Skip to main content
summaryrefslogtreecommitdiffstats
path: root/jpa
diff options
context:
space:
mode:
authornhauge2012-04-10 13:21:39 +0000
committernhauge2012-04-10 13:21:39 +0000
commit65a36b20353b9b061b130a3662217d4fe6a8d857 (patch)
tree60532ed6c933046b7fca38f4925290e744bdf519 /jpa
parenta8195d55f03af975249fbb9fe5cc9c90a13fbb25 (diff)
downloadwebtools.dali-201204100000.tar.gz
webtools.dali-201204100000.tar.xz
webtools.dali-201204100000.zip
This commit was manufactured by cvs2svn to create tag 'v201204100000'.v201204100000
Diffstat (limited to 'jpa')
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink.feature/.project5
-rw-r--r--jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project5
-rw-r--r--jpa/features/org.eclipse.jpt.feature/.project5
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/build.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.properties43
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.xml91
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/build.properties21
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/build.properties21
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/build.properties7
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.properties51
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.xml32
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.cvsignore3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/build.properties5
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.properties43
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.xml30
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/build.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/feature.properties43
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/feature.xml121
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/build.properties12
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/build.properties14
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/feature.properties48
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.html27
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.ini31
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.mappings6
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.properties26
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/build.properties12
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.gifbin1706 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.pngbin4634 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/epl-v10.html328
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/license.html86
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/plugin.properties13
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/.cvsignore1
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/build.properties7
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.properties51
-rw-r--r--jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.xml38
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/.cvsignore3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/.project17
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/build.properties5
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/eclipse_update_120.jpgbin21695 -> 0 bytes
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.properties43
-rw-r--r--jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.xml37
-rw-r--r--jpa/features/org.eclipse.jpt.tests.feature/.project5
-rw-r--r--jpa/features/org.eclipse.jpt_sdk.feature/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.branding/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.core/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.db.ui/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.db/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF9
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/about.htm43
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/about.html43
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/build.properties136
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml44
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml88
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm43
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm60
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml646
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css21
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm11
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm80
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm105
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm204
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.pngbin14825 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.pngbin11473 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.pngbin4148 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.pngbin21428 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.pngbin21454 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/customize_default_entity_generation.pngbin27589 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/customize_individual_entities.pngbin24998 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.pngbin10563 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.pngbin13762 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/generate_classes_from_schema.pngbin16127 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.pngbin11583 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapmappings.pngbin361 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.pngbin476 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.pngbin11615 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.pngbin3359 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.pngbin8101 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.pngbin8380 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/jaxb_schmea_generation_dialog.pngbin18846 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.pngbin7864 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.pngbin14896 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.pngbin19392 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.pngbin15128 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.pngbin14985 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.pngbin15162 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/modify_faceted_project.pngbin28047 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.pngbin332 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.pngbin700 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.pngbin477 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.pngbin321 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.pngbin461 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.pngbin311 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.pngbin316 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.pngbin682 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.pngbin681 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.pngbin325 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.pngbin270 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.pngbin303 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.pngbin373 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.pngbin27810 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.pngbin387 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.pngbin26056 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.pngbin667 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.pngbin615 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.pngbin568 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.pngbin8746 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.pngbin29075 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.pngbin9676 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.pngbin4408 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.pngbin20222 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.pngbin20446 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.pngbin22231 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_jaxb_schema_wizard.pngbin20015 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/select_tables.pngbin21639 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.pngbin10643 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/table_associations.pngbin26207 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.pngbin9169 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.pngbin9338 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/img/upgrade_persistence_jpa_version.pngbin5208 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/index.xml668
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/legal.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties32
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml37
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityClassPage.htm115
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityPropertiesPage.htm117
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_add_converter.htm78
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_association_cardinality.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_association_table.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_configure_jaxb_class_generation_dialog.htm77
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_create_custom_entities_wizard.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_create_jpa_entity_wizard.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_create_new_association_wizard.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_customizIndividualEntities.htm89
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_customizeDefaultEntityGeneration.htm96
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm56
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_eclipselink_mapping_file.htm81
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_java_page.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_jaxb_schema_wizard.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_join_columns.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm122
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm272
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm104
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_general.htm126
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm56
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_xmll_editor.htm82
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm142
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm98
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_schema_from_classes_page.htm42
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_selectTables.htm79
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_select_cascade_dialog.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/ref_tableAssociations.htm78
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference.htm60
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm52
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm122
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm80
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm48
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm113
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm47
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm82
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm71
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm98
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm106
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm116
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm76
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm183
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm221
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm185
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm241
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm170
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm143
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm108
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm49
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm67
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm46
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm125
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm62
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm53
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm60
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm84
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_create_jpa_entity.htm160
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm141
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_generate_classes_from_schema.htm55
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_generating_schema_from_classes.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm138
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm64
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm222
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm77
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm81
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm85
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm74
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm43
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm58
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm96
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm70
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm84
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm183
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm97
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm91
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm176
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm179
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm167
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm197
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm146
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm66
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm136
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm40
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm95
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm61
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm92
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tasks026.htm63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm68
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/toc.xml155
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm51
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm63
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm41
-rw-r--r--jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm39
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.core/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.gen/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jaxb.ui/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/.cvsignore2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/META-INF/MANIFEST.MF7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/about.ini44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/about.mappings6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/about.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/component.xml14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.branding/plugin.properties13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/META-INF/MANIFEST.MF15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/build.properties16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db.ui/src/org/eclipse/jpt/jpa/db/ui/internal/DTPUiTools.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/.classpath11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/META-INF/MANIFEST.MF20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/build.properties16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/plugin.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Catalog.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Column.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionAdapter.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionListener.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfile.java219
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileAdapter.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileFactory.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileListener.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Database.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseIdentifierAdapter.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseObject.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ForeignKey.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/JptJpaDbPlugin.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Schema.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/SchemaContainer.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Sequence.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Table.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPCatalogWrapper.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPColumnWrapper.java235
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java537
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObject.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObjectWrapper.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseWrapper.java358
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPForeignKeyWrapper.java337
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaContainerWrapper.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaWrapper.java338
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSequenceWrapper.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPTableWrapper.java412
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/AbstractDTPDriverAdapter.java488
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/CatalogStrategy.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DB2.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapter.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterFactory.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterManager.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Derby.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FauxCatalogStrategy.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FoldingStrategy.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/HSQLDB.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Informix.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/LowerCaseFoldingStrategy.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MaxDB.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MySQL.java311
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NoCatalogStrategy.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NonFoldingStrategy.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Oracle.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/PostgreSQL.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SQLServer.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Sybase.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Unknown.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UnknownCatalogStrategy.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UpperCaseFoldingStrategy.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.project22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/META-INF/MANIFEST.MF7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.ini44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.mappings6
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/component.xml9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/icons/WTP_icon_x32_v2.pngbin5616 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/plugin.properties13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.classpath7
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/META-INF/MANIFEST.MF12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/about.html47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/build.properties16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/plugin.properties23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java181
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.classpath20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/build.properties20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel630
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore806
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml205
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/jpt_jpa_eclipselink_core.properties11
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkJpaProject.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkMappingKeys.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/JptJpaEclipseLinkCorePlugin.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/builder/EclipselinkStaticWeavingBuilder.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/builder/StaticWeavingBuilderConfigurator.java241
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessMethodsHolder.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessType.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkArrayMapping2_3.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheCoordinationType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheIsolationType2_2.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheType.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java237
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTracking.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTrackingType.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConversionValue.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverter.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterClassConverter.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterContainer.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvertibleMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomConverter.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkElementCollectionMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEmbeddable.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEntity.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkExistenceType.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetch.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchType.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkManyToManyMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMappedSuperclass.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenancy2_3.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenantType2_3.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutable.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkObjectTypeConverter.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship2_0.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwned.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnly.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnlyAccessMethodsHolder.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkRelationshipMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructConverter.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructureMapping2_3.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTimeOfDay.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTransformationMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeConverter.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeMapping.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/ReadOnlyTenantDiscriminatorColumn2_3.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/TenantDiscriminatorColumn2_3.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/VirtualTenantDiscriminatorColumn2_3.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaConvertibleMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaTypeMapping.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkCaching.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEntity.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMultitenancy2_3.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkNonEmbeddableTypeMapping.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkPersistentAttribute.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaReadOnlyTenantDiscriminatorColumn2_3.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaTenantDiscriminatorColumn2_3.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaVirtualTenantDiscriminatorColumn2_3.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkEntityMappings.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmConvertibleMapping.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship2_0.java30
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmPersistentType.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmTypeMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkPersistenceUnitDefaults.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkCaching.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkConverterContainer.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEntity.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMultitenancy2_3.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkNonEmbeddableTypeMapping.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmReadOnlyTenantDiscriminatorColumn2_3.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmTenantDiscriminatorColumn2_3.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmVirtualTenantDiscriminatorColumn2_3.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/BatchWriting.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CacheType.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Caching.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CachingEntity.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection2_0.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Customization.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CustomizationEntity.java110
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/DdlGenerationType.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java1325
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/ExclusiveConnectionMode.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/FlushClearCache.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/GeneralProperties.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logger.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging2_0.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/LoggingLevel.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options2_0.java20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/OutputMode.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Profiler.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/SchemaGeneration.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetDatabase.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetServer.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Weaving.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/AbstractEclipseLink2_0JpaPlatformProvider.java180
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformFactory.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformProvider.java187
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaAnnotationDefinitionProvider.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformFactory.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformProvider.java190
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaAnnotationDefinitionProvider.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaFactory.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformFactory.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformProvider.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaAnnotationDefinitionProvider.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformFactory.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformProvider.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaAnnotationDefinitionProvider.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformFactory.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformProvider.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaAnnotationDefinitionProvider.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformFactory.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformProvider.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformFactory.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformProvider.java155
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaFactory.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaJpqlQueryHelper.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java183
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/JptJpaEclipseLinkCoreMessages.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/AbstractEclipseLinkTypeMappingValidator.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkConvertValidator.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkDynamicTypeMappingValidator.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassValidator.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkPersistentAttributeValidator.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkTypeMappingValidator.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/TenantDiscriminatorColumnValidator2_3.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaArrayMappingDefinition2_3.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_2.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_0.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_2.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_2.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition2_2.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition2_2.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_3.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_0.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_2.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_2.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_2.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_0.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_2.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_2.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyRelationship.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_2.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaStructureMappingDefinition2_3.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTenantDiscriminatorColumn2_3.java281
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTimeOfDay.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition2_0.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_0.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_2.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkArrayMapping2_3.java332
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java655
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java171
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterClassConverter.java185
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java474
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java209
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java170
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedIdMapping.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedMapping.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java290
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java268
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java764
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java177
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java348
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructureMapping2_3.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/NullJavaEclipseLinkMultitenancy2_3.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/SpecifiedJavaEclipseLinkPersistentAttribute.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java609
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyRelationship.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentTypeImpl.java324
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTenantDiscriminatorColumn2_3.java270
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTimeOfDay.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_1Definition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_2Definition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0Definition.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1Definition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_2Definition.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3ContextNodeFactory.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3Definition.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_4Definition.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/GenericOrmVirtualTenantDiscriminatorColumn2_3.java196
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/NullOrmEclipseLinkMultitenancy2_3.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3.java369
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3Definition.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java21
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping2_1.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java805
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java172
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterClassConverter.java224
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterContainerImpl.java624
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java319
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java288
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedIdMapping.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedMapping.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java476
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java422
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java795
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java485
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java213
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitDefaults.java374
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitMetadata.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java143
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3Definition.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java269
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java209
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java395
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java350
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java586
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection.java676
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection2_0.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCustomization.java870
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkGeneralProperties.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging.java408
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging2_0.java328
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions.java443
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions2_0.java345
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkSchemaGeneration.java231
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java467
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLink2_0DDLGenerator.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkEclipseLinkBundlesLibraryValidator.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkUserLibraryValidator.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkArray2_3AnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverters2_2AnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMapKeyConvert2_0AnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMultitenant2_3AnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverters2_2AnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverters2_2AnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructure2_3AnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverters2_2AnnotationDefinition.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkMultitenantAnnotation2_3.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkArrayAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBaseConvertAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBaseTypeConverterAnnotation.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java336
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMapKeyConvertAnnotation2_0.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation2_3.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructureAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkArrayAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBaseConvertAnnotation.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBaseTypeConverterAnnotation.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java575
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java192
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java151
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMapKeyConvertAnnotation2_0.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMultitenantAnnotation2_3.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructureAnnotation.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java308
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java249
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java160
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java149
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/weave/StaticWeave.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicEmbeddable.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicEntity.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicManagedType.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMappedSuperclass.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMapping.java249
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicType.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkManagedTypeBuilder.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkMapping.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkMappingBuilder.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheCoordinationType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheIsolationType2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheType.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ChangeTrackingType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLink.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkArrayAnnotation2_3.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBaseConvertAnnotation.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBaseTypeConverterAnnotation.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java239
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkClassExtractorAnnotation2_1.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMapKeyConvertAnnotation2_0.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMultitenantAnnotation2_3.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructureAnnotation2_3.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ExistenceType.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/JoinFetchType.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/MultitenantType2_3.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/Attributes.java535
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheCoordinationType.java295
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheType.java373
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLink.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java1199
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java13044
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/ExistenceType.java295
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethods.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAdditionalCriteria.java221
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java1303
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java1564
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java526
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java526
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetch.java300
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetchHolder.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCache.java1029
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheHolder.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheIndex.java201
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTracking.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingType.java291
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java299
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCollectionTable.java265
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConversionValue.java314
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverter.java256
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverterContainer.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertibleMapping.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCopyPolicy.java226
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizer.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizerHolder.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlDirection.java294
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java2317
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddable.java1611
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java460
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java460
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntity.java3797
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java1368
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchAttribute.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchGroup.java360
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlHashPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java1110
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlIndex.java563
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetch.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetchType.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinTable.java265
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java2041
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java1552
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMappedSuperclass.java4020
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java404
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenantHolder.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMutable.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedConverter.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredFunctionQuery.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredProcedureQuery.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredFunctionQuery.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java644
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlObjectTypeConverter.java487
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java2220
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java1717
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLocking.java373
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLockingType.java294
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOrderColumn.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPartitioning.java224
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java374
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java233
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPinnedPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlRecord.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlTable.java215
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrimaryKey.java406
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrivateOwned.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlProperty.java362
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPropertyContainer.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryContainer.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryRedirectors.java654
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRangePartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReadOnly.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReplicationPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReturnInsert.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRoundRobinPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlSecondaryTable.java262
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java590
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStruct.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructConverter.java260
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java468
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTable.java264
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTableGenerator.java274
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java414
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTimeOfDay.java446
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java463
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java436
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeConverter.java349
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeMapping.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlUnionPartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlValuePartitioning.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java1374
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java990
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java696
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java257
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java1533
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java257
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java266
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java258
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkAccessType.java22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java192
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java1975
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlTypeMapping_2_1.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/CacheIsolationType.java257
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLink2_2.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Factory.java170
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Package.java4616
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlAdditionalCriteria_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicCollection_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicMap_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasic_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCache_2_2.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCollectionTable_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlElementCollection_2_2.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEmbeddable_2_2.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntityMappings_2_2.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntity_2_2.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlHashPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlId_2_2.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlIndex_2_2.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlJoinTable_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToMany_2_2.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToOne_2_2.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlMappedSuperclass_2_2.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToMany_2_2.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToOne_2_2.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioningGroup_2_2.java281
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPinnedPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRangePartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlReplicationPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRoundRobinPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlSecondaryTable_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTableGenerator_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTable_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlUnionPartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlValuePartitioning_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVariableOneToOne_2_2.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVersion_2_2.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java2607
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/MultitenantType.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlArray_2_3.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlAttributes_2_3.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlElementCollection_2_3.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEmbeddable_2_3.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntityMappings_2_3.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntity_2_3.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMappedSuperclass_2_3.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedStoredFunctionQuery_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPersistenceUnitDefaults_2_3.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlRecord_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlTable_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStruct_2_3.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStructure_2_3.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/DatabaseChangeNotificationType.java230
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Factory.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Package.java1099
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlBasic_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCacheIndex_2_4.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCache_2_4.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlElementCollection_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlEntity_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlId_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMappedSuperclass_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMultitenant_2_4.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlOneToMany_2_4.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.classpath15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/META-INF/MANIFEST.MF62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.properties37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml308
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui.properties409
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_details.properties171
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_dynamic_entity_gen.properties14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/JptJpaEclipseLinkUiPlugin.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/EclipseLinkHelpContextIds.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/EclipseLinkUiMessages.java424
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/GenerateDynamicEntitiesHandler.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/JavaConverterConversionHandler.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/GenerateDDLWizard.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/GenerationOutputModeWizardPage.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkArrayMapping2_3UiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkBasicCollectionMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkBasicMapMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkStructureMapping2_3UiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkTransformationMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkVariableOneToOneMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLink2_4ProjectFlagModel.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAlwaysRefreshComposite.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkArrayMapping2_3Composite.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicCollectionMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMapMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java209
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheCoordinationTypeComposite.java113
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheSizeComposite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheTypeComposite.java119
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCaching2_0Composite.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkChangeTrackingComposite.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java209
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueStateObject.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java251
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java386
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java163
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomizerComposite.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkDisableHitsComposite.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMapping2_0Composite.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkEmbeddableAdvancedComposite.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkEntityAdvancedComposite.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java337
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToOneMappingComposite.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMappedSuperclassAdvancedComposite.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMultitenancyComposite.java399
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMutableComposite.java100
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java494
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToManyJoiningStrategyPane.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToManyMappingComposite.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToOneMappingComposite.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkPrivateOwnedComposite.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkReadOnlyComposite.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkRefreshOnlyIfNewerComposite.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructConverterComposite.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructureMapping2_3Composite.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTransformationMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTypeConverterComposite.java210
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java188
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVariableOneToOneMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnComposite.java403
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnsComposite.java344
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEmbeddableComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntity2_xComposite.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntityComposite.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkMappedSuperclassComposite.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToManyMappingUiDefinition.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToOneMappingUiDefinition.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink1_2JavaResourceUiDefinition.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink1_2JavaUiFactory.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_0JavaResourceUiDefinition.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_0JavaUiFactory.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_3JavaResourceUiDefinition.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_3JavaUiFactory.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLinkJavaResourceUiDefinition.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLinkJavaUiFactory.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkArrayMapping2_3UiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicCollectionMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMapMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMappingComposite.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkCaching2_0Composite.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkCachingComposite.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkElementCollectionMapping2_0Composite.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddable1_2Composite.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddableComposite.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity1_2Composite.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_0Composite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_3Composite.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntityComposite.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkExistenceCheckingComposite.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMapping2_0Composite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMapping2_0UiDefinition.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMappingComposite.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToManyMapping2_0Composite.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToOneMapping2_0Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass1_2Composite.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_0Composite.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_3Composite.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclassComposite.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToOneMapping2_0Composite.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkStructureMapping2_3UiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkTransformationMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVariableOneToOneMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVersionMappingComposite.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntity2_xComposite.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLink2_3PersistenceUnitMetadataComposite.java213
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java192
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsPage.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsProvider.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsPage.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsProvider.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite.java246
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_1UiDefinition.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_1UiFactory.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_2UiDefinition.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiDefinition.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiFactory.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_1UiDefinition.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_1UiFactory.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_2UiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_3UiDefinition.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_3UiFactory.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_4UiDefinition.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmAttributeTypeComposite.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkArrayMapping2_3UiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMapping1_1Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMapping1_1Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCaching2_0Composite.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_0Composite.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping2_0Composite.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_0Composite.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_3Composite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping1_1Composite.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping2_0Composite.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping1_1Composite.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping2_0Composite.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_0Composite.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_1Composite.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_3Composite.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping1_1Composite.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping2_0Composite.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkStructureMapping2_3UiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/dialogs/AddVirtualAttributeDialog.java334
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/handlers/AddVirtualAttributeHandler.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiFactory.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheDefaultsComposite.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheSizeComposite.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheTypeComposite.java181
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultCacheSizeComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultCacheTypeComposite.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultSharedCacheComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EntityCachingPropertyComposite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EntityListComposite.java212
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/PersistenceXmlCachingTab.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/SharedCacheComposite.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/BatchWritingComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java135
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/ConnectionPropertiesComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/DataSourcePropertiesComposite.java146
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkConnectionComposite.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcBindParametersComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcConnectionPropertiesComposite.java342
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcDriverComposite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionModeComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionsPropertiesComposite.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcLazyConnectionComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcPropertiesComposite.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionPropertiesComposite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMaxComposite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMinComposite.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsSharedComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionPropertiesComposite.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMaxComposite.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMinComposite.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/NativeSqlComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/PersistenceXmlConnectionTab.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/TransactionTypeComposite.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/CustomizerComposite.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EntityCustomizationPropertyComposite.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EntityListComposite.java212
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/PersistenceXmlCustomizationTab.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ProfilerComposite.java207
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/SessionCustomizersComposite.java192
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ThrowExceptionsComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ValidateSchemaComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingChangeTrackingComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingEagerComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingFetchGroupsComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingInternalComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingLazyComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingPropertiesComposite.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralComposite.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitJarFilesComposite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitMappingFilesComposite.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/ExceptionsComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggerComposite.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggingFileLocationComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggingLevelComposite.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/PersistenceXmlLoggingTab.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/SessionComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/ThreadComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/TimestampComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EclipseLinkOptionsComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EventListenerComposite.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/IncludeDescriptorQueriesComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/PersistenceXmlOptionsTab.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/SessionNameComposite.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java232
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TargetServerComposite.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TemporalMutableComposite.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationLocationComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationTypeComposite.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/EclipseLinkSchemaGenerationComposite.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/OutputModeComposite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/PersistenceXmlSchemaGenerationTab.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistencexml/details/EclipseLinkPersistenceUnitItemContentProvider.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/AbstractEclipseLinkJpaPlatformUi.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_0JpaPlatformUi.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_1JpaPlatformUiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_1JpaPlatformUiProvider.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_2JpaPlatformUiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_2JpaPlatformUiProvider.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUi.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUiProvider.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_1JpaPlatformUiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_1JpaPlatformUiProvider.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_2JpaPlatformUiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_2JpaPlatformUiProvider.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_3JpaPlatformUiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_3JpaPlatformUiProvider.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_4JpaPlatformUiFactory.java31
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_4JpaPlatformUiProvider.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUi.java19
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiFactory.java40
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiProvider.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkNavigatorItemContentProviderFactory.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceStructureItemContentProviderFactory.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceUnitItemContentProvider.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLink2_0PersistenceXmlUiFactory.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/CacheDefaults2_0Composite.java88
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/EclipseLinkCaching2_0Composite.java74
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/FlushClearCache2_0Composite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/PersistenceXmlCaching2_0Tab.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/customization/EclipseLinkCustomization2_0Composite.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/customization/PersistenceXmlCustomization2_0Tab.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkCategoryLoggingLevelComposite.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/PersistenceXmlLogging2_0Tab.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/EclipseLinkOptions2_0Composite.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/LockingConfigurationComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/PersistenceXmlOptions2_0Tab.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/QueryConfigurationComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/ValidationConfigurationComposite.java382
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/ValidationModeComposite.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/weave/EclipselinkPreferencePage.java498
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizard.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/EmbeddedEclipseLinkMappingFileWizard.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/SelectEclipseLinkMappingFileDialog.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaConverterConversionWizardPage.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaGeneratorConversionWizardPage.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaMetadataConversionWizardPage.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaQueryConversionWizardPage.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicDefaultTableGenerationWizardPage.java181
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicTableGenPanel.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicTablesAndColumnsCustomizationWizardPage.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/GenerateDynamicEntitiesFromSchemaWizard.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/JptJpaEclipseLinkUiEntityGenMessages.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/.classpath8
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/.project28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/META-INF/MANIFEST.MF25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/build.properties18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/plugin.properties23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/property_files/jpt_gen.properties20
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/Association.java388
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/AssociationRole.java277
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/BaseEntityGenCustomizer.java278
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/DatabaseAnnotationNameBuilder.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptGenMessages.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptJpaGenPlugin.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java419
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenCustomizer.java884
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenTable.java1037
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/OverwriteConfirmer.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/PackageGenerator.java493
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/TagNames.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/CompilationUnitModifier.java131
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/DTPUtil.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/EntityGenTools.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/FileUtil.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/ForeignKeyInfo.java120
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/StringUtil.java648
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/UrlUtil.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/column.vm54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/join.vm81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/main.java.vm134
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToMany.vm26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToOne.vm13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/mappingKind.vm34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToMany.vm18
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToOne.vm22
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/pk.java.vm65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/basic.vm3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/column.vm29
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/embeddable.vm9
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/embeddedBasic.vm3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/footer.vm2
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/header.vm4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/id.vm26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/join.vm50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/main.xml.vm38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/manyToMany.vm34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/manyToOne.vm16
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/oneToMany.vm32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/version.vm3
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/.classpath13
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/.cvsignore1
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/.jetproperties4
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/.options14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/.project34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF99
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/about.html34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/build.properties24
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/component.xml12
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_entity_wiz.gifbin594 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpa_file_wiz.gifbin359 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpaproject_wiz.gifbin372 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/jpa_facet.gifbin896 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_entity_wiz.gifbin624 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpa_file_wiz.gifbin586 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpaproject_wiz.gifbin991 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_details.gifbin953 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_perspective.gifbin896 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_structure.gifbin900 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/basic.gifbin897 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/element-collection.gifbin872 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embeddable.gifbin1003 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded-id.gifbin953 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded.gifbin905 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity-mappings.gifbin974 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity.gifbin1010 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/id.gifbin938 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-content.gifbin896 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-file.gifbin968 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-jar-file.gifbin1013 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.function.gifbin261 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.identifier.gifbin627 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.variable.gifbin99 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-many.gifbin328 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-one.gifbin307 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/mapped-superclass.gifbin1005 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-attribute-mapping.gifbin911 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-type-mapping.gifbin586 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-many.gifbin306 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-one.gifbin283 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence-unit.gifbin931 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence.gifbin961 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/transient.gifbin892 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/version.gifbin321 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/warning.gifbin338 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_entity_wizban.gifbin3316 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_file_wizban.gifbin3070 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_prj_wiz.gifbin2791 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add-connection.gifbin920 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add.pngbin1000 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse-mini.pngbin448 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse.pngbin1072 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/collapse-all.pngbin989 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/delete.pngbin1059 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/deselect-all.pngbin1050 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/dot.gifbin121 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/edit.pngbin380 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/expand-all.pngbin1004 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/list-of-values.pngbin1072 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-down.pngbin305 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-up.pngbin284 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/reconnect.pngbin1022 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/refresh.gifbin327 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/restore-defaults.pngbin1057 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/select-all.pngbin1096 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/warningstd.pngbin993 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img-hover.pngbin1222 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img.pngbin1047 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_left_bg.pngbin232 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_mid_bg.pngbin190 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_right_bg.pngbin232 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print-hover.pngbin1219 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print.pngbin1051 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-bottom.pngbin928 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-left.pngbin978 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-right.pngbin989 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-side.pngbin924 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-upper-right.pngbin976 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/toolbar_bg.pngbin196 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/column.gifbin113 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/columnKey.gifbin1715 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/file.pngbin456 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/folder.pngbin310 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/forward.gifbin138 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/moveRight.gifbin138 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/package.pngbin319 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table.gifbin953 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table_obj.gifbin561 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/error.gifbin82 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/warning.pngbin322 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/images/save-image-16.pngbin508 -> 0 bytes
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.properties78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml1228
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui.properties204
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details.properties325
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details2_0.properties58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details_orm.properties49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_entity_gen.properties115
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_entity_wizard.properties58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_jpql_identifiers.properties83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_persistence.properties56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_persistence2_0.properties60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_validation_preferences.properties297
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/schema/jpaPlatformUis.exsd139
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaFileModel.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUi.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUiFactory.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUiProvider.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectModel.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectsModel.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaRootContextNodeModel.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JptJpaUiPlugin.java300
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/MappingResourceUiDefinition.java73
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/PersistenceXmlResourceUiDefinition.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/ResourceUiDefinition.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/DefaultMappingUiDefinition.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsPageManager.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsProvider.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaPageComposite.java47
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaAttributeMappingUiDefinition.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaTypeMappingUiDefinition.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaAttributeMappingUiDefinition.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaTypeMappingUiDefinition.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaUiFactory.java265
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmAttributeMappingUiDefinition.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmTypeMappingUiDefinition.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmXmlUiFactory.java220
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractJpaPlatformUiProvider.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractJpaXmlCompletionProposalComputer.java1097
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/DefaultJpaXmlCompletionProposalComputer.java223
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/FileAdapterFactory.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/GenericJpaPlatformUiProvider.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/ImageRepository.java154
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaHelpContextIds.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaJavaCompletionProposalComputer.java196
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaMappingImageHelper.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaPlatformAdapterFactory.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaStructureNodeAdapterFactory.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaXmlCompletionProposalComputer.java259
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiIcons.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiMessages.java196
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiValidationPreferenceMessages.java329
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/ProjectAdapterFactory.java167
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/WorkspaceAdapterFactory.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/GenerateDDLAction.java27
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/GenerateEntitiesAction.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/MakePersistentAction.java150
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/OpenJpaResourceAction.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/ProjectAction.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/SynchronizeClassesAction.java242
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AbstractJavaMetadataConversionHandler.java93
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentAttributeToXmlAndMapHandler.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentAttributeToXmlHandler.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentClassHandler.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/ConvertJavaProjectToJpaCommandHandler.java165
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/JavaGeneratorConversionHandler.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/JavaQueryConversionHandler.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/PersistentAttributeMapAsHandler.java184
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/PersistentTypeMapAsHandler.java124
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/RemovePersistentAttributeFromXmlHandler.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/RemovePersistentClassHandler.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/UpgradeXmlFileVersionHandler.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingComposite.java217
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableComposite.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingComposite.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingComposite.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingOverridesComposite.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityComposite.java216
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityMappingsDetailsProvider.java32
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityOverridesComposite.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingComposite.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingUiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractInheritanceComposite.java246
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJavaMappedSuperclassComposite.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJoiningStrategyPane.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJpaDetailsPage.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingComposite.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingComposite.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassComposite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappingUiDefinition.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingComposite.java132
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingComposite.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOrderingComposite.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOverridesComposite.java412
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractPrimaryKeyJoinColumnsComposite.java331
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractSecondaryTablesComposite.java178
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractTransientMappingUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingComposite.java161
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingUiDefinition.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AccessTypeComposite.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AddQueryDialog.java195
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AddQueryStateObject.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AssociationOverrideComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AttributeOverrideComposite.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialog.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialogPane.java442
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnStateObject.java389
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BasicMappingComposite.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/CascadeComposite.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ColumnComposite.java554
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/DiscriminatorColumnComposite.java314
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingComposite.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedMappingComposite.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedMappingOverridesComposite.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EntityNameComposite.java122
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EntityOverridesComposite.java25
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EnumTypeComposite.java118
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/FetchTypeComposite.java112
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GeneratedValueComposite.java232
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GenerationComposite.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GeneratorComposite.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdClassComposite.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdMappingComposite.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdMappingGenerationComposite.java348
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableDialog.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableStateObject.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialog.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialogPane.java286
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInJoiningStrategyDialog.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInJoiningStrategyStateObject.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableDialog.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableStateObject.java87
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnStateObject.java212
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnsComposite.java329
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableComposite.java404
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableJoiningStrategyPane.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsComposite.java200
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsWithOverrideOptionComposite.java152
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JptUiDetailsMessages.java304
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyJoiningStrategyPane.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyMappingComposite.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToOneJoiningStrategyPane.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToOneMappingComposite.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MapAsComposite.java626
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByJoiningStrategyPane.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByPane.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/NamedNativeQueryPropertyComposite.java190
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/NamedQueryPropertyComposite.java140
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToManyJoiningStrategyPane.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToManyMappingComposite.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToOneJoiningStrategyPane.java96
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToOneMappingComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OptionalComposite.java102
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OrderingComposite.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPage.java182
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeMapAsComposite.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPage.java169
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeMapAsComposite.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnDialog.java108
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableStateObject.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnStateObject.java101
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java401
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java314
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueryHintsComposite.java340
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java421
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/SecondaryTableDialog.java450
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/SequenceGeneratorComposite.java136
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableComposite.java239
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableGeneratorComposite.java499
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TargetEntityComposite.java139
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeComposite.java143
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TransientMappingComposite.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/VersionMappingComposite.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/CatalogCombo.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/ColumnCombo.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/DatabaseObjectCombo.java349
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/SchemaCombo.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/SequenceCombo.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/TableCombo.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/BaseJavaUiFactory.java173
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultBasicMappingUiDefinition.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultEmbeddedMappingUiDefinition.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/GenericJavaResourceUiDefinition.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/GenericJavaUiFactory.java23
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaBasicMappingUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableUiDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedIdMappingUDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedMappingUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityComposite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaIdMappingUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaInheritanceComposite.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToManyMappingUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToOneMappingUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassComposite.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToManyMappingUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToOneMappingUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsPage.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsProvider.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentTypeDetailsProvider.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPrimaryKeyJoinColumnsComposite.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaSecondaryTablesComposite.java129
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaTransientMappingUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaVersionMappingUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaAttributeMappingUiDefinition.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaTypeMappingUiDefinition.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPage.java222
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmEntityComposite.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmXmlResourceUiDefinition.java174
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorDialog.java194
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorStateObject.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/BaseOrmXmlUiFactory.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsPage.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsProvider.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java371
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/GenericOrmXmlUiFactory.java15
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/JptUiDetailsOrmMessages.java70
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/MetadataCompleteComposite.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingComposite.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingUiDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableComposite.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableUiDefinition.java54
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingComposite.java39
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingComposite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityComposite.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingComposite.java36
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmInheritanceComposite.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmJavaClassChooser.java117
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingComposite.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingComposite.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassComposite.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassUiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappingNameChooser.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingComposite.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingComposite.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPackageChooser.java98
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsPage.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsProvider.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentTypeDetailsProvider.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPrimaryKeyJoinColumnsComposite.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmQueriesComposite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmSecondaryTablesComposite.java211
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmTransientMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingComposite.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingUiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java92
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java267
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/UnsupportedOrmMappingUiDefinition.java89
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java197
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/dialogs/AddPersistentClassDialog.java314
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/editors/PersistenceContributor.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/editors/PersistenceEditor.java435
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jface/XmlMappingFileViewerFilter.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Generic2_0JpaPlatformUiProvider.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/GenericOrmXml2_0UiFactory.java147
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Jpa2_0FlagTransformer.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Jpa2_0XmlFlagModel.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java381
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0UiDefinition.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractManyToOneMapping2_0Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractOneToOneMapping2_0Composite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AssociationOverride2_0Composite.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Cacheable2_0Pane.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CascadePane2_0.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CollectionTable2_0Composite.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java200
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ElementCollectionValueOverridesComposite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedIdMapping2_0Composite.java37
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedIdMapping2_0MappedByRelationshipPane.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedMapping2_0OverridesComposite.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Entity2_0OverridesComposite.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Generation2_0Composite.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/IdMapping2_0MappedByRelationshipPane.java71
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/IdMappingGeneration2_0Composite.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/LockModeComposite.java104
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ManyToOneJoiningStrategy2_0Pane.java84
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/NamedQueryProperty2_0Composite.java148
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OneToManyJoiningStrategy2_0Pane.java95
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OneToOneJoiningStrategy2_0Pane.java115
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OrderColumnComposite.java334
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Ordering2_0Composite.java156
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java111
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Queries2_0Composite.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/SequenceGenerator2_0Composite.java190
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/TargetClassComposite.java138
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/Generic2_0JavaResourceUiDefinition.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java134
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaElementCollectionMapping2_0UiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddable2_0Composite.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddedMapping2_0Composite.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEntity2_0Composite.java105
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaIdMapping2_0Composite.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Composite.java42
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Pane.java14
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaMappedSuperclass2_0Composite.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToOneMapping2_0Composite.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsPage.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsProvider.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappingsGenerators2_0Composite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmBasicMapping2_0Composite.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0Composite.java59
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0UiDefinition.java56
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedIdMapping2_0Composite.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedMapping2_0Composite.java77
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEntity2_0Composite.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmIdMapping2_0Composite.java58
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToOneMapping2_0Composite.java57
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToOneMapping2_0Composite.java76
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmQueries2_0Composite.java43
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmVersionMapping2_0Composite.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmXml2_0UiDefinition.java97
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/Generic2_0PersistenceXmlUiFactory.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/JptUiPersistence2_0Messages.java82
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceXml2_0UiDefinition.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/ConnectionPropertiesComposite.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/DataSourcePropertiesComposite.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/GenericPersistenceUnit2_0ConnectionComposite.java49
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/GenericPersistenceUnit2_0ConnectionTab.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcConnectionPropertiesComposite.java314
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcDriverComposite.java94
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcPropertiesComposite.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/TransactionTypeComposite.java130
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/GenericPersistenceUnit2_0OptionsComposite.java63
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/GenericPersistenceUnit2_0OptionsTab.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/LockingConfigurationComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/QueryConfigurationComposite.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/SharedCacheModeComposite.java107
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/ValidationConfigurationComposite.java384
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/ValidationModeComposite.java103
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/platform/generic/Generic2_0JpaPlatformUiFactory.java34
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlContentProposalProvider.java700
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlJavaCompletionProposalComputer.java325
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlSseCompletionProposalComputer.java218
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlCompletionProposal.java158
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlCompletionProposalComputer.java448
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlIdentifierMessages.java186
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/TextTransferHandler.java228
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/listeners/SWTConnectionListenerWrapper.java337
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/MapAsContribution.java203
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentAttributeMapAsContribution.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentTypeMapAsContribution.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorActionProvider.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorContentProvider.java72
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorItemContentProviderFactory.java85
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorItemLabelProviderFactory.java79
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/RootContextNodeModelItemContentProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/RootContextNodeModelItemLabelProvider.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/JptUiPersistenceMessages.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/AbstractPersistenceXmlResourceUiDefinition.java50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/ArchiveFileSelectionDialog.java225
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitGeneralComposite.java116
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitJarFilesComposite.java26
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitMappingFilesComposite.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceXmlUiFactory.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitClassesComposite.java375
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionComposite.java144
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionDatabaseComposite.java159
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionGeneralComposite.java109
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitGeneralComposite.java230
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitJarFilesComposite.java224
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitMappingFilesComposite.java250
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitPropertiesComposite.java418
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceXmlUiDefinition.java61
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceXmlUiFactory.java38
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/perspective/JpaPerspectiveFactory.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/JpaPlatformUiRegistry.java190
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractJpaPlatformUi.java233
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/EntitiesGenerator.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/ClassRefItemLabelProvider.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericJpaPlatformUi.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericJpaPlatformUiFactory.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericNavigatorItemContentProviderFactory.java90
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericNavigatorItemLabelProviderFactory.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JarFileRefItemLabelProvider.java64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JavaPersistentTypeItemContentProvider.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/MappingFileRefItemLabelProvider.java66
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmPersistentTypeItemContentProvider.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmXmlItemContentProvider.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemContentProvider.java198
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemLabelProvider.java162
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceXmlItemContentProvider.java68
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentAttributeItemLabelProvider.java78
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentTypeItemLabelProvider.java69
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaEntityGenPreferencePage.java145
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaPreferencesPage.java301
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaProblemSeveritiesPage.java936
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JptPreferencesPage.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/properties/DataModelPropertyPage.java309
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/properties/JpaProjectPropertiesPage.java1726
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaPageManager.java296
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaTextEditorManager.java336
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaWindowManager.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaWorkbenchManager.java251
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/TextEditorAdapterFactory.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/ViewPartAdapterFactory.java52
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/WorkbenchAdapterFactory.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/WorkbenchWindowAdapterFactory.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/EntityMappingsItemContentProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemContentProviderFactory.java67
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemLabelProviderFactory.java35
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaFileItemContentProvider.java51
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/MappingStructureItemLabelProviderFactory.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemContentProviderFactory.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemLabelProviderFactory.java65
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceItemContentProvider.java55
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemContentProviderFactory.java91
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemLabelProviderFactory.java106
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceUnitItemContentProvider.java176
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaDetailsView.java318
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructurePage.java514
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructureView.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/DatabaseSchemaWizardPage.java446
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetActionPage.java214
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetInstallPage.java248
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetVersionChangePage.java44
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizard.java83
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizardPage.java906
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/NewEntityDropDownAction.java261
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/SelectMappingFileDialog.java142
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaGeneratorConversionWizardPage.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaMetadataConversionWizardPage.java46
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaQueryConversionWizardPage.java48
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizard.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizardPage.java625
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/AnnotatedEntityTemplate.java166
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityClassWizardPage.java405
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityFieldsWizardPage.java234
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityRowTableWizardSection.java822
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityTemplate.java126
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityWizard.java153
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityWizardMsg.java127
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/IdClassTemplate.java255
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/CreateEntityTemplateModel.java391
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/EntityDataModelProvider.java506
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/EntityRow.java206
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/IEntityDataModelProperties.java33
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/operation/NewEntityClassOperation.java574
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationFigure.java227
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationTablesPage.java208
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationsListComposite.java137
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/CardinalityPage.java161
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/CascadeDialog.java191
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/ColumnGenPanel.java368
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DatabaseGroup.java551
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DefaultTableGenerationWizardPage.java340
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/GenerateEntitiesFromSchemaWizard.java509
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/JoinColumnsPage.java629
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/JptUiEntityGenMessages.java128
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/NewAssociationWizard.java199
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/NewAssociationWizardPage.java60
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/PromptJPAProjectWizardPage.java157
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/SWTUtil.java133
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/SelectTableDialog.java75
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableAssociationsWizardPage.java775
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableFigure.java86
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableGenPanel.java429
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesAndColumnsCustomizationWizardPage.java398
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesSelectorWizardPage.java767
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/EmbeddedMappingFileWizard.java53
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileNewFileWizardPage.java80
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileOptionsWizardPage.java125
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java384
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/AddToEarComposite.java114
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/JpaProjectWizard.java62
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/JpaProjectWizardFirstPage.java121
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProperties.java28
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProvider.java361
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/java/JavaUiFactory2_0.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/orm/OrmXmlUiFactory2_0.java41
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaEditorManager.java45
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaSelectionManager.java81
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaViewManager.java99
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/templates/annotated_entity.javajet64
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/templates/entity.javajet50
-rw-r--r--jpa/plugins/org.eclipse.jpt.jpa.ui/templates/idClass.javajet124
-rw-r--r--jpa/plugins/org.eclipse.jpt.ui/.project5
-rw-r--r--jpa/plugins/org.eclipse.jpt.utility/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.core.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.db.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.gen.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.classpath13
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/META-INF/MANIFEST.MF25
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/build.properties17
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.xml34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/ExtensionTestPlugin.java55
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMapping.java35
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMappingDefinition.java54
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaBasicMapping.java21
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaEntity.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaFactory.java39
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformFactory.java72
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformProvider.java163
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformUiFactory.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/.classpath15
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/META-INF/MANIFEST.MF47
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/build.properties16
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/JptJpaCoreTestsPlugin.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/MiscTests.java65
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/JptJpaCoreTests.java77
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/ContextModelTestCase.java235
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaFileTests.java445
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaProjectTests.java172
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JptJpaCoreContextModelTests.java52
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java313
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentTypeTests.java935
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAssociationOverrideTests.java447
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAttributeOverrideTests.java261
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaBasicMappingTests.java997
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaCascadeTests.java322
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaColumnTests.java844
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java459
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddableTests.java171
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java656
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java861
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java3438
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaGeneratedValueTests.java151
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaIdMappingTests.java716
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java550
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinTableTests.java1179
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToManyMappingTests.java1183
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java964
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaMappedSuperclassTests.java289
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedNativeQueryTests.java433
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedQueryTests.java334
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToManyMappingTests.java1163
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java1516
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java304
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaQueryHintTests.java150
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSecondaryTableTests.java731
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSequenceGeneratorTests.java236
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableGeneratorTests.java672
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableTests.java611
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTransientMappingTests.java250
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaVersionMappingTests.java401
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JptCoreContextJavaModelTests.java59
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/EntityMappingsTests.java1066
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentAttributeTests.java319
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentTypeTests.java502
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java62
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAssociationOverrideTests.java267
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAttributeOverrideTests.java99
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmBasicMappingTests.java724
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmCascadeTests.java290
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmColumnTests.java856
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java456
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddableTests.java295
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java928
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java948
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java2803
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmGeneratedValueTests.java138
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmIdMappingTests.java767
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinColumnTests.java522
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinTableTests.java1386
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToManyMappingTests.java1088
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToOneMappingTests.java629
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmMappedSuperclassTests.java386
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java358
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedQueryTests.java273
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToManyMappingTests.java1080
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToOneMappingTests.java1220
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java253
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmQueryHintTests.java122
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSecondaryTableTests.java767
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java172
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableGeneratorTests.java609
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableTests.java827
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTransientMappingTests.java309
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmVersionMappingTests.java493
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmXmlTests.java69
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java369
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java104
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/ClassRefTests.java113
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/MappingFileRefTests.java98
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceTests.java134
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java367
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTests.java1245
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceXmlTests.java56
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/RootContextNodeTests.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/Generic2_0ContextModelTestCase.java46
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/Generic2_0JavaContextModelTests.java45
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java580
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaBasicMapping2_0Tests.java417
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCascade2_0Tests.java107
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCollectionTable2_0Tests.java723
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java2615
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java368
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java1608
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java2057
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaIdMapping2_0Tests.java423
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java1953
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java682
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java2214
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java1141
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0Tests.java162
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentType2_0Tests.java863
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0Tests.java197
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaVersionMapping2_0Tests.java352
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/Generic2_0OrmContextModelTests.java41
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java534
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCascade2_0Tests.java91
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCollectionTable2_0Tests.java770
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0Tests.java1741
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java1739
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java1972
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java1208
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java673
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java1500
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java992
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0Tests.java565
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentType2_0Tests.java285
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0Tests.java91
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0ConnectionTests.java186
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0JpaMetadataConversionTests.java650
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0OptionsTests.java520
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceContextModelTests.java31
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceUnitTests.java58
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Access2_0AnnotationTests.java177
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverride2_0Tests.java861
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java949
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Cacheable2_0AnnotationTests.java106
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/CollectionTable2_0AnnotationTests.java499
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ElementCollection2_0AnnotationTests.java170
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResource2_0Tests.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResourceModel2_0TestCase.java29
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToMany2_0AnnotationTests.java410
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToOne2_0AnnotationTests.java403
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyClass2_0AnnotationTests.java109
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationTests.java405
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationTests.java92
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationTests.java358
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationTests.java448
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationTests.java90
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapsId2_0AnnotationTests.java87
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToMany2_0AnnotationTests.java413
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToOne2_0AnnotationTests.java463
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OrderColumn2_0AnnotationTests.java253
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationTests.java116
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaEntityGenMetadataTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaJpqlMetadataTests.java59
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaMetadataTests.java101
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaValidationMetadataTests.java83
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JptJpaCoreMetadataTests.java33
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JpaProjectManagerTests.java282
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JptJpaCoreModelTests.java28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/BaseJpaPlatformTests.java77
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformExtensionTests.java96
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformTests.java129
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/projects/TestJpaProject.java101
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/JptJpaCoreResourceModelTests.java42
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverrideTests.java251
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverridesTests.java344
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverrideTests.java163
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverridesTests.java298
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/BasicTests.java152
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ColumnTests.java405
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorColumnTests.java212
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorValueTests.java83
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddableTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedIdTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EntityTests.java124
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EnumeratedTests.java90
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/GeneratedValueTests.java134
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdClassTests.java103
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/InheritanceTests.java83
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JPTToolsTests.java479
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceAttributeTests.java718
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceModelTestCase.java173
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceTypeTests.java679
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnTests.java353
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnsTests.java446
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinTableTests.java656
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JpaJavaResourceModelTestCase.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JptJavaResourceTests.java75
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/LobTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToManyTests.java395
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToOneTests.java388
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MapKeyTests.java89
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MappedSuperclassTests.java74
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueriesTests.java425
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueryTests.java341
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueriesTests.java339
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueryTests.java259
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToManyTests.java398
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToOneTests.java448
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OrderByTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java273
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/QueryHintTests.java65
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTableTests.java436
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTablesTests.java503
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SequenceGeneratorTests.java234
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableGeneratorTests.java502
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableTests.java346
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TemporalTests.java89
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TransientTests.java51
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/VersionTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.core.tests/test.xml35
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/META-INF/MANIFEST.MF19
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/build.properties14
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/derby.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/mysql.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10g.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10gXE.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle9i.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/postgresql.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sqlserver.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sybase.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/plugin.properties24
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTests.java135
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTools.java105
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTests.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTestsPlugin.java56
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/AllPlatformTests.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DTPPlatformTests.java1030
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DerbyTests.java482
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/MySQLTests.java417
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gTests.java397
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gXETests.java79
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle9iTests.java79
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/PostgreSQLTests.java486
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SQLServerTests.java83
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SybaseTests.java443
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.classpath14
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF33
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/build.properties16
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java95
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java188
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java38
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_1ContextModelTestCase.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_2ContextModelTestCase.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_3ContextModelTestCase.java37
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java132
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java166
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/JptJpaEclipseLinkCoreContextModelTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java724
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java2280
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java1804
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java1411
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java326
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java529
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java1531
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java814
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_2JavaEntityTests.java175
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_2JavaMappedSuperclassTests.java143
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_3JavaMultitenancyTests.java631
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java323
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java742
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java170
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java220
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java254
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java388
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java324
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java150
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java149
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java349
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java631
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java582
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java449
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java217
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java309
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java323
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java54
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java435
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java293
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java816
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java1703
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java1807
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java1099
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToOneMappingTests.java589
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java2377
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java1215
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java923
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1EntityMappingsTests.java275
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmEmbeddableTests.java61
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmEntityTests.java61
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmMappedSuperclassTests.java61
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmPersistentTypeTests.java271
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1PersistenceUnitDefaultsTests.java330
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java546
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java677
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java390
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmCachingTests.java497
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java147
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java1037
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java2395
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java391
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java397
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java331
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java2149
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java403
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java760
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java465
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java323
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java146
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java63
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java191
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java392
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java371
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java106
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java66
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingAdapterTests.java448
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingValueModelTests.java443
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CustomizationValueModelTests.java204
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java173
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java431
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java519
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java57
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_2JpaMetadataConversionTests.java823
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkConnectionTests.java541
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkCustomizationTests.java760
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java53
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java174
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesAdapterTests.java104
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesValueModelTests.java161
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java48
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingAdapterTests.java339
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingValueModelTests.java161
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsAdapterTests.java379
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsValueModelTests.java160
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationAdapterTests.java253
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationBasicAdapterTests.java153
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationValueModelTests.java231
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/EclipseLinkStaticWeavingBuilderMetadataTests.java67
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/JptJpaEclipseLinkCoreMetadataTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java41
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CacheTests.java494
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java132
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java106
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java156
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java99
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_0JavaResourceModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_3JavaResourceModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java54
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.java330
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipselinkMultitenantAnnotation2_3Tests.java138
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java88
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java93
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MapKeyConvertAnnotation2_0Tests.java106
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java112
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java427
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java50
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java47
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java156
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java156
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java220
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java159
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java215
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java220
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml49
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/.classpath11
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/META-INF/MANIFEST.MF14
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/about.html34
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/build.properties16
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/EntityGenToolsTests.java143
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/JptJpaGenTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.gen.tests/test.xml49
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/.classpath14
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/.cvsignore1
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/.project28
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/.settings/org.eclipse.jdt.core.prefs12
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/META-INF/MANIFEST.MF23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/build.properties13
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/plugin.properties23
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/JptUiTests.java32
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java65
-rw-r--r--jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JptUiPlatformTests.java27
-rw-r--r--jpa/tests/org.eclipse.jpt.ui.tests/.project5
-rw-r--r--jpa/tests/org.eclipse.jpt.utility.tests/.project5
2546 files changed, 0 insertions, 432292 deletions
diff --git a/jpa/features/org.eclipse.jpt.eclipselink.feature/.project b/jpa/features/org.eclipse.jpt.eclipselink.feature/.project
deleted file mode 100644
index f2123ce740..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.feature</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project b/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project
deleted file mode 100644
index d8a03f0b6e..0000000000
--- a/jpa/features/org.eclipse.jpt.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink_sdk.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink_sdk.feature</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.feature/.project b/jpa/features/org.eclipse.jpt.feature/.project
deleted file mode 100644
index b83e9de317..0000000000
--- a/jpa/features/org.eclipse.jpt.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa.feature</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.project b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.project
deleted file mode 100644
index 82b5c31c8d..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index dab5837cb6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:47 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/build.properties
deleted file mode 100644
index 93ccfad587..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.properties
deleted file mode 100644
index fb9f31ea74..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JPA Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - EclipseLink JPA Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.xml
deleted file mode 100644
index f3c3ec5f0f..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/feature.xml
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.eclipselink.feature"
- label="%featureName"
- version="3.2.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.jpa.eclipselink.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.jpa.feature" version="3.2.0"/>
- <import feature="org.eclipse.jpt.common.eclipselink.feature" version="1.2.0"/>
- </requires>
-
- <plugin
- id="javax.persistence"
- download-size="0"
- install-size="0"
- version="2.0.4.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.antlr"
- download-size="0"
- install-size="0"
- version="3.2.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.asm"
- download-size="0"
- install-size="0"
- version="3.3.1.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.core"
- download-size="0"
- install-size="0"
- version="2.4.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.jpa"
- download-size="0"
- install-size="0"
- version="2.4.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.core.ddlgen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.ini b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.mappings b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index cb59e5f914..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.gif b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.png b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/epl-v10.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/license.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/plugin.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index 262082f5ee..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index 897839fcea..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index d71318f213..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools EclipseLink Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.ini b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.mappings b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index cb59e5f914..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools - EclipseLink Support Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2005. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index 6dcfcd6269..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-###############################################################################
-# Copyright (c) 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- about.html,\
- about.ini,\
- about.mappings,\
- about.properties,\
- eclipse32.gif,\
- plugin.properties,\
- plugin.xml,\
- src/**,\
- META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.png b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/epl-v10.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/license.html b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/plugin.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index 262082f5ee..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2008, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink Support
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.project b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.project
deleted file mode 100644
index 5bc700173c..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 235b84ae83..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:17 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/build.properties
deleted file mode 100644
index da6de749f9..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-src.includes = \
- feature.xml,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.properties
deleted file mode 100644
index 147cc747be..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JPA Core JUnit Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools EclipseLink JPA Core JUnit Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.xml
deleted file mode 100644
index 8f92c24af8..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink.tests.feature/feature.xml
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.eclipselink.tests.feature"
- label="%featureName"
- version="3.2.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.tests.feature" version="1.2.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jpa.eclipselink.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.cvsignore
deleted file mode 100644
index 6365d3dc51..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-feature.temp.folder
-build.xml
-org.eclipse.jpt_sdk.feature_1.0.1.*
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.project b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.project
deleted file mode 100644
index f5f4862fc6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6cc7d4b4cd..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:09:59 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/build.properties
deleted file mode 100644
index 191698f8c6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.jpa.eclipselink.feature.source=org.eclipse.jpt.jpa.eclipselink.feature
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.properties
deleted file mode 100644
index 30feaf668b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - EclipseLink JPA Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence - EclipseLink JPA Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.xml
deleted file mode 100644
index 5776a5aa46..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.eclipselink_sdk.feature/feature.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.eclipselink_sdk.feature"
- label="%featureName"
- version="3.2.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.jpa.eclipselink.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa.eclipselink.feature.source"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/.project b/jpa/features/org.eclipse.jpt.jpa.feature/.project
deleted file mode 100644
index e1d95d7c7f..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index dab5837cb6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:47 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.feature/build.properties
deleted file mode 100644
index 93ccfad587..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.feature/feature.properties
deleted file mode 100644
index 9558aa952b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JPA Support
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools - JPA Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml
deleted file mode 100644
index ff3a374415..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/feature.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.feature"
- label="%featureName"
- version="3.2.0.qualifier"
- provider-name="%providerName"
- plugin="org.eclipse.jpt.jpa.branding"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.feature" version="1.2.0"/>
- <import feature="org.eclipse.datatools.enablement.feature" version="1.9.0"/>
- <import feature="org.eclipse.datatools.sqldevtools.feature" version="1.9.0"/>
- <import feature="org.eclipse.datatools.connectivity.feature" version="1.9.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jpa.core"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.db"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.db.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.gen"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.ui"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.doc.user"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.jpa.jpql"
- download-size="0"
- install-size="0"
- version="2.0.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.persistence.jpa.jpql.source"
- download-size="0"
- install-size="0"
- version="2.0.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.commons.collections"
- download-size="0"
- install-size="0"
- version="3.2.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.commons.lang"
- download-size="0"
- install-size="0"
- version="2.1.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.apache.velocity"
- download-size="0"
- install-size="0"
- version="1.5.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.jdom"
- download-size="0"
- install-size="0"
- version="1.0.0.qualifier"
- unpack="false"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.branding"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.ini b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.mappings b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.properties
deleted file mode 100644
index 20288ae9d9..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/build.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.gif b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.png b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/epl-v10.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/license.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/plugin.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/plugin.properties
deleted file mode 100644
index c07594d901..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateBundle/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/build.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/build.properties
deleted file mode 100644
index fba3ef0266..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = \
- eclipse_update_120.jpg,\
- feature.xml,\
- feature.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/feature.properties
deleted file mode 100644
index f47ad4ff08..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplateFeature/feature.properties
+++ /dev/null
@@ -1,48 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code zips for Dali Java Persistence Tools
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2010 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.html
deleted file mode 100644
index d4916df475..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.html
+++ /dev/null
@@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-<body lang="EN-US">
-<h2>About This Content</h2>
-
-<p>June 06, 2007</p>
-<h3>License</h3>
-
-<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the
-Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
-For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
-apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
-indicated below, the terms and conditions of the EPL still apply to any source code in the Content.</p>
-
-<h3>Source Code</h3>
-<p>This plug-in contains source code zip files (&quot;Source Zips&quot;) that correspond to binary content in other plug-ins. These Source Zips may be distributed under different license
-agreements and/or notices. Details about these license agreements and notices are contained in &quot;about.html&quot; files (&quot;Abouts&quot;) located in sub-directories in the
-src/ directory of this plug-in. Such Abouts govern your use of the Source Zips in that directory, not the EPL.</p>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.ini b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.ini
deleted file mode 100644
index 2dee36a2e2..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.ini
+++ /dev/null
@@ -1,31 +0,0 @@
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=eclipse32.gif
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (not translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-
-
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.mappings b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.mappings
deleted file mode 100644
index a28390a75e..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.properties
deleted file mode 100644
index 021634dd5c..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/about.properties
+++ /dev/null
@@ -1,26 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-#
-# Do not translate any values surrounded by {}
-
-blurb=Dali Java Persistence Tools Source\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Eclipse contributors and others 2008, 2010. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
-
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/build.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/build.properties
deleted file mode 100644
index ce9529be74..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/build.properties
+++ /dev/null
@@ -1,12 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2008 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-bin.includes = about.html, about.ini, about.mappings, about.properties, eclipse32.gif, plugin.properties, plugin.xml, src/**, META-INF/
-sourcePlugin = true
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.gif b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.gif
deleted file mode 100644
index e6ad7ccd75..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.png b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.png
deleted file mode 100644
index 50ae49de24..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse32.png
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/epl-v10.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/epl-v10.html
deleted file mode 100644
index 022ad2955b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/epl-v10.html
+++ /dev/null
@@ -1,328 +0,0 @@
-<html xmlns:o="urn:schemas-microsoft-com:office:office"
-xmlns:w="urn:schemas-microsoft-com:office:word"
-xmlns="http://www.w3.org/TR/REC-html40">
-
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=windows-1252">
-<meta name=ProgId content=Word.Document>
-<meta name=Generator content="Microsoft Word 9">
-<meta name=Originator content="Microsoft Word 9">
-<link rel=File-List
-href="./Eclipse%20EPL%202003_11_10%20Final_files/filelist.xml">
-<title>Eclipse Public License - Version 1.0</title>
-<!--[if gte mso 9]><xml>
- <o:DocumentProperties>
- <o:Revision>2</o:Revision>
- <o:TotalTime>3</o:TotalTime>
- <o:Created>2004-03-05T23:03:00Z</o:Created>
- <o:LastSaved>2004-03-05T23:03:00Z</o:LastSaved>
- <o:Pages>4</o:Pages>
- <o:Words>1626</o:Words>
- <o:Characters>9270</o:Characters>
- <o:Lines>77</o:Lines>
- <o:Paragraphs>18</o:Paragraphs>
- <o:CharactersWithSpaces>11384</o:CharactersWithSpaces>
- <o:Version>9.4402</o:Version>
- </o:DocumentProperties>
-</xml><![endif]--><!--[if gte mso 9]><xml>
- <w:WordDocument>
- <w:TrackRevisions/>
- </w:WordDocument>
-</xml><![endif]-->
-<style>
-<!--
- /* Font Definitions */
-@font-face
- {font-family:Tahoma;
- panose-1:2 11 6 4 3 5 4 4 2 4;
- mso-font-charset:0;
- mso-generic-font-family:swiss;
- mso-font-pitch:variable;
- mso-font-signature:553679495 -2147483648 8 0 66047 0;}
- /* Style Definitions */
-p.MsoNormal, li.MsoNormal, div.MsoNormal
- {mso-style-parent:"";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p
- {margin-right:0in;
- mso-margin-top-alt:auto;
- mso-margin-bottom-alt:auto;
- margin-left:0in;
- mso-pagination:widow-orphan;
- font-size:12.0pt;
- font-family:"Times New Roman";
- mso-fareast-font-family:"Times New Roman";}
-p.BalloonText, li.BalloonText, div.BalloonText
- {mso-style-name:"Balloon Text";
- margin:0in;
- margin-bottom:.0001pt;
- mso-pagination:widow-orphan;
- font-size:8.0pt;
- font-family:Tahoma;
- mso-fareast-font-family:"Times New Roman";}
-@page Section1
- {size:8.5in 11.0in;
- margin:1.0in 1.25in 1.0in 1.25in;
- mso-header-margin:.5in;
- mso-footer-margin:.5in;
- mso-paper-source:0;}
-div.Section1
- {page:Section1;}
--->
-</style>
-</head>
-
-<body lang=EN-US style='tab-interval:.5in'>
-
-<div class=Section1>
-
-<p align=center style='text-align:center'><b>Eclipse Public License - v 1.0</b>
-</p>
-
-<p><span style='font-size:10.0pt'>THE ACCOMPANYING PROGRAM IS PROVIDED UNDER
-THE TERMS OF THIS ECLIPSE PUBLIC LICENSE (&quot;AGREEMENT&quot;). ANY USE,
-REPRODUCTION OR DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE
-OF THIS AGREEMENT.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>1. DEFINITIONS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Contribution&quot; means:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-in the case of the initial Contributor, the initial code and documentation
-distributed under this Agreement, and<br clear=left>
-b) in the case of each subsequent Contributor:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-changes to the Program, and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-additions to the Program;</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>where
-such changes and/or additions to the Program originate from and are distributed
-by that particular Contributor. A Contribution 'originates' from a Contributor
-if it was added to the Program by such Contributor itself or anyone acting on
-such Contributor's behalf. Contributions do not include additions to the
-Program which: (i) are separate modules of software distributed in conjunction
-with the Program under their own license agreement, and (ii) are not derivative
-works of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Contributor&quot; means any person or
-entity that distributes the Program.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Licensed Patents &quot; mean patent
-claims licensable by a Contributor which are necessarily infringed by the use
-or sale of its Contribution alone or when combined with the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>&quot;Program&quot; means the Contributions
-distributed in accordance with this Agreement.</span> </p>
-
-<p><span style='font-size:10.0pt'>&quot;Recipient&quot; means anyone who
-receives the Program under this Agreement, including all Contributors.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>2. GRANT OF RIGHTS</span></b> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-Subject to the terms of this Agreement, each Contributor hereby grants Recipient
-a non-exclusive, worldwide, royalty-free copyright license to<span
-style='color:red'> </span>reproduce, prepare derivative works of, publicly
-display, publicly perform, distribute and sublicense the Contribution of such
-Contributor, if any, and such derivative works, in source code and object code
-form.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-Subject to the terms of this Agreement, each Contributor hereby grants
-Recipient a non-exclusive, worldwide,<span style='color:green'> </span>royalty-free
-patent license under Licensed Patents to make, use, sell, offer to sell, import
-and otherwise transfer the Contribution of such Contributor, if any, in source
-code and object code form. This patent license shall apply to the combination
-of the Contribution and the Program if, at the time the Contribution is added
-by the Contributor, such addition of the Contribution causes such combination
-to be covered by the Licensed Patents. The patent license shall not apply to
-any other combinations which include the Contribution. No hardware per se is
-licensed hereunder. </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>c)
-Recipient understands that although each Contributor grants the licenses to its
-Contributions set forth herein, no assurances are provided by any Contributor
-that the Program does not infringe the patent or other intellectual property
-rights of any other entity. Each Contributor disclaims any liability to Recipient
-for claims brought by any other entity based on infringement of intellectual
-property rights or otherwise. As a condition to exercising the rights and
-licenses granted hereunder, each Recipient hereby assumes sole responsibility
-to secure any other intellectual property rights needed, if any. For example,
-if a third party patent license is required to allow Recipient to distribute
-the Program, it is Recipient's responsibility to acquire that license before
-distributing the Program.</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>d)
-Each Contributor represents that to its knowledge it has sufficient copyright
-rights in its Contribution, if any, to grant the copyright license set forth in
-this Agreement. </span></p>
-
-<p><b><span style='font-size:10.0pt'>3. REQUIREMENTS</span></b> </p>
-
-<p><span style='font-size:10.0pt'>A Contributor may choose to distribute the
-Program in object code form under its own license agreement, provided that:</span>
-</p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it complies with the terms and conditions of this Agreement; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b)
-its license agreement:</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>i)
-effectively disclaims on behalf of all Contributors all warranties and
-conditions, express and implied, including warranties or conditions of title
-and non-infringement, and implied warranties or conditions of merchantability
-and fitness for a particular purpose; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>ii)
-effectively excludes on behalf of all Contributors all liability for damages,
-including direct, indirect, special, incidental and consequential damages, such
-as lost profits; </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iii)
-states that any provisions which differ from this Agreement are offered by that
-Contributor alone and not by any other party; and</span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>iv)
-states that source code for the Program is available from such Contributor, and
-informs licensees how to obtain it in a reasonable manner on or through a
-medium customarily used for software exchange.<span style='color:blue'> </span></span></p>
-
-<p><span style='font-size:10.0pt'>When the Program is made available in source
-code form:</span> </p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>a)
-it must be made available under this Agreement; and </span></p>
-
-<p class=MsoNormal style='margin-left:.5in'><span style='font-size:10.0pt'>b) a
-copy of this Agreement must be included with each copy of the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Contributors may not remove or alter any
-copyright notices contained within the Program. </span></p>
-
-<p><span style='font-size:10.0pt'>Each Contributor must identify itself as the
-originator of its Contribution, if any, in a manner that reasonably allows
-subsequent Recipients to identify the originator of the Contribution. </span></p>
-
-<p><b><span style='font-size:10.0pt'>4. COMMERCIAL DISTRIBUTION</span></b> </p>
-
-<p><span style='font-size:10.0pt'>Commercial distributors of software may
-accept certain responsibilities with respect to end users, business partners
-and the like. While this license is intended to facilitate the commercial use
-of the Program, the Contributor who includes the Program in a commercial
-product offering should do so in a manner which does not create potential
-liability for other Contributors. Therefore, if a Contributor includes the
-Program in a commercial product offering, such Contributor (&quot;Commercial
-Contributor&quot;) hereby agrees to defend and indemnify every other
-Contributor (&quot;Indemnified Contributor&quot;) against any losses, damages and
-costs (collectively &quot;Losses&quot;) arising from claims, lawsuits and other
-legal actions brought by a third party against the Indemnified Contributor to
-the extent caused by the acts or omissions of such Commercial Contributor in
-connection with its distribution of the Program in a commercial product
-offering. The obligations in this section do not apply to any claims or Losses
-relating to any actual or alleged intellectual property infringement. In order
-to qualify, an Indemnified Contributor must: a) promptly notify the Commercial
-Contributor in writing of such claim, and b) allow the Commercial Contributor
-to control, and cooperate with the Commercial Contributor in, the defense and
-any related settlement negotiations. The Indemnified Contributor may participate
-in any such claim at its own expense.</span> </p>
-
-<p><span style='font-size:10.0pt'>For example, a Contributor might include the
-Program in a commercial product offering, Product X. That Contributor is then a
-Commercial Contributor. If that Commercial Contributor then makes performance
-claims, or offers warranties related to Product X, those performance claims and
-warranties are such Commercial Contributor's responsibility alone. Under this
-section, the Commercial Contributor would have to defend claims against the
-other Contributors related to those performance claims and warranties, and if a
-court requires any other Contributor to pay any damages as a result, the
-Commercial Contributor must pay those damages.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>5. NO WARRANTY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, THE PROGRAM IS PROVIDED ON AN &quot;AS IS&quot; BASIS, WITHOUT
-WARRANTIES OR CONDITIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING,
-WITHOUT LIMITATION, ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT,
-MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely
-responsible for determining the appropriateness of using and distributing the
-Program and assumes all risks associated with its exercise of rights under this
-Agreement , including but not limited to the risks and costs of program errors,
-compliance with applicable laws, damage to or loss of data, programs or
-equipment, and unavailability or interruption of operations. </span></p>
-
-<p><b><span style='font-size:10.0pt'>6. DISCLAIMER OF LIABILITY</span></b> </p>
-
-<p><span style='font-size:10.0pt'>EXCEPT AS EXPRESSLY SET FORTH IN THIS
-AGREEMENT, NEITHER RECIPIENT NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR
-ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
-(INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY
-OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
-NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR DISTRIBUTION OF
-THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF
-THE POSSIBILITY OF SUCH DAMAGES.</span> </p>
-
-<p><b><span style='font-size:10.0pt'>7. GENERAL</span></b> </p>
-
-<p><span style='font-size:10.0pt'>If any provision of this Agreement is invalid
-or unenforceable under applicable law, it shall not affect the validity or
-enforceability of the remainder of the terms of this Agreement, and without
-further action by the parties hereto, such provision shall be reformed to the
-minimum extent necessary to make such provision valid and enforceable.</span> </p>
-
-<p><span style='font-size:10.0pt'>If Recipient institutes patent litigation
-against any entity (including a cross-claim or counterclaim in a lawsuit)
-alleging that the Program itself (excluding combinations of the Program with
-other software or hardware) infringes such Recipient's patent(s), then such
-Recipient's rights granted under Section 2(b) shall terminate as of the date
-such litigation is filed. </span></p>
-
-<p><span style='font-size:10.0pt'>All Recipient's rights under this Agreement
-shall terminate if it fails to comply with any of the material terms or
-conditions of this Agreement and does not cure such failure in a reasonable
-period of time after becoming aware of such noncompliance. If all Recipient's
-rights under this Agreement terminate, Recipient agrees to cease use and
-distribution of the Program as soon as reasonably practicable. However,
-Recipient's obligations under this Agreement and any licenses granted by
-Recipient relating to the Program shall continue and survive. </span></p>
-
-<p><span style='font-size:10.0pt'>Everyone is permitted to copy and distribute
-copies of this Agreement, but in order to avoid inconsistency the Agreement is
-copyrighted and may only be modified in the following manner. The Agreement
-Steward reserves the right to publish new versions (including revisions) of
-this Agreement from time to time. No one other than the Agreement Steward has
-the right to modify this Agreement. The Eclipse Foundation is the initial
-Agreement Steward. The Eclipse Foundation may assign the responsibility to
-serve as the Agreement Steward to a suitable separate entity. Each new version
-of the Agreement will be given a distinguishing version number. The Program
-(including Contributions) may always be distributed subject to the version of
-the Agreement under which it was received. In addition, after a new version of
-the Agreement is published, Contributor may elect to distribute the Program
-(including its Contributions) under the new version. Except as expressly stated
-in Sections 2(a) and 2(b) above, Recipient receives no rights or licenses to
-the intellectual property of any Contributor under this Agreement, whether
-expressly, by implication, estoppel or otherwise. All rights in the Program not
-expressly granted under this Agreement are reserved.</span> </p>
-
-<p><span style='font-size:10.0pt'>This Agreement is governed by the laws of the
-State of New York and the intellectual property laws of the United States of
-America. No party to this Agreement will bring a legal action under this
-Agreement more than one year after the cause of action arose. Each party waives
-its rights to a jury trial in any resulting litigation.</span> </p>
-
-<p class=MsoNormal><![if !supportEmptyParas]>&nbsp;<![endif]><o:p></o:p></p>
-
-</div>
-
-</body>
-
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/license.html b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/license.html
deleted file mode 100644
index 5ad00ba719..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/license.html
+++ /dev/null
@@ -1,86 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<html>
-<head>
-<meta http-equiv=Content-Type content="text/html; charset=iso-8859-1">
-<title>Eclipse.org Software User Agreement</title>
-</head>
-
-<body lang="EN-US" link=blue vlink=purple>
-<h2>Eclipse Foundation Software User Agreement</h2>
-<p>March 17, 2005</p>
-
-<h3>Usage Of Content</h3>
-
-<p>THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS
- (COLLECTIVELY &quot;CONTENT&quot;). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND
- CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE
- OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR
- NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND
- CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.</p>
-
-<h3>Applicable Licenses</h3>
-
-<p>Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0
- (&quot;EPL&quot;). A copy of the EPL is provided with this Content and is also available at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
- For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
-
-<p>Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse.org CVS repository (&quot;Repository&quot;) in CVS
- modules (&quot;Modules&quot;) and made available as downloadable archives (&quot;Downloads&quot;).</p>
-
-<ul>
- <li>Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins (&quot;Plug-ins&quot;), plug-in fragments (&quot;Fragments&quot;), and features (&quot;Features&quot;).</li>
-
- <li>Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java&trade; ARchive) in a directory named &quot;plugins&quot;.</li>
- <li>A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named &quot;features&quot;. Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of the Plug-ins
- and/or Fragments associated with that Feature.</li>
- <li>Features may also include other Features (&quot;Included Features&quot;). Within a Feature, files named &quot;feature.xml&quot; may contain a list of the names and version numbers of Included Features.</li>
-
-</ul>
-
-<p>The terms and conditions governing Plug-ins and Fragments should be contained in files named &quot;about.html&quot; (&quot;Abouts&quot;). The terms and conditions governing Features and
-Included Features should be contained in files named &quot;license.html&quot; (&quot;Feature Licenses&quot;). Abouts and Feature Licenses may be located in any directory of a Download or Module
-including, but not limited to the following locations:</p>
-
-<ul>
- <li>The top-level (root) directory</li>
-
- <li>Plug-in and Fragment directories</li>
- <li>Inside Plug-ins and Fragments packaged as JARs</li>
- <li>Sub-directories of the directory named &quot;src&quot; of certain Plug-ins</li>
- <li>Feature directories</li>
-</ul>
-
-
-<p>Note: if a Feature made available by the Eclipse Foundation is installed using the Eclipse Update Manager, you must agree to a license (&quot;Feature Update License&quot;) during the
-installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or
-inform you where you can locate them. Feature Update Licenses may be found in the &quot;license&quot; property of files named &quot;feature.properties&quot; found within a Feature.
-Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in
-that directory.</p>
-
-<p>THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE
-OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):</p>
-
-<ul>
- <li>Common Public License Version 1.0 (available at <a href="http://www.eclipse.org/legal/cpl-v10.html">http://www.eclipse.org/legal/cpl-v10.html</a>)</li>
-
- <li>Apache Software License 1.1 (available at <a href="http://www.apache.org/licenses/LICENSE">http://www.apache.org/licenses/LICENSE</a>)</li>
- <li>Apache Software License 2.0 (available at <a href="http://www.apache.org/licenses/LICENSE-2.0">http://www.apache.org/licenses/LICENSE-2.0</a>)</li>
- <li>IBM Public License 1.0 (available at <a href="http://oss.software.ibm.com/developerworks/opensource/license10.html">http://oss.software.ibm.com/developerworks/opensource/license10.html</a>)</li>
- <li>Metro Link Public License 1.00 (available at <a href="http://www.opengroup.org/openmotif/supporters/metrolink/license.html">http://www.opengroup.org/openmotif/supporters/metrolink/license.html</a>)</li>
-
- <li>Mozilla Public License Version 1.1 (available at <a href="http://www.mozilla.org/MPL/MPL-1.1.html">http://www.mozilla.org/MPL/MPL-1.1.html</a>)</li>
-</ul>
-
-<p>IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please
-contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.</p>
-
-<h3>Cryptography</h3>
-
-<p>Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to
- another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import,
- possession, or use, and re-export of encryption software, to see if this is permitted.</p>
-
-<small>Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.</small>
-
-</body>
-</html>
diff --git a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/plugin.properties b/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/plugin.properties
deleted file mode 100644
index c07594d901..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.feature/sourceTemplatePlugin/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa.tests.feature/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.project b/jpa/features/org.eclipse.jpt.jpa.tests.feature/.project
deleted file mode 100644
index 5466fa5d4b..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.tests.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa.tests.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 235b84ae83..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:11:17 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa.tests.feature/build.properties
deleted file mode 100644
index da6de749f9..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/build.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-bin.includes = feature.xml,\
- eclipse_update_120.jpg,\
- feature.properties
-src.includes = \
- feature.xml,\
- eclipse_update_120.jpg,\
- build.properties
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa.tests.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.properties
deleted file mode 100644
index 7f06e1199c..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.properties
+++ /dev/null
@@ -1,51 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-# feature.properties
-# contains externalized strings for feature.xml
-# "%foo" in feature.xml corresponds to the key "foo" in this file
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file should be translated.
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - Common and JPA JUnit Tests
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-# "updateSiteName" property - label for the update site
-# TOREVIEW - updateSiteName
-updateSiteName=Web Tools Platform (WTP) Updates
-
-# "description" property - description of the feature
-description=Dali Java Persistence Tools Common and JPA JUnit Tests
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.xml
deleted file mode 100644
index f384addebd..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa.tests.feature/feature.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa.tests.feature"
- label="%featureName"
- version="3.1.100.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <requires>
- <import feature="org.eclipse.jpt.common.tests.feature" version="1.0.0"/>
- </requires>
-
- <plugin
- id="org.eclipse.jpt.jpa.core.tests"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.jpa.core.tests.extension.resource"
- download-size="0"
- install-size="0"
- version="0.0.0"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.cvsignore b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.cvsignore
deleted file mode 100644
index 087aebe7cd..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.cvsignore
+++ /dev/null
@@ -1,3 +0,0 @@
-feature.temp.folder
-build.xml
-org.eclipse.jpt.jpa_sdk.feature_1.0.1.*
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.project b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.project
deleted file mode 100644
index f933b5eefa..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.project
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa_sdk.feature</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.FeatureBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.FeatureNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.settings/org.eclipse.core.resources.prefs b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 6cc7d4b4cd..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:09:59 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/build.properties b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/build.properties
deleted file mode 100644
index a0610c3956..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = feature.xml,\
- feature.properties,\
- eclipse_update_120.jpg
-
-generate.feature@org.eclipse.jpt.jpa.feature.source=org.eclipse.jpt.jpa.feature
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/eclipse_update_120.jpg b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/eclipse_update_120.jpg
deleted file mode 100644
index bfdf708ad6..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/eclipse_update_120.jpg
+++ /dev/null
Binary files differ
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.properties b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.properties
deleted file mode 100644
index 6dbfeca679..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.properties
+++ /dev/null
@@ -1,43 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# "featureName" property - name of the feature
-featureName=Dali Java Persistence Tools - JPA Support SDK
-
-# "providerName" property - name of the company that provides the feature
-providerName=Eclipse Web Tools Platform
-
-
-# "description" property - description of the feature
-description=Source code archives for Dali Java Persistence Tools - JPA Support
-
-# "copyright" property - text of the "Feature Update Copyright"
-copyright=\
-Copyright (c) 2006, 2011 Oracle Corporation.\n\
-All rights reserved. This program and the accompanying materials\n\
-are made available under the terms of the Eclipse Public License v1.0\n\
-which accompanies this distribution, and is available at\n\
-http://www.eclipse.org/legal/epl-v10.html\n\
-\n\
-Contributors:\n\
- Oracle - initial API and implementation\n
-################ end of copyright property ####################################
-
-# "licenseURL" property - URL of the "Feature License"
-# do not translate value - just change to point to a locale-specific HTML page
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-
-# "license" property - text of the "Feature Update License"
-# should be plain text version of license agreement pointed to be "licenseURL"
-# license and licenseURL properties were removed as a result to migrating to new PDE license support.
-# Those properties are now added at build time. See http://wiki.eclipse.org/Equinox/p2/License_Mechanism.
-########### end of license property ##########################################
diff --git a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.xml b/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.xml
deleted file mode 100644
index 200592f4b5..0000000000
--- a/jpa/features/org.eclipse.jpt.jpa_sdk.feature/feature.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<feature
- id="org.eclipse.jpt.jpa_sdk.feature"
- label="%featureName"
- version="3.2.0.qualifier"
- provider-name="%providerName"
- license-feature="org.eclipse.license"
- license-feature-version="1.0.0.qualifier">
-
- <description>
- %description
- </description>
-
- <copyright>
- %copyright
- </copyright>
-
- <license url="license.html">
- %license
- </license>
-
- <includes
- id="org.eclipse.jpt.jpa.feature"
- version="0.0.0"/>
-
- <includes
- id="org.eclipse.jpt.jpa.feature.source"
- version="0.0.0"/>
-
- <plugin
- id="org.eclipse.jpt.doc.isv"
- download-size="0"
- install-size="0"
- version="0.0.0"
- unpack="false"/>
-
-</feature>
diff --git a/jpa/features/org.eclipse.jpt.tests.feature/.project b/jpa/features/org.eclipse.jpt.tests.feature/.project
deleted file mode 100644
index 5ee70fa0ef..0000000000
--- a/jpa/features/org.eclipse.jpt.tests.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.tests.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa.tests.feature</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/features/org.eclipse.jpt_sdk.feature/.project b/jpa/features/org.eclipse.jpt_sdk.feature/.project
deleted file mode 100644
index 4d523cea52..0000000000
--- a/jpa/features/org.eclipse.jpt_sdk.feature/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt_sdk.feature</name>
- <comment>renamed to org.eclipse.jpt.jpa_sdk.feature</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.branding/.project b/jpa/plugins/org.eclipse.jpt.branding/.project
deleted file mode 100644
index 0b315e62ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.branding/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.branding</name>
- <comment>renamed to org.eclipse.jpt.jpa.branding</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.core/.project b/jpa/plugins/org.eclipse.jpt.core/.project
deleted file mode 100644
index fff56584ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.core/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core</name>
- <comment>renamed to org.eclipse.jpt.jpa.core</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db.ui/.project b/jpa/plugins/org.eclipse.jpt.db.ui/.project
deleted file mode 100644
index 64a5574ce5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db.ui/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db.ui</name>
- <comment>renamed to org.eclipse.jpt.jpa.db.ui</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.db/.project b/jpa/plugins/org.eclipse.jpt.db/.project
deleted file mode 100644
index 604cfcb4a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.db/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db</name>
- <comment>renamed to org.eclipse.jpt.jpa.db</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/.project b/jpa/plugins/org.eclipse.jpt.doc.user/.project
deleted file mode 100644
index 61670ff4fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.doc.user</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF
deleted file mode 100644
index 105574155c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,9 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.doc.user;singleton:=true
-Bundle-Version: 1.4.1.qualifier
-Bundle-Localization: plugin
-Require-Bundle: org.eclipse.help;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.ui.cheatsheets;bundle-version="[3.3.100,4.0.0)"
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/about.htm b/jpa/plugins/org.eclipse.jpt.doc.user/about.htm
deleted file mode 100644
index 29a91352c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.htm
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>About this content</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref295" name="sthref295"></a>
-<h1>About this content</h1>
-<p>November, 2009</p>
-<a id="sthref296" name="sthref296"></a>
-<p class="subhead2">License</p>
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code>. For purposes of the EPL, "Program" will mean the Content.</p>
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <code><a href="http://www.eclipse.org">http://www.eclipse.org</a></code>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/about.html b/jpa/plugins/org.eclipse.jpt.doc.user/about.html
deleted file mode 100644
index 54a84efdaf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/about.html
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>About this content</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1 Build 004" />
-<meta name="date" content="2009-11-16T9:56:23Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="About this content" />
-<meta name="relnum" content="Release 3.0" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref290" name="sthref290"></a>
-<h1>About this content</h1>
-<p>November, 2009</p>
-<a id="sthref291" name="sthref291"></a>
-<p class="subhead2">License</p>
-<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise indicated below, the Content is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available at <code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code>. For purposes of the EPL, "Program" will mean the Content.</p>
-<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is being redistributed by another party ("Redistributor") and different terms and conditions may apply to your use of any object code in the Content. Check the Redistributor's license that was provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise indicated below, the terms and conditions of the EPL still apply to any source code in the Content and such source code may be obtained at <code><a href="http://www.eclipse.org">http://www.eclipse.org</a></code>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2009,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties b/jpa/plugins/org.eclipse.jpt.doc.user/build.properties
deleted file mode 100644
index 2b421082db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/build.properties
+++ /dev/null
@@ -1,136 +0,0 @@
-bin.includes = cheatsheets/,\
- dcommon/,\
- img/,\
- META-INF/,\
- about.html,\
- build.properties,\
- concept_mapping.htm,\
- concept_persistence.htm,\
- concepts.htm,\
- concepts001.htm,\
- concepts002.htm,\
- concepts003.htm,\
- contexts.xml,\
- getting_started.htm,\
- getting_started001.htm,\
- getting_started002.htm,\
- getting_started003.htm,\
- getting_started004.htm,\
- index.xml,\
- legal.htm,\
- plugin.properties,\
- plugin.xml,\
- ref_details_orm.htm,\
- ref_jpa_facet.htm,\
- ref_mapping_general.htm,\
- ref_new_jpa_project.htm,\
- ref_new_jpa_project_wizard.htm,\
- ref_persistence_map_view.htm,\
- ref_persistence_outline.htm,\
- ref_persistence_perspective.htm,\
- ref_persistence_prop_view.htm,\
- ref_primary_key.htm,\
- ref_project_properties.htm,\
- reference.htm,\
- reference001.htm,\
- reference002.htm,\
- reference003.htm,\
- reference004.htm,\
- reference005.htm,\
- reference006.htm,\
- reference007.htm,\
- reference008.htm,\
- reference009.htm,\
- reference010.htm,\
- reference011.htm,\
- reference012.htm,\
- reference013.htm,\
- reference014.htm,\
- reference015.htm,\
- reference016.htm,\
- reference017.htm,\
- reference018.htm,\
- task_add_persistence.htm,\
- task_additonal_tables.htm,\
- task_create_new_project.htm,\
- task_inheritance.htm,\
- task_manage_orm.htm,\
- task_manage_persistence.htm,\
- task_mapping.htm,\
- tasks.htm,\
- tasks001.htm,\
- tasks002.htm,\
- tasks003.htm,\
- tasks004.htm,\
- tasks005.htm,\
- tasks006.htm,\
- tasks007.htm,\
- tasks008.htm,\
- tasks009.htm,\
- tasks010.htm,\
- tasks011.htm,\
- tasks012.htm,\
- tasks013.htm,\
- tasks014.htm,\
- tasks015.htm,\
- tasks016.htm,\
- tasks017.htm,\
- tasks018.htm,\
- tasks019.htm,\
- tasks020.htm,\
- tasks021.htm,\
- tasks022.htm,\
- tips_and_tricks.htm,\
- toc.xml,\
- whats_new.htm,\
- whats_new001.htm,\
- whats_new002.htm,\
- whats_new003.htm,\
- about.htm,\
- reference019.htm,\
- reference020.htm,\
- reference021.htm,\
- reference022.htm,\
- reference023.htm,\
- reference024.htm,\
- reference025.htm,\
- reference026.htm,\
- reference027.htm,\
- reference028.htm,\
- reference030.htm,\
- reference029.htm,\
- reference031.htm,\
- reference032.htm,\
- tasks023.htm,\
- tasks024.htm,\
- whats_new004.htm,\
- whats_new005.htm,\
- ref_persistence_xmll_editor.htm,\
- ref_EntityClassPage.htm,\
- ref_EntityPropertiesPage.htm,\
- ref_add_converter.htm,\
- ref_association_cardinality.htm,\
- ref_association_table.htm,\
- ref_create_custom_entities_wizard.htm,\
- ref_create_jpa_entity_wizard.htm,\
- ref_create_new_association_wizard.htm,\
- ref_customizIndividualEntities.htm,\
- ref_customizeDefaultEntityGeneration.htm,\
- ref_eclipselink_mapping_file.htm,\
- ref_java_page.htm,\
- ref_join_columns.htm,\
- ref_persistence_general.htm,\
- ref_selectTables.htm,\
- ref_select_cascade_dialog.htm,\
- ref_tableAssociations.htm,\
- task_create_jpa_entity.htm,\
- ref_configure_jaxb_class_generation_dialog.htm,\
- ref_jaxb_schema_wizard.htm,\
- ref_schema_from_classes_page.htm,\
- reference033.htm,\
- task_generate_classes_from_schema.htm,\
- task_generating_schema_from_classes.htm,\
- tasks025.htm,\
- tasks026.htm,\
- whats_new006.htm
-generateSourceBundle=false
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml
deleted file mode 100644
index 6dbeedbeca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/add_persistence.xml
+++ /dev/null
@@ -1,63 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Create a JPA Project">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
- This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to create a JPA project.
-
-To learn more about using cheat sheets, or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet click the &quot;Click to Begin&quot; button below.
-
-Let&apos;s get started!
- </description>
- </intro>
- <item title="Setup the Environment" dialog="false" skip="true" href="/org.eclipse.datatools.doc.user/c_database_development_setup.html">
- <description>
- Your environment must be set up before you can perform the steps in this cheat sheet.
-
-Create a database profile and connect to the database.
-
-The Database Connection dialog automatically appears when you click the &quot;Click to Perform&quot; button.
- </description>
- <command serialization="org.eclipse.datatools.sqltools.sqleditor.attachProfileAction" confirm="false">
- </command>
- </item>
- <item title="Create a JPA Project" dialog="false" skip="false" href="/org.eclipse.jpt.doc.user/task_create_new_project.htm">
- <description>
- Use the New Project Wizard to create a JPA project.
-Select <b>File-&gt;New-&gt;Project...</b> and choose <b>JPA-&gt;JPA Project</b> in the list.
-
-On the first page of the wizard, enter a project name and location, select your target runtime, and select a predefined project configuration.
-
-Click <b>Next</b> to display the next page of the wizard.
-
-The &quot;New JPA Project&quot; wizard is automatically displayed when you click the &quot;Click to Perform&quot; button.
- </description>
- <action class="org.eclipse.jdt.internal.ui.wizards.OpenProjectWizardAction" pluginId="org.eclipse.jdt.ui" confirm="false">
- </action>
- </item>
- <item title="Select Project Facet" dialog="false" skip="false" href="/org.eclipse.jst.j2ee.doc.user/topics/ph-projects.html">
- <description>
- Use the Project Facet page to select a predefined project configuration or specific specific facets to include in the project.
-
-Click &quot;Next&quot; to display the next page of the wizard.
- </description>
- </item>
- <item title="Specify the JPA Facet" dialog="false" skip="false" href="/org.eclipse.jdt.doc.user/ref_jpa_facet.htm">
- <description>
- Use the JPA Facet page to specify the the vendor-specific JPA platform, the database connection to use, and the specific JPA implementation library.
-
-You can also specify if Dali should create an orm.xml file.
-
-If you do not have an active database connection, click <b>Add Connections</b> to create one.
-
-If you do not have a defined JPA implementation library, click <b>Configure default JPA implementation library</b> or <b>Configure user libraries</b> to define one.
-
-Click <b>Finish</b> to complete the wizard and open the open the project.
- </description>
- </item>
- <item title="Finish" dialog="false" skip="false">
- <description>
- Congratulations! You have successfully created a JPA project. Complete the additional cheat sheets to add Java persistent entities and map those entities to database tables.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml
deleted file mode 100644
index b64e8afdee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/create_entity.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Create a Persistent Entity">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
-This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to add a Java persistent entity to your Java project.
-To learn more about using cheat sheets or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet, click the <b>Click to Begin</b> button below.
-Let's get started!
- </description>
- </intro>
- <item title="Create a JPA Project" skip="true">
- <description>
-To create a Persistent entity, you must create a JPA project. If you already have a JPA project, you may skip this step by clicking the "Click to Skip" button.
-If not, select <b>File->New->Project...</b> and choose <b>JPA->JPA Project</b> in the list. Complete each page of the Create JPA Project wizard to create a new JPA project.
- </description>
- </item>
- <item title="Open the JPA Development Perspective" skip="true" href="/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm">
- <action pluginId="org.eclipse.ui.cheatsheets" class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" param1="org.eclipse.jpt.ui.PersistencePerspective"/>
- <description>
-When working with JPA persistence, you should use the Persistence perspective. If you already have the Persistence perspective active, you may skip this step by clicking the "Click to Skip" button.
-If not, select <b>Window->Open Perspective->Other</b> in the menubar at the top of the workbench. In the Select Perspectives dialog, select <b>JPA Development</b> and click OK. This step changes the perspective to set up the Eclipse workbench for JPA development.
-You can click the "Click to Perform" button to have the "Persistence" perspective opened automatically.
- </description>
- </item>
- <item title="Create a Java Class">
- <description>
-The next step is to create a new Java class. In the main toolbar again, click on <b>New Java Class</b> button (or the link below).
-The Java editor will automatically open showing your new class.
- </description>
- </item>
- <item title="Create a Persistent Entity">
- <description>
-Finally we will make the Java class a persistent entity.
-In the JPA Structure view select the Java class.
-In the JPA Details view, use the "Map As" field to select <b>Entity</b>. Dali automatically adds the @Entity annotation to the class in the Java editor.
-Use the Table, Catalog, and Schema fields to associate the entity with a specific table in the database.
- </description>
- </item>
- <item title="Finish">
- <description>
-Congratulations! You have successfully added a JPA entity to your JPA project. Complete the additional cheat sheets to map the entity's fields to database tables.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml b/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml
deleted file mode 100644
index 63307f226e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/cheatsheets/map_entity.xml
+++ /dev/null
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<cheatsheet title="Map a Java Persistent Entity">
- <intro href="/org.eclipse.platform.doc.user/reference/ref-cheatsheets.htm">
- <description>
- This cheat sheet will automatically launch wizards, perform actions, and guide you through the steps to map the fields of a JPA entity entity to your database.
-
-To learn more about using cheat sheets or to see a list of available cheat sheets, click Help (?).
-To start work working on this cheat sheet, click the &quot;Click to Begin&quot; button below.
-
-Let&apos;s get started!
- </description>
- </intro>
- <item title="Setup the Environment" dialog="false" skip="true" href="/org.eclipse.datatools.doc.user/c_database_development_setup.html">
- <description>
- Your environment must be set up before you can perform the steps in this cheat sheet.
-
-Create a database profile and connect to the database.
-
-If you already have (and are connected to) a database connection, you may skip this step by clicking the &quot;Click to Skip&quot; button.
-
-The Database Connection dialog automatically appears when you click the &quot;Click to Perform&quot; button.
- </description>
- <command serialization="org.eclipse.datatools.sqltools.sqleditor.attachProfileAction" confirm="false">
- </command>
- </item>
- <item title="Create a JPA Project" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/task_create_new_project.htm">
- <description>
- Use the New Project Wizard to create a JPA project.
-Select <b>File-&gt;New-&gt;Project...</b> and choose <b>JPA-&gt;JPA Project</b> in the list.
-
-Complete each page of the wizard to create a new JPA project.
-
-The &quot;New JPA Project&quot; wizard is automatically displayed when you click the &quot;Click to Perform&quot; button.
-
-If you already have a JPA project, you may skip this step by clicking the &quot;Click to Skip&quot; button.
- </description>
- <action class="org.eclipse.jdt.internal.ui.wizards.OpenProjectWizardAction" pluginId="org.eclipse.jdt.ui" confirm="false">
- </action>
- </item>
- <item title="Open the JPA Development Perspective" dialog="false" skip="true" href="/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm">
- <description>
- When working with JPA persistence, you should use the Persistence perspective. If you already have the Persistence perspective active, you may skip this step by clicking the &quot;Click to Skip&quot; button.
-If not, select <b>Window-&gt;Open Perspective-&gt;Other</b> in the menubar at the top of the workbench. In the Select Perspectives dialog, select <b>JPA Development</b> and click OK. This step changes the perspective to set up the Eclipse workbench for JPA development.
-You can click the &quot;Click to Perform&quot; button to have the &quot;Persistence&quot; perspective opened automatically.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.jpt.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Create a Java Class" dialog="false" skip="false">
- <description>
- The next step is to create a new Java class. In the main toolbar again, click on <b>New Java Class</b> button (or the link below).
-The Java editor will automatically open showing your new class.
- </description>
- </item>
- <item title="Create a Persistent Entity" dialog="false" skip="false">
- <description>
- Finally we will make the Java class a persistent entity.
-In the JPA Structure view select the Java class.
-In the JPA Details view, use the &quot;Map As&quot; field to select <b>Entity</b>. Dali automatically adds the @Entity annotation to the class in the Java editor.
-Use the Table, Catalog, and Schema fields to associate the entity with a specific table in the database.
- </description>
- </item>
- <item title="Add Fields to the Class" dialog="false" skip="true">
- <description>
- Now you will add some fields to the entity to map to rows in the database table.
-
-If your persistent entity already has fields to map, you may skip this step by clicking the &quot;Click to Skip&quot; button. If not, use the Java editor to add fields to the entity.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Create the Mapping" dialog="false" skip="false" href="/org.eclipse.dali.doc.user/ref_entity_page.htm">
- <description>
- Now you are ready to map the entity fields to columns in the database table. In the Package Explorer, select the Java class.
-
-In the JPA Structure view, expand the persistent entity to display the fields. Select a field.
-
-The JPA Details view displays the information for the field. Use the Map As field to select the Basic mapping. Use the Column field to select a column from the database table.
- </description>
- <action class="org.eclipse.ui.internal.cheatsheets.actions.OpenPerspective" pluginId="org.eclipse.ui.cheatsheets" confirm="false" param1="org.eclipse.dali.ui.PersistencePerspective">
- </action>
- </item>
- <item title="Finish" dialog="false" skip="false">
- <description>
- Congratulations! You have successfully mapped the fields from a Java persistent entity to a column in a database table.
- </description>
- </item>
-</cheatsheet>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm
deleted file mode 100644
index 59f7d97bfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_mapping.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Understanding OR mappings</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding OR mappings" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBDJFI" name="BABBDJFI"></a></p>
-<div class="sect1">
-<h1>Understanding OR mappings</h1>
-<p><a id="sthref21" name="sthref21"></a><a id="sthref22" name="sthref22"></a>The Dali OR (object-relational) Mapping Tool allows you to describe how your entity objects <span class="italic">map</span> to the data source (or other objects). This approach isolates persistence information from the object model&ndash;developers are free to design their ideal object model, and DBAs are free to design their ideal schema.</p>
-<p>These mappings transform an object data member type to a corresponding relational database data source representation. These OR mappings can also transform object data members that reference other domain objects stored in other tables in the database and are related through foreign keys.</p>
-<p>You can use these mappings to map simple data types including primitives (such as <code>int</code>), JDK classes (such as <code>String</code>), and large object (LOB) values. You can also use them to transform object data members that reference other domain objects by way of association where data source representations require object identity maintenance (such as sequencing and back references) and possess various types of multiplicity and navigability. The appropriate mapping class is chosen primarily by the cardinality of the relationship.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm
deleted file mode 100644
index 3c7f80bf06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concept_persistence.htm
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Understanding Java persistence</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding Java persistence" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABCAHIC" name="BABCAHIC"></a></p>
-<div class="sect1">
-<h1>Understanding Java persistence</h1>
-<p><a id="sthref19" name="sthref19"></a><span class="italic">Persistence</span> refers to the ability to store objects in a database and use those objects with transactional integrity. In a J2EE application, data is typically stored and persisted in the data tier, in a relational database.</p>
-<p><a id="sthref20" name="sthref20"></a><span class="italic">Entity beans</span> are enterprise beans that contain persistent data and that can be saved in various persistent data stores. The entity beans represent data from a database; each entity bean carries its own identity. Entity beans can be deployed using <span class="italic">application-managed persistence</span> or <span class="italic">container-managed persistence</span>.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm
deleted file mode 100644
index 7a140b7e90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts.htm
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Concepts</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Concepts" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref18" name="sthref18"></a></p>
-<h1>Concepts</h1>
-<p>This section contains an overview of concepts you should be familiar with when using Dali to create mappings for Java persistent entities.</p>
-<ul>
-<li>
-<p><a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></p>
-</li>
-<li>
-<p><a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a></p>
-</li>
-<li>
-<p><a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></p>
-</li>
-</ul>
-<p>In addition to these sections, you should review the following resources for additional information:</p>
-<ul>
-<li>
-<p>Eclipse Dali project: <code><a href="http://www.eclipse.org/webtools/dali">http://www.eclipse.org/webtools/dali</a></code></p>
-</li>
-<li>
-<p>Eclipse Web Tools Platform project: <code><a href="http://www.eclipse.org/webtools">http://www.eclipse.org/webtools</a></code></p>
-</li>
-<li>
-<p>JSR 220 EJB 3.0 specification: <code><a href="http://www.jcp.org/en/jsr/detail?id=220">http://www.jcp.org/en/jsr/detail?id=220</a></code></p>
-</li>
-<li>
-<p>EclipseLink project: <code><a href="http://www.eclipse.org/eclipselink">http://www.eclipse.org/eclipselink</a></code></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm
deleted file mode 100644
index 5104da12ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts001.htm
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Understanding EJB 3.0 Java Persistence API</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Understanding EJB 3.0 Java Persistence API" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBGFJG" name="BABBGFJG"></a></p>
-<div class="sect1">
-<h1>Understanding EJB 3.0 Java Persistence API</h1>
-<p>The Java 2 Enterprise Edition(J2EE) Enterprise JavaBeans (EJB) are a component architecture that you use to develop and deploy object-oriented, distributed, enterprise-scale applications. An application written according to the Enterprise JavaBeans architecture is scalable, transactional, and secure.</p>
-<p>The EJB 3.0 Java Persistence API (JPA) improves the EJB architecture by reducing its complexity through the use of metadata (annotations) and specifying programmatic defaults of that metadata.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm
deleted file mode 100644
index 99f1e4397b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts002.htm
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>The persistence.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The persistence.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDHAGIH" name="CHDHAGIH"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref23" name="sthref23"></a>The persistence.xml file</h1>
-<p>The JPA specification requires the use of a <code>persistence.xml</code> file for deployment. This file defines the database and entity manager options, and may contain more than one persistence unit. To enable you to easily edit this information, Dali provides the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>. Alternatively, you can use the Eclipse XML Editor to create and maintain this information. See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-To work with multiple persistence units, comment out all but one persistence unit in <code>persistence.xml</code>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm
deleted file mode 100644
index 9c887a7984..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/concepts003.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>The orm.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="The orm.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDBIJAC" name="CHDBIJAC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref24" name="sthref24"></a>The orm.xml file</h1>
-<p>Although the JPA specification emphasizes the use of annotations to specify persistence, you can also use the <code>orm.xml</code> file to store this metadata. Dali enables you to create a stub <code>orm.xml</code> file for a JPA project using the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>. See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The metadata must match the XSD specification of your selected JPA implementation.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<p>Dali provides comprehensive support for configuring XML mapping files through the <a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a> that is nearly identical to the annotation-based configuration in the Java source. Alternatively, you can also use the Eclipse XML Editor to create and maintain the metadata information in <code>orm.xml</code>.</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a><br />
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml b/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml
deleted file mode 100644
index a7a661aa44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/contexts.xml
+++ /dev/null
@@ -1,646 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?NLS TYPE="org.eclipse.help.contexts"?>
-<contexts>
- <context id="entity_accessType">
- <description>Specify how the variable is accessed: Property (default) or Field.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_name">
- <description>The name of this entity. By default, the class name is used as the entity name.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_table">
- <description>The database table assigned to this entity. By default, the class name is used as the database table name.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverrides">
- <description>Specify a property or field to be overridden (from the default mappings).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesName">
- <description>Name of the database column.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesColumn">
- <description>The database column that overrides a property or field.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesInsertable">
- <description>Specifies if the column is always included in SQL INSERT statements.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_attributeOverridesUpdatable">
- <description>Specifies if the column is always included in SQL UPDATE statements.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="mapping_mapAs">
- <description>Specify how this attribute maps to the database.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_column">
- <description>The database column that contains the value for the attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnTable">
- <description>Name of the database table that contains the selected column.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnInsertable">
- <description>Specifies if the column is always included in SQL INSERT statements.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_columnUpdatable">
- <description>Specifies if the column is always included in SQL UPDATE statements.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_fetchType">
- <description>Defines how data is loaded from the database: Eager (default) or Lazy</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_optional">
- <description>Specifies if this field is can be null.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_generatedValueStrategy">
- <description>Determines how the primary key is generated: Auto (default), Sequence, Identity, or Table.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_generatedValueGeneratorName">
- <description>Unique name of the generator.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_targetEntity">
- <description>The entity to which this attribute is mapped. </description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_cascadeType">
- <description>Specify which operations are propagated throughout the entity: All, Persist, Merge, or Move.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_mappedBy">
- <description>The field in the database table that owns the relationship.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_joinColumnName">
- <description>The name of the database column that contains the foreign key reference for the entity association.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_joinReferencedColumn">
- <description>Name of the join table that contains the foreign key column.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_embeddedAttributeOverrides">
- <description>Specify to override the default mapping of an entity’s attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="mapping_embeddedAttributeOverridesColumn">
- <description>The database column that is being mapped to the entity’s attribute.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="entity_mapAs">
- <description>Specify the type of persistent domain object for the Java class: Persistent, Embedded, or Mapped Superclass.</description>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_inheritanceStrategy">
- <description>Specify how an entity may inherit properties from other entities: Single table, One table per class, or Joined tables.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorColumn">
- <description>Use to specify the name of the discriminator column when using a Single or Joined inheritance strategy.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorType">
- <description>Use this field to set the discriminator type to CHAR or INTEGER (instead of its default: String). The discriminator value must conform to this type.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="entity_inheritanceDiscriminatorValue">
- <description>Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified discriminator type.</description>
- <topic label="Specifying inheritance" href="task_inheritance.htm"/>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- </context>
- <context id="mapping_orderBy">
- <description>Specify the default order for objects returned from a query.
-orderby_list::= orderby_item [,orderby_item]
-orderby_item::= [property_or_field_name] [ASC | DESC]
-For example: "lastName ASC ,salary DESC" </description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an Entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableName">
- <description>Specify the name of the database table that defines the foreign key for a many-to-many or a unidirectional one-to-many association. You can configure the join table with a specific catalog or schema, configure one or more join table columns with a unique constraint, and use multiple join columns per entity.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableJoinColumns">
- <description>Specify two or more join columns (that is, a composite primary key).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_joinTableInverseJoinColumns">
- <description>Specify the join column on the owned (or inverse side) of the association: the owned entity's primary key column. </description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="properties_javaPersistence">
- <description>Use the Java Persistence options on the Properties page to select the database connection to use with the project.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Adding persistence" href="ref_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="properties_javaPersistenceConnection">
- <description>The database connection used to map the persistent entities.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="properties_javaPersistenceSchema">
- <description>The database schema used to map the persistent entities.</description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="dialog_addPersistence">
- <description>Use the Add Persistence dialog to define the database connection use to store the persistence entities.</description>
- <topic label="Adding persistence" href="ref_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="persistenceOutline">
- <description>The JPA Structure view displays an outline of the structure (its attributes and mappings) of the entity that is currently selected or opened in the editor.</description>
- <topic label="JPA Structure view" href="ref_persistence_outline.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_generateEntities">
- <description>Use the Generate Entities dialog to create Java persistent entities based on your database tables.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm.htm" />
- <topic label="Project properties" href="ref_project_properties"/>
- </context>
- <context id="dialog_generateEntities_source">
- <description>The project folder name in which to generate the Java persistent entities. Click Browse to select an existing folder.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- </context>
- <context id="dialog_generateEntities_package">
- <description>The package in which to generate the Java persistent entities, or click Browse to select an existing package.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- </context>
- <context id="dialog_generateEntities_tables">
- <description>Select the tables from which to create Java persistent entities.</description>
- <topic label="Generating entities from tables" href="task_generate_entities.htm"/>
- <topic label="Project properties" href="ref_project_properties"/>
- </context>
- <context id="dialog_addJavaPersistence">
- <description>Use this dialog to define the database connection used to store the persistence entities and to create the persistence.xml file.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence.htm" />
- </context>
- <context id="dialog_newJPAProject">
- <description>Use this dialog to define the new JPA project name, its location, target runtime, and other configuration settings.</description>
- <topic label="New JPA Project page" href="ref_new_jpa_project.htm" />
- <topic label="New JPA Project wizard" href="ref_new_jpa_project_wizard" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- <topic label="Creating a new JPA project" href="task_create_new_project.htm" />
- </context>
- <context id="dialog_addJavaPersistence_database">
- <description>Use these fields to define the database connection used to store the persistent entities.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- </context>
- <context id="dialog_addJavaPersistence_classpath">
- <description>Use this option to add libraries or JARs that contain the Java Persistence API (JPA) and entities to the project’s Java Build Path.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Adding persistence to a project" href="task_add_persistence" />
- </context>
- <context id="dialog_addJavaPersistence_packaging">
- <description>Use these fields to create the persistence.xml file. Select the persistence version, the name of the JPA provider, and a unique name to identify the persistence unit.</description>
- <topic label="Add Persistence dialog" href="ref_add_persistence.htm" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence.htm" />
- </context>
- <context id="wizard_generateDDL_options ">
- <description>Use this page to select which script options will be included in the generated script.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Options page " href="ref_options.htm" />
- </context>
- <context id="wizard_generateDDL_objects ">
- <description>Use this page to select which elements will be included in the generated script.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Objects page " href="ref_objects.htm" />
- </context>
- <context id="wizard_generateDDL_save ">
- <description>Use this page to select the filename and location of the generated script. You can also preview the script and specify to run or continue editing the script after generation.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- <topic label="Save and Run DDL page " href="ref_save_and_run.htm" />
- </context>
- <context id="wizard_generateDDL_summary ">
- <description>This page shows the settings that you selected for the generated DDL. To change any option click "Back" or click "Finish" to continue.</description>
- <topic label="Generating tables (DDL) from entities " href="task_generate_ddl.htm" />
- </context>
- <context id="mapping_tableGeneratorName">
- <description>The name of the table sequence generator. This name is global to to the persistence unit (across all generator types).</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorTable">
- <description>The database table that stores the generated ID values. </description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorPrimaryKeyColumn">
- <description>The database column of the generator table that stores the generated ID values.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorValueColumn">
- <description>The name for the column that stores the generated ID values.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGeneratorPrimaryKeyColumnValue">
- <description>The database column of the generator table that defines the primary key value.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_databaseAuthorization">
- <description>Use to connect (log in) to a database connection to use with your Java persistent entities.
- You must have a defined database connection (and be connected) to add persistence. </description>
- <topic label="Add persistence to a Java project" href="task_add_persistence_project.htm"/>
- </context>
- <context id="mapping_temporal">
- <description>Specify if the mapped field contains a Date (java.sql.Date), Time (java.sql.Time), or Timestamp (java.sql.Timestamp) value.</description>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_primaryKeyGeneration">
- <description>Define how the primary key is generated</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_tableGenerator">
- <description>Specify to use a specific database table for generating the primary key.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGenerator">
- <description>Specify to use a specific sequence for generating the primary key.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGeneratorName">
- <description>Name of the sequence.</description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_sequenceGeneratorSequence">
- <description> </description>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_lob">
- <description>Specify if the field is mapped to java.sql.Clob or java.sql.Blob.</description>
- <topic label="General information" href="ref_mapping_general.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="mapping_enumerated">
- <description>Specify how to persist enumerated constraints if the String value suits your application requirements or to match an existing database schema.</description>
- <topic label="General information" href="ref_mapping_general.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="dialog_editInverseJoinColumn">
- <description>.</description>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- </context>
- <context id="entity_catalog">
- <description>The database catalog that contains the Table. This field overrides the defaults in the orm.xml file.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_schema">
- <description>The database schema that contains the Table. This field overrides the defaults in the orm.xml file.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Adding persistence to a class" href="task_add_persistence.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="orm_package">
- <description>The Java package that contains the persistent entities to which the orm.xml file applies.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_schema">
- <description>The database schema to use as the default for all entities managed by this persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_catalog">
- <description>The database catalog to use as the default for all entities managed by this persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_access">
- <description>The default access method for variables in this project: Property or Field.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_cascade">
- <description>Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="orm_xml">
- <description>Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Details" href="ref_details_orm.htm"/>
- </context>
- <context id="dialog_JPAPlatform">
- <description>Specify the vendor-specific JPA implementation.Default is Generic..</description>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm"/>
- </context>
- <context id="dialog_createORM">
- <description>Create an initial orm.xml file. Use this file to specify project and persistence unit defaults.</description>
- <topic label="Managing the orm.xml file" href="task_manage_orm.htm"/>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm"/>
- </context>
-
- <context id="caching_defaultType">
- <description>Select the default caching strategy for the project. The default is Weak with Soft Subcache.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="caching_defaultSize">
- <description>Select the default size of the cache. The default is 100 items.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="caching_defaultShared">
- <description>Specify if cached instances should be in the shared cache or in a client isolated cache.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_level">
- <description>Specifies the amount and detail of log output by selecting the log level. Default is Info level.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_timeStamp">
- <description>Control whether the timestamp is logged in each log entry. Default is True.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_thread">
- <description>Control whether a thread identifier is logged in each log entry. Default is True.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_session">
- <description>Control whether an EclipseLink session identifier is logged in each log entry. Default is True.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="logging_exceptions">
- <description>Control whether the exceptions thrown from within the code are logged prior to returning the exception to the calling application. Ensures that all exceptions are logged and not masked by the application code.. Default is False.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="options_sessionName">
- <description>Specify the name by which the EclipseLink session is stored in the static session manager.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="options_sessionsXml">
- <description>Specify persistence information loaded from the EclipseLink session configuration file. You can use this option as an alternative to annotations and deployment XML.</description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="options_targetDatabase">
- <description></description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="options_targetServer">
- <description> </description>
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="dialog_newJPAProjectJava">
- <description>Use this dialog to include existing Java source files in this project.</description>
- <topic label="Java page" href="ref_java_page.htm" />
- <topic label="New JPA Project wizard" href="ref_new_jpa_project_wizard" />
- <topic label="Creating a new JPA project" href="task_create_new_project.htm" />
- </context>
- <context id="dialog_newJPAProjectFacet">
- <description>Use this dialog to specify your vender-specific platform, JPA implementation library, and database connection.</description>
- <topic label="JPA Facet page" href="ref_jpa_facet.htm" />
- <topic label="New JPA Project wizard" href="ref_new_jpa_project_wizard" />
- <topic label="Creating a new JPA project" href="task_create_new_project.htm" />
- </context>
- <context id="dialog_entityClassPage">
- <description>Use this dialog to specify package, class name, and inheritance properties of the entity to create.</description>
- <topic label="Entity Class page" href="ref_EntityClassPage.htm" />
- <topic label="New JPA Entity wizard" href="ref_create_jpa_entity_wizard.htm" />
- <topic label="Creating a new JPA entity" href="task_create_jpa_entity.htm" />
- </context>
- <context id="dialog_entityPropertiesPage">
- <description>Use this dialog to specify the entity name, associated table, and mapped fields.</description>
- <topic label="Entity Properties page" href="ref_EntityPropertiesPage.htm" />
- <topic label="New JPA Entity wizard" href="ref_create_jpa_entity_wizard.htm" />
- <topic label="Creating a new JPA entity" href="task_create_jpa_entity.htm" />
- </context>
- <context id="dialog_selectTablesPage">
- <description>Use this dialog to specify the database tables from which to generate entities.</description>
- <topic label="Select Tables page" href="ref_selectTables.htm" />
- <topic label="Generate Custom Entities wizard" href="ref_create_custom_entities_wizard.htm" />
- </context>
- <context id="dialog_tableAssociationsPage">
- <description>Use this dialog to create or edit the association between the database table and entity.</description>
- <topic label="Table Associations page" href="ref_tableAssociations.htm" />
- <topic label="Generate Custom Entities wizard" href="ref_create_custom_entities_wizard.htm" />
- </context>
- <context id="dialog_customizeDefaultEntityGeneration">
- <description>Use this dialog to specify the table mapping and domain class information for the generated entity.</description>
- <topic label="Customize Default Entity Generation page" href="ref_customizeDefaultEntityGeneration.htm" />
- <topic label="Generate Custom Entities wizard" href="ref_create_custom_entities_wizard.htm" />
- </context>
- <context id="dialog_customizeIndividualEntities">
- <description>Use this dialog to specify the table mapping and domain class information for the generated entity.</description>
- <topic label="Customize Individual Entities page" href="ref_customizIndividualEntities.htm" />
- <topic label="Generate Custom Entities wizard" href="ref_create_custom_entities_wizard.htm" />
- </context>
-
- <context id="dialog_associationTablesPage">
- <description>Use this dialog to specify the association tables for an entity.</description>
- <topic label="Association Tables page" href="ref_association_tables.htm" />
- <topic label="Create New Association wizard" href="ref_create_new_association_wizard.htm" />
- </context>
- <context id="dialog_joinColumnsPage">
- <description>Use this dialog to specify the join columns of an association table.</description>
- <topic label="Join Columns page" href="ref_join_columns.htm" />
- <topic label="Create New Association wizard" href="ref_create_new_association_wizard.htm" />
- </context>
- <context id="dialog_associationCardinalityPage">
- <description>Use this dialog to specify cardinality of an association table.</description>
- <topic label="Association Cardinality page" href="ref_association_cardinality.htm" />
- <topic label="Create New Association wizard" href="ref_create_new_association_wizard.htm" />
- </context>
- <context id="dialog_selectCascade">
- <description>Specify which operations are propagated throughout the association: All, Persist, Merge, Remove, or Refresh.</description>
- <topic label="Select Cascade page" href="ref_select_cascade_dialog.htm"/>
- <topic label="JPA Details" href="ref_persistence_map_view.htm"/>
- <topic label="Mapping an entity" href="task_mapping.htm"/>
- <topic label="Understanding OR mappings" href="concept_mapping.htm"/>
- </context>
- <context id="persistence_general">
- <description>Specify the general persistence options.</description>
- <topic label="General page" href="ref_persistence_general" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_connection">
- <description>Specify the data source or JDBC connection properties.</description>
- <topic label="Connection page" href="ref_persistence_connection" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_customization">
- <description>Specify the default or entity specific EclipseLink customization and validation properties.</description>
- <topic label="Customization page" href="ref_persistence_connection" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_caching">
- <description>Configure the session or entity specific EclipseLink caching properties.</description>
- <topic label="Caching page" href="ref_persistence_caching" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_logging">
- <description>Configure the EclipseLink logging properties.</description>
- <topic label="Logging page" href="ref_persistence_logging" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_options">
- <description>Configure the EclipseLink session and miscellanous options.</description>
- <topic label="Options page" href="ref_persistence_options" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_schemaGeneration">
- <description>Configure the schema generation properties.</description>
- <topic label="Schema Generation page" href="ref_persistence_schemaGeneration" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_properties">
- <description>Configure the properties defined for the persistence unit.</description>
- <topic label="Properties page" href="ref_persistence_properties" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="persistence_source">
- <description>Configure the properties defined for the persistence unit.</description>
- <topic label="Properties page" href="ref_persistence_properties" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the persistence.xml file" href="task_manage_persistence" />
- </context>
- <context id="dialog_eclipselink_mapping_file">
- <description>Configure the properties defined for the persistence unit.</description>
- <topic label="New EclipseLink Mapping File page" href="ref_eclipselink_mapping_file" />
- <topic label="persistence.xml editor" href="ref_persistence_xml_editor" />
- <topic label="Managing the orm.xml file" href="task_manage_orm" />
- </context>
- <context id="dialog_create_new_converters">
- <description>Use this dialog to create a new EclipseLink conveter.</description>
- <topic label="Add Converter dialog" href="ref_add_converter" />
- <topic label="Managing the orm.xml file" href="task_manage_orm" />
- </context>
-
-<!-- Added for 2.3 -->
- <context id="properties_canonicalMetamodel">
- <description>Specifies if the project model uses the Canonical Metamodel. </description>
- <topic label="Project properties" href="ref_project_properties"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_cacheable">
- <description>Specify if the entity uses the @Cachable annotation. Default is @Cachable(false).</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Understanding persistence" href="concept_persistence.htm"/>
- </context>
- <context id="entity_primaryKeyClass">
- <description>Click Browse and select the primary key for the entity. Clicking the field name, which is represented as a hyperlink, allows you to create a new class.</description>
- <topic label="JPA Details" href="ref_persistence_prop_view.htm"/>
- <topic label="Primary Key Generation information" href="ref_primary_key.htm"/>
- </context>
- <context id="wizard_jaxbschema_classes">
- <description>Select the project, package, or classes from which to generate the XML schema. Click Finish to generate the schema</description>
- <topic label="Generate Schema from JAXB Classes wizard" href="ref_jaxb_schema_wizard.htm"/>
- <topic label="Generating schema from classes" href="task_generating_schema_from_classes.htm"/>
- </context>
- <context id="configure_jaxb_class_generation_dialog">
- <description>Enter the JAXB class generation settings and click Finish to generate classes. All fields are optional except for the source folder.</description>
- <topic label="Configure JAXB Class Generation dialog" href="ref_configure_jaxb_class_generation_dialog.htm"/>
- <topic label="Generating JAXB Classes from a Schema" href="task_generate_classes_from_schema.htm"/>
- </context>
-
-
-
-
-
-</contexts>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css b/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css
deleted file mode 100644
index baf6127928..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/css/blafdoc.css
+++ /dev/null
@@ -1,21 +0,0 @@
-@import "../../../PRODUCT_PLUGIN/book.css";
-
-span.control, span.gui-object-action, p.subhead2, span.bold, p.notep1 {
- font-weight: bold;
-}
-
-span.name, p.titleinfigure, span.italic {
- font-style: italic;
-}
-
-p.titleinfigure, p.subhead2 {
- padding-top: 10px;
-}
-
-span.code {
- font-family: monospace;
-}
-
-span.copyrightlogo {font-size: 0.8em}
-
-.footer {margin-top: 2em;border-top:1px solid #cccccc;padding-top:1em;} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm b/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm
deleted file mode 100644
index 382ec67619..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/dcommon/html/cpyr.htm
+++ /dev/null
@@ -1,11 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-
-<head>
-<!-- <meta http-equiv="refresh" content="0;url=../../legal.htm"> -->
-</head>
-<body>
-<p><a href="../../legal.htm">License Information</a></p>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm
deleted file mode 100644
index c993ad7ac6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started.htm
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Getting started</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Getting started" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref2" name="sthref2"></a></p>
-<h1>Getting started</h1>
-<p>This section provides information on getting started with the Java Persistence Tools.</p>
-<ul>
-<li>
-<p><a href="getting_started001.htm#BABEFHCD">Requirements and installation</a></p>
-</li>
-<li>
-<p><a href="getting_started002.htm#BABIGCJA">Dali quick start</a></p>
-</li>
-</ul>
-<p>For additional information, please visit the Dali home page at:</p>
-<p><code><a href="http://www.eclipse.org/webtools/dali">http://www.eclipse.org/webtools/dali</a></code>.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm
deleted file mode 100644
index 21cf961743..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started001.htm
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Requirements and installation</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Requirements and installation" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABEFHCD" name="BABEFHCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Requirements and installation<a id="sthref3" name="sthref3"></a><a id="sthref4" name="sthref4"></a></h1>
-<p>Before installing Dali, ensure that your environment meets the following <span class="italic">minimum</span> requirements:</p>
-<ul>
-<li>
-<p>Eclipse 3.6 (<code><a href="http://www.eclipse.org/downloads">http://www.eclipse.org/downloads</a></code>)</p>
-</li>
-<li>
-<p>Java Runtime Environment (JRE) 1.5 (<code><a href="http://java.com">http://java.com</a></code>)</p>
-</li>
-<li>
-<p>Eclipse Web Tools Platform (WTP) 3.2 (<code><a href="http://www.eclipse.org/webtools">http://www.eclipse.org/webtools</a></code>)</p>
-</li>
-<li>
-<p>Java Persistence API (JPA) for Java EE 5. For example, the EclipseLink implementation for JPA can be obtained from: <code><a href="http://www.eclipse.org/eclipselink/">http://www.eclipse.org/eclipselink/</a></code></p>
-</li>
-</ul>
-<p>Refer to <code><a href="http://www.eclipse.org/webtools/dali/gettingstarted_main.html">http://www.eclipse.org/webtools/dali/gettingstarted_main.html</a></code> for additional installation information.</p>
-<p><a id="sthref5" name="sthref5"></a>Dali is included as part of WTP 3.2. No additional installation or configuration is required.</p>
-<a id="sthref6" name="sthref6"></a>
-<p class="subhead2">Accessibility Features</p>
-<p>Dali supports the standard accessibility features in Eclipse, including the following:</p>
-<ul>
-<li>
-<p>Navigating the user interface using the keyboard.</p>
-</li>
-<li>
-<p>Specifying general accessibility preferences for the editor.</p>
-</li>
-</ul>
-<p>See <a href="../org.eclipse.platform.doc.user/concepts/accessibility/accessmain.htm">Accessibility Features in Eclipse</a> in the <span class="italic">Workbench User Guide</span> for details.</p>
-<a id="sthref7" name="sthref7"></a>
-<p class="subhead2">Help Accessibility</p>
-<p>The documentation and help contains markup to facilitate access by the disabled community. See <a href="../org.eclipse.platform.doc.user/tasks/help_accessibility.htm">Help Accessibility</a> in the <span class="italic">Workbench User Guide</span> for details.</p>
-<p>When using the help, be aware of the following:</p>
-<ul>
-<li>
-<p>Screen readers may not always correctly read the code examples in this document. The conventions for writing code require that closing braces should appear on an otherwise empty line; however, some screen readers may not always read a line of text that consists solely of a bracket or brace.</p>
-</li>
-<li>
-<p>This documentation may contain links to Web sites of other companies or organizations that we do not control. We neither evaluate nor make any representations regarding the accessibility of these Web sites.</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm
deleted file mode 100644
index 3285315b65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started002.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Dali quick start</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali quick start" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIGCJA" name="BABIGCJA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Dali quick start</h1>
-<p><a id="sthref8" name="sthref8"></a>This section includes information to help you quickly start using Dali to create relational mappings between Java persistent entities and database tables.</p>
-<ul>
-<li>
-<p><a href="getting_started003.htm#BABDFHDA">Creating a new JPA project</a></p>
-</li>
-<li>
-<p><a href="getting_started004.htm#BABFGDDG">Creating a Java persistent entity with persistent fields</a></p>
-</li>
-</ul>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="tips_and_tricks.htm#CHDHGHBF">Tips and tricks</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm
deleted file mode 100644
index 2cbac78532..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started003.htm
+++ /dev/null
@@ -1,105 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating a new JPA project</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDFHDA" name="BABDFHDA"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Creating a new JPA project</h1>
-<p><a id="sthref9" name="sthref9"></a>This quick start shows how to create a new JPA project.</p>
-<ol>
-<li>
-<p><span class="bold">Select File &gt; New &gt; Project</span>. The Select a Wizard dialog appears.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also select the JPA perspective and then select <span class="bold">File &gt; New &gt; JPA Project</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-</li>
-<li>
-<p>Select <span class="bold">JPA Project</span> and then click <span class="bold">Next</span>. The <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> appears.</p>
-</li>
-<li>
-<p>Enter a <span class="gui-object-action">Project name</span> (such as <code>QuickStart</code>).</p>
-</li>
-<li>
-<p>If needed, select the <span class="bold">Target Runtime</span> (such as <code>Apache Tomcat</code>) and configuration, such as <span class="bold">Utility JPA Project with Java 5.0</span> and then click <span class="bold">Next</span>. The Java source page appears.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Target Runtime is not required for Java SE development.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>If you have existing Java source files, add them to your classpath and then click <span class="bold">Next</span>. The <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p>
-</li>
-<li>
-<p>On the JPA Facet dialog, select your vendor-specific JPA platform (or select <span class="bold">Generic</span>), database connection (or create a new connection), JPA implementation library (such as EclipseLink), define how Dali should manage persistent classes, and then click <span class="bold">Finish</span>.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-Select <span class="bold">Override the Default Schema for Connection</span> if you require a schema other than the one that Dali derives from the connection information, which may be incorrect in some cases. Using this option, you can select a development time schema for defaults and validation.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-</li>
-</ol>
-<p>Eclipse adds the project to the workbench and opens the JPA perspective.</p>
-<div class="figure"><a id="sthref10" name="sthref10"></a>
-<p class="titleinfigure">JPA Project in Project Explorer</p>
-<img src="img/quickstart_project.png" alt="Package Explorer showing the JPA project." title="Package Explorer showing the JPA project." /><br /></div>
-<!-- class="figure" -->
-<p>Now that you have created a project with persistence, you can continue with <a href="getting_started004.htm#BABFGDDG">Creating a Java persistent entity with persistent fields</a>.</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
deleted file mode 100644
index 249ea76a96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/getting_started004.htm
+++ /dev/null
@@ -1,204 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating a Java persistent entity with persistent fields</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a Java persistent entity with persistent fields" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFGDDG" name="BABFGDDG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Creating a Java persistent entity with persistent fields</h1>
-<p><a id="sthref11" name="sthref11"></a>This quick start shows how to create a new persistent Java entity. We will create an entity to associate with a database table. You will also need to add the ADDRESS table to your database.</p>
-<ol>
-<li>
-<p>Select the JPA project in the Navigator or Project Explorer and then click <span class="bold">New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-</li>
-<li>
-<p>Select <span class="bold">JPA &gt; Entity</span> and then click <span class="bold">Next</span>. The <a href="ref_EntityClassPage.htm#CIAFEIGF">Entity Class page</a> appears.</p>
-</li>
-<li>
-<p>Enter the package name (such as <code>quickstart.demo.model</code>), the class name (such as <code>Address</code>) and then click <span class="bold">Next</span>. The <a href="ref_EntityPropertiesPage.htm#CIADECIA">Entity Properties page</a> appears, which enables you to define the persistence fields, which you will map to the columns of a database table.</p>
-</li>
-<li>
-<p><a id="sthref12" name="sthref12"></a><a id="sthref13" name="sthref13"></a>Use the Entity Fields dialog (invoked by clicking <span class="bold">Add</span>) to add persistence fields to the Address class:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-private Long id;
-private String city;
-private String country;
-private String stateOrProvince;
-private String postalCode;
-private String street;
-</pre>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-You will also need to add the following columns to the ADDRESS database table:
-<pre xml:space="preserve" class="oac_no_warn">
-NUMBER(10,0) ADDRESS_ID (primary key)
-VARCHAR2(80) PROVINCE
-VARCHAR2(80) COUNTRY
-VARCHAR2(20) P_CODE
-VARCHAR2(80) STREET
-VARCHAR2(80) CITY
-</pre>
-<pre xml:space="preserve" class="oac_no_warn">
-</pre></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>. With the Create JPA Entity completed, Eclipse displays the <span class="bold">Address</span> entity in the JPA Structure view.</p>
-<p>Address.java includes the <code>@Entity</code> annotation, the persistence fields, as well as <code>getter</code> and <code>setter</code> methods for each of the fields.</p>
-</li>
-</ol>
-<div class="figure"><a id="sthref14" name="sthref14"></a>
-<p class="titleinfigure">Address Entity in Address.java</p>
-<img src="img/java_editor_address.png" alt="Java editor with the Address entity." title="Java editor with the Address entity." /><br /></div>
-<!-- class="figure" -->
-<p>Eclipse also displays the <span class="bold">Address</span> entity in the JPA Structure view:</p>
-<div class="figure"><a id="sthref15" name="sthref15"></a>
-<p class="titleinfigure">Address Entity in the JPA Structure View</p>
-<img src="img/address_java_JPA_structure_quickstart.png" alt="Address.java in the JPA Structure View." title="Address.java in the JPA Structure View." /><br /></div>
-<!-- class="figure" -->
-<ol>
-<li>
-<p>Select the <span class="gui-object-action">Address</span> class in the Project Explorer view.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, notice that Dali has automatically associated the ADDRESS database table with the entity because they are named identically.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Depending on your database connection type, you may need to specify the <span class="bold">Schema</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="figure"><a id="sthref16" name="sthref16"></a>
-<p class="titleinfigure">JPA Details View for Address Entity</p>
-<img src="img/address.java_jpa_details.png" alt="Address.java in the JPA Details view." title="Address.java in the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-After associating the entity with the database table, you should update the <code>persistence.xml</code> file to include this JPA entity.
-<p>Right-click the <code>persistence.xml</code> file in the Project Explorer and select <span class="bold">JPA Tools &gt; Synchronize Class List</span>. Dali adds the following to the <code>persistence.xml</code> file:</p>
-<p><code>&lt;class&gt;quickstart.demo.model.Address&lt;/class&gt;</code></p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<p>Now we are ready to map each fields in the Address class to a column in the database table.</p>
-<ol>
-<li>
-<p>Select the <span class="gui-object-action">id</span> field in the JPA Details view.</p>
-</li>
-<li>
-<p>Right click id and then select <span class="bold">Map As &gt; id</span>.</p>
-</li>
-<li>
-<p>In the JPA Details view, select <span class="bold">ADDRESS_ID</span> in the Name field:</p>
-<div class="figure"><a id="sthref17" name="sthref17"></a>
-<p class="titleinfigure">JPA Details View for the addressId Field</p>
-<img src="img/address_id_details_quickstart.png" alt="The JPA Details view for the Address entity&rsquo;s id attribute." title="The JPA Details view for the Address entity&rsquo;s id attribute." /><br /></div>
-<!-- class="figure" -->
-<p>Eclipse adds the following annotations to the Address entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Id
-@Column(name="ADDRESS_ID")
-</pre></li>
-<li>
-<p>Map each of the following fields (as <span class="bold">Basic</span> mappings) to the appropriate database column:</p>
-<div class="inftblhruleinformal">
-<table class="HRuleInformal" title="This table describes the mappings for each of the fields in the Address entity." summary="This table describes the mappings for each of the fields in the Address entity." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="*" />
-<col width="33%" />
-<col width="33%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Field</th>
-<th align="left" valign="bottom" id="r1c2-t8">Map As</th>
-<th align="left" valign="bottom" id="r1c3-t8">Database Column</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">city</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r2c1-t8 r1c3-t8">CITY</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8">country</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r3c1-t8 r1c3-t8">COUNTRY</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">postalCode</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r4c1-t8 r1c3-t8">P_CODE</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t8" headers="r1c1-t8">provinceOrState</td>
-<td align="left" headers="r5c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r5c1-t8 r1c3-t8">PROVINCE</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t8" headers="r1c1-t8">street</td>
-<td align="left" headers="r6c1-t8 r1c2-t8">Basic</td>
-<td align="left" headers="r6c1-t8 r1c3-t8">STREET</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformal" --></li>
-</ol>
-<p>Dali automatically maps some fields to the correct database column (such as the city field to the City column) if the names are identical.</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.png
deleted file mode 100644
index bdcf00838f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address.java_jpa_details.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.png
deleted file mode 100644
index 7ef40cf6c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_id_details_quickstart.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.png
deleted file mode 100644
index 1af51a9f9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/address_java_JPA_structure_quickstart.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.png
deleted file mode 100644
index 0360e0a86c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_entity_wizard.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.png
deleted file mode 100644
index 69797a803c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/create_jpa_fields.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_default_entity_generation.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_default_entity_generation.png
deleted file mode 100644
index 9567616b7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_default_entity_generation.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_individual_entities.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_individual_entities.png
deleted file mode 100644
index 237bdee290..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/customize_individual_entities.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png
deleted file mode 100644
index d66300e421..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/details_entitymappings.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png
deleted file mode 100644
index 3a4964632c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/error_sample.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_classes_from_schema.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_classes_from_schema.png
deleted file mode 100644
index b911d0280b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_classes_from_schema.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png
deleted file mode 100644
index 4daa25c7c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/generate_entities.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapmappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapmappings.png
deleted file mode 100644
index 86eef3abe4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapmappings.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png
deleted file mode 100644
index b193753e98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/icon_basicmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png
deleted file mode 100644
index 22b6875f4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_join.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png
deleted file mode 100644
index 3146482609..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_single.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png
deleted file mode 100644
index b76dd9faf3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/inheritance_tab.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png
deleted file mode 100644
index 47428906e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/java_editor_address.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/jaxb_schmea_generation_dialog.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/jaxb_schmea_generation_dialog.png
deleted file mode 100644
index c9b222e8cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/jaxb_schmea_generation_dialog.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.png
deleted file mode 100644
index 30550ea033..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/jpa_wizard_create_fields.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.png
deleted file mode 100644
index 2b616033dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapped_entity_type_link.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.png
deleted file mode 100644
index 3355741af7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_file_new.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.png
deleted file mode 100644
index 086ea6e9eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_embed.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.png
deleted file mode 100644
index 2604fd9284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.png
deleted file mode 100644
index e28e8fa168..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/mapping_type_selection_superclass.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/modify_faceted_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/modify_faceted_project.png
deleted file mode 100644
index f4c7968a69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/modify_faceted_project.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.png
deleted file mode 100644
index 1b0b7ff4bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_basicmappings.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.png
deleted file mode 100644
index 48294edaf6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddableentitymapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.png
deleted file mode 100644
index abe9dc8d20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedidmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.png
deleted file mode 100644
index 44d52b8bc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_embeddedmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.png
deleted file mode 100644
index fdefb5d781..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_idmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.png
deleted file mode 100644
index eb8022e16c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytomanymapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.png
deleted file mode 100644
index ccacc19f1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_manytoonemapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.png
deleted file mode 100644
index 398ea2c11f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedentity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.png
deleted file mode 100644
index fc97ceb1fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_mappedsuperclass.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.png
deleted file mode 100644
index 5ddc989dfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetomanymapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.png
deleted file mode 100644
index 74d9bbd66c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_onetoonemapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.png
deleted file mode 100644
index 750488f49d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_transientmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.png
deleted file mode 100644
index a87371215b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_icon_versionmapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.png
deleted file mode 100644
index 7607808317..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_facet_task.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.png
deleted file mode 100644
index 07425ad08a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_perspective_button.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.png
deleted file mode 100644
index ab079c2484..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/new_jpa_project_task.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png
deleted file mode 100644
index 88381a5a80..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelc.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png
deleted file mode 100644
index 4bbc744806..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelr.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png
deleted file mode 100644
index 60af21f5ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/ngrelt.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png
deleted file mode 100644
index 769aa825e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/persistence_outline_view.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.png
deleted file mode 100644
index 97557ee963..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/project_properties_tasks.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png
deleted file mode 100644
index 48ca05099b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/quickstart_project.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png
deleted file mode 100644
index a41f9f53ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/secondary_tables.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.png
deleted file mode 100644
index 2cebe90add..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.png
deleted file mode 100644
index 182350246d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_jpa_project.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.png
deleted file mode 100644
index 049c9d15b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_a_wizard_mapping.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_jaxb_schema_wizard.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_jaxb_schema_wizard.png
deleted file mode 100644
index 587e61c9c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_jaxb_schema_wizard.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_tables.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/select_tables.png
deleted file mode 100644
index a57c9314c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/select_tables.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png
deleted file mode 100644
index a359f64651..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/synchornize_classes.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_associations.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/table_associations.png
deleted file mode 100644
index b5b40be797..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_associations.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png
deleted file mode 100644
index 1aa1dbe059..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/table_entity.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.png
deleted file mode 100644
index e8beaceb79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/task_entering_query.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/img/upgrade_persistence_jpa_version.png b/jpa/plugins/org.eclipse.jpt.doc.user/img/upgrade_persistence_jpa_version.png
deleted file mode 100644
index 96fa4d27c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/img/upgrade_persistence_jpa_version.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml b/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
deleted file mode 100644
index acf9beb953..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/index.xml
+++ /dev/null
@@ -1,668 +0,0 @@
-<?xml version='1.0' encoding='iso-8859-1'?>
-<index version="1.0">
- <entry keyword="@Basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref116" /></entry>
- </entry>
- <entry keyword="@Column">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref245" /></entry>
- </entry>
- <entry keyword="@DiscriminatorColumn">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref96" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref239" /></entry>
- </entry>
- <entry keyword="@DiscriminatorValue">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref98" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref237" /></entry>
- </entry>
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref81" /></entry>
- </entry>
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref120" /></entry>
- </entry>
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref124" /></entry>
- </entry>
- <entry keyword="@Entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref74" /></entry>
- </entry>
- <entry keyword="@Enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref255" /></entry>
- </entry>
- <entry keyword="@GeneratedValue">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref265" /></entry>
- </entry>
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref128" /></entry>
- </entry>
- <entry keyword="@Inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref94" /></entry>
- </entry>
- <entry keyword="@JoinColumn">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref139" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref149" /></entry>
- <entry keyword="Join Table Information"><topic href="reference011.htm#sthref261" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference012.htm#sthref264" /></entry>
- </entry>
- <entry keyword="@Lob">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref250" /></entry>
- </entry>
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref132" /></entry>
- </entry>
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref137" /></entry>
- </entry>
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref88" /></entry>
- </entry>
- <entry keyword="@NamedQuery">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref108" /></entry>
- </entry>
- <entry keyword="@OneToMany">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref142" /></entry>
- </entry>
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref146" /></entry>
- </entry>
- <entry keyword="@OrderBy">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref259" /></entry>
- </entry>
- <entry keyword="@SequenceGenerator">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref267" /></entry>
- </entry>
- <entry keyword="@Temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref252" /></entry>
- </entry>
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref152" /></entry>
- </entry>
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref156" /></entry>
- </entry>
- <entry keyword="architecture of Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference033.htm#sthref303" /></entry>
- </entry>
- <entry keyword="association tables">
- <entry keyword="Create New Association"><topic href="ref_create_new_association_wizard.htm#sthref221" /></entry>
- </entry>
- <entry keyword="attribute overrides">
- <entry keyword="Attribute overrides"><topic href="reference007.htm#sthref228" /></entry>
- </entry>
- <entry keyword="Attribute Overrides - in Java Details view">
- <entry keyword="Attribute overrides"><topic href="reference007.htm#sthref230" /></entry>
- </entry>
- <entry keyword="attributes">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref244" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref21" /></entry>
- </entry>
- </entry>
- <entry keyword="basic mapping">
- <entry keyword="@Basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref117" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref115" /></entry>
- </entry>
- <entry keyword="(See also mappings)"></entry>
- </entry>
- <entry keyword="caching">
- <entry keyword="Caching"><topic href="reference020.htm#sthref278" /></entry>
- </entry>
- <entry keyword="canonical metamodel">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref298" /></entry>
- </entry>
- <entry keyword="cardinality - association tables">
- <entry keyword="Association Cardinality"><topic href="ref_association_cardinality.htm#sthref224" /></entry>
- </entry>
- <entry keyword="classes">
- <entry keyword="adding persistence to">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref69" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref80" /></entry>
- </entry>
- <entry keyword="entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref72" /></entry>
- </entry>
- <entry keyword="generating schema from">
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref190" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref198" /></entry>
- </entry>
- <entry keyword="managed">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref50" /></entry>
- </entry>
- <entry keyword="managing persistent classes">
- <entry keyword="JPA Facet page"><topic href="ref_jpa_facet.htm#sthref207" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref86" /></entry>
- </entry>
- <entry keyword="synchronizing">
- <entry keyword="Synchronizing classes"><topic href="tasks002.htm#sthref52" /></entry>
- </entry>
- </entry>
- <entry keyword="columns">
- <entry keyword="discriminator">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref97" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref240" /></entry>
- </entry>
- <entry keyword="join">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref138" /></entry>
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref148" /></entry>
- <entry keyword="Join Table Information"><topic href="reference011.htm#sthref260" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference012.htm#sthref263" /></entry>
- </entry>
- <entry keyword="mapping to">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref246" /></entry>
- </entry>
- <entry keyword="value">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref99" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref238" /></entry>
- </entry>
- </entry>
- <entry keyword="connection pool">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref51" /></entry>
- </entry>
- <entry keyword="converting Java project to JPA">
- <entry keyword="Converting a Java Project to a JPA Project"><topic href="tasks001.htm#sthref37" /></entry>
- </entry>
- <entry keyword="Create a JPA Project Wizard">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref29" /></entry>
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref194" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref202" /></entry>
- </entry>
- <entry keyword="Create New JPA Project wizard">
- <entry keyword="Create New JPA Project wizard"><topic href="ref_new_jpa_project_wizard.htm#sthref204" /></entry>
- </entry>
- <entry keyword="database tables">
- <entry keyword="generating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks021.htm#sthref161" /></entry>
- </entry>
- </entry>
- <entry keyword="database - persistence">
- <entry keyword="connection">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref293" /></entry>
- </entry>
- <entry keyword="schema">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref295" /></entry>
- </entry>
- </entry>
- <entry keyword="derived ID">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref257" /></entry>
- </entry>
- <entry keyword="developer documentation - Dali">
- <entry keyword="Dali Developer Documentation"><topic href="reference033.htm#sthref302" /></entry>
- </entry>
- <entry keyword="eager fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref248" /></entry>
- </entry>
- <entry keyword="embeddable class">
- <entry keyword="@Embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref82" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref79" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded ID mapping">
- <entry keyword="@EmbeddedId">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref125" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref123" /></entry>
- </entry>
- </entry>
- <entry keyword="embedded mapping">
- <entry keyword="@Embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref121" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref119" /></entry>
- </entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="@Entity annotation">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref75" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref20" /></entry>
- </entry>
- <entry keyword="creating">
- <entry keyword="Creating a JPA Entity"><topic href="task_create_jpa_entity.htm#sthref40" /></entry>
- </entry>
- <entry keyword="customizing">
- <entry keyword="Customize Individual Entities"><topic href="ref_customizIndividualEntities.htm#sthref220" /></entry>
- </entry>
- <entry keyword="embeddable">
- <entry keyword="Embeddable"><topic href="tasks007.htm#sthref83" /></entry>
- </entry>
- <entry keyword="from tables">
- <entry keyword="Generating entities from tables"><topic href="tasks021.htm#sthref158" /></entry>
- <entry keyword="Select Tables"><topic href="ref_selectTables.htm#sthref216" /></entry>
- </entry>
- <entry keyword="generating">
- <entry keyword="Customize Default Entity Generation"><topic href="ref_customizeDefaultEntityGeneration.htm#sthref219" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref227" /></entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref89" /></entry>
- </entry>
- <entry keyword="mapping">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref13" /></entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref11" /></entry>
- </entry>
- <entry keyword="persistent">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref70" /></entry>
- <entry keyword="Entity"><topic href="tasks006.htm#sthref76" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference008.htm#sthref233" /></entry>
- </entry>
- </entry>
- <entry keyword="Entity Class page">
- <entry keyword="Selecting the Create a JPA Entity Wizard"><topic href="task_create_jpa_entity.htm#sthref43" /></entry>
- </entry>
- <entry keyword="Entity Properties page">
- <entry keyword="&lt;a id=&quot;sthref43&quot; name=&quot;sthref43&quot;&gt;&lt;/a&gt;The Entity Class Page"><topic href="task_create_jpa_entity.htm#sthref45" /></entry>
- </entry>
- <entry keyword="enumerated">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref254" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref256" /></entry>
- </entry>
- <entry keyword="error messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks023.htm#sthref167" /></entry>
- <entry keyword="Error messages"><topic href="tasks024.htm#sthref172" /></entry>
- </entry>
- <entry keyword="extension points - Dali feature">
- <entry keyword="Dali Developer Documentation"><topic href="reference033.htm#sthref304" /></entry>
- </entry>
- <entry keyword="fetch type">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref247" /></entry>
- </entry>
- <entry keyword="Generate Entities from Tables dialog">
- <entry keyword="Generating entities from tables"><topic href="tasks021.htm#sthref160" /></entry>
- <entry keyword="Select Tables"><topic href="ref_selectTables.htm#sthref215" /></entry>
- </entry>
- <entry keyword="Generate Schema from Classes wizard">
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref192" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref200" /></entry>
- </entry>
- <entry keyword="generated values">
- <entry keyword="ID mappings">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref266" /></entry>
- </entry>
- <entry keyword="sequence">
- <entry keyword="Primary Key Generation information"><topic href="ref_primary_key.htm#sthref268" /></entry>
- </entry>
- </entry>
- <entry keyword="hints - query">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref110" /></entry>
- </entry>
- <entry keyword="ID mapping">
- <entry keyword="@Id">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref129" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref127" /></entry>
- </entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="entity">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref93" /></entry>
- <entry keyword="Entity Class page"><topic href="ref_EntityClassPage.htm#sthref209" /></entry>
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref236" /></entry>
- </entry>
- <entry keyword="joined tables">
- <entry keyword="Single Table Inheritance"><topic href="task_inheritance.htm#sthref105" /></entry>
- </entry>
- <entry keyword="single table">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref100" /></entry>
- </entry>
- </entry>
- <entry keyword="Inheritance - in Java Details view">
- <entry keyword="Inheritance information"><topic href="reference009.htm#sthref235" /></entry>
- </entry>
- <entry keyword="installation - Dali">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref3" /></entry>
- </entry>
- <entry keyword="Java project - converting to JPA">
- <entry keyword="Converting a Java Project to a JPA Project"><topic href="tasks001.htm#sthref35" /></entry>
- </entry>
- <entry keyword="JAXB">
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref191" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref199" /></entry>
- </entry>
- <entry keyword="join columns">
- <entry keyword="Join Columns"><topic href="ref_join_columns.htm#sthref223" /></entry>
- <entry keyword="Join Columns Information"><topic href="reference012.htm#sthref262" /></entry>
- </entry>
- <entry keyword="joined tables - inheritance">
- <entry keyword="Single Table Inheritance"><topic href="task_inheritance.htm#sthref106" /></entry>
- </entry>
- <entry keyword="JPA Details view">
- <entry keyword="attributes">
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref242" /></entry>
- </entry>
- <entry keyword="entities">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref225" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Development perspective">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref300" /></entry>
- </entry>
- <entry keyword="JPA Facet page">
- <entry keyword="The Java Source Page"><topic href="task_create_new_project.htm#sthref34" /></entry>
- </entry>
- <entry keyword="JPA project">
- <entry keyword="converting from Java">
- <entry keyword="Converting a Java Project to a JPA Project"><topic href="tasks001.htm#sthref36" /></entry>
- </entry>
- <entry keyword="creating new">
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref27" /></entry>
- </entry>
- <entry keyword="implementation">
- <entry keyword="JPA Facet page"><topic href="ref_jpa_facet.htm#sthref205" /></entry>
- </entry>
- <entry keyword="page">
- <entry keyword="&lt;a id=&quot;sthref29&quot; name=&quot;sthref29&quot;&gt;&lt;/a&gt;Selecting the Create a JPA Project wizard"><topic href="task_create_new_project.htm#sthref31" /></entry>
- <entry keyword="&lt;a id=&quot;sthref194&quot; name=&quot;sthref194&quot;&gt;&lt;/a&gt;Selecting the Schema from JAXB Classes wizard"><topic href="task_generating_schema_from_classes.htm#sthref196" /></entry>
- </entry>
- <entry keyword="platform">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref292" /></entry>
- </entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref270" /></entry>
- </entry>
- <entry keyword="lazy fetch">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref249" /></entry>
- </entry>
- <entry keyword="library - JPA">
- <entry keyword="JPA Facet page"><topic href="ref_jpa_facet.htm#sthref206" /></entry>
- </entry>
- <entry keyword="many-to-many mapping">
- <entry keyword="@ManyToMany">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref133" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref131" /></entry>
- </entry>
- </entry>
- <entry keyword="many-to-one mapping">
- <entry keyword="@ManyToOne">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref136" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref135" /></entry>
- </entry>
- </entry>
- <entry keyword="mapped superclass">
- <entry keyword="@MappedSuperclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref87" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref85" /></entry>
- </entry>
- </entry>
- <entry keyword="mapping entities">
- <entry keyword="Creating a Java persistent entity with persistent fields"><topic href="getting_started004.htm#sthref12" /></entry>
- </entry>
- <entry keyword="mapping file">
- <entry keyword="&lt;a id=&quot;sthref58&quot; name=&quot;sthref58&quot;&gt;&lt;/a&gt;Managing the orm.xml file"><topic href="tasks004.htm#sthref61" /></entry>
- <entry keyword="Entity Class page"><topic href="ref_EntityClassPage.htm#sthref210" /></entry>
- </entry>
- <entry keyword="mappings">
- <entry keyword="about">
- <entry keyword="Understanding OR mappings"><topic href="concept_mapping.htm#sthref22" /></entry>
- </entry>
- <entry keyword="basic">
- <entry keyword="Basic mapping"><topic href="tasks010.htm#sthref114" /></entry>
- </entry>
- <entry keyword="embedded">
- <entry keyword="Embedded mapping"><topic href="tasks011.htm#sthref118" /></entry>
- </entry>
- <entry keyword="embedded ID">
- <entry keyword="Embedded ID mapping"><topic href="tasks012.htm#sthref122" /></entry>
- </entry>
- <entry keyword="ID">
- <entry keyword="ID mapping"><topic href="tasks013.htm#sthref126" /></entry>
- </entry>
- <entry keyword="many-to-many">
- <entry keyword="Many-to-many mapping"><topic href="tasks014.htm#sthref130" /></entry>
- </entry>
- <entry keyword="many-to-one">
- <entry keyword="Many-to-one mapping"><topic href="tasks015.htm#sthref134" /></entry>
- </entry>
- <entry keyword="one-to-many">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref140" /></entry>
- </entry>
- <entry keyword="one-to-one">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref144" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks023.htm#sthref170" /></entry>
- </entry>
- <entry keyword="transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref150" /></entry>
- </entry>
- <entry keyword="version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref154" /></entry>
- </entry>
- </entry>
- <entry keyword="metamodel - canonical">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref299" /></entry>
- </entry>
- <entry keyword="named queries">
- <entry keyword="entity">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref107" /></entry>
- </entry>
- <entry keyword="hints">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref111" /></entry>
- </entry>
- </entry>
- <entry keyword="native queries">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref112" /></entry>
- </entry>
- <entry keyword="nonpersistent">
- <entry keyword="classes">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref68" /></entry>
- </entry>
- <entry keyword="fields. See transient"></entry>
- </entry>
- <entry keyword="one-to-many mapping">
- <entry keyword="@OneToMany">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref143" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-many mapping"><topic href="tasks016.htm#sthref141" /></entry>
- </entry>
- </entry>
- <entry keyword="one-to-one mapping">
- <entry keyword="@OneToOne">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref147" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="One-to-one mapping"><topic href="tasks017.htm#sthref145" /></entry>
- </entry>
- </entry>
- <entry keyword="ordering">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref258" /></entry>
- </entry>
- <entry keyword="orm.xml file">
- <entry keyword="about">
- <entry keyword="The orm.xml file"><topic href="concepts003.htm#sthref24" /></entry>
- </entry>
- <entry keyword="creating">
- <entry keyword="JPA Facet page"><topic href="ref_jpa_facet.htm#sthref208" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref58" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the orm.xml file"><topic href="task_manage_orm.htm#sthref59" /></entry>
- </entry>
- </entry>
- <entry keyword="overrides - JPA attributes">
- <entry keyword="Attribute overrides"><topic href="reference007.htm#sthref229" /></entry>
- </entry>
- <entry keyword="persistence">
- <entry keyword="about">
- <entry keyword="Understanding Java persistence"><topic href="concept_persistence.htm#sthref19" /></entry>
- </entry>
- <entry keyword="database connection">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref294" /></entry>
- </entry>
- <entry keyword="database schema">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref297" /></entry>
- </entry>
- <entry keyword="entity class">
- <entry keyword="Adding persistence to a class"><topic href="task_add_persistence.htm#sthref67" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - Java Persistence Options"><topic href="ref_project_properties.htm#sthref287" /></entry>
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref289" /></entry>
- </entry>
- <entry keyword="provider">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref49" /></entry>
- </entry>
- </entry>
- <entry keyword="persistence.xml file">
- <entry keyword="about">
- <entry keyword="The persistence.xml file"><topic href="concepts002.htm#sthref23" /></entry>
- </entry>
- <entry keyword="managing">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref47" /></entry>
- <entry keyword="Working with orm.xml file"><topic href="tasks005.htm#sthref65" /></entry>
- </entry>
- <entry keyword="sample">
- <entry keyword="Managing the persistence.xml file"><topic href="task_manage_persistence.htm#sthref48" /></entry>
- </entry>
- <entry keyword="synchronizing with classes">
- <entry keyword="Synchronizing classes"><topic href="tasks002.htm#sthref53" /></entry>
- </entry>
- </entry>
- <entry keyword="persistent entity">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref71" /></entry>
- </entry>
- <entry keyword="perspective - JPA Development">
- <entry keyword="JPA Development perspective"><topic href="ref_persistence_perspective.htm#sthref301" /></entry>
- </entry>
- <entry keyword="platform - JPA">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref291" /></entry>
- </entry>
- <entry keyword="problems">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks023.htm#sthref169" /></entry>
- </entry>
- <entry keyword="projects - JPA">
- <entry keyword="creating new">
- <entry keyword="Creating a new JPA project"><topic href="getting_started003.htm#sthref9" /></entry>
- <entry keyword="Creating a new JPA project"><topic href="task_create_new_project.htm#sthref26" /></entry>
- </entry>
- <entry keyword="options">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref290" /></entry>
- </entry>
- <entry keyword="validation preferences">
- <entry keyword="Project Properties page - Java Persistence Options"><topic href="ref_project_properties.htm#sthref288" /></entry>
- </entry>
- </entry>
- <entry keyword="query hints">
- <entry keyword="Creating Named Queries"><topic href="tasks009.htm#sthref109" /></entry>
- </entry>
- <entry keyword="quick start - Dali">
- <entry keyword="Dali quick start"><topic href="getting_started002.htm#sthref8" /></entry>
- </entry>
- <entry keyword="requirements">
- <entry keyword="Dali Java Persistence Tools">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref4" /></entry>
- </entry>
- <entry keyword="persistent entities">
- <entry keyword="Entity"><topic href="tasks006.htm#sthref73" /></entry>
- </entry>
- </entry>
- <entry keyword="schema">
- <entry keyword="from classes">
- <entry keyword="Generating Schema from Classes"><topic href="task_generating_schema_from_classes.htm#sthref189" /></entry>
- <entry keyword="Generating JAXB Classes from a Schema"><topic href="task_generate_classes_from_schema.htm#sthref197" /></entry>
- </entry>
- </entry>
- <entry keyword="schema - database">
- <entry keyword="Project Properties page - Validation Preferences"><topic href="reference027.htm#sthref296" /></entry>
- </entry>
- <entry keyword="secondary tables">
- <entry keyword="Secondary table information"><topic href="reference008.htm#sthref231" /></entry>
- </entry>
- <entry keyword="Secondary Tables - in Java Details view">
- <entry keyword="Secondary table information"><topic href="reference008.htm#sthref234" /></entry>
- </entry>
- <entry keyword="single table inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref101" /></entry>
- </entry>
- <entry keyword="superclass">
- <entry keyword="Mapped superclass"><topic href="tasks008.htm#sthref90" /></entry>
- </entry>
- <entry keyword="synchronizing classes with persistence.xml file">
- <entry keyword="Synchronizing classes"><topic href="tasks002.htm#sthref54" /></entry>
- </entry>
- <entry keyword="tables">
- <entry keyword="associations">
- <entry keyword="Table Associations"><topic href="ref_tableAssociations.htm#sthref218" /></entry>
- <entry keyword="Create New Association"><topic href="ref_create_new_association_wizard.htm#sthref222" /></entry>
- </entry>
- <entry keyword="creating entities from">
- <entry keyword="Generating entities from tables"><topic href="tasks021.htm#sthref159" /></entry>
- <entry keyword="Select Tables"><topic href="ref_selectTables.htm#sthref217" /></entry>
- </entry>
- <entry keyword="inheritance">
- <entry keyword="Specifying entity inheritance"><topic href="task_inheritance.htm#sthref102" /></entry>
- </entry>
- <entry keyword="secondary">
- <entry keyword="Secondary table information"><topic href="reference008.htm#sthref232" /></entry>
- </entry>
- </entry>
- <entry keyword="temporal">
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref251" /></entry>
- <entry keyword="General information"><topic href="ref_mapping_general.htm#sthref253" /></entry>
- </entry>
- <entry keyword="transient mapping">
- <entry keyword="@Transient">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref153" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Transient mapping"><topic href="tasks018.htm#sthref151" /></entry>
- </entry>
- </entry>
- <entry keyword="version mapping">
- <entry keyword="@Version">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref157" /></entry>
- </entry>
- <entry keyword="about">
- <entry keyword="Version mapping"><topic href="tasks019.htm#sthref155" /></entry>
- </entry>
- </entry>
- <entry keyword="views">
- <entry keyword="JPA Details view">
- <entry keyword="JPA Details view (for entities)"><topic href="ref_persistence_prop_view.htm#sthref226" /></entry>
- <entry keyword="JPA Details view (for attributes)"><topic href="ref_persistence_map_view.htm#sthref243" /></entry>
- </entry>
- <entry keyword="JPA Structure view">
- <entry keyword="JPA Structure view"><topic href="ref_persistence_outline.htm#sthref269" /></entry>
- </entry>
- </entry>
- <entry keyword="warning messages - Dali">
- <entry keyword="Validating mappings and reporting problems"><topic href="tasks023.htm#sthref168" /></entry>
- </entry>
- <entry keyword="Web Tools Platform (WTP)">
- <entry keyword="Requirements and installation"><topic href="getting_started001.htm#sthref5" /></entry>
- </entry>
- <entry keyword="XML editor">
- <entry keyword="Working with orm.xml file"><topic href="tasks005.htm#sthref64" /></entry>
- </entry>
-</index>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm b/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm
deleted file mode 100644
index dfa0007f53..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/legal.htm
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Legal</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Legal" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref294" name="sthref294"></a></p>
-<h1>Legal</h1>
-<p>Copyright &copy; 2006, 2010, Oracle. All rights reserved.</p>
-<p>This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at:</p>
-<p><code><a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a></code></p>
-<p><a href="about.htm">Terms and conditions regarding the use of this guide.</a></p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties b/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties
deleted file mode 100644
index 0aea0c736c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-###############################################################################
-# Copyright (c) 2007, 2010 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Documentation
-providerName = Eclipse Web Tools Platform
-
-jpaDevelopment=JPA Development
-createAJpaProject=Create a JPA project
-createAJpaProjectDescription=This cheat sheet helps you create a JPA project.
-createAPersistentEntity=Create a persistent entity
-createAPersistentEntityDescription=This cheat sheet helps you create a Java persistent entity.
-MapAPersistentEntity=Map a persistent entity
-MapAPersistentEntityDescription=This cheat sheet helps you map the a Java persistent entity to a database table.
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml b/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml
deleted file mode 100644
index c405262e39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/plugin.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin>
- <!-- =========== -->
- <!-- Define TOC -->
- <!-- =========== -->
- <extension point="org.eclipse.help.toc">
- <toc file="toc.xml" primary="true"/>
- </extension>
- <!-- =========== -->
- <!-- Define F1 -->
- <!-- =========== -->
- <extension point="org.eclipse.help.contexts">
- <contexts file="contexts.xml" plugin="org.eclipse.jpt.jpa.ui"/>
- </extension>
- <!-- ==================== -->
- <!-- Define Keyword Index -->
- <!-- ==================== -->
- <extension point="org.eclipse.help.index">
- <index file="index.xml"/>
- </extension>
- <!-- =========== -->
- <!-- Cheatsheets -->
- <!-- =========== -->
- <extension point="org.eclipse.ui.cheatsheets.cheatSheetContent">
- <category name="%jpaDevelopment" id="com.jpa.category"/>
- <cheatsheet name="%createAJpaProject" category="com.jpa.category" contentFile="$nl$/cheatsheets/add_persistence.xml" id="org.eclipse.jpa.cheatsheet.createproject1">
- <description>%createAJpaProjectDescription</description>
- </cheatsheet>
- <cheatsheet name="%createAPersistentEntity" category="com.jpa.category" contentFile="$nl$/cheatsheets/create_entity.xml" id="org.eclipse.jpa.cheatsheet.addentity">
- <description>%createAPersistentEntityDescription</description>
- </cheatsheet>
- <cheatsheet name="%MapAPersistentEntity" category="com.jpa.category" contentFile="$nl$/cheatsheets/map_entity.xml" id="org.eclipse.jpa.cheatsheet.mapentity">
- <description>%MapAPersistentEntityDescription</description>
- </cheatsheet>
- </extension>
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityClassPage.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityClassPage.htm
deleted file mode 100644
index f4578f1bd3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityClassPage.htm
+++ /dev/null
@@ -1,115 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Entity Class page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity Class page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFEIGF" name="CIAFEIGF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Entity Class page</h1>
-<p>This table lists the properties of the Entity Class page of the <a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a>.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" summary="This table lists the properties of the Entity Class page of the Create JPA Entity wizard." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="22%" />
-<col width="*" />
-<col width="17%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t5">Property</th>
-<th align="left" valign="bottom" id="r1c2-t5">Description</th>
-<th align="left" valign="bottom" id="r1c3-t5">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t5" headers="r1c1-t5">Project</td>
-<td align="left" headers="r2c1-t5 r1c2-t5">The name of the JPA project.</td>
-<td align="left" headers="r2c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t5" headers="r1c1-t5">Source Folder</td>
-<td align="left" headers="r3c1-t5 r1c2-t5">The location of the JPA project's src folder.</td>
-<td align="left" headers="r3c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t5" headers="r1c1-t5">Java Package</td>
-<td align="left" headers="r4c1-t5 r1c2-t5">The name of the class package.</td>
-<td align="left" headers="r4c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t5" headers="r1c1-t5">Class name</td>
-<td align="left" headers="r5c1-t5 r1c2-t5">The name of the Java class.</td>
-<td align="left" headers="r5c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t5" headers="r1c1-t5">Superclass</td>
-<td align="left" headers="r6c1-t5 r1c2-t5">Select the superclass.</td>
-<td align="left" headers="r6c1-t5 r1c3-t5"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t5" headers="r1c1-t5"><a id="sthref195" name="sthref195"></a>Inheritance</td>
-<td align="left" headers="r7c1-t5 r1c2-t5">Because the wizard creates a Java class with an <code>@Entity</code> notation, the <span class="bold">Entity</span> option is selected by default.
-<p>Select <span class="bold">Mapped Superclass</span> if you defined a superclass.</p>
-<p>To add an <code>@Inheritance</code> notation to the entity, select <span class="bold">Inheritance</span> and then select one of the inheritance mapping strategies (described in JSR 220):</p>
-<ul>
-<li>
-<p>SINGLE_TABLE -- All classes in a hierarchy as mapped to a single table. This annotation is without an attribute for the inheritance strategy.</p>
-</li>
-<li>
-<p>TABLE_PER_CLASS -- Each class is mapped to a separate table.</p>
-</li>
-<li>
-<p>JOINED -- The root of the class hierarchy is represented by a single table. Each subclass is represented by a separate table that contains those fields that are specific to the subclass (not inherited from its superclass), as well as the column(s) that represent its primary key. The primary key column(s) of the subclass table serves as a foreign key to the primary key of the superclass table.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r7c1-t5 r1c3-t5">Entity</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t5" headers="r1c1-t5"><a id="sthref196" name="sthref196"></a>XML Entity Mappings</td>
-<td align="left" headers="r8c1-t5 r1c2-t5">Select <span class="bold">Add to entity mappings in XML</span> to create XML mappings in <code>orm.xml</code>, rather than annotations.
-<p>Use the <span class="bold">Mapping file</span> field to specify the file to use. By default, mappings are stored in the <code>META-INF/orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r8c1-t5 r1c3-t5"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityPropertiesPage.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityPropertiesPage.htm
deleted file mode 100644
index 8914f86c92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_EntityPropertiesPage.htm
+++ /dev/null
@@ -1,117 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Entity Properties page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity Properties page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIADECIA" name="CIADECIA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Entity Properties page</h1>
-<p>This table lists the properties of the Entity Properties page of the <a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a>.</p>
-<div class="tblformal"><a id="sthref197" name="sthref197"></a><a id="sthref198" name="sthref198"></a>
-<p class="titleintable">&nbsp;</p>
-<table class="Formal" title="" summary="This table to be converted to informal." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t6">Property</th>
-<th align="left" valign="bottom" id="r1c2-t6">Description</th>
-<th align="left" valign="bottom" id="r1c3-t6">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t6" headers="r1c1-t6">
-<p>Entity Name</p>
-</td>
-<td align="left" headers="r2c1-t6 r1c2-t6">
-<p>The name of the entity. By default, this value is the same as the one entered as the class name. If the entity name differs from the class name, then the entity name is added as an attribute. For example: <code>@Entity(name="EntityName")</code>.</p>
-</td>
-<td align="left" headers="r2c1-t6 r1c3-t6">
-<p>Determined by server.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t6" headers="r1c1-t6">
-<p>Table Name</p>
-</td>
-<td align="left" headers="r3c1-t6 r1c2-t6">
-<p>Select <span class="bold">Use default</span> to match the name of the mapped table name to the entity name. Otherwise, clear the <span class="bold">Use default</span> option and enter the name in the <span class="italic">Table Name</span> field. These options result in the addition of the <code>@Table</code> option to the Java class file.</p>
-</td>
-<td align="left" headers="r3c1-t6 r1c3-t6">
-<p>Use default.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t6" headers="r1c1-t6">
-<p>Entity Fields</p>
-</td>
-<td align="left" headers="r4c1-t6 r1c2-t6">
-<p>Click the <span class="bold">Add</span> button to add persistence fields using the Entity Fields dialog. This dialog enable you to build a field by entering a field name and selecting among persistence types. The <span class="bold">Key</span> option enables you to mark a field as a primary key. The dialog's <span class="bold">Browse</span> function enables you to add other persistence types described in the JPA specification. The <span class="bold">Edit</span> button enables you to change the name or type set for a persistent field.</p>
-</td>
-<td align="left" headers="r4c1-t6 r1c3-t6"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t6" headers="r1c1-t6">
-<p>Access Type</p>
-</td>
-<td align="left" headers="r5c1-t6 r1c2-t6">
-<p>Select whether the entity's access to instance variables is field-based or property-based, as defined in the JPA specification.</p>
-<ul>
-<li>
-<p><span class="bold">Field</span> &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-<li>
-<p><span class="bold">Property</span> &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t6 r1c3-t6">
-<p>Field</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_add_converter.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_add_converter.htm
deleted file mode 100644
index f992258622..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_add_converter.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Add Converter dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Add Converter dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGCGIJ" name="CIAGCGIJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Add Converter dialog</h1>
-<p>Use this dialog to create a new EclipseLink converter.</p>
-<div class="inftblhruleinformalmax">
-<table class="HRuleInformalMax" summary="This table lists the options on the New EclipseLink Mapping File dialog." dir="ltr" border="1" width="100%" frame="hsides" rules="rows" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t40">Property</th>
-<th align="left" valign="bottom" id="r1c2-t40">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t40" headers="r1c1-t40">Name</td>
-<td align="left" headers="r2c1-t40 r1c2-t40">Enter the name for this converter</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t40" headers="r1c1-t40">Type</td>
-<td align="left" headers="r3c1-t40 r1c2-t40">Select the converter type:
-<ul>
-<li>
-<p>Custom</p>
-</li>
-<li>
-<p>Object type</p>
-</li>
-<li>
-<p>Struct</p>
-</li>
-<li>
-<p>Type</p>
-</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformalmax" --></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_cardinality.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_cardinality.htm
deleted file mode 100644
index 17b8e5d990..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_cardinality.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Association Cardinality</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Association Cardinality" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFIIFH" name="CIAFIIFH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Association Cardinality</h1>
-<p><a id="sthref210" name="sthref210"></a>Use this dialog to specify cardinality of an association table. Depending on the <span class="bold">Association Kind</span> and <span class="bold">Join Columns</span> that you selected previously, some associations may not be available.</p>
-<ul>
-<li>
-<p>Many to one</p>
-</li>
-<li>
-<p>One to many</p>
-</li>
-<li>
-<p>One to one</p>
-</li>
-<li>
-<p>Many to many</p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_table.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_table.htm
deleted file mode 100644
index 78197f6367..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_association_table.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Association Tables</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Association Tables" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGJHDC" name="CIAGJHDC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Association Tables</h1>
-<p>Use this page to specify the association tables for an entity.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Association Tables dialog." summary="This table describes the options on the Association Tables dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t12">Property</th>
-<th align="left" valign="bottom" id="r1c2-t12">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t12" headers="r1c1-t12">Association kind</td>
-<td align="left" headers="r2c1-t12 r1c2-t12">Specify if the association is <span class="bold">Simple</span> (1:M) or <span class="bold">Many to Many</span> (M:M).</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t12" headers="r1c1-t12">Association tables</td>
-<td align="left" headers="r3c1-t12 r1c2-t12">Click <span class="bold">Table Selection</span>, then select the two tables to associate.
-<p>When creating a <span class="bold">Many to Many</span> association, you can select a <span class="bold">Join Table</span> for the association.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_configure_jaxb_class_generation_dialog.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_configure_jaxb_class_generation_dialog.htm
deleted file mode 100644
index 7efc7a4ffa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_configure_jaxb_class_generation_dialog.htm
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Configure JAXB Class Generation dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T19:33:7Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Configure JAXB Class Generation dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACHHHJA" name="CACHHHJA"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Configure JAXB Class Generation dialog</h1>
-<p>Use this dialog to generate JAXB classes from a schema.</p>
-<div class="inftblhruleinformalmax">
-<table class="HRuleInformalMax" summary="This table lists the options on the New EclipseLink Mapping File dialog." dir="ltr" border="1" width="100%" frame="hsides" rules="rows" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t41">Property</th>
-<th align="left" valign="bottom" id="r1c2-t41">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t41" headers="r1c1-t41">Source folder</td>
-<td align="left" headers="r2c1-t41 r1c2-t41">Location in which to generate the classes. Click <span class="bold">Browse</span> to select a location.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t41" headers="r1c1-t41">Package</td>
-<td align="left" headers="r3c1-t41 r1c2-t41">Name of the package. Click <span class="bold">Browse</span> to select an existing package.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t41" headers="r1c1-t41">Catalog</td>
-<td align="left" headers="r4c1-t41 r1c2-t41">Name of the catalog file to use to resolve external entity references.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t41" headers="r1c1-t41">Bindings files</td>
-<td align="left" headers="r5c1-t41 r1c2-t41">Click <span class="bold">Add</span> to select the external bindings files</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformalmax" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_generate_classes_from_schema.htm#CIHCBHJD">Generating JAXB Classes from a Schema</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_custom_entities_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_custom_entities_wizard.htm
deleted file mode 100644
index 6b5694a7a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_custom_entities_wizard.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generate Entities from Tables Wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Entities from Tables Wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGBFJE" name="CIAGBFJE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Entities from Tables Wizard</h1>
-<p>Use the Generate Custom Entities Wizard to create entities from your database tables.</p>
-<p>The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_selectTables.htm#CIAHCGEE">Select Tables</a></p>
-</li>
-<li>
-<p><a href="ref_tableAssociations.htm#CIACDICB">Table Associations</a></p>
-</li>
-<li>
-<p><a href="ref_customizeDefaultEntityGeneration.htm#CIAEJDBE">Customize Default Entity Generation</a></p>
-</li>
-<li>
-<p><a href="ref_customizIndividualEntities.htm#CIACIGEE">Customize Individual Entities</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_jpa_entity_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_jpa_entity_wizard.htm
deleted file mode 100644
index 12da7476c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_jpa_entity_wizard.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Create JPA Entity wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create JPA Entity wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGGGDF" name="CIAGGGDF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Create JPA Entity wizard</h1>
-<p>The Create JPA wizard enables you to quickly add an entity and also add persistence fields to that entity. In addition, this wizard adds the accessor methods (<code>getter</code> and <code>setter</code>) in the class file. The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_EntityClassPage.htm#CIAFEIGF">Entity Class page</a></p>
-</li>
-<li>
-<p><a href="ref_EntityPropertiesPage.htm#CIADECIA">Entity Properties page</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_new_association_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_new_association_wizard.htm
deleted file mode 100644
index b74aa5a71a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_create_new_association_wizard.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Create New Association</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create New Association" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFGHIF" name="CIAFGHIF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Create New Association</h1>
-<p><a id="sthref207" name="sthref207"></a><a id="sthref208" name="sthref208"></a>Use the Create New Association wizard to specify association tables when generating an entity.</p>
-<p>The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_association_table.htm#CIAGJHDC">Association Tables</a></p>
-</li>
-<li>
-<p><a href="ref_join_columns.htm#CIAEGEEG">Join Columns</a></p>
-</li>
-<li>
-<p><a href="ref_association_cardinality.htm#CIAFIIFH">Association Cardinality</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizIndividualEntities.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizIndividualEntities.htm
deleted file mode 100644
index e847da34fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizIndividualEntities.htm
+++ /dev/null
@@ -1,89 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Customize Individual Entities</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Customize Individual Entities" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACIGEE" name="CIACIGEE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Customize Individual Entities</h1>
-<p><a id="sthref206" name="sthref206"></a>Use this page to customize each generated entity. Select an item in the Table and columns area, then complete the following fields for each item.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Individual Entities dialog." summary="This table describes the options on the Individual Entities dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t11">Property</th>
-<th align="left" valign="bottom" id="r1c2-t11">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t11" headers="r1c1-t11">Table Mapping</td>
-<td align="left" headers="r2c1-t11 r1c2-t11">Use these options to define the table mapping information for the entity.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t11" headers="r1c1-t11">&nbsp;&nbsp;Key&nbsp;generator</td>
-<td align="left" headers="r3c1-t11 r1c2-t11">Select the generator used for this mapping.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t11" headers="r1c1-t11">&nbsp;&nbsp;Sequence&nbsp;name</td>
-<td align="left" headers="r4c1-t11 r1c2-t11">Enter a name for the sequence.
-<p>You can use <span class="bold">$table</span> and <span class="bold">$pk</span> as variables in the name. These will be replaced by the table name and primary key column name (respectively) when Dali generates a table mapping.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t11" headers="r1c1-t11">&nbsp;&nbsp;Entity&nbsp;access</td>
-<td align="left" headers="r5c1-t11 r1c2-t11">Specify the default entity access method: <span class="bold">Field</span> (default) or <span class="bold">Property</span>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t11" headers="r1c1-t11">Domain Java Class</td>
-<td align="left" headers="r6c1-t11 r1c2-t11">Use these options to define the class information (<span class="bold">Superclass</span> and <span class="bold">Interfaces</span>) for the entity.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizeDefaultEntityGeneration.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizeDefaultEntityGeneration.htm
deleted file mode 100644
index 578801a58e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_customizeDefaultEntityGeneration.htm
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Customize Default Entity Generation</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Customize Default Entity Generation" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAEJDBE" name="CIAEJDBE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Customize Default Entity Generation</h1>
-<p><a id="sthref205" name="sthref205"></a>Use this page to specify the default information Dali will use when generating the entities from the database tables. You will be able to override this information for specific entities.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate Entities dialog." summary="This table describes the options on the Custom Default Entity Generation dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t10">Property</th>
-<th align="left" valign="bottom" id="r1c2-t10">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t10" headers="r1c1-t10">Table Mapping</td>
-<td align="left" headers="r2c1-t10 r1c2-t10">Use these options to define the table mapping information for the entity.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Key&nbsp;generator</td>
-<td align="left" headers="r3c1-t10 r1c2-t10">Select the generator used for this mapping.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Sequence&nbsp;name</td>
-<td align="left" headers="r4c1-t10 r1c2-t10">Enter a name for the sequence.
-<p>You can use <span class="bold">$table</span> and <span class="bold">$pk</span> as variables in the name. These will be replaced by the table name and primary key column name (respectively) when Dali generates a table mapping.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Entity&nbsp;access</td>
-<td align="left" headers="r5c1-t10 r1c2-t10">Specify the default entity access method: <span class="bold">Field</span> (default) or <span class="bold">Property</span>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Associations&nbsp;fetch</td>
-<td align="left" headers="r6c1-t10 r1c2-t10">Specify the default fetch mode for associations: <span class="bold">Default</span>, as defined by the application (default), or <span class="bold">Lazy</span>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t10" headers="r1c1-t10">&nbsp;&nbsp;Collection&nbsp;type</td>
-<td align="left" headers="r7c1-t10 r1c2-t10">Specify if the collection properties are a <span class="bold">Set</span> or <span class="bold">List</span>.
-<p>Enable the <span class="bold">Always generate optional JPA annotations and DDL parameters</span> option to have Dali include this information in the entity.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t10" headers="r1c1-t10">Domain Java Class</td>
-<td align="left" headers="r8c1-t10 r1c2-t10">Use these options to define the class information (<span class="bold">Package</span>, <span class="bold">Superclass</span>, and <span class="bold">Interfaces</span>) for the entity.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm
deleted file mode 100644
index 018594b103..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_details_orm.htm
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Details view (for orm.xml)</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for orm.xml)" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGDGHC" name="CACGDGHC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Details view (for orm.xml)</h1>
-<p>The <span class="gui-object-title">JPA Details</span> view displays the default mapping and persistence information for the project and contains the following areas:</p>
-<ul>
-<li>
-<p><a href="reference013.htm#CACCACGH">General information</a></p>
-</li>
-<li>
-<p><a href="reference014.htm#CACEAGBG">Persistence Unit information</a></p>
-</li>
-<li>
-<p><a href="reference015.htm#CIAFGAIJ">Generators</a></p>
-</li>
-<li>
-<p><a href="reference016.htm#CIAIBAAJ">Queries</a></p>
-</li>
-<li>
-<p><a href="reference017.htm#CIADGCID">Converters</a> (when using EclipseLink)</p>
-</li>
-</ul>
-<p>These defaults can be overridden by the settings on a specific entity or mapping.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_eclipselink_mapping_file.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_eclipselink_mapping_file.htm
deleted file mode 100644
index 18a6305077..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_eclipselink_mapping_file.htm
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>New EclipseLink Mapping File dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="New EclipseLink Mapping File dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAEDEJF" name="CIAEDEJF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>New EclipseLink Mapping File dialog</h1>
-<p>Specify the location and properties of the EclipseLink mapping file (<code>eclispelink-orm.xml</code>).</p>
-<div class="inftblhruleinformalmax">
-<table class="HRuleInformalMax" summary="This table lists the options on the New EclipseLink Mapping File dialog." dir="ltr" border="1" width="100%" frame="hsides" rules="rows" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t39">Property</th>
-<th align="left" valign="bottom" id="r1c2-t39">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t39" headers="r1c1-t39">Project</td>
-<td align="left" headers="r2c1-t39 r1c2-t39">Select the project in which to add the mapping file.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t39" headers="r1c1-t39">Source folder</td>
-<td align="left" headers="r3c1-t39 r1c2-t39">Click <span class="bold">Browse</span> and select the source file in which to add the mapping file. The default is <code>../</code><code><span class="codeinlineitalic">&lt;PROJECT&gt;</span></code><code>/src</code>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t39" headers="r1c1-t39">File path</td>
-<td align="left" headers="r4c1-t39 r1c2-t39">Enter the filename and path of the mapping file. The default is <code>META-INF/eclipselink-orm.xml</code>.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t39" headers="r1c1-t39">Default access</td>
-<td align="left" headers="r5c1-t39 r1c2-t39">Select whether the entity's access to instance variables is <span class="bold">field</span>-based or <span class="bold">property</span>-based, as defined in the JPA specification.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t39" headers="r1c1-t39">Add to persistence unit</td>
-<td align="left" headers="r6c1-t39 r1c2-t39">Specify if this mapping file should be added to the persistence unit (<code>persistence.xml</code>).</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t39" headers="r1c1-t39">&nbsp;&nbsp;Persistence&nbsp;Unit</td>
-<td align="left" headers="r7c1-t39 r1c2-t39">Select the persistence unit in which to add the mapping file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblhruleinformalmax" -->
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference003.htm#CIAJEIDJ">Mapping File</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_java_page.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_java_page.htm
deleted file mode 100644
index ffbf3fdaff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_java_page.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Java Page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Java Page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGEBAA" name="CIAGEBAA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Java Page</h1>
-<p>This table lists the properties available on the Java page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t3">Property</th>
-<th align="left" valign="bottom" id="r1c2-t3">Description</th>
-<th align="left" valign="bottom" id="r1c3-t3">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t3" headers="r1c1-t3">Source folders on build path</td>
-<td align="left" headers="r2c1-t3 r1c2-t3">Click <span class="bold">Add Folder</span> to select an existing Java source folder to add to this project.</td>
-<td align="left" headers="r2c1-t3 r1c3-t3">EclipseLink</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t3" headers="r1c1-t3">Default output folder</td>
-<td align="left" headers="r3c1-t3 r1c2-t3">Specify the location of the&nbsp;<code>.class</code> files.</td>
-<td align="left" headers="r3c1-t3 r1c3-t3">build\classes</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jaxb_schema_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_jaxb_schema_wizard.htm
deleted file mode 100644
index e2eb5bf134..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jaxb_schema_wizard.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generate Schema from JAXB Classes Wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T16:18:13Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Schema from JAXB Classes Wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGADFH" name="CACGADFH"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Schema from JAXB Classes Wizard</h1>
-<p>Use the Generate Schema from JAXB Classes wizard create an XML schema (&nbsp;.xsd) for a set of JAXB mapped classes.</p>
-<p>The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_schema_from_classes_page.htm#CACHBEGJ">Generate Schema from Classes</a></p>
-</li>
-</ul>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_generating_schema_from_classes.htm#CIHHBJCJ">Generating Schema from Classes</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="#CACGADFH">Generate Schema from JAXB Classes Wizard</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_join_columns.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_join_columns.htm
deleted file mode 100644
index 8632cbfec4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_join_columns.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Join Columns</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Columns" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAEGEEG" name="CIAEGEEG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Join Columns</h1>
-<p><a id="sthref209" name="sthref209"></a>Use this dialog to specify the join columns of an association table.</p>
-<p>Click Add to specify the join columns between the two tables.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm
deleted file mode 100644
index 89e4ff8a71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_jpa_facet.htm
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Facet page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Facet page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACIFDIF" name="CACIFDIF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Facet page</h1>
-<p>This table lists the properties available on the JPA Facet page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t4">Property</th>
-<th align="left" valign="bottom" id="r1c2-t4">Description</th>
-<th align="left" valign="bottom" id="r1c3-t4">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t4" headers="r1c1-t4">Platform</td>
-<td align="left" headers="r2c1-t4 r1c2-t4">Vendor-specific JPA implementation.</td>
-<td align="left" headers="r2c1-t4 r1c3-t4">EclipseLink</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t4" headers="r1c1-t4"><a id="sthref191" name="sthref191"></a><a id="sthref192" name="sthref192"></a>JPA Implementation</td>
-<td align="left" headers="r3c1-t4 r1c2-t4">Select a specific JPA library configuration.
-<p>Click <span class="bold">Manage libraries</span> to create or update a user library.</p>
-<p>Click <span class="bold">Download libraries</span> to download a specific library configuration.</p>
-</td>
-<td align="left" headers="r3c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t4" headers="r1c1-t4">&nbsp;&nbsp;Type</td>
-<td align="left" headers="r4c1-t4 r1c2-t4">Select <span class="bold">User Library</span> to select from the available user-defined or downloaded libraries.
-<p>If you select Disable, you must manually include the JPA implementation library on the project classpath.</p>
-</td>
-<td align="left" headers="r4c1-t4 r1c3-t4">User Library</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t4" headers="r1c1-t4">&nbsp;&nbsp;Include libraries with this application</td>
-<td align="left" headers="r5c1-t4 r1c2-t4">Specify if the selected libraries are included when deploying the application.</td>
-<td align="left" headers="r5c1-t4 r1c3-t4">Selected</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t4" headers="r1c1-t4">Connection</td>
-<td align="left" headers="r6c1-t4 r1c2-t4">Select the database connection to use with the project. Dali requires an active database connection to use and validate the persistent entities and mappings.
-<p>Click <span class="bold">Add connection</span> to create a new database connection.</p>
-</td>
-<td align="left" headers="r6c1-t4 r1c3-t4"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t4" headers="r1c1-t4">&nbsp;&nbsp;Override&nbsp;default schema from connection</td>
-<td align="left" headers="r7c1-t4 r1c2-t4">Select a schema other than the default one that is derived from the connection information. Use this option if the default schema cannot be used. For example, use this option when the deployment login differs from the design-time login.</td>
-<td align="left" headers="r7c1-t4 r1c3-t4">The value calculated by Dali.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t4" headers="r1c1-t4">JPA Implementation</td>
-<td align="left" headers="r8c1-t4 r1c2-t4">Select to use the <span class="bold">JPA implementation provided by the server at runtime</span>, or select a specific <span class="bold">implementation library</span> that contain the Java Persistence API (JPA) and entities to be added to the project's Java Build Path.
-<p>Click <span class="bold">Configure default JPA implementation library</span> to create a default library for the project or click <span class="bold">Configure user libraries</span> to define additional libraries.</p>
-<p>Depending on your JPA implementation (for example, Generic or EclipseLink), different options may be available when working with JPA projects.</p>
-</td>
-<td align="left" headers="r8c1-t4 r1c3-t4">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t4" headers="r1c1-t4"><a id="sthref193" name="sthref193"></a>Persistent class management</td>
-<td align="left" headers="r9c1-t4 r1c2-t4">Specify if Dali will <span class="bold">discover annotated classes automatically</span>, or if the <span class="bold">annotated classes must be listed in the persistence.xml</span> file.
-<p><span class="bold">Note</span>: To insure application portability, you should explicitly list the managed persistence classes that are included in the persistence unit.</p>
-</td>
-<td align="left" headers="r9c1-t4 r1c3-t4">Determined by server.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t4" headers="r1c1-t4"><a id="sthref194" name="sthref194"></a>Create <code>orm.xml</code></td>
-<td align="left" headers="r10c1-t4 r1c2-t4">Specify if Dali should create a default <code>orm.xml</code> file for your entity mappings and persistence unit defaults.</td>
-<td align="left" headers="r10c1-t4 r1c3-t4">Selected</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
deleted file mode 100644
index 7b02bb68fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_mapping_general.htm
+++ /dev/null
@@ -1,272 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>General information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBHFIJ" name="CACBHFIJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General information</h1>
-<p>This table lists the General properties available in the <span class="gui-object-title">Java Details view</span> for each mapping type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view." summary="This table describes the options on the Persistence Properties view." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<col width="27%" />
-<col width="21%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t16">Property</th>
-<th align="left" valign="bottom" id="r1c2-t16">Description</th>
-<th align="left" valign="bottom" id="r1c3-t16">Default</th>
-<th align="left" valign="bottom" id="r1c4-t16">Available for Mapping Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t16" headers="r1c1-t16">Mapping Type Hyperlink</td>
-<td align="left" headers="r2c1-t16 r1c2-t16">Clicking the name of the mapping type, which is represented as a hyperlink, invokes the Mapping Type Selection dialog. Use this dialog to specify the type of attribute.</td>
-<td align="left" headers="r2c1-t16 r1c3-t16">Basic</td>
-<td align="left" headers="r2c1-t16 r1c4-t16">All mapping types</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t16" headers="r1c1-t16"><a id="CACGCBHB" name="CACGCBHB"></a>Column</td>
-<td align="left" headers="r3c1-t16 r1c2-t16"><a id="sthref231" name="sthref231"></a><a id="sthref232" name="sthref232"></a>The database column that contains the value for the attribute. This field corresponds to the <code>@Column</code> annotation.</td>
-<td align="left" headers="r3c1-t16 r1c3-t16">By default, the Column is assumed to be named identically to the attribute.</td>
-<td align="left" headers="r3c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a>, <a href="tasks019.htm#BABHIBII">Version mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r4c1-t16 r1c2-t16">Name of the database column.
-<p>This field corresponds to the <code>@Column</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r4c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r5c1-t16 r1c2-t16">Name of the database table that contains the selected column.</td>
-<td align="left" headers="r5c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r5c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Insertable</td>
-<td align="left" headers="r6c1-t16 r1c2-t16">Specifies if the column is always included in <code>SQL INSERT</code> statements.</td>
-<td align="left" headers="r6c1-t16 r1c3-t16">True</td>
-<td align="left" headers="r6c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Updatable</td>
-<td align="left" headers="r7c1-t16 r1c2-t16">Specifies if this column is always included in <code>SQL UPDATE</code> statements.</td>
-<td align="left" headers="r7c1-t16 r1c3-t16">True</td>
-<td align="left" headers="r7c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Unique</td>
-<td align="left" headers="r8c1-t16 r1c2-t16">Sets the <code>UNIQUE</code> constraint for the column.</td>
-<td align="left" headers="r8c1-t16 r1c3-t16">False</td>
-<td align="left" headers="r8c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Nullable</td>
-<td align="left" headers="r9c1-t16 r1c2-t16">Specifies if the column allows null values.</td>
-<td align="left" headers="r9c1-t16 r1c3-t16">True</td>
-<td align="left" headers="r9c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Length</td>
-<td align="left" headers="r10c1-t16 r1c2-t16">Sets the column length.</td>
-<td align="left" headers="r10c1-t16 r1c3-t16">255</td>
-<td align="left" headers="r10c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Precision</td>
-<td align="left" headers="r11c1-t16 r1c2-t16">Sets the precision for the column values.</td>
-<td align="left" headers="r11c1-t16 r1c3-t16">0</td>
-<td align="left" headers="r11c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Scale</td>
-<td align="left" headers="r12c1-t16 r1c2-t16">Sets the number of digits that appear to the right of the decimal point.</td>
-<td align="left" headers="r12c1-t16 r1c3-t16">0</td>
-<td align="left" headers="r12c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t16" headers="r1c1-t16">&nbsp;&nbsp;Column Definition</td>
-<td align="left" headers="r13c1-t16 r1c2-t16">Define the DDL for a column. This is used when a table is being generated.</td>
-<td align="left" headers="r13c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r13c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks011.htm#BABCBHDF">Embedded mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t16" headers="r1c1-t16"><a id="CACGGGHB" name="CACGGGHB"></a><a id="sthref233" name="sthref233"></a><a id="sthref234" name="sthref234"></a><a id="sthref235" name="sthref235"></a>Fetch Type</td>
-<td align="left" headers="r14c1-t16 r1c2-t16">Defines how data is loaded from the database:
-<ul>
-<li>
-<p>Eager &ndash; Data is loaded in before it is actually needed.</p>
-</li>
-<li>
-<p>Lazy &ndash; Data is loaded only when required by the transaction.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r14c1-t16 r1c3-t16">Eager</td>
-<td align="left" headers="r14c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r15c1-t16" headers="r1c1-t16">Optional</td>
-<td align="left" headers="r15c1-t16 r1c2-t16">Specifies if this field is can be null.</td>
-<td align="left" headers="r15c1-t16 r1c3-t16">Yes</td>
-<td align="left" headers="r15c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r16c1-t16" headers="r1c1-t16"><a id="CACBBIBI" name="CACBBIBI"></a><a id="sthref236" name="sthref236"></a>Lob</td>
-<td align="left" headers="r16c1-t16 r1c2-t16">Specify if the field is mapped to <code>java.sql.Clob</code> or <code>java.sql.Blob</code>.
-<p>This field corresponds to the <code>@Lob</code> annotation.</p>
-</td>
-<td align="left" headers="r16c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r16c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r17c1-t16" headers="r1c1-t16"><a id="CACEAJGD" name="CACEAJGD"></a><a id="sthref237" name="sthref237"></a><a id="sthref238" name="sthref238"></a><a id="sthref239" name="sthref239"></a>Temporal</td>
-<td align="left" headers="r17c1-t16 r1c2-t16">Specifies if this field is one of the following:
-<ul>
-<li>
-<p>Date &ndash; <code>java.sql.Date</code></p>
-</li>
-<li>
-<p>Time &ndash; <code>java.sql.Time</code></p>
-</li>
-<li>
-<p>Timestamp &ndash; <code>java.sql.Timestamp</code></p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Temporal</code> annotation.</p>
-</td>
-<td align="left" headers="r17c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r17c1-t16 r1c4-t16"><a href="tasks010.htm#BABBABCE">Basic mapping</a>, <a href="tasks013.htm#BABGCBHG">ID mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r18c1-t16" headers="r1c1-t16"><a id="sthref240" name="sthref240"></a><a id="sthref241" name="sthref241"></a><a id="sthref242" name="sthref242"></a>Enumerated</td>
-<td align="left" headers="r18c1-t16 r1c2-t16">Specify how to persist enumerated constraints if the <code>String</code> value suits your application requirements or to match an existing database schema.
-<ul>
-<li>
-<p>ordinal</p>
-</li>
-<li>
-<p><code>String</code></p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Enumerated</code> annotation.</p>
-</td>
-<td align="left" headers="r18c1-t16 r1c3-t16">Ordinal</td>
-<td align="left" headers="r18c1-t16 r1c4-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r19c1-t16" headers="r1c1-t16">Target Entity</td>
-<td align="left" headers="r19c1-t16 r1c2-t16">The persistent entity to which the attribute is mapped.</td>
-<td align="left" headers="r19c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r19c1-t16 r1c4-t16"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a> <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r20c1-t16" headers="r1c1-t16"><a id="sthref243" name="sthref243"></a>ID</td>
-<td align="left" headers="r20c1-t16 r1c2-t16">Specify if the entity's ID is derived from the identity of another entity.</td>
-<td align="left" headers="r20c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r20c1-t16 r1c4-t16"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r21c1-t16" headers="r1c1-t16"><a id="CACJAIHB" name="CACJAIHB"></a>Cascade Type</td>
-<td align="left" headers="r21c1-t16 r1c2-t16">Specify which operations are propagated throughout the entity.
-<ul>
-<li>
-<p>All &ndash; All operations</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Move</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-<li>
-<p>Refresh</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r21c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r21c1-t16 r1c4-t16"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a>, <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r22c1-t16" headers="r1c1-t16"><a id="CACJDJJA" name="CACJDJJA"></a>Mapped By</td>
-<td align="left" headers="r22c1-t16 r1c2-t16">The field in the database table that "owns" the relationship. This field is required only on the non-owning side of the relationship.</td>
-<td align="left" headers="r22c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r22c1-t16 r1c4-t16"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a>, <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r23c1-t16" headers="r1c1-t16"><a id="CACDADIH" name="CACDADIH"></a><a id="sthref244" name="sthref244"></a><a id="sthref245" name="sthref245"></a>Order By</td>
-<td align="left" headers="r23c1-t16 r1c2-t16">Specify the default order for objects returned from a query:
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom ordering</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@OrderBy</code> annotation.</p>
-</td>
-<td align="left" headers="r23c1-t16 r1c3-t16">Primary key</td>
-<td align="left" headers="r23c1-t16 r1c4-t16"><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a>. <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a>, <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r24c1-t16" headers="r1c1-t16">Attribute Overrides</td>
-<td align="left" headers="r24c1-t16 r1c2-t16">Overrides <span class="bold">Basic</span> mappings of a mapped superclass (for example, if the inherited column name is incompatible with a pre-existing data model, or invalid as a column name in your database).</td>
-<td align="left" headers="r24c1-t16 r1c3-t16"><br /></td>
-<td align="left" headers="r24c1-t16 r1c4-t16"><a href="tasks011.htm#BABCBHDF">Embedded mapping</a>
-<p><a href="tasks011.htm#BABCBHDF">Embedded mapping</a></p>
-<br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm
deleted file mode 100644
index 2a576e6eba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project.htm
+++ /dev/null
@@ -1,104 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>New JPA Project page</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="New JPA Project page" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBJAGC" name="CACBJAGC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>New JPA Project page</h1>
-<p>This table lists the properties available on the New JPA Project page of the <a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate DDL - Objects page." summary="This table describes the options on the Generate DDL - Objects page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t2">Property</th>
-<th align="left" valign="bottom" id="r1c2-t2">Description</th>
-<th align="left" valign="bottom" id="r1c3-t2">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t2" headers="r1c1-t2">Project name</td>
-<td align="left" headers="r2c1-t2 r1c2-t2">Name of the Eclipse JPA project.</td>
-<td align="left" headers="r2c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t2" headers="r1c1-t2">Project contents</td>
-<td align="left" headers="r3c1-t2 r1c2-t2">Location of the workspace in which to save the project.
-<p>Unselect The <span class="bold">Use Default</span> option and click <span class="bold">Browse</span> to select a new location.</p>
-</td>
-<td align="left" headers="r3c1-t2 r1c3-t2">Current workspace</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t2" headers="r1c1-t2">Target runtime</td>
-<td align="left" headers="r4c1-t2 r1c2-t2">Select a pre-defined target for the project.
-<p>Click <span class="bold">New</span> to create a new environment with the New Server Runtime wizard.</p>
-</td>
-<td align="left" headers="r4c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t2" headers="r1c1-t2">Configurations</td>
-<td align="left" headers="r5c1-t2 r1c2-t2">Select a project configuration with pre-defined facets.
-<p>Select <span class="bold">&lt;custom&gt;</span> to manually select the facets for this project.</p>
-</td>
-<td align="left" headers="r5c1-t2 r1c3-t2">Utility JPA project with Java 5.0</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t2" headers="r1c1-t2">EAR membership</td>
-<td align="left" headers="r6c1-t2 r1c2-t2">Specify if this project should be included in an EAR file for deployment.
-<p>Select the <span class="bold">EAR Project Name</span>, or click <span class="bold">New</span> to create a new EAR project.</p>
-</td>
-<td align="left" headers="r6c1-t2 r1c3-t2"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t2" headers="r1c1-t2">Working sets</td>
-<td align="left" headers="r7c1-t2 r1c2-t2">Specify if this project should be included in an existing working set. The drop down field shows a list of previous selected working sets.
-<p>Select <span class="bold">Add project to working sets</span>, then select a working set in which to add this project.</p>
-</td>
-<td align="left" headers="r7c1-t2 r1c3-t2"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm
deleted file mode 100644
index b59320be77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_new_jpa_project_wizard.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Create New JPA Project wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Create New JPA Project wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBJGBG" name="CACBJGBG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Create New JPA Project wizard</h1>
-<p><a id="sthref190" name="sthref190"></a>The Create New JPA Project wizard allows you to create a new Java project using JPA. The wizard consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a></p>
-</li>
-<li>
-<p><a href="ref_java_page.htm#CIAGEBAA">Java Page</a></p>
-</li>
-<li>
-<p><a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_general.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_general.htm
deleted file mode 100644
index ea6f099cfc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_general.htm
+++ /dev/null
@@ -1,126 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>General</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACIFGJ" name="CIACIFGJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General</h1>
-<p>The following table lists properties available in the General page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref258" name="sthref258"></a><a id="sthref259" name="sthref259"></a>
-<p class="titleintable">Properties of the General Page</p>
-<table class="Formal" title="Properties of the General Page" summary="This table describes the properties of the persistence.xml&rsquo;s General page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t24">Property</th>
-<th align="left" valign="bottom" id="r1c2-t24">Description</th>
-<th align="left" valign="bottom" id="r1c3-t24">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t24" headers="r1c1-t24">
-<p>Name</p>
-</td>
-<td align="left" headers="r2c1-t24 r1c2-t24">
-<p>Enter the name of the persistence unit.</p>
-</td>
-<td align="left" headers="r2c1-t24 r1c3-t24">
-<p>The project name.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t24" headers="r1c1-t24">
-<p>Persistence Provider</p>
-</td>
-<td align="left" headers="r3c1-t24 r1c2-t24">
-<p>Enter the name of the persistence provider.</p>
-</td>
-<td align="left" headers="r3c1-t24 r1c3-t24">
-<p>Determined by the server.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t24" headers="r1c1-t24">
-<p>Description</p>
-</td>
-<td align="left" headers="r4c1-t24 r1c2-t24">
-<p>Enter a description for this persistence unit. This is an optional property.</p>
-</td>
-<td align="left" headers="r4c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t24" headers="r1c1-t24">
-<p>Managed Classes</p>
-</td>
-<td align="left" headers="r5c1-t24 r1c2-t24">
-<p>Add or remove the classes managed through the persistence unit.</p>
-</td>
-<td align="left" headers="r5c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t24" headers="r1c1-t24">
-<p>Exclude Unlisted Classes</p>
-</td>
-<td align="left" headers="r6c1-t24 r1c2-t24">
-<p>Select to include all annotated entity classes in the root of the persistence unit.</p>
-</td>
-<td align="left" headers="r6c1-t24 r1c3-t24">
-<p>False</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t24" headers="r1c1-t24">
-<p>XML Mapping Files</p>
-</td>
-<td align="left" headers="r7c1-t24 r1c2-t24">
-<p>Add or remove the object/relational mapping XML files that define the classes to be managed by the persistence unit.</p>
-</td>
-<td align="left" headers="r7c1-t24 r1c3-t24">
-<p>Meta-INF\orm.xml</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t24" headers="r1c1-t24">
-<p>JAR Files</p>
-</td>
-<td align="left" headers="r8c1-t24 r1c2-t24"><br /></td>
-<td align="left" headers="r8c1-t24 r1c3-t24"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm
deleted file mode 100644
index 40d2673812..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_map_view.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Details view (for attributes)</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for attributes)" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIFBAF" name="BABIFBAF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Details view (for attributes)</h1>
-<p><a id="sthref228" name="sthref228"></a><a id="sthref229" name="sthref229"></a><a id="sthref230" name="sthref230"></a>The <span class="gui-object-title">JPA Details</span> view displays the persistence information for the currently selected mapped attribute and contains the following areas:</p>
-<ul>
-<li>
-<p><a href="ref_mapping_general.htm#CACBHFIJ">General information</a></p>
-</li>
-<li>
-<p><a href="reference011.htm#CACBAEBC">Join Table Information</a></p>
-</li>
-<li>
-<p><a href="reference012.htm#CACFCEJC">Join Columns Information</a></p>
-</li>
-<li>
-<p><a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm
deleted file mode 100644
index abdafce3b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_outline.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Structure view</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Structure view" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABEGGFE" name="BABEGGFE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Structure view</h1>
-<p><a id="sthref255" name="sthref255"></a><a id="sthref256" name="sthref256"></a>The <span class="gui-object-title">JPA Structure</span> view displays an outline of the structure (its attributes and mappings) of the entity that is currently selected or opened in the editor. The structural elements shown in the outline are the entity and its fields.</p>
-<div class="figure"><a id="sthref257" name="sthref257"></a>
-<p class="titleinfigure">Sample JPA Structure View</p>
-<img src="img/persistence_outline_view.png" alt="Sample JPA Structure view for an entity." title="Sample JPA Structure view for an entity." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm
deleted file mode 100644
index 0be8caf0d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_perspective.htm
+++ /dev/null
@@ -1,56 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Development perspective</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Development perspective" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIFBDB" name="BABIFBDB"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Development perspective</h1>
-<p><a id="sthref286" name="sthref286"></a><a id="sthref287" name="sthref287"></a>The <span class="bold">JPA Development perspective</span> defines the initial set and layout of views in the Workbench window when using Dali. By default, the <span class="gui-object-title">JPA Development perspective</span> includes the following views:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li>
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-</ul>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/concepts-4.htm">Perspectives</a></p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm
deleted file mode 100644
index 408e016a11..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_prop_view.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>JPA Details view (for entities)</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="JPA Details view (for entities)" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFAEBB" name="BABFAEBB"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>JPA Details view (for entities)</h1>
-<p><a id="sthref211" name="sthref211"></a><a id="sthref212" name="sthref212"></a><a id="sthref213" name="sthref213"></a>The <span class="gui-object-title">JPA Details</span> view displays the persistence information for the currently selected entity and contains the following tabs:</p>
-<ul>
-<li>
-<p><a href="reference006.htm#CACCAGGC">General information</a></p>
-</li>
-<li>
-<p><a href="reference007.htm#CACIJBGH">Attribute overrides</a></p>
-</li>
-<li>
-<p><a href="reference008.htm#CACBHIDA">Secondary table information</a></p>
-</li>
-<li>
-<p><a href="reference009.htm#CACFHGHE">Inheritance information</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_xmll_editor.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_xmll_editor.htm
deleted file mode 100644
index 027900047f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_persistence_xmll_editor.htm
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>persistence.xml Editor</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="persistence.xml Editor" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACCHID" name="CIACCHID"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>persistence.xml Editor</h1>
-<p>The persistence.xml Editor provides an interface that enables you to update the persistence.xml file. For projects using the EclipseLink platform, the perisistence.xml Editor consists of the following pages:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_general.htm#CIACIFGJ">General</a></p>
-</li>
-<li>
-<p><a href="reference018.htm#CIAFFJIE">Connection</a></p>
-</li>
-<li>
-<p><a href="reference019.htm#CIAJAFEG">Customization</a></p>
-</li>
-<li>
-<p><a href="reference020.htm#CIABEDCH">Caching</a></p>
-</li>
-<li>
-<p><a href="reference021.htm#CIABGHHI">Logging</a></p>
-</li>
-<li>
-<p><a href="reference022.htm#CIAFJCHE">Options</a></p>
-</li>
-<li>
-<p><a href="reference023.htm#CIACCFCB">Schema Generation</a></p>
-</li>
-<li>
-<p><a href="reference024.htm#CIAHJDFF">Properties</a></p>
-</li>
-<li>
-<p><a href="reference025.htm#CIAHCJAH">Source</a></p>
-</li>
-</ul>
-<p>For projects using the Generic platform, the following subset of these pages is available:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_general.htm#CIACIFGJ">General</a></p>
-</li>
-<li>
-<p><a href="reference018.htm#CIAFFJIE">Connection</a></p>
-</li>
-<li>
-<p><a href="reference024.htm#CIAHJDFF">Properties</a></p>
-</li>
-<li>
-<p><a href="reference025.htm#CIAHCJAH">Source</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm
deleted file mode 100644
index 78ae018537..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_primary_key.htm
+++ /dev/null
@@ -1,142 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Primary Key Generation information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Primary Key Generation information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFCCAB" name="CACFCCAB"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Primary Key Generation information</h1>
-<p>This table lists the fields available in the <span class="gui-object-title">Primary Key Generation</span> area in JPA Details view for <a href="tasks013.htm#BABGCBHG">ID mapping</a> types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Columns tab." summary="This table describes the options on the Join Columns tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="26%" />
-<col width="*" />
-<col width="34%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t19">Property</th>
-<th align="left" valign="bottom" id="r1c2-t19">Description</th>
-<th align="left" valign="bottom" id="r1c3-t19">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t19" headers="r1c1-t19"><a id="CACBAJBC" name="CACBAJBC"></a>Primary Key Generation</td>
-<td align="left" headers="r2c1-t19 r1c2-t19"><a id="sthref251" name="sthref251"></a><a id="sthref252" name="sthref252"></a>These fields define how the primary key is generated. These fields correspond to the <code>@GeneratedValue</code> annotation.</td>
-<td align="left" headers="r2c1-t19 r1c3-t19">Generated Value</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t19" headers="r1c1-t19"><a id="CACJEEEC" name="CACJEEEC"></a>&nbsp;&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t19 r1c2-t19">
-<ul>
-<li>Auto</li>
-<li>
-<p>Identity &ndash; Values are assigned by the database's <span class="bold">Identity</span> column.</p>
-</li>
-<li>
-<p>Sequence &ndash; Values are assigned by a sequence table (see <a href="#CACFFHEH">Sequence&nbsp;Generator</a>).</p>
-</li>
-<li>
-<p>Table &ndash; Values are assigned by a database table (see <a href="#CACGFEAH">Table Generator</a>).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t19 r1c3-t19">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t19" headers="r1c1-t19"><a id="BABEEAHJ" name="BABEEAHJ"></a>&nbsp;&nbsp;Generator Name</td>
-<td align="left" headers="r4c1-t19 r1c2-t19">Unique name of the generated value.</td>
-<td align="left" headers="r4c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t19" headers="r1c1-t19"><a id="CACGFEAH" name="CACGFEAH"></a>Table Generator</td>
-<td align="left" headers="r5c1-t19 r1c2-t19">These fields define the database table used for generating the primary key and correspond to the <code>@TableGenerator</code> annotation.
-<p>These fields apply only when <span class="bold">Strategy</span>&nbsp;=&nbsp;<span class="bold">Table</span>.</p>
-</td>
-<td align="left" headers="r5c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r6c1-t19 r1c2-t19">Unique name of the generator.</td>
-<td align="left" headers="r6c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Table</td>
-<td align="left" headers="r7c1-t19 r1c2-t19">Database table that stores the generated ID values.</td>
-<td align="left" headers="r7c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Primary Key Column</td>
-<td align="left" headers="r8c1-t19 r1c2-t19">The column in the table generator's <span class="bold">Table</span> that contains the primary key.</td>
-<td align="left" headers="r8c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Value Column</td>
-<td align="left" headers="r9c1-t19 r1c2-t19">The column that stores the generated ID values.</td>
-<td align="left" headers="r9c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Primary Key Column Value</td>
-<td align="left" headers="r10c1-t19 r1c2-t19">The value for the <span class="bold">Primary Key Column</span> in the generator table.</td>
-<td align="left" headers="r10c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t19" headers="r1c1-t19"><a id="CACFFHEH" name="CACFFHEH"></a>Sequence&nbsp;Generator</td>
-<td align="left" headers="r11c1-t19 r1c2-t19"><a id="sthref253" name="sthref253"></a><a id="sthref254" name="sthref254"></a>These fields define the specific sequence used for generating the primary key and correspond to the <code>@SequenceGenerator</code> annotation.
-<p>These fields apply only when <span class="bold">Strategy</span> = <span class="bold">Sequence</span>.</p>
-</td>
-<td align="left" headers="r11c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r12c1-t19 r1c2-t19">Name of the sequence table to use for defining primary key values.</td>
-<td align="left" headers="r12c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t19" headers="r1c1-t19">&nbsp;&nbsp;Sequence</td>
-<td align="left" headers="r13c1-t19 r1c2-t19">Unique name of the sequence.</td>
-<td align="left" headers="r13c1-t19 r1c3-t19"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks013.htm#BABGCBHG">ID mapping</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm
deleted file mode 100644
index 7a6aa85241..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_project_properties.htm
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Project Properties page &ndash; Java Persistence Options</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Project Properties page &ndash; Java Persistence Options" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABJHBCI" name="BABJHBCI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Project Properties page &ndash; Java Persistence Options</h1>
-<p><a id="sthref273" name="sthref273"></a><a id="sthref274" name="sthref274"></a>Use the <span class="gui-object-title">Errors/Warnings</span> options on the <span class="gui-object-title">Properties</span> page to specify the validation options to use with the project.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties page." summary="This table describes the options on the Persistence Properties page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t36">Property</th>
-<th align="left" valign="bottom" id="r1c2-t36">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t36" headers="r1c1-t36">Enable project specific settings</td>
-<td align="left" headers="r2c1-t36 r1c2-t36">Select the to override the general settings for this project.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Project level</td>
-<td align="left" headers="r3c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Persistent unit level</td>
-<td align="left" headers="r4c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Type level</td>
-<td align="left" headers="r5c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Attribute level</td>
-<td align="left" headers="r6c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Schema mapping</td>
-<td align="left" headers="r7c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Implied&nbsp;attributes</td>
-<td align="left" headers="r8c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Implied&nbsp;associations</td>
-<td align="left" headers="r9c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Inheritance</td>
-<td align="left" headers="r10c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t36" headers="r1c1-t36">&nbsp;&nbsp;Queries&nbsp;and&nbsp;generators</td>
-<td align="left" headers="r11c1-t36 r1c2-t36">Select the warning level to report.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks026.htm#BABDBCBI">Modifying persistent project properties</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_schema_from_classes_page.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_schema_from_classes_page.htm
deleted file mode 100644
index 46ff81ed85..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_schema_from_classes_page.htm
+++ /dev/null
@@ -1,42 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generate Schema from Classes</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T16:18:13Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Schema from Classes" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACHBEGJ" name="CACHBEGJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Schema from Classes</h1>
-<p>Use this dialog to select the classes from which to generate a schema. You can select an entire project, a package, or specific classes.</p>
-</div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_selectTables.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_selectTables.htm
deleted file mode 100644
index ea7d3c1a7f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_selectTables.htm
+++ /dev/null
@@ -1,79 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Select Tables</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Select Tables" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAHCGEE" name="CIAHCGEE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Select Tables</h1>
-<p><a id="sthref201" name="sthref201"></a><a id="sthref202" name="sthref202"></a><a id="sthref203" name="sthref203"></a>Use the <span class="gui-object-title">Select Tables</span> dialog to specify the database connection and tables from which to create entities.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate Entities dialog." summary="This table describes the options on the Generate Entities dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Property</th>
-<th align="left" valign="bottom" id="r1c2-t8">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Connection</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Select a database connection or click <span class="bold">Add Connection</span> to create a new connection.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8">Schema</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">Select the database schema from which to select tables.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">Tables</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Select the tables from which to create Java persistent entities. The tables shown are determined by the database connection and schema selections.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t8" headers="r1c1-t8">Synchronize Classes listed in persistence.xml</td>
-<td align="left" headers="r5c1-t8 r1c2-t8">Specify if Dali should update the <code>persistence.xml</code> file to include the generated classes.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_select_cascade_dialog.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_select_cascade_dialog.htm
deleted file mode 100644
index 317bf1e1f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_select_cascade_dialog.htm
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Select Cascade dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Select Cascade dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFDGIJ" name="CIAFDGIJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Select Cascade dialog</h1>
-<p>Specify which operations are propagated throughout the association: All, Persist, Merge, Remove, or Refresh.</p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/ref_tableAssociations.htm b/jpa/plugins/org.eclipse.jpt.doc.user/ref_tableAssociations.htm
deleted file mode 100644
index 507ef3adaa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/ref_tableAssociations.htm
+++ /dev/null
@@ -1,78 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Table Associations</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Table Associations" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACDICB" name="CIACDICB"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Table Associations</h1>
-<p><a id="sthref204" name="sthref204"></a>Use this page to create or edit the association between the database table and entity.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Generate Entities dialog." summary="This table describes the options on the Table Associations dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t9">Property</th>
-<th align="left" valign="bottom" id="r1c2-t9">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t9" headers="r1c1-t9">Table associations</td>
-<td align="left" headers="r2c1-t9 r1c2-t9">Select an association to modify or click to create a new table association with the <a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a> wizard.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t9" headers="r1c1-t9">Generate this association</td>
-<td align="left" headers="r3c1-t9 r1c2-t9">Specify if Dali should create the selected association. If enabled, you can specify the Cardinality and Join table for the table association.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t9" headers="r1c1-t9">Generate a reference to <span class="italic">&lt;ROW&gt;</span> in <span class="italic">&lt;TABLE&gt;</span></td>
-<td align="left" headers="r4c1-t9 r1c2-t9">Specify if the entity should contain a reference to the specified table.
-<p>If enabled, you can also enter the <span class="bold">Property</span> name and select the <span class="bold">Cascade</span> method (all, persist, merge, remove, or refresh) for the reference.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm
deleted file mode 100644
index edb027d6f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Reference</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Reference" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref189" name="sthref189"></a></p>
-<h1>Reference</h1>
-<p>This section includes detailed help information for each of the following elements in the Dali OR Mapping Tool:</p>
-<ul>
-<li>
-<p><a href="reference001.htm#CACJJJJH">Wizards</a></p>
-</li>
-<li>
-<p><a href="reference005.htm#CACDJIIG">Property pages</a></p>
-</li>
-<li>
-<p><a href="reference026.htm#CACDEIEE">Preferences</a></p>
-</li>
-<li>
-<p><a href="reference028.htm#CACGEJDA">Dialogs</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a></p>
-</li>
-<li>
-<p><a href="reference030.htm#CACDHCIA">Icons and buttons</a></p>
-</li>
-<li>
-<p><a href="reference033.htm#CACBBDIB">Dali Developer Documentation</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
deleted file mode 100644
index be40229799..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference001.htm
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Wizards</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T19:33:3Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Wizards" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACJJJJH" name="CACJJJJH"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Wizards</h1>
-<p>This section includes information on the following wizards:</p>
-<ul>
-<li>
-<p><a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a></p>
-</li>
-<li>
-<p><a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a></p>
-</li>
-<li>
-<p><a href="reference004.htm#CIAGHCGA">Generate Tables from Entities Wizard</a></p>
-</li>
-<li>
-<p><a href="ref_create_custom_entities_wizard.htm#CIAGBFJE">Generate Entities from Tables Wizard</a></p>
-</li>
-<li>
-<p><a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a></p>
-</li>
-<li>
-<p><a href="ref_jaxb_schema_wizard.htm#CACGADFH">Generate Schema from JAXB Classes Wizard</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm
deleted file mode 100644
index a636406aa6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference002.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Mapping File Wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File Wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAIJCCE" name="CIAIJCCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Mapping File Wizard</h1>
-<p>The Mapping File wizard enables you to add an <code>orm.xml</code> file to a JPA project if no object map exists at the location specified. For example, if you cleared the <span class="bold">Create orm.xml</span> option on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a>, you can later add the <code>orm.xml</code> file to the src file of the project using this wizard.</p>
-<p>The <a href="#CIAIJCCE">Mapping File Wizard</a> consists of the Mapping File page.</p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
deleted file mode 100644
index 80773ce3bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference003.htm
+++ /dev/null
@@ -1,134 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Mapping File</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping File" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAJEIDJ" name="CIAJEIDJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Mapping File</h1>
-<p>This table lists the properties of the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<div class="tblformal"><a id="sthref199" name="sthref199"></a><a id="sthref200" name="sthref200"></a>
-<p class="titleintable">Mapping File Wizard Properties</p>
-<table class="Formal" title="Mapping File Wizard Properties" summary="This table lists the properties of the Mapping File Wizard." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t7">Property</th>
-<th align="left" valign="bottom" id="r1c2-t7">Description</th>
-<th align="left" valign="bottom" id="r1c3-t7">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t7" headers="r1c1-t7">
-<p>Project</p>
-</td>
-<td align="left" headers="r2c1-t7 r1c2-t7">
-<p>The name of the JPA project.</p>
-</td>
-<td align="left" headers="r2c1-t7 r1c3-t7">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t7" headers="r1c1-t7">
-<p>Source folder</p>
-</td>
-<td align="left" headers="r3c1-t7 r1c2-t7">
-<p>The location of the project's src folder. If needed, click <span class="bold">Browse</span> to point the wizard to the src file's location.</p>
-</td>
-<td align="left" headers="r3c1-t7 r1c3-t7">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t7" headers="r1c1-t7">
-<p>File Path</p>
-</td>
-<td align="left" headers="r4c1-t7 r1c2-t7">
-<p>The location for the new <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t7 r1c3-t7">
-<p>Selected.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t7" headers="r1c1-t7">
-<p>Default Access</p>
-</td>
-<td align="left" headers="r5c1-t7 r1c2-t7">
-<p>Select whether the access to the entity is field-based or property-based, as defined in JPA specification.</p>
-<ul>
-<li>
-<p>None &ndash; No access type specified.</p>
-</li>
-<li>
-<p><span class="bold">Property-based</span> &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-<li>
-<p><span class="bold">Field-based</span> &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t7 r1c3-t7">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t7" headers="r1c1-t7">
-<p>Add to persistence unit</p>
-</td>
-<td align="left" headers="r6c1-t7 r1c2-t7">
-<p>Designates the persistence unit for this object map file.</p>
-</td>
-<td align="left" headers="r6c1-t7 r1c3-t7">
-<p>Selected.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a><br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a><br /></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm
deleted file mode 100644
index 8a00cd0882..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference004.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generate Tables from Entities Wizard</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:46Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generate Tables from Entities Wizard" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAGHCGA" name="CIAGHCGA"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Generate Tables from Entities Wizard</h1>
-<p>Use the Generate DDL from Entities Wizard to quickly create DDL scripts from your persistent entities. Dali automatically creates the necessary primary and foreign keys, based on the entity mappings.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks021.htm#BABBAGFI">Generating entities from tables</a><br />
-<a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a><br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a><br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
deleted file mode 100644
index a11400d263..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference005.htm
+++ /dev/null
@@ -1,52 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Property pages</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Property pages" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDJIIG" name="CACDJIIG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Property pages</h1>
-<p>This section includes information on the following:</p>
-<ul>
-<li>
-<p><a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a></p>
-</li>
-<li>
-<p><a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></p>
-</li>
-<li>
-<p><a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
deleted file mode 100644
index 31bc24dbb3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference006.htm
+++ /dev/null
@@ -1,122 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>General information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACCAGGC" name="CACCAGGC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General information</h1>
-<p>This table lists the General information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="16%" />
-<col width="*" />
-<col width="17%" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t13">Property</th>
-<th align="left" valign="bottom" id="r1c2-t13">Description</th>
-<th align="left" valign="bottom" id="r1c3-t13">Default</th>
-<th align="left" valign="bottom" id="r1c4-t13">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t13" headers="r1c1-t13">Mapping Type Hyperlink</td>
-<td align="left" headers="r2c1-t13 r1c2-t13">Clicking the name of the mapping type, which is represented as a hyperlink, invokes the Mapping Type Selection dialog. Use this dialog to specify the type of entity: Mapped Superclass, Embeddable or the default mapping type.</td>
-<td align="left" headers="r2c1-t13 r1c3-t13">Entity</td>
-<td align="left" headers="r2c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a>, <a href="tasks007.htm#BABFEICE">Embeddable</a>, and <a href="tasks008.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t13" headers="r1c1-t13">Table</td>
-<td align="left" headers="r3c1-t13 r1c2-t13">The default database table information for this entity. These fields can be overridden by the information in the <a href="reference007.htm#CACIJBGH">Attribute overrides</a> area.</td>
-<td align="left" headers="r3c1-t13 r1c3-t13"><br /></td>
-<td align="left" headers="r3c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r4c1-t13 r1c2-t13">The name of the primary database table associated with the entity.</td>
-<td align="left" headers="r4c1-t13 r1c3-t13"><br /></td>
-<td align="left" headers="r4c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Catalog</td>
-<td align="left" headers="r5c1-t13 r1c2-t13">The database catalog that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r5c1-t13 r1c3-t13">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r5c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t13" headers="r1c1-t13">&nbsp;&nbsp;Schema</td>
-<td align="left" headers="r6c1-t13 r1c2-t13">The database schema that contains the <span class="bold">Table</span>.</td>
-<td align="left" headers="r6c1-t13 r1c3-t13">As defined in <code>orm.xml</code>.</td>
-<td align="left" headers="r6c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t13" headers="r1c1-t13">Name</td>
-<td align="left" headers="r7c1-t13 r1c2-t13">The name of this entity. By default, the class name is used as the entity name.</td>
-<td align="left" headers="r7c1-t13 r1c3-t13"><br /></td>
-<td align="left" headers="r7c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t13" headers="r1c1-t13">Access</td>
-<td align="left" headers="r8c1-t13 r1c2-t13">The access method for this entity.</td>
-<td align="left" headers="r8c1-t13 r1c3-t13">Field</td>
-<td align="left" headers="r8c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t13" headers="r1c1-t13">Primary&nbsp;key&nbsp;class</td>
-<td align="left" headers="r9c1-t13 r1c2-t13">Click <span class="bold">Browse</span> and select the primary key for the entity. Clicking the field name, which is represented as a hyperlink, allows you to create a new class.</td>
-<td align="left" headers="r9c1-t13 r1c3-t13"><br /></td>
-<td align="left" headers="r9c1-t13 r1c4-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t13" headers="r1c1-t13">Cachable</td>
-<td align="left" headers="r10c1-t13 r1c2-t13">Specifies if the entity is cachable.
-<p>This field corresponds to the <code>@Cachable</code> annotation.</p>
-</td>
-<td align="left" headers="r10c1-t13 r1c3-t13">@Cachable(false)</td>
-<td align="left" headers="r10c1-t13 r1c4-t13"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm
deleted file mode 100644
index 3100acd390..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference007.htm
+++ /dev/null
@@ -1,80 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Attribute overrides</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Attribute overrides" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACIJBGH" name="CACIJBGH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Attribute overrides</h1>
-<p><a id="sthref214" name="sthref214"></a><a id="sthref215" name="sthref215"></a><a id="sthref216" name="sthref216"></a>Use the <span class="gui-object-title">Attribute Overrides</span> area in the <span class="gui-object-title">JPA Details</span> view to override the default settings specified in the <a href="reference006.htm#CACCAGGC">General information</a> area of an attribute. Attribute overrides generally override/configure attributes that are inherited or embedded.</p>
-<p>This table lists the Attribute override fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="16%" />
-<col width="*" />
-<col width="17%" />
-<col width="25%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t14">Property</th>
-<th align="left" valign="bottom" id="r1c2-t14">Description</th>
-<th align="left" valign="bottom" id="r1c3-t14">Default</th>
-<th align="left" valign="bottom" id="r1c4-t14">Available for Entity&nbsp;Type</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t14" headers="r1c1-t14">Attribute Overrides</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">Specify a property or field to be overridden (from the default mappings). Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r2c1-t14 r1c3-t14"><br /></td>
-<td align="left" headers="r2c1-t14 r1c4-t14"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Join Columns</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">Specify the joining strategy. Select <span class="bold">Override Default</span> to add a different joining strategy.</td>
-<td align="left" headers="r3c1-t14 r1c3-t14">Join columns</td>
-<td align="left" headers="r3c1-t14 r1c4-t14"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference006.htm#CACCAGGC">General information</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm
deleted file mode 100644
index edd0f9f932..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference008.htm
+++ /dev/null
@@ -1,48 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Secondary table information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Secondary table information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBHIDA" name="CACBHIDA"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Secondary table information</h1>
-<p><a id="sthref217" name="sthref217"></a><a id="sthref218" name="sthref218"></a><a id="sthref219" name="sthref219"></a><a id="sthref220" name="sthref220"></a>Use the <span class="gui-object-title">Secondary Tables</span> area in the <span class="gui-object-title">JPA Details</span> view to associate additional tables with an entity. Use this area if the data associated with an entity is spread across multiple tables.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm
deleted file mode 100644
index b905385cad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference009.htm
+++ /dev/null
@@ -1,113 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Inheritance information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Inheritance information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFHGHE" name="CACFHGHE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Inheritance information</h1>
-<p><a id="sthref221" name="sthref221"></a><a id="sthref222" name="sthref222"></a>This table lists the fields available on the <span class="gui-object-title">Inheritance</span> area in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, Inheritance tab." summary="This table describes the options on the Persistence Properties view, Inheritance tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="23%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t15">Property</th>
-<th align="left" valign="bottom" id="r1c2-t15">Description</th>
-<th align="left" valign="bottom" id="r1c3-t15">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t15" headers="r1c1-t15">Strategy</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">Specify the strategy to use when mapping a class or class hierarchy:
-<ul>
-<li>
-<p>Single table &ndash; All classes in the hierarchy are mapped to a single table.</p>
-</li>
-<li>
-<p>Joined &ndash; The root of the hierarchy is mapped to a single table; each child maps to its own table.</p>
-</li>
-<li>
-<p>Table per class &ndash; Each class is mapped to a separate table.</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>@Inheritance</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t15 r1c3-t15">Single table</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15"><a id="sthref223" name="sthref223"></a><a id="sthref224" name="sthref224"></a>Discriminator Value</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified <span class="bold">Discriminator Type</span>.</td>
-<td align="left" headers="r3c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t15" headers="r1c1-t15"><a id="sthref225" name="sthref225"></a><a id="sthref226" name="sthref226"></a>Discriminator Column</td>
-<td align="left" headers="r4c1-t15 r1c2-t15">These fields are available when using a <span class="bold">Single</span> or <span class="bold">Joined</span> inheritance strategy.
-<p>This field corresponds to the <code>@DiscriminatorColumn</code> annotation.</p>
-<p>Use the <span class="bold">Details</span> area to define the <span class="bold">Length</span> and <span class="bold">Column definition</span> of this Discriminator Column.</p>
-</td>
-<td align="left" headers="r4c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t15" headers="r1c1-t15">&nbsp;&nbsp;Name</td>
-<td align="left" headers="r5c1-t15 r1c2-t15">Name of the discriminator column</td>
-<td align="left" headers="r5c1-t15 r1c3-t15"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t15" headers="r1c1-t15">&nbsp;&nbsp;Type</td>
-<td align="left" headers="r6c1-t15 r1c2-t15">Set this field to set the discriminator type to <code>Char</code> or <code>Integer</code> (instead of its default: <code>String</code>). The <span class="bold">Discriminator Value</span> must conform to this type.</td>
-<td align="left" headers="r6c1-t15 r1c3-t15">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t15" headers="r1c1-t15">Primary Key Join Columns</td>
-<td align="left" headers="r7c1-t15 r1c2-t15">Use to override the default primary key join columns. Select <span class="bold">Override Default</span>, then click <span class="bold">Add</span> to select new Join Column.
-<p>This field corresponds with @PrimaryKeyJoinColumn annotation.</p>
-</td>
-<td align="left" headers="r7c1-t15 r1c3-t15"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm
deleted file mode 100644
index f4b3e9ab36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference010.htm
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Queries</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Queries" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect3"><!-- infolevel="all" infotype="General" --><a id="sthref227" name="sthref227"></a>
-<h1>Queries</h1>
-<p>Use the queries area of the JPA Details view to create named queries and named native queries. Refer to <a href="tasks009.htm#BABIGBGG">"Creating Named Queries"</a> for additional information.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks009.htm#BABIGBGG">Creating Named Queries</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
deleted file mode 100644
index 25cdce9134..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference011.htm
+++ /dev/null
@@ -1,82 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Join Table Information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Table Information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBAEBC" name="CACBAEBC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Join Table Information</h1>
-<p>Use area to specify a mapped column for joining an entity association. By default, the mapping is assumed to have a single join.</p>
-<p>This table lists the fields available on the <span class="gui-object-title">Join Table</span> area in <span class="gui-object-title">the JPA Details</span> view for <a href="tasks016.htm#BABHGEBD">One-to-many mapping</a> and <a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a> mapping types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Table tab." summary="This table describes the options on the Join Table tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="26%" />
-<col width="*" />
-<col width="34%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t17">Property</th>
-<th align="left" valign="bottom" id="r1c2-t17">Description</th>
-<th align="left" valign="bottom" id="r1c3-t17">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t17" headers="r1c1-t17">Name</td>
-<td align="left" headers="r2c1-t17 r1c2-t17">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t17 r1c3-t17">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t17" headers="r1c1-t17"><a id="CACBBDFG" name="CACBBDFG"></a>Join Columns</td>
-<td align="left" headers="r3c1-t17 r1c2-t17"><a id="sthref246" name="sthref246"></a><a id="sthref247" name="sthref247"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r3c1-t17 r1c3-t17">By default, the mapping is assumed to have a single join.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t17" headers="r1c1-t17">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t17 r1c2-t17">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t17 r1c3-t17"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference029.htm#CACCGEHC">Edit Join Columns Dialog</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm
deleted file mode 100644
index 619907782d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference012.htm
+++ /dev/null
@@ -1,71 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Join Columns Information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:47Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Join Columns Information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFCEJC" name="CACFCEJC"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Join Columns Information</h1>
-<p><a id="sthref248" name="sthref248"></a>This table lists the fields available in the <span class="gui-object-title">Join Table</span> area in <span class="gui-object-title">JPA Details</span> view for <a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a> and <a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a> mapping types.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Join Columns tab." summary="This table describes the options on the Join Columns tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="26%" />
-<col width="*" />
-<col width="34%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t18">Property</th>
-<th align="left" valign="bottom" id="r1c2-t18">Description</th>
-<th align="left" valign="bottom" id="r1c3-t18">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t18" headers="r1c1-t18">Join Column</td>
-<td align="left" headers="r2c1-t18 r1c2-t18"><a id="sthref249" name="sthref249"></a><a id="sthref250" name="sthref250"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t18 r1c3-t18">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="reference029.htm#CACCGEHC">Edit Join Columns Dialog</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm
deleted file mode 100644
index 0b08922f60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference013.htm
+++ /dev/null
@@ -1,98 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>General information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="General information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACCACGH" name="CACCACGH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>General information</h1>
-<p>This table lists the General information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<col width="22%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t20">Property</th>
-<th align="left" valign="bottom" id="r1c2-t20">Description</th>
-<th align="left" valign="bottom" id="r1c3-t20">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t20" headers="r1c1-t20">Package</td>
-<td align="left" headers="r2c1-t20 r1c2-t20">The Java package that contains the persistent entities. Click <span class="bold">Browse</span> and select the package</td>
-<td align="left" headers="r2c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t20" headers="r1c1-t20">Schema</td>
-<td align="left" headers="r3c1-t20 r1c2-t20">The database schema that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;schema&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r3c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t20" headers="r1c1-t20">Catalog</td>
-<td align="left" headers="r4c1-t20 r1c2-t20">The database catalog that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;catalog&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t20 r1c3-t20"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t20" headers="r1c1-t20">Access</td>
-<td align="left" headers="r5c1-t20 r1c2-t20">Specify the default access method for the variables in the project:
-<ul>
-<li>
-<p>Property</p>
-</li>
-<li>
-<p>Field</p>
-</li>
-</ul>
-<p>This field corresponds to the <code>&lt;access&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r5c1-t20 r1c3-t20"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm
deleted file mode 100644
index e824d3fab2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference014.htm
+++ /dev/null
@@ -1,106 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Persistence Unit information</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Persistence Unit information" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACEAGBG" name="CACEAGBG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Persistence Unit information</h1>
-<p>This table lists the Persistence Unit information fields available in the <span class="gui-object-title">JPA Details</span> view for each entity type. These fields are contained in the <code>&lt;persistence-unit-metadata&gt;</code> element in the <code>orm.xml</code> file.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<col width="22%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t21">Property</th>
-<th align="left" valign="bottom" id="r1c2-t21">Description</th>
-<th align="left" valign="bottom" id="r1c3-t21">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t21" headers="r1c1-t21">XML Mapping Data Complete</td>
-<td align="left" headers="r2c1-t21 r1c2-t21">Specifies that the Java classes in this persistence unit are fully specified by their metadata. Any annotations will be ignored.
-<p>This field corresponds to the <code>&lt;xml-mapping-metadata-complete&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r2c1-t21 r1c3-t21"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t21" headers="r1c1-t21">Cascade Persist</td>
-<td align="left" headers="r3c1-t21 r1c2-t21">Adds cascade-persist to the set of cascade options in entity relationships of the persistence unit.
-<p>This field corresponds to the <code>&lt;cascade-persist&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r3c1-t21 r1c3-t21"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t21" headers="r1c1-t21">Schema</td>
-<td align="left" headers="r4c1-t21 r1c2-t21">The database schema that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;schema&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r4c1-t21 r1c3-t21"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t21" headers="r1c1-t21">Catalog</td>
-<td align="left" headers="r5c1-t21 r1c2-t21">The database catalog that contains the <span class="bold">Table</span>.
-<p>This field corresponds to the <code>&lt;catalog&gt;</code> element in the <code>orm.xml</code> file.</p>
-</td>
-<td align="left" headers="r5c1-t21 r1c3-t21"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t21" headers="r1c1-t21">Access</td>
-<td align="left" headers="r6c1-t21 r1c2-t21">Specify how the entity its access instance variables.
-<ul>
-<li>
-<p>Property &ndash; Persistent state accessed through the property accessor methods. The property accessor methods must be <span class="bold">public</span> or <span class="bold">private</span>.</p>
-</li>
-<li>
-<p>Field &ndash; Instance variables are accessed directly. All non-transient instance variables are persistent.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r6c1-t21 r1c3-t21">Property</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
deleted file mode 100644
index dd0c88a4e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference015.htm
+++ /dev/null
@@ -1,116 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generators</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generators" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFGAIJ" name="CIAFGAIJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Generators</h1>
-<p>This table lists the Generator information fields available in the <span class="gui-object-title">JPA Details</span> view for the <code>orm.xml</code> file.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t22">Property</th>
-<th align="left" valign="bottom" id="r1c2-t22">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t22" headers="r1c1-t22">Generator</td>
-<td align="left" headers="r2c1-t22 r1c2-t22">Displays the existing Sequence and Table generators.
-<p>Click <span class="bold">Add Sequence</span> or <span class="bold">Add Table</span> to add a new generator.</p>
-<p>For sequence generators, you must complete the following fields:</p>
-<ul>
-<li>
-<p>Name</p>
-</li>
-<li>
-<p>Sequence</p>
-</li>
-<li>
-<p>Schema</p>
-</li>
-<li>
-<p>Catalog</p>
-</li>
-<li>
-<p>Allocation size</p>
-</li>
-<li>
-<p>Initial value</p>
-</li>
-</ul>
-<p>For table generators, you must complete the following fields:</p>
-<ul>
-<li>
-<p>Name</p>
-</li>
-<li>
-<p>Table</p>
-</li>
-<li>
-<p>Schema</p>
-</li>
-<li>
-<p>Catalog</p>
-</li>
-<li>
-<p>Primary key column</p>
-</li>
-<li>
-<p>Value column</p>
-</li>
-<li>
-<p>Primary key column value</p>
-</li>
-<li>
-<p>Allocation size</p>
-</li>
-</ul>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm
deleted file mode 100644
index 227a2b3ec2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference016.htm
+++ /dev/null
@@ -1,76 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Queries</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Queries" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAIBAAJ" name="CIAIBAAJ"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Queries</h1>
-<p>This table lists the Query information fields available in the <span class="gui-object-title">JPA Details</span> view for the <code>orm.xml</code> file.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, General tab." summary="This table describes the options on the Persistence Properties view, General tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="21%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t23">Property</th>
-<th align="left" valign="bottom" id="r1c2-t23">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t23" headers="r1c1-t23">Queries</td>
-<td align="left" headers="r2c1-t23 r1c2-t23">Displays the existing Named and Native queries.
-<p>Click <span class="bold">Add</span> to add a named query, or <span class="bold">Add Native</span> for a native query.</p>
-<p>For named queries, enter the query in the Query field.</p>
-<p>For native queries, select a result class, then enter the query in the Query field.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t23" headers="r1c1-t23">Query Hints</td>
-<td align="left" headers="r3c1-t23 r1c2-t23">Displays the existing query hints (Name and Value).
-<p>Click <span class="bold">Add</span> to add a new query hint.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks009.htm#BABIGBGG">Creating Named Queries</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
deleted file mode 100644
index a9a21aad29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference017.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Converters</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Converters" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIADGCID" name="CIADGCID"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Converters</h1>
-<p>The Converters information in the JPA Details view applies only when using EclipseLink</p>
-<p>Click <span class="bold">Add</span> to create a new converter, using the <a href="ref_add_converter.htm#CIAGCGIJ">Add Converter dialog</a>.</p>
-<p>&nbsp;</p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm
deleted file mode 100644
index 8f35b73150..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference018.htm
+++ /dev/null
@@ -1,183 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Connection</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Connection" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFFJIE" name="CIAFFJIE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Connection</h1>
-<p>The following table lists the properties available in the Connection page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref260" name="sthref260"></a><a id="sthref261" name="sthref261"></a>
-<p class="titleintable">Properties of the Connection Page</p>
-<table class="Formal" title="Properties of the Connection Page" summary="This table lists the properties for the persistence.xml editor&rsquo;s connection page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t25">Property</th>
-<th align="left" valign="bottom" id="r1c2-t25">Description</th>
-<th align="left" valign="bottom" id="r1c3-t25">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t25" headers="r1c1-t25">
-<p>Transaction Type</p>
-</td>
-<td align="left" headers="r2c1-t25 r1c2-t25">
-<p>Specify if the connection for this persistence unit uses one of the following transaction types:</p>
-<ul>
-<li>
-<p><span class="bold">Default</span> -- Select to use the container used by the container.</p>
-</li>
-<li>
-<p><span class="bold">JTA</span> (Java Transaction API) -- Transactions of the Java EE server.</p>
-</li>
-<li>
-<p><span class="bold">Resource Local</span> -- Native actions of a JDBC driver that are referenced by a persistence unit.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t25" headers="r1c1-t25">
-<p>Batch Writing</p>
-</td>
-<td align="left" headers="r3c1-t25 r1c2-t25">
-<p>Specify the use of batch writing to optimize transactions with multiple write operations.</p>
-<p>Set the value of this property into the session at deployment time.</p>
-<p>Note: This property applies when used both in a Java SE and Java EE environment.</p>
-<p>The following are the valid values for oracle.toplink.config.BatchWriting:</p>
-<ul>
-<li>
-<p><span class="bold">JDBC</span>&ndash;Use JDBC batch writing.</p>
-</li>
-<li>
-<p><span class="bold">Buffered</span>&ndash;Do not use either JDBC batch writing nor native platform batch writing.</p>
-</li>
-<li>
-<p><span class="bold">OracleJDBC</span>&ndash;Use both JDBC batch writing and Oracle native platform batch writing.</p>
-</li>
-<li>
-<p><span class="bold">None</span>&ndash;Do not use batch writing (turn it off).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t25 r1c3-t25">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t25" headers="r1c1-t25">
-<p>Statement caching</p>
-</td>
-<td align="left" headers="r4c1-t25 r1c2-t25"><br /></td>
-<td align="left" headers="r4c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t25" headers="r1c1-t25">
-<p>Native SQL</p>
-</td>
-<td align="left" headers="r5c1-t25 r1c2-t25"><br /></td>
-<td align="left" headers="r5c1-t25 r1c3-t25">
-<p>False</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t25" headers="r1c1-t25">
-<p>JTA Data Source Name</p>
-</td>
-<td align="left" headers="r6c1-t25 r1c2-t25">
-<p>If you selected <span class="bold">JTA</span> as the transaction type, then enter the name of the default JTA data source for the persistence unit.</p>
-</td>
-<td align="left" headers="r6c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t25" headers="r1c1-t25">
-<p>Non-JTA Data Source Name</p>
-</td>
-<td align="left" headers="r7c1-t25 r1c2-t25">
-<p>If you selected <span class="bold">Resource Local</span> as the transaction type, then enter the name of the non-JTA data source.</p>
-<p>This property is not available for projects using the Generic platform.</p>
-</td>
-<td align="left" headers="r7c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t25" headers="r1c1-t25">
-<p>&nbsp;&nbsp;Bind&nbsp;Parameters</p>
-</td>
-<td align="left" headers="r8c1-t25 r1c2-t25">
-<p>Control whether or not the query uses parameter binding.</p>
-<p>Note: This property applies when used in a Java SE environment.</p>
-<p>This property is not available for projects using the Generic platform.</p>
-</td>
-<td align="left" headers="r8c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t25" headers="r1c1-t25">
-<p>EclipseLink Connection Pool</p>
-</td>
-<td align="left" headers="r9c1-t25 r1c2-t25">
-<p>Define the connection pool driver, URL, user name and password.</p>
-<p>These properties are note available for projects using the Generic platform.</p>
-</td>
-<td align="left" headers="r9c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t25" headers="r1c1-t25">
-<p>&nbsp;&nbsp;Read&nbsp;Connection</p>
-</td>
-<td align="left" headers="r10c1-t25 r1c2-t25">
-<p>The maximum and minimum number of connections allowed in the JDBC read connection pool.</p>
-<p>Note: These property apply when used in a Java SE environment.</p>
-<p>These properties are not available for projects using the Generic platform</p>
-</td>
-<td align="left" headers="r10c1-t25 r1c3-t25"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t25" headers="r1c1-t25">
-<p>&nbsp;&nbsp;Write&nbsp;Connection</p>
-</td>
-<td align="left" headers="r11c1-t25 r1c2-t25">
-<p>The maximum and minimum number of connections allowed in the JDBC read connection pool.</p>
-<p>Note: These property apply when used in a Java SE environment.</p>
-<p>These properties are not available for projects using the Generic platform</p>
-</td>
-<td align="left" headers="r11c1-t25 r1c3-t25"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm
deleted file mode 100644
index 2a13dba748..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference019.htm
+++ /dev/null
@@ -1,221 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Customization</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Customization" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAJAFEG" name="CIAJAFEG"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Customization</h1>
-<p>The following table lists the properties available in the Customization page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref262" name="sthref262"></a><a id="sthref263" name="sthref263"></a>
-<p class="titleintable">Properties of the Customization Page</p>
-<table class="Formal" title="Properties of the Customization Page" summary="This table lists the properties of the persistence.xml Editor&rsquo;s Customization page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="23%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t26">Property</th>
-<th align="left" valign="bottom" id="r1c2-t26">Description</th>
-<th align="left" valign="bottom" id="r1c3-t26">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t26" headers="r1c1-t26">
-<p>Weaving</p>
-</td>
-<td align="left" headers="r2c1-t26 r1c2-t26">
-<p>Specifies if weaving of the entity classes is performed. The EclipseLink JPA persistence provider uses weaving to enhance JPA entities for such properties as lazy loading, change tracking, fetch groups, and internal optimizations. Select from the following options:</p>
-<ul>
-<li>
-<p><span class="bold">No Weaving</span></p>
-</li>
-<li>
-<p><span class="bold">Weave Dynamically</span></p>
-</li>
-<li>
-<p><span class="bold">Weave Statically</span> -- Use this option if you plan to execute your application outside of a Java EE 5 container in an environment that does not permit the use of <code>-javaagent:eclipselink.jar</code> on the JVM command line. This assumes that classes have already been statically woven. Run the static weaver on the classes before deploying them.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t26 r1c3-t26">
-<p>Weave Dynamically</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t26" headers="r1c1-t26">
-<p>&nbsp;&nbsp;Weaving&nbsp;Lazy</p>
-</td>
-<td align="left" headers="r3c1-t26 r1c2-t26">
-<p>Select this option to enable lazy weaving.</p>
-</td>
-<td align="left" headers="r3c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t26" headers="r1c1-t26">
-<p>&nbsp;&nbsp;Weaving&nbsp;Fetch&nbsp;Groups</p>
-</td>
-<td align="left" headers="r4c1-t26 r1c2-t26">
-<p>Select this option to enable fetch groups through weaving. Set this option to false if:</p>
-<ul>
-<li>
-<p>There is no weaving.</p>
-</li>
-<li>
-<p>Classes should not be changed during weaving (for example, when debugging).</p>
-</li>
-</ul>
-<p>Set this property to false for platforms where it is not supported.</p>
-</td>
-<td align="left" headers="r4c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t26" headers="r1c1-t26">
-<p>Weaving&nbsp;internal</p>
-</td>
-<td align="left" headers="r5c1-t26 r1c2-t26"><br /></td>
-<td align="left" headers="r5c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t26" headers="r1c1-t26">
-<p>Weaving&nbsp;eager</p>
-</td>
-<td align="left" headers="r6c1-t26 r1c2-t26"><br /></td>
-<td align="left" headers="r6c1-t26 r1c3-t26">
-<p>False</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t26" headers="r1c1-t26">
-<p>&nbsp;&nbsp;Weaving&nbsp;Change&nbsp;Tracking</p>
-</td>
-<td align="left" headers="r7c1-t26 r1c2-t26">
-<p>Select this option to use weaving to detect which fields or properties of the object change.</p>
-</td>
-<td align="left" headers="r7c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t26" headers="r1c1-t26">
-<p>&nbsp;&nbsp;Throw&nbsp;Exceptions</p>
-</td>
-<td align="left" headers="r8c1-t26 r1c2-t26">
-<p>Select this option to set EclipseLink to throw an exception or log a warning when it encounters a problem with any of the files listed in a <span class="bold">persistence.xml</span> file <code>&lt;mapping-file&gt;</code> element.</p>
-</td>
-<td align="left" headers="r8c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t26" headers="r1c1-t26">
-<p>Exception handler</p>
-</td>
-<td align="left" headers="r9c1-t26 r1c2-t26">
-<p>Select (or create) a Java class to handle exceptions.</p>
-</td>
-<td align="left" headers="r9c1-t26 r1c3-t26"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t26" headers="r1c1-t26">
-<p>Session Customizer</p>
-</td>
-<td align="left" headers="r10c1-t26 r1c2-t26">
-<p>Select a session customizer class: a Java class that implements the <code>eclipselink.tools.sessionconfiguration.SessionCustomizer</code> interface and provides a default (zero-argument) constructor. Use this class' <code>customize</code> method, which takes an <code>eclipselink.sessions.Session</code>, to programmatically access advanced EclipseLink session API.</p>
-</td>
-<td align="left" headers="r10c1-t26 r1c3-t26"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t26" headers="r1c1-t26">
-<p>Descriptor Customizer</p>
-</td>
-<td align="left" headers="r11c1-t26 r1c2-t26">
-<p>Select an EclipseLink descriptor customizer class&ndash;a Java class that implements the <code>eclipselink.tools.sessionconfiguration.DescriptorCustomizer</code> interface and provides a default (zero-argument) constructor. Use this class's <code>customize</code> method, which takes an <code>eclipselink.descriptors.ClassDescriptor</code>, to programmatically access advanced EclipseLink descriptor and mapping API for the descriptor associated with the JPA entity named <code>&lt;ENTITY&gt;</code>.</p>
-</td>
-<td align="left" headers="r11c1-t26 r1c3-t26"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t26" headers="r1c1-t26">
-<p>Validation only</p>
-</td>
-<td align="left" headers="r12c1-t26 r1c2-t26"><br /></td>
-<td align="left" headers="r12c1-t26 r1c3-t26">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t26" headers="r1c1-t26">
-<p>Profiler</p>
-</td>
-<td align="left" headers="r13c1-t26 r1c2-t26">
-<ul>
-<li>
-<p>No Profiler</p>
-</li>
-<li>
-<p>Performance Profiler</p>
-</li>
-<li>
-<p>Query Monitor</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r13c1-t26 r1c3-t26">
-<p>NoProfiler</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm
deleted file mode 100644
index 769e6de077..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference020.htm
+++ /dev/null
@@ -1,185 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Caching</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Caching" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIABEDCH" name="CIABEDCH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref264" name="sthref264"></a>Caching</h1>
-<p>This table lists the properties of the Caching page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div class="tblformal"><a id="sthref265" name="sthref265"></a><a id="sthref266" name="sthref266"></a>
-<p class="titleintable">Properties of the Caching Page</p>
-<table class="Formal" title="Properties of the Caching Page" summary="This table lists the properties of the persistence.xml&rsquo;s Caching page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t28">Property</th>
-<th align="left" valign="bottom" id="r1c2-t28">Description</th>
-<th align="left" valign="bottom" id="r1c3-t28">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t28" headers="r1c1-t28">
-<p>Default Cache Type</p>
-</td>
-<td align="left" headers="r2c1-t28 r1c2-t28">
-<p>Select one of the following as the Default Cache Type:</p>
-<ul>
-<li>
-<p><span class="bold">Soft with Weak Subcache</span>&ndash;This option is similar to <span class="bold">Weak with Hard Subcache</span> except that it maintains a most frequently used subcache that uses soft references. The size of the subcache is proportional to the size of the identity map. The subcache uses soft references to ensure that these objects are garbage-collected only if the system is low on memory.</p>
-<p>Use this identity map in most circumstances as a means to control memory used by the cache.</p>
-</li>
-<li>
-<p><span class="bold">Week with Hard Subcache</span>&ndash;This option is similar to <span class="bold">Soft with Weak</span> subcache except that it maintains a most frequently used subcache that uses hard references. Use this identity map if soft references are not suitable for your platform.</p>
-</li>
-<li>
-<p><span class="bold">Weak</span>&ndash;This option is similar to <span class="bold">Full</span>, except that objects are referenced using weak references. This option uses less memory than <span class="bold">Full</span>, allows complete garbage collection and provides full caching and guaranteed identity.</p>
-<p>Use this identity map for transactions that, once started, stay on the server side.</p>
-</li>
-<li>
-<p><span class="bold">Soft</span>&ndash;This option is similar to <span class="bold">Weak</span> except that the map holds the objects using soft references. This identity map enables full garbage collection when memory is low. It provides full caching and guaranteed identity.</p>
-</li>
-<li>
-<p><span class="bold">Full</span>&ndash;This option provides full caching and guaranteed identity: all objects are cached and not removed.</p>
-<p>Note: This process may be memory-intensive when many objects are read.</p>
-</li>
-<li>
-<p><span class="bold">None</span>&ndash;This option does not preserve object identity and does not cache objects.This option is not recommended.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t28 r1c3-t28">
-<p>Weak with soft subcache</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t28" headers="r1c1-t28">
-<p>Default Cache Size</p>
-</td>
-<td align="left" headers="r3c1-t28 r1c2-t28">
-<p>Set the size (maximum number of objects) of the cache.</p>
-</td>
-<td align="left" headers="r3c1-t28 r1c3-t28">
-<p>100</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t28" headers="r1c1-t28">
-<p>Default Shared Cache</p>
-</td>
-<td align="left" headers="r4c1-t28 r1c2-t28">
-<p>Specifies if cached instances should be in the shared cache or in a client isolated cache.</p>
-</td>
-<td align="left" headers="r4c1-t28 r1c3-t28">
-<p>True</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t28" headers="r1c1-t28">
-<p>Entity Caching</p>
-</td>
-<td align="left" headers="r5c1-t28 r1c2-t28">
-<p>Specify the entity-specific caching information.</p>
-</td>
-<td align="left" headers="r5c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t28" headers="r1c1-t28">
-<p>&nbsp;&nbsp;Cache&nbsp;Type</p>
-</td>
-<td align="left" headers="r6c1-t28 r1c2-t28">
-<p>See <span class="italic">Default Cache Type.</span></p>
-</td>
-<td align="left" headers="r6c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t28" headers="r1c1-t28">
-<p>&nbsp;&nbsp;Cache&nbsp;Size</p>
-</td>
-<td align="left" headers="r7c1-t28 r1c2-t28">
-<p>See <span class="italic">Default Cache Size.</span></p>
-</td>
-<td align="left" headers="r7c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t28" headers="r1c1-t28">
-<p>&nbsp;&nbsp;Shared&nbsp;Cache</p>
-</td>
-<td align="left" headers="r8c1-t28 r1c2-t28">
-<p>See <span class="italic">Default Shared Cache</span>.</p>
-</td>
-<td align="left" headers="r8c1-t28 r1c3-t28"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t28" headers="r1c1-t28">
-<p>Flush clear cache</p>
-</td>
-<td align="left" headers="r9c1-t28 r1c2-t28">
-<p>Select one of the following as the Default Cache Type:</p>
-<ul>
-<li>
-<p><span class="bold">Drop</span> &ndash; This mode is the fastest and uses the least memory. However, after commit the shared cache might potentially contain stale data.</p>
-</li>
-<li>
-<p><span class="bold">Drop Invalidate</span> &ndash; Classes that have at least one object updated or deleted are invalidated in the shared cache at commit time. This mode is slower than <span class="bold">Drop</span>, but as efficient memory usage-wise, and prevents stale data.</p>
-</li>
-<li>
-<p><span class="bold">Merge</span> &ndash; Drop classes from the EntityManager's cache of objects that have not been flushed. This mode leaves the shared cache in a perfect state after commit. However, it is the least memory-efficient mode; the memory might even run out in a very large transaction.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r9c1-t28 r1c3-t28">
-<p>Drop Invalidate</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" -->
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm
deleted file mode 100644
index c92c362700..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference021.htm
+++ /dev/null
@@ -1,241 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Logging</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Logging" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIABGHHI" name="CIABGHHI"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Logging</h1>
-<p>This table lists the properties of the Logging page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="tblformal"><a id="sthref267" name="sthref267"></a><a id="sthref268" name="sthref268"></a>
-<p class="titleintable">Properties of the Logging Page</p>
-<table class="Formal" title="Properties of the Logging Page" summary="This table lists the properties of the Logging page of the persistence.xml Editor." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t31">Property</th>
-<th align="left" valign="bottom" id="r1c2-t31">Description</th>
-<th align="left" valign="bottom" id="r1c3-t31">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t31" headers="r1c1-t31">
-<p>Logging Level</p>
-</td>
-<td align="left" headers="r2c1-t31 r1c2-t31">
-<p>Specifies the amount and detail of log output by selecting the log level (in ascending order of information):</p>
-<p>The following are the valid values for the <code>java.util.logging.Level</code>:</p>
-<ul>
-<li>
-<p><span class="bold">OFF</span>&ndash;disables logging</p>
-</li>
-<li>
-<p><span class="bold">SEVERE</span>&ndash;logs exceptions indicating TopLink cannot continue, as well as any exceptions generated during login. This includes a stack trace.</p>
-</li>
-<li>
-<p><span class="bold">WARNING</span>&ndash;logs exceptions that do not force TopLink to stop, including all exceptions not logged with severe level. This does not include a stack trace.</p>
-</li>
-<li>
-<p><span class="bold">INFO</span>&ndash;logs the login/logout per sever session, including the user name. After acquiring the session, detailed information is logged.</p>
-</li>
-<li>
-<p><span class="bold">CONFIG</span>&ndash;logs only login, JDBC connection, and database information.</p>
-</li>
-<li>
-<p><span class="bold">FINE</span>&ndash;logs SQL.</p>
-</li>
-<li>
-<p><span class="bold">FINER</span>&ndash;similar to warning. Includes stack trace.</p>
-</li>
-<li>
-<p><span class="bold">FINEST</span>&ndash;includes additional low level information.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.level" value="INFO"/&gt;
-</pre></td>
-<td align="left" headers="r2c1-t31 r1c3-t31">
-<p>Info</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t31" headers="r1c1-t31">
-<p>&nbsp;&nbsp;Timestamp</p>
-</td>
-<td align="left" headers="r3c1-t31 r1c2-t31">
-<p>Control whether the timestamp is logged in each log entry.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log a timestamp.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log a timestamp.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.timestamp" value="false"/&gt;
-</pre></td>
-<td align="left" headers="r3c1-t31 r1c3-t31">
-<p>true</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t31" headers="r1c1-t31">
-<p>&nbsp;&nbsp;Thread</p>
-</td>
-<td align="left" headers="r4c1-t31 r1c2-t31">
-<p>Control whether a thread identifier is logged in each log entry.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log a thread identifier.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log a thread identifier.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t31 r1c3-t31">
-<p>true</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t31" headers="r1c1-t31">
-<p>&nbsp;&nbsp;Session</p>
-</td>
-<td align="left" headers="r5c1-t31 r1c2-t31">
-<p>Control whether an EclipseLink session identifier is logged in each log entry.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log a EclipseLink session identifier.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log a EclipseLink session identifier.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.session" value="false"/&gt;
-</pre></td>
-<td align="left" headers="r5c1-t31 r1c3-t31">
-<p>true</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t31" headers="r1c1-t31">
-<p>&nbsp;&nbsp;Exceptions</p>
-</td>
-<td align="left" headers="r6c1-t31 r1c2-t31">
-<p>Control whether the exceptions thrown from within the EclipseLink code are logged prior to returning the exception to the calling application. Ensures that all exceptions are logged and not masked by the application code.</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">true</span>&ndash;log all exceptions.</p>
-</li>
-<li>
-<p><span class="bold">false</span>&ndash;do not log exceptions.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.exceptions" value="true"/&gt;
-</pre></td>
-<td align="left" headers="r6c1-t31 r1c3-t31">
-<p>false</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t31" headers="r1c1-t31">
-<p>Log file</p>
-</td>
-<td align="left" headers="r7c1-t31 r1c2-t31">
-<p>Specify a file location for the log output (instead of the standard out).</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.file" value="C:\myout\" /&gt;
-</pre></td>
-<td align="left" headers="r7c1-t31 r1c3-t31"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t31" headers="r1c1-t31">
-<p>Logger</p>
-</td>
-<td align="left" headers="r8c1-t31 r1c2-t31">
-<p>Select the type of logger to use:</p>
-<p>The following are the valid values:</p>
-<ul>
-<li>
-<p><span class="bold">DefaultLogger</span>&ndash;the EclipseLink native logger <code>eclipselink.logging.DefaultSessionLog</code>.</p>
-</li>
-<li>
-<p><span class="bold">JavaLogger</span>&ndash;the <code>java.util.logging</code> logger <code>eclipselink.logging.JavaLog</code>.</p>
-</li>
-<li>
-<p><span class="bold">ServerLogger</span>&ndash;the <code>java.util.logging</code> logger <code>eclipselink.platform.server.ServerLog</code>. Integrates with the application server's logging as define in the <code>eclipselink.platform.server.ServerPlatform.</code></p>
-</li>
-<li>
-<p>Fully qualified class name of a custom logger. The custom logger must implement the <code>eclipselink.logging.SessionLog</code> interface.</p>
-</li>
-</ul>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.logging.logger" value="acme.loggers.MyCustomLogger" /&gt;
-</pre></td>
-<td align="left" headers="r8c1-t31 r1c3-t31">
-<p>DefaultLogger</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm
deleted file mode 100644
index 111b7cbf21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference022.htm
+++ /dev/null
@@ -1,170 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Options</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Options" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAFJCHE" name="CIAFJCHE"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Options</h1>
-<p>This table lists the properties of the Options page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="tblformal"><a id="sthref269" name="sthref269"></a><a id="sthref270" name="sthref270"></a>
-<p class="titleintable">Properties of the Options Page</p>
-<table class="Formal" title="Properties of the Options Page" summary="Properties of the Options Page" dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t33">Property</th>
-<th align="left" valign="bottom" id="r1c2-t33">Description</th>
-<th align="left" valign="bottom" id="r1c3-t33">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t33" headers="r1c1-t33">
-<p>Session Name</p>
-</td>
-<td align="left" headers="r2c1-t33 r1c2-t33">
-<p>Specify the name by which the EclipseLink session is stored in the static session manager. Use this option if you need to access the EclipseLink shared session outside of the context of the JPA or to use a pre-existing EclipseLink session configured through a EclipseLink <code>sessions.xml</code> file</p>
-<p>Valid values: a valid EclipseLink session name that is unique in a server deployment.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.session-name" value="MySession"/&gt;
-</pre></td>
-<td align="left" headers="r2c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t33" headers="r1c1-t33">
-<p>Sessions XML</p>
-</td>
-<td align="left" headers="r3c1-t33 r1c2-t33">
-<p>Specify persistence information loaded from the EclipseLink session configuration file (<code>sessions.xml</code>).</p>
-<p>You can use this option as an alternative to annotations and deployment XML. If you specify this property, EclipseLink will override all class annotation and the object relational mapping from the <code>persistence.xml</code>, as well as <code>ORM.xml</code> and other mapping files, if present.</p>
-<p>Indicate the session by setting the <code>eclipselink.session-name</code> property.</p>
-<p>Note: If you do not specify the value for this property, <code>sessions.xml</code> file will not be used.</p>
-<p>Valid values: the resource name of the sessions XML file.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="toplink.session-xml" value="mysession.xml"/&gt;
-</pre></td>
-<td align="left" headers="r3c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t33" headers="r1c1-t33">
-<p>Target Database</p>
-</td>
-<td align="left" headers="r4c1-t33 r1c2-t33">
-<p>Select the target database. You can also set the value to the fully qualified class name of a subclass of the <code>org.eclipse.persistence.platform.DatabasePlatform class</code>.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.target-database" value="Oracle"/&gt;
-</pre></td>
-<td align="left" headers="r4c1-t33 r1c3-t33">
-<p>Auto</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t33" headers="r1c1-t33">
-<p>Target Server</p>
-</td>
-<td align="left" headers="r5c1-t33 r1c2-t33">
-<p>Select the target server for your JPA application.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.target-server" value="OC4J_10_1_3"/&gt;
-</pre></td>
-<td align="left" headers="r5c1-t33 r1c3-t33">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t33" headers="r1c1-t33">
-<p>Event Listener</p>
-</td>
-<td align="left" headers="r6c1-t33 r1c2-t33">
-<p>Specify a descriptor event listener to be added during bootstrapping.</p>
-<p>Valid values: qualified class name for a class that implements the <code>eclipselink.sessions.SessionEventListener</code> interface.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.session-event-listener" value="mypackage.MyClass.class"/&gt;
-</pre></td>
-<td align="left" headers="r6c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t33" headers="r1c1-t33">
-<p>Include Descriptor Queries</p>
-</td>
-<td align="left" headers="r7c1-t33 r1c2-t33">
-<p>Enable or disable the default copying of all named queries from the descriptors to the session. These queries include the ones defined using EclipseLink API, descriptor amendment methods, and so on.</p>
-</td>
-<td align="left" headers="r7c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t33" headers="r1c1-t33">
-<p>Miscellaneous Options</p>
-</td>
-<td align="left" headers="r8c1-t33 r1c2-t33"><br /></td>
-<td align="left" headers="r8c1-t33 r1c3-t33"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t33" headers="r1c1-t33">
-<p>&nbsp;&nbsp;Temporal mutable</p>
-</td>
-<td align="left" headers="r9c1-t33 r1c2-t33">
-<p>Specify if all <code>Date</code> and <code>Calendar</code> persistent fields should be handled as mutable objects.</p>
-<p><span class="bold">Example</span>: <code>persistence.xml</code> file</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;property name="eclipselink.temporal.mutable" value="true"/&gt;
-</pre></td>
-<td align="left" headers="r9c1-t33 r1c3-t33">
-<p>False</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm
deleted file mode 100644
index 52ec40416d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference023.htm
+++ /dev/null
@@ -1,143 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Schema Generation</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Schema Generation" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIACCFCB" name="CIACCFCB"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Schema Generation</h1>
-<p>This table lists the properties of the Schema Generation page of the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-This page is not available for projects using the <span class="bold">Generic</span> platform.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="tblformal"><a id="sthref271" name="sthref271"></a><a id="sthref272" name="sthref272"></a>
-<p class="titleintable">&nbsp;</p>
-<table class="Formal" title="" summary="This table lists the properties of the persistence.xml Editor&rsquo;s Schema Generation page." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="24%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t35">Property</th>
-<th align="left" valign="bottom" id="r1c2-t35">Description</th>
-<th align="left" valign="bottom" id="r1c3-t35">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t35" headers="r1c1-t35">
-<p>DDL Generation Type</p>
-</td>
-<td align="left" headers="r2c1-t35 r1c2-t35">
-<p>Select the type of DDL generation:</p>
-<ul>
-<li>
-<p><span class="bold">None</span> -- Do not generate DDL; no schema is generated.</p>
-</li>
-<li>
-<p><span class="bold">Create Tables</span> -- Create DDL for non-existent tables; leave existing tables unchanged.</p>
-</li>
-<li>
-<p><span class="bold">Drop and Create Tables</span> -- Create DDL for all tables; drop all existing tables.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r2c1-t35 r1c3-t35">
-<p>None</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t35" headers="r1c1-t35">
-<p>Output Mode</p>
-</td>
-<td align="left" headers="r3c1-t35 r1c2-t35">
-<p>Select the DDL generation target:</p>
-<ul>
-<li>
-<p><span class="bold">Both</span> -- Generate SQL files and execute them on the database.</p>
-</li>
-<li>
-<p><span class="bold">Database</span> -- Execute SQL on the database only (do not generate SQL files).</p>
-</li>
-<li>
-<p><span class="bold">SQL Script</span> -- Generate SQL files only (do not execute them on the database).</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t35 r1c3-t35"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t35" headers="r1c1-t35">
-<p>DDL Generation Location</p>
-</td>
-<td align="left" headers="r4c1-t35 r1c2-t35">
-<p>Specify where EclipseLink writes DDL output. Specify a file specification to a directory in which you have write access. The file specification may be relative to your current working directory or absolute. If it does not end in a file separator, then EclipseLink appends one that is valid for your operating system.</p>
-</td>
-<td align="left" headers="r4c1-t35 r1c3-t35"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t35" headers="r1c1-t35">
-<p>Create DDL File Name</p>
-</td>
-<td align="left" headers="r5c1-t35 r1c2-t35">
-<p>Specify the file name of the DDL file that EclipseLink generates that contains SQL statements for creating tables for JPA entities. Specify a file name valid for your operating system.</p>
-</td>
-<td align="left" headers="r5c1-t35 r1c3-t35">
-<p>createDDL.jdbc</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t35" headers="r1c1-t35">
-<p>Drop DDL File Name</p>
-</td>
-<td align="left" headers="r6c1-t35 r1c2-t35">
-<p>Specify the file name of the DDL file that EclipseLink generates that contains SQL statements for dropping tables for JPA entities.</p>
-</td>
-<td align="left" headers="r6c1-t35 r1c3-t35">
-<p>dropDDL.jdbc</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="tblformal" --></div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm
deleted file mode 100644
index 1830f01b1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference024.htm
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Properties</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Properties" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAHJDFF" name="CIAHJDFF"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Properties</h1>
-<p>This page enables you to add or remove the vendor-specific <code>&lt;properties&gt;</code> elements of <code>persistence.xml</code>.</p>
-<p>To add a property, click <span class="bold">Add</span> then enter the property <span class="bold">Name</span> and <span class="bold">Value</span>.</p>
-</div>
-<!-- class="sect3" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm
deleted file mode 100644
index 47b984b01f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference025.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Source</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Source" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIAHCJAH" name="CIAHCJAH"></a></p>
-<div class="sect3"><!-- infolevel="all" infotype="General" -->
-<h1>Source</h1>
-<p>Using this page, you can manually edit the <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for additional information.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a></div>
-<!-- class="sect3" -->
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm
deleted file mode 100644
index 235ba80757..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference026.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Preferences</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Preferences" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDEIEE" name="CACDEIEE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Preferences</h1>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li>
-<p><a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a></p>
-</li>
-<li>
-<p><a href="reference027.htm#CACFBAEH">Project Properties page &ndash; Validation Preferences</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm
deleted file mode 100644
index f48d45b158..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference027.htm
+++ /dev/null
@@ -1,108 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Project Properties page &ndash; Validation Preferences</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Project Properties page &ndash; Validation Preferences" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACFBAEH" name="CACFBAEH"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Project Properties page &ndash; Validation Preferences</h1>
-<p><a id="sthref275" name="sthref275"></a><a id="sthref276" name="sthref276"></a>Use the <span class="gui-object-title">Java Persistence</span> options on the <span class="gui-object-title">Properties</span> page to select the database connection to use with the project.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">JPA Details page</span>.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Persistence Properties page." summary="This table describes the options on the Persistence Properties page." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t37">Property</th>
-<th align="left" valign="bottom" id="r1c2-t37">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t37" headers="r1c1-t37"><a id="sthref277" name="sthref277"></a><a id="sthref278" name="sthref278"></a><a id="sthref279" name="sthref279"></a><a id="sthref280" name="sthref280"></a>Platform</td>
-<td align="left" headers="r2c1-t37 r1c2-t37">Select the vendor-specific platform.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t37" headers="r1c1-t37">Library</td>
-<td align="left" headers="r3c1-t37 r1c2-t37">Select a specific JPA library configuration.
-<p>Click <span class="bold">Manage libraries</span> to create or update a user library.</p>
-<p>Click <span class="bold">Download libraries</span> to download a specific library configuration.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t37" headers="r1c1-t37">&nbsp;&nbsp;Type</td>
-<td align="left" headers="r4c1-t37 r1c2-t37">Select <span class="bold">User Library</span> to select from the available user-defined or downloaded libraries.
-<p>If you select Disable, you must manually include the JPA implementation library on the project classpath.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t37" headers="r1c1-t37">&nbsp;&nbsp;Include&nbsp;libraries&nbsp;with&nbsp;this&nbsp;application</td>
-<td align="left" headers="r5c1-t37 r1c2-t37">Specify if the selected libraries are included when deploying the application.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t37" headers="r1c1-t37"><a id="sthref281" name="sthref281"></a><a id="sthref282" name="sthref282"></a><a id="sthref283" name="sthref283"></a>Connection</td>
-<td align="left" headers="r6c1-t37 r1c2-t37">The database connection used to map the persistent entities.
-<ul>
-<li>
-<p>To create a new connection, click <span class="bold">Add Connections</span>.</p>
-</li>
-<li>
-<p>To reconnect to an existing connection, click <span class="bold">Reconnect</span>.</p>
-</li>
-</ul>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t37" headers="r1c1-t37">&nbsp;&nbsp;Override&nbsp;default&nbsp;catalog&nbsp;from&nbsp;connection</td>
-<td align="left" headers="r7c1-t37 r1c2-t37">Select a catalog other than the default one derived from the connection information. Use this option if the default catalog is incorrect or cannot be used.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t37" headers="r1c1-t37">&nbsp;&nbsp;Override&nbsp;default&nbsp;schema&nbsp;from&nbsp;connection</td>
-<td align="left" headers="r8c1-t37 r1c2-t37">Select a schema other than the default one derived from the connection information. Use this option if the default schema is incorrect or cannot be used. For example, use this option when the deployment login differs from the design-time login.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t37" headers="r1c1-t37">Persistent Class Management</td>
-<td align="left" headers="r9c1-t37 r1c2-t37">Specify if Dali will <span class="bold">discover annotated classes automatically</span>, or if the <span class="bold">annotated classes must be listed in the persistence.xml</span> file.
-<p><span class="bold">Note</span>: To insure application portability, you should explicitly list the managed persistence classes that are included in the persistence unit.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t37" headers="r1c1-t37"><a id="sthref284" name="sthref284"></a><a id="sthref285" name="sthref285"></a>Canonical Metamodel</td>
-<td align="left" headers="r10c1-t37 r1c2-t37"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm
deleted file mode 100644
index 7371b2503f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference028.htm
+++ /dev/null
@@ -1,49 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Dialogs</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dialogs" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGEJDA" name="CACGEJDA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Dialogs</h1>
-<p>This section includes information on the following preference pages:</p>
-<ul>
-<li>
-<p><a href="reference029.htm#CACCGEHC">Edit Join Columns Dialog</a></p>
-</li>
-<li>
-<p><a href="ref_select_cascade_dialog.htm#CIAFDGIJ">Select Cascade dialog</a></p>
-</li>
-<li>
-<p><a href="ref_eclipselink_mapping_file.htm#CIAEDEJF">New EclipseLink Mapping File dialog</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm
deleted file mode 100644
index 9f66678703..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference029.htm
+++ /dev/null
@@ -1,67 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Edit Join Columns Dialog</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:48Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Edit Join Columns Dialog" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACCGEHC" name="CACCGEHC"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Edit Join Columns Dialog</h1>
-<p>Use the <span class="gui-object-title">Join Columns</span> dialog to create or modify the join tables and columns in relationship mappings.</p>
-<p>This table lists the properties available in the <span class="gui-object-title">Join Columns</span> dialog.</p>
-<div class="inftblinformal">
-<table class="Informal" title="This table describes the options on the Join Columns dialog." summary="This table describes the options on the Join Columns dialog." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="32%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t38">Property</th>
-<th align="left" valign="bottom" id="r1c2-t38">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t38" headers="r1c1-t38">Name</td>
-<td align="left" headers="r2c1-t38 r1c2-t38">Name of the joint table column that contains the foreign key column.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t38" headers="r1c1-t38">Referenced Column Name</td>
-<td align="left" headers="r3c1-t38 r1c2-t38">Name of the database column that contains the foreign key reference for the entity relationship.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" -->
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="reference011.htm#CACBAEBC">Join Table Information</a><br />
-<a href="reference012.htm#CACFCEJC">Join Columns Information</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm
deleted file mode 100644
index 70279780ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference030.htm
+++ /dev/null
@@ -1,46 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Icons and buttons</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons and buttons" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDHCIA" name="CACDHCIA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Icons and buttons</h1>
-<p>This section includes information on each of the icons and buttons used in the Dali OR Mapping Tool.</p>
-<ul>
-<li>
-<p><a href="reference031.htm#CACGEACG">Icons</a></p>
-</li>
-<li>
-<p><a href="reference032.htm#CACDJCEI">Buttons</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm
deleted file mode 100644
index 35760eef4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference031.htm
+++ /dev/null
@@ -1,125 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Icons</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Icons" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACGEACG" name="CACGEACG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Icons</h1>
-<p>The following icons are used throughout the Dali OR Mapping Tool.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the icons used in the Dali plug-in." summary="This table describes the icons used in the Dali plug-in." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="23%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t41">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t41">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t41" headers="r1c1-t41"><img src="img/new_icon_mappedentity.png" alt="" title="" /><br /></td>
-<td align="left" headers="r2c1-t41 r1c2-t41"><a href="tasks006.htm#BABGBIEE">Entity</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t41" headers="r1c1-t41"><img src="img/new_icon_embeddableentitymapping.png" alt="Embeddable entity icon" title="Embeddable entity icon" /><br /></td>
-<td align="left" headers="r3c1-t41 r1c2-t41"><a href="tasks007.htm#BABFEICE">Embeddable</a> entity</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t41" headers="r1c1-t41"><img src="img/new_icon_mappedsuperclass.png" alt="Mapped superclass icon" title="Mapped superclass icon" /><br /></td>
-<td align="left" headers="r4c1-t41 r1c2-t41"><a href="tasks008.htm#BABDAGCI">Mapped superclass</a></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t41" headers="r1c1-t41"><img src="img/new_icon_basicmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r5c1-t41 r1c2-t41"><a href="tasks010.htm#BABBABCE">Basic mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t41" headers="r1c1-t41"><img src="img/icon_basicmapmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r6c1-t41 r1c2-t41">Basic collection mapping</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t41" headers="r1c1-t41"><img src="img/icon_basicmapping.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r7c1-t41 r1c2-t41">Basic map mapping</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t41" headers="r1c1-t41"><img src="img/new_icon_embeddedidmapping.png" alt="Embedded mapping icon" title="Embedded mapping icon" /><br /></td>
-<td align="left" headers="r8c1-t41 r1c2-t41"><a href="tasks011.htm#BABCBHDF">Embedded mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r9c1-t41" headers="r1c1-t41"><img src="img/new_icon_embeddedmapping.png" alt="Embedded ID mapping icon" title="Embedded ID mapping icon" /><br /></td>
-<td align="left" headers="r9c1-t41 r1c2-t41"><a href="tasks012.htm#CIHDIAEE">Embedded ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r10c1-t41" headers="r1c1-t41"><img src="img/new_icon_idmapping.png" alt="ID mapping icon" title="ID mapping icon" /><br /></td>
-<td align="left" headers="r10c1-t41 r1c2-t41"><a href="tasks013.htm#BABGCBHG">ID mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r11c1-t41" headers="r1c1-t41"><img src="img/new_icon_manytomanymapping.png" alt="Many-to-many mapping icon" title="Many-to-many mapping icon" /><br /></td>
-<td align="left" headers="r11c1-t41 r1c2-t41"><a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r12c1-t41" headers="r1c1-t41"><img src="img/new_icon_manytoonemapping.png" alt="Many-to-one mapping icon." title="Many-to-one mapping icon." /><br /></td>
-<td align="left" headers="r12c1-t41 r1c2-t41"><a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r13c1-t41" headers="r1c1-t41"><img src="img/new_icon_onetomanymapping.png" alt="One-to-many mapping icon" title="One-to-many mapping icon" /><br /></td>
-<td align="left" headers="r13c1-t41 r1c2-t41"><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r14c1-t41" headers="r1c1-t41"><img src="img/new_icon_onetoonemapping.png" alt="One-to-one mapping icon." title="One-to-one mapping icon." /><br /></td>
-<td align="left" headers="r14c1-t41 r1c2-t41"><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r15c1-t41" headers="r1c1-t41"><img src="img/icon_basicmapmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r15c1-t41 r1c2-t41">Transformation mappings</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r16c1-t41" headers="r1c1-t41"><img src="img/new_icon_transientmapping.png" alt="Transient mapping icon." title="Transient mapping icon." /><br /></td>
-<td align="left" headers="r16c1-t41 r1c2-t41"><a href="tasks018.htm#BABHFHEI">Transient mapping</a><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r17c1-t41" headers="r1c1-t41"><img src="img/icon_basicmapmappings.png" alt="Basic mapping icon" title="Basic mapping icon" /><br /></td>
-<td align="left" headers="r17c1-t41 r1c2-t41">Variable one-to-one mappings</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r18c1-t41" headers="r1c1-t41"><img src="img/new_icon_versionmapping.png" alt="Version mapping icon." title="Version mapping icon." /><br /></td>
-<td align="left" headers="r18c1-t41 r1c2-t41"><a href="tasks019.htm#BABHIBII">Version mapping</a><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="reference030.htm#CACDHCIA">Icons and buttons</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm
deleted file mode 100644
index 36db5405f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference032.htm
+++ /dev/null
@@ -1,62 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Buttons</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Buttons" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACDJCEI" name="CACDJCEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Buttons</h1>
-<p>The following buttons are used throughout the Dali OR Mapping Tool.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the buttons used in the Dali plug-in." summary="This table describes the buttons used in the Dali plug-in." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="27%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t42">Icon</th>
-<th align="left" valign="bottom" id="r1c2-t42">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t42" headers="r1c1-t42"><img src="img/new_jpa_perspective_button.png" alt="The JPA Perspective icon" title="The JPA Perspective icon" /><br /></td>
-<td align="left" headers="r2c1-t42 r1c2-t42">JPA Development perspective</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="reference030.htm#CACDHCIA">Icons and buttons</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm b/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm
deleted file mode 100644
index 9a706b9f2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/reference033.htm
+++ /dev/null
@@ -1,53 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Dali Developer Documentation</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Dali Developer Documentation" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CACBBDIB" name="CACBBDIB"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Dali Developer Documentation</h1>
-<p><a id="sthref288" name="sthref288"></a><a id="sthref289" name="sthref289"></a><a id="sthref290" name="sthref290"></a>Additional Dali documentation is available online at:</p>
-<p><code><a href="http://wiki.eclipse.org/index.php/Dali_Developer_Documentation">http://wiki.eclipse.org/index.php/Dali_Developer_Documentation</a></code></p>
-<p>This developer documentation includes information about:</p>
-<ul>
-<li>
-<p>Dali architecture</p>
-</li>
-<li>
-<p>Plugins that comprise the Dali JPA Eclipse feature</p>
-</li>
-<li>
-<p>Extension points</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm
deleted file mode 100644
index 4c9842ee03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_add_persistence.htm
+++ /dev/null
@@ -1,60 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Adding persistence to a class</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Adding persistence to a class" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHICAI" name="BABHICAI"></a></p>
-<div class="sect1">
-<h1>Adding persistence to a class</h1>
-<p><a id="sthref67" name="sthref67"></a><a id="sthref68" name="sthref68"></a><a id="sthref69" name="sthref69"></a>You can make a Java class into one of the following persistent types:</p>
-<ul>
-<li>
-<p><a href="tasks006.htm#BABGBIEE">Entity</a></p>
-</li>
-<li>
-<p><a href="tasks007.htm#BABFEICE">Embeddable</a></p>
-</li>
-<li>
-<p><a href="tasks008.htm#BABDAGCI">Mapped superclass</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm
deleted file mode 100644
index 77d584cd6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_additonal_tables.htm
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Specifying additional tables</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying additional tables" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHGBIEI" name="CIHGBIEI"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Specifying additional tables</h1>
-<p>Add a secondary table annotation to an entity if its data is split across more than one table.</p>
-<p>To add a secondary table to the entity,</p>
-<ol>
-<li>
-<p>Select the entity in the <span class="gui-object-title">Project Explorer</span>.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, select the <span class="gui-object-action">Secondary Tables</span> information.</p>
-<div class="figure"><a id="sthref92" name="sthref92"></a>
-<p class="titleinfigure">Specifying Secondary Tables</p>
-<img src="img/secondary_tables.png" alt="Secondary Tables area on the JPA Details view." title="Secondary Tables area on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Click <span class="bold">Add</span> to associate an additional table with the entity. The Edit Secondary Table dialog appears</p>
-</li>
-<li>
-<p>Select the <span class="bold">Name</span>, <span class="bold">Catalog</span>, and <span class="bold">Schema</span> of the additional table to associate with the entity.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotations the entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@SecondaryTable(name="NAME", catalog = "CATALOG", schema = "SCHEMA")
-
-</pre>
-<p>To override the default primary key:</p>
-<ol>
-<li>
-<p>Enable the <span class="bold">Overwrite default</span> option, then click <span class="bold">Add</span> to specify a new primary key join column. The Create New Primary Key Join Column appears.</p>
-</li>
-<li>
-<p>Select the <span class="bold">Name</span>, <span class="bold">Referenced column name</span>, <span class="bold">Table</span>, and <span class="bold">Column definition</span> of the primary key for the entity.</p>
-<p>Eclipse adds the following annotations the entity:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@SecondaryTable(name="NAME", catalog = "CATALOG", schema = "SCHEMA", pkJoinColumns = {@PrimaryKeyJoinColumn(name="id", referencedColumnName = "id"),@PrimaryKeyJoinColumn(name="NAME", referencedColumnName = "REFERENCED COLUMN NAME", columnDefinition = "COLUMN DEFINITION")})
-
-</pre></li>
-</ol>
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_jpa_entity.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_create_jpa_entity.htm
deleted file mode 100644
index a83f787ffc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_jpa_entity.htm
+++ /dev/null
@@ -1,160 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating a JPA Entity</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a JPA Entity" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFBJBG" name="BABFBJBG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref40" name="sthref40"></a>Creating a JPA Entity</h1>
-<p>Use this procedure to create a JPA entity:</p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, select the JPA project and then <span class="bold">File &gt; New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-<div class="figure"><a id="sthref41" name="sthref41"></a>
-<p class="titleinfigure">Selecting the Create a JPA Entity Wizard</p>
-<img src="img/select_a_wizard_entity.png" alt="The Select a Wizard dialog with Entity selected." title="The Select a Wizard dialog with Entity selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">JPA &gt; Entity</span> and then click <span class="bold">Next</span>. The <a href="ref_EntityClassPage.htm#CIAFEIGF">Entity Class page</a> appears.</p>
-<div class="figure"><a id="sthref42" name="sthref42"></a>
-<p class="titleinfigure"><a id="sthref43" name="sthref43"></a>The Entity Class Page</p>
-<img src="img/create_jpa_entity_wizard.png" alt="The Entity Class page of the Create a JPA Entity wizard." title="The Entity Class page of the Create a JPA Entity wizard." /><br /></div>
-<!-- class="figure" -->
-<p>Complete this page as follows:</p>
-<ul>
-<li>
-<p>Select the JPA project in the <span class="bold">Project</span> field.</p>
-</li>
-<li>
-<p>In the <span class="bold">Source Folder</span> field, select, or enter, the location of the JPA project's <code>src</code> folder.</p>
-</li>
-<li>
-<p>Select, or enter, the name of the class package for this entity in the <span class="bold">Java Package</span> field.</p>
-</li>
-<li>
-<p>Enter the name of the Java class in the <span class="bold">Class name</span> field.</p>
-</li>
-<li>
-<p>If needed, enter, or select a superclass.</p>
-</li>
-<li>
-<p>If needed, complete the Inheritance section as follows (these properties are optional):</p>
-<ul>
-<li>
-<p>Accept the <span class="bold">Entity</span> option (the default) to create a Java class with the <code>@Entity</code> option.</p>
-</li>
-<li>
-<p>Alternatively, select <a href="tasks008.htm#BABDAGCI">Mapped superclass</a> (if you defined a super class).</p>
-</li>
-<li>
-<p>Select <span class="bold">Inheritance</span> and then select one of the JSR 220 inheritance mapping strategies (SINGLE_TABLE, TABLE_PER_CLASS, JOINED).</p>
-</li>
-<li>
-<p>Select <span class="bold">Add to entity mappings in XML</span> to create XML mappings in <code>orm.xml</code>, rather than annotations.</p>
-</li>
-</ul>
-</li>
-</ul>
-</li>
-<li>
-<p>Click <span class="bold">Next</span> to proceed to the <a href="ref_EntityPropertiesPage.htm#CIADECIA">Entity Properties page</a> where you define the persistent fields for the entity.</p>
-<div class="figure"><a id="sthref44" name="sthref44"></a>
-<p class="titleinfigure"><a id="sthref45" name="sthref45"></a>The Entity Properties Page</p>
-<img src="img/create_jpa_fields.png" alt="The Entity Properties page of the Create JPA Entity wizard." title="The Entity Properties page of the Create JPA Entity wizard." /><br /></div>
-<!-- class="figure" -->
-<p>Alternatively, click <span class="bold">Finish</span> to complete the entity.</p>
-</li>
-<li>
-<p>Complete the page as follows:</p>
-<ol>
-<li>
-<p>If needed, enter a new name for the entity. Doing so results in adding a <code>name</code> attribute to the <code>@Entity</code> notation (<code>@Entity(name="EntityName")</code>).</p>
-</li>
-<li>
-<p>Accept <span class="bold">Use default</span> (the default setting) to use the default value for the name of the mapped table. Entering a different name results in adding the <code>@Table</code> notation with its <code>name</code> attribute defined as the new table (<code>@Table(name="TableName")</code>).</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Entity Name-related options are not available if you selected <a href="tasks008.htm#BABDAGCI">Mapped superclass</a> on the <a href="ref_EntityClassPage.htm#CIAFEIGF">Entity Class page</a></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Add persistence fields to the entity by clicking <span class="bold">Add</span>. The Entity Fields dialog appears.</p>
-<div class="figure"><a id="sthref46" name="sthref46"></a>
-<p class="titleinfigure">The Entity Fields Dialog</p>
-<img src="img/jpa_wizard_create_fields.png" alt="The Entity Fields dialog." title="The Entity Fields dialog." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select a persistence type from the Type list. You can retrieve additional types using the <span class="bold">Browse</span> function.</p>
-</li>
-<li>
-<p>Enter the field name and then click <span class="bold">OK</span>. Repeat this procedure for each field.</p>
-</li>
-<li>
-<p>If needed, select <span class="bold">Key</span> to designate the field as a primary key.</p>
-</li>
-<li>
-<p>Select either the <span class="bold">Field-based</span> access type (the default) or <span class="bold">Property-based</span> access type.</p>
-</li>
-</ol>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>. Eclipse adds the entity to your project.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a><br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
deleted file mode 100644
index ee7e1ede8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_create_new_project.htm
+++ /dev/null
@@ -1,141 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating a new JPA project</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating a new JPA project" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHHEJCJ" name="CIHHEJCJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Creating a new JPA project</h1>
-<p><a id="sthref26" name="sthref26"></a><a id="sthref27" name="sthref27"></a>Use this procedure to create a new JPA project.</p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, select <span class="bold">File &gt; New &gt; Project</span>. The Select a wizard dialog appears.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also select the JPA perspective and then select <span class="bold">File &gt; New &gt; JPA Project</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<div class="figure"><a id="sthref28" name="sthref28"></a>
-<p class="titleinfigure"><a id="sthref29" name="sthref29"></a>Selecting the Create a JPA Project wizard</p>
-<img src="img/select_a_wizard_jpa_project.png" alt="The Select a Wizard dialog with JPA project selected." title="The Select a Wizard dialog with JPA project selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">JPA Project</span> and then click <span class="bold">Next</span>. The <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> appears.</p>
-<div class="figure"><a id="sthref30" name="sthref30"></a>
-<p class="titleinfigure"><a id="sthref31" name="sthref31"></a>The JPA Project Page</p>
-<img src="img/new_jpa_project_task.png" alt="The JPA Project page of the Create a JPA Project wizard." title="The JPA Project page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_new_jpa_project.htm#CACBJAGC">New JPA Project page</a> to specify the project name and location, target runtime, and pre-defined configuration.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The Target Runtime is not required for Java SE development.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Next</span>. The Java source page appears.</p>
-<div class="figure"><a id="sthref32" name="sthref32"></a>
-<p class="titleinfigure">The Java Source Page</p>
-<img src="img/java_editor_address.png" alt="The JPA Facet page of the Create a JPA Project wizard." title="The JPA Facet page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Click <span class="bold">Add Folder</span> to add existing Java source files to the project.</p>
-</li>
-<li>
-<p>Click <span class="bold">Next</span>. <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p>
-<div class="figure"><a id="sthref33" name="sthref33"></a>
-<p class="titleinfigure"><a id="sthref34" name="sthref34"></a>The JPA Facet Page</p>
-<img src="img/new_jpa_facet_task.png" alt="The JPA Facet page of the Create a JPA Project wizard." title="The JPA Facet page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> to specify your vender-specific platform, JPA implementation library, and database connection.</p>
-<p>Click <span class="bold">Manage libraries</span> to create or update your JPA user libraries. Click <span class="bold">Download libraries</span> to obtain additional JPA implementation libraries.</p>
-<p>If Dali derives the incorrect schema, select <span class="bold">Override the Default Schema for Connection</span>. Using this option, you can select a development time schema for defaults and validation.</p>
-<p>If you clear the <span class="bold">Create orm.xml</span> option (which is selected by default), you can later add a mapping file to the project using the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-If the server runtime does not provide a JPA implementation, you must explicitly select a JPA implementation library.
-<p>To insure the portability of your application, you must explicitly list the managed persistence classes that are included in the persistence unit. If the server supports EJB 3.0, the persistent classes will be discovered automatically.</p>
-<p>Depending on your JPA implementation (for example, Generic or EclipseLink), different options may be available when creating JPA projects.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>. You should now open the <a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a><br />
-<a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="tasks001.htm#BEIBADHH">Converting a Java Project to a JPA Project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_classes_from_schema.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_classes_from_schema.htm
deleted file mode 100644
index 429ee81d23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_generate_classes_from_schema.htm
+++ /dev/null
@@ -1,55 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generating JAXB Classes from a Schema</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T19:33:3Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating JAXB Classes from a Schema" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHCBHJD" name="CIHCBHJD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generating JAXB Classes from a Schema</h1>
-<p><a id="sthref197" name="sthref197"></a><a id="sthref198" name="sthref198"></a><a id="sthref199" name="sthref199"></a>Use the Generate Classes from XSD dialog to generate JAXB classes from an XML schema (&nbsp;.xsd).<a id="sthref200" name="sthref200"></a></p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, right-click a schema (&nbsp;.xsd file) and select <span class="bold">Generate &gt; JAXB Classes</span>. The Generate Classes from Schema dialog appears.</p>
-<div class="figure"><a id="sthref201" name="sthref201"></a>
-<p class="titleinfigure"><a id="sthref202" name="sthref202"></a>Configure JAXB Class Generation dialog</p>
-<img src="img/generate_classes_from_schema.png" alt="Generate classes from schema dialog." title="Generate classes from schema dialog." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Enter the JAXB settings information and click <span class="bold">Finish</span>.</p>
-</li>
-</ol>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_configure_jaxb_class_generation_dialog.htm#CACHHHJA">Configure JAXB Class Generation dialog</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_generating_schema_from_classes.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_generating_schema_from_classes.htm
deleted file mode 100644
index 6e7cf1cca2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_generating_schema_from_classes.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generating Schema from Classes</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T16:18:12Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating Schema from Classes" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHHBJCJ" name="CIHHBJCJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generating Schema from Classes</h1>
-<p><a id="sthref189" name="sthref189"></a><a id="sthref190" name="sthref190"></a><a id="sthref191" name="sthref191"></a>Use the Generate Schema from JAXB Classes wizard create an XML schema (&nbsp;.xsd) for a set of JAXB mapped classes.<a id="sthref192" name="sthref192"></a></p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, select <span class="bold">File &gt; New &gt; Other</span>. The Select a wizard dialog appears.</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also access the Generate Schema from JAXB Classes wizard from a specific project or package.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<div class="figure"><a id="sthref193" name="sthref193"></a>
-<p class="titleinfigure"><a id="sthref194" name="sthref194"></a>Selecting the Schema From JAXB Classes wizard</p>
-<img src="img/select_jaxb_schema_wizard.png" alt="The Select a Wizard dialog with Schema From JAXB Classes selected." title="The Select a Wizard dialog with Schema From JAXB Classes selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">JAXB &gt; Schema from JAXB Classes</span> and then click <span class="bold">Next</span>. The <a href="ref_schema_from_classes_page.htm#CACHBEGJ">Generate Schema from Classes</a> page of the <a href="ref_jaxb_schema_wizard.htm#CACGADFH">Generate Schema from JAXB Classes Wizard</a> appears.</p>
-<div class="figure"><a id="sthref195" name="sthref195"></a>
-<p class="titleinfigure"><a id="sthref196" name="sthref196"></a>The Generate Schema from Classes Page</p>
-<img src="img/jaxb_schmea_generation_dialog.png" alt="The JPA Project page of the Create a JPA Project wizard." title="The JPA Project page of the Create a JPA Project wizard." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select the project, package, or classes from which to generate the schema and click <span class="bold">Finish</span>.</p>
-</li>
-</ol>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_jaxb_schema_wizard.htm#CACGADFH">Generate Schema from JAXB Classes Wizard</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm
deleted file mode 100644
index 15a4d073d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_inheritance.htm
+++ /dev/null
@@ -1,138 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Specifying entity inheritance</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Specifying entity inheritance" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHCCCJD" name="CIHCCCJD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Specifying entity inheritance</h1>
-<p><a id="sthref93" name="sthref93"></a><a id="sthref94" name="sthref94"></a>An entity may inherit properties from other entities. You can specify a specific strategy to use for inheritance.</p>
-<p>Use this procedure to specify inheritance (<code>@Inheritance)</code> for an existing entity (<code>@Entity</code>):</p>
-<ol>
-<li>
-<p>Select the entity in the <span class="gui-object-title">Project Explorer</span>.</p>
-</li>
-<li>
-<p>In the <span class="gui-object-title">JPA Details</span> view, select the <span class="gui-object-action">Inheritance</span> information.</p>
-<div class="figure"><a id="sthref95" name="sthref95"></a>
-<p class="titleinfigure">Specifying Inheritance</p>
-<img src="img/inheritance_tab.png" alt="Selecting the Inheritance area on the JPA Details view." title="Selecting the Inheritance area on the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>In the <span class="bold">Strategy</span> list, select one of the following the inheritance strategies:</p>
-<ul>
-<li>
-<p>A single table (default)</p>
-</li>
-<li>
-<p>Joined table</p>
-</li>
-<li>
-<p>One table per class</p>
-</li>
-</ul>
-</li>
-<li>
-<p>Use the following table to complete the remaining fields on the tab. See <a href="reference009.htm#CACFHGHE">"Inheritance information"</a> for additional details.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table describes the options on the Persistence Properties view, Inheritance tab." summary="This table describes the options on the Persistence Properties view, Inheritance tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="24%" />
-<col width="*" />
-<col width="23%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t13">Property</th>
-<th align="left" valign="bottom" id="r1c2-t13">Description</th>
-<th align="left" valign="bottom" id="r1c3-t13">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t13" headers="r1c1-t13"><a id="sthref96" name="sthref96"></a><a id="sthref97" name="sthref97"></a>Discriminator Column</td>
-<td align="left" headers="r2c1-t13 r1c2-t13">Name of the discriminator column when using a <span class="bold">Single</span> or <span class="bold">Joined</span> inheritance strategy.
-<p>This field corresponds to the <code>@DiscriminatorColumn</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t13" headers="r1c1-t13">Discriminator Type</td>
-<td align="left" headers="r3c1-t13 r1c2-t13">Set the discriminator type to <code>Char</code> or <code>Integer</code> (instead of its default: <code>String</code>). The <span class="bold">Discriminator Value</span> must conform to this type.</td>
-<td align="left" headers="r3c1-t13 r1c3-t13">String</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t13" headers="r1c1-t13"><a id="sthref98" name="sthref98"></a><a id="sthref99" name="sthref99"></a>Discriminator Value</td>
-<td align="left" headers="r4c1-t13 r1c2-t13">Specify the discriminator value used to differentiate an entity in this inheritance hierarchy. The value must conform to the specified <span class="bold">Discriminator Type</span>.
-<p>This field corresponds to the <code>@DiscriminatorValue</code> annotation.</p>
-</td>
-<td align="left" headers="r4c1-t13 r1c3-t13"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t13" headers="r1c1-t13">Override Default</td>
-<td align="left" headers="r5c1-t13 r1c2-t13">Use this field to specify custom primary key join columns.
-<p>This field corresponds to the <code>@PrimaryKeyJoinClumn</code> annotation.</p>
-</td>
-<td align="left" headers="r5c1-t13 r1c3-t13"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations the entity field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Inheritance(strategy=InheritanceType.<span class="italic">&lt;INHERITANCE_STRATEGY&gt;</span>)
-@DiscriminatorColumn(name="<span class="italic">&lt;DISCRIMINATOR_COLUMN&gt;</span>",
- discriminatorType=<span class="italic">&lt;DISCRIMINATOR_TYPE&gt;</span>)
-@DiscriminatorValue(value-"<span class="italic">&lt;DISCRIMINATOR_VALUE&gt;</span>")
-@PrimaryKeyJoinColumn(name="<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>",
- referencedColumnName = "<span class="italic">&lt;REFERENCED_COLUMN_NAME&gt;</span>")
-
-</pre>
-<p><a id="sthref100" name="sthref100"></a><a id="sthref101" name="sthref101"></a><a id="sthref102" name="sthref102"></a>The following figures illustrates the different inheritance strategies.</p>
-<div class="figure"><a id="sthref103" name="sthref103"></a>
-<p class="titleinfigure">Single Table Inheritance</p>
-<img src="img/inheritance_single.png" alt="This figure illustrates entity inheritance in a single table." title="This figure illustrates entity inheritance in a single table." /><br /></div>
-<!-- class="figure" -->
-<div class="figure"><a id="sthref104" name="sthref104"></a>
-<p class="titleinfigure"><a id="sthref105" name="sthref105"></a><a id="sthref106" name="sthref106"></a>Joined Table Inheritance</p>
-<img src="img/inheritance_join.png" alt="This figure illustrates a joined subclass inheritance strategy." title="This figure illustrates a joined subclass inheritance strategy." /><br /></div>
-<!-- class="figure" -->
-<br />
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br /></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm
deleted file mode 100644
index 8968739b98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_orm.htm
+++ /dev/null
@@ -1,64 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Managing the orm.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the orm.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDGDCD" name="CIHDGDCD"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref58" name="sthref58"></a>Managing the orm.xml file</h1>
-<p>When creating a JPA project, (see <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a>) you can also create the <code>orm.xml</code> file that defines the mapping metadata and defaults.</p>
-<p><a id="sthref59" name="sthref59"></a>Eclipse creates the <code>META-INF\orm.xml</code> file in your project's directory:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;persistence version="<span class="italic">&lt;PERSISTENCE_VERSION&gt;</span>"
- xmlns="http://java.sun.com/xml/ns/persistence"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
- http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
- &lt;persistence-unit name="<span class="italic">&lt;PERSISTENCE_UNIT_NAME&gt;</span>"&gt;
- &lt;provider="<span class="italic">&lt;PERSISTENCE_PROVIDER&gt;</span>" /&gt;
- &lt;/persistence-unit&gt;
-&lt;/persistence&gt;
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_eclipselink_mapping_file.htm#CIAEDEJF">New EclipseLink Mapping File dialog</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks005.htm#CIHBCDCE">Working with orm.xml file</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
deleted file mode 100644
index 92f618b401..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_manage_persistence.htm
+++ /dev/null
@@ -1,222 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Managing the persistence.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Managing the persistence.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDAJID" name="CIHDAJID"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1><a id="sthref47" name="sthref47"></a>Managing the persistence.xml file</h1>
-<p><a id="sthref48" name="sthref48"></a>When you create a project, Eclipse creates the <code>META-INF\persistence.xml</code> file in the project's directory.</p>
-<p>You can create a stub <code>persistence.xml</code> file in the META-INF directory when you create a JPA project (see <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a>). You can manage this file either through the XML editor (see ) or through the <a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Depending on your JPA implementation (for example, EclipseLink), the following additional pages may be available in the persistence.xml Editor:
-<ul>
-<li>
-<p><a href="reference019.htm#CIAJAFEG">Customization</a></p>
-<p>Use this page to define change-tracking and session customizer-related properties.</p>
-</li>
-<li>
-<p><a href="reference020.htm#CIABEDCH">Caching</a></p>
-<p>Use this page to define caching properties.</p>
-</li>
-<li>
-<p><a href="reference021.htm#CIABGHHI">Logging</a></p>
-<p>Use this page to define logging properties.</p>
-</li>
-<li>
-<p><a href="reference022.htm#CIAFJCHE">Options</a></p>
-<p>Use this page to define session and target database properties.</p>
-</li>
-<li>
-<p><a href="reference023.htm#CIACCFCB">Schema Generation</a></p>
-<p>Use this page to define DDL-related properties.</p>
-</li>
-</ul>
-<p>For projects using the EclipseLink JPA implementation, the Connections page also includes JDBC connection pool properties.</p>
-<p>If the project uses the Generic platform, then only the <a href="ref_persistence_general.htm#CIACIFGJ">General</a>, <a href="reference018.htm#CIAFFJIE">Connection</a>, <a href="reference024.htm#CIAHJDFF">Properties</a> and <a href="reference025.htm#CIAHCJAH">Source</a> pages are available.</p>
-</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<p>To use the <code>persistence.xml</code> Editor:</p>
-<ol>
-<li>
-<p>Open the <code>peristence.xml</code> file. The <a href="ref_persistence_general.htm#CIACIFGJ">General</a> page of the editor appears.</p>
-</li>
-<li>
-<p>Use the <span class="bold">General</span> page to define the <code>persistence.xml</code> files <code>&lt;persistent-unit&gt;</code>-related attributes as well as the <code>&lt;provider&gt;</code>, and <code>&lt;class&gt;</code> elements (described in the following table).</p>
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-The persistence.xml Editor's Source page enables you to view and edit the raw XML file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-<div class="inftblinformal">
-<table class="Informal" summary="This table lists the properties of the persistence.xml editor." dir="ltr" border="1" width="100%" frame="hsides" rules="groups" cellpadding="3" cellspacing="0">
-<col width="29%" />
-<col width="29%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t8">Property</th>
-<th align="left" valign="bottom" id="r1c2-t8">Description</th>
-<th align="left" valign="bottom" id="r1c3-t8">Element Defined</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t8" headers="r1c1-t8">Name</td>
-<td align="left" headers="r2c1-t8 r1c2-t8">Enter the name of the persistence unit.</td>
-<td align="left" headers="r2c1-t8 r1c3-t8"><code>&lt;persistence-unit name = "&lt;Name&gt;"&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t8" headers="r1c1-t8"><a id="sthref49" name="sthref49"></a>Persistence Provider</td>
-<td align="left" headers="r3c1-t8 r1c2-t8">Enter the name of the persistence provider.</td>
-<td align="left" headers="r3c1-t8 r1c3-t8"><code>&lt;provider&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t8" headers="r1c1-t8">Description</td>
-<td align="left" headers="r4c1-t8 r1c2-t8">Enter a description for this persistence unit. This is an optional property.</td>
-<td align="left" headers="r4c1-t8 r1c3-t8"><code>&lt;description&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t8" headers="r1c1-t8"><a id="sthref50" name="sthref50"></a>Managed Classes</td>
-<td align="left" headers="r5c1-t8 r1c2-t8">Add or remove the classes managed through the persistence unit.</td>
-<td align="left" headers="r5c1-t8 r1c3-t8"><code>&lt;class&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t8" headers="r1c1-t8">&nbsp;&nbsp;Exclude&nbsp;Unlisted&nbsp;Classes</td>
-<td align="left" headers="r6c1-t8 r1c2-t8">Select to include all annotated entity classes in the root of the persistence unit.</td>
-<td align="left" headers="r6c1-t8 r1c3-t8"><code>&lt;exclude-unlisted-classes&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t8" headers="r1c1-t8">XML&nbsp;Mapping&nbsp;Files</td>
-<td align="left" headers="r7c1-t8 r1c2-t8">Add or remove the object/relational mapping XML files define the classes managed through the persistence unit.</td>
-<td align="left" headers="r7c1-t8 r1c3-t8"><code>&lt;mapping-file&gt;</code></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r8c1-t8" headers="r1c1-t8">JAR&nbsp;Files</td>
-<td align="left" headers="r8c1-t8 r1c2-t8">Add or remove additional JAR files and libraries</td>
-<td align="left" headers="r8c1-t8 r1c3-t8"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblinformal" --></li>
-<li>
-<p>Use the <a href="reference018.htm#CIAFFJIE">Connection</a> page to define the <code>&lt;jta-data-source&gt;</code> and <code>&lt;non-jta-data-source&gt;</code> elements as follows:</p>
-<p>To configure the JTA (Java Transaction API) source used by the persistence provider:</p>
-<ol>
-<li>
-<p>Select <span class="bold">JTA</span> from the Transaction Type list.</p>
-</li>
-<li>
-<p>Enter the global JNDI name of the data source.</p>
-</li>
-</ol>
-<p>To configure a non-JTA data source:</p>
-<ol>
-<li>
-<p>Select <span class="bold">Resource Local</span> from the Transaction Type list.</p>
-</li>
-<li>
-<p>Enter the global JNDI name of the data source.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Select <span class="bold">Default()</span> to use the data source provided by the container.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-</ol>
-<p><a id="sthref51" name="sthref51"></a>For projects using the Generic platform, you can also define the EclipseLink connection pool driver, connection pool driver, URL, user name and password.</p>
-</li>
-<li>
-<p>Use the table in the Properties page to set the vendor-specific <code>&lt;properties&gt;</code> element.</p>
-<p>To add <code>&lt;property&gt;</code> elements:</p>
-<ol>
-<li>
-<p>Click <span class="bold">Add</span>.</p>
-</li>
-<li>
-<p>Enter the <code>&lt;name&gt;</code> and <code>&lt;value&gt;</code> attributes for the <code>&lt;property&gt;</code> element using the table's Name and Value fields.</p>
-</li>
-</ol>
-<p>To remove a <code>&lt;property&gt;</code> element, select a defined property in the table and then click <span class="bold">Remove</span>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-If the project uses the EclipseLink platform, the connection page also includes parameters for JDBC connection pooling.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-</li>
-</ol>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_xmll_editor.htm#CIACCHID">persistence.xml Editor</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="tasks002.htm#CIHFEBAI">Synchronizing classes</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm b/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm
deleted file mode 100644
index be8d8f1f48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/task_mapping.htm
+++ /dev/null
@@ -1,77 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Mapping an entity</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapping an entity" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDGBIJ" name="BABDGBIJ"></a></p>
-<div class="sect1">
-<h1>Mapping an entity</h1>
-<p>Dali supports the following mapping types for Java persistent entities:</p>
-<ul>
-<li>
-<p><a href="tasks010.htm#BABBABCE">Basic mapping</a></p>
-</li>
-<li>
-<p><a href="tasks011.htm#BABCBHDF">Embedded mapping</a></p>
-</li>
-<li>
-<p><a href="tasks012.htm#CIHDIAEE">Embedded ID mapping</a></p>
-</li>
-<li>
-<p><a href="tasks013.htm#BABGCBHG">ID mapping</a></p>
-</li>
-<li>
-<p><a href="tasks014.htm#BABEIEGD">Many-to-many mapping</a></p>
-</li>
-<li>
-<p><a href="tasks015.htm#BABHFAFJ">Many-to-one mapping</a></p>
-</li>
-<li>
-<p><a href="tasks016.htm#BABHGEBD">One-to-many mapping</a></p>
-</li>
-<li>
-<p><a href="tasks017.htm#BABFHBCJ">One-to-one mapping</a></p>
-</li>
-<li>
-<p><a href="tasks018.htm#BABHFHEI">Transient mapping</a></p>
-</li>
-<li>
-<p><a href="tasks019.htm#BABHIBII">Version mapping</a></p>
-</li>
-<li>
-<p><a href="tasks020.htm#CIHBDEAJ">Element Collection mapping</a></p>
-</li>
-</ul>
-<p>Additional mapping types (such as Basic Collection mappings) may be available when using Dali with EclipseLink.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a> <!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm
deleted file mode 100644
index 00e2189526..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks.htm
+++ /dev/null
@@ -1,81 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Tasks</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-06-04T19:32:58Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tasks" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref25" name="sthref25"></a></p>
-<h1>Tasks</h1>
-<p>This section includes detailed step-by-step procedures for accessing the Dali OR mapping tool functionality.</p>
-<ul>
-<li>
-<p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p>
-</li>
-<li>
-<p><a href="tasks001.htm#BEIBADHH">Converting a Java Project to a JPA Project</a></p>
-</li>
-<li>
-<p><a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a></p>
-</li>
-<li>
-<p><a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a></p>
-</li>
-<li>
-<p><a href="task_manage_orm.htm#CIHDGDCD">Managing the orm.xml file</a></p>
-</li>
-<li>
-<p><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></p>
-</li>
-<li>
-<p><a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a></p>
-</li>
-<li>
-<p><a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a></p>
-</li>
-<li>
-<p><a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a></p>
-</li>
-<li>
-<p><a href="tasks021.htm#BABBAGFI">Generating entities from tables</a></p>
-</li>
-<li>
-<p><a href="tasks023.htm#BABFAIBA">Validating mappings and reporting problems</a></p>
-</li>
-<li>
-<p><a href="tasks026.htm#BABDBCBI">Modifying persistent project properties</a></p>
-</li>
-<li>
-<p><a href="task_generating_schema_from_classes.htm#CIHHBJCJ">Generating Schema from Classes</a></p>
-</li>
-<li>
-<p><a href="task_generate_classes_from_schema.htm#CIHCBHJD">Generating JAXB Classes from a Schema</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
deleted file mode 100644
index 0960434330..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks001.htm
+++ /dev/null
@@ -1,85 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Converting a Java Project to a JPA Project</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:41Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Converting a Java Project to a JPA Project" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BEIBADHH" name="BEIBADHH"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Converting a Java Project to a JPA Project</h1>
-<p><a id="sthref35" name="sthref35"></a><a id="sthref36" name="sthref36"></a><a id="sthref37" name="sthref37"></a>Use this procedure to convert an existing Java project to a JPA project.</p>
-<ol>
-<li>
-<p>From the Navigator or Project explorer, right-click the Java project and then select <span class="bold">Configure &gt; Convert to JPA Project.</span> The Project Facets page of the Modify Faceted Project wizard appears.</p>
-<div class="figure"><a id="sthref38" name="sthref38"></a>
-<p class="titleinfigure">Modify Faceted Project Page</p>
-<img src="img/modify_faceted_project.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Change the <span class="bold">Configuration</span> to <span class="bold">Default JPA Configuration</span>.</p>
-</li>
-<li>
-<p>Click <span class="bold">Next</span>. <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> appears.</p>
-<div class="figure"><a id="sthref39" name="sthref39"></a>
-<p class="titleinfigure">JPA Facet Page</p>
-<img src="img/new_jpa_facet_task.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the fields on the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a> to specify your vender-specific platform, JPA implementation library, and database connection.</p>
-<p>Click <span class="bold">Manage libraries</span> to create or update your JPA user libraries. Click <span class="bold">Download libraries</span> to obtain additional JPA implementation libraries.</p>
-<p>If Dali derives the incorrect schema, select <span class="bold">Override the Default Schema for Connection</span>. Using this option, you can select a development time schema for defaults and validation.</p>
-<p>If you clear the <span class="bold">Create orm.xml</span> option (which is selected by default), you can later add a mapping file to the project using the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-</li>
-<li>
-<p>Click <span class="bold">Finish</span>.</p>
-</li>
-</ol>
-<p>The Dali OR Mapping Tool adds the JPA implementation libraries to your project and creates the necessary <code>orm.xml</code> and <code>perisistence.xml</code> files.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_new_jpa_project_wizard.htm#CACBJGBG">Create New JPA Project wizard</a><br />
-<a href="ref_persistence_perspective.htm#BABIFBDB">JPA Development perspective</a><br />
-<a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a><br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a><br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a>
-<p>&nbsp;</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm
deleted file mode 100644
index 96f9bb0090..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks002.htm
+++ /dev/null
@@ -1,74 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Synchronizing classes</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Synchronizing classes" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHFEBAI" name="CIHFEBAI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Synchronizing classes</h1>
-<p>As you work with the classes in your Java project, you will need to update the <code>persistence.xml</code> file to reflect the changes. <a id="sthref52" name="sthref52"></a><a id="sthref53" name="sthref53"></a><a id="sthref54" name="sthref54"></a></p>
-<p>Use this procedure to synchronize the <code>persistence.xml</code> file:</p>
-<ol>
-<li>
-<p>Right-click the <code>persistence.xml</code> file in the <span class="gui-object-title">Project Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Synchronize Class List</span>.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-Use this function if you selected <span class="bold">Annotated classes must be listed in the persistence.xml option</span> in the <a href="ref_jpa_facet.htm#CACIFDIF">JPA Facet page</a>. In general, you do not have to use this function within the container.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<div class="figure"><a id="sthref55" name="sthref55"></a>
-<p class="titleinfigure">Synchronizing the persistence.xml File</p>
-<img src="img/synchornize_classes.png" alt="This figure shows the JPA Tools &gt; Synchronize Classes option." title="This figure shows the JPA Tools &gt; Synchronize Classes option." /><br /></div>
-<!-- class="figure" -->
-<p>Dali adds the necessary <code>&lt;class&gt;</code> elements to the <code>persistence.xml</code> file.</p>
-</li>
-<li>
-<p>Use the <span class="gui-object-title">Persistence XML Editor</span> to continue editing the <code>persistence.xml</code> file.</p>
-</li>
-</ol>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_manage_persistence.htm#CIHDAJID">Managing the persistence.xml file</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts002.htm#CHDHAGIH">The persistence.xml file</a><br />
-<br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm
deleted file mode 100644
index 818f14603c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks003.htm
+++ /dev/null
@@ -1,43 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Upgrading document version</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Upgrading document version" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect2"><!-- infolevel="all" infotype="General" --><a id="sthref56" name="sthref56"></a>
-<h1>Upgrading document version</h1>
-<p>Use this procedure to migrate your project from JPA 1.0 to JPA 2.0. You must complete this upgrade to use the current JPA 2.0 features in Dali.</p>
-<div class="figure"><a id="sthref57" name="sthref57"></a>
-<p class="titleinfigure">Upgrading the persistence.xml File</p>
-<img src="img/upgrade_persistence_jpa_version.png" alt="This figure shows the JPA Tools &gt; Synchronize Classes option." title="This figure shows the JPA Tools &gt; Synchronize Classes option." /><br /></div>
-<!-- class="figure" --></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
deleted file mode 100644
index 90441ad325..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks004.htm
+++ /dev/null
@@ -1,58 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating an orm.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating an orm.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect2"><!-- infolevel="all" infotype="General" --><a id="sthref60" name="sthref60"></a>
-<h1>Creating an orm.xml file</h1>
-<p><a id="sthref61" name="sthref61"></a>If you opt not to create an <code>orm.xml</code> file when you create a JPA project, you can create one using the <a href="reference002.htm#CIAIJCCE">Mapping File Wizard</a>.</p>
-<p>Use this procedure to create an <code>orm.xml</code> file:</p>
-<ol>
-<li>
-<p>From the Navigator or Project Explorer, select <span class="bold">File &gt; New &gt; Other</span>. The Select a Wizard dialog appears.</p>
-<div class="figure"><a id="sthref62" name="sthref62"></a>
-<p class="titleinfigure">The Select a Wizard Dialog</p>
-<img src="img/select_a_wizard_mapping.png" alt="The Select a Wizard dialog with Mapping file selected." title="The Select a Wizard dialog with Mapping file selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Select <span class="bold">Mapping File</span> and then click <span class="bold">Next</span>. The Mapping File page appears.</p>
-<p>If you are using EclipseLink, you can select <span class="bold">EclipseLink &gt; EclipseLink Mapping File</span>.</p>
-<div class="figure"><a id="sthref63" name="sthref63"></a>
-<p class="titleinfigure">The Mapping File Page</p>
-<img src="img/mapping_file_new.png" alt="The Mapping File page." title="The Mapping File page." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Define the properties in the page and click <span class="bold">Finish</span>. The <code>orm.xml</code> file appears in the src directory of the selected JPA project. You can manage the orm.xml file using the JPA Details view or through the XML Editor. See also <a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a>.</p>
-</li>
-</ol>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm
deleted file mode 100644
index 1f960838f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks005.htm
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Working with orm.xml file</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:42Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Working with orm.xml file" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHBCDCE" name="CIHBCDCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Working with orm.xml file</h1>
-<p><a id="sthref64" name="sthref64"></a><a id="sthref65" name="sthref65"></a>You can work with the <code>orm.xml</code> by using the JPA Details view.</p>
-<p>Use this procedure to work with the <code>orm.xml</code> file:</p>
-<ol>
-<li>
-<p>Right-click the <code>orm.xml</code> file in the <span class="gui-object-title">Project Explorer</span> and select <span class="gui-object-action">Open</span>.</p>
-</li>
-<li>
-<p>In the JPA Structure view, select <span class="bold">EntityMappings</span>.</p>
-</li>
-<li>
-<p>Use the JPA Details view to configure the entity mapping and persistence unit defaults.</p>
-<div class="figure"><a id="sthref66" name="sthref66"></a>
-<p class="titleinfigure">JPA Details view for EntityMappings (orm.xml)</p>
-<img src="img/details_entitymappings.png" alt="JPA Details view for orm.xml file." title="JPA Details view for orm.xml file." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<img src="img/ngrelr.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="ref_details_orm.htm#CACGDGHC">JPA Details view (for orm.xml)</a><br />
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="#CIHBCDCE">Working with orm.xml file</a><br />
-<a href="../org.eclipse.wst.xmleditor.doc.user/topics/cworkXML.html">Working with XML Files</a><br />
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concepts003.htm#CHDBIJAC">The orm.xml file</a><br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm
deleted file mode 100644
index eca0d7006b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks006.htm
+++ /dev/null
@@ -1,96 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Entity</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Entity" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABGBIEE" name="BABGBIEE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Entity</h1>
-<p><a id="sthref70" name="sthref70"></a><a id="sthref71" name="sthref71"></a><a id="sthref72" name="sthref72"></a><a id="sthref73" name="sthref73"></a>An <span class="bold">Entity</span> is a persistent domain object.</p>
-<p>An entity <span class="italic">can be</span>:</p>
-<ul>
-<li>
-<p>Abstract or concrete classes. Entities may also extend non-entity classes as well as entity classes, and non-entity classes may extend entity classes.</p>
-</li>
-</ul>
-<p>An entity <span class="italic">must have</span>:</p>
-<ul>
-<li>
-<p>A no-arg constructor (public or protected); the entity class may have other constructors as well.</p>
-</li>
-</ul>
-<p><a id="sthref74" name="sthref74"></a><a id="sthref75" name="sthref75"></a><a id="sthref76" name="sthref76"></a>Each persistent entity must be mapped to a database table and contain a primary key. Persistent entities are identified by the <code>@Entity</code> annotation.</p>
-<p>Use this procedure to add persistence to an existing entity:</p>
-<ol>
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Project Explorer.</span></p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the JPA Details view, click the mapping type hyperlink to access the Mapping Type Selection dialog. In the following figure, clicking <span class="italic">entity</span> invokes the dialog from the JPA Details View.</p>
-<div class="figure"><a id="sthref77" name="sthref77"></a>
-<p class="titleinfigure">The Mapping Type Hyperlink</p>
-<img src="img/mapped_entity_type_link.png" alt="The JPA Details view for an entity showing the mapping type hyperlink." title="The JPA Details view for an entity showing the mapping type hyperlink." /><br /></div>
-<!-- class="figure" -->
-<div align="center">
-<div class="inftblnotealso"><br />
-<table class="NoteAlso oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Tip:</p>
-You can also change (or add) persistence for an entity by right-clicking the class in the JPA Structure View and then clicking <span class="bold">Map As &gt; Entity</span>.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnotealso" --></div>
-</li>
-<li>
-<p>Select <span class="bold">Entity</span> from the Mapping Type Selection dialog and then click <span class="bold">OK</span>.</p>
-<div class="figure"><a id="sthref78" name="sthref78"></a>
-<p class="titleinfigure">The Mapping Type Selection Dialog</p>
-<img src="img/mapping_type_selection_entity.png" alt="The Mapping Type selection dialog with Enity selected." title="The Mapping Type selection dialog with Enity selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br /></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
deleted file mode 100644
index 004a1691dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks007.htm
+++ /dev/null
@@ -1,70 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Embeddable</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embeddable" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFEICE" name="BABFEICE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embeddable</h1>
-<p><a id="sthref79" name="sthref79"></a><a id="sthref80" name="sthref80"></a>An <span class="bold">Embedded</span> class is a class whose instances are stored as part of an owning entity; it shares the identity of the owning entity. Each field of the embedded class is mapped to the database table associated with the owning entity.</p>
-<p>To override the mapping information for a specific subclass, use the <code>@AttributeOverride</code> annotation for that specific class.</p>
-<p><a id="sthref81" name="sthref81"></a><a id="sthref82" name="sthref82"></a><a id="sthref83" name="sthref83"></a>An embeddable entity is identified by the <code>@Embeddable</code> annotation.</p>
-<p>Use this procedure to add embeddable persistence to an existing entity:</p>
-<ol>
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Project Explorer</span>.</p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>Click the mapping type hyperlink to open the Mapping Type Selection dialog.</p>
-</li>
-<li>
-<p>Select <span class="bold">Embeddable</span> and then click <span class="bold">OK</span>.</p>
-<div class="figure"><a id="sthref84" name="sthref84"></a>
-<p class="titleinfigure">Mapping Type Selection Dialog (Embeddable)</p>
-<img src="img/mapping_type_selection_embed.png" alt="The Mapping Type Selection dialog with Embeddable selected." title="The Mapping Type Selection dialog with Embeddable selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<dl>
-<dd><a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a></dd>
-<dd><a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a></dd>
-<dd><a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a></dd>
-</dl>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
deleted file mode 100644
index 1b5054e055..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks008.htm
+++ /dev/null
@@ -1,84 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Mapped superclass</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Mapped superclass" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDAGCI" name="BABDAGCI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Mapped superclass</h1>
-<p><a id="sthref85" name="sthref85"></a><a id="sthref86" name="sthref86"></a>An entity that extends a <span class="bold">Mapped Superclass</span> class inherits the persistent state and mapping information from a superclass. You should use a mapped superclass to define mapping information that is common to multiple entity classes.</p>
-<p>A mapped superclass <span class="italic">can be</span>:</p>
-<ul>
-<li>
-<p>Abstract or concrete classes</p>
-</li>
-</ul>
-<p>A mapped superclass <span class="italic">cannot be</span>:</p>
-<ul>
-<li>
-<p>Be queried or passed as an argument to Entity-Manager or Query operations</p>
-</li>
-<li>
-<p>Be the target of a persistent relationship</p>
-</li>
-</ul>
-<p>A mapped superclass does not have a defined database table. Instead, its mapping information is derived from its superclass. To override the mapping information for a specific subclass, use the <code>@AttributeOverride</code> annotation for that specific class.</p>
-<p><a id="sthref87" name="sthref87"></a><a id="sthref88" name="sthref88"></a><a id="sthref89" name="sthref89"></a><a id="sthref90" name="sthref90"></a>A mapped superclass is identified by the <code>@MappedSuperclass</code> annotation.</p>
-<p>Use this procedure to add Mapped Superclass persistence to an existing entity:</p>
-<ol>
-<li>
-<p>Open the Java class in the <span class="gui-object-title">Project Explorer</span>.</p>
-</li>
-<li>
-<p>Select the class in the JPA Structure view.</p>
-</li>
-<li>
-<p>In the JPA Details view, click the mapping type hyperlink to open the Mapping Type Selection dialog.</p>
-</li>
-<li>
-<p>Select <span class="bold">Mapped Superclass</span> and then <span class="bold">OK</span>.</p>
-<div class="figure"><a id="sthref91" name="sthref91"></a>
-<p class="titleinfigure">Mapping Type Selection Dialog (Mapped Superclass)</p>
-<img src="img/mapping_type_selection_superclass.png" alt="The Mapping Type Selection dialog with Mapped Superclass selected." title="The Mapping Type Selection dialog with Mapped Superclass selected." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete the remaining <a href="ref_persistence_prop_view.htm#BABFAEBB">JPA Details view (for entities)</a>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related tasks" title="Related tasks" /><br />
-<br />
-<a href="task_add_persistence.htm#BABHICAI">Adding persistence to a class</a><br />
-<a href="task_additonal_tables.htm#CIHGBIEI">Specifying additional tables</a><br />
-<a href="task_inheritance.htm#CIHCCCJD">Specifying entity inheritance</a><br /></div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm
deleted file mode 100644
index 82e8697c54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks009.htm
+++ /dev/null
@@ -1,65 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Creating Named Queries</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Creating Named Queries" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABIGBGG" name="BABIGBGG"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Creating Named Queries</h1>
-<p><a id="sthref107" name="sthref107"></a><a id="sthref108" name="sthref108"></a>Named queries improve application performance because they are prepared once and they (and all of their associated supporting objects) can be efficiently reused thereafter, making them well suited for complex and frequently executed operations. Named queries use the JPA query language for portable execution on any underlying database; named native queries use the SQL language native to the underlying database.</p>
-<p>Use this procedure to add <code>@NamedQuery</code> and <code>@NamedNativeQuery</code> annotations to the entity.</p>
-<p>To create a named query:</p>
-<ol>
-<li>
-<p>Select the entity in the Project Explorer.</p>
-</li>
-<li>
-<p>In the JPA Details view, expand Queries.</p>
-</li>
-<li>
-<p>Click <span class="bold">Add</span> for a named query, or <span class="bold">Add Native</span> for a native query.</p>
-</li>
-<li>
-<p>In the dialog that appears, enter the name of the query in the Name field and then click OK.</p>
-</li>
-<li>
-<p>Enter the query in the Query field.</p>
-</li>
-<li>
-<p><a id="sthref109" name="sthref109"></a><a id="sthref110" name="sthref110"></a><a id="sthref111" name="sthref111"></a><a id="sthref112" name="sthref112"></a>To add a Query hint, click <span class="bold">Add</span>.</p>
-<div class="figure"><a id="sthref113" name="sthref113"></a>
-<p class="titleinfigure">Entering a Named Query</p>
-<img src="img/task_entering_query.png" alt="The Queries section of the JPA Details view." title="The Queries section of the JPA Details view." /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm
deleted file mode 100644
index f4022d9d10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks010.htm
+++ /dev/null
@@ -1,183 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Basic mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:43Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Basic mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBABCE" name="BABBABCE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Basic mapping</h1>
-<p><a id="sthref114" name="sthref114"></a><a id="sthref115" name="sthref115"></a><a id="sthref116" name="sthref116"></a><a id="sthref117" name="sthref117"></a>Use a <span class="bold">Basic Mapping</span> to map an attribute directly to a database column. Basic mappings may be used only with the following attribute types:</p>
-<ul>
-<li>
-<p>Java primitive types and wrappers of the primitive types</p>
-</li>
-<li>
-<p><code>java.lang.String, java.math.BigInteger</code></p>
-</li>
-<li>
-<p><code>java.math.BigDecimal</code></p>
-</li>
-<li>
-<p><code>java.util.Date</code></p>
-</li>
-<li>
-<p><code>java.util.Calendar, java.sql.Date</code></p>
-</li>
-<li>
-<p><code>java.sql.Time</code></p>
-</li>
-<li>
-<p><code>java.sql.Timestamp</code></p>
-</li>
-<li>
-<p><code>byte[]</code></p>
-</li>
-<li>
-<p><code>Byte[]</code></p>
-</li>
-<li>
-<p><code>char[]</code></p>
-</li>
-<li>
-<p><code>Character[]</code></p>
-</li>
-<li>
-<p>enums</p>
-</li>
-<li>
-<p>any other type that implements <code>Serializable</code></p>
-</li>
-</ul>
-<p>To create a basic mapping:</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, right-click the field to map. Select <span class="bold">Map As &gt; Basic</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t14">Property</th>
-<th align="left" valign="bottom" id="r1c2-t14">Description</th>
-<th align="left" valign="bottom" id="r1c3-t14">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t14" headers="r1c1-t14">Entity Map Hyperlink</td>
-<td align="left" headers="r2c1-t14 r1c2-t14">Defines this mapping as a <span class="bold">Basic Mapping</span>.
-<p>This corresponds to the <code>@Basic</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t14 r1c3-t14">Basic</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t14" headers="r1c1-t14">Column</td>
-<td align="left" headers="r3c1-t14 r1c2-t14">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t14 r1c3-t14">By default, the Column is assumed to be named identically to the attribute and always included in the <code>INSERT</code> and <code>UPDATE</code> statements.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t14" headers="r1c1-t14">Table</td>
-<td align="left" headers="r4c1-t14 r1c2-t14">Name of the database table.</td>
-<td align="left" headers="r4c1-t14 r1c3-t14"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t14" headers="r1c1-t14">Fetch</td>
-<td align="left" headers="r5c1-t14 r1c2-t14">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t14 r1c3-t14">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t14" headers="r1c1-t14">Optional</td>
-<td align="left" headers="r6c1-t14 r1c2-t14">Specifies if this field is can be null.</td>
-<td align="left" headers="r6c1-t14 r1c3-t14">Yes</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t14" headers="r1c1-t14">Type</td>
-<td align="left" headers="r7c1-t14 r1c2-t14">Specifies the type of data:
-<ul>
-<li>
-<p>Default</p>
-</li>
-<li>
-<p>LOB &ndash; Specifies if this is a large objects (BLOB or CLOB). See <a href="ref_mapping_general.htm#CACBBIBI">"Lob"</a> for details.</p>
-</li>
-<li>
-<p>Temporal &ndash; Specify if this is a Date, Time, or Timestamp object. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.</p>
-</li>
-<li>
-<p>Enumerated &ndash; Specify how to persist enumerated constraints as ordinal or string, in order to match an existing database schema.</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r7c1-t14 r1c3-t14"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Column(name="<span class="italic">&lt;COLUMN_NAME&gt;</span>", table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>",
- insertable=<span class="italic">&lt;INSERTABLE&gt;</span>, updatable=<span class="italic">&lt;UPDATABLE&gt;</span>)
-@Basic(fetch=FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, optional = <span class="italic">&lt;OPTIONAL&gt;</span>)
-@Temporal(TemporalType.<span class="italic">&lt;TEMPORAL&gt;</span>)
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
deleted file mode 100644
index 5634d786c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks011.htm
+++ /dev/null
@@ -1,97 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Embedded mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABCBHDF" name="BABCBHDF"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embedded mapping</h1>
-<p><a id="sthref118" name="sthref118"></a><a id="sthref119" name="sthref119"></a><a id="sthref120" name="sthref120"></a><a id="sthref121" name="sthref121"></a>Use an <span class="bold">Embedded Mapping</span> to specify a persistent field or property of an entity whose value is an instance of an embeddable class.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, right-click the field to map.</p>
-</li>
-<li>
-<p>Select <span class="bold">Map as &gt; Embedded</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t15">Property</th>
-<th align="left" valign="bottom" id="r1c2-t15">Description</th>
-<th align="left" valign="bottom" id="r1c3-t15">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t15" headers="r1c1-t15">Entity Mapping Hyperlink</td>
-<td align="left" headers="r2c1-t15 r1c2-t15">Defines this mapping as a <span class="bold">Embedded</span>.
-<p>This corresponds to the <code>@Embedded</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t15 r1c3-t15">Embedded</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t15" headers="r1c1-t15">Attribute Overrides</td>
-<td align="left" headers="r3c1-t15 r1c2-t15">Specify to override the default mapping of an entity's attribute. Select <span class="bold">Override Default</span>.</td>
-<td align="left" headers="r3c1-t15 r1c3-t15"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Embedded
-@AttributeOverride(column=@Column(table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>", name = "<span class="italic">&lt;COLUMN_NAME&gt;</span>"))
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
deleted file mode 100644
index 425fb6498c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks012.htm
+++ /dev/null
@@ -1,91 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Embedded ID mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Embedded ID mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHDIAEE" name="CIHDIAEE"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Embedded ID mapping</h1>
-<p><a id="sthref122" name="sthref122"></a><a id="sthref123" name="sthref123"></a><a id="sthref124" name="sthref124"></a><a id="sthref125" name="sthref125"></a>Use an <span class="bold">Embedded ID Mapping</span> to specify the primary key of an embedded ID. These mappings may be used with a <a href="tasks007.htm#BABFEICE">Embeddable</a> entities.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; Embedded Id</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields on the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t16">Property</th>
-<th align="left" valign="bottom" id="r1c2-t16">Description</th>
-<th align="left" valign="bottom" id="r1c3-t16">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t16" headers="r1c1-t16">Entity Mapping Hyperlink</td>
-<td align="left" headers="r2c1-t16 r1c2-t16">Defines this mapping as a <span class="bold">Embedded Id</span>.
-<p>This corresponds to the <code>@EmbeddedId</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t16 r1c3-t16">Embedded Id</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@EmbeddedId
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
deleted file mode 100644
index 8aadf81887..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks013.htm
+++ /dev/null
@@ -1,176 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>ID mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="ID mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABGCBHG" name="BABGCBHG"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>ID mapping</h1>
-<p><a id="sthref126" name="sthref126"></a><a id="sthref127" name="sthref127"></a><a id="sthref128" name="sthref128"></a><a id="sthref129" name="sthref129"></a>Use an <span class="bold">ID Mapping</span> to specify the primary key of an entity. ID mappings may be used with a <a href="tasks006.htm#BABGBIEE">Entity</a> or <a href="tasks008.htm#BABDAGCI">Mapped superclass</a>. Each <a href="tasks006.htm#BABGBIEE">Entity</a> must have an ID mapping.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right click the filed and then select <span class="bold">Map as &gt; ID</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="22%" />
-<col width="*" />
-<col width="35%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t17">Property</th>
-<th align="left" valign="bottom" id="r1c2-t17">Description</th>
-<th align="left" valign="bottom" id="r1c3-t17">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t17" headers="r1c1-t17">Entity Mapping Hyperlink</td>
-<td align="left" headers="r2c1-t17 r1c2-t17">Defines this mapping as an <span class="bold">ID Mapping</span>.
-<p>This field corresponds to the <code>@Id</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t17 r1c3-t17">ID</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t17" headers="r1c1-t17">Column</td>
-<td align="left" headers="r3c1-t17 r1c2-t17">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t17 r1c3-t17">By default, the Column is assumed to be named identically to the attribute.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t17" headers="r1c1-t17">Table</td>
-<td align="left" headers="r4c1-t17 r1c2-t17">The database table mapped to the entity attribute.</td>
-<td align="left" headers="r4c1-t17 r1c3-t17">By default, the Table is assumed to be identical to the table associated with the entity.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t17" headers="r1c1-t17">Temporal</td>
-<td align="left" headers="r5c1-t17 r1c2-t17">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t17 r1c3-t17"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields in <a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a> area in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the PK Generation tab." summary="This table lists the fields in the PK Generation tab." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="22%" />
-<col width="*" />
-<col width="35%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t18">Property</th>
-<th align="left" valign="bottom" id="r1c2-t18">Description</th>
-<th align="left" valign="bottom" id="r1c3-t18">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t18" headers="r1c1-t18">Primary Key Generation</td>
-<td align="left" headers="r2c1-t18 r1c2-t18">These fields define how the primary key is generated.</td>
-<td align="left" headers="r2c1-t18 r1c3-t18"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t18" headers="r1c1-t18">&nbsp;&nbsp;Strategy</td>
-<td align="left" headers="r3c1-t18 r1c2-t18">See <a href="ref_primary_key.htm#CACBAJBC">"Primary Key Generation"</a> for details.
-<ul>
-<li>
-<p>Auto</p>
-</li>
-<li>
-<p>Sequence</p>
-</li>
-<li>
-<p>Identity</p>
-</li>
-<li>
-<p>Table</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r3c1-t18 r1c3-t18">Auto</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t18" headers="r1c1-t18">&nbsp;&nbsp;Generator&nbsp;Name</td>
-<td align="left" headers="r4c1-t18 r1c2-t18">Name of the primary key generator specified in the <span class="bold">Strategy</span></td>
-<td align="left" headers="r4c1-t18 r1c3-t18"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Additional fields will appear in the <a href="ref_primary_key.htm#CACFCCAB">Primary Key Generation information</a> area, depending on the selected Strategy. See <a href="ref_persistence_map_view.htm#BABIFBAF">"JPA Details view (for attributes)"</a> for additional information.</p>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Id
-@Column(name="<span class="italic">&lt;COLUMN_NAME&gt;</span>", table="<span class="italic">&lt;TABLE_NAME&gt;</span>", insertable=<span class="italic">&lt;INSERTABLE&gt;</span>,
- updatable=<span class="italic">&lt;UPDATABLE&gt;</span>)
-@Temporal(<span class="italic">&lt;TEMPORAL&gt;</span>)
-@GeneratedValue(strategy=GeneratorType.<span class="italic">&lt;STRATEGY&gt;</span>, generator="<span class="italic">&lt;GENERATOR_NAME&gt;</span>")@TableGenerator(name="<span class="italic">&lt;TABLE_GENERATOR_NAME&gt;</span>", table = "<span class="italic">&lt;TABLE_GENERATOR_TABLE&gt;</span>",
- pkColumnName = "<span class="italic">&lt;TABLE_GENERATOR_PK&gt;</span>",
- valueColumnName = "<span class="italic">&lt;TABLE_GENERATOR_VALUE_COLUMN&gt;</span>",
- pkColumnValue = "<span class="italic">&lt;TABLE_GENERATOR_PK_COLUMN_VALUE&gt;</span>")@SequenceGenerator(name="<span class="italic">&lt;SEQUENCE_GENERATOR_NAME&gt;</span>",
- sequenceName="<span class="italic">&lt;SEQUENCE_GENERATOR_SEQUENCE&gt;</span>")
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm
deleted file mode 100644
index d158190edb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks014.htm
+++ /dev/null
@@ -1,179 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Many-to-many mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-many mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABEIEGD" name="BABEIEGD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Many-to-many mapping</h1>
-<p><a id="sthref130" name="sthref130"></a><a id="sthref131" name="sthref131"></a><a id="sthref132" name="sthref132"></a><a id="sthref133" name="sthref133"></a>Use a <span class="bold">Many-to-Many Mapping</span> to define a many-valued association with many-to-many multiplicity. A many-to-many mapping has two sides: the <span class="italic">owning side</span> and <span class="italic">non-owning side</span>. You must specify the join table on the owning side. For bidirectional mappings, either side may be the owning side.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; Many-to-Many</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected field.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields of the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t19">Property</th>
-<th align="left" valign="bottom" id="r1c2-t19">Description</th>
-<th align="left" valign="bottom" id="r1c3-t19">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t19" headers="r1c1-t19">Mapping Entity Hyperlink</td>
-<td align="left" headers="r2c1-t19 r1c2-t19">Defines this mapping as a <span class="bold">Many to Many Mapping</span>.
-<p>This field corresponds to the <code>@ManyToMany</code> annotation.</p>
-</td>
-<td align="left" headers="r2c1-t19 r1c3-t19">Many to Many</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t19" headers="r1c1-t19">Target Entity</td>
-<td align="left" headers="r3c1-t19 r1c2-t19">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t19 r1c3-t19">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t19" headers="r1c1-t19">Fetch</td>
-<td align="left" headers="r4c1-t19 r1c2-t19">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t19 r1c3-t19">Lazy</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t19" headers="r1c1-t19">Mapped By</td>
-<td align="left" headers="r5c1-t19 r1c2-t19">The database field that owns the relationship.</td>
-<td align="left" headers="r5c1-t19 r1c3-t19"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t19" headers="r1c1-t19">Order By</td>
-<td align="left" headers="r6c1-t19 r1c2-t19">Specify the default order for objects returned from a query. See <a href="ref_mapping_general.htm#CACDADIH">"Order By"</a> for details.
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r6c1-t19 r1c3-t19">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields in the <a href="reference011.htm#CACBAEBC">Join Table Information</a> area in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t20">Property</th>
-<th align="left" valign="bottom" id="r1c2-t20">Description</th>
-<th align="left" valign="bottom" id="r1c3-t20">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t20" headers="r1c1-t20">Name</td>
-<td align="left" headers="r2c1-t20 r1c2-t20">Name of the join table that contains the foreign key column.</td>
-<td align="left" headers="r2c1-t20 r1c3-t20">You must specify the join table on the owning side.
-<p>By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t20" headers="r1c1-t20">Join Columns</td>
-<td align="left" headers="r3c1-t20 r1c2-t20">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r3c1-t20 r1c3-t20">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t20" headers="r1c1-t20">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t20 r1c2-t20">Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</td>
-<td align="left" headers="r4c1-t20 r1c3-t20">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>To add a new Join or Inverse Join Column, click <span class="gui-object-action">Add</span>.</p>
-<p>To edit an existing Join or Inverse Join Column, select the field to and click <span class="gui-object-action">Edit</span>.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@JoinTable(joinColumns=@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN&gt;</span>"),
- name = "<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>")
-@ManyToMany(cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>, fetch=FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>,
- targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")
-@OrderBy("<span class="italic">&lt;ORDER_BY&gt;</span>")
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm
deleted file mode 100644
index 05eba6a8dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks015.htm
+++ /dev/null
@@ -1,167 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Many-to-one mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Many-to-one mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHFAFJ" name="BABHFAFJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Many-to-one mapping</h1>
-<p><a id="sthref134" name="sthref134"></a><a id="sthref135" name="sthref135"></a><a id="sthref136" name="sthref136"></a><a id="sthref137" name="sthref137"></a>Use a <span class="bold">Many-to-One</span> mapping to defines a single-valued association to another entity class that has many-to-one multiplicity.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right click the field and then select <span class="bold">Map As &gt; Many-to-One</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields ion the General tab for this mapping." summary="This table lists the fields ion the General tab for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t21">Property</th>
-<th align="left" valign="bottom" id="r1c2-t21">Description</th>
-<th align="left" valign="bottom" id="r1c3-t21">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t21" headers="r1c1-t21">Mapping Entity Hyperlink</td>
-<td align="left" headers="r2c1-t21 r1c2-t21">Defines mapping as <span class="bold">Many-to-One</span>. This corresponds to the <code>@ManyToOne</code> annotation.</td>
-<td align="left" headers="r2c1-t21 r1c3-t21">Many-to-One</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t21" headers="r1c1-t21">Target Entity</td>
-<td align="left" headers="r3c1-t21 r1c2-t21">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t21 r1c3-t21">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t21" headers="r1c1-t21">Fetch</td>
-<td align="left" headers="r4c1-t21 r1c2-t21">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t21 r1c3-t21">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t21" headers="r1c1-t21">Cascade</td>
-<td align="left" headers="r5c1-t21 r1c2-t21">See <a href="ref_mapping_general.htm#CACJAIHB">"Cascade Type"</a> for details.
-<ul>
-<li>
-<p>Default</p>
-</li>
-<li>
-<p>All</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t21 r1c3-t21">Default</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t21" headers="r1c1-t21">Optional</td>
-<td align="left" headers="r6c1-t21 r1c2-t21">Specifies if this field is can be null.</td>
-<td align="left" headers="r6c1-t21 r1c3-t21">Yes</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the fields on the <a href="reference012.htm#CACFCEJC">Join Columns Information</a> tab in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t22">Property</th>
-<th align="left" valign="bottom" id="r1c2-t22">Description</th>
-<th align="left" valign="bottom" id="r1c3-t22">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t22" headers="r1c1-t22">Join Column</td>
-<td align="left" headers="r2c1-t22 r1c2-t22"><a id="sthref138" name="sthref138"></a><a id="sthref139" name="sthref139"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t22 r1c3-t22">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@JoinTable(joinColumns=@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN&gt;</span>"),
- name = "<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>")
-@ManyToOne(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, fetch=<span class="italic">&lt;FETCH_TYPE&gt;</span>,
- cascade=<span class="italic">&lt;CASCADE_TYPE&gt;</span>)
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
deleted file mode 100644
index 417c743805..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks016.htm
+++ /dev/null
@@ -1,197 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>One-to-many mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-many mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHGEBD" name="BABHGEBD"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>One-to-many mapping</h1>
-<p><a id="sthref140" name="sthref140"></a><a id="sthref141" name="sthref141"></a><a id="sthref142" name="sthref142"></a><a id="sthref143" name="sthref143"></a>Use a <span class="bold">One-to-Many Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; One-to-many</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the General tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the General tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t23">Property</th>
-<th align="left" valign="bottom" id="r1c2-t23">Description</th>
-<th align="left" valign="bottom" id="r1c3-t23">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t23" headers="r1c1-t23">Mapping Entity Type Hyperlink</td>
-<td align="left" headers="r2c1-t23 r1c2-t23">Defines mapping as <span class="bold">One-to-Many</span>. This corresponds to the <code>@OneToMany</code> annotation.</td>
-<td align="left" headers="r2c1-t23 r1c3-t23">One-to-Many</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t23" headers="r1c1-t23">Target Entity</td>
-<td align="left" headers="r3c1-t23 r1c2-t23">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t23" headers="r1c1-t23">Cascade</td>
-<td align="left" headers="r4c1-t23 r1c2-t23">See <a href="ref_mapping_general.htm#CACJAIHB">"Cascade Type"</a> for details.
-<ul>
-<li>
-<p>Default</p>
-</li>
-<li>
-<p>All</p>
-</li>
-<li>
-<p>Persist</p>
-</li>
-<li>
-<p>Merge</p>
-</li>
-<li>
-<p>Remove</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t23" headers="r1c1-t23">Fetch</td>
-<td align="left" headers="r5c1-t23 r1c2-t23">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t23 r1c3-t23">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r6c1-t23" headers="r1c1-t23">Mapped By</td>
-<td align="left" headers="r6c1-t23 r1c2-t23">The database field that owns the relationship.</td>
-<td align="left" headers="r6c1-t23 r1c3-t23"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r7c1-t23" headers="r1c1-t23">Order By</td>
-<td align="left" headers="r7c1-t23 r1c2-t23">Specify the default order for objects returned from a query. See <a href="ref_mapping_general.htm#CACDADIH">"Order By"</a> for details.
-<ul>
-<li>
-<p>No ordering</p>
-</li>
-<li>
-<p>Primary key</p>
-</li>
-<li>
-<p>Custom</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r7c1-t23 r1c3-t23">No ordering</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference011.htm#CACBAEBC">Join Table Information</a> fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." summary="This table lists the fields in the Join Table tab of the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t24">Property</th>
-<th align="left" valign="bottom" id="r1c2-t24">Description</th>
-<th align="left" valign="bottom" id="r1c3-t24">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t24" headers="r1c1-t24">Name</td>
-<td align="left" headers="r2c1-t24 r1c2-t24">Name of the join table</td>
-<td align="left" headers="r2c1-t24 r1c3-t24">By default, the name is assumed to be the primary tables associated with the entities concatenated with an underscore.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t24" headers="r1c1-t24">Join Columns</td>
-<td align="left" headers="r3c1-t24 r1c2-t24">Specify two or more join columns (that is, a primary key).</td>
-<td align="left" headers="r3c1-t24 r1c3-t24"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t24" headers="r1c1-t24">Inverse Join Columns</td>
-<td align="left" headers="r4c1-t24 r1c2-t24">The join column on the owned (or inverse) side of the association: the owned entity's primary key column.</td>
-<td align="left" headers="r4c1-t24 r1c3-t24"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@OneToMany(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>)
-@Column(name="<span class="italic">&lt;COLUMN&gt;</span>")
-
-
-@OneToMany(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>.class, cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>,
- fetch = FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")@OrderBy("<span class="italic">&lt;ORDER_BY&gt;</span>")
-@JoinTable(name="<span class="italic">&lt;JOIN_TABLE_NAME&gt;</span>", joinColumns=@JoinColumn(name=
- "<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>", referencedColumnName="<span class="italic">&lt;JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>"),
- inverseJoinColumns=@JoinColumn(name="<span class="italic">&lt;INVERSE_JOIN_COLUMN_NAME&gt;</span>",
- referencedColumnName="<span class="italic">&lt;INVERSE_JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>"))
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
deleted file mode 100644
index 9c58f8a42b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks017.htm
+++ /dev/null
@@ -1,146 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>One-to-one mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:44Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="One-to-one mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFHBCJ" name="BABFHBCJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>One-to-one mapping</h1>
-<p><a id="sthref144" name="sthref144"></a><a id="sthref145" name="sthref145"></a><a id="sthref146" name="sthref146"></a><a id="sthref147" name="sthref147"></a>Use a <span class="bold">One-to-One Mapping</span> to define a relationship with one-to-many multiplicity.</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; One-to-One</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the <a href="ref_mapping_general.htm#CACBHFIJ">General information</a> fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t25">Property</th>
-<th align="left" valign="bottom" id="r1c2-t25">Description</th>
-<th align="left" valign="bottom" id="r1c3-t25">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t25" headers="r1c1-t25">Mapped Entity Hyperlink</td>
-<td align="left" headers="r2c1-t25 r1c2-t25">Defines mapping as <span class="bold">One-to-One</span>. This corresponds to the <code>@OneToOne</code> annotation.</td>
-<td align="left" headers="r2c1-t25 r1c3-t25">One-to-One</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t25" headers="r1c1-t25">Target Entity</td>
-<td align="left" headers="r3c1-t25 r1c2-t25">The entity to which this attribute is mapped.</td>
-<td align="left" headers="r3c1-t25 r1c3-t25">null
-<p>You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.</p>
-</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t25" headers="r1c1-t25">Fetch Type</td>
-<td align="left" headers="r4c1-t25 r1c2-t25">Defines how data is loaded from the database. See <a href="ref_mapping_general.htm#CACGGGHB">"Fetch Type"</a> for details.
-<ul>
-<li>
-<p>Eager</p>
-</li>
-<li>
-<p>Lazy</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r4c1-t25 r1c3-t25">Eager</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t25" headers="r1c1-t25">Mapped By</td>
-<td align="left" headers="r5c1-t25 r1c2-t25">The database field that owns the relationship.</td>
-<td align="left" headers="r5c1-t25 r1c3-t25"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-<li>
-<p>Use this table to complete the <a href="reference012.htm#CACFCEJC">Join Columns Information</a> fields in the <span class="gui-object-title">JPA Details</span> view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="41%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t26">Property</th>
-<th align="left" valign="bottom" id="r1c2-t26">Description</th>
-<th align="left" valign="bottom" id="r1c3-t26">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t26" headers="r1c1-t26">Join Column</td>
-<td align="left" headers="r2c1-t26 r1c2-t26"><a id="sthref148" name="sthref148"></a><a id="sthref149" name="sthref149"></a>Specify a mapped column for joining an entity association. This field corresponds to the <code>@JoinColum</code> attribute.
-<p>Select <span class="bold">Override Default</span>, then Add, Edit, or Remove the join columns.</p>
-</td>
-<td align="left" headers="r2c1-t26 r1c3-t26">By default, the mapping is assumed to have a single join.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@OneToOne(targetEntity=<span class="italic">&lt;TARGET_ENTITY&gt;</span>, cascade=CascadeType.<span class="italic">&lt;CASCADE_TYPE&gt;</span>,
- fetch = FetchType.<span class="italic">&lt;FETCH_TYPE&gt;</span>, mappedBy = "<span class="italic">&lt;MAPPED_BY&gt;</span>")
-@JoinColumn(name="<span class="italic">&lt;JOIN_COLUMN_NAME&gt;</span>", referencedColumnName=
- "<span class="italic">&lt;JOIN_COLUMN_REFERENCED_COLUMN&gt;</span>", insertable = <span class="italic">&lt;INSERTABLE&gt;</span>,
- updatable = <span class="italic">&lt;UPDATABLE&gt;</span>)
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm
deleted file mode 100644
index b04bdb3c0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks018.htm
+++ /dev/null
@@ -1,66 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Transient mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Transient mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHFHEI" name="BABHFHEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Transient mapping</h1>
-<p><a id="sthref150" name="sthref150"></a><a id="sthref151" name="sthref151"></a><a id="sthref152" name="sthref152"></a><a id="sthref153" name="sthref153"></a>Use the Transient Mapping to specify a field of the entity class that <span class="italic">is not</span> persistent.</p>
-<p>To create a transient mapping:</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As Transient</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-</ol>
-<p>Eclipse adds the following annotation to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Transient
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
deleted file mode 100644
index f9f3209292..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks019.htm
+++ /dev/null
@@ -1,136 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Version mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Version mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABHIBII" name="BABHIBII"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Version mapping</h1>
-<p><a id="sthref154" name="sthref154"></a><a id="sthref155" name="sthref155"></a><a id="sthref156" name="sthref156"></a><a id="sthref157" name="sthref157"></a>Use a <span class="bold">Version Mapping</span> to specify the field used for optimistic locking. If the entity is associated with multiple tables, you should use a version mapping only with the primary table. You should have only a single version mapping per persistent entity. Version mappings may be used only with the following attribute types:</p>
-<ul>
-<li>
-<p><code>int</code></p>
-</li>
-<li>
-<p><code>Integer</code></p>
-</li>
-<li>
-<p><code>short, Short</code></p>
-</li>
-<li>
-<p><code>long, Long</code></p>
-</li>
-<li>
-<p><code>Timestamp</code></p>
-</li>
-</ul>
-<p>To create a version mapping:</p>
-<ol>
-<li>
-<p>In the <a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a>, select the field to map.</p>
-</li>
-<li>
-<p>Right-click the field and then select <span class="bold">Map As &gt; Version</span>. The <a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a> displays the properties for the selected.</p>
-</li>
-<li>
-<p>Use this table to complete the remaining fields in the JPA Details view.</p>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the fields in the Persistence Properties view for this mapping." summary="This table lists the fields in the Persistence Properties view for this mapping." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="19%" />
-<col width="*" />
-<col width="38%" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t27">Property</th>
-<th align="left" valign="bottom" id="r1c2-t27">Description</th>
-<th align="left" valign="bottom" id="r1c3-t27">Default</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t27" headers="r1c1-t27">Mapped Entity Hyperlink</td>
-<td align="left" headers="r2c1-t27 r1c2-t27">Defines the mapping as Version. This corresponds to the <code>@Version</code> annotation.</td>
-<td align="left" headers="r2c1-t27 r1c3-t27">Version</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t27" headers="r1c1-t27">Column</td>
-<td align="left" headers="r3c1-t27 r1c2-t27">The database column mapped to the entity attribute. See <a href="ref_mapping_general.htm#CACGCBHB">"Column"</a> for details.</td>
-<td align="left" headers="r3c1-t27 r1c3-t27">By default, the Column is assumed to be named identically to the attribute and always included in the <code>INSERT</code> and <code>UPDATE</code> statements.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r4c1-t27" headers="r1c1-t27">Table</td>
-<td align="left" headers="r4c1-t27 r1c2-t27">Name of the database table. This must be the primary table associated with the attribute's entity.</td>
-<td align="left" headers="r4c1-t27 r1c3-t27"><br /></td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r5c1-t27" headers="r1c1-t27">Temporal</td>
-<td align="left" headers="r5c1-t27 r1c2-t27">Specifies the type of data. See <a href="ref_mapping_general.htm#CACEAJGD">"Temporal"</a> for details.
-<ul>
-<li>
-<p>Date</p>
-</li>
-<li>
-<p>Time</p>
-</li>
-<li>
-<p>Timestamp</p>
-</li>
-</ul>
-</td>
-<td align="left" headers="r5c1-t27 r1c3-t27"><br /></td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" --></li>
-</ol>
-<p>Eclipse adds the following annotations to the field:</p>
-<pre xml:space="preserve" class="oac_no_warn">
-@Version
-@Column(table="<span class="italic">&lt;COLUMN_TABLE&gt;</span>", name="&lt;<span class="italic">COLUMN_NAME</span>&gt;")
-
-</pre>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_mapping.htm#BABDGBIJ">Mapping an entity</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_persistence_outline.htm#BABEGGFE">JPA Structure view</a><br />
-<a href="ref_persistence_map_view.htm#BABIFBAF">JPA Details view (for attributes)</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_mapping.htm#BABBDJFI">Understanding OR mappings</a><br />
-<a href="concepts001.htm#BABBGFJG">Understanding EJB 3.0 Java Persistence API</a></div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm
deleted file mode 100644
index c785cd4dc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks020.htm
+++ /dev/null
@@ -1,40 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Element Collection mapping</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Element Collection mapping" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHBDEAJ" name="CIHBDEAJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Element Collection mapping</h1>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm
deleted file mode 100644
index 358ebb8f33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks021.htm
+++ /dev/null
@@ -1,95 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generating entities from tables</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating entities from tables" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABBAGFI" name="BABBAGFI"></a></p>
-<div class="sect1">
-<h1>Generating entities from tables</h1>
-<p><a id="sthref158" name="sthref158"></a><a id="sthref159" name="sthref159"></a>Use this procedure to generate Java persistent entities from database tables. You must create a JPA project and establish a database connection <span class="italic">before</span> generating persistent entities. See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> for more information.<a id="sthref160" name="sthref160"></a><a id="sthref161" name="sthref161"></a></p>
-<ol>
-<li>
-<p>Right-click the JPA project in the <span class="gui-object-title">Project Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Generate Entities from Tables</span>.</p>
-<div class="figure"><a id="sthref162" name="sthref162"></a>
-<p class="titleinfigure">Generating Entities</p>
-<img src="img/generate_entities.png" alt="Using the JPA Tools &gt; Generate Entities menu option." title="Using the JPA Tools &gt; Generate Entities menu option." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>On the <a href="ref_selectTables.htm#CIAHCGEE">Select Tables</a> page, select your database connection and schema.</p>
-<p>To create a new database connection, click <span class="bold">Add connection</span>.</p>
-<p>If you are not currently connected to the database, the Database Connection page appears. Select your database connection and schema, and click <span class="bold">Reconnect</span>.</p>
-<div class="figure"><a id="sthref163" name="sthref163"></a>
-<p class="titleinfigure">Select Tables</p>
-<img src="img/select_tables.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>After selecting a schema, select the tables from which to generate Java persistent entities and click <span class="bold">Next</span>.</p>
-</li>
-<li>
-<p>On the <a href="ref_tableAssociations.htm#CIACDICB">Table Associations</a> page, select the associations to generate. You can specify to generate specific references for each association.</p>
-<p>To create a new association, click <span class="bold">Add Association</span>. Use the <a href="ref_create_new_association_wizard.htm#CIAFGHIF">Create New Association</a> wizard to define the association.</p>
-<div class="figure"><a id="sthref164" name="sthref164"></a>
-<p class="titleinfigure">Table Associations</p>
-<img src="img/table_associations.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>After editing the table associations, click <span class="bold">Next</span>.</p>
-</li>
-<li>
-<p>On the <a href="ref_customizeDefaultEntityGeneration.htm#CIAEJDBE">Customize Default Entity Generation</a> page, customize the mapping and class information for each generated entity.</p>
-<div class="figure"><a id="sthref165" name="sthref165"></a>
-<p class="titleinfigure">Customize Default Entity Generation</p>
-<img src="img/customize_default_entity_generation.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>After customizing the mappings, click <span class="bold">Next</span>.</p>
-</li>
-<li>
-<p>On the <a href="ref_customizIndividualEntities.htm#CIACIGEE">Customize Individual Entities</a> page, review the mapping and class information for each entity that will be generated, then click <span class="bold">Finish</span>.</p>
-<div class="figure"><a id="sthref166" name="sthref166"></a>
-<p class="titleinfigure">Customize Individual Entities</p>
-<img src="img/customize_individual_entities.png" alt="" title="" /><br /></div>
-<!-- class="figure" --></li>
-</ol>
-<p>Eclipse creates a Java persistent entity for each database table. Each entity contains fields based on the table's columns. Eclipse will also generate entity relationships (such as one-to-one) based on the table constraints. <a href="#CIHJIJJC">Figure: Generating Entities from Tables</a> illustrates how Eclipse generates entities from tables.</p>
-<div class="figure"><a id="CIHJIJJC" name="CIHJIJJC"></a>
-<p class="titleinfigure">Generating Entities from Tables</p>
-<img src="img/table_entity.png" alt="This figure shows the EMPLOYEE and ADDRESS entities generated from database tables." title="This figure shows the EMPLOYEE and ADDRESS entities generated from database tables." /><br /></div>
-<!-- class="figure" -->
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a></p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm
deleted file mode 100644
index 6341e8970b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks022.htm
+++ /dev/null
@@ -1,61 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Generating tables from entities</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Generating tables from entities" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHJIGBE" name="CIHJIGBE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Generating tables from entities</h1>
-<p>When using a vendor-specific platform, you can create a DDL script from your persistent entities.</p>
-<div align="center">
-<div class="inftblnote"><br />
-<table class="Note oac_no_warn" summary="" cellpadding="3" cellspacing="0">
-<tbody>
-<tr>
-<td align="left">
-<p class="notep1">Note:</p>
-The DDL script with DROP existing tables on the database and CREATE new tables, based on the entities in your project.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblnote" --></div>
-<p>To generate a DDL script:</p>
-<p>Right-click the JPA project in the <span class="gui-object-title">Project Explorer</span> and select <span class="gui-object-action">JPA Tools &gt; Generate Tables from Entities</span>.</p>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<p><a href="task_create_jpa_entity.htm#BABFBJBG">Creating a JPA Entity</a></p>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm
deleted file mode 100644
index a1870e4d58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks023.htm
+++ /dev/null
@@ -1,54 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Validating mappings and reporting problems</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Validating mappings and reporting problems" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABFAIBA" name="BABFAIBA"></a></p>
-<div class="sect1">
-<h1>Validating mappings and reporting problems</h1>
-<p><a id="sthref167" name="sthref167"></a><a id="sthref168" name="sthref168"></a><a id="sthref169" name="sthref169"></a><a id="sthref170" name="sthref170"></a>Errors and warnings on persistent entities and mappings are indicated with a red error or yellow warning next to the resource with the error, as well as the parent containers up to the project.</p>
-<div class="figure"><a id="sthref171" name="sthref171"></a>
-<p class="titleinfigure">Sample Errors and Warnings</p>
-<img src="img/error_sample.png" alt="This figure shows sample error and warning icons in the Explorer view." title="This figure shows sample error and warning icons in the Explorer view." /><br /></div>
-<!-- class="figure" -->
-<p>This section contains information on the following:</p>
-<ul>
-<li>
-<p><a href="tasks024.htm#CIHFEDEI">Error messages</a></p>
-</li>
-<li>
-<p><a href="tasks025.htm#CIHGEAIJ">Warning messages</a></p>
-</li>
-</ul>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" --></div>
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm
deleted file mode 100644
index b3fee1f68d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks024.htm
+++ /dev/null
@@ -1,92 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Error messages</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Error messages" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHFEDEI" name="CIHFEDEI"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Error messages<a id="sthref172" name="sthref172"></a></h1>
-<p>This section contains information on error messages (including how to resolve the issue) you may encounter while working with Dali.</p>
-<a id="sthref173" name="sthref173"></a>
-<p class="subhead2">Attribute "<span class="italic">&lt;ATTRIBUTE__NAME&gt;</span>" has invalid mapping type in this context</p>
-<p>The mapped attribute is invalid. Either change the mapping type or change the entity type.</p>
-<p>See <a href="task_mapping.htm#BABDGBIJ">"Mapping an entity"</a> for more information.</p>
-<a id="sthref174" name="sthref174"></a>
-<p class="subhead2">Attribute "<span class="italic">&lt;ATTRIBUTE_NAME&gt;</span>" cannot be resolved.</p>
-<p>Dali cannot map the attribute to a database table and column. Verify that you database connection information is correct.</p>
-<p>See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> for more information.</p>
-<a id="sthref175" name="sthref175"></a>
-<p class="subhead2">Class "<span class="italic">&lt;CLASS_NAME&gt;</span>" is not annotated as a persistent class.</p>
-<p>The class has not been identified as a persistent class. Configure the class as an Entity, Mapped Superclass, or Embeddable persistent entity.</p>
-<p>See <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a>.</p>
-<a id="sthref176" name="sthref176"></a>
-<p class="subhead2">Column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" cannot be resolved.</p>
-<p>You mapped an entity's field to an incorrect or invalid column in the database table. By default, Dali will attempt to map each field in the entity with an identically named row in the database table. If the field's name differs from the row's name, you must explicitly create the mapping.</p>
-<p>Map the field to a valid row in the database table as shown in <a href="task_mapping.htm#BABDGBIJ">"Mapping an entity"</a>.</p>
-<a id="sthref177" name="sthref177"></a>
-<p class="subhead2">Duplicate class "<span class="italic">&lt;CLASS_NAME&gt;</span>".</p>
-<p>You created to persistence classes with the same name. Each Java class must have a unique name. See <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a> for more information.</p>
-<a id="sthref178" name="sthref178"></a>
-<p class="subhead2">Entity does not have an Id or Embedded Id.</p>
-<p>You created a persistent entity without identifying its primary key. A persistent entity must have a primary key field designated with an <code>@Id</code> or <code>@EmbeddedId</code> annotation.</p>
-<p>Add an ID mapping to the entity as shown in <a href="tasks013.htm#BABGCBHG">"ID mapping"</a> or <a href="tasks012.htm#CIHDIAEE">"Embedded ID mapping"</a>.</p>
-<a id="sthref179" name="sthref179"></a>
-<p class="subhead2">Multiple persistence.xml files in project.</p>
-<p>You created a JPA project with more than one <code>persistence.xml</code> file. Each JPA project must contain a <span class="italic">single</span> <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<a id="sthref180" name="sthref180"></a>
-<p class="subhead2">No persistence unit defined.</p>
-<p>There is no persistence unit defined in the <code>persistence.xml</code> file. Use the &lt;persistence-unit name="<span class="italic">&lt;PERSISTENCE_UNIT_NAME&gt;</span>" tag to define the persistent unit.</p>
-<p>See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<a id="sthref181" name="sthref181"></a>
-<p class="subhead2">No persistence.xml file in project.</p>
-<p>You created a JPA project without a <code>persistence.xml</code> file. Each JPA project must contain a <span class="italic">single</span> <code>persistence.xml</code> file.</p>
-<p>See <a href="task_manage_persistence.htm#CIHDAJID">"Managing the persistence.xml file"</a> for more information.</p>
-<a id="sthref182" name="sthref182"></a>
-<p class="subhead2">Referenced column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" in join column "<span class="italic">&lt;COLUMN_NAME&gt;</span>" cannot be resolved.</p>
-<p>The column that you selected to join a relationship mapping does not exist on the database table. Either select a different column on the <a href="reference011.htm#CACBAEBC">Join Table Information</a> or create the necessary column on the database table.</p>
-<p>See <a href="ref_persistence_map_view.htm#BABIFBAF">"JPA Details view (for attributes)"</a> for more information.</p>
-<a id="sthref183" name="sthref183"></a>
-<p class="subhead2">Schema "&lt;<span class="italic">SCHEMA_NAME</span>&gt;" cannot be resolved for table/join table "&lt;<span class="italic">TABLE_NAME</span>&gt;".</p>
-<p>Define the default database schema information in the persistence unit.</p>
-<p>See <a href="task_manage_orm.htm#CIHDGDCD">"Managing the orm.xml file"</a> for more information.</p>
-<a id="sthref184" name="sthref184"></a>
-<p class="subhead2">Table "<span class="italic">&lt;TABLE_NAME&gt;</span>" cannot be resolved.</p>
-<p>You associated a persistent entity to an incorrect or invalid database table. By default, Dali will attempt to associate each persistent entity with an identically named database table. If the entity's name differs from the table's name, you must explicitly create the association.</p>
-<p>Associate the entity with a valid database table as shown in <a href="task_add_persistence.htm#BABHICAI">"Adding persistence to a class"</a>.</p>
-<a id="sthref185" name="sthref185"></a>
-<p class="subhead2">Unresolved generator "<span class="italic">&lt;GENERATOR_NAME&gt;</span>" is defined in persistence unit.</p>
-<p>You created a persistence entity that uses sequencing or a table generator, but did not define the generator in the persistence unit. Either define the generator by using an annotation or including it in the XML mapping file.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm
deleted file mode 100644
index f6bbacb426..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks025.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Warning messages</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Warning messages" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CIHGEAIJ" name="CIHGEAIJ"></a></p>
-<div class="sect2"><!-- infolevel="all" infotype="General" -->
-<h1>Warning messages</h1>
-<p>This section contains information on warning messages (including how to resolve the issue) you may encounter while working with Dali.</p>
-<a id="sthref186" name="sthref186"></a>
-<p class="subhead2">Connection "<span class="italic">&lt;CONNECTION_NAME&gt;</span>" is not active. No validation will be done against the data source.</p>
-<p>The database connection you specified to use with the JPA project is not active. The JPA project requires an active connection.</p>
-<a id="sthref187" name="sthref187"></a>
-<p class="subhead2">No connection specified for the project. No data-specific validation will be performed.</p>
-<p>You created a JPA project without specifying a database connection. The JPA project requires an active connection.</p>
-<p>See <a href="task_create_new_project.htm#CIHHEJCJ">"Creating a new JPA project"</a> or <a href="tasks026.htm#BABDBCBI">"Modifying persistent project properties"</a> for information on specifying a database connection.</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<p><a href="../org.eclipse.platform.doc.user/concepts/cprbview.htm">Problems view</a></p>
-</div>
-<!-- class="sect2" -->
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tasks026.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tasks026.htm
deleted file mode 100644
index 295a03a8bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tasks026.htm
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Modifying persistent project properties</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:45Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Modifying persistent project properties" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="BABDBCBI" name="BABDBCBI"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Modifying persistent project properties</h1>
-<p>Each persistent project must be associated with a database connection. To create a new database connection, click <span class="gui-object-action">Database Connection</span> use the New Connection wizard.</p>
-<p>Use this procedure to modify the vender-specific platform and database connection associated with your JPA project.</p>
-<ol>
-<li>
-<p>Right-click the project in the <span class="gui-object-title">Explorer</span> view and select <span class="gui-object-action">Properties</span>. The Properties page appears.</p>
-<div class="figure"><a id="sthref188" name="sthref188"></a>
-<p class="titleinfigure">The Properties Page</p>
-<img src="img/project_properties_tasks.png" alt="The Persistence page." title="The Persistence page." /><br /></div>
-<!-- class="figure" --></li>
-<li>
-<p>Complete each field on the <a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a> click <span class="bold">OK</span>.</p>
-</li>
-</ol>
-<p>&nbsp;</p>
-<img src="img/ngrelt.png" alt="Related task" title="Related task" /><br />
-<br />
-<a href="task_create_new_project.htm#CIHHEJCJ">Creating a new JPA project</a>
-<p>&nbsp;</p>
-<img src="img/ngrelr.png" alt="Related reference" title="Related reference" /><br />
-<br />
-<a href="ref_project_properties.htm#BABJHBCI">Project Properties page &ndash; Java Persistence Options</a>
-<p>&nbsp;</p>
-<img src="img/ngrelc.png" alt="Related concept" title="Related concept" /><br />
-<br />
-<a href="concept_persistence.htm#BABCAHIC">Understanding Java persistence</a></div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm b/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm
deleted file mode 100644
index a47917f7e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/tips_and_tricks.htm
+++ /dev/null
@@ -1,68 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Tips and tricks</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" Tips and tricks" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CHDHGHBF" name="CHDHGHBF"></a></p>
-<h1>Tips and tricks</h1>
-<p>The following tips and tricks give some helpful ideas for increasing your productivity.</p>
-<ul>
-<li>
-<p><a href="#BABFIIHA"><span class="bold">Database Connections</span></a></p>
-</li>
-<li>
-<p><a href="#BABCHAHF"><span class="bold">Schema-based persistence.xml</span></a></p>
-</li>
-</ul>
-<div class="inftblruleinformal">
-<table class="RuleInformal" title="This table lists the tips and tricks in this category." summary="This table lists the tips and tricks in this category." dir="ltr" border="1" width="100%" frame="border" rules="all" cellpadding="3" cellspacing="0">
-<col width="27%" />
-<col width="*" />
-<thead>
-<tr align="left" valign="top">
-<th align="left" valign="bottom" id="r1c1-t2">Tip</th>
-<th align="left" valign="bottom" id="r1c2-t2">Description</th>
-</tr>
-</thead>
-<tbody>
-<tr align="left" valign="top">
-<td align="left" id="r2c1-t2" headers="r1c1-t2"><a id="BABFIIHA" name="BABFIIHA"></a><span class="bold">Database Connections</span></td>
-<td align="left" headers="r2c1-t2 r1c2-t2">When starting a new workbench session, be sure to <a href="../org.eclipse.datatools.connectivity.doc.user/doc/html/asc1229700343352.html">reconnect to your database</a> (if you are working online). This allows Dali to provide database-related mapping assistance and validation.</td>
-</tr>
-<tr align="left" valign="top">
-<td align="left" id="r3c1-t2" headers="r1c1-t2"><a id="BABCHAHF" name="BABCHAHF"></a><span class="bold">Schema-based persistence.xml</span></td>
-<td align="left" headers="r3c1-t2 r1c2-t2">If you are behind a firewall, you may need to configure your Eclipse workspace proxy in the <a href="../org.eclipse.platform.doc.user/reference/ref-72.htm">Preferences dialog</a> (<span class="gui-object-action">Preferences &gt; Internet &gt; Proxy Settings</span>) to properly validate a schema-based <code>persistence.xml</code> file.</td>
-</tr>
-</tbody>
-</table>
-<br /></div>
-<!-- class="inftblruleinformal" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml b/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
deleted file mode 100644
index 976debe599..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/toc.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<?xml version='1.0' encoding='iso-8859-1'?>
-<!-- User Guide -->
- <toc label="Dali Java Persistence Tools User Guide">
- <topic href="getting_started.htm" label="Getting started">
- <topic href="getting_started001.htm#BABEFHCD" label="Requirements and installation" />
- <topic href="getting_started002.htm#BABIGCJA" label="Dali quick start">
- <topic href="getting_started003.htm#BABDFHDA" label="Creating a new JPA project" />
- <topic href="getting_started004.htm#BABFGDDG" label="Creating a Java persistent entity with persistent fields" />
- </topic>
- </topic>
- <topic href="concepts.htm" label=" Concepts">
- <topic href="concept_persistence.htm#BABCAHIC" label="Understanding Java persistence" />
- <topic href="concept_mapping.htm#BABBDJFI" label="Understanding OR mappings" />
- <topic href="concepts001.htm#BABBGFJG" label="Understanding EJB 3.0 Java Persistence API">
- <topic href="concepts002.htm#CHDHAGIH" label="The persistence.xml file" />
- <topic href="concepts003.htm#CHDBIJAC" label="The orm.xml file" />
- </topic>
- </topic>
- <topic href="tasks.htm" label=" Tasks">
- <topic href="task_create_new_project.htm#CIHHEJCJ" label="Creating a new JPA project" />
- <topic href="tasks001.htm#BEIBADHH" label="Converting a Java Project to a JPA Project" />
- <topic href="task_create_jpa_entity.htm#BABFBJBG" label="Creating a JPA Entity" />
- <topic href="task_manage_persistence.htm#CIHDAJID" label="Managing the persistence.xml file">
- <topic href="tasks002.htm#CIHFEBAI" label="Synchronizing classes" />
- <topic href="tasks003.htm#sthref56" label="Upgrading document version" />
- </topic>
- <topic href="task_manage_orm.htm#CIHDGDCD" label="Managing the orm.xml file">
- <topic href="tasks004.htm#sthref60" label="Creating an orm.xml file" />
- <topic href="tasks005.htm#CIHBCDCE" label="Working with orm.xml file" />
- </topic>
- <topic href="task_add_persistence.htm#BABHICAI" label="Adding persistence to a class">
- <topic href="tasks006.htm#BABGBIEE" label="Entity" />
- <topic href="tasks007.htm#BABFEICE" label="Embeddable" />
- <topic href="tasks008.htm#BABDAGCI" label="Mapped superclass" />
- </topic>
- <topic href="task_additonal_tables.htm#CIHGBIEI" label="Specifying additional tables" />
- <topic href="task_inheritance.htm#CIHCCCJD" label="Specifying entity inheritance" />
- <topic href="tasks009.htm#BABIGBGG" label="Creating Named Queries" />
- <topic href="task_mapping.htm#BABDGBIJ" label="Mapping an entity">
- <topic href="tasks010.htm#BABBABCE" label="Basic mapping" />
- <topic href="tasks011.htm#BABCBHDF" label="Embedded mapping" />
- <topic href="tasks012.htm#CIHDIAEE" label="Embedded ID mapping" />
- <topic href="tasks013.htm#BABGCBHG" label="ID mapping" />
- <topic href="tasks014.htm#BABEIEGD" label="Many-to-many mapping" />
- <topic href="tasks015.htm#BABHFAFJ" label="Many-to-one mapping" />
- <topic href="tasks016.htm#BABHGEBD" label="One-to-many mapping" />
- <topic href="tasks017.htm#BABFHBCJ" label="One-to-one mapping" />
- <topic href="tasks018.htm#BABHFHEI" label="Transient mapping" />
- <topic href="tasks019.htm#BABHIBII" label="Version mapping" />
- <topic href="tasks020.htm#CIHBDEAJ" label="Element Collection mapping" />
- </topic>
- <topic href="tasks021.htm#BABBAGFI" label="Generating entities from tables" />
- <topic href="tasks022.htm#CIHJIGBE" label="Generating tables from entities" />
- <topic href="tasks023.htm#BABFAIBA" label="Validating mappings and reporting problems">
- <topic href="tasks024.htm#CIHFEDEI" label="Error messages" />
- <topic href="tasks025.htm#CIHGEAIJ" label="Warning messages" />
- </topic>
- <topic href="tasks026.htm#BABDBCBI" label="Modifying persistent project properties" />
- <topic href="task_generating_schema_from_classes.htm#CIHHBJCJ" label="Generating Schema from Classes" />
- <topic href="task_generate_classes_from_schema.htm#CIHCBHJD" label="Generating JAXB Classes from a Schema" />
- </topic>
- <topic label=" Reference">
- <topic label="Wizards">
- <topic href="ref_new_jpa_project_wizard.htm#CACBJGBG" label="Create New JPA Project wizard">
- <topic href="ref_new_jpa_project.htm#CACBJAGC" label="New JPA Project page" />
- <topic href="ref_java_page.htm#CIAGEBAA" label="Java Page" />
- <topic href="ref_jpa_facet.htm#CACIFDIF" label="JPA Facet page" />
- </topic>
- <topic href="ref_create_jpa_entity_wizard.htm#CIAGGGDF" label="Create JPA Entity wizard">
- <topic href="ref_EntityClassPage.htm#CIAFEIGF" label="Entity Class page" />
- <topic href="ref_EntityPropertiesPage.htm#CIADECIA" label="Entity Properties page" />
- </topic>
- <topic href="reference002.htm#CIAIJCCE" label="Mapping File Wizard">
- <topic href="reference003.htm#CIAJEIDJ" label="Mapping File" />
- </topic>
- <topic href="reference004.htm#CIAGHCGA" label="Generate Tables from Entities Wizard" />
- <topic href="ref_create_custom_entities_wizard.htm#CIAGBFJE" label="Generate Entities from Tables Wizard">
- <topic href="ref_selectTables.htm#CIAHCGEE" label="Select Tables" />
- <topic href="ref_tableAssociations.htm#CIACDICB" label="Table Associations" />
- <topic href="ref_customizeDefaultEntityGeneration.htm#CIAEJDBE" label="Customize Default Entity Generation" />
- <topic href="ref_customizIndividualEntities.htm#CIACIGEE" label="Customize Individual Entities" />
- </topic>
- <topic href="ref_create_new_association_wizard.htm#CIAFGHIF" label="Create New Association">
- <topic href="ref_association_table.htm#CIAGJHDC" label="Association Tables" />
- <topic href="ref_join_columns.htm#CIAEGEEG" label="Join Columns" />
- <topic href="ref_association_cardinality.htm#CIAFIIFH" label="Association Cardinality" />
- </topic>
- <topic href="ref_jaxb_schema_wizard.htm#CACGADFH" label="Generate Schema from JAXB Classes Wizard">
- <topic href="ref_schema_from_classes_page.htm#CACHBEGJ" label="Generate Schema from Classes" />
- </topic>
- </topic>
- <topic label="Property pages">
- <topic href="ref_persistence_prop_view.htm#BABFAEBB" label="JPA Details view (for entities)">
- <topic href="reference006.htm#CACCAGGC" label="General information" />
- <topic href="reference007.htm#CACIJBGH" label="Attribute overrides" />
- <topic href="reference008.htm#CACBHIDA" label="Secondary table information" />
- <topic href="reference009.htm#CACFHGHE" label="Inheritance information" />
- <topic href="reference010.htm#sthref241" label="Queries" />
- </topic>
- <topic href="ref_persistence_map_view.htm#BABIFBAF" label="JPA Details view (for attributes)">
- <topic href="ref_mapping_general.htm#CACBHFIJ" label="General information" />
- <topic href="reference011.htm#CACBAEBC" label="Join Table Information" />
- <topic href="reference012.htm#CACFCEJC" label="Join Columns Information" />
- <topic href="ref_primary_key.htm#CACFCCAB" label="Primary Key Generation information" />
- </topic>
- <topic href="ref_details_orm.htm#CACGDGHC" label="JPA Details view (for orm.xml)">
- <topic href="reference013.htm#CACCACGH" label="General information" />
- <topic href="reference014.htm#CACEAGBG" label="Persistence Unit information" />
- <topic href="reference015.htm#CIAFGAIJ" label="Generators" />
- <topic href="reference016.htm#CIAIBAAJ" label="Queries" />
- <topic href="reference017.htm#CIADGCID" label="Converters" />
- </topic>
- <topic href="ref_persistence_outline.htm#BABEGGFE" label="JPA Structure view" />
- <topic href="ref_persistence_xmll_editor.htm#CIACCHID" label="persistence.xml Editor">
- <topic href="ref_persistence_general.htm#CIACIFGJ" label="General" />
- <topic href="reference018.htm#CIAFFJIE" label="Connection" />
- <topic href="reference019.htm#CIAJAFEG" label="Customization" />
- <topic href="reference020.htm#CIABEDCH" label="Caching" />
- <topic href="reference021.htm#CIABGHHI" label="Logging" />
- <topic href="reference022.htm#CIAFJCHE" label="Options" />
- <topic href="reference023.htm#CIACCFCB" label="Schema Generation" />
- <topic href="reference024.htm#CIAHJDFF" label="Properties" />
- <topic href="reference025.htm#CIAHCJAH" label="Source" />
- </topic>
- </topic>
- <topic label="Preferences">
- <topic href="ref_project_properties.htm#BABJHBCI" label="Project Properties page - Java Persistence Options" />
- <topic href="reference027.htm#CACFBAEH" label="Project Properties page - Validation Preferences" />
- </topic>
- <topic label="Dialogs">
- <topic href="reference029.htm#CACCGEHC" label="Edit Join Columns Dialog" />
- <topic href="ref_select_cascade_dialog.htm#CIAFDGIJ" label="Select Cascade dialog" />
- <topic href="ref_eclipselink_mapping_file.htm#CIAEDEJF" label="New EclipseLink Mapping File dialog" />
- <topic href="ref_add_converter.htm#CIAGCGIJ" label="Add Converter dialog" />
- <topic href="ref_configure_jaxb_class_generation_dialog.htm#CACHHHJA" label="Configure JAXB Class Generation dialog" />
- </topic>
- <topic href="ref_persistence_perspective.htm#BABIFBDB" label="JPA Development perspective" />
- <topic label="Icons and buttons">
- <topic href="reference031.htm#CACGEACG" label="Icons" />
- <topic href="reference032.htm#CACDJCEI" label="Buttons" />
- </topic>
- <topic href="reference033.htm#CACBBDIB" label="Dali Developer Documentation" />
- </topic>
- <topic href="tips_and_tricks.htm" label="Tips and tricks">
- <topic href="whats_new001.htm#sthref306" label="Improved Internationalization and Localization" />
- <topic href="whats_new002.htm#CJACEDDE" label="Multiple Improvements to the Dali Perspective" />
- <topic href="whats_new003.htm#CJADIFHJ" label="Support for JPA 2.0 and EclipseLink" />
- <topic href="whats_new004.htm#CJABIJEC" label="Conversion of Java Projects to JPA Projects" />
- <topic href="whats_new005.htm#CJACJBDA" label="EclipseLink 2.x Support" />
- <topic href="whats_new006.htm#sthref307" label="Table-per-Concrete-Class Inheritance" />
- </topic>
- <topic href="legal.htm" label=" Legal">
- <topic href="about.htm#sthref309" label="About this content" />
- </topic>
-</toc>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
deleted file mode 100644
index 95294a3e2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new.htm
+++ /dev/null
@@ -1,50 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>What's new</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content=" What's new" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="sthref291" name="sthref291"></a> What's new</p>
-<p>This section contains descriptions of the following new features and significant changes made to the Dali OR Mapping Tool for Release 2.3:</p>
-<ul>
-<li>
-<p><a href="whats_new002.htm#CJACEDDE">Multiple Improvements to the Dali Perspective</a></p>
-</li>
-<li>
-<p><a href="whats_new003.htm#CJADIFHJ">Support for JPA 2.0 and EclipseLink</a></p>
-</li>
-<li>
-<p><a href="whats_new004.htm#CJABIJEC">Conversion of Java Projects to JPA Projects</a></p>
-</li>
-<li>
-<p><a href="whats_new005.htm#CJACJBDA">EclipseLink 2.x Support</a></p>
-</li>
-</ul>
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm
deleted file mode 100644
index 70ca442b7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new001.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Improved Internationalization and Localization</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Improved Internationalization and Localization" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref292" name="sthref292"></a>
-<h1>Improved Internationalization and Localization</h1>
-<p>This release of the Dali OR Mapping Tool provides improved internationalization (i18n) and localization support. Dali projects can support different locales and processing of international data (such as dates and strings).</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm
deleted file mode 100644
index 46b15e5afc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new002.htm
+++ /dev/null
@@ -1,51 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Multiple Improvements to the Dali Perspective</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Multiple Improvements to the Dali Perspective" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CJACEDDE" name="CJACEDDE"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Multiple Improvements to the Dali Perspective</h1>
-<p>There have been multiple improvements to the Dali perspectives to improve its ease-of-use:</p>
-<ul>
-<li>
-<p>The <a href="ref_create_jpa_entity_wizard.htm#CIAGGGDF">Create JPA Entity wizard</a> now accepts short names as attribute types.</p>
-</li>
-<li>
-<p>Dali will perform validation after refreshing database information.</p>
-</li>
-<li>
-<p>Dali allows project-level customization for validation (error and warning reports)</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm
deleted file mode 100644
index 5061cc4f3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new003.htm
+++ /dev/null
@@ -1,63 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Support for JPA 2.0 and EclipseLink</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Support for JPA 2.0 and EclipseLink" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CJADIFHJ" name="CJADIFHJ"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Support for JPA 2.0 and EclipseLink</h1>
-<p>This release of the Dali OR Mapping Tool supports generic JPA 2.0 as well as specific items for EclispeLink 1.2.</p>
-<ul>
-<li>
-<p>Derived IDs</p>
-</li>
-<li>
-<p>Caching (Shared Cache and Cachable)</p>
-</li>
-<li>
-<p>Canonical metamodel generation</p>
-</li>
-<li>
-<p>Order Column configuration</p>
-</li>
-<li>
-<p>ElementCollection mapping type</p>
-</li>
-<li>
-<p>Cascade detach</p>
-</li>
-<li>
-<p>Dali will upgrade your <code>persistence.xml</code> from JPA 1.0 to 2.0.</p>
-</li>
-</ul>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm
deleted file mode 100644
index 7ad545bfb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new004.htm
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Conversion of Java Projects to JPA Projects</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Conversion of Java Projects to JPA Projects" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CJABIJEC" name="CJABIJEC"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>Conversion of Java Projects to JPA Projects</h1>
-<p>The Dali OR Mapping Tool now uses the Eclipse <span class="bold">Configure</span> menu to convert existing Java projects to JPA projects.</p>
-<p>See <a href="tasks001.htm#BEIBADHH">"Converting a Java Project to a JPA Project"</a> for more information.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm
deleted file mode 100644
index 431f99807f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new005.htm
+++ /dev/null
@@ -1,41 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>EclipseLink 2.x Support</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="EclipseLink 2.x Support" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<p><a id="CJACJBDA" name="CJACJBDA"></a></p>
-<div class="sect1"><!-- infolevel="all" infotype="General" -->
-<h1>EclipseLink 2.x Support</h1>
-<p>Release 2.3 provides support for EclipseLink 2.x features.</p>
-<p>EclipseLink (the Eclipse Persistence Services Project) is a complete persistence frame work. Refer to <code><a href="http://www.eclipse.org/eclipselink/">http://www.eclipse.org/eclipselink/</a></code> for more information.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm b/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm
deleted file mode 100644
index 712867a5cc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.doc.user/whats_new006.htm
+++ /dev/null
@@ -1,39 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
-<head>
-<meta http-equiv="Content-Type" content="text/html; charset=us-ascii" />
-
-<meta http-equiv="Content-Style-Type" content="text/css" />
-<meta http-equiv="Content-Script-Type" content="text/javascript" />
-<title>Table-per-Concrete-Class Inheritance</title>
-<meta name="generator" content="Oracle DARB XHTML Converter (Mode = ohj/ohw) - Version 5.1.1" />
-<meta name="date" content="2010-05-19T8:12:49Z" />
-<meta name="robots" content="noarchive" />
-<meta name="doctitle" content="Table-per-Concrete-Class Inheritance" />
-<meta name="relnum" content="Release 2.3" />
-<meta name="copyright" content="Copyright (c) 2000, 2008 oracle . All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation" />
-<link rel="copyright" href="dcommon/html/cpyr.htm" title="Copyright" type="text/html" />
-<link rel="stylesheet" href="dcommon/css/blafdoc.css" title="Oracle BLAFDoc" type="text/css" />
-<!-- contents -->
-</head>
-<body>
-<div class="sect1"><!-- infolevel="all" infotype="General" --><a id="sthref293" name="sthref293"></a>
-<h1>Table-per-Concrete-Class Inheritance</h1>
-<p>The Dali OR Mapping Tool now supports the JPA 1.0-optional table-per-concrete-class inheritance option. This functionality may be required in JPA 2.0.</p>
-</div>
-<!-- class="sect1" -->
-<!-- Start Footer -->
-<div class="footer">
-<table class="simple oac_no_warn" summary="" cellspacing="0" cellpadding="0" width="100%">
-<col width="86%" />
-<col width="*" />
-<tr>
-<td align="left"><span class="copyrightlogo">Copyright&nbsp;&copy;&nbsp;2006, 2010,&nbsp;Oracle&nbsp;and/or&nbsp;its&nbsp;affiliates.&nbsp;All&nbsp;rights&nbsp;reserved.</span><br />
-<a href="dcommon/html/cpyr.htm"><span class="copyrightlogo">Legal Notices</span></a></td>
-</tr>
-</table>
-</div>
-<!-- class="footer" -->
-</body>
-</html>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project
deleted file mode 100644
index 56cc5af912..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.branding/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.branding</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.branding</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project
deleted file mode 100644
index 1d5359a334..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core.ddlgen/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.core.ddlgen</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.core.ddlgen</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.core/.project
deleted file mode 100644
index bd14595c75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.core/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.core</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.core</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project
deleted file mode 100644
index 868e21be70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.jaxb.core.schemagen/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.jaxb.core.schemagen</name>
- <comment>renamed to org.eclipse.jpt.jaxb.eclipselink.core.schemagen and moved to jaxb component</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project b/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project
deleted file mode 100644
index 7a6587657e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.eclipselink.ui/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.ui</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.ui</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.gen/.project b/jpa/plugins/org.eclipse.jpt.gen/.project
deleted file mode 100644
index 688225a0c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.gen/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.gen</name>
- <comment>renamed to org.eclipse.jpt.jpa.gen</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project b/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project
deleted file mode 100644
index 3d552f89dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.core.schemagen/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.core.schemagen</name>
- <comment>moved to jaxb component</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jaxb.ui/.project b/jpa/plugins/org.eclipse.jpt.jaxb.ui/.project
deleted file mode 100644
index 8dc3015b6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jaxb.ui/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jaxb.ui</name>
- <comment>moved to jaxb component</comment>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.branding/.cvsignore
deleted file mode 100644
index c9401a2c83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/.cvsignore
+++ /dev/null
@@ -1,2 +0,0 @@
-build.xml
-org.eclipse.jpt_1.0.0.* \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/.project b/jpa/plugins/org.eclipse.jpt.jpa.branding/.project
deleted file mode 100644
index fe9634f7fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.jpa.branding/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4aec29d1cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:09 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 4f1c0c2735..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.branding;singleton:=true
-Bundle-Version: 3.2.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.html b/jpa/plugins/org.eclipse.jpt.jpa.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.ini b/jpa/plugins/org.eclipse.jpt.jpa.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.mappings b/jpa/plugins/org.eclipse.jpt.jpa.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.properties b/jpa/plugins/org.eclipse.jpt.jpa.branding/about.properties
deleted file mode 100644
index e4f170f396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - JPA Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2006, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.branding/build.properties
deleted file mode 100644
index 4e089bbd76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties,\
- component.xml
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.branding/component.xml
deleted file mode 100644
index 6e51135f57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/component.xml
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.jpa.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.utility" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.db" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.db.ui" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.gen" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/icons/WTP_icon_x32_v2.png b/jpa/plugins/org.eclipse.jpt.jpa.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.branding/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.branding/plugin.properties
deleted file mode 100644
index 48126670cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - JPA Support
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.project b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.project
deleted file mode 100644
index af3dab3f36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.db.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index b6cef902e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:55 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index b3885ff7cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.db.ui
-Bundle-Version: 2.0.0.qualifier
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.datatools.connectivity.ui;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.datatools.sqltools.editor.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.datatools.connectivity.db.generic.ui;bundle-version="[1.0.1,2.0.0)"
-Export-Package: org.eclipse.jpt.jpa.db.ui.internal;x-friends:="org.eclipse.jpt.jpa.ui"
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/about.html b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/build.properties
deleted file mode 100644
index 41837ebdd1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/component.xml
deleted file mode 100644
index db3c94b7b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.db.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jpa.db.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/plugin.properties
deleted file mode 100644
index 951e96ded1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - JPA DB UI
-providerName = Eclipse Web Tools Platform
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/src/org/eclipse/jpt/jpa/db/ui/internal/DTPUiTools.java b/jpa/plugins/org.eclipse.jpt.jpa.db.ui/src/org/eclipse/jpt/jpa/db/ui/internal/DTPUiTools.java
deleted file mode 100644
index 11873fbd1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db.ui/src/org/eclipse/jpt/jpa/db/ui/internal/DTPUiTools.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.db.ui.internal;
-
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.db.generic.ui.wizard.NewJDBCFilteredCPWizard;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * DTP UI tools
- */
-public class DTPUiTools {
-
- /**
- * Launch the DTP New Connection Profile wizard to create a new database connection profile.
- *
- * Returns the name of the added profile, or null if the wizard was cancelled.
- * The name can be used to build a Dali connection profile from
- * JptJpaDbPlugin.getConnectionProfileFactory().buildConnectionProfile(String).
- */
- public static String createNewConnectionProfile() {
- // Filter datasource category
- NewJDBCFilteredCPWizard wizard = new NewJDBCFilteredCPWizard();
- WizardDialog wizardDialog = new WizardDialog(Display.getCurrent().getActiveShell(), wizard);
- wizardDialog.setBlockOnOpen(true);
-
- LocalProfileListener listener = new LocalProfileListener();
- ProfileManager.getInstance().addProfileListener(listener);
-
- String newCPName = null;
- if (wizardDialog.open() == Window.OK) {
- // assume the last added profile is the one we want
- newCPName = listener.addedProfile.getName();
- }
- ProfileManager.getInstance().removeProfileListener(listener);
-
- return newCPName;
- }
-
-
- // ********** DTP profile listener **********
-
- /**
- * This listener simply holds on to the most recently added connection
- * profile.
- */
- static class LocalProfileListener implements IProfileListener {
- IConnectionProfile addedProfile;
-
- public void profileAdded(IConnectionProfile profile) {
- this.addedProfile = profile;
- }
-
- public void profileChanged(IConnectionProfile profile) {
- // do nothing
- }
-
- public void profileDeleted(IConnectionProfile profile) {
- // do nothing
- }
- }
-
-
-// // ********** viewer filter **********
-//
-// static class LocalViewerFilter extends ViewerFilter {
-//
-// private static final String DATABASE_CATEGORY_ID = "org.eclipse.datatools.connectivity.db.category"; //$NON-NLS-1$
-//
-// LocalViewerFilter() {
-// super();
-// }
-//
-// @Override
-// public boolean select(Viewer viewer, Object parentElement, Object element) {
-// CPWizardNode wizardNode = (CPWizardNode) element;
-// IProfileWizardProvider wizardProvider = wizardNode.getProvider();
-// if (wizardProvider instanceof IWizardCategoryProvider) {
-// return false;
-// }
-// ICategory category = ConnectionProfileManager.getInstance().getProvider(
-// ((ProfileWizardProvider) wizardProvider).getProfile()).getCategory();
-//
-// // Only display wizards belong to database category
-// while (category != null) {
-// if (category.getId().equals(DATABASE_CATEGORY_ID)) {
-// return true;
-// }
-// category = category.getParent();
-// }
-// return false;
-// }
-// }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.db/.classpath
deleted file mode 100644
index 2fc0e3f0a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/.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="nonaccessible" pattern="org/eclipse/jpt/common/utility/model/value/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.db/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/.project b/jpa/plugins/org.eclipse.jpt.jpa.db/.project
deleted file mode 100644
index 3cb8e9f83a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.db</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.db/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index d6b660508f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:40 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.db/META-INF/MANIFEST.MF
deleted file mode 100644
index ebc36c5a92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,20 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.db
-Bundle-Version: 2.1.100.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.db.JptJpaDbPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.datatools.enablement.jdt.classpath;bundle-version="[1.0.1,2.0.0)",
- org.eclipse.datatools.sqltools.editor.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)"
-Export-Package: org.eclipse.jpt.jpa.db,
- org.eclipse.jpt.jpa.db.internal;x-internal:=true,
- org.eclipse.jpt.jpa.db.internal.driver;x-internal:=true
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/about.html b/jpa/plugins/org.eclipse.jpt.jpa.db/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.db/build.properties
deleted file mode 100644
index f6a257843e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.db/component.xml
deleted file mode 100644
index e52b4eea61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.db"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jpa.db" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.db/plugin.properties
deleted file mode 100644
index c428887e38..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - JPA DB
-providerName = Eclipse Web Tools Platform
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Catalog.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Catalog.java
deleted file mode 100644
index b976d3f1c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Catalog.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database catalog
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Catalog
- extends SchemaContainer
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Column.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Column.java
deleted file mode 100644
index 3f24d3d3ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Column.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import org.eclipse.jpt.common.utility.JavaType;
-
-/**
- * Database column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Column
- extends DatabaseObject
-{
- /**
- * Return the column's table.
- */
- Table getTable();
-
-
- // ********** constraints **********
-
- /**
- * Return whether the column is part of its table's primary key.
- */
- boolean isPartOfPrimaryKey();
-
- /**
- * Return whether the column is part of one of its table's foreign keys.
- */
- boolean isPartOfForeignKey();
-
- /**
- * Return whether the column is part of a unique constraint defined for its
- * table.
- */
- boolean isPartOfUniqueConstraint();
-
- /**
- * Return whether the column is nullable.
- */
- boolean isNullable();
-
-
- // ********** data type **********
-
- /**
- * Return the name of the column's datatype.
- */
- String getDataTypeName();
-
- /**
- * Return whether the column's type is numeric.
- */
- boolean isNumeric();
-
- /**
- * Return the column's precision if it is a NumericalDataType;
- * otherwise, return -1.
- */
- public int getPrecision();
-
- /**
- * Return the column's scale if it is an ExactNumericDataType;
- * otherwise, return -1.
- */
- public int getScale();
-
- /**
- * If the column is a CharacterStringDataType, return its length;
- * otherwise, return -1.
- */
- public int getLength();
-
- /**
- * Return whether the column's datatype is a LOB type
- * (i.e. BLOB, CLOB, or NCLOB).
- */
- boolean isLOB();
-
-
- // ********** Java type **********
-
- /**
- * Return a Java type declaration that is reasonably
- * similar to the column's data type.
- */
- String getJavaTypeDeclaration();
-
- /**
- * Return a Java type that is reasonably
- * similar to the column's data type.
- */
- JavaType getJavaType();
-
- /**
- * Return a Java type declaration that is reasonably
- * similar to the column's data type and suitable for use as a
- * primary key field.
- */
- String getPrimaryKeyJavaTypeDeclaration();
-
- /**
- * Return a Java type that is reasonably
- * similar to the column's data type and suitable for use as a
- * primary key field.
- */
- JavaType getPrimaryKeyJavaType();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionAdapter.java
deleted file mode 100644
index 22e3d7d663..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionAdapter.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * An empty implementation of {@link ConnectionListener}.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class ConnectionAdapter
- implements ConnectionListener
-{
- public void aboutToClose(ConnectionProfile profile) {
- // do nothing
- }
-
- public void closed(ConnectionProfile profile) {
- // do nothing
- }
-
- public void databaseChanged(ConnectionProfile profile, Database database) {
- // do nothing
- }
-
- public void modified(ConnectionProfile profile) {
- // do nothing
- }
-
- public boolean okToClose(ConnectionProfile profile) {
- return true;
- }
-
- public void opened(ConnectionProfile profile) {
- // do nothing
- }
-
- public void catalogChanged(ConnectionProfile profile, Catalog catalog) {
- // do nothing
- }
-
- public void schemaChanged(ConnectionProfile profile, Schema schema) {
- // do nothing
- }
-
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence) {
- // do nothing
- }
-
- public void tableChanged(ConnectionProfile profile, Table table) {
- // do nothing
- }
-
- public void columnChanged(ConnectionProfile profile, Column column) {
- // do nothing
- }
-
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey) {
- // do nothing
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionListener.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionListener.java
deleted file mode 100644
index 5cb9129aa4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionListener.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.util.EventListener;
-
-/**
- * A <code>ConnectionListener</code> is notified of any changes to a connection.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @see org.eclipse.datatools.connectivity.IManagedConnectionListener
- */
-public interface ConnectionListener
- extends EventListener
-{
- public void opened(ConnectionProfile profile);
- public void modified(ConnectionProfile profile);
- public boolean okToClose(ConnectionProfile profile);
- public void aboutToClose(ConnectionProfile profile);
- public void closed(ConnectionProfile profile);
-
- public void databaseChanged(ConnectionProfile profile, Database database);
- public void catalogChanged(ConnectionProfile profile, Catalog catalog);
- public void schemaChanged(ConnectionProfile profile, Schema schema);
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence);
- public void tableChanged(ConnectionProfile profile, Table table);
- public void columnChanged(ConnectionProfile profile, Column column);
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfile.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfile.java
deleted file mode 100644
index a8815874ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfile.java
+++ /dev/null
@@ -1,219 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.sql.Connection;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-
-/**
- * Database connection profile
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ConnectionProfile
- extends DatabaseObject
-{
- // ********** properties **********
-
- /**
- * Return the connection profile's database.
- * Return <code>null</code> if the connection profile is inactive.
- */
- Database getDatabase();
-
- /**
- * Return ID of the provider managing the DTP profile.
- */
- String getProviderID();
-
- /**
- * Return the connection profile's static ID.
- */
- String getInstanceID();
-
- /**
- * Return the default database name.
- */
- String getDatabaseName();
-
- /**
- * Return the database product name.
- */
- String getDatabaseProduct();
-
- /**
- * Return the database vendor.
- */
- String getDatabaseVendor();
-
- /**
- * Return the database version.
- */
- String getDatabaseVersion();
-
- /**
- * Return the driver class name.
- */
- String getDriverClassName();
-
- /**
- * Return the default connection URL.
- */
- String getURL();
-
- /**
- * Return the default user name.
- */
- String getUserName();
-
- /**
- * Return the default user password.
- */
- String getUserPassword();
-
- /**
- * Return the ID of the associated Driver definition.
- */
- String getDriverDefinitionID();
-
- /**
- * Return the jar list for the associated Driver as a
- * comma-delimited string.
- */
- String getDriverJarList();
-
- /**
- * Return the name of the associated Driver definition.
- */
- String getDriverName();
-
-
- // ********** identifiers **********
-
- /**
- * Return whether all identifiers are to be treated as though they were
- * delimited. This is determined by the client-supplied database
- * identifier adapter.
- */
- boolean treatIdentifiersAsDelimited();
-
-
- // ********** connection **********
-
- /**
- * Return whether the profile is either connected to a live database
- * session or working off-line (i.e. it has access to meta-data).
- * @see #isConnected()
- * @see #isWorkingOffline()
- */
- boolean isActive();
-
- /**
- * Return whether the profile is neither connected to a live database
- * session nor working off-line (i.e. it has access to meta-data).
- * @see #isActive()
- */
- boolean isInactive();
-
- /**
- * Return whether the profile is connected to a live database session
- * (i.e. the meta-data comes from the database), as opposed to working
- * off-line.
- * @see #isActive()
- */
- boolean isConnected();
-
- /**
- * Return whether the profile is not connected to a live database session
- * (i.e. the meta-data comes from the database), as opposed to working
- * off-line.
- * @see #isConnected()
- */
- boolean isDisconnected();
-
- /**
- * Connect to the database.
- * @see #disconnect()
- */
- void connect();
-
- /**
- * Disconnect from the database.
- * @see #connect()
- */
- void disconnect();
-
- /**
- * Return the JDBC connection.
- */
- Connection getJDBCConnection();
-
-
- // ********** off-line support **********
-
- /**
- * Return whether the profile is working off-line (i.e. the meta-data
- * comes from a local cache), as opposed to connected to a live
- * database session.
- * @see #isActive()
- */
- boolean isWorkingOffline();
-
- /**
- * Return whether the connection factories associated with the
- * connection profile's provider support working offline.
- */
- boolean supportsWorkOfflineMode();
-
- /**
- * Save the state of the connection profile for working in an offline mode.
- * If the connection profile does not support working in an offline mode, no
- * exception is thrown and the method will return immediately.
- */
- IStatus saveWorkOfflineData();
-
- /**
- * Return whether the connection profile supports working offline and data
- * has been saved for working offline.
- */
- boolean canWorkOffline();
-
- /**
- * Begin working off-line.
- */
- IStatus workOffline();
-
-
- // ********** listeners **********
-
- /**
- * Add the specified connection listener to the connection profile.
- */
- void addConnectionListener(ConnectionListener listener);
-
- /**
- * Remove the specified connection listener from the connection profile.
- */
- void removeConnectionListener(ConnectionListener listener);
-
-
- // ********** constants **********
-
- String CONNECTION_PROFILE_TYPE = "org.eclipse.datatools.connectivity.db.generic.connectionProfile"; //$NON-NLS-1$
- String DRIVER_DEFINITION_PROP_ID = "org.eclipse.datatools.connectivity.driverDefinitionID"; //$NON-NLS-1$
- String DRIVER_DEFINITION_TYPE_PROP_ID = "org.eclipse.datatools.connectivity.drivers.defnType"; //$NON-NLS-1$
- String DRIVER_JAR_LIST_PROP_ID = "jarList"; //$NON-NLS-1$
- String DATABASE_SAVE_PWD_PROP_ID = IJDBCDriverDefinitionConstants.PROP_PREFIX + "savePWD"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileAdapter.java
deleted file mode 100644
index ecf4a98e1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileAdapter.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * An empty implementation of {@link ConnectionProfileListener}.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class ConnectionProfileAdapter
- implements ConnectionProfileListener
-{
- public void connectionProfileAdded(String name) {
- // do nothing
- }
-
- public void connectionProfileRemoved(String name) {
- // do nothing
- }
-
- public void connectionProfileRenamed(String oldName, String newName) {
- // do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileFactory.java
deleted file mode 100644
index e31521820c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database connection profile factory
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ConnectionProfileFactory {
-
- /**
- * Return the names of the DTP connection profiles the factory can wrap with
- * new connection profiles.
- */
- Iterable<String> getConnectionProfileNames();
-
- /**
- * Build and return a connection profile that wraps the DTP connection
- * profile with the specified name.
- * Return <code>null</code> if there is no DTP connection profile with the
- * specified name.
- * Use the specified database identifier adapter to allow clients to control how
- * database identifiers are handled.
- */
- ConnectionProfile buildConnectionProfile(String name, DatabaseIdentifierAdapter adapter);
-
- /**
- * Build and return a connection profile that wraps the DTP connection
- * profile with the specified name.
- * Return <code>null</code> if there is no DTP connection profile with the
- * specified name.
- * <p>
- * Clients should use this method when a JPA platform is unavailable
- * (e.g. during project creation). The returned connection profile will
- * use the default database identifier adapter.
- */
- ConnectionProfile buildConnectionProfile(String name);
-
- /**
- * Add a listener that will be notified of changes to the DTP
- * connection profiles.
- */
- void addConnectionProfileListener(ConnectionProfileListener listener);
-
- /**
- * Remove the specified listener.
- */
- void removeConnectionProfileListener(ConnectionProfileListener listener);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileListener.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileListener.java
deleted file mode 100644
index c7eb1e5236..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ConnectionProfileListener.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.util.EventListener;
-
-/**
- * A <code>ProfileListener</code> is notified of any changes to the DTP connection profiles.
- * <p>
- * @see org.eclipse.datatools.connectivity.IProfileListener
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ConnectionProfileListener
- extends EventListener
-{
- /**
- * The specified profile has been added.
- */
- public void connectionProfileAdded(String name);
-
- /**
- * The specified profile has been removed.
- */
- public void connectionProfileRemoved(String name);
-
- /**
- * The specified profile has been renamed.
- */
- public void connectionProfileRenamed(String oldName, String newName);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Database.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Database.java
deleted file mode 100644
index 11c486fbf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Database.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Database
- extends SchemaContainer
-{
- /**
- * Return the database's DTP database.
- */
- org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase();
-
-
- // ********** properties **********
-
- /**
- * Return the name of the database's vendor.
- */
- String getVendorName();
-
- /**
- * Return the database's version.
- */
- String getVersion();
-
-
- // ********** catalogs **********
-
- /**
- * Return whether the database supports catalogs. If it does, all database
- * objects are contained by the database's catalogs; otherwise all database
- * objects are contained by the database's schemata.
- * <br>
- * Practically speaking:<ul>
- * <li>If {@link #supportsCatalogs()} returns <code>true</code><ul>
- * <li>{@link #getCatalogs()} returns catalogs that contain the database's schemata
- * <li>{@link #getSchemata()} returns an empty iterable
- * </ul>
- * <li>else<ul>
- * <li>{@link #getCatalogs()} returns an empty iterable
- * <li>{@link #getSchemata()} returns the database's schemata
- * </ul>
- * </ul>
- * This is complicated by the presence of a "default" catalog that clients can
- * use to allow the specification of a catalog to be optional; but clients
- * must manage this explicitly.
- * @see #getCatalogs()
- * @see #getSchemata()
- */
- boolean supportsCatalogs();
-
- /**
- * Return the database's catalogs.
- * Return an empty iterable if the database does not support catalogs.
- * @see #supportsCatalogs()
- */
- Iterable<Catalog> getCatalogs();
-
- /**
- * Return the number of catalogs the database contains.
- * Return zero if the database does not support catalogs.
- * @see #supportsCatalogs()
- */
- int getCatalogsSize();
-
- /**
- * Return the database's catalog names, sorted.
- * Return an empty iterable if the database does not support catalogs.
- * This is useful when the user is selecting a catalog from a read-only
- * combo-box (e.g. in a wizard).
- * @see #getSortedCatalogIdentifiers()
- * @see #getCatalogNamed(String)
- */
- Iterable<String> getSortedCatalogNames();
-
- /**
- * Return the catalog with the specified name. The name must be an exact match
- * of the catalog's name.
- * Return <code>null</code> if the database does not support catalogs.
- * @see #supportsCatalogs()
- * @see #getSortedCatalogNames()
- * @see #getCatalogForIdentifier(String)
- */
- Catalog getCatalogNamed(String name);
-
- /**
- * Return the database's catalog identifiers, sorted by name.
- * Return an empty iterable if the database does not support catalogs.
- * This is useful when the user is selecting an identifier that will be
- * placed in a text file (e.g. in a Java annotation).
- * @see #getSortedCatalogNames()
- * @see #getCatalogForIdentifier(String)
- */
- Iterable<String> getSortedCatalogIdentifiers();
-
- /**
- * Return the catalog for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * Return <code>null</code> if the database does not support catalogs.
- * @see #supportsCatalogs()
- * @see #getSortedCatalogIdentifiers()
- * @see #getCatalogNamed(String)
- */
- Catalog getCatalogForIdentifier(String identifier);
-
- /**
- * Return the database's default catalog, as defined by the database vendor.
- * In most cases the default catalog's name will match the user name.
- * Return <code>null</code> if the database does not support catalogs or
- * if the default catalog does not exist (e.g. the database has no catalog
- * whose name matches the user name).
- * @see #supportsCatalogs()
- * @see #getDefaultCatalogIdentifier()
- */
- Catalog getDefaultCatalog();
-
- /**
- * Return the database's default catalog identifier.
- * The database may or may not have a catalog with a matching name.
- * @see #supportsCatalogs()
- * @see #getDefaultCatalog()
- */
- String getDefaultCatalogIdentifier();
-
-
- // ********** utility methods **********
-
- /**
- * Select and return from the specified list of tables the
- * table identified by the specified identifier.
- * The identifier should be an SQL identifier (i.e. delimited as
- * appropriate).
- */
- Table selectTableForIdentifier(Iterable<Table> tables, String identifier);
-
- /**
- * Convert the specified name to a database-appropriate SQL identifier
- * (i.e. delimit the name as appropriate).
- */
- // it seems we don't need database object-specific conversions here;
- // i.e. separate methods for tables, columns, etc.
- String convertNameToIdentifier(String name);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseIdentifierAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseIdentifierAdapter.java
deleted file mode 100644
index 7fc173d53e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseIdentifierAdapter.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * This interface allows clients of the Dali db package to control whether
- * database identifiers are to be treated as though they are delimited, which,
- * most significantly, usually means the identifiers are case-sensitive.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DatabaseIdentifierAdapter {
-
- /**
- * Return whether identifiers are to be treated as though they were
- * delimited.
- */
- boolean treatIdentifiersAsDelimited();
-
-
- /**
- * This adapter simply returns <code>false</code>, which is compatible
- * with JPA 1.0.
- */
- final class Default
- implements DatabaseIdentifierAdapter
- {
- public static final DatabaseIdentifierAdapter INSTANCE = new Default();
- public static DatabaseIdentifierAdapter instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- public boolean treatIdentifiersAsDelimited() {
- return false; // JPA 1.0
- }
- @Override
- public String toString() {
- return StringTools.buildSingletonToString(this);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseObject.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseObject.java
deleted file mode 100644
index e20a54084b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/DatabaseObject.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.util.Comparator;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import com.ibm.icu.text.Collator;
-
-/**
- * Behavior common to all database objects.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DatabaseObject {
-
- /**
- * Return the database object's name.
- */
- String getName();
-
- /**
- * Return the database object's <em>identifier</em>, which is the object's name
- * modified so it can be used in an SQL statement (e.g. if the name contains
- * special characters or is mixed case, it will be delimited, typically by
- * double-quotes).
- */
- String getIdentifier();
-
- /**
- * Return the database object's <em>identifier</em>, which is the object's name
- * modified so it can be used in an SQL statement (e.g. if the name contains
- * special characters or is mixed case, it will be delimited, typically by
- * double-quotes).
- * Return <code>null</code> if the database object's identifier matches the
- * specified default name.
- * <p>
- * This is used by the Dali entity generation code to determine whether
- * a generated annotation must explicitly identify a database object
- * (e.g. a table) or the default (as specified here) adequately identifies
- * the database object (taking into consideration case-sensitivity,
- * special characters, etc.).
- */
- String getIdentifier(String defaultName);
-
- /**
- * Return the database object's database.
- */
- Database getDatabase();
-
- /**
- * Return the database object's connection profile.
- */
- ConnectionProfile getConnectionProfile();
-
-
- /**
- * Sort by name.
- */
- Comparator<DatabaseObject> DEFAULT_COMPARATOR =
- new Comparator<DatabaseObject>() {
- public int compare(DatabaseObject dbObject1, DatabaseObject dbObject2) {
- return Collator.getInstance().compare(dbObject1.getName(), dbObject2.getName());
- }
- @Override
- public String toString() {
- return this.getClass().getEnclosingClass().getSimpleName() + ".DEFAULT_COMPARATOR"; //$NON-NLS-1$
- }
- };
-
- Transformer<DatabaseObject, String> NAME_TRANSFORMER =
- new Transformer<DatabaseObject, String>() {
- public String transform(DatabaseObject dbObject) {
- return dbObject.getName();
- }
- @Override
- public String toString() {
- return this.getClass().getEnclosingClass().getSimpleName() + ".NAME_TRANSFORMER"; //$NON-NLS-1$
- }
- };
-
- Transformer<DatabaseObject, String> IDENTIFIER_TRANSFORMER =
- new Transformer<DatabaseObject, String>() {
- public String transform(DatabaseObject dbObject) {
- return dbObject.getIdentifier();
- }
- @Override
- public String toString() {
- return this.getClass().getEnclosingClass().getSimpleName() + ".IDENTIFIER_TRANSFORMER"; //$NON-NLS-1$
- }
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ForeignKey.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ForeignKey.java
deleted file mode 100644
index 47c0abcda3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/ForeignKey.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import java.util.Comparator;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * Database foreign key
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ForeignKey
- extends DatabaseObject
-{
- // ********** tables **********
-
- /**
- * Return the foreign key's <em>base</em> table.
- */
- Table getBaseTable();
-
- /**
- * Return the foreign key's <em>referenced</em> table.
- */
- Table getReferencedTable();
-
-
- // ********** column pairs **********
-
- /**
- * Return the foreign key's column pairs.
- */
- Iterable<ColumnPair> getColumnPairs();
-
- /**
- * Return the size of the foreign key's column pairs.
- */
- int getColumnPairsSize();
-
- /**
- * Return the foreign key's single column pair. Throw an
- * {@link IllegalStateException} if the foreign key has more than one column pair.
- */
- ColumnPair getColumnPair();
-
- /**
- * Return the foreign key's <em>base</em> columns.
- */
- Iterable<Column> getBaseColumns();
-
- /**
- * Return the foreign key's <em>base</em> columns that are not part of the base
- * table's primary key. (The non-primary key base columns are not used to
- * generate basic attributes during entity generation.)
- */
- Iterable<Column> getNonPrimaryKeyBaseColumns();
-
- /**
- * Return the foreign key's <em>referenced</em> columns.
- */
- Iterable<Column> getReferencedColumns();
-
- /**
- * Return whether the foreign key references the primary key of the
- * <em>referenced</em> table and that primary key has only a single column.
- * This can be used when determining JPA defaults.
- */
- boolean referencesSingleColumnPrimaryKey();
-
-
- // ********** JPA support **********
-
- /**
- * Return an appropriate name for an attribute that holds the entity
- * mapped to the foreign key's <em>referenced</em> table.
- */
- String getAttributeName();
-
- /**
- * If the name of the <em>base</em> column adheres to the JPA spec for a
- * default mapping (i.e. it ends with an underscore followed by the name
- * of the <em>referenced</em> column, and the <em>referenced</em> column is the single
- * primary key column of the <em>referenced</em> table), return the corresponding
- * default attribute name:<pre>
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * </pre>
- * Return <code>null</code> if it does not adhere to the JPA spec:<pre>
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.CUBICLE_ID) => null
- * ForeignKey(EMP.CUBICLE => CUBICLE.ID) => null
- * </pre>
- */
- String getDefaultAttributeName();
-
- /**
- * Given the name of an attribute (field or property) that is mapped to the
- * foreign key, build and return a string to be used as the value for the
- * attribute's <code>@javax.persistence.JoinColumn</code> annotation's
- * <code>name</code> element. Return <code>null</code> if the attribute
- * maps to the join column by default.
- * <p>
- * Precondition: The foreign key consists of a single column pair whose
- * referenced column is the single-column primary key of the foreign
- * key's referenced table.
- * <p>
- * This is used by the entity generation code to determine whether
- * a generated annotation must explicitly identify the join column
- * or the calculated default adequately identifies the join column
- * (taking into consideration case-sensitivity, special characters, etc.).
- */
- String getJoinColumnAnnotationIdentifier(String attributeName);
-
-
- // ********** column pair interface **********
-
- /**
- * Pair up the foreign key's column pairs, matching each <em>base</em> column with
- * the appropriate <em>referenced</em> column.
- * @see #getColumnPairs()
- */
- interface ColumnPair {
-
- /**
- * Return the column pair's <em>base</em> column.
- */
- Column getBaseColumn();
-
- /**
- * Return the column pair's <em>referenced</em> column.
- */
- Column getReferencedColumn();
-
- Comparator<ColumnPair> BASE_COLUMN_COMPARATOR =
- new Comparator<ColumnPair>() {
- public int compare(ColumnPair cp1, ColumnPair cp2) {
- return Collator.getInstance().compare(cp1.getBaseColumn().getName(), cp2.getBaseColumn().getName());
- }
- @Override
- public String toString() {
- return "ForeignKey.ColumnPair.BASE_COLUMN_COMPARATOR"; //$NON-NLS-1$
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/JptJpaDbPlugin.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/JptJpaDbPlugin.java
deleted file mode 100644
index 473ab86097..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/JptJpaDbPlugin.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.datatools.enablement.jdt.classpath.DriverClasspathContainer;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jpt.jpa.db.internal.DTPConnectionProfileFactory;
-import org.osgi.framework.BundleContext;
-
-/**
- * The Dali JPA DB plug-in lifecycle implementation.
- * Globally available connection profile factory.
- * <p>
- * Provisional API: This class is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public class JptJpaDbPlugin
- extends Plugin
-{
- // lazy-initialized
- private DTPConnectionProfileFactory connectionProfileFactory;
-
- private static JptJpaDbPlugin INSTANCE; // sorta-final
-
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.db"; //$NON-NLS-1$
-
- /**
- * Return the singleton JPT DB plug-in.
- */
- public static JptJpaDbPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- public static ConnectionProfileFactory getConnectionProfileFactory() {
- return INSTANCE.getConnectionProfileFactory_();
- }
-
-
- // ********** logging **********
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(msg, null);
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(throwable.getLocalizedMessage(), throwable);
- }
-
- /**
- * Log the specified message and exception or error.
- */
- public static void log(String msg, Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, throwable));
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
-
- // ********** plug-in implementation **********
-
- /**
- * The constructor
- */
- public JptJpaDbPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- // the connection profile factory is lazy-initialized...
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- if (this.connectionProfileFactory != null) {
- this.connectionProfileFactory.stop();
- this.connectionProfileFactory = null;
- }
- INSTANCE = null;
- super.stop(context);
- }
-
- private synchronized ConnectionProfileFactory getConnectionProfileFactory_() {
- if (this.connectionProfileFactory == null) {
- this.connectionProfileFactory = this.buildConnectionProfileFactory();
- this.connectionProfileFactory.start();
- }
- return this.connectionProfileFactory;
- }
-
- private DTPConnectionProfileFactory buildConnectionProfileFactory() {
- return DTPConnectionProfileFactory.instance();
- }
-
- /**
- * Creates a jar list container for the given DTP driver.
- */
- public IClasspathContainer buildDriverClasspathContainerFor(String driverName) {
- return new DriverClasspathContainer(driverName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Schema.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Schema.java
deleted file mode 100644
index 9ae336fe27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Schema.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database schema
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Schema
- extends DatabaseObject
-{
- /**
- * Return the schema's container; either a catalog or a database.
- */
- SchemaContainer getContainer();
-
-
- // ********** tables **********
-
- /**
- * Return the schema's tables.
- */
- Iterable<Table> getTables();
-
- /**
- * Return the number of tables the schema contains.
- */
- int getTablesSize();
-
- /**
- * Return the table with the specified name. The name must be an exact match
- * of the table's name.
- * @see #getTableForIdentifier(String)
- */
- Table getTableNamed(String name);
-
- /**
- * Return the schema's table identifiers, sorted by name.
- * @see #getTableForIdentifier(String)
- */
- Iterable<String> getSortedTableIdentifiers();
-
- /**
- * Return the table for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getTableNamed(String)
- * @see #getSortedTableIdentifiers()
- */
- Table getTableForIdentifier(String identifier);
-
-
- // ********** sequences **********
-
- /**
- * Return the schema's sequences.
- */
- Iterable<Sequence> getSequences();
-
- /**
- * Return the number of sequences the schema contains.
- */
- int getSequencesSize();
-
- /**
- * Return the sequence with the specified name. The name must be an exact match
- * of the sequence's name.
- * @see #getSequenceForIdentifier(String)
- */
- Sequence getSequenceNamed(String name);
-
- /**
- * Return the schema's sequence identifers, sorted by name.
- * @see #getSequenceForIdentifier(String)
- */
- Iterable<String> getSortedSequenceIdentifiers();
-
- /**
- * Return the sequence for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getSequenceNamed(String)
- * @see #getSortedSequenceIdentifiers()
- */
- Sequence getSequenceForIdentifier(String identifier);
-
- // ********** sequences **********
-
- void refresh();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/SchemaContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/SchemaContainer.java
deleted file mode 100644
index 9f3fad1acb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/SchemaContainer.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Schema container (i.e. Database or Catalog)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface SchemaContainer
- extends DatabaseObject
-{
- /**
- * Return the container's schemata.
- */
- Iterable<Schema> getSchemata();
-
- /**
- * Return the number of schemata in the container.
- */
- int getSchemataSize();
-
- /**
- * Return the container's schema names, sorted.
- * This is useful when the user is selecting a schema from a read-only
- * combo-box (e.g. in a wizard).
- * @see #getSchemaNamed(String)
- * @see #getSortedSchemaIdentifiers()
- */
- Iterable<String> getSortedSchemaNames();
-
- /**
- * Return the schema with the specified name. The name must be an exact match
- * of the schema's name.
- * @see #getSortedSchemaNames()
- * @see #getSchemaForIdentifier(String)
- */
- Schema getSchemaNamed(String name);
-
- /**
- * Return the container's schema identifiers, sorted by name.
- * This is useful when the user is selecting an identifier that will be
- * placed in a text file (e.g. in a Java annotation).
- * @see #getSchemaForIdentifier(String)
- * @see #getSortedSchemaNames()
- */
- Iterable<String> getSortedSchemaIdentifiers();
-
- /**
- * Return the schema for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getSortedSchemaIdentifiers()
- * @see #getSchemaNamed(String)
- */
- Schema getSchemaForIdentifier(String identifier);
-
- /**
- * Return the container's default schema, as defined by the database vendor.
- * In most cases the default schema's name will match the user name.
- * Return <code>null</code> if the default schema does not exist (e.g. the
- * container has no schema whose name matches the user name).
- * @see #getDefaultSchemaIdentifier()
- */
- Schema getDefaultSchema();
-
- /**
- * Return the container's default schema identifier.
- * The container may or may not have a schema with a matching name.
- * @see #getDefaultSchema()
- */
- String getDefaultSchemaIdentifier();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Sequence.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Sequence.java
deleted file mode 100644
index 886c728fc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Sequence.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database sequence
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Sequence
- extends DatabaseObject
-{
- /**
- * Return the sequence's schema.
- */
- Schema getSchema();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Table.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Table.java
deleted file mode 100644
index aa2258ab75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/Table.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db;
-
-/**
- * Database table
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface Table
- extends DatabaseObject
-{
- /**
- * Return the table's schema.
- */
- Schema getSchema();
-
-
- // ********** columns **********
-
- /**
- * Return the table's columns.
- */
- Iterable<Column> getColumns();
-
- /**
- * Return the number of columns the table contains.
- */
- int getColumnsSize();
-
- /**
- * Return the column with the specified name. The name must be an exact match
- * of the column's name.
- * @see #getColumnForIdentifier(String)
- */
- Column getColumnNamed(String name);
-
- /**
- * Return the table's column identifers, sorted by name.
- * @see #getColumnForIdentifier(String)
- */
- Iterable<String> getSortedColumnIdentifiers();
-
- /**
- * Return the column for the specified identifier. The identifier should
- * be an SQL identifier (i.e. quoted when case-sensitive or containing
- * special characters, unquoted otherwise).
- * @see #getColumnNamed(String)
- * @see #getSortedColumnIdentifiers()
- */
- Column getColumnForIdentifier(String identifier);
-
-
- // ********** primary key columns **********
-
- /**
- * Return the table's primary key columns.
- */
- Iterable<Column> getPrimaryKeyColumns();
-
- /**
- * Return the number of primary key columns the table contains.
- */
- int getPrimaryKeyColumnsSize();
-
- /**
- * Return the table's single primary key column. Throw an
- * {@link IllegalStateException} if the table has more than one primary key column.
- */
- Column getPrimaryKeyColumn();
-
-
- // ********** foreign keys **********
-
- /**
- * Return the table's foreign keys.
- */
- Iterable<ForeignKey> getForeignKeys();
-
- /**
- * Return the number of foreign keys the table contains.
- */
- int getForeignKeysSize();
-
-
- // ********** join table support **********
-
- /**
- * Return whether the table is possibly a <em>join</em> table
- * (i.e. it contains only 2 foreign keys). Whether the table <em>actually</em> is
- * a <em>join</em> table is determined by the semantics of the database design.
- */
- boolean isPossibleJoinTable();
-
- /**
- * Assuming the table is a <em>join</em> table, return the foreign key to the
- * <em>owning</em> table.
- * @see #isPossibleJoinTable()
- */
- ForeignKey getJoinTableOwningForeignKey();
-
- /**
- * Assuming the table is a <em>join</em> table, return the foreign key to the
- * <em>non-owning</em> table.
- * @see #isPossibleJoinTable()
- */
- ForeignKey getJoinTableNonOwningForeignKey();
-
- /**
- * Assuming the table is a <em>join</em> table, return whether its name matches
- * the JPA default (i.e. <code>"OWNINGTABLE_NONOWNINGTABLE"</code>).
- * @see #isPossibleJoinTable()
- */
- boolean joinTableNameIsDefault();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPCatalogWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPCatalogWrapper.java
deleted file mode 100644
index 8773036640..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPCatalogWrapper.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.List;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Catalog;
-
-/**
- * Wrap a DTP Catalog
- */
-final class DTPCatalogWrapper
- extends DTPSchemaContainerWrapper<DTPDatabaseWrapper>
- implements Catalog
-{
- /** the wrapped DTP catalog */
- private final org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog;
-
-
- // ********** constructor **********
-
- DTPCatalogWrapper(DTPDatabaseWrapper database, org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) {
- super(database);
- this.dtpCatalog = dtpCatalog;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpCatalog;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().catalogChanged(this);
- }
-
-
- // ********** DTPSchemaContainerWrapper implementation **********
-
- @Override
- @SuppressWarnings("unchecked")
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas() {
- return this.dtpCatalog.getSchemas();
- }
-
- @Override
- DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- // try to short-circuit the search
- return this.wraps(dtpSchema.getCatalog()) ?
- this.getSchema_(dtpSchema) :
- this.getDatabase().getSchemaFromCatalogs(dtpSchema);
- }
-
- @Override
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- // try to short-circuit the search
- return this.wraps(dtpTable.getSchema().getCatalog()) ?
- this.getTable_(dtpTable) :
- this.getDatabase().getTableFromCatalogs(dtpTable);
- }
-
- @Override
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- // try to short-circuit the search
- return this.wraps(dtpColumn.getTable().getSchema().getCatalog()) ?
- this.getColumn_(dtpColumn) :
- this.getDatabase().getColumnFromCatalogs(dtpColumn);
- }
-
-
- // ********** DatabaseObject implementation **********
-
- public String getName() {
- return this.dtpCatalog.getName();
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.schema.Catalog catalog) {
- return this.dtpCatalog == catalog;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPColumnWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPColumnWrapper.java
deleted file mode 100644
index 4613cab63f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPColumnWrapper.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.modelbase.dbdefinition.PredefinedDataTypeDefinition;
-import org.eclipse.datatools.modelbase.sql.datatypes.CharacterStringDataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.DataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.ExactNumericDataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.NumericalDataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.PredefinedDataType;
-import org.eclipse.datatools.modelbase.sql.datatypes.PrimitiveType;
-import org.eclipse.jpt.common.utility.JavaType;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.SimpleJavaType;
-import org.eclipse.jpt.jpa.db.Column;
-
-/**
- * Wrap a DTP Column
- */
-final class DTPColumnWrapper
- extends DTPDatabaseObjectWrapper<DTPTableWrapper>
- implements Column
-{
- /** the wrapped DTP column */
- private final org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn;
-
-
- // ********** constructor **********
-
- DTPColumnWrapper(DTPTableWrapper table, org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- super(table);
- this.dtpColumn = dtpColumn;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpColumn;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().columnChanged(this);
- }
-
-
- // ********** Column implementation **********
-
- public String getName() {
- return this.dtpColumn.getName();
- }
-
- public DTPTableWrapper getTable() {
- return this.parent;
- }
-
- public boolean isPartOfPrimaryKey() {
- return this.getTable().primaryKeyColumnsContains(this);
- }
-
- public boolean isPartOfForeignKey() {
- return this.getTable().foreignKeyBaseColumnsContains(this);
- }
-
- public boolean isPartOfUniqueConstraint() {
- return this.dtpColumn.isPartOfUniqueConstraint();
- }
-
- public boolean isNullable() {
- return this.dtpColumn.isNullable();
- }
-
- public String getDataTypeName() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType == null) ? null : dataType.getName();
- }
-
- public boolean isNumeric() {
- return this.dtpColumn.getDataType() instanceof NumericalDataType;
- }
-
- public int getPrecision() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof NumericalDataType) ?
- ((NumericalDataType) dataType).getPrecision() :
- -1;
- }
-
- public int getScale(){
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof ExactNumericDataType) ?
- ((ExactNumericDataType) dataType).getScale() :
- -1;
- }
-
- public int getLength() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof CharacterStringDataType) ?
- ((CharacterStringDataType) dataType).getLength() :
- -1;
- }
-
- public boolean isLOB() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof PredefinedDataType) ?
- primitiveTypeIsLob(((PredefinedDataType) dataType).getPrimitiveType()) :
- false;
- }
-
- public String getJavaTypeDeclaration() {
- return this.getJavaType().declaration();
- }
-
- public JavaType getJavaType() {
- DataType dataType = this.dtpColumn.getDataType();
- return (dataType instanceof PredefinedDataType) ?
- convertToJPAJavaType(this.getJavaType((PredefinedDataType) dataType)) :
- DEFAULT_JAVA_TYPE;
- }
-
- public String getPrimaryKeyJavaTypeDeclaration() {
- return this.getPrimaryKeyJavaType().declaration();
- }
-
- public JavaType getPrimaryKeyJavaType() {
- return convertToJPAPrimaryKeyJavaType(this.getJavaType());
- }
-
- private JavaType getJavaType(PredefinedDataType dataType) {
- // this is just a bit hacky: moving from a type declaration to a class name to a type declaration...
- String dtpJavaClassName = this.resolveDefinition(dataType).getJavaClassName();
- return new SimpleJavaType(ReflectionTools.getClassNameForTypeDeclaration(dtpJavaClassName));
- }
-
- private PredefinedDataTypeDefinition resolveDefinition(PredefinedDataType dataType) {
- return this.getDatabase().getDTPDefinition().getPredefinedDataTypeDefinition(dataType.getName());
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.tables.Column column) {
- return this.dtpColumn == column;
- }
-
- @Override
- void clear() {
- // no state to clear
- }
-
-
- // ********** static methods **********
-
- /**
- * The JDBC spec says JDBC drivers should be able to map BLOBs and CLOBs
- * directly, but the JPA spec does not allow them.
- */
- private static JavaType convertToJPAJavaType(JavaType javaType) {
- if (javaType.equals(BLOB_JAVA_TYPE)) {
- return BYTE_ARRAY_JAVA_TYPE;
- }
- if (javaType.equals(CLOB_JAVA_TYPE)) {
- return STRING_JAVA_TYPE;
- }
- return javaType;
- }
-
- /**
- * The JPA spec [2.1.4] says only the following types are allowed in
- * primary key fields:<ul>
- * <li>[variable] primitives
- * <li>[variable] primitive wrappers
- * <li>{@link java.lang.String}
- * <li>{@link java.util.Date}
- * <li>{@link java.sql.Date}
- * </ul>
- */
- private static JavaType convertToJPAPrimaryKeyJavaType(JavaType javaType) {
- if (javaType.isVariablePrimitive()
- || javaType.isVariablePrimitiveWrapper()
- || javaType.equals(STRING_JAVA_TYPE)
- || javaType.equals(UTIL_DATE_JAVA_TYPE)
- || javaType.equals(SQL_DATE_JAVA_TYPE)) {
- return javaType;
- }
- if (javaType.equals(BIG_DECIMAL_JAVA_TYPE)) {
- return LONG_JAVA_TYPE; // ??
- }
- if (javaType.equals(SQL_TIME_JAVA_TYPE)) {
- return UTIL_DATE_JAVA_TYPE; // ???
- }
- if (javaType.equals(SQL_TIMESTAMP_JAVA_TYPE)) {
- return UTIL_DATE_JAVA_TYPE; // ???
- }
- // all the other typical types are pretty much un-mappable - return String(?)
- return STRING_JAVA_TYPE;
- }
-
- private static boolean primitiveTypeIsLob(PrimitiveType primitiveType) {
- return (primitiveType == PrimitiveType.BINARY_LARGE_OBJECT_LITERAL)
- || (primitiveType == PrimitiveType.CHARACTER_LARGE_OBJECT_LITERAL)
- || (primitiveType == PrimitiveType.NATIONAL_CHARACTER_LARGE_OBJECT_LITERAL);
- }
-
-
- // ***** some constants used when converting the column to a Java attribute
- // TODO Object is the default?
- private static final JavaType DEFAULT_JAVA_TYPE = new SimpleJavaType(java.lang.Object.class);
-
- private static final JavaType BLOB_JAVA_TYPE = new SimpleJavaType(java.sql.Blob.class);
- private static final JavaType BYTE_ARRAY_JAVA_TYPE = new SimpleJavaType(byte[].class);
-
- private static final JavaType CLOB_JAVA_TYPE = new SimpleJavaType(java.sql.Clob.class);
- private static final JavaType STRING_JAVA_TYPE = new SimpleJavaType(java.lang.String.class);
-
- private static final JavaType UTIL_DATE_JAVA_TYPE = new SimpleJavaType(java.util.Date.class);
- private static final JavaType SQL_DATE_JAVA_TYPE = new SimpleJavaType(java.sql.Date.class);
- private static final JavaType SQL_TIME_JAVA_TYPE = new SimpleJavaType(java.sql.Time.class);
- private static final JavaType SQL_TIMESTAMP_JAVA_TYPE = new SimpleJavaType(java.sql.Timestamp.class);
-
- private static final JavaType BIG_DECIMAL_JAVA_TYPE = new SimpleJavaType(java.math.BigDecimal.class);
- private static final JavaType LONG_JAVA_TYPE = new SimpleJavaType(long.class);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java
deleted file mode 100644
index c59252543b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileFactory.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IProfileListener1;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.ConnectionProfileFactory;
-import org.eclipse.jpt.jpa.db.ConnectionProfileListener;
-import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
-
-/**
- * Wrap the DTP {@link ProfileManager} in yet another singleton.
- */
-public final class DTPConnectionProfileFactory
- implements ConnectionProfileFactory
-{
- private ProfileManager dtpProfileManager;
-
- private LocalProfileListener profileListener;
-
-
- // ********** singleton **********
-
- private static final DTPConnectionProfileFactory INSTANCE = new DTPConnectionProfileFactory();
-
- public static DTPConnectionProfileFactory instance() {
- return INSTANCE;
- }
-
- /**
- * Access is <code>private</code> to ensure singleton
- */
- private DTPConnectionProfileFactory() {
- super();
- }
-
-
- // ********** lifecycle **********
-
- /**
- * called by plug-in
- */
- public synchronized void start() {
- this.dtpProfileManager = ProfileManager.getInstance();
- this.profileListener = new LocalProfileListener();
- this.dtpProfileManager.addProfileListener(this.profileListener);
- }
-
- /**
- * called by plug-in
- */
- public synchronized void stop() {
- this.dtpProfileManager.removeProfileListener(this.profileListener);
- this.profileListener = null;
- this.dtpProfileManager = null;
- }
-
-
- // ********** connection profiles **********
-
- public synchronized ConnectionProfile buildConnectionProfile(String name, DatabaseIdentifierAdapter adapter) {
- for (IConnectionProfile dtpProfile : this.dtpProfileManager.getProfiles()) {
- if (dtpProfile.getName().equals(name)) {
- return this.buildConnectionProfile(dtpProfile, adapter);
- }
- }
- return null;
- }
-
- private ConnectionProfile buildConnectionProfile(IConnectionProfile dtpProfile, DatabaseIdentifierAdapter adapter) {
- return new DTPConnectionProfileWrapper(dtpProfile, adapter);
- }
-
- public ConnectionProfile buildConnectionProfile(String name) {
- return this.buildConnectionProfile(name, DatabaseIdentifierAdapter.Default.instance());
- }
-
- public Iterable<String> getConnectionProfileNames() {
- return new TransformationIterable<IConnectionProfile, String>(this.getDTPConnectionProfiles()) {
- @Override
- protected String transform(IConnectionProfile dtpProfile) {
- return dtpProfile.getName();
- }
- };
- }
-
- private synchronized Iterable<IConnectionProfile> getDTPConnectionProfiles() {
- return new ArrayIterable<IConnectionProfile>(this.dtpProfileManager.getProfiles());
- }
-
-
- // ********** listeners **********
-
- public void addConnectionProfileListener(ConnectionProfileListener listener) {
- this.profileListener.addConnectionProfileListener(listener);
- }
-
- public void removeConnectionProfileListener(ConnectionProfileListener listener) {
- this.profileListener.removeConnectionProfileListener(listener);
- }
-
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-
- // ********** listener **********
-
- /**
- * Forward events to the factory's listeners.
- */
- private static class LocalProfileListener
- implements IProfileListener1
- {
- private final ListenerList<ConnectionProfileListener> listenerList = new ListenerList<ConnectionProfileListener>(ConnectionProfileListener.class);
-
- LocalProfileListener() {
- super();
- }
-
- void addConnectionProfileListener(ConnectionProfileListener listener) {
- this.listenerList.add(listener);
- }
-
- void removeConnectionProfileListener(ConnectionProfileListener listener) {
- this.listenerList.remove(listener);
- }
-
-
- // ********** IProfileListener implementation **********
-
- public void profileAdded(IConnectionProfile dtpProfile) {
- String name = dtpProfile.getName();
- for (ConnectionProfileListener listener : this.listenerList.getListeners()) {
- listener.connectionProfileAdded(name);
- }
- }
-
- public void profileChanged(IConnectionProfile dtpProfile, String oldName, String oldDescription, Boolean oldAutoConnect) {
- String newName = dtpProfile.getName();
- if ( ! newName.equals(oldName)) {
- for (ConnectionProfileListener listener : this.listenerList.getListeners()) {
- listener.connectionProfileRenamed(oldName, newName);
- }
- }
- }
-
- public void profileChanged(IConnectionProfile dtpProfile) {
- // this method shouldn't be called on IProfileListener1
- throw new UnsupportedOperationException();
- }
-
- public void profileDeleted(IConnectionProfile dtpProfile) {
- String name = dtpProfile.getName();
- for (ConnectionProfileListener listener : this.listenerList.getListeners()) {
- listener.connectionProfileRemoved(name);
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java
deleted file mode 100644
index f07551a360..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPConnectionProfileWrapper.java
+++ /dev/null
@@ -1,537 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.sql.Connection;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.datatools.connectivity.ConnectEvent;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.IManagedConnection;
-import org.eclipse.datatools.connectivity.IManagedConnectionOfflineListener;
-import org.eclipse.datatools.connectivity.drivers.DriverManager;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.sqm.core.connection.ConnectionInfo;
-import org.eclipse.datatools.sqltools.core.DatabaseIdentifier;
-import org.eclipse.datatools.sqltools.core.profile.ProfileUtil;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.ConnectionListener;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
-
-/**
- * Wrap a DTP {@link IConnectionProfile}
- */
-final class DTPConnectionProfileWrapper
- implements DTPDatabaseObject, ConnectionProfile
-{
- /** the wrapped DTP connection profile */
- private final IConnectionProfile dtpConnectionProfile;
-
- /** adapter supplied by the client (determines identifier delimiters) */
- private final DatabaseIdentifierAdapter identifierAdapter;
-
- /** the DTP managed connection we listen to */
- private final IManagedConnection dtpManagedConnection;
-
- /**
- * forward events from the DTP managed connection above;
- * we listen and propagate events iff we have listeners ourselves
- */
- private final LocalConnectionListener connectionListener;
-
- /** lazy-initialized, and deleted at disconnect */
- private DTPDatabaseWrapper database;
-
-
- // ********** constants **********
-
- private static final String LIVE_DTP_CONNECTION_TYPE = java.sql.Connection.class.getName();
-
- private static final String OFFLINE_DTP_CONNECTION_TYPE = ConnectionInfo.class.getName();
-
- private static final String DATABASE_PRODUCT_PROP_ID = "org.eclipse.datatools.connectivity.server.version"; //$NON-NLS-1$
-
-
- // ********** constructor **********
-
- DTPConnectionProfileWrapper(IConnectionProfile dtpConnectionProfile, DatabaseIdentifierAdapter identifierAdapter) {
- super();
- this.dtpConnectionProfile = dtpConnectionProfile;
- this.identifierAdapter = identifierAdapter;
- this.dtpManagedConnection = this.buildDTPManagedConnection();
- this.connectionListener = new LocalConnectionListener();
- // don't listen to the managed connection yet
- }
-
- private IManagedConnection buildDTPManagedConnection() {
- return this.dtpConnectionProfile.getManagedConnection(this.getDTPConnectionType());
- }
-
- private String getDTPConnectionType() {
- return this.dtpConnectionProfile.supportsWorkOfflineMode() ?
- OFFLINE_DTP_CONNECTION_TYPE :
- LIVE_DTP_CONNECTION_TYPE;
- }
-
-
- // ********** DatabaseObject implementation **********
-
- public String getName() {
- return this.dtpConnectionProfile.getName();
- }
-
- public String getIdentifier(String javaIdentifier) {
- // connection profiles do not have "identifiers"
- throw new UnsupportedOperationException();
- }
-
- public String getIdentifier() {
- // connection profiles do not have "identifiers"
- throw new UnsupportedOperationException();
- }
-
-
- // ********** DTPDatabaseObject implementation **********
-
- public DTPConnectionProfileWrapper getConnectionProfile() {
- return this;
- }
-
- public synchronized DTPDatabaseWrapper getDatabase() {
- if (this.database == null) {
- this.database = this.buildDatabase();
- }
- return this.database;
- }
-
-
- // ********** ConnectionProfile implementation **********
-
- // ***** properties
- public String getProviderID() {
- return this.dtpConnectionProfile.getProviderId();
- }
-
- public String getInstanceID() {
- return this.dtpConnectionProfile.getInstanceID();
- }
-
- public String getDatabaseName() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DATABASE_NAME_PROP_ID);
- }
-
- public String getDatabaseProduct() {
- return this.getProperty(DATABASE_PRODUCT_PROP_ID);
- }
-
- public String getDatabaseVendor() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID);
- }
-
- public String getDatabaseVersion() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID);
- }
-
- public String getDriverClassName() {
- return this.getProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID);
- }
-
- public String getURL() {
- return this.getProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID);
- }
-
- public String getUserName() {
- String userName = this.getProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID);
- return this.extractUserName(userName.trim());
- }
-
- private String extractUserName(String userName) {
- String[] strings = userName.split("\\s+"); //$NON-NLS-1$
- // bug 208946 handle username like "sys as sysdba" on Oracle
- if ((strings.length == 3) && strings[1].equalsIgnoreCase("as")) { //$NON-NLS-1$
- return strings[0];
- }
- return userName;
- }
-
- public String getUserPassword() {
- return this.getProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID);
- }
-
- public String getDriverDefinitionID() {
- return this.getProperty(DRIVER_DEFINITION_PROP_ID);
- }
-
- public String getDriverJarList() {
- return DriverManager.getInstance().getDriverInstanceByID(this.getDriverDefinitionID()).getJarList();
- }
-
- public String getDriverName() {
- return DriverManager.getInstance().getDriverInstanceByID(this.getDriverDefinitionID()).getName();
- }
-
- // ***** connection
- public boolean isActive() {
- return this.isConnected() || this.isWorkingOffline();
- }
-
- public boolean isInactive() {
- return ! this.isActive();
- }
-
- public boolean isConnected() {
- return this.dtpManagedConnection.isConnected()
- && ! this.dtpManagedConnection.isWorkingOffline();
- }
-
- public boolean isDisconnected() {
- return ! this.isConnected();
- }
-
- public void connect() {
- if (this.isDisconnected()) {
- this.checkStatus(this.dtpConnectionProfile.connect());
- }
- }
-
- public void disconnect() {
- this.checkStatus(this.dtpConnectionProfile.disconnect());
- }
-
- public Connection getJDBCConnection() {
- return this.getConnectionInfo().getSharedConnection();
- }
-
- // ***** off-line support
- public boolean isWorkingOffline() {
- return this.dtpManagedConnection.isWorkingOffline();
- }
-
- public boolean supportsWorkOfflineMode() {
- return this.dtpConnectionProfile.supportsWorkOfflineMode();
- }
-
- public IStatus saveWorkOfflineData() {
- return this.dtpConnectionProfile.saveWorkOfflineData();
- }
-
- public boolean canWorkOffline() {
- return this.dtpConnectionProfile.canWorkOffline();
- }
-
- public IStatus workOffline() {
- return this.dtpConnectionProfile.workOffline();
- }
-
- // ***** listeners
- public synchronized void addConnectionListener(ConnectionListener listener) {
- if (this.hasNoListeners()) { // first listener added
- this.startListening();
- }
- this.connectionListener.addConnectionListener(listener);
- }
-
- private void startListening() {
- this.dtpManagedConnection.addConnectionListener(this.connectionListener);
- if (this.database != null) { // don't trigger database creation
- if (this.isConnected()) { // DTP does not change when off-line
- this.database.startListening();
- }
- }
- }
-
- public synchronized void removeConnectionListener(ConnectionListener listener) {
- this.connectionListener.removeConnectionListener(listener);
- if (this.hasNoListeners()) { // last listener removed
- this.stopListening();
- }
- }
-
- private void stopListening() {
- if (this.database != null) { // don't trigger database creation
- if (this.isConnected()) { // DTP does not change when off-line
- this.database.stopListening();
- }
- }
- this.dtpManagedConnection.removeConnectionListener(this.connectionListener);
- }
-
- boolean hasNoListeners() {
- return this.connectionListener.hasNoListeners();
- }
-
- boolean hasAnyListeners() {
- return this.connectionListener.hasAnyListeners();
- }
-
-
- // ********** internal methods **********
-
- private void checkStatus(IStatus status) {
- if (status.isOK()) {
- return;
- }
- if (status.isMultiStatus()) {
- for (IStatus child : status.getChildren()) {
- this.checkStatus(child); // recurse, looking for the first error
- }
- }
- throw new RuntimeException(status.getMessage(), status.getException());
- }
-
- private DTPDatabaseWrapper buildDatabase() {
- return this.isInactive() ? null : new DTPDatabaseWrapper(this, this.buildDTPDatabase());
- }
-
- private org.eclipse.datatools.modelbase.sql.schema.Database buildDTPDatabase() {
- return this.isWorkingOffline() ?
- this.buildOfflineDTPDatabase() :
- this.buildLiveDTPDatabase();
- }
-
- private org.eclipse.datatools.modelbase.sql.schema.Database buildOfflineDTPDatabase() {
- return this.getConnectionInfo().getSharedDatabase();
- }
-
- private ConnectionInfo getConnectionInfo() {
- return (ConnectionInfo) this.dtpManagedConnection.getConnection().getRawConnection();
- }
-
- private org.eclipse.datatools.modelbase.sql.schema.Database buildLiveDTPDatabase() {
- // TODO see DTP bug 202306
- // pass connect=true in to ProfileUtil.getDatabase()
- // there is a bug mentioned in a comment:
- // "during the profile connected event notification,
- // IManagedConnection is connected while IConnectionProfile is not"
- // so, some hackery here to handle hackery there
- return ProfileUtil.getDatabase(new DatabaseIdentifier(this.getName(), this.getDatabaseName()), true);
- }
-
- synchronized void clearDatabase() {
- if (this.database != null) {
- if (this.isConnected()) { // DTP does not change when off-line
- this.database.stopListening();
- }
- this.database = null;
- }
- }
-
- public boolean treatIdentifiersAsDelimited() {
- return this.identifierAdapter.treatIdentifiersAsDelimited();
- }
-
- void databaseChanged(DTPDatabaseWrapper db) {
- this.connectionListener.databaseChanged(db);
- }
-
- void catalogChanged(DTPCatalogWrapper catalog) {
- this.connectionListener.catalogChanged(catalog);
- }
-
- void schemaChanged(DTPSchemaWrapper schema) {
- this.connectionListener.schemaChanged(schema);
- }
-
- void sequenceChanged(DTPSequenceWrapper sequence) {
- this.connectionListener.sequenceChanged(sequence);
- }
-
- void tableChanged(DTPTableWrapper table) {
- this.connectionListener.tableChanged(table);
- }
-
- void columnChanged(DTPColumnWrapper column) {
- this.connectionListener.columnChanged(column);
- }
-
- void foreignKeyChanged(DTPForeignKeyWrapper foreignKey) {
- this.connectionListener.foreignKeyChanged(foreignKey);
- }
-
- private String getProperty(String propertyName) {
- return this.dtpConnectionProfile.getBaseProperties().getProperty(propertyName);
- }
-
-
- // ********** overrides **********
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName());
- }
-
-
- // ********** DTP connection listener **********
-
- /**
- * This listener translates and forwards
- * {@link org.eclipse.datatools.connectivity.IManagedConnectionListener} and
- * {@link IManagedConnectionOfflineListener} events to
- * {@link ConnectionListener}s. Also, the connection profile delegates to
- * this listener when notifying {@link ConnectionListener}s of changes to
- * the database objects (catalogs, schemata, tables, etc.).
- */
- private class LocalConnectionListener
- implements IManagedConnectionOfflineListener
- {
- private ListenerList<ConnectionListener> listenerList = new ListenerList<ConnectionListener>(ConnectionListener.class);
-
- LocalConnectionListener() {
- super();
- }
-
- void addConnectionListener(ConnectionListener listener) {
- this.listenerList.add(listener);
- }
-
- void removeConnectionListener(ConnectionListener listener) {
- this.listenerList.remove(listener);
- }
-
- boolean hasNoListeners() {
- return this.listenerList.isEmpty();
- }
-
- boolean hasAnyListeners() {
- return ! this.listenerList.isEmpty();
- }
-
-
- // ********** IManagedConnectionListener implementation **********
-
- // off-line or inactive => live
- public void opened(ConnectEvent event) {
- // do *not* build the database here - it is built on-demand;
- // forward event to listeners
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.opened(DTPConnectionProfileWrapper.this);
- }
- }
-
- /**
- * This method is never called from the base DTP code.
- * Perhaps DTP extenders call it....
- * See {@link org.eclipse.datatools.connectivity.internal.ManagedConnection#fireModifiedEvent(Object)},
- * which is never called...
- */
- public void modified(ConnectEvent event) {
- // forward event to listeners
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.modified(DTPConnectionProfileWrapper.this);
- }
- }
-
- public boolean okToClose(ConnectEvent event) {
- // forward event to listeners
- boolean result = true;
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- result &= listener.okToClose(DTPConnectionProfileWrapper.this);
- }
- return result;
- }
-
- // live or off-line => inactive
- public void aboutToClose(ConnectEvent event) {
- // forward event to listeners
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.aboutToClose(DTPConnectionProfileWrapper.this);
- }
- // clear the database *before* the DTP connection is closed
- // but after we notify our listeners of the "about to close";
- // otherwise we leave ourselves open to hitting a closed database
- DTPConnectionProfileWrapper.this.clearDatabase();
- }
-
- // live or off-line => inactive
- public void closed(ConnectEvent event) {
- // 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 an "about to close" event;
- // we are "closing" the live connection
- this.aboutToClose(event);
- }
-
- // inactive or live => off-line
- public void workingOffline(ConnectEvent event) {
- // convert the event to an "opened" event;
- // we are "opening" the off-line connection
- this.opened(event);
- }
-
- // off-line => live
- public void aboutToAttach(ConnectEvent event) {
- // convert the event to an "about to close" event;
- // we are "closing" the off-line connection
- this.aboutToClose(event);
- }
-
-
- // ********** internal methods **********
-
- void databaseChanged(DTPDatabaseWrapper db) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.databaseChanged(DTPConnectionProfileWrapper.this, db);
- }
- }
-
- void catalogChanged(DTPCatalogWrapper catalog) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.catalogChanged(DTPConnectionProfileWrapper.this, catalog);
- }
- }
-
- void schemaChanged(DTPSchemaWrapper schema) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.schemaChanged(DTPConnectionProfileWrapper.this, schema);
- }
- }
-
- void sequenceChanged(DTPSequenceWrapper sequence) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.sequenceChanged(DTPConnectionProfileWrapper.this, sequence);
- }
- }
-
- void tableChanged(DTPTableWrapper table) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.tableChanged(DTPConnectionProfileWrapper.this, table);
- }
- }
-
- void columnChanged(DTPColumnWrapper column) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.columnChanged(DTPConnectionProfileWrapper.this, column);
- }
- }
-
- void foreignKeyChanged(DTPForeignKeyWrapper foreignKey) {
- for (ConnectionListener listener : this.listenerList.getListeners()) {
- listener.foreignKeyChanged(DTPConnectionProfileWrapper.this, foreignKey);
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObject.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObject.java
deleted file mode 100644
index 57caa3ec82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObject.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-
-/**
- * Internal interface: DTP database object.
- */
-interface DTPDatabaseObject
- extends DatabaseObject
-{
- /**
- * covariant override
- */
- DTPConnectionProfileWrapper getConnectionProfile();
-
- /**
- * covariant override
- */
- public DTPDatabaseWrapper getDatabase();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObjectWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObjectWrapper.java
deleted file mode 100644
index d498e152f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseObjectWrapper.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObjectListener;
-import org.eclipse.datatools.connectivity.sqm.core.rte.RefreshManager;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.internal.driver.DTPDriverAdapter;
-
-/**
- * DTP Object Wrapper base class
- */
-abstract class DTPDatabaseObjectWrapper<P extends DTPDatabaseObject>
- implements DTPDatabaseObject
-{
- /** we need a way to get to the connection profile */
- final P parent;
-
- /** listen for the "catalog object" being refreshed */
- private final ICatalogObjectListener catalogObjectListener;
-
-
- // ********** constructor **********
-
- DTPDatabaseObjectWrapper(P parent) {
- super();
- this.parent = parent;
- if (this.getConnectionProfile().isConnected()) {
- // we only listen to "live" connections (as opposed to "off-line" connections);
- // and the model is rebuilt when the connection connects or disconnects
- this.catalogObjectListener = this.buildCatalogObjectListener();
- if (this.getConnectionProfile().hasAnyListeners()) {
- this.startListening();
- }
- } else {
- this.catalogObjectListener = null;
- }
- }
-
-
- // ********** names vs. identifiers **********
-
- /**
- * Examples:<ul>
- * <li>Oracle etc.<ul><code>
- * <li>Table(FOO) vs. "Foo" => null
- * <li>Table(BAR) vs. "Foo" => "BAR"
- * <li>Table(Foo) vs. "Foo" => "\"Foo\""
- * <li>Table(Bar) vs. "Foo" => "\"Bar\""
- * </code></ul>
- * <li>PostgreSQL etc.<ul><code>
- * <li>Table(foo) vs. "Foo" => null
- * <li>Table(bar) vs. "Foo" => "bar"
- * <li>Table(Foo) vs. "Foo" => "\"Foo\""
- * <li>Table(Bar) vs. "Foo" => "\"Bar\""
- * </code></ul>
- * <li>SQL Server etc.<ul><code>
- * <li>Table(Foo) vs. "Foo" => null
- * <li>Table(foo) vs. "Foo" => "foo"
- * <li>Table(bar) vs. "Foo" => "bar"
- * <li>Table(Bar) vs. "Foo" => "Bar"
- * </code></ul>
- * </ul>
- */
- public String getIdentifier(String defaultName) {
- return this.getDTPDriverAdapter().convertNameToIdentifier(this.getName(), defaultName);
- }
-
- /**
- * Examples:<ul>
- * <li>Oracle etc.<ul><code>
- * <li>Table(FOO) => "FOO"
- * <li>Table(Foo) => "\"Foo\""
- * <li>Table(foo) => "\"foo\""
- * <li>Table(foo++) => "\"foo++\""
- * <li>Table(f"o) => "\"f\"\"o\"" (i.e. "f""o")
- * </code></ul>
- * <li>PostgreSQL etc.<ul><code>
- * <li>Table(FOO) => "\"FOO\""
- * <li>Table(Foo) => "\"Foo\""
- * <li>Table(foo) => "foo"
- * <li>Table(foo++) => "\"foo++\""
- * <li>Table(f"o) => "\"f\"\"o\"" (i.e. "f""o")
- * </code></ul>
- * <li>SQL Server etc.<ul><code>
- * <li>Table(FOO) => "FOO"
- * <li>Table(Foo) => "Foo"
- * <li>Table(foo) => "foo"
- * <li>Table(foo++) => "\"foo++\""
- * <li>Table(f"o) => "\"f\"\"o\"" (i.e. "f""o")
- * </code></ul>
- * <li>MySQL<ul><code>
- * <li>Table(FOO) => "FOO"
- * <li>Table(Foo) => "Foo"
- * <li>Table(foo) => "foo"
- * <li>Table(foo++) => "`foo++`"
- * <li>Table(f"o) => "`f\"o`" (i.e. `f"o`)
- * </code></ul>
- * </ul>
- */
- public String getIdentifier() {
- return this.convertNameToIdentifier(this.getName());
- }
-
- String convertNameToIdentifier(String name) {
- return this.getDTPDriverAdapter().convertNameToIdentifier(name);
- }
-
-
- // ********** DTP database object listener **********
-
- private ICatalogObjectListener buildCatalogObjectListener() {
- return new ICatalogObjectListener() {
- public void notifyChanged(ICatalogObject dmElement, int eventType) {
- if (dmElement == DTPDatabaseObjectWrapper.this.getCatalogObject()) {
- // 'eventType' doesn't seem to be very useful, so drop it
- DTPDatabaseObjectWrapper.this.catalogObjectChanged();
- }
- }
- };
- }
-
- /**
- * Typically, return the wrapped DTP database object.
- */
- abstract ICatalogObject getCatalogObject();
-
- /**
- * Typically, a subclass will override this method to
- * call <code>super.catalogObjectChanged()</code> and
- * notify the connection profile something has changed
- */
- void catalogObjectChanged() {
- this.clear();
- }
-
- /**
- * The DTP object has changed, clear the wrapper's state so it will be
- * synchronized on-demand.
- */
- abstract void clear();
-
- // this should only be called when the connection profile is "live" and has listeners
- void startListening() {
- this.checkListener();
- RefreshManager.getInstance().AddListener(this.getCatalogObject(), this.catalogObjectListener);
- }
-
- // this should only be called when the connection profile is "live" and has no listeners
- void stopListening() {
- this.checkListener();
- RefreshManager.getInstance().removeListener(this.getCatalogObject(), this.catalogObjectListener);
- }
-
- /**
- * We only build {@link #catalogObjectListener} when the connection
- * profile is "live". If we get here and it is <code>null</code>,
- * something is wrong.
- */
- private void checkListener() {
- if (this.catalogObjectListener == null) {
- throw new IllegalStateException("the catalog listener is null"); //$NON-NLS-1$
- }
- }
-
-
- // ********** misc **********
-
- public DTPConnectionProfileWrapper getConnectionProfile() {
- return this.parent.getConnectionProfile();
- }
-
- public DTPDatabaseWrapper getDatabase() {
- return this.parent.getDatabase();
- }
-
- DTPDriverAdapter getDTPDriverAdapter() {
- return this.getDatabase().getDTPDriverAdapter();
- }
-
- /**
- * Convenience method.
- */
- <T extends DatabaseObject> T selectDatabaseObjectNamed(Iterable<T> databaseObjects, String name) {
- for (T databaseObject : databaseObjects) {
- if (databaseObject.getName().equals(name)) {
- return databaseObject;
- }
- }
- return null;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseWrapper.java
deleted file mode 100644
index ed7d51577a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPDatabaseWrapper.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.connectivity.sqm.internal.core.RDBCorePlugin;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.db.internal.driver.DTPDriverAdapter;
-import org.eclipse.jpt.jpa.db.internal.driver.DTPDriverAdapterManager;
-
-/**
- * Wrap a DTP Database.
- * <p>
- * Catalogs vs. Schemata:<br>
- * Typically, if a DTP database does not support <em>catalogs</em>,
- * o.e.datatools.modelbase.sql.schema.Database#getCatalogs() will return a
- * single catalog without a name (actually, it's an empty string). This catalog
- * will contain all the database's schemata. We try to ignore this catalog and
- * return the schemata from the database directly.
- * <p>
- * Catalog Note 1:<br>
- * As of Jan 2009, the DTP MySQL driver is not consistent with this pattern.
- * A DTP MySQL database has <em>no</em> catalogs; it holds a single schema
- * directly, and that schema has the same name as the database. See bug 249013.
- * <p>
- * Catalog Note 2:<br>
- * As of Jan 2009, the PostgreSQL JDBC driver complicates this pattern a bit.
- * Even though PostgreSQL does not support <em>catalogs</em>, its JDBC driver
- * returns a single catalog that has the same name as the database specified
- * in the JDBC connection URL. The DTP PostgreSQL driver simply replicates this
- * behavior. Unfortunately, this catalog can be unnamed; i.e. its name is an
- * empty string....
- * <p>
- * (Yet Another) Note:<br>
- * We use <em>name</em> when dealing with the unmodified name of a database object
- * as supplied by the database itself (i.e. it is not delimited and it is always
- * case-sensitive).
- * We use <em>identifier</em> when dealing with a string representation of a database
- * object name (i.e. it may be delimited and, depending on the vendor, it may
- * be case-insensitive).
- */
-final class DTPDatabaseWrapper
- extends DTPSchemaContainerWrapper<DTPConnectionProfileWrapper>
- implements Database
-{
- /** the wrapped DTP database */
- private final org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase;
-
- /** database-specific behavior */
- private final DTPDriverAdapter dtpDriverAdapter;
-
- /** lazy-initialized, sorted */
- private DTPCatalogWrapper[] catalogs;
-
-
- // ********** constructor **********
-
- DTPDatabaseWrapper(DTPConnectionProfileWrapper connectionProfile, org.eclipse.datatools.modelbase.sql.schema.Database dtpDatabase) {
- super(connectionProfile);
- this.dtpDatabase = dtpDatabase;
- this.dtpDriverAdapter = DTPDriverAdapterManager.instance().buildAdapter(this.getVendorName(), this);
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpDatabase;
- }
-
- /* TODO
- * We might want to listen to the "virtual" catalog; but that's probably
- * not necessary since there is no easy way for the user to refresh it
- * (i.e. it is not displayed in the DTP UI).
- */
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().databaseChanged(this);
- }
-
- @Override
- public DTPDatabaseWrapper getDatabase() {
- return this;
- }
-
-
- // ********** DTPSchemaContainerWrapper implementation **********
-
- @Override
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas() {
- return this.dtpDriverAdapter.getDTPSchemas();
- }
-
- @Override
- DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- return this.getSchema_(dtpSchema);
- }
-
- /**
- * This is only called from a catalog, so we know we have catalogs;
- * i.e. the search has to descend through catalogs, then to schemata.
- */
- DTPSchemaWrapper getSchemaFromCatalogs(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- return this.getCatalog(dtpSchema.getCatalog()).getSchema_(dtpSchema);
- }
-
- /**
- * This is only called from a schema when the database is the schema
- * container, so we know we don't have any catalogs.
- */
- @Override
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.getTable_(dtpTable);
- }
-
- /**
- * This is only called from a catalog, so we know we have catalogs;
- * i.e. the search has to descend through catalogs, then to schemata.
- */
- DTPTableWrapper getTableFromCatalogs(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.getCatalog(dtpTable.getSchema().getCatalog()).getTable_(dtpTable);
- }
-
- /**
- * This is only called from a schema when the database is the schema
- * container, so we know we don't have any catalogs.
- */
- @Override
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getColumn_(dtpColumn);
- }
-
- /**
- * This is only called from a catalog, so we know we have catalogs;
- * i.e. the search has to descend through catalogs, then to schemata.
- */
- DTPColumnWrapper getColumnFromCatalogs(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getCatalog(dtpColumn.getTable().getSchema().getCatalog()).getColumn_(dtpColumn);
- }
-
-
- // ********** catalogs **********
-
- public boolean supportsCatalogs() {
- return this.dtpDriverAdapter.supportsCatalogs();
- }
-
- public Iterable<Catalog> getCatalogs() {
- return new ArrayIterable<Catalog>(this.getCatalogArray());
- }
-
- private Iterable<DTPCatalogWrapper> getCatalogWrappers() {
- return new ArrayIterable<DTPCatalogWrapper>(this.getCatalogArray());
- }
-
- private synchronized DTPCatalogWrapper[] getCatalogArray() {
- if (this.catalogs == null) {
- this.catalogs = this.buildCatalogArray();
- }
- return this.catalogs;
- }
-
- private DTPCatalogWrapper[] buildCatalogArray() {
- List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs = this.getDTPCatalogs();
- DTPCatalogWrapper[] result = new DTPCatalogWrapper[dtpCatalogs.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPCatalogWrapper(this, dtpCatalogs.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- private List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs() {
- return this.dtpDriverAdapter.getDTPCatalogs();
- }
-
- public int getCatalogsSize() {
- return this.getCatalogArray().length;
- }
-
- /**
- * Return the catalog for the specified DTP catalog.
- */
- DTPCatalogWrapper getCatalog(org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog) {
- for (DTPCatalogWrapper catalog : this.getCatalogArray()) {
- if (catalog.wraps(dtpCatalog)) {
- return catalog;
- }
- }
- throw new IllegalArgumentException("invalid DTP catalog: " + dtpCatalog); //$NON-NLS-1$
- }
-
- public Iterable<String> getSortedCatalogNames() {
- // the catalogs are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getCatalogWrappers(), NAME_TRANSFORMER);
- }
-
- public DTPCatalogWrapper getCatalogNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getCatalogWrappers(), name);
- }
-
- public Iterable<String> getSortedCatalogIdentifiers() {
- // the catalogs are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getCatalogWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Catalog getCatalogForIdentifier(String identifier) {
- return this.dtpDriverAdapter.selectCatalogForIdentifier(this.getCatalogs(), identifier);
- }
-
- public synchronized DTPCatalogWrapper getDefaultCatalog() {
- return this.getCatalogForNames(this.getDefaultCatalogNames());
- }
-
- private Iterable<String> getDefaultCatalogNames() {
- return this.dtpDriverAdapter.getDefaultCatalogNames();
- }
-
- /**
- * Return the first catalog found.
- */
- private DTPCatalogWrapper getCatalogForNames(Iterable<String> names) {
- for (String name : names) {
- DTPCatalogWrapper catalog = this.getCatalogNamed(name);
- if (catalog != null) {
- return catalog;
- }
- }
- return null;
- }
-
- /**
- * If we find a default catalog, return its identifier;
- * otherwise, return the last name on the list of default names.
- * (Some databases have multiple possible default names.)
- * Return null if the database does not support catalogs.
- */
- public synchronized String getDefaultCatalogIdentifier() {
- Iterable<String> names = this.getDefaultCatalogNames();
- DTPCatalogWrapper catalog = this.getCatalogForNames(names);
- if (catalog != null) {
- return catalog.getIdentifier();
- }
- Iterator<String> stream = names.iterator();
- return stream.hasNext() ? this.convertNameToIdentifier(CollectionTools.last(stream)) : null;
- }
-
-
- // ********** names vs. identifiers **********
-
- // override to make method public since it's in the Database interface
- @Override
- public String convertNameToIdentifier(String name) {
- return super.convertNameToIdentifier(name);
- }
-
-
- // ********** misc **********
-
- public org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase() {
- return this.dtpDatabase;
- }
-
- public String getName() {
- return this.dtpDatabase.getName();
- }
-
- public String getVendorName() {
- return this.dtpDatabase.getVendor();
- }
-
- public String getVersion() {
- return this.dtpDatabase.getVersion();
- }
-
- @Override
- DTPDriverAdapter getDTPDriverAdapter() {
- return this.dtpDriverAdapter;
- }
-
- public Table selectTableForIdentifier(Iterable<Table> tables, String identifier) {
- return this.dtpDriverAdapter.selectTableForIdentifier(tables, identifier);
- }
-
- // TODO add to interface? (so it can be used by AbstractDTPDriverAdapter)
- DatabaseDefinition getDTPDefinition() {
- return RDBCorePlugin.getDefault().getDatabaseDefinitionRegistry().getDefinition(this.dtpDatabase);
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.catalogs != null) {
- this.startCatalogs();
- }
- super.startListening();
- }
-
- private void startCatalogs() {
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.catalogs != null) {
- this.stopCatalogs();
- }
- super.stopListening();
- }
-
- private void stopCatalogs() {
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.catalogs != null) {
- this.clearCatalogs();
- }
- super.clear();
- }
-
- private void clearCatalogs() {
- this.stopCatalogs();
- for (DTPCatalogWrapper catalog : this.catalogs) {
- catalog.clear();
- }
- this.catalogs = null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPForeignKeyWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPForeignKeyWrapper.java
deleted file mode 100644
index 3a341c636f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPForeignKeyWrapper.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.Arrays;
-import java.util.List;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-
-/**
- * Wrap a DTP ForeignKey
- */
-final class DTPForeignKeyWrapper
- extends DTPDatabaseObjectWrapper<DTPTableWrapper>
- implements ForeignKey
-{
- /** the wrapped DTP foreign key */
- private final org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey;
-
- /** lazy-initialized */
- private DTPTableWrapper referencedTable;
-
- /** lazy-initialized */
- private LocalColumnPair[] columnPairs;
-
- /** lazy-initialized - but it can be 'null' so we use a flag */
- private String defaultAttributeName;
- private boolean defaultAttributeNameCalculated = false;
-
-
- // ********** constructor **********
-
- DTPForeignKeyWrapper(DTPTableWrapper baseTable, org.eclipse.datatools.modelbase.sql.constraints.ForeignKey dtpForeignKey) {
- super(baseTable);
- this.dtpForeignKey = dtpForeignKey;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpForeignKey;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().foreignKeyChanged(this);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getName() + ": " + Arrays.asList(this.getColumnPairArray())); //$NON-NLS-1$
- }
-
-
- // ********** ForeignKey implementation **********
-
- public String getName() {
- return this.dtpForeignKey.getName();
- }
-
- public DTPTableWrapper getBaseTable() {
- return this.parent;
- }
-
- public synchronized DTPTableWrapper getReferencedTable() {
- if (this.referencedTable == null) {
- this.referencedTable = this.getBaseTable().getTable(this.dtpForeignKey.getUniqueConstraint().getBaseTable());
- }
- return this.referencedTable;
- }
-
- public boolean referencesSingleColumnPrimaryKey() {
- if (this.getColumnPairsSize() != 1) {
- return false;
- }
- if (this.getReferencedTable().getPrimaryKeyColumnsSize() != 1) {
- return false;
- }
- return this.getColumnPair().getReferencedColumn() == this.getReferencedTable().getPrimaryKeyColumn();
- }
-
- // ***** column pairs
-
- public Iterable<ColumnPair> getColumnPairs() {
- return new ArrayIterable<ColumnPair>(this.getColumnPairArray());
- }
-
- public LocalColumnPair getColumnPair() {
- LocalColumnPair[] pairs = this.getColumnPairArray();
- if (pairs.length != 1) {
- throw new IllegalStateException("multiple column pairs: " + pairs.length); //$NON-NLS-1$
- }
- return pairs[0];
- }
-
- private Iterable<LocalColumnPair> getLocalColumnPairs() {
- return new ArrayIterable<LocalColumnPair>(this.getColumnPairArray());
- }
-
- private synchronized LocalColumnPair[] getColumnPairArray() {
- if (this.columnPairs == null) {
- this.columnPairs = this.buildColumnPairArray();
- }
- return this.columnPairs;
- }
-
- private LocalColumnPair[] buildColumnPairArray() {
- List<org.eclipse.datatools.modelbase.sql.tables.Column> baseColumns = this.getDTPBaseColumns();
- int size = baseColumns.size();
- List<org.eclipse.datatools.modelbase.sql.tables.Column> refColumns = this.getDTPReferenceColumns();
- if (refColumns.size() != size) {
- throw new IllegalStateException(this.getBaseTable().getName() + '.' + this.getName() +
- " - mismatched sizes: " + size + " vs. " + refColumns.size()); //$NON-NLS-1$ //$NON-NLS-2$
- }
- LocalColumnPair[] result = new LocalColumnPair[baseColumns.size()];
- for (int i = baseColumns.size(); i-- > 0; ) {
- result[i] = new LocalColumnPair(
- this.getBaseTable().getColumn(baseColumns.get(i)),
- this.getBaseTable().getColumn(refColumns.get(i))
- );
- }
- return ArrayTools.sort(result, ColumnPair.BASE_COLUMN_COMPARATOR);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPBaseColumns() {
- return this.dtpForeignKey.getMembers();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPReferenceColumns() {
- return this.dtpForeignKey.getUniqueConstraint().getMembers();
- }
-
- public int getColumnPairsSize() {
- return this.getColumnPairArray().length;
- }
-
- public Iterable<Column> getBaseColumns() {
- return new TransformationIterable<LocalColumnPair, Column>(this.getLocalColumnPairs()) {
- @Override
- protected Column transform(LocalColumnPair pair) {
- return pair.getBaseColumn();
- }
- };
- }
-
- boolean baseColumnsContains(Column column) {
- return CollectionTools.contains(this.getBaseColumns(), column);
- }
-
- public Iterable<Column> getNonPrimaryKeyBaseColumns() {
- return new FilteringIterable<Column>(this.getBaseColumns()) {
- @Override
- protected boolean accept(Column column) {
- return ! column.isPartOfPrimaryKey();
- }
- };
- }
-
- public Iterable<Column> getReferencedColumns() {
- return new TransformationIterable<LocalColumnPair, Column>(this.getLocalColumnPairs()) {
- @Override
- protected Column transform(LocalColumnPair columnPair) {
- return columnPair.getReferencedColumn();
- }
- };
- }
-
- // ***** attribute name
-
- public String getAttributeName() {
- String defaultName = this.getDefaultAttributeName();
- return (defaultName != null) ? defaultName : this.getNonDefaultAttributeName();
- }
-
- public synchronized String getDefaultAttributeName() {
- if ( ! this.defaultAttributeNameCalculated) {
- this.defaultAttributeNameCalculated = true;
- this.defaultAttributeName = this.buildDefaultAttributeName();
- }
- return this.defaultAttributeName;
- }
-
- private String buildDefaultAttributeName() {
- if ( ! this.referencesSingleColumnPrimaryKey()) {
- return null;
- }
- LocalColumnPair columnPair = this.getColumnPair();
- String baseColName = columnPair.getBaseColumn().getName();
- String refColName = columnPair.getReferencedColumn().getName();
- if (baseColName.length() <= (refColName.length() + 1)) {
- return null;
- }
- if ( ! baseColName.endsWith(refColName)) {
- return null;
- }
- int _index = baseColName.length() - refColName.length() - 1;
- if (baseColName.charAt(_index) != '_') {
- return null;
- }
- return baseColName.substring(0, _index);
- }
-
- /**
- * If this is a simple (single-column) foreign key, use the name of the
- * single base column to build a name. If this is a compound foreign key,
- * return the name of the referenced table.
- */
- // TODO if there is only one FK to a given table, use the table's name instead of the column's name?
- private String getNonDefaultAttributeName() {
- return (this.getColumnPairsSize() == 1) ?
- this.getNonDefaultAttributeNameFromBaseColumn() :
- this.getReferencedTable().getName();
- }
-
- /**
- * The underscore check is helpful when the referenced column is <em>not</em> the
- * primary key of the referenced table (i.e. it has only a <em>unique</em> constraint).
- * <pre>
- * ForeignKey(EMP.CUBICLE_ID => CUBICLE.ID) => "CUBICLE"
- * ForeignKey(EMP.CUBICLEID => CUBICLE.ID) => "CUBICLE"
- * ForeignKey(EMP.CUBICLE_PK => CUBICLE.ID) => "CUBICLE_PK"
- * </pre>
- */
- private String getNonDefaultAttributeNameFromBaseColumn() {
- LocalColumnPair columnPair = this.getColumnPair();
- String baseColName = columnPair.getBaseColumn().getName();
- String refColName = columnPair.getReferencedColumn().getName();
- int len = baseColName.length();
- int refLen = refColName.length();
- if ((len > refLen) && baseColName.endsWith(refColName)) {
- len = len - refLen;
- if ((len > 1) && baseColName.charAt(len - 1) == '_') {
- len = len - 1;
- }
- }
- return baseColName.substring(0, len);
- }
-
- /**
- * Examples:<ul>
- * <li>Oracle etc.<ul><code>
- * <li>ForeignKey(FOO_ID => ID) vs. "foo" => null
- * <li>ForeignKey(FOO_ID => FOO_ID) vs. "foo" => "FOO_ID"
- * <li>ForeignKey(FOO => ID) vs. "foo" => "FOO"
- * <li>ForeignKey(Foo_ID => ID) vs. "foo" => "\"Foo_ID\""
- * </code></ul>
- * <li>PostgreSQL etc.<ul><code>
- * <li>ForeignKey(foo_id => id) vs. "foo" => null
- * <li>ForeignKey(foo_id => foo_id) vs. "foo" => "foo_id"
- * <li>ForeignKey(foo => id) vs. "foo" => "foo"
- * <li>ForeignKey(Foo_ID => ID) vs. "foo" => "\"Foo_ID\""
- * </code></ul>
- * <li>SQL Server etc.<ul><code>
- * <li>ForeignKey(foo_ID => ID) vs. "foo" => null
- * <li>ForeignKey(FOO_ID => FOO_ID) vs. "foo" => "FOO_ID"
- * <li>ForeignKey(FOO => ID) vs. "foo" => "FOO"
- * <li>ForeignKey(Foo_ID => ID) vs. "foo" => "Foo_ID"
- * </code></ul>
- * </ul>
- */
- public String getJoinColumnAnnotationIdentifier(String attributeName) {
- String baseColumnName = this.getColumnPair().getBaseColumn().getName();
- String defaultBaseColumnName = attributeName + '_' + this.getReferencedTable().getPrimaryKeyColumn().getName();
- return this.getDTPDriverAdapter().convertNameToIdentifier(baseColumnName, defaultBaseColumnName);
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.constraints.ForeignKey foreignKey) {
- return this.dtpForeignKey == foreignKey;
- }
-
- @Override
- synchronized void clear() {
- // the foreign key does not "contain" any other objects,
- // so we don't need to forward the #clear()
- this.defaultAttributeNameCalculated = false;
- this.defaultAttributeName = null;
- this.columnPairs = null;
- this.referencedTable = null;
- }
-
-
- // ********** column pair implementation **********
-
- static class LocalColumnPair implements ColumnPair {
- private final DTPColumnWrapper baseColumn;
- private final DTPColumnWrapper referencedColumn;
-
- LocalColumnPair(DTPColumnWrapper baseColumn, DTPColumnWrapper referencedColumn) {
- super();
- if ((baseColumn == null) || (referencedColumn == null)) {
- throw new NullPointerException();
- }
- this.baseColumn = baseColumn;
- this.referencedColumn = referencedColumn;
- }
-
- public DTPColumnWrapper getBaseColumn() {
- return this.baseColumn;
- }
-
- public DTPColumnWrapper getReferencedColumn() {
- return this.referencedColumn;
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.baseColumn.getName() + "=>" + this.referencedColumn.getName()); //$NON-NLS-1$
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaContainerWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaContainerWrapper.java
deleted file mode 100644
index 46d0f6a4c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaContainerWrapper.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-
-/**
- * Coalesce behavior for a schema container (i.e. database or catalog).
- */
-abstract class DTPSchemaContainerWrapper<P extends DTPDatabaseObject>
- extends DTPDatabaseObjectWrapper<P>
- implements SchemaContainer
-{
- /** lazy-initialized */
- private DTPSchemaWrapper[] schemata;
-
-
- // ********** constructor **********
-
- DTPSchemaContainerWrapper(P parent) {
- super(parent);
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- }
-
-
- // ********** abstract methods **********
-
- /**
- * Return the schema container's DTP schemas.
- */
- abstract List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas();
-
- /**
- * Return the schema for the specified DTP schema.
- */
- abstract DTPSchemaWrapper getSchema(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema);
-
- /**
- * Pre-condition: The schema container (database or catalog) contains
- * the specified schema.
- */
- DTPSchemaWrapper getSchema_(org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- for (DTPSchemaWrapper schema : this.getSchemaArray()) {
- if (schema.wraps(dtpSchema)) {
- return schema;
- }
- }
- throw new IllegalArgumentException("invalid DTP schema: " + dtpSchema); //$NON-NLS-1$
- }
-
- /**
- * Return the table for the specified DTP table.
- * This is only called from a schema (to its container).
- */
- abstract DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable);
-
- /**
- * Pre-condition: The schema container contains the specified table.
- */
- DTPTableWrapper getTable_(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return this.getSchema_(dtpTable.getSchema()).getTable_(dtpTable);
- }
-
- /**
- * Return the column for the specified DTP column.
- * This is only called from a schema (to its container).
- */
- abstract DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn);
-
- /**
- * Pre-condition: The schema container contains the specified column.
- */
- DTPColumnWrapper getColumn_(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getTable_(dtpColumn.getTable()).getColumn_(dtpColumn);
- }
-
-
- // ********** schemata **********
-
- public Iterable<Schema> getSchemata() {
- return new ArrayIterable<Schema>(this.getSchemaArray());
- }
-
- Iterable<DTPSchemaWrapper> getSchemaWrappers() {
- return new ArrayIterable<DTPSchemaWrapper>(this.getSchemaArray());
- }
-
- synchronized DTPSchemaWrapper[] getSchemaArray() {
- if (this.schemata == null) {
- this.schemata = this.buildSchemaArray();
- }
- return this.schemata;
- }
-
- private DTPSchemaWrapper[] buildSchemaArray() {
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> dtpSchemata = this.getDTPSchemas();
- DTPSchemaWrapper[] result = new DTPSchemaWrapper[dtpSchemata.size()];
- for (int i = result.length; i-- > 0; ) {
- result[i] = new DTPSchemaWrapper(this, dtpSchemata.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- public int getSchemataSize() {
- return this.getSchemaArray().length;
- }
-
- public Iterable<String> getSortedSchemaNames() {
- // the schemata are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getSchemaWrappers(), NAME_TRANSFORMER);
- }
-
- public DTPSchemaWrapper getSchemaNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getSchemaWrappers(), name);
- }
-
- public Iterable<String> getSortedSchemaIdentifiers() {
- // the schemata are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getSchemaWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Schema getSchemaForIdentifier(String identifier) {
- return this.getDTPDriverAdapter().selectSchemaForIdentifier(this.getSchemata(), identifier);
- }
-
- public DTPSchemaWrapper getDefaultSchema() {
- return this.getSchemaForNames(this.getDTPDriverAdapter().getDefaultSchemaNames());
- }
-
- /**
- * Return the first schema found.
- */
- DTPSchemaWrapper getSchemaForNames(Iterable<String> names) {
- for (String name : names) {
- DTPSchemaWrapper schema = this.getSchemaNamed(name);
- if (schema != null) {
- return schema;
- }
- }
- return null;
- }
-
- /**
- * If we find a default schema, return its identifier;
- * otherwise, return the last name on the list of default names.
- * (Some containers have multiple possible default names.)
- */
- public synchronized String getDefaultSchemaIdentifier() {
- Iterable<String> names = this.getDTPDriverAdapter().getDefaultSchemaNames();
- DTPSchemaWrapper schema = this.getSchemaForNames(names);
- // assume 'names' is non-empty (!)
- return (schema != null) ?
- schema.getIdentifier() :
- this.convertNameToIdentifier(CollectionTools.last(names));
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.schemata != null) {
- this.startSchemata();
- }
- super.startListening();
- }
-
- private void startSchemata() {
- for (DTPSchemaWrapper schema : this.schemata) {
- schema.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.schemata != null) {
- this.stopSchemata();
- }
- super.stopListening();
- }
-
- private void stopSchemata() {
- for (DTPSchemaWrapper schema : this.schemata) {
- schema.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.schemata != null) {
- this.clearSchemata();
- }
- }
-
- private void clearSchemata() {
- this.stopSchemata();
- for (DTPSchemaWrapper schema : this.schemata) {
- schema.clear();
- }
- this.schemata = null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaWrapper.java
deleted file mode 100644
index ddc7040902..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSchemaWrapper.java
+++ /dev/null
@@ -1,338 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IProduct;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.modelbase.sql.tables.SQLTablesPackage;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * Wrap a DTP Schema
- */
-final class DTPSchemaWrapper
- extends DTPDatabaseObjectWrapper<DTPSchemaContainerWrapper<?>>
- implements Schema
-{
- /** the wrapped DTP schema */
- private final org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema;
-
- /** lazy-initialized */
- private DTPTableWrapper[] tables;
-
- /** lazy-initialized */
- private DTPSequenceWrapper[] sequences;
-
-
- // ********** constants **********
-
- /** used for adopter product customization */
- private static final String PERSISTENT_AND_VIEW_TABLES_ONLY = "supportPersistentAndViewTablesOnly"; //$NON-NLS-1$
-
-
- // ********** constructor **********
-
- DTPSchemaWrapper(DTPSchemaContainerWrapper<?> container, org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema) {
- super(container);
- this.dtpSchema = dtpSchema;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpSchema;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().schemaChanged(this);
- }
-
-
- // ********** Schema implementation **********
-
- public String getName() {
- return this.dtpSchema.getName();
- }
-
- public DTPSchemaContainerWrapper<?> getContainer() {
- return this.parent;
- }
-
- // ***** tables
-
- public Iterable<Table> getTables() {
- return new ArrayIterable<Table>(this.getTableArray());
- }
-
- private Iterable<DTPTableWrapper> getTableWrappers() {
- return new ArrayIterable<DTPTableWrapper>(this.getTableArray());
- }
-
- private synchronized DTPTableWrapper[] getTableArray() {
- if (this.tables == null) {
- this.tables = this.buildTableArray();
- }
- return this.tables;
- }
-
- private DTPTableWrapper[] buildTableArray() {
- List<org.eclipse.datatools.modelbase.sql.tables.Table> dtpTables = this.getDTPTables();
- DTPTableWrapper[] result = new DTPTableWrapper[dtpTables.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPTableWrapper(this, dtpTables.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- private List<org.eclipse.datatools.modelbase.sql.tables.Table> getDTPTables() {
- List<org.eclipse.datatools.modelbase.sql.tables.Table> dtpTables = this.getDTPTables_();
- return this.hack() ? this.hack(dtpTables) : dtpTables;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Table> getDTPTables_() {
- return this.dtpSchema.getTables();
- }
-
- private boolean hack() {
- // the product is null during junit testing
- IProduct product = Platform.getProduct();
- String hack = (product == null) ? null : product.getProperty(PERSISTENT_AND_VIEW_TABLES_ONLY);
- return (hack != null) && hack.equals("true"); //$NON-NLS-1$
- }
-
- // provides a mechanism for DTP extenders that support synonyms but don't want to have them appear
- // in Dali to filter out these table types from Dali
- private List<org.eclipse.datatools.modelbase.sql.tables.Table> hack(List<org.eclipse.datatools.modelbase.sql.tables.Table> dtpTables) {
- List<org.eclipse.datatools.modelbase.sql.tables.Table> result = new ArrayList<org.eclipse.datatools.modelbase.sql.tables.Table>();
- for (org.eclipse.datatools.modelbase.sql.tables.Table dtpTable : dtpTables) {
- if (this.hack(dtpTable)) {
- result.add(dtpTable);
- }
- }
- return result;
- }
-
- private boolean hack(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- return SQLTablesPackage.eINSTANCE.getPersistentTable().isSuperTypeOf(dtpTable.eClass()) ||
- SQLTablesPackage.eINSTANCE.getViewTable().isSuperTypeOf(dtpTable.eClass());
- }
-
- public int getTablesSize() {
- return this.getTableArray().length;
- }
-
- /**
- * return the table for the specified DTP table
- */
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- // try to short-circuit the search
- return this.wraps(dtpTable.getSchema()) ?
- this.getTable_(dtpTable) :
- this.getContainer().getTable(dtpTable);
- }
-
- /**
- * assume the schema contains the specified table
- */
- DTPTableWrapper getTable_(org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- for (DTPTableWrapper table : this.getTableArray()) {
- if (table.wraps(dtpTable)) {
- return table;
- }
- }
- throw new IllegalArgumentException("invalid DTP table: " + dtpTable); //$NON-NLS-1$
- }
-
- public DTPTableWrapper getTableNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getTableWrappers(), name);
- }
-
- public Iterable<String> getSortedTableIdentifiers() {
- // the tables are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getTableWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Table getTableForIdentifier(String identifier) {
- return this.getDTPDriverAdapter().selectTableForIdentifier(this.getTables(), identifier);
- }
-
- // ***** sequences
-
- public Iterable<Sequence> getSequences() {
- return new ArrayIterable<Sequence>(this.getSequenceArray());
- }
-
- private Iterable<DTPSequenceWrapper> getSequenceWrappers() {
- return new ArrayIterable<DTPSequenceWrapper>(this.getSequenceArray());
- }
-
- private synchronized DTPSequenceWrapper[] getSequenceArray() {
- if (this.sequences == null) {
- this.sequences = this.buildSequenceArray();
- }
- return this.sequences;
- }
-
- private DTPSequenceWrapper[] buildSequenceArray() {
- List<org.eclipse.datatools.modelbase.sql.schema.Sequence> dtpSequences = this.getDTPSequences();
- DTPSequenceWrapper[] result = new DTPSequenceWrapper[dtpSequences.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPSequenceWrapper(this, dtpSequences.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.schema.Sequence> getDTPSequences() {
- return this.dtpSchema.getSequences();
- }
-
- public int getSequencesSize() {
- return this.getSequenceArray().length;
- }
-
- public DTPSequenceWrapper getSequenceNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getSequenceWrappers(), name);
- }
-
- public Iterable<String> getSortedSequenceIdentifiers() {
- // the sequences are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getSequenceWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Sequence getSequenceForIdentifier(String identifier) {
- return this.getDTPDriverAdapter().selectSequenceForIdentifier(this.getSequences(), identifier);
- }
-
- // ***** refresh
-
- public void refresh() {
-
- this.getCatalogObject().refresh();
- }
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.schema.Schema schema) {
- return this.dtpSchema == schema;
- }
-
- /**
- * Return the column for the specified DTP column.
- */
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- // try to short-circuit the search
- return this.wraps(dtpColumn.getTable().getSchema()) ?
- this.getColumn_(dtpColumn) :
- this.getContainer().getColumn(dtpColumn);
- }
-
- /**
- * Assume the schema contains the specified column.
- */
- DTPColumnWrapper getColumn_(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- return this.getTable_(dtpColumn.getTable()).getColumn_(dtpColumn);
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.sequences != null) {
- this.startSequences();
- }
- if (this.tables != null) {
- this.startTables();
- }
- super.startListening();
- }
-
- private void startSequences() {
- for (DTPSequenceWrapper sequence : this.sequences) {
- sequence.startListening();
- }
- }
-
- private void startTables() {
- for (DTPTableWrapper table : this.tables) {
- table.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.sequences != null) {
- this.stopSequences();
- }
- if (this.tables != null) {
- this.stopTables();
- }
- super.stopListening();
- }
-
- private void stopSequences() {
- for (DTPSequenceWrapper sequence : this.sequences) {
- sequence.stopListening();
- }
- }
-
- private void stopTables() {
- for (DTPTableWrapper table : this.tables) {
- table.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.sequences != null) {
- this.clearSequences();
- }
- if (this.tables != null) {
- this.clearTables();
- }
- }
-
- private void clearSequences() {
- this.stopSequences();
- for (DTPSequenceWrapper sequence : this.sequences) {
- sequence.clear();
- }
- this.sequences = null;
- }
-
- private void clearTables() {
- this.stopTables();
- for (DTPTableWrapper table : this.tables) {
- table.clear();
- }
- this.tables = null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSequenceWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSequenceWrapper.java
deleted file mode 100644
index 49114e051d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPSequenceWrapper.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Sequence;
-
-/**
- * Wrap a DTP Sequence
- */
-final class DTPSequenceWrapper
- extends DTPDatabaseObjectWrapper<DTPSchemaWrapper>
- implements Sequence
-{
- /** the wrapped DTP sequence */
- private final org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence;
-
-
- // ********** constructor **********
-
- DTPSequenceWrapper(DTPSchemaWrapper schema, org.eclipse.datatools.modelbase.sql.schema.Sequence dtpSequence) {
- super(schema);
- this.dtpSequence = dtpSequence;
- }
-
-
- // ********** DTPDatabaseObjectWrapper implementation **********
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpSequence;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().sequenceChanged(this);
- }
-
-
- // ********** Sequence implementation **********
-
- public String getName() {
- return this.dtpSequence.getName();
- }
-
- public DTPSchemaWrapper getSchema() {
- return this.parent;
- }
-
-
- // ********** internal methods **********
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.schema.Sequence sequence) {
- return this.dtpSequence == sequence;
- }
-
- @Override
- void clear() {
- // no state to clear
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPTableWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPTableWrapper.java
deleted file mode 100644
index a7a58c595f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/DTPTableWrapper.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal;
-
-import java.util.List;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.datatools.modelbase.sql.constraints.PrimaryKey;
-import org.eclipse.datatools.modelbase.sql.tables.BaseTable;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * Wrap a DTP Table
- */
-final class DTPTableWrapper
- extends DTPDatabaseObjectWrapper<DTPSchemaWrapper>
- implements Table
-{
- /** the wrapped DTP table */
- private final org.eclipse.datatools.modelbase.sql.tables.Table dtpTable;
-
- /** lazy-initialized */
- private DTPColumnWrapper[] columns;
-
- /** lazy-initialized */
- private DTPColumnWrapper[] primaryKeyColumns;
-
- /** lazy-initialized */
- private DTPForeignKeyWrapper[] foreignKeys;
-
-
- private static final DTPColumnWrapper[] EMPTY_COLUMNS = new DTPColumnWrapper[0];
- private static final DTPForeignKeyWrapper[] EMPTY_FOREIGN_KEYS = new DTPForeignKeyWrapper[0];
-
-
- // ********** constructor **********
-
- DTPTableWrapper(DTPSchemaWrapper schema, org.eclipse.datatools.modelbase.sql.tables.Table dtpTable) {
- super(schema);
- this.dtpTable = dtpTable;
- }
-
-
- // ********** columns **********
-
- public Iterable<Column> getColumns() {
- return new ArrayIterable<Column>(this.getColumnArray());
- }
-
- private Iterable<DTPColumnWrapper> getColumnWrappers() {
- return new ArrayIterable<DTPColumnWrapper>(this.getColumnArray());
- }
-
- private synchronized DTPColumnWrapper[] getColumnArray() {
- if (this.columns == null) {
- this.columns = this.buildColumnArray();
- }
- return this.columns;
- }
-
- private DTPColumnWrapper[] buildColumnArray() {
- List<org.eclipse.datatools.modelbase.sql.tables.Column> dtpColumns = this.getDTPColumns();
- DTPColumnWrapper[] result = new DTPColumnWrapper[dtpColumns.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPColumnWrapper(this, dtpColumns.get(i));
- }
- return ArrayTools.sort(result, DEFAULT_COMPARATOR);
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getDTPColumns() {
- return this.dtpTable.getColumns();
- }
-
- public int getColumnsSize() {
- return this.getColumnArray().length;
- }
-
- public DTPColumnWrapper getColumnNamed(String name) {
- return this.selectDatabaseObjectNamed(this.getColumnWrappers(), name);
- }
-
- /**
- * Return the column for the specified DTP column.
- */
- DTPColumnWrapper getColumn(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- // try to short-circuit the search
- return this.wraps(dtpColumn.getTable()) ?
- this.getColumn_(dtpColumn) :
- this.getSchema().getColumn(dtpColumn);
- }
-
- /**
- * Pre-condition: The table contains the specified column.
- */
- DTPColumnWrapper getColumn_(org.eclipse.datatools.modelbase.sql.tables.Column dtpColumn) {
- for (DTPColumnWrapper column : this.getColumnArray()) {
- if (column.wraps(dtpColumn)) {
- return column;
- }
- }
- throw new IllegalArgumentException("invalid DTP column: " + dtpColumn); //$NON-NLS-1$
- }
-
- public Iterable<String> getSortedColumnIdentifiers() {
- // the columns are already sorted
- return new TransformationIterable<DatabaseObject, String>(this.getColumnWrappers(), IDENTIFIER_TRANSFORMER);
- }
-
- public Column getColumnForIdentifier(String identifier) {
- return this.getDTPDriverAdapter().selectColumnForIdentifier(this.getColumns(), identifier);
- }
-
-
- // ********** primary key columns **********
-
- public Iterable<Column> getPrimaryKeyColumns() {
- return new ArrayIterable<Column>(this.getPrimaryKeyColumnArray());
- }
-
- public DTPColumnWrapper getPrimaryKeyColumn() {
- DTPColumnWrapper[] pkColumns = this.getPrimaryKeyColumnArray();
- if (pkColumns.length != 1) {
- throw new IllegalStateException("multiple primary key columns: " + pkColumns.length); //$NON-NLS-1$
- }
- return pkColumns[0];
- }
-
- private synchronized DTPColumnWrapper[] getPrimaryKeyColumnArray() {
- if (this.primaryKeyColumns == null) {
- this.primaryKeyColumns = this.buildPrimaryKeyColumnArray();
- }
- return this.primaryKeyColumns;
- }
-
- private DTPColumnWrapper[] buildPrimaryKeyColumnArray() {
- if ( ! (this.dtpTable instanceof BaseTable)) {
- return EMPTY_COLUMNS;
- }
- PrimaryKey pk = ((BaseTable) this.dtpTable).getPrimaryKey();
- if (pk == null) {
- // no PK was defined
- return EMPTY_COLUMNS;
- }
- List<org.eclipse.datatools.modelbase.sql.tables.Column> pkColumns = this.getColumns(pk);
- DTPColumnWrapper[] result = new DTPColumnWrapper[pkColumns.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = this.getColumn(pkColumns.get(i));
- }
- return result;
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.tables.Column> getColumns(PrimaryKey pk) {
- return pk.getMembers();
- }
-
- public int getPrimaryKeyColumnsSize() {
- return this.getPrimaryKeyColumnArray().length;
- }
-
- boolean primaryKeyColumnsContains(Column column) {
- return ArrayTools.contains(this.getPrimaryKeyColumnArray(), column);
- }
-
-
- // ********** foreign keys **********
-
- public Iterable<ForeignKey> getForeignKeys() {
- return new ArrayIterable<ForeignKey>(this.getForeignKeyArray());
- }
-
- private synchronized DTPForeignKeyWrapper[] getForeignKeyArray() {
- if (this.foreignKeys == null) {
- this.foreignKeys = this.buildForeignKeyArray();
- }
- return this.foreignKeys;
- }
-
- private DTPForeignKeyWrapper[] buildForeignKeyArray() {
- if ( ! (this.dtpTable instanceof BaseTable)) {
- return EMPTY_FOREIGN_KEYS;
- }
- List<org.eclipse.datatools.modelbase.sql.constraints.ForeignKey> dtpForeignKeys = this.getDTPForeignKeys();
- DTPForeignKeyWrapper[] result = new DTPForeignKeyWrapper[dtpForeignKeys.size()];
- for (int i = result.length; i-- > 0;) {
- result[i] = new DTPForeignKeyWrapper(this, dtpForeignKeys.get(i));
- }
- return result;
- }
-
- @SuppressWarnings("unchecked")
- private List<org.eclipse.datatools.modelbase.sql.constraints.ForeignKey> getDTPForeignKeys() {
- return ((BaseTable) this.dtpTable).getForeignKeys();
- }
-
- public int getForeignKeysSize() {
- return this.getForeignKeyArray().length;
- }
-
- /**
- * return whether the specified column is a base column for at least one
- * of the the table's foreign keys
- */
- boolean foreignKeyBaseColumnsContains(Column column) {
- for (DTPForeignKeyWrapper fkWrapper : this.getForeignKeyArray()) {
- if (fkWrapper.baseColumnsContains(column)) {
- return true;
- }
- }
- return false;
- }
-
-
- // ********** join table **********
-
- public boolean isPossibleJoinTable() {
- if (this.getForeignKeyArray().length != 2) {
- return false; // the table must have exactly 2 foreign keys
- }
- for (Column column : this.getColumns()) {
- if ( ! this.foreignKeyBaseColumnsContains(column)) {
- return false; // all the table's columns must belong to one (or both) of the 2 foreign keys
- }
- }
- return true;
- }
-
- /**
- * If the table name is <code>FOO_BAR</code>
- * and it joins tables <code>FOO</code> and <code>BAR</code>,
- * return the foreign key to <code>FOO</code>;
- * if the table name is <code>BAR_FOO</code>
- * and it joins tables <code>FOO</code> and <code>BAR</code>,
- * return the foreign key to <code>BAR</code>;
- * otherwise simply return the first foreign key in the array.
- */
- public ForeignKey getJoinTableOwningForeignKey() {
- ForeignKey fk0 = this.getForeignKeyArray()[0];
- String name0 = fk0.getReferencedTable().getName();
-
- ForeignKey fk1 = this.getForeignKeyArray()[1];
- String name1 = fk1.getReferencedTable().getName();
-
- return this.getName().equals(name1 + '_' + name0) ? fk1 : fk0;
- }
-
- public ForeignKey getJoinTableNonOwningForeignKey() {
- ForeignKey fk0 = this.getForeignKeyArray()[0];
- ForeignKey fk1 = this.getForeignKeyArray()[1];
- ForeignKey ofk = this.getJoinTableOwningForeignKey();
- return (ofk == fk0) ? fk1 : fk0;
- }
-
- /**
- * Hmmm....
- * We might want to go to the platform to allow a vendor-specific
- * comparison here;
- * but, since all the names are coming directly from the database
- * (i.e. there are no conversions to Java identifiers etc.), it seems
- * like we can just compare them directly and ignore case-sensitivity
- * issues.... ~bjv
- */
- public boolean joinTableNameIsDefault() {
- return this.getName().equals(this.buildDefaultJoinTableName());
- }
-
- private String buildDefaultJoinTableName() {
- return this.getJoinTableOwningTable().getName()
- + '_'
- + this.getJoinTableNonOwningTable().getName();
- }
-
- private Table getJoinTableOwningTable() {
- return this.getJoinTableOwningForeignKey().getReferencedTable();
- }
-
- private Table getJoinTableNonOwningTable() {
- return this.getJoinTableNonOwningForeignKey().getReferencedTable();
- }
-
-
- // ********** misc **********
-
- public DTPSchemaWrapper getSchema() {
- return this.parent;
- }
-
- public String getName() {
- return this.dtpTable.getName();
- }
-
- @Override
- ICatalogObject getCatalogObject() {
- return (ICatalogObject) this.dtpTable;
- }
-
- @Override
- synchronized void catalogObjectChanged() {
- super.catalogObjectChanged();
- this.getConnectionProfile().tableChanged(this);
- }
-
- boolean wraps(org.eclipse.datatools.modelbase.sql.tables.Table table) {
- return this.dtpTable == table;
- }
-
- /**
- * Return the table for the specified DTP table.
- */
- DTPTableWrapper getTable(org.eclipse.datatools.modelbase.sql.tables.Table table) {
- // try to short-circuit the search
- return this.wraps(table) ? this : this.getSchema().getTable(table);
- }
-
-
- // ********** listening **********
-
- @Override
- synchronized void startListening() {
- if (this.foreignKeys != null) {
- this.startForeignKeys();
- }
- if (this.columns != null) {
- this.startColumns();
- }
- super.startListening();
- }
-
- private void startForeignKeys() {
- for (DTPForeignKeyWrapper foreignKey : this.foreignKeys) {
- foreignKey.startListening();
- }
- }
-
- private void startColumns() {
- for (DTPColumnWrapper column : this.columns) {
- column.startListening();
- }
- }
-
- @Override
- synchronized void stopListening() {
- if (this.foreignKeys != null) {
- this.stopForeignKeys();
- }
- if (this.columns != null) {
- this.stopColumns();
- }
- super.stopListening();
- }
-
- private void stopForeignKeys() {
- for (DTPForeignKeyWrapper foreignKey : this.foreignKeys) {
- foreignKey.stopListening();
- }
- }
-
- private void stopColumns() {
- for (DTPColumnWrapper column : this.columns) {
- column.stopListening();
- }
- }
-
-
- // ********** clear **********
-
- @Override
- synchronized void clear() {
- if (this.foreignKeys != null) {
- this.clearForeignKeys();
- }
-
- // the table does not "contain" the pk columns, so no need to forward #clear()
- this.primaryKeyColumns = null;
-
- if (this.columns != null) {
- this.clearColumns();
- }
- }
-
- private void clearForeignKeys() {
- this.stopForeignKeys();
- for (DTPForeignKeyWrapper foreignKey : this.foreignKeys) {
- foreignKey.clear();
- }
- this.foreignKeys = null;
- }
-
- private void clearColumns() {
- this.stopColumns();
- for (DTPColumnWrapper column : this.columns) {
- column.clear();
- }
- this.columns = null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/AbstractDTPDriverAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/AbstractDTPDriverAdapter.java
deleted file mode 100644
index 6a3e845164..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/AbstractDTPDriverAdapter.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.datatools.connectivity.sqm.core.definition.DatabaseDefinition;
-import org.eclipse.datatools.connectivity.sqm.internal.core.RDBCorePlugin;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ResultSetIterator;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.JptJpaDbPlugin;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * Consolidate the behavior common to the typical DTP drivers.
- *
- * @see Unknown
- */
-abstract class AbstractDTPDriverAdapter
- implements DTPDriverAdapter
-{
- /**
- * The Dali database that wraps the corresponding DTP database.
- */
- final Database database;
-
- /**
- * DTP drivers return catalogs and schemata in a variety of ways....
- */
- final CatalogStrategy catalogStrategy;
-
- /**
- * The SQL spec says a <em>regular</em> (non-delimited) identifier should be
- * folded to uppercase; but some databases do otherwise (e.g. Sybase).
- */
- final FoldingStrategy foldingStrategy;
-
-
- AbstractDTPDriverAdapter(Database database) {
- super();
- this.database = database;
- this.catalogStrategy = this.buildCatalogStrategy();
- this.foldingStrategy = this.buildFoldingStrategy();
- }
-
- abstract CatalogStrategy buildCatalogStrategy();
-
- abstract FoldingStrategy buildFoldingStrategy();
-
-
- // ********** catalogs **********
-
- public boolean supportsCatalogs() {
- return this.catalogStrategy.supportsCatalogs();
- }
-
- public List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs() {
- return this.catalogStrategy.getCatalogs();
- }
-
- /**
- * Typically, the name of the default catalog is the user name.
- */
- public final Iterable<String> getDefaultCatalogNames() {
- return this.supportsCatalogs() ? this.getDefaultCatalogNames_() : Collections.<String>emptyList();
- }
-
- final Iterable<String> getDefaultCatalogNames_() {
- ArrayList<String> names = new ArrayList<String>();
- this.addDefaultCatalogNamesTo(names);
- return names;
- }
-
- void addDefaultCatalogNamesTo(ArrayList<String> names) {
- names.add(this.getUserName());
- }
-
-
- // ********** schemas **********
-
- public List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas() {
- try {
- return this.catalogStrategy.getSchemas();
- } catch (Exception ex) {
- throw new RuntimeException("driver adapter: " + this, ex); //$NON-NLS-1$
- }
- }
-
- /**
- * Typically, the name of the default schema is the user name.
- */
- public final Iterable<String> getDefaultSchemaNames() {
- ArrayList<String> names = new ArrayList<String>();
- this.addDefaultSchemaNamesTo(names);
- return names;
- }
-
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(this.getUserName());
- }
-
-
- // ********** name -> identifier **********
-
- public String convertNameToIdentifier(String name) {
- if (this.treatIdentifiersAsDelimited()) {
- return name; // no delimiters necessary
- }
- if (this.nameRequiresDelimiters(name)) {
- return this.delimitName(name);
- }
- return name;
- }
-
- // TODO break into converting table and column names so MySQL works better
- public String convertNameToIdentifier(String name, String defaultName) {
- if (( ! this.treatIdentifiersAsDelimited()) && this.nameRequiresDelimiters(name)) {
- // no match possible
- return this.delimitName(name);
- }
- if (this.regularNamesMatch(name, defaultName)) {
- return null;
- }
- return name;
- }
-
- /**
- * Return whether the specified database object name must be delimited
- * when used in an SQL statement.
- * If the name has any <em>special</em> characters (as opposed to letters,
- * digits, and other allowed characters [e.g. underscores]), it requires
- * delimiters.
- * If the name is mixed case and the database folds undelimited names
- * (to either uppercase or lowercase), it requires delimiters.
- */
- boolean nameRequiresDelimiters(String name) {
- return (name.length() == 0) // an empty string must be delimited(?)
- || this.nameIsReservedWord(name)
- || this.nameContainsAnySpecialCharacters(name)
- || this.nameIsNotFolded(name);
- }
-
- boolean nameIsReservedWord(String name) {
- return this.getDTPDefinition().isSQLKeyword(name);
- }
-
- // TODO make Database.getDTPDefinition() public?
- DatabaseDefinition getDTPDefinition() {
- return RDBCorePlugin.getDefault().getDatabaseDefinitionRegistry().getDefinition(this.database.getDTPDatabase());
- }
-
- /**
- * Return whether the specified name contains any <em>special</em>
- * characters that require the name to be delimited.
- * <br>
- * Pre-condition: the specified name is not empty
- */
- boolean nameContainsAnySpecialCharacters(String name) {
- char[] string = name.toCharArray();
- if (this.characterIsNonRegularNameStart(string[0])) {
- return true;
- }
- for (int i = string.length; i-- > 1; ) { // note: stop at 1
- if (this.characterIsNonRegularNamePart(string[i])) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return whether the specified character is non-<em>regular</em> for the first
- * character of a name.
- * Typically, databases are more restrictive about what characters can
- * be used to <em>start</em> an identifier (as opposed to the characters
- * allowed for the remainder of the identifier).
- */
- boolean characterIsNonRegularNameStart(char c) {
- return ! this.characterIsRegularNameStart(c);
- }
-
- /**
- * Return whether the specified character is <em>regular</em> for the first
- * character of a name.
- * The first character of an identifier can be:<ul>
- * <li>a letter
- * <li>any of the extended, database-specific, <em>regular</em> start characters
- * </ul>
- */
- boolean characterIsRegularNameStart(char c) {
- // all databases allow a letter
- return Character.isLetter(c)
- || this.characterIsExtendedRegularNameStart(c);
- }
-
- boolean characterIsExtendedRegularNameStart(char c) {
- return this.arrayContains(this.getExtendedRegularNameStartCharacters(), c);
- }
-
- /**
- * Return the <em>regular</em> characters, beyond letters, for the
- * first character of a name.
- * Return <code>null</code> if there are no "extended" characters.
- */
- char[] getExtendedRegularNameStartCharacters() {
- return null;
- }
-
- /**
- * Return whether the specified character is non-<em>regular</em> for the
- * second and subsequent characters of a name.
- */
- boolean characterIsNonRegularNamePart(char c) {
- return ! this.characterIsRegularNamePart(c);
- }
-
- /**
- * Return whether the specified character is <em>regular</em> for the second and
- * subsequent characters of a name.
- * The second and subsequent characters of a <em>regular</em> name can be:<ul>
- * <li>a letter
- * <li>a digit
- * <li>an underscore
- * <li>any of the extended, database-specific, <em>regular</em> start characters
- * <li>any of the extended, database-specific, <em>regular</em> part characters
- * </ul>
- */
- boolean characterIsRegularNamePart(char c) {
- // all databases allow a letter or digit
- return Character.isLetterOrDigit(c) ||
- (c == '_') ||
- this.characterIsExtendedRegularNameStart(c) ||
- this.characterIsExtendedRegularNamePart(c);
- }
-
- boolean characterIsExtendedRegularNamePart(char c) {
- return this.arrayContains(this.getExtendedRegularNamePartCharacters(), c);
- }
-
- /**
- * Return the <em>regular</em> characters, beyond letters and digits and the
- * <em>regular</em> first characters, for the second and subsequent characters
- * of an identifier. Return <code>null</code> if there are no additional characters.
- */
- char[] getExtendedRegularNamePartCharacters() {
- return null;
- }
-
- /**
- * Return whether the specified name is not folded to the database's
- * case, requiring it to be delimited.
- */
- boolean nameIsNotFolded(String name) {
- return ! this.foldingStrategy.nameIsFolded(name);
- }
-
- /**
- * Return whether the specified <em>regular</em> names match.
- * Typically, <em>regular</em> identifiers are case-insensitive.
- */
- boolean regularNamesMatch(String name1, String name2) {
- return name1.equalsIgnoreCase(name2);
- }
-
- /**
- * Wrap the specified name in delimiters (typically double-quotes),
- * converting it to an identifier.
- */
- String delimitName(String name) {
- return StringTools.quote(name);
- }
-
-
- // ********** identifier -> name **********
-
- // not sure how to handle an empty string:
- // both "" and "\"\"" are converted to "" ...
- // convert "" to 'null' since empty strings must be delimited?
- public String convertIdentifierToName(String identifier) {
- if (identifier == null) {
- return null;
- }
- if (this.treatIdentifiersAsDelimited()) {
- return identifier; // automatically delimited
- }
- if (this.identifierIsDelimited(identifier)) {
- return StringTools.undelimit(identifier);
- }
- return this.foldingStrategy.fold(identifier);
- }
-
- /**
- * Return whether the specified identifier is <em>delimited</em>.
- * The SQL-92 spec says identifiers should be delimited by
- * double-quotes; but some databases allow otherwise (e.g. Sybase).
- */
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsQuoted(identifier);
- }
-
-
- // ********** selecting database objects **********
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Catalog selectCatalogForIdentifier(Iterable<Catalog> catalogs, String identifier) {
- return this.selectDatabaseObjectForIdentifier(catalogs, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Schema selectSchemaForIdentifier(Iterable<Schema> schemata, String identifier) {
- return this.selectDatabaseObjectForIdentifier(schemata, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Table selectTableForIdentifier(Iterable<Table> tables, String identifier) {
- return this.selectDatabaseObjectForIdentifier(tables, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Sequence selectSequenceForIdentifier(Iterable<Sequence> sequences, String identifier) {
- return this.selectDatabaseObjectForIdentifier(sequences, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- public Column selectColumnForIdentifier(Iterable<Column> columns, String identifier) {
- return this.selectDatabaseObjectForIdentifier(columns, identifier);
- }
-
- /**
- * By default, convert the identifier to a name and perform a name lookup.
- */
- <T extends DatabaseObject> T selectDatabaseObjectForIdentifier(Iterable<T> databaseObjects, String identifier) {
- return this.selectDatabaseObjectNamed(databaseObjects, this.convertIdentifierToName(identifier));
- }
-
- /**
- * We can tanslate identifiers on most databasee into a name we can treat as
- * case-sensitive.
- */
- <T extends DatabaseObject> T selectDatabaseObjectNamed(Iterable<T> databaseObjects, String name) {
- return this.selectDatabaseObjectNamedRespectCase(databaseObjects, name);
- }
-
- <T extends DatabaseObject> T selectDatabaseObjectNamedRespectCase(Iterable<T> databaseObjects, String name) {
- for (T databaseObject : databaseObjects) {
- if (databaseObject.getName().equals(name)) {
- return databaseObject;
- }
- }
- return null;
- }
-
- <T extends DatabaseObject> T selectDatabaseObjectNamedIgnoreCase(Iterable<T> databaseObjects, String name) {
- for (T databaseObject : databaseObjects) {
- if (databaseObject.getName().equalsIgnoreCase(name)) {
- return databaseObject;
- }
- }
- return null;
- }
-
-
- // ********** database queries **********
-
- List<Map<String, Object>> execute(String sql) {
- try {
- return this.execute_(sql);
- } catch (SQLException ex) {
- JptJpaDbPlugin.log("SQL: " + sql, ex); //$NON-NLS-1$
- return Collections.emptyList();
- }
- }
-
- List<Map<String, Object>> execute_(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- List<Map<String, Object>> rows = Collections.emptyList();
- try {
- jdbcStatement.execute(sql);
- rows = this.buildRows(jdbcStatement.getResultSet());
- } finally {
- jdbcStatement.close();
- }
- return rows;
- }
-
- Statement createJDBCStatement() throws SQLException {
- return this.getConnectionProfile().getJDBCConnection().createStatement();
- }
-
- List<Map<String, Object>> buildRows(ResultSet resultSet) throws SQLException {
- List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
- CollectionTools.addAll(rows, this.buildResultSetIterator(resultSet));
- return rows;
- }
-
- Iterator<Map<String, Object>> buildResultSetIterator(ResultSet resultSet) throws SQLException {
- return new ResultSetIterator<Map<String, Object>>(resultSet, new ListResultSetIteratorAdapter(resultSet.getMetaData()));
- }
-
- /**
- * Convert each row in the result set into a map whose key is the column
- * name and value is the column value.
- */
- static class ListResultSetIteratorAdapter
- implements ResultSetIterator.Adapter<Map<String, Object>>
- {
- private final int columnCount;
- private final String[] columnNames;
-
- ListResultSetIteratorAdapter(ResultSetMetaData rsMetaData) throws SQLException {
- super();
- this.columnCount = rsMetaData.getColumnCount();
- this.columnNames = new String[this.columnCount + 1]; // leave the zero slot empty
- for (int i = 1; i <= this.columnCount; i++) { // NB: ResultSet index/subscript is 1-based
- this.columnNames[i] = rsMetaData.getColumnName(i);
- }
- }
-
- public Map<String, Object> buildNext(ResultSet rs) throws SQLException {
- HashMap<String, Object> row = new HashMap<String, Object>(this.columnCount);
- for (int i = 1; i <= this.columnCount; i++) { // NB: ResultSet index/subscript is 1-based
- row.put(this.columnNames[i], rs.getObject(i));
- }
- return row;
- }
- }
-
-
- // ********** misc **********
-
- String getUserName() {
- return this.convertIdentifierToName(this.getConnectionProfile().getUserName());
- }
-
- boolean treatIdentifiersAsDelimited() {
- return this.getConnectionProfile().treatIdentifiersAsDelimited();
- }
-
- ConnectionProfile getConnectionProfile() {
- return this.database.getConnectionProfile();
- }
-
- /**
- * Convenience method: Add <code>null</code> check.
- */
- boolean arrayContains(char[] array, char c) {
- return (array != null) && ArrayTools.contains(array, c);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.database);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/CatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/CatalogStrategy.java
deleted file mode 100644
index 1fa345a172..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/CatalogStrategy.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.List;
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Adapt the variety of catalog (and schema) configurations generated by
- * DTP-supplied drivers.
- */
-interface CatalogStrategy {
-
- /**
- * Return whether the DTP database has "real" catalogs (i.e. catalogs that
- * can be specified by the user).
- */
- boolean supportsCatalogs();
-
- /**
- * Return the DTP database's catalogs. This will be empty if the database
- * does <em>not</em> support catalogs.
- * @see #supportsCatalogs()
- */
- List<Catalog> getCatalogs();
-
- /**
- * Return the DTP database's schemas. This will be empty if the database
- * supports catalogs.
- * @see #supportsCatalogs()
- */
- List<Schema> getSchemas();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DB2.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DB2.java
deleted file mode 100644
index 771ff68874..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DB2.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class DB2
- extends AbstractDTPDriverAdapter
-{
- DB2(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // unverified...
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "DB2 UDB", //$NON-NLS-1$
- "DB2 UDB iSeries", //$NON-NLS-1$
- "DB2 UDB zSeries" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new DB2(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapter.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapter.java
deleted file mode 100644
index e94380b533..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapter.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * Delegate DTP driver-specific behavior to implementations of this
- * interface:<ul>
- * <li>catalogs/schemas
- * <li>names/identifiers
- * <li>database object selection
- * </ul>
- * <strong>NB:</strong><br>
- * We use <em>name</em> when dealing with the unmodified name of a database
- * object as supplied by the database itself (i.e. it is not delimited and it is
- * always case-sensitive).
- * <br>
- * We use <em>identifier</em> when dealing with a string representation of a
- * database object name (i.e. it may be delimited and, depending on the database,
- * it may be case-insensitive).
- */
-public interface DTPDriverAdapter {
-
- // ********** catalogs **********
-
- /**
- * Return whether the DTP driver supports "real" catalogs (e.g. Sybase).
- * If it does, use {@link #getDTPCatalogs()} to retrieve them;
- * otherwise, use {@link #getDTPSchemas()} to retrieve the schemas directly.
- */
- boolean supportsCatalogs();
-
- /**
- * Return the DTP database's catalogs.
- * This will be empty if the database does not support catalogs.
- * @see #supportsCatalogs()
- */
- List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs();
-
- /**
- * Return the DTP database's default catalog names.
- * The first name in the list that identifies an existing catalog
- * is <em>the</em> default.
- * This will be empty if the database does not support catalogs.
- */
- Iterable<String> getDefaultCatalogNames();
-
-
- // ********** schemas **********
-
- /**
- * Return the DTP database's schemas.
- * This will be empty if the database supports catalogs.
- * @see #supportsCatalogs()
- */
- List<org.eclipse.datatools.modelbase.sql.schema.Schema> getDTPSchemas();
-
- /**
- * Return the DTP database's default schema names.
- * The first name in the list that identifies an existing schema
- * is <em>the</em> default.
- */
- Iterable<String> getDefaultSchemaNames();
-
-
- // ********** names/identifiers **********
-
- /**
- * Convert the specified database object name to a database-specific
- * identifier (i.e. delimit the name as appropriate).
- */
- String convertNameToIdentifier(String name);
-
- /**
- * Convert the specified database object name to a database-specific
- * identifier (i.e. delimit the name as appropriate).
- * Return <code>null</code> if the resulting identifier matches the
- * specified default name.
- * <p>
- * This is used by entity generation code to determine whether
- * a generated annotation must explicitly identify a database object
- * (e.g. a table) or the specified default adequately identifies the
- * specified database object (taking into consideration case-sensitivity,
- * special characters, etc.).
- */
- String convertNameToIdentifier(String name, String defaultName);
-
- /**
- * Convert the specified database object identifier to a database-specific
- * name (i.e. stripping delimiters from and folding the identifier as
- * appropriate).
- */
- String convertIdentifierToName(String identifier);
-
-
- // ********** selecting database objects **********
-
- /**
- * Select from the specified collection the catalog for the specified
- * identifier.
- */
- Catalog selectCatalogForIdentifier(Iterable<Catalog> catalogs, String identifier);
-
- /**
- * Select from the specified collection the schema for the specified
- * identifier.
- */
- Schema selectSchemaForIdentifier(Iterable<Schema> schemata, String identifier);
-
- /**
- * Select from the specified collection the table for the specified
- * identifier.
- */
- Table selectTableForIdentifier(Iterable<Table> tables, String identifier);
-
- /**
- * Select from the specified collection the sequence for the specified
- * identifier.
- */
- Sequence selectSequenceForIdentifier(Iterable<Sequence> sequences, String identifier);
-
- /**
- * Select from the specified collection the column for the specified
- * identifier.
- */
- Column selectColumnForIdentifier(Iterable<Column> columns, String identifier);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterFactory.java
deleted file mode 100644
index 61319fd784..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterFactory.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-/**
- * Factory interface.
- */
-interface DTPDriverAdapterFactory {
- /**
- * Return the vendors supported by the factory's adapter.
- */
- String[] getSupportedVendors();
-
- /**
- * Build a new DTP driver adapter for the specified Dali database.
- */
- DTPDriverAdapter buildAdapter(Database database);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterManager.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterManager.java
deleted file mode 100644
index c5a5e2f284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/DTPDriverAdapterManager.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.HashMap;
-import org.eclipse.jpt.jpa.db.Database;
-
-public class DTPDriverAdapterManager {
- private final HashMap<String, DTPDriverAdapterFactory> adapterFactories;
-
- // singleton
- private static final DTPDriverAdapterManager INSTANCE = new DTPDriverAdapterManager();
-
- /**
- * Return the singleton.
- */
- public static DTPDriverAdapterManager instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private DTPDriverAdapterManager() {
- super();
- this.adapterFactories = this.buildAdapterFactories();
- }
-
- private HashMap<String, DTPDriverAdapterFactory> buildAdapterFactories() {
- HashMap<String, DTPDriverAdapterFactory> factories = new HashMap<String, DTPDriverAdapterFactory>();
- this.addAdapterFactoriesTo(factories);
- return factories;
- }
-
- private void addAdapterFactoriesTo(HashMap<String, DTPDriverAdapterFactory> factories) {
- this.addAdapterFactoryTo(new DB2.Factory(), factories);
- this.addAdapterFactoryTo(new Derby.Factory(), factories);
- this.addAdapterFactoryTo(new HSQLDB.Factory(), factories);
- this.addAdapterFactoryTo(new Informix.Factory(), factories);
- this.addAdapterFactoryTo(new MaxDB.Factory(), factories);
- this.addAdapterFactoryTo(new MySQL.Factory(), factories);
- this.addAdapterFactoryTo(new Oracle.Factory(), factories);
- this.addAdapterFactoryTo(new PostgreSQL.Factory(), factories);
- this.addAdapterFactoryTo(new SQLServer.Factory(), factories);
- this.addAdapterFactoryTo(new Sybase.Factory(), factories);
- }
-
- /**
- * @see org.eclipse.datatools.modelbase.sql.schema.Database#getVendor()
- */
- private void addAdapterFactoryTo(DTPDriverAdapterFactory factory, HashMap<String, DTPDriverAdapterFactory> factories) {
- for (String name : factory.getSupportedVendors()) {
- this.addAdapterFactoryTo(name, factory, factories);
- }
- }
-
- private void addAdapterFactoryTo(String name, DTPDriverAdapterFactory factory, HashMap<String, DTPDriverAdapterFactory> factories) {
- if (factories.put(name, factory) != null) {
- throw new IllegalArgumentException("Duplicate adapter factory: " + name); //$NON-NLS-1$
- }
- }
-
- public DTPDriverAdapter buildAdapter(String dtpVendorName, Database database) {
- return this.getAdapterFactory(dtpVendorName).buildAdapter(database);
- }
-
- private DTPDriverAdapterFactory getAdapterFactory(String dtpVendorName) {
- DTPDriverAdapterFactory factory = this.adapterFactories.get(dtpVendorName);
- return (factory != null) ? factory : UNRECOGNIZED_ADAPTER_FACTORY;
- }
- private static final DTPDriverAdapterFactory UNRECOGNIZED_ADAPTER_FACTORY = new Unknown.Factory();
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Derby.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Derby.java
deleted file mode 100644
index e990660927..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Derby.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.jpa.db.Database;
-
-class Derby
- extends AbstractDTPDriverAdapter
-{
- Derby(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new FauxCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(this.getDefaultSchemaName());
- }
-
- /**
- * The default user name on Derby is <code>"APP"</code> when the user
- * connects without a user name.
- */
- private String getDefaultSchemaName() {
- String userName = this.getUserName();
- return ((userName != null) && (userName.length() != 0)) ?
- userName :
- DEFAULT_USER_NAME;
- }
- private static final String DEFAULT_USER_NAME = "APP"; //$NON-NLS-1$
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "Derby" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Derby(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FauxCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FauxCatalogStrategy.java
deleted file mode 100644
index 507d5cb573..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FauxCatalogStrategy.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Catalog strategy for DTP database drivers that build a "virtual" catalog
- * (that has no name) because the underlying JDBC driver does not return any
- * catalogs (e.g. Oracle). This catalog cannot be specified by the user in
- * annotations etc.
- *
- * @see java.sql.DatabaseMetaData#getCatalogs()
- */
-class FauxCatalogStrategy
- implements CatalogStrategy
-{
- private final Database database;
-
- FauxCatalogStrategy(Database database) {
- super();
- this.database = database;
- }
-
- public boolean supportsCatalogs() {
- return false;
- }
-
- public List<Catalog> getCatalogs() {
- return Collections.emptyList();
- }
-
- public List<Schema> getSchemas() {
- Catalog fauxCatalog = this.getFauxCatalog();
- @SuppressWarnings("unchecked")
- List<Schema> schemas = fauxCatalog.getSchemas();
- return schemas;
- }
-
- private Catalog getFauxCatalog() {
- List<Catalog> catalogs = this.getCatalogs_();
- if (catalogs == null) {
- throw new IllegalStateException("catalogs list is null"); //$NON-NLS-1$
- }
- if (catalogs.size() != 1) {
- throw new IllegalStateException("not a single catalog: " + catalogs); //$NON-NLS-1$
- }
-
- Catalog catalog = catalogs.get(0);
- if (catalog.getName().length() != 0) {
- throw new IllegalStateException("illegal name: " + catalog.getName()); //$NON-NLS-1$
- }
- return catalog;
- }
-
- @SuppressWarnings("unchecked")
- private List<Catalog> getCatalogs_() {
- return this.database.getCatalogs();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FoldingStrategy.java
deleted file mode 100644
index 523bb7a486..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/FoldingStrategy.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-/**
- * Adapt database-specific identifier-folding etc.
- */
-interface FoldingStrategy {
-
- /**
- * Fold the specified identifier.
- */
- String fold(String identifier);
-
- /**
- * Return whether the specified database object name is already folded,
- * meaning, typically, if it has no special characters, it requires no
- * delimiters.
- */
- boolean nameIsFolded(String name);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/HSQLDB.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/HSQLDB.java
deleted file mode 100644
index 6876c2cf66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/HSQLDB.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.jpa.db.Database;
-
-class HSQLDB
- extends AbstractDTPDriverAdapter
-{
- HSQLDB(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // unverified...
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(PUBLIC_SCHEMA_NAME);
- }
- private static final String PUBLIC_SCHEMA_NAME = "PUBLIC"; //$NON-NLS-1$
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "HSQLDB" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new HSQLDB(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Informix.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Informix.java
deleted file mode 100644
index 8ff84a3390..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Informix.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class Informix
- extends AbstractDTPDriverAdapter
-{
- Informix(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // unverified...
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return LowerCaseFoldingStrategy.instance();
- }
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_' };
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$' };
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "Informix" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Informix(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/LowerCaseFoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/LowerCaseFoldingStrategy.java
deleted file mode 100644
index 903ad0b9d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/LowerCaseFoldingStrategy.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Fold <em>regular</em> identifiers to lower case.
- */
-class LowerCaseFoldingStrategy
- implements FoldingStrategy
-{
- // singleton
- private static final FoldingStrategy INSTANCE = new LowerCaseFoldingStrategy();
-
- /**
- * Return the singleton.
- */
- static FoldingStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private LowerCaseFoldingStrategy() {
- super();
- }
-
- public String fold(String identifier) {
- return identifier.toLowerCase();
- }
-
- public boolean nameIsFolded(String name) {
- return StringTools.stringIsLowercase(name);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MaxDB.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MaxDB.java
deleted file mode 100644
index 9a3d08fce7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MaxDB.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class MaxDB
- extends AbstractDTPDriverAdapter
-{
- MaxDB(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // unverified...
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '#', '@', '$' };
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "MaxDB" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new MaxDB(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MySQL.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MySQL.java
deleted file mode 100644
index 8d76aaf498..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/MySQL.java
+++ /dev/null
@@ -1,311 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.DatabaseObject;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * MySQL is a bit unusual in that it does <em>not</em> fold <em>regular</em>
- * identifiers and its identifiers are <em>not</em> case-sensitive
- * (except in special cases, described below). Even <em>delimited</em> identifiers
- * are case-<em>in</em>sensitive. (Delimiters are only needed for identifiers
- * that contain special characters or are reserved words.)
- * <p>
- * MySQL handles the case-sensitivity of databases and tables according to the
- * value of the system variable <code>lower_case_table_names</code>:<ul>
- * <li>0 (Unix/Linux default): database and table names are <em>not</em> folded
- * and they are case-sensitive
- * <li>1 (Windows default): database and table names are folded to lowercase
- * and they are <em>not</em> case-sensitive
- * <li>2 (Mac OS X default): database and table names are <em>not</em> folded
- * and they are <em>not</em> case-sensitive
- * </ul>
- * These values will not work perfectly on all platforms because databases are
- * stored as directories and tables are stored as files in the underlying
- * O/S; and the actual case-sensitivity of the names will ulimately be
- * determined by the behavior of filenames on the O/S.
- * <p>
- * See <a href=http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html>
- * Identifier Case Sensitivity</a>.
- */
-class MySQL
- extends AbstractDTPDriverAdapter
-{
- /** lazy-initialized; value comes from the database server */
- private int lower_case_table_names = -1;
-
- /** lazy-initialized; value comes from the database server */
- private Boolean ANSI_QUOTES = null;
-
-
- MySQL(Database database) {
- super(database);
- }
-
- /**
- * The DTP model for MySQL has a database that contains no catalogs;
- * but, instead, directly holds a single schema with the same name as
- * the database. (This is hard-coded in
- * {@link org.eclipse.datatools.enablement.mysql.catalog.MySqlCatalogDatabase#getSchemas()}.)
- * Although you can qualify identifiers with a database name
- * in MySQL, only the database specified at login seems to be available
- * in the DTP model....
- * <p>
- * <strong>NB:</strong> In MySQL DDL, <code>SCHEMA</code> is a synonym
- * for <code>DATABASE</code>; but the JDBC
- * method {@link java.sql.DatabaseMetaData#getSchemas()} returns an empty list,
- * while {@link java.sql.DatabaseMetaData#getCatalogs()} returns a list of the
- * available databases.
- * You can also use the JDBC method {@link java.sql.Connection#setCatalog(String)}
- * to set the default database.
- */
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new NoCatalogStrategy(this.database.getDTPDatabase());
- }
-
- /**
- * There are some cases where MySQL folds identifiers, but using the
- * non-folding strategy should work:<ul>
- * <li>We only fold identifiers when
- * converting them to names; but MySQL is case-<em>in</em>sensitive
- * when it is folding database and table names
- * (<code>lower_case_table_names</code>=1), so lookups will work
- * fine without any folding anyways.
- * <li>We only test whether a name is already folded when determining
- * whether it must be delimited; and MySQL ignores delimiters
- * when it comes to case-sensitivity, so we can leave any <em>regular</em>
- * mixed-case names undelimited. (MySQL only requires delimiters for
- * special characters and reserved words.)
- * </ul>
- */
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return NonFoldingStrategy.instance();
- }
-
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(this.database.getName());
- }
-
-
- // ********** identifiers/names **********
-
- /**
- * MySQL is the only vendor that allows a digit.
- * Although, the name cannnot be <em>all</em> digits
- * (unless delimited).
- */
- @Override
- boolean characterIsRegularNameStart(char c) {
- return Character.isDigit(c) || super.characterIsRegularNameStart(c);
- }
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_', '$' };
-
- @Override
- String delimitName(String name) {
- return StringTools.delimit(name, BACKTICK);
- }
-
- /**
- * By default, MySQL delimits identifiers with backticks (<code>`</code>);
- * but it can also be configured to use double-quotes.
- */
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsDelimited(identifier, BACKTICK)
- || (StringTools.stringIsQuoted(identifier) && this.doubleQuoteIsIdentifierDelimiter());
- }
- private static final char BACKTICK = '`';
-
- /**
- * This method should only affect whether entity
- * generation will generate a specified table or column identifier when the
- * default identifier is not a match. Worst case: Entity generation will
- * generate explicit identifiers unnecessarily for columns when tables are
- * case-sensitive. The generated annotation will be valid but the column
- * name will be redundant.
- */
- @Override
- boolean regularNamesMatch(String name1, String name2) {
- return this.tableNamesAreCaseSensitive() ?
- name1.equals(name2) :
- name1.equalsIgnoreCase(name2);
- }
-
-
- // ********** selecting database objects **********
-
- /**
- * DTP schemata are MySQL databases(?). Of course, we only have one per
- * connection....
- */
- @Override
- public Schema selectSchemaForIdentifier(Iterable<Schema> schemata, String identifier) {
- return this.tableNamesAreCaseSensitive() ?
- this.selectDatabaseObjectForIdentifierRespectCase(schemata, identifier) :
- super.selectSchemaForIdentifier(schemata, identifier);
- }
-
- @Override
- public Table selectTableForIdentifier(Iterable<Table> tables, String identifier) {
- return this.tableNamesAreCaseSensitive() ?
- this.selectDatabaseObjectForIdentifierRespectCase(tables, identifier) :
- super.selectTableForIdentifier(tables, identifier);
- }
-
- private <T extends DatabaseObject> T selectDatabaseObjectForIdentifierRespectCase(Iterable<T> databaseObjects, String identifier) {
- return this.selectDatabaseObjectNamedRespectCase(databaseObjects, this.convertIdentifierToName(identifier));
- }
-
- /**
- * MySQL database object names are usually case-insensitive;
- * the exception being databases (schemata) and tables when the system
- * variable <code>lower_case_table_names</code> is 0 (the default on
- * UNIX/Linux). (For some odd reason, trigger names are also
- * case-sensitive.... Fortunately, we don't care yet.)
- */
- @Override
- <T extends DatabaseObject> T selectDatabaseObjectNamed(Iterable<T> databaseObjects, String name) {
- return this.selectDatabaseObjectNamedIgnoreCase(databaseObjects, name);
- }
-
-
- // ********** lower_case_table_names **********
-
- private boolean tableNamesAreCaseSensitive() {
- return this.getLowerCaseTableNames() == 0;
- }
-
- private int getLowerCaseTableNames() {
- if (this.lower_case_table_names == -1) {
- this.lower_case_table_names = this.buildLowerCaseTableNames();
- }
- return this.lower_case_table_names;
- }
-
- /**
- * If we don't have a live connection (i.e. we are working off-line),
- * use the current O/S default setting(?).
- */
- private int buildLowerCaseTableNames() {
- int dbValue = this.getLowerCaseTableNamesFromDatabase();
- return (dbValue != -1) ? dbValue : this.getLowerCaseTableNamesFromOS();
- }
-
- /**
- * See <a href=http://dev.mysql.com/doc/refman/5.0/en/identifier-case-sensitivity.html>
- * Identifier Case Sensitivity</a>.
- */
- private int getLowerCaseTableNamesFromDatabase() {
- if (this.getConnectionProfile().isDisconnected()) {
- return -1;
- }
- // the underscore is a wild character on MySQL, so we need to escape it
- List<Map<String, Object>> rows = this.execute("SHOW VARIABLES LIKE 'lower\\_case\\_table\\_names'"); //$NON-NLS-1$
- if (rows.isEmpty()) {
- return -1;
- }
- Map<String, Object> row = rows.get(0);
- if (Tools.valuesAreEqual(row.get("Variable_name"), "lower_case_table_names")) { //$NON-NLS-1$ //$NON-NLS-2$
- return Integer.valueOf((String) row.get("Value")).intValue(); //$NON-NLS-1$
- }
- return -1;
- }
-
- /**
- * Make a best guess at what the setting might be:
- * Return the default value for the current O/S (unfortunately this is the
- * client O/S, not the MySQL Server O/S...).
- */
- private int getLowerCaseTableNamesFromOS() {
- if (Tools.osIsMac()) {
- return 2;
- }
- if (Tools.osIsWindows()) {
- return 1;
- }
- return 0; // Linux etc.
- }
-
-
- // ********** ANSI_QUOTES **********
-
- private boolean doubleQuoteIsIdentifierDelimiter() {
- return this.getANSIQuotes().booleanValue();
- }
-
- private Boolean getANSIQuotes() {
- if (this.ANSI_QUOTES == null) {
- this.ANSI_QUOTES = this.buildANSIQuotes();
- }
- return this.ANSI_QUOTES;
- }
-
- /**
- * If we don't have a live connection (i.e. we are working off-line),
- * return <code>FALSE</code> (the default setting).
- */
- private Boolean buildANSIQuotes() {
- Boolean dbValue = this.getANSIQuotesFromDatabase();
- return (dbValue != null) ? dbValue : Boolean.FALSE;
- }
-
- /**
- * See <a href=http://dev.mysql.com/doc/refman/5.0/en/server-sql-mode.html#sqlmode_ansi_quotes>
- * ANSI_QUOTES</a>.
- */
- private Boolean getANSIQuotesFromDatabase() {
- if (this.getConnectionProfile().isDisconnected()) {
- return null;
- }
- List<Map<String, Object>> rows = this.execute("SELECT @@SESSION.sql_mode"); //$NON-NLS-1$
- if (rows.isEmpty()) {
- return null;
- }
- Map<String, Object> row = rows.get(0);
- String sql_mode = (String) row.get("@@SESSION.sql_mode"); //$NON-NLS-1$
- if (sql_mode == null) {
- return null;
- }
- String[] modes = sql_mode.split(","); //$NON-NLS-1$
- return Boolean.valueOf(ArrayTools.contains(modes, "ANSI_QUOTES")); //$NON-NLS-1$
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "MySql" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new MySQL(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NoCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NoCatalogStrategy.java
deleted file mode 100644
index 348bd59869..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NoCatalogStrategy.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Catalog strategy for DTP database drivers that do not have catalogs
- * (e.g. MySQL; see bug 249013).
- */
-class NoCatalogStrategy
- implements CatalogStrategy
-{
- private final Database database;
-
- NoCatalogStrategy(Database database) {
- super();
- this.database = database;
- }
-
- public boolean supportsCatalogs() {
- return false;
- }
-
- public List<Catalog> getCatalogs() {
- return Collections.emptyList();
- }
-
- @SuppressWarnings("unchecked")
- public List<Schema> getSchemas() {
- return this.database.getSchemas();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NonFoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NonFoldingStrategy.java
deleted file mode 100644
index 045367776b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/NonFoldingStrategy.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-/**
- * Do not fold <em>regular</em> identifiers.
- */
-class NonFoldingStrategy
- implements FoldingStrategy
-{
- // singleton
- private static final FoldingStrategy INSTANCE = new NonFoldingStrategy();
-
- /**
- * Return the singleton.
- */
- static FoldingStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private NonFoldingStrategy() {
- super();
- }
-
- /**
- * Since identifiers are not folded to upper- or lower-case, the name is
- * already <em>folded</em>.
- */
- public String fold(String identifier) {
- return identifier;
- }
-
- /**
- * Since identifiers are not folded to upper- or lower-case, the name is
- * already <em>folded</em>.
- * (Non-folding databases do not require delimiters around mixed-case
- * <em>regular</em> identifiers.)
- */
- public boolean nameIsFolded(String name) {
- return true;
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Oracle.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Oracle.java
deleted file mode 100644
index 48fc149991..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Oracle.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class Oracle
- extends AbstractDTPDriverAdapter
-{
- Oracle(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new FauxCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return UpperCaseFoldingStrategy.instance();
- }
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$', '#' };
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "Oracle" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Oracle(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/PostgreSQL.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/PostgreSQL.java
deleted file mode 100644
index 93598f1a54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/PostgreSQL.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.jpt.jpa.db.Database;
-
-class PostgreSQL
- extends AbstractDTPDriverAdapter
-{
- PostgreSQL(Database database) {
- super(database);
- }
-
- /**
- * The PostgreSQL JDBC driver returns a single catalog from the call to
- * {@link java.sql.DatabaseMetaData#getCatalogs()} that has the same name as the
- * database initially specified by the connection (in the JDBC URL).
- * DTP uses this configuration unmodified. Unfortunately, the DTP
- * database's name is not the same as the PostgreSQL database's
- * name.
- */
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new SimpleCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return LowerCaseFoldingStrategy.instance();
- }
-
- /**
- * The PostgreSQL database holds a single catalog that has the same name as
- * the database.
- */
- @Override
- void addDefaultCatalogNamesTo(ArrayList<String> names) {
- names.add(this.buildDefaultCatalogName());
- }
-
- private String buildDefaultCatalogName() {
- return ((Catalog) this.database.getDTPDatabase().getCatalogs().get(0)).getName();
- }
-
- /**
- * PostgreSQL has a "schema search path". The default is:<br><code>
- * "$user",public
- * </code><br>
- * If the <code>"$user"</code> schema is not found, use the
- * <code>"public"</code> schema.
- */
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- super.addDefaultSchemaNamesTo(names);
- names.add(PUBLIC_SCHEMA_NAME);
- }
- private static final String PUBLIC_SCHEMA_NAME = "public"; //$NON-NLS-1$
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_' };
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$' };
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "postgres" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new PostgreSQL(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SQLServer.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SQLServer.java
deleted file mode 100644
index d9aefb05a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SQLServer.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.Database;
-
-/**
- * Microsoft SQL Server
- */
-class SQLServer
- extends AbstractDTPDriverAdapter
-{
- SQLServer(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new SimpleCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return NonFoldingStrategy.instance();
- }
-
- /**
- * By default, SQL Server identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- //TODO query database for collation setting
- @Override
- boolean regularNamesMatch(String name1, String name2) {
- return name1.equals(name2);
- }
-
- /**
- * SQL Server will use the user-requested database; if that database is not
- * found, it will default to <code>master</code>.
- */
- @Override
- void addDefaultCatalogNamesTo(ArrayList<String> names) {
- names.add(this.database.getName());
- names.add(MASTER_CATALOG_IDENTIFIER);
- }
- private static final String MASTER_CATALOG_IDENTIFIER = "master"; //$NON-NLS-1$
-
- /**
- * The default schema on SQL Server for any database (catalog) is
- * <code>dbo</code>.
- */
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(DEFAULT_SCHEMA_NAME);
- }
- private static final String DEFAULT_SCHEMA_NAME = "dbo"; //$NON-NLS-1$
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_', '@', '#' };
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$' };
-
- //TODO query database for delimiter setting
- @Override
- String delimitName(String name) {
- return '[' + name + ']';
- }
-
- /**
- * By default, SQL Server delimits identifiers with brackets
- * (<code>[]</code>); but it
- * can also be configured to use double-quotes.
- */
- //TODO query database for delimiter setting
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsBracketed(identifier)
- || super.identifierIsDelimited(identifier);
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "SQL Server" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new SQLServer(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java
deleted file mode 100644
index 8d42d07226..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/SimpleCatalogStrategy.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Catalog strategy for DTP database drivers that simply model the catalogs
- * returned by the underlying JDBC driver (e.g. Sybase).
- *
- * @see java.sql.DatabaseMetaData#getCatalogs()
- */
-class SimpleCatalogStrategy
- implements CatalogStrategy
-{
- private final Database database;
-
- SimpleCatalogStrategy(Database database) {
- super();
- this.database = database;
- }
-
- public boolean supportsCatalogs() {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- public List<Catalog> getCatalogs() {
- return this.database.getCatalogs();
- }
-
- public List<Schema> getSchemas() {
- return Collections.emptyList();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Sybase.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Sybase.java
deleted file mode 100644
index 0847a0c2db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Sybase.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.Database;
-
-class Sybase
- extends AbstractDTPDriverAdapter
-{
- Sybase(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- return new SimpleCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- return NonFoldingStrategy.instance();
- }
-
- /**
- * By default, Sybase identifiers are case-sensitive, even without
- * delimiters. This can depend on the collation setting....
- */
- //TODO query database for collation setting
- @Override
- boolean regularNamesMatch(String name1, String name2) {
- return name1.equals(name2);
- }
-
- /**
- * Sybase will use the user-requested database; if that database is not
- * found, it will default to <code>master</code>.
- */
- @Override
- void addDefaultCatalogNamesTo(ArrayList<String> names) {
- names.add(this.database.getName());
- names.add(MASTER_CATALOG_NAME);
- }
- private static final String MASTER_CATALOG_NAME = "master"; //$NON-NLS-1$
-
- /**
- * The typical default schema on Sybase for any database (catalog) is
- * <code>dbo</code>.
- * <br>
- * Actually, the default schema is more like a search path:
- * The server looks for a schema object (e.g. a table) first in the user's
- * schema, then it looks for the schema object in the database owner's
- * schema (<code>dbo</code>). As a result, it's really not possible to specify
- * the "default" schema without knowing the schema object we are
- * looking for.
- * <br>
- * (Note: the current 'user' is not the same thing as the current
- * 'login' - see sp_adduser and sp_addlogin; so we probably can't
- * use {@link org.eclipse.jpt.jpa.db.ConnectionProfile#getUserName()}.)
- */
- @Override
- void addDefaultSchemaNamesTo(ArrayList<String> names) {
- names.add(DEFAULT_SCHEMA_NAME);
- }
- private static final String DEFAULT_SCHEMA_NAME = "dbo"; //$NON-NLS-1$
-
- @Override
- char[] getExtendedRegularNameStartCharacters() {
- return EXTENDED_REGULAR_NAME_START_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_START_CHARACTERS = new char[] { '_', '@' };
-
- @Override
- char[] getExtendedRegularNamePartCharacters() {
- return EXTENDED_REGULAR_NAME_PART_CHARACTERS;
- }
- private static final char[] EXTENDED_REGULAR_NAME_PART_CHARACTERS = new char[] { '$', '¥', '£', '#' };
-
- //TODO query database for delimiter setting
- @Override
- String delimitName(String name) {
- return '[' + name + ']';
- }
-
- /**
- * By default, Sybase delimits identifiers with brackets
- * (<code>[]</code>); but it
- * can also be configured to use double-quotes.
- */
- //TODO query database for delimiter setting
- @Override
- boolean identifierIsDelimited(String identifier) {
- return StringTools.stringIsBracketed(identifier)
- || super.identifierIsDelimited(identifier);
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- private static final String[] VENDORS = {
- "Sybase_ASA", //$NON-NLS-1$
- "Sybase_ASE" //$NON-NLS-1$
- };
- public String[] getSupportedVendors() {
- return VENDORS;
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Sybase(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Unknown.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Unknown.java
deleted file mode 100644
index a417250363..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/Unknown.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.jpa.db.Database;
-
-class Unknown
- extends AbstractDTPDriverAdapter
-{
- Unknown(Database database) {
- super(database);
- }
-
- @Override
- CatalogStrategy buildCatalogStrategy() {
- // infer from existing catalogs and schemas
- return new UnknownCatalogStrategy(this.database.getDTPDatabase());
- }
-
- @Override
- FoldingStrategy buildFoldingStrategy() {
- // SQL standard
- return UpperCaseFoldingStrategy.instance();
- }
-
-
- // ********** factory **********
-
- static class Factory implements DTPDriverAdapterFactory {
- public String[] getSupportedVendors() {
- throw new UnsupportedOperationException();
- }
- public DTPDriverAdapter buildAdapter(Database database) {
- return new Unknown(database);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UnknownCatalogStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UnknownCatalogStrategy.java
deleted file mode 100644
index ca7722c5bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UnknownCatalogStrategy.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.datatools.modelbase.sql.schema.Catalog;
-import org.eclipse.datatools.modelbase.sql.schema.Database;
-import org.eclipse.datatools.modelbase.sql.schema.Schema;
-
-/**
- * Catalog strategy for unknown DTP database drivers.
- * Infer the strategy from the returned catalogs and schemas.
- *
- * @see java.sql.DatabaseMetaData#getCatalogs()
- */
-class UnknownCatalogStrategy
- implements CatalogStrategy
-{
- private final Database database;
-
- UnknownCatalogStrategy(Database database) {
- super();
- this.database = database;
- }
-
- /**
- * Return <code>true</code> if the database returns a list of catalogs and
- * that list does not contain only a "faux" catalog.
- */
- public boolean supportsCatalogs() {
- return ! this.getCatalogs().isEmpty();
- }
-
- public List<Catalog> getCatalogs() {
- List<Catalog> catalogs = this.getCatalogs_();
- // if there are no catalogs, the database must hold the schemata directly
- if ((catalogs == null) || catalogs.isEmpty()) {
- return Collections.emptyList();
- }
-
- Catalog fauxCatalog = this.selectFauxCatalog(catalogs);
- // if we don't have a "faux" catalog, we must have "real" catalogs
- return (fauxCatalog == null) ? catalogs : Collections.<Catalog>emptyList();
- }
-
- public List<Schema> getSchemas() {
- List<Catalog> catalogs = this.getCatalogs_();
- // if there are no catalogs, the database must hold the schemata directly
- if ((catalogs == null) || catalogs.isEmpty()) {
- return this.getSchemas_();
- }
-
- Catalog fauxCatalog = this.selectFauxCatalog(catalogs);
- return (fauxCatalog != null) ? this.getSchemas(fauxCatalog) : Collections.<Schema>emptyList();
- }
-
- // minimize scope of suppressed warnings
- @SuppressWarnings("unchecked")
- private List<Schema> getSchemas(Catalog catalog) {
- return catalog.getSchemas();
- }
-
- /**
- * If the specified list of catalogs contains a "faux" catalog (i.e. a
- * single catalog with an empty string for a name), return it; otherwise
- * return <code>null</code>.
- */
- private Catalog selectFauxCatalog(List<Catalog> catalogs) {
- if (catalogs.size() == 1) {
- Catalog catalog = catalogs.get(0);
- if (catalog.getName().equals("")) { //$NON-NLS-1$
- return catalog;
- }
- }
- return null;
- }
-
- @SuppressWarnings("unchecked")
- private List<Catalog> getCatalogs_() {
- return this.database.getCatalogs();
- }
-
- @SuppressWarnings("unchecked")
- private List<Schema> getSchemas_() {
- return this.database.getSchemas();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UpperCaseFoldingStrategy.java b/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UpperCaseFoldingStrategy.java
deleted file mode 100644
index 00afecc306..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.db/src/org/eclipse/jpt/jpa/db/internal/driver/UpperCaseFoldingStrategy.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.internal.driver;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Fold <em>regular</em> identifiers to upper case.
- */
-class UpperCaseFoldingStrategy
- implements FoldingStrategy
-{
- // singleton
- private static final FoldingStrategy INSTANCE = new UpperCaseFoldingStrategy();
-
- /**
- * Return the singleton.
- */
- static FoldingStrategy instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private UpperCaseFoldingStrategy() {
- super();
- }
-
- public String fold(String identifier) {
- return identifier.toUpperCase();
- }
-
- public boolean nameIsFolded(String name) {
- return StringTools.stringIsUppercase(name);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.cvsignore
deleted file mode 100644
index c14487ceac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-build.xml
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.project b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.project
deleted file mode 100644
index 1cd07b0642..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.project
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.branding</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.settings/org.eclipse.core.resources.prefs b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.settings/org.eclipse.core.resources.prefs
deleted file mode 100644
index 4aec29d1cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/.settings/org.eclipse.core.resources.prefs
+++ /dev/null
@@ -1,3 +0,0 @@
-#Sun May 27 15:10:09 EDT 2007
-eclipse.preferences.version=1
-encoding/<project>=ISO-8859-1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/META-INF/MANIFEST.MF
deleted file mode 100644
index 8573aca40f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,7 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.eclipselink.branding;singleton:=true
-Bundle-Version: 3.2.0.qualifier
-Bundle-Localization: plugin
-Bundle-Vendor: %providerName
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.html b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.html
deleted file mode 100644
index ca606b1bb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>June 06, 2007</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.ini b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.ini
deleted file mode 100644
index 7d88b9d396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.ini
+++ /dev/null
@@ -1,44 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.ini
-# contains information about a feature
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# "%key" are externalized strings defined in about.properties
-# This file does not need to be translated.
-
-# Property "aboutText" contains blurb for "About" dialog (translated)
-aboutText=%blurb
-
-# Property "windowImage" contains path to window icon (16x16)
-# needed for primary features only
-
-# Property "featureImage" contains path to feature image (32x32)
-featureImage=icons/WTP_icon_x32_v2.png
-
-# Property "aboutImage" contains path to product image (500x330 or 115x164)
-# needed for primary features only
-
-# Property "appName" contains name of the application (translated)
-# needed for primary features only
-
-# Property "welcomePage" contains path to welcome page (special XML-based format)
-# optional
-
-# Property "welcomePerspective" contains the id of the perspective in which the
-# welcome page is to be opened.
-# optional
-
-# Property "tipsAndTricksHref" contains the Help topic href to a tips and tricks page
-# optional
-tipsAndTricksHref=/org.eclipse.jpt.doc.user/tips_and_tricks.htm
-
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.mappings b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.mappings
deleted file mode 100644
index bddaab4310..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.mappings
+++ /dev/null
@@ -1,6 +0,0 @@
-# about.mappings
-# contains fill-ins for about.properties
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# This file does not need to be translated.
-
-0=@build@ \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.properties
deleted file mode 100644
index c6dd28d19b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/about.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-# about.properties
-# contains externalized strings for about.ini
-# java.io.Properties file (ISO 8859-1 with "\" escapes)
-# fill-ins are supplied by about.mappings
-# This file should be translated.
-
-blurb=Dali Java Persistence Tools - EclipseLink JPA Support\n\
-\n\
-Version: {featureVersion}\n\
-Build id: {0}\n\
-\n\
-(c) Copyright Oracle contributors and others 2006, 2011. All rights reserved.\n\
-Visit http://www.eclipse.org/webtools
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/build.properties
deleted file mode 100644
index 4e089bbd76..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-bin.includes = META-INF/,\
- about.ini,\
- about.html,\
- about.mappings,\
- about.properties,\
- icons/,\
- plugin.properties,\
- component.xml
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/component.xml
deleted file mode 100644
index 5ab146d23a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/component.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.eclipselink.branding">
-<description url=""></description>
-<component-depends unrestricted="true"></component-depends>
-<plugin id="org.eclipse.jpt.jpa.eclipselink.branding" fragment="false"/>
-<plugin id="org.eclipse.jpt.common.eclipselink.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.eclipselink.core" fragment="false"/>
-<plugin id="org.eclipse.jpt.jpa.eclipselink.ui" fragment="false"/>
-</component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/icons/WTP_icon_x32_v2.png b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/icons/WTP_icon_x32_v2.png
deleted file mode 100644
index 6f09c2a700..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/icons/WTP_icon_x32_v2.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/plugin.properties
deleted file mode 100644
index 3201735fbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.branding/plugin.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2009 Oracle.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# Oracle. - initial API and implementation
-###############################################################################
-
-pluginName = Dali Java Persistence Tools - EclipseLink JPA Support
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.classpath
deleted file mode 100644
index 304e86186a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.project b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.project
deleted file mode 100644
index 084aa66d47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.core.ddlgen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f6a20c3394..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:07 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/META-INF/MANIFEST.MF
deleted file mode 100644
index faaf11185f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,12 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.eclipselink.core.ddlgen;singleton:=true
-Bundle-Version: 2.1.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.jpt.jpa.eclipselink.core;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.persistence.core;bundle-version="[2.4.0,3.0.0)"
-Import-Package: javax.persistence
-Export-Package: org.eclipse.jpt.jpa.eclipselink.core.ddlgen
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/about.html b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/about.html
deleted file mode 100644
index 071f586b21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/about.html
+++ /dev/null
@@ -1,47 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H2>About This Content</H2>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-<h3>Third Party Content</h3>
-<p>The Content includes items that have been sourced from third parties as set
- out below. If you did not receive this Content directly from the Eclipse Foundation,
- the following is provided for informational purposes only, and you should look
- to the Redistributor&#8217;s license for terms and conditions of use.</p>
-
-<h4><a name="JPA" id="JPA"></a>Java Persistence API (JPA) v1.0</h4>
-
-<blockquote>
- <p>The Java Persistence API (JPA) which is distributed under <a href="https://glassfish.dev.java.net/public/CDDLv1.0.html">CDDL
- v1.0</a> is required by the Dali Java Persistence Tools Project in order
- to support this standard.</p>
-</blockquote>
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/build.properties
deleted file mode 100644
index f6a257843e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/plugin.properties
deleted file mode 100644
index a2f8480048..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Jpa EclipseLink Support - DDL Generation
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java
deleted file mode 100644
index 6a4e5af92a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core.ddlgen/src/org/eclipse/jpt/jpa/eclipselink/core/ddlgen/Main.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.ddlgen;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-import java.util.Map.Entry;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.Persistence;
-import org.eclipse.persistence.config.PersistenceUnitProperties;
-import org.eclipse.persistence.dynamic.DynamicClassLoader;
-
-/**
- * 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
- * [-debug] - debug mode
- * [-dynamic] - use the org.eclipse.persistence.dynamic.DynamicClassLoader
- *
- * 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, Object> eclipseLinkProperties;
- 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.setDynamicClassLoaderProperty(args);
-
- this.isDebugMode = this.getDebugMode(args);
- }
-
- private void setDynamicClassLoaderProperty(String[] args) {
- if (this.getEclipseLinkDynamic(args)) {
- this.eclipseLinkProperties.put(PersistenceUnitProperties.CLASSLOADER, this.buildDynamicClassLoader());
- }
- }
-
- private ClassLoader buildDynamicClassLoader() {
- return new DynamicClassLoader(Thread.currentThread().getContextClassLoader());
- }
-
- private void dispose() {
- if( ! this.isDebugMode) {
- new File(this.eclipseLinkPropertiesPath).delete();
- }
- }
-
- private Map<String, Object> getProperties(String eclipseLinkPropertiesPath) {
- Set<Entry<Object, Object>> propertiesSet = null;
- try {
- propertiesSet = this.loadEclipseLinkProperties(eclipseLinkPropertiesPath);
- }
- catch (IOException e) {
- throw new RuntimeException("Missing: " + eclipseLinkPropertiesPath, e); //$NON-NLS-1$
- }
-
- Map<String, Object> properties = new HashMap<String, Object>();
- for(Entry<Object, Object> property : propertiesSet) {
- properties.put((String) property.getKey(), property.getValue());
- }
- return properties;
- }
-
- private Set<Entry<Object, Object>> loadEclipseLinkProperties(String eclipseLinkPropertiesPath) throws IOException {
- FileInputStream stream = new FileInputStream(eclipseLinkPropertiesPath);
-
- Properties properties = new Properties();
- properties.load(stream);
-
- return properties.entrySet();
- }
-
- // ********** argument queries **********
-
- private String getPUName(String[] args) {
- return this.getArgumentValue("-pu", args); //$NON-NLS-1$
- }
-
- private String getEclipseLinkPropertiesPath(String[] args) {
- return this.getArgumentValue("-p", args); //$NON-NLS-1$
- }
-
- private boolean getDebugMode(String[] args) {
- return this.argumentExists("-debug", args); //$NON-NLS-1$
- }
-
- private boolean getEclipseLinkDynamic(String[] args) {
- return this.argumentExists("-dynamic", args); //$NON-NLS-1$
- }
-
- private String getArgumentValue(String argument, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argument)) {
- int j = i + 1;
- if (j < args.length) {
- return args[j];
- }
- }
- }
- return null;
- }
-
- private boolean argumentExists(String argument, String[] args) {
- for (int i = 0; i < args.length; i++) {
- String arg = args[i];
- if (arg.toLowerCase().equals(argument)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.classpath
deleted file mode 100644
index c0a0d3812e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.classpath
+++ /dev/null
@@ -1,20 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/eclipselink/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/model/value/**"/>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/internal/model/listener/awt/**"/>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/internal/model/value/**"/>
- <accessrule kind="nonaccessible" pattern="org/eclipse/jpt/common/utility/internal/swing/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.project b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.project
deleted file mode 100644
index 800c2b384e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.core</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 0b22921e94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:01 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF
deleted file mode 100644
index 0f9530ac8b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,65 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.eclipselink.core;singleton:=true
-Bundle-Version: 2.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.commands;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.debug.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.eclipselink.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.100,2.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.402,2.0.0)",
- org.eclipse.persistence.jpa.jpql;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.text;bundle-version="[3.5.0,4.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.4.100,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.300,2.0.0)"
-Export-Package: org.eclipse.jpt.jpa.eclipselink.core,
- org.eclipse.jpt.jpa.eclipselink.core.builder,
- org.eclipse.jpt.jpa.eclipselink.core.context,
- org.eclipse.jpt.jpa.eclipselink.core.context.java,
- org.eclipse.jpt.jpa.eclipselink.core.context.orm,
- org.eclipse.jpt.jpa.eclipselink.core.context.persistence,
- org.eclipse.jpt.jpa.eclipselink.core.internal;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.context;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.libval;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.operations;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.resource.orm;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.internal.weave;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.jpql.spi,
- org.eclipse.jpt.jpa.eclipselink.core.platform,
- org.eclipse.jpt.jpa.eclipselink.core.resource.java,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/about.html b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/build.properties
deleted file mode 100644
index ee4c0e5e61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/build.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
-src.includes = model/
-src.includes = model/
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel
deleted file mode 100644
index 8db5a45ab3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipseLinkResourceModels.genmodel
+++ /dev/null
@@ -1,630 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<genmodel:GenModel xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
- xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/org.eclipse.jpt.jpa.eclipselink.core/src"
- creationCommands="false" creationIcons="false" editDirectory="" editorDirectory=""
- modelPluginID="org.eclipse.jpt.jpa.eclipselink.core" modelName="EclipseLinkCore"
- editPluginClass="" editorPluginClass="" updateClasspath="false" rootExtendsInterface="org.eclipse.jpt.jpa.core.resource.xml.JpaEObject"
- rootExtendsClass="org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject" suppressInterfaces="true"
- testsDirectory="" testSuiteClass="" importerID="org.eclipse.emf.importer.ecore"
- complianceLevel="5.0" copyrightFields="false" usedGenPackages="../../org.eclipse.jpt.jpa.core/model/jpaResourceModels.genmodel#//orm ../../org.eclipse.jpt.jpa.core/model/jpaResourceModels.genmodel#//xml">
- <foreignModel>eclipselink_orm.ecore</foreignModel>
- <genPackages prefix="EclipseLinkOrm" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource"
- disposableProviderFactory="true" adapterFactory="false" ecorePackage="eclipselink_orm.ecore#/">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//CacheCoordinationType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheCoordinationType/SEND_OBJECT_CHANGES"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheCoordinationType/INVALIDATE_CHANGED_OBJECTS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheCoordinationType/SEND_NEW_OBJECTS_WITH_CHANGES"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheCoordinationType/NONE"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//CacheType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/FULL"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/WEAK"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/SOFT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/SOFT_WEAK"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/HARD_WEAK"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/CACHE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//CacheType/NONE"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//XmlChangeTrackingType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlChangeTrackingType/ATTRIBUTE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlChangeTrackingType/OBJECT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlChangeTrackingType/DEFERRED"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlChangeTrackingType/AUTO"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//XmlDirection">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlDirection/IN"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlDirection/OUT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlDirection/IN_OUT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlDirection/OUT_CURSOR"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//ExistenceType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//ExistenceType/CHECK_CACHE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//ExistenceType/CHECK_DATABASE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//ExistenceType/ASSUME_EXISTENCE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//ExistenceType/ASSUME_NON_EXISTENCE"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//XmlJoinFetchType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlJoinFetchType/INNER"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlJoinFetchType/OUTER"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//XmlOptimisticLockingType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlOptimisticLockingType/ALL_COLUMNS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlOptimisticLockingType/CHANGED_COLUMNS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlOptimisticLockingType/SELECTED_COLUMNS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//XmlOptimisticLockingType/VERSION_COLUMN"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlAccessMethods">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlAccessMethods/getMethod"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlAccessMethods/setMethod"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlAccessMethodsHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlAccessMethodsHolder/accessMethods"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlAdditionalCriteria"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlArray"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlAttributeMapping">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlAttributeMapping/attributeType"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//Attributes">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/basicCollections"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/basicMaps"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/transformations"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//Attributes/variableOneToOnes"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBasic"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBasicCollection"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBasicMap"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlBatchFetch"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlBatchFetchHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlBatchFetchHolder/batchFetch"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCache">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/expiry"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/size"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/shared"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/type"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/alwaysRefresh"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/refreshOnlyIfNewer"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/disableHits"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCache/coordinationType"/>
- <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlCache/expiryTimeOfDay"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlCacheHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlCacheHolder/cache"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCacheHolder/existenceChecking"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCacheIndex"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlChangeTracking">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlChangeTracking/type"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlChangeTrackingHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlChangeTrackingHolder/changeTracking"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCloneCopyPolicy">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCloneCopyPolicy/method"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCloneCopyPolicy/workingCopyMethod"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCollectionTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlConversionValue">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlConversionValue/dataValue"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlConversionValue/objectValue"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlConverter/className"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlConverterContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConverterContainer/converters"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConverterContainer/typeConverters"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConverterContainer/objectTypeConverters"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlConverterContainer/structConverters"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlConvertibleMapping">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlConvertibleMapping/convert"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlCopyPolicy">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCopyPolicy/class"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlCustomizer">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlCustomizer/customizerClassName"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlCustomizerHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlCustomizerHolder/customizer"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlElementCollection"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlEmbeddable">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEmbeddable/copyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEmbeddable/instantiationCopyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEmbeddable/cloneCopyPolicy"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlEmbeddable/excludeDefaultMappings"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlEmbedded"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlEmbeddedId"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlEntity">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEntity/optimisticLocking"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEntity/copyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEntity/instantiationCopyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlEntity/cloneCopyPolicy"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlEntity/excludeDefaultMappings"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlEntityMappings"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlFetchAttribute"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlFetchGroup"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlHashPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlId"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlIndex"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlInstantiationCopyPolicy"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlJoinFetch">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlJoinFetch/joinFetch"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlJoinTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToMany"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlManyToOne"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlMappedSuperclass">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMappedSuperclass/optimisticLocking"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMappedSuperclass/copyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMappedSuperclass/instantiationCopyPolicy"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMappedSuperclass/cloneCopyPolicy"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlMappedSuperclass/excludeDefaultMappings"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlMultitenant"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlMultitenantHolder">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlMultitenantHolder/multitenant"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlMutable">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlMutable/mutable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlNamedConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedConverter/name"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlNamedPlsqlStoredFunctionQuery"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlNamedPlsqlStoredProcedureQuery"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlNamedStoredFunctionQuery"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/resultClass"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/resultSetMapping"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/procedureName"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/returnsResultSet"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/hints"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlNamedStoredProcedureQuery/parameters"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlObjectTypeConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlObjectTypeConverter/dataType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlObjectTypeConverter/objectType"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlObjectTypeConverter/conversionValues"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlObjectTypeConverter/defaultObjectValue"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOneToMany"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOneToOne"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOptimisticLocking">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlOptimisticLocking/type"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlOptimisticLocking/cascade"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlOptimisticLocking/selectedColumns"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlOrderColumn"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPersistenceUnitDefaults"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPersistenceUnitMetadata">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlPersistenceUnitMetadata/excludeDefaultMappings"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPinnedPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPlsqlRecord"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPlsqlTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlPrimaryKey"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlPrivateOwned">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlPrivateOwned/privateOwned"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlProperty">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlProperty/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlProperty/value"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlProperty/valueType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlPropertyContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlPropertyContainer/properties"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlQueryContainer">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//XmlQueryContainer/namedStoredProcedureQueries"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlQueryRedirectors"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlRangePartitioning"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlReadOnly">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlReadOnly/readOnly"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlReplicationPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlReturnInsert"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlRoundRobinPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlSecondaryTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStoredProcedureParameter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/direction"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/queryParameter"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/type"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/jdbcType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStoredProcedureParameter/jdbcTypeName"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStruct"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStructConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlStructConverter/converter"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlStructure"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTable"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTableGenerator"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTenantDiscriminatorColumn"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTimeOfDay">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTimeOfDay/hour"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTimeOfDay/minute"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTimeOfDay/second"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTimeOfDay/millisecond"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlTransformation"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTransient"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlTypeConverter">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTypeConverter/dataType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlTypeConverter/objectType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlTypeMapping"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlUnionPartitioning"/>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlValuePartitioning"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//XmlVariableOneToOne">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//XmlVariableOneToOne/targetInterface"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//XmlVersion"/>
- <nestedGenPackages prefix="EclipseLinkOrmV1_1" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" ecorePackage="eclipselink_orm.ecore#//v1_1">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v1_1/IdValidationType_1_1">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v1_1/IdValidationType_1_1/NULL"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v1_1/IdValidationType_1_1/ZERO"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v1_1/IdValidationType_1_1/NONE"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v1_1/XmlBasic_1_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v1_1/XmlBasic_1_1/generatedValue"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v1_1/XmlEntity_1_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v1_1/XmlEntity_1_1/primaryKey"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v1_1/XmlMappedSuperclass_1_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v1_1/XmlMappedSuperclass_1_1/primaryKey"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v1_1/XmlPrimaryKey_1_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v1_1/XmlPrimaryKey_1_1/validation"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v1_1/XmlPrimaryKey_1_1/columns"/>
- </genClasses>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_0" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" ecorePackage="eclipselink_orm.ecore#//v2_0">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_0/OrderCorrectionType_2_0">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_0/OrderCorrectionType_2_0/READ"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_0/OrderCorrectionType_2_0/READ_WRITE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_0/OrderCorrectionType_2_0/EXCEPTION"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlCollectionMapping_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlCollectionMapping_2_0/mapKeyConvert"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlElementCollection_2_0"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlEntity_2_0">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_0/XmlEntity_2_0/cacheInterceptor"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_0/XmlEntity_2_0/queryRedirectors"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlManyToMany_2_0"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlMapKeyAssociationOverrideContainer_2_0">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_0/XmlMapKeyAssociationOverrideContainer_2_0/mapKeyAssociationOverrides"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlMappedSuperclass_2_0">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_0/XmlMappedSuperclass_2_0/cacheInterceptor"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlOneToMany_2_0"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlOrderColumn_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlOrderColumn_2_0/correctionType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/allQueries"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/readAll"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/readObject"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/report"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/update"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/insert"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_0/XmlQueryRedirectors_2_0/delete"/>
- </genClasses>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_1" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" fileExtensions="eclipselinkormv2_1"
- ecorePackage="eclipselink_orm.ecore#//v2_1">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_1/CacheKeyType_2_1">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/CacheKeyType_2_1/ID_VALUE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/CacheKeyType_2_1/CACHE_KEY"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/CacheKeyType_2_1/AUTO"/>
- </genEnums>
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_1/BatchFetchType_2_1">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/BatchFetchType_2_1/JOIN"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/BatchFetchType_2_1/EXISTS"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_1/BatchFetchType_2_1/IN"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlBasic_2_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlBasic_2_1/returnInsert"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBasic_2_1/returnUpdate"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlBatchFetch_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBatchFetch_2_1/size"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlBatchFetch_2_1/batchFetchType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlElementCollection_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEntity_2_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlEntity_2_1/classExtractor"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlEntityMappings_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlFetchAttribute_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlFetchAttribute_2_1/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlFetchGroup_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlFetchGroup_2_1/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlFetchGroup_2_1/load"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlFetchGroup_2_1/attributes"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//v2_1/XmlFetchGroupContainer_2_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlFetchGroupContainer_2_1/fetchGroups"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlManyToMany_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlManyToOne_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1/sqlResultSetMappings"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_1/XmlMappedSuperclass_2_1/queryRedirectors"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlOneToMany_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlOneToOne_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlPersistenceUnitDefaults_2_1"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlPrimaryKey_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlPrimaryKey_2_1/cacheKeyType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlReturnInsert_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlReturnInsert_2_1/returnOnly"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_1/XmlTypeMapping_2_1">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_1/XmlTypeMapping_2_1/parentClass"/>
- </genClasses>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_2" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" fileExtensions="EclipseLinkOrmV2_2"
- ecorePackage="eclipselink_orm.ecore#//v2_2">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_2/CacheIsolationType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_2/CacheIsolationType/SHARED"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_2/CacheIsolationType/PROTECTED"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_2/CacheIsolationType/ISOLATED"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlAdditionalCriteria_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlAdditionalCriteria_2_2/criteria"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlBasic_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlBasic_2_2/index"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlBasicCollection_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlBasicCollection_2_2/cascadeOnDelete"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlBasicMap_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlBasicMap_2_2/cascadeOnDelete"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlCache_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlCache_2_2/isolation"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlCollectionTable_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlCollectionTable_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlElementCollection_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlElementCollection_2_2/cascadeOnDelete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlElementCollection_2_2/noncacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlEmbeddable_2_2"/>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlEntity_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntity_2_2/additionalCriteria"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlEntity_2_2/cascadeOnDelete"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntity_2_2/index"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/partitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/replicationPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/roundRobinPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/pinnedPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/rangePartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/valuePartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/hashPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlEntityMappings_2_2/unionPartitioning"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlHashPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlHashPartitioning_2_2/name"/>
- </genClasses>
- <genClasses ecoreClass="eclipselink_orm.ecore#//v2_2/XmlId_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlId_2_2/index"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlIndex_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/name"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/schema"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/catalog"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/table"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/unique"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlIndex_2_2/columnNames"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlJoinTable_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlJoinTable_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlManyToMany_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlManyToMany_2_2/cascadeOnDelete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlManyToMany_2_2/nonCacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlManyToOne_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlManyToOne_2_2/nonCacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlMappedSuperclass_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlMappedSuperclass_2_2/additionalCriteria"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlOneToOne_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlOneToOne_2_2/cascadeOnDelete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlOneToOne_2_2/nonCacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlOneToMany_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlOneToMany_2_2/cascadeOnDelete"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlOneToMany_2_2/noncacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/partitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/replicationPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/roundRobinPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/pinnedPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/rangePartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/valuePartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/hashPartitioning"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/unionPartitioning"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlPartitioningGroup_2_2/partitioned"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlPinnedPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlPinnedPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlRangePartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlRangePartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlReplicationPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlReplicationPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlRoundRobinPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlRoundRobinPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlSecondaryTable_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlSecondaryTable_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlTable_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlTable_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlTableGenerator_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlTableGenerator_2_2/creationSuffix"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlUnionPartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlUnionPartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlValuePartitioning_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlValuePartitioning_2_2/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlVariableOneToOne_2_2">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_2/XmlVariableOneToOne_2_2/nonCacheable"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_2/XmlVersion_2_2">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_2/XmlVersion_2_2/index"/>
- </genClasses>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_3" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" fileExtensions="EclipselinkOrmV2_3"
- ecorePackage="eclipselink_orm.ecore#//v2_3">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_3/MultitenantType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_3/MultitenantType/SINGLE_TABLE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_3/MultitenantType/TABLE_PER_TENANT"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_3/MultitenantType/VPD"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlArray_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlArray_2_3/databaseType"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlArray_2_3/targetClass"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlAttributes_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlAttributes_2_3/structures"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlAttributes_2_3/arrays"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlElementCollection_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlElementCollection_2_3/compositeMember"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlEmbeddable_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEmbeddable_2_3/plsqlRecords"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEmbeddable_2_3/plsqlTables"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEmbeddable_2_3/struct"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlEntity_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/namedStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/namedPlsqlStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/namedPlsqlStoredProcedureQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/plsqlRecords"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/plsqlTables"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntity_2_3/struct"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/tenantDiscriminatorColumns"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/namedStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/namedPlsqlStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/namedPlsqlStoredProcedureQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/plsqlRecords"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlEntityMappings_2_3/plsqlTables"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/namedStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/namedPlsqlStoredFunctionQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/namedPlsqlStoredProcedureQueries"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/plsqlRecords"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMappedSuperclass_2_3/plsqlTables"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlMultitenant_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlMultitenant_2_3/type"/>
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlMultitenant_2_3/tenantDiscriminatorColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlNamedStoredFunctionQuery_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlNamedStoredFunctionQuery_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlPersistenceUnitDefaults_2_3">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_3/XmlPersistenceUnitDefaults_2_3/tenantDiscriminatorColumns"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlPlsqlRecord_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlPlsqlRecord_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlPlsqlTable_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlPlsqlTable_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlStruct_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlStruct_2_3/name"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/contextProperty"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/table"/>
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_3/XmlTenantDiscriminatorColumn_2_3/primaryKey"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_3/XmlStructure_2_3"/>
- </nestedGenPackages>
- <nestedGenPackages prefix="EclipseLinkOrmV2_4" basePackage="org.eclipse.jpt.jpa.eclipselink.core.resource.orm"
- disposableProviderFactory="true" adapterFactory="false" fileExtensions="EclipselinkOrmV2_4"
- ecorePackage="eclipselink_orm.ecore#//v2_4">
- <genEnums typeSafeEnumCompatible="false" ecoreEnum="eclipselink_orm.ecore#//v2_4/DatabaseChangeNotificationType">
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_4/DatabaseChangeNotificationType/NONE"/>
- <genEnumLiterals ecoreEnumLiteral="eclipselink_orm.ecore#//v2_4/DatabaseChangeNotificationType/INVALIDATION"/>
- </genEnums>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlBasic_2_4">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_4/XmlBasic_2_4/cacheIndex"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlCache_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlCache_2_4/databaseChangeNotificationType"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlCacheIndex_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlCacheIndex_2_4/columnNames"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlElementCollection_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlElementCollection_2_4/deleteAll"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlEntity_2_4">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_4/XmlEntity_2_4/cacheIndex"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlId_2_4">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_4/XmlId_2_4/cacheIndex"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlMappedSuperclass_2_4">
- <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference eclipselink_orm.ecore#//v2_4/XmlMappedSuperclass_2_4/cacheIndex"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlMultitenant_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlMultitenant_2_4/includeCriteria"/>
- </genClasses>
- <genClasses image="false" ecoreClass="eclipselink_orm.ecore#//v2_4/XmlOneToMany_2_4">
- <genFeatures createChild="false" ecoreFeature="ecore:EAttribute eclipselink_orm.ecore#//v2_4/XmlOneToMany_2_4/deleteAll"/>
- </genClasses>
- </nestedGenPackages>
- </genPackages>
-</genmodel:GenModel>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore
deleted file mode 100644
index f9bd98e0b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/model/eclipselink_orm.ecore
+++ /dev/null
@@ -1,806 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="orm"
- nsURI="jpt.eclipselink.orm.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm">
- <eClassifiers xsi:type="ecore:EClass" name="XmlAccessMethods">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="getMethod" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="setMethod" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAccessMethodsHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="accessMethods" eType="#//XmlAccessMethods"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAdditionalCriteria" eSuperTypes="#//v2_2/XmlAdditionalCriteria_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlArray" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_3/XmlArray_2_3 #//XmlConvertibleMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributeMapping" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAttributeMapping #//XmlAccessMethodsHolder #//XmlPropertyContainer">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="attributeType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="Attributes" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//Attributes #//v2_3/XmlAttributes_2_3">
- <eStructuralFeatures xsi:type="ecore:EReference" name="basicCollections" upperBound="-1"
- eType="#//XmlBasicCollection" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="basicMaps" upperBound="-1"
- eType="#//XmlBasicMap" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="transformations" upperBound="-1"
- eType="#//XmlTransformation" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="variableOneToOnes" upperBound="-1"
- eType="#//XmlVariableOneToOne" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlBasic #//v1_1/XmlBasic_1_1 #//v2_1/XmlBasic_2_1 #//v2_2/XmlBasic_2_2 #//v2_4/XmlBasic_2_4 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping #//XmlConverterContainer"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicCollection" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_2/XmlBasicCollection_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicMap" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_2/XmlBasicMap_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBatchFetch" eSuperTypes="#//v2_1/XmlBatchFetch_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBatchFetchHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="batchFetch" eType="#//XmlBatchFetch"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCache" eSuperTypes="#//v2_2/XmlCache_2_2 #//v2_4/XmlCache_2_4">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="expiry" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="size" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="shared" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//CacheType"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="alwaysRefresh" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="refreshOnlyIfNewer" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="disableHits" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="coordinationType" eType="#//CacheCoordinationType"
- defaultValueLiteral=""/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="expiryTimeOfDay" eType="#//XmlTimeOfDay"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCacheHolder" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cache" eType="#//XmlCache"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="existenceChecking" eType="#//ExistenceType"
- defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCacheIndex" eSuperTypes="#//v2_4/XmlCacheIndex_2_4"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlChangeTracking">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//XmlChangeTrackingType"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlChangeTrackingHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="changeTracking" eType="#//XmlChangeTracking"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCloneCopyPolicy">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="method" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="workingCopyMethod" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCollectionTable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlCollectionTable #//v2_2/XmlCollectionTable_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConversionValue">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConverter" eSuperTypes="#//XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="className" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConverterContainer" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="converters" upperBound="-1"
- eType="#//XmlConverter" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="typeConverters" upperBound="-1"
- eType="#//XmlTypeConverter" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="objectTypeConverters" upperBound="-1"
- eType="#//XmlObjectTypeConverter" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="structConverters" upperBound="-1"
- eType="#//XmlStructConverter" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlConvertibleMapping" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlConvertibleMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="convert" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCopyPolicy">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="class" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCustomizer">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="customizerClassName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCustomizerHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="customizer" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlElementCollection #//v2_0/XmlElementCollection_2_0 #//v2_1/XmlElementCollection_2_1 #//v2_2/XmlElementCollection_2_2 #//v2_3/XmlElementCollection_2_3 #//v2_4/XmlElementCollection_2_4"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbeddable #//XmlTypeMapping #//v2_2/XmlEmbeddable_2_2 #//v2_3/XmlEmbeddable_2_3 #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlConverterContainer #//XmlPropertyContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="copyPolicy" eType="#//XmlCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="instantiationCopyPolicy"
- eType="#//XmlInstantiationCopyPolicy" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="cloneCopyPolicy" eType="#//XmlCloneCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultMappings"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbedded" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbedded #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddedId" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEmbeddedId #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEntity #//XmlTypeMapping #//v1_1/XmlEntity_1_1 #//v2_0/XmlEntity_2_0 #//v2_1/XmlEntity_2_1 #//v2_2/XmlEntity_2_2 #//v2_3/XmlEntity_2_3 #//v2_4/XmlEntity_2_4 #//XmlReadOnly #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlCacheHolder #//XmlConverterContainer #//XmlQueryContainer #//XmlPropertyContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="optimisticLocking" eType="#//XmlOptimisticLocking"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="copyPolicy" eType="#//XmlCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="instantiationCopyPolicy"
- eType="#//XmlInstantiationCopyPolicy" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="cloneCopyPolicy" eType="#//XmlCloneCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultMappings"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlEntityMappings #//v2_1/XmlEntityMappings_2_1 #//v2_2/XmlEntityMappings_2_2 #//v2_3/XmlEntityMappings_2_3 #//XmlConverterContainer #//XmlQueryContainer"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchAttribute" eSuperTypes="#//v2_1/XmlFetchAttribute_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchGroup" eSuperTypes="#//v2_1/XmlFetchGroup_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlHashPartitioning" eSuperTypes="#//v2_2/XmlHashPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlId #//v2_2/XmlId_2_2 #//v2_4/XmlId_2_4 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping #//XmlConverterContainer"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlIndex" eSuperTypes="#//v2_2/XmlIndex_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlInstantiationCopyPolicy"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinFetch" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="joinFetch" eType="#//XmlJoinFetchType"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlJoinTable #//v2_2/XmlJoinTable_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlManyToMany #//v2_0/XmlManyToMany_2_0 #//v2_1/XmlManyToMany_2_1 #//v2_2/XmlManyToMany_2_2 #//XmlAttributeMapping #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlManyToOne #//v2_1/XmlManyToOne_2_1 #//v2_2/XmlManyToOne_2_2 #//XmlAttributeMapping #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlMappedSuperclass #//XmlTypeMapping #//v1_1/XmlMappedSuperclass_1_1 #//v2_0/XmlMappedSuperclass_2_0 #//v2_1/XmlMappedSuperclass_2_1 #//v2_2/XmlMappedSuperclass_2_2 #//v2_3/XmlMappedSuperclass_2_3 #//v2_4/XmlMappedSuperclass_2_4 #//XmlReadOnly #//XmlCustomizerHolder #//XmlChangeTrackingHolder #//XmlCacheHolder #//XmlConverterContainer #//XmlPropertyContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="optimisticLocking" eType="#//XmlOptimisticLocking"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="copyPolicy" eType="#//XmlCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="instantiationCopyPolicy"
- eType="#//XmlInstantiationCopyPolicy" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="cloneCopyPolicy" eType="#//XmlCloneCopyPolicy"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultMappings"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultitenant" eSuperTypes="#//v2_3/XmlMultitenant_2_3 #//v2_4/XmlMultitenant_2_4"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultitenantHolder" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="multitenant" eType="#//XmlMultitenant"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMutable" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mutable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedPlsqlStoredFunctionQuery" eSuperTypes="#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedPlsqlStoredProcedureQuery" eSuperTypes="#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedStoredFunctionQuery" eSuperTypes="#//v2_3/XmlNamedStoredFunctionQuery_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedStoredProcedureQuery">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="resultClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="resultSetMapping" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="procedureName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="returnsResultSet" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="hints" upperBound="-1"
- eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlQueryHint"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="parameters" upperBound="-1"
- eType="#//XmlStoredProcedureParameter" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlObjectTypeConverter" eSuperTypes="#//XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="conversionValues" upperBound="-1"
- eType="#//XmlConversionValue" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultObjectValue" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlOneToMany #//v2_0/XmlOneToMany_2_0 #//v2_1/XmlOneToMany_2_1 #//v2_2/XmlOneToMany_2_2 #//v2_4/XmlOneToMany_2_4 #//XmlAttributeMapping #//XmlPrivateOwned #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlOneToOne #//v2_1/XmlOneToOne_2_1 #//v2_2/XmlOneToOne_2_2 #//XmlAttributeMapping #//XmlPrivateOwned #//XmlJoinFetch"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOptimisticLocking">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//XmlOptimisticLockingType"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascade" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="selectedColumns" upperBound="-1"
- eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlColumn"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrderColumn" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlOrderColumn #//v2_0/XmlOrderColumn_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPartitioning" eSuperTypes="#//v2_2/XmlPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlPersistenceUnitDefaults #//v2_1/XmlPersistenceUnitDefaults_2_1 #//v2_3/XmlPersistenceUnitDefaults_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitMetadata" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlPersistenceUnitMetadata">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="excludeDefaultMappings"
- eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPinnedPartitioning" eSuperTypes="#//v2_2/XmlPinnedPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPlsqlRecord" eSuperTypes="#//v2_3/XmlPlsqlRecord_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPlsqlTable" eSuperTypes="#//v2_3/XmlPlsqlTable_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrimaryKey" eSuperTypes="#//v1_1/XmlPrimaryKey_1_1 #//v2_1/XmlPrimaryKey_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrivateOwned" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="privateOwned" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlProperty">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="value" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="valueType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPropertyContainer" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="properties" upperBound="-1"
- eType="#//XmlProperty" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryContainer" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedStoredProcedureQueries"
- upperBound="-1" eType="#//XmlNamedStoredProcedureQuery" containment="true"
- resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryRedirectors" eSuperTypes="#//v2_0/XmlQueryRedirectors_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlRangePartitioning" eSuperTypes="#//v2_2/XmlRangePartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReadOnly" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="readOnly" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReplicationPartitioning" eSuperTypes="#//v2_2/XmlReplicationPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReturnInsert" eSuperTypes="#//v2_1/XmlReturnInsert_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlRoundRobinPartitioning" eSuperTypes="#//v2_2/XmlRoundRobinPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSecondaryTable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlSecondaryTable #//v2_2/XmlSecondaryTable_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStoredProcedureParameter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="direction" eType="#//XmlDirection"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="queryParameter" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="jdbcType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="jdbcTypeName" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStruct" eSuperTypes="#//v2_3/XmlStruct_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStructConverter" eSuperTypes="#//XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="converter" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStructure" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_3/XmlStructure_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTable" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlTable #//v2_2/XmlTable_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTableGenerator" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlTableGenerator #//v2_2/XmlTableGenerator_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTenantDiscriminatorColumn" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlBaseDiscriminatorColumn #//v2_3/XmlTenantDiscriminatorColumn_2_3"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTimeOfDay">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="hour" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="minute" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="second" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="millisecond" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransformation" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTransient" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlTransient #//XmlAttributeMapping"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTypeConverter" eSuperTypes="#//XmlNamedConverter">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="dataType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="objectType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTypeMapping" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlTypeMapping #//v2_1/XmlTypeMapping_2_1"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlUnionPartitioning" eSuperTypes="#//v2_2/XmlUnionPartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlValuePartitioning" eSuperTypes="#//v2_2/XmlValuePartitioning_2_2"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVariableOneToOne" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//AbstractXmlAttributeMapping #//XmlAttributeMapping #//v2_2/XmlVariableOneToOne_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="targetInterface" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlVersion #//v2_2/XmlVersion_2_2 #//XmlAttributeMapping #//XmlMutable #//XmlConvertibleMapping #//XmlConverterContainer"/>
- <eClassifiers xsi:type="ecore:EEnum" name="CacheCoordinationType">
- <eLiterals name="SEND_OBJECT_CHANGES"/>
- <eLiterals name="INVALIDATE_CHANGED_OBJECTS" value="1"/>
- <eLiterals name="SEND_NEW_OBJECTS_WITH_CHANGES" value="2"/>
- <eLiterals name="NONE" value="3"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="CacheType">
- <eLiterals name="FULL"/>
- <eLiterals name="WEAK" value="1"/>
- <eLiterals name="SOFT" value="2"/>
- <eLiterals name="SOFT_WEAK" value="3"/>
- <eLiterals name="HARD_WEAK" value="4"/>
- <eLiterals name="CACHE" value="5"/>
- <eLiterals name="NONE" value="6"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlChangeTrackingType">
- <eLiterals name="ATTRIBUTE" literal="ATTRIBUTE"/>
- <eLiterals name="OBJECT" value="1"/>
- <eLiterals name="DEFERRED" value="2"/>
- <eLiterals name="AUTO" value="3"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlDirection">
- <eLiterals name="IN"/>
- <eLiterals name="OUT" value="1" literal="OUT"/>
- <eLiterals name="IN_OUT" value="2" literal="IN_OUT"/>
- <eLiterals name="OUT_CURSOR" value="3" literal="OUT_CURSOR"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="ExistenceType">
- <eLiterals name="CHECK_CACHE"/>
- <eLiterals name="CHECK_DATABASE" value="1"/>
- <eLiterals name="ASSUME_EXISTENCE" value="2"/>
- <eLiterals name="ASSUME_NON_EXISTENCE" value="3"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlJoinFetchType">
- <eLiterals name="INNER"/>
- <eLiterals name="OUTER" value="1" literal="OUTER"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="XmlOptimisticLockingType">
- <eLiterals name="ALL_COLUMNS"/>
- <eLiterals name="CHANGED_COLUMNS" value="1" literal="CHANGED_COLUMNS"/>
- <eLiterals name="SELECTED_COLUMNS" value="2" literal="SELECTED_COLUMNS"/>
- <eLiterals name="VERSION_COLUMN" value="3" literal="VERSION_COLUMN"/>
- </eClassifiers>
- <eSubpackages name="v1_1" nsURI="jpt.eclipselink.orm.v1_1.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1">
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_1_1" abstract="true" interface="true"
- eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlGeneratorContainer">
- <eStructuralFeatures xsi:type="ecore:EReference" name="generatedValue" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlGeneratedValue"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_1_1" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKey" eType="#//XmlPrimaryKey"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_1_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="primaryKey" eType="#//XmlPrimaryKey"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrimaryKey_1_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="validation" eType="#//v1_1/IdValidationType_1_1"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="columns" upperBound="-1"
- eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlColumn"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="IdValidationType_1_1">
- <eLiterals name="NULL"/>
- <eLiterals name="ZERO" value="2"/>
- <eLiterals name="NONE" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_0" nsURI="jpt.eclipselink.orm.v2_0.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0">
- <eClassifiers xsi:type="ecore:EClass" name="XmlCollectionMapping_2_0" abstract="true"
- interface="true" eSuperTypes="#//v2_0/XmlMapKeyAssociationOverrideContainer_2_0 #//XmlConverterContainer">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="mapKeyConvert" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_0" abstract="true"
- interface="true" eSuperTypes="#//XmlAttributeMapping #//XmlConvertibleMapping #//v2_0/XmlCollectionMapping_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_0" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheInterceptor" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="queryRedirectors" eType="#//XmlQueryRedirectors"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany_2_0" abstract="true"
- interface="true" eSuperTypes="#//v2_0/XmlCollectionMapping_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMapKeyAssociationOverrideContainer_2_0"
- abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="mapKeyAssociationOverrides"
- upperBound="-1" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAssociationOverride"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_0" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//v2_0/XmlCacheable_2_0">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheInterceptor" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_0" abstract="true"
- interface="true" eSuperTypes="#//v2_0/XmlCollectionMapping_2_0"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOrderColumn_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="correctionType" eType="#//v2_0/OrderCorrectionType_2_0"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlQueryRedirectors_2_0" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="allQueries" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="readAll" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="readObject" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="report" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="update" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="insert" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="delete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="OrderCorrectionType_2_0">
- <eLiterals name="READ"/>
- <eLiterals name="READ_WRITE" value="1"/>
- <eLiterals name="EXCEPTION" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_1" nsURI="jpt.eclipselink.orm.v2_1.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1">
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_2_1" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="returnInsert" eType="#//XmlReturnInsert"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="returnUpdate" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBatchFetch_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="size" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//IntObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="batchFetchType" eType="#//v2_1/BatchFetchType_2_1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlJoinFetch #//XmlBatchFetchHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_1" abstract="true" interface="true"
- eSuperTypes="#//v2_1/XmlTypeMapping_2_1 #//v2_1/XmlFetchGroupContainer_2_1">
- <eStructuralFeatures xsi:type="ecore:EReference" name="classExtractor" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlClassReference"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlAccessMethodsHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchAttribute_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchGroup_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="load" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="attributes" upperBound="-1"
- eType="#//XmlFetchAttribute" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlFetchGroupContainer_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="fetchGroups" upperBound="-1"
- eType="#//XmlFetchGroup" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlBatchFetchHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlBatchFetchHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_1" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAssociationOverrideContainer ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAttributeOverrideContainer #//v2_1/XmlFetchGroupContainer_2_1 ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlGeneratorContainer ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlQueryContainer #//XmlQueryContainer #//v2_1/XmlTypeMapping_2_1">
- <eStructuralFeatures xsi:type="ecore:EReference" name="sqlResultSetMappings"
- upperBound="-1" eType="ecore:EClass ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//SqlResultSetMapping"
- containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="queryRedirectors" eType="#//XmlQueryRedirectors"
- containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlBatchFetchHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne_2_1" abstract="true" interface="true"
- eSuperTypes="#//XmlBatchFetchHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlAccessMethodsHolder"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPrimaryKey_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cacheKeyType" eType="#//v2_1/CacheKeyType_2_1"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReturnInsert_2_1" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="returnOnly" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTypeMapping_2_1" abstract="true"
- interface="true" eSuperTypes="#//XmlAccessMethodsHolder">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="parentClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="CacheKeyType_2_1">
- <eLiterals name="ID_VALUE" literal="ID_VALUE"/>
- <eLiterals name="CACHE_KEY" value="1"/>
- <eLiterals name="AUTO" value="2"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="BatchFetchType_2_1">
- <eLiterals name="JOIN"/>
- <eLiterals name="EXISTS" value="1"/>
- <eLiterals name="IN" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_2" nsURI="jpt.eclipselink.orm.v2_2.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2">
- <eClassifiers xsi:type="ecore:EClass" name="XmlAdditionalCriteria_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="criteria" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="index" eType="#//v2_2/XmlIndex_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicCollection_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasicMap_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCache_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="isolation" eType="#//v2_2/CacheIsolationType"
- defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCollectionTable_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="noncacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable_2_2" abstract="true"
- interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAttributeOverrideContainer ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlAssociationOverrideContainer"/>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_2" abstract="true" interface="true"
- eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EReference" name="additionalCriteria" eType="#//v2_2/XmlAdditionalCriteria_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="index" eType="#//v2_2/XmlIndex_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="partitioning" upperBound="-1"
- eType="#//v2_2/XmlPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="replicationPartitioning"
- upperBound="-1" eType="#//v2_2/XmlReplicationPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="roundRobinPartitioning"
- upperBound="-1" eType="#//v2_2/XmlRoundRobinPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="pinnedPartitioning" upperBound="-1"
- eType="#//v2_2/XmlPinnedPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="rangePartitioning" upperBound="-1"
- eType="#//v2_2/XmlRangePartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="valuePartitioning" upperBound="-1"
- eType="#//v2_2/XmlValuePartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="hashPartitioning" upperBound="-1"
- eType="#//v2_2/XmlHashPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="unionPartitioning" upperBound="-1"
- eType="#//v2_2/XmlUnionPartitioning_2_2" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlHashPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="index" eType="#//v2_2/XmlIndex_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlIndex_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="schema" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="catalog" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="table" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="unique" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="columnNames" unique="false"
- upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlJoinTable_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToMany_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonCacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlManyToOne_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonCacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EReference" name="additionalCriteria" eType="#//v2_2/XmlAdditionalCriteria_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToOne_2_2" abstract="true" interface="true"
- eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonCacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="cascadeOnDelete" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="noncacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPartitioningGroup_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="partitioning" eType="#//v2_2/XmlPartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="replicationPartitioning"
- eType="#//v2_2/XmlReplicationPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="roundRobinPartitioning"
- eType="#//v2_2/XmlRoundRobinPartitioning_2_2" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="pinnedPartitioning" eType="#//v2_2/XmlPinnedPartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="rangePartitioning" eType="#//v2_2/XmlRangePartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="valuePartitioning" eType="#//v2_2/XmlValuePartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="hashPartitioning" eType="#//v2_2/XmlHashPartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="unionPartitioning" eType="#//v2_2/XmlUnionPartitioning_2_2"
- containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="partitioned" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPinnedPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlRangePartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlReplicationPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlRoundRobinPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlSecondaryTable_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTable_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTableGenerator_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationSuffix" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlUnionPartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlValuePartitioning_2_2" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVariableOneToOne_2_2" abstract="true"
- interface="true" eSuperTypes="#//v2_2/XmlPartitioningGroup_2_2">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="nonCacheable" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlVersion_2_2" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="index" eType="#//v2_2/XmlIndex_2_2"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="CacheIsolationType">
- <eLiterals name="SHARED"/>
- <eLiterals name="PROTECTED" value="1" literal="PROTECTED"/>
- <eLiterals name="ISOLATED" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_3" nsURI="jpt.eclipselink.orm.v2_3.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3">
- <eClassifiers xsi:type="ecore:EClass" name="XmlArray_2_3" abstract="true" interface="true"
- eSuperTypes="#//XmlConverterContainer ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlConvertibleMapping ../../org.eclipse.jpt.jpa.core/model/orm.ecore#//ColumnMapping">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="databaseType" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="targetClass" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlAttributes_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="structures" upperBound="-1"
- eType="#//v2_3/XmlStructure_2_3" containment="true" resolveProxies="false"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="arrays" upperBound="-1"
- eType="#//v2_3/XmlArray_2_3" containment="true" resolveProxies="false"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="compositeMember" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEmbeddable_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlRecords" upperBound="-1"
- eType="#//v2_3/XmlPlsqlRecord_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlTables" upperBound="-1"
- eType="#//XmlPlsqlTable" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="struct" eType="#//v2_3/XmlStruct_2_3"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_3" abstract="true" interface="true"
- eSuperTypes="#//XmlMultitenantHolder">
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredProcedureQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlRecords" upperBound="-1"
- eType="#//v2_3/XmlPlsqlRecord_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlTables" upperBound="-1"
- eType="#//XmlPlsqlTable" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="struct" eType="#//v2_3/XmlStruct_2_3"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntityMappings_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="tenantDiscriminatorColumns"
- upperBound="-1" eType="#//v2_3/XmlTenantDiscriminatorColumn_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredProcedureQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlRecords" upperBound="-1"
- eType="#//v2_3/XmlPlsqlRecord_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlTables" upperBound="-1"
- eType="#//XmlPlsqlTable" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_3" abstract="true"
- interface="true" eSuperTypes="#//XmlMultitenantHolder">
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredFunctionQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="namedPlsqlStoredProcedureQueries"
- upperBound="-1" eType="#//v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlRecords" upperBound="-1"
- eType="#//v2_3/XmlPlsqlRecord_2_3" containment="true"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="plsqlTables" upperBound="-1"
- eType="#//XmlPlsqlTable" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultitenant_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" eType="#//v2_3/MultitenantType"/>
- <eStructuralFeatures xsi:type="ecore:EReference" name="tenantDiscriminatorColumns"
- upperBound="-1" eType="#//v2_3/XmlTenantDiscriminatorColumn_2_3" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedPlsqlStoredFunctionQuery_2_3"
- abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedPlsqlStoredProcedureQuery_2_3"
- abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlNamedStoredFunctionQuery_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPersistenceUnitDefaults_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="tenantDiscriminatorColumns"
- upperBound="-1" eType="#//v2_3/XmlTenantDiscriminatorColumn_2_3" containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPlsqlRecord_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlPlsqlTable_2_3" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStruct_2_3" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlTenantDiscriminatorColumn_2_3"
- abstract="true" interface="true" eSuperTypes="../../org.eclipse.jpt.jpa.core/model/orm.ecore#//XmlBaseDiscriminatorColumn">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="contextProperty" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="table" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="primaryKey" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlStructure_2_3" abstract="true"
- interface="true"/>
- <eClassifiers xsi:type="ecore:EEnum" name="MultitenantType">
- <eLiterals name="SINGLE_TABLE"/>
- <eLiterals name="TABLE_PER_TENANT" value="1" literal="TABLE_PER_TENANT"/>
- <eLiterals name="VPD" value="2"/>
- </eClassifiers>
- </eSubpackages>
- <eSubpackages name="v2_4" nsURI="jpt.eclipselink.orm.v2_4.xmi" nsPrefix="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4">
- <eClassifiers xsi:type="ecore:EClass" name="XmlBasic_2_4" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheIndex" eType="#//v2_4/XmlCacheIndex_2_4"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCache_2_4" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="databaseChangeNotificationType"
- eType="#//v2_4/DatabaseChangeNotificationType" defaultValueLiteral=""/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlCacheIndex_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="columnNames" unique="false"
- upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlElementCollection_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="deleteAll" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlEntity_2_4" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheIndex" eType="#//v2_4/XmlCacheIndex_2_4"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlId_2_4" abstract="true" interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheIndex" eType="#//v2_4/XmlCacheIndex_2_4"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMappedSuperclass_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EReference" name="cacheIndex" eType="#//v2_4/XmlCacheIndex_2_4"
- containment="true"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlMultitenant_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="includeCriteria" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//BooleanObject"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EClass" name="XmlOneToMany_2_4" abstract="true"
- interface="true">
- <eStructuralFeatures xsi:type="ecore:EAttribute" name="deleteAll" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//Boolean"/>
- </eClassifiers>
- <eClassifiers xsi:type="ecore:EEnum" name="DatabaseChangeNotificationType">
- <eLiterals name="NONE"/>
- <eLiterals name="INVALIDATION" value="1" literal="INVALIDATION"/>
- </eClassifiers>
- </eSubpackages>
-</ecore:EPackage>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties
deleted file mode 100644
index e070816f6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - JPA EclipseLink Support - Core
-providerName = Eclipse Web Tools Platform
-
-ECLIPSELINK_ORM_XML_CONTENT = EclipseLink XML mapping files
-
-ECLIPSELINK_PLATFORM_GROUP_LABEL=EclipseLink
-ECLIPSELINK1_0_x_PLATFORM = EclipseLink 1.0.x
-ECLIPSELINK1_1_x_PLATFORM = EclipseLink 1.1.x
-ECLIPSELINK1_2_x_PLATFORM = EclipseLink 1.2.x
-ECLIPSELINK2_0_x_PLATFORM = EclipseLink 2.0.x
-ECLIPSELINK2_1_x_PLATFORM = EclipseLink 2.1.x
-ECLIPSELINK2_2_x_PLATFORM = EclipseLink 2.2.x
-ECLIPSELINK2_3_x_PLATFORM = EclipseLink 2.3.x
-ECLIPSELINK2_4_x_PLATFORM = EclipseLink 2.4.x
-
-builderName = Eclipselink Static Weaving Builder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
deleted file mode 100644
index ca9b42c072..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/plugin.xml
+++ /dev/null
@@ -1,205 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- Copyright (c) 2008, 2012 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.core.contenttype.contentTypes">
-
- <content-type
- id="org.eclipse.jpt.jpa.eclipselink.core.content.orm"
- name="%ECLIPSELINK_ORM_XML_CONTENT"
- base-type="org.eclipse.jpt.jpa.core.content.mappingFile">
- <describer
- class="org.eclipse.core.runtime.content.XMLRootElementContentDescriber2">
- <parameter
- name="element"
- value="{http://www.eclipse.org/eclipselink/xsds/persistence/orm}entity-mappings"/>
- </describer>
- </content-type>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.jpa.core.jpaPlatforms">
-
- <jpaPlatformGroup
- id="eclipselink"
- label="%ECLIPSELINK_PLATFORM_GROUP_LABEL"/>
-
- <jpaPlatform
- id="org.eclipse.eclipselink.platform"
- label="%ECLIPSELINK1_0_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="1.0"/>
-
- <jpaPlatform
- id="eclipselink1_1"
- label="%ECLIPSELINK1_1_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink1_1JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="1.0"/>
-
- <jpaPlatform
- id="eclipselink1_2"
- label="%ECLIPSELINK1_2_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink1_2JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="1.0"/>
-
- <jpaPlatform
- id="eclipselink2_0"
- label="%ECLIPSELINK2_0_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
-
- <jpaPlatform
- id="eclipselink2_1"
- label="%ECLIPSELINK2_1_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_1JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
-
- <jpaPlatform
- id="eclipselink2_2"
- label="%ECLIPSELINK2_2_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_2JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
-
- <jpaPlatform
- id="eclipselink2_3"
- label="%ECLIPSELINK2_3_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_3JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
-
- <jpaPlatform
- id="eclipselink2_4"
- label="%ECLIPSELINK2_4_x_PLATFORM"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_4JpaPlatformFactory"
- group="eclipselink"
- jpaFacetVersion="2.0"/>
- </extension>
-
-
- <extension
- point="org.eclipse.jpt.common.core.libraryValidators">
-
- <libraryValidator
- id="eclipselinkLibraryValidator"
- class="org.eclipse.jpt.jpa.eclipselink.core.internal.libval.EclipseLinkUserLibraryValidator">
- <enablement>
- <and>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId"
- value="jpa-user-library-provider"/>
- </with>
- <with variable="config">
- <adapt type = "org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription">
- <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup"
- value="eclipselink"/>
- </adapt>
- </with>
- </and>
- </enablement>
- </libraryValidator>
-
- <libraryValidator
- id="eclipselinkEclipselinkBundlesLibraryValidator"
- class="org.eclipse.jpt.jpa.eclipselink.core.internal.libval.EclipseLinkEclipseLinkBundlesLibraryValidator">
- <enablement>
- <and>
- <with variable="libraryProvider">
- <test property="org.eclipse.jpt.common.core.extendsId"
- value="eclipselink-bundles-library-provider"/>
- </with>
- <with variable="config">
- <adapt type = "org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription">
- <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup"
- value="eclipselink"/>
- </adapt>
- </with>
- </and>
- </enablement>
- </libraryValidator>
-
- </extension>
-
-
- <extension
- point="org.eclipse.jst.common.project.facet.core.libraryProviders">
-
- <provider
- id="jpa-eclipselink1_0-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- <provider
- id="jpa-eclipselink1_1-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- <provider
- id="jpa-eclipselink1_2-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- <provider
- id="eclipselink2_0-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- <provider
- id="jpa-eclipselink2_1-user-library-provider"
- extends="jpa-deprecated-user-library-provider"
- hidden="true">
- </provider>
-
- </extension>
-
-
- <extension
- id="builder"
- name="%builderName"
- point="org.eclipse.core.resources.builders">
-
- <builder hasNature="false">
- <run class="org.eclipse.jpt.jpa.eclipselink.core.builder.EclipselinkStaticWeavingBuilder"/>
- </builder>
- </extension>
-
-
-
- <!-- ***** WTP extensions ***** -->
-
- <extension
- point="org.eclipse.wst.common.modulecore.resourceFactories">
-
- <resourceFactory
- class="org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmXmlResourceFactory"
- isDefault="true">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.jpa.eclipselink.core.content.orm">
- </contentTypeBinding>
- </resourceFactory>
-
- </extension>
-
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties
deleted file mode 100644
index 2ee8408491..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/eclipselink_jpa_validation.properties
+++ /dev/null
@@ -1,65 +0,0 @@
-################################################################################
-# Copyright (c) 2008, 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-CACHE_EXPIRY_AND_EXPIRY_TIME_OF_DAY_BOTH_SPECIFIED=The @Cache annotation on entity \"{0}\" has both expiry() and expiryTimeOfDay() specified. Only one of the two may be specified
-CONVERTER_CLASS_EXISTS=The converter class \"{0}\" does not exist on the project classpath
-CONVERTER_CLASS_DEFINED=The converter class must be defined.
-CONVERTER_CLASS_IMPLEMENTS_CONVERTER=The converter class \"{0}\" does not implement the org.eclipse.persistence.mappings.converters.Converter interface
-STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER=The struct converter class \"{0}\" does not implement the org.eclipse.persistence.platform.database.converters.StructConverter interface
-CONVERTER_DUPLICATE_NAME=Multiple converters named \"{0}\" defined in this persistence unit
-CONVERTER_NAME_UNDEFINED=Converter is unnamed. All converters require a name.
-RESERVED_CONVERTER_NAME=Converter name must not be a reserved converter name.
-DESCRIPTOR_CUSTOMIZER_CLASS_NOT_SPECIFIED=An entity customizer class should be specified
-DESCRIPTOR_CUSTOMIZER_CLASS_NOT_EXIST=The entity customizer class \"{0}\" does not exist on the project classpath
-DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID=The entity customizer class \"{0}\" must have a public, zero-argument constructor
-DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER=The entity customizer class \"{0}\" does not implement the org.eclipse.persistence.config.DescriptorCustomizer interface
-EXCEPTION_HANDLER_CLASS_NOT_SPECIFIED=An exception handler class should be specified
-EXCEPTION_HANDLER_CLASS_NOT_EXIST=The exception handler class \"{0}\" does not exist on the project classpath
-EXCEPTION_HANDLER_CLASS_NOT_VALID=The exception handler class \"{0}\" must have a public, zero-argument constructor
-EXCEPTION_HANDLER_CLASS_IMPLEMENTS_EXCEPTION_HANDLER=The exception handler class \"{0}\" does not implement the org.eclipse.persistence.exceptions.ExceptionHandler interface
-GENERATOR_DUPLICATE_NAME=Multiple generators named \"{0}\" defined in this persistence unit
-GENERATOR_EQUIVALENT=Equivalent generator \"{0}\" defined in this persistence unit, which may not be portable
-ID_MAPPING_UNRESOLVED_CONVERTER_NAME=The specified converter \"{0}\" for mapping \"{1}\" cannot be resolved
-MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE=Multiple object values are specified for the data value \"{0}\"
-PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE=The persistent field or property for a Version mapping must be of type int, Integer, short, Short, long, Long, or Timestamp
-PERSISTENCE_UNIT_LEGACY_DESCRIPTOR_CUSTOMIZER=\"{0}\" is a legacy descriptor customizer property. Consider migration to the EclipseLink customizer settings via annotation or XML mapping file
-PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING=\"{0}\" is a legacy entity caching property. Consider migration to JPA 2.0 and EclipseLink cache settings via annotation or XML mapping file
-PERSISTENCE_UNIT_CACHING_PROPERTY_IGNORED=Property \"{0}\" will be ignored as shared-cache-mode is set to NONE
-QUERY_DUPLICATE_NAME=Multiple queries named \"{0}\" defined in this persistence unit
-QUERY_EQUIVALENT=Equivalent query \"{0}\" defined in this persistence unit, which may not be portable
-SESSION_CUSTOMIZER_CLASS_NOT_SPECIFIED=A session customizer class should be specified
-SESSION_CUSTOMIZER_CLASS_NOT_EXIST=The session customizer class \"{0}\" does not exist on the project classpath
-SESSION_CUSTOMIZER_CLASS_NOT_VALID=The session customizer class \"{0}\" must have a public, zero-argument constructor
-SESSION_CUSTOMIZER_CLASS_IMPLEMENTS_SESSION_CUSTOMIZER=The session customizer class \"{0}\" does not implement the org.eclipse.persistence.config.SessionCustomizer interface
-SESSION_LOGGER_CLASS_NOT_SPECIFIED=A session logger class should be specified
-SESSION_LOGGER_CLASS_NOT_EXIST=The session logger class \"{0}\" does not exist on the project classpath
-SESSION_LOGGER_CLASS_IMPLEMENTS_SESSION_LOG=The session logger class \"{0}\" does not implement the org.eclipse.persistence.logging.SessionLog interface
-SESSION_PROFILER_CLASS_NOT_SPECIFIED=A session profiler class should be specified
-SESSION_PROFILER_CLASS_NOT_EXIST=The session profiler class \"{0}\" does not exist on the project classpath
-SESSION_PROFILER_CLASS_NOT_VALID=The session profiler class \"{0}\" must have a public, zero-argument constructor
-SESSION_PROFILER_CLASS_IMPLEMENTS_SESSION_PROFILER=The session profiler class \"{0}\" does not implement the org.eclipse.persistence.sessions.SessionProfiler interface
-BASIC_COLLECTION_MAPPING_DEPRECATED=The type basic-collection is deprecated
-BASIC_MAP_MAPPING_DEPRECATED=The type basic-map is deprecated
-TYPE_MAPPING_MEMBER_CLASS_NOT_STATIC=The java class for mapped type \"{0}\" is a non-static member class
-TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=Tenant discriminator column \"{0}\" cannot be resolved on table \"{1}\"
-VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=In default tenant discriminator column, name \"{0}\" cannot be resolved on table \"{1}\"
-VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=In implied attribute \"{0}\", tenant discriminator column \"{1}\" cannot be resolved on table \"{2}\"
-TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID=Table \"{0}\" for tenant discriminator column \"{1}\" {2}
-VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID=In default tenant discriminator column \"{1}\", table \"{0}\" {2}
-VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID=In implied attribute \"{0}\", table \"{1}\" for tenant discriminator column \"{2}\" {3}
-MULTITENANT_NOT_SPECIFIED_WITH_TENANT_DISCRIMINATOR_COLUMNS=Tenant discriminator columns cannot be specified without the Multitenant annotation
-MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY=Multitenant metadata cannot be specified on non-root entities in a SINGLE_TABLE or JOINED inheritance hierarchy
-MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED=EclipseLink does not support MultitenantType.TABLE_PER_TENANT
-MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED=Target database is not specified in the persistence.xml, multitenancy with Oracle VPD might not be supported
-MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM=Target database is \"{0}\", multitenancy with Oracle VPD is only supported on Oracle platform
-MULTITENANT_VPD_INCLUDE_CRITERIA_WILL_BE_IGNORED=Include criteria is false when multitenant type is VPD. The specified setting will be ignored.
-VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED=Virtual attribute \"{0}\" must specify an attribute-type
-VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST=Attribute type \"{0}\" does not exist
-VIRTUAL_TYPE_PARENT_CLASS_DOES_NOT_EXIST=Parent class \"{0}\" does not exist \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/jpt_jpa_eclipselink_core.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/jpt_jpa_eclipselink_core.properties
deleted file mode 100644
index 6636a82260..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/property_files/jpt_jpa_eclipselink_core.properties
+++ /dev/null
@@ -1,11 +0,0 @@
-################################################################################
-# Copyright (c) 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-JAVA_METADATA_CONVERSION_CONVERT_CONVERTER=Converting Java converter ''{0}''
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkJpaProject.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkJpaProject.java
deleted file mode 100644
index 4bbe6840ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkJpaProject.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-
-/**
- * EclipseLink JPA project.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJpaProject
- extends JpaProject
-{
-
- /**
- * Return the resource model object that corresponds to the file
- * <code>META-INF/eclipselink-orm.xml</code> if that file has the
- * EclipseLink content type.
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin#DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH
- * @see org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin#ECLIPSELINK_ORM_XML_CONTENT_TYPE
- */
- JpaXmlResource getDefaultEclipseLinkOrmXmlResource();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkMappingKeys.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkMappingKeys.java
deleted file mode 100644
index 5a9c2b398e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/EclipseLinkMappingKeys.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public interface EclipseLinkMappingKeys {
-
- String BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY = "basicCollection";
- String BASIC_MAP_ATTRIBUTE_MAPPING_KEY = "basicMap";
- String TRANSFORMATION_ATTRIBUTE_MAPPING_KEY = "transformation";
- String VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY = "variableOneToOne";
-
- //EclipseLink 2.3 mapping keys
- String STRUCTURE_ATTRIBUTE_MAPPING_KEY = "structure";
- String ARRAY_ATTRIBUTE_MAPPING_KEY = "array";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/JptJpaEclipseLinkCorePlugin.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/JptJpaEclipseLinkCorePlugin.java
deleted file mode 100644
index 401ee1ae0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/JptJpaEclipseLinkCorePlugin.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class JptJpaEclipseLinkCorePlugin
- extends Plugin
-{
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.eclipselink.core"; //$NON-NLS-1$
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- /**
- * Version string for EclipseLink platform version 1.0
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_1_0 = "1.0"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 1.1
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_1_1 = "1.1"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 1.2
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_1_2 = "1.2"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.0
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_0 = "2.0"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.1
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_1 = "2.1"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.2
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_2 = "2.2"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.3
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_3 = "2.3"; //$NON-NLS-1$
-
- /**
- * Version string for EclipseLink platform version 2.4
- */
- public static final String ECLIPSELINK_PLATFORM_VERSION_2_4 = "2.4"; //$NON-NLS-1$
-
- /**
- * Value of the content-type for eclipselink-orm.xml mappings files. Use this
- * value to retrieve the ORM xml content type from the content type manager
- * and to add new eclipselink-orm.xml-like extensions to this content type.
- *
- * @see org.eclipse.core.runtime.content.IContentTypeManager#getContentType(String)
- */
- public static final IContentType ECLIPSELINK_ORM_XML_CONTENT_TYPE =
- Platform.getContentTypeManager().getContentType(PLUGIN_ID_ + "content.orm"); //$NON-NLS-1$
-
- /**
- * The resource type for eclipselink-orm.xml version 1.0 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 1.1 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink1_1.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 1.1 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink1_2.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.0 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_0.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.1 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_1.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.2 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_2_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_2.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.3 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_3_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_3.SCHEMA_VERSION);
-
- /**
- * The resource type for eclipselink-orm.xml version 2.4 mapping files
- */
- public static final JptResourceType ECLIPSELINK_ORM_XML_2_4_RESOURCE_TYPE
- = new JptResourceType(ECLIPSELINK_ORM_XML_CONTENT_TYPE, EclipseLink2_4.SCHEMA_VERSION);
-
- public static final IPath DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH = new Path("META-INF/eclipselink-orm.xml"); //$NON-NLS-1$
-
-
- // ********** singleton **********
- private static JptJpaEclipseLinkCorePlugin INSTANCE;
-
- /**
- * Return the singleton JPT EclipseLink plug-in.
- */
- public static JptJpaEclipseLinkCorePlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** public static methods **********
-
- public static boolean nodeIsEclipseLink2_3Compatible(JpaNode jpaNode) {
- return nodeIsEclipseLinkVersionCompatible(jpaNode, ECLIPSELINK_PLATFORM_VERSION_2_3);
- }
-
- public static boolean nodeIsEclipseLink2_4Compatible(JpaNode jpaNode) {
- return nodeIsEclipseLinkVersionCompatible(jpaNode, ECLIPSELINK_PLATFORM_VERSION_2_4);
- }
-
- public static boolean nodeIsEclipseLinkVersionCompatible(JpaNode jpaNode, String version) {
- return ((EclipseLinkVersion) jpaNode.getJpaProject().getJpaPlatform().getJpaVersion()).isCompatibleWithVersion(version);
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(msg, null);
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(throwable.getLocalizedMessage(), throwable);
- }
-
- /**
- * Log the specified message and exception or error.
- */
- public static void log(String msg, Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, throwable));
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJpaEclipseLinkCorePlugin() {
- super();
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- INSTANCE = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- INSTANCE = null;
- super.stop(context);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/builder/EclipselinkStaticWeavingBuilder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/builder/EclipselinkStaticWeavingBuilder.java
deleted file mode 100644
index cce60ab276..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/builder/EclipselinkStaticWeavingBuilder.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.builder;
-
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.weave.StaticWeave;
-
-public class EclipselinkStaticWeavingBuilder extends IncrementalProjectBuilder
-{
- public static final String BUILDER_ID = JptJpaEclipseLinkCorePlugin.PLUGIN_ID + ".builder"; //$NON-NLS-1$
-
- private StaticWeavingBuilderConfigurator configurator;
-
- // ********** overrides **********
-
- /**
- * Performs static weaving on project's model classes
- */
- @Override
- protected IProject[] build(int kind, Map<String, String> parameters, IProgressMonitor monitor) throws CoreException
- {
- StaticWeave.weave(
- JavaCore.create(this.getProject()),
- this.configurator.getSourceLocationPreference(),
- this.configurator.getTargetLocationPreference(),
- this.configurator.getLogLevelPreference(),
- this.configurator.getPersistenceInfoPreference(),
- monitor);
-
- return new IProject[0];
- }
-
- @Override
- protected void startupOnInitialize() {
- super.startupOnInitialize();
- this.configurator = new StaticWeavingBuilderConfigurator(this.getProject());
- }
-
- @Override
- protected void clean(IProgressMonitor monitor) throws CoreException {
- super.clean(monitor);
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/builder/StaticWeavingBuilderConfigurator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/builder/StaticWeavingBuilderConfigurator.java
deleted file mode 100644
index 107cdbf812..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/builder/StaticWeavingBuilderConfigurator.java
+++ /dev/null
@@ -1,241 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.builder;
-
-import java.util.logging.Level;
-
-import org.eclipse.core.resources.ICommand;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.jpa.core.internal.prefs.JpaPreferencesManager;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-
-/**
- * Configures and coordinates StaticWeaving builder behavior for the project.
- * Also handles the builder preferences.
- */
-public class StaticWeavingBuilderConfigurator extends JpaPreferencesManager
-{
- public static final String BUILDER_ID = EclipselinkStaticWeavingBuilder.BUILDER_ID;
-
- private static final String STATIC_WEAVE_PREFIX = "staticweave."; //$NON-NLS-1$
-
- public static final String SOURCE = "SOURCE"; //$NON-NLS-1$
- public static final String TARGET = "TARGET"; //$NON-NLS-1$
- public static final String LOG_LEVEL = "LOG_LEVEL"; //$NON-NLS-1$
- public static final String PERSISTENCE_INFO = "PERSISTENCE_INFO"; //$NON-NLS-1$
-
- // ********** constructors **********
-
- public StaticWeavingBuilderConfigurator(IProject project) {
-
- super(project);
- }
-
- // ********** builder **********
-
- public void addBuilder() {
- try {
- IProjectDescription description = this.getProject().getDescription();
- ICommand[] commands = description.getBuildSpec();
-
- ICommand newCommand = description.newCommand();
- newCommand.setBuilderName(BUILDER_ID);
-
- ICommand[] newCommands = null;
- if(commands != null) {
- newCommands = new ICommand[commands.length + 1];
- System.arraycopy(commands, 0, newCommands, 0, commands.length);
- newCommands[commands.length] = newCommand;
- }
- else {
- newCommands = new ICommand[1];
- newCommands[0] = newCommand;
- }
- description.setBuildSpec(newCommands);
- this.getProject().setDescription(description, null);
- }
- catch(CoreException ce) {
- // if we can't read the information, the project isn't open
- return;
- }
- }
-
- public boolean projectHasStaticWeavingBuilder() {
-
- try {
- IProjectDescription description = this.getProject().getDescription();
- ICommand[] commands = description.getBuildSpec();
- if(commands.length == 0)
- return false;
- for(int i = 0; i < commands.length; i++) {
- if(commands[i].getBuilderName().equals(BUILDER_ID)) {
- return true;
- }
- }
- return false;
- }
- catch(CoreException ce) {
- // if we can't read the information, the project isn't open
- return false;
- }
- }
-
- public void removeBuilder() {
- try {
- IProjectDescription description = this.getProject().getDescription();
- ICommand[] commands = description.getBuildSpec();
- if(commands.length == 0)
- return;
- int newLength = 0;
- // null out all commands that match BUILDER_ID
- for(int i = 0; i < commands.length; i++) {
- if(commands[i].getBuilderName().equals(BUILDER_ID))
- commands[i] = null;
- else
- newLength++;
- }
- // check if any were actually removed
- if(newLength == commands.length)
- return;
-
- ICommand[] newCommands = new ICommand[newLength];
- for(int i = 0, j = 0; i < commands.length; i++) {
- if(commands[i] != null)
- newCommands[j++] = commands[i];
- }
- description.setBuildSpec(newCommands);
- this.getProject().setDescription(description, IResource.NONE, null);
- }
- catch(CoreException ce) {
- // if we can't read the information, the project isn't open
- return;
- }
- }
-
- // ********** preferences **********
-
- // retrieves preference, if none return default
-
- public String getSourceLocationPreference() {
-
- return this.getLegacyProjectPreference(this.appendPrefix(SOURCE), this.getDefaultSourceLocation());
- }
-
- public String getTargetLocationPreference() {
-
- return this.getLegacyProjectPreference(this.appendPrefix(TARGET), this.getDefaultTargetLocation());
- }
-
- public String getPersistenceInfoPreference() {
-
- return this.getLegacyProjectPreference(this.appendPrefix(PERSISTENCE_INFO), this.getDefaultPersistenceInfo());
- }
-
- public String getLogLevelPreference() {
-
- return this.getLegacyProjectPreference(this.appendPrefix(LOG_LEVEL), this.getDefaultLogLevel());
- }
-
- // default preferences value
-
- public String getDefaultSourceLocation() {
- return this.getJavaProjectOutputLocation();
- }
-
- public String getDefaultTargetLocation() {
- return this.getJavaProjectOutputLocation();
- }
-
- public String getDefaultPersistenceInfo() {
- return null;
- }
-
- public String getDefaultLogLevel() {
- return Level.SEVERE.getName();
- }
-
- public LoggingLevel[] getLogLevelValues() {
-
- return LoggingLevel.values();
- }
-
- // setting and removing preferences
-
- public void setSourceLocationPreference(String location) {
- this.setLegacyProjectPreference(this.appendPrefix(SOURCE), location);
- }
-
- public void removeSourceLocationPreference() {
- this.setLegacyProjectPreference(this.appendPrefix(SOURCE), null);
- }
-
- public void setTargetLocationPreference(String location) {
- this.setLegacyProjectPreference(this.appendPrefix(TARGET), location);
- }
-
- public void removeTargetLocationPreference() {
- this.setLegacyProjectPreference(this.appendPrefix(TARGET), null);
- }
-
- public void setLogLevelPreference(String logLevel) {
- this.setLegacyProjectPreference(this.appendPrefix(LOG_LEVEL), logLevel);
- }
-
- public void removeLogLevelPreference() {
- this.setLegacyProjectPreference(this.appendPrefix(LOG_LEVEL), null);
- }
-
- public void setPersistenceInfoPreference(String persistenceInfo) {
- this.setLegacyProjectPreference(this.appendPrefix(PERSISTENCE_INFO), persistenceInfo);
- }
-
- public void removePersistenceInfoPreference() {
- this.setLegacyProjectPreference(this.appendPrefix(PERSISTENCE_INFO), null);
- }
-
- // ********** private methods **********
-
- private String getJavaProjectOutputLocation() {
- try {
- return this.getJavaProjectOutputLocationPath().toOSString();
- }
- catch (CoreException e) {
- return "."; //$NON-NLS-1$
- }
- }
-
- /**
- * @return output location path relative to the project
- */
- private IPath getJavaProjectOutputLocationPath() throws CoreException {
- IPath outputLocation = this.getJavaProject().getOutputLocation();
- String projectName = outputLocation.segment(0);
-
- if(this.getProject().getName().equals(projectName)) {
- outputLocation = outputLocation.removeFirstSegments(1);
- }
- return outputLocation;
- }
-
- private IJavaProject getJavaProject() {
- return JavaCore.create(this.getProject());
- }
-
- private String appendPrefix(String id) {
- return STATIC_WEAVE_PREFIX + id;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessMethodsHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessMethodsHolder.java
deleted file mode 100644
index e643126a28..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessMethodsHolder.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * Common interface that can be used by clients interested only in a type
- * or attribute's access setting (e.g. a UI composite).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkAccessMethodsHolder
- extends EclipseLinkReadOnlyAccessMethodsHolder
-{
- /**
- * Return the specified get method;
- */
- String getSpecifiedGetMethod();
-
- /**
- * Set the specified access type.
- */
- void setSpecifiedGetMethod(String newSpecifiedGetMethod);
-
- /**
- * String constant associated with changes to the specified get method
- */
- String SPECIFIED_GET_METHOD_PROPERTY = "specifiedGetMethod"; //$NON-NLS-1$
-
- /**
- * Return the default get method
- */
- String getDefaultGetMethod();
-
- /**
- * String constant associated with changes to the default get method
- */
- String DEFAULT_GET_METHOD_PROPERTY = "defaultGetMethod"; //$NON-NLS-1$
-
- /**
- * String constant for the default get method
- */
- String DEFAULT_GET_METHOD = "get"; //$NON-NLS-1$
-
- /**
- * Return the specified set method;
- */
- String getSpecifiedSetMethod();
-
- /**
- * Set the specified access type.
- */
- void setSpecifiedSetMethod(String newSpecifiedSetMethod);
-
- /**
- * String constant associated with changes to the specified get method
- */
- String SPECIFIED_SET_METHOD_PROPERTY = "specifiedSetMethod"; //$NON-NLS-1$
-
- /**
- * Return the default set method, never null
- */
- String getDefaultSetMethod();
-
- /**
- * String constant associated with changes to the default set method
- */
- String DEFAULT_SET_METHOD_PROPERTY = "defaultSetMethod"; //$NON-NLS-1$
-
- /**
- * String constant for the default set method
- */
- String DEFAULT_SET_METHOD = "set"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessType.java
deleted file mode 100644
index e897f3453f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkAccessType.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AccessType;
-
-/**
- * Context model corresponding to:<ul>
- * <li>the XML resource model
- * {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType},
- * which corresponds to the <code>access</code> element in the
- * <code>orm.xml</code> file.
- * <li>the Java resource model {@link org.eclipse.jpt.jpa.core.resource.java.AccessType}
- * which corresponds to the <code>javax.persistence.Access</code> annotation.
- * </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 3.2
- * @since 3.2
- */
-public class EclipseLinkAccessType extends AccessType {
-
- public static final AccessType VIRTUAL = new AccessType(
- null,
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL,
- "Virtual" //$NON-NLS-1$
- );
-
-
- public EclipseLinkAccessType(org.eclipse.jpt.jpa.core.resource.java.AccessType javaAccessType, String ormAccessType, String displayString) {
- super(javaAccessType, ormAccessType, displayString);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkArrayMapping2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkArrayMapping2_3.java
deleted file mode 100644
index 5f2b19d96d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkArrayMapping2_3.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.ColumnMapping;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-
-/**
- * EclipseLink array mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkArrayMapping2_3
- extends AttributeMapping, ConvertibleMapping, EclipseLinkConvertibleMapping, ColumnMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index dba2c1bfac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink basic collection mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkBasicCollectionMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapMapping.java
deleted file mode 100644
index d39716b6d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink basic map mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkBasicMapMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java
deleted file mode 100644
index 7483180887..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkBasicMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-
-/**
- * EclipseLink basic mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface EclipseLinkBasicMapping
- extends BasicMapping, EclipseLinkConvertibleMapping
-{
- EclipseLinkMutable getMutable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheCoordinationType.java
deleted file mode 100644
index ea8581e80d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheCoordinationType.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum EclipseLinkCacheCoordinationType {
-
- SEND_OBJECT_CHANGES,
- INVALIDATE_CHANGED_OBJECTS,
- SEND_NEW_OBJECTS_WITH_CHANGES,
- NONE;
-
-
- public static EclipseLinkCacheCoordinationType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType javaCacheCoordinationType) {
- if (javaCacheCoordinationType == null) {
- return null;
- }
- switch (javaCacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return NONE;
- default:
- throw new IllegalArgumentException("unknown cache coordination type: " + javaCacheCoordinationType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType toJavaResourceModel(EclipseLinkCacheCoordinationType cacheCoordinationType) {
- if (cacheCoordinationType == null) {
- return null;
- }
- switch (cacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.NONE;
- default:
- throw new IllegalArgumentException("unknown cache coordination type: " + cacheCoordinationType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkCacheCoordinationType fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType ormCacheCoordinationType) {
- if (ormCacheCoordinationType == null) {
- return null;
- }
- switch (ormCacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return NONE;
- default:
- throw new IllegalArgumentException("unknown cache coordination type: " + ormCacheCoordinationType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType toOrmResourceModel(EclipseLinkCacheCoordinationType cacheCoordinationType) {
- if (cacheCoordinationType == null) {
- return null;
- }
- switch (cacheCoordinationType) {
- case SEND_OBJECT_CHANGES:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.NONE;
- default:
- throw new IllegalArgumentException("unknown cache coordination type: " + cacheCoordinationType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheIsolationType2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheIsolationType2_2.java
deleted file mode 100644
index c01e3c2000..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheIsolationType2_2.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- * corresponds to EclipseLink org.eclipse.persistence.config.CacheIsolationType
- * which was added in EclipseLink 2.2
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public enum EclipseLinkCacheIsolationType2_2 {
-
- SHARED,
- PROTECTED,
- ISOLATED;
-
-
- public static EclipseLinkCacheIsolationType2_2 fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2 javaCacheIsolationType) {
- if (javaCacheIsolationType == null) {
- return null;
- }
- switch (javaCacheIsolationType) {
- case SHARED:
- return SHARED;
- case PROTECTED:
- return PROTECTED;
- case ISOLATED:
- return ISOLATED;
- default:
- throw new IllegalArgumentException("unknown cache isolation type: " + javaCacheIsolationType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2 toJavaResourceModel(EclipseLinkCacheIsolationType2_2 cacheIsolationType) {
- if (cacheIsolationType == null) {
- return null;
- }
- switch (cacheIsolationType) {
- case SHARED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.SHARED;
- case PROTECTED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.PROTECTED;
- case ISOLATED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.ISOLATED;
- default:
- throw new IllegalArgumentException("unknown cache isolation type: " + cacheIsolationType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkCacheIsolationType2_2 fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType ormCacheIsolationType) {
- if (ormCacheIsolationType == null) {
- return null;
- }
- switch (ormCacheIsolationType) {
- case SHARED:
- return SHARED;
- case PROTECTED:
- return PROTECTED;
- case ISOLATED:
- return ISOLATED;
- default:
- throw new IllegalArgumentException("unknown cache isolation type: " + ormCacheIsolationType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType toOrmResourceModel(EclipseLinkCacheIsolationType2_2 cacheIsolationType) {
- if (cacheIsolationType == null) {
- return null;
- }
- switch (cacheIsolationType) {
- case SHARED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType.SHARED;
- case PROTECTED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType.PROTECTED;
- case ISOLATED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType.ISOLATED;
- default:
- throw new IllegalArgumentException("unknown cache isolation type: " + cacheIsolationType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheType.java
deleted file mode 100644
index 921db50bdd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCacheType.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum EclipseLinkCacheType {
-
- SOFT_WEAK,
- HARD_WEAK,
- WEAK,
- SOFT,
- FULL,
- CACHE,
- NONE;
-
-
- public static EclipseLinkCacheType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType javaCacheType) {
- if (javaCacheType == null) {
- return null;
- }
- switch (javaCacheType) {
- case FULL:
- return FULL;
- case WEAK:
- return WEAK;
- case SOFT:
- return SOFT;
- case SOFT_WEAK:
- return SOFT_WEAK;
- case HARD_WEAK:
- return HARD_WEAK;
- case CACHE:
- return CACHE;
- case NONE:
- return NONE;
- default:
- throw new IllegalArgumentException("unknown cache type: " + javaCacheType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType toJavaResourceModel(EclipseLinkCacheType cacheType) {
- if (cacheType == null) {
- return null;
- }
- switch (cacheType) {
- case FULL:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.FULL;
- case WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.WEAK;
- case SOFT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.SOFT;
- case SOFT_WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.SOFT_WEAK;
- case HARD_WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.HARD_WEAK;
- case CACHE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.CACHE;
- case NONE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.NONE;
- default:
- throw new IllegalArgumentException("unknown cache type: " + cacheType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkCacheType fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType ormCacheType) {
- if (ormCacheType == null) {
- return null;
- }
- switch (ormCacheType) {
- case FULL:
- return FULL;
- case WEAK:
- return WEAK;
- case SOFT:
- return SOFT;
- case SOFT_WEAK:
- return SOFT_WEAK;
- case HARD_WEAK:
- return HARD_WEAK;
- case CACHE:
- return CACHE;
- case NONE:
- return NONE;
- default:
- throw new IllegalArgumentException("unknown cache type: " + ormCacheType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType toOrmResourceModel(EclipseLinkCacheType cacheType) {
- if (cacheType == null) {
- return null;
- }
- switch (cacheType) {
- case FULL:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL;
- case WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.WEAK;
- case SOFT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.SOFT;
- case SOFT_WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.SOFT_WEAK;
- case HARD_WEAK:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.HARD_WEAK;
- case CACHE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.CACHE;
- case NONE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.NONE;
- default:
- throw new IllegalArgumentException("unknown cache type: " + cacheType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java
deleted file mode 100644
index a1e9a42cec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCaching.java
+++ /dev/null
@@ -1,237 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink caching
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 2.1
- */
-// TODO bjv EclipseLinkCachingPolicy
-public interface EclipseLinkCaching
- extends JpaContextNode
-{
- // ********** type **********
-
- /**
- * This is the combination of defaultType and specifiedType.
- * If getSpecifiedType() returns null, then return getDefaultType()
- */
- EclipseLinkCacheType getType();
-
- EclipseLinkCacheType getSpecifiedType();
- void setSpecifiedType(EclipseLinkCacheType type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- EclipseLinkCacheType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
- EclipseLinkCacheType DEFAULT_TYPE = EclipseLinkCacheType.SOFT_WEAK;
-
-
- // ********** size **********
-
- /**
- * This is the combination of defaultSize and specifiedSize.
- * If getSpecifiedSize() returns null, then return getDefaultSize()
- */
- int getSize();
-
- Integer getSpecifiedSize();
- void setSpecifiedSize(Integer size);
- String SPECIFIED_SIZE_PROPERTY = "specifiedSize"; //$NON-NLS-1$
-
- int getDefaultSize();
- String DEFAULT_SIZE_PROPERTY = "defaultSize"; //$NON-NLS-1$
- int DEFAULT_SIZE = 100;
-
-
- // ********** shared **********
-
- /**
- * This is the combination of defaultShared and specifiedShared.
- * If getSpecifiedShared() returns null, then return isDefaultShared()
- */
- boolean isShared();
-
- Boolean getSpecifiedShared();
-
- /**
- * Specifying <em>shared</em> <code>false</code> will return the following
- * caching settings to their defaults:<ul>
- * <li>type
- * <li>size
- * <li>always refresh
- * <li>refresh only if newer
- * <li>disable hits
- * <li>coordination type
- * </ul>
- * Additionally, the following settings will be cleared:<ul>
- * <li>expiry
- * <li>expiry time of day
- * </ul>
- * These settings do not apply to an unchared cache.
- */
- void setSpecifiedShared(Boolean shared);
- String SPECIFIED_SHARED_PROPERTY = "specifiedShared"; //$NON-NLS-1$
-
- boolean isDefaultShared();
- String DEFAULT_SHARED_PROPERTY = "defaultShared"; //$NON-NLS-1$
- boolean DEFAULT_SHARED = true;
-
-
- // ********** always refresh **********
-
- /**
- * This is the combination of defaultAlwaysRefresh and specifiedAlwaysRefresh.
- * If getSpecifiedAlwaysRefresh() returns null, then return isDefaultAlwaysRefresh()
- */
- boolean isAlwaysRefresh();
-
- Boolean getSpecifiedAlwaysRefresh();
- void setSpecifiedAlwaysRefresh(Boolean alwaysRefresh);
- String SPECIFIED_ALWAYS_REFRESH_PROPERTY = "specifiedAlwaysRefresh"; //$NON-NLS-1$
-
- boolean isDefaultAlwaysRefresh();
- String DEFAULT_ALWAYS_REFRESH_PROPERTY = "defaultAlwaysRefresh"; //$NON-NLS-1$
- boolean DEFAULT_ALWAYS_REFRESH = false;
-
-
- // ********** refresh only if newer **********
-
- /**
- * This is the combination of defaultRefreshOnlyIfNewer and specifiedRefreshOnlyIfNewer.
- * If getSpecifiedRefreshOnlyIfNewer() returns null, then return isDefaultRefreshOnlyIfNewer()
- */
- boolean isRefreshOnlyIfNewer();
-
- Boolean getSpecifiedRefreshOnlyIfNewer();
- void setSpecifiedRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer);
- String SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY = "specifiedRefreshOnlyIfNewer"; //$NON-NLS-1$
-
- boolean isDefaultRefreshOnlyIfNewer();
- String DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY = "defaultRefreshOnlyIfNewer"; //$NON-NLS-1$
- boolean DEFAULT_REFRESH_ONLY_IF_NEWER = false;
-
-
- // ********** disable hits **********
-
- /**
- * This is the combination of defaultDisableHits and specifiedDisableHits.
- * If getSpecifiedDisableHits() returns null, then return getDefaultDisableHits()
- */
- boolean isDisableHits();
-
- Boolean getSpecifiedDisableHits();
- void setSpecifiedDisableHits(Boolean disableHits);
- String SPECIFIED_DISABLE_HITS_PROPERTY = "specifiedDisableHits"; //$NON-NLS-1$
-
- boolean isDefaultDisableHits();
- String DEFAULT_DISABLE_HITS_PROPERTY = "defaultDisableHits"; //$NON-NLS-1$
- boolean DEFAULT_DISABLE_HITS = false;
-
-
- // ********** coordination type **********
-
- /**
- * This is the combination of defaultCoordinationType and specifiedCoordinationType.
- * If getSpecifiedCoordinationType() returns null, then return getDefaultCoordinationType()
- */
- EclipseLinkCacheCoordinationType getCoordinationType();
-
- EclipseLinkCacheCoordinationType getSpecifiedCoordinationType();
- void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType coordinationType);
- String SPECIFIED_COORDINATION_TYPE_PROPERTY = "specifiedCoordinationType"; //$NON-NLS-1$
-
- EclipseLinkCacheCoordinationType getDefaultCoordinationType();
- String DEFAULT_COORDINATION_TYPE_PROPERTY = "defaultCoordinationType"; //$NON-NLS-1$
- EclipseLinkCacheCoordinationType DEFAULT_COORDINATION_TYPE = EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES;
-
-
- // ********** expiry **********
-
- /**
- * corresponds to the Cache expiry element. If this returns
- * a non-null value then getExpiryTimeOfDay will return null.
- * It is not valid to specify both
- */
- Integer getExpiry();
-
- /**
- * Setting this to a non-null value will set timeOfDayExpiry to null
- */
- void setExpiry(Integer expiry);
- String EXPIRY_PROPERTY = "expiry"; //$NON-NLS-1$
-
-
- // ********** expiry time of day **********
-
- /**
- * corresponds to the Cache expiryTimeOfDay annotation or xml element.
- * If this returns a non-null value then getExpiry will return null.
- * It is not valid to specify both.
- */
- EclipseLinkTimeOfDay getExpiryTimeOfDay();
- String EXPIRY_TIME_OF_DAY_PROPERTY = "expiryTimeOfDay"; //$NON-NLS-1$
-
- /**
- * Add Cache expiryTimeOfDay annotation or xml element, this will set
- * Expiry to null as it is not valid to set both expiry and timeOfDayExpiry
- */
- EclipseLinkTimeOfDay addExpiryTimeOfDay();
-
- /**
- * Removes the Cache expiryTimeOfDay annotation/xml element
- */
- void removeExpiryTimeOfDay();
-
-
- // ********** existence type **********
- // TODO bjv rename existenceCheckingPolicy
- /**
- * This is the combination of defaultExistenceType and specifiedExistenceType.
- * If getSpecifiedExistenceType() returns null, then return getDefaultExistenceType()
- */
- EclipseLinkExistenceType getExistenceType();
-
- EclipseLinkExistenceType getSpecifiedExistenceType();
- void setSpecifiedExistenceType(EclipseLinkExistenceType type);
- String SPECIFIED_EXISTENCE_TYPE_PROPERTY = "specifiedExistenceType"; //$NON-NLS-1$
-
- EclipseLinkExistenceType getDefaultExistenceType();
- String DEFAULT_EXISTENCE_TYPE_PROPERTY = "defaultExistenceType"; //$NON-NLS-1$
- EclipseLinkExistenceType DEFAULT_EXISTENCE_TYPE = EclipseLinkExistenceType.CHECK_DATABASE;
-
-
- // ********** isolation added in EclipseLink 2.2 **********
-
- /**
- * This is the combination of defaultIsolation and specifiedIsolation.
- * If getSpecifiedIsolation() returns null, then return getDefaultIsolation()
- */
- EclipseLinkCacheIsolationType2_2 getIsolation();
-
- EclipseLinkCacheIsolationType2_2 getSpecifiedIsolation();
- void setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2 isolation);
- String SPECIFIED_ISOLATION_PROPERTY = "specifiedIsolation"; //$NON-NLS-1$
-
- EclipseLinkCacheIsolationType2_2 getDefaultIsolation();
- String DEFAULT_ISOLATION_PROPERTY = "defaultIsolation"; //$NON-NLS-1$
- EclipseLinkCacheIsolationType2_2 DEFAULT_ISOLATION = EclipseLinkCacheIsolationType2_2.SHARED;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTracking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTracking.java
deleted file mode 100644
index bf4afe83cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTracking.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink change tracking
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkChangeTracking
- extends JpaContextNode
-{
- /**
- * Return the specified type if it is present, otherwise return the default
- * type.
- */
- EclipseLinkChangeTrackingType getType();
-
- EclipseLinkChangeTrackingType getSpecifiedType();
- void setSpecifiedType(EclipseLinkChangeTrackingType type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- EclipseLinkChangeTrackingType getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
- EclipseLinkChangeTrackingType DEFAULT_TYPE = EclipseLinkChangeTrackingType.AUTO;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTrackingType.java
deleted file mode 100644
index 114d5a75f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkChangeTrackingType.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum EclipseLinkChangeTrackingType {
-
- ATTRIBUTE,
- OBJECT,
- DEFERRED,
- AUTO;
-
-
- public static EclipseLinkChangeTrackingType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType javaChangeTrackingType) {
- if (javaChangeTrackingType == null) {
- return null;
- }
- switch (javaChangeTrackingType) {
- case ATTRIBUTE:
- return ATTRIBUTE;
- case OBJECT:
- return OBJECT;
- case DEFERRED:
- return DEFERRED;
- case AUTO:
- return AUTO;
- default:
- throw new IllegalArgumentException("unknown change tracking type: " + javaChangeTrackingType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType toJavaResourceModel(EclipseLinkChangeTrackingType changeTrackingType) {
- if (changeTrackingType == null) {
- return null;
- }
- switch (changeTrackingType) {
- case ATTRIBUTE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE;
- case OBJECT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT;
- case DEFERRED:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED;
- case AUTO:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO;
- default:
- throw new IllegalArgumentException("unknown change tracking type: " + changeTrackingType); //$NON-NLS-1$
- }
- }
-
- public static EclipseLinkChangeTrackingType fromOrmResourceModel(XmlChangeTrackingType ormChangeTrackingType) {
- if (ormChangeTrackingType == null) {
- return null;
- }
- switch (ormChangeTrackingType) {
- case ATTRIBUTE:
- return ATTRIBUTE;
- case OBJECT:
- return OBJECT;
- case DEFERRED:
- return DEFERRED;
- case AUTO:
- return AUTO;
- default:
- throw new IllegalArgumentException("unknown change tracking type: " + ormChangeTrackingType); //$NON-NLS-1$
- }
- }
-
- public static XmlChangeTrackingType toOrmResourceModel(EclipseLinkChangeTrackingType changeTrackingType) {
- if (changeTrackingType == null) {
- return null;
- }
- switch (changeTrackingType) {
- case ATTRIBUTE:
- return XmlChangeTrackingType.ATTRIBUTE;
- case OBJECT:
- return XmlChangeTrackingType.OBJECT;
- case DEFERRED:
- return XmlChangeTrackingType.DEFERRED;
- case AUTO:
- return XmlChangeTrackingType.AUTO;
- default:
- throw new IllegalArgumentException("unknown change tracking type: " + changeTrackingType); //$NON-NLS-1$
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConversionValue.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConversionValue.java
deleted file mode 100644
index af0c1650e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConversionValue.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Corresponds to a ConversionValue resource model object
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkConversionValue
- extends JpaContextNode
-{
- EclipseLinkObjectTypeConverter getParent();
-
- String getDataValue();
- void setDataValue(String dataValue);
- String DATA_VALUE_PROPERTY = "dataValue"; //$NON-NLS-1$
-
- String getObjectValue();
- void setObjectValue(String objectValue);
- String OBJECT_VALUE_PROPERTY = "objectValue"; //$NON-NLS-1$
-
- /**
- * Return whether the conversion value has the same state as the specified
- * conversion value.
- */
- boolean isEquivalentTo(EclipseLinkConversionValue conversionValue);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java
deleted file mode 100644
index e37f336d91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvert.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-
-/**
- * EclipseLink convert (not to be confused with EclipseLink converter)
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface EclipseLinkConvert
- extends Converter
-{
-
- EclipseLinkPersistenceUnit getPersistenceUnit();
-
- String getConverterName();
-
- String getSpecifiedConverterName();
- void setSpecifiedConverterName(String converterName);
- String SPECIFIED_CONVERTER_NAME_PROPERTY = "specifiedConverterName"; //$NON-NLS-1$
-
- String getDefaultConverterName();
- String DEFAULT_CONVERTER_NAME_PROPERTY = "defaultConverterName"; //$NON-NLS-1$
-
- /**
- * Reserved name for specifying a serialized object converter.
- * In this case a corresponding @CustomConverter is unnecessary.
- */
- String SERIALIZED_CONVERTER = "serialized"; //$NON-NLS-1$
-
- /**
- * Reserved name for specifying a class instance converter.
- * Will use a ClassInstanceConverter
- * on the associated mapping. When using a ClassInstanceConverter the database representation is a
- * String representing the Class name and the object-model representation is an instance
- * of that class built with the zero-argument constructor.
- * In this case a corresponding @CustomConverter is unnecessary.
- */
- String CLASS_INSTANCE_CONVERTER = "class-instance"; //$NON-NLS-1$
-
- /**
- * Reserved name for specifying no converter.
- * This can be used to override a situation where either
- * another converter is defaulted or another converter is set.
- * In this case a corresponding @CustomConverter is unnecessary.
- */
- String NO_CONVERTER = "none"; //$NON-NLS-1$
-
- String[] RESERVED_CONVERTER_NAMES = {NO_CONVERTER, CLASS_INSTANCE_CONVERTER, SERIALIZED_CONVERTER};
-
- String DEFAULT_CONVERTER_NAME = NO_CONVERTER;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverter.java
deleted file mode 100644
index c10376fc63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverter.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
- import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-
-/**
- * EclipseLink converter:<ul>
- * <li>Type ({@link EclipseLinkTypeConverter})
- * <li>Object Type ({@link EclipseLinkObjectTypeConverter})
- * <li>Struct ({@link EclipseLinkStructConverter})
- * <li>Custom ({@link EclipseLinkCustomConverter})
- * </ul>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkConverter
- extends JpaNamedContextNode
-{
- /**
- * Return the converter's type.
- */
- Class<? extends EclipseLinkConverter> getType();
- @SuppressWarnings("unchecked")
- Iterable<Class<? extends EclipseLinkConverter>> TYPES = new ArrayIterable<Class<? extends EclipseLinkConverter>>(
- EclipseLinkCustomConverter.class,
- EclipseLinkObjectTypeConverter.class,
- EclipseLinkStructConverter.class,
- EclipseLinkTypeConverter.class
- );
-
-
- /**
- * Return the character to be used for browsing or creating the converter
- * class {@link org.eclipse.jdt.core.IType IType}.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getEnclosingTypeSeparator();
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterClassConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterClassConverter.java
deleted file mode 100644
index a3f400d922..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterClassConverter.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * Corresponds to a *ConverterClassConverter resource model object
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.4
- */
-
-public interface EclipseLinkConverterClassConverter
- extends EclipseLinkConverter
-{
- String getConverterClass();
- String CONVERTER_CLASS_PROPERTY = "converterClass"; //$NON-NLS-1$
- void setConverterClass(String converterClass);
-
- String getFullyQualifiedConverterClass();
- String FULLY_QUALIFIED_CONVERTER_CLASS_PROPERTY = "fullyQualifiedConverterClass"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterContainer.java
deleted file mode 100644
index 826c5e6ddd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConverterContainer.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-
-/**
- * EclipseLink converter container
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkConverterContainer
- extends JpaContextNode
-{
- Iterable<EclipseLinkConverter> getConverters();
-
- int getConvertersSize();
-
- int getNumberSupportedConverters();
-
-
- //************ customConverters *********************
-
- /**
- * Return a list iterator of the custom converters.
- * This will not be null.
- */
- ListIterable<? extends EclipseLinkCustomConverter> getCustomConverters();
-
- /**
- * Return the number of custom converters.
- */
- int getCustomConvertersSize();
-
- /**
- * Add a custom converter to the converter holder, return the object representing it.
- */
- EclipseLinkCustomConverter addCustomConverter(int index);
-
- /**
- * Remove the custom converter at the index from the converter holder.
- */
- void removeCustomConverter(int index);
-
- /**
- * Remove the custom converter at from the converter holder.
- */
- void removeCustomConverter(EclipseLinkCustomConverter converter);
-
- /**
- * Move the custom converter from the source index to the target index.
- */
- void moveCustomConverter(int targetIndex, int sourceIndex);
-
- String CUSTOM_CONVERTERS_LIST = "customConverters"; //$NON-NLS-1$
-
-
- //************ object type converters *********************
-
- /**
- * Return a list iterator of the object type converters.
- * This will not be null.
- */
- ListIterable<? extends EclipseLinkObjectTypeConverter> getObjectTypeConverters();
-
- /**
- * Return the number of object type converters.
- */
- int getObjectTypeConvertersSize();
-
- /**
- * Add a object type converter to the converter holder, return the object representing it.
- */
- EclipseLinkObjectTypeConverter addObjectTypeConverter(int index);
-
- /**
- * Remove the object type converter at the index from the converter holder.
- */
- void removeObjectTypeConverter(int index);
-
- /**
- * Remove the object type converter at from the converter holder.
- */
- void removeObjectTypeConverter(EclipseLinkObjectTypeConverter converter);
-
- /**
- * Move the object type converter from the source index to the target index.
- */
- void moveObjectTypeConverter(int targetIndex, int sourceIndex);
-
- String OBJECT_TYPE_CONVERTERS_LIST = "objectTypeConverters"; //$NON-NLS-1$
-
-
- //************ struct converters *********************
-
- /**
- * Return a list iterator of the struct converters.
- * This will not be null.
- */
- ListIterable<? extends EclipseLinkStructConverter> getStructConverters();
-
- /**
- * Return the number of struct converters.
- */
- int getStructConvertersSize();
-
- /**
- * Add a struct converter to the converter holder, return the object representing it.
- */
- EclipseLinkStructConverter addStructConverter(int index);
-
- /**
- * Remove the struct converter at the index from the converter holder.
- */
- void removeStructConverter(int index);
-
- /**
- * Remove the struct converter at from the converter holder.
- */
- void removeStructConverter(EclipseLinkStructConverter converter);
-
- /**
- * Move the struct converter from the source index to the target index.
- */
- void moveStructConverter(int targetIndex, int sourceIndex);
-
- String STRUCT_CONVERTERS_LIST = "structConverters"; //$NON-NLS-1$
-
-
- //************ type converters *********************
-
- /**
- * Return a list iterator of the type converters.
- * This will not be null.
- */
- ListIterable<? extends EclipseLinkTypeConverter> getTypeConverters();
-
- /**
- * Return the number of type converters.
- */
- int getTypeConvertersSize();
-
- /**
- * Add a type converter to the converter holder, return the object representing it.
- */
- EclipseLinkTypeConverter addTypeConverter(int index);
-
- /**
- * Remove the type converter at the index from the converter holder.
- */
- void removeTypeConverter(int index);
-
- /**
- * Remove the type converter at from the converter holder.
- */
- void removeTypeConverter(EclipseLinkTypeConverter converter);
-
- /**
- * Move the type converter from the source index to the target index.
- */
- void moveTypeConverter(int targetIndex, int sourceIndex);
-
- String TYPE_CONVERTERS_LIST = "typeConverters"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvertibleMapping.java
deleted file mode 100644
index 4d4057d4a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkConvertibleMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * EclipseLink convertible mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkConvertibleMapping
-{
- EclipseLinkConverterContainer getConverterContainer();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomConverter.java
deleted file mode 100644
index ed43b5cacc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomConverter.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * EclipseLink custom converter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkCustomConverter
- extends EclipseLinkConverterClassConverter
-{
- String ECLIPSELINK_CONVERTER_CLASS_NAME = "org.eclipse.persistence.mappings.converters.Converter"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java
deleted file mode 100644
index dd52236b30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkCustomizer.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Corresponds to a Customizer resource model object
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface EclipseLinkCustomizer
- extends JpaContextNode
-{
- String getCustomizerClass();
-
- String getSpecifiedCustomizerClass();
- void setSpecifiedCustomizerClass(String customizerClass);
- String SPECIFIED_CUSTOMIZER_CLASS_PROPERTY = "specifiedCustomizerClass"; //$NON-NLS-1$
- String ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME = "org.eclipse.persistence.config.DescriptorCustomizer"; //$NON-NLS-1$
-
- String getDefaultCustomizerClass();
- String DEFAULT_CUSTOMIZER_CLASS_PROPERTY = "defaultCustomizerClass"; //$NON-NLS-1$
-
- String getFullyQualifiedCustomizerClass();
- String FULLY_QUALIFIED_CUSTOMIZER_CLASS_PROPERTY = "fullyQualifiedCustomizerClass"; //$NON-NLS-1$
-
- /**
- * Return the char to be used for browsing or creating the customizer class IType.
- * @see org.eclipse.jdt.core.IType#getFullyQualifiedName(char)
- */
- char getCustomizerClassEnclosingTypeSeparator();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkElementCollectionMapping2_0.java
deleted file mode 100644
index 49f0555b16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-
-/**
- * EclipseLink element collection mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.3
- */
-public interface EclipseLinkElementCollectionMapping2_0
- extends ElementCollectionMapping2_0, EclipseLinkJoinFetchMapping, EclipseLinkConvertibleMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEmbeddable.java
deleted file mode 100644
index cb838dc67c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEmbeddable.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkEmbeddable
- extends Embeddable, EclipseLinkTypeMapping
-{
- // combine various interfaces
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEntity.java
deleted file mode 100644
index 034e32126c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkEntity.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.Entity;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkEntity
- extends Entity, EclipseLinkNonEmbeddableTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkExistenceType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkExistenceType.java
deleted file mode 100644
index 8d5698ee5e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkExistenceType.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-// TODO bjv rename to EclipseLinkExistenceCheckingPolicy
-public enum EclipseLinkExistenceType {
-
- CHECK_CACHE,
- CHECK_DATABASE,
- ASSUME_EXISTENCE,
- ASSUME_NON_EXISTENCE;
-
-
- public static EclipseLinkExistenceType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType javaExistenceType) {
- if (javaExistenceType == null) {
- return null;
- }
- switch (javaExistenceType) {
- case CHECK_CACHE:
- return CHECK_CACHE;
- case CHECK_DATABASE:
- return CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return ASSUME_NON_EXISTENCE;
- default:
- throw new IllegalArgumentException("unknown existence type: " + javaExistenceType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType toJavaResourceModel(EclipseLinkExistenceType existenceType) {
- if (existenceType == null) {
- return null;
- }
- switch (existenceType) {
- case CHECK_CACHE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.CHECK_CACHE;
- case CHECK_DATABASE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_NON_EXISTENCE;
- default:
- throw new IllegalArgumentException("unknown existence type: " + existenceType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkExistenceType fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType ormExistenceType) {
- if (ormExistenceType == null) {
- return null;
- }
- switch (ormExistenceType) {
- case CHECK_CACHE:
- return CHECK_CACHE;
- case CHECK_DATABASE:
- return CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return ASSUME_NON_EXISTENCE;
- default:
- throw new IllegalArgumentException("unknown existence type: " + ormExistenceType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType toOrmResourceModel(EclipseLinkExistenceType existenceType) {
- if (existenceType == null) {
- return null;
- }
- switch (existenceType) {
- case CHECK_CACHE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.CHECK_CACHE;
- case CHECK_DATABASE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.CHECK_DATABASE;
- case ASSUME_EXISTENCE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_NON_EXISTENCE;
- default:
- throw new IllegalArgumentException("unknown existence type: " + existenceType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java
deleted file mode 100644
index 154ff8be81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkIdMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-
-/**
- * EclipseLink ID mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface EclipseLinkIdMapping
- extends IdMapping, EclipseLinkConvertibleMapping
-{
- EclipseLinkMutable getMutable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetch.java
deleted file mode 100644
index 44fa1cf3f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetch.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkJoinFetch
- extends JpaContextNode
-{
- EclipseLinkJoinFetchType getValue();
- void setValue(EclipseLinkJoinFetchType value);
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
- EclipseLinkJoinFetchType DEFAULT_VALUE = EclipseLinkJoinFetchType.INNER;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java
deleted file mode 100644
index 77966f4d37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchMapping.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink join-fetch mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJoinFetchMapping
- extends AttributeMapping
-{
- EclipseLinkJoinFetch getJoinFetch();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchType.java
deleted file mode 100644
index b61a2c825b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkJoinFetchType.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum EclipseLinkJoinFetchType {
-
- INNER,
- OUTER;
-
-
- public static EclipseLinkJoinFetchType fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType javaJoinFetchType) {
- if (javaJoinFetchType == null) {
- return null;
- }
- switch (javaJoinFetchType) {
- case INNER:
- return INNER;
- case OUTER:
- return OUTER;
- default:
- throw new IllegalArgumentException("unknown join fetch type: " + javaJoinFetchType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType toJavaResourceModel(EclipseLinkJoinFetchType joinFetchType) {
- if (joinFetchType == null) {
- return null;
- }
- switch (joinFetchType) {
- case INNER:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER;
- case OUTER:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER;
- default:
- throw new IllegalArgumentException("unknown join fetch type: " + joinFetchType); //$NON-NLS-1$
- }
- }
-
-
- public static EclipseLinkJoinFetchType fromOrmResourceModel(XmlJoinFetchType ormJoinFetchType) {
- if (ormJoinFetchType == null) {
- return null;
- }
- switch (ormJoinFetchType) {
- case INNER:
- return INNER;
- case OUTER:
- return OUTER;
- default:
- throw new IllegalArgumentException("unknown join fetch type: " + ormJoinFetchType); //$NON-NLS-1$
- }
- }
-
- public static XmlJoinFetchType toOrmResourceModel(EclipseLinkJoinFetchType fetchType) {
- if (fetchType == null) {
- return null;
- }
- switch (fetchType) {
- case INNER:
- return XmlJoinFetchType.INNER;
- case OUTER:
- return XmlJoinFetchType.OUTER;
- default:
- throw new IllegalArgumentException("unknown join fetch type: " + fetchType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkManyToManyMapping.java
deleted file mode 100644
index f179ce1e25..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkManyToManyMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-
-/**
- * EclipseLink relationship (1:1, 1:m, m:1, m:m) mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkManyToManyMapping
- extends ManyToManyMapping, EclipseLinkRelationshipMapping, EclipseLinkConvertibleMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMappedSuperclass.java
deleted file mode 100644
index c417475cc4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMappedSuperclass.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkMappedSuperclass
- extends MappedSuperclass, EclipseLinkNonEmbeddableTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenancy2_3.java
deleted file mode 100644
index 9d3f0aad4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink multitenancy
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface EclipseLinkMultitenancy2_3
- extends JpaContextNode
-{
-
- boolean isMultitenant();
- boolean isDefaultMultitenant();
- String DEFAULT_MULTITENANT_PROPERTY = "defaultMultitenant"; //$NON-NLS-1$
- boolean isSpecifiedMultitenant();
- void setSpecifiedMultitenant(boolean isMultitenant);
- String SPECIFIED_MULTITENANT_PROPERTY = "specifiedMultitenant"; //$NON-NLS-1$
-
- // ********** type **********
-
- /**
- * This is the combination of defaultType and specifiedType.
- * If getSpecifiedType() returns null, then return getDefaultType()
- */
- EclipseLinkMultitenantType2_3 getType();
-
- EclipseLinkMultitenantType2_3 getSpecifiedType();
- void setSpecifiedType(EclipseLinkMultitenantType2_3 type);
- String SPECIFIED_TYPE_PROPERTY = "specifiedType"; //$NON-NLS-1$
-
- EclipseLinkMultitenantType2_3 getDefaultType();
- String DEFAULT_TYPE_PROPERTY = "defaultType"; //$NON-NLS-1$
- EclipseLinkMultitenantType2_3 DEFAULT_TYPE = EclipseLinkMultitenantType2_3.SINGLE_TABLE;
-
-
- // ********** include criteria (EclipseLink 2.4+) **********
-
- /**
- * This is the combination of defaultIncludeCriteria and specifiedIncludeCriteria.
- * If getSpecifiedIncludeCriteria() returns null, then return isDefaultIncludeCriteria()
- */
- boolean isIncludeCriteria();
-
- Boolean getSpecifiedIncludeCriteria();
- void setSpecifiedIncludeCriteria(Boolean includeCriteria);
- String SPECIFIED_INCLUDE_CRITERIA_PROPERTY = "specifiedIncludeCriteria"; //$NON-NLS-1$
-
- boolean isDefaultIncludeCriteria();
- String DEFAULT_INCLUDE_CRITERIA_PROPERTY = "defaultIncludeCriteria"; //$NON-NLS-1$
- boolean DEFAULT_INCLUDE_CRITERIA = true;
-
-
- // ********** tenant discriminator columns **********
-
- /**
- * Return the tenant discriminator columns whether specified or default.
- */
- ListIterable<? extends ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
-
- /**
- * Return the number of tenant discriminator columns, whether specified and default.
- */
- int getTenantDiscriminatorColumnsSize();
-
-
- // ********** specified tenant discriminator columns **********
-
- /**
- * Return a list iterable of the specified tenant discriminator columns.
- * This will not be null.
- */
- ListIterable<? extends TenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns();
- String SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST = "specifiedTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of specified tenant discriminator columns.
- */
- int getSpecifiedTenantDiscriminatorColumnsSize();
-
- /**
- * Return whether there are any specified tenant discriminator columns.
- */
- boolean hasSpecifiedTenantDiscriminatorColumns();
-
- /**
- * Add a specified tenant discriminator column and return the object
- * representing it.
- */
- TenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn();
-
- /**
- * Add a specified tenant discriminator column and return the object
- * representing it.
- */
- TenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index);
-
- /**
- * Remove the specified tenant discriminator column.
- */
- void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn);
-
- /**
- * Remove the specified tenant discriminator column at the index.
- */
- void removeSpecifiedTenantDiscriminatorColumn(int index);
-
- /**
- * Move the specified tenant discriminator column from the source index to the target index.
- */
- void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex);
-
-
- // ********** default tenant discriminator columns **********
-
- /**
- * Return a list iterable of the default tenant discriminator columns.
- * This will not be null. If there are specified tenant discriminator columns
- * then there will be no default tenant discriminator columns.
- */
- ListIterable<? extends VirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns();
- String DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST = "defaultTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of default tenant discriminator columns.
- */
- int getDefaultTenantDiscriminatorColumnsSize();
-
- /**
- * Return whether a TenantDiscriminatorColumn is allowed for this type mapping.
- * It is allowed if it is a mapped-superclass, the root entity in the inheritance hierarchy,
- * or the inheritance strategy is table-per-class
- */
- boolean specifiedTenantDiscriminatorColumnsAllowed();
- String SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_ALLOWED_PROPERTY = "specifiedTenantDiscriminatorColumnsAllowed"; //$NON-NLS-1$
-
-
- /**
- * Return true if any of the tenant discriminator columns (specified or default)
- * have the primaryKey option set to true
- */
- boolean usesPrimaryKeyTenantDiscriminatorColumns();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenantType2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenantType2_3.java
deleted file mode 100644
index 5704e4aaa3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMultitenantType2_3.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public enum EclipseLinkMultitenantType2_3 {
-
- SINGLE_TABLE,
- TABLE_PER_TENANT,
- VPD;
-
-
- public static EclipseLinkMultitenantType2_3 fromJavaResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3 javaMultitenantType) {
- if (javaMultitenantType == null) {
- return null;
- }
- switch (javaMultitenantType) {
- case SINGLE_TABLE:
- return SINGLE_TABLE;
- case TABLE_PER_TENANT:
- return TABLE_PER_TENANT;
- case VPD:
- return VPD;
- default:
- throw new IllegalArgumentException("unknown multitenant type: " + javaMultitenantType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3 toJavaResourceModel(EclipseLinkMultitenantType2_3 multitenantType) {
- if (multitenantType == null) {
- return null;
- }
- switch (multitenantType) {
- case SINGLE_TABLE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3.SINGLE_TABLE;
- case TABLE_PER_TENANT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3.TABLE_PER_TENANT;
- case VPD:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3.VPD;
- default:
- throw new IllegalArgumentException("unknown multitenant type: " + multitenantType); //$NON-NLS-1$
- }
- }
-
- public static EclipseLinkMultitenantType2_3 fromOrmResourceModel(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType ormMultitenantType) {
- if (ormMultitenantType == null) {
- return null;
- }
- switch (ormMultitenantType) {
- case SINGLE_TABLE:
- return SINGLE_TABLE;
- case TABLE_PER_TENANT:
- return TABLE_PER_TENANT;
- case VPD:
- return VPD;
- default:
- throw new IllegalArgumentException("unknown multitenant type: " + ormMultitenantType); //$NON-NLS-1$
- }
- }
-
- public static org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType toOrmResourceModel(EclipseLinkMultitenantType2_3 multitenantType) {
- if (multitenantType == null) {
- return null;
- }
- switch (multitenantType) {
- case SINGLE_TABLE:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType.SINGLE_TABLE;
- case TABLE_PER_TENANT:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType.TABLE_PER_TENANT;
- case VPD:
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType.VPD;
- default:
- throw new IllegalArgumentException("unknown multitenant type: " + multitenantType); //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutable.java
deleted file mode 100644
index 1611e608be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkMutable.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkMutable
- extends JpaContextNode
-{
- boolean isMutable();
-
- Boolean getSpecifiedMutable();
- void setSpecifiedMutable(Boolean mutable);
- String SPECIFIED_MUTABLE_PROPERTY = "specifiedMutable"; //$NON-NLS-1$
-
- boolean isDefaultMutable();
- String DEFAULT_MUTABLE_PROPERTY = "defaultMutable"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java
deleted file mode 100644
index 710f10a5d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkNonEmbeddableTypeMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-
-/**
- * EclipseLink non-embeddable type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkNonEmbeddableTypeMapping
- extends EclipseLinkTypeMapping
-{
- EclipseLinkCaching getCaching();
-
- EclipseLinkReadOnly getReadOnly();
-
- EclipseLinkMultitenancy2_3 getMultitenancy();
-
- /**
- * Used for validating whether tenant discriminator columns may be specified
- */
- boolean isMultitenantMetadataAllowed();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkObjectTypeConverter.java
deleted file mode 100644
index 722b98a808..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkObjectTypeConverter.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * EclipseLink object type converter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface EclipseLinkObjectTypeConverter
- extends EclipseLinkConverter
-{
- // ********** data type **********
-
- String getDataType();
- void setDataType(String dataType);
- String DATA_TYPE_PROPERTY = "dataType"; //$NON-NLS-1$
-
- String getFullyQualifiedDataType();
- String FULLY_QUALIFIED_DATA_TYPE_PROPERTY = "fullyQualifiedDataType"; //$NON-NLS-1$
-
-
- // ********** object type **********
-
- String getObjectType();
- void setObjectType(String objectType);
- String OBJECT_TYPE_PROPERTY = "objectType"; //$NON-NLS-1$
-
- String getFullyQualifiedObjectType();
- String FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY = "fullyQualifiedObjectType"; //$NON-NLS-1$
-
-
- // ********** conversion values **********
-
- /**
- * Return the converter's conversion values.
- */
- ListIterable<? extends EclipseLinkConversionValue> getConversionValues();
- String CONVERSION_VALUES_LIST = "conversionValues"; //$NON-NLS-1$
-
- /**
- * Return the number of conversion values.
- */
- int getConversionValuesSize();
-
- /**
- * Return the conversion value at the specified index.
- */
- EclipseLinkConversionValue getConversionValue(int index);
-
- /**
- * Add a conversion value to the converter at the specified index
- * and return it.
- */
- EclipseLinkConversionValue addConversionValue(int index);
-
- /**
- * Add a conversion value to the converter and return it.
- */
- EclipseLinkConversionValue addConversionValue();
-
- /**
- * Remove the conversion value at the specified index.
- */
- void removeConversionValue(int index);
-
- /**
- * Remove the specified conversion value.
- */
- void removeConversionValue(EclipseLinkConversionValue conversionValue);
-
- /**
- * Move the conversion value from the specified source index to the
- * specified target index.
- */
- void moveConversionValue(int targetIndex, int sourceIndex);
-
-
- // ********** data values **********
-
- /**
- * Return the converter's data values.
- */
- Iterable<String> getDataValues();
-
- /**
- * Return the number of data values.
- */
- int getDataValuesSize();
-
-
- // ********** default object value **********
-
- String getDefaultObjectValue();
- void setDefaultObjectValue(String value);
- String DEFAULT_OBJECT_VALUE_PROPERTY = "defaultObjectValue"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java
deleted file mode 100644
index c942713807..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-
-/**
- * EclipseLink 1:m mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface EclipseLinkOneToManyMapping
- extends OneToManyMapping, EclipseLinkRelationshipMapping, EclipseLinkConvertibleMapping
-{
- EclipseLinkOneToManyRelationship getRelationship();
-
- EclipseLinkPrivateOwned getPrivateOwned();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping2_0.java
deleted file mode 100644
index 4015ca77ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyMapping2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-
-/**
- * EclipseLink 1:m mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface EclipseLinkOneToManyMapping2_0
- extends EclipseLinkOneToManyMapping, OneToManyMapping2_0
-{
- EclipseLinkOneToManyRelationship2_0 getRelationship();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship.java
deleted file mode 100644
index 214b6128cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.OneToManyRelationship;
-
-/**
- * EclipseLink 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- */
-public interface EclipseLinkOneToManyRelationship
- extends OneToManyRelationship,
- JoinColumnRelationship
-{
- // add join column support to JPA 1.0 1:m
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship2_0.java
deleted file mode 100644
index ed0c9e06ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToManyRelationship2_0.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-
-/**
- * EclipseLink 2.0 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface EclipseLinkOneToManyRelationship2_0
- extends EclipseLinkOneToManyRelationship,
- OneToManyRelationship2_0
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java
deleted file mode 100644
index 846192a66e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-
-/**
- * EclipseLink 1:1 mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkOneToOneMapping
- extends OneToOneMapping, EclipseLinkRelationshipMapping
-{
- OneToOneRelationship getRelationship();
-
- EclipseLinkPrivateOwned getPrivateOwned();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping2_0.java
deleted file mode 100644
index fe265ae45d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkOneToOneMapping2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-
-/**
- * EclipseLink 1:1 mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 3.0
- */
-public interface EclipseLinkOneToOneMapping2_0
- extends EclipseLinkOneToOneMapping, OneToOneMapping2_0
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwned.java
deleted file mode 100644
index 4a3b7f924c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkPrivateOwned.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkPrivateOwned
- extends JpaContextNode
-{
- boolean isPrivateOwned();
- void setPrivateOwned(boolean privateOwned);
- String PRIVATE_OWNED_PROPERTY = "privateOwned"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnly.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnly.java
deleted file mode 100644
index 28d212495a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnly.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink read-only
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkReadOnly
- extends JpaContextNode
-{
- boolean isReadOnly();
-
- boolean isDefaultReadOnly();
- String DEFAULT_READ_ONLY_PROPERTY = "defaultReadOnly"; //$NON-NLS-1$
- boolean DEFAULT_READ_ONLY = false;
-
- Boolean getSpecifiedReadOnly();
- void setSpecifiedReadOnly(Boolean newSpecifiedReadOnly);
- String SPECIFIED_READ_ONLY_PROPERTY = "specifiedReadOnly"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnlyAccessMethodsHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnlyAccessMethodsHolder.java
deleted file mode 100644
index f3001313f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkReadOnlyAccessMethodsHolder.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.common.utility.model.Model;
-
-/**
- * Common interface that can be used by clients interested only in a type
- * or attribute's access methods setting (e.g. a UI composite).
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkReadOnlyAccessMethodsHolder
- extends Model
-{
- /**
- * Return the get method, whether specified or defaulted.
- * This should never return <code>null</code> since at least the default
- * will be set.
- */
- String getGetMethod();
-
- /**
- * Return the set method, whether specified or defaulted.
- * This should never return <code>null</code> since at least the default
- * will be set.
- */
- String getSetMethod();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkRelationshipMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkRelationshipMapping.java
deleted file mode 100644
index 9f349118f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkRelationshipMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
-
-/**
- * EclipseLink relationship (1:1, 1:m, m:1, m:m) mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkRelationshipMapping
- extends RelationshipMapping, EclipseLinkJoinFetchMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructConverter.java
deleted file mode 100644
index b9c13484c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructConverter.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * EclipseLink struct converter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkStructConverter extends EclipseLinkConverterClassConverter
-{
- String ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME = "org.eclipse.persistence.platform.database.converters.StructConverter"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructureMapping2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructureMapping2_3.java
deleted file mode 100644
index 73407318ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkStructureMapping2_3.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink structure mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkStructureMapping2_3
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTimeOfDay.java
deleted file mode 100644
index 12b7a15e56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTimeOfDay.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-
-/**
- * EclipseLink caching expiry time of day
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTimeOfDay
- extends JpaContextNode
-{
- Integer getHour();
- void setHour(Integer hour);
- String HOUR_PROPERTY = "hour"; //$NON-NLS-1$
-
- Integer getMinute();
- void setMinute(Integer minute);
- String MINUTE_PROPERTY = "minute"; //$NON-NLS-1$
-
- Integer getSecond();
- void setSecond(Integer second);
- String SECOND_PROPERTY = "second"; //$NON-NLS-1$
-
- Integer getMillisecond();
- void setMillisecond(Integer millisecond);
- String MILLISECOND_PROPERTY = "millisecond"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTransformationMapping.java
deleted file mode 100644
index 972fdebb9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTransformationMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink transformation mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTransformationMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeConverter.java
deleted file mode 100644
index 6e735e8bb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeConverter.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-/**
- * EclipseLink type converter
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface EclipseLinkTypeConverter
- extends EclipseLinkConverter
-{
- String getDataType();
- void setDataType(String dataType);
- String DATA_TYPE_PROPERTY = "dataType"; //$NON-NLS-1$
-
- String getFullyQualifiedDataType();
- String FULLY_QUALIFIED_DATA_TYPE_PROPERTY = "fullyQualifiedDataType"; //$NON-NLS-1$
-
-
- String getObjectType();
- void setObjectType(String objectType);
- String OBJECT_TYPE_PROPERTY = "objectType"; //$NON-NLS-1$
-
- String getFullyQualifiedObjectType();
- String FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY = "fullyQualifiedObjectType"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeMapping.java
deleted file mode 100644
index ea4ecab60a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkTypeMapping.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.ConvertibleKeyMapping2_0;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface EclipseLinkTypeMapping
- extends TypeMapping, EclipseLinkConvertibleMapping
-{
- EclipseLinkCustomizer getCustomizer();
-
- EclipseLinkChangeTracking getChangeTracking();
-
- /**
- * Return whether this type mapping specifies primary key columns rather than using
- * JPA-style attributes
- * (Uses the @PrimaryKey annotation for java, or the primary-key element for xml)
- *
- * Note: there is no context-level or UI support for this feature as of yet.
- * Note: this is a 1.1 feature, but this check has been implemented for all versions
- */
- boolean usesPrimaryKeyColumns();
-
- /**
- * Return true if the type mapping is multitenant and any of the tenant discriminator
- * columns (specified or default) have the primaryKey option set to true
- */
- boolean usesPrimaryKeyTenantDiscriminatorColumns();
-
- Iterable<EclipseLinkConverter> getConverters();
-
- Transformer<AttributeMapping, Iterable<EclipseLinkConverter>> ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER =
- new Transformer<AttributeMapping, Iterable<EclipseLinkConverter>>() {
- public Iterable<EclipseLinkConverter> transform(AttributeMapping attributeMapping) {
- List<EclipseLinkConverter> converters = new ArrayList<EclipseLinkConverter>();
- if (attributeMapping instanceof EclipseLinkConvertibleMapping) {
- Iterable<EclipseLinkConverter> mappingConverters =
- ((EclipseLinkConvertibleMapping) attributeMapping).getConverterContainer().getConverters();
- CollectionTools.addAll(converters, mappingConverters);
- }
- return converters;
- }
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java
deleted file mode 100644
index 311a212512..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVariableOneToOneMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-
-/**
- * EclipseLink variable 1:1 mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- */
-public interface EclipseLinkVariableOneToOneMapping
- extends AttributeMapping
-{
- // nothing yet
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java
deleted file mode 100644
index 7b100b917f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/EclipseLinkVersionMapping.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-
-/**
- * EclipseLink version mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface EclipseLinkVersionMapping
- extends VersionMapping, EclipseLinkConvertibleMapping
-{
- EclipseLinkMutable getMutable();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/ReadOnlyTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/ReadOnlyTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index b8326b34e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/ReadOnlyTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyTableColumn;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface ReadOnlyTenantDiscriminatorColumn2_3
- extends ReadOnlyNamedDiscriminatorColumn, ReadOnlyTableColumn
-{
- String DEFAULT_NAME = "TENANT_ID"; //$NON-NLS-1$
-
-
- // ********** context property **********
-
- /**
- * Return the specified context property if present, otherwise return
- * the default context property.
- */
- String getContextProperty();
- String getSpecifiedContextProperty();
- String SPECIFIED_CONTEXT_PROPERTY_PROPERTY = "specifiedContextProperty"; //$NON-NLS-1$
- String getDefaultContextProperty();
- String DEFAULT_CONTEXT_PROPERTY_PROPERTY = "defaultContextProperty"; //$NON-NLS-1$
- String DEFAULT_CONTEXT_PROPERTY = "eclipselink.tenant-id"; //$NON-NLS-1$
-
-
- // ********** primaryKey **********
-
- /**
- * Return the specified primaryKey setting if present, otherwise return the
- * default primaryKey setting.
- */
- boolean isPrimaryKey();
- Boolean getSpecifiedPrimaryKey();
- String SPECIFIED_PRIMARY_KEY_PROPERTY = "specifiedPrimaryKey"; //$NON-NLS-1$
- boolean isDefaultPrimaryKey();
- String DEFAULT_PRIMARY_KEY_PROPERTY = "defaultPrimaryKey"; //$NON-NLS-1$
- boolean DEFAULT_PRIMARY_KEY = false;
-
-
- // ********** owner **********
-
- /**
- * interface allowing tenant discriminator columns to be used in multiple places
- */
- interface Owner
- extends ReadOnlyNamedDiscriminatorColumn.Owner, ReadOnlyTableColumn.Owner
- {
- /**
- * Return the default context property name
- */
- String getDefaultContextPropertyName();
-
- /**
- * Return the default primary key setting
- */
- boolean getDefaultPrimaryKey();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/TenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/TenantDiscriminatorColumn2_3.java
deleted file mode 100644
index aab012ac37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/TenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.NamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.TableColumn;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface TenantDiscriminatorColumn2_3
- extends NamedDiscriminatorColumn, ReadOnlyTenantDiscriminatorColumn2_3, TableColumn
-{
-
- void setSpecifiedContextProperty(String contextProperty);
- void setSpecifiedPrimaryKey(Boolean primaryKey);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/VirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/VirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index e7eeb921e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/VirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context;
-
-import org.eclipse.jpt.jpa.core.context.VirtualNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.VirtualTableColumn;
-
-/**
- * Virtual tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface VirtualTenantDiscriminatorColumn2_3
- extends VirtualNamedDiscriminatorColumn, VirtualTableColumn, ReadOnlyTenantDiscriminatorColumn2_3
-{
- ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn();
-
- // ********** owner **********
-
- /**
- * Interface allowing the virtual column to be get the column it overrides.
- */
- interface Owner
- extends ReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
- /**
- * Return the column overridden by the virtual column.
- */
- ReadOnlyTenantDiscriminatorColumn2_3 resolveOverriddenColumn();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaConvertibleMapping.java
deleted file mode 100644
index ffe04e56f7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaConvertibleMapping.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvertibleMapping;
-
-/**
- * EclipseLink java convertible mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkJavaConvertibleMapping
- extends EclipseLinkConvertibleMapping, JavaEclipseLinkConverterContainer.ParentAdapter
-{
- JavaEclipseLinkConverterContainer getConverterContainer();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship.java
deleted file mode 100644
index 09b8a1b8a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship;
-
-/**
- * EclipseLink Java 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJavaOneToManyRelationship
- extends EclipseLinkOneToManyRelationship,
- JavaOneToManyRelationship,
- JavaJoinColumnRelationship
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship2_0.java
deleted file mode 100644
index b723b3eef2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaOneToManyRelationship2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship2_0;
-
-/**
- * EclipseLink 2.0 Java 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJavaOneToManyRelationship2_0
- extends EclipseLinkOneToManyRelationship2_0,
- EclipseLinkJavaOneToManyRelationship,
- JavaOneToManyRelationship2_0
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaTypeMapping.java
deleted file mode 100644
index b39b021a68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/EclipseLinkJavaTypeMapping.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-
-/**
- * EclipseLink Java type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkJavaTypeMapping
- extends JavaTypeMapping, EclipseLinkTypeMapping
-{
- JavaEclipseLinkConverterContainer getConverterContainer();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkCaching.java
deleted file mode 100644
index be17d91a59..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkCaching.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-
-/**
- * EclipseLink Java caching
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface JavaEclipseLinkCaching
- extends EclipseLinkCaching, JavaJpaContextNode
-{
- /**
- * Return true if the existence-checking model object exists.
- * Have to have a separate flag for this since the default existence
- * type is different depending on whether hasExistenceChecking() returns
- * true or false.
- */
- boolean isExistenceChecking();
- void setExistenceChecking(boolean existenceChecking);
- String EXISTENCE_CHECKING_PROPERTY = "existenceChecking"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java
deleted file mode 100644
index 7a78c609fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkConverterContainer.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkTypeConverter;
-
-/**
- * EclipseLink Java converter container
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface JavaEclipseLinkConverterContainer
- extends EclipseLinkConverterContainer, JavaJpaContextNode
-{
- ListIterable<JavaEclipseLinkCustomConverter> getCustomConverters();
- JavaEclipseLinkCustomConverter addCustomConverter(int index);
-
- ListIterable<JavaEclipseLinkObjectTypeConverter> getObjectTypeConverters();
- JavaEclipseLinkObjectTypeConverter addObjectTypeConverter(int index);
-
- ListIterable<JavaEclipseLinkStructConverter> getStructConverters();
- JavaEclipseLinkStructConverter addStructConverter(int index);
-
- ListIterable<JavaEclipseLinkTypeConverter> getTypeConverters();
- JavaEclipseLinkTypeConverter addTypeConverter(int index);
-
- /**
- * Parent adapter
- */
- interface ParentAdapter {
- /**
- * Return the container's parent.
- */
- JavaJpaContextNode getConverterContainerParent();
-
- /**
- * Return the element that is annotated with converters.
- */
- JavaResourceAnnotatedElement getJavaResourceAnnotatedElement();
-
- /**
- * Return whether the container's parent supports converters.
- * (Virtual attributes do not support converters.)
- */
- boolean parentSupportsConverters();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java
deleted file mode 100644
index 80c3e43510..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEmbeddable.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEmbeddable;
-
-/**
- * EclipseLink
- * Java embeddable type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface JavaEclipseLinkEmbeddable
- extends JavaEmbeddable, EclipseLinkEmbeddable, EclipseLinkJavaTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEntity.java
deleted file mode 100644
index 32a78c5646..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkEntity.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-
-/**
- * EclipseLink
- * Java entity
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface JavaEclipseLinkEntity
- extends JavaEntity, EclipseLinkEntity, JavaEclipseLinkNonEmbeddableTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java
deleted file mode 100644
index c5541c4fc7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMappedSuperclass.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-
-/**
- * EclipseLink
- * Java mapped superclass
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 2.1
- */
-public interface JavaEclipseLinkMappedSuperclass
- extends JavaMappedSuperclass, EclipseLinkMappedSuperclass, JavaEclipseLinkNonEmbeddableTypeMapping
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMultitenancy2_3.java
deleted file mode 100644
index c1897750a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenancy2_3;
-
-public interface JavaEclipseLinkMultitenancy2_3
- extends EclipseLinkMultitenancy2_3, JavaJpaContextNode
-{
-
- ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
-
- ListIterable<JavaTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns();
- JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn();
- JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index);
-
- ListIterable<JavaVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkNonEmbeddableTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkNonEmbeddableTypeMapping.java
deleted file mode 100644
index 4d89e38aab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkNonEmbeddableTypeMapping.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkNonEmbeddableTypeMapping;
-
-/**
- * EclipseLink Java non-embeddable type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaEclipseLinkNonEmbeddableTypeMapping
- extends EclipseLinkNonEmbeddableTypeMapping, EclipseLinkJavaTypeMapping
-{
- JavaEclipseLinkCaching getCaching();
-
- JavaEclipseLinkMultitenancy2_3 getMultitenancy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkPersistentAttribute.java
deleted file mode 100644
index b6bf972832..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaEclipseLinkPersistentAttribute.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-/**
- * EclipseLink Java persistent attribute
- */
-public interface JavaEclipseLinkPersistentAttribute
-{
-
- /**
- * Return whether the attribute's type is a subclass of
- * <code>java.util.Date</code> or <code>java.util.Calendar</code>.
- */
- boolean typeIsDateOrCalendar();
-
- String DATE_TYPE_NAME = java.util.Date.class.getName();
- String CALENDAR_TYPE_NAME = java.util.Calendar.class.getName();
-
- boolean typeIsSerializable();
-
- boolean typeIsValidForVariableOneToOne();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaReadOnlyTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaReadOnlyTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 0169a52e23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaReadOnlyTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyTableColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JavaReadOnlyTenantDiscriminatorColumn2_3
- extends JavaReadOnlyNamedDiscriminatorColumn, ReadOnlyTenantDiscriminatorColumn2_3, JavaReadOnlyTableColumn
-{
-
- // ********** owner **********
-
- /**
- * interface allowing tenant discriminator columns to be used in multiple places
- */
- interface Owner
- extends ReadOnlyTenantDiscriminatorColumn2_3.Owner, JavaReadOnlyNamedDiscriminatorColumn.Owner
- {
- //combining interfaces
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 085104ff78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface JavaTenantDiscriminatorColumn2_3
- extends TenantDiscriminatorColumn2_3, JavaReadOnlyTenantDiscriminatorColumn2_3
-{
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 getColumnAnnotation();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaVirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaVirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index c5430a0a6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/java/JavaVirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyTableColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.VirtualTenantDiscriminatorColumn2_3;
-
-/**
- * Java virtual tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaVirtualTenantDiscriminatorColumn2_3
- extends VirtualTenantDiscriminatorColumn2_3, JavaReadOnlyTenantDiscriminatorColumn2_3, JavaReadOnlyTableColumn
-{
- /**
- * The overridden column can be either a Java tenant discriminator column or an
- * <code>orm.xml</code> tenant discriminator column; so we don't change the return type
- * here.
- */
- ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkEntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkEntityMappings.java
deleted file mode 100644
index 993d2b0a2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkEntityMappings.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessMethodsHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-
-public interface EclipseLinkEntityMappings
- extends EntityMappings, EclipseLinkAccessMethodsHolder
-{
- /**
- * Return all the converters defined in both the entity mappings and its
- * entities (but <em>not</em> in any associated Java annotations).
- */
- Iterable<EclipseLinkConverter> getMappingFileConverters();
-
- OrmEclipseLinkConverterContainer getConverterContainer();
-
-
- // ********** tenant discriminator columns **********
-
- /**
- * Return the tenant discriminator columns whether specified or default.
- */
- ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
-
- /**
- * Return the number of tenant discriminator columns, whether specified and default.
- */
- int getTenantDiscriminatorColumnsSize();
-
-
- // ********** specified tenant discriminator columns **********
-
- /**
- * Return a list iterable of the specified tenant discriminator columns.
- * This will not be null.
- */
- ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns();
- String SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST = "specifiedTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of specified tenant discriminator columns.
- */
- int getSpecifiedTenantDiscriminatorColumnsSize();
-
- /**
- * Return whether there are any specified tenant discriminator columns.
- */
- boolean hasSpecifiedTenantDiscriminatorColumns();
-
- /**
- * Add a specified tenant discriminator column and return the object
- * representing it.
- */
- OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn();
-
- /**
- * Add a specified tenant discriminator column and return the object
- * representing it.
- */
- OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index);
-
- /**
- * Remove the specified tenant discriminator column.
- */
- void removeSpecifiedTenantDiscriminatorColumn(OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn);
-
- /**
- * Remove the specified tenant discriminator column at the index.
- */
- void removeSpecifiedTenantDiscriminatorColumn(int index);
-
- /**
- * Move the specified tenant discriminator column from the source index to the target index.
- */
- void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex);
-
-
- // ********** default tenant discriminator columns **********
-
- /**
- * Return a list iterable of the default tenant discriminator columns.
- * This will not be null. If there are specified tenant discriminator columns
- * then there will be no default tenant discriminator columns.
- */
- ListIterable<? extends ReadOnlyTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns();
- String DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST = "defaultTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of default tenant discriminator columns.
- */
- int getDefaultTenantDiscriminatorColumnsSize();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmConvertibleMapping.java
deleted file mode 100644
index c252acb040..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmConvertibleMapping.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvertibleMapping;
-
-/**
- * EclipseLink orm convertible mapping.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkOrmConvertibleMapping
- extends EclipseLinkConvertibleMapping
-{
- OrmEclipseLinkConverterContainer getConverterContainer();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship.java
deleted file mode 100644
index c56fee5fe2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship;
-
-/**
- * EclipseLink <code>orm.xml</code> 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkOrmOneToManyRelationship
- extends EclipseLinkOneToManyRelationship,
- OrmOneToManyRelationship,
- OrmJoinColumnRelationship
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship2_0.java
deleted file mode 100644
index a5ba92c14d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmOneToManyRelationship2_0.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship2_0;
-
-/**
- * EclipseLink 2.0 <code>orm.xml</code> 1:m relationship
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkOrmOneToManyRelationship2_0
- extends EclipseLinkOneToManyRelationship2_0,
- EclipseLinkOrmOneToManyRelationship,
- OrmOneToManyRelationship2_0
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmPersistentType.java
deleted file mode 100644
index b019e57db7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmPersistentType.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmPersistentType2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessMethodsHolder;
-
-/**
- * <code>eclipselink-orm.xml</code> persistent type:<ul>
- * <li>mapping
- * <li>access
- * <li>access-methods
- * <li>attributes
- * <li>super persistent type
- * <li>Java persistent type
- * </ul>
- */
-public interface EclipseLinkOrmPersistentType
- extends OrmPersistentType2_0, EclipseLinkAccessMethodsHolder
-{
-
- //*************** dynamic *****************
-
- boolean isDynamic();
- String DYNAMIC_PROPERTY = "dynamic"; //$NON-NLS-1$
-
- OrmPersistentAttribute addVirtualAttribute(String attributeName, String mappingKey, String attributeType);
-
- //*************** covariant overrides *****************
-
- EclipseLinkOrmTypeMapping getMapping();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmTypeMapping.java
deleted file mode 100644
index 777d4c33a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkOrmTypeMapping.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaTypeMapping;
-
-/**
- * EclipseLink ORM type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkOrmTypeMapping
- extends OrmTypeMapping, EclipseLinkTypeMapping
-{
- OrmEclipseLinkConverterContainer getConverterContainer();
-
- EclipseLinkJavaTypeMapping getJavaTypeMapping();
-
- EclipseLinkJavaTypeMapping getJavaTypeMappingForDefaults();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkPersistenceUnitDefaults.java
deleted file mode 100644
index 401c4043cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/EclipseLinkPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmPersistenceUnitDefaults2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessMethodsHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-
-/**
- * EclipseLink <code>orm.xml</code> file
- * <br>
- * <code>persistence-unit-defaults</code> element
- */
-public interface EclipseLinkPersistenceUnitDefaults
- extends OrmPersistenceUnitDefaults2_0, EclipseLinkAccessMethodsHolder
-{
-
- // ********** tenant discriminator columns **********
-
- /**
- * Return a list iterable of the tenant discriminator columns.
- * This will not be null.
- */
- ListIterable<OrmTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
- String TENANT_DISCRIMINATOR_COLUMNS_LIST = "tenantDiscriminatorColumns"; //$NON-NLS-1$
-
- /**
- * Return the number of tenant discriminator columns.
- */
- int getTenantDiscriminatorColumnsSize();
-
- /**
- * Return whether there are any tenant discriminator columns.
- */
- boolean hasTenantDiscriminatorColumns();
-
- /**
- * Add a tenant discriminator column and return the object
- * representing it.
- */
- OrmTenantDiscriminatorColumn2_3 addTenantDiscriminatorColumn();
-
- /**
- * Add a tenant discriminator column and return the object
- * representing it.
- */
- OrmTenantDiscriminatorColumn2_3 addTenantDiscriminatorColumn(int index);
-
- /**
- * Remove the tenant discriminator column.
- */
- void removeTenantDiscriminatorColumn(OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn);
-
- /**
- * Remove the tenant discriminator column at the index.
- */
- void removeTenantDiscriminatorColumn(int index);
-
- /**
- * Move the tenant discriminator column from the source index to the target index.
- */
- void moveTenantDiscriminatorColumn(int targetIndex, int sourceIndex);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkCaching.java
deleted file mode 100644
index d8acb7e6ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkCaching.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-
-/**
- * EclipseLink <code>orm.xml</code> caching
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface OrmEclipseLinkCaching
- extends EclipseLinkCaching, XmlContextNode
-{
- // combine various interfaces
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkConverterContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkConverterContainer.java
deleted file mode 100644
index ae9666fde0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkConverterContainer.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkTypeConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-
-/**
- * EclipseLink <code>orm.xml</code> converter container
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface OrmEclipseLinkConverterContainer
- extends EclipseLinkConverterContainer, XmlContextNode
-{
-
- ListIterable<OrmEclipseLinkCustomConverter> getCustomConverters();
- OrmEclipseLinkCustomConverter addCustomConverter(int index);
- OrmEclipseLinkCustomConverter addCustomConverter();
-
- ListIterable<OrmEclipseLinkObjectTypeConverter> getObjectTypeConverters();
- OrmEclipseLinkObjectTypeConverter addObjectTypeConverter(int index);
- OrmEclipseLinkObjectTypeConverter addObjectTypeConverter();
-
- ListIterable<OrmEclipseLinkStructConverter> getStructConverters();
- OrmEclipseLinkStructConverter addStructConverter(int index);
- OrmEclipseLinkStructConverter addStructConverter();
-
- ListIterable<OrmEclipseLinkTypeConverter> getTypeConverters();
- OrmEclipseLinkTypeConverter addTypeConverter(int index);
- OrmEclipseLinkTypeConverter addTypeConverter();
-
-
- // ********** refactoring **********
-
- Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName);
- Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage);
- Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName);
-
-
- interface Owner {
- int getNumberSupportedConverters();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java
deleted file mode 100644
index b401ae71a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEmbeddable.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable;
-
-/**
- * EclipseLink <code>orm.xml</code> embeddable
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface OrmEclipseLinkEmbeddable
- extends OrmEmbeddable, EclipseLinkEmbeddable, EclipseLinkOrmTypeMapping
-{
- XmlEmbeddable getXmlTypeMapping();
-
- JavaEclipseLinkEmbeddable getJavaTypeMapping();
-
- JavaEclipseLinkEmbeddable getJavaTypeMappingForDefaults();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEntity.java
deleted file mode 100644
index 52b3b9472f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkEntity.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-
-/**
- * EclipseLink <code>orm.xml</code> entity
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface OrmEclipseLinkEntity
- extends OrmEntity, EclipseLinkEntity, OrmEclipseLinkNonEmbeddableTypeMapping
-{
- XmlEntity getXmlTypeMapping();
-
- JavaEclipseLinkEntity getJavaTypeMapping();
-
- JavaEclipseLinkEntity getJavaTypeMappingForDefaults();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java
deleted file mode 100644
index 37a0c7e46b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMappedSuperclass.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> mapped superclass
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface OrmEclipseLinkMappedSuperclass
- extends OrmMappedSuperclass, EclipseLinkMappedSuperclass, OrmEclipseLinkNonEmbeddableTypeMapping
-{
- XmlMappedSuperclass getXmlTypeMapping();
-
- JavaEclipseLinkMappedSuperclass getJavaTypeMapping();
-
- JavaEclipseLinkMappedSuperclass getJavaTypeMappingForDefaults();
-
- OrmQueryContainer getQueryContainer();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMultitenancy2_3.java
deleted file mode 100644
index dad9f450e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenancy2_3;
-
-public interface OrmEclipseLinkMultitenancy2_3
- extends EclipseLinkMultitenancy2_3, XmlContextNode
-{
- ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns();
-
- ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns();
- OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn();
- OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index);
-
- ListIterable<OrmVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkNonEmbeddableTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkNonEmbeddableTypeMapping.java
deleted file mode 100644
index 70cec9cebc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmEclipseLinkNonEmbeddableTypeMapping.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-
-/**
- * EclipseLink <code>orm.xml</code> non-embeddable type mapping
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmEclipseLinkNonEmbeddableTypeMapping
- extends EclipseLinkNonEmbeddableTypeMapping, EclipseLinkOrmTypeMapping
-{
- OrmEclipseLinkCaching getCaching();
-
- JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMapping();
-
- JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMappingForDefaults();
-
- OrmEclipseLinkMultitenancy2_3 getMultitenancy();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmReadOnlyTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmReadOnlyTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 8879430be2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmReadOnlyTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyTableColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-
-/**
- * tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface OrmReadOnlyTenantDiscriminatorColumn2_3
- extends OrmReadOnlyNamedDiscriminatorColumn, ReadOnlyTenantDiscriminatorColumn2_3, OrmReadOnlyTableColumn
-{
-
- // ********** owner **********
-
- /**
- * interface allowing discriminator columns to be used in multiple places
- */
- interface Owner
- extends ReadOnlyTenantDiscriminatorColumn2_3.Owner, OrmReadOnlyNamedDiscriminatorColumn.Owner
- {
- //combining interfaces
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index aee1206caf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-
-/**
- * orm tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface OrmTenantDiscriminatorColumn2_3
- extends TenantDiscriminatorColumn2_3, OrmReadOnlyTenantDiscriminatorColumn2_3
-{
- XmlTenantDiscriminatorColumn_2_3 getXmlColumn();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmVirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmVirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index d39ddfbecf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/orm/OrmVirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyTableColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.VirtualTenantDiscriminatorColumn2_3;
-
-/**
- * <code>orm.xml</code> virtual tenant discriminator column
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmVirtualTenantDiscriminatorColumn2_3
- extends VirtualTenantDiscriminatorColumn2_3, OrmReadOnlyTenantDiscriminatorColumn2_3, OrmReadOnlyTableColumn
-{
- /**
- * The overridden column can be either a Java tenant discriminator column or an
- * <code>orm.xml</code> tenant discriminator column; so we don't change the return type
- * here.
- */
- ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/BatchWriting.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/BatchWriting.java
deleted file mode 100644
index a6e372fd54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/BatchWriting.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * BatchWriting
- */
-public enum BatchWriting implements PersistenceXmlEnumValue {
- none("None"), //$NON-NLS-1$
- jdbc("JDBC"), //$NON-NLS-1$
- buffered("Buffered"), //$NON-NLS-1$
- oracle_jdbc("Oracle-JDBC"); //$NON-NLS-1$
-
- private final String propertyValue;
-
- BatchWriting(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CacheType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CacheType.java
deleted file mode 100644
index 5c258d688e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CacheType.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * CacheType
- */
-public enum CacheType implements PersistenceXmlEnumValue {
- soft_weak("SoftWeak"), //$NON-NLS-1$
- hard_weak("HardWeak"), //$NON-NLS-1$
- weak("Weak"), //$NON-NLS-1$
- soft("Soft"), //$NON-NLS-1$
- full("Full"), //$NON-NLS-1$
- none("NONE"); //$NON-NLS-1$
-
- private final String propertyValue;
-
- CacheType(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Caching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Caching.java
deleted file mode 100644
index f285fcf9d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Caching.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * Caching
- */
-public interface Caching extends PersistenceUnitProperties
-{
- CacheType getDefaultCacheTypeDefault();
- CacheType getCacheTypeDefault();
- void setCacheTypeDefault(CacheType cacheTypeDefault);
- static final String CACHE_TYPE_DEFAULT_PROPERTY = "cacheTypeDefault"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_TYPE_DEFAULT = "eclipselink.cache.type.default"; //$NON-NLS-1$
- static final CacheType DEFAULT_CACHE_TYPE_DEFAULT = CacheType.soft_weak;
-
- Integer getDefaultCacheSizeDefault();
- Integer getCacheSizeDefault();
- void setCacheSizeDefault(Integer cacheSizeDefault);
- static final String CACHE_SIZE_DEFAULT_PROPERTY = "cacheSizeDefault"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_SIZE_DEFAULT = "eclipselink.cache.size.default"; //$NON-NLS-1$
- static final Integer DEFAULT_CACHE_SIZE_DEFAULT = Integer.valueOf(100);
-
- Boolean getDefaultSharedCacheDefault();
- Boolean getSharedCacheDefault();
- void setSharedCacheDefault(Boolean sharedCacheDefault);
- static final String SHARED_CACHE_DEFAULT_PROPERTY = "sharedCacheDefault"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_SHARED_DEFAULT = "eclipselink.cache.shared.default"; //$NON-NLS-1$
- static final Boolean DEFAULT_SHARED_CACHE_DEFAULT = Boolean.TRUE;
-
-
- CacheType getDefaultCacheType();
- CacheType getCacheTypeOf(String entityName);
- void setCacheTypeOf(String entityName, CacheType cacheType);
- static final String CACHE_TYPE_PROPERTY = "cacheType"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_TYPE = "eclipselink.cache.type."; //$NON-NLS-1$
- static final CacheType DEFAULT_CACHE_TYPE = CacheType.soft_weak;
-
- Integer getDefaultCacheSize();
- Integer getCacheSizeOf(String entityName);
- void setCacheSizeOf(String entityName, Integer cacheSize);
- static final String CACHE_SIZE_PROPERTY = "cacheSize"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_SIZE = "eclipselink.cache.size."; //$NON-NLS-1$
- static final Integer DEFAULT_CACHE_SIZE = Integer.valueOf(100);
-
- Boolean getDefaultSharedCache();
- Boolean getSharedCacheOf(String entityName);
- void setSharedCacheOf(String entityName, Boolean sharedCache);
- static final String SHARED_CACHE_PROPERTY = "sharedCache"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SHARED_CACHE = "eclipselink.cache.shared."; //$NON-NLS-1$
- static final Boolean DEFAULT_SHARED_CACHE = Boolean.TRUE;
-
- FlushClearCache getDefaultFlushClearCache();
- FlushClearCache getFlushClearCache();
- void setFlushClearCache(FlushClearCache newFlushClearCache);
- static final String FLUSH_CLEAR_CACHE_PROPERTY = "flushClearCache"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_FLUSH_CLEAR_CACHE = "eclipselink.flush-clear.cache"; //$NON-NLS-1$
- static final FlushClearCache DEFAULT_FLUSH_CLEAR_CACHE = FlushClearCache.drop_invalidate;
-
- void removeDefaultCachingProperties();
-
- ListIterable<CachingEntity> getEntities();
- Iterable<String> getEntityNames();
- int getEntitiesSize();
- boolean entityExists(String entity);
- CachingEntity addEntity(String entity);
- void removeEntity(String entity);
- String ENTITIES_LIST = "entities"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CachingEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CachingEntity.java
deleted file mode 100644
index cf80dcd8ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CachingEntity.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import java.io.Serializable;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-
-/**
- * Entity
- */
-public class CachingEntity extends AbstractModel implements Cloneable, Serializable
-{
- private String name;
- private Caching parent;
-
- public static final String CACHE_TYPE_PROPERTY = Caching.CACHE_TYPE_PROPERTY;
- public static final String CACHE_SIZE_PROPERTY = Caching.CACHE_SIZE_PROPERTY;
- public static final String SHARED_CACHE_PROPERTY = Caching.SHARED_CACHE_PROPERTY;
-
- // ********** EclipseLink properties **********
- private CacheType cacheType;
- private Integer cacheSize;
- private Boolean cacheIsShared;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public CachingEntity(Caching parent, String name) {
- this(parent);
- this.initialize(name);
- }
-
- private CachingEntity(Caching parent) {
- this.parent = parent;
- }
-
- private void initialize(String name) {
- if(StringTools.stringIsEmpty(name)) {
- throw new IllegalArgumentException();
- }
- this.name = name;
- }
-
- // ********** behaviors **********
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof CachingEntity)) {
- return false;
- }
- CachingEntity other = (CachingEntity) o;
- return (
- (this.cacheType == null ?
- other.cacheType == null : this.cacheType.equals(other.cacheType)) &&
- (this.cacheIsShared == null ?
- other.cacheIsShared == null : this.cacheIsShared.equals(other.cacheIsShared)) &&
- (this.cacheSize == null ?
- other.cacheSize == null : this.cacheSize.equals(other.cacheSize)));
- }
-
- @Override
- public int hashCode() {
- return (this.cacheType == null) ? 0 : this.cacheType.hashCode();
- }
-
- @Override
- public CachingEntity clone() {
- try {
- return (CachingEntity)super.clone();
- }
- catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- public boolean isEmpty() {
- return (this.cacheType == null) &&
- (this.cacheSize == null) &&
- (this.cacheIsShared == null);
- }
-
- public boolean entityNameIsValid() {
- return ! StringTools.stringIsEmpty(this.name);
- }
-
- public Caching getParent() {
- return this.parent;
- }
-
- // ********** name **********
- public String getName() {
- return this.name;
- }
-
- // ********** cacheType **********
- public CacheType getCacheType() {
- return this.cacheType;
- }
-
- public void setCacheType(CacheType cacheType) {
- CacheType old = this.cacheType;
- this.cacheType = cacheType;
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, cacheType);
- }
-
- // ********** cacheSize **********
- public Integer getCacheSize() {
- return this.cacheSize;
- }
-
- public void setCacheSize(Integer cacheSize) {
- Integer old = this.cacheSize;
- this.cacheSize = cacheSize;
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, cacheSize);
- }
-
- // ********** cacheIsShared **********
- public Boolean cacheIsShared() {
- return this.cacheIsShared;
- }
-
- public void setSharedCache(Boolean isShared) {
- Boolean old = this.cacheIsShared;
- this.cacheIsShared = isShared;
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, isShared);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append("name: "); //$NON-NLS-1$
- sb.append(this.name);
- sb.append(", cacheType: "); //$NON-NLS-1$
- sb.append(this.cacheType);
- sb.append(", cacheSize: "); //$NON-NLS-1$
- sb.append(this.cacheSize);
- sb.append(", cacheIsShared: "); //$NON-NLS-1$
- sb.append(this.cacheIsShared);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection.java
deleted file mode 100644
index 3266bab553..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * Connection
- */
-public interface Connection extends PersistenceUnitProperties
-{
- Boolean getDefaultNativeSql();
- Boolean getNativeSql();
- void setNativeSql(Boolean newNativeSql);
- static final String NATIVE_SQL_PROPERTY = "nativeSql"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_NATIVE_SQL = "eclipselink.jdbc.native-sql"; //$NON-NLS-1$
- static final Boolean DEFAULT_NATIVE_SQL = Boolean.FALSE;
-
- BatchWriting getDefaultBatchWriting();
- BatchWriting getBatchWriting();
- void setBatchWriting(BatchWriting newBatchWriting);
- static final String BATCH_WRITING_PROPERTY = "batchWriting"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_BATCH_WRITING = "eclipselink.jdbc.batch-writing"; //$NON-NLS-1$
- static final BatchWriting DEFAULT_BATCH_WRITING = BatchWriting.none;
-
- Boolean getDefaultCacheStatements();
- Boolean getCacheStatements();
- void setCacheStatements(Boolean newCacheStatements);
- static final String CACHE_STATEMENTS_PROPERTY = "cacheStatements"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_STATEMENTS = "eclipselink.jdbc.cache-statements"; //$NON-NLS-1$
- static final Boolean DEFAULT_CACHE_STATEMENTS = Boolean.FALSE;
-
- Integer getDefaultCacheStatementsSize();
- Integer getCacheStatementsSize();
- void setCacheStatementsSize(Integer newCacheStatementsSize);
- static final String CACHE_STATEMENTS_SIZE_PROPERTY = "cacheStatementsSize"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CACHE_STATEMENTS_SIZE = "eclipselink.jdbc.cache-statements.size"; //$NON-NLS-1$
- static final Integer DEFAULT_CACHE_STATEMENTS_SIZE = Integer.valueOf(50);
-
- String getDefaultDriver();
- String getDriver();
- void setDriver(String newDriver);
- static final String DRIVER_PROPERTY = "driver"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DRIVER = "eclipselink.jdbc.driver"; //$NON-NLS-1$
- static final String DEFAULT_DRIVER = ""; //$NON-NLS-1$
-
- String getDefaultUrl();
- String getUrl();
- void setUrl(String newUrl);
- static final String URL_PROPERTY = "url"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_URL = "eclipselink.jdbc.url"; //$NON-NLS-1$
- static final String DEFAULT_URL = ""; //$NON-NLS-1$
-
- String getDefaultUser();
- String getUser();
- void setUser(String newUser);
- static final String USER_PROPERTY = "user"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_USER = "eclipselink.jdbc.user"; //$NON-NLS-1$
- static final String DEFAULT_USER = ""; //$NON-NLS-1$
-
- String getDefaultPassword();
- String getPassword();
- void setPassword(String newPassword);
- static final String PASSWORD_PROPERTY = "password"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_PASSWORD = "eclipselink.jdbc.password"; //$NON-NLS-1$
- static final String DEFAULT_PASSWORD = ""; //$NON-NLS-1$
-
- Boolean getDefaultBindParameters();
- Boolean getBindParameters();
- void setBindParameters(Boolean newBindParameters);
- static final String BIND_PARAMETERS_PROPERTY = "bindParameters"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_BIND_PARAMETERS = "eclipselink.jdbc.bind-parameters"; //$NON-NLS-1$
- static final Boolean DEFAULT_BIND_PARAMETERS = Boolean.TRUE;
-
- Boolean getDefaultReadConnectionsShared();
- Boolean getReadConnectionsShared();
- void setReadConnectionsShared(Boolean newReadConnectionsShared);
- static final String READ_CONNECTIONS_SHARED_PROPERTY = "readConnectionsShared"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_READ_CONNECTIONS_SHARED = "eclipselink.jdbc.read-connections.shared"; //$NON-NLS-1$
- static final Boolean DEFAULT_READ_CONNECTIONS_SHARED = Boolean.FALSE;
-
- Integer getDefaultReadConnectionsMin();
- Integer getReadConnectionsMin();
- void setReadConnectionsMin(Integer newReadConnectionsMin);
- static final String READ_CONNECTIONS_MIN_PROPERTY = "readConnectionsMin"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_READ_CONNECTIONS_MIN = "eclipselink.jdbc.read-connections.min"; //$NON-NLS-1$
- static final Integer DEFAULT_READ_CONNECTIONS_MIN = Integer.valueOf(2);
-
- Integer getDefaultReadConnectionsMax();
- Integer getReadConnectionsMax();
- void setReadConnectionsMax(Integer newReadConnectionsMax);
- static final String READ_CONNECTIONS_MAX_PROPERTY = "readConnectionsMax"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_READ_CONNECTIONS_MAX = "eclipselink.jdbc.read-connections.max"; //$NON-NLS-1$
- static final Integer DEFAULT_READ_CONNECTIONS_MAX = Integer.valueOf(2);
-
- Integer getDefaultWriteConnectionsMin();
- Integer getWriteConnectionsMin();
- void setWriteConnectionsMin(Integer newWriteConnectionsMin);
- static final String WRITE_CONNECTIONS_MIN_PROPERTY = "writeConnectionsMin"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WRITE_CONNECTIONS_MIN = "eclipselink.jdbc.write-connections.min"; //$NON-NLS-1$
- static final Integer DEFAULT_WRITE_CONNECTIONS_MIN = Integer.valueOf(5);
-
- Integer getDefaultWriteConnectionsMax();
- Integer getWriteConnectionsMax();
- void setWriteConnectionsMax(Integer newWriteConnectionsMax);
- static final String WRITE_CONNECTIONS_MAX_PROPERTY = "writeConnectionsMax"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WRITE_CONNECTIONS_MAX = "eclipselink.jdbc.write-connections.max"; //$NON-NLS-1$
- static final Integer DEFAULT_WRITE_CONNECTIONS_MAX = Integer.valueOf(10);
-
- ExclusiveConnectionMode getDefaultExclusiveConnectionMode();
- ExclusiveConnectionMode getExclusiveConnectionMode();
- void setExclusiveConnectionMode(ExclusiveConnectionMode newExclusiveConnectionMode);
- static final String EXCLUSIVE_CONNECTION_MODE_PROPERTY = "exclusiveConnectionMode"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE = "eclipselink.jdbc.exclusive-connection.mode"; //$NON-NLS-1$
- static final ExclusiveConnectionMode DEFAULT_EXCLUSIVE_CONNECTION_MODE = ExclusiveConnectionMode.transactional;
-
- Boolean getDefaultLazyConnection();
- Boolean getLazyConnection();
- void setLazyConnection(Boolean newLazyConnection);
- static final String LAZY_CONNECTION_PROPERTY = "lazyConnection"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_LAZY_CONNECTION = "eclipselink.jdbc.exclusive-connection.is-lazy"; //$NON-NLS-1$
- static final Boolean DEFAULT_LAZY_CONNECTION = Boolean.TRUE;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection2_0.java
deleted file mode 100644
index 593779eb74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Connection2_0.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-
-/**
- * Connection2_0
- */
-public interface Connection2_0 extends Connection, JpaConnection2_0
-{
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Customization.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Customization.java
deleted file mode 100644
index c0ea32dcbf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Customization.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * Customization
- */
-public interface Customization extends PersistenceUnitProperties
-{
- Boolean getDefaultThrowExceptions();
- Boolean getThrowExceptions();
- void setThrowExceptions(Boolean newThrowExceptions);
- static final String THROW_EXCEPTIONS_PROPERTY = "throwExceptions"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_THROW_EXCEPTIONS = "eclipselink.orm.throw.exceptions"; //$NON-NLS-1$
- static final Boolean DEFAULT_THROW_EXCEPTIONS = Boolean.TRUE;
-
- Weaving getDefaultWeaving();
- Weaving getWeaving();
- void setWeaving(Weaving newWeaving);
- static final String WEAVING_PROPERTY = "weaving"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING = "eclipselink.weaving"; //$NON-NLS-1$
- static final Weaving DEFAULT_WEAVING = Weaving.true_;
-
- Boolean getDefaultWeavingLazy();
- Boolean getWeavingLazy();
- void setWeavingLazy(Boolean newWeavingLazy);
- static final String WEAVING_LAZY_PROPERTY = "weavingLazy"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_LAZY = "eclipselink.weaving.lazy"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_LAZY = Boolean.TRUE;
-
- Boolean getDefaultWeavingChangeTracking();
- Boolean getWeavingChangeTracking();
- void setWeavingChangeTracking(Boolean newWeavingChangeTracking);
- static final String WEAVING_CHANGE_TRACKING_PROPERTY = "weavingChangeTracking"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_CHANGE_TRACKING = "eclipselink.weaving.changetracking"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_CHANGE_TRACKING = Boolean.TRUE;
-
- Boolean getDefaultWeavingFetchGroups();
- Boolean getWeavingFetchGroups();
- void setWeavingFetchGroups(Boolean newWeavingFetchGroups);
- static final String WEAVING_FETCH_GROUPS_PROPERTY = "weavingFetchGroups"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_FETCH_GROUPS = "eclipselink.weaving.fetchgroups"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_FETCH_GROUPS = Boolean.TRUE;
-
- Boolean getDefaultWeavingInternal();
- Boolean getWeavingInternal();
- void setWeavingInternal(Boolean newWeavingInternal);
- static final String WEAVING_INTERNAL_PROPERTY = "weavingInternal"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_INTERNAL = "eclipselink.weaving.internal"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_INTERNAL = Boolean.TRUE;
-
- Boolean getDefaultWeavingEager();
- Boolean getWeavingEager();
- void setWeavingEager(Boolean newWeavingEager);
- static final String WEAVING_EAGER_PROPERTY = "weavingEager"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_WEAVING_EAGER = "eclipselink.weaving.eager"; //$NON-NLS-1$
- static final Boolean DEFAULT_WEAVING_EAGER = Boolean.FALSE;
-
- String getDefaultDescriptorCustomizer();
- String getDescriptorCustomizerOf(String entityName);
- void setDescriptorCustomizerOf(String entityName, String newDescriptorCustomizer);
- static final String DESCRIPTOR_CUSTOMIZER_PROPERTY = "descriptorCustomizer"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DESCRIPTOR_CUSTOMIZER = "eclipselink.descriptor.customizer."; //$NON-NLS-1$
- static final String DEFAULT_DESCRIPTOR_CUSTOMIZER = null; // no default
-
- ListIterable<String> getSessionCustomizers();
- int getSessionCustomizersSize();
- boolean sessionCustomizerExists(String sessionCustomizerClassName);
- String addSessionCustomizer(String newSessionCustomizerClassName);
- void removeSessionCustomizer(String sessionCustomizerClassName);
- static final String SESSION_CUSTOMIZER_LIST = "sessionCustomizers"; //$NON-NLS-1$
- static final String SESSION_CUSTOMIZER_PROPERTY = "sessionCustomizer"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_CUSTOMIZER = "eclipselink.session.customizer"; //$NON-NLS-1$
- String ECLIPSELINK_SESSION_CUSTOMIZER_CLASS_NAME = "org.eclipse.persistence.config.SessionCustomizer"; //$NON-NLS-1$
-
- ListIterable<CustomizationEntity> getEntities();
- Iterable<String> getEntityNames();
- int getEntitiesSize();
- boolean entityExists(String entity);
- CustomizationEntity addEntity(String entity);
- void removeEntity(String entity);
- static final String ENTITIES_LIST = "entities"; //$NON-NLS-1$
-
- String getDefaultProfiler();
- String getProfiler();
- void setProfiler(String newProfiler);
- void setProfiler(Profiler newProfiler);
- static final String PROFILER_PROPERTY = "profiler"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_PROFILER = "eclipselink.profiler"; //$NON-NLS-1$
- static final String DEFAULT_PROFILER = Profiler.no_profiler.getPropertyValue();
- static final String[] RESERVED_PROFILER_NAMES = {Profiler.no_profiler.getPropertyValue(), Profiler.performance_profiler.getPropertyValue(), Profiler.query_monitor.getPropertyValue()};
- String ECLIPSELINK_SESSION_PROFILER_CLASS_NAME = "org.eclipse.persistence.sessions.SessionProfiler"; //$NON-NLS-1$
-
- Boolean getDefaultValidationOnly();
- Boolean getValidationOnly();
- void setValidationOnly(Boolean newValidationOnly);
- static final String VALIDATION_ONLY_PROPERTY = "validationOnly"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_VALIDATION_ONLY = "eclipselink.validation-only"; //$NON-NLS-1$
- static final Boolean DEFAULT_VALIDATION_ONLY = Boolean.TRUE;
-
- String getDefaultExceptionHandler();
- String getExceptionHandler();
- void setExceptionHandler(String newExceptionHandler);
- static final String EXCEPTION_HANDLER_PROPERTY = "exceptionHandler"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_EXCEPTION_HANDLER = "eclipselink.exception-handler"; //$NON-NLS-1$
- static final String DEFAULT_EXCEPTION_HANDLER = null; // no default
- String ECLIPSELINK_EXCEPTION_HANDLER_CLASS_NAME = "org.eclipse.persistence.exceptions.ExceptionHandler"; //$NON-NLS-1$
-
- Boolean getDefaultValidateSchema();
- Boolean getValidateSchema();
- void setValidateSchema(Boolean newValidateSchema);
- static final String VALIDATE_SCHEMA_PROPERTY = "validateSchema"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_VALIDATE_SCHEMA = "eclipselink.orm.validate.schema"; //$NON-NLS-1$
- static final Boolean DEFAULT_VALIDATE_SCHEMA = Boolean.FALSE;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CustomizationEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CustomizationEntity.java
deleted file mode 100644
index b57a6e8c8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/CustomizationEntity.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import java.io.Serializable;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-
-/**
- * Entity
- */
-public class CustomizationEntity extends AbstractModel implements Cloneable, Serializable
-{
- private String name;
- private Customization parent;
-
- public static final String DESCRIPTOR_CUSTOMIZER_PROPERTY = Customization.DESCRIPTOR_CUSTOMIZER_PROPERTY;
-
- // ********** EclipseLink properties **********
- private String descriptorCustomizer;
-
- private static final long serialVersionUID = 1L;
-
- // ********** constructors **********
- public CustomizationEntity(Customization parent, String name) {
- this(parent);
- this.initialize(name);
- }
-
- private CustomizationEntity(Customization parent) {
- this.parent = parent;
- }
-
- private void initialize(String name) {
- if(StringTools.stringIsEmpty(name)) {
- throw new IllegalArgumentException();
- }
- this.name = name;
- }
-
- // ********** behaviors **********
- @Override
- public boolean equals(Object o) {
- if ( ! (o instanceof CustomizationEntity)) {
- return false;
- }
- CustomizationEntity customizer = (CustomizationEntity) o;
- return (
- (this.descriptorCustomizer == null ?
- customizer.descriptorCustomizer == null :
- this.descriptorCustomizer.equals(customizer.descriptorCustomizer)));
- }
-
- @Override
- public int hashCode() {
- return (this.descriptorCustomizer == null) ? 0 : this.descriptorCustomizer.hashCode();
- }
-
- @Override
- public CustomizationEntity clone() {
- try {
- return (CustomizationEntity)super.clone();
- }
- catch (CloneNotSupportedException ex) {
- throw new InternalError();
- }
- }
-
- public boolean isEmpty() {
- return this.descriptorCustomizer == null;
- }
-
- public boolean entityNameIsValid() {
- return ! StringTools.stringIsEmpty(this.name);
- }
-
- public Customization getParent() {
- return this.parent;
- }
-
- // ********** getter/setter **********
- public String getName() {
- return this.name;
- }
-
- public String getDescriptorCustomizer() {
- return this.descriptorCustomizer;
- }
-
- public void setDescriptorCustomizer(String descriptorCustomizer) {
- String old = this.descriptorCustomizer;
- this.descriptorCustomizer = descriptorCustomizer;
- this.firePropertyChanged(DESCRIPTOR_CUSTOMIZER_PROPERTY, old, descriptorCustomizer);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append("name: "); //$NON-NLS-1$
- sb.append(this.name);
- sb.append(", descriptorCustomizer: "); //$NON-NLS-1$
- sb.append(this.descriptorCustomizer);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/DdlGenerationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/DdlGenerationType.java
deleted file mode 100644
index d4f086a305..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/DdlGenerationType.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * DdlGenerationType
- */
-public enum DdlGenerationType implements PersistenceXmlEnumValue{
- none("none") , //$NON-NLS-1$
- create_tables("create-tables"), //$NON-NLS-1$
- drop_and_create_tables("drop-and-create-tables"); //$NON-NLS-1$
-
- private final String propertyValue;
-
- DdlGenerationType(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java
deleted file mode 100644
index 8351b41812..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceUnit.java
+++ /dev/null
@@ -1,1325 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.NonEmptyStringFilter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.MappingFile;
-import org.eclipse.jpt.jpa.core.context.MappingFilePersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.context.MappingFileRoot;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaGenerator;
-import org.eclipse.jpt.jpa.core.context.java.JavaQuery;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.internal.JptCoreMessages;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.ImpliedMappingFileRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpql.JpaJpqlQueryHelper;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaJpqlQueryHelper;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.JptJpaEclipseLinkCoreMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkCustomization;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkGeneralProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkSchemaGeneration;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink persistence unit
- */
-public class EclipseLinkPersistenceUnit
- extends AbstractPersistenceUnit
-{
- /**
- * Will be null if the implied EL mapping file should not be part of the context model.
- * Otherwise will be equal to potentialImpliedEclipseLinkMappingFileRef.
- *
- * @see #potentialImpliedEclipseLinkMappingFileRef
- */
- protected MappingFileRef impliedEclipseLinkMappingFileRef;
- /**
- * String constant associated with changes to the implied eclipselink mapping file ref
- */
- public static final String IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY = "impliedEclipseLinkMappingFileRef"; //$NON-NLS-1$
-
- /**
- * Store the implied EL mapping file ref even if it is not part of the context model.
- * This allows us to sync it in the syncWithResourceModel. In the update, determine if
- * it should be part of the context model and set the impliedEclipseLinkMappingFileRef appropriately.
- *
- * @see #impliedEclipseLinkMappingFileRef
- * @see #usesImpliedEclipseLinkMappingFile()
- */
- protected final MappingFileRef potentialImpliedEclipseLinkMappingFileRef;
-
-
- private/*final*/ GeneralProperties generalProperties;
- private Customization customization;
- private Caching caching;
- private Logging logging;
- private SchemaGeneration schemaGeneration;
-
- /* global converter definitions, defined elsewhere in model */
- protected final Vector<EclipseLinkConverter> converters = new Vector<EclipseLinkConverter>();
-
- protected final Vector<ReadOnlyTenantDiscriminatorColumn2_3> defaultTenantDiscriminatorColumns = new Vector<ReadOnlyTenantDiscriminatorColumn2_3>();
-
- protected String defaultGetMethod;
- protected String defaultSetMethod;
-
- public EclipseLinkPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- super(parent, xmlPersistenceUnit);
- this.potentialImpliedEclipseLinkMappingFileRef = this.buildEclipseLinkImpliedMappingFileRef();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void update() {
- super.update();
- this.setConverters(this.buildConverters());
-
- OrmEclipseLinkPersistenceUnitMetadata metadata = this.getEclipseLinkMetadata();
-
- EclipseLinkPersistenceUnitDefaults defaults = (metadata == null) ? null : metadata.getPersistenceUnitDefaults();
- this.setDefaultTenantDiscriminatorColumns(this.buildDefaultTenantDiscriminatorColumns(defaults));
- }
-
- protected OrmEclipseLinkPersistenceUnitMetadata getEclipseLinkMetadata() {
- MappingFilePersistenceUnitMetadata metadata = super.getMetadata();
- if (metadata instanceof OrmEclipseLinkPersistenceUnitMetadata) {
- return (OrmEclipseLinkPersistenceUnitMetadata) metadata;
- }
- return null;
- }
-
- @Override
- protected void updatePersistenceUnitMetadata() {
- super.updatePersistenceUnitMetadata();
- OrmEclipseLinkPersistenceUnitMetadata metadata = this.getEclipseLinkMetadata();
-
- EclipseLinkPersistenceUnitDefaults defaults = (metadata == null) ? null : metadata.getPersistenceUnitDefaults();
- this.setDefaultGetMethod(this.buildDefaultGetMethod(defaults));
- this.setDefaultSetMethod(this.buildDefaultSetMethod(defaults));
- }
-
- // ********** properties **********
-
- public GeneralProperties getGeneralProperties() {
- return this.generalProperties;
- }
-
- @Override
- public Connection getConnection() {
- return (Connection) super.getConnection();
- }
-
- public Customization getCustomization() {
- return this.customization;
- }
-
- public Caching getCaching() {
- return this.caching;
- }
-
- public String getDefaultCacheTypePropertyValue() {
- Property cacheTypeDefaultProperty = getCacheTypeDefaultProperty();
- return cacheTypeDefaultProperty != null ? cacheTypeDefaultProperty.getValue() : null;
- }
-
- public String getDefaultCacheSizePropertyValue() {
- Property cacheSizeDefaultProperty = getCacheSizeDefaultProperty();
- return cacheSizeDefaultProperty != null ? cacheSizeDefaultProperty.getValue() : null;
- }
-
- public String getDefaultCacheSharedPropertyValue() {
- Property cacheSharedDefaultProperty = getCacheSharedDefaultProperty();
- return cacheSharedDefaultProperty != null ? cacheSharedDefaultProperty.getValue() : null;
- }
-
- public Logging getLogging() {
- return this.logging;
- }
-
- @Override
- public Options getOptions() {
- return (Options) super.getOptions();
- }
-
- public SchemaGeneration getSchemaGeneration() {
- return this.schemaGeneration;
- }
-
- protected GeneralProperties buildEclipseLinkGeneralProperties() {
- return new EclipseLinkGeneralProperties(this);
- }
-
- protected Connection buildEclipseLinkConnection() {
- return (Connection) this.getContextNodeFactory().buildConnection(this);
- }
-
- protected Customization buildEclipseLinkCustomization() {
- return new EclipseLinkCustomization(this);
- }
-
- protected Caching buildEclipseLinkCaching() {
- return new EclipseLinkCaching(this);
- }
-
- protected Logging buildEclipseLinkLogging() {
- return (Logging) this.getContextNodeFactory().buildLogging(this);
- }
-
- protected Options buildEclipseLinkOptions() {
- return (Options) this.getContextNodeFactory().buildOptions(this);
- }
-
- protected SchemaGeneration buildEclipseLinkSchemaGeneration() {
- return new EclipseLinkSchemaGeneration(this);
- }
-
- @Override
- protected void initializeProperties() {
- super.initializeProperties();
- this.generalProperties = this.buildEclipseLinkGeneralProperties();
- this.customization = this.buildEclipseLinkCustomization();
- this.caching = this.buildEclipseLinkCaching();
- this.logging = this.buildEclipseLinkLogging();
- this.schemaGeneration = this.buildEclipseLinkSchemaGeneration();
- }
-
- @Override
- public void propertyValueChanged(String propertyName, String newValue) {
- super.propertyValueChanged(propertyName, newValue);
- this.generalProperties.propertyValueChanged(propertyName, newValue);
- this.customization.propertyValueChanged(propertyName, newValue);
- this.caching.propertyValueChanged(propertyName, newValue);
- this.logging.propertyValueChanged(propertyName, newValue);
- this.schemaGeneration.propertyValueChanged(propertyName, newValue);
- }
-
- @Override
- public void propertyRemoved(String propertyName) {
- super.propertyRemoved(propertyName);
- this.generalProperties.propertyRemoved(propertyName);
- this.customization.propertyRemoved(propertyName);
- this.caching.propertyRemoved(propertyName);
- this.logging.propertyRemoved(propertyName);
- this.schemaGeneration.propertyRemoved(propertyName);
- }
-
-
- // ********** mapping file refs **********
-
- @Override
- public ListIterable<MappingFileRef> getMappingFileRefs() {
- return (this.impliedEclipseLinkMappingFileRef == null) ?
- super.getMappingFileRefs() :
- new CompositeListIterable<MappingFileRef>(super.getMappingFileRefs(), this.impliedEclipseLinkMappingFileRef);
- }
-
- @Override
- public int getMappingFileRefsSize() {
- return (this.impliedEclipseLinkMappingFileRef == null) ?
- super.getMappingFileRefsSize() :
- super.getMappingFileRefsSize() + 1;
- }
-
-
- // ********** implied eclipselink mapping file ref **********
-
- public MappingFileRef getImpliedEclipseLinkMappingFileRef() {
- return this.impliedEclipseLinkMappingFileRef;
- }
-
- protected void setImpliedEclipseLinkMappingFileRef(MappingFileRef mappingFileRef) {
- MappingFileRef old = this.impliedEclipseLinkMappingFileRef;
- this.impliedEclipseLinkMappingFileRef = mappingFileRef;
- this.firePropertyChanged(IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, old, mappingFileRef);
- }
-
- private ImpliedMappingFileRef buildEclipseLinkImpliedMappingFileRef() {
- return new ImpliedMappingFileRef(this, JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- }
-
- @Override
- protected void syncImpliedMappingFileRef() {
- super.syncImpliedMappingFileRef();
- this.potentialImpliedEclipseLinkMappingFileRef.synchronizeWithResourceModel();
- }
-
- @Override
- protected void updateImpliedMappingFileRef() {
- super.updateImpliedMappingFileRef();
-
- if (this.usesImpliedEclipseLinkMappingFile()) {
- this.setImpliedEclipseLinkMappingFileRef(this.potentialImpliedEclipseLinkMappingFileRef);
- this.potentialImpliedEclipseLinkMappingFileRef.update();
- }
- else {
- this.setImpliedEclipseLinkMappingFileRef(null);
- //this is needed to unregister the root structure node, how we build the root structure nodes probably needs to change.
- this.potentialImpliedEclipseLinkMappingFileRef.dispose();
- }
- }
-
- /**
- * Use the implied EclipseLink mapping file if all the following are true:<ul>
- * <li>the properties do not explicitly exclude it
- * <li>it is not specified explicitly in the persistence unit
- * <li>the file actually exists
- * </ul>
- */
- private boolean usesImpliedEclipseLinkMappingFile() {
- return this.impliedEclipseLinkMappingFileIsNotExcluded() &&
- this.impliedEclipseLinkMappingFileIsNotSpecified() &&
- this.impliedEclipseLinkMappingFileExists();
- }
-
- protected boolean impliedEclipseLinkMappingFileIsNotExcluded() {
- return ! this.impliedEclipseLinkMappingFileIsExcluded();
- }
-
- protected boolean impliedEclipseLinkMappingFileIsExcluded() {
- return this.getGeneralProperties().getExcludeEclipselinkOrm() == Boolean.TRUE;
- }
-
- protected boolean impliedEclipseLinkMappingFileIsNotSpecified() {
- return ! this.impliedEclipseLinkMappingFileIsSpecified();
- }
-
- protected boolean impliedEclipseLinkMappingFileIsSpecified() {
- return this.mappingFileIsSpecified(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- }
-
- protected boolean impliedEclipseLinkMappingFileExists() {
- return this.getJpaProject().getDefaultEclipseLinkOrmXmlResource() != null;
- }
-
-
- // ********** default tenant discriminator columns **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * list of default tenant discriminator Columns
- */
- public static final String DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST = "defaultTenantDiscriminatorColumns"; //$NON-NLS-1$
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return new LiveCloneListIterable<ReadOnlyTenantDiscriminatorColumn2_3>(this.defaultTenantDiscriminatorColumns);
- }
-
- protected void setDefaultTenantDiscriminatorColumns(Iterable<ReadOnlyTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns) {
- this.synchronizeList(tenantDiscriminatorColumns, this.defaultTenantDiscriminatorColumns, DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST);
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> buildDefaultTenantDiscriminatorColumns(EclipseLinkPersistenceUnitDefaults defaults) {
- return (defaults == null) ? EmptyListIterable.<ReadOnlyTenantDiscriminatorColumn2_3> instance() : new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(defaults.getTenantDiscriminatorColumns());
- }
-
-
- // ********** converters **********
-
- /**
- * String constant associated with changes to the persistence unit's
- * collection of "global" converters.
- */
- public static final String CONVERTERS_COLLECTION = "converters"; //$NON-NLS-1$
-
- /**
- * Return the "active" converters defined within the persistence unit's scope,
- * including converters with duplicate names. "Active" converters are:<ul>
- * <li>any converter defined in mapping files
- * <li>any converter defined via Java annotations that is not "overridden"
- * by a mapping file converter with the same name
- * </ul>
- * <strong>NB:</strong> A Java converter defined on a class or attribute
- * that is overridden in a mapping file is <em>not</em>, as a result,
- * itself overridden. A Java converter can only be overridden by a mapping
- * file converter with the same name.
- * <p>
- * <strong>NB:</strong> A Java converter defined on a class or attribute
- * whose corresponding mapping file mapping (or mapping file) is marked
- * "metadata complete" is ignored.
- */
- // TODO bjv change to getConverterNames() etc.
- public Iterable<EclipseLinkConverter> getAllConverters() {
- return this.getConverters();
- }
-
- public Iterable<EclipseLinkConverter> getConverters() {
- return new LiveCloneIterable<EclipseLinkConverter>(this.converters);
- }
-
- public int getConvertersSize() {
- return this.converters.size();
- }
-
- /**
- * Return the names of the "active" converters defined in the persistence
- * unit's scope, with duplicates removed.
- */
- public Iterable<String> getUniqueConverterNames() {
- return CollectionTools.set(this.getNonEmptyConverterNames(), this.getConvertersSize());
- }
-
- protected Iterable<String> getNonEmptyConverterNames() {
- return new FilteringIterable<String>(this.getConverterNames(), NonEmptyStringFilter.instance());
- }
-
- protected Iterable<String> getConverterNames() {
- return new TransformationIterable<EclipseLinkConverter, String>(this.getConverters(), JpaNamedContextNode.NameTransformer.<EclipseLinkConverter>instance());
- }
-
- protected void setConverters(Iterable<EclipseLinkConverter> converters) {
- this.synchronizeCollection(converters, this.converters, CONVERTERS_COLLECTION);
- }
-
- /**
- * Converters are much like queries.
- * @see #buildQueries()
- */
- protected Iterable<EclipseLinkConverter> buildConverters() {
- ArrayList<EclipseLinkConverter> result = CollectionTools.list(this.getMappingFileConverters());
-
- HashSet<String> mappingFileConverterNames = this.convertToNames(result);
- HashMap<String, ArrayList<JavaEclipseLinkConverter<?>>> javaConverters = this.mapByName(this.getAllJavaConverters());
- for (Map.Entry<String, ArrayList<JavaEclipseLinkConverter<?>>> entry : javaConverters.entrySet()) {
- if ( ! mappingFileConverterNames.contains(entry.getKey())) {
- result.addAll(entry.getValue());
- }
- }
-
- return result;
- }
-
- protected Iterable<EclipseLinkConverter> getMappingFileConverters() {
- return new CompositeIterable<EclipseLinkConverter>(this.getMappingFileConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getMappingFileConverterLists() {
- return new TransformationIterable<MappingFile, Iterable<EclipseLinkConverter>>(this.getMappingFiles()) {
- @Override
- protected Iterable<EclipseLinkConverter> transform(MappingFile mappingFile) {
- MappingFileRoot root = mappingFile.getRoot();
- return (root instanceof EclipseLinkEntityMappings) ?
- ((EclipseLinkEntityMappings) root).getMappingFileConverters() :
- EmptyIterable.<EclipseLinkConverter>instance();
- }
- };
- }
-
- /**
- * Include "overridden" Java converters.
- */
- public Iterable<JavaEclipseLinkConverter<?>> getAllJavaConverters() {
- return new CompositeIterable<JavaEclipseLinkConverter<?>>(this.getAllJavaTypeMappingConverterLists());
- }
-
- protected Iterable<Iterable<JavaEclipseLinkConverter<?>>> getAllJavaTypeMappingConverterLists() {
- return new TransformationIterable<TypeMapping, Iterable<JavaEclipseLinkConverter<?>>>(this.getAllJavaTypeMappingsUnique()) {
- @Override
- protected Iterable<JavaEclipseLinkConverter<?>> transform(TypeMapping typeMapping) {
- return new SubIterableWrapper<EclipseLinkConverter, JavaEclipseLinkConverter<?>>(this.transform_(typeMapping));
- }
- protected Iterable<EclipseLinkConverter> transform_(TypeMapping typeMapping) {
- // Java "null" type mappings are not EclipseLink mappings
- return (typeMapping instanceof EclipseLinkTypeMapping) ?
- ((EclipseLinkTypeMapping) typeMapping).getConverters() :
- EmptyIterable.<EclipseLinkConverter>instance();
- }
- };
- }
-
-
- // ********** misc **********
-
- @Override
- public EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- @Override
- public EclipseLinkPersistenceXmlContextNodeFactory getContextNodeFactory() {
- return (EclipseLinkPersistenceXmlContextNodeFactory) super.getContextNodeFactory();
- }
-
- @Override
- public void setSpecifiedSharedCacheMode(SharedCacheMode specifiedSharedCacheMode) {
- super.setSpecifiedSharedCacheMode(specifiedSharedCacheMode);
-
- if(specifiedSharedCacheMode == SharedCacheMode.NONE) {
- this.caching.removeDefaultCachingProperties();
- }
- }
-
- @Override
- protected SharedCacheMode buildDefaultSharedCacheMode() {
- return SharedCacheMode.DISABLE_SELECTIVE;
- }
-
- @Override
- public boolean calculateDefaultCacheable() {
- SharedCacheMode sharedCacheMode = this.getSharedCacheMode();
- if (sharedCacheMode == null) {
- return true;
- }
- switch (sharedCacheMode) {
- case NONE:
- case ENABLE_SELECTIVE:
- return false;
- case ALL:
- case DISABLE_SELECTIVE:
- case UNSPECIFIED:
- return true;
- }
- return true;
- }
-
-
- public String getDefaultGetMethod() {
- return this.defaultGetMethod;
- }
-
- protected void setDefaultGetMethod(String getMethod) {
- String old = this.defaultGetMethod;
- this.defaultGetMethod = getMethod;
- this.firePropertyChanged(DEFAULT_GET_METHOD_PROPERTY, old, getMethod);
- }
-
- /**
- * String constant associated with changes to the persistence unit's
- * default get method.
- */
- public static final String DEFAULT_GET_METHOD_PROPERTY = "defaultGetMethod"; //$NON-NLS-1$
-
- protected String buildDefaultGetMethod(EclipseLinkPersistenceUnitDefaults defaults) {
- String getMethod = (defaults == null) ? null : defaults.getGetMethod();
- return (getMethod != null) ? getMethod : null;
- }
-
- public String getDefaultSetMethod() {
- return this.defaultSetMethod;
- }
-
- protected void setDefaultSetMethod(String setMethod) {
- String old = this.defaultSetMethod;
- this.defaultSetMethod = setMethod;
- this.firePropertyChanged(DEFAULT_SET_METHOD_PROPERTY, old, setMethod);
- }
-
- /**
- * String constant associated with changes to the persistence unit's
- * default set method.
- */
- public static final String DEFAULT_SET_METHOD_PROPERTY = "defaultSetMethod"; //$NON-NLS-1$
-
- protected String buildDefaultSetMethod(EclipseLinkPersistenceUnitDefaults defaults) {
- String setMethod = (defaults == null) ? null : defaults.getSetMethod();
- return (setMethod != null) ? setMethod : null;
- }
-
- // ********** validation **********
-
- public JpaJpqlQueryHelper createJpqlQueryHelper() {
- return new EclipseLinkJpaJpqlQueryHelper(this.getJpaPlatform().getJpqlGrammar());
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateConverters(messages, reporter);
- }
-
- @Override
- protected void validateProperties(List<IMessage> messages, IReporter reporter) {
-
- if(this.isJpa2_0Compatible()) {
- for(Property property: this.getLegacyEntityCachingProperties()) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING,
- new String[] {property.getName()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- }
- for(Property property: this.getLegacyDescriptorCustomizerProperties()) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENCE_UNIT_LEGACY_DESCRIPTOR_CUSTOMIZER,
- new String[] {property.getName()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- }
- this.validateDefaultCachingProperty(this.getCacheTypeDefaultProperty(), messages);
- this.validateDefaultCachingProperty(this.getCacheSizeDefaultProperty(), messages);
- this.validateDefaultCachingProperty(this.getFlushClearCacheProperty(), messages);
- this.validateLoggerProperty(this.getLoggerProperty(), messages);
- this.validateExceptionHandlerProperty(this.getExceptionHandlerProperty(), messages);
- this.validatePerformanceProfilerProperty(this.getPerformanceProfilerProperty(), messages);
- this.validateSessionCustomizerProperty(this.getSessionCustomizerProperties(), messages);
- }
- }
-
- protected void validateDefaultCachingProperty(Property cachingProperty, List<IMessage> messages) {
-
- if(this.getSharedCacheMode() == SharedCacheMode.NONE) {
- if(cachingProperty != null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENCE_UNIT_CACHING_PROPERTY_IGNORED,
- new String[] {cachingProperty.getName()},
- this.getPersistenceUnit(),
- cachingProperty.getValidationTextRange()
- )
- );
- }
- }
- }
-
- protected void validateLoggerProperty(Property loggerProperty, List<IMessage> messages) {
- if ((loggerProperty == null) || (loggerProperty.getValue() == null) ) {
- return;
- }
-
- if (ArrayTools.contains(Logging.RESERVED_LOGGER_NAMES, loggerProperty.getValue())) {
- return;
- }
-
- IJavaProject javaProject = getJpaProject().getJavaProject();
- if (StringTools.stringIsEmpty(loggerProperty.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_LOGGER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this.getPersistenceUnit(),
- loggerProperty.getValidationTextRange()
- )
- );
- } else if (JDTTools.findType(javaProject, loggerProperty.getValue()) == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_LOGGER_CLASS_NOT_EXIST,
- new String[] {loggerProperty.getValue()},
- this.getPersistenceUnit(),
- loggerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.typeIsSubType(
- javaProject, loggerProperty.getValue(), Logging.ECLIPSELINK_LOGGER_CLASS_NAME)
- ) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_LOGGER_CLASS_IMPLEMENTS_SESSION_LOG,
- new String[] {loggerProperty.getValue()},
- this.getPersistenceUnit(),
- loggerProperty.getValidationTextRange()
- )
- );
- }
- }
-
- private void validateExceptionHandlerProperty(Property handlerProperty, List<IMessage> messages) {
- if ((handlerProperty == null) || (handlerProperty.getValue() == null) ) {
- return;
- }
-
- IJavaProject javaProject = getJpaProject().getJavaProject();
- if (StringTools.stringIsEmpty(handlerProperty.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.EXCEPTION_HANDLER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this.getPersistenceUnit(),
- handlerProperty.getValidationTextRange()
- )
- );
- } else if (JDTTools.findType(javaProject, handlerProperty.getValue()) == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.EXCEPTION_HANDLER_CLASS_NOT_EXIST,
- new String[] {handlerProperty.getValue()},
- this.getPersistenceUnit(),
- handlerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, handlerProperty.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.EXCEPTION_HANDLER_CLASS_NOT_VALID,
- new String[] {handlerProperty.getValue()},
- this.getPersistenceUnit(),
- handlerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.typeIsSubType(
- javaProject, handlerProperty.getValue(), Customization.ECLIPSELINK_EXCEPTION_HANDLER_CLASS_NAME)
- ) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.EXCEPTION_HANDLER_CLASS_IMPLEMENTS_EXCEPTION_HANDLER,
- new String[] {handlerProperty.getValue()},
- this.getPersistenceUnit(),
- handlerProperty.getValidationTextRange()
- )
- );
- }
- }
-
- private void validatePerformanceProfilerProperty(Property profilerProperty, List<IMessage> messages) {
-
- if ((profilerProperty == null) || (profilerProperty.getValue() == null) ) {
- return;
- }
-
- if (ArrayTools.contains(Customization.RESERVED_PROFILER_NAMES, profilerProperty.getValue())) {
- return;
- }
-
- IJavaProject javaProject = getJpaProject().getJavaProject();
- if (StringTools.stringIsEmpty(profilerProperty.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_PROFILER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this.getPersistenceUnit(),
- profilerProperty.getValidationTextRange()
- )
- );
- } else if (JDTTools.findType(javaProject, profilerProperty.getValue()) == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_PROFILER_CLASS_NOT_EXIST,
- new String[] {profilerProperty.getValue()},
- this.getPersistenceUnit(),
- profilerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, profilerProperty.getValue())){
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_PROFILER_CLASS_NOT_VALID,
- new String[] {profilerProperty.getValue()},
- this.getPersistenceUnit(),
- profilerProperty.getValidationTextRange()
- )
- );
- } else if (!JDTTools.typeIsSubType(
- javaProject, profilerProperty.getValue(), Customization.ECLIPSELINK_SESSION_PROFILER_CLASS_NAME)
- ) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_PROFILER_CLASS_IMPLEMENTS_SESSIONP_ROFILER,
- new String[] {profilerProperty.getValue()},
- this.getPersistenceUnit(),
- profilerProperty.getValidationTextRange()
- )
- );
- }
- }
-
- private void validateSessionCustomizerProperty( Iterable<Property> properties, List<IMessage> messages) {
- for (Property property : properties) {
- if (property.getValue() == null) {
- return;
- }
-
- IJavaProject javaProject = getJpaProject().getJavaProject();
- if (StringTools.stringIsEmpty(property.getValue())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_CUSTOMIZER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- } else if (JDTTools.findType(javaProject, property.getValue()) == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_CUSTOMIZER_CLASS_NOT_EXIST,
- new String[] {property.getValue()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- } else if (!JDTTools.classHasPublicZeroArgConstructor(javaProject, property.getValue())){
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_CUSTOMIZER_CLASS_NOT_VALID,
- new String[] {property.getValue()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- } else if (!JDTTools.typeIsSubType(
- javaProject, property.getValue(), Customization.ECLIPSELINK_SESSION_CUSTOMIZER_CLASS_NAME)
- ) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.SESSION_CUSTOMIZER_CLASS_IMPLEMENTS_SESSION_CUSTOMIZER,
- new String[] {property.getValue()},
- this.getPersistenceUnit(),
- property.getValidationTextRange()
- )
- );
- }
- }
- }
-
-
- protected ArrayList<Property> getLegacyDescriptorCustomizerProperties() {
- ArrayList<Property> result = new ArrayList<Property>();
- CollectionTools.addAll(result, this.getDescriptorCustomizerProperties());
- return result;
- }
-
- protected ArrayList<Property> getLegacyEntityCachingProperties() {
- ArrayList<Property> result = new ArrayList<Property>();
- CollectionTools.addAll(result, this.getSharedCacheProperties());
- CollectionTools.addAll(result, this.getEntityCacheTypeProperties());
- CollectionTools.addAll(result, this.getEntityCacheSizeProperties());
- return result;
- }
-
- private Property getCacheTypeDefaultProperty() {
- return this.getProperty(Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT);
- }
-
- private Property getCacheSizeDefaultProperty() {
- return this.getProperty(Caching.ECLIPSELINK_CACHE_SIZE_DEFAULT);
- }
-
- private Property getCacheSharedDefaultProperty() {
- return this.getProperty(Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT);
- }
-
- private Property getFlushClearCacheProperty() {
- return this.getProperty(Caching.ECLIPSELINK_FLUSH_CLEAR_CACHE);
- }
-
- /**
- * Returns all Shared Cache Properties, including Entity and default.
- */
- private Iterable<Property> getSharedCacheProperties() {
- return this.getPropertiesWithNamePrefix(Caching.ECLIPSELINK_SHARED_CACHE);
- }
-
- /**
- * Returns Entity Cache Size Properties, excluding default.
- */
- private Iterable<Property> getEntityCacheSizeProperties() {
- return this.getEntityPropertiesWithPrefix(Caching.ECLIPSELINK_CACHE_SIZE);
- }
-
- /**
- * Returns Entity Cache Type Properties, excluding default.
- */
- private Iterable<Property> getEntityCacheTypeProperties() {
- return this.getEntityPropertiesWithPrefix(Caching.ECLIPSELINK_CACHE_TYPE);
- }
-
- /**
- * Returns Descriptor Customizer Properties.
- */
- private Iterable<Property> getDescriptorCustomizerProperties() {
- return this.getEntityPropertiesWithPrefix(Customization.ECLIPSELINK_DESCRIPTOR_CUSTOMIZER);
- }
-
- /**
- * Returns Entity Properties with the given prefix,
- * excluding Entity which name equals "default".
- */
- private Iterable<Property> getEntityPropertiesWithPrefix(String prefix) {
- return new FilteringIterable<Property>(this.getPropertiesWithNamePrefix(prefix)) {
- @Override
- protected boolean accept(Property next) {
- return ! next.getName().endsWith("default"); //$NON-NLS-1$
- }
- };
- }
-
- private Property getLoggerProperty() {
- return this.getProperty(Logging.ECLIPSELINK_LOGGER);
- }
-
- private Property getExceptionHandlerProperty() {
- return this.getProperty(Customization.ECLIPSELINK_EXCEPTION_HANDLER);
- }
-
- private Property getPerformanceProfilerProperty() {
- return this.getProperty(Customization.ECLIPSELINK_PROFILER);
- }
-
- /**
- * Returns all Session Customizer Properties.
- */
- private Iterable<Property> getSessionCustomizerProperties() {
- return this.getPropertiesWithNamePrefix(Customization.ECLIPSELINK_SESSION_CUSTOMIZER);
- }
-
- /**
- * <strong>NB:</strong> We validate converters here.
- * @see #validateGenerators(List, IReporter)
- */
- protected void validateConverters(List<IMessage> messages, IReporter reporter) {
- this.checkForConvertersWithSameName(messages);
- for (EclipseLinkConverter converter : this.getConverters()) {
- this.validate(converter, messages, reporter);
- }
- }
-
- protected void checkForConvertersWithSameName(List<IMessage> messages) {
- HashMap<String, ArrayList<EclipseLinkConverter>> convertersByName = this.mapByName(this.getConverters());
- for (Map.Entry<String, ArrayList<EclipseLinkConverter>> entry : convertersByName.entrySet()) {
- String converterName = entry.getKey();
- if (StringTools.stringIsNotEmpty(converterName)) { // ignore empty names
- ArrayList<EclipseLinkConverter> dups = entry.getValue();
- if (dups.size() > 1) {
- this.validateConvertersWithSameName(converterName, dups, messages);
- }
- }
- }
- }
-
- /**
- * <strong>NB:</strong> Unlike generators and queries, we do not mark
- * "equivalent" converters with info messages - we just ignore them
- * because they cannot be "portable" (since only EclipseLink has converters).
- */
- protected void validateConvertersWithSameName(String converterName, ArrayList<EclipseLinkConverter> dups, List<IMessage> messages) {
- String[] parms = new String[] {converterName};
- if (this.anyNodesAreInequivalent(dups)) {
- for (EclipseLinkConverter dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_DUPLICATE_NAME,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- }
- }
- }
-
- /**
- * Return whether all the specified nodes are "equivalent"
- * (i.e. they all have the same state).
- */
- protected boolean allNodesAreEquivalent(ArrayList<? extends JpaNamedContextNode> nodes) {
- return ! this.anyNodesAreInequivalent(nodes);
- }
-
- protected boolean anyNodesAreInequivalent(ArrayList<? extends JpaNamedContextNode> nodes) {
- if (nodes.size() < 2) {
- throw new IllegalArgumentException();
- }
- Iterator<? extends JpaNamedContextNode> stream = nodes.iterator();
- JpaNamedContextNode first = stream.next();
- while (stream.hasNext()) {
- if ( ! stream.next().isEquivalentTo(first)) {
- return true;
- }
- }
- return false;
- }
-
- // TODO bjv isn't it obvious?
- protected TextRange extractNameTextRange(EclipseLinkConverter converter) {
- return (converter instanceof OrmEclipseLinkConverter<?>) ?
- ((OrmEclipseLinkConverter<?>) converter).getNameTextRange() :
- ((JavaEclipseLinkConverter<?>) converter).getNameTextRange(null);
- }
-
- // TODO bjv isn't it obvious?
- protected void validate(EclipseLinkConverter converter, List<IMessage> messages, IReporter reporter) {
- if (converter instanceof OrmEclipseLinkConverter<?>) {
- ((OrmEclipseLinkConverter<?>) converter).validate(messages, reporter);
- } else {
- ((JavaEclipseLinkConverter<?>) converter).validate(messages, reporter, null);
- }
- }
-
- /**
- * If all the generators are "equivalent" add info messages;
- * otherwise mark them all as duplicates.
- */
- @Override
- protected void validateGeneratorsWithSameName(String generatorName, ArrayList<Generator> dups, List<IMessage> messages) {
- if (this.allNodesAreEquivalent(dups)) {
- String[] parms = new String[] {generatorName};
- for (Generator dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- EclipseLinkJpaValidationMessages.GENERATOR_EQUIVALENT,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- }
- } else {
- super.validateGeneratorsWithSameName(generatorName, dups, messages);
- }
- }
-
- /**
- * @see #validateGeneratorsWithSameName(String, ArrayList, List)
- */
- @Override
- protected void validateQueriesWithSameName(String queryName, ArrayList<Query> dups, List<IMessage> messages) {
- if (this.allNodesAreEquivalent(dups)) {
- String[] parms = new String[] {queryName};
- for (Query dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- EclipseLinkJpaValidationMessages.QUERY_EQUIVALENT,
- parms,
- dup,
- this.extractNameTextRange(dup)
- )
- );
- }
- } else {
- super.validateQueriesWithSameName(queryName, dups, messages);
- }
- }
-
-
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- protected Iterable<ReplaceEdit> createPersistenceUnitPropertiesRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createPersistenceUnitPropertiesRenameTypeEdits(originalType, newName),
- this.customization.createRenameTypeEdits(originalType, newName),
- this.logging.createRenameTypeEdits(originalType, newName)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected Iterable<ReplaceEdit> createPersistenceUnitPropertiesMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createPersistenceUnitPropertiesMoveTypeEdits(originalType, newPackage),
- this.customization.createMoveTypeEdits(originalType, newPackage),
- this.logging.createMoveTypeEdits(originalType, newPackage)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected Iterable<ReplaceEdit> createPersistenceUnitPropertiesRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createPersistenceUnitPropertiesRenamePackageEdits(originalPackage, newName),
- this.customization.createRenamePackageEdits(originalPackage, newName),
- this.logging.createRenamePackageEdits(originalPackage, newName)
- );
- }
-
- // ********** metadata conversion **********
- // ***** queries
-
- /**
- * @see #convertJavaQueries(EntityMappings, IProgressMonitor)
- */
- @Override
- public boolean hasConvertibleJavaQueries() {
- return ! this.getEclipseLinkConvertibleJavaQueries().isEmpty();
- }
-
- /**
- * Return whether the persistence unit has any equivalent Java generators.
- */
- public boolean hasAnyEquivalentJavaQueries() {
- return this.hasAnyEquivalentJavaNodes(this.getAllJavaQueries(), this.getMappingFileQueries());
- }
-
- /**
- * Override the default implementation because EclipseLink allows
- * "equivalent" queries.
- */
- @Override
- public void convertJavaQueries(EntityMappings entityMappings, IProgressMonitor monitor) {
- OrmQueryContainer queryContainer = entityMappings.getQueryContainer();
- HashMap<String, ArrayList<JavaQuery>> convertibleJavaQueries = this.getEclipseLinkConvertibleJavaQueries();
- int work = this.calculateCumulativeSize(convertibleJavaQueries.values());
- SubMonitor sm = SubMonitor.convert(monitor, JptCoreMessages.JAVA_METADATA_CONVERSION_IN_PROGRESS, work);
- for (Map.Entry<String, ArrayList<JavaQuery>> entry : convertibleJavaQueries.entrySet()) {
- this.convertJavaQueriesWithSameName(queryContainer, entry, sm.newChild(entry.getValue().size()));
- }
- sm.setTaskName(JptCoreMessages.JAVA_METADATA_CONVERSION_COMPLETE);
- }
-
- protected void convertJavaQueriesWithSameName(OrmQueryContainer queryContainer, Map.Entry<String, ArrayList<JavaQuery>> entry, SubMonitor monitor) {
- if (monitor.isCanceled()) {
- throw new OperationCanceledException(JptCoreMessages.JAVA_METADATA_CONVERSION_CANCELED);
- }
- monitor.setTaskName(NLS.bind(JptCoreMessages.JAVA_METADATA_CONVERSION_CONVERT_QUERY, entry.getKey()));
-
- ArrayList<JavaQuery> javaQueriesWithSameName = entry.getValue();
- JavaQuery first = javaQueriesWithSameName.get(0);
- first.convertTo(queryContainer);
- first.delete(); // delete any converted queries
- monitor.worked(1);
-
- for (int i = 1; i < javaQueriesWithSameName.size(); i++) { // NB: start with 1!
- javaQueriesWithSameName.get(i).delete();
- monitor.worked(1);
- }
- }
-
- /**
- * @see #extractEclipseLinkConvertibleJavaNodes(Iterable, Iterable)
- */
- protected HashMap<String, ArrayList<JavaQuery>> getEclipseLinkConvertibleJavaQueries() {
- return this.extractEclipseLinkConvertibleJavaNodes(this.getAllJavaQueries(), this.getMappingFileQueries());
- }
-
- // ***** generators
-
- /**
- * @see #convertJavaGenerators(EntityMappings, IProgressMonitor)
- */
- @Override
- public boolean hasConvertibleJavaGenerators() {
- return ! this.getEclipseLinkConvertibleJavaGenerators().isEmpty();
- }
-
- /**
- * Return whether the persistence unit has any equivalent Java generators.
- */
- public boolean hasAnyEquivalentJavaGenerators() {
- return this.hasAnyEquivalentJavaNodes(this.getAllJavaGenerators(), this.getMappingFileGenerators());
- }
-
- /**
- * Override the default implementation because EclipseLink allows
- * "equivalent" generators.
- */
- @Override
- public void convertJavaGenerators(EntityMappings entityMappings, IProgressMonitor monitor) {
- HashMap<String, ArrayList<JavaGenerator>> convertibleJavaGenerators = this.getEclipseLinkConvertibleJavaGenerators();
- int work = this.calculateCumulativeSize(convertibleJavaGenerators.values());
- SubMonitor sm = SubMonitor.convert(monitor, JptCoreMessages.JAVA_METADATA_CONVERSION_IN_PROGRESS, work);
- for (Map.Entry<String, ArrayList<JavaGenerator>> entry : convertibleJavaGenerators.entrySet()) {
- this.convertJavaGeneratorsWithSameName(entityMappings, entry, sm.newChild(entry.getValue().size()));
- }
- sm.setTaskName(JptCoreMessages.JAVA_METADATA_CONVERSION_COMPLETE);
- }
-
- protected void convertJavaGeneratorsWithSameName(EntityMappings entityMappings, Map.Entry<String, ArrayList<JavaGenerator>> entry, SubMonitor monitor) {
- if (monitor.isCanceled()) {
- throw new OperationCanceledException(JptCoreMessages.JAVA_METADATA_CONVERSION_CANCELED);
- }
- monitor.setTaskName(NLS.bind(JptCoreMessages.JAVA_METADATA_CONVERSION_CONVERT_GENERATOR, entry.getKey()));
-
- ArrayList<JavaGenerator> javaGeneratorsWithSameName = entry.getValue();
- JavaGenerator first = javaGeneratorsWithSameName.get(0);
- first.convertTo(entityMappings);
- first.delete(); // delete any converted generators
- monitor.worked(1);
-
- for (int i = 1; i < javaGeneratorsWithSameName.size(); i++) { // NB: start with 1!
- javaGeneratorsWithSameName.get(i).delete();
- monitor.worked(1);
- }
- }
-
- /**
- * @see #extractEclipseLinkConvertibleJavaNodes(Iterable, Iterable)
- */
- protected HashMap<String, ArrayList<JavaGenerator>> getEclipseLinkConvertibleJavaGenerators() {
- return this.extractEclipseLinkConvertibleJavaNodes(this.getAllJavaGenerators(), this.getMappingFileGenerators());
- }
-
- // ***** converters
-
- /**
- * @see #convertJavaConverters(EclipseLinkEntityMappings, IProgressMonitor)
- */
- public boolean hasConvertibleJavaConverters() {
- return ! this.getEclipseLinkConvertibleJavaConverters().isEmpty();
- }
-
- /**
- * Return whether the persistence unit has any equivalent Java generators.
- */
- public boolean hasAnyEquivalentJavaConverters() {
- return this.hasAnyEquivalentJavaNodes(this.getAllJavaConverters(), this.getMappingFileConverters());
- }
-
- /**
- * Override the default implementation because EclipseLink allows
- * "equivalent" converters.
- */
- public void convertJavaConverters(EclipseLinkEntityMappings entityMappings, IProgressMonitor monitor) {
- OrmEclipseLinkConverterContainer ormConverterContainer = entityMappings.getConverterContainer();
- HashMap<String, ArrayList<JavaEclipseLinkConverter<?>>> convertibleJavaConverters = this.getEclipseLinkConvertibleJavaConverters();
- int work = this.calculateCumulativeSize(convertibleJavaConverters.values());
- SubMonitor sm = SubMonitor.convert(monitor, JptCoreMessages.JAVA_METADATA_CONVERSION_IN_PROGRESS, work);
- for (Map.Entry<String, ArrayList<JavaEclipseLinkConverter<?>>> entry : convertibleJavaConverters.entrySet()) {
- this.convertJavaConvertersWithSameName(ormConverterContainer, entry, sm.newChild(entry.getValue().size()));
- }
- sm.setTaskName(JptCoreMessages.JAVA_METADATA_CONVERSION_COMPLETE);
- }
-
- protected void convertJavaConvertersWithSameName(OrmEclipseLinkConverterContainer ormConverterContainer, Map.Entry<String, ArrayList<JavaEclipseLinkConverter<?>>> entry, SubMonitor monitor) {
- if (monitor.isCanceled()) {
- throw new OperationCanceledException(JptCoreMessages.JAVA_METADATA_CONVERSION_CANCELED);
- }
- monitor.setTaskName(NLS.bind(JptJpaEclipseLinkCoreMessages.JAVA_METADATA_CONVERSION_CONVERT_CONVERTER, entry.getKey()));
-
- ArrayList<JavaEclipseLinkConverter<?>> javaConvertersWithSameName = entry.getValue();
- JavaEclipseLinkConverter<?> first = javaConvertersWithSameName.get(0);
- first.convertTo(ormConverterContainer);
- first.delete(); // delete any converted generators
- monitor.worked(1);
-
- for (int i = 1; i < javaConvertersWithSameName.size(); i++) { // NB: start with 1!
- javaConvertersWithSameName.get(i).delete();
- monitor.worked(1);
- }
- }
-
- /**
- * @see #extractEclipseLinkConvertibleJavaNodes(Iterable, Iterable)
- */
- protected HashMap<String, ArrayList<JavaEclipseLinkConverter<?>>> getEclipseLinkConvertibleJavaConverters() {
- return this.extractEclipseLinkConvertibleJavaNodes(this.getAllJavaConverters(), this.getMappingFileConverters());
- }
-
- protected int calculateCumulativeSize(Collection<? extends Collection<?>> collections) {
- int cumulativeSize = 0;
- for (Collection<?> collection : collections) {
- cumulativeSize += collection.size();
- }
- return cumulativeSize;
- }
-
- protected <N extends JpaNamedContextNode> boolean hasAnyEquivalentJavaNodes(Iterable<N> allJavaNodes, Iterable<? extends JpaNamedContextNode> mappingFileNodes) {
- HashMap<String, ArrayList<N>> convertibleJavaNodes = this.extractEclipseLinkConvertibleJavaNodes(allJavaNodes, mappingFileNodes);
- for (Map.Entry<String, ArrayList<N>> entry : convertibleJavaNodes.entrySet()) {
- if (entry.getValue().size() > 1) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return the Java nodes that are neither overridden nor duplicated
- * (by default any Java nodes with the same name are "duplicates");
- * but, in EclipseLink we return any "equivalent" nodes also.
- */
- protected <N extends JpaNamedContextNode> HashMap<String, ArrayList<N>> extractEclipseLinkConvertibleJavaNodes(Iterable<N> allJavaNodes, Iterable<? extends JpaNamedContextNode> mappingFileNodes) {
- HashMap<String, ArrayList<N>> convertibleNodes = new HashMap<String, ArrayList<N>>();
-
- HashSet<String> mappingFileNodeNames = this.convertToNames(CollectionTools.list(mappingFileNodes));
- HashMap<String, ArrayList<N>> allJavaNodesByName = this.mapByName(allJavaNodes);
- for (Map.Entry<String, ArrayList<N>> entry : allJavaNodesByName.entrySet()) {
- String javaNodeName = entry.getKey();
- if (StringTools.stringIsEmpty(javaNodeName)) {
- continue; // ignore any nodes with an empty name(?)
- }
- if (mappingFileNodeNames.contains(javaNodeName)) {
- continue; // ignore any Java nodes overridden in the mapping file
- }
- ArrayList<N> javaNodesWithSameName = entry.getValue();
- if ((javaNodesWithSameName.size() == 1) || this.allNodesAreEquivalent(javaNodesWithSameName)) {
- convertibleNodes.put(javaNodeName, javaNodesWithSameName);
- } else {
- // ignore multiple Java nodes with the same name but that are not all "equivalent"
- }
- }
-
- return convertibleNodes;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
deleted file mode 100644
index 8a21402ae9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlContextNodeFactory;
-
-public interface EclipseLinkPersistenceXmlContextNodeFactory extends PersistenceXmlContextNodeFactory
-{
-
- PersistenceUnitProperties buildLogging(PersistenceUnit parent);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/ExclusiveConnectionMode.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/ExclusiveConnectionMode.java
deleted file mode 100644
index b8ffe28226..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/ExclusiveConnectionMode.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * ExclusiveConnectionMode
- */
-public enum ExclusiveConnectionMode implements PersistenceXmlEnumValue {
- always("Always"), //$NON-NLS-1$
- isolated("Isolated"), //$NON-NLS-1$
- transactional("Transactional"); //$NON-NLS-1$
-
- private final String propertyValue;
-
- ExclusiveConnectionMode(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/FlushClearCache.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/FlushClearCache.java
deleted file mode 100644
index ac5a0dc7b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/FlushClearCache.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * FlushClearCache
- */
-public enum FlushClearCache implements PersistenceXmlEnumValue {
- drop("Drop"), //$NON-NLS-1$
- drop_invalidate("DropInvalidate"), //$NON-NLS-1$
- merge("Merge"); //$NON-NLS-1$
-
- private final String propertyValue;
-
- FlushClearCache(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/GeneralProperties.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/GeneralProperties.java
deleted file mode 100644
index c1516a7e99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/GeneralProperties.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * GeneralProperties
- */
-public interface GeneralProperties extends PersistenceUnitProperties
-{
-
- Boolean getDefaultExcludeEclipselinkOrm();
- Boolean getExcludeEclipselinkOrm();
- void setExcludeEclipselinkOrm(Boolean newExcludeEclipselinkOrm);
- static final String EXCLUDE_ECLIPSELINK_ORM_PROPERTY = "excludeEclipselinkOrm"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM = "eclipselink.exclude-eclipselink-orm"; //$NON-NLS-1$
- static final Boolean DEFAULT_EXCLUDE_ECLIPSELINK_ORM = Boolean.FALSE;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logger.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logger.java
deleted file mode 100644
index 76fc836c0b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logger.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * Logger
- */
-public enum Logger implements PersistenceXmlEnumValue {
- default_logger("DefaultLogger", "org.eclipse.persistence.logging.DefaultSessionLog"), //$NON-NLS-1$ //$NON-NLS-2$
- java_logger("JavaLogger", "org.eclipse.persistence.logging.JavaLog"), //$NON-NLS-1$ //$NON-NLS-2$
- server_logger("ServerLogger", "org.eclipse.persistence.platform.server.ServerLog"); //$NON-NLS-1$ //$NON-NLS-2$
-
- private final String propertyValue;
-
- private final String className;
-
- Logger(String propertyValue, String className) {
- this.propertyValue = propertyValue;
- this.className = className;
- }
-
- public String getPropertyValue() {
- return this.propertyValue;
- }
-
- public String getClassName() {
- return this.className;
- }
-
- /**
- * Return the Logger value corresponding to the given literal.
- */
- public static Logger getLoggerFor(String literal) {
-
- for( Logger logger : Logger.values()) {
- if(logger.toString().equals(literal)) {
- return logger;
- }
- }
- return null;
- }
-
- public static String getLoggerClassName(String loggerValue) {
- for (Logger logger : values()) {
- if (logger.getPropertyValue() == loggerValue) {
- return logger.getClassName();
- }
- }
- return loggerValue;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging.java
deleted file mode 100644
index 3234f31d4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * Logging
- */
-public interface Logging extends PersistenceUnitProperties
-{
- LoggingLevel getDefaultLevel();
- LoggingLevel getLevel();
- void setLevel(LoggingLevel level);
- static final String LEVEL_PROPERTY = "level"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_LEVEL = "eclipselink.logging.level"; //$NON-NLS-1$
- static final LoggingLevel DEFAULT_LEVEL = LoggingLevel.info;
-
- Boolean getDefaultTimestamp();
- Boolean getTimestamp();
- void setTimestamp(Boolean timestamp);
- static final String TIMESTAMP_PROPERTY = "timestamp"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_TIMESTAMP = "eclipselink.logging.timestamp"; //$NON-NLS-1$
- static final Boolean DEFAULT_TIMESTAMP = Boolean.TRUE;
-
- Boolean getDefaultThread();
- Boolean getThread();
- void setThread(Boolean thread);
- static final String THREAD_PROPERTY = "thread"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_THREAD = "eclipselink.logging.thread"; //$NON-NLS-1$
- static final Boolean DEFAULT_THREAD = Boolean.TRUE;
-
- Boolean getDefaultSession();
- Boolean getSession();
- void setSession(Boolean session);
- static final String SESSION_PROPERTY = "session"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION = "eclipselink.logging.session"; //$NON-NLS-1$
- static final Boolean DEFAULT_SESSION = Boolean.TRUE;
-
- Boolean getDefaultExceptions();
- Boolean getExceptions();
- void setExceptions(Boolean exceptions);
- static final String EXCEPTIONS_PROPERTY = "exceptions"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_EXCEPTIONS = "eclipselink.logging.exceptions"; //$NON-NLS-1$
- static final Boolean DEFAULT_EXCEPTIONS = Boolean.FALSE;
-
- String getDefaultLogFileLocation();
- String getLogFileLocation();
- void setLogFileLocation(String newLogFileLocation);
- static final String LOG_FILE_LOCATION_PROPERTY = "logFileLocation"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_LOG_FILE_LOCATION = "eclipselink.logging.file"; //$NON-NLS-1$
- static final String DEFAULT_LOG_FILE_LOCATION = null; // No Default
-
- String getDefaultLogger();
- String getLogger();
- void setLogger(String newLogger);
- void setLogger(Logger newLogger);
- static final String LOGGER_PROPERTY = "logger"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_LOGGER = "eclipselink.logging.logger"; //$NON-NLS-1$
- static final String DEFAULT_LOGGER = Logger.default_logger.getPropertyValue();
- static final String[] RESERVED_LOGGER_NAMES = {Logger.default_logger.getPropertyValue(), Logger.java_logger.getPropertyValue(), Logger.server_logger.getPropertyValue()};
- String ECLIPSELINK_LOGGER_CLASS_NAME = "org.eclipse.persistence.logging.SessionLog"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging2_0.java
deleted file mode 100644
index e273a09f9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Logging2_0.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-/**
- * Logging2_0
- */
-public interface Logging2_0 extends Logging
-{
- public static final String CATEGORY_PREFIX_ = "eclipselink.logging.level."; //$NON-NLS-1$
-
- Boolean getDefaultConnection();
- Boolean getConnection();
- void setConnection(Boolean connection);
- static final String CONNECTION_PROPERTY = "connection"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CONNECTION = "eclipselink.logging.connection"; //$NON-NLS-1$
- static final Boolean DEFAULT_CONNECTION = Boolean.TRUE;
-
- LoggingLevel getCategoriesDefaultLevel();
- LoggingLevel getLevel(String category);
- void setLevel(String category, LoggingLevel level);
- void setDefaultLevel(LoggingLevel level);
- static final String CATEGORIES_DEFAULT_LOGGING_PROPERTY = "categoriesDefaultLoggingLevel"; //$NON-NLS-1$
-
- static final String SQL_CATEGORY_LOGGING_PROPERTY = "sqlLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "sql"; //$NON-NLS-1$
-
- static final String TRANSACTION_CATEGORY_LOGGING_PROPERTY = "transactionLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "transaction"; //$NON-NLS-1$
-
- static final String EVENT_CATEGORY_LOGGING_PROPERTY = "eventLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "event"; //$NON-NLS-1$
-
- static final String CONNECTION_CATEGORY_LOGGING_PROPERTY = "connectionLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "connection"; //$NON-NLS-1$
-
- static final String QUERY_CATEGORY_LOGGING_PROPERTY = "queryLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "query"; //$NON-NLS-1$
-
- static final String CACHE_CATEGORY_LOGGING_PROPERTY = "cacheLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "cache"; //$NON-NLS-1$
-
- static final String PROPAGATION_CATEGORY_LOGGING_PROPERTY = "propagationLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "propagation"; //$NON-NLS-1$
-
- static final String SEQUENCING_CATEGORY_LOGGING_PROPERTY = "sequencingLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "sequencing"; //$NON-NLS-1$
-
- static final String EJB_CATEGORY_LOGGING_PROPERTY = "ejbLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "ejb"; //$NON-NLS-1$
-
- static final String DMS_CATEGORY_LOGGING_PROPERTY = "dmsLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "dms"; //$NON-NLS-1$
-
- static final String EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY = "ejb_or_metadataLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "ejb_or_metadata"; //$NON-NLS-1$
-
- static final String METAMODEL_CATEGORY_LOGGING_PROPERTY = "jpa_metamodelLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "jpa_metamodel"; //$NON-NLS-1$
-
- static final String WEAVER_CATEGORY_LOGGING_PROPERTY = "weaverLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "weaver"; //$NON-NLS-1$
-
- static final String PROPERTIES_CATEGORY_LOGGING_PROPERTY = "propertiesLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "properties"; //$NON-NLS-1$
-
- static final String SERVER_CATEGORY_LOGGING_PROPERTY = "serverLoggingLevel"; //$NON-NLS-1$
- static final String ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL = CATEGORY_PREFIX_ + "server"; //$NON-NLS-1$
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/LoggingLevel.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/LoggingLevel.java
deleted file mode 100644
index b0028f1826..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/LoggingLevel.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * LoggingLevel
- */
-public enum LoggingLevel implements PersistenceXmlEnumValue {
- off("OFF"), //$NON-NLS-1$
- severe("SEVERE"), //$NON-NLS-1$
- warning("WARNING"), //$NON-NLS-1$
- info("INFO"), //$NON-NLS-1$
- config("CONFIG"), //$NON-NLS-1$
- fine("FINE"), //$NON-NLS-1$
- finer("FINER"), //$NON-NLS-1$
- finest("FINEST"), //$NON-NLS-1$
- all("ALL"); //$NON-NLS-1$
-
- /**
- * EclipseLink property value
- */
- private final String propertyValue;
-
- LoggingLevel(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options.java
deleted file mode 100644
index 1d0acdc2ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * Session Options
- */
-public interface Options extends PersistenceUnitProperties
-{
- String getDefaultSessionName();
- String getSessionName();
- void setSessionName(String newSessionName);
- static final String SESSION_NAME_PROPERTY = "sessionName"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_NAME = "eclipselink.session-name"; //$NON-NLS-1$
- static final String DEFAULT_SESSION_NAME = ""; // no default //$NON-NLS-1$
-
- String getDefaultSessionsXml();
- String getSessionsXml();
- void setSessionsXml(String newSessionsXml);
- static final String SESSIONS_XML_PROPERTY = "sessionsXml"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSIONS_XML = "eclipselink.sessions-xml"; //$NON-NLS-1$
- static final String DEFAULT_SESSIONS_XML = ""; // no default //$NON-NLS-1$
-
- Boolean getDefaultIncludeDescriptorQueries();
- Boolean getIncludeDescriptorQueries();
- void setIncludeDescriptorQueries(Boolean newIncludeDescriptorQueries);
- static final String SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY = "includeDescriptorQueriesy"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES = "eclipselink.session.include.descriptor.queries"; //$NON-NLS-1$
- static final Boolean DEFAULT_SESSION_INCLUDE_DESCRIPTOR_QUERIES = Boolean.TRUE;
-
- String getDefaultTargetDatabase();
- String getTargetDatabase();
- void setTargetDatabase(String newTargetDatabase);
- void setTargetDatabase(TargetDatabase newTargetDatabase);
- static final String TARGET_DATABASE_PROPERTY = "targetDatabase"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_TARGET_DATABASE = "eclipselink.target-database"; //$NON-NLS-1$
- static final String DEFAULT_TARGET_DATABASE = TargetDatabase.auto.getPropertyValue();
-
- String getDefaultTargetServer();
- String getTargetServer();
- void setTargetServer(String newTargetServer);
- void setTargetServer(TargetServer newTargetServer);
- static final String TARGET_SERVER_PROPERTY = "targetServer"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_TARGET_SERVER = "eclipselink.target-server"; //$NON-NLS-1$
- static final String DEFAULT_TARGET_SERVER = TargetServer.none.getPropertyValue();
-
- String getDefaultEventListener();
- String getEventListener();
- void setEventListener(String newEventListener);
- static final String SESSION_EVENT_LISTENER_PROPERTY = "eventListener"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_SESSION_EVENT_LISTENER = "eclipselink.session-event-listener"; //$NON-NLS-1$
- static final String DEFAULT_SESSION_EVENT_LISTENER = null; // no default
- String ECLIPSELINK_EVENT_LISTENER_CLASS_NAME = "org.eclipse.persistence.sessions.SessionEventListener"; //$NON-NLS-1$
-
- Boolean getDefaultTemporalMutable();
- Boolean getTemporalMutable();
- void setTemporalMutable(Boolean temporalMutable);
- static final String TEMPORAL_MUTABLE_PROPERTY = "temporalMutable"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_TEMPORAL_MUTABLE = "eclipselink.temporal.mutable"; //$NON-NLS-1$
- static final Boolean DEFAULT_TEMPORAL_MUTABLE = Boolean.FALSE;
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options2_0.java
deleted file mode 100644
index 62fd2abb1c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Options2_0.java
+++ /dev/null
@@ -1,20 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-
-/**
- * Options2_0
- */
-public interface Options2_0 extends Options, JpaOptions2_0
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/OutputMode.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/OutputMode.java
deleted file mode 100644
index 643d15b945..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/OutputMode.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * OutputMode
- */
-public enum OutputMode implements PersistenceXmlEnumValue {
- both("both"), //$NON-NLS-1$
- database("database"), //$NON-NLS-1$
- sql_script("sql-script"); //$NON-NLS-1$
-
- private final String propertyValue;
-
- OutputMode(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Profiler.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Profiler.java
deleted file mode 100644
index f1b943cc77..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Profiler.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * Profiler
- */
-public enum Profiler implements PersistenceXmlEnumValue {
-
- performance_profiler("PerformanceProfiler", "org.eclipse.persistence.tools.profiler.PerformanceProfiler"), //$NON-NLS-1$ //$NON-NLS-2$
- query_monitor("QueryMonitor", "org.eclipse.persistence.tools.profiler.QueryMonitor"), //$NON-NLS-1$ //$NON-NLS-2$
- no_profiler("NoProfiler", null); //$NON-NLS-1$
-
- /**
- * EclipseLink property value
- */
- private final String propertyValue;
-
- /**
- * EclipseLink profiler class name
- */
- private final String className;
-
- Profiler(String propertyValue, String className) {
- this.propertyValue = propertyValue;
- this.className = className;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-
- public String getClassName() {
- return this.className;
- }
-
- public static Profiler fromPropertyValue(String propertyValue) {
- for (Profiler profiler : Profiler.values()) {
- if (profiler.getPropertyValue().equals(propertyValue)) {
- return profiler;
- }
- }
- return null;
- }
-
- /**
- * Return the Profiler value corresponding to the given literal.
- */
- public static Profiler getProfilerFor(String literal) {
- for( Profiler profiler : Profiler.values()) {
- if(profiler.toString().equals(literal)) {
- return profiler;
- }
- }
- return null;
- }
-
- public static String getProfilerClassName(String profilerValue) {
- return fromPropertyValue(profilerValue).getClassName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/SchemaGeneration.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/SchemaGeneration.java
deleted file mode 100644
index 5c26a32986..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/SchemaGeneration.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-
-/**
- * SchemaGeneration
- */
-public interface SchemaGeneration extends PersistenceUnitProperties
-{
- DdlGenerationType getDefaultDdlGenerationType();
- DdlGenerationType getDdlGenerationType();
- void setDdlGenerationType(DdlGenerationType ddlGenerationType);
- static final String DDL_GENERATION_TYPE_PROPERTY = "ddlGenerationType"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DDL_GENERATION_TYPE = "eclipselink.ddl-generation"; //$NON-NLS-1$
- static final DdlGenerationType DEFAULT_SCHEMA_GENERATION_DDL_GENERATION_TYPE = DdlGenerationType.none;
-
- OutputMode getDefaultOutputMode();
- OutputMode getOutputMode();
- void setOutputMode(OutputMode outputMode); // put
- static final String OUTPUT_MODE_PROPERTY = "outputMode"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE = "eclipselink.ddl-generation.output-mode"; //$NON-NLS-1$
- static final OutputMode DEFAULT_SCHEMA_GENERATION_OUTPUT_MODE = null; // No Default
-
- String getDefaultCreateFileName();
- String getCreateFileName();
- void setCreateFileName(String createFileName);
- static final String CREATE_FILE_NAME_PROPERTY = "createFileName"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_CREATE_FILE_NAME = "eclipselink.create-ddl-jdbc-file-name"; //$NON-NLS-1$
- static final String DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME = "createDDL.sql"; //$NON-NLS-1$
-
- String getDefaultDropFileName();
- String getDropFileName();
- void setDropFileName(String dropFileName);
- static final String DROP_FILE_NAME_PROPERTY = "dropFileName"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_DROP_FILE_NAME = "eclipselink.drop-ddl-jdbc-file-name"; //$NON-NLS-1$
- static final String DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME = "dropDDL.sql"; //$NON-NLS-1$
-
- String getDefaultApplicationLocation();
- String getApplicationLocation();
- void setApplicationLocation(String applicationLocation);
- static final String APPLICATION_LOCATION_PROPERTY = "applicationLocation"; //$NON-NLS-1$
- // EclipseLink key string
- static final String ECLIPSELINK_APPLICATION_LOCATION = "eclipselink.application-location"; //$NON-NLS-1$
- static final String DEFAULT_SCHEMA_GENERATION_APPLICATION_LOCATION = null; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetDatabase.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetDatabase.java
deleted file mode 100644
index 8954795652..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetDatabase.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * TargetDatabase
- */
-public enum TargetDatabase implements PersistenceXmlEnumValue {
- attunity("Attunity"), //$NON-NLS-1$
- auto("Auto"), //$NON-NLS-1$
- cloudscape("Cloudscape"), //$NON-NLS-1$
- database("Database"), //$NON-NLS-1$
- db2("DB2"), //$NON-NLS-1$
- db2mainframe("DB2Mainframe"), //$NON-NLS-1$
- dbase("DBase"), //$NON-NLS-1$
- derby("Derby"), //$NON-NLS-1$
- hsql("HSQL"), //$NON-NLS-1$
- informix("Informix"), //$NON-NLS-1$
- javadb("JavaDB"), //$NON-NLS-1$
- maxdb("MaxDB"), //$NON-NLS-1$
- mysql("MySQL"), //$NON-NLS-1$
- oracle("Oracle"), //$NON-NLS-1$
- oracle11("Oracle11"), //$NON-NLS-1$
- oracle10("Oracle10g"), //$NON-NLS-1$
- oracle9("Oracle9i"), //$NON-NLS-1$
- oracle8("Oracle8i"), //$NON-NLS-1$
- pointbase("PointBase"), //$NON-NLS-1$
- postgresql("PostgreSQL"), //$NON-NLS-1$
- sqlanywhere("SQLAnywhere"), //$NON-NLS-1$
- sqlserver("SQLServer"), //$NON-NLS-1$
- sybase("Sybase"), //$NON-NLS-1$
- symfoware("Symfoware"), //$NON-NLS-1$
- timesten("TimesTen"); //$NON-NLS-1$
-
- private final String propertyValue;
-
- TargetDatabase(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-
- /**
- * Return the TargetDatabase value corresponding to the given literal.
- */
- public static TargetDatabase getTargetDatabaseFor(String literal) {
- for (TargetDatabase targetDatabase : TargetDatabase.values()) {
- if (targetDatabase.toString().equals(literal)) {
- return targetDatabase;
- }
- }
- return null;
- }
-
- public static boolean isOracleDatabase(String literal) {
- return literal.contains("Oracle"); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetServer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetServer.java
deleted file mode 100644
index 57bd246528..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/TargetServer.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * TargetServer
- */
-public enum TargetServer implements PersistenceXmlEnumValue {
- none("None"), //$NON-NLS-1$
- oc4j("OC4J"), //$NON-NLS-1$
- sunas9("SunAS9"), //$NON-NLS-1$
- websphere("WebSphere"), //$NON-NLS-1$
- websphere_6_1("WebSphere_6_1"), //$NON-NLS-1$
- websphere_7("WebSphere_7"), //$NON-NLS-1$
- weblogic("WebLogic"), //$NON-NLS-1$
- weblogic_9("WebLogic_9"), //$NON-NLS-1$
- weblogic_10("WebLogic_10"), //$NON-NLS-1$
- jboss("JBoss"), //$NON-NLS-1$
- netweaver_7_1("NetWeaver_7_1"); //$NON-NLS-1$
-
- private final String propertyValue;
-
- TargetServer(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-
- /**
- * Return the TargetServer value corresponding to the given literal.
- */
- public static TargetServer getTargetServerFor(String literal) {
- for (TargetServer targetServer : TargetServer.values()) {
- if (targetServer.toString().equals(literal)) {
- return targetServer;
- }
- }
- return null;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Weaving.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Weaving.java
deleted file mode 100644
index 76f9a32b9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/context/persistence/Weaving.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-
-/**
- * Weaving
- */
-public enum Weaving implements PersistenceXmlEnumValue {
- true_("true"), //$NON-NLS-1$
- false_("false"), //$NON-NLS-1$
- static_("static"); //$NON-NLS-1$
-
-
- /**
- * EclipseLink property value
- */
- private final String propertyValue;
-
- Weaving(String propertyValue) {
- this.propertyValue = propertyValue;
- }
-
- /**
- * The string used as the property value in the persistence.xml
- */
- public String getPropertyValue() {
- return this.propertyValue;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/AbstractEclipseLink2_0JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/AbstractEclipseLink2_0JpaPlatformProvider.java
deleted file mode 100644
index 56f1cc4eee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/AbstractEclipseLink2_0JpaPlatformProvider.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmXml2_0Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaElementCollectionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedIdMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_2Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_0Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLink2_0PersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-
-/**
- * EclipseLink 2.0 platform config
- */
-public abstract class AbstractEclipseLink2_0JpaPlatformProvider
- extends AbstractJpaPlatformProvider
-{
- protected AbstractEclipseLink2_0JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_2_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()
- };
-
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition2_0.instance(),
- EclipseLinkJavaEmbeddableDefinition2_0.instance(),
- EclipseLinkJavaMappedSuperclassDefinition2_0.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.2 to 2.0
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- EclipseLinkJavaEmbeddedMappingDefinition2_0.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_0.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMappingDefinition2_0.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMapMappingDefinition2_0.instance(),
- EclipseLinkJavaElementCollectionMappingDefinition2_0.instance(),
- EclipseLinkJavaIdMappingDefinition2_0.instance(),
- EclipseLinkJavaVersionMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMappingDefinition2_0.instance(),
- EclipseLinkJavaEmbeddedMappingDefinition2_0.instance(),
- EclipseLinkJavaEmbeddedIdMappingDefinition2_0.instance(),
- EclipseLinkJavaTransformationMappingDefinition2_0.instance(),
- EclipseLinkJavaManyToManyMappingDefinition2_0.instance(),
- EclipseLinkJavaManyToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_0.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance()
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- EclipseLink2_0PersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- GenericOrmXml2_0Definition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance(),
- EclipseLinkOrmXml1_2Definition.instance(),
- EclipseLinkOrmXml2_0Definition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java
deleted file mode 100644
index 532f70ab4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/DefaultEclipseLinkJpaValidationMessages.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.Locale;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
-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 defaultSeverity, String messageId, JpaNode targetObject) {
- return buildMessage(defaultSeverity, messageId, targetObject.getResource());
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, IResource targetObject) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, JpaNode targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject.getResource());
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject, DEFAULT_TEXT_RANGE);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, JpaNode targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, targetObject.getResource(), textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, IResource targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, DEFAULT_PARMS, targetObject, textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, JpaNode targetObject, TextRange textRange) {
- return buildMessage(defaultSeverity, messageId, parms, targetObject.getResource(), textRange);
- }
-
- public static IMessage buildMessage(int defaultSeverity, String messageId, String[] parms, IResource targetObject, TextRange textRange) {
- return DefaultJpaValidationMessages.buildMessage(defaultSeverity, messageId, parms, targetObject, textRange, MESSAGE_FACTORY);
- }
-
-
- private DefaultEclipseLinkJpaValidationMessages() {
- super();
- throw new UnsupportedOperationException();
- }
-
-
- private static final DefaultJpaValidationMessages.MessageFactory MESSAGE_FACTORY = new EclipseLinkMessageFactory();
-
- /* CU private */ static class EclipseLinkMessageFactory
- implements DefaultJpaValidationMessages.MessageFactory
- {
- public IMessage buildMessage(int severity, String messageId, String[] parms, IResource targetObject) {
- // TODO check for preference override
-// int prefSeverity = JpaValidationPreferences.getProblemSeverityPreference(targetObject, messageId);
-// if (prefSeverity != JpaValidationPreferences.NO_SEVERITY_PREFERENCE){
-// severity = prefSeverity;
-// }
- IMessage message = new EclipseLinkMessage(EclipseLinkJpaValidationMessages.BUNDLE_NAME, severity, messageId, parms, targetObject);
- // TODO "EclipseLink JPA" validation marker?
- message.setMarkerId(JptJpaCorePlugin.VALIDATION_MARKER_ID);
- return message;
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- /**
- * We have to build this message so {@link Message} uses the right class
- * loader to retrieve the message bundles.
- * <p>
- * Another way we could potentially solve this is to have a separate
- * EclispeLink JPA validator and set up the extension points so that
- * it only runs against JPA projects with the EclispeLink platform....
- */
- /* CU private */ static class EclipseLinkMessage
- extends Message
- {
- EclipseLinkMessage(String bundleName, int severity, String id, String[] params, Object target) {
- super(bundleName, severity, id, params, target);
- }
-
- @Override
- public ResourceBundle getBundle(Locale locale, ClassLoader classLoader) {
- try {
- return super.getBundle(locale, this.getClass().getClassLoader());
- } catch (MissingResourceException ex) {
- return super.getBundle(locale, classLoader);
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformFactory.java
deleted file mode 100644
index d134425f5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformFactory.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar1;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class EclipseLink1_1JpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink1_1JpaPlatformFactory() {
- super();
- }
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLinkJpaFactory(),
- buildAnnotationProvider(),
- EclipseLink1_1JpaPlatformProvider.instance(),
- buildJpaPlatformVariation(),
- EclipseLinkJPQLGrammar1.instance());
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.instance());
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return false;
- }
- public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
- return GENERIC_SUPPORTED_ACCESS_TYPES;
- }
- };
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_1_1,
- JpaFacet.VERSION_1_0.getVersionString());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformProvider.java
deleted file mode 100644
index fb4d28faed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_1JpaPlatformProvider.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLink1_1JpaPlatformProvider
- extends AbstractJpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink1_1JpaPlatformProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink1_1JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()
- };
-
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition.instance(),
- EclipseLinkJavaEmbeddableDefinition.instance(),
- EclipseLinkJavaMappedSuperclassDefinition.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.0 to 1.1
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.0 to 1.1
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition.instance(),
- EclipseLinkJavaBasicMapMappingDefinition.instance(),
- EclipseLinkJavaIdMappingDefinition.instance(),
- EclipseLinkJavaVersionMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- EclipseLinkJavaTransformationMappingDefinition.instance(),
- EclipseLinkJavaManyToManyMappingDefinition.instance(),
- EclipseLinkJavaManyToOneMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance()
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index f0776d8918..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.resource.java.Access2_0AnnotationDefinition;
-
-/**
- * Provides annotations for 1.2 EclipseLink platform
- */
-public class EclipseLink1_2JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink1_2JpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink1_2JpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- definitions.add(Access2_0AnnotationDefinition.instance());
- }
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- // nothing new for EclipseLink 1.2
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformFactory.java
deleted file mode 100644
index cf82ed8b66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformFactory.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar1;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class EclipseLink1_2JpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink1_2JpaPlatformFactory() {
- super();
- }
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLinkJpaFactory(),
- buildAnnotationProvider(),
- EclipseLink1_2JpaPlatformProvider.instance(),
- buildJpaPlatformVariation(),
- EclipseLinkJPQLGrammar1.instance());
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.instance(),
- EclipseLink1_2JpaAnnotationDefinitionProvider.instance());
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return false;
- }
- public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
- return GENERIC_SUPPORTED_ACCESS_TYPES;
- }
- };
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_1_2,
- JpaFacet.VERSION_1_0.getVersionString());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformProvider.java
deleted file mode 100644
index 1b31d88dbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink1_2JpaPlatformProvider.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml1_2Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLink1_2JpaPlatformProvider
- extends AbstractJpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink1_2JpaPlatformProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink1_2JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()
- };
-
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition.instance(),
- EclipseLinkJavaEmbeddableDefinition.instance(),
- EclipseLinkJavaMappedSuperclassDefinition.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.1 to 1.2
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.1 to 1.2
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition.instance(),
- EclipseLinkJavaBasicMapMappingDefinition.instance(),
- EclipseLinkJavaIdMappingDefinition.instance(),
- EclipseLinkJavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- EclipseLinkJavaTransformationMappingDefinition.instance(),
- EclipseLinkJavaManyToManyMappingDefinition.instance(),
- EclipseLinkJavaManyToOneMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance()
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- EclipseLinkOrmXml1_1Definition.instance(),
- EclipseLinkOrmXml1_2Definition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index 229346a442..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMapKeyConvert2_0AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 2.0 EclipseLink platform
- */
-public class EclipseLink2_0JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink2_0JpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_0JpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
- }
-
- protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
- EclipseLinkBasicCollectionAnnotationDefinition.instance(),
- EclipseLinkBasicMapAnnotationDefinition.instance(),
- EclipseLinkCacheAnnotationDefinition.instance(),
- EclipseLinkChangeTrackingAnnotationDefinition.instance(),
- EclipseLinkConvertAnnotationDefinition.instance(),
- EclipseLinkCustomizerAnnotationDefinition.instance(),
- EclipseLinkExistenceCheckingAnnotationDefinition.instance(),
- EclipseLinkJoinFetchAnnotationDefinition.instance(),
- EclipseLinkMapKeyConvert2_0AnnotationDefinition.instance(),
- EclipseLinkMutableAnnotationDefinition.instance(),
- EclipseLinkPrimaryKeyAnnotationDefinition.instance(),
- EclipseLinkPrivateOwnedAnnotationDefinition.instance(),
- EclipseLinkReadOnlyAnnotationDefinition.instance(),
- EclipseLinkReadTransformerAnnotationDefinition.instance(),
- EclipseLinkTransformationAnnotationDefinition.instance(),
- EclipseLinkVariableOneToOneAnnotationDefinition.instance(),
- EclipseLinkWriteTransformerAnnotationDefinition.instance()
- };
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, NESTABLE_ANNOTATION_DEFINITIONS);
- }
-
- protected static final NestableAnnotationDefinition[] NESTABLE_ANNOTATION_DEFINITIONS = new NestableAnnotationDefinition[] {
- EclipseLinkConverterAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverterAnnotationDefinition.instance(),
- EclipseLinkStructConverterAnnotationDefinition.instance(),
- EclipseLinkTypeConverterAnnotationDefinition.instance(),
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaFactory.java
deleted file mode 100644
index 1826ba1595..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaFactory.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jpa.core.JpaDataSource;
-import org.eclipse.jpt.jpa.core.JpaProject.Config;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaGeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaOrderable;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaQueryContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaSequenceGenerator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaColumn;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaOrderable;
-import org.eclipse.jpt.jpa.core.internal.jpa2.GenericJpaDatabaseIdentifierAdapter;
-import org.eclipse.jpt.jpa.core.internal.jpa2.GenericMetamodelSynchronizer;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaNamedQuery2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaOrderColumn2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaOrphanRemoval2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaPersistentType2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.GenericJavaSequenceGenerator2_0;
-import org.eclipse.jpt.jpa.core.jpa2.JpaFactory2_0;
-import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0.Owner;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaSingleRelationshipMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.NamedQuery2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkElementCollectionMapping2_0;
-
-/**
- * EclipseLink 2.0 factory
- */
-public class EclipseLink2_0JpaFactory
- extends EclipseLinkJpaFactory
- implements JpaFactory2_0
-{
- public EclipseLink2_0JpaFactory() {
- super();
- }
-
-
- // ********** Core Model **********
-
- @Override
- public EclipseLinkJpaProject buildJpaProject(Config config) {
- if ( ! (config instanceof JpaProject2_0.Config)) {
- throw new IllegalArgumentException("config must be 2.0-compatible: " + config); //$NON-NLS-1$
- }
- return super.buildJpaProject(config);
- }
-
- public MetamodelSourceType.Synchronizer buildMetamodelSynchronizer(MetamodelSourceType sourceType) {
- return new GenericMetamodelSynchronizer(sourceType);
- }
-
- public DatabaseIdentifierAdapter buildDatabaseIdentifierAdapter(JpaDataSource dataSource) {
- return new GenericJpaDatabaseIdentifierAdapter(dataSource);
- }
-
-
- // ********** Java Context Model **********
-
- @Override
- public JavaPersistentType buildJavaPersistentType(PersistentType.Owner owner, JavaResourceType jrt) {
- return new GenericJavaPersistentType2_0(owner, jrt);
- }
-
- @Override
- public JavaSequenceGenerator buildJavaSequenceGenerator(JavaGeneratorContainer parent, SequenceGeneratorAnnotation annotation) {
- return new GenericJavaSequenceGenerator2_0(parent, (SequenceGenerator2_0Annotation) annotation);
- }
-
- //The 2.0 JPA spec supports association overrides on an embedded mapping while the 1.0 spec did not
- public JavaAssociationOverrideContainer buildJavaAssociationOverrideContainer(JavaEmbeddedMapping2_0 parent, JavaAssociationOverrideContainer.Owner owner) {
- return new GenericJavaAssociationOverrideContainer(parent, owner);
- }
-
- public JavaDerivedIdentity2_0 buildJavaDerivedIdentity(JavaSingleRelationshipMapping2_0 parent) {
- return new GenericJavaDerivedIdentity2_0(parent);
- }
-
- public JavaElementCollectionMapping2_0 buildJavaElementCollectionMapping2_0(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkElementCollectionMapping2_0(parent);
- }
-
- public JavaCacheable2_0 buildJavaCacheable(JavaCacheableHolder2_0 parent) {
- return new GenericJavaCacheable2_0(parent);
- }
-
- public JavaOrphanRemovable2_0 buildJavaOrphanRemoval(JavaOrphanRemovalHolder2_0 parent) {
- return new GenericJavaOrphanRemoval2_0(parent);
- }
-
- @Override
- public JavaNamedQuery buildJavaNamedQuery(JavaQueryContainer parent, NamedQueryAnnotation annotation) {
- return new GenericJavaNamedQuery2_0(parent, (NamedQuery2_0Annotation) annotation);
- }
-
- public JavaCollectionTable2_0 buildJavaCollectionTable(JavaElementCollectionMapping2_0 parent, Table.Owner owner) {
- return new GenericJavaCollectionTable2_0(parent, owner);
- }
-
- public JavaOrderColumn2_0 buildJavaOrderColumn(JavaOrderable2_0 parent, JavaReadOnlyNamedColumn.Owner owner) {
- return new GenericJavaOrderColumn2_0(parent, owner);
- }
-
- public JavaColumn buildJavaMapKeyColumn(JavaJpaContextNode parent, JavaColumn.Owner owner) {
- return new GenericJavaColumn(parent, owner);
- }
-
- public JavaOrderable2_0 buildJavaOrderable(JavaAttributeMapping parent, Owner owner) {
- return new GenericJavaOrderable(parent, owner);
- }
-
- @Override
- public JavaOrderable buildJavaOrderable(JavaAttributeMapping parent) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformFactory.java
deleted file mode 100644
index a758509542..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformFactory.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar2_0;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class EclipseLink2_0JpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink2_0JpaPlatformFactory() {
- super();
- }
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- this.buildAnnotationProvider(),
- EclipseLink2_0JpaPlatformProvider.instance(),
- this.buildJpaVariation(),
- EclipseLinkJPQLGrammar2_0.instance());
- }
-
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_0,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_0JpaAnnotationDefinitionProvider.instance());
- }
-
- protected JpaPlatformVariation buildJpaVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return true;
- }
- public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
- return GENERIC_SUPPORTED_ACCESS_TYPES;
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformProvider.java
deleted file mode 100644
index 0cfa335424..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_0JpaPlatformProvider.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-
-/**
- * EclipseLink 2.0 platform config
- */
-public class EclipseLink2_0JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider
-{
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_0JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected EclipseLink2_0JpaPlatformProvider() {
- super();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index e4a0e922b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkClassExtractor2_1AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 2.1 EclipseLink platform
- */
-public class EclipseLink2_1JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink2_1JpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_1JpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
- }
-
- protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
- EclipseLinkBasicCollectionAnnotationDefinition.instance(),
- EclipseLinkBasicMapAnnotationDefinition.instance(),
- EclipseLinkCacheAnnotationDefinition.instance(),
- EclipseLinkChangeTrackingAnnotationDefinition.instance(),
- EclipseLinkClassExtractor2_1AnnotationDefinition.instance(),
- EclipseLinkConvertAnnotationDefinition.instance(),
- EclipseLinkCustomizerAnnotationDefinition.instance(),
- EclipseLinkExistenceCheckingAnnotationDefinition.instance(),
- EclipseLinkJoinFetchAnnotationDefinition.instance(),
- EclipseLinkMutableAnnotationDefinition.instance(),
- EclipseLinkPrimaryKeyAnnotationDefinition.instance(),
- EclipseLinkPrivateOwnedAnnotationDefinition.instance(),
- EclipseLinkReadOnlyAnnotationDefinition.instance(),
- EclipseLinkReadTransformerAnnotationDefinition.instance(),
- EclipseLinkTransformationAnnotationDefinition.instance(),
- EclipseLinkVariableOneToOneAnnotationDefinition.instance(),
- EclipseLinkWriteTransformerAnnotationDefinition.instance()
- };
-
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, NESTABLE_ANNOTATION_DEFINITIONS);
- }
-
- protected static final NestableAnnotationDefinition[] NESTABLE_ANNOTATION_DEFINITIONS = new NestableAnnotationDefinition[] {
- EclipseLinkConverterAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverterAnnotationDefinition.instance(),
- EclipseLinkStructConverterAnnotationDefinition.instance(),
- EclipseLinkTypeConverterAnnotationDefinition.instance(),
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformFactory.java
deleted file mode 100644
index 648d92fca3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformFactory.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar2_1;
-
-public class EclipseLink2_1JpaPlatformFactory
- extends EclipseLink2_0JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink2_1JpaPlatformFactory() {
- super();
- }
-
- @Override
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- this.buildAnnotationProvider(),
- EclipseLink2_1JpaPlatformProvider.instance(),
- this.buildJpaVariation(),
- EclipseLinkJPQLGrammar2_1.instance());
- }
-
- @Override
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_1,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_1JpaAnnotationDefinitionProvider.instance());
- }
-
- @Override
- protected JpaPlatformVariation buildJpaVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return true;
- }
- public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
- if (resourceType.getContentType() == JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE) {
- if (this.versionIsEclipseLink2_1Compatibile(resourceType)) {
- return ECLIPSELINK_SUPPORTED_ACCESS_TYPES;
- }
- }
- return GENERIC_SUPPORTED_ACCESS_TYPES;
- }
- protected boolean versionIsEclipseLink2_1Compatibile(JptResourceType resourceType) {
- return JptJpaCorePlugin.resourceTypeIsCompatible(resourceType, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE.getVersion());
- }
- };
- }
-
- public static final AccessType[] ECLIPSELINK_SUPPORTED_ACCESS_TYPES = new AccessType[] {AccessType.FIELD, AccessType.PROPERTY, EclipseLinkAccessType.VIRTUAL};
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformProvider.java
deleted file mode 100644
index 9a5ed3063c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_1JpaPlatformProvider.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
-
-/**
- * EclipseLink 2.1 platform config
- */
-public class EclipseLink2_1JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider
-{
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_1JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_1JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- @Override
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE;
- }
- return super.getMostRecentSupportedResourceType(contentType);
- }
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- super.addResourceDefinitionsTo(definitions);
- definitions.add(EclipseLinkOrmXml2_1Definition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index ba286dea99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkClassExtractor2_1AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverters2_2AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverters2_2AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverters2_2AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverters2_2AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 2.3 EclipseLink platform
- */
-public class EclipseLink2_2JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink2_2JpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_2JpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
- }
-
- protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
- EclipseLinkBasicCollectionAnnotationDefinition.instance(),
- EclipseLinkBasicMapAnnotationDefinition.instance(),
- EclipseLinkCacheAnnotationDefinition.instance(),
- EclipseLinkChangeTrackingAnnotationDefinition.instance(),
- EclipseLinkClassExtractor2_1AnnotationDefinition.instance(),
- EclipseLinkConvertAnnotationDefinition.instance(),
- EclipseLinkConverters2_2AnnotationDefinition.instance(),
- EclipseLinkCustomizerAnnotationDefinition.instance(),
- EclipseLinkExistenceCheckingAnnotationDefinition.instance(),
- EclipseLinkJoinFetchAnnotationDefinition.instance(),
- EclipseLinkMutableAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverters2_2AnnotationDefinition.instance(),
- EclipseLinkPrimaryKeyAnnotationDefinition.instance(),
- EclipseLinkPrivateOwnedAnnotationDefinition.instance(),
- EclipseLinkReadOnlyAnnotationDefinition.instance(),
- EclipseLinkReadTransformerAnnotationDefinition.instance(),
- EclipseLinkStructConverters2_2AnnotationDefinition.instance(),
- EclipseLinkTransformationAnnotationDefinition.instance(),
- EclipseLinkTypeConverters2_2AnnotationDefinition.instance(),
- EclipseLinkVariableOneToOneAnnotationDefinition.instance(),
- EclipseLinkWriteTransformerAnnotationDefinition.instance()
- };
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, NESTABLE_ANNOTATION_DEFINITIONS);
- }
-
- protected static final NestableAnnotationDefinition[] NESTABLE_ANNOTATION_DEFINITIONS = new NestableAnnotationDefinition[] {
- EclipseLinkConverterAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverterAnnotationDefinition.instance(),
- EclipseLinkStructConverterAnnotationDefinition.instance(),
- EclipseLinkTypeConverterAnnotationDefinition.instance(),
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformFactory.java
deleted file mode 100644
index 317a2d7082..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformFactory.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar2_2;
-
-public class EclipseLink2_2JpaPlatformFactory
- extends EclipseLink2_0JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public EclipseLink2_2JpaPlatformFactory() {
- super();
- }
-
- @Override
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- this.buildAnnotationProvider(),
- EclipseLink2_2JpaPlatformProvider.instance(),
- this.buildJpaVariation(),
- EclipseLinkJPQLGrammar2_2.instance());
- }
-
- @Override
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_2,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_2JpaAnnotationDefinitionProvider.instance());
- }
-
- @Override
- protected JpaPlatformVariation buildJpaVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return true;
- }
- public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
- if (resourceType.getContentType() == JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE) {
- if (this.versionIsEclipseLink2_1Compatibile(resourceType)) {
- return EclipseLink2_1JpaPlatformFactory.ECLIPSELINK_SUPPORTED_ACCESS_TYPES;
- }
- }
- return GENERIC_SUPPORTED_ACCESS_TYPES;
- }
- protected boolean versionIsEclipseLink2_1Compatibile(JptResourceType resourceType) {
- return JptJpaCorePlugin.resourceTypeIsCompatible(resourceType, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE.getVersion());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformProvider.java
deleted file mode 100644
index bd1cafa900..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_2JpaPlatformProvider.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaElementCollectionMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedIdMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_2Definition;
-
-public class EclipseLink2_2JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider
-{
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_2JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_2JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- @Override
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_2_RESOURCE_TYPE;
- }
- return super.getMostRecentSupportedResourceType(contentType);
- }
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- super.addResourceDefinitionsTo(definitions);
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkOrmXml2_1Definition.instance(),
- EclipseLinkOrmXml2_2Definition.instance(),
- };
-
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition2_2.instance(),
- EclipseLinkJavaEmbeddableDefinition2_2.instance(),
- EclipseLinkJavaMappedSuperclassDefinition2_2.instance()
- };
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.2 to 2.0
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- EclipseLinkJavaEmbeddedMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_2.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMappingDefinition2_2.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMapMappingDefinition2_0.instance(),
- EclipseLinkJavaElementCollectionMappingDefinition2_2.instance(),
- EclipseLinkJavaIdMappingDefinition2_2.instance(),
- EclipseLinkJavaVersionMappingDefinition2_2.instance(),
- EclipseLinkJavaBasicMappingDefinition2_2.instance(),
- EclipseLinkJavaEmbeddedMappingDefinition2_2.instance(),
- EclipseLinkJavaEmbeddedIdMappingDefinition2_2.instance(),
- EclipseLinkJavaTransformationMappingDefinition2_0.instance(),
- EclipseLinkJavaManyToManyMappingDefinition2_2.instance(),
- EclipseLinkJavaManyToOneMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_2.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance()
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaAnnotationDefinitionProvider.java
deleted file mode 100644
index d98f4f534c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkArray2_3AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkClassExtractor2_1AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverters2_2AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMultitenant2_3AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverters2_2AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverters2_2AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructure2_3AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverters2_2AnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 2.3 EclipseLink platform
- */
-public class EclipseLink2_3JpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLink2_3JpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_3JpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
- }
-
- protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
- EclipseLinkArray2_3AnnotationDefinition.instance(),
- EclipseLinkBasicCollectionAnnotationDefinition.instance(),
- EclipseLinkBasicMapAnnotationDefinition.instance(),
- EclipseLinkCacheAnnotationDefinition.instance(),
- EclipseLinkChangeTrackingAnnotationDefinition.instance(),
- EclipseLinkClassExtractor2_1AnnotationDefinition.instance(),
- EclipseLinkConvertAnnotationDefinition.instance(),
- EclipseLinkConverters2_2AnnotationDefinition.instance(),
- EclipseLinkCustomizerAnnotationDefinition.instance(),
- EclipseLinkExistenceCheckingAnnotationDefinition.instance(),
- EclipseLinkJoinFetchAnnotationDefinition.instance(),
- EclipseLinkMultitenant2_3AnnotationDefinition.instance(),
- EclipseLinkMutableAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverters2_2AnnotationDefinition.instance(),
- EclipseLinkPrimaryKeyAnnotationDefinition.instance(),
- EclipseLinkPrivateOwnedAnnotationDefinition.instance(),
- EclipseLinkReadOnlyAnnotationDefinition.instance(),
- EclipseLinkReadTransformerAnnotationDefinition.instance(),
- EclipseLinkStructConverters2_2AnnotationDefinition.instance(),
- EclipseLinkStructure2_3AnnotationDefinition.instance(),
- EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.instance(),
- EclipseLinkTransformationAnnotationDefinition.instance(),
- EclipseLinkTypeConverters2_2AnnotationDefinition.instance(),
- EclipseLinkVariableOneToOneAnnotationDefinition.instance(),
- EclipseLinkWriteTransformerAnnotationDefinition.instance()
- };
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, NESTABLE_ANNOTATION_DEFINITIONS);
- }
-
- protected static final NestableAnnotationDefinition[] NESTABLE_ANNOTATION_DEFINITIONS = new NestableAnnotationDefinition[] {
- EclipseLinkConverterAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverterAnnotationDefinition.instance(),
- EclipseLinkStructConverterAnnotationDefinition.instance(),
- EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.instance(),
- EclipseLinkTypeConverterAnnotationDefinition.instance(),
- };
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformFactory.java
deleted file mode 100644
index 9157ad05c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformFactory.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar2_3;
-
-public class EclipseLink2_3JpaPlatformFactory
- extends EclipseLink2_0JpaPlatformFactory {
-
- /**
- * zero-argument constructor
- */
- public EclipseLink2_3JpaPlatformFactory() {
- super();
- }
-
- @Override
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- buildAnnotationProvider(),
- EclipseLink2_3JpaPlatformProvider.instance(),
- buildJpaVariation(),
- EclipseLinkJPQLGrammar2_3.instance());
- }
-
- @Override
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_3,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_3JpaAnnotationDefinitionProvider.instance());
- }
-
- @Override
- protected JpaPlatformVariation buildJpaVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return true;
- }
- public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
- if (resourceType.getContentType() == JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE) {
- if (this.versionIsEclipseLink2_1Compatibile(resourceType)) {
- return EclipseLink2_1JpaPlatformFactory.ECLIPSELINK_SUPPORTED_ACCESS_TYPES;
- }
- }
- return GENERIC_SUPPORTED_ACCESS_TYPES;
- }
- protected boolean versionIsEclipseLink2_1Compatibile(JptResourceType resourceType) {
- return JptJpaCorePlugin.resourceTypeIsCompatible(resourceType, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE.getVersion());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformProvider.java
deleted file mode 100644
index 474055a6b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_3JpaPlatformProvider.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaArrayMappingDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaElementCollectionMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedIdMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaStructureMappingDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_2Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_3Definition;
-
-
-public class EclipseLink2_3JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_3JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_3JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- @Override
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_3_RESOURCE_TYPE;
- }
- return super.getMostRecentSupportedResourceType(contentType);
- }
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- super.addResourceDefinitionsTo(definitions);
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkOrmXml2_1Definition.instance(),
- EclipseLinkOrmXml2_2Definition.instance(),
- EclipseLinkOrmXml2_3Definition.instance()
- };
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition2_3.instance(),
- EclipseLinkJavaEmbeddableDefinition2_2.instance(),
- EclipseLinkJavaMappedSuperclassDefinition2_3.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.2 to 2.0
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- EclipseLinkJavaEmbeddedMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_2.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMappingDefinition2_2.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMapMappingDefinition2_0.instance(),
- EclipseLinkJavaArrayMappingDefinition2_3.instance(),
- EclipseLinkJavaElementCollectionMappingDefinition2_2.instance(),
- EclipseLinkJavaIdMappingDefinition2_2.instance(),
- EclipseLinkJavaVersionMappingDefinition2_2.instance(),
- EclipseLinkJavaBasicMappingDefinition2_2.instance(),
- EclipseLinkJavaStructureMappingDefinition2_3.instance(),
- EclipseLinkJavaEmbeddedMappingDefinition2_2.instance(),
- EclipseLinkJavaEmbeddedIdMappingDefinition2_2.instance(),
- EclipseLinkJavaTransformationMappingDefinition2_0.instance(),
- EclipseLinkJavaManyToManyMappingDefinition2_2.instance(),
- EclipseLinkJavaManyToOneMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_2.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformFactory.java
deleted file mode 100644
index c263a00881..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformFactory.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformFactory.EclipseLinkVersion;
-import org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar2_4;
-
-public class EclipseLink2_4JpaPlatformFactory
- extends EclipseLink2_0JpaPlatformFactory {
-
- /**
- * zero-argument constructor
- */
- public EclipseLink2_4JpaPlatformFactory() {
- super();
- }
-
- @Override
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLink2_0JpaFactory(),
- buildAnnotationProvider(),
- EclipseLink2_4JpaPlatformProvider.instance(),
- buildJpaVariation(),
- EclipseLinkJPQLGrammar2_4.instance());
- }
-
- @Override
- protected JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_4,
- JpaFacet.VERSION_2_0.getVersionString());
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_3JpaAnnotationDefinitionProvider.instance());
- }
-
- @Override
- protected JpaPlatformVariation buildJpaVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.YES;
- }
- public boolean isJoinTableOverridable() {
- return true;
- }
- public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
- if (resourceType.getContentType() == JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE) {
- if (this.versionIsEclipseLink2_1Compatibile(resourceType)) {
- return EclipseLink2_1JpaPlatformFactory.ECLIPSELINK_SUPPORTED_ACCESS_TYPES;
- }
- }
- return GENERIC_SUPPORTED_ACCESS_TYPES;
- }
- protected boolean versionIsEclipseLink2_1Compatibile(JptResourceType resourceType) {
- return JptJpaCorePlugin.resourceTypeIsCompatible(resourceType, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE.getVersion());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformProvider.java
deleted file mode 100644
index d84df233d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLink2_4JpaPlatformProvider.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaArrayMappingDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaElementCollectionMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedIdMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddedMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaStructureMappingDefinition2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_1Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_2Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_3Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXml2_4Definition;
-
-
-public class EclipseLink2_4JpaPlatformProvider
- extends AbstractEclipseLink2_0JpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLink2_4JpaPlatformProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_4JpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- @Override
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_4_RESOURCE_TYPE;
- }
- return super.getMostRecentSupportedResourceType(contentType);
- }
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- super.addResourceDefinitionsTo(definitions);
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkOrmXml2_1Definition.instance(),
- EclipseLinkOrmXml2_2Definition.instance(),
- EclipseLinkOrmXml2_3Definition.instance(),
- EclipseLinkOrmXml2_4Definition.instance()
- };
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition2_3.instance(),
- EclipseLinkJavaEmbeddableDefinition2_2.instance(),
- EclipseLinkJavaMappedSuperclassDefinition2_3.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no change from EclipseLink 1.2 to 2.0
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- EclipseLinkJavaEmbeddedMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_2.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMappingDefinition2_2.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition2_0.instance(),
- EclipseLinkJavaBasicMapMappingDefinition2_0.instance(),
- EclipseLinkJavaArrayMappingDefinition2_3.instance(),
- EclipseLinkJavaElementCollectionMappingDefinition2_2.instance(),
- EclipseLinkJavaIdMappingDefinition2_2.instance(),
- EclipseLinkJavaVersionMappingDefinition2_2.instance(),
- EclipseLinkJavaBasicMappingDefinition2_2.instance(),
- EclipseLinkJavaStructureMappingDefinition2_3.instance(),
- EclipseLinkJavaEmbeddedMappingDefinition2_2.instance(),
- EclipseLinkJavaEmbeddedIdMappingDefinition2_2.instance(),
- EclipseLinkJavaTransformationMappingDefinition2_0.instance(),
- EclipseLinkJavaManyToManyMappingDefinition2_2.instance(),
- EclipseLinkJavaManyToOneMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToManyMappingDefinition2_2.instance(),
- EclipseLinkJavaOneToOneMappingDefinition2_2.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition2_0.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java
deleted file mode 100644
index bcca4f019e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaAnnotationDefinitionProvider.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicCollectionAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkBasicMapAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCacheAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkChangeTrackingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConvertAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkCustomizerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkExistenceCheckingAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkJoinFetchAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkMutableAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkObjectTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrimaryKeyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkPrivateOwnedAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadOnlyAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkReadTransformerAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkStructConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTransformationAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkTypeConverterAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkVariableOneToOneAnnotationDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.EclipseLinkWriteTransformerAnnotationDefinition;
-
-/**
- * Provides annotations for 1.0 EclipseLink platform
- */
-public class EclipseLinkJpaAnnotationDefinitionProvider
- extends AbstractJpaAnnotationDefinitionProvider
-{
- // singleton
- private static final JpaAnnotationDefinitionProvider INSTANCE = new EclipseLinkJpaAnnotationDefinitionProvider();
-
- /**
- * Return the singleton
- */
- public static JpaAnnotationDefinitionProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJpaAnnotationDefinitionProvider() {
- super();
- }
-
- @Override
- protected void addAnnotationDefinitionsTo(ArrayList<AnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, ANNOTATION_DEFINITIONS);
- }
-
- protected static final AnnotationDefinition[] ANNOTATION_DEFINITIONS = new AnnotationDefinition[] {
- EclipseLinkBasicCollectionAnnotationDefinition.instance(),
- EclipseLinkBasicMapAnnotationDefinition.instance(),
- EclipseLinkCacheAnnotationDefinition.instance(),
- EclipseLinkChangeTrackingAnnotationDefinition.instance(),
- EclipseLinkConvertAnnotationDefinition.instance(),
- EclipseLinkCustomizerAnnotationDefinition.instance(),
- EclipseLinkExistenceCheckingAnnotationDefinition.instance(),
- EclipseLinkJoinFetchAnnotationDefinition.instance(),
- EclipseLinkMutableAnnotationDefinition.instance(),
- EclipseLinkPrimaryKeyAnnotationDefinition.instance(),
- EclipseLinkPrivateOwnedAnnotationDefinition.instance(),
- EclipseLinkReadOnlyAnnotationDefinition.instance(),
- EclipseLinkReadTransformerAnnotationDefinition.instance(),
- EclipseLinkTransformationAnnotationDefinition.instance(),
- EclipseLinkVariableOneToOneAnnotationDefinition.instance(),
- EclipseLinkWriteTransformerAnnotationDefinition.instance()
- };
-
-
- @Override
- protected void addNestableAnnotationDefinitionsTo(ArrayList<NestableAnnotationDefinition> definitions) {
- CollectionTools.addAll(definitions, NESTABLE_ANNOTATION_DEFINITIONS);
- }
-
- protected static final NestableAnnotationDefinition[] NESTABLE_ANNOTATION_DEFINITIONS = new NestableAnnotationDefinition[] {
- EclipseLinkConverterAnnotationDefinition.instance(),
- EclipseLinkObjectTypeConverterAnnotationDefinition.instance(),
- EclipseLinkStructConverterAnnotationDefinition.instance(),
- EclipseLinkTypeConverterAnnotationDefinition.instance(),
- };
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaFactory.java
deleted file mode 100644
index 3f89c55f55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaFactory.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.Accessor;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaFactory;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkEmbeddableImpl;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkEntityImpl;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkMappedSuperclassImpl;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.SpecifiedJavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkVersionMapping;
-
-public class EclipseLinkJpaFactory
- extends AbstractJpaFactory
-{
- public EclipseLinkJpaFactory() {
- super();
- }
-
-
- // ********** Core Model **********
-
- @Override
- public EclipseLinkJpaProject buildJpaProject(JpaProject.Config config) {
- return new EclipseLinkJpaProjectImpl(config);
- }
-
-
- // ********** Java Context Model overrides **********
-
- @Override
- public JavaPersistentAttribute buildJavaPersistentAttribute(PersistentType parent, Accessor accessor) {
- return new SpecifiedJavaEclipseLinkPersistentAttribute(parent, accessor);
- }
-
- @Override
- public JavaPersistentAttribute buildJavaPersistentField(PersistentType parent, JavaResourceField resourceField) {
- return new SpecifiedJavaEclipseLinkPersistentAttribute(parent, resourceField);
- }
-
- @Override
- public JavaPersistentAttribute buildJavaPersistentProperty(PersistentType parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return new SpecifiedJavaEclipseLinkPersistentAttribute(parent, resourceGetter, resourceSetter);
- }
-
- @Override
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkBasicMapping(parent);
- }
-
- @Override
- public JavaEmbeddable buildJavaEmbeddable(JavaPersistentType parent, EmbeddableAnnotation embeddableAnnotation) {
- return new JavaEclipseLinkEmbeddableImpl(parent, embeddableAnnotation);
- }
-
- @Override
- public JavaEclipseLinkEntity buildJavaEntity(JavaPersistentType parent, EntityAnnotation entityAnnotation) {
- return new JavaEclipseLinkEntityImpl(parent, entityAnnotation);
- }
-
- @Override
- public JavaIdMapping buildJavaIdMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkIdMapping(parent);
- }
-
- @Override
- public JavaEclipseLinkMappedSuperclass buildJavaMappedSuperclass(JavaPersistentType parent, MappedSuperclassAnnotation mappedSuperclassAnnotation) {
- return new JavaEclipseLinkMappedSuperclassImpl(parent, mappedSuperclassAnnotation);
- }
-
- @Override
- public JavaVersionMapping buildJavaVersionMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkVersionMapping(parent);
- }
-
- @Override
- public JavaOneToManyMapping buildJavaOneToManyMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkOneToManyMapping(parent);
- }
-
- @Override
- public JavaOneToOneMapping buildJavaOneToOneMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkOneToOneMapping(parent);
- }
-
- @Override
- public JavaManyToManyMapping buildJavaManyToManyMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkManyToManyMapping(parent);
- }
-
- @Override
- public JavaManyToOneMapping buildJavaManyToOneMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkManyToOneMapping(parent);
- }
-
-
- // ********** EclipseLink-specific Java Context Model **********
-
- public JavaEclipseLinkBasicCollectionMapping buildJavaEclipseLinkBasicCollectionMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkBasicCollectionMapping(parent);
- }
-
- public JavaEclipseLinkBasicMapMapping buildJavaEclipseLinkBasicMapMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkBasicMapMapping(parent);
- }
-
- public JavaEclipseLinkTransformationMapping buildJavaEclipseLinkTransformationMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkTransformationMapping(parent);
- }
-
- public JavaEclipseLinkVariableOneToOneMapping buildJavaEclipseLinkVariableOneToOneMapping(JavaPersistentAttribute parent) {
- return new JavaEclipseLinkVariableOneToOneMapping(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaJpqlQueryHelper.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaJpqlQueryHelper.java
deleted file mode 100644
index 6af4aa7100..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaJpqlQueryHelper.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.jpql.JpaJpqlQueryHelper;
-import org.eclipse.jpt.jpa.core.jpql.spi.IManagedTypeBuilder;
-import org.eclipse.jpt.jpa.eclipselink.core.jpql.spi.EclipseLinkManagedTypeBuilder;
-import org.eclipse.jpt.jpa.eclipselink.core.jpql.spi.EclipseLinkMappingBuilder;
-import org.eclipse.persistence.jpa.jpql.AbstractContentAssistVisitor;
-import org.eclipse.persistence.jpa.jpql.AbstractGrammarValidator;
-import org.eclipse.persistence.jpa.jpql.AbstractSemanticValidator;
-import org.eclipse.persistence.jpa.jpql.DefaultRefactoringTool;
-import org.eclipse.persistence.jpa.jpql.EclipseLinkContentAssistVisitor;
-import org.eclipse.persistence.jpa.jpql.EclipseLinkGrammarValidator;
-import org.eclipse.persistence.jpa.jpql.EclipseLinkJPQLQueryContext;
-import org.eclipse.persistence.jpa.jpql.EclipseLinkSemanticValidator;
-import org.eclipse.persistence.jpa.jpql.JPQLQueryContext;
-import org.eclipse.persistence.jpa.jpql.RefactoringTool;
-import org.eclipse.persistence.jpa.jpql.model.EclipseLinkJPQLQueryBuilder;
-import org.eclipse.persistence.jpa.jpql.model.IJPQLQueryBuilder;
-import org.eclipse.persistence.jpa.jpql.parser.JPQLGrammar;
-import org.eclipse.persistence.jpa.jpql.spi.IMappingBuilder;
-import org.eclipse.persistence.jpa.jpql.spi.IQuery;
-
-/**
- * The abstract implementation of {@link JpaJpqlQueryHelper} that supports EclipseLink.
- *
- * @version 3.2
- * @since 3.1
- * @author Pascal Filion
- */
-public class EclipseLinkJpaJpqlQueryHelper extends JpaJpqlQueryHelper {
-
- /**
- * Creates a new <code>EclipseLinkJpaJpqlQueryHelper</code>.
- *
- * @param jpqlGrammar The grammar that defines how to parse a JPQL query
- */
- public EclipseLinkJpaJpqlQueryHelper(JPQLGrammar jpqlGrammar) {
- super(jpqlGrammar);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected AbstractContentAssistVisitor buildContentAssistVisitor(JPQLQueryContext queryContext) {
- return new EclipseLinkContentAssistVisitor(queryContext);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected AbstractGrammarValidator buildGrammarValidator(JPQLQueryContext queryContext) {
- return new EclipseLinkGrammarValidator(queryContext.getGrammar());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected JPQLQueryContext buildJPQLQueryContext(JPQLGrammar jpqlGrammar) {
- return new EclipseLinkJPQLQueryContext(jpqlGrammar);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected IManagedTypeBuilder buildManagedTypeBuilder() {
- return new EclipseLinkManagedTypeBuilder();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected IMappingBuilder<AttributeMapping> buildMappingBuilder() {
- return new EclipseLinkMappingBuilder();
- }
-
- /**
- * Creates the right {@link IJPQLQueryBuilder} based on the JPQL grammar.
- *
- * @return A new concrete instance of {@link IJPQLQueryBuilder}
- */
- protected IJPQLQueryBuilder buildQueryBuilder() {
- return new EclipseLinkJPQLQueryBuilder(getGrammar());
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public RefactoringTool buildRefactoringTool() {
-
- IQuery query = getQuery();
-
- return new DefaultRefactoringTool(
- query.getProvider(),
- buildQueryBuilder(),
- query.getExpression()
- );
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected AbstractSemanticValidator buildSemanticValidator(JPQLQueryContext queryContext) {
- return new EclipseLinkSemanticValidator(queryContext);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java
deleted file mode 100644
index ec067a3fd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformFactory.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatformFactory.SimpleVersion;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.persistence.jpa.jpql.parser.EclipseLinkJPQLGrammar1;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class EclipseLinkJpaPlatformFactory
- implements JpaPlatformFactory
-{
-
- /**
- * zero-argument constructor
- */
- public EclipseLinkJpaPlatformFactory() {
- super();
- }
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new EclipseLinkJpaFactory(),
- buildAnnotationProvider(),
- EclipseLinkJpaPlatformProvider.instance(),
- buildJpaPlatformVariation(),
- EclipseLinkJPQLGrammar1.instance());
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new EclipseLinkVersion(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_1_0,
- JpaFacet.VERSION_1_0.getVersionString());
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.instance());
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.NO;
- }
- public boolean isJoinTableOverridable() {
- return false;
- }
- public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
- return GENERIC_SUPPORTED_ACCESS_TYPES;
- }
- };
- }
-
-
- public static class EclipseLinkVersion extends SimpleVersion {
-
- protected final String eclipseLinkVersion;
-
- public EclipseLinkVersion(String eclipseLinkVersion, String jpaVersion) {
- super(jpaVersion);
- this.eclipseLinkVersion = eclipseLinkVersion;
- }
-
- @Override
- public String getVersion() {
- return this.eclipseLinkVersion;
- }
-
- /**
- * Return whether the platform is compatible with the specified EclipseLink version.
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_1_0
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_1_1
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_1_2
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_2_0
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_2_1
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_2_2
- * @see JptJpaEclipseLinkCorePlugin#ECLIPSELINK_PLATFORM_VERSION_2_3
- */
- public boolean isCompatibleWithVersion(String version) {
- return VERSION_COMPARATOR.compare(this.eclipseLinkVersion, version) >= 0;
- }
-
- @Override
- public String toString() {
- return super.toString() + " EclipseLink version: " + this.getVersion(); //$NON-NLS-1$
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java
deleted file mode 100644
index 641e5b14a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaPlatformProvider.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicCollectionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMapMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaEntityDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaIdMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaTransformationMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVariableOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.EclipseLinkJavaVersionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.EclipseLinkOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkPersistenceXmlDefinition;
-
-/**
- * EclipseLink platform
- */
-public class EclipseLinkJpaPlatformProvider
- extends AbstractJpaPlatformProvider {
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new EclipseLinkJpaPlatformProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJpaPlatformProvider() {
- super();
- }
-
-
- // ********* resource models *********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE)) {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance(),
- EclipseLinkOrmResourceModelProvider.instance()
- };
-
-
- // ********* Java type mappings *********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- // NB: no EclipseLink-specific mappings
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- EclipseLinkJavaEntityDefinition.instance(),
- EclipseLinkJavaEmbeddableDefinition.instance(),
- EclipseLinkJavaMappedSuperclassDefinition.instance()
- };
-
-
- // ********* Java attribute mappings *********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance()
- };
-
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by EclipseLink
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- EclipseLinkJavaBasicCollectionMappingDefinition.instance(),
- EclipseLinkJavaBasicMapMappingDefinition.instance(),
- EclipseLinkJavaIdMappingDefinition.instance(),
- EclipseLinkJavaVersionMappingDefinition.instance(),
- EclipseLinkJavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- EclipseLinkJavaTransformationMappingDefinition.instance(),
- EclipseLinkJavaManyToManyMappingDefinition.instance(),
- EclipseLinkJavaManyToOneMappingDefinition.instance(),
- EclipseLinkJavaOneToManyMappingDefinition.instance(),
- EclipseLinkJavaOneToOneMappingDefinition.instance(),
- EclipseLinkJavaVariableOneToOneMappingDefinition.instance()
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- EclipseLinkPersistenceXmlDefinition.instance(),
- EclipseLinkOrmXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java
deleted file mode 100644
index d354457ad5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaProjectImpl.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaProject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-/**
- * EclipseLink-specific JPA project.
- */
-public class EclipseLinkJpaProjectImpl
- extends AbstractJpaProject
- implements EclipseLinkJpaProject {
-
- public EclipseLinkJpaProjectImpl(JpaProject.Config config) {
- super(config);
- }
-
- public JpaXmlResource getDefaultEclipseLinkOrmXmlResource() {
- return (JpaXmlResource) this.getResourceModel(
- JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH,
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java
deleted file mode 100644
index 2eb9fc274e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkJpaValidationMessages.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-@SuppressWarnings("nls")
-public interface EclipseLinkJpaValidationMessages {
-
- public static final String BUNDLE_NAME = "eclipselink_jpa_validation";
-
- public static final String CACHE_EXPIRY_AND_EXPIRY_TIME_OF_DAY_BOTH_SPECIFIED = "CACHE_EXPIRY_AND_EXPIRY_TIME_OF_DAY_BOTH_SPECIFIED";
-
- public static final String CONVERTER_CLASS_IMPLEMENTS_CONVERTER = "CONVERTER_CLASS_IMPLEMENTS_CONVERTER";
-
- public static final String STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER = "STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER";
-
- public static final String CONVERTER_DUPLICATE_NAME = "CONVERTER_DUPLICATE_NAME";
-
- public static final String CONVERTER_NAME_UNDEFINED = "CONVERTER_NAME_UNDEFINED";
-
- public static final String RESERVED_CONVERTER_NAME = "RESERVED_CONVERTER_NAME";
-
- public static final String CONVERTER_CLASS_EXISTS = "CONVERTER_CLASS_EXISTS";
-
- public static final String CONVERTER_CLASS_DEFINED = "CONVERTER_CLASS_DEFINED";
-
- public static final String DESCRIPTOR_CUSTOMIZER_CLASS_NOT_SPECIFIED = "DESCRIPTOR_CUSTOMIZER_CLASS_NOT_SPECIFIED";
-
- public static final String DESCRIPTOR_CUSTOMIZER_CLASS_NOT_EXIST = "DESCRIPTOR_CUSTOMIZER_CLASS_NOT_EXIST";
-
- public static final String DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID = "DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID";
-
- public static final String DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER = "DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER";
-
- public static final String EXCEPTION_HANDLER_CLASS_NOT_SPECIFIED = "EXCEPTION_HANDLER_CLASS_NOT_SPECIFIED";
-
- public static final String EXCEPTION_HANDLER_CLASS_NOT_EXIST = "EXCEPTION_HANDLER_CLASS_NOT_EXIST";
-
- public static final String EXCEPTION_HANDLER_CLASS_NOT_VALID = "EXCEPTION_HANDLER_CLASS_NOT_VALID";
-
- public static final String EXCEPTION_HANDLER_CLASS_IMPLEMENTS_EXCEPTION_HANDLER = "EXCEPTION_HANDLER_CLASS_IMPLEMENTS_EXCEPTION_HANDLER";
-
- public static final String GENERATOR_DUPLICATE_NAME = "GENERATOR_DUPLICATE_NAME";
-
- public static final String GENERATOR_EQUIVALENT = "GENERATOR_EQUIVALENT";
-
- public static final String ID_MAPPING_UNRESOLVED_CONVERTER_NAME = "ID_MAPPING_UNRESOLVED_CONVERTER_NAME";
-
- public static final String MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE = "MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE";
-
- public static final String PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE = "PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE";
-
- public static final String PERSISTENCE_UNIT_LEGACY_DESCRIPTOR_CUSTOMIZER = "PERSISTENCE_UNIT_LEGACY_DESCRIPTOR_CUSTOMIZER";
-
- public static final String PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING = "PERSISTENCE_UNIT_LEGACY_ENTITY_CACHING";
-
- public static final String PERSISTENCE_UNIT_CACHING_PROPERTY_IGNORED = "PERSISTENCE_UNIT_CACHING_PROPERTY_IGNORED";
-
- public static final String QUERY_DUPLICATE_NAME = "QUERY_DUPLICATE_NAME";
-
- public static final String QUERY_EQUIVALENT = "QUERY_EQUIVALENT";
-
- public static final String SESSION_CUSTOMIZER_CLASS_NOT_SPECIFIED = "SESSION_CUSTOMIZER_CLASS_NOT_SPECIFIED";
-
- public static final String SESSION_CUSTOMIZER_CLASS_NOT_EXIST = "SESSION_CUSTOMIZER_CLASS_NOT_EXIST";
-
- public static final String SESSION_CUSTOMIZER_CLASS_NOT_VALID = "SESSION_CUSTOMIZER_CLASS_NOT_VALID";
-
- public static final String SESSION_CUSTOMIZER_CLASS_IMPLEMENTS_SESSION_CUSTOMIZER = "SESSION_CUSTOMIZER_CLASS_IMPLEMENTS_SESSION_CUSTOMIZER";
-
- public static final String SESSION_LOGGER_CLASS_NOT_SPECIFIED = "SESSION_LOGGER_CLASS_NOT_SPECIFIED";
-
- public static final String SESSION_LOGGER_CLASS_NOT_EXIST = "SESSION_LOGGER_CLASS_NOT_EXIST";
-
- public static final String SESSION_LOGGER_CLASS_IMPLEMENTS_SESSION_LOG = "SESSION_LOGGER_CLASS_IMPLEMENTS_SESSION_LOG";
-
- public static final String SESSION_PROFILER_CLASS_NOT_SPECIFIED = "SESSION_PROFILER_CLASS_NOT_SPECIFIED";
-
- public static final String SESSION_PROFILER_CLASS_NOT_EXIST = "SESSION_PROFILER_CLASS_NOT_EXIST";
-
- public static final String SESSION_PROFILER_CLASS_NOT_VALID = "SESSION_PROFILER_CLASS_NOT_VALID";
-
- public static final String SESSION_PROFILER_CLASS_IMPLEMENTS_SESSIONP_ROFILER = "SESSION_PROFILER_CLASS_IMPLEMENTS_SESSION_PROFILER";
-
- public static final String BASIC_COLLECTION_MAPPING_DEPRECATED = "BASIC_COLLECTION_MAPPING_DEPRECATED";
-
- public static final String BASIC_MAP_MAPPING_DEPRECATED = "BASIC_MAP_MAPPING_DEPRECATED";
-
- public static final String TYPE_MAPPING_MEMBER_CLASS_NOT_STATIC = "TYPE_MAPPING_MEMBER_CLASS_NOT_STATIC";
-
- public static final String TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME = "TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME = "VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME";
- public static final String VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME = "VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME";
- public static final String TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID = "TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID = "VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID";
- public static final String VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID="VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID";
- public static final String MULTITENANT_NOT_SPECIFIED_WITH_TENANT_DISCRIMINATOR_COLUMNS = "MULTITENANT_NOT_SPECIFIED_WITH_TENANT_DISCRIMINATOR_COLUMNS";
- public static final String MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY = "MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY";
- public static final String MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED = "MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED";
- public static final String MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED = "MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED";
- public static final String MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM = "MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM";
- public static final String MULTITENANT_VPD_INCLUDE_CRITERIA_WILL_BE_IGNORED = "MULTITENANT_VPD_INCLUDE_CRITERIA_WILL_BE_IGNORED";
-
- public static final String VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED = "VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED";
- public static final String VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST = "VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST";
- public static final String VIRTUAL_TYPE_PARENT_CLASS_DOES_NOT_EXIST = "VIRTUAL_TYPE_PARENT_CLASS_DOES_NOT_EXIST";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java
deleted file mode 100644
index d6d8ed6086..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/EclipseLinkOrmResourceModelProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.orm.EclipseLinkOrmXmlResourceProvider;
-
-/**
- * EclipseLink orm.xml
- */
-public class EclipseLinkOrmResourceModelProvider
- implements JpaResourceModelProvider
-{
- // singleton
- private static final JpaResourceModelProvider INSTANCE = new EclipseLinkOrmResourceModelProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaResourceModelProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmResourceModelProvider() {
- super();
- }
-
-
- public IContentType getContentType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE;
- }
-
- public JpaXmlResource buildResourceModel(JpaProject jpaProject, IFile file) {
- return EclipseLinkOrmXmlResourceProvider.getXmlResourceProvider(file).getXmlResource();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/JptJpaEclipseLinkCoreMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/JptJpaEclipseLinkCoreMessages.java
deleted file mode 100644
index c7d748efcd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/JptJpaEclipseLinkCoreMessages.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-public class JptJpaEclipseLinkCoreMessages {
- private static final String BUNDLE_NAME = "jpt_jpa_eclipselink_core"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptJpaEclipseLinkCoreMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- public static String JAVA_METADATA_CONVERSION_CONVERT_CONVERTER;
-
- private JptJpaEclipseLinkCoreMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/AbstractEclipseLinkTypeMappingValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/AbstractEclipseLinkTypeMappingValidator.java
deleted file mode 100644
index 0ada0fb11b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/AbstractEclipseLinkTypeMappingValidator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractTypeMappingValidator;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public abstract class AbstractEclipseLinkTypeMappingValidator<T extends TypeMapping>
- extends AbstractTypeMappingValidator<T>
-{
- protected AbstractEclipseLinkTypeMappingValidator(T typeMapping, JavaResourceType jrt, TypeMappingTextRangeResolver textRangeResolver) {
- super(typeMapping, jrt, textRangeResolver);
- }
-
-
- @Override
- protected void validateType(List<IMessage> messages) {
- if (this.isMemberType() && !this.isStaticType()) {
- messages.add(this.buildEclipseLinkTypeMessage(EclipseLinkJpaValidationMessages.TYPE_MAPPING_MEMBER_CLASS_NOT_STATIC));
- }
- if (!this.hasNoArgConstructor()) {
- messages.add(this.buildTypeMessage(JpaValidationMessages.TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR));
- }
- }
-
- protected IMessage buildEclipseLinkTypeMessage(String msgID) {
- return DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- msgID,
- new String[] {this.typeMapping.getName()},
- this.typeMapping,
- this.textRangeResolver.getTypeMappingTextRange()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkConvertValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkConvertValidator.java
deleted file mode 100644
index 8a9057b880..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkConvertValidator.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.ConverterTextRangeResolver;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkConvertValidator
- implements JptValidator
-{
- protected final EclipseLinkConvert convert;
-
- protected final ConverterTextRangeResolver textRangeResolver;
-
-
- public EclipseLinkConvertValidator(EclipseLinkConvert convert, ConverterTextRangeResolver textRangeResolver) {
- super();
- this.convert = convert;
- this.textRangeResolver = textRangeResolver;
- }
-
- protected AttributeMapping getAttributeMapping() {
- return this.convert.getParent();
- }
-
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return this.convert.getPersistenceUnit();
- }
-
- /**
- * The converters are validated in the persistence unit.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit#validateConverters(List, IReporter)
- */
- public boolean validate(List<IMessage> messages, IReporter reporter) {
- // converters are validated in the persistence unit
- return this.validateConverterName(messages);
- }
-
-
- private boolean validateConverterName(List<IMessage> messages) {
- String converterName = this.convert.getConverterName();
- if (converterName == null) {
- return true;
- }
-
- if (CollectionTools.contains(this.getPersistenceUnit().getUniqueConverterNames(), converterName)) {
- return true;
- }
-
- if (ArrayTools.contains(EclipseLinkConvert.RESERVED_CONVERTER_NAMES, converterName)) {
- return true;
- }
-
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.ID_MAPPING_UNRESOLVED_CONVERTER_NAME,
- new String[] {
- converterName,
- this.getAttributeMapping().getName()
- },
- this.getAttributeMapping(),
- this.textRangeResolver.getConverterTextRange()
- )
- );
- return false;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkDynamicTypeMappingValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkDynamicTypeMappingValidator.java
deleted file mode 100644
index 947aecf2d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkDynamicTypeMappingValidator.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkDynamicTypeMappingValidator
- extends AbstractEclipseLinkTypeMappingValidator<TypeMapping>
-{
- public EclipseLinkDynamicTypeMappingValidator(TypeMapping typeMapping) {
- super(typeMapping, null, null);
- }
-
- @Override
- protected void validateType(List<IMessage> messages) {
- //no validation for a dynamic type
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java
deleted file mode 100644
index 29a3a3fce5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkEntityPrimaryKeyValidator.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractEntityPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkEntityPrimaryKeyValidator
- extends AbstractEntityPrimaryKeyValidator
-{
- public EclipseLinkEntityPrimaryKeyValidator(
- EclipseLinkEntity entity, PrimaryKeyTextRangeResolver textRangeResolver) {
-
- super(entity, textRangeResolver);
- }
-
-
- @Override
- protected EclipseLinkEntity entity() {
- return (EclipseLinkEntity) typeMapping();
- }
-
- // in EclipseLink, a hierarchy may define its primary key on multiple classes, so long as the
- // root entity has a coherent defined primary key.
- // However, the id class may only be defined on one class in the hierarchy.
- @Override
- protected void validatePrimaryKeyIsNotRedefined(List<IMessage> messages, IReporter reporter) {
- if (idClassReference().isSpecified() && definesIdClassOnAncestor(typeMapping())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_REDEFINED,
- new String[0],
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
- }
-
- @Override
- protected boolean definesPrimaryKey(TypeMapping typeMapping) {
- return super.definesPrimaryKey(typeMapping)
- || ((EclipseLinkTypeMapping) typeMapping).usesPrimaryKeyColumns()
- || ((EclipseLinkTypeMapping) typeMapping).usesPrimaryKeyTenantDiscriminatorColumns();
- }
-
- @Override
- protected boolean specifiesIdClass() {
- return super.specifiesIdClass() || definesIdClass(typeMapping());
- }
-
-
- @Override
- protected void validateIdClassAttributesWithPropertyAccess(
- JavaPersistentType idClass, List<IMessage> messages,
- IReporter reporter) {
- //do nothing - Eclipselink does not care about the existence status of property methods
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java
deleted file mode 100644
index b3b97d2791..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassPrimaryKeyValidator.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.PrimaryKeyTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkMappedSuperclassPrimaryKeyValidator
- extends AbstractMappedSuperclassPrimaryKeyValidator
-{
- public EclipseLinkMappedSuperclassPrimaryKeyValidator(
- EclipseLinkMappedSuperclass mappedSuperclass, PrimaryKeyTextRangeResolver textRangeResolver) {
-
- super(mappedSuperclass, textRangeResolver);
- }
-
-
- @Override
- protected EclipseLinkMappedSuperclass mappedSuperclass() {
- return (EclipseLinkMappedSuperclass) typeMapping();
- }
-
- // in EclipseLink, a hierarchy may define its primary key on multiple classes, so long as the
- // root entity has a coherent defined primary key.
- // However, the id class may only be defined on one class in the hierarchy.
- @Override
- protected void validatePrimaryKeyIsNotRedefined(List<IMessage> messages, IReporter reporter) {
- if (idClassReference().isSpecified() && definesIdClassOnAncestor(typeMapping())) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.TYPE_MAPPING_ID_CLASS_REDEFINED,
- new String[0],
- typeMapping(),
- textRangeResolver().getIdClassTextRange()));
- }
- }
-
- // in EclipseLink, it's only the root entity where this matters
- @Override
- protected void validateIdClassIsUsedIfNecessary(List<IMessage> messages, IReporter reporter) {
- // no op
- }
-
- // in EclipseLink, it's only the root entity where this matters
- @Override
- protected void validateIdClass(JavaPersistentType idClass, List<IMessage> messages, IReporter reporter) {
- // no op
- }
-
- @Override
- protected boolean definesPrimaryKey(TypeMapping typeMapping) {
- return super.definesPrimaryKey(typeMapping)
- || ((EclipseLinkTypeMapping) typeMapping).usesPrimaryKeyColumns();
- }
-
-
- @Override
- protected void validateIdClassAttributesWithPropertyAccess(
- JavaPersistentType idClass, List<IMessage> messages,
- IReporter reporter) {
- //do nothing - Eclipselink does not care about the existence status of property methods
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassValidator.java
deleted file mode 100644
index aab2123010..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkMappedSuperclassValidator.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkMappedSuperclassValidator
- extends AbstractEclipseLinkTypeMappingValidator<MappedSuperclass>
-{
- public EclipseLinkMappedSuperclassValidator(MappedSuperclass mappedSuperclass, JavaResourceType jrt, TypeMappingTextRangeResolver textRangeResolver) {
- super(mappedSuperclass, jrt, textRangeResolver);
- }
-
-
- @Override
- protected void validateType(List<IMessage> messages) {
- if (this.isFinalType()) {
- messages.add(this.buildTypeMessage(JpaValidationMessages.TYPE_MAPPING_FINAL_CLASS));
- }
- super.validateType(messages);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkPersistentAttributeValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkPersistentAttributeValidator.java
deleted file mode 100644
index 1a0f14d1b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkPersistentAttributeValidator.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.PersistentAttributeTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractPersistentAttributeValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class EclipseLinkPersistentAttributeValidator
- extends AbstractPersistentAttributeValidator
-{
- public EclipseLinkPersistentAttributeValidator(
- ReadOnlyPersistentAttribute persistentAttribute, PersistentAttributeTextRangeResolver textRangeResolver)
- {
- super(persistentAttribute, textRangeResolver);
- }
-
- /**
- * EclipseLink does not have the same restrictions on the
- * attribute as the JPA spec does (e.g. the spec prohibits a field from
- * being public).
- */
- @Override
- protected void validateMappedAttribute(List<IMessage> messages) {
- return;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkTypeMappingValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkTypeMappingValidator.java
deleted file mode 100644
index a2f720f05f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/EclipseLinkTypeMappingValidator.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.TypeMappingTextRangeResolver;
-
-public class EclipseLinkTypeMappingValidator
- extends AbstractEclipseLinkTypeMappingValidator<TypeMapping>
-{
- public EclipseLinkTypeMappingValidator(TypeMapping typeMapping, JavaResourceType jrt, TypeMappingTextRangeResolver textRangeResolver) {
- super(typeMapping, jrt, textRangeResolver);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/TenantDiscriminatorColumnValidator2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/TenantDiscriminatorColumnValidator2_3.java
deleted file mode 100644
index 0ca15e5edc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/TenantDiscriminatorColumnValidator2_3.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context;
-
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.AbstractNamedColumnValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.EntityTableDescriptionProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-public class TenantDiscriminatorColumnValidator2_3
- extends AbstractNamedColumnValidator<ReadOnlyTenantDiscriminatorColumn2_3, NamedColumnTextRangeResolver>
-{
- public TenantDiscriminatorColumnValidator2_3(
- ReadOnlyTenantDiscriminatorColumn2_3 namedColumn,
- NamedColumnTextRangeResolver textRangeResolver) {
- super(namedColumn, textRangeResolver, new EntityTableDescriptionProvider());
- }
-
- @Override
- protected JptValidator buildTableValidator() {
- return new TableValidator();
- }
-
- @Override
- protected IMessage buildUnresolvedNameMessage(String message) {
- return DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- message,
- new String[] {
- this.column.getName(),
- this.column.getDbTable().getName()
- },
- this.column,
- this.textRangeResolver.getNameTextRange()
- );
- }
-
- @Override
- protected IMessage buildUnresolvedNameMessage() {
- return this.column.isVirtual() ?
- this.buildUnresolvedNameMessage(this.getVirtualTenantDiscriminatorColumnUnresolvedNameMessage()) :
- super.buildUnresolvedNameMessage();
- }
-
- protected String getVirtualTenantDiscriminatorColumnUnresolvedNameMessage() {
- return EclipseLinkJpaValidationMessages.VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getUnresolvedNameMessage() {
- return EclipseLinkJpaValidationMessages.TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME;
- }
-
- @Override
- protected String getVirtualAttributeUnresolvedNameMessage() {
- return EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_UNRESOLVED_NAME;
- }
-
-
- // ********** table validator **********
-
- protected class TableValidator
- extends BaseColumnTableValidator
- {
- protected TableValidator() {
- super();
- }
-
- @Override
- protected ReadOnlyTenantDiscriminatorColumn2_3 getColumn() {
- return (ReadOnlyTenantDiscriminatorColumn2_3) super.getColumn();
- }
-
- @Override
- protected IMessage buildTableNotValidMessage_() {
- return DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getColumnTableNotValidMessage(),
- new String[] {
- this.getColumn().getTable(),
- this.getColumn().getName(),
- this.getColumnTableDescriptionMessage()
- },
- this.getColumn(),
- this.getTextRangeResolver().getTableTextRange()
- );
- }
-
- @Override
- protected String getColumnTableNotValidMessage() {
- return this.getColumn().isVirtual() ?
- this.getVirtualTenantDiscriminatorColumnTableNotValidMessage() :
- this.getColumnTableNotValidMessage_();
- }
-
- protected String getVirtualTenantDiscriminatorColumnTableNotValidMessage() {
- return EclipseLinkJpaValidationMessages.VIRTUAL_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID;
- }
-
- protected String getColumnTableNotValidMessage_() {
- return EclipseLinkJpaValidationMessages.TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID;
- }
-
- @Override
- protected String getVirtualAttributeColumnTableNotValidMessage() {
- return EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_TENANT_DISCRIMINATOR_COLUMN_TABLE_NOT_VALID;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaArrayMappingDefinition2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaArrayMappingDefinition2_3.java
deleted file mode 100644
index 437c432f1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaArrayMappingDefinition2_3.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkArrayAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaArrayMappingDefinition2_3
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaArrayMappingDefinition2_3();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaArrayMappingDefinition2_3() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.ARRAY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkArrayAnnotation2_3.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkConvertAnnotation.ANNOTATION_NAME,
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME
- };
- private static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return new JavaEclipseLinkArrayMapping2_3(persistentAttribute);
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- JavaBasicMappingDefinition.instance().getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition.java
deleted file mode 100644
index 9697611f6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-public class EclipseLinkJavaBasicCollectionMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicCollectionMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicCollectionMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicCollectionAnnotation.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkBasicCollectionMapping(persistentAttribute);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition2_0.java
deleted file mode 100644
index 4e73f3e103..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicCollectionMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-
-public class EclipseLinkJavaBasicCollectionMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaBasicCollectionMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicCollectionMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicCollectionMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
- Access2_0Annotation.ANNOTATION_NAME,
- };
- private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- SUPPORTING_ANNOTATION_NAMES_2_0
- );
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition.java
deleted file mode 100644
index 498cbfbb94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-public class EclipseLinkJavaBasicMapMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicMapMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicMapMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicMapAnnotation.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkBasicMapMapping(persistentAttribute);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition2_0.java
deleted file mode 100644
index 3aa06e0148..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMapMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-
-public class EclipseLinkJavaBasicMapMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaBasicMapMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicMapMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicMapMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
- Access2_0Annotation.ANNOTATION_NAME,
- };
- private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- SUPPORTING_ANNOTATION_NAMES_2_0
- );
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition.java
deleted file mode 100644
index 8a516cc7ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.DefaultJavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaBasicMappingDefinition
- extends DefaultJavaAttributeMappingDefinitionWrapper
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = JavaBasicMappingDefinition.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicMappingDefinition() {
- super();
- }
-
- @Override
- protected DefaultJavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkConvertAnnotation.ANNOTATION_NAME,
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkMutableAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- // 'public' because the EclipseLink Id and Version mappings also support these annotations
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_0.java
deleted file mode 100644
index 961bf8bd5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaBasicMappingDefinition2_0;
-
-public class EclipseLinkJavaBasicMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaBasicMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return EclipseLinkJavaBasicMappingDefinition.instance().isDefault(persistentAttribute);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_2.java
deleted file mode 100644
index 4873517592..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaBasicMappingDefinition2_2.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-public class EclipseLinkJavaBasicMappingDefinition2_2
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaBasicMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaBasicMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaBasicMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLink.CONVERTERS,
- EclipseLink.OBJECT_TYPE_CONVERTERS,
- EclipseLink.STRUCT_CONVERTERS,
- EclipseLink.TYPE_CONVERTERS,
- };
- public static final Iterable<String> ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return DELEGATE.isDefault(persistentAttribute);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_0.java
deleted file mode 100644
index 6a39972bb3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_0.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaElementCollectionMappingDefinition2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaElementCollectionMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaElementCollectionMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaElementCollectionMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaElementCollectionMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME
- };
- private static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_2.java
deleted file mode 100644
index a14b2c171e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaElementCollectionMappingDefinition2_2.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaElementCollectionMappingDefinition2_2
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaElementCollectionMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaElementCollectionMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaElementCollectionMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition2_2.ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition.java
deleted file mode 100644
index f84d80d3e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaEmbeddableDefinition
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaEmbeddableDefinition.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddableDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddableDefinition() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME,
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkCustomizerAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_0.java
deleted file mode 100644
index 8803312721..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddableDefinition2_0;
-
-public class EclipseLinkJavaEmbeddableDefinition2_0
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaEmbeddableDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddableDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddableDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEmbeddableDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_2.java
deleted file mode 100644
index 8607463658..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddableDefinition2_2.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-public class EclipseLinkJavaEmbeddableDefinition2_2
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = EclipseLinkJavaEmbeddableDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddableDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddableDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLink.CONVERTERS,
- EclipseLink.OBJECT_TYPE_CONVERTERS,
- EclipseLink.STRUCT_CONVERTERS,
- EclipseLink.TYPE_CONVERTERS,
- };
- public static final Iterable<String> ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition.java
deleted file mode 100644
index 418af12c8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaEmbeddedIdMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaEmbeddedIdMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddedIdMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddedIdMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition2_0.java
deleted file mode 100644
index 9abe4fcb34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddedIdMappingDefinition2_0;
-
-public class EclipseLinkJavaEmbeddedIdMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaEmbeddedIdMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddedIdMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddedIdMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEmbeddedIdMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition2_2.java
deleted file mode 100644
index 00b2ee65a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedIdMappingDefinition2_2.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaEmbeddedIdMappingDefinition2_2
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaEmbeddedIdMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddedIdMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddedIdMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition2_2.ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition.java
deleted file mode 100644
index 9241b5354f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.DefaultJavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaEmbeddedMappingDefinition
- extends DefaultJavaAttributeMappingDefinitionWrapper
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = JavaEmbeddedMappingDefinition.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddedMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddedMappingDefinition() {
- super();
- }
-
- @Override
- protected DefaultJavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition2_0.java
deleted file mode 100644
index 8b73d718f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.DefaultJavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEmbeddedMappingDefinition2_0;
-
-public class EclipseLinkJavaEmbeddedMappingDefinition2_0
- extends DefaultJavaAttributeMappingDefinitionWrapper
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = JavaEmbeddedMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddedMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddedMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected DefaultJavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEmbeddedMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition2_2.java
deleted file mode 100644
index 64ef0ac813..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEmbeddedMappingDefinition2_2.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.DefaultJavaAttributeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaEmbeddedMappingDefinition2_2
- extends DefaultJavaAttributeMappingDefinitionWrapper
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaEmbeddedMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaEmbeddedMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEmbeddedMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected DefaultJavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition2_2.ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition.java
deleted file mode 100644
index 7477386ae0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaEntityDefinition
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaEntityDefinition.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEntityDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEntityDefinition() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkCacheAnnotation.ANNOTATION_NAME,
- EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME,
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkCustomizerAnnotation.ANNOTATION_NAME,
- EclipseLinkExistenceCheckingAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- // 'public' because EclipseLink MappedSuperclass also supports these annotations
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_0.java
deleted file mode 100644
index 9e3021f20b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaEntityDefinition2_0;
-
-public class EclipseLinkJavaEntityDefinition2_0
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaEntityDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEntityDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEntityDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEntityDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_2.java
deleted file mode 100644
index d49fd52aff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-public class EclipseLinkJavaEntityDefinition2_2
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = EclipseLinkJavaEntityDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEntityDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEntityDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLink.CONVERTERS,
- EclipseLink.OBJECT_TYPE_CONVERTERS,
- EclipseLink.STRUCT_CONVERTERS,
- EclipseLink.TYPE_CONVERTERS,
- };
-
- public static final Iterable<String> ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_3.java
deleted file mode 100644
index 0be7d15f90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaEntityDefinition2_3.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-public class EclipseLinkJavaEntityDefinition2_3
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = EclipseLinkJavaEntityDefinition2_2.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaEntityDefinition2_3();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaEntityDefinition2_3() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME,
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMNS
- };
- public static final Iterable<String> ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition.java
deleted file mode 100644
index 7bbfb2547b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaIdMappingDefinition;
-
-public class EclipseLinkJavaIdMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaIdMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaIdMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaIdMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_0.java
deleted file mode 100644
index 2962443e4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_0.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaIdMappingDefinition2_0;
-
-public class EclipseLinkJavaIdMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaIdMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaIdMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaIdMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- /**
- * Check whether the <code>Id</code> mapping is "specified" according to
- * the spec then check for EclipseLink default mappings that negate the
- * <code>Id</code> mapping.
- */
- @Override
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- boolean specSpecified = super.isSpecified(persistentAttribute);
- return specSpecified && ! this.isDefaultDerivedId(persistentAttribute);
- }
-
- /**
- * EclipseLink supports default M:1 and 1:1 mappings.
- */
- private boolean isDefaultDerivedId(JavaPersistentAttribute persistentAttribute) {
- String defaultKey = persistentAttribute.getDefaultMappingKey();
- return Tools.valuesAreEqual(defaultKey, this.getManyToOneKey()) ||
- Tools.valuesAreEqual(defaultKey, this.getOneToOneKey());
- }
-
- private String getManyToOneKey() {
- return EclipseLinkJavaOneToOneMappingDefinition2_0.instance().getKey();
- }
-
- private String getOneToOneKey() {
- return EclipseLinkJavaOneToOneMappingDefinition2_0.instance().getKey();
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_2.java
deleted file mode 100644
index bca3fc929f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaIdMappingDefinition2_2.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaIdMappingDefinition2_2
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaIdMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaIdMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaIdMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition2_2.ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition.java
deleted file mode 100644
index 12e4d936cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaManyToManyMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaManyToManyMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToManyMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToManyMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_0.java
deleted file mode 100644
index 1a57786e09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaManyToManyMappingDefinition2_0;
-
-public class EclipseLinkJavaManyToManyMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaManyToManyMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToManyMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToManyMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaManyToManyMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_2.java
deleted file mode 100644
index 97e7e61618..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToManyMappingDefinition2_2.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaManyToManyMappingDefinition2_2
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaManyToManyMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToManyMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToManyMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition2_2.ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition.java
deleted file mode 100644
index 9e1b33baf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaManyToOneMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaManyToOneMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToOneMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToOneMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_0.java
deleted file mode 100644
index 74c6d4ea0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaManyToOneMappingDefinition2_0;
-
-public class EclipseLinkJavaManyToOneMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaManyToOneMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToOneMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToOneMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaManyToOneMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_2.java
deleted file mode 100644
index 4130039f91..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaManyToOneMappingDefinition2_2.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaManyToOneMappingDefinition2_2
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaManyToOneMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaManyToOneMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaManyToOneMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition2_2.ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition.java
deleted file mode 100644
index 2bcb1ca038..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaMappedSuperclassDefinition
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaMappedSuperclassDefinition.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaMappedSuperclassDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaMappedSuperclassDefinition() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEntityDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_0.java
deleted file mode 100644
index 8c407f5460..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_0.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaMappedSuperclassDefinition2_0;
-
-public class EclipseLinkJavaMappedSuperclassDefinition2_0
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = JavaMappedSuperclassDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaMappedSuperclassDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaMappedSuperclassDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEntityDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_2.java
deleted file mode 100644
index 489129227c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_2.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-public class EclipseLinkJavaMappedSuperclassDefinition2_2
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = EclipseLinkJavaMappedSuperclassDefinition2_0.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaMappedSuperclassDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaMappedSuperclassDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLink.CONVERTERS,
- EclipseLink.OBJECT_TYPE_CONVERTERS,
- EclipseLink.STRUCT_CONVERTERS,
- EclipseLink.TYPE_CONVERTERS,
- };
- public static final Iterable<String> ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java
deleted file mode 100644
index 18c3788321..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaMappedSuperclassDefinition2_3.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTypeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaMappedSuperclassDefinition2_3
- extends JavaTypeMappingDefinitionWrapper
-{
- private static final JavaTypeMappingDefinition DELEGATE = EclipseLinkJavaMappedSuperclassDefinition2_2.instance();
-
- // singleton
- private static final JavaTypeMappingDefinition INSTANCE = new EclipseLinkJavaMappedSuperclassDefinition2_3();
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaMappedSuperclassDefinition2_3() {
- super();
- }
-
- @Override
- protected JavaTypeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaEntityDefinition2_3.ECLIPSE_LINK2_3_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition.java
deleted file mode 100644
index 420ed0e417..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaOneToManyMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaOneToManyMappingDefinition.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToManyMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToManyMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- String targetEntity = persistentAttribute.getMultiReferenceTargetTypeName();
- return (targetEntity != null)
- && (persistentAttribute.getPersistenceUnit().getEntity(targetEntity) != null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_0.java
deleted file mode 100644
index ebae8afb9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaOneToManyMappingDefinition2_0;
-
-public class EclipseLinkJavaOneToManyMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaOneToManyMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToManyMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToManyMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaOneToManyMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return EclipseLinkJavaOneToManyMappingDefinition.instance().isDefault(persistentAttribute);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_2.java
deleted file mode 100644
index b3c989bdcc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyMappingDefinition2_2.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.DefaultJavaAttributeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaOneToManyMappingDefinition2_2
- extends DefaultJavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaOneToManyMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToManyMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToManyMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected DefaultJavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition2_2.ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyRelationship.java
deleted file mode 100644
index 1da55872e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToManyRelationship.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.GenericJavaOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaOneToManyRelationship2_0;
-
-/**
- * We need this class because the EclipseLink 1.0 1:m mapping supports a join
- * column strategy while JPA did not until JPA 2.0. As a result, we need a class
- * that implements EclipseLink 1.0.
- */
-public class EclipseLinkJavaOneToManyRelationship
- extends GenericJavaOneToManyRelationship
- implements EclipseLinkJavaOneToManyRelationship2_0
-{
- public EclipseLinkJavaOneToManyRelationship(JavaOneToManyMapping parent) {
- super(parent, true); // true=supports join column strategy
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition.java
deleted file mode 100644
index f98b13b3d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-public class EclipseLinkJavaOneToOneMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaOneToOneMappingDefinition.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToOneMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToOneMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- private static final String[] ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY = new String[] {
- EclipseLinkConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME,
- EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME,
- EclipseLinkStructConverterAnnotation.ANNOTATION_NAME,
- EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME,
- };
- public static final Iterable<String> ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES = new ArrayIterable<String>(ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES_ARRAY);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- String targetEntity = persistentAttribute.getSingleReferenceTargetTypeName();
- return (targetEntity != null)
- && (persistentAttribute.getPersistenceUnit().getEntity(targetEntity) != null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_0.java
deleted file mode 100644
index 5782117eb9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaOneToOneMappingDefinition2_0;
-
-public class EclipseLinkJavaOneToOneMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
- implements DefaultJavaAttributeMappingDefinition
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaOneToOneMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToOneMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToOneMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaOneToOneMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return EclipseLinkJavaOneToOneMappingDefinition.instance().isDefault(persistentAttribute);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_2.java
deleted file mode 100644
index 5a467be72f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaOneToOneMappingDefinition2_2.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.DefaultJavaAttributeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaOneToOneMappingDefinition2_2
- extends DefaultJavaAttributeMappingDefinitionWrapper
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaOneToOneMappingDefinition2_0.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaOneToOneMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaOneToOneMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected DefaultJavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition2_2.ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaStructureMappingDefinition2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaStructureMappingDefinition2_3.java
deleted file mode 100644
index 1ed2035920..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaStructureMappingDefinition2_3.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructureAnnotation2_3;
-
-public class EclipseLinkJavaStructureMappingDefinition2_3
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaStructureMappingDefinition2_3();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaStructureMappingDefinition2_3() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.STRUCTURE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkStructureAnnotation2_3.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return new JavaEclipseLinkStructureMapping2_3(persistentAttribute);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 4d558ee500..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaNamedColumn;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.AbstractJavaNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * Java tenant discriminator column
- */
-public class EclipseLinkJavaTenantDiscriminatorColumn2_3
- extends AbstractJavaNamedDiscriminatorColumn<EclipseLinkTenantDiscriminatorColumnAnnotation2_3, JavaReadOnlyTenantDiscriminatorColumn2_3.Owner>
- implements JavaTenantDiscriminatorColumn2_3
-{
- /** @see AbstractJavaNamedColumn#AbstractJavaNamedColumn(JavaJpaContextNode, org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyNamedColumn.Owner, org.eclipse.jpt.jpa.core.resource.java.NamedColumnAnnotation) */
- protected /* final */ EclipseLinkTenantDiscriminatorColumnAnnotation2_3 columnAnnotation; // never null
-
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedContextProperty;
- protected String defaultContextProperty;
-
- protected Boolean specifiedPrimaryKey;
- protected boolean defaultPrimaryKey = DEFAULT_PRIMARY_KEY;
-
- public EclipseLinkJavaTenantDiscriminatorColumn2_3(JavaEclipseLinkMultitenancyImpl2_3 parent, JavaReadOnlyTenantDiscriminatorColumn2_3.Owner owner, EclipseLinkTenantDiscriminatorColumnAnnotation2_3 columnAnnotation) {
- super(parent, owner, columnAnnotation);
- this.specifiedTable = this.buildSpecifiedTable();
- this.specifiedContextProperty = this.buildSpecifiedContextProperty();
- this.specifiedPrimaryKey = this.buildSpecifiedPrimaryKey();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedTable_(this.buildSpecifiedTable());
- this.setSpecifiedContextProperty_(this.buildSpecifiedContextProperty());
- this.setSpecifiedPrimaryKey_(this.buildSpecifiedPrimaryKey());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultTable(this.buildDefaultTable());
- this.setDefaultContextProperty(this.buildDefaultContextProperty());
- this.setDefaultPrimaryKey(this.buildDefaultPrimaryKey());
- }
-
- // ********** column annotation **********
-
- @Override
- public EclipseLinkTenantDiscriminatorColumnAnnotation2_3 getColumnAnnotation() {
- return this.columnAnnotation;
- }
-
- @Override
- protected void setColumnAnnotation(EclipseLinkTenantDiscriminatorColumnAnnotation2_3 columnAnnotation) {
- this.columnAnnotation = columnAnnotation;
- }
-
- @Override
- protected void removeColumnAnnotation() {
- // we don't remove a tenant discriminator column annotation when it is empty
- }
-
-
- // ********** table **********
-
- @Override
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String table) {
- if (this.valuesAreDifferent(this.specifiedTable, table)) {
- this.getColumnAnnotation().setTable(table);
- this.removeColumnAnnotationIfUnset();
- this.setSpecifiedTable_(table);
- }
- }
-
- protected void setSpecifiedTable_(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected String buildSpecifiedTable() {
- return this.getColumnAnnotation().getTable();
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String table) {
- String old = this.defaultTable;
- this.defaultTable = table;
- this.firePropertyChanged(DEFAULT_TABLE_PROPERTY, old, table);
- }
-
- protected String buildDefaultTable() {
- return this.owner.getDefaultTableName();
- }
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.getColumnAnnotation().getTableTextRange(), astRoot);
- }
-
-
- // ********** contextProperty **********
-
- public String getContextProperty() {
- return (this.specifiedContextProperty != null) ? this.specifiedContextProperty : this.defaultContextProperty;
- }
-
- public String getSpecifiedContextProperty() {
- return this.specifiedContextProperty;
- }
-
- public void setSpecifiedContextProperty(String contextProperty) {
- if (this.valuesAreDifferent(this.specifiedContextProperty, contextProperty)) {
- this.getColumnAnnotation().setContextProperty(contextProperty);
- this.removeColumnAnnotationIfUnset();
- this.setSpecifiedContextProperty_(contextProperty);
- }
- }
-
- protected void setSpecifiedContextProperty_(String contextProperty) {
- String old = this.specifiedContextProperty;
- this.specifiedContextProperty = contextProperty;
- this.firePropertyChanged(SPECIFIED_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildSpecifiedContextProperty() {
- return this.getColumnAnnotation().getContextProperty();
- }
-
- public String getDefaultContextProperty() {
- return this.defaultContextProperty;
- }
-
- protected void setDefaultContextProperty(String contextProperty) {
- String old = this.defaultContextProperty;
- this.defaultContextProperty = contextProperty;
- this.firePropertyChanged(DEFAULT_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildDefaultContextProperty() {
- return this.owner.getDefaultContextPropertyName();
- }
-
- public TextRange getContextPropertyTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.getColumnAnnotation().getContextPropertyTextRange(), astRoot);
- }
-
-
- // ********** primaryKey **********
-
- public boolean isPrimaryKey() {
- return (this.specifiedPrimaryKey != null) ? this.specifiedPrimaryKey.booleanValue() : this.isDefaultPrimaryKey();
- }
-
- public Boolean getSpecifiedPrimaryKey() {
- return this.specifiedPrimaryKey;
- }
-
- public void setSpecifiedPrimaryKey(Boolean primaryKey) {
- if (this.valuesAreDifferent(this.specifiedPrimaryKey, primaryKey)) {
- this.getColumnAnnotation().setPrimaryKey(primaryKey);
- this.removeColumnAnnotationIfUnset();
- this.setSpecifiedPrimaryKey_(primaryKey);
- }
- }
-
- protected void setSpecifiedPrimaryKey_(Boolean primaryKey) {
- Boolean old = this.specifiedPrimaryKey;
- this.specifiedPrimaryKey = primaryKey;
- this.firePropertyChanged(SPECIFIED_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected Boolean buildSpecifiedPrimaryKey() {
- return this.getColumnAnnotation().getPrimaryKey();
- }
-
- public boolean isDefaultPrimaryKey() {
- return this.defaultPrimaryKey;
- }
-
- protected void setDefaultPrimaryKey(boolean primaryKey) {
- boolean old = this.defaultPrimaryKey;
- this.defaultPrimaryKey = primaryKey;
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected boolean buildDefaultPrimaryKey() {
- return DEFAULT_PRIMARY_KEY;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkMultitenancyImpl2_3 getParent() {
- return (JavaEclipseLinkMultitenancyImpl2_3) super.getParent();
- }
-
- protected JavaResourceType getJavaResourceType() {
- return this.getParent().getJavaResourceType();
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.tableTouches(pos)) {
- return this.getJavaCandidateTableNames(filter);
- }
- return null;
- }
-
- protected boolean tableTouches(int pos) {
- return this.getColumnAnnotation().tableTouches(pos);
- }
-
- protected Iterable<String> getJavaCandidateTableNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateTableNames(filter));
- }
-
- protected Iterable<String> getCandidateTableNames(Filter<String> filter) {
- return new FilteringIterable<String>(this.getCandidateTableNames(), filter);
- }
-
- public Iterable<String> getCandidateTableNames() {
- return this.owner.getCandidateTableNames();
- }
-
-
- // ********** validation **********
-
- public boolean tableNameIsInvalid() {
- return this.owner.tableNameIsInvalid(this.getTable());
- }
-
- @Override
- protected NamedColumnTextRangeResolver buildTextRangeResolver(CompilationUnit astRoot) {
- return new JavaTableColumnTextRangeResolver(this, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTimeOfDay.java
deleted file mode 100644
index d04f0dc00b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTimeOfDay.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-public class EclipseLinkJavaTimeOfDay
- extends AbstractJavaJpaContextNode
- implements EclipseLinkTimeOfDay
-{
- protected final EclipseLinkTimeOfDayAnnotation todAnnotation;
-
- protected Integer hour;
- protected Integer minute;
- protected Integer second;
- protected Integer millisecond;
-
-
- public EclipseLinkJavaTimeOfDay(JavaEclipseLinkCaching parent, EclipseLinkTimeOfDayAnnotation todAnnotation) {
- super(parent);
- this.todAnnotation = todAnnotation;
- this.hour = todAnnotation.getHour();
- this.minute = todAnnotation.getMinute();
- this.second = todAnnotation.getSecond();
- this.millisecond = todAnnotation.getMillisecond();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setHour_(this.todAnnotation.getHour());
- this.setMinute_(this.todAnnotation.getMinute());
- this.setSecond_(this.todAnnotation.getSecond());
- this.setMillisecond_(this.todAnnotation.getMillisecond());
- }
-
-
- // ********** hour **********
-
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer hour) {
- this.todAnnotation.setHour(hour);
- this.setHour_(hour);
- }
-
- protected void setHour_(Integer hour) {
- Integer old = this.hour;
- this.hour = hour;
- this.firePropertyChanged(HOUR_PROPERTY, old, hour);
- }
-
-
- // ********** minute **********
-
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer minute) {
- this.todAnnotation.setMinute(minute);
- this.setMinute_(minute);
- }
-
- protected void setMinute_(Integer minute) {
- Integer old = this.minute;
- this.minute = minute;
- this.firePropertyChanged(MINUTE_PROPERTY, old, minute);
- }
-
-
- // ********** second **********
-
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer second) {
- this.todAnnotation.setSecond(second);
- this.setSecond_(second);
- }
-
- protected void setSecond_(Integer second) {
- Integer old = this.second;
- this.second = second;
- this.firePropertyChanged(SECOND_PROPERTY, old, second);
- }
-
-
- // ********** millisecond **********
-
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer millisecond) {
- this.todAnnotation.setMillisecond(millisecond);
- this.setMillisecond_(millisecond);
- }
-
- protected void setMillisecond_(Integer millisecond) {
- Integer old = this.millisecond;
- this.millisecond = millisecond;
- this.firePropertyChanged(MILLISECOND_PROPERTY, old, millisecond);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkCaching getParent() {
- return (JavaEclipseLinkCaching) super.getParent();
- }
-
- public JavaEclipseLinkCaching getCaching() {
- return this.getParent();
- }
-
- public EclipseLinkTimeOfDayAnnotation getTimeOfDayAnnotation() {
- return this.todAnnotation;
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.todAnnotation.getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getCaching().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition.java
deleted file mode 100644
index 5319654deb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-public class EclipseLinkJavaTransformationMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaTransformationMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaTransformationMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkTransformationAnnotation.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkTransformationMapping(persistentAttribute);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition2_0.java
deleted file mode 100644
index 822c576a36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaTransformationMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-
-public class EclipseLinkJavaTransformationMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaTransformationMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaTransformationMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaTransformationMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
- Access2_0Annotation.ANNOTATION_NAME,
- };
- private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- SUPPORTING_ANNOTATION_NAMES_2_0
- );
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition.java
deleted file mode 100644
index 75bcf45dc8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-public class EclipseLinkJavaVariableOneToOneMappingDefinition
- implements DefaultJavaAttributeMappingDefinition
-{
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaVariableOneToOneMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaVariableOneToOneMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((EclipseLinkJpaFactory) factory).buildJavaEclipseLinkVariableOneToOneMapping(persistentAttribute);
- }
-
- public boolean isDefault(JavaPersistentAttribute persistentAttribute) {
- return ((JavaEclipseLinkPersistentAttribute) persistentAttribute).typeIsValidForVariableOneToOne();
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition2_0.java
deleted file mode 100644
index f67c17b0de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVariableOneToOneMappingDefinition2_0.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.DefaultJavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-
-public class EclipseLinkJavaVariableOneToOneMappingDefinition2_0
- extends DefaultJavaAttributeMappingDefinitionWrapper
-{
- private static final DefaultJavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaVariableOneToOneMappingDefinition.instance();
-
- // singleton
- private static final DefaultJavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaVariableOneToOneMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaVariableOneToOneMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected DefaultJavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- public static final String[] SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0 = new String[] {
- Access2_0Annotation.ANNOTATION_NAME,
- };
- private static final Iterable<String> SUPPORTING_ANNOTATION_NAMES_2_0 = new ArrayIterable<String>(SUPPORTING_ANNOTATION_NAMES_ARRAY_2_0);
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- SUPPORTING_ANNOTATION_NAMES_2_0
- );
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition.java
deleted file mode 100644
index 71d233c1ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaVersionMappingDefinition;
-
-public class EclipseLinkJavaVersionMappingDefinition
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaVersionMappingDefinition.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaVersionMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaVersionMappingDefinition() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_0.java
deleted file mode 100644
index aafeb2e933..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_0.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.JavaVersionMappingDefinition2_0;
-
-public class EclipseLinkJavaVersionMappingDefinition2_0
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = JavaVersionMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaVersionMappingDefinition2_0();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaVersionMappingDefinition2_0() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition.ECLIPSE_LINK_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_2.java
deleted file mode 100644
index 63a10847c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVersionMappingDefinition2_2.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaAttributeMappingDefinitionWrapper;
-
-public class EclipseLinkJavaVersionMappingDefinition2_2
- extends JavaAttributeMappingDefinitionWrapper
-{
- private static final JavaAttributeMappingDefinition DELEGATE = EclipseLinkJavaVersionMappingDefinition2_0.instance();
-
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new EclipseLinkJavaVersionMappingDefinition2_2();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkJavaVersionMappingDefinition2_2() {
- super();
- }
-
- @Override
- protected JavaAttributeMappingDefinition getDelegate() {
- return DELEGATE;
- }
-
- @Override
- public Iterable<String> getSupportingAnnotationNames() {
- return COMBINED_SUPPORTING_ANNOTATION_NAMES;
- }
-
- @SuppressWarnings("unchecked")
- private static final Iterable<String> COMBINED_SUPPORTING_ANNOTATION_NAMES = new CompositeIterable<String>(
- DELEGATE.getSupportingAnnotationNames(),
- EclipseLinkJavaBasicMappingDefinition2_2.ECLIPSE_LINK2_2_SUPPORTING_ANNOTATION_NAMES
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index cc66614cf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaVirtualNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaVirtualTenantDiscriminatorColumn2_3;
-
-/**
- * Java virtual tenant discriminator column
- */
-public class EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3
- extends AbstractJavaVirtualNamedDiscriminatorColumn<JavaReadOnlyTenantDiscriminatorColumn2_3.Owner, ReadOnlyTenantDiscriminatorColumn2_3>
- implements JavaVirtualTenantDiscriminatorColumn2_3
-{
- protected final ReadOnlyTenantDiscriminatorColumn2_3 overriddenColumn;
-
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedContextProperty;
- protected String defaultContextProperty;
-
- protected Boolean specifiedPrimaryKey;
- protected boolean defaultPrimaryKey;
-
-
- public EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3(JavaJpaContextNode parent, JavaReadOnlyTenantDiscriminatorColumn2_3.Owner owner, ReadOnlyTenantDiscriminatorColumn2_3 overriddenColumn) {
- super(parent, owner);
- this.overriddenColumn = overriddenColumn;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void update() {
- super.update();
-
- this.setSpecifiedTable(this.buildSpecifiedTable());
- this.setDefaultTable(this.buildDefaultTable());
-
- this.setSpecifiedContextProperty(this.buildSpecifiedContextProperty());
- this.setDefaultContextProperty(this.buildDefaultContextProperty());
-
- this.setSpecifiedPrimaryKey(this.buildSpecifiedPrimaryKey());
- this.setDefaultPrimaryKey(this.buildDefaultPrimaryKey());
- }
-
-
- // ********** column **********
-
- @Override
- public ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn() {
- return this.overriddenColumn;
- }
-
- // ********** table **********
-
- @Override
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- protected void setSpecifiedTable(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected String buildSpecifiedTable() {
- return this.getOverriddenColumn().getSpecifiedTable();
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String table) {
- String old = this.defaultTable;
- this.defaultTable = table;
- this.firePropertyChanged(DEFAULT_TABLE_PROPERTY, old, table);
- }
-
- protected String buildDefaultTable() {
- return this.owner.getDefaultTableName();
- }
-
-
- // ********** context property **********
-
- public String getContextProperty() {
- return (this.specifiedContextProperty != null) ? this.specifiedContextProperty : this.defaultContextProperty;
- }
-
- public String getSpecifiedContextProperty() {
- return this.specifiedContextProperty;
- }
-
- protected void setSpecifiedContextProperty(String contextProperty) {
- String old = this.specifiedContextProperty;
- this.specifiedContextProperty = contextProperty;
- this.firePropertyChanged(SPECIFIED_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildSpecifiedContextProperty() {
- return this.getOverriddenColumn().getSpecifiedContextProperty();
- }
-
- public String getDefaultContextProperty() {
- return this.defaultContextProperty;
- }
-
- protected void setDefaultContextProperty(String contextProperty) {
- String old = this.defaultContextProperty;
- this.defaultContextProperty = contextProperty;
- this.firePropertyChanged(DEFAULT_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildDefaultContextProperty() {
- return this.owner.getDefaultContextPropertyName();
- }
-
-
- // ********** primary key **********
-
- public boolean isPrimaryKey() {
- return (this.specifiedPrimaryKey != null) ? this.specifiedPrimaryKey.booleanValue() : this.defaultPrimaryKey;
- }
-
- public Boolean getSpecifiedPrimaryKey() {
- return this.specifiedPrimaryKey;
- }
-
- protected void setSpecifiedPrimaryKey(Boolean primaryKey) {
- Boolean old = this.specifiedPrimaryKey;
- this.specifiedPrimaryKey = primaryKey;
- this.firePropertyChanged(SPECIFIED_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected Boolean buildSpecifiedPrimaryKey() {
- return this.getOverriddenColumn().getSpecifiedPrimaryKey();
- }
-
- public boolean isDefaultPrimaryKey() {
- return this.defaultPrimaryKey;
- }
-
- protected void setDefaultPrimaryKey(boolean primaryKey) {
- boolean old = this.defaultPrimaryKey;
- this.defaultPrimaryKey = primaryKey;
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected boolean buildDefaultPrimaryKey() {
- return this.owner.getDefaultPrimaryKey();
- }
-
- // ********** misc **********
-
- public boolean tableNameIsInvalid() {
- return this.owner.tableNameIsInvalid(this.getTable());
- }
-
- public Iterable<String> getCandidateTableNames() {
- return this.owner.getCandidateTableNames();
- }
-
-
- // ********** validation **********
-
- public TextRange getTableTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(astRoot);
- }
-
- @Override
- protected NamedColumnTextRangeResolver buildTextRangeResolver(CompilationUnit astRoot) {
- return new JavaTableColumnTextRangeResolver(this, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkArrayMapping2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkArrayMapping2_3.java
deleted file mode 100644
index 1795808f8b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkArrayMapping2_3.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Association;
-import org.eclipse.jpt.common.utility.internal.SimpleAssociation;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaColumnMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaLobConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaTemporalConverter;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.TableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.EntityTableDescriptionProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.NamedColumnValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.NullJavaConverter;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkArrayMapping2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkArrayAnnotation2_3;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkArrayMapping2_3
- extends AbstractJavaAttributeMapping<EclipseLinkArrayAnnotation2_3>
- implements
- EclipseLinkArrayMapping2_3,
- EclipseLinkJavaConvertibleMapping,
- JavaColumnMapping
-{
-
- protected final JavaColumn column;
-
- protected JavaConverter converter; // never null
-
-
- protected static final JavaConverter.Adapter[] CONVERTER_ADAPTER_ARRAY = new JavaConverter.Adapter[] {
- JavaEnumeratedConverter.Adapter.instance(),
- JavaTemporalConverter.BasicAdapter.instance(),
- JavaLobConverter.Adapter.instance(),
- JavaEclipseLinkConvert.Adapter.instance()
- };
-
- protected static final Iterable<JavaConverter.Adapter> CONVERTER_ADAPTERS = new ArrayIterable<JavaConverter.Adapter>(CONVERTER_ADAPTER_ARRAY);
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- public JavaEclipseLinkArrayMapping2_3(JavaPersistentAttribute parent) {
- super(parent);
- this.column = this.buildColumn();
- this.converter = this.buildConverter();
- this.converterContainer = this.buildConverterContainer();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.column.synchronizeWithResourceModel();
- this.syncConverter();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.column.update();
- this.syncConverter();
- this.converterContainer.update();
- }
-
- // ********** column **********
-
- public JavaColumn getColumn() {
- return this.column;
- }
-
- protected JavaColumn buildColumn() {
- return this.getJpaFactory().buildJavaColumn(this, this);
- }
-
- // ********** converter **********
-
- public JavaConverter getConverter() {
- return this.converter;
- }
-
- public void setConverter(Class<? extends Converter> converterType) {
- if (this.converter.getType() != converterType) {
- this.converter.dispose();
- JavaConverter.Adapter converterAdapter = this.getConverterAdapter(converterType);
- this.retainConverterAnnotation(converterAdapter);
- this.setConverter_(this.buildConverter(converterAdapter));
- }
- }
-
- protected JavaConverter buildConverter(JavaConverter.Adapter converterAdapter) {
- return (converterAdapter != null) ?
- converterAdapter.buildNewConverter(this, this.getJpaFactory()) :
- this.buildNullConverter();
- }
-
- protected void setConverter_(JavaConverter converter) {
- Converter old = this.converter;
- this.converter = converter;
- this.firePropertyChanged(CONVERTER_PROPERTY, old, converter);
- }
-
- /**
- * Clear all the converter annotations <em>except</em> for the annotation
- * corresponding to the specified adapter. If the specified adapter is
- * <code>null</code>, remove <em>all</em> the converter annotations.
- */
- protected void retainConverterAnnotation(JavaConverter.Adapter converterAdapter) {
- JavaResourceAttribute resourceAttribute = this.getResourceAttribute();
- for (JavaConverter.Adapter adapter : this.getConverterAdapters()) {
- if (adapter != converterAdapter) {
- adapter.removeConverterAnnotation(resourceAttribute);
- }
- }
- }
-
- protected JavaConverter buildConverter() {
- JpaFactory jpaFactory = this.getJpaFactory();
- for (JavaConverter.Adapter adapter : this.getConverterAdapters()) {
- JavaConverter javaConverter = adapter.buildConverter(this, jpaFactory);
- if (javaConverter != null) {
- return javaConverter;
- }
- }
- return this.buildNullConverter();
- }
-
- protected void syncConverter() {
- Association<JavaConverter.Adapter, Annotation> assoc = this.getConverterAnnotation();
- if (assoc == null) {
- if (this.converter.getType() != null) {
- this.setConverter_(this.buildNullConverter());
- }
- } else {
- JavaConverter.Adapter adapter = assoc.getKey();
- Annotation annotation = assoc.getValue();
- if ((this.converter.getType() == adapter.getConverterType()) &&
- (this.converter.getConverterAnnotation() == annotation)) {
- this.converter.synchronizeWithResourceModel();
- } else {
- this.setConverter_(adapter.buildConverter(annotation, this, this.getJpaFactory()));
- }
- }
- }
-
- /**
- * Return the first converter annotation we find along with its corresponding
- * adapter. Return <code>null</code> if there are no converter annotations.
- */
- protected Association<JavaConverter.Adapter, Annotation> getConverterAnnotation() {
- JavaResourceAttribute resourceAttribute = this.getResourceAttribute();
- for (JavaConverter.Adapter adapter : this.getConverterAdapters()) {
- Annotation annotation = adapter.getConverterAnnotation(resourceAttribute);
- if (annotation != null) {
- return new SimpleAssociation<JavaConverter.Adapter, Annotation>(adapter, annotation);
- }
- }
- return null;
- }
-
- protected JavaConverter buildNullConverter() {
- return new NullJavaConverter(this);
- }
-
-
- // ********** converter adapters **********
-
- /**
- * Return the converter adapter for the specified converter type.
- */
- protected JavaConverter.Adapter getConverterAdapter(Class<? extends Converter> converterType) {
- for (JavaConverter.Adapter adapter : this.getConverterAdapters()) {
- if (adapter.getConverterType() == converterType) {
- return adapter;
- }
- }
- return null;
- }
-
- protected Iterable<JavaConverter.Adapter> getConverterAdapters() {
- return CONVERTER_ADAPTERS;
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- //TODO should get this from targetClass
- String targetTypeName = this.getPersistentAttribute().getMultiReferenceTargetTypeName();
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-
-
- // ********** misc **********
-
- public String getKey() {
- return EclipseLinkMappingKeys.ARRAY_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkArrayAnnotation2_3.ANNOTATION_NAME;
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
-
- // ********** JavaColumn.Owner implementation **********
-
- public ColumnAnnotation getColumnAnnotation() {
- return (ColumnAnnotation) this.getResourceAttribute().getNonNullAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- public void removeColumnAnnotation() {
- this.getResourceAttribute().removeAnnotation(ColumnAnnotation.ANNOTATION_NAME);
- }
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return this.getName();
- }
-
- public String getDefaultTableName() {
- return this.getTypeMapping().getPrimaryTableName();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return this.getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterable<String> getCandidateTableNames() {
- return this.getTypeMapping().getAllAssociatedTableNames();
- }
-
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn col, NamedColumnTextRangeResolver textRangeResolver) {
- return new NamedColumnValidator(this.getPersistentAttribute(), (ReadOnlyBaseColumn) col, (TableColumnTextRangeResolver) textRangeResolver, new EntityTableDescriptionProvider());
- }
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.column.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.converter.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.column.validate(messages, reporter, astRoot);
- this.converter.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index 9843285d6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-public class JavaEclipseLinkBasicCollectionMapping
- extends AbstractJavaAttributeMapping<EclipseLinkBasicCollectionAnnotation>
- implements EclipseLinkBasicCollectionMapping, EclipseLinkJavaConvertibleMapping
-{
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- public JavaEclipseLinkBasicCollectionMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.converterContainer = this.buildConverterContainer();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- String targetTypeName = this.getPersistentAttribute().getMultiReferenceTargetTypeName();
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-
-
- // ********** misc **********
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkBasicCollectionAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java
deleted file mode 100644
index 2f303a45bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-public class JavaEclipseLinkBasicMapMapping
- extends AbstractJavaAttributeMapping<EclipseLinkBasicMapAnnotation>
- implements EclipseLinkBasicMapMapping, EclipseLinkJavaConvertibleMapping
-{
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- public JavaEclipseLinkBasicMapMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** misc **********
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkBasicMapAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((JavaPersistentAttribute2_0) this.getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- String targetTypeName = this.getPersistentAttribute().getMultiReferenceTargetTypeName();
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-
- @Override
- protected void addMetamodelFieldTypeArgumentNamesTo(ArrayList<String> typeArgumentNames) {
- this.addMetamodelFieldMapKeyTypeArgumentNameTo(typeArgumentNames);
- super.addMetamodelFieldTypeArgumentNamesTo(typeArgumentNames);
- }
-
- protected void addMetamodelFieldMapKeyTypeArgumentNameTo(ArrayList<String> typeArgumentNames) {
- String mapKeyTypeName = this.getPersistentAttribute().getMultiReferenceMapKeyTypeName();
- mapKeyTypeName = mapKeyTypeName != null ? mapKeyTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- typeArgumentNames.add(mapKeyTypeName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java
deleted file mode 100644
index 131a82acea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkBasicMapping.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkBasicMapping
- extends AbstractJavaBasicMapping
- implements EclipseLinkBasicMapping, EclipseLinkJavaConvertibleMapping
-{
- protected final JavaEclipseLinkMutable mutable;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
-
- public JavaEclipseLinkBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.mutable = new JavaEclipseLinkMutable(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- this.converterContainer.update();
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<JavaConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<JavaConverter.Adapter>(
- JavaEclipseLinkConvert.Adapter.instance(),
- super.getConverterAdapters()
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.mutable.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java
deleted file mode 100644
index dcb40f9adc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCachingImpl.java
+++ /dev/null
@@ -1,655 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.NullJavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkCachingImpl
- extends AbstractJavaJpaContextNode
- implements JavaEclipseLinkCaching, JavaCacheableHolder2_0
-{
- protected EclipseLinkCacheType specifiedType;
- protected Integer specifiedSize;
- protected Boolean specifiedShared;
- protected Boolean specifiedAlwaysRefresh;
- protected Boolean specifiedRefreshOnlyIfNewer;
- protected Boolean specifiedDisableHits;
-
- protected EclipseLinkCacheCoordinationType specifiedCoordinationType;
-
- protected Integer expiry;
- protected EclipseLinkJavaTimeOfDay expiryTimeOfDay;
-
- protected boolean existenceChecking;
- protected EclipseLinkExistenceType specifiedExistenceType;
- protected EclipseLinkExistenceType defaultExistenceType;
-
- protected final JavaCacheable2_0 cacheable;
-
- protected EclipseLinkCacheIsolationType2_2 specifiedIsolation;
-
- public JavaEclipseLinkCachingImpl(JavaEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
-
- EclipseLinkCacheAnnotation cacheAnnotation = this.getCacheAnnotation();
- this.specifiedType = EclipseLinkCacheType.fromJavaResourceModel(cacheAnnotation.getType());
- this.specifiedSize = cacheAnnotation.getSize();
- this.specifiedShared = cacheAnnotation.getShared();
- this.specifiedAlwaysRefresh = cacheAnnotation.getAlwaysRefresh();
- this.specifiedRefreshOnlyIfNewer = cacheAnnotation.getRefreshOnlyIfNewer();
- this.specifiedDisableHits = cacheAnnotation.getDisableHits();
-
- this.specifiedCoordinationType = EclipseLinkCacheCoordinationType.fromJavaResourceModel(cacheAnnotation.getCoordinationType());
-
- this.expiry = cacheAnnotation.getExpiry();
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay(cacheAnnotation.getExpiryTimeOfDay());
-
- EclipseLinkExistenceCheckingAnnotation ecAnnotation = this.getExistenceCheckingAnnotation();
- this.existenceChecking = (ecAnnotation != null);
- this.specifiedExistenceType = this.buildSpecifiedExistenceType(ecAnnotation);
-
- this.cacheable = this.buildCacheable();
-
- this.specifiedIsolation = EclipseLinkCacheIsolationType2_2.fromJavaResourceModel(cacheAnnotation.getIsolation());
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
-
- EclipseLinkCacheAnnotation cacheAnnotation = this.getCacheAnnotation();
- this.setSpecifiedType_(EclipseLinkCacheType.fromJavaResourceModel(cacheAnnotation.getType()));
- this.setSpecifiedSize_(cacheAnnotation.getSize());
- this.setSpecifiedShared_(cacheAnnotation.getShared());
- this.setSpecifiedAlwaysRefresh_(cacheAnnotation.getAlwaysRefresh());
- this.setSpecifiedRefreshOnlyIfNewer_(cacheAnnotation.getRefreshOnlyIfNewer());
- this.setSpecifiedDisableHits_(cacheAnnotation.getDisableHits());
-
- this.setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType.fromJavaResourceModel(cacheAnnotation.getCoordinationType()));
-
- this.setExpiry_(cacheAnnotation.getExpiry());
- this.syncExpiryTimeOfDay(cacheAnnotation.getExpiryTimeOfDay());
-
- EclipseLinkExistenceCheckingAnnotation ecAnnotation = this.getExistenceCheckingAnnotation();
- this.setExistenceChecking_(ecAnnotation != null);
- this.setSpecifiedExistenceType_(this.buildSpecifiedExistenceType(ecAnnotation));
-
- this.cacheable.synchronizeWithResourceModel();
-
- this.setSpecifiedIsolation_(EclipseLinkCacheIsolationType2_2.fromJavaResourceModel(cacheAnnotation.getIsolation()));
- }
-
- @Override
- public void update() {
- super.update();
- if (this.expiryTimeOfDay != null) {
- this.expiryTimeOfDay.update();
- }
- this.setDefaultExistenceType(this.buildDefaultExistenceType());
- this.cacheable.update();
- }
-
-
- // ********** type **********
-
- public EclipseLinkCacheType getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
- }
-
- public EclipseLinkCacheType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkCacheType type) {
- this.getCacheAnnotation().setType(EclipseLinkCacheType.toJavaResourceModel(type));
- this.setSpecifiedType_(type);
-
- if (type != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkCacheType type) {
- EclipseLinkCacheType old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- public EclipseLinkCacheType getDefaultType() {
- String puDefaultCacheTypeName = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheTypePropertyValue();
- if (!StringTools.stringIsEmpty(puDefaultCacheTypeName)) {
- try {
- return EclipseLinkCacheType.valueOf(StringTools.convertCamelCaseToAllCaps(puDefaultCacheTypeName));
- } catch (IllegalArgumentException exception) {
- //no match, return default
- }
- }
- return DEFAULT_TYPE;
- }
-
- // ********** size **********
-
- public int getSize() {
- return (this.specifiedSize != null) ? this.specifiedSize.intValue() : this.getDefaultSize();
- }
-
- public Integer getSpecifiedSize() {
- return this.specifiedSize;
- }
-
- public void setSpecifiedSize(Integer size) {
- this.getCacheAnnotation().setSize(size);
- this.setSpecifiedSize_(size);
-
- if (size != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedSize_(Integer size) {
- Integer old = this.specifiedSize;
- this.specifiedSize = size;
- this.firePropertyChanged(SPECIFIED_SIZE_PROPERTY, old, size);
- }
-
- public int getDefaultSize() {
- String puDefaultCacheSize = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSizePropertyValue();
- if (!StringTools.stringIsEmpty(puDefaultCacheSize)) {
- try {
- return Integer.valueOf(puDefaultCacheSize).intValue();
- } catch (NumberFormatException exception) {
- //couldn't parse, return default
- }
- }
- return DEFAULT_SIZE;
- }
-
-
- // ********** shared **********
-
- public boolean isShared() {
- return (this.specifiedShared != null) ? this.specifiedShared.booleanValue() : this.isDefaultShared();
- }
-
- public Boolean getSpecifiedShared() {
- return this.specifiedShared;
- }
-
- public void setSpecifiedShared(Boolean shared) {
- this.getCacheAnnotation().setShared(shared);
- this.setSpecifiedShared_(shared);
-
- if ((shared != null) && ! shared.booleanValue()) { // Boolean.FALSE
- this.setSpecifiedType(null);
- this.setSpecifiedSize(null);
- this.setSpecifiedAlwaysRefresh(null);
- this.setSpecifiedRefreshOnlyIfNewer(null);
- this.setSpecifiedDisableHits(null);
- this.setSpecifiedCoordinationType(null);
- this.setExpiry(null);
- this.removeExpiryTimeOfDayIfNecessary();
- }
- }
-
- protected void setSpecifiedShared_(Boolean shared) {
- Boolean old = this.specifiedShared;
- this.specifiedShared = shared;
- this.firePropertyChanged(SPECIFIED_SHARED_PROPERTY, old, shared);
- }
-
- public boolean isDefaultShared() {
- String puDefaultSharedCache = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSharedPropertyValue();
- return !StringTools.stringIsEmpty(puDefaultSharedCache) ? Boolean.valueOf(puDefaultSharedCache).booleanValue() : DEFAULT_SHARED;
- }
-
-
- // ********** always refresh **********
-
- public boolean isAlwaysRefresh() {
- return (this.specifiedAlwaysRefresh != null) ? this.specifiedAlwaysRefresh.booleanValue() : this.isDefaultAlwaysRefresh();
- }
-
- public Boolean getSpecifiedAlwaysRefresh() {
- return this.specifiedAlwaysRefresh;
- }
-
- public void setSpecifiedAlwaysRefresh(Boolean alwaysRefresh) {
- this.getCacheAnnotation().setAlwaysRefresh(alwaysRefresh);
- this.setSpecifiedAlwaysRefresh_(alwaysRefresh);
-
- if (alwaysRefresh != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedAlwaysRefresh_(Boolean alwaysRefresh) {
- Boolean old = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
- }
-
- public boolean isDefaultAlwaysRefresh() {
- return DEFAULT_ALWAYS_REFRESH;
- }
-
-
- // ********** refresh only if newer **********
-
- public boolean isRefreshOnlyIfNewer() {
- return (this.specifiedRefreshOnlyIfNewer != null) ? this.specifiedRefreshOnlyIfNewer.booleanValue() : this.isDefaultRefreshOnlyIfNewer();
- }
-
- public Boolean getSpecifiedRefreshOnlyIfNewer() {
- return this.specifiedRefreshOnlyIfNewer;
- }
-
- public void setSpecifiedRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- this.getCacheAnnotation().setRefreshOnlyIfNewer(refreshOnlyIfNewer);
- this.setSpecifiedRefreshOnlyIfNewer_(refreshOnlyIfNewer);
-
- if (refreshOnlyIfNewer != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedRefreshOnlyIfNewer_(Boolean refreshOnlyIfNewer) {
- Boolean old = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
- }
-
- public boolean isDefaultRefreshOnlyIfNewer() {
- return DEFAULT_REFRESH_ONLY_IF_NEWER;
- }
-
-
- // ********** disable hits **********
-
- public boolean isDisableHits() {
- return (this.specifiedDisableHits != null) ? this.specifiedDisableHits.booleanValue() : this.isDefaultDisableHits();
- }
-
- public Boolean getSpecifiedDisableHits() {
- return this.specifiedDisableHits;
- }
-
- public void setSpecifiedDisableHits(Boolean disableHits) {
- this.getCacheAnnotation().setDisableHits(disableHits);
- this.setSpecifiedDisableHits_(disableHits);
-
- if (disableHits != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedDisableHits_(Boolean disableHits) {
- Boolean old = this.specifiedDisableHits;
- this.specifiedDisableHits = disableHits;
- this.firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, old, disableHits);
- }
-
- public boolean isDefaultDisableHits() {
- return DEFAULT_DISABLE_HITS;
- }
-
-
- // ********** coordination type **********
-
- public EclipseLinkCacheCoordinationType getCoordinationType() {
- return (this.specifiedCoordinationType != null) ? this.specifiedCoordinationType : this.getDefaultCoordinationType();
- }
-
- public EclipseLinkCacheCoordinationType getSpecifiedCoordinationType() {
- return this.specifiedCoordinationType;
- }
-
- public void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType type) {
- this.getCacheAnnotation().setCoordinationType(EclipseLinkCacheCoordinationType.toJavaResourceModel(type));
- this.setSpecifiedCoordinationType_(type);
-
- if (type != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType type) {
- EclipseLinkCacheCoordinationType old = this.specifiedCoordinationType;
- this.specifiedCoordinationType = type;
- this.firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, old, type);
- }
-
- public EclipseLinkCacheCoordinationType getDefaultCoordinationType() {
- return DEFAULT_COORDINATION_TYPE;
- }
-
-
- // ********** expiry **********
-
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer expiry) {
- this.getCacheAnnotation().setExpiry(expiry);
- this.setExpiry_(expiry);
-
- if (expiry != null) {
- this.removeExpiryTimeOfDayIfNecessary();
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setExpiry_(Integer expiry) {
- Integer old = this.expiry;
- this.expiry = expiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry);
- }
-
-
- // ********** expiry time of day **********
-
- public EclipseLinkTimeOfDay getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkTimeOfDay addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("expiry time of day already exists: " + this.expiryTimeOfDay); //$NON-NLS-1$
- }
- EclipseLinkTimeOfDayAnnotation timeOfDayAnnotation = this.getCacheAnnotation().addExpiryTimeOfDay();
- EclipseLinkJavaTimeOfDay timeOfDay = this.buildExpiryTimeOfDay(timeOfDayAnnotation);
- this.setExpiryTimeOfDay(timeOfDay);
-
- this.setExpiry(null);
- this.setSpecifiedShared(null);
-
- return timeOfDay;
- }
-
- public void removeExpiryTimeOfDay() {
- if (this.expiryTimeOfDay == null) {
- throw new IllegalStateException("expiry time of day does not exist"); //$NON-NLS-1$
- }
- this.removeExpiryTimeOfDay_();
- }
-
- protected void removeExpiryTimeOfDayIfNecessary() {
- if (this.expiryTimeOfDay != null) {
- this.removeExpiryTimeOfDay_();
- }
- }
-
- protected void removeExpiryTimeOfDay_() {
- this.getCacheAnnotation().removeExpiryTimeOfDay();
- this.setExpiryTimeOfDay(null);
- }
-
- public void setExpiryTimeOfDay(EclipseLinkJavaTimeOfDay timeOfDay) {
- EclipseLinkJavaTimeOfDay old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = timeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, timeOfDay);
- }
-
- protected void syncExpiryTimeOfDay(EclipseLinkTimeOfDayAnnotation timeOfDayAnnotation) {
- if (timeOfDayAnnotation == null) {
- if (this.expiryTimeOfDay != null) {
- this.setExpiryTimeOfDay(null);
- }
- } else {
- if ((this.expiryTimeOfDay != null) && (this.expiryTimeOfDay.getTimeOfDayAnnotation() == timeOfDayAnnotation)) {
- this.expiryTimeOfDay.synchronizeWithResourceModel();
- } else {
- this.setExpiryTimeOfDay(this.buildExpiryTimeOfDay(timeOfDayAnnotation));
- }
- }
- }
-
- protected EclipseLinkJavaTimeOfDay buildExpiryTimeOfDay(EclipseLinkTimeOfDayAnnotation timeOfDayAnnotation) {
- return (timeOfDayAnnotation == null) ? null : new EclipseLinkJavaTimeOfDay(this, timeOfDayAnnotation);
- }
-
-
- // ********** existence checking **********
-
- public boolean isExistenceChecking() {
- return this.existenceChecking;
- }
-
- public void setExistenceChecking(boolean existenceChecking) {
- if (existenceChecking != this.existenceChecking) {
- if (existenceChecking) {
- this.addExistenceCheckingAnnotation();
- } else {
- this.removeExistenceCheckingAnnotation();
- this.setSpecifiedExistenceType(null);
- }
- this.setExistenceChecking_(existenceChecking);
- }
- }
-
- protected void setExistenceChecking_(boolean existenceChecking) {
- boolean old = this.existenceChecking;
- this.existenceChecking = existenceChecking;
- this.firePropertyChanged(EXISTENCE_CHECKING_PROPERTY, old, existenceChecking);
- }
-
-
- // ********** existence type **********
-
- public EclipseLinkExistenceType getExistenceType() {
- return (this.specifiedExistenceType != null) ? this.specifiedExistenceType : this.defaultExistenceType;
- }
-
- public EclipseLinkExistenceType getSpecifiedExistenceType() {
- return this.specifiedExistenceType;
- }
-
- public void setSpecifiedExistenceType(EclipseLinkExistenceType type) {
- if (this.valuesAreDifferent(type, this.specifiedExistenceType)) {
- if (type != null) {
- this.setExistenceChecking(true);
- }
- this.getExistenceCheckingAnnotation().setValue(EclipseLinkExistenceType.toJavaResourceModel(type));
- this.setSpecifiedExistenceType_(type);
- }
- }
-
- protected void setSpecifiedExistenceType_(EclipseLinkExistenceType type) {
- EclipseLinkExistenceType old = this.specifiedExistenceType;
- this.specifiedExistenceType = type;
- this.firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkExistenceType buildSpecifiedExistenceType(EclipseLinkExistenceCheckingAnnotation ecAnnotation) {
- return (ecAnnotation == null) ? null : EclipseLinkExistenceType.fromJavaResourceModel(ecAnnotation.getValue());
- }
-
- public EclipseLinkExistenceType getDefaultExistenceType() {
- return this.defaultExistenceType;
- }
-
- protected void setDefaultExistenceType(EclipseLinkExistenceType type) {
- EclipseLinkExistenceType old = this.defaultExistenceType;
- this.defaultExistenceType = type;
- this.firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkExistenceType buildDefaultExistenceType() {
- return this.existenceChecking ? EclipseLinkExistenceType.CHECK_CACHE : DEFAULT_EXISTENCE_TYPE;
- }
-
-
- // ********** cacheable **********
-
- public JavaCacheable2_0 getCacheable() {
- return this.cacheable;
- }
-
- public boolean calculateDefaultCacheable() {
- CacheableHolder2_0 superCacheableHolder = this.getCacheableSuperPersistentType(this.getPersistentType());
- return (superCacheableHolder != null) ?
- superCacheableHolder.getCacheable().isCacheable() :
- ((PersistenceUnit2_0) this.getPersistenceUnit()).calculateDefaultCacheable();
- }
-
- protected CacheableHolder2_0 getCacheableSuperPersistentType(PersistentType persistentType) {
- PersistentType superPersistentType = persistentType.getSuperPersistentType();
- if (superPersistentType == null) {
- return null;
- }
- TypeMapping superMapping = superPersistentType.getMapping();
- return (superMapping instanceof CacheableHolder2_0) ?
- (CacheableHolder2_0) superMapping :
- this.getCacheableSuperPersistentType(superPersistentType); // recurse
- }
-
- protected JavaCacheable2_0 buildCacheable() {
- return this.isJpa2_0Compatible() ?
- this.getJpaFactory2_0().buildJavaCacheable(this) :
- new NullJavaCacheable2_0(this);
- }
-
-
- // ********** isolation **********
-
- public EclipseLinkCacheIsolationType2_2 getIsolation() {
- return (this.specifiedIsolation != null) ? this.specifiedIsolation : this.getDefaultIsolation();
- }
-
- public EclipseLinkCacheIsolationType2_2 getSpecifiedIsolation() {
- return this.specifiedIsolation;
- }
-
- public void setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2 isolation) {
- this.getCacheAnnotation().setIsolation(EclipseLinkCacheIsolationType2_2.toJavaResourceModel(isolation));
- this.setSpecifiedIsolation_(isolation);
-
- if (isolation != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedIsolation_(EclipseLinkCacheIsolationType2_2 isolation) {
- EclipseLinkCacheIsolationType2_2 old = this.specifiedIsolation;
- this.specifiedIsolation = isolation;
- this.firePropertyChanged(SPECIFIED_ISOLATION_PROPERTY, old, isolation);
- }
-
- public EclipseLinkCacheIsolationType2_2 getDefaultIsolation() {
- return DEFAULT_ISOLATION;
- }
-
- // ********** cache annotation **********
-
- protected EclipseLinkCacheAnnotation getCacheAnnotation() {
- return (EclipseLinkCacheAnnotation) this.getJavaResourceType().getNonNullAnnotation(this.getCacheAnnotationName());
- }
-
- protected String getCacheAnnotationName() {
- return EclipseLinkCacheAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** existence checking annotation **********
-
- protected EclipseLinkExistenceCheckingAnnotation getExistenceCheckingAnnotation() {
- return (EclipseLinkExistenceCheckingAnnotation) this.getJavaResourceType().getAnnotation(this.getExistenceCheckingAnnotationName());
- }
-
- protected EclipseLinkExistenceCheckingAnnotation addExistenceCheckingAnnotation() {
- return (EclipseLinkExistenceCheckingAnnotation) this.getJavaResourceType().addAnnotation(this.getExistenceCheckingAnnotationName());
- }
-
- protected void removeExistenceCheckingAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getExistenceCheckingAnnotationName());
- }
-
- protected String getExistenceCheckingAnnotationName() {
- return EclipseLinkExistenceCheckingAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (JavaEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaPersistentType getPersistentType() {
- return this.getTypeMapping().getPersistentType();
- }
-
- public JavaResourceType getJavaResourceType() {
- return this.getTypeMapping().getJavaResourceType();
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateExpiry(messages, astRoot);
- }
-
- protected void validateExpiry(List<IMessage> messages, CompilationUnit astRoot) {
- if ((this.expiry != null) && (this.expiryTimeOfDay != null)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CACHE_EXPIRY_AND_EXPIRY_TIME_OF_DAY_BOTH_SPECIFIED,
- new String[] {this.getPersistentType().getName()},
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getCacheAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java
deleted file mode 100644
index b391bc8ddf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkChangeTracking.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-public class JavaEclipseLinkChangeTracking
- extends AbstractJavaJpaContextNode
- implements EclipseLinkChangeTracking
-{
- protected EclipseLinkChangeTrackingType specifiedType;
-
-
- public JavaEclipseLinkChangeTracking(JavaTypeMapping parent) {
- super(parent);
- this.specifiedType = this.buildSpecifiedType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedType_(this.buildSpecifiedType());
- }
-
-
- // ********** type **********
-
- public EclipseLinkChangeTrackingType getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
- }
-
- public EclipseLinkChangeTrackingType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkChangeTrackingType type) {
- if (this.valuesAreDifferent(type, this.specifiedType)) {
- EclipseLinkChangeTrackingAnnotation annotation = this.getChangeTrackingAnnotation();
- if (type == null) {
- if (annotation != null) {
- this.removeChangeTrackingAnnotation();
- }
- } else {
- if (annotation == null) {
- annotation = this.addChangeTrackingAnnotation();
- }
- annotation.setValue(EclipseLinkChangeTrackingType.toJavaResourceModel(type));
- }
- this.setSpecifiedType_(type);
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkChangeTrackingType type) {
- EclipseLinkChangeTrackingType old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkChangeTrackingType buildSpecifiedType() {
- EclipseLinkChangeTrackingAnnotation annotation = this.getChangeTrackingAnnotation();
- if (annotation == null) {
- return null;
- }
- ChangeTrackingType value = annotation.getValue();
- return (value == null) ? DEFAULT_TYPE : EclipseLinkChangeTrackingType.fromJavaResourceModel(value);
- }
-
- public EclipseLinkChangeTrackingType getDefaultType() {
- return DEFAULT_TYPE;
- }
-
-
- // ********** change tracking annotation **********
-
- protected EclipseLinkChangeTrackingAnnotation getChangeTrackingAnnotation() {
- return (EclipseLinkChangeTrackingAnnotation) this.getJavaResourceType().getAnnotation(this.getChangeTrackingAnnotationName());
- }
-
- protected EclipseLinkChangeTrackingAnnotation addChangeTrackingAnnotation() {
- return (EclipseLinkChangeTrackingAnnotation) this.getJavaResourceType().addAnnotation(this.getChangeTrackingAnnotationName());
- }
-
- protected void removeChangeTrackingAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getChangeTrackingAnnotationName());
- }
-
- protected String getChangeTrackingAnnotationName() {
- return EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaTypeMapping getParent() {
- return (JavaTypeMapping) super.getParent();
- }
-
- protected JavaTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaPersistentType getPersistentType() {
- return this.getTypeMapping().getPersistentType();
- }
-
- protected JavaResourceType getJavaResourceType() {
- return this.getPersistentType().getJavaResourceType();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkChangeTrackingAnnotation annotation = this.getChangeTrackingAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java
deleted file mode 100644
index 41c83ced16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConversionValue.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkConversionValue
- extends AbstractJavaJpaContextNode
- implements EclipseLinkConversionValue
-{
- private final EclipseLinkConversionValueAnnotation conversionValueAnnotation;
-
- private String dataValue;
-
- private String objectValue;
-
-
- public JavaEclipseLinkConversionValue(JavaEclipseLinkObjectTypeConverter parent, EclipseLinkConversionValueAnnotation conversionValueAnnotation) {
- super(parent);
- this.conversionValueAnnotation = conversionValueAnnotation;
- this.dataValue = conversionValueAnnotation.getDataValue();
- this.objectValue = conversionValueAnnotation.getObjectValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataValue_(this.conversionValueAnnotation.getDataValue());
- this.setObjectValue_(this.conversionValueAnnotation.getObjectValue());
- }
-
-
- // ********** data value **********
-
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String value) {
- this.conversionValueAnnotation.setDataValue(value);
- this.setDataValue_(value);
- }
-
- protected void setDataValue_(String value) {
- String old = this.dataValue;
- this.dataValue = value;
- this.firePropertyChanged(DATA_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** object value **********
-
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String value) {
- this.conversionValueAnnotation.setObjectValue(value);
- this.setObjectValue_(value);
- }
-
- protected void setObjectValue_(String value) {
- String old = this.objectValue;
- this.objectValue = value;
- this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkObjectTypeConverter getParent() {
- return (JavaEclipseLinkObjectTypeConverter) super.getParent();
- }
-
- protected JavaEclipseLinkObjectTypeConverter getObjectTypeConverter() {
- return this.getParent();
- }
-
- public EclipseLinkConversionValueAnnotation getConversionValueAnnotation() {
- return this.conversionValueAnnotation;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- }
-
- public TextRange getDataValueTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.conversionValueAnnotation.getDataValueTextRange(), astRoot);
- }
-
- protected TextRange getObjectValueTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.conversionValueAnnotation.getObjectValueTextRange(), astRoot);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.conversionValueAnnotation.getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getObjectTypeConverter().getValidationTextRange(astRoot);
- }
-
- public boolean isEquivalentTo(EclipseLinkConversionValue conversionValue) {
- return Tools.valuesAreEqual(this.dataValue, conversionValue.getDataValue()) &&
- Tools.valuesAreEqual(this.objectValue, conversionValue.getObjectValue());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java
deleted file mode 100644
index 5704051483..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConvert.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.Arrays;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.ConverterTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.AbstractJavaConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkConvertValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-public class JavaEclipseLinkConvert
- extends AbstractJavaConverter
- implements EclipseLinkConvert
-{
- private final EclipseLinkConvertAnnotation convertAnnotation;
-
- private String specifiedConverterName;
- private String defaultConverterName;
-
-
- public JavaEclipseLinkConvert(JavaAttributeMapping parent, EclipseLinkConvertAnnotation convertAnnotation, JavaConverter.Owner owner) {
- super(parent, owner);
- this.convertAnnotation = convertAnnotation;
- this.specifiedConverterName = convertAnnotation.getValue();
- }
-
- public EclipseLinkConvertAnnotation getConverterAnnotation() {
- return this.convertAnnotation;
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedConverterName_(this.convertAnnotation.getValue());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultConverterName(this.buildDefaultConverterName());
- }
-
-
- // ********** converter name **********
-
- public String getConverterName() {
- return (this.specifiedConverterName != null) ? this.specifiedConverterName : this.defaultConverterName;
- }
-
- public String getSpecifiedConverterName() {
- return this.specifiedConverterName;
- }
-
- public void setSpecifiedConverterName(String name) {
- this.convertAnnotation.setValue(name);
- this.setSpecifiedConverterName_(name);
- }
-
- protected void setSpecifiedConverterName_(String name) {
- String old = this.specifiedConverterName;
- this.specifiedConverterName = name;
- this.firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultConverterName() {
- return this.defaultConverterName;
- }
-
- protected void setDefaultConverterName(String name) {
- String old = this.defaultConverterName;
- this.defaultConverterName = name;
- this.firePropertyChanged(DEFAULT_CONVERTER_NAME_PROPERTY, old, name);
- }
-
- protected String buildDefaultConverterName() {
- return DEFAULT_CONVERTER_NAME;
- }
-
-
- // ********** misc **********
-
- public Class<? extends Converter> getType() {
- return EclipseLinkConvert.class;
- }
-
- /**
- * Return whether the convert is <em>virtual</em> and, as a result, does
- * not have a converter.
- */
- protected boolean isVirtual() {
- return this.getAttributeMapping().getPersistentAttribute().isVirtual();
- }
-
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- if (this.convertValueTouches(pos)) {
- result = this.getJavaCandidateConverterNames(filter);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-
- protected boolean convertValueTouches(int pos) {
- return this.convertAnnotation.valueTouches(pos);
- }
-
- protected Iterable<String> getJavaCandidateConverterNames(Filter<String> filter) {
- return StringTools.convertToJavaStringLiterals(this.getCandidateConverterNames(filter));
- }
-
- protected Iterable<String> getCandidateConverterNames(Filter<String> filter) {
- return new FilteringIterable<String>(this.getConverterNames(), filter);
- }
-
- /**
- * @return names of the user-defined converters and of reserved converters
- */
- @SuppressWarnings("unchecked")
- protected Iterable<String> getConverterNames() {
- return new CompositeIterable<String>(
- this.getPersistenceUnit().getUniqueConverterNames(),
- Arrays.asList(EclipseLinkConvert.RESERVED_CONVERTER_NAMES)
- );
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-
- // ********** adapter **********
-
- public static class Adapter
- extends JavaConverter.AbstractAdapter
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<? extends Converter> getConverterType() {
- return EclipseLinkConvert.class;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkConvertAnnotation.ANNOTATION_NAME;
- }
-
- public JavaConverter buildConverter(Annotation converterAnnotation, JavaAttributeMapping parent, JpaFactory factory) {
- return new JavaEclipseLinkConvert(parent, (EclipseLinkConvertAnnotation) converterAnnotation, this.buildOwner());
- }
-
- @Override
- protected Owner buildOwner() {
- return new Owner() {
- public JptValidator buildValidator(Converter converter, ConverterTextRangeResolver textRangeResolver) {
- return new EclipseLinkConvertValidator((EclipseLinkConvert) converter, textRangeResolver);
- }
- };
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java
deleted file mode 100644
index 0b15ca6dce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverter.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * <code>
- * <ul>
- * <li>org.eclipse.persistence.annotations.Converter
- * <li>org.eclipse.persistence.annotations.StructConverter
- * <li>org.eclipse.persistence.annotations.ObjectTypeConverter
- * <li>org.eclipse.persistence.annotations.TypeConverter
- * </ul>
- * </code>
- */
-public abstract class JavaEclipseLinkConverter<A extends EclipseLinkNamedConverterAnnotation>
- extends AbstractJavaJpaContextNode
- implements EclipseLinkConverter
-{
- protected final A converterAnnotation;
-
- protected String name;
-
-
- protected JavaEclipseLinkConverter(JavaJpaContextNode parent, A converterAnnotation) {
- super(parent);
- this.converterAnnotation = converterAnnotation;
- this.name = converterAnnotation.getName();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setName_(this.converterAnnotation.getName());
- }
-
- @Override
- public void update() {
- super.update();
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.converterAnnotation.setName(name);
- this.setName_(name);
- }
-
- protected void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkConverterContainer getParent() {
- return (JavaEclipseLinkConverterContainer) super.getParent();
- }
-
- public A getConverterAnnotation() {
- return this.converterAnnotation;
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- public char getEnclosingTypeSeparator() {
- return '.';
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateName(messages, astRoot);
- }
-
- protected void validateName(List<IMessage> messages, CompilationUnit astRoot) {
- if (StringTools.stringIsEmpty(this.name)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_NAME_UNDEFINED,
- EMPTY_STRING_ARRAY,
- this,
- this.getNameTextRange(astRoot)
- )
- );
- return;
- }
-
- if (ArrayTools.contains(EclipseLinkConvert.RESERVED_CONVERTER_NAMES, this.name)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.RESERVED_CONVERTER_NAME,
- EMPTY_STRING_ARRAY,
- this,
- this.getNameTextRange(astRoot)
- )
- );
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.converterAnnotation.getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-
- public TextRange getNameTextRange(CompilationUnit astRoot){
- return this.getValidationTextRange(this.getConverterAnnotation().getNameTextRange(), astRoot);
- }
-
- public boolean isEquivalentTo(JpaNamedContextNode node) {
- return (this != node) &&
- (this.getType() == node.getType()) &&
- Tools.valuesAreEqual(this.name, node.getName());
- }
-
- // ********** metadata conversion **********
-
- public abstract void convertTo(OrmEclipseLinkConverterContainer ormConverterContainer);
-
- public abstract void delete();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterClassConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterClassConverter.java
deleted file mode 100644
index 549acbf736..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterClassConverter.java
+++ /dev/null
@@ -1,185 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterClassConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * <code>
- * <ul>
- * <li>org.eclipse.persistence.annotations.Converter
- * <li>org.eclipse.persistence.annotations.StructConverter
- * </ul>
- * </code>
- */
-public abstract class JavaEclipseLinkConverterClassConverter<A extends EclipseLinkNamedConverterAnnotation>
- extends JavaEclipseLinkConverter<A>
- implements EclipseLinkConverterClassConverter
-{
- private String converterClass;
-
-
- public JavaEclipseLinkConverterClassConverter(JavaJpaContextNode parent, A converterAnnotation, String converterClass) {
- super(parent, converterAnnotation);
- this.converterClass = converterClass;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setConverterClass_(this.getAnnotationConverterClass());
- }
-
-
- // ********** converter class **********
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String converterClass) {
- this.setAnnotationConverterClass(converterClass);
- this.setConverterClass_(converterClass);
- }
-
- protected void setConverterClass_(String converterClass) {
- String old = this.converterClass;
- this.converterClass = converterClass;
- this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, old, converterClass);
- }
-
- protected abstract String getAnnotationConverterClass();
-
- protected abstract void setAnnotationConverterClass(String converterClass);
-
-
- // ********** JDT IType **********
-
- /**
- * Add <code>null</code> check.
- */
- protected boolean typeExists(String typeName) {
- return (typeName != null) &&
- (JDTTools.findType(this.getJavaProject(), typeName) != null);
- }
-
- /**
- * Add <code>null</code> check.
- */
- protected boolean typeImplementsInterface(String typeName, String interfaceName) {
- return (typeName != null) &&
- JDTTools.typeIsSubType(this.getJavaProject(), typeName, interfaceName);
- }
-
-
- //************ validation ***************
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateConverterClass(messages, astRoot);
- }
-
- protected void validateConverterClass(List<IMessage> messages, CompilationUnit astRoot) {
- if (this.converterClass == null) {
- // the annotation will have a compile error if its converter class is missing
- return;
- }
-
- if (StringTools.stringIsEmpty(this.converterClass)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_CLASS_DEFINED,
- this,
- this.getConverterClassTextRange(astRoot)
- )
- );
- return;
- }
-
- if ( ! this.converterClassExists()) {
- this.addConverterClassDoesNotExistMessageTo(messages, astRoot);
- return;
- }
-
- if ( ! this.converterClassImplementsInterface(this.getEclipseLinkConverterInterface())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getEclipseLinkConverterInterfaceErrorMessage(),
- new String[] {this.getFullyQualifiedConverterClass()},
- this,
- this.getConverterClassTextRange(astRoot)
- )
- );
- }
- }
-
- protected void addConverterClassDoesNotExistMessageTo(List<IMessage> messages, CompilationUnit astRoot) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_CLASS_EXISTS,
- new String[] {this.getFullyQualifiedConverterClass()},
- this,
- this.getConverterClassTextRange(astRoot)
- )
- );
- }
-
- /**
- * Return the name of the EclipseLink interface the converter class must
- * implement.
- */
- protected abstract String getEclipseLinkConverterInterface();
-
- protected abstract String getEclipseLinkConverterInterfaceErrorMessage();
-
- protected boolean converterClassExists() {
- return this.typeExists(this.getFullyQualifiedConverterClass());
- }
-
- protected boolean converterClassImplementsInterface(String interfaceName) {
- return this.typeImplementsInterface(this.getFullyQualifiedConverterClass(), interfaceName);
- }
-
- protected TextRange getConverterClassTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.getAnnotationConverterClassTextRange(), astRoot);
- }
-
- protected abstract TextRange getAnnotationConverterClassTextRange();
-
- @Override
- public boolean isEquivalentTo(JpaNamedContextNode node) {
- return super.isEquivalentTo(node)
- && this.isEquivalentTo((EclipseLinkConverterClassConverter) node);
- }
-
- protected boolean isEquivalentTo(EclipseLinkConverterClassConverter converter) {
- return Tools.valuesAreEqual(this.getFullyQualifiedConverterClass(), converter.getFullyQualifiedConverterClass());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java
deleted file mode 100644
index 48f7bce159..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkConverterContainerImpl.java
+++ /dev/null
@@ -1,474 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkConverterContainerImpl
- extends AbstractJavaJpaContextNode
- implements JavaEclipseLinkConverterContainer
-{
- protected final ParentAdapter parentAdapter;
-
- protected final ContextListContainer<JavaEclipseLinkCustomConverter, EclipseLinkConverterAnnotation> customConverterContainer;
- protected final ContextListContainer<JavaEclipseLinkObjectTypeConverter, EclipseLinkObjectTypeConverterAnnotation> objectTypeConverterContainer;
- protected final ContextListContainer<JavaEclipseLinkStructConverter, EclipseLinkStructConverterAnnotation> structConverterContainer;
- protected final ContextListContainer<JavaEclipseLinkTypeConverter, EclipseLinkTypeConverterAnnotation> typeConverterContainer;
-
-
- public JavaEclipseLinkConverterContainerImpl(ParentAdapter parentAdapter) {
- super(parentAdapter.getConverterContainerParent());
- this.parentAdapter = parentAdapter;
- this.customConverterContainer = this.buildCustomConverterContainer();
- this.objectTypeConverterContainer = this.buildObjectTypeConverterContainer();
- this.structConverterContainer = this.buildStructConverterContainer();
- this.typeConverterContainer = this.buildTypeConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncCustomConverters();
- this.syncObjectTypeConverters();
- this.syncStructConverters();
- this.syncTypeConverters();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getCustomConverters());
- this.updateNodes(this.getObjectTypeConverters());
- this.updateNodes(this.getStructConverters());
- this.updateNodes(this.getTypeConverters());
- }
-
-
- // ********** custom converters **********
-
- public ListIterable<JavaEclipseLinkCustomConverter> getCustomConverters() {
- return this.customConverterContainer.getContextElements();
- }
-
- public int getCustomConvertersSize() {
- return this.customConverterContainer.getContextElementsSize();
- }
-
- public JavaEclipseLinkCustomConverter addCustomConverter() {
- return this.addCustomConverter(this.getCustomConvertersSize());
- }
-
- public JavaEclipseLinkCustomConverter addCustomConverter(int index) {
- EclipseLinkConverterAnnotation annotation = this.addCustomConverterAnnotation(index);
- return this.customConverterContainer.addContextElement(index, annotation);
- }
-
- protected EclipseLinkConverterAnnotation addCustomConverterAnnotation(int index) {
- return (EclipseLinkConverterAnnotation) this.getJavaResourceAnnotatedElement().addAnnotation(index, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- }
-
- public void removeCustomConverter(EclipseLinkCustomConverter customConverter) {
- this.removeCustomConverter(this.customConverterContainer.indexOfContextElement((JavaEclipseLinkCustomConverter) customConverter));
- }
-
- public void removeCustomConverter(int index) {
- this.getJavaResourceAnnotatedElement().removeAnnotation(index, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- this.customConverterContainer.removeContextElement(index);
- }
-
- public void moveCustomConverter(int targetIndex, int sourceIndex) {
- this.getJavaResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- this.customConverterContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected JavaEclipseLinkCustomConverter buildCustomConverter(EclipseLinkConverterAnnotation converterAnnotation) {
- return new JavaEclipseLinkCustomConverter(this, converterAnnotation);
- }
-
- protected void syncCustomConverters() {
- this.customConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<EclipseLinkConverterAnnotation> getCustomConverterAnnotations() {
- return this.parentAdapter.parentSupportsConverters() ?
- new SubListIterableWrapper<NestableAnnotation, EclipseLinkConverterAnnotation>(this.getNestableCustomConverterAnnotations_()) :
- EmptyListIterable.<EclipseLinkConverterAnnotation>instance();
- }
-
- protected ListIterable<NestableAnnotation> getNestableCustomConverterAnnotations_() {
- return this.getJavaResourceAnnotatedElement().getAnnotations(EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- }
-
- protected ContextListContainer<JavaEclipseLinkCustomConverter, EclipseLinkConverterAnnotation> buildCustomConverterContainer() {
- CustomConverterContainer container = new CustomConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * custom converter container
- */
- protected class CustomConverterContainer
- extends ContextListContainer<JavaEclipseLinkCustomConverter, EclipseLinkConverterAnnotation>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return CUSTOM_CONVERTERS_LIST;
- }
- @Override
- protected JavaEclipseLinkCustomConverter buildContextElement(EclipseLinkConverterAnnotation resourceElement) {
- return JavaEclipseLinkConverterContainerImpl.this.buildCustomConverter(resourceElement);
- }
- @Override
- protected ListIterable<EclipseLinkConverterAnnotation> getResourceElements() {
- return JavaEclipseLinkConverterContainerImpl.this.getCustomConverterAnnotations();
- }
- @Override
- protected EclipseLinkConverterAnnotation getResourceElement(JavaEclipseLinkCustomConverter contextElement) {
- return contextElement.getConverterAnnotation();
- }
- }
-
- // ********** object type converters **********
-
- public ListIterable<JavaEclipseLinkObjectTypeConverter> getObjectTypeConverters() {
- return this.objectTypeConverterContainer.getContextElements();
- }
-
- public int getObjectTypeConvertersSize() {
- return this.objectTypeConverterContainer.getContextElementsSize();
- }
-
- public JavaEclipseLinkObjectTypeConverter addObjectTypeConverter() {
- return this.addObjectTypeConverter(this.getObjectTypeConvertersSize());
- }
-
- public JavaEclipseLinkObjectTypeConverter addObjectTypeConverter(int index) {
- EclipseLinkObjectTypeConverterAnnotation annotation = this.addObjectTypeConverterAnnotation(index);
- return this.objectTypeConverterContainer.addContextElement(index, annotation);
- }
-
- protected EclipseLinkObjectTypeConverterAnnotation addObjectTypeConverterAnnotation(int index) {
- return (EclipseLinkObjectTypeConverterAnnotation) this.getJavaResourceAnnotatedElement().addAnnotation(index, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- }
-
- public void removeObjectTypeConverter(EclipseLinkObjectTypeConverter objectTypeConverter) {
- this.removeObjectTypeConverter(this.objectTypeConverterContainer.indexOfContextElement((JavaEclipseLinkObjectTypeConverter) objectTypeConverter));
- }
-
- public void removeObjectTypeConverter(int index) {
- this.getJavaResourceAnnotatedElement().removeAnnotation(index, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- this.objectTypeConverterContainer.removeContextElement(index);
- }
-
- public void moveObjectTypeConverter(int targetIndex, int sourceIndex) {
- this.getJavaResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- this.objectTypeConverterContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected JavaEclipseLinkObjectTypeConverter buildObjectTypeConverter(EclipseLinkObjectTypeConverterAnnotation converterAnnotation) {
- return new JavaEclipseLinkObjectTypeConverter(this, converterAnnotation);
- }
-
- protected void syncObjectTypeConverters() {
- this.objectTypeConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<EclipseLinkObjectTypeConverterAnnotation> getObjectTypeConverterAnnotations() {
- return this.parentAdapter.parentSupportsConverters() ?
- new SubListIterableWrapper<NestableAnnotation, EclipseLinkObjectTypeConverterAnnotation>(this.getNestableObjectTypeConverterAnnotations_()) :
- EmptyListIterable.<EclipseLinkObjectTypeConverterAnnotation>instance();
- }
-
- protected ListIterable<NestableAnnotation> getNestableObjectTypeConverterAnnotations_() {
- return this.getJavaResourceAnnotatedElement().getAnnotations(EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- }
-
- protected ContextListContainer<JavaEclipseLinkObjectTypeConverter, EclipseLinkObjectTypeConverterAnnotation> buildObjectTypeConverterContainer() {
- ObjectTypeConverterContainer container = new ObjectTypeConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * objectType converter container
- */
- protected class ObjectTypeConverterContainer
- extends ContextListContainer<JavaEclipseLinkObjectTypeConverter, EclipseLinkObjectTypeConverterAnnotation>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return OBJECT_TYPE_CONVERTERS_LIST;
- }
- @Override
- protected JavaEclipseLinkObjectTypeConverter buildContextElement(EclipseLinkObjectTypeConverterAnnotation resourceElement) {
- return JavaEclipseLinkConverterContainerImpl.this.buildObjectTypeConverter(resourceElement);
- }
- @Override
- protected ListIterable<EclipseLinkObjectTypeConverterAnnotation> getResourceElements() {
- return JavaEclipseLinkConverterContainerImpl.this.getObjectTypeConverterAnnotations();
- }
- @Override
- protected EclipseLinkObjectTypeConverterAnnotation getResourceElement(JavaEclipseLinkObjectTypeConverter contextElement) {
- return contextElement.getConverterAnnotation();
- }
- }
-
- // ********** struct converters **********
-
- public ListIterable<JavaEclipseLinkStructConverter> getStructConverters() {
- return this.structConverterContainer.getContextElements();
- }
-
- public int getStructConvertersSize() {
- return this.structConverterContainer.getContextElementsSize();
- }
-
- public JavaEclipseLinkStructConverter addStructConverter() {
- return this.addStructConverter(this.getStructConvertersSize());
- }
-
- public JavaEclipseLinkStructConverter addStructConverter(int index) {
- EclipseLinkStructConverterAnnotation annotation = this.addStructConverterAnnotation(index);
- return this.structConverterContainer.addContextElement(index, annotation);
- }
-
- protected EclipseLinkStructConverterAnnotation addStructConverterAnnotation(int index) {
- return (EclipseLinkStructConverterAnnotation) this.getJavaResourceAnnotatedElement().addAnnotation(index, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- }
-
- public void removeStructConverter(EclipseLinkStructConverter structConverter) {
- this.removeStructConverter(this.structConverterContainer.indexOfContextElement((JavaEclipseLinkStructConverter) structConverter));
- }
-
- public void removeStructConverter(int index) {
- this.getJavaResourceAnnotatedElement().removeAnnotation(index, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- this.structConverterContainer.removeContextElement(index);
- }
-
- public void moveStructConverter(int targetIndex, int sourceIndex) {
- this.getJavaResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- this.structConverterContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected JavaEclipseLinkStructConverter buildStructConverter(EclipseLinkStructConverterAnnotation converterAnnotation) {
- return new JavaEclipseLinkStructConverter(this, converterAnnotation);
- }
-
- protected void syncStructConverters() {
- this.structConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<EclipseLinkStructConverterAnnotation> getStructConverterAnnotations() {
- return this.parentAdapter.parentSupportsConverters() ?
- new SubListIterableWrapper<NestableAnnotation, EclipseLinkStructConverterAnnotation>(this.getNestableStructConverterAnnotations_()) :
- EmptyListIterable.<EclipseLinkStructConverterAnnotation>instance();
- }
-
- protected ListIterable<NestableAnnotation> getNestableStructConverterAnnotations_() {
- return this.getJavaResourceAnnotatedElement().getAnnotations(EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- }
-
- protected ContextListContainer<JavaEclipseLinkStructConverter, EclipseLinkStructConverterAnnotation> buildStructConverterContainer() {
- StructConverterContainer container = new StructConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * struct converter container
- */
- protected class StructConverterContainer
- extends ContextListContainer<JavaEclipseLinkStructConverter, EclipseLinkStructConverterAnnotation>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return STRUCT_CONVERTERS_LIST;
- }
- @Override
- protected JavaEclipseLinkStructConverter buildContextElement(EclipseLinkStructConverterAnnotation resourceElement) {
- return JavaEclipseLinkConverterContainerImpl.this.buildStructConverter(resourceElement);
- }
- @Override
- protected ListIterable<EclipseLinkStructConverterAnnotation> getResourceElements() {
- return JavaEclipseLinkConverterContainerImpl.this.getStructConverterAnnotations();
- }
- @Override
- protected EclipseLinkStructConverterAnnotation getResourceElement(JavaEclipseLinkStructConverter contextElement) {
- return contextElement.getConverterAnnotation();
- }
- }
-
-
- // ********** type converters **********
-
- public ListIterable<JavaEclipseLinkTypeConverter> getTypeConverters() {
- return this.typeConverterContainer.getContextElements();
- }
-
- public int getTypeConvertersSize() {
- return this.typeConverterContainer.getContextElementsSize();
- }
-
- public JavaEclipseLinkTypeConverter addTypeConverter() {
- return this.addTypeConverter(this.getTypeConvertersSize());
- }
-
- public JavaEclipseLinkTypeConverter addTypeConverter(int index) {
- EclipseLinkTypeConverterAnnotation annotation = this.addTypeConverterAnnotation(index);
- return this.typeConverterContainer.addContextElement(index, annotation);
- }
-
- protected EclipseLinkTypeConverterAnnotation addTypeConverterAnnotation(int index) {
- return (EclipseLinkTypeConverterAnnotation) this.getJavaResourceAnnotatedElement().addAnnotation(index, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- }
-
- public void removeTypeConverter(EclipseLinkTypeConverter typeConverter) {
- this.removeTypeConverter(this.typeConverterContainer.indexOfContextElement((JavaEclipseLinkTypeConverter) typeConverter));
- }
-
- public void removeTypeConverter(int index) {
- this.getJavaResourceAnnotatedElement().removeAnnotation(index, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- this.typeConverterContainer.removeContextElement(index);
- }
-
- public void moveTypeConverter(int targetIndex, int sourceIndex) {
- this.getJavaResourceAnnotatedElement().moveAnnotation(targetIndex, sourceIndex, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- this.typeConverterContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected JavaEclipseLinkTypeConverter buildTypeConverter(EclipseLinkTypeConverterAnnotation converterAnnotation) {
- return new JavaEclipseLinkTypeConverter(this, converterAnnotation);
- }
-
- protected void syncTypeConverters() {
- this.typeConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<EclipseLinkTypeConverterAnnotation> getTypeConverterAnnotations() {
- return this.parentAdapter.parentSupportsConverters() ?
- new SubListIterableWrapper<NestableAnnotation, EclipseLinkTypeConverterAnnotation>(this.getNestableTypeConverterAnnotations_()) :
- EmptyListIterable.<EclipseLinkTypeConverterAnnotation>instance();
- }
-
- protected ListIterable<NestableAnnotation> getNestableTypeConverterAnnotations_() {
- return this.getJavaResourceAnnotatedElement().getAnnotations(EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- }
-
- protected ContextListContainer<JavaEclipseLinkTypeConverter, EclipseLinkTypeConverterAnnotation> buildTypeConverterContainer() {
- TypeConverterContainer container = new TypeConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * type converter container
- */
- protected class TypeConverterContainer
- extends ContextListContainer<JavaEclipseLinkTypeConverter, EclipseLinkTypeConverterAnnotation>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return TYPE_CONVERTERS_LIST;
- }
- @Override
- protected JavaEclipseLinkTypeConverter buildContextElement(EclipseLinkTypeConverterAnnotation resourceElement) {
- return JavaEclipseLinkConverterContainerImpl.this.buildTypeConverter(resourceElement);
- }
- @Override
- protected ListIterable<EclipseLinkTypeConverterAnnotation> getResourceElements() {
- return JavaEclipseLinkConverterContainerImpl.this.getTypeConverterAnnotations();
- }
- @Override
- protected EclipseLinkTypeConverterAnnotation getResourceElement(JavaEclipseLinkTypeConverter contextElement) {
- return contextElement.getConverterAnnotation();
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaJpaContextNode getParent() {
- return (JavaJpaContextNode) super.getParent();
- }
-
- protected ParentAdapter getParentAdapter() {
- return this.parentAdapter;
- }
-
- protected JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getParentAdapter().getJavaResourceAnnotatedElement();
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.getCustomConverters(),
- this.getObjectTypeConverters(),
- this.getStructConverters(),
- this.getTypeConverters()
- );
- }
-
- public int getConvertersSize() {
- return this.getCustomConvertersSize()
- + this.getObjectTypeConvertersSize()
- + this.getStructConvertersSize()
- + this.getTypeConvertersSize();
- }
-
- public int getNumberSupportedConverters() {
- return Integer.MAX_VALUE;
- }
-
-
- // ********** validation **********
-
- /**
- * The converters are validated in the persistence unit.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit#validateConverters(List, IReporter)
- */
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- // converters are validated in the persistence unit
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getJavaResourceAnnotatedElement().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java
deleted file mode 100644
index 70b7d67957..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomConverter.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * <code>org.eclipse.persistence.annotations.Converter</code>
- */
-public class JavaEclipseLinkCustomConverter
- extends JavaEclipseLinkConverterClassConverter<EclipseLinkConverterAnnotation>
- implements EclipseLinkCustomConverter
-{
- private String fullyQualifiedConverterClass;
-
-
- public JavaEclipseLinkCustomConverter(JavaEclipseLinkConverterContainer parent, EclipseLinkConverterAnnotation converterAnnotation) {
- super(parent, converterAnnotation, converterAnnotation.getConverterClass());
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedConverterClass(this.converterAnnotation.getFullyQualifiedConverterClassName());
- }
-
-
- // ********** converter class **********
-
- @Override
- protected String getAnnotationConverterClass() {
- return this.converterAnnotation.getConverterClass();
- }
-
- @Override
- protected void setAnnotationConverterClass(String converterClass) {
- this.converterAnnotation.setConverterClass(converterClass);
- }
-
-
- // ********** fully qualified converter class **********
-
- public String getFullyQualifiedConverterClass() {
- return this.fullyQualifiedConverterClass;
- }
-
- protected void setFullyQualifiedConverterClass(String converterClass) {
- String old = this.fullyQualifiedConverterClass;
- this.fullyQualifiedConverterClass = converterClass;
- this.firePropertyChanged(FULLY_QUALIFIED_CONVERTER_CLASS_PROPERTY, old, converterClass);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkCustomConverter> getType() {
- return EclipseLinkCustomConverter.class;
- }
-
-
- //************ validation ***************
-
- @Override
- protected String getEclipseLinkConverterInterface() {
- return ECLIPSELINK_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected String getEclipseLinkConverterInterfaceErrorMessage() {
- return EclipseLinkJpaValidationMessages.CONVERTER_CLASS_IMPLEMENTS_CONVERTER;
- }
-
- @Override
- protected TextRange getAnnotationConverterClassTextRange() {
- return this.converterAnnotation.getConverterClassTextRange();
- }
-
- @Override
- protected void addConverterClassDoesNotExistMessageTo(List<IMessage> messages, CompilationUnit astRoot) {
- // no need to add message since there will already be a compiler error
- }
-
- // ********** metadata conversion **********
-
- @Override
- public void convertTo(OrmEclipseLinkConverterContainer ormConverterContainer) {
- ormConverterContainer.addCustomConverter().convertFrom(this);
- }
-
- @Override
- public void delete() {
- this.getParent().removeCustomConverter(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java
deleted file mode 100644
index 55c275757f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkCustomizer.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkCustomizer
- extends AbstractJavaJpaContextNode
- implements EclipseLinkCustomizer
-{
- private String specifiedCustomizerClass;
-
- private String fullyQualifiedCustomizerClass;
-
-
- public JavaEclipseLinkCustomizer(EclipseLinkJavaTypeMapping parent) {
- super(parent);
- this.specifiedCustomizerClass = this.buildSpecifiedCustomizerClass();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedCustomizerClass_(this.buildSpecifiedCustomizerClass());
- }
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedCustomizerClass(this.buildFullyQualifiedCustomizerClass());
- }
-
-
- // ********** customizer class **********
-
- public String getCustomizerClass() {
- return (this.specifiedCustomizerClass != null) ? this.specifiedCustomizerClass : null;
- }
-
- public String getSpecifiedCustomizerClass() {
- return this.specifiedCustomizerClass;
- }
-
- public void setSpecifiedCustomizerClass(String customizerClass) {
- if (this.valuesAreDifferent(customizerClass, this.specifiedCustomizerClass)) {
- EclipseLinkCustomizerAnnotation annotation = this.getCustomizerAnnotation();
- if (customizerClass == null) {
- if (annotation != null) {
- this.removeCustomizerAnnotation();
- }
- } else {
- if (annotation == null) {
- annotation = this.addCustomizerAnnotation();
- }
- annotation.setValue(customizerClass);
- }
-
- this.setSpecifiedCustomizerClass_(customizerClass);
- }
- }
-
- protected void setSpecifiedCustomizerClass_(String customizerClass) {
- String old = this.specifiedCustomizerClass;
- this.specifiedCustomizerClass = customizerClass;
- this.firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
- }
-
- protected String buildSpecifiedCustomizerClass() {
- EclipseLinkCustomizerAnnotation annotation = this.getCustomizerAnnotation();
- return (annotation == null) ? null : annotation.getValue();
- }
-
- public String getDefaultCustomizerClass() {
- return null; // no default for Java
- }
-
-
- // ********** fully-qualified customizer class **********
-
- public String getFullyQualifiedCustomizerClass() {
- return this.fullyQualifiedCustomizerClass;
- }
-
- protected void setFullyQualifiedCustomizerClass(String customizerClass) {
- String old = this.fullyQualifiedCustomizerClass;
- this.fullyQualifiedCustomizerClass = customizerClass;
- this.firePropertyChanged(FULLY_QUALIFIED_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
- }
-
- protected String buildFullyQualifiedCustomizerClass() {
- EclipseLinkCustomizerAnnotation annotation = this.getCustomizerAnnotation();
- return (annotation == null) ? null : annotation.getFullyQualifiedCustomizerClassName();
- }
-
-
- // ********** customizer annotation **********
-
- protected EclipseLinkCustomizerAnnotation getCustomizerAnnotation() {
- return (EclipseLinkCustomizerAnnotation) this.getJavaResourceType().getAnnotation(this.getCustomizerAnnotationName());
- }
-
- protected EclipseLinkCustomizerAnnotation addCustomizerAnnotation() {
- return (EclipseLinkCustomizerAnnotation) this.getJavaResourceType().addAnnotation(this.getCustomizerAnnotationName());
- }
-
- protected void removeCustomizerAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getCustomizerAnnotationName());
- }
-
- protected String getCustomizerAnnotationName() {
- return EclipseLinkCustomizerAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public EclipseLinkJavaTypeMapping getParent() {
- return (EclipseLinkJavaTypeMapping) super.getParent();
- }
-
- protected EclipseLinkJavaTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaResourceType getJavaResourceType() {
- return this.getTypeMapping().getJavaResourceType();
- }
-
- public char getCustomizerClassEnclosingTypeSeparator() {
- return '.';
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.validateCustomizerClass(messages, astRoot);
- }
-
- protected void validateCustomizerClass(List<IMessage> messages,CompilationUnit astRoot) {
- if (this.getFullyQualifiedCustomizerClass() == null) {
- return;
- }
- //if the type cannot be resolved there is no need to perform the following validation,
- //JDT will note the error in the source
- IType customizerJdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedCustomizerClass());
- if (customizerJdtType == null) {
- return;
- }
- if (!JDTTools.typeHasPublicZeroArgConstructor(customizerJdtType)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID,
- new String[] {this.getFullyQualifiedCustomizerClass()},
- this,
- this.getCustomizerClassTextRange(astRoot)
- )
- );
- }
- EclipseLinkCustomizerAnnotation annotation = this.getCustomizerAnnotation();
- if (!annotation.customizerClassImplementsInterface(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME, astRoot)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER,
- new String[] {this.getFullyQualifiedCustomizerClass()},
- this,
- this.getCustomizerClassTextRange(astRoot)
- )
- );
- }
- }
-
- protected TextRange getCustomizerClassTextRange(CompilationUnit astRoot) {
- return this.getValidationTextRange(this.getCustomizerAnnotation().getValueTextRange(), astRoot);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getCustomizerAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java
deleted file mode 100644
index f2ba879a37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.java.AbstractJavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-
-public class JavaEclipseLinkElementCollectionMapping2_0
- extends AbstractJavaElementCollectionMapping2_0
- implements EclipseLinkElementCollectionMapping2_0, EclipseLinkJavaConvertibleMapping
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- public JavaEclipseLinkElementCollectionMapping2_0(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- this.converterContainer.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<JavaConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<JavaConverter.Adapter>(
- JavaEclipseLinkConvert.Adapter.instance(),
- super.getConverterAdapters()
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java
deleted file mode 100644
index aa64876362..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddableImpl.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * Java embeddable type mapping
- */
-public class JavaEclipseLinkEmbeddableImpl
- extends AbstractJavaEmbeddable
- implements JavaEclipseLinkEmbeddable, JavaEclipseLinkConverterContainer.ParentAdapter
-{
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- protected final JavaEclipseLinkChangeTracking changeTracking;
-
- protected final JavaEclipseLinkCustomizer customizer;
-
-
- public JavaEclipseLinkEmbeddableImpl(JavaPersistentType parent, EmbeddableAnnotation mappingAnnotation) {
- super(parent, mappingAnnotation);
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- }
-
-
- // ********** converter container **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new CompositeIterable<EclipseLinkConverter>(this.getAttributeMappingConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getAttributeMappingConverterLists() {
- return new TransformationIterable<AttributeMapping, Iterable<EclipseLinkConverter>>(
- this.getAttributeMappings(),
- ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER
- );
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected JavaEclipseLinkChangeTracking buildChangeTracking() {
- return new JavaEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected JavaEclipseLinkCustomizer buildCustomizer() {
- return new JavaEclipseLinkCustomizer(this);
- }
-
-
- // ********** misc **********
-
- public boolean usesPrimaryKeyColumns() {
- return false;
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- return false;
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getJavaResourceType();
- }
-
- public boolean parentSupportsConverters() {
- return true;
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.converterContainer.validate(messages, reporter, astRoot);
- this.changeTracking.validate(messages, reporter, astRoot);
- this.customizer.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator(CompilationUnit astRoot) {
- return new EclipseLinkTypeMappingValidator(this, this.getJavaResourceType(), this.buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedIdMapping.java
deleted file mode 100644
index e10d1b5823..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedIdMapping.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-
-/**
- * Java embedded ID mapping
- */
-public class JavaEclipseLinkEmbeddedIdMapping
- extends AbstractJavaEmbeddedIdMapping
- implements EclipseLinkJavaConvertibleMapping
-{
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- public JavaEclipseLinkEmbeddedIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedMapping.java
deleted file mode 100644
index 017f7c0f92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEmbeddedMapping.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-
-public class JavaEclipseLinkEmbeddedMapping
- extends AbstractJavaEmbeddedMapping
- implements EclipseLinkJavaConvertibleMapping
-{
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- public JavaEclipseLinkEmbeddedMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java
deleted file mode 100644
index bf03953941..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkEntityImpl.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEntity;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkEntityPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * Java entity
- */
-public class JavaEclipseLinkEntityImpl
- extends AbstractJavaEntity
- implements JavaEclipseLinkEntity, JavaEclipseLinkConverterContainer.ParentAdapter
-{
- protected final JavaEclipseLinkCaching caching;
-
- protected final JavaEclipseLinkReadOnly readOnly;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- protected final JavaEclipseLinkChangeTracking changeTracking;
-
- protected final JavaEclipseLinkCustomizer customizer;
-
- protected final JavaEclipseLinkMultitenancy2_3 multitenancy;
-
- public JavaEclipseLinkEntityImpl(JavaPersistentType parent, EntityAnnotation mappingAnnotation) {
- super(parent, mappingAnnotation);
- this.caching = this.buildCaching();
- this.readOnly = this.buildReadOnly();
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- this.multitenancy = this.buildMultitenancy();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.caching.synchronizeWithResourceModel();
- this.readOnly.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- this.multitenancy.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.caching.update();
- this.readOnly.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- this.multitenancy.update();
- }
-
-
- // ********** caching **********
-
- public JavaEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- protected JavaEclipseLinkCaching buildCaching() {
- return new JavaEclipseLinkCachingImpl(this);
- }
-
-
- // ********** read-only **********
-
- public EclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- protected JavaEclipseLinkReadOnly buildReadOnly() {
- return new JavaEclipseLinkReadOnly(this);
- }
-
-
- // ********** converter container **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new CompositeIterable<EclipseLinkConverter>(this.getAttributeMappingConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getAttributeMappingConverterLists() {
- return new TransformationIterable<AttributeMapping, Iterable<EclipseLinkConverter>>(
- this.getAttributeMappings(),
- ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER
- );
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected JavaEclipseLinkChangeTracking buildChangeTracking() {
- return new JavaEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected JavaEclipseLinkCustomizer buildCustomizer() {
- return new JavaEclipseLinkCustomizer(this);
- }
-
-
- // ********** multitenancy **********
-
- public JavaEclipseLinkMultitenancy2_3 getMultitenancy() {
- return this.multitenancy;
- }
-
- protected JavaEclipseLinkMultitenancy2_3 buildMultitenancy() {
- return this.isEclipseLink2_3Compatible() ?
- new JavaEclipseLinkMultitenancyImpl2_3(this) :
- new NullJavaEclipseLinkMultitenancy2_3(this);
- }
-
- protected boolean isEclipseLink2_3Compatible() {
- return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this);
- }
-
- public boolean isMultitenantMetadataAllowed() {
- return this.isRootEntity() || this.isInheritanceStrategyTablePerClass();
- }
-
- protected boolean isInheritanceStrategyTablePerClass() {
- return this.getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS;
- }
-
-
- // ********** discriminator column **********
-
- @Override
- protected boolean buildSpecifiedDiscriminatorColumnIsAllowed() {
- return super.buildSpecifiedDiscriminatorColumnIsAllowed() && ! this.classExtractorIsSpecified();
- }
-
- protected boolean classExtractorIsSpecified() {
- return this.getClassExtractorAnnotation() != null;
- }
-
- protected EclipseLinkClassExtractorAnnotation2_1 getClassExtractorAnnotation() {
- return (EclipseLinkClassExtractorAnnotation2_1) this.getJavaResourceType().getAnnotation(EclipseLinkClassExtractorAnnotation2_1.ANNOTATION_NAME);
- }
-
-
- // ********** misc **********
-
- public boolean usesPrimaryKeyColumns() {
- return this.getJavaResourceType().getAnnotation(EclipseLink.PRIMARY_KEY) != null;
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- return getMultitenancy().usesPrimaryKeyTenantDiscriminatorColumns();
- }
-
- public JavaCacheable2_0 getCacheable() {
- return ((JavaCacheableHolder2_0) this.getCaching()).getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return ((JavaCacheableHolder2_0) this.getCaching()).calculateDefaultCacheable();
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getJavaResourceType();
- }
-
- public boolean parentSupportsConverters() {
- return true;
- }
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.multitenancy.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.caching.validate(messages, reporter, astRoot);
- this.readOnly.validate(messages, reporter, astRoot);
- this.converterContainer.validate(messages, reporter, astRoot);
- this.changeTracking.validate(messages, reporter, astRoot);
- this.customizer.validate(messages, reporter, astRoot);
- this.multitenancy.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected JptValidator buildPrimaryKeyValidator(CompilationUnit astRoot) {
- return new EclipseLinkEntityPrimaryKeyValidator(this, this.buildTextRangeResolver(astRoot));
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator(CompilationUnit astRoot) {
- return new EclipseLinkTypeMappingValidator(this, this.getJavaResourceType(), buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java
deleted file mode 100644
index 584749bc0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkIdMapping.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkIdMapping
- extends AbstractJavaIdMapping
- implements EclipseLinkIdMapping, EclipseLinkJavaConvertibleMapping
-{
- protected final JavaEclipseLinkMutable mutable;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
-
- public JavaEclipseLinkIdMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.mutable = new JavaEclipseLinkMutable(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- this.converterContainer.update();
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<JavaConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<JavaConverter.Adapter>(JavaEclipseLinkConvert.Adapter.instance(), super.getConverterAdapters());
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.mutable.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java
deleted file mode 100644
index fcb9dd1148..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkJoinFetch.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-public class JavaEclipseLinkJoinFetch
- extends AbstractJavaJpaContextNode
- implements EclipseLinkJoinFetch
-{
- protected EclipseLinkJoinFetchType value;
-
-
- public JavaEclipseLinkJoinFetch(JavaAttributeMapping parent) {
- super(parent);
- this.value = this.buildValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** value **********
-
- public EclipseLinkJoinFetchType getValue() {
- return this.value;
- }
-
- public void setValue(EclipseLinkJoinFetchType value) {
- if (this.valuesAreDifferent(value, this.value)) {
- EclipseLinkJoinFetchAnnotation annotation = this.getJoinFetchAnnotation();
- if (value == null) {
- if (annotation != null) {
- this.removeJoinFetchAnnotation();
- }
- } else {
- if (annotation == null) {
- annotation = this.addJoinFetchAnnotation();
- }
- annotation.setValue(EclipseLinkJoinFetchType.toJavaResourceModel(value));
- }
-
- this.setValue_(value);
- }
- }
-
- protected void setValue_(EclipseLinkJoinFetchType value) {
- EclipseLinkJoinFetchType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private EclipseLinkJoinFetchType buildValue() {
- EclipseLinkJoinFetchAnnotation annotation = this.getJoinFetchAnnotation();
- if (annotation == null) {
- return null;
- }
- JoinFetchType annotationValue = annotation.getValue();
- return (annotationValue != null) ?
- EclipseLinkJoinFetchType.fromJavaResourceModel(annotationValue) :
- this.getDefaultValue(); // @JoinFetch is equivalent to @JoinFetch(JoinFetch.INNER)
- }
-
- protected EclipseLinkJoinFetchType getDefaultValue() {
- return DEFAULT_VALUE;
- }
-
-
- // ********** join fetch annotation **********
-
- protected EclipseLinkJoinFetchAnnotation getJoinFetchAnnotation() {
- return (EclipseLinkJoinFetchAnnotation) this.getResourceAttribute().getAnnotation(this.getJoinFetchAnnotationName());
- }
-
- protected EclipseLinkJoinFetchAnnotation addJoinFetchAnnotation() {
- return (EclipseLinkJoinFetchAnnotation) this.getResourceAttribute().addAnnotation(this.getJoinFetchAnnotationName());
- }
-
- protected void removeJoinFetchAnnotation() {
- this.getResourceAttribute().removeAnnotation(this.getJoinFetchAnnotationName());
- }
-
- protected String getJoinFetchAnnotationName() {
- return EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- protected JavaAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected JavaResourceAttribute getResourceAttribute() {
- return this.getAttributeMapping().getResourceAttribute();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkJoinFetchAnnotation annotation = this.getJoinFetchAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java
deleted file mode 100644
index b169bd9e87..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToManyMapping.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkManyToManyMapping
- extends AbstractJavaManyToManyMapping
- implements EclipseLinkManyToManyMapping, EclipseLinkJavaConvertibleMapping
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
-
- public JavaEclipseLinkManyToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- this.converterContainer.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java
deleted file mode 100644
index 2c1a52650a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkManyToOneMapping.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkManyToOneMapping
- extends AbstractJavaManyToOneMapping
- implements EclipseLinkRelationshipMapping, EclipseLinkJavaConvertibleMapping
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
-
- public JavaEclipseLinkManyToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- this.converterContainer.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java
deleted file mode 100644
index d35595468c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMappedSuperclassImpl.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * Java mapped superclass
- */
-public class JavaEclipseLinkMappedSuperclassImpl
- extends AbstractJavaMappedSuperclass
- implements JavaEclipseLinkMappedSuperclass, JavaCacheableHolder2_0, JavaEclipseLinkConverterContainer.ParentAdapter
-{
- protected final JavaEclipseLinkCaching caching;
-
- protected final JavaEclipseLinkReadOnly readOnly;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- protected final JavaEclipseLinkChangeTracking changeTracking;
-
- protected final JavaEclipseLinkCustomizer customizer;
-
- protected final JavaEclipseLinkMultitenancy2_3 multitenancy;
-
- public JavaEclipseLinkMappedSuperclassImpl(JavaPersistentType parent, MappedSuperclassAnnotation mappingAnnotation) {
- super(parent, mappingAnnotation);
- this.caching = this.buildCaching();
- this.readOnly = this.buildReadOnly();
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- this.multitenancy = this.buildMultitenancy();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.caching.synchronizeWithResourceModel();
- this.readOnly.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- this.multitenancy.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.caching.update();
- this.readOnly.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- this.multitenancy.update();
- }
-
-
- // ********** caching **********
-
- public JavaEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- protected JavaEclipseLinkCaching buildCaching() {
- return new JavaEclipseLinkCachingImpl(this);
- }
-
-
- // ********** read-only **********
-
- public EclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- protected JavaEclipseLinkReadOnly buildReadOnly() {
- return new JavaEclipseLinkReadOnly(this);
- }
-
-
- // ********** converter container **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new CompositeIterable<EclipseLinkConverter>(this.getAttributeMappingConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getAttributeMappingConverterLists() {
- return new TransformationIterable<AttributeMapping, Iterable<EclipseLinkConverter>>(
- this.getAttributeMappings(),
- ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER
- );
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected JavaEclipseLinkChangeTracking buildChangeTracking() {
- return new JavaEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected JavaEclipseLinkCustomizer buildCustomizer() {
- return new JavaEclipseLinkCustomizer(this);
- }
-
-
- // ********** multitenancy **********
-
- public JavaEclipseLinkMultitenancy2_3 getMultitenancy() {
- return this.multitenancy;
- }
-
-
- protected JavaEclipseLinkMultitenancy2_3 buildMultitenancy() {
- return this.isEclipseLink2_3Compatible() ?
- new JavaEclipseLinkMultitenancyImpl2_3(this) :
- new NullJavaEclipseLinkMultitenancy2_3(this);
- }
-
- protected boolean isEclipseLink2_3Compatible() {
- return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this);
- }
-
- public boolean isMultitenantMetadataAllowed() {
- return true;
- }
-
- // ********** misc **********
-
- public boolean usesPrimaryKeyColumns() {
- return this.getJavaResourceType().getAnnotation(EclipseLink.PRIMARY_KEY) != null;
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- return getMultitenancy().usesPrimaryKeyTenantDiscriminatorColumns();
- }
-
- public JavaCacheable2_0 getCacheable() {
- return ((JavaCacheableHolder2_0) this.getCaching()).getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return ((CacheableHolder2_0) this.getCaching()).calculateDefaultCacheable();
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getJavaResourceType();
- }
-
- public boolean parentSupportsConverters() {
- return true;
- }
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- result = this.multitenancy.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- return null;
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.caching.validate(messages, reporter, astRoot);
- this.readOnly.validate(messages, reporter, astRoot);
- this.converterContainer.validate(messages, reporter, astRoot);
- this.changeTracking.validate(messages, reporter, astRoot);
- this.customizer.validate(messages, reporter, astRoot);
- this.multitenancy.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected JptValidator buildPrimaryKeyValidator(CompilationUnit astRoot) {
- return new EclipseLinkMappedSuperclassPrimaryKeyValidator(this, this.buildTextRangeResolver(astRoot));
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator(CompilationUnit astRoot) {
- return new EclipseLinkMappedSuperclassValidator(this, this.getJavaResourceType(), this.buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java
deleted file mode 100644
index adc71a7b7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMultitenancyImpl2_3.java
+++ /dev/null
@@ -1,764 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SubListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.MappingFileRoot;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaVirtualTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetDatabase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.TenantDiscriminatorColumnValidator2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkMultitenancyImpl2_3
- extends AbstractJavaJpaContextNode
- implements JavaEclipseLinkMultitenancy2_3
-{
- protected boolean defaultMultitenant;
- protected boolean specifiedMultitenant;
-
- protected EclipseLinkMultitenantType2_3 specifiedType;
- protected EclipseLinkMultitenantType2_3 defaultType;
-
- protected Boolean specifiedIncludeCriteria;
- protected boolean defaultIncludeCriteria = DEFAULT_INCLUDE_CRITERIA;
-
- protected final JavaReadOnlyTenantDiscriminatorColumn2_3.Owner tenantDiscriminatorColumnOwner;
- protected final ContextListContainer<JavaTenantDiscriminatorColumn2_3, EclipseLinkTenantDiscriminatorColumnAnnotation2_3> specifiedTenantDiscriminatorColumnContainer;
- protected final ContextListContainer<JavaVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> defaultTenantDiscriminatorColumnContainer;
-
- protected final JavaReadOnlyTenantDiscriminatorColumn2_3 defaultTenantDiscriminatorColumn;
-
- protected boolean specifiedTenantDiscriminatorColumnsAllowed;
-
- public JavaEclipseLinkMultitenancyImpl2_3(JavaEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
-
- EclipseLinkMultitenantAnnotation2_3 multitenantAnnotation = this.getMultitenantAnnotation();
- this.specifiedMultitenant = multitenantAnnotation.isSpecified();
- this.specifiedType = EclipseLinkMultitenantType2_3.fromJavaResourceModel(multitenantAnnotation.getValue());
- this.specifiedIncludeCriteria = multitenantAnnotation.getIncludeCriteria();
- this.tenantDiscriminatorColumnOwner = this.buildTenantDiscriminatorColumnOwner();
- this.specifiedTenantDiscriminatorColumnContainer = this.buildSpecifiedTenantDiscriminatorColumnContainer();
- this.defaultTenantDiscriminatorColumn = this.buildTenantDiscriminatorColumn(this.buildNullTenantDiscriminatorColumnAnnotation());
- this.defaultTenantDiscriminatorColumnContainer = this.buildDefaultTenantDiscriminatorColumnContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
-
- EclipseLinkMultitenantAnnotation2_3 multitenantAnnotation = this.getMultitenantAnnotation();
- this.setSpecifiedType_(EclipseLinkMultitenantType2_3.fromJavaResourceModel(multitenantAnnotation.getValue()));
- this.setSpecifiedIncludeCriteria_(multitenantAnnotation.getIncludeCriteria());
- this.syncSpecifiedTenantDiscriminatorColumns();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getSpecifiedTenantDiscriminatorColumns());
- this.setSpecifiedMultitenant_(this.isMultitenantAnnotationSpecified());
- this.setDefaultMultitenant(this.buildDefaultMultitenant());
- this.setDefaultType(this.buildDefaultType());
- this.setDefaultIncludeCriteria(this.buildDefaultIncludeCriteria());
- this.setSpecifiedTenantDiscriminatorColumnsAllowed(this.buildSpecifiedTenantDiscriminatorColumnsAllowed());
- this.updateDefaultTenantDiscriminatorColumns();
- }
-
-
- // ********** multitenant **********
-
- public boolean isMultitenant() {
- return this.isSpecifiedMultitenant() || this.isDefaultMultitenant();
- }
-
- public boolean isDefaultMultitenant() {
- return this.defaultMultitenant;
- }
-
- public void setDefaultMultitenant(boolean defaultMultitenant) {
- boolean old = this.defaultMultitenant;
- this.defaultMultitenant = defaultMultitenant;
- this.firePropertyChanged(DEFAULT_MULTITENANT_PROPERTY, old, defaultMultitenant);
- }
-
- protected boolean buildDefaultMultitenant() {
- return this.isMultitenantInheritanceHierarchy() || this.isSuperMappedSuperclassMultitenant();
- }
-
- public boolean isSpecifiedMultitenant() {
- return this.specifiedMultitenant;
- }
-
- public void setSpecifiedMultitenant(boolean isMultitenant) {
- if (isMultitenant) {
- if (getMultitenantAnnotation().isSpecified()) {
- throw new IllegalStateException("Multitenant annotation already specified"); //$NON-NLS-1$
- }
- this.addMultitenantAnnotation();
- }
- else {
- if (!getMultitenantAnnotation().isSpecified()) {
- throw new IllegalStateException("Multitenant annotation does not exist"); //$NON-NLS-1$
- }
- this.removeMultitenantAnnotation();
- this.setSpecifiedType(null);
- for (int i = this.getSpecifiedTenantDiscriminatorColumnsSize(); i-- > 0; ) {
- this.removeSpecifiedTenantDiscriminatorColumn(i);
- }
- }
- this.setSpecifiedMultitenant_(isMultitenant);
- }
-
- protected void setSpecifiedMultitenant_(boolean isMultitenant) {
- boolean old = this.specifiedMultitenant;
- this.specifiedMultitenant = isMultitenant;
- this.firePropertyChanged(SPECIFIED_MULTITENANT_PROPERTY, old, isMultitenant);
- }
-
-
- // ********** type **********
-
- public EclipseLinkMultitenantType2_3 getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
- }
-
- public EclipseLinkMultitenantType2_3 getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkMultitenantType2_3 type) {
- this.getMultitenantAnnotation().setValue(EclipseLinkMultitenantType2_3.toJavaResourceModel(type));
- this.setSpecifiedType_(type);
- }
-
- protected void setSpecifiedType_(EclipseLinkMultitenantType2_3 type) {
- EclipseLinkMultitenantType2_3 old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- public EclipseLinkMultitenantType2_3 getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(EclipseLinkMultitenantType2_3 type) {
- EclipseLinkMultitenantType2_3 old = this.defaultType;
- this.defaultType = type;
- this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkMultitenantType2_3 buildDefaultType() {
- if (!isMultitenant()) {
- return null;
- }
- if (isSpecifiedMultitenant()) {
- return DEFAULT_TYPE;
- }
- if (this.isMultitenantInheritanceHierarchy()) {
- return getRootEntity().getMultitenancy().getType();
- }
- EclipseLinkMappedSuperclass superMappedSuperclass = getSuperMappedSuperclass();
- return superMappedSuperclass != null ? superMappedSuperclass.getMultitenancy().getType() : DEFAULT_TYPE;
- }
-
-
- // ********** include criteria **********
-
- public boolean isIncludeCriteria() {
- return (this.specifiedIncludeCriteria != null) ? this.specifiedIncludeCriteria.booleanValue() : this.isDefaultIncludeCriteria();
- }
-
- public Boolean getSpecifiedIncludeCriteria() {
- return this.specifiedIncludeCriteria;
- }
-
- public void setSpecifiedIncludeCriteria(Boolean includeCriteria) {
- this.getMultitenantAnnotation().setIncludeCriteria(includeCriteria);
- this.setSpecifiedIncludeCriteria_(includeCriteria);
- }
-
- protected void setSpecifiedIncludeCriteria_(Boolean includeCriteria) {
- Boolean old = this.specifiedIncludeCriteria;
- this.specifiedIncludeCriteria = includeCriteria;
- this.firePropertyChanged(SPECIFIED_INCLUDE_CRITERIA_PROPERTY, old, includeCriteria);
- }
-
- public boolean isDefaultIncludeCriteria() {
- return this.defaultIncludeCriteria;
- }
-
- protected void setDefaultIncludeCriteria(boolean includeCriteria) {
- boolean old = this.defaultIncludeCriteria;
- this.defaultIncludeCriteria = includeCriteria;
- this.firePropertyChanged(DEFAULT_INCLUDE_CRITERIA_PROPERTY, old, includeCriteria);
- }
-
- protected boolean buildDefaultIncludeCriteria() {
- if (getType() == EclipseLinkMultitenantType2_3.VPD) {
- return false;
- }
- return DEFAULT_INCLUDE_CRITERIA;
- }
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getReadOnlySpecifiedTenantDiscriminatorColumns() :
- this.getReadOnlyDefaultTenantDiscriminatorColumns();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getSpecifiedTenantDiscriminatorColumnsSize() :
- this.getDefaultTenantDiscriminatorColumnsSize();
- }
-
-
- // ********** specified tenant discriminator columns **********
-
- public ListIterable<JavaTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getReadOnlySpecifiedTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<JavaReadOnlyTenantDiscriminatorColumn2_3>(this.getSpecifiedTenantDiscriminatorColumns());
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return this.getSpecifiedTenantDiscriminatorColumnsSize() != 0;
- }
-
- public JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- return this.addSpecifiedTenantDiscriminatorColumn(this.getSpecifiedTenantDiscriminatorColumnsSize());
- }
-
- public JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 annotation = this.addTenantDiscriminatorColumnAnnotation(index);
- return this.specifiedTenantDiscriminatorColumnContainer.addContextElement(index, annotation);
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.removeSpecifiedTenantDiscriminatorColumn(this.specifiedTenantDiscriminatorColumnContainer.indexOfContextElement((JavaTenantDiscriminatorColumn2_3) tenantDiscriminatorColumn));
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- this.removeTenantDiscriminatorColumnAnnotation(index);
- this.specifiedTenantDiscriminatorColumnContainer.removeContextElement(index);
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- this.moveTenantDiscriminatorColumnAnnotation(targetIndex, sourceIndex);
- this.specifiedTenantDiscriminatorColumnContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected JavaTenantDiscriminatorColumn2_3 buildTenantDiscriminatorColumn(EclipseLinkTenantDiscriminatorColumnAnnotation2_3 discriminatorColumnAnnotation) {
- return new EclipseLinkJavaTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, discriminatorColumnAnnotation);
- }
-
- protected EclipseLinkTenantDiscriminatorColumnAnnotation2_3 buildNullTenantDiscriminatorColumnAnnotation() {
- return new NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3(this.getJavaResourceType());
- }
-
- protected void syncSpecifiedTenantDiscriminatorColumns() {
- this.specifiedTenantDiscriminatorColumnContainer.synchronizeWithResourceModel();
- }
-
- protected ContextListContainer<JavaTenantDiscriminatorColumn2_3, EclipseLinkTenantDiscriminatorColumnAnnotation2_3> buildSpecifiedTenantDiscriminatorColumnContainer() {
- SpecifiedTenantDiscriminatorColumnContainer container = new SpecifiedTenantDiscriminatorColumnContainer();
- container.initialize();
- return container;
- }
-
- protected JavaReadOnlyTenantDiscriminatorColumn2_3.Owner buildTenantDiscriminatorColumnOwner() {
- return new TenantDiscriminatorColumnOwner();
- }
-
- /**
- * specified tenant discriminator column container
- */
- protected class SpecifiedTenantDiscriminatorColumnContainer
- extends ContextListContainer<JavaTenantDiscriminatorColumn2_3, EclipseLinkTenantDiscriminatorColumnAnnotation2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected JavaTenantDiscriminatorColumn2_3 buildContextElement(EclipseLinkTenantDiscriminatorColumnAnnotation2_3 resourceElement) {
- return JavaEclipseLinkMultitenancyImpl2_3.this.buildTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<EclipseLinkTenantDiscriminatorColumnAnnotation2_3> getResourceElements() {
- return JavaEclipseLinkMultitenancyImpl2_3.this.getTenantDiscriminatorColumnAnnotations();
- }
- @Override
- protected EclipseLinkTenantDiscriminatorColumnAnnotation2_3 getResourceElement(JavaTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getColumnAnnotation();
- }
- }
-
-
- // ********** default tenant discriminator columns **********
-
- public ListIterable<JavaVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getReadOnlyDefaultTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<JavaReadOnlyTenantDiscriminatorColumn2_3>(this.getDefaultTenantDiscriminatorColumns());
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- protected void clearDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.clearContextList();
- }
-
- /**
- * If there are any specified tenant discriminator columns, then there are no default
- * tenant discriminator columns.
- * @see #getTenantDiscriminatorColumnsForDefaults()
- */
- protected void updateDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.update();
- }
-
- protected ContextListContainer<JavaVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> buildDefaultTenantDiscriminatorColumnContainer() {
- return new DefaultTenantDiscriminatorColumnContainer();
- }
-
- protected JavaVirtualTenantDiscriminatorColumn2_3 buildVirtualTenantDiscriminatorColumn(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- return new EclipseLinkJavaVirtualTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, tenantDiscriminatorColumn);
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumnsForDefaults() {
- if (this.getType() == null || this.getType() == EclipseLinkMultitenantType2_3.TABLE_PER_TENANT) {
- return EmptyListIterable.instance();
- }
- if (this.isMultitenantInheritanceHierarchy()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(this.getRootEntity().getMultitenancy().getTenantDiscriminatorColumns());
- }
- if (!this.isSpecifiedMultitenant()) {
- EclipseLinkMappedSuperclass superMappedSuperclass = this.getSuperMappedSuperclass();
- if (superMappedSuperclass != null && superMappedSuperclass.getMultitenancy().isMultitenant()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(superMappedSuperclass.getMultitenancy().getTenantDiscriminatorColumns());
- }
- }
- if (this.getSpecifiedTenantDiscriminatorColumnsSize() == 0) {
- ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> contextColumns = this.getContextDefaultTenantDiscriminatorColumns();
- if (CollectionTools.isEmpty(contextColumns)) {
- return new SingleElementListIterable<ReadOnlyTenantDiscriminatorColumn2_3>(this.defaultTenantDiscriminatorColumn);
- }
- return contextColumns;
- }
- return EmptyListIterable.instance();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getContextDefaultTenantDiscriminatorColumns() {
- EclipseLinkEntityMappings entityMappings = this.getEclipseLinkEntityMappings();
- return (entityMappings != null) ? entityMappings.getTenantDiscriminatorColumns() : this.getPersistenceUnit().getDefaultTenantDiscriminatorColumns();
- }
-
- public boolean specifiedTenantDiscriminatorColumnsAllowed() {
- return this.specifiedTenantDiscriminatorColumnsAllowed;
- }
-
- public void setSpecifiedTenantDiscriminatorColumnsAllowed(boolean allowed) {
- boolean old = this.specifiedTenantDiscriminatorColumnsAllowed;
- this.specifiedTenantDiscriminatorColumnsAllowed = allowed;
- this.firePropertyChanged(SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_ALLOWED_PROPERTY, old, allowed);
- }
-
- protected boolean buildSpecifiedTenantDiscriminatorColumnsAllowed() {
- return this.getParent().isMultitenantMetadataAllowed();
- }
-
-
- /**
- * default tenant discriminator column container
- */
- protected class DefaultTenantDiscriminatorColumnContainer
- extends ContextListContainer<JavaVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected JavaVirtualTenantDiscriminatorColumn2_3 buildContextElement(ReadOnlyTenantDiscriminatorColumn2_3 resourceElement) {
- return JavaEclipseLinkMultitenancyImpl2_3.this.buildVirtualTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getResourceElements() {
- return JavaEclipseLinkMultitenancyImpl2_3.this.getTenantDiscriminatorColumnsForDefaults();
- }
- @Override
- protected ReadOnlyTenantDiscriminatorColumn2_3 getResourceElement(JavaVirtualTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getOverriddenColumn();
- }
- }
-
-
-
- // ********** JavaReadOnlyTenantDiscriminatorColumn.Owner implementation **********
-
- protected class TenantDiscriminatorColumnOwner
- implements JavaReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
-
- public String getDefaultContextPropertyName() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_CONTEXT_PROPERTY;
- }
-
- public boolean getDefaultPrimaryKey() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_PRIMARY_KEY;
- }
-
- public int getDefaultLength() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME;
- }
-
- public Table resolveDbTable(String tableName) {
- return getTypeMapping().resolveDbTable(tableName);
- }
-
- public Iterable<String> getCandidateTableNames() {
- return getTypeMapping().getAllAssociatedTableNames();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn column, NamedColumnTextRangeResolver textRangeResolver) {
- return new TenantDiscriminatorColumnValidator2_3((ReadOnlyTenantDiscriminatorColumn2_3) column, textRangeResolver);
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- return JavaEclipseLinkMultitenancyImpl2_3.this.getValidationTextRange(astRoot);
- }
- }
-
-
- // ********** multitenant annotation **********
-
- protected EclipseLinkMultitenantAnnotation2_3 addMultitenantAnnotation() {
- return (EclipseLinkMultitenantAnnotation2_3) this.getJavaResourceType().addAnnotation(this.getMultitenantAnnotationName());
- }
-
- protected void removeMultitenantAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getMultitenantAnnotationName());
- }
-
- protected EclipseLinkMultitenantAnnotation2_3 getMultitenantAnnotation() {
- return (EclipseLinkMultitenantAnnotation2_3) this.getJavaResourceType().getNonNullAnnotation(this.getMultitenantAnnotationName());
- }
-
- protected TextRange getMultitenantAnnotationTextRange(CompilationUnit astRoot) {
- return this.getMultitenantAnnotation().getTextRange(astRoot);
- }
-
- public boolean isMultitenantAnnotationSpecified() {
- return this.getMultitenantAnnotation().isSpecified();
- }
-
- protected String getMultitenantAnnotationName() {
- return EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME;
- }
-
-
- // ********** tenant discriminator column annotations **********
-
- protected ListIterable<EclipseLinkTenantDiscriminatorColumnAnnotation2_3> getTenantDiscriminatorColumnAnnotations() {
- return this.getTenantDiscriminatorColumnAnnotations_();
- }
-
- protected ListIterable<EclipseLinkTenantDiscriminatorColumnAnnotation2_3> getTenantDiscriminatorColumnAnnotations_() {
- return new SubListIterableWrapper<NestableAnnotation, EclipseLinkTenantDiscriminatorColumnAnnotation2_3>(this.getNestableTenantDiscriminatorColumnAnnotations_());
- }
-
- protected ListIterable<NestableAnnotation> getNestableTenantDiscriminatorColumnAnnotations_() {
- return this.getJavaResourceType().getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- }
-
- protected EclipseLinkTenantDiscriminatorColumnAnnotation2_3 addTenantDiscriminatorColumnAnnotation(int index) {
- return (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) this.getJavaResourceType().addAnnotation(index, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- }
-
- protected void removeTenantDiscriminatorColumnAnnotation(int index) {
- this.getJavaResourceType().removeAnnotation(index, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- }
-
- protected void moveTenantDiscriminatorColumnAnnotation(int targetIndex, int sourceIndex) {
- this.getJavaResourceType().moveAnnotation(targetIndex, sourceIndex, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (JavaEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaPersistentType getPersistentType() {
- return this.getTypeMapping().getPersistentType();
- }
-
- public JavaResourceType getJavaResourceType() {
- return this.getTypeMapping().getJavaResourceType();
- }
-
- public EclipseLinkEntityMappings getEclipseLinkEntityMappings() {
- MappingFileRoot mfRoot = super.getMappingFileRoot();
- if (mfRoot instanceof EclipseLinkEntityMappings) {
- return (EclipseLinkEntityMappings) mfRoot;
- }
- return null;
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- protected boolean isMultitenantInheritanceHierarchy() {
- if (this.isInheritanceStrategyTablePerClass()) {
- return false;
- }
- return this.isRootEntityMultitenant();
- }
-
- protected boolean isInheritanceStrategyTablePerClass() {
- return this.getParent().getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS;
- }
-
- protected boolean isRootEntityMultitenant() {
- EclipseLinkEntity rootEntity = this.getRootEntity();
- return rootEntity != null && rootEntity != getParent() && rootEntity.getMultitenancy().isMultitenant();
- }
-
- protected EclipseLinkEntity getRootEntity() {
- //instanceof check in case the rootEntity is in an orm.xml instead of an eclipselinkorm.xml file.
- Entity entity = getParent().getRootEntity();
- return entity instanceof EclipseLinkEntity ? (EclipseLinkEntity) entity : null;
- }
-
-
- protected boolean isSuperMappedSuperclassMultitenant() {
- EclipseLinkMappedSuperclass mappedSuperclass = this.getSuperMappedSuperclass(getParent());
- return mappedSuperclass != null && mappedSuperclass.getMultitenancy().isMultitenant();
- }
-
- protected EclipseLinkMappedSuperclass getSuperMappedSuperclass() {
- return this.getSuperMappedSuperclass(this.getParent());
- }
-
- protected EclipseLinkMappedSuperclass getSuperMappedSuperclass(TypeMapping typeMapping) {
- TypeMapping superTypeMapping = typeMapping.getSuperTypeMapping();
- if (superTypeMapping == null) {
- return null;
- }
- //instanceof check in case the mapped superclass is in an orm.xml instead of an eclipselinkorm.xml file.
- if (superTypeMapping instanceof EclipseLinkMappedSuperclass) {
- return (EclipseLinkMappedSuperclass) superTypeMapping;
- }
- return this.getSuperMappedSuperclass(superTypeMapping);
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- for (ReadOnlyTenantDiscriminatorColumn2_3 column : getTenantDiscriminatorColumns()) {
- if (column.isPrimaryKey()) {
- return true;
- }
- }
- return false;
- }
-
- // ********** Java completion proposals **********
-
- @Override
- public Iterable<String> getJavaCompletionProposals(int pos, Filter<String> filter, CompilationUnit astRoot) {
- Iterable<String> result = super.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- for (JavaTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn : this.getSpecifiedTenantDiscriminatorColumns()) {
- result = tenantDiscriminatorColumn.getJavaCompletionProposals(pos, filter, astRoot);
- if (result != null) {
- return result;
- }
- }
-
- return null;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- if (getSpecifiedType() == EclipseLinkMultitenantType2_3.TABLE_PER_TENANT) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED,
- EMPTY_STRING_ARRAY,
- this,
- this.getMultitenantAnnotationTextRange(astRoot)
- )
- );
- }
- if (getSpecifiedType() == EclipseLinkMultitenantType2_3.VPD) {
- String targetDatabase = getPersistenceUnit().getOptions().getTargetDatabase();
- if (targetDatabase == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED,
- EMPTY_STRING_ARRAY,
- this,
- this.getMultitenantAnnotationTextRange(astRoot)
- )
- );
- }
- else if (!TargetDatabase.isOracleDatabase(targetDatabase)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM,
- new String[] {targetDatabase},
- this,
- this.getMultitenantAnnotationTextRange(astRoot)
- )
- );
- }
- }
- if (this.getSpecifiedTenantDiscriminatorColumnsSize() > 0) {
- if (!this.specifiedTenantDiscriminatorColumnsAllowed()) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY,
- EMPTY_STRING_ARRAY,
- this,
- this.getJavaResourceType().getTextRange(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME, astRoot)
- )
- );
- }
- else if (this.isMultitenantAnnotationSpecified()) {
- for (JavaTenantDiscriminatorColumn2_3 column : this.getSpecifiedTenantDiscriminatorColumns()) {
- column.validate(messages, reporter, astRoot);
- }
- }
- else {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_NOT_SPECIFIED_WITH_TENANT_DISCRIMINATOR_COLUMNS,
- EMPTY_STRING_ARRAY,
- this,
- this.getJavaResourceType().getTextRange(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME, astRoot)
- )
- );
- }
- }
- if (this.specifiedTenantDiscriminatorColumnsAllowed()) {
- //bug 360731 no need to validate, they will be validated where they are specified
- for (JavaVirtualTenantDiscriminatorColumn2_3 column : this.getDefaultTenantDiscriminatorColumns()) {
- column.validate(messages, reporter, astRoot);
- }
- }
- if (this.getSpecifiedIncludeCriteria() == Boolean.TRUE && getType() == EclipseLinkMultitenantType2_3.VPD) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_INCLUDE_CRITERIA_WILL_BE_IGNORED,
- EMPTY_STRING_ARRAY,
- this,
- this.getMultitenantAnnotation().getIncludeCriteriaTextRange(astRoot)
- )
- );
- }
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getMultitenantAnnotation().getTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java
deleted file mode 100644
index 69bc1deada..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkMutable.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-public class JavaEclipseLinkMutable
- extends AbstractJavaJpaContextNode
- implements EclipseLinkMutable
-{
- protected Boolean specifiedMutable;
- protected boolean defaultMutable;
-
-
- public JavaEclipseLinkMutable(JavaAttributeMapping parent) {
- super(parent);
- this.specifiedMutable = this.buildSpecifiedMutable();
- //build defaults during construction for performance
- this.defaultMutable = this.buildDefaultMutable();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedMutable_(this.buildSpecifiedMutable());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultMutable(this.buildDefaultMutable());
- }
-
-
- // ********** mutable **********
-
- public boolean isMutable() {
- return (this.specifiedMutable != null) ? this.specifiedMutable.booleanValue() : this.defaultMutable;
- }
-
- public Boolean getSpecifiedMutable() {
- return this.specifiedMutable;
- }
-
- public void setSpecifiedMutable(Boolean mutable) {
- if (this.valuesAreDifferent(mutable, this.specifiedMutable)) {
- EclipseLinkMutableAnnotation annotation = this.getMutableAnnotation();
- if (mutable == null) {
- if (annotation != null) {
- this.removeMutableAnnotation();
- }
- } else {
- if (annotation == null) {
- annotation = this.addMutableAnnotation();
- }
- Boolean annotationValue = annotation.getValue();
- boolean annotationBooleanValue = (annotationValue == null) ? true : annotationValue.booleanValue();
- if (annotationBooleanValue != mutable.booleanValue()) {
- annotation.setValue(mutable);
- }
- }
-
- this.setSpecifiedMutable_(mutable);
- }
- }
-
- protected void setSpecifiedMutable_(Boolean mutable) {
- Boolean old = this.specifiedMutable;
- this.specifiedMutable = mutable;
- this.firePropertyChanged(SPECIFIED_MUTABLE_PROPERTY, old, mutable);
- }
-
- protected Boolean buildSpecifiedMutable() {
- EclipseLinkMutableAnnotation annotation = this.getMutableAnnotation();
- if (annotation == null) {
- return null;
- }
-
- // @Mutable is equivalent to @Mutable(true)
- Boolean annotationValue = annotation.getValue();
- return (annotationValue == null) ? Boolean.TRUE : annotationValue;
- }
-
- public boolean isDefaultMutable() {
- return this.defaultMutable;
- }
-
- protected void setDefaultMutable(boolean mutable) {
- boolean old = this.defaultMutable;
- this.defaultMutable = mutable;
- this.firePropertyChanged(DEFAULT_MUTABLE_PROPERTY, old, mutable);
- }
-
- protected boolean buildDefaultMutable() {
- JavaEclipseLinkPersistentAttribute javaAttribute = this.getPersistentAttribute();
- if (javaAttribute.typeIsDateOrCalendar()) {
- Boolean puTemporalMutable = this.getPersistenceUnit().getOptions().getTemporalMutable();
- return (puTemporalMutable == null) ? false : puTemporalMutable.booleanValue();
- }
- return javaAttribute.typeIsSerializable();
- }
-
-
- // ********** mutable annotation **********
-
- protected EclipseLinkMutableAnnotation getMutableAnnotation() {
- return (EclipseLinkMutableAnnotation) this.getResourceAttribute().getAnnotation(this.getMutableAnnotationName());
- }
-
- protected EclipseLinkMutableAnnotation addMutableAnnotation() {
- return (EclipseLinkMutableAnnotation) this.getResourceAttribute().addAnnotation(this.getMutableAnnotationName());
- }
-
- protected void removeMutableAnnotation() {
- this.getResourceAttribute().removeAnnotation(this.getMutableAnnotationName());
- }
-
- protected String getMutableAnnotationName() {
- return EclipseLinkMutableAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- protected JavaAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected JavaResourceAttribute getResourceAttribute() {
- return this.getAttributeMapping().getResourceAttribute();
- }
-
- protected JavaEclipseLinkPersistentAttribute getPersistentAttribute() {
- return (JavaEclipseLinkPersistentAttribute) this.getAttributeMapping().getPersistentAttribute();
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkMutableAnnotation annotation = this.getMutableAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java
deleted file mode 100644
index 8be199c18e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkObjectTypeConverter.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * <code>org.eclipse.persistence.annotations.ObjectTypeConverter</code>
- */
-public class JavaEclipseLinkObjectTypeConverter
- extends JavaEclipseLinkConverter<EclipseLinkObjectTypeConverterAnnotation>
- implements EclipseLinkObjectTypeConverter
-{
- private String dataType;
- private String fullyQualifiedDataType;
-
- private String objectType;
- private String fullyQualifiedObjectType;
-
- protected final ContextListContainer<JavaEclipseLinkConversionValue, EclipseLinkConversionValueAnnotation> conversionValueContainer;
-
- private String defaultObjectValue;
-
-
- public JavaEclipseLinkObjectTypeConverter(JavaEclipseLinkConverterContainer parent, EclipseLinkObjectTypeConverterAnnotation converterAnnotation) {
- super(parent, converterAnnotation);
- this.dataType = converterAnnotation.getDataType();
- this.objectType = converterAnnotation.getObjectType();
- this.conversionValueContainer = this.buildConversionValueContainer();
- this.defaultObjectValue = converterAnnotation.getDefaultObjectValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataType_(this.converterAnnotation.getDataType());
- this.setObjectType_(this.converterAnnotation.getObjectType());
- this.syncConversionValues();
- this.setDefaultObjectValue_(this.converterAnnotation.getDefaultObjectValue());
- }
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedDataType(this.converterAnnotation.getFullyQualifiedDataType());
- this.setFullyQualifiedObjectType(this.converterAnnotation.getFullyQualifiedObjectType());
- this.updateNodes(this.getConversionValues());
- }
-
-
- // ********** data type **********
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- this.converterAnnotation.setDataType(dataType);
- this.setDataType_(dataType);
- }
-
- protected void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
-
-
- // ********** fully qualified data type **********
-
- public String getFullyQualifiedDataType() {
- return this.fullyQualifiedDataType;
- }
-
- protected void setFullyQualifiedDataType(String dataType) {
- String old = this.fullyQualifiedDataType;
- this.fullyQualifiedDataType = dataType;
- this.firePropertyChanged(FULLY_QUALIFIED_DATA_TYPE_PROPERTY, old, dataType);
- }
-
-
- // ********** object type **********
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- this.converterAnnotation.setObjectType(objectType);
- this.setObjectType_(objectType);
- }
-
- protected void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
-
- // ********** fully qualified object type **********
-
- public String getFullyQualifiedObjectType() {
- return this.fullyQualifiedObjectType;
- }
-
- protected void setFullyQualifiedObjectType(String objectType) {
- String old = this.fullyQualifiedObjectType;
- this.fullyQualifiedObjectType = objectType;
- this.firePropertyChanged(FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
-
- // ********** conversion values **********
-
- public ListIterable<JavaEclipseLinkConversionValue> getConversionValues() {
- return this.conversionValueContainer.getContextElements();
- }
-
- public int getConversionValuesSize() {
- return this.conversionValueContainer.getContextElementsSize();
- }
-
- public EclipseLinkConversionValue getConversionValue(int index) {
- return this.conversionValueContainer.get(index);
- }
-
- public JavaEclipseLinkConversionValue addConversionValue() {
- return this.addConversionValue(this.getConversionValuesSize());
- }
-
- public JavaEclipseLinkConversionValue addConversionValue(int index) {
- EclipseLinkConversionValueAnnotation annotation = this.converterAnnotation.addConversionValue(index);
- return this.conversionValueContainer.addContextElement(index, annotation);
- }
-
- public void removeConversionValue(EclipseLinkConversionValue conversionValue) {
- this.removeConversionValue(this.conversionValueContainer.indexOfContextElement((JavaEclipseLinkConversionValue) conversionValue));
- }
-
- public void removeConversionValue(int index) {
- this.converterAnnotation.removeConversionValue(index);
- this.conversionValueContainer.removeContextElement(index);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- this.converterAnnotation.moveConversionValue(targetIndex, sourceIndex);
- this.conversionValueContainer.moveContextElement(targetIndex, sourceIndex);
- }
-
- protected JavaEclipseLinkConversionValue buildConversionValue(EclipseLinkConversionValueAnnotation conversionValueAnnotation) {
- return new JavaEclipseLinkConversionValue(this, conversionValueAnnotation);
- }
-
- protected void syncConversionValues() {
- this.conversionValueContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<EclipseLinkConversionValueAnnotation> getConversionValueAnnotations() {
- return this.converterAnnotation.getConversionValues();
- }
-
- protected ContextListContainer<JavaEclipseLinkConversionValue, EclipseLinkConversionValueAnnotation> buildConversionValueContainer() {
- ConversionValueContainer container = new ConversionValueContainer();
- container.initialize();
- return container;
- }
-
- /**
- * conversion value container
- */
- protected class ConversionValueContainer
- extends ContextListContainer<JavaEclipseLinkConversionValue, EclipseLinkConversionValueAnnotation> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return CONVERSION_VALUES_LIST;
- }
-
- @Override
- protected JavaEclipseLinkConversionValue buildContextElement(EclipseLinkConversionValueAnnotation resourceElement) {
- return JavaEclipseLinkObjectTypeConverter.this.buildConversionValue(resourceElement);
- }
-
- @Override
- protected ListIterable<EclipseLinkConversionValueAnnotation> getResourceElements() {
- return JavaEclipseLinkObjectTypeConverter.this.getConversionValueAnnotations();
- }
-
- @Override
- protected EclipseLinkConversionValueAnnotation getResourceElement(JavaEclipseLinkConversionValue contextElement) {
- return contextElement.getConversionValueAnnotation();
- }
- }
-
-
- // ********** data values **********
-
- public Iterable<String> getDataValues() {
- return new TransformationIterable<JavaEclipseLinkConversionValue, String>(this.getConversionValues()) {
- @Override
- protected String transform(JavaEclipseLinkConversionValue conversionValue) {
- return conversionValue.getDataValue();
- }
- };
- }
-
- public int getDataValuesSize() {
- return this.getConversionValuesSize();
- }
-
-
- // ********** default object value **********
-
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String value) {
- this.converterAnnotation.setDefaultObjectValue(value);
- this.setDefaultObjectValue_(value);
- }
-
- protected void setDefaultObjectValue_(String value) {
- String old = this.defaultObjectValue;
- this.defaultObjectValue = value;
- this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkObjectTypeConverter> getType() {
- return EclipseLinkObjectTypeConverter.class;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.checkForDuplicateDataValues(messages, astRoot);
- for (JavaEclipseLinkConversionValue conversionValue : this.getConversionValues()) {
- conversionValue.validate(messages, reporter, astRoot);
- }
- }
-
- protected void checkForDuplicateDataValues(List<IMessage> messages, CompilationUnit astRoot) {
- for (ArrayList<JavaEclipseLinkConversionValue> dups : this.mapConversionValuesByDataValue().values()) {
- if (dups.size() > 1) {
- for (JavaEclipseLinkConversionValue dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE,
- new String[] {dup.getDataValue()},
- this,
- dup.getDataValueTextRange(astRoot)
- )
- );
- }
- }
- }
- }
-
- protected HashMap<String, ArrayList<JavaEclipseLinkConversionValue>> mapConversionValuesByDataValue() {
- HashMap<String, ArrayList<JavaEclipseLinkConversionValue>> map = new HashMap<String, ArrayList<JavaEclipseLinkConversionValue>>(this.getConversionValuesSize());
- for (JavaEclipseLinkConversionValue conversionValue : this.getConversionValues()) {
- String dataValue = conversionValue.getDataValue();
- ArrayList<JavaEclipseLinkConversionValue> list = map.get(dataValue);
- if (list == null) {
- list = new ArrayList<JavaEclipseLinkConversionValue>();
- map.put(dataValue, list);
- }
- list.add(conversionValue);
- }
- return map;
- }
-
- @Override
- public boolean isEquivalentTo(JpaNamedContextNode node) {
- return super.isEquivalentTo(node)
- && this.isEquivalentTo((EclipseLinkObjectTypeConverter) node);
- }
-
- protected boolean isEquivalentTo(EclipseLinkObjectTypeConverter converter) {
- return Tools.valuesAreEqual(this.fullyQualifiedObjectType, converter.getFullyQualifiedObjectType()) &&
- Tools.valuesAreEqual(this.fullyQualifiedDataType, converter.getFullyQualifiedDataType()) &&
- Tools.valuesAreEqual(this.defaultObjectValue, converter.getDefaultObjectValue()) &&
- this.conversionValuesAreEquivalentTo(converter);
- }
-
- protected boolean conversionValuesAreEquivalentTo(EclipseLinkObjectTypeConverter converter) {
- // get fixed lists of the conversion values
- ArrayList<JavaEclipseLinkConversionValue> conversionValues1 = CollectionTools.list(this.getConversionValues());
- ArrayList<? extends EclipseLinkConversionValue> conversionValues2 = CollectionTools.list(converter.getConversionValues());
- if (conversionValues1.size() != conversionValues2.size()) {
- return false;
- }
- for (int i = 0; i < conversionValues1.size(); i++) {
- if ( ! conversionValues1.get(i).isEquivalentTo(conversionValues2.get(i))) {
- return false;
- }
- }
- return true;
- }
-
-
- // ********** metadata conversion **********
-
- @Override
- public void convertTo(OrmEclipseLinkConverterContainer ormConverterContainer) {
- ormConverterContainer.addObjectTypeConverter().convertFrom(this);
- }
-
- @Override
- public void delete() {
- this.getParent().removeObjectTypeConverter(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java
deleted file mode 100644
index 8dfc2c5ea7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToManyMapping.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappingRelationship;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkOneToManyMapping
- extends AbstractJavaOneToManyMapping
- implements EclipseLinkOneToManyMapping2_0, EclipseLinkJavaConvertibleMapping
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
- protected final JavaEclipseLinkPrivateOwned privateOwned;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
-
- public JavaEclipseLinkOneToManyMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- this.privateOwned = new JavaEclipseLinkPrivateOwned(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.privateOwned.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- this.converterContainer.update();
- }
-
-
- // ********** private owned **********
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** relationship **********
-
- @Override
- public EclipseLinkJavaOneToManyRelationship2_0 getRelationship() {
- return (EclipseLinkJavaOneToManyRelationship) super.getRelationship();
- }
-
- @Override
- protected JavaMappingRelationship buildRelationship() {
- return new EclipseLinkJavaOneToManyRelationship(this);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- this.privateOwned.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java
deleted file mode 100644
index ae6866d9d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkOneToOneMapping.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkOneToOneMapping
- extends AbstractJavaOneToOneMapping
- implements EclipseLinkOneToOneMapping2_0, EclipseLinkJavaConvertibleMapping
-{
- protected final JavaEclipseLinkJoinFetch joinFetch;
-
- protected final JavaEclipseLinkPrivateOwned privateOwned;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
-
- public JavaEclipseLinkOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.joinFetch = new JavaEclipseLinkJoinFetch(this);
- this.privateOwned = new JavaEclipseLinkPrivateOwned(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.privateOwned.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- this.converterContainer.update();
- }
-
-
- // ********** private owned **********
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.joinFetch.validate(messages, reporter, astRoot);
- this.privateOwned.validate(messages, reporter, astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java
deleted file mode 100644
index 01b6e9238b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkPrivateOwned.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-public class JavaEclipseLinkPrivateOwned
- extends AbstractJavaJpaContextNode
- implements EclipseLinkPrivateOwned
-{
- protected boolean privateOwned;
-
-
- public JavaEclipseLinkPrivateOwned(JavaAttributeMapping parent) {
- super(parent);
- this.privateOwned = this.buildPrivateOwned();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setPrivateOwned_(this.buildPrivateOwned());
- }
-
-
- // ********** private owned **********
-
- public boolean isPrivateOwned() {
- return this.privateOwned;
- }
-
- public void setPrivateOwned(boolean privateOwned) {
- if (privateOwned != this.privateOwned) {
- EclipseLinkPrivateOwnedAnnotation annotation = this.getPrivateOwnedAnnotation();
- if (privateOwned) {
- if (annotation == null) {
- this.addPrivateOwnedAnnotation();
- }
- } else {
- if (annotation != null) {
- this.removePrivateOwnedAnnotation();
- }
- }
-
- this.setPrivateOwned_(privateOwned);
- }
- }
-
- protected void setPrivateOwned_(boolean privateOwned) {
- boolean old = this.privateOwned;
- this.privateOwned = privateOwned;
- this.firePropertyChanged(PRIVATE_OWNED_PROPERTY, old, privateOwned);
- }
-
- protected boolean buildPrivateOwned() {
- return this.getPrivateOwnedAnnotation() != null;
- }
-
-
- // ********** private owned annotation **********
-
- protected EclipseLinkPrivateOwnedAnnotation getPrivateOwnedAnnotation() {
- return (EclipseLinkPrivateOwnedAnnotation) this.getResourceAttribute().getAnnotation(this.getPrivateOwnedAnnotationName());
- }
-
- protected EclipseLinkPrivateOwnedAnnotation addPrivateOwnedAnnotation() {
- return (EclipseLinkPrivateOwnedAnnotation) this.getResourceAttribute().addAnnotation(this.getPrivateOwnedAnnotationName());
- }
-
- protected void removePrivateOwnedAnnotation() {
- this.getResourceAttribute().removeAnnotation(this.getPrivateOwnedAnnotationName());
- }
-
- protected String getPrivateOwnedAnnotationName() {
- return EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaAttributeMapping getParent() {
- return (JavaAttributeMapping) super.getParent();
- }
-
- protected JavaAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected JavaResourceAttribute getResourceAttribute() {
- return this.getAttributeMapping().getResourceAttribute();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkPrivateOwnedAnnotation annotation = this.getPrivateOwnedAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java
deleted file mode 100644
index 0cc0da0052..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkReadOnly.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-public class JavaEclipseLinkReadOnly
- extends AbstractJavaJpaContextNode
- implements EclipseLinkReadOnly
-{
- protected Boolean specifiedReadOnly; // TRUE or null
-
-
- public JavaEclipseLinkReadOnly(JavaEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
- this.specifiedReadOnly = this.buildSpecifiedReadOnly();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedReadOnly_(this.buildSpecifiedReadOnly());
- }
-
-
- // ********** read-only **********
-
- public boolean isReadOnly() {
- return (this.specifiedReadOnly != null) ? this.specifiedReadOnly.booleanValue() : this.isDefaultReadOnly();
- }
-
- public Boolean getSpecifiedReadOnly() {
- return this.specifiedReadOnly;
- }
-
- public void setSpecifiedReadOnly(Boolean readOnly) {
- readOnly = (readOnly == null) ? null : readOnly.booleanValue() ? readOnly : null;
- if (this.valuesAreDifferent(readOnly, this.specifiedReadOnly)) {
- EclipseLinkReadOnlyAnnotation annotation = this.getReadOnlyAnnotation();
- if (readOnly != null) {
- if (annotation == null) {
- this.addReadOnlyAnnotation();
- }
- } else {
- if (annotation != null) {
- this.removeReadOnlyAnnotation();
- }
- }
-
- this.setSpecifiedReadOnly_(readOnly);
- }
- }
-
- protected void setSpecifiedReadOnly_(Boolean readOnly) {
- Boolean old = this.specifiedReadOnly;
- this.specifiedReadOnly = readOnly;
- this.firePropertyChanged(SPECIFIED_READ_ONLY_PROPERTY, old, readOnly);
- }
-
- private Boolean buildSpecifiedReadOnly() {
- return (this.getReadOnlyAnnotation() == null) ? null : Boolean.TRUE;
- }
-
- public boolean isDefaultReadOnly() {
- return DEFAULT_READ_ONLY;
- }
-
-
- // ********** read-only annotation **********
-
- protected EclipseLinkReadOnlyAnnotation getReadOnlyAnnotation() {
- return (EclipseLinkReadOnlyAnnotation) this.getJavaResourceType().getAnnotation(this.getReadOnlyAnnotationName());
- }
-
- protected void addReadOnlyAnnotation() {
- this.getJavaResourceType().addAnnotation(this.getReadOnlyAnnotationName());
- }
-
- protected void removeReadOnlyAnnotation() {
- this.getJavaResourceType().removeAnnotation(this.getReadOnlyAnnotationName());
- }
-
- protected String getReadOnlyAnnotationName() {
- return EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME;
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (JavaEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected JavaPersistentType getPersistentType() {
- return this.getTypeMapping().getPersistentType();
- }
-
- protected JavaResourceType getJavaResourceType() {
- return this.getTypeMapping().getJavaResourceType();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- TextRange textRange = this.getAnnotationTextRange(astRoot);
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange(astRoot);
- }
-
- protected TextRange getAnnotationTextRange(CompilationUnit astRoot) {
- EclipseLinkReadOnlyAnnotation annotation = this.getReadOnlyAnnotation();
- return (annotation == null) ? null : annotation.getTextRange(astRoot);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java
deleted file mode 100644
index c368e7c247..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructConverter.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.StructConverter</code>
- */
-public class JavaEclipseLinkStructConverter
- extends JavaEclipseLinkConverterClassConverter<EclipseLinkStructConverterAnnotation>
- implements EclipseLinkStructConverter
-{
- public JavaEclipseLinkStructConverter(JavaEclipseLinkConverterContainer parent, EclipseLinkStructConverterAnnotation converterAnnotation) {
- super(parent, converterAnnotation, converterAnnotation.getConverter());
- }
-
-
- // ********** converter class **********
-
- @Override
- protected String getAnnotationConverterClass() {
- return this.converterAnnotation.getConverter();
- }
-
- @Override
- protected void setAnnotationConverterClass(String converterClass) {
- this.converterAnnotation.setConverter(converterClass);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkStructConverter> getType() {
- return EclipseLinkStructConverter.class;
- }
-
-
- // ********** validation **********
-
- @Override
- protected String getEclipseLinkConverterInterface() {
- return ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected String getEclipseLinkConverterInterfaceErrorMessage() {
- return EclipseLinkJpaValidationMessages.STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER;
- }
-
- @Override
- protected TextRange getAnnotationConverterClassTextRange() {
- return this.converterAnnotation.getConverterTextRange();
- }
-
- /**
- * Since the converter class is a string, it must be fully-qualified.
- */
- public String getFullyQualifiedConverterClass() {
- return this.getConverterClass();
- }
-
- // ********** metadata conversion **********
-
- @Override
- public void convertTo(OrmEclipseLinkConverterContainer ormConverterContainer) {
- ormConverterContainer.addStructConverter().convertFrom(this);
- }
-
- @Override
- public void delete() {
- this.getParent().removeStructConverter(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructureMapping2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructureMapping2_3.java
deleted file mode 100644
index f1a6915182..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkStructureMapping2_3.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructureMapping2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructureAnnotation2_3;
-
-public class JavaEclipseLinkStructureMapping2_3
- extends AbstractJavaAttributeMapping<EclipseLinkStructureAnnotation2_3>
- implements EclipseLinkStructureMapping2_3
-{
-
- public JavaEclipseLinkStructureMapping2_3(JavaPersistentAttribute parent) {
- super(parent);
- }
-
-
- // ********** misc **********
-
- public String getKey() {
- return EclipseLinkMappingKeys.STRUCTURE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkStructureAnnotation2_3.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java
deleted file mode 100644
index b6ea98a647..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTransformationMapping.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-public class JavaEclipseLinkTransformationMapping
- extends AbstractJavaAttributeMapping<EclipseLinkTransformationAnnotation>
- implements EclipseLinkTransformationMapping, EclipseLinkJavaConvertibleMapping
-{
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- public JavaEclipseLinkTransformationMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** misc **********
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkTransformationAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java
deleted file mode 100644
index ec658aa847..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkTypeConverter.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.TypeConverter</code>
- */
-public class JavaEclipseLinkTypeConverter
- extends JavaEclipseLinkConverter<EclipseLinkTypeConverterAnnotation>
- implements EclipseLinkTypeConverter
-{
- private String dataType;
- private String fullyQualifiedDataType;
-
- private String objectType;
- private String fullyQualifiedObjectType;
-
-
- public JavaEclipseLinkTypeConverter(JavaEclipseLinkConverterContainer parent, EclipseLinkTypeConverterAnnotation converterAnnotation) {
- super(parent, converterAnnotation);
- this.dataType = this.converterAnnotation.getDataType();
- this.objectType = this.converterAnnotation.getObjectType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataType_(this.converterAnnotation.getDataType());
- this.setObjectType_(this.converterAnnotation.getObjectType());
- }
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedDataType(this.converterAnnotation.getFullyQualifiedDataType());
- this.setFullyQualifiedObjectType(this.converterAnnotation.getFullyQualifiedObjectType());
- }
-
-
- // ********** data type **********
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- this.converterAnnotation.setDataType(dataType);
- this.setDataType_(dataType);
- }
-
- protected void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
-
-
- // ********** fully qualified data type **********
-
- public String getFullyQualifiedDataType() {
- return this.fullyQualifiedDataType;
- }
-
- protected void setFullyQualifiedDataType(String dataType) {
- String old = this.fullyQualifiedDataType;
- this.fullyQualifiedDataType = dataType;
- this.firePropertyChanged(FULLY_QUALIFIED_DATA_TYPE_PROPERTY, old, dataType);
- }
-
-
- // ********** object type **********
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- this.converterAnnotation.setObjectType(objectType);
- this.setObjectType_(objectType);
- }
-
- protected void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
-
- // ********** fully qualified object type **********
-
- public String getFullyQualifiedObjectType() {
- return this.fullyQualifiedObjectType;
- }
-
- protected void setFullyQualifiedObjectType(String objectType) {
- String old = this.fullyQualifiedObjectType;
- this.fullyQualifiedObjectType = objectType;
- this.firePropertyChanged(FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkTypeConverter> getType() {
- return EclipseLinkTypeConverter.class;
- }
-
-
- // ********** validation *********
-
- @Override
- public boolean isEquivalentTo(JpaNamedContextNode node) {
- return super.isEquivalentTo(node)
- && this.isEquivalentTo((EclipseLinkTypeConverter) node);
- }
-
- protected boolean isEquivalentTo(EclipseLinkTypeConverter converter) {
- return Tools.valuesAreEqual(this.fullyQualifiedDataType, converter.getFullyQualifiedDataType()) &&
- Tools.valuesAreEqual(this.fullyQualifiedObjectType, converter.getFullyQualifiedObjectType());
- }
-
-
- // ********** metadata conversion **********
-
- @Override
- public void convertTo(OrmEclipseLinkConverterContainer ormConverterContainer) {
- ormConverterContainer.addTypeConverter().convertFrom(this);
- }
-
- @Override
- public void delete() {
- this.getParent().removeTypeConverter(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java
deleted file mode 100644
index 4aca27cee5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVariableOneToOneMapping.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-public class JavaEclipseLinkVariableOneToOneMapping
- extends AbstractJavaAttributeMapping<EclipseLinkVariableOneToOneAnnotation>
- implements EclipseLinkVariableOneToOneMapping, EclipseLinkJavaConvertibleMapping
-{
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
- public JavaEclipseLinkVariableOneToOneMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** misc **********
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java
deleted file mode 100644
index 92b1f9bfcf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/JavaEclipseLinkVersionMapping.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import java.util.List;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.java.JavaConverter;
-import org.eclipse.jpt.jpa.core.context.java.JavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class JavaEclipseLinkVersionMapping
- extends AbstractJavaVersionMapping
- implements EclipseLinkVersionMapping, EclipseLinkJavaConvertibleMapping
-{
- protected final JavaEclipseLinkMutable mutable;
-
- protected final JavaEclipseLinkConverterContainer converterContainer;
-
-
- public JavaEclipseLinkVersionMapping(JavaPersistentAttribute parent) {
- super(parent);
- this.mutable = new JavaEclipseLinkMutable(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- this.converterContainer.update();
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converters **********
-
- public JavaEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected JavaEclipseLinkConverterContainer buildConverterContainer() {
- return new JavaEclipseLinkConverterContainerImpl(this);
- }
-
- // ********** converter container parent adapter **********
-
- public JavaJpaContextNode getConverterContainerParent() {
- return this; // no adapter
- }
-
- public JavaResourceAnnotatedElement getJavaResourceAnnotatedElement() {
- return this.getResourceAttribute();
- }
-
- public boolean parentSupportsConverters() {
- return ! this.getPersistentAttribute().isVirtual();
- }
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<JavaConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<JavaConverter.Adapter>(JavaEclipseLinkConvert.Adapter.instance(), super.getConverterAdapters());
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter, CompilationUnit astRoot) {
- super.validate(messages, reporter, astRoot);
- this.mutable.validate(messages, reporter, astRoot);
- }
-
- @Override
- protected void validateAttributeType(List<IMessage> messages, CompilationUnit astRoot) {
- if (!ArrayTools.contains(SUPPORTED_TYPE_NAMES, this.getPersistentAttribute().getTypeName())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange(astRoot)
- )
- );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/NullJavaEclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/NullJavaEclipseLinkMultitenancy2_3.java
deleted file mode 100644
index 47b1b00a4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/NullJavaEclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaVirtualTenantDiscriminatorColumn2_3;
-
-public class NullJavaEclipseLinkMultitenancy2_3
- extends AbstractJavaJpaContextNode
- implements JavaEclipseLinkMultitenancy2_3
-{
-
- public NullJavaEclipseLinkMultitenancy2_3(JavaEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
- }
-
- // ********** multitenant **********
-
- public boolean isMultitenant() {
- return false;
- }
-
- public boolean isDefaultMultitenant() {
- return false;
- }
-
- public boolean isSpecifiedMultitenant() {
- return false;
- }
-
- public void setSpecifiedMultitenant(boolean isMultitenant) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
-
- // ********** type **********
-
- public EclipseLinkMultitenantType2_3 getType() {
- return null;
- }
-
- public EclipseLinkMultitenantType2_3 getSpecifiedType() {
- return null;
- }
-
- public void setSpecifiedType(EclipseLinkMultitenantType2_3 type) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public EclipseLinkMultitenantType2_3 getDefaultType() {
- return null;
- }
-
- public boolean isIncludeCriteria() {
- return false;
- }
-
- public Boolean getSpecifiedIncludeCriteria() {
- return null;
- }
-
- public void setSpecifiedIncludeCriteria(Boolean includeCriteria) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public boolean isDefaultIncludeCriteria() {
- return false;
- }
-
- public ListIterable<JavaReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public ListIterable<JavaTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return false;
- }
-
- public JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public JavaTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public ListIterable<JavaVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public boolean specifiedTenantDiscriminatorColumnsAllowed() {
- return false;
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/SpecifiedJavaEclipseLinkPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/SpecifiedJavaEclipseLinkPersistentAttribute.java
deleted file mode 100644
index 0549444725..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/java/SpecifiedJavaEclipseLinkPersistentAttribute.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.Accessor;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkPersistentAttributeValidator;
-
-/**
- * EclipseLink Java persistent attribute
- */
-public class SpecifiedJavaEclipseLinkPersistentAttribute
- extends AbstractJavaPersistentAttribute
- implements JavaEclipseLinkPersistentAttribute
-{
-
- public SpecifiedJavaEclipseLinkPersistentAttribute(PersistentType parent, JavaResourceField resourceField) {
- super(parent,resourceField);
- }
-
- public SpecifiedJavaEclipseLinkPersistentAttribute(PersistentType parent, JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- super(parent, resourceGetter, resourceSetter);
- }
-
- public SpecifiedJavaEclipseLinkPersistentAttribute(PersistentType parent, Accessor accessor) {
- super(parent, accessor);
- }
-
- // ********** mapping **********
-
- @Override
- protected JavaAttributeMappingDefinition getSpecifiedMappingDefinition(String key) {
- if (this.specifiedKeyIsInvalid(key)) {
- throw new IllegalArgumentException("invalid mapping: " + key); //$NON-NLS-1$
- }
- return super.getSpecifiedMappingDefinition(key);
- }
-
- /**
- * EclipseLink does not support setting an attribute with a default 1:1
- * mapping to a specified mapping of ID; because the resulting ID annotation
- * indicates a primary key derived from the 1:1 mapping, <em>not</em> an ID
- * mapping.
- */
- protected boolean specifiedKeyIsInvalid(String key) {
- return Tools.valuesAreEqual(key, MappingKeys.ID_ATTRIBUTE_MAPPING_KEY) &&
- Tools.valuesAreEqual(this.getDefaultMappingKey(), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-
-
- // ********** type **********
-
- /**
- * Return whether the attribute's type is a subclass of
- * <code>java.util.Date</code> or <code>java.util.Calendar</code>.
- */
- public boolean typeIsDateOrCalendar() {
- return this.getResourceAttribute().typeIsSubTypeOf(DATE_TYPE_NAME)
- || this.getResourceAttribute().typeIsSubTypeOf(CALENDAR_TYPE_NAME);
- }
-
- public boolean typeIsSerializable() {
- return this.getResourceAttribute().typeIsVariablePrimitive()
- || this.getResourceAttribute().typeIsSubTypeOf(JDTTools.SERIALIZABLE_CLASS_NAME);
- }
-
- public boolean typeIsValidForVariableOneToOne() {
- return this.getResourceAttribute().typeIsInterface()
- && this.interfaceIsValidForVariableOneToOne(getTypeName());
- }
-
- protected boolean interfaceIsValidForVariableOneToOne(String interfaceName) {
- return ! this.interfaceIsInvalidForVariableOneToOne(interfaceName);
- }
-
- // TODO we could probably add more interfaces to this list...
- protected boolean interfaceIsInvalidForVariableOneToOne(String interfaceName) {
- return (interfaceName == null) ||
- this.typeIsContainer(interfaceName) ||
- interfaceName.equals("org.eclipse.persistence.indirection.ValueHolderInterface"); //$NON-NLS-1$
- }
-
-
- // ********** validation **********
-
- @Override
- protected JptValidator buildAttributeValidator(CompilationUnit astRoot) {
- return new EclipseLinkPersistentAttributeValidator(this, buildTextRangeResolver(astRoot));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java
deleted file mode 100644
index cb76b92120..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractEclipseLinkOrmXmlDefinition.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-
-public abstract class AbstractEclipseLinkOrmXmlDefinition
- extends AbstractOrmXmlDefinition
-{
- protected AbstractEclipseLinkOrmXmlDefinition() {
- super();
- }
-
- public EFactory getResourceNodeFactory() {
- return EclipseLinkOrmFactory.eINSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index 962339cc9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.PersistentAttribute2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-
-public abstract class AbstractOrmEclipseLinkBasicCollectionMapping
- extends AbstractOrmAttributeMapping<XmlBasicCollection>
- implements EclipseLinkBasicCollectionMapping
-{
- protected AbstractOrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection xmlMapping) {
- super(parent, xmlMapping);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addXmlAttributeMappingTo(org.eclipse.jpt.jpa.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicCollections().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicCollections().remove(this.xmlAttributeMapping);
- }
-
- public int getXmlSequence() {
- return 23;
- }
-
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((PersistentAttribute2_0) getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- String targetTypeName = null;
- JavaPersistentAttribute javaPersistentAttribute = getJavaPersistentAttribute();
- if (javaPersistentAttribute != null) {
- targetTypeName = javaPersistentAttribute.getMultiReferenceTargetTypeName();
- }
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java
deleted file mode 100644
index 2a7bf337c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/AbstractOrmEclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.PersistentAttribute2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-
-public abstract class AbstractOrmEclipseLinkBasicMapMapping
- extends AbstractOrmAttributeMapping<XmlBasicMap>
- implements EclipseLinkBasicMapMapping
-{
- protected AbstractOrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap xmlMapping) {
- super(parent, xmlMapping);
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public void addXmlAttributeMappingTo(org.eclipse.jpt.jpa.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicMaps().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes resourceAttributes) {
- ((Attributes) resourceAttributes).getBasicMaps().remove(this.xmlAttributeMapping);
- }
-
-
- public int getXmlSequence() {
- return 27;
- }
-
-
- // ********** metamodel **********
- @Override
- protected String getMetamodelFieldTypeName() {
- return ((PersistentAttribute2_0) getPersistentAttribute()).getMetamodelContainerFieldTypeName();
- }
-
- @Override
- public String getMetamodelTypeName() {
- String targetTypeName = null;
- JavaPersistentAttribute javaPersistentAttribute = getJavaPersistentAttribute();
- if (javaPersistentAttribute != null) {
- targetTypeName = javaPersistentAttribute.getMultiReferenceTargetTypeName();
- }
- return (targetTypeName != null) ? targetTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- }
-
- @Override
- protected void addMetamodelFieldTypeArgumentNamesTo(ArrayList<String> typeArgumentNames) {
- this.addMetamodelFieldMapKeyTypeArgumentNameTo(typeArgumentNames);
- super.addMetamodelFieldTypeArgumentNamesTo(typeArgumentNames);
- }
-
- protected void addMetamodelFieldMapKeyTypeArgumentNameTo(ArrayList<String> typeArgumentNames) {
- String mapKeyTypeName = null;
- JavaPersistentAttribute javaPersistentAttribute = getJavaPersistentAttribute();
- if (javaPersistentAttribute != null) {
- mapKeyTypeName = javaPersistentAttribute.getMultiReferenceMapKeyTypeName();
- }
- mapKeyTypeName = mapKeyTypeName != null ? mapKeyTypeName : MetamodelField.DEFAULT_TYPE_NAME;
- typeArgumentNames.add(mapKeyTypeName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java
deleted file mode 100644
index 3222b02607..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkEntityMappingsImpl.java
+++ /dev/null
@@ -1,609 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractEntityMappings;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmVirtualTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkEntityMappingsImpl
- extends AbstractEntityMappings
- implements
- EclipseLinkEntityMappings,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
- protected final ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> specifiedTenantDiscriminatorColumnContainer;
- protected final OrmReadOnlyTenantDiscriminatorColumn2_3.Owner tenantDiscriminatorColumnOwner;
-
- protected final ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> defaultTenantDiscriminatorColumnContainer;
-
-
- protected String specifiedGetMethod;
- protected String defaultGetMethod;
-
- protected String specifiedSetMethod;
- protected String defaultSetMethod;
-
-
- public EclipseLinkEntityMappingsImpl(OrmXml parent, XmlEntityMappings resource) {
- super(parent, resource);
- this.converterContainer = this.buildConverterContainer();
- this.tenantDiscriminatorColumnOwner = this.buildTenantDiscriminatorColumnOwner();
- this.specifiedTenantDiscriminatorColumnContainer = this.buildSpecifiedTenantDiscriminatorColumnContainer();
- this.defaultTenantDiscriminatorColumnContainer = this.buildDefaultTenantDiscriminatorColumnContainer();
- this.specifiedGetMethod = this.buildSpecifiedGetMethod();
- this.specifiedSetMethod = this.buildSpecifiedSetMethod();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.syncSpecifiedTenantDiscriminatorColumns();
- this.setSpecifiedGetMethod_(this.buildSpecifiedGetMethod());
- this.setSpecifiedSetMethod_(this.buildSpecifiedSetMethod());
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- this.updateNodes(this.getSpecifiedTenantDiscriminatorColumns());
- this.updateDefaultTenantDiscriminatorColumns();
- this.setDefaultGetMethod(this.buildDefaultGetMethod());
- this.setDefaultSetMethod(this.buildDefaultSetMethod());
- }
-
- @Override
- public XmlEntityMappings getXmlEntityMappings() {
- return (XmlEntityMappings) super.getXmlEntityMappings();
- }
-
-
- // ********** types **********
-
- /**
- * preconditions:
- * getPackage() is not null
- * unqualifiedClassName is not qualified (contains no '.')
- */
- @Override
- protected String prependGlobalPackage(String unqualifiedClassName) {
- // Format of global package is "foo.bar."
- if (this.getPackage().endsWith(".")) { //$NON-NLS-1$
- return this.getPackage() + unqualifiedClassName;
- }
- // Format of global package is "foo.bar"
- return super.prependGlobalPackage(unqualifiedClassName);
- }
-
-
- // ********** converter container **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, (XmlEntityMappings) this.xmlEntityMappings);
- }
-
- public int getNumberSupportedConverters() {
- return Integer.MAX_VALUE;
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getMappingFileConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getTypeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getTypeMappingConverters() {
- return new CompositeIterable<EclipseLinkConverter>(this.getTypeMappingConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getTypeMappingConverterLists() {
- return new TransformationIterable<OrmTypeMapping, Iterable<EclipseLinkConverter>>(this.getTypeMappings()) {
- @Override
- protected Iterable<EclipseLinkConverter> transform(OrmTypeMapping typeMapping) {
- return ((EclipseLinkTypeMapping) typeMapping).getConverters();
- }
- };
- }
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getReadOnlySpecifiedTenantDiscriminatorColumns() :
- this.getReadOnlyDefaultTenantDiscriminatorColumns();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getSpecifiedTenantDiscriminatorColumnsSize() :
- this.getDefaultTenantDiscriminatorColumnsSize();
- }
-
- // ********** specified tenant discriminator columns **********
-
- public ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getReadOnlySpecifiedTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(this.getSpecifiedTenantDiscriminatorColumns());
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return this.getSpecifiedTenantDiscriminatorColumnsSize() != 0;
- }
-
- public OrmTenantDiscriminatorColumn2_3 getSpecifiedTenantDiscriminatorColumn(int index) {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElement(index);
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- return this.addSpecifiedTenantDiscriminatorColumn(this.getSpecifiedTenantDiscriminatorColumnsSize());
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- XmlTenantDiscriminatorColumn xmlJoinColumn = this.buildXmlTenantDiscriminatorColumn();
- OrmTenantDiscriminatorColumn2_3 joinColumn = this.specifiedTenantDiscriminatorColumnContainer.addContextElement(index, xmlJoinColumn);
- this.getXmlEntityMappings().getTenantDiscriminatorColumns().add(index, xmlJoinColumn);
- return joinColumn;
- }
-
- protected XmlTenantDiscriminatorColumn buildXmlTenantDiscriminatorColumn() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn();
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.removeSpecifiedTenantDiscriminatorColumn(this.specifiedTenantDiscriminatorColumnContainer.indexOfContextElement(tenantDiscriminatorColumn));
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- this.specifiedTenantDiscriminatorColumnContainer.removeContextElement(index);
- this.getXmlEntityMappings().getTenantDiscriminatorColumns().remove(index);
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- this.specifiedTenantDiscriminatorColumnContainer.moveContextElement(targetIndex, sourceIndex);
- this.getXmlEntityMappings().getTenantDiscriminatorColumns().move(targetIndex, sourceIndex);
- }
-
- protected void syncSpecifiedTenantDiscriminatorColumns() {
- this.specifiedTenantDiscriminatorColumnContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getXmlTenantDiscriminatorColumns() {
- if (getXmlEntityMappings() == null) {
- return EmptyListIterable.instance();
- }
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlTenantDiscriminatorColumn_2_3>(this.getXmlEntityMappings().getTenantDiscriminatorColumns());
- }
-
- /**
- * specified tenant discriminator column container
- */
- protected class SpecifiedTenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmTenantDiscriminatorColumn2_3 buildContextElement(XmlTenantDiscriminatorColumn_2_3 resourceElement) {
- return EclipseLinkEntityMappingsImpl.this.buildTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getResourceElements() {
- return EclipseLinkEntityMappingsImpl.this.getXmlTenantDiscriminatorColumns();
- }
- @Override
- protected XmlTenantDiscriminatorColumn_2_3 getResourceElement(OrmTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getXmlColumn();
- }
- }
-
- protected OrmReadOnlyTenantDiscriminatorColumn2_3.Owner buildTenantDiscriminatorColumnOwner() {
- return new TenantDiscriminatorColumnOwner();
- }
-
- protected SpecifiedTenantDiscriminatorColumnContainer buildSpecifiedTenantDiscriminatorColumnContainer() {
- SpecifiedTenantDiscriminatorColumnContainer container = new SpecifiedTenantDiscriminatorColumnContainer();
- container.initialize();
- return container;
- }
-
- protected OrmTenantDiscriminatorColumn2_3 buildTenantDiscriminatorColumn(XmlTenantDiscriminatorColumn_2_3 xmlTenantDiscriminatorColumn) {
- return new EclipseLinkOrmTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, xmlTenantDiscriminatorColumn);
- }
-
-
- // ********** default tenant discriminator columns **********
-
- public ListIterable<OrmVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getReadOnlyDefaultTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(this.getDefaultTenantDiscriminatorColumns());
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- protected void clearDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.clearContextList();
- }
-
- /**
- * If there are any specified tenant discriminator columns, then there are no default
- * tenant discriminator columns.
- * @see #getTenantDiscriminatorColumnsForDefaults()
- */
- protected void updateDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.update();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumnsForDefaults() {
- if (this.getSpecifiedTenantDiscriminatorColumnsSize() > 0) {
- return EmptyListIterable.instance();
- }
- return getContextDefaultTenantDiscriminatorColumns();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getContextDefaultTenantDiscriminatorColumns() {
- return this.getPersistenceUnit().getDefaultTenantDiscriminatorColumns();
- }
-
- protected void moveDefaultTenantDiscriminatorColumn(int index, OrmVirtualTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.defaultTenantDiscriminatorColumnContainer.moveContextElement(index, tenantDiscriminatorColumn);
- }
-
- protected OrmVirtualTenantDiscriminatorColumn2_3 addDefaultTenantDiscriminatorColumn(int index, OrmTenantDiscriminatorColumn2_3 ormTenantDiscriminatorColumn) {
- return this.defaultTenantDiscriminatorColumnContainer.addContextElement(index, ormTenantDiscriminatorColumn);
- }
-
- protected OrmVirtualTenantDiscriminatorColumn2_3 buildVirtualTenantDiscriminatorColumn(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- return new GenericOrmVirtualTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, tenantDiscriminatorColumn);
- }
-
- protected void removeDefaultTenantDiscriminatorColumn(OrmVirtualTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.defaultTenantDiscriminatorColumnContainer.removeContextElement(tenantDiscriminatorColumn);
- }
-
- protected DefaultTenantDiscriminatorColumnContainer buildDefaultTenantDiscriminatorColumnContainer() {
- return new DefaultTenantDiscriminatorColumnContainer();
- }
-
-
- /**
- * default tenant discriminator column container
- */
- protected class DefaultTenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmVirtualTenantDiscriminatorColumn2_3 buildContextElement(ReadOnlyTenantDiscriminatorColumn2_3 resourceElement) {
- return EclipseLinkEntityMappingsImpl.this.buildVirtualTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getResourceElements() {
- return EclipseLinkEntityMappingsImpl.this.getTenantDiscriminatorColumnsForDefaults();
- }
- @Override
- protected ReadOnlyTenantDiscriminatorColumn2_3 getResourceElement(OrmVirtualTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getOverriddenColumn();
- }
- }
-
-
- // ********** OrmReadOnlyTenantDiscriminatorColumn.Owner implementation **********
-
- protected class TenantDiscriminatorColumnOwner
- implements OrmReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
-
- public String getDefaultContextPropertyName() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_CONTEXT_PROPERTY;
- }
-
- public boolean getDefaultPrimaryKey() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_PRIMARY_KEY;
- }
-
- public int getDefaultLength() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- /**
- * No default table name in the context of entity mappings
- */
- public String getDefaultTableName() {
- return null;
- }
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME;
- }
-
- /**
- * No table in the context of entity mappings
- */
- public Table resolveDbTable(String tableName) {
- return null;
- }
-
- public Iterable<String> getCandidateTableNames() {
- return EmptyIterable.instance();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- /**
- * no column validation can be done in the context of the persistence unit defaults
- */
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn column, NamedColumnTextRangeResolver textRangeResolver) {
- return JptValidator.Null.instance();
- }
-
- public TextRange getValidationTextRange() {
- return EclipseLinkEntityMappingsImpl.this.getValidationTextRange();
- }
- }
-
-
- //*************** get method *****************
-
- public String getGetMethod() {
- String specifiedGetMethod = this.getSpecifiedGetMethod();
- return (specifiedGetMethod != null) ? specifiedGetMethod : this.defaultGetMethod;
- }
-
- public String getDefaultGetMethod() {
- return this.defaultGetMethod;
- }
-
- protected String buildDefaultGetMethod() {
- return this.getPersistenceUnit().getDefaultGetMethod();
- }
-
- protected void setDefaultGetMethod(String getMethod) {
- String old = this.defaultGetMethod;
- this.defaultGetMethod = getMethod;
- this.firePropertyChanged(DEFAULT_GET_METHOD_PROPERTY, old, getMethod);
- }
-
- public String getSpecifiedGetMethod() {
- return this.specifiedGetMethod;
- }
-
- public void setSpecifiedGetMethod(String getMethod) {
- if (this.valuesAreDifferent(this.specifiedGetMethod, getMethod)) {
- XmlAccessMethods xmlAccessMethods = this.getXmlAccessMethodsForUpdate();
- this.setSpecifiedGetMethod_(getMethod);
- xmlAccessMethods.setGetMethod(getMethod);
- this.removeXmlAccessMethodsIfUnset();
- }
- }
-
- protected void setSpecifiedGetMethod_(String getMethod) {
- String old = this.specifiedGetMethod;
- this.specifiedGetMethod = getMethod;
- this.firePropertyChanged(SPECIFIED_GET_METHOD_PROPERTY, old, getMethod);
- }
-
- protected String buildSpecifiedGetMethod() {
- XmlAccessMethods xmlAccessMethods = getXmlAccessMethods();
- return xmlAccessMethods != null ? xmlAccessMethods.getGetMethod() : null;
- }
-
-
- //*************** set method *****************
-
- public String getSetMethod() {
- String specifiedSetMethod = this.getSpecifiedSetMethod();
- return (specifiedSetMethod != null) ? specifiedSetMethod : this.defaultSetMethod;
- }
-
- public String getDefaultSetMethod() {
- return this.defaultSetMethod;
- }
-
- protected void setDefaultSetMethod(String setMethod) {
- String old = this.defaultSetMethod;
- this.defaultSetMethod = setMethod;
- this.firePropertyChanged(DEFAULT_SET_METHOD_PROPERTY, old, setMethod);
- }
-
- protected String buildDefaultSetMethod() {
- return this.getPersistenceUnit().getDefaultSetMethod();
- }
-
- public String getSpecifiedSetMethod() {
- return this.specifiedSetMethod;
- }
-
- public void setSpecifiedSetMethod(String setMethod) {
- if (this.valuesAreDifferent(this.specifiedSetMethod, setMethod)) {
- XmlAccessMethods xmlAccessMethods = this.getXmlAccessMethodsForUpdate();
- this.setSpecifiedSetMethod_(setMethod);
- xmlAccessMethods.setSetMethod(setMethod);
- this.removeXmlAccessMethodsIfUnset();
- }
- }
-
- protected void setSpecifiedSetMethod_(String setMethod) {
- String old = this.specifiedSetMethod;
- this.specifiedSetMethod = setMethod;
- this.firePropertyChanged(SPECIFIED_SET_METHOD_PROPERTY, old, setMethod);
- }
-
- protected String buildSpecifiedSetMethod() {
- XmlAccessMethods xmlAccessMethods = getXmlAccessMethods();
- return xmlAccessMethods != null ? xmlAccessMethods.getSetMethod() : null;
- }
-
- //*************** XML access methods *****************
- protected XmlAccessMethods getXmlAccessMethods() {
- return getXmlEntityMappings().getAccessMethods();
- }
-
- /**
- * Build the XML access methods (and XML defaults and XML metadata if necessary) if it does not exist.
- */
- protected XmlAccessMethods getXmlAccessMethodsForUpdate() {
- XmlAccessMethods xmlAccessMethods = getXmlAccessMethods();
- return (xmlAccessMethods != null) ? xmlAccessMethods : this.buildXmlAccessMethods();
- }
-
- protected XmlAccessMethods buildXmlAccessMethods() {
- XmlAccessMethods xmlAccessMethods = this.buildXmlAccessMethods_();
- this.getXmlEntityMappings().setAccessMethods(xmlAccessMethods);
- return xmlAccessMethods;
- }
-
- protected XmlAccessMethods buildXmlAccessMethods_() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlAccessMethods();
- }
-
- /**
- * clear the XML access methods if appropriate
- */
- protected void removeXmlAccessMethodsIfUnset() {
- if (this.getXmlAccessMethods().isUnset()) {
- this.getXmlEntityMappings().setAccessMethods(null);
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- @Override
- protected IContentType getContentType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE;
- }
-
-
- // ********** refactoring **********
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.createConverterRenameTypeEdits(originalType, newName));
- }
-
- protected Iterable<ReplaceEdit> createConverterRenameTypeEdits(IType originalType, String newName) {
- return this.converterContainer.createRenameTypeEdits(originalType, newName);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.createConverterMoveTypeEdits(originalType, newPackage));
- }
-
- protected Iterable<ReplaceEdit> createConverterMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.converterContainer.createMoveTypeEdits(originalType, newPackage);
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.createConverterRenamePackageEdits(originalPackage, newName));
- }
-
- protected Iterable<ReplaceEdit> createConverterRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.converterContainer.createRenamePackageEdits(originalPackage, newName);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.converterContainer.validate(messages, reporter);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java
deleted file mode 100644
index 184167e1c2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmElementCollectionMapping2_0.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.AbstractOrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class EclipseLinkOrmElementCollectionMapping2_0
- extends AbstractOrmElementCollectionMapping2_0<XmlElementCollection>
- implements
- EclipseLinkElementCollectionMapping2_0,
- EclipseLinkOrmConvertibleMapping,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
-
- public EclipseLinkOrmElementCollectionMapping2_0(OrmPersistentAttribute parent, XmlElementCollection resourceMapping) {
- super(parent, resourceMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- this.converterContainer.update();
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- if (getJpaPlatformVersion().getVersion().equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_0)) {
- throw new UnsupportedOperationException("join-fetch not supported in EclipseLink 2.0 platform"); //$NON-NLS-1$
- }
- return this.joinFetch;
- }
-
-
- // ********** converters **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.xmlAttributeMapping);
- }
-
- public int getNumberSupportedConverters() {
- return 2;
- }
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<OrmConverter.Adapter>(
- OrmEclipseLinkConvert.Adapter.instance(),
- super.getConverterAdapters()
- );
- }
-
-
- //************ refactoring ************
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.converterContainer.createMoveTypeEdits(originalType, newPackage)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.converterContainer.createRenamePackageEdits(originalPackage, newName)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.converterContainer.createRenameTypeEdits(originalType, newName)
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO join fetch validation
- }
-
- @Override
- protected void validateAttributeType(List<IMessage> messages, IReporter reporter) {
- if (this.isVirtualAccess()) {
- if (StringTools.stringIsEmpty(this.getAttributeType())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED,
- new String[] {this.getName()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- if (this.getResolvedAttributeType() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedAttributeType()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- }
- }
- super.validateAttributeType(messages, reporter);
- }
-
-
- protected boolean isVirtualAccess() {
- return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL;
- }
-
- @Override
- protected TextRange getAttributeTypeTextRange() {
- return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyRelationship.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyRelationship.java
deleted file mode 100644
index 8c9def1627..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmOneToManyRelationship.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.internal.context.orm.GenericOrmOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmOneToManyRelationship2_0;
-
-/**
- * We need this class because the EclipseLink 1.0 1:m mapping supports a join
- * column strategy while JPA did not until JPA 2.0. As a result, we need a class
- * that implements EclipseLink 1.0.
- */
-public class EclipseLinkOrmOneToManyRelationship
- extends GenericOrmOneToManyRelationship
- implements EclipseLinkOrmOneToManyRelationship2_0
-{
- public EclipseLinkOrmOneToManyRelationship(OrmOneToManyMapping parent) {
- super(parent, true); // true=supports join column strategy
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentTypeImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentTypeImpl.java
deleted file mode 100644
index 5f762ba74e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmPersistentTypeImpl.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.SpecifiedOrmPersistentType;
-import org.eclipse.jpt.jpa.core.internal.validation.DefaultJpaValidationMessages;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * <code>eclipselink-orm.xml</code> persistent type:<ul>
- * <li>mapping
- * <li>access
- * <li>access-methods
- * <li>attributes
- * <li>super persistent type
- * <li>Java persistent type
- * </ul>
- */
-public class EclipseLinkOrmPersistentTypeImpl
- extends SpecifiedOrmPersistentType
- implements EclipseLinkOrmPersistentType
-{
-
- protected String specifiedGetMethod;
- protected String defaultGetMethod;
-
- protected String specifiedSetMethod;
- protected String defaultSetMethod;
-
- protected boolean dynamic;
-
- public EclipseLinkOrmPersistentTypeImpl(EntityMappings parent, XmlTypeMapping xmlTypeMapping) {
- super(parent, xmlTypeMapping);
- this.specifiedGetMethod = this.buildSpecifiedGetMethod();
- this.specifiedSetMethod = this.buildSpecifiedSetMethod();
- }
-
- @Override
- protected XmlTypeMapping getXmlTypeMapping() {
- return (XmlTypeMapping) super.getXmlTypeMapping();
- }
-
- @Override
- public EclipseLinkOrmTypeMapping getMapping() {
- return (EclipseLinkOrmTypeMapping) super.getMapping();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedGetMethod_(this.buildSpecifiedGetMethod());
- this.setSpecifiedSetMethod_(this.buildSpecifiedSetMethod());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultGetMethod(this.buildDefaultGetMethod());
- this.setDefaultSetMethod(this.buildDefaultSetMethod());
- this.setDynamic(this.buildDynamic());
- }
-
-
- //*************** dynamic *****************
-
- public boolean isDynamic() {
- return this.dynamic;
- }
-
- protected void setDynamic(boolean dynamic) {
- boolean old = this.dynamic;
- this.dynamic = dynamic;
- if (this.firePropertyChanged(DYNAMIC_PROPERTY, old, this.dynamic)) {
- // clear out the Java persistent type here, it will be rebuilt during "update"
- if (this.javaPersistentType != null) {
- this.javaPersistentType.dispose();
- this.setJavaPersistentType(null);
- }
- }
- }
-
- //Base the dynamic state only on the JavaResourceType being null.
- //Otherwise, the access type affects the hierarchy
- //and then the hierarchy affects the access type and we get stuck in an update.
- //Validation will check that virtual access is set if it is dynamic.
- protected boolean buildDynamic() {
- return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLinkVersionCompatible(this, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_1)
- && this.resolveJavaResourceType() == null;
- }
-
- protected boolean isVirtualAccess() {
- return this.getAccess() == EclipseLinkAccessType.VIRTUAL;
- }
-
- @Override
- protected JavaPersistentType buildJavaPersistentType() {
- if (this.isDynamic()) {
- return this.buildVirtualJavaPersistentType();
- }
- return super.buildJavaPersistentType();
- }
-
- protected JavaPersistentType buildVirtualJavaPersistentType() {
- return new VirtualJavaPersistentType(this, this.getXmlTypeMapping());
- }
-
-
- @Override
- public PersistentType getOverriddenPersistentType() {
- if (this.isDynamic()) {
- return null;
- }
- return super.getOverriddenPersistentType();
- }
-
- public OrmPersistentAttribute addVirtualAttribute(String attributeName, String mappingKey, String attributeType) {
- // force the creation of an empty xml attribute container beforehand or it will trigger
- // a sync and, if we do this after adding the attribute, clear out our context attributes
- Attributes xmlAttributes = this.getXmlAttributesForUpdate();
- this.getXmlTypeMapping().setAttributes(xmlAttributes); // possibly a NOP
-
- OrmAttributeMappingDefinition md = this.getMappingFileDefinition().getAttributeMappingDefinition(mappingKey);
- XmlAttributeMapping xmlMapping = (XmlAttributeMapping) md.buildResourceMapping(this.getResourceNodeFactory());
- xmlMapping.setName(attributeName);
- xmlMapping.setAttributeType(attributeType);
- if (this.getAccess() != EclipseLinkAccessType.VIRTUAL) {
- xmlMapping.setAccess(EclipseLinkAccessType.VIRTUAL.getOrmAccessType());
- }
-
- OrmPersistentAttribute specifiedAttribute = this.buildSpecifiedAttribute(xmlMapping);
- // we need to add the attribute to the right spot in the list - stupid spec...
- int specifiedIndex = this.getSpecifiedAttributeInsertionIndex(specifiedAttribute);
- this.addItemToList(specifiedIndex, specifiedAttribute, this.specifiedAttributes, SPECIFIED_ATTRIBUTES_LIST);
- specifiedAttribute.getMapping().addXmlAttributeMappingTo(xmlAttributes);
-
- return specifiedAttribute;
- }
-
- //*************** get method *****************
-
- public String getGetMethod() {
- String specifiedGetMethod = this.getSpecifiedGetMethod();
- return (specifiedGetMethod != null) ? specifiedGetMethod : this.defaultGetMethod;
- }
-
- public String getDefaultGetMethod() {
- return this.defaultGetMethod;
- }
-
- //TODO get the default get method from the java VirtualAccessMethods annotation and from the super type
- protected String buildDefaultGetMethod() {
- if (getAccess() == EclipseLinkAccessType.VIRTUAL) {
- String defaultGetMethod = getEntityMappings().getDefaultGetMethod();
- return defaultGetMethod != null ? defaultGetMethod : DEFAULT_GET_METHOD;
- }
- return null;
- }
-
- protected void setDefaultGetMethod(String getMethod) {
- String old = this.defaultGetMethod;
- this.defaultGetMethod = getMethod;
- this.firePropertyChanged(DEFAULT_GET_METHOD_PROPERTY, old, getMethod);
- }
-
- public String getSpecifiedGetMethod() {
- return this.specifiedGetMethod;
- }
-
- public void setSpecifiedGetMethod(String getMethod) {
- if (this.valuesAreDifferent(this.specifiedGetMethod, getMethod)) {
- XmlAccessMethods xmlAccessMethods = this.getXmlAccessMethodsForUpdate();
- this.setSpecifiedGetMethod_(getMethod);
- xmlAccessMethods.setGetMethod(getMethod);
- this.removeXmlAccessMethodsIfUnset();
- }
- }
-
- protected void setSpecifiedGetMethod_(String getMethod) {
- String old = this.specifiedGetMethod;
- this.specifiedGetMethod = getMethod;
- this.firePropertyChanged(SPECIFIED_GET_METHOD_PROPERTY, old, getMethod);
- }
-
- protected String buildSpecifiedGetMethod() {
- XmlAccessMethods accessMethods = this.getXmlAccessMethods();
- return accessMethods != null ? accessMethods.getGetMethod() : null;
- }
-
-
- //*************** set method *****************
-
- public String getSetMethod() {
- String specifiedSetMethod = this.getSpecifiedSetMethod();
- return (specifiedSetMethod != null) ? specifiedSetMethod : this.defaultSetMethod;
- }
-
- public String getDefaultSetMethod() {
- return this.defaultSetMethod;
- }
-
- protected void setDefaultSetMethod(String setMethod) {
- String old = this.defaultSetMethod;
- this.defaultSetMethod = setMethod;
- this.firePropertyChanged(DEFAULT_SET_METHOD_PROPERTY, old, setMethod);
- }
-
- protected String buildDefaultSetMethod() {
- if (getAccess() == EclipseLinkAccessType.VIRTUAL) {
- //TODO get the default set method from the java VirtualAccessMethods annotation/super persistent type, embedded parent, etc
- String defaultSetMethod = getEntityMappings().getDefaultSetMethod();
- return defaultSetMethod != null ? defaultSetMethod : DEFAULT_SET_METHOD;
- }
- return null;
- }
-
- public String getSpecifiedSetMethod() {
- return this.specifiedSetMethod;
- }
-
- public void setSpecifiedSetMethod(String setMethod) {
- if (this.valuesAreDifferent(this.specifiedSetMethod, setMethod)) {
- XmlAccessMethods xmlAccessMethods = this.getXmlAccessMethodsForUpdate();
- this.setSpecifiedSetMethod_(setMethod);
- xmlAccessMethods.setSetMethod(setMethod);
- this.removeXmlAccessMethodsIfUnset();
- }
- }
-
- protected void setSpecifiedSetMethod_(String setMethod) {
- String old = this.specifiedSetMethod;
- this.specifiedSetMethod = setMethod;
- this.firePropertyChanged(SPECIFIED_SET_METHOD_PROPERTY, old, setMethod);
- }
-
- protected String buildSpecifiedSetMethod() {
- XmlAccessMethods accessMethods = this.getXmlAccessMethods();
- return accessMethods != null ? accessMethods.getSetMethod() : null;
- }
-
- //*************** XML access methods *****************
-
- protected XmlAccessMethodsHolder getXmlAccessMethodsHolder() {
- return this.getXmlTypeMapping();
- }
-
- protected XmlAccessMethods getXmlAccessMethods() {
- return getXmlAccessMethodsHolder().getAccessMethods();
- }
-
- /**
- * Build the XML access methods (and XML defaults and XML metadata if necessary) if it does not exist.
- */
- protected XmlAccessMethods getXmlAccessMethodsForUpdate() {
- XmlAccessMethods xmlAccessMethods = this.getXmlAccessMethodsHolder().getAccessMethods();
- return (xmlAccessMethods != null) ? xmlAccessMethods : this.buildXmlAccessMethods();
- }
-
- protected XmlAccessMethods buildXmlAccessMethods() {
- XmlAccessMethods xmlAccessMethods = this.buildXmlAccessMethods_();
- this.getXmlAccessMethodsHolder().setAccessMethods(xmlAccessMethods);
- return xmlAccessMethods;
- }
-
- protected XmlAccessMethods buildXmlAccessMethods_() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlAccessMethods();
- }
-
- /**
- * clear the XML access methods if appropriate
- */
- protected void removeXmlAccessMethodsIfUnset() {
- if (this.getXmlAccessMethods().isUnset()) {
- this.getXmlAccessMethodsHolder().setAccessMethods(null);
- }
- }
-
- @Override
- protected EclipseLinkEntityMappings getEntityMappings() {
- return (EclipseLinkEntityMappings) super.getEntityMappings();
- }
-
- @Override
- protected void validateClass(List<IMessage> messages) {
- if (this.isDynamic() && !this.isVirtualAccess()) {
- messages.add(
- DefaultJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- JpaValidationMessages.PERSISTENT_TYPE_UNRESOLVED_CLASS,
- new String[] {this.getName()},
- this,
- this.mapping.getClassTextRange()
- )
- );
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index 463756227a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,270 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-
-/**
- * <code>orm.xml</code> tenant discriminator column
- */
-public class EclipseLinkOrmTenantDiscriminatorColumn2_3
- extends AbstractOrmNamedDiscriminatorColumn<XmlTenantDiscriminatorColumn_2_3, OrmReadOnlyTenantDiscriminatorColumn2_3.Owner>
- implements OrmTenantDiscriminatorColumn2_3
-{
- protected XmlTenantDiscriminatorColumn_2_3 xmlTenantDiscriminatorColumn;
-
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedContextProperty;
- protected String defaultContextProperty;
-
- protected Boolean specifiedPrimaryKey;
- protected boolean defaultPrimaryKey = DEFAULT_PRIMARY_KEY;
-
- public EclipseLinkOrmTenantDiscriminatorColumn2_3(XmlContextNode parent, OrmReadOnlyTenantDiscriminatorColumn2_3.Owner owner, XmlTenantDiscriminatorColumn_2_3 column) {
- super(parent, owner, column);
- this.specifiedTable = this.buildSpecifiedTable();
- this.specifiedContextProperty = this.buildSpecifiedContextProperty();
- this.specifiedPrimaryKey = this.buildSpecifiedPrimaryKey();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedTable_(this.buildSpecifiedTable());
- this.setSpecifiedContextProperty_(this.buildSpecifiedContextProperty());
- this.setSpecifiedPrimaryKey_(this.buildSpecifiedPrimaryKey());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultTable(this.buildDefaultTable());
- this.setDefaultContextProperty(this.buildDefaultContextProperty());
- this.setDefaultPrimaryKey(this.buildDefaultPrimaryKey());
- }
-
-
-
- // ********** XML column **********
-
- @Override
- public XmlTenantDiscriminatorColumn_2_3 getXmlColumn() {
- return this.xmlTenantDiscriminatorColumn;
- }
-
- @Override
- protected void setXmlColumn(XmlTenantDiscriminatorColumn_2_3 xmlColumn) {
- this.xmlTenantDiscriminatorColumn = xmlColumn;
- }
-
- /**
- * tenant discriminator columns are part of a collection;
- * the 'tenant-discriminator-column' element will be removed/added
- * when the XML tenant discriminator column is removed from/added to
- * the owner's collection
- */
- @Override
- protected XmlTenantDiscriminatorColumn buildXmlColumn() {
- throw new IllegalStateException("XML tenant discriminator column is missing"); //$NON-NLS-1$
- }
-
- /**
- * @see #buildXmlColumn()
- */
- @Override
- protected void removeXmlColumn() {
- // do nothing
- }
-
-
- // ********** table **********
-
- @Override
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- public void setSpecifiedTable(String table) {
- if (this.valuesAreDifferent(this.specifiedTable, table)) {
- this.setSpecifiedTable_(table);
- this.xmlTenantDiscriminatorColumn.setTable(table);
- }
- }
-
- protected void setSpecifiedTable_(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected String buildSpecifiedTable() {
- return (this.xmlTenantDiscriminatorColumn == null) ? null : this.xmlTenantDiscriminatorColumn.getTable();
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String table) {
- String old = this.defaultTable;
- this.defaultTable = table;
- this.firePropertyChanged(DEFAULT_TABLE_PROPERTY, old, table);
- }
-
- protected String buildDefaultTable() {
- return this.owner.getDefaultTableName();
- }
-
- // ********** contextProperty **********
-
- public String getContextProperty() {
- return (this.specifiedContextProperty != null) ? this.specifiedContextProperty : this.defaultContextProperty;
- }
-
- public String getSpecifiedContextProperty() {
- return this.specifiedContextProperty;
- }
-
- public void setSpecifiedContextProperty(String contextProperty) {
- if (this.valuesAreDifferent(this.specifiedContextProperty, contextProperty)) {
- this.setSpecifiedContextProperty_(contextProperty);
- this.xmlTenantDiscriminatorColumn.setContextProperty(contextProperty);
- }
- }
-
- protected void setSpecifiedContextProperty_(String contextProperty) {
- String old = this.specifiedContextProperty;
- this.specifiedContextProperty = contextProperty;
- this.firePropertyChanged(SPECIFIED_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildSpecifiedContextProperty() {
- return (this.xmlTenantDiscriminatorColumn == null) ? null : this.xmlTenantDiscriminatorColumn.getContextProperty();
- }
-
- public String getDefaultContextProperty() {
- return this.defaultContextProperty;
- }
-
- protected void setDefaultContextProperty(String contextProperty) {
- String old = this.defaultContextProperty;
- this.defaultContextProperty = contextProperty;
- this.firePropertyChanged(DEFAULT_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildDefaultContextProperty() {
- return this.owner.getDefaultContextPropertyName();
- }
-
-
- // ********** primaryKey **********
-
- public boolean isPrimaryKey() {
- return (this.specifiedPrimaryKey != null) ? this.specifiedPrimaryKey.booleanValue() : this.isDefaultPrimaryKey();
- }
-
- public Boolean getSpecifiedPrimaryKey() {
- return this.specifiedPrimaryKey;
- }
-
- public void setSpecifiedPrimaryKey(Boolean primaryKey) {
- if (this.valuesAreDifferent(this.specifiedPrimaryKey, primaryKey)) {
- this.setSpecifiedPrimaryKey_(primaryKey);
- this.xmlTenantDiscriminatorColumn.setPrimaryKey(primaryKey);
- }
- }
-
- protected void setSpecifiedPrimaryKey_(Boolean primaryKey) {
- Boolean old = this.specifiedPrimaryKey;
- this.specifiedPrimaryKey = primaryKey;
- this.firePropertyChanged(SPECIFIED_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected Boolean buildSpecifiedPrimaryKey() {
- return (this.xmlTenantDiscriminatorColumn == null) ? null : this.xmlTenantDiscriminatorColumn.getPrimaryKey();
- }
-
- public boolean isDefaultPrimaryKey() {
- return this.defaultPrimaryKey;
- }
-
- protected void setDefaultPrimaryKey(boolean defaultPrimaryKey) {
- boolean old = this.defaultPrimaryKey;
- this.defaultPrimaryKey = defaultPrimaryKey;
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_PROPERTY, old, defaultPrimaryKey);
- }
-
- protected boolean buildDefaultPrimaryKey() {
- return this.owner.getDefaultPrimaryKey();
- }
-
-
- // ********** misc **********
-
- public Iterable<String> getCandidateTableNames() {
- return this.owner.getCandidateTableNames();
- }
-
-
- // ********** validation **********
-
- public boolean tableNameIsInvalid() {
- return this.owner.tableNameIsInvalid(this.getTable());
- }
-
- public TextRange getTableTextRange() {
- return this.getValidationTextRange(this.getXmlColumnTableTextRange());
- }
-
- protected TextRange getXmlColumnTableTextRange() {
- XmlTenantDiscriminatorColumn_2_3 xmlColumn = this.getXmlColumn();
- return (xmlColumn == null) ? null : xmlColumn.getTableTextRange();
- }
-
- @Override
- protected NamedColumnTextRangeResolver buildTextRangeResolver() {
- return new OrmTableColumnTextRangeResolver(this);
- }
-
- // ********** completion proposals **********
-
- @Override
- public Iterable<String> getXmlCompletionProposals(int pos) {
- Iterable<String> result = super.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- if (this.tableTouches(pos)) {
- return this.getCandidateTableNames();
- }
- return null;
- }
-
- protected boolean tableTouches(int pos) {
- return this.xmlTenantDiscriminatorColumn.tableTouches(pos);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTimeOfDay.java
deleted file mode 100644
index 046fd56243..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmTimeOfDay.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay;
-
-public class EclipseLinkOrmTimeOfDay
- extends AbstractOrmXmlContextNode
- implements EclipseLinkTimeOfDay
-{
- protected final XmlTimeOfDay xmlTimeOfDay;
-
- protected Integer hour;
- protected Integer minute;
- protected Integer second;
- protected Integer millisecond;
-
-
- public EclipseLinkOrmTimeOfDay(OrmEclipseLinkCaching parent, XmlTimeOfDay xmlTimeOfDay) {
- super(parent);
- this.xmlTimeOfDay = xmlTimeOfDay;
- this.hour = xmlTimeOfDay.getHour();
- this.minute = xmlTimeOfDay.getMinute();
- this.second = xmlTimeOfDay.getSecond();
- this.millisecond = xmlTimeOfDay.getMillisecond();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setHour_(this.xmlTimeOfDay.getHour());
- this.setMinute_(this.xmlTimeOfDay.getMinute());
- this.setSecond_(this.xmlTimeOfDay.getSecond());
- this.setMillisecond_(this.xmlTimeOfDay.getMillisecond());
- }
-
-
- // ********** hour **********
-
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer hour) {
- this.setHour_(hour);
- this.xmlTimeOfDay.setHour(hour);
- }
-
- protected void setHour_(Integer hour) {
- Integer old = this.hour;
- this.hour = hour;
- this.firePropertyChanged(HOUR_PROPERTY, old, hour);
- }
-
-
- // ********** minute **********
-
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer minute) {
- this.setMinute_(minute);
- this.xmlTimeOfDay.setMinute(minute);
- }
-
- protected void setMinute_(Integer minute) {
- Integer old = this.minute;
- this.minute = minute;
- this.firePropertyChanged(MINUTE_PROPERTY, old, minute);
- }
-
-
- // ********** second **********
-
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer second) {
- this.setSecond_(second);
- this.xmlTimeOfDay.setSecond(second);
- }
-
- protected void setSecond_(Integer second) {
- Integer old = this.second;
- this.second = second;
- this.firePropertyChanged(SECOND_PROPERTY, old, second);
- }
-
-
- // ********** millisecond **********
-
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer millisecond) {
- this.setMillisecond_(millisecond);
- this.xmlTimeOfDay.setMillisecond(millisecond);
- }
-
- protected void setMillisecond_(Integer millisecond) {
- Integer old = this.millisecond;
- this.millisecond = millisecond;
- this.firePropertyChanged(MILLISECOND_PROPERTY, old, millisecond);
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkCaching getParent() {
- return (OrmEclipseLinkCaching) super.getParent();
- }
-
- protected OrmEclipseLinkCaching getCaching() {
- return this.getParent();
- }
-
- public XmlTimeOfDay getXmlTimeOfDay() {
- return this.xmlTimeOfDay;
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.xmlTimeOfDay.getValidationTextRange();
- return (textRange != null) ? textRange : this.getCaching().getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_1Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_1Definition.java
deleted file mode 100644
index ba636b0de6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_1Definition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-public class EclipseLinkOrmXml1_1Definition
- extends AbstractEclipseLinkOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml1_1Definition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml1_1Definition() {
- super();
- }
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return EclipseLinkOrmXmlDefinition.instance().getContextNodeFactory();
- }
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, EclipseLinkOrmXmlDefinition.ECLIPSELINK_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_2Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_2Definition.java
deleted file mode 100644
index 77527bef2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml1_2Definition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-public class EclipseLinkOrmXml1_2Definition
- extends AbstractEclipseLinkOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml1_2Definition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml1_2Definition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return EclipseLinkOrmXmlDefinition.instance().getContextNodeFactory();
- }
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, EclipseLinkOrmXmlDefinition.ECLIPSELINK_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java
deleted file mode 100644
index 8d4e85e5d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0ContextNodeFactory.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOrderable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmOrderable;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmNamedQuery2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmOrderColumn2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmOrphanRemoval2_0;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmSequenceGenerator2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmAssociationOverrideContainer2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmSingleRelationshipMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmXml2_0ContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection;
-
-public class EclipseLinkOrmXml2_0ContextNodeFactory
- extends EclipseLinkOrmXmlContextNodeFactory
- implements OrmXml2_0ContextNodeFactory
-{
-
- public OrmAssociationOverrideContainer buildOrmAssociationOverrideContainer(OrmEmbeddedMapping2_0 parent, OrmAssociationOverrideContainer2_0.Owner owner) {
- return new GenericOrmAssociationOverrideContainer(parent, owner);
- }
-
- @Override
- public OrmSequenceGenerator buildOrmSequenceGenerator(XmlContextNode parent, org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator resourceSequenceGenerator) {
- return new GenericOrmSequenceGenerator2_0(parent, resourceSequenceGenerator);
- }
-
- public OrmDerivedIdentity2_0 buildOrmDerivedIdentity(OrmSingleRelationshipMapping2_0 parent) {
- return new GenericOrmDerivedIdentity2_0(parent);
- }
-
- public OrmElementCollectionMapping2_0 buildOrmElementCollectionMapping2_0(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection resourceMapping) {
- return new EclipseLinkOrmElementCollectionMapping2_0(parent, (XmlElementCollection) resourceMapping);
- }
-
- public OrmCacheable2_0 buildOrmCacheable(OrmCacheableHolder2_0 parent) {
- return new GenericOrmCacheable2_0(parent);
- }
-
- public OrmOrphanRemovable2_0 buildOrmOrphanRemoval(OrmOrphanRemovalHolder2_0 parent) {
- return new GenericOrmOrphanRemoval2_0(parent);
- }
-
- @Override
- public OrmNamedQuery buildOrmNamedQuery(XmlContextNode parent, XmlNamedQuery resourceNamedQuery) {
- return new GenericOrmNamedQuery2_0(parent, resourceNamedQuery);
- }
-
- public OrmCollectionTable2_0 buildOrmCollectionTable(OrmElementCollectionMapping2_0 parent, Table.Owner owner) {
- return new GenericOrmCollectionTable2_0(parent, owner);
- }
-
- @Override
- public OrmOrderable buildOrmOrderable(OrmAttributeMapping parent) {
- throw new UnsupportedOperationException("use #buildOrmOrderable(OrmAttributeMapping parent, Orderable2_0.Owner owner)"); //$NON-NLS-1$
- }
-
- public OrmOrderable2_0 buildOrmOrderable(OrmAttributeMapping parent, Orderable2_0.Owner owner) {
- return new GenericOrmOrderable(parent, owner);
- }
-
- public OrmOrderColumn2_0 buildOrmOrderColumn(OrmOrderable2_0 parent, OrmOrderColumn2_0.Owner owner) {
- return new GenericOrmOrderColumn2_0(parent, owner);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0Definition.java
deleted file mode 100644
index 2cd76ef0e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_0Definition.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.NullOrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmBasicMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmVersionMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.OrmElementCollectionMapping2_0Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaPlatformProvider;
-
-public class EclipseLinkOrmXml2_0Definition
- extends AbstractEclipseLinkOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml2_0Definition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_0Definition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml2_0ContextNodeFactory();
- }
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, ECLIPSELINK_2_0_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- /**
- * Order should not matter here; but we'll use the same order as for Java.
- * @see EclipseLink2_0JpaPlatformProvider
- */
- protected static final OrmAttributeMappingDefinition[] ECLIPSELINK_2_0_ATTRIBUTE_MAPPING_DEFINITIONS = new OrmAttributeMappingDefinition[] {
- OrmTransientMappingDefinition.instance(),
- OrmEclipseLinkBasicCollectionMappingDefinition.instance(),
- OrmEclipseLinkBasicMapMappingDefinition.instance(),
- OrmElementCollectionMapping2_0Definition.instance(),
- OrmIdMappingDefinition.instance(),
- OrmVersionMappingDefinition.instance(),
- OrmBasicMappingDefinition.instance(),
- OrmEmbeddedMappingDefinition.instance(),
- OrmEmbeddedIdMappingDefinition.instance(),
- OrmEclipseLinkTransformationMappingDefinition.instance(),
- OrmManyToManyMappingDefinition.instance(),
- OrmManyToOneMappingDefinition.instance(),
- OrmOneToManyMappingDefinition.instance(),
- OrmOneToOneMappingDefinition.instance(),
- OrmEclipseLinkVariableOneToOneMappingDefinition.instance(),
- NullOrmAttributeMappingDefinition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java
deleted file mode 100644
index 95ac734624..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1ContextNodeFactory.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-
-public class EclipseLinkOrmXml2_1ContextNodeFactory
- extends EclipseLinkOrmXml2_0ContextNodeFactory
-{
-
- @Override
- public AbstractOrmEclipseLinkBasicCollectionMapping buildOrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection resourceMapping) {
- return new OrmEclipseLinkBasicCollectionMapping2_1(parent, resourceMapping);
- }
-
- @Override
- public AbstractOrmEclipseLinkBasicMapMapping buildOrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap resourceMapping) {
- return new OrmEclipseLinkBasicMapMapping2_1(parent, resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1Definition.java
deleted file mode 100644
index bb5f160db9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_1Definition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-public class EclipseLinkOrmXml2_1Definition
- extends AbstractEclipseLinkOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml2_1Definition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_1Definition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml2_1ContextNodeFactory();
- }
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, EclipseLinkOrmXml2_0Definition.ECLIPSELINK_2_0_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_2Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_2Definition.java
deleted file mode 100644
index 0b9a42b08c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_2Definition.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-public class EclipseLinkOrmXml2_2Definition
- extends AbstractEclipseLinkOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE =
- new EclipseLinkOrmXml2_2Definition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_2Definition() {
- super();
- }
-
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return EclipseLinkOrmXml2_1Definition.instance().getContextNodeFactory();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_2_RESOURCE_TYPE;
- }
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, EclipseLinkOrmXml2_0Definition.ECLIPSELINK_2_0_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3ContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3ContextNodeFactory.java
deleted file mode 100644
index 85bbeb4b4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3ContextNodeFactory.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure;
-
-public class EclipseLinkOrmXml2_3ContextNodeFactory
- extends EclipseLinkOrmXml2_0ContextNodeFactory
-{
-
- public OrmEclipseLinkArrayMapping2_3 buildOrmEclipseLinkArrayMapping(OrmPersistentAttribute parent, XmlArray resourceMapping) {
- return new OrmEclipseLinkArrayMapping2_3(parent, resourceMapping);
- }
-
- public OrmEclipseLinkStructureMapping2_3 buildOrmEclipseLinkStructureMapping(OrmPersistentAttribute parent, XmlStructure resourceMapping) {
- return new OrmEclipseLinkStructureMapping2_3(parent, resourceMapping);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3Definition.java
deleted file mode 100644
index 1b86429d5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_3Definition.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.NullOrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmBasicMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmVersionMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.OrmElementCollectionMapping2_0Definition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-
-public class EclipseLinkOrmXml2_3Definition
- extends AbstractEclipseLinkOrmXmlDefinition {
-
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml2_3Definition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_3Definition() {
- super();
- }
-
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_3_RESOURCE_TYPE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXml2_3ContextNodeFactory();
- }
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, ECLIPSELINK_2_3_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- /**
- * Order should not matter here; but we'll use the same order as for Java.
- * @see EclipseLink2_3JpaPlatformProvider
- */
- protected static final OrmAttributeMappingDefinition[] ECLIPSELINK_2_3_ATTRIBUTE_MAPPING_DEFINITIONS = new OrmAttributeMappingDefinition[] {
- OrmTransientMappingDefinition.instance(),
- OrmEclipseLinkBasicCollectionMappingDefinition.instance(),
- OrmEclipseLinkBasicMapMappingDefinition.instance(),
- OrmEclipseLinkArrayMapping2_3Definition.instance(),
- OrmElementCollectionMapping2_0Definition.instance(),
- OrmIdMappingDefinition.instance(),
- OrmVersionMappingDefinition.instance(),
- OrmBasicMappingDefinition.instance(),
- OrmEclipseLinkStructureMapping2_3Definition.instance(),
- OrmEmbeddedMappingDefinition.instance(),
- OrmEmbeddedIdMappingDefinition.instance(),
- OrmEclipseLinkTransformationMappingDefinition.instance(),
- OrmManyToManyMappingDefinition.instance(),
- OrmManyToOneMappingDefinition.instance(),
- OrmOneToManyMappingDefinition.instance(),
- OrmOneToOneMappingDefinition.instance(),
- OrmEclipseLinkVariableOneToOneMappingDefinition.instance(),
- NullOrmAttributeMappingDefinition.instance()
- };
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_4Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_4Definition.java
deleted file mode 100644
index c686fb0b55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXml2_4Definition.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-
-public class EclipseLinkOrmXml2_4Definition
- extends AbstractEclipseLinkOrmXmlDefinition {
-
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXml2_4Definition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_4Definition() {
- super();
- }
-
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_4_RESOURCE_TYPE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return EclipseLinkOrmXml2_3Definition.instance().getContextNodeFactory();
- }
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, EclipseLinkOrmXml2_3Definition.ECLIPSELINK_2_3_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java
deleted file mode 100644
index 745ef833a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlContextNodeFactory.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion;
-
-public class EclipseLinkOrmXmlContextNodeFactory
- extends AbstractOrmXmlContextNodeFactory
-{
-
- // ********** EclipseLink-specific ORM Context Model **********
-
- @Override
- public EntityMappings buildEntityMappings(OrmXml parent, org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings xmlEntityMappings) {
- return new EclipseLinkEntityMappingsImpl(parent, (XmlEntityMappings) xmlEntityMappings);
- }
-
- @Override
- public OrmPersistentAttribute buildOrmPersistentAttribute(OrmPersistentType parent, org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping resourceMapping) {
- return new OrmEclipseLinkPersistentAttribute(parent, (XmlAttributeMapping) resourceMapping);
- }
-
- @Override
- public OrmPersistentType buildOrmPersistentType(EntityMappings parent, org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping resourceMapping) {
- return new EclipseLinkOrmPersistentTypeImpl(parent, (XmlTypeMapping) resourceMapping);
- }
-
- @Override
- public OrmEmbeddable buildOrmEmbeddable(OrmPersistentType type, org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable resourceMapping) {
- return new OrmEclipseLinkEmbeddableImpl(type, (XmlEmbeddable) resourceMapping);
- }
-
- @Override
- public OrmEntity buildOrmEntity(OrmPersistentType type, org.eclipse.jpt.jpa.core.resource.orm.XmlEntity resourceMapping) {
- return new OrmEclipseLinkEntityImpl(type, (XmlEntity) resourceMapping);
- }
-
- @Override
- public OrmMappedSuperclass buildOrmMappedSuperclass(OrmPersistentType type, org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass resourceMapping) {
- return new OrmEclipseLinkMappedSuperclassImpl(type, (XmlMappedSuperclass) resourceMapping);
- }
-
- @Override
- public OrmBasicMapping buildOrmBasicMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlBasic resourceMapping) {
- return new OrmEclipseLinkBasicMapping(parent, (XmlBasic) resourceMapping);
- }
-
- @Override
- public OrmIdMapping buildOrmIdMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlId resourceMapping) {
- return new OrmEclipseLinkIdMapping(parent, (XmlId) resourceMapping);
- }
-
- @Override
- public OrmEmbeddedMapping buildOrmEmbeddedMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded resourceMapping) {
- return new OrmEclipseLinkEmbeddedMapping(parent, (XmlEmbedded) resourceMapping);
- }
-
- @Override
- public OrmEmbeddedIdMapping buildOrmEmbeddedIdMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId resourceMapping) {
- return new OrmEclipseLinkEmbeddedIdMapping(parent, (XmlEmbeddedId) resourceMapping);
- }
-
- @Override
- public OrmManyToManyMapping buildOrmManyToManyMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany resourceMapping) {
- return new OrmEclipseLinkManyToManyMapping(parent, (XmlManyToMany) resourceMapping);
- }
-
- @Override
- public OrmManyToOneMapping buildOrmManyToOneMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne resourceMapping) {
- return new OrmEclipseLinkManyToOneMapping(parent, (XmlManyToOne) resourceMapping);
- }
-
- @Override
- public OrmOneToManyMapping buildOrmOneToManyMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany resourceMapping) {
- return new OrmEclipseLinkOneToManyMapping(parent, (XmlOneToMany) resourceMapping);
- }
-
- @Override
- public OrmOneToOneMapping buildOrmOneToOneMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne resourceMapping) {
- return new OrmEclipseLinkOneToOneMapping(parent, (XmlOneToOne) resourceMapping);
- }
-
- @Override
- public OrmVersionMapping buildOrmVersionMapping(OrmPersistentAttribute parent, org.eclipse.jpt.jpa.core.resource.orm.XmlVersion resourceMapping) {
- return new OrmEclipseLinkVersionMapping(parent, (XmlVersion) resourceMapping);
- }
-
- public AbstractOrmEclipseLinkBasicCollectionMapping buildOrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection resourceMapping) {
- return new OrmEclipseLinkBasicCollectionMapping(parent, resourceMapping);
- }
-
- public AbstractOrmEclipseLinkBasicMapMapping buildOrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap resourceMapping) {
- return new OrmEclipseLinkBasicMapMapping(parent, resourceMapping);
- }
-
- public OrmEclipseLinkTransformationMapping buildOrmEclipseLinkTransformationMapping(OrmPersistentAttribute parent, XmlTransformation resourceMapping) {
- return new OrmEclipseLinkTransformationMapping(parent, resourceMapping);
- }
-
- public OrmEclipseLinkVariableOneToOneMapping buildOrmEclipseLinkVariableOneToOneMapping(OrmPersistentAttribute parent, XmlVariableOneToOne resourceMapping) {
- return new OrmEclipseLinkVariableOneToOneMapping(parent, resourceMapping);
- }
-
- @Override
- public OrmPersistenceUnitDefaults buildOrmPersistenceUnitDefaults(OrmPersistenceUnitMetadata parent) {
- return new OrmEclipseLinkPersistenceUnitDefaults(parent);
- }
-
- @Override
- public OrmPersistenceUnitMetadata buildOrmPersistenceUnitMetadata(EntityMappings parent) {
- return new OrmEclipseLinkPersistenceUnitMetadata(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java
deleted file mode 100644
index 751e36ce08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/EclipseLinkOrmXmlDefinition.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.orm.NullOrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmBasicMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmVersionMappingDefinition;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaPlatformProvider;
-
-public class EclipseLinkOrmXmlDefinition
- extends AbstractEclipseLinkOrmXmlDefinition
-{
- // singleton
- private static final OrmXmlDefinition INSTANCE = new EclipseLinkOrmXmlDefinition();
-
- /**
- * Return the singleton.
- */
- public static OrmXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkOrmXmlDefinition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE;
- }
-
- @Override
- protected OrmXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkOrmXmlContextNodeFactory();
- }
-
- @Override
- protected void addAttributeMappingDefinitionsTo(ArrayList<OrmAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, ECLIPSELINK_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- /**
- * Order should not matter here; but we'll use the same order as for Java.
- * @see EclipseLinkJpaPlatformProvider
- */
- protected static final OrmAttributeMappingDefinition[] ECLIPSELINK_ATTRIBUTE_MAPPING_DEFINITIONS = new OrmAttributeMappingDefinition[] {
- OrmTransientMappingDefinition.instance(),
- OrmEclipseLinkBasicCollectionMappingDefinition.instance(),
- OrmEclipseLinkBasicMapMappingDefinition.instance(),
- OrmIdMappingDefinition.instance(),
- OrmVersionMappingDefinition.instance(),
- OrmBasicMappingDefinition.instance(),
- OrmEmbeddedMappingDefinition.instance(),
- OrmEmbeddedIdMappingDefinition.instance(),
- OrmEclipseLinkTransformationMappingDefinition.instance(),
- OrmManyToManyMappingDefinition.instance(),
- OrmManyToOneMappingDefinition.instance(),
- OrmOneToManyMappingDefinition.instance(),
- OrmOneToOneMappingDefinition.instance(),
- OrmEclipseLinkVariableOneToOneMappingDefinition.instance(),
- NullOrmAttributeMappingDefinition.instance()
- };
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/GenericOrmVirtualTenantDiscriminatorColumn2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/GenericOrmVirtualTenantDiscriminatorColumn2_3.java
deleted file mode 100644
index aceef294b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/GenericOrmVirtualTenantDiscriminatorColumn2_3.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmVirtualNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.internal.context.orm.OrmTableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmVirtualTenantDiscriminatorColumn2_3;
-
-/**
- * <code>orm.xml</code> virtual tenant discriminator column
- */
-public class GenericOrmVirtualTenantDiscriminatorColumn2_3
- extends AbstractOrmVirtualNamedDiscriminatorColumn<OrmReadOnlyTenantDiscriminatorColumn2_3.Owner, ReadOnlyTenantDiscriminatorColumn2_3>
- implements OrmVirtualTenantDiscriminatorColumn2_3
-{
- protected final ReadOnlyTenantDiscriminatorColumn2_3 overriddenColumn;
-
- protected String specifiedTable;
- protected String defaultTable;
-
- protected String specifiedContextProperty;
- protected String defaultContextProperty;
-
- protected Boolean specifiedPrimaryKey;
- protected boolean defaultPrimaryKey;
-
-
- public GenericOrmVirtualTenantDiscriminatorColumn2_3(XmlContextNode parent, OrmReadOnlyTenantDiscriminatorColumn2_3.Owner owner, ReadOnlyTenantDiscriminatorColumn2_3 overridenColumn) {
- super(parent, owner);
- this.overriddenColumn = overridenColumn;
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void update() {
- super.update();
-
- this.setSpecifiedTable(this.buildSpecifiedTable());
- this.setDefaultTable(this.buildDefaultTable());
-
- this.setSpecifiedContextProperty(this.buildSpecifiedContextProperty());
- this.setDefaultContextProperty(this.buildDefaultContextProperty());
-
- this.setSpecifiedPrimaryKey(this.buildSpecifiedPrimaryKey());
- this.setDefaultPrimaryKey(this.buildDefaultPrimaryKey());
- }
-
-
- // ********** column **********
-
- @Override
- public ReadOnlyTenantDiscriminatorColumn2_3 getOverriddenColumn() {
- return this.overriddenColumn;
- }
-
-
- // ********** table **********
-
- public String getTable() {
- return (this.specifiedTable != null) ? this.specifiedTable : this.defaultTable;
- }
-
- public String getSpecifiedTable() {
- return this.specifiedTable;
- }
-
- protected void setSpecifiedTable(String table) {
- String old = this.specifiedTable;
- this.specifiedTable = table;
- this.firePropertyChanged(SPECIFIED_TABLE_PROPERTY, old, table);
- }
-
- protected String buildSpecifiedTable() {
- return this.getOverriddenColumn().getSpecifiedTable();
- }
-
- public String getDefaultTable() {
- return this.defaultTable;
- }
-
- protected void setDefaultTable(String table) {
- String old = this.defaultTable;
- this.defaultTable = table;
- this.firePropertyChanged(DEFAULT_TABLE_PROPERTY, old, table);
- }
-
- protected String buildDefaultTable() {
- return this.owner.getDefaultTableName();
- }
-
- // ********** context property **********
-
- public String getContextProperty() {
- return (this.specifiedContextProperty != null) ? this.specifiedContextProperty : this.defaultContextProperty;
- }
-
- public String getSpecifiedContextProperty() {
- return this.specifiedContextProperty;
- }
-
- protected void setSpecifiedContextProperty(String contextProperty) {
- String old = this.specifiedContextProperty;
- this.specifiedContextProperty = contextProperty;
- this.firePropertyChanged(SPECIFIED_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildSpecifiedContextProperty() {
- return this.getOverriddenColumn().getSpecifiedContextProperty();
- }
-
- public String getDefaultContextProperty() {
- return this.defaultContextProperty;
- }
-
- protected void setDefaultContextProperty(String contextProperty) {
- String old = this.defaultContextProperty;
- this.defaultContextProperty = contextProperty;
- this.firePropertyChanged(DEFAULT_CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- protected String buildDefaultContextProperty() {
- return this.owner.getDefaultContextPropertyName();
- }
-
-
- // ********** primary key **********
-
- public boolean isPrimaryKey() {
- return (this.specifiedPrimaryKey != null) ? this.specifiedPrimaryKey.booleanValue() : this.defaultPrimaryKey;
- }
-
- public Boolean getSpecifiedPrimaryKey() {
- return this.specifiedPrimaryKey;
- }
-
- protected void setSpecifiedPrimaryKey(Boolean primaryKey) {
- Boolean old = this.specifiedPrimaryKey;
- this.specifiedPrimaryKey = primaryKey;
- this.firePropertyChanged(SPECIFIED_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected Boolean buildSpecifiedPrimaryKey() {
- return this.getOverriddenColumn().getSpecifiedPrimaryKey();
- }
-
- public boolean isDefaultPrimaryKey() {
- return this.defaultPrimaryKey;
- }
-
- protected void setDefaultPrimaryKey(boolean primaryKey) {
- boolean old = this.defaultPrimaryKey;
- this.defaultPrimaryKey = primaryKey;
- this.firePropertyChanged(DEFAULT_PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- protected boolean buildDefaultPrimaryKey() {
- return this.owner.getDefaultPrimaryKey();
- }
-
-
- // ********** misc **********
-
- public boolean tableNameIsInvalid() {
- return this.owner.tableNameIsInvalid(this.getTable());
- }
-
- public Iterable<String> getCandidateTableNames() {
- return this.owner.getCandidateTableNames();
- }
-
-
- // ********** validation **********
-
- public TextRange getTableTextRange() {
- return this.getValidationTextRange();
- }
-
- @Override
- protected NamedColumnTextRangeResolver buildTextRangeResolver() {
- return new OrmTableColumnTextRangeResolver(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/NullOrmEclipseLinkMultitenancy2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/NullOrmEclipseLinkMultitenancy2_3.java
deleted file mode 100644
index c4aeb14826..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/NullOrmEclipseLinkMultitenancy2_3.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmVirtualTenantDiscriminatorColumn2_3;
-
-public class NullOrmEclipseLinkMultitenancy2_3
- extends AbstractOrmXmlContextNode
- implements OrmEclipseLinkMultitenancy2_3
-{
-
- public NullOrmEclipseLinkMultitenancy2_3(OrmEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
- }
-
-
- // ********** multitenant **********
-
- public boolean isMultitenant() {
- return false;
- }
-
- public boolean isDefaultMultitenant() {
- return false;
- }
-
- public boolean isSpecifiedMultitenant() {
- return false;
- }
-
- public void setSpecifiedMultitenant(boolean isMultitenant) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
-
- // ********** type **********
-
- public EclipseLinkMultitenantType2_3 getType() {
- return null;
- }
-
- public EclipseLinkMultitenantType2_3 getSpecifiedType() {
- return null;
- }
-
- public void setSpecifiedType(EclipseLinkMultitenantType2_3 type) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public EclipseLinkMultitenantType2_3 getDefaultType() {
- return null;
- }
-
-
- // ********** include criteria **********
-
- public boolean isIncludeCriteria() {
- return false;
- }
-
- public Boolean getSpecifiedIncludeCriteria() {
- return null;
- }
-
- public void setSpecifiedIncludeCriteria(Boolean includeCriteria) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public boolean isDefaultIncludeCriteria() {
- return false;
- }
-
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return false;
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public TextRange getValidationTextRange() {
- throw new UnsupportedOperationException("Multitenancy is only supported in EclipseLink version 2.3 and higher"); //$NON-NLS-1$
- }
-
- public ListIterable<OrmVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return EmptyListIterable.instance();
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return 0;
- }
-
- public boolean specifiedTenantDiscriminatorColumnsAllowed() {
- return false;
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3.java
deleted file mode 100644
index fcfe9537db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumnMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmLobConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.TableColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.EntityTableDescriptionProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.NamedColumnValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.NullOrmConverter;
-import org.eclipse.jpt.jpa.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkArrayMapping2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-//TODO canonical metamodel generation, need to override getMetamodelTypeName() and use the target-class element
-public class OrmEclipseLinkArrayMapping2_3
- extends AbstractOrmAttributeMapping<XmlArray>
- implements
- EclipseLinkArrayMapping2_3,
- EclipseLinkOrmConvertibleMapping,
- OrmEclipseLinkConverterContainer.Owner,
- OrmColumnMapping
-{
- protected final OrmColumn column;
-
- protected OrmConverter converter; // never null
-
- protected static final OrmConverter.Adapter[] CONVERTER_ADAPTER_ARRAY = new OrmConverter.Adapter[] {
- OrmEnumeratedConverter.Adapter.instance(),
- OrmTemporalConverter.BasicAdapter.instance(),
- OrmLobConverter.Adapter.instance(),
- OrmEclipseLinkConvert.Adapter.instance()
- };
- protected static final Iterable<OrmConverter.Adapter> CONVERTER_ADAPTERS = new ArrayIterable<OrmConverter.Adapter>(CONVERTER_ADAPTER_ARRAY);
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
-
- public OrmEclipseLinkArrayMapping2_3(OrmPersistentAttribute parent, XmlArray xmlMapping) {
- super(parent, xmlMapping);
- this.column = this.buildColumn();
- this.converterContainer = this.buildConverterContainer();
- this.converter = this.buildConverter();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.column.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.syncConverter();
- }
-
- @Override
- public void update() {
- super.update();
- this.column.update();
- this.converterContainer.update();
- this.converter.update();
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
-
- // ********** column **********
-
- public OrmColumn getColumn() {
- return this.column;
- }
-
- protected OrmColumn buildColumn() {
- return this.getContextNodeFactory().buildOrmColumn(this, this);
- }
-
-
- // ********** converter **********
-
- public OrmConverter getConverter() {
- return this.converter;
- }
-
- public void setConverter(Class<? extends Converter> converterType) {
- if (this.converter.getType() != converterType) {
- // note: we may also clear the XML value we want;
- // but if we leave it, the resulting sync will screw things up...
- this.clearXmlConverterValues();
- OrmConverter.Adapter converterAdapter = this.getConverterAdapter(converterType);
- this.setConverter_(this.buildConverter(converterAdapter));
- this.converter.initialize();
- }
- }
-
- protected OrmConverter buildConverter(OrmConverter.Adapter converterAdapter) {
- return (converterAdapter != null) ?
- converterAdapter.buildNewConverter(this, this.getContextNodeFactory()) :
- this.buildNullConverter();
- }
-
- protected void setConverter_(OrmConverter converter) {
- Converter old = this.converter;
- this.converter = converter;
- this.firePropertyChanged(CONVERTER_PROPERTY, old, converter);
- }
-
- protected void clearXmlConverterValues() {
- for (OrmConverter.Adapter adapter : this.getConverterAdapters()) {
- adapter.clearXmlValue(this.xmlAttributeMapping);
- }
- }
-
- protected OrmConverter buildConverter() {
- OrmXmlContextNodeFactory factory = this.getContextNodeFactory();
- for (OrmConverter.Adapter adapter : this.getConverterAdapters()) {
- OrmConverter ormConverter = adapter.buildConverter(this, factory);
- if (ormConverter != null) {
- return ormConverter;
- }
- }
- return this.buildNullConverter();
- }
-
- protected void syncConverter() {
- OrmConverter.Adapter adapter = this.getXmlConverterAdapter();
- if (adapter == null) {
- if (this.converter.getType() != null) {
- this.setConverter_(this.buildNullConverter());
- }
- } else {
- if (this.converter.getType() == adapter.getConverterType()) {
- this.converter.synchronizeWithResourceModel();
- } else {
- this.setConverter_(adapter.buildNewConverter(this, this.getContextNodeFactory()));
- }
- }
- }
-
- /**
- * Return the first adapter whose converter value is set in the XML mapping.
- * Return <code>null</code> if there are no converter values in the XML.
- */
- protected OrmConverter.Adapter getXmlConverterAdapter() {
- for (OrmConverter.Adapter adapter : this.getConverterAdapters()) {
- if (adapter.isActive(this.xmlAttributeMapping)) {
- return adapter;
- }
- }
- return null;
- }
-
- protected OrmConverter buildNullConverter() {
- return new NullOrmConverter(this);
- }
-
-
- // ********** converter adapters **********
-
- /**
- * Return the converter adapter for the specified converter type.
- */
- protected OrmConverter.Adapter getConverterAdapter(Class<? extends Converter> converterType) {
- for (OrmConverter.Adapter adapter : this.getConverterAdapters()) {
- if (adapter.getConverterType() == converterType) {
- return adapter;
- }
- }
- return null;
- }
-
- protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
- return CONVERTER_ADAPTERS;
- }
-
- // ********** converters **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.xmlAttributeMapping);
- }
-
- public int getNumberSupportedConverters() {
- return 2; //TODO EclipseLink supports 2, but really should be just 1, see bug 365114
- }
-
-
- // ********** misc **********
-
- public String getKey() {
- return EclipseLinkMappingKeys.ARRAY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public int getXmlSequence() {
- return 110;
- }
-
- @Override
- public boolean isOverridableAttributeMapping() {
- return true;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- @Override
- protected void initializeFromOrmColumnMapping(OrmColumnMapping oldMapping) {
- super.initializeFromOrmColumnMapping(oldMapping);
- this.column.initializeFrom(oldMapping.getColumn());
- }
-
- public void addXmlAttributeMappingTo(Attributes xmlAttributes) {
- ((XmlAttributes_2_3) xmlAttributes).getArrays().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(Attributes xmlAttributes) {
- ((XmlAttributes_2_3) xmlAttributes).getArrays().remove(this.xmlAttributeMapping);
- }
-
-
- // ********** OrmColumn.Owner implementation **********
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return this.name;
- }
-
- public String getDefaultTableName() {
- return this.getTypeMapping().getPrimaryTableName();
- }
-
- public Table resolveDbTable(String tableName) {
- return this.getTypeMapping().resolveDbTable(tableName);
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return this.getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public Iterable<String> getCandidateTableNames() {
- return this.getTypeMapping().getAllAssociatedTableNames();
- }
-
- public XmlColumn getXmlColumn() {
- return this.xmlAttributeMapping.getColumn();
- }
-
- public XmlColumn buildXmlColumn() {
- XmlColumn xmlColumn = OrmFactory.eINSTANCE.createXmlColumn();
- this.xmlAttributeMapping.setColumn(xmlColumn);
- return xmlColumn;
- }
-
- public void removeXmlColumn() {
- this.xmlAttributeMapping.setColumn(null);
- }
-
-
- //************ refactoring ************
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.converterContainer.createMoveTypeEdits(originalType, newPackage)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.converterContainer.createRenamePackageEdits(originalPackage, newName)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.converterContainer.createRenameTypeEdits(originalType, newName)
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.column.validate(messages, reporter);
- this.converter.validate(messages, reporter);
- }
-
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn col, NamedColumnTextRangeResolver textRangeResolver) {
- return new NamedColumnValidator(this.getPersistentAttribute(), (ReadOnlyBaseColumn) col, (TableColumnTextRangeResolver) textRangeResolver, new EntityTableDescriptionProvider());
- }
-
- // ********** completion proposals **********
-
- @Override
- public Iterable<String> getXmlCompletionProposals(int pos) {
- Iterable<String> result = super.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- result = this.column.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- result = this.converter.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3Definition.java
deleted file mode 100644
index bdf36eddc2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkArrayMapping2_3Definition.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray;
-
-public class OrmEclipseLinkArrayMapping2_3Definition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkArrayMapping2_3Definition INSTANCE =
- new OrmEclipseLinkArrayMapping2_3Definition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEclipseLinkArrayMapping2_3Definition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.ARRAY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlArray(),
- XmlArray.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return new OrmEclipseLinkArrayMapping2_3(parent, (XmlArray) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java
deleted file mode 100644
index c12804c92d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-
-public class OrmEclipseLinkBasicCollectionMapping
- extends AbstractOrmEclipseLinkBasicCollectionMapping
-{
- public OrmEclipseLinkBasicCollectionMapping(OrmPersistentAttribute parent, XmlBasicCollection xmlMapping) {
- super(parent, xmlMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java
deleted file mode 100644
index cc74413dc1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMapping2_1.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkBasicCollectionMapping2_1
- extends AbstractOrmEclipseLinkBasicCollectionMapping
-{
- public OrmEclipseLinkBasicCollectionMapping2_1(OrmPersistentAttribute parent, XmlBasicCollection xmlMapping) {
- super(parent, xmlMapping);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.BASIC_COLLECTION_MAPPING_DEPRECATED,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java
deleted file mode 100644
index 25b2416257..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicCollectionMappingDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection;
-
-public class OrmEclipseLinkBasicCollectionMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkBasicCollectionMappingDefinition INSTANCE =
- new OrmEclipseLinkBasicCollectionMappingDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEclipseLinkBasicCollectionMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlBasicCollection(),
- XmlBasicCollection.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildOrmEclipseLinkBasicCollectionMapping(parent, (XmlBasicCollection) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java
deleted file mode 100644
index b968528b6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-
-public class OrmEclipseLinkBasicMapMapping
- extends AbstractOrmEclipseLinkBasicMapMapping
-{
- public OrmEclipseLinkBasicMapMapping(OrmPersistentAttribute parent, XmlBasicMap xmlMapping) {
- super(parent, xmlMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping2_1.java
deleted file mode 100644
index df70780bff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMapping2_1.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkBasicMapMapping2_1
- extends AbstractOrmEclipseLinkBasicMapMapping
-{
- public OrmEclipseLinkBasicMapMapping2_1(OrmPersistentAttribute parent, XmlBasicMap xmlMapping) {
- super(parent, xmlMapping);
- }
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.BASIC_MAP_MAPPING_DEPRECATED,
- new String[] {this.getName()},
- this,
- this.getValidationTextRange()
- )
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java
deleted file mode 100644
index 5130e023ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapMappingDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap;
-
-public class OrmEclipseLinkBasicMapMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkBasicMapMappingDefinition INSTANCE =
- new OrmEclipseLinkBasicMapMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensforce singleton usage
- */
- private OrmEclipseLinkBasicMapMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlBasicMap(),
- XmlBasicMap.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildOrmEclipseLinkBasicMapMapping(parent, (XmlBasicMap) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java
deleted file mode 100644
index 7bb026f2d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkBasicMapping.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkBasicMapping
- extends AbstractOrmBasicMapping<XmlBasic>
- implements
- EclipseLinkBasicMapping,
- EclipseLinkOrmConvertibleMapping,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkMutable mutable;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
-
- public OrmEclipseLinkBasicMapping(OrmPersistentAttribute parent, XmlBasic xmlMapping) {
- super(parent, xmlMapping);
- this.mutable = new OrmEclipseLinkMutable(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- this.converterContainer.update();
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
-
- // ********** converters **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.xmlAttributeMapping);
- }
-
- public int getNumberSupportedConverters() {
- return 1;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<OrmConverter.Adapter>(
- OrmEclipseLinkConvert.Adapter.instance(),
- super.getConverterAdapters()
- );
- }
-
-
- //************ refactoring ************
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.converterContainer.createMoveTypeEdits(originalType, newPackage)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.converterContainer.createRenamePackageEdits(originalPackage, newName)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.converterContainer.createRenameTypeEdits(originalType, newName)
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateAttributeType(messages);
- // TODO mutable validation
- }
-
- protected void validateAttributeType(List<IMessage> messages) {
- if (this.isVirtualAccess()) {
- if (StringTools.stringIsEmpty(this.getAttributeType())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED,
- new String[] {this.getName()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedAttributeType())) {
- return;
- }
- if (this.getResolvedAttributeType() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedAttributeType()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- }
- return;
- }
- }
- }
-
- protected boolean isVirtualAccess() {
- return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL;
- }
-
- protected TextRange getAttributeTypeTextRange() {
- return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java
deleted file mode 100644
index cc7e2b852b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCachingImpl.java
+++ /dev/null
@@ -1,805 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.NullOrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay;
-
-public class OrmEclipseLinkCachingImpl
- extends AbstractOrmXmlContextNode
- implements OrmEclipseLinkCaching, OrmCacheableHolder2_0
-{
- protected EclipseLinkCacheType specifiedType;
- protected EclipseLinkCacheType defaultType = DEFAULT_TYPE;
-
- protected Integer specifiedSize;
- protected int defaultSize = DEFAULT_SIZE;
-
- protected Boolean specifiedShared;
- protected boolean defaultShared = DEFAULT_SHARED;
-
- protected Boolean specifiedAlwaysRefresh;
- protected boolean defaultAlwaysRefresh = DEFAULT_ALWAYS_REFRESH;
-
- protected Boolean specifiedRefreshOnlyIfNewer;
- protected boolean defaultRefreshOnlyIfNewer = DEFAULT_REFRESH_ONLY_IF_NEWER;
-
- protected Boolean specifiedDisableHits;
- protected boolean defaultDisableHits = DEFAULT_DISABLE_HITS;
-
- protected EclipseLinkCacheCoordinationType specifiedCoordinationType;
- protected EclipseLinkCacheCoordinationType defaultCoordinationType = DEFAULT_COORDINATION_TYPE;
-
- protected Integer expiry;
- protected EclipseLinkOrmTimeOfDay expiryTimeOfDay;
-
- protected EclipseLinkExistenceType specifiedExistenceType;
- protected EclipseLinkExistenceType defaultExistenceType = DEFAULT_EXISTENCE_TYPE;
-
- protected final OrmCacheable2_0 cacheable;
-
- protected EclipseLinkCacheIsolationType2_2 specifiedIsolation;
- protected EclipseLinkCacheIsolationType2_2 defaultIsolation = DEFAULT_ISOLATION;
-
-
- public OrmEclipseLinkCachingImpl(OrmEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
-
- this.specifiedType = this.buildSpecifiedType();
- this.specifiedSize = this.buildSpecifiedSize();
- this.specifiedShared = this.buildSpecifiedShared();
- this.specifiedAlwaysRefresh = this.buildSpecifiedAlwaysRefresh();
- this.specifiedRefreshOnlyIfNewer = this.buildSpecifiedRefreshOnlyIfNewer();
- this.specifiedDisableHits = this.buildSpecifiedDisableHits();
-
- this.specifiedCoordinationType = this.buildSpecifiedCoordinationType();
-
- this.expiry = this.buildExpiry();
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay();
-
- this.specifiedExistenceType = this.buildSpecifiedExistenceType();
-
- this.cacheable = this.buildCacheable();
-
- this.specifiedIsolation = this.buildSpecifiedIsolation();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
-
- this.setSpecifiedType_(this.buildSpecifiedType());
- this.setSpecifiedSize_(this.buildSpecifiedSize());
- this.setSpecifiedShared_(this.buildSpecifiedShared());
- this.setSpecifiedAlwaysRefresh_(this.buildSpecifiedAlwaysRefresh());
- this.setSpecifiedRefreshOnlyIfNewer_(this.buildSpecifiedRefreshOnlyIfNewer());
- this.setSpecifiedDisableHits_(this.buildSpecifiedDisableHits());
-
- this.setSpecifiedCoordinationType_(this.buildSpecifiedCoordinationType());
-
- this.setExpiry_(this.buildExpiry());
- this.syncExpiryTimeOfDay();
-
- this.setSpecifiedExistenceType_(this.buildSpecifiedExistenceType());
-
- this.cacheable.synchronizeWithResourceModel();
-
- this.setSpecifiedIsolation_(this.buildSpecifiedIsolation());
- }
-
- @Override
- public void update() {
- super.update();
-
- boolean xmlCacheNotSpecified = (this.getXmlCache() == null);
- JavaEclipseLinkCaching javaCaching = this.getJavaCachingForDefaults();
- boolean javaCacheSpecified = (javaCaching != null);
- boolean useJavaValue = (xmlCacheNotSpecified && javaCacheSpecified);
-
- this.setDefaultType(useJavaValue ? javaCaching.getType() : DEFAULT_TYPE);
- this.setDefaultSize(useJavaValue ? javaCaching.getSize() : DEFAULT_SIZE);
- this.setDefaultShared(useJavaValue ? javaCaching.isShared() : DEFAULT_SHARED);
- this.setDefaultAlwaysRefresh(useJavaValue ? javaCaching.isAlwaysRefresh() : DEFAULT_ALWAYS_REFRESH);
- this.setDefaultRefreshOnlyIfNewer(useJavaValue ? javaCaching.isRefreshOnlyIfNewer() : DEFAULT_REFRESH_ONLY_IF_NEWER);
- this.setDefaultDisableHits(useJavaValue ? javaCaching.isDisableHits() : DEFAULT_DISABLE_HITS);
-
- this.setDefaultCoordinationType(useJavaValue ? javaCaching.getCoordinationType() : DEFAULT_COORDINATION_TYPE);
-
- if (this.expiryTimeOfDay != null) {
- this.expiryTimeOfDay.update();
- }
-
- // existence checking is its own xml attribute, it is not part of the cache xml element
- this.setDefaultExistenceType(javaCacheSpecified ? javaCaching.getExistenceType() : DEFAULT_EXISTENCE_TYPE);
-
- this.cacheable.update();
-
- this.setDefaultIsolation(useJavaValue ? javaCaching.getIsolation() : DEFAULT_ISOLATION);
- }
-
-
- // ********** type **********
-
- public EclipseLinkCacheType getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.defaultType;
- }
-
- public EclipseLinkCacheType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkCacheType type) {
- if (this.valuesAreDifferent(this.specifiedType, type)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedType_(type);
- xmlCache.setType(EclipseLinkCacheType.toOrmResourceModel(type));
- this.removeXmlCacheIfUnset();
- }
-
- if (type != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkCacheType type) {
- EclipseLinkCacheType old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkCacheType buildSpecifiedType() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : EclipseLinkCacheType.fromOrmResourceModel(xmlCache.getType());
- }
-
- public EclipseLinkCacheType getDefaultType() {
- String puDefaultCacheTypeName = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheTypePropertyValue();
- if (!StringTools.stringIsEmpty(puDefaultCacheTypeName)) {
- try {
- return EclipseLinkCacheType.valueOf(StringTools.convertCamelCaseToAllCaps(puDefaultCacheTypeName));
- } catch (IllegalArgumentException exception) {
- //no match, return default
- }
- }
- return this.defaultType;
- }
-
- protected void setDefaultType(EclipseLinkCacheType type) {
- EclipseLinkCacheType old = this.defaultType;
- this.defaultType = type;
- this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, type);
- }
-
-
- // ********** size **********
-
- public int getSize() {
- return (this.specifiedSize != null) ? this.specifiedSize.intValue() : this.defaultSize;
- }
-
- public Integer getSpecifiedSize() {
- return this.specifiedSize;
- }
-
- public void setSpecifiedSize(Integer size) {
- if (this.valuesAreDifferent(this.specifiedSize, size)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedSize_(size);
- xmlCache.setSize(size);
- this.removeXmlCacheIfUnset();
- }
-
- if (size != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedSize_(Integer size) {
- Integer old = this.specifiedSize;
- this.specifiedSize = size;
- this.firePropertyChanged(SPECIFIED_SIZE_PROPERTY, old, size);
- }
-
- protected Integer buildSpecifiedSize() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getSize();
- }
-
- public int getDefaultSize() {
- String puDefaultCacheSize = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSizePropertyValue();
- if (!StringTools.stringIsEmpty(puDefaultCacheSize)) {
- try {
- return Integer.valueOf(puDefaultCacheSize).intValue();
- } catch (NumberFormatException exception) {
- //couldn't parse, return default
- }
- }
- return this.defaultSize;
- }
-
- protected void setDefaultSize(int size) {
- int old = this.defaultSize;
- this.defaultSize = size;
- this.firePropertyChanged(DEFAULT_SIZE_PROPERTY, old, size);
- }
-
-
- // ********** shared **********
-
- public boolean isShared() {
- return (this.specifiedShared != null) ? this.specifiedShared.booleanValue() : this.defaultShared;
- }
-
- public Boolean getSpecifiedShared() {
- return this.specifiedShared;
- }
-
- public void setSpecifiedShared(Boolean shared) {
- if (this.valuesAreDifferent(this.specifiedShared, shared)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedShared_(shared);
- xmlCache.setShared(shared);
- this.removeXmlCacheIfUnset();
- }
-
- if ((shared != null) && ! shared.booleanValue()) { // Boolean.FALSE
- this.setSpecifiedType(null);
- this.setSpecifiedSize(null);
- this.setSpecifiedAlwaysRefresh(null);
- this.setSpecifiedRefreshOnlyIfNewer(null);
- this.setSpecifiedDisableHits(null);
- this.setSpecifiedCoordinationType(null);
- this.setExpiry(null);
- this.removeExpiryTimeOfDayIfNecessary();
- }
- }
-
- protected void setSpecifiedShared_(Boolean shared) {
- Boolean old = this.specifiedShared;
- this.specifiedShared = shared;
- this.firePropertyChanged(SPECIFIED_SHARED_PROPERTY, old, shared);
- }
-
- protected Boolean buildSpecifiedShared() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getShared();
- }
-
- public boolean isDefaultShared() {
- String puDefaultSharedCache = ((EclipseLinkPersistenceUnit)getPersistenceUnit()).getDefaultCacheSharedPropertyValue();
- return !StringTools.stringIsEmpty(puDefaultSharedCache) ? Boolean.valueOf(puDefaultSharedCache) : this.defaultShared;
- }
-
- protected void setDefaultShared(boolean shared) {
- boolean old = this.defaultShared;
- this.defaultShared = shared;
- this.firePropertyChanged(DEFAULT_SHARED_PROPERTY, old, shared);
- }
-
-
- // ********** always refresh **********
-
- public boolean isAlwaysRefresh() {
- return (this.specifiedAlwaysRefresh != null) ? this.specifiedAlwaysRefresh.booleanValue() : this.defaultAlwaysRefresh;
- }
-
- public Boolean getSpecifiedAlwaysRefresh() {
- return this.specifiedAlwaysRefresh;
- }
-
- public void setSpecifiedAlwaysRefresh(Boolean alwaysRefresh) {
- if (this.valuesAreDifferent(this.specifiedAlwaysRefresh, alwaysRefresh)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedAlwaysRefresh_(alwaysRefresh);
- xmlCache.setAlwaysRefresh(alwaysRefresh);
- this.removeXmlCacheIfUnset();
- }
-
- if (alwaysRefresh != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedAlwaysRefresh_(Boolean alwaysRefresh) {
- Boolean old = this.specifiedAlwaysRefresh;
- this.specifiedAlwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(SPECIFIED_ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
- }
-
- protected Boolean buildSpecifiedAlwaysRefresh() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getAlwaysRefresh();
- }
-
- public boolean isDefaultAlwaysRefresh() {
- return this.defaultAlwaysRefresh;
- }
-
- protected void setDefaultAlwaysRefresh(boolean alwaysRefresh) {
- boolean old = this.defaultAlwaysRefresh;
- this.defaultAlwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(DEFAULT_ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
- }
-
-
- // ********** refresh only if newer **********
-
- public boolean isRefreshOnlyIfNewer() {
- return (this.specifiedRefreshOnlyIfNewer != null) ? this.specifiedRefreshOnlyIfNewer.booleanValue() : this.defaultRefreshOnlyIfNewer;
- }
-
- public Boolean getSpecifiedRefreshOnlyIfNewer() {
- return this.specifiedRefreshOnlyIfNewer;
- }
-
- public void setSpecifiedRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- if (this.valuesAreDifferent(this.specifiedRefreshOnlyIfNewer, refreshOnlyIfNewer)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedRefreshOnlyIfNewer_(refreshOnlyIfNewer);
- xmlCache.setRefreshOnlyIfNewer(refreshOnlyIfNewer);
- this.removeXmlCacheIfUnset();
- }
-
- if (refreshOnlyIfNewer != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedRefreshOnlyIfNewer_(Boolean refreshOnlyIfNewer) {
- Boolean old = this.specifiedRefreshOnlyIfNewer;
- this.specifiedRefreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
- }
-
- protected Boolean buildSpecifiedRefreshOnlyIfNewer() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getRefreshOnlyIfNewer();
- }
-
- public boolean isDefaultRefreshOnlyIfNewer() {
- return this.defaultRefreshOnlyIfNewer;
- }
-
- protected void setDefaultRefreshOnlyIfNewer(boolean refreshOnlyIfNewer) {
- boolean old = this.defaultRefreshOnlyIfNewer;
- this.defaultRefreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
- }
-
-
- // ********** disable hits **********
-
- public boolean isDisableHits() {
- return (this.specifiedDisableHits != null) ? this.specifiedDisableHits.booleanValue() : this.defaultDisableHits;
- }
-
- public Boolean getSpecifiedDisableHits() {
- return this.specifiedDisableHits;
- }
-
- public void setSpecifiedDisableHits(Boolean disableHits) {
- if (this.valuesAreDifferent(this.specifiedDisableHits, disableHits)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedDisableHits_(disableHits);
- xmlCache.setDisableHits(disableHits);
- this.removeXmlCacheIfUnset();
- }
-
- if (disableHits != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedDisableHits_(Boolean disableHits) {
- Boolean old = this.specifiedDisableHits;
- this.specifiedDisableHits = disableHits;
- this.firePropertyChanged(SPECIFIED_DISABLE_HITS_PROPERTY, old, disableHits);
- }
-
- protected Boolean buildSpecifiedDisableHits() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getDisableHits();
- }
-
- public boolean isDefaultDisableHits() {
- return this.defaultDisableHits;
- }
-
- protected void setDefaultDisableHits(boolean disableHits) {
- boolean old = this.defaultDisableHits;
- this.defaultDisableHits = disableHits;
- this.firePropertyChanged(DEFAULT_DISABLE_HITS_PROPERTY, old, disableHits);
- }
-
-
- // ********** coordination type **********
-
- public EclipseLinkCacheCoordinationType getCoordinationType() {
- return (this.specifiedCoordinationType != null) ? this.specifiedCoordinationType : this.defaultCoordinationType;
- }
-
- public EclipseLinkCacheCoordinationType getSpecifiedCoordinationType() {
- return this.specifiedCoordinationType;
- }
-
- public void setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType type) {
- if (this.valuesAreDifferent(this.specifiedCoordinationType, type)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedCoordinationType_(type);
- xmlCache.setCoordinationType(EclipseLinkCacheCoordinationType.toOrmResourceModel(type));
- this.removeXmlCacheIfUnset();
- }
-
- if (type != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedCoordinationType_(EclipseLinkCacheCoordinationType type) {
- EclipseLinkCacheCoordinationType old = this.specifiedCoordinationType;
- this.specifiedCoordinationType = type;
- this.firePropertyChanged(SPECIFIED_COORDINATION_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkCacheCoordinationType buildSpecifiedCoordinationType() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : EclipseLinkCacheCoordinationType.fromOrmResourceModel(xmlCache.getCoordinationType());
- }
-
- public EclipseLinkCacheCoordinationType getDefaultCoordinationType() {
- return this.defaultCoordinationType;
- }
-
- protected void setDefaultCoordinationType(EclipseLinkCacheCoordinationType type) {
- EclipseLinkCacheCoordinationType old= this.defaultCoordinationType;
- this.defaultCoordinationType = type;
- this.firePropertyChanged(DEFAULT_COORDINATION_TYPE_PROPERTY, old, type);
- }
-
-
- // ********** expiry **********
-
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer expiry) {
- if (this.valuesAreDifferent(this.expiry, expiry)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setExpiry_(expiry);
- xmlCache.setExpiry(expiry);
- this.removeXmlCacheIfUnset();
- }
-
- if (expiry != null) {
- this.removeExpiryTimeOfDayIfNecessary();
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setExpiry_(Integer expiry) {
- Integer old = this.expiry;
- this.expiry = expiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry);
- }
-
- protected Integer buildExpiry() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getExpiry();
- }
-
-
- // ********** expiry time of day **********
-
- public EclipseLinkTimeOfDay getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkTimeOfDay addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("expiry time of day already exists: " + this.expiryTimeOfDay); //$NON-NLS-1$
- }
-
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- XmlTimeOfDay xmlTimeOfDay = this.buildXmlTimeOfDay();
- EclipseLinkOrmTimeOfDay timeOfDay = this.buildExpiryTimeOfDay(xmlTimeOfDay);
- this.setExpiryTimeOfDay(timeOfDay);
- xmlCache.setExpiryTimeOfDay(xmlTimeOfDay);
-
- this.setExpiry(null);
- this.setSpecifiedShared(null);
-
- return timeOfDay;
- }
-
- protected XmlTimeOfDay buildXmlTimeOfDay() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTimeOfDay();
- }
-
- public void removeExpiryTimeOfDay() {
- if (this.expiryTimeOfDay == null) {
- throw new IllegalStateException("expiry time of day does not exist"); //$NON-NLS-1$
- }
- this.removeExpiryTimeOfDay_();
- }
-
- protected void removeExpiryTimeOfDayIfNecessary() {
- if (this.expiryTimeOfDay != null) {
- this.removeExpiryTimeOfDay_();
- }
- }
-
- protected void removeExpiryTimeOfDay_() {
- this.setExpiryTimeOfDay(null);
- this.getXmlCache().setExpiryTimeOfDay(null);
- this.removeXmlCacheIfUnset();
- }
-
- protected void setExpiryTimeOfDay(EclipseLinkOrmTimeOfDay timeOfDay) {
- EclipseLinkOrmTimeOfDay old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = timeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, timeOfDay);
- }
-
- protected void syncExpiryTimeOfDay() {
- XmlTimeOfDay xmlTimeOfDay = this.getXmlExpiryTimeOfDay();
- if (xmlTimeOfDay == null) {
- if (this.expiryTimeOfDay != null) {
- this.setExpiryTimeOfDay(null);
- }
- } else {
- if ((this.expiryTimeOfDay != null) && (this.expiryTimeOfDay.getXmlTimeOfDay() == xmlTimeOfDay)) {
- this.expiryTimeOfDay.synchronizeWithResourceModel();
- } else {
- this.setExpiryTimeOfDay(this.buildExpiryTimeOfDay(xmlTimeOfDay));
- }
- }
- }
-
- protected EclipseLinkOrmTimeOfDay buildExpiryTimeOfDay() {
- return this.buildExpiryTimeOfDay(this.getXmlExpiryTimeOfDay());
- }
-
- protected XmlTimeOfDay getXmlExpiryTimeOfDay() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getExpiryTimeOfDay();
- }
-
- protected EclipseLinkOrmTimeOfDay buildExpiryTimeOfDay(XmlTimeOfDay xmlTimeOfDay) {
- return (xmlTimeOfDay == null) ? null : new EclipseLinkOrmTimeOfDay(this, xmlTimeOfDay);
- }
-
-
- // ********** existence type **********
-
- public EclipseLinkExistenceType getExistenceType() {
- return (this.specifiedExistenceType != null) ? this.specifiedExistenceType : this.defaultExistenceType;
- }
-
- public EclipseLinkExistenceType getSpecifiedExistenceType() {
- return this.specifiedExistenceType;
- }
-
- public void setSpecifiedExistenceType(EclipseLinkExistenceType type) {
- if (this.setSpecifiedExistenceType_(type)) {
- this.getXmlCacheHolder().setExistenceChecking(EclipseLinkExistenceType.toOrmResourceModel(type));
- }
- }
-
- protected boolean setSpecifiedExistenceType_(EclipseLinkExistenceType type) {
- EclipseLinkExistenceType old = this.specifiedExistenceType;
- this.specifiedExistenceType = type;
- return this.firePropertyChanged(SPECIFIED_EXISTENCE_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkExistenceType buildSpecifiedExistenceType() {
- XmlCacheHolder xmlCacheHolder = this.getXmlCacheHolder();
- return (xmlCacheHolder == null) ? null : EclipseLinkExistenceType.fromOrmResourceModel(xmlCacheHolder.getExistenceChecking());
- }
-
- public EclipseLinkExistenceType getDefaultExistenceType() {
- return this.defaultExistenceType;
- }
-
- protected void setDefaultExistenceType(EclipseLinkExistenceType type) {
- EclipseLinkExistenceType old = this.defaultExistenceType;
- this.defaultExistenceType = type;
- this.firePropertyChanged(DEFAULT_EXISTENCE_TYPE_PROPERTY, old, type);
- }
-
-
- // ********** cacheable **********
-
- public OrmCacheable2_0 getCacheable() {
- return this.cacheable;
- }
-
- protected OrmCacheable2_0 buildCacheable() {
- return this.isOrmXml2_0Compatible() ?
- this.getContextNodeFactory2_0().buildOrmCacheable(this) :
- new NullOrmCacheable2_0(this);
- }
-
- public boolean calculateDefaultCacheable() {
- if ( ! this.getTypeMapping().isMetadataComplete()) {
- JavaPersistentType javaPersistentType = this.getTypeMapping().getPersistentType().getJavaPersistentType();
- if ((javaPersistentType != null) && (javaPersistentType.getMapping() instanceof CacheableHolder2_0)) {
- return ((CacheableHolder2_0) javaPersistentType.getMapping()).getCacheable().isCacheable();
- }
- }
- CacheableHolder2_0 superCacheableHolder = this.getCacheableSuperPersistentType(this.getTypeMapping().getPersistentType());
- return (superCacheableHolder != null) ?
- superCacheableHolder.getCacheable().isCacheable() :
- ((PersistenceUnit2_0) this.getPersistenceUnit()).calculateDefaultCacheable();
- }
-
- protected CacheableHolder2_0 getCacheableSuperPersistentType(PersistentType persistentType) {
- PersistentType superPersistentType = persistentType.getSuperPersistentType();
- if (superPersistentType == null) {
- return null;
- }
- TypeMapping superMapping = superPersistentType.getMapping();
- return (superMapping instanceof CacheableHolder2_0) ?
- (CacheableHolder2_0) superMapping :
- this.getCacheableSuperPersistentType(superPersistentType); // recurse
- }
-
-
- // ********** isolation **********
-
- public EclipseLinkCacheIsolationType2_2 getIsolation() {
- return (this.specifiedIsolation != null) ? this.specifiedIsolation : this.defaultIsolation;
- }
-
- public EclipseLinkCacheIsolationType2_2 getSpecifiedIsolation() {
- return this.specifiedIsolation;
- }
-
- public void setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2 isolation) {
- if (this.valuesAreDifferent(this.specifiedIsolation, isolation)) {
- XmlCache xmlCache = this.getXmlCacheForUpdate();
- this.setSpecifiedIsolation_(isolation);
- xmlCache.setIsolation(EclipseLinkCacheIsolationType2_2.toOrmResourceModel(isolation));
- this.removeXmlCacheIfUnset();
- }
-
- if (isolation != null) {
- this.setSpecifiedShared(null);
- }
- }
-
- protected void setSpecifiedIsolation_(EclipseLinkCacheIsolationType2_2 isolation) {
- EclipseLinkCacheIsolationType2_2 old = this.specifiedIsolation;
- this.specifiedIsolation = isolation;
- this.firePropertyChanged(SPECIFIED_ISOLATION_PROPERTY, old, isolation);
- }
-
- protected EclipseLinkCacheIsolationType2_2 buildSpecifiedIsolation() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : EclipseLinkCacheIsolationType2_2.fromOrmResourceModel(xmlCache.getIsolation());
- }
-
- public EclipseLinkCacheIsolationType2_2 getDefaultIsolation() {
- return this.defaultIsolation;
- }
-
- protected void setDefaultIsolation(EclipseLinkCacheIsolationType2_2 isolation) {
- EclipseLinkCacheIsolationType2_2 old = this.defaultIsolation;
- this.defaultIsolation = isolation;
- this.firePropertyChanged(DEFAULT_ISOLATION_PROPERTY, old, isolation);
- }
-
- // ********** XML cache **********
-
- /**
- * Return null if the XML cache does not exists.
- */
- protected XmlCache getXmlCache() {
- return this.getXmlCacheHolder().getCache();
- }
-
- /**
- * Build the XML cache if it does not exist.
- */
- protected XmlCache getXmlCacheForUpdate() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache != null) ? xmlCache : this.buildXmlCache();
- }
-
- protected XmlCache buildXmlCache() {
- XmlCache xmlCache = EclipseLinkOrmFactory.eINSTANCE.createXmlCache();
- this.getXmlCacheHolder().setCache(xmlCache);
- return xmlCache;
- }
-
- protected void removeXmlCacheIfUnset() {
- if (this.getXmlCache().isUnset()) {
- this.removeXmlCache();
- }
- }
-
- protected void removeXmlCache() {
- this.getXmlCacheHolder().setCache(null);
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (OrmEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected OrmEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- public XmlCacheable_2_0 getXmlCacheable() {
- return (XmlCacheable_2_0) this.getXmlTypeMapping();
- }
-
- protected XmlCacheHolder getXmlCacheHolder() {
- return (XmlCacheHolder) this.getXmlTypeMapping();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected JavaEclipseLinkCaching getJavaCachingForDefaults() {
- JavaEclipseLinkNonEmbeddableTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : javaTypeMapping.getCaching();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- XmlCache xmlCache = this.getXmlCache();
- return (xmlCache == null) ? null : xmlCache.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java
deleted file mode 100644
index 93f3076f1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkChangeTracking.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder;
-
-public class OrmEclipseLinkChangeTracking
- extends AbstractOrmXmlContextNode
- implements EclipseLinkChangeTracking
-{
- protected EclipseLinkChangeTrackingType specifiedType;
- protected EclipseLinkChangeTrackingType defaultType = DEFAULT_TYPE;
-
-
- public OrmEclipseLinkChangeTracking(EclipseLinkOrmTypeMapping parent) {
- super(parent);
- this.specifiedType = this.buildSpecifiedType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedType_(this.buildSpecifiedType());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultType(this.buildDefaultType());
- }
-
-
- // ********** type **********
-
- public EclipseLinkChangeTrackingType getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.defaultType;
- }
-
- public EclipseLinkChangeTrackingType getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkChangeTrackingType type) {
- if (this.specifiedType != type) {
- XmlChangeTracking xmlChangeTracking = this.getXmlChangeTrackingForUpdate();
- this.setSpecifiedType_(type);
- xmlChangeTracking.setType(EclipseLinkChangeTrackingType.toOrmResourceModel(type));
- this.removeXmlChangeTrackingIfUnset();
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkChangeTrackingType type) {
- EclipseLinkChangeTrackingType old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkChangeTrackingType buildSpecifiedType() {
- XmlChangeTracking xmlChangeTracking = this.getXmlChangeTracking();
- return (xmlChangeTracking == null) ? null : EclipseLinkChangeTrackingType.fromOrmResourceModel(xmlChangeTracking.getType());
- }
-
- public EclipseLinkChangeTrackingType getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(EclipseLinkChangeTrackingType type) {
- EclipseLinkChangeTrackingType old = this.defaultType;
- this.defaultType = type;
- this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkChangeTrackingType buildDefaultType() {
- EclipseLinkChangeTracking javaChangeTracking = this.getJavaChangeTrackingForDefaults();
- return (javaChangeTracking != null) ? javaChangeTracking.getType() : DEFAULT_TYPE;
- }
-
-
- // ********** xml customizer class ref **********
-
- /**
- * Return <code>null</code> if the XML change tracking does not exists.
- */
- protected XmlChangeTracking getXmlChangeTracking() {
- return this.getXmlChangeTrackingHolder().getChangeTracking();
- }
-
- /**
- * Build the XML change tracking if it does not exist.
- */
- protected XmlChangeTracking getXmlChangeTrackingForUpdate() {
- XmlChangeTracking xmlChangeTracking = this.getXmlChangeTracking();
- return (xmlChangeTracking != null) ? xmlChangeTracking : this.buildXmlChangeTracking();
- }
-
- protected XmlChangeTracking buildXmlChangeTracking() {
- XmlChangeTracking xmlChangeTracking = EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking();
- this.getXmlChangeTrackingHolder().setChangeTracking(xmlChangeTracking);
- return xmlChangeTracking;
- }
-
- protected void removeXmlChangeTrackingIfUnset() {
- if (this.getXmlChangeTracking().isUnset()) {
- this.removeXmlChangeTracking();
- }
- }
-
- protected void removeXmlChangeTracking() {
- this.getXmlChangeTrackingHolder().setChangeTracking(null);
- }
-
-
- // ********** misc **********
-
- @Override
- public EclipseLinkOrmTypeMapping getParent() {
- return (EclipseLinkOrmTypeMapping) super.getParent();
- }
-
- protected EclipseLinkOrmTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- protected XmlChangeTrackingHolder getXmlChangeTrackingHolder() {
- return (XmlChangeTrackingHolder) this.getXmlTypeMapping();
- }
-
- protected EclipseLinkJavaTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected EclipseLinkChangeTracking getJavaChangeTrackingForDefaults() {
- EclipseLinkJavaTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : javaTypeMapping.getChangeTracking();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- XmlChangeTracking xmlChangeTracking = this.getXmlChangeTracking();
- return (xmlChangeTracking == null) ? null : xmlChangeTracking.getValidationTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java
deleted file mode 100644
index e4254a0cef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConversionValue.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkConversionValue
- extends AbstractOrmXmlContextNode
- implements EclipseLinkConversionValue
-{
- private final XmlConversionValue xmlConversionValue;
-
- private String dataValue;
-
- private String objectValue;
-
-
- public OrmEclipseLinkConversionValue(OrmEclipseLinkObjectTypeConverter parent, XmlConversionValue xmlConversionValue) {
- super(parent);
- this.xmlConversionValue = xmlConversionValue;
- this.dataValue = xmlConversionValue.getDataValue();
- this.objectValue = xmlConversionValue.getObjectValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataValue_(this.xmlConversionValue.getDataValue());
- this.setObjectValue_(this.xmlConversionValue.getObjectValue());
- }
-
-
- // ********** data value **********
-
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String value) {
- this.setDataValue_(value);
- this.xmlConversionValue.setDataValue(value);
- }
-
- protected void setDataValue_(String value) {
- String old = this.dataValue;
- this.dataValue = value;
- this.firePropertyChanged(DATA_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** object value **********
-
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String value) {
- this.setObjectValue_(value);
- this.xmlConversionValue.setObjectValue(value);
- }
-
- protected void setObjectValue_(String value) {
- String old = this.objectValue;
- this.objectValue = value;
- this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkObjectTypeConverter getParent() {
- return (OrmEclipseLinkObjectTypeConverter) super.getParent();
- }
-
- protected OrmEclipseLinkObjectTypeConverter getObjectTypeConverter() {
- return this.getParent();
- }
-
- public XmlConversionValue getXmlConversionValue() {
- return this.xmlConversionValue;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- }
-
- public TextRange getDataValueTextRange() {
- return this.getValidationTextRange(this.xmlConversionValue.getDataValueTextRange());
- }
-
- protected TextRange getObjectValueTextRange() {
- return this.getValidationTextRange(this.xmlConversionValue.getObjectValueTextRange());
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.xmlConversionValue.getValidationTextRange();
- return (textRange != null) ? textRange : this.getObjectTypeConverter().getValidationTextRange();
- }
-
- public boolean isEquivalentTo(EclipseLinkConversionValue conversionValue) {
- return Tools.valuesAreEqual(this.dataValue, conversionValue.getDataValue()) &&
- Tools.valuesAreEqual(this.objectValue, conversionValue.getObjectValue());
- }
-
- // ********** validation **********
-
- public void convertFrom(JavaEclipseLinkConversionValue value) {
- this.setDataValue(value.getDataValue());
- this.setObjectValue(value.getObjectValue());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java
deleted file mode 100644
index 30e6084c70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConvert.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.Arrays;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.ConverterTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmConverter;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkConvertValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping;
-
-public class OrmEclipseLinkConvert
- extends AbstractOrmConverter
- implements EclipseLinkConvert
-{
- protected String specifiedConverterName;
- protected String defaultConverterName;
-
- public OrmEclipseLinkConvert(OrmAttributeMapping parent, OrmConverter.Owner owner) {
- super(parent, owner);
- this.specifiedConverterName = this.getXmlConvertibleMapping().getConvert();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit(){
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedConverterName_(this.getXmlConvertibleMapping().getConvert());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultConverterName(this.buildDefaultConverterName());
- }
-
-
- // ********** converter name **********
-
- public String getConverterName() {
- return (this.specifiedConverterName != null) ? this.specifiedConverterName : this.defaultConverterName;
- }
-
- public String getSpecifiedConverterName() {
- return this.specifiedConverterName;
- }
-
- public void setSpecifiedConverterName(String name) {
- this.setSpecifiedConverterName_(name);
- this.getXmlConvertibleMapping().setConvert(name);
- }
-
- protected void setSpecifiedConverterName_(String name) {
- String old = this.specifiedConverterName;
- this.specifiedConverterName = name;
- this.firePropertyChanged(SPECIFIED_CONVERTER_NAME_PROPERTY, old, name);
- }
-
- public String getDefaultConverterName() {
- return this.defaultConverterName;
- }
-
- protected void setDefaultConverterName(String name) {
- String old = this.defaultConverterName;
- this.defaultConverterName = name;
- this.firePropertyChanged(DEFAULT_CONVERTER_NAME_PROPERTY, old, name);
- }
-
- protected String buildDefaultConverterName() {
- return DEFAULT_CONVERTER_NAME;
- }
-
-
- // ********** misc **********
-
- protected XmlConvertibleMapping getXmlConvertibleMapping() {
- // cast to EclipseLink type
- return (XmlConvertibleMapping) super.getXmlAttributeMapping();
- }
-
- public Class<? extends Converter> getType() {
- return EclipseLinkConvert.class;
- }
-
- public void initialize() {
- this.specifiedConverterName = ""; //$NON-NLS-1$
- this.getXmlConvertibleMapping().setConvert(this.specifiedConverterName);
- }
-
-
- // ********** validation **********
-
- @Override
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlConvertibleMapping().getConvertTextRange();
- }
-
- // ********** completion proposals **********
-
- @Override
- public Iterable<String> getXmlCompletionProposals(int pos) {
- Iterable<String> result = super.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- if (this.convertValueTouches(pos)) {
- return this.getConverterNames();
- }
- return null;
- }
-
- protected boolean convertValueTouches(int pos) {
- return this.getXmlConvertibleMapping().convertTouches(pos);
- }
-
- /**
- * @return names of the user-defined converters and of reserved converters
- */
- @SuppressWarnings("unchecked")
- protected Iterable<String> getConverterNames() {
- return new CompositeIterable<String>(
- this.getPersistenceUnit().getUniqueConverterNames(),
- Arrays.asList(EclipseLinkConvert.RESERVED_CONVERTER_NAMES));
- }
-
- // ********** adapter **********
-
- public static class Adapter
- implements OrmConverter.Adapter, OrmConverter.Owner
- {
- private static final Adapter INSTANCE = new Adapter();
- public static Adapter instance() {
- return INSTANCE;
- }
-
- private Adapter() {
- super();
- }
-
- public Class<? extends Converter> getConverterType() {
- return EclipseLinkConvert.class;
- }
-
- public OrmConverter buildConverter(OrmAttributeMapping parent, OrmXmlContextNodeFactory factory) {
- XmlConvertibleMapping xmlMapping = (XmlConvertibleMapping) parent.getXmlAttributeMapping();
- return (xmlMapping.getConvert() == null) ? null : new OrmEclipseLinkConvert(parent, this);
- }
-
- public boolean isActive(XmlAttributeMapping xmlMapping) {
- return ((XmlConvertibleMapping) xmlMapping).getConvert() != null;
- }
-
- public OrmConverter buildNewConverter(OrmAttributeMapping parent, OrmXmlContextNodeFactory factory) {
- return new OrmEclipseLinkConvert(parent, this);
- }
-
- public void clearXmlValue(XmlAttributeMapping xmlMapping) {
- ((XmlConvertibleMapping) xmlMapping).setConvert(null);
- }
-
- public JptValidator buildValidator(Converter converter, ConverterTextRangeResolver textRangeResolver) {
- return new EclipseLinkConvertValidator((EclipseLinkConvert) converter, textRangeResolver);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java
deleted file mode 100644
index 7e229197e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverter.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class OrmEclipseLinkConverter<X extends XmlNamedConverter>
- extends AbstractOrmXmlContextNode
- implements EclipseLinkConverter
-{
- protected final X xmlConverter;
-
- protected String name;
-
-
- protected OrmEclipseLinkConverter(XmlContextNode parent, X xmlConverter) {
- super(parent);
- this.xmlConverter = xmlConverter;
- this.name = xmlConverter.getName();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setName_(this.xmlConverter.getName());
- }
-
- @Override
- public void update() {
- super.update();
- }
-
-
- // ********** name **********
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- this.setName_(name);
- this.xmlConverter.setName(name);
- }
-
- protected void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
-
- // ********** misc **********
-
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-
- public X getXmlConverter() {
- return this.xmlConverter;
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- public char getEnclosingTypeSeparator() {
- return '$';
- }
-
-
- // ********** refactoring **********
-
- public abstract Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName);
-
- public abstract Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage);
-
- public abstract Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName);
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateName(messages);
- }
-
- protected void validateName(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(this.name)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_NAME_UNDEFINED,
- EMPTY_STRING_ARRAY,
- this,
- this.getNameTextRange()
- )
- );
- return;
- }
-
- if (ArrayTools.contains(EclipseLinkConvert.RESERVED_CONVERTER_NAMES, this.name)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.RESERVED_CONVERTER_NAME,
- EMPTY_STRING_ARRAY,
- this,
- this.getNameTextRange()
- )
- );
- }
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.xmlConverter.getValidationTextRange();
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange();
- }
-
- public TextRange getNameTextRange() {
- return this.getValidationTextRange(this.xmlConverter.getNameTextRange());
- }
-
- public boolean isEquivalentTo(JpaNamedContextNode node) {
- return (this != node) &&
- (this.getType() == node.getType()) &&
- Tools.valuesAreEqual(this.name, node.getName());
- }
-
- // ********** metadata conversion **********
-
- public void convertFrom(JavaEclipseLinkConverter<?> javaConverter) {
- this.setName(javaConverter.getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterClassConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterClassConverter.java
deleted file mode 100644
index 349a25572b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterClassConverter.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterClassConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public abstract class OrmEclipseLinkConverterClassConverter<X extends XmlNamedConverter>
- extends OrmEclipseLinkConverter<X>
- implements EclipseLinkConverterClassConverter
-{
- private String converterClass;
- private String fullyQualifiedConverterClass;
-
-
- public OrmEclipseLinkConverterClassConverter(XmlContextNode parent, X xmlConverter) {
- super(parent, xmlConverter);
- this.converterClass = this.getXmlConverterClass();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setConverterClass_(this.getXmlConverterClass());
- }
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedConverterClass(this.buildFullyQualifiedConverterClass());
- }
-
- // ********** converter class **********
-
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String converterClass) {
- this.setConverterClass_(converterClass);
- this.setXmlConverterClass(converterClass);
- }
-
- protected void setConverterClass_(String newConverterClass) {
- String oldConverterClass = this.converterClass;
- this.converterClass = newConverterClass;
- this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, oldConverterClass, newConverterClass);
- }
-
- public String getFullyQualifiedConverterClass() {
- return this.fullyQualifiedConverterClass;
- }
-
- protected void setFullyQualifiedConverterClass(String converterClass) {
- String old = this.fullyQualifiedConverterClass;
- this.fullyQualifiedConverterClass = converterClass;
- this.firePropertyChanged(FULLY_QUALIFIED_CONVERTER_CLASS_PROPERTY, old, converterClass);
- }
-
- protected String buildFullyQualifiedConverterClass() {
- return this.getMappingFileRoot().getFullyQualifiedName(this.converterClass);
- }
-
- protected JavaResourceAbstractType getConverterJavaResourceType() {
- if (this.fullyQualifiedConverterClass == null) {
- return null;
- }
- return this.getJpaProject().getJavaResourceType(this.fullyQualifiedConverterClass);
- }
-
- protected abstract String getXmlConverterClass();
-
- protected abstract void setXmlConverterClass(String converterClass);
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateConverterClass(messages);
- }
-
- protected void validateConverterClass(List<IMessage> messages) {
- if (StringTools.stringIsEmpty(this.converterClass)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_CLASS_DEFINED,
- this,
- this.getConverterClassTextRange()
- )
- );
- return;
- }
-
- IType converterJdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedConverterClass());
- if (converterJdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.CONVERTER_CLASS_EXISTS,
- new String[] {this.getFullyQualifiedConverterClass()},
- this,
- this.getConverterClassTextRange()
- )
- );
- return;
- }
-
- if ( ! this.converterClassImplementsInterface(this.getEclipseLinkConverterInterface())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- this.getEclipseLinkConverterInterfaceErrorMessage(),
- new String[] {this.getFullyQualifiedConverterClass()},
- this,
- this.getConverterClassTextRange()
- )
- );
- }
- }
-
- /**
- * Return the name of the EclipseLink interface the converter class must
- * implement.
- */
- protected abstract String getEclipseLinkConverterInterface();
-
- protected abstract String getEclipseLinkConverterInterfaceErrorMessage();
-
- /**
- * Add <code>null</code> check.
- */
- protected boolean typeImplementsInterface(String typeName, String interfaceName) {
- return (typeName != null) &&
- JDTTools.typeIsSubType(this.getJavaProject(), typeName, interfaceName);
- }
-
- protected boolean converterClassImplementsInterface(String interfaceName) {
- return this.typeImplementsInterface(this.getFullyQualifiedConverterClass(), interfaceName);
- }
-
- protected TextRange getConverterClassTextRange() {
- return this.getValidationTextRange(this.getXmlConverterClassTextRange());
- }
-
- protected abstract TextRange getXmlConverterClassTextRange();
-
-
- @Override
- public boolean isEquivalentTo(JpaNamedContextNode node) {
- return super.isEquivalentTo(node)
- && this.isEquivalentTo((EclipseLinkConverterClassConverter) node);
- }
-
- protected boolean isEquivalentTo(EclipseLinkConverterClassConverter converter) {
- return Tools.valuesAreEqual(this.getFullyQualifiedConverterClass(), converter.getFullyQualifiedConverterClass());
- }
-
- // ********** refactoring **********
-
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return this.isFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected abstract ReplaceEdit createRenameEdit(IType originalType, String newName);
-
- @Override
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.isFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenamePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected abstract ReplaceEdit createRenamePackageEdit(String newName);
-
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.isIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenamePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected boolean isFor(String typeName) {
- String converterType = this.getFullyQualifiedConverterClass();
- return (converterType != null) && converterType.equals(typeName);
- }
-
- protected boolean isIn(IPackageFragment packageFragment) {
- JavaResourceAbstractType converterType = this.getConverterJavaResourceType();
- return (converterType != null) && converterType.isIn(packageFragment);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterContainerImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterContainerImpl.java
deleted file mode 100644
index 34f83c63ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkConverterContainerImpl.java
+++ /dev/null
@@ -1,624 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkConverterContainerImpl
- extends AbstractOrmXmlContextNode
- implements OrmEclipseLinkConverterContainer
-{
-
- private final Owner owner;
- private final XmlConverterContainer xmlConverterContainer;
-
- protected final ContextListContainer<OrmEclipseLinkCustomConverter, XmlConverter> customConverterContainer;
- protected final ContextListContainer<OrmEclipseLinkObjectTypeConverter, XmlObjectTypeConverter> objectTypeConverterContainer;
- protected final ContextListContainer<OrmEclipseLinkStructConverter, XmlStructConverter> structConverterContainer;
- protected final ContextListContainer<OrmEclipseLinkTypeConverter, XmlTypeConverter> typeConverterContainer;
-
-
- public OrmEclipseLinkConverterContainerImpl(XmlContextNode parent, Owner owner, XmlConverterContainer xmlConverterContainer) {
- super(parent);
- this.owner = owner;
- this.xmlConverterContainer = xmlConverterContainer;
-
- this.customConverterContainer = this.buildCustomConverterContainer();
- this.objectTypeConverterContainer = this.buildObjectTypeConverterContainer();
- this.structConverterContainer = this.buildStructConverterContainer();
- this.typeConverterContainer = this.buildTypeConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncCustomConverters();
- this.syncObjectTypeConverters();
- this.syncStructConverters();
- this.syncTypeConverters();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getCustomConverters());
- this.updateNodes(this.getObjectTypeConverters());
- this.updateNodes(this.getStructConverters());
- this.updateNodes(this.getTypeConverters());
- }
-
-
- // ********** custom converters **********
-
- public ListIterable<OrmEclipseLinkCustomConverter> getCustomConverters() {
- return this.customConverterContainer.getContextElements();
- }
-
- public int getCustomConvertersSize() {
- return this.customConverterContainer.getContextElementsSize();
- }
-
- public OrmEclipseLinkCustomConverter addCustomConverter() {
- return this.addCustomConverter(this.getCustomConvertersSize());
- }
-
- public OrmEclipseLinkCustomConverter addCustomConverter(int index) {
- XmlConverter xmlConverter = this.buildXmlCustomConverter();
- OrmEclipseLinkCustomConverter converter = this.customConverterContainer.addContextElement(index, xmlConverter);
- this.xmlConverterContainer.getConverters().add(index, xmlConverter);
- return converter;
- }
-
- protected XmlConverter buildXmlCustomConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- }
-
- public void removeCustomConverter(EclipseLinkCustomConverter converter) {
- this.removeCustomConverter(this.customConverterContainer.indexOfContextElement((OrmEclipseLinkCustomConverter) converter));
- }
-
- public void removeCustomConverter(int index) {
- this.customConverterContainer.removeContextElement(index);
- this.xmlConverterContainer.getConverters().remove(index);
- }
-
- public void moveCustomConverter(int targetIndex, int sourceIndex) {
- this.customConverterContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConverterContainer.getConverters().move(targetIndex, sourceIndex);
- }
-
- protected OrmEclipseLinkCustomConverter buildCustomConverter(XmlConverter xmlConverter) {
- return new OrmEclipseLinkCustomConverter(this, xmlConverter);
- }
-
- protected void syncCustomConverters() {
- this.customConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlConverter> getXmlCustomConverters() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlConverter>(this.xmlConverterContainer.getConverters());
- }
-
- protected ContextListContainer<OrmEclipseLinkCustomConverter, XmlConverter> buildCustomConverterContainer() {
- CustomConverterContainer container = new CustomConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * custom converter container
- */
- protected class CustomConverterContainer
- extends ContextListContainer<OrmEclipseLinkCustomConverter, XmlConverter>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return CUSTOM_CONVERTERS_LIST;
- }
- @Override
- protected OrmEclipseLinkCustomConverter buildContextElement(XmlConverter resourceElement) {
- return OrmEclipseLinkConverterContainerImpl.this.buildCustomConverter(resourceElement);
- }
- @Override
- protected ListIterable<XmlConverter> getResourceElements() {
- return OrmEclipseLinkConverterContainerImpl.this.getXmlCustomConverters();
- }
- @Override
- protected XmlConverter getResourceElement(OrmEclipseLinkCustomConverter contextElement) {
- return contextElement.getXmlConverter();
- }
- }
-
-
- // ********** object type converters **********
-
- public ListIterable<OrmEclipseLinkObjectTypeConverter> getObjectTypeConverters() {
- return this.objectTypeConverterContainer.getContextElements();
- }
-
- public int getObjectTypeConvertersSize() {
- return this.objectTypeConverterContainer.getContextElementsSize();
- }
-
- public OrmEclipseLinkObjectTypeConverter addObjectTypeConverter() {
- return this.addObjectTypeConverter(this.getObjectTypeConvertersSize());
- }
-
- public OrmEclipseLinkObjectTypeConverter addObjectTypeConverter(int index) {
- XmlObjectTypeConverter xmlConverter = this.buildXmlObjectTypeConverter();
- OrmEclipseLinkObjectTypeConverter converter = this.objectTypeConverterContainer.addContextElement(index, xmlConverter);
- this.xmlConverterContainer.getObjectTypeConverters().add(index, xmlConverter);
- return converter;
- }
-
- protected XmlObjectTypeConverter buildXmlObjectTypeConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- }
-
- public void removeObjectTypeConverter(EclipseLinkObjectTypeConverter converter) {
- this.removeObjectTypeConverter(this.objectTypeConverterContainer.indexOfContextElement((OrmEclipseLinkObjectTypeConverter) converter));
- }
-
- public void removeObjectTypeConverter(int index) {
- this.objectTypeConverterContainer.removeContextElement(index);
- this.xmlConverterContainer.getObjectTypeConverters().remove(index);
- }
-
- public void moveObjectTypeConverter(int targetIndex, int sourceIndex) {
- this.objectTypeConverterContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConverterContainer.getObjectTypeConverters().move(targetIndex, sourceIndex);
- }
-
- protected OrmEclipseLinkObjectTypeConverter buildObjectTypeConverter(XmlObjectTypeConverter xmlConverter) {
- return new OrmEclipseLinkObjectTypeConverter(this, xmlConverter);
- }
-
- protected void syncObjectTypeConverters() {
- this.objectTypeConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlObjectTypeConverter> getXmlObjectTypeConverters() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlObjectTypeConverter>(this.xmlConverterContainer.getObjectTypeConverters());
- }
-
- protected ContextListContainer<OrmEclipseLinkObjectTypeConverter, XmlObjectTypeConverter> buildObjectTypeConverterContainer() {
- ObjectTypeConverterContainer container = new ObjectTypeConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * object type converter container
- */
- protected class ObjectTypeConverterContainer
- extends ContextListContainer<OrmEclipseLinkObjectTypeConverter, XmlObjectTypeConverter>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return OBJECT_TYPE_CONVERTERS_LIST;
- }
- @Override
- protected OrmEclipseLinkObjectTypeConverter buildContextElement(XmlObjectTypeConverter resourceElement) {
- return OrmEclipseLinkConverterContainerImpl.this.buildObjectTypeConverter(resourceElement);
- }
- @Override
- protected ListIterable<XmlObjectTypeConverter> getResourceElements() {
- return OrmEclipseLinkConverterContainerImpl.this.getXmlObjectTypeConverters();
- }
- @Override
- protected XmlObjectTypeConverter getResourceElement(OrmEclipseLinkObjectTypeConverter contextElement) {
- return contextElement.getXmlConverter();
- }
- }
-
- // ********** struct converters **********
-
- public ListIterable<OrmEclipseLinkStructConverter> getStructConverters() {
- return this.structConverterContainer.getContextElements();
- }
-
- public int getStructConvertersSize() {
- return this.structConverterContainer.getContextElementsSize();
- }
-
- public OrmEclipseLinkStructConverter addStructConverter() {
- return this.addStructConverter(this.getStructConvertersSize());
- }
-
- public OrmEclipseLinkStructConverter addStructConverter(int index) {
- XmlStructConverter xmlConverter = this.buildXmlStructConverter();
- OrmEclipseLinkStructConverter converter = this.structConverterContainer.addContextElement(index, xmlConverter);
- this.xmlConverterContainer.getStructConverters().add(index, xmlConverter);
- return converter;
- }
-
- protected XmlStructConverter buildXmlStructConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- }
-
- public void removeStructConverter(EclipseLinkStructConverter converter) {
- this.removeStructConverter(this.structConverterContainer.indexOfContextElement((OrmEclipseLinkStructConverter) converter));
- }
-
- public void removeStructConverter(int index) {
- this.structConverterContainer.removeContextElement(index);
- this.xmlConverterContainer.getStructConverters().remove(index);
- }
-
- public void moveStructConverter(int targetIndex, int sourceIndex) {
- this.structConverterContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConverterContainer.getStructConverters().move(targetIndex, sourceIndex);
- }
-
- protected OrmEclipseLinkStructConverter buildStructConverter(XmlStructConverter xmlConverter) {
- return new OrmEclipseLinkStructConverter(this, xmlConverter);
- }
-
- protected void syncStructConverters() {
- this.structConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlStructConverter> getXmlStructConverters() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlStructConverter>(this.xmlConverterContainer.getStructConverters());
- }
-
- protected ContextListContainer<OrmEclipseLinkStructConverter, XmlStructConverter> buildStructConverterContainer() {
- StructConverterContainer container = new StructConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * struct converter container
- */
- protected class StructConverterContainer
- extends ContextListContainer<OrmEclipseLinkStructConverter, XmlStructConverter>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return STRUCT_CONVERTERS_LIST;
- }
- @Override
- protected OrmEclipseLinkStructConverter buildContextElement(XmlStructConverter resourceElement) {
- return OrmEclipseLinkConverterContainerImpl.this.buildStructConverter(resourceElement);
- }
- @Override
- protected ListIterable<XmlStructConverter> getResourceElements() {
- return OrmEclipseLinkConverterContainerImpl.this.getXmlStructConverters();
- }
- @Override
- protected XmlStructConverter getResourceElement(OrmEclipseLinkStructConverter contextElement) {
- return contextElement.getXmlConverter();
- }
- }
-
-
- // ********** type converters **********
-
- public ListIterable<OrmEclipseLinkTypeConverter> getTypeConverters() {
- return this.typeConverterContainer.getContextElements();
- }
-
- public int getTypeConvertersSize() {
- return this.typeConverterContainer.getContextElementsSize();
- }
-
- public OrmEclipseLinkTypeConverter addTypeConverter() {
- return this.addTypeConverter(this.getTypeConvertersSize());
- }
-
- public OrmEclipseLinkTypeConverter addTypeConverter(int index) {
- XmlTypeConverter xmlConverter = this.buildXmlTypeConverter();
- OrmEclipseLinkTypeConverter converter = this.typeConverterContainer.addContextElement(index, xmlConverter);
- this.xmlConverterContainer.getTypeConverters().add(index, xmlConverter);
- return converter;
- }
-
- protected XmlTypeConverter buildXmlTypeConverter() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- }
-
- public void removeTypeConverter(EclipseLinkTypeConverter converter) {
- this.removeTypeConverter(this.typeConverterContainer.indexOfContextElement((OrmEclipseLinkTypeConverter) converter));
- }
-
- public void removeTypeConverter(int index) {
- this.typeConverterContainer.removeContextElement(index);
- this.xmlConverterContainer.getTypeConverters().remove(index);
- }
-
- public void moveTypeConverter(int targetIndex, int sourceIndex) {
- this.typeConverterContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConverterContainer.getTypeConverters().move(targetIndex, sourceIndex);
- }
-
- protected OrmEclipseLinkTypeConverter buildTypeConverter(XmlTypeConverter xmlConverter) {
- return new OrmEclipseLinkTypeConverter(this, xmlConverter);
- }
-
- protected void syncTypeConverters() {
- this.typeConverterContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlTypeConverter> getXmlTypeConverters() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlTypeConverter>(this.xmlConverterContainer.getTypeConverters());
- }
-
- protected ContextListContainer<OrmEclipseLinkTypeConverter, XmlTypeConverter> buildTypeConverterContainer() {
- TypeConverterContainer container = new TypeConverterContainer();
- container.initialize();
- return container;
- }
-
- /**
- * type converter container
- */
- protected class TypeConverterContainer
- extends ContextListContainer<OrmEclipseLinkTypeConverter, XmlTypeConverter>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return TYPE_CONVERTERS_LIST;
- }
- @Override
- protected OrmEclipseLinkTypeConverter buildContextElement(XmlTypeConverter resourceElement) {
- return OrmEclipseLinkConverterContainerImpl.this.buildTypeConverter(resourceElement);
- }
- @Override
- protected ListIterable<XmlTypeConverter> getResourceElements() {
- return OrmEclipseLinkConverterContainerImpl.this.getXmlTypeConverters();
- }
- @Override
- protected XmlTypeConverter getResourceElement(OrmEclipseLinkTypeConverter contextElement) {
- return contextElement.getXmlConverter();
- }
- }
-
-
- // ********** refactoring **********
-
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameObjectTypeConverterEdits(originalType, newName),
- this.createRenameTypeConverterEdits(originalType, newName),
- this.createRenameStructConverterEdits(originalType, newName),
- this.createRenameCustomConverterEdits(originalType, newName));
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypeConverterEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkObjectTypeConverter, Iterable<ReplaceEdit>>(getObjectTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkObjectTypeConverter objectTypeConverter) {
- return objectTypeConverter.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameTypeConverterEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkTypeConverter, Iterable<ReplaceEdit>>(getTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkTypeConverter typeConverter) {
- return typeConverter.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameStructConverterEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkStructConverter, Iterable<ReplaceEdit>>(getStructConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkStructConverter structConverter) {
- return structConverter.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameCustomConverterEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkCustomConverter, Iterable<ReplaceEdit>>(getCustomConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkCustomConverter customConverter) {
- return customConverter.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- this.createMoveObjectTypeConverterEdits(originalType, newPackage),
- this.createMoveTypeConverterEdits(originalType, newPackage),
- this.createMoveStructConverterEdits(originalType, newPackage),
- this.createMoveCustomConverterEdits(originalType, newPackage));
- }
-
- protected Iterable<ReplaceEdit> createMoveObjectTypeConverterEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkObjectTypeConverter, Iterable<ReplaceEdit>>(getObjectTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkObjectTypeConverter objectTypeConverter) {
- return objectTypeConverter.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveTypeConverterEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkTypeConverter, Iterable<ReplaceEdit>>(getTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkTypeConverter typeConverter) {
- return typeConverter.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveStructConverterEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkStructConverter, Iterable<ReplaceEdit>>(getStructConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkStructConverter structConverter) {
- return structConverter.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveCustomConverterEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkCustomConverter, Iterable<ReplaceEdit>>(getCustomConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkCustomConverter customConverter) {
- return customConverter.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
-
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createObjectTypeConverterRenamePackageEdits(originalPackage, newName),
- this.createTypeConverterRenamePackageEdits(originalPackage, newName),
- this.createStructConverterRenamePackageEdits(originalPackage, newName),
- this.createCustomConverterRenamePackageEdits(originalPackage, newName));
- }
-
- protected Iterable<ReplaceEdit> createObjectTypeConverterRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkObjectTypeConverter, Iterable<ReplaceEdit>>(getObjectTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkObjectTypeConverter objectTypeConverter) {
- return objectTypeConverter.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createTypeConverterRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkTypeConverter, Iterable<ReplaceEdit>>(getTypeConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkTypeConverter typeConverter) {
- return typeConverter.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createStructConverterRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkStructConverter, Iterable<ReplaceEdit>>(getStructConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkStructConverter structConverter) {
- return structConverter.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomConverterRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<OrmEclipseLinkCustomConverter, Iterable<ReplaceEdit>>(getCustomConverters()) {
- @Override
- protected Iterable<ReplaceEdit> transform(OrmEclipseLinkCustomConverter customConverter) {
- return customConverter.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
-
- // ********** validation **********
-
- /**
- * The converters are validated in the persistence unit.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit#validateConverters(List, IReporter)
- */
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // converters are validated in the persistence unit
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.xmlConverterContainer.getValidationTextRange();
- return (textRange != null) ? textRange : this.getParent().getValidationTextRange();
- }
-
-
- // ********** misc **********
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.getCustomConverters(),
- this.getObjectTypeConverters(),
- this.getStructConverters(),
- this.getTypeConverters()
- );
- }
-
- public int getConvertersSize() {
- return this.getCustomConvertersSize()
- + this.getObjectTypeConvertersSize()
- + this.getStructConvertersSize()
- + this.getTypeConvertersSize();
- }
-
- public int getNumberSupportedConverters() {
- return this.owner.getNumberSupportedConverters();
- }
-
- @Override
- public XmlContextNode getParent() {
- return (XmlContextNode) super.getParent();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java
deleted file mode 100644
index 88f752362f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomConverter.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-
-public class OrmEclipseLinkCustomConverter
- extends OrmEclipseLinkConverterClassConverter<XmlConverter>
- implements EclipseLinkCustomConverter
-{
- public OrmEclipseLinkCustomConverter(XmlContextNode parent, XmlConverter xmlConverter) {
- super(parent, xmlConverter);
- }
-
-
- // ********** converter class **********
-
- @Override
- protected String getXmlConverterClass() {
- return this.xmlConverter.getClassName();
- }
-
- @Override
- protected void setXmlConverterClass(String converterClass) {
- this.xmlConverter.setClassName(converterClass);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkCustomConverter> getType() {
- return EclipseLinkCustomConverter.class;
- }
-
-
- // ********** refactoring **********
-
- @Override
- protected ReplaceEdit createRenameEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameEdit(originalType, newName);
- }
-
- @Override
- protected ReplaceEdit createRenamePackageEdit(String newName) {
- return this.xmlConverter.createRenamePackageEdit(newName);
- }
-
-
- // ********** validation **********
-
- @Override
- protected String getEclipseLinkConverterInterface() {
- return ECLIPSELINK_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected String getEclipseLinkConverterInterfaceErrorMessage() {
- return EclipseLinkJpaValidationMessages.CONVERTER_CLASS_IMPLEMENTS_CONVERTER;
- }
-
- @Override
- protected TextRange getXmlConverterClassTextRange() {
- return this.xmlConverter.getConverterClassTextRange();
- }
-
- // ********** metadata conversion **********
-
- public void convertFrom(JavaEclipseLinkCustomConverter javaConverter) {
- super.convertFrom(javaConverter);
- this.setConverterClass(javaConverter.getFullyQualifiedConverterClass());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java
deleted file mode 100644
index cb71a673f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkCustomizer.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.EclipseLinkJavaTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkCustomizer
- extends AbstractOrmXmlContextNode
- implements EclipseLinkCustomizer
-{
- protected String specifiedCustomizerClass;
- protected String defaultCustomizerClass;
- protected String fullyQualifiedCustomizerClass;
-
-
- public OrmEclipseLinkCustomizer(EclipseLinkOrmTypeMapping parent) {
- super(parent);
- this.specifiedCustomizerClass = this.buildSpecifiedCustomizerClass();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedCustomizerClass_(this.buildSpecifiedCustomizerClass());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultCustomizerClass(this.buildDefaultCustomizerClass());
- this.setFullyQualifiedCustomizerClass(this.buildFullyQualifiedCustomizerClass());
- }
-
-
- // ********** customizer class **********
-
- public String getCustomizerClass() {
- return (this.specifiedCustomizerClass != null) ? this.specifiedCustomizerClass : this.defaultCustomizerClass;
- }
-
- public String getSpecifiedCustomizerClass() {
- return this.specifiedCustomizerClass;
- }
-
- public void setSpecifiedCustomizerClass(String customizerClass) {
- if (this.valuesAreDifferent(this.specifiedCustomizerClass, customizerClass)) {
- XmlClassReference xmlClassRef = this.getXmlCustomizerClassRefForUpdate();
- this.setSpecifiedCustomizerClass_(customizerClass);
- xmlClassRef.setClassName(customizerClass);
- this.removeXmlCustomizerClassRefIfUnset();
- }
- }
-
- protected void setSpecifiedCustomizerClass_(String customizerClass) {
- String old = this.specifiedCustomizerClass;
- this.specifiedCustomizerClass = customizerClass;
- this.firePropertyChanged(SPECIFIED_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
- }
-
- protected String buildSpecifiedCustomizerClass() {
- XmlClassReference xmlClassRef = this.getXmlCustomizerClassRef();
- return (xmlClassRef == null) ? null : xmlClassRef.getClassName();
- }
-
- public String getDefaultCustomizerClass() {
- return this.defaultCustomizerClass;
- }
-
- protected void setDefaultCustomizerClass(String customizerClass) {
- String old = this.defaultCustomizerClass;
- this.defaultCustomizerClass = customizerClass;
- this.firePropertyChanged(DEFAULT_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
- }
-
- protected String buildDefaultCustomizerClass() {
- JavaEclipseLinkCustomizer javaCustomizer = this.getJavaCustomizerForDefaults();
- return (javaCustomizer == null) ? null : javaCustomizer.getFullyQualifiedCustomizerClass();
- }
-
- public String getFullyQualifiedCustomizerClass() {
- return this.fullyQualifiedCustomizerClass;
- }
-
- protected void setFullyQualifiedCustomizerClass(String customizerClass) {
- String old = this.fullyQualifiedCustomizerClass;
- this.fullyQualifiedCustomizerClass = customizerClass;
- this.firePropertyChanged(FULLY_QUALIFIED_CUSTOMIZER_CLASS_PROPERTY, old, customizerClass);
- }
-
- protected String buildFullyQualifiedCustomizerClass() {
- return (this.specifiedCustomizerClass == null) ?
- //this is the fully qualified java customizer class name
- this.defaultCustomizerClass :
- this.getEntityMappings().getFullyQualifiedName(this.specifiedCustomizerClass);
- }
-
-
- // ********** xml customizer class ref **********
-
- /**
- * Return null if the XML class ref does not exists.
- */
- protected XmlClassReference getXmlCustomizerClassRef() {
- return this.getXmlCustomizerHolder().getCustomizer();
- }
-
- /**
- * Build the XML class ref if it does not exist.
- */
- protected XmlClassReference getXmlCustomizerClassRefForUpdate() {
- XmlClassReference xmlClassRef = this.getXmlCustomizerClassRef();
- return (xmlClassRef != null) ? xmlClassRef : this.buildXmlCustomizerClassRef();
- }
-
- protected XmlClassReference buildXmlCustomizerClassRef() {
- XmlClassReference ref = OrmFactory.eINSTANCE.createXmlClassReference();
- this.getXmlCustomizerHolder().setCustomizer(ref);
- return ref;
- }
-
- protected void removeXmlCustomizerClassRefIfUnset() {
- if (this.getXmlCustomizerClassRef().isUnset()) {
- this.removeXmlCustomizerClassRef();
- }
- }
-
- protected void removeXmlCustomizerClassRef() {
- this.getXmlCustomizerHolder().setCustomizer(null);
- }
-
- protected JavaResourceAbstractType getResourceCustomizerType() {
- if (this.fullyQualifiedCustomizerClass == null) {
- return null;
- }
- return this.getJpaProject().getJavaResourceType(this.fullyQualifiedCustomizerClass);
- }
-
-
- // ********** misc **********
-
- @Override
- public EclipseLinkOrmTypeMapping getParent() {
- return (EclipseLinkOrmTypeMapping) super.getParent();
- }
-
- protected EclipseLinkOrmTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- protected XmlCustomizerHolder getXmlCustomizerHolder() {
- return (XmlCustomizerHolder) this.getXmlTypeMapping();
- }
-
- protected EclipseLinkJavaTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected JavaEclipseLinkCustomizer getJavaCustomizerForDefaults() {
- EclipseLinkJavaTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : (JavaEclipseLinkCustomizer) javaTypeMapping.getCustomizer();
- }
-
- protected EntityMappings getEntityMappings() {
- return this.getMappingFileRoot();
- }
-
- protected boolean isFor(String typeName) {
- JavaResourceAbstractType customizerType = this.getResourceCustomizerType();
- return (customizerType != null) && customizerType.getQualifiedName().equals(typeName);
- }
-
- protected boolean isIn(IPackageFragment packageFragment) {
- JavaResourceAbstractType customizerType = this.getResourceCustomizerType();
- return (customizerType != null) && customizerType.isIn(packageFragment);
- }
-
- public char getCustomizerClassEnclosingTypeSeparator() {
- return '$';
- }
-
-
- // ********** refactoring **********
-
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return this.getXmlCustomizerClassRef() != null && this.isFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameTypeEdit(IType originalType, String newName) {
- return this.getXmlCustomizerClassRef().createRenameEdit(originalType, newName);
- }
-
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.getXmlCustomizerClassRef() != null && this.isFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenamePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.getXmlCustomizerClassRef() != null && this.isIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenamePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenamePackageEdit(String newName) {
- return this.getXmlCustomizerClassRef().createRenamePackageEdit(newName);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateCustomizerClass(messages);
- }
-
- protected void validateCustomizerClass(List<IMessage> messages) {
- if (this.getCustomizerClass() == null) {
- return;
- }
- if (StringTools.stringIsEmpty(this.getCustomizerClass())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_NOT_SPECIFIED,
- EMPTY_STRING_ARRAY,
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
-
- IType customizerJdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedCustomizerClass());
- if (customizerJdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_NOT_EXIST,
- new String[] {this.getFullyQualifiedCustomizerClass()},
- this,
- this.getValidationTextRange()
- )
- );
- return;
- }
- if (!JDTTools.typeHasPublicZeroArgConstructor(customizerJdtType)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_NOT_VALID,
- new String[] {this.getFullyQualifiedCustomizerClass()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- if (!JDTTools.typeIsSubType(this.getJavaProject(), customizerJdtType, ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.DESCRIPTOR_CUSTOMIZER_CLASS_IMPLEMENTS_DESCRIPTOR_CUSTOMIZER,
- new String[] {this.getFullyQualifiedCustomizerClass()},
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- XmlClassReference xmlClassRef = this.getXmlCustomizerClassRef();
- return (xmlClassRef == null) ? null : xmlClassRef.getClassNameTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java
deleted file mode 100644
index ae750c9a2d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddableImpl.java
+++ /dev/null
@@ -1,288 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkDynamicTypeMappingValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> embeddable type mapping
- */
-public class OrmEclipseLinkEmbeddableImpl
- extends AbstractOrmEmbeddable<XmlEmbeddable>
- implements
- OrmEclipseLinkEmbeddable,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
- protected final OrmEclipseLinkChangeTracking changeTracking;
-
- protected final OrmEclipseLinkCustomizer customizer;
-
-
- public OrmEclipseLinkEmbeddableImpl(OrmPersistentType parent, XmlEmbeddable xmlEmbeddable) {
- super(parent, xmlEmbeddable);
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- }
-
-
- // ********** converter container **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.getXmlTypeMapping());
- }
-
- public int getNumberSupportedConverters() {
- return Integer.MAX_VALUE;
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new CompositeIterable<EclipseLinkConverter>(this.getAttributeMappingConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getAttributeMappingConverterLists() {
- return new TransformationIterable<AttributeMapping, Iterable<EclipseLinkConverter>>(
- this.getAttributeMappings(),
- ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER
- );
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected OrmEclipseLinkChangeTracking buildChangeTracking() {
- return new OrmEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected OrmEclipseLinkCustomizer buildCustomizer() {
- return new OrmEclipseLinkCustomizer(this);
- }
-
-
- // ********** parent class **********
-
- @Override
- protected String buildSpecifiedParentClass() {
- return this.xmlTypeMapping.getParentClass();
- }
-
- @Override
- public void setSpecifiedParentClassInXml(String parentClass) {
- this.xmlTypeMapping.setParentClass(parentClass);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkEmbeddable getJavaTypeMapping() {
- return (JavaEclipseLinkEmbeddable) super.getJavaTypeMapping();
- }
-
- @Override
- public JavaEclipseLinkEmbeddable getJavaTypeMappingForDefaults() {
- return (JavaEclipseLinkEmbeddable) super.getJavaTypeMappingForDefaults();
- }
-
- @Override
- public EclipseLinkOrmPersistentType getPersistentType() {
- return (EclipseLinkOrmPersistentType) super.getPersistentType();
- }
-
- public boolean usesPrimaryKeyColumns() {
- return false;
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- return false;
- }
-
-
- // ********** refactoring **********
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.createCustomizerRenameTypeEdits(originalType, newName),
- this.createConverterHolderRenameTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenameTypeEdits(IType originalType, String newName) {
- return this.customizer.createRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenameTypeEdits(IType originalType, String newName) {
- return this.converterContainer.createRenameTypeEdits(originalType, newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.createCustomizerMoveTypeEdits(originalType, newPackage),
- this.createConverterHolderMoveTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.customizer.createMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.converterContainer.createMoveTypeEdits(originalType, newPackage);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.createCustomizerRenamePackageEdits(originalPackage, newName),
- this.createConverterHolderRenamePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.customizer.createRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.converterContainer.createRenamePackageEdits(originalPackage, newName);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateParentClass(messages, reporter);
- this.customizer.validate(messages, reporter);
- this.changeTracking.validate(messages, reporter);
- this.converterContainer.validate(messages, reporter);
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator() {
- if (this.isDynamicType()) {
- return new EclipseLinkDynamicTypeMappingValidator(this);
- }
- return new EclipseLinkTypeMappingValidator(this, getJavaResourceType(), buildTextRangeResolver());
- }
-
- protected boolean isDynamicType() {
- return this.getPersistentType().isDynamic();
- }
-
-
- protected void validateParentClass(List<IMessage> messages, IReporter reporter) {
- if (this.specifiedParentClass == null) {
- return;
- }
- if (this.getResolvedParentClass() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedParentClass());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_TYPE_PARENT_CLASS_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedParentClass()},
- this,
- this.getParentClassTextRange()
- )
- );
- }
- }
- }
-
- protected TextRange getParentClassTextRange() {
- return this.getValidationTextRange(this.xmlTypeMapping.getParentClassTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedIdMapping.java
deleted file mode 100644
index 3d9643aa97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedIdMapping.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * <code>orm.xml</code> embedded mapping
- */
-public class OrmEclipseLinkEmbeddedIdMapping
- extends AbstractOrmEmbeddedIdMapping<XmlEmbeddedId>
-{
-
- public OrmEclipseLinkEmbeddedIdMapping(OrmPersistentAttribute parent, XmlEmbeddedId xmlMapping) {
- super(parent, xmlMapping);
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
- // ********** validation **********
-
- @Override
- protected boolean validateTargetEmbeddable(List<IMessage> messages) {
- if (this.isVirtualAccess()) {
- if (StringTools.stringIsEmpty(this.getAttributeType())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED,
- new String[] {this.getName()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return false;
- }
- if (this.getResolvedAttributeType() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedAttributeType()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return false;
- }
- }
- }
- return super.validateTargetEmbeddable(messages);
- }
-
- protected boolean isVirtualAccess() {
- return this.getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL;
- }
-
- @Override
- protected TextRange getAttributeTypeTextRange() {
- return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedMapping.java
deleted file mode 100644
index bbfb4b7073..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEmbeddedMapping.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-
-/**
- * <code>orm.xml</code> embedded mapping
- */
-public class OrmEclipseLinkEmbeddedMapping
- extends AbstractOrmEmbeddedMapping<XmlEmbedded>
-{
- public OrmEclipseLinkEmbeddedMapping(OrmPersistentAttribute parent, XmlEmbedded xmlMapping) {
- super(parent, xmlMapping);
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
- // ********** validation **********
-
- @Override
- protected boolean validateTargetEmbeddable(List<IMessage> messages) {
- if (this.isVirtualAccess()) {
- if (StringTools.stringIsEmpty(this.getAttributeType())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED,
- new String[] {this.getName()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return false;
- }
- if (this.getResolvedAttributeType() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedAttributeType()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return false;
- }
- }
- }
- return super.validateTargetEmbeddable(messages);
- }
-
- protected boolean isVirtualAccess() {
- return this.getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL;
- }
-
- @Override
- protected TextRange getAttributeTypeTextRange() {
- return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java
deleted file mode 100644
index b4b7872404..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkEntityImpl.java
+++ /dev/null
@@ -1,476 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmEntity;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkDynamicTypeMappingValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkEntityPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkTypeMappingValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> entity type mapping
- */
-public class OrmEclipseLinkEntityImpl
- extends AbstractOrmEntity<XmlEntity>
- implements
- OrmEclipseLinkEntity,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkReadOnly readOnly;
-
- protected final OrmEclipseLinkCustomizer customizer;
-
- protected final OrmEclipseLinkChangeTracking changeTracking;
-
- protected final OrmEclipseLinkCaching caching;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
- protected final OrmEclipseLinkMultitenancy2_3 multitenancy;
-
-
- public OrmEclipseLinkEntityImpl(OrmPersistentType parent, XmlEntity xmlEntity) {
- super(parent, xmlEntity);
- this.caching = this.buildCaching();
- this.readOnly = this.buildReadOnly();
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- this.multitenancy = this.buildMultitenancy();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.caching.synchronizeWithResourceModel();
- this.readOnly.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- this.multitenancy.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.caching.update();
- this.readOnly.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- this.multitenancy.update();
- }
-
-
- // ********** caching **********
-
- public OrmEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- protected OrmEclipseLinkCaching buildCaching() {
- return new OrmEclipseLinkCachingImpl(this);
- }
-
-
- // ********** read only **********
-
- public OrmEclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- protected OrmEclipseLinkReadOnly buildReadOnly() {
- return new OrmEclipseLinkReadOnly(this);
- }
-
-
- // ********** converter container **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.xmlTypeMapping);
- }
-
- public int getNumberSupportedConverters() {
- return Integer.MAX_VALUE;
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new CompositeIterable<EclipseLinkConverter>(this.getAttributeMappingConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getAttributeMappingConverterLists() {
- return new TransformationIterable<AttributeMapping, Iterable<EclipseLinkConverter>>(
- this.getAttributeMappings(),
- ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER
- );
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected OrmEclipseLinkChangeTracking buildChangeTracking() {
- return new OrmEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected OrmEclipseLinkCustomizer buildCustomizer() {
- return new OrmEclipseLinkCustomizer(this);
- }
-
-
- // ********** multitenancy **********
-
- public OrmEclipseLinkMultitenancy2_3 getMultitenancy() {
- return this.multitenancy;
- }
-
- protected OrmEclipseLinkMultitenancy2_3 buildMultitenancy() {
- return this.isEclipseLink2_3Compatible() ?
- new OrmEclipseLinkMultitenancyImpl2_3(this) :
- new NullOrmEclipseLinkMultitenancy2_3(this);
- }
-
- protected boolean isEclipseLink2_3Compatible() {
- return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this);
- }
-
- public boolean isMultitenantMetadataAllowed() {
- return this.isRootEntity() || this.isInheritanceStrategyTablePerClass();
- }
-
- protected boolean isInheritanceStrategyTablePerClass() {
- return this.getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS;
- }
-
-
- // ********** parent class **********
-
- @Override
- protected String buildSpecifiedParentClass() {
- return this.xmlTypeMapping.getParentClass();
- }
-
- @Override
- public void setSpecifiedParentClassInXml(String parentClass) {
- this.xmlTypeMapping.setParentClass(parentClass);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkEntity getJavaTypeMapping() {
- return (JavaEclipseLinkEntity) super.getJavaTypeMapping();
- }
-
- @Override
- public JavaEclipseLinkEntity getJavaTypeMappingForDefaults() {
- return (JavaEclipseLinkEntity) super.getJavaTypeMappingForDefaults();
- }
-
- @Override
- public EclipseLinkOrmPersistentType getPersistentType() {
- return (EclipseLinkOrmPersistentType) super.getPersistentType();
- }
-
- public boolean usesPrimaryKeyColumns() {
- return (this.getXmlTypeMapping().getPrimaryKey() != null)
- || this.usesJavaPrimaryKeyColumns();
- }
-
- protected boolean usesJavaPrimaryKeyColumns() {
- JavaEclipseLinkEntity javaEntity = this.getJavaTypeMappingForDefaults();
- return (javaEntity != null) && javaEntity.usesPrimaryKeyColumns();
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- return getMultitenancy().usesPrimaryKeyTenantDiscriminatorColumns();
- }
-
- @Override
- protected boolean buildSpecifiedDiscriminatorColumnIsAllowed() {
- return super.buildSpecifiedDiscriminatorColumnIsAllowed() && ! this.classExtractorIsUsed();
- }
-
- protected boolean classExtractorIsUsed() {
- return (this.getXmlClassExtractor() != null) || (this.getClassExtractorAnnotation() != null);
- }
-
- protected XmlClassReference getXmlClassExtractor() {
- return this.getXmlTypeMapping().getClassExtractor();
- }
-
- protected EclipseLinkClassExtractorAnnotation2_1 getClassExtractorAnnotation() {
- if (this.getJavaTypeMappingForDefaults() != null) {
- JavaResourceType jrpt = this.getJavaPersistentType().getJavaResourceType();
- return (EclipseLinkClassExtractorAnnotation2_1) jrpt.getAnnotation(EclipseLinkClassExtractorAnnotation2_1.ANNOTATION_NAME);
- }
- return null;
- }
-
- public OrmCacheable2_0 getCacheable() {
- return this.getCacheableHolder().getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return this.getCacheableHolder().calculateDefaultCacheable();
- }
-
- protected OrmCacheableHolder2_0 getCacheableHolder() {
- return (OrmCacheableHolder2_0) this.caching;
- }
-
- public XmlCacheable_2_0 getXmlCacheable() {
- return this.getXmlTypeMapping();
- }
-
- protected JavaResourceAbstractType getResourceClassExtractorType() {
- XmlClassReference classExtractorClassRef = this.getXmlClassExtractor();
- if (classExtractorClassRef == null) {
- return null;
- }
-
- String className = classExtractorClassRef.getClassName();
- if (className == null) {
- return null;
- }
-
- return this.getMappingFileRoot().resolveJavaResourceType(className);
- }
-
- protected boolean classExtractorIsFor(String typeName) {
- JavaResourceAbstractType classExtractorType = this.getResourceClassExtractorType();
- return (classExtractorType != null) && classExtractorType.getQualifiedName().equals(typeName);
- }
-
- protected boolean classExtractorIsIn(IPackageFragment packageFragment) {
- JavaResourceAbstractType classExtractorType = this.getResourceClassExtractorType();
- return (classExtractorType != null) && classExtractorType.isIn(packageFragment);
- }
-
-
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.createCustomizerRenameTypeEdits(originalType, newName),
- this.createConverterHolderRenameTypeEdits(originalType, newName),
- this.createClassExtractorRenameTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenameTypeEdits(IType originalType, String newName) {
- return this.customizer.createRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenameTypeEdits(IType originalType, String newName) {
- return this.converterContainer.createRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createClassExtractorRenameTypeEdits(IType originalType, String newName) {
- return this.classExtractorIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.getXmlClassExtractor().createRenameEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.createCustomizerMoveTypeEdits(originalType, newPackage),
- this.createConverterHolderMoveTypeEdits(originalType, newPackage),
- this.createClassExtractorMoveTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.customizer.createMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.converterContainer.createMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createClassExtractorMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.classExtractorIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.getXmlClassExtractor().createRenamePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- @SuppressWarnings("unchecked")
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.createCustomizerRenamePackageEdits(originalPackage, newName),
- this.createConverterHolderRenamePackageEdits(originalPackage, newName),
- this.createClassExtractorRenamePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.customizer.createRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.converterContainer.createRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createClassExtractorRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.classExtractorIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.getXmlClassExtractor().createRenamePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateParentClass(messages, reporter);
- this.caching.validate(messages, reporter);
- this.readOnly.validate(messages, reporter);
- this.converterContainer.validate(messages, reporter);
- this.changeTracking.validate(messages, reporter);
- this.customizer.validate(messages, reporter);
- this.multitenancy.validate(messages, reporter);
- }
-
- @Override
- protected JptValidator buildPrimaryKeyValidator() {
- return new EclipseLinkEntityPrimaryKeyValidator(this, buildTextRangeResolver());
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator() {
- if (this.isDynamicType()) {
- return new EclipseLinkDynamicTypeMappingValidator(this);
- }
- return new EclipseLinkTypeMappingValidator(this, getJavaResourceType(), buildTextRangeResolver());
- }
-
- protected boolean isDynamicType() {
- return this.getPersistentType().isDynamic();
- }
-
- protected void validateParentClass(List<IMessage> messages, IReporter reporter) {
- if (this.specifiedParentClass == null) {
- return;
- }
- if (this.getResolvedParentClass() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedParentClass());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_TYPE_PARENT_CLASS_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedParentClass()},
- this,
- this.getParentClassTextRange()
- )
- );
- }
- }
- }
-
- protected TextRange getParentClassTextRange() {
- return this.getValidationTextRange(this.xmlTypeMapping.getParentClassTextRange());
- }
-
-
- // ********** completion proposals **********
-
- @Override
- public Iterable<String> getXmlCompletionProposals(int pos) {
- Iterable<String> result = super.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- result = this.multitenancy.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java
deleted file mode 100644
index c6373d412b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkIdMapping.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkIdMapping
- extends AbstractOrmIdMapping<XmlId>
- implements
- EclipseLinkIdMapping,
- EclipseLinkOrmConvertibleMapping,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkMutable mutable;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
-
- public OrmEclipseLinkIdMapping(OrmPersistentAttribute parent, XmlId xmlMapping) {
- super(parent, xmlMapping);
- this.mutable = new OrmEclipseLinkMutable(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- this.converterContainer.update();
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
- // ********** converters **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.xmlAttributeMapping);
- }
-
- public int getNumberSupportedConverters() {
- return 1;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<OrmConverter.Adapter>(OrmEclipseLinkConvert.Adapter.instance(), super.getConverterAdapters());
- }
-
-
- //************ refactoring ************
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.converterContainer.createMoveTypeEdits(originalType, newPackage)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.converterContainer.createRenamePackageEdits(originalPackage, newName)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.converterContainer.createRenameTypeEdits(originalType, newName)
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateAttributeType(messages);
- // TODO mutable validation
- }
-
- //TODO copied from OrmEclipseLinkBasicMapping
- protected void validateAttributeType(List<IMessage> messages) {
- if (this.isVirtualAccess()) {
- if (StringTools.stringIsEmpty(this.getAttributeType())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED,
- new String[] {this.getName()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedAttributeType())) {
- return;
- }
- if (this.getResolvedAttributeType() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedAttributeType()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- }
- return;
- }
- }
- }
-
- protected boolean isVirtualAccess() {
- return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL;
- }
-
- protected TextRange getAttributeTypeTextRange() {
- return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java
deleted file mode 100644
index c29d55668b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkJoinFetch.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch;
-
-public class OrmEclipseLinkJoinFetch
- extends AbstractOrmXmlContextNode
- implements EclipseLinkJoinFetch
-{
- protected EclipseLinkJoinFetchType value;
-
-
- public OrmEclipseLinkJoinFetch(OrmAttributeMapping parent) {
- super(parent);
- this.value = this.buildValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** value **********
-
- public EclipseLinkJoinFetchType getValue() {
- return this.value;
- }
-
- public void setValue(EclipseLinkJoinFetchType value) {
- this.setValue_(value);
- this.getXmlJoinFetch().setJoinFetch(EclipseLinkJoinFetchType.toOrmResourceModel(value));
- }
-
- protected void setValue_(EclipseLinkJoinFetchType value) {
- EclipseLinkJoinFetchType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- protected EclipseLinkJoinFetchType buildValue() {
- return EclipseLinkJoinFetchType.fromOrmResourceModel(this.getXmlJoinFetch().getJoinFetch());
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- protected OrmAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected XmlAttributeMapping getXmlAttributeMapping() {
- return this.getAttributeMapping().getXmlAttributeMapping();
- }
-
- protected XmlJoinFetch getXmlJoinFetch() {
- return (XmlJoinFetch) this.getXmlAttributeMapping();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlJoinFetch().getJoinFetchTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java
deleted file mode 100644
index 0910c4df1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToManyMapping.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkManyToManyMapping
- extends AbstractOrmManyToManyMapping<XmlManyToMany>
- implements
- EclipseLinkManyToManyMapping,
- EclipseLinkOrmConvertibleMapping,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
-
- public OrmEclipseLinkManyToManyMapping(OrmPersistentAttribute parent, XmlManyToMany xmlMapping) {
- super(parent, xmlMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- this.converterContainer.update();
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
- // ********** converters **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.xmlAttributeMapping);
- }
-
- public int getNumberSupportedConverters() {
- return 1;
- }
-
-
- //************ refactoring ************
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.converterContainer.createMoveTypeEdits(originalType, newPackage)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.converterContainer.createRenamePackageEdits(originalPackage, newName)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.converterContainer.createRenameTypeEdits(originalType, newName)
- );
- }
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO join fetch validation
- }
-
- @Override
- protected void validateAttributeType(List<IMessage> messages, IReporter reporter) {
- if (this.isVirtualAccess()) {
- if (StringTools.stringIsEmpty(this.getAttributeType())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED,
- new String[] {this.getName()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- if (this.getResolvedAttributeType() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedAttributeType()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- }
- }
- super.validateAttributeType(messages, reporter);
- }
-
- protected boolean isVirtualAccess() {
- return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL;
- }
-
- @Override
- protected TextRange getAttributeTypeTextRange() {
- return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java
deleted file mode 100644
index 381c08a5ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkManyToOneMapping.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkManyToOneMapping
- extends AbstractOrmManyToOneMapping<XmlManyToOne>
- implements EclipseLinkRelationshipMapping
-{
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
-
- protected OrmEclipseLinkManyToOneMapping(OrmPersistentAttribute parent, XmlManyToOne xmlMapping) {
- super(parent, xmlMapping);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.joinFetch.update();
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO - join fetch validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java
deleted file mode 100644
index 86fe9361e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMappedSuperclassImpl.java
+++ /dev/null
@@ -1,422 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkDynamicTypeMappingValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassPrimaryKeyValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkMappedSuperclassValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> mapped superclass
- */
-public class OrmEclipseLinkMappedSuperclassImpl
- extends AbstractOrmMappedSuperclass<XmlMappedSuperclass>
- implements
- OrmEclipseLinkMappedSuperclass,
- OrmCacheableHolder2_0,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkReadOnly readOnly;
-
- protected final OrmEclipseLinkCustomizer customizer;
-
- protected final OrmEclipseLinkChangeTracking changeTracking;
-
- protected final OrmEclipseLinkCaching caching;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
- protected final OrmEclipseLinkMultitenancy2_3 multitenancy;
-
- protected final OrmQueryContainer queryContainer;
-
-
- public OrmEclipseLinkMappedSuperclassImpl(OrmPersistentType parent, XmlMappedSuperclass xmlMappedSuperclass) {
- super(parent, xmlMappedSuperclass);
- this.caching = this.buildCaching();
- this.readOnly = this.buildReadOnly();
- this.converterContainer = this.buildConverterContainer();
- this.changeTracking = this.buildChangeTracking();
- this.customizer = this.buildCustomizer();
- this.multitenancy = this.buildMultitenancy();
- this.queryContainer = this.buildQueryContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.caching.synchronizeWithResourceModel();
- this.readOnly.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- this.changeTracking.synchronizeWithResourceModel();
- this.customizer.synchronizeWithResourceModel();
- this.multitenancy.synchronizeWithResourceModel();
- this.queryContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.caching.update();
- this.readOnly.update();
- this.converterContainer.update();
- this.changeTracking.update();
- this.customizer.update();
- this.multitenancy.update();
- this.queryContainer.update();
- }
-
-
- // ********** caching **********
-
- public OrmEclipseLinkCaching getCaching() {
- return this.caching;
- }
-
- protected OrmEclipseLinkCaching buildCaching() {
- return new OrmEclipseLinkCachingImpl(this);
- }
-
-
- // ********** read only **********
-
- public OrmEclipseLinkReadOnly getReadOnly() {
- return this.readOnly;
- }
-
- protected OrmEclipseLinkReadOnly buildReadOnly() {
- return new OrmEclipseLinkReadOnly(this);
- }
-
-
- // ********** converter container **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.xmlTypeMapping);
- }
-
- public int getNumberSupportedConverters() {
- return Integer.MAX_VALUE;
- }
-
- @SuppressWarnings("unchecked")
- public Iterable<EclipseLinkConverter> getConverters() {
- return new CompositeIterable<EclipseLinkConverter>(
- this.converterContainer.getConverters(),
- this.getAttributeMappingConverters()
- );
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters() {
- return new FilteringIterable<EclipseLinkConverter>(this.getAttributeMappingConverters_(), NotNullFilter.<EclipseLinkConverter>instance());
- }
-
- protected Iterable<EclipseLinkConverter> getAttributeMappingConverters_() {
- return new CompositeIterable<EclipseLinkConverter>(this.getAttributeMappingConverterLists());
- }
-
- protected Iterable<Iterable<EclipseLinkConverter>> getAttributeMappingConverterLists() {
- return new TransformationIterable<AttributeMapping, Iterable<EclipseLinkConverter>>(
- this.getAttributeMappings(),
- ATTRIBUTE_MAPPING_CONVERTER_TRANSFORMER
- );
- }
-
-
- // ********** change tracking **********
-
- public EclipseLinkChangeTracking getChangeTracking() {
- return this.changeTracking;
- }
-
- protected OrmEclipseLinkChangeTracking buildChangeTracking() {
- return new OrmEclipseLinkChangeTracking(this);
- }
-
-
- // ********** customizer **********
-
- public EclipseLinkCustomizer getCustomizer() {
- return this.customizer;
- }
-
- protected OrmEclipseLinkCustomizer buildCustomizer() {
- return new OrmEclipseLinkCustomizer(this);
- }
-
-
- // ********** multitenancy **********
-
- public OrmEclipseLinkMultitenancy2_3 getMultitenancy() {
- return this.multitenancy;
- }
-
-
- protected OrmEclipseLinkMultitenancy2_3 buildMultitenancy() {
- return this.isEclipseLink2_3Compatible() ?
- new OrmEclipseLinkMultitenancyImpl2_3(this) :
- new NullOrmEclipseLinkMultitenancy2_3(this);
- }
-
- protected boolean isEclipseLink2_3Compatible() {
- return JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_3Compatible(this);
- }
-
- // ********** query container **********
-
- public OrmQueryContainer getQueryContainer() {
- return this.queryContainer;
- }
-
- protected OrmQueryContainer buildQueryContainer() {
- return this.getContextNodeFactory().buildOrmQueryContainer(this, this.xmlTypeMapping);
- }
-
- @Override
- public Iterable<Query> getQueries() {
- return this.queryContainer.getQueries();
- }
-
- public boolean isMultitenantMetadataAllowed() {
- return true;
- }
-
-
- // ********** parent class **********
-
- @Override
- protected String buildSpecifiedParentClass() {
- return this.xmlTypeMapping.getParentClass();
- }
-
- @Override
- public void setSpecifiedParentClassInXml(String parentClass) {
- this.xmlTypeMapping.setParentClass(parentClass);
- }
-
-
- // ********** misc **********
-
- @Override
- public JavaEclipseLinkMappedSuperclass getJavaTypeMapping() {
- return (JavaEclipseLinkMappedSuperclass) super.getJavaTypeMapping();
- }
-
- @Override
- public JavaEclipseLinkMappedSuperclass getJavaTypeMappingForDefaults() {
- return (JavaEclipseLinkMappedSuperclass) super.getJavaTypeMappingForDefaults();
- }
-
- @Override
- public EclipseLinkOrmPersistentType getPersistentType() {
- return (EclipseLinkOrmPersistentType) super.getPersistentType();
- }
-
- public boolean usesPrimaryKeyColumns() {
- return (this.getXmlTypeMapping().getPrimaryKey() != null)
- || this.usesJavaPrimaryKeyColumns();
- }
-
- protected boolean usesJavaPrimaryKeyColumns() {
- JavaEclipseLinkMappedSuperclass javaMappedSuperclass = this.getJavaTypeMappingForDefaults();
- return (javaMappedSuperclass != null) && javaMappedSuperclass.usesPrimaryKeyColumns();
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- return getMultitenancy().usesPrimaryKeyTenantDiscriminatorColumns();
- }
-
- public OrmCacheable2_0 getCacheable() {
- return this.getCacheableHolder().getCacheable();
- }
-
- public boolean calculateDefaultCacheable() {
- return this.getCacheableHolder().calculateDefaultCacheable();
- }
-
- protected OrmCacheableHolder2_0 getCacheableHolder() {
- return (OrmCacheableHolder2_0) this.caching;
- }
-
- public XmlCacheable_2_0 getXmlCacheable() {
- return this.getXmlTypeMapping();
- }
-
-
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.createCustomizerRenameTypeEdits(originalType, newName),
- this.createConverterHolderRenameTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenameTypeEdits(IType originalType, String newName) {
- return this.customizer.createRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenameTypeEdits(IType originalType, String newName) {
- return this.converterContainer.createRenameTypeEdits(originalType, newName);
- }
-
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.createCustomizerMoveTypeEdits(originalType, newPackage),
- this.createConverterHolderMoveTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.customizer.createMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.converterContainer.createMoveTypeEdits(originalType, newPackage);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.createCustomizerRenamePackageEdits(originalPackage, newName),
- this.createConverterHolderRenamePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createCustomizerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.customizer.createRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createConverterHolderRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.converterContainer.createRenamePackageEdits(originalPackage, newName);
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.validateParentClass(messages, reporter);
- this.caching.validate(messages, reporter);
- this.readOnly.validate(messages, reporter);
- this.converterContainer.validate(messages, reporter);
- this.changeTracking.validate(messages, reporter);
- this.customizer.validate(messages, reporter);
- this.multitenancy.validate(messages, reporter);
- }
-
- @Override
- protected JptValidator buildPrimaryKeyValidator() {
- return new EclipseLinkMappedSuperclassPrimaryKeyValidator(this, this.buildTextRangeResolver());
- }
-
- @Override
- protected JptValidator buildTypeMappingValidator() {
- if (this.isDynamicType()) {
- return new EclipseLinkDynamicTypeMappingValidator(this);
- }
- return new EclipseLinkMappedSuperclassValidator(this, this.getJavaResourceType(), this.buildTextRangeResolver());
- }
-
- protected boolean isDynamicType() {
- return this.getPersistentType().isDynamic();
- }
-
- protected void validateParentClass(List<IMessage> messages, IReporter reporter) {
- if (this.specifiedParentClass == null) {
- return;
- }
- if (this.getResolvedParentClass() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedParentClass());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_TYPE_PARENT_CLASS_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedParentClass()},
- this,
- this.getParentClassTextRange()
- )
- );
- }
- }
- }
-
- protected TextRange getParentClassTextRange() {
- return this.getValidationTextRange(this.xmlTypeMapping.getParentClassTextRange());
- }
-
- // ********** completion proposals **********
-
- @Override
- public Iterable<String> getXmlCompletionProposals(int pos) {
- Iterable<String> result = super.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- result = this.multitenancy.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java
deleted file mode 100644
index 4e12dff7de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMultitenancyImpl2_3.java
+++ /dev/null
@@ -1,795 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmVirtualTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetDatabase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.TenantDiscriminatorColumnValidator2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkMultitenancyImpl2_3
- extends AbstractOrmXmlContextNode
- implements OrmEclipseLinkMultitenancy2_3
-{
- protected boolean specifiedMultitenant;
- protected boolean defaultMultitenant;
-
- protected EclipseLinkMultitenantType2_3 specifiedType;
- protected EclipseLinkMultitenantType2_3 defaultType;
-
- protected Boolean specifiedIncludeCriteria;
- protected boolean defaultIncludeCriteria = DEFAULT_INCLUDE_CRITERIA;
-
- protected final ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> specifiedTenantDiscriminatorColumnContainer;
- protected final OrmReadOnlyTenantDiscriminatorColumn2_3.Owner tenantDiscriminatorColumnOwner;
-
- protected final ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> defaultTenantDiscriminatorColumnContainer;
-
- protected final OrmReadOnlyTenantDiscriminatorColumn2_3 defaultTenantDiscriminatorColumn;
-
- protected boolean specifiedTenantDiscriminatorColumnsAllowed;
-
- public OrmEclipseLinkMultitenancyImpl2_3(OrmEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
-
- this.specifiedMultitenant = isMultitenantElementSpecified();
- this.specifiedType = this.buildSpecifiedType();
- this.specifiedIncludeCriteria = this.buildSpecifiedIncludeCriteria();
- this.tenantDiscriminatorColumnOwner = this.buildTenantDiscriminatorColumnOwner();
- this.specifiedTenantDiscriminatorColumnContainer = this.buildSpecifiedTenantDiscriminatorColumnContainer();
- this.defaultTenantDiscriminatorColumn = this.buildTenantDiscriminatorColumn(null);
- this.defaultTenantDiscriminatorColumnContainer = this.buildDefaultTenantDiscriminatorColumnContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedMultitenant_(isMultitenantElementSpecified());
- this.setSpecifiedType_(this.buildSpecifiedType());
- this.setSpecifiedIncludeCriteria_(this.buildSpecifiedIncludeCriteria());
- this.syncSpecifiedTenantDiscriminatorColumns();
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getSpecifiedTenantDiscriminatorColumns());
-
- boolean xmlMultitenantNotSpecified = (this.getXmlMultitenant() == null);
- JavaEclipseLinkMultitenancy2_3 javaMultitenantPolicy = this.getJavaMultitenancyPolicyForDefaults();
- boolean javaMultitenantPolicySpecified = javaMultitenantPolicy != null;
- boolean useJavaValue = (xmlMultitenantNotSpecified && javaMultitenantPolicySpecified);
-
- this.setDefaultMultitenant(useJavaValue ? javaMultitenantPolicy.isMultitenant() : this.buildDefaultMultitenant());
- this.setDefaultType(useJavaValue ? javaMultitenantPolicy.getType() : this.buildDefaultType());
- this.setDefaultIncludeCriteria(useJavaValue ? javaMultitenantPolicy.isIncludeCriteria() : this.buildDefaultIncludeCriteria());
- this.setSpecifiedTenantDiscriminatorColumnsAllowed(this.buildSpecifiedTenantDiscriminatorColumnsAllowed());
- this.updateDefaultTenantDiscriminatorColumns();
- }
-
-
- // ********** multitenant **********
-
- public boolean isMultitenant() {
- return isSpecifiedMultitenant() || isDefaultMultitenant();
- }
-
- public boolean isDefaultMultitenant() {
- return this.defaultMultitenant;
- }
-
- public void setDefaultMultitenant(boolean defaultMultitenant) {
- boolean old = this.defaultMultitenant;
- this.defaultMultitenant = defaultMultitenant;
- this.firePropertyChanged(DEFAULT_MULTITENANT_PROPERTY, old, defaultMultitenant);
- }
-
- protected boolean buildDefaultMultitenant() {
- return this.isMultitenantInheritanceHierarchy() || this.isSuperMappedSuperclassMultitenant();
- }
-
- public boolean isSpecifiedMultitenant() {
- return this.specifiedMultitenant;
- }
-
- public void setSpecifiedMultitenant(boolean isMultitenant) {
- if (isMultitenant) {
- if (getXmlMultitenant() != null) {
- throw new IllegalStateException("Multitenant element already specified"); //$NON-NLS-1$
- }
- this.addXmlMultitenant();
- }
- else {
- if (getXmlMultitenant() == null) {
- throw new IllegalStateException("Multitenant element does not exist"); //$NON-NLS-1$
- }
- this.removeXmlMultitenant();
- this.setSpecifiedType(null);
- for (int i = this.getSpecifiedTenantDiscriminatorColumnsSize(); i-- > 0; ) {
- this.removeSpecifiedTenantDiscriminatorColumn(i);
- }
- }
- this.setSpecifiedMultitenant_(isMultitenant);
- }
-
- protected void setSpecifiedMultitenant_(boolean isMultitenant) {
- boolean old = this.specifiedMultitenant;
- this.specifiedMultitenant = isMultitenant;
- this.firePropertyChanged(SPECIFIED_MULTITENANT_PROPERTY, old, isMultitenant);
- }
-
-
- // ********** type **********
-
- public EclipseLinkMultitenantType2_3 getType() {
- return (this.specifiedType != null) ? this.specifiedType : this.getDefaultType();
- }
-
- public EclipseLinkMultitenantType2_3 getSpecifiedType() {
- return this.specifiedType;
- }
-
- public void setSpecifiedType(EclipseLinkMultitenantType2_3 type) {
- if (this.valuesAreDifferent(this.specifiedType, type)) {
- XmlMultitenant xmlMultitenant = this.getXmlMultitenantForUpdate();
- this.setSpecifiedType_(type);
- xmlMultitenant.setType(EclipseLinkMultitenantType2_3.toOrmResourceModel(type));
- }
- }
-
- protected void setSpecifiedType_(EclipseLinkMultitenantType2_3 type) {
- EclipseLinkMultitenantType2_3 old = this.specifiedType;
- this.specifiedType = type;
- this.firePropertyChanged(SPECIFIED_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkMultitenantType2_3 buildSpecifiedType() {
- XmlMultitenant xmlMultitenant = this.getXmlMultitenant();
- return (xmlMultitenant == null) ? null : EclipseLinkMultitenantType2_3.fromOrmResourceModel(xmlMultitenant.getType());
- }
-
- public EclipseLinkMultitenantType2_3 getDefaultType() {
- return this.defaultType;
- }
-
- protected void setDefaultType(EclipseLinkMultitenantType2_3 type) {
- EclipseLinkMultitenantType2_3 old = this.defaultType;
- this.defaultType = type;
- this.firePropertyChanged(DEFAULT_TYPE_PROPERTY, old, type);
- }
-
- protected EclipseLinkMultitenantType2_3 buildDefaultType() {
- if (!isMultitenant()) {
- return null;
- }
- if (isSpecifiedMultitenant()) {
- return DEFAULT_TYPE;
- }
- if (this.isMultitenantInheritanceHierarchy()) {
- return getRootEntity().getMultitenancy().getType();
- }
- EclipseLinkMappedSuperclass superMappedSuperclass = getSuperMappedSuperclass();
- return superMappedSuperclass != null ? superMappedSuperclass.getMultitenancy().getType() : DEFAULT_TYPE;
- }
-
-
- // ********** include criteria **********
-
- public boolean isIncludeCriteria() {
- return (this.specifiedIncludeCriteria != null) ? this.specifiedIncludeCriteria.booleanValue() : this.defaultIncludeCriteria;
- }
-
- public Boolean getSpecifiedIncludeCriteria() {
- return this.specifiedIncludeCriteria;
- }
-
- public void setSpecifiedIncludeCriteria(Boolean includeCriteria) {
- if (this.valuesAreDifferent(this.specifiedIncludeCriteria, includeCriteria)) {
- XmlMultitenant xmlMultitenant = this.getXmlMultitenantForUpdate();
- this.setSpecifiedIncludeCriteria_(includeCriteria);
- xmlMultitenant.setIncludeCriteria(includeCriteria);
- }
- }
-
- protected void setSpecifiedIncludeCriteria_(Boolean includeCriteria) {
- Boolean old = this.specifiedIncludeCriteria;
- this.specifiedIncludeCriteria = includeCriteria;
- this.firePropertyChanged(SPECIFIED_INCLUDE_CRITERIA_PROPERTY, old, includeCriteria);
- }
-
- protected Boolean buildSpecifiedIncludeCriteria() {
- XmlMultitenant xmlMultitenant = this.getXmlMultitenant();
- return (xmlMultitenant == null) ? null : xmlMultitenant.getIncludeCriteria();
- }
-
-
- public boolean isDefaultIncludeCriteria() {
- return this.defaultIncludeCriteria;
- }
-
- protected void setDefaultIncludeCriteria(boolean includeCriteria) {
- boolean old = this.defaultIncludeCriteria;
- this.defaultIncludeCriteria = includeCriteria;
- this.firePropertyChanged(DEFAULT_INCLUDE_CRITERIA_PROPERTY, old, includeCriteria);
- }
-
- protected boolean buildDefaultIncludeCriteria() {
- if (getType() == EclipseLinkMultitenantType2_3.VPD) {
- return false;
- }
- return DEFAULT_INCLUDE_CRITERIA;
- }
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getReadOnlySpecifiedTenantDiscriminatorColumns() :
- this.getReadOnlyDefaultTenantDiscriminatorColumns();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return this.hasSpecifiedTenantDiscriminatorColumns() ?
- this.getSpecifiedTenantDiscriminatorColumnsSize() :
- this.getDefaultTenantDiscriminatorColumnsSize();
- }
-
- // ********** specified tenant discriminator columns **********
-
- public ListIterable<OrmTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getReadOnlySpecifiedTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<OrmReadOnlyTenantDiscriminatorColumn2_3>(this.getSpecifiedTenantDiscriminatorColumns());
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize() {
- return this.specifiedTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns() {
- return this.getSpecifiedTenantDiscriminatorColumnsSize() != 0;
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn() {
- return this.addSpecifiedTenantDiscriminatorColumn(this.getSpecifiedTenantDiscriminatorColumnsSize());
- }
-
- public OrmTenantDiscriminatorColumn2_3 addSpecifiedTenantDiscriminatorColumn(int index) {
- XmlTenantDiscriminatorColumn xmlJoinColumn = this.buildXmlTenantDiscriminatorColumn();
- OrmTenantDiscriminatorColumn2_3 joinColumn = this.specifiedTenantDiscriminatorColumnContainer.addContextElement(index, xmlJoinColumn);
- this.getXmlMultitenantForUpdate().getTenantDiscriminatorColumns().add(index, xmlJoinColumn);
- return joinColumn;
- }
-
- protected XmlTenantDiscriminatorColumn buildXmlTenantDiscriminatorColumn() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn();
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(TenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.removeSpecifiedTenantDiscriminatorColumn(this.specifiedTenantDiscriminatorColumnContainer.indexOfContextElement((OrmTenantDiscriminatorColumn2_3) tenantDiscriminatorColumn));
- }
-
- public void removeSpecifiedTenantDiscriminatorColumn(int index) {
- this.specifiedTenantDiscriminatorColumnContainer.removeContextElement(index);
- this.getXmlMultitenant().getTenantDiscriminatorColumns().remove(index);
- }
-
- public void moveSpecifiedTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- this.specifiedTenantDiscriminatorColumnContainer.moveContextElement(targetIndex, sourceIndex);
- this.getXmlMultitenant().getTenantDiscriminatorColumns().move(targetIndex, sourceIndex);
- }
-
-
- protected void syncSpecifiedTenantDiscriminatorColumns() {
- this.specifiedTenantDiscriminatorColumnContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getXmlTenantDiscriminatorColumns() {
- if (getXmlMultitenant() == null) {
- return EmptyListIterable.instance();
- }
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlTenantDiscriminatorColumn_2_3>(this.getXmlMultitenant().getTenantDiscriminatorColumns());
- }
-
- /**
- * specified tenant discriminator column container
- */
- protected class SpecifiedTenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmTenantDiscriminatorColumn2_3 buildContextElement(XmlTenantDiscriminatorColumn_2_3 resourceElement) {
- return OrmEclipseLinkMultitenancyImpl2_3.this.buildTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getResourceElements() {
- return OrmEclipseLinkMultitenancyImpl2_3.this.getXmlTenantDiscriminatorColumns();
- }
- @Override
- protected XmlTenantDiscriminatorColumn_2_3 getResourceElement(OrmTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getXmlColumn();
- }
- }
-
- protected OrmReadOnlyTenantDiscriminatorColumn2_3.Owner buildTenantDiscriminatorColumnOwner() {
- return new TenantDiscriminatorColumnOwner();
- }
-
- protected ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> buildSpecifiedTenantDiscriminatorColumnContainer() {
- SpecifiedTenantDiscriminatorColumnContainer container = new SpecifiedTenantDiscriminatorColumnContainer();
- container.initialize();
- return container;
- }
-
- protected OrmTenantDiscriminatorColumn2_3 buildTenantDiscriminatorColumn(XmlTenantDiscriminatorColumn_2_3 xmlTenantDiscriminatorColumn) {
- return new EclipseLinkOrmTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, xmlTenantDiscriminatorColumn);
- }
-
-
- // ********** default tenant discriminator columns **********
-
- public ListIterable<OrmVirtualTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElements();
- }
-
- protected ListIterable<OrmReadOnlyTenantDiscriminatorColumn2_3> getReadOnlyDefaultTenantDiscriminatorColumns() {
- return new SuperListIterableWrapper<OrmReadOnlyTenantDiscriminatorColumn2_3>(this.getDefaultTenantDiscriminatorColumns());
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize() {
- return this.defaultTenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- protected void clearDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.clearContextList();
- }
-
- /**
- * If there are any specified tenant discriminator columns, then there are no default
- * tenant discriminator columns.
- * If there are Java specified tenant discriminator columns, then those are the default
- * tenant discriminator columns.
- * @see #getTenantDiscriminatorColumnsForDefaults()
- */
- protected void updateDefaultTenantDiscriminatorColumns() {
- this.defaultTenantDiscriminatorColumnContainer.update();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumnsForDefaults() {
- if (this.getType() == null || this.getType() == EclipseLinkMultitenantType2_3.TABLE_PER_TENANT) {
- return EmptyListIterable.instance();
- }
- JavaEclipseLinkMultitenancy2_3 javaMultitenancy = this.getJavaMultitenancyPolicyForDefaults();
- if (javaMultitenancy != null && !this.isSpecifiedMultitenant()) {
- if (javaMultitenancy.hasSpecifiedTenantDiscriminatorColumns()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(javaMultitenancy.getSpecifiedTenantDiscriminatorColumns());
- }
- }
- if (this.isMultitenantInheritanceHierarchy()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(this.getRootEntity().getMultitenancy().getTenantDiscriminatorColumns());
- }
- if (!isSpecifiedMultitenant()) {
- EclipseLinkMappedSuperclass superMappedSuperclass = this.getSuperMappedSuperclass();
- if (superMappedSuperclass != null && superMappedSuperclass.getMultitenancy().isMultitenant()) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(superMappedSuperclass.getMultitenancy().getTenantDiscriminatorColumns());
- }
- }
- if (this.getSpecifiedTenantDiscriminatorColumnsSize() == 0) {
- ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> contextColumns = this.getContextDefaultTenantDiscriminatorColumns();
- if (CollectionTools.isEmpty(contextColumns)) {
- return new SingleElementListIterable<ReadOnlyTenantDiscriminatorColumn2_3>(this.defaultTenantDiscriminatorColumn);
- }
- return contextColumns;
- }
- return EmptyListIterable.instance();
- }
-
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getContextDefaultTenantDiscriminatorColumns() {
- EclipseLinkEntityMappings entityMappings = this.getEclipseLinkEntityMappings();
- return (entityMappings != null) ? entityMappings.getTenantDiscriminatorColumns() : this.getPersistenceUnit().getDefaultTenantDiscriminatorColumns();
- }
-
-
- protected void moveDefaultTenantDiscriminatorColumn(int index, OrmVirtualTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.defaultTenantDiscriminatorColumnContainer.moveContextElement(index, tenantDiscriminatorColumn);
- }
-
- protected OrmVirtualTenantDiscriminatorColumn2_3 addDefaultTenantDiscriminatorColumn(int index, JavaTenantDiscriminatorColumn2_3 javaTenantDiscriminatorColumn) {
- return this.defaultTenantDiscriminatorColumnContainer.addContextElement(index, javaTenantDiscriminatorColumn);
- }
-
- protected OrmVirtualTenantDiscriminatorColumn2_3 buildVirtualTenantDiscriminatorColumn(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- return new GenericOrmVirtualTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, tenantDiscriminatorColumn);
- }
-
- protected void removeDefaultTenantDiscriminatorColumn(OrmVirtualTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.defaultTenantDiscriminatorColumnContainer.removeContextElement(tenantDiscriminatorColumn);
- }
-
- protected ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3> buildDefaultTenantDiscriminatorColumnContainer() {
- return new DefaultTenantDiscriminatorColumnContainer();
- }
-
- public boolean specifiedTenantDiscriminatorColumnsAllowed() {
- return this.specifiedTenantDiscriminatorColumnsAllowed;
- }
-
- public void setSpecifiedTenantDiscriminatorColumnsAllowed(boolean allowed) {
- boolean old = this.specifiedTenantDiscriminatorColumnsAllowed;
- this.specifiedTenantDiscriminatorColumnsAllowed = allowed;
- this.firePropertyChanged(SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_ALLOWED_PROPERTY, old, allowed);
- }
-
- protected boolean buildSpecifiedTenantDiscriminatorColumnsAllowed() {
- return this.getParent().isMultitenantMetadataAllowed();
- }
-
-
- /**
- * default tenant discriminator column container
- */
- protected class DefaultTenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmVirtualTenantDiscriminatorColumn2_3, ReadOnlyTenantDiscriminatorColumn2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmVirtualTenantDiscriminatorColumn2_3 buildContextElement(ReadOnlyTenantDiscriminatorColumn2_3 resourceElement) {
- return OrmEclipseLinkMultitenancyImpl2_3.this.buildVirtualTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getResourceElements() {
- return OrmEclipseLinkMultitenancyImpl2_3.this.getTenantDiscriminatorColumnsForDefaults();
- }
- @Override
- protected ReadOnlyTenantDiscriminatorColumn2_3 getResourceElement(OrmVirtualTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getOverriddenColumn();
- }
- }
-
-
- // ********** OrmReadOnlyTenantDiscriminatorColumn.Owner implementation **********
-
- protected class TenantDiscriminatorColumnOwner
- implements OrmReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
-
- public String getDefaultContextPropertyName() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_CONTEXT_PROPERTY;
- }
-
- public boolean getDefaultPrimaryKey() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_PRIMARY_KEY;
- }
-
- public int getDefaultLength() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- public String getDefaultTableName() {
- return getTypeMapping().getPrimaryTableName();
- }
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME;
- }
-
- public Table resolveDbTable(String tableName) {
- return getTypeMapping().resolveDbTable(tableName);
- }
-
- public Iterable<String> getCandidateTableNames() {
- return getTypeMapping().getAllAssociatedTableNames();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return getTypeMapping().tableNameIsInvalid(tableName);
- }
-
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn column, NamedColumnTextRangeResolver textRangeResolver) {
- return new TenantDiscriminatorColumnValidator2_3((ReadOnlyTenantDiscriminatorColumn2_3) column, textRangeResolver);
- }
-
- public TextRange getValidationTextRange() {
- return OrmEclipseLinkMultitenancyImpl2_3.this.getValidationTextRange();
- }
- }
-
- // ********** XML multitenant **********
-
- /**
- * Return null if the XML multitenant does not exists.
- */
- protected XmlMultitenant getXmlMultitenant() {
- return getXmlMultitenantHolder().getMultitenant();
- }
-
- protected XmlMultitenantHolder getXmlMultitenantHolder() {
- return (XmlMultitenantHolder) this.getXmlTypeMapping();
- }
-
- /**
- * Build the XML multitenant if it does not exist.
- */
- protected XmlMultitenant getXmlMultitenantForUpdate() {
- XmlMultitenant xmlMultitenant = this.getXmlMultitenant();
- return (xmlMultitenant != null) ? xmlMultitenant : this.buildXmlMultitenant();
- }
-
- protected XmlMultitenant buildXmlMultitenant() {
- XmlMultitenant xmlMultitenant = EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant();
- this.getXmlMultitenantHolder().setMultitenant(xmlMultitenant);
- return xmlMultitenant;
- }
-
- public boolean isMultitenantElementSpecified() {
- return this.getXmlMultitenant() != null;
- }
-
- protected XmlMultitenant addXmlMultitenant() {
- XmlMultitenant xmlMultitenant = this.buildXmlMultitenant();
- this.getXmlMultitenantHolder().setMultitenant(xmlMultitenant);
- return xmlMultitenant;
- }
-
- protected void removeXmlMultitenant() {
- this.getXmlMultitenantHolder().setMultitenant(null);
- }
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (OrmEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected OrmEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- public EclipseLinkEntityMappings getEclipseLinkEntityMappings() {
- return (EclipseLinkEntityMappings) super.getMappingFileRoot();
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected JavaEclipseLinkMultitenancy2_3 getJavaMultitenancyPolicyForDefaults() {
- JavaEclipseLinkNonEmbeddableTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : javaTypeMapping.getMultitenancy();
- }
-
- protected boolean isMultitenantInheritanceHierarchy() {
- if (this.isInheritanceStrategyTablePerClass()) {
- return false;
- }
- return this.isRootEntityMultitenant();
- }
-
- protected boolean isInheritanceStrategyTablePerClass() {
- return this.getParent().getInheritanceStrategy() == InheritanceType.TABLE_PER_CLASS;
- }
-
- protected boolean isRootEntityMultitenant() {
- EclipseLinkEntity rootEntity = this.getRootEntity();
- return rootEntity != null && rootEntity != getParent() && rootEntity.getMultitenancy().isMultitenant();
- }
-
- protected EclipseLinkEntity getRootEntity() {
- //instanceof check in case the rootEntity is in an orm.xml instead of an eclipselinkorm.xml file.
- Entity entity = getParent().getRootEntity();
- return entity instanceof EclipseLinkEntity ? (EclipseLinkEntity) entity : null;
- }
-
- protected boolean isSuperMappedSuperclassMultitenant() {
- EclipseLinkMappedSuperclass mappedSuperclass = this.getSuperMappedSuperclass(getParent());
- return mappedSuperclass != null && mappedSuperclass.getMultitenancy().isMultitenant();
- }
-
- protected EclipseLinkMappedSuperclass getSuperMappedSuperclass() {
- return this.getSuperMappedSuperclass(this.getParent());
- }
-
- protected EclipseLinkMappedSuperclass getSuperMappedSuperclass(TypeMapping typeMapping) {
- TypeMapping superTypeMapping = typeMapping.getSuperTypeMapping();
- if (superTypeMapping == null) {
- return null;
- }
- //instanceof check in case the mapped superclass is in an orm.xml instead of an eclipselinkorm.xml file.
- if (superTypeMapping instanceof EclipseLinkMappedSuperclass) {
- return (EclipseLinkMappedSuperclass) superTypeMapping;
- }
- return this.getSuperMappedSuperclass(superTypeMapping);
- }
-
- public boolean usesPrimaryKeyTenantDiscriminatorColumns() {
- for (ReadOnlyTenantDiscriminatorColumn2_3 column : getTenantDiscriminatorColumns()) {
- if (column.isPrimaryKey()) {
- return true;
- }
- }
- return false;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- if (getType() == EclipseLinkMultitenantType2_3.TABLE_PER_TENANT) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_TABLE_PER_TENANT_NOT_SUPPORTED,
- EMPTY_STRING_ARRAY,
- this,
- this.getValidationTextRange()
- )
- );
- }
- if (getType() == EclipseLinkMultitenantType2_3.VPD) {
- String targetDatabase = getPersistenceUnit().getOptions().getTargetDatabase();
- if (targetDatabase == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.LOW_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_MIGHT_NOT_BE_NOT_SUPPORTED,
- EMPTY_STRING_ARRAY,
- this,
- this.getValidationTextRange()
- )
- );
- }
- else if (!TargetDatabase.isOracleDatabase(targetDatabase)) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_NOT_SUPPORTED_ON_NON_ORACLE_DATABASE_PLATFORM,
- new String[] {targetDatabase},
- this,
- this.getValidationTextRange()
- )
- );
- }
- }
- if (getSpecifiedTenantDiscriminatorColumnsSize() > 0) {
- if (!this.specifiedTenantDiscriminatorColumnsAllowed()) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_METADATA_CANNOT_BE_SPECIFIED_ON_NON_ROOT_ENTITY,
- EMPTY_STRING_ARRAY,
- this,
- this.getXmlMultitenant().getValidationTextRange()
- )
- );
- }
- else {
- for (OrmTenantDiscriminatorColumn2_3 column : this.getSpecifiedTenantDiscriminatorColumns()) {
- column.validate(messages, reporter);
- }
- }
- }
- if (this.specifiedTenantDiscriminatorColumnsAllowed()) {
- //bug 360731 no need to validate, they will be validated where they are specified
- for (OrmVirtualTenantDiscriminatorColumn2_3 column : this.getDefaultTenantDiscriminatorColumns()) {
- column.validate(messages, reporter);
- }
- }
- if (this.getSpecifiedIncludeCriteria() == Boolean.TRUE && getType() == EclipseLinkMultitenantType2_3.VPD) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.NORMAL_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTITENANT_VPD_INCLUDE_CRITERIA_WILL_BE_IGNORED,
- EMPTY_STRING_ARRAY,
- this,
- this.getXmlMultitenant().getIncludeCriteriaTextRange()
- )
- );
- }
- }
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlMultitenantValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlMultitenantValidationTextRange() {
- XmlMultitenant_2_4 xmlMultitenant = this.getXmlMultitenant();
- return (xmlMultitenant == null) ? null : xmlMultitenant.getValidationTextRange();
- }
-
- // ********** completion proposals **********
-
- @Override
- public Iterable<String> getXmlCompletionProposals(int pos) {
- Iterable<String> result = super.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- for (OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn : this.getSpecifiedTenantDiscriminatorColumns()) {
- result = tenantDiscriminatorColumn.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java
deleted file mode 100644
index 6d2d947109..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkMutable.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable;
-
-public class OrmEclipseLinkMutable
- extends AbstractOrmXmlContextNode
- implements EclipseLinkMutable
-{
- protected Boolean specifiedMutable;
- protected boolean defaultMutable;
-
-
- public OrmEclipseLinkMutable(OrmAttributeMapping parent) {
- super(parent);
- this.specifiedMutable = this.buildSpecifiedMutable();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedMutable_(this.buildSpecifiedMutable());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultMutable(this.buildDefaultMutable());
- }
-
-
- // ********** mutable **********
-
- public boolean isMutable() {
- return (this.specifiedMutable != null) ? this.specifiedMutable.booleanValue() : this.defaultMutable;
- }
-
- public Boolean getSpecifiedMutable() {
- return this.specifiedMutable;
- }
-
- public void setSpecifiedMutable(Boolean mutable) {
- this.setSpecifiedMutable_(mutable);
- this.getXmlMutable().setMutable(mutable);
- }
-
- protected void setSpecifiedMutable_(Boolean mutable) {
- Boolean old = this.specifiedMutable;
- this.specifiedMutable = mutable;
- this.firePropertyChanged(SPECIFIED_MUTABLE_PROPERTY, old, mutable);
- }
-
- protected Boolean buildSpecifiedMutable() {
- return this.getXmlMutable().getMutable();
- }
-
- public boolean isDefaultMutable() {
- return this.defaultMutable;
- }
-
- protected void setDefaultMutable(boolean mutable) {
- boolean old = this.defaultMutable;
- this.defaultMutable = mutable;
- this.firePropertyChanged(DEFAULT_MUTABLE_PROPERTY, old, mutable);
- }
-
- protected boolean buildDefaultMutable() {
- JavaEclipseLinkPersistentAttribute javaAttribute = this.getJavaPersistentAttribute();
- if (javaAttribute == null) {
- return false;
- }
- if (javaAttribute.typeIsDateOrCalendar()) {
- Boolean puTemporalMutable = this.getPersistenceUnit().getOptions().getTemporalMutable();
- return (puTemporalMutable == null) ? false : puTemporalMutable.booleanValue();
- }
- return javaAttribute.typeIsSerializable();
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- protected OrmAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected XmlMutable getXmlMutable() {
- return (XmlMutable) this.getAttributeMapping().getXmlAttributeMapping();
- }
-
- protected JavaEclipseLinkPersistentAttribute getJavaPersistentAttribute() {
- return (JavaEclipseLinkPersistentAttribute) this.getAttributeMapping().getPersistentAttribute().getJavaPersistentAttribute();
- }
-
- @Override
- public EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlMutable().getMutableTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java
deleted file mode 100644
index 65477b4da5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkObjectTypeConverter.java
+++ /dev/null
@@ -1,485 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkObjectTypeConverter
- extends OrmEclipseLinkConverter<XmlObjectTypeConverter>
- implements EclipseLinkObjectTypeConverter
-{
- private String dataType;
- private String fullyQualifiedDataType;
-
- private String objectType;
- private String fullyQualifiedObjectType;
-
-
- protected final ContextListContainer<OrmEclipseLinkConversionValue, XmlConversionValue> conversionValueContainer;
-
- private String defaultObjectValue;
-
-
- public OrmEclipseLinkObjectTypeConverter(XmlContextNode parent, XmlObjectTypeConverter xmlConverter) {
- super(parent, xmlConverter);
- this.dataType = xmlConverter.getDataType();
- this.objectType = xmlConverter.getObjectType();
- this.conversionValueContainer = this.buildConversionValueContainer();
- this.defaultObjectValue = xmlConverter.getDefaultObjectValue();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataType_(this.xmlConverter.getDataType());
- this.setObjectType_(this.xmlConverter.getObjectType());
- this.syncConversionValues();
- this.setDefaultObjectValue_(this.xmlConverter.getDefaultObjectValue());
- }
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedDataType(this.buildFullyQualifiedDataType());
- this.setFullyQualifiedObjectType(this.buildFullyQualifiedObjectType());
- this.updateNodes(this.getConversionValues());
- }
-
-
- // ********** data type **********
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- this.setDataType_(dataType);
- this.xmlConverter.setDataType(dataType);
- }
-
- protected void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
-
- public String getFullyQualifiedDataType() {
- return this.fullyQualifiedDataType;
- }
-
- protected void setFullyQualifiedDataType(String dataType) {
- String old = this.fullyQualifiedDataType;
- this.fullyQualifiedDataType = dataType;
- this.firePropertyChanged(FULLY_QUALIFIED_DATA_TYPE_PROPERTY, old, dataType);
- }
-
- protected String buildFullyQualifiedDataType() {
- return this.getMappingFileRoot().getFullyQualifiedName(this.dataType);
- }
-
- protected boolean dataTypeIsFor(String typeName) {
- return this.typeIsFor(this.getDataTypeJavaResourceType(), typeName);
- }
-
- protected boolean dataTypeIsIn(IPackageFragment packageFragment) {
- return this.typeIsIn(this.getDataTypeJavaResourceType(), packageFragment);
- }
-
- protected JavaResourceAbstractType getDataTypeJavaResourceType() {
- if (this.fullyQualifiedDataType == null) {
- return null;
- }
- return this.getJpaProject().getJavaResourceType(this.fullyQualifiedDataType);
- }
-
-
- // ********** object type **********
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- this.setObjectType_(objectType);
- this.xmlConverter.setObjectType(objectType);
- }
-
- protected void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
- public String getFullyQualifiedObjectType() {
- return this.fullyQualifiedObjectType;
- }
-
- protected void setFullyQualifiedObjectType(String objectType) {
- String old = this.fullyQualifiedObjectType;
- this.fullyQualifiedObjectType = objectType;
- this.firePropertyChanged(FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
- protected String buildFullyQualifiedObjectType() {
- return this.getMappingFileRoot().getFullyQualifiedName(this.objectType);
- }
-
- protected boolean objectTypeIsFor(String typeName) {
- return this.typeIsFor(this.getObjectTypeJavaResourceType(), typeName);
- }
-
- protected boolean objectTypeIsIn(IPackageFragment packageFragment) {
- return this.typeIsIn(this.getObjectTypeJavaResourceType(), packageFragment);
- }
-
- protected JavaResourceAbstractType getObjectTypeJavaResourceType() {
- if (this.fullyQualifiedObjectType == null) {
- return null;
- }
- return this.getJpaProject().getJavaResourceType(this.fullyQualifiedObjectType);
- }
-
-
- // ********** conversion values **********
-
- public ListIterable<OrmEclipseLinkConversionValue> getConversionValues() {
- return this.conversionValueContainer.getContextElements();
- }
-
- public int getConversionValuesSize() {
- return this.conversionValueContainer.getContextElementsSize();
- }
-
- public EclipseLinkConversionValue getConversionValue(int index) {
- return this.conversionValueContainer.get(index);
- }
-
- public OrmEclipseLinkConversionValue addConversionValue() {
- return this.addConversionValue(this.getConversionValuesSize());
- }
-
- public OrmEclipseLinkConversionValue addConversionValue(int index) {
- XmlConversionValue xmlConversionValue = this.buildXmlConversionValue();
- OrmEclipseLinkConversionValue conversionValue = this.conversionValueContainer.addContextElement(index, xmlConversionValue);
- this.xmlConverter.getConversionValues().add(index, xmlConversionValue);
- return conversionValue;
- }
-
- protected XmlConversionValue buildXmlConversionValue() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlConversionValue();
- }
-
- public void removeConversionValue(EclipseLinkConversionValue conversionValue) {
- this.removeConversionValue(this.conversionValueContainer.indexOfContextElement((OrmEclipseLinkConversionValue) conversionValue));
- }
-
- public void removeConversionValue(int index) {
- this.conversionValueContainer.removeContextElement(index);
- this.xmlConverter.getConversionValues().remove(index);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- this.conversionValueContainer.moveContextElement(targetIndex, sourceIndex);
- this.xmlConverter.getConversionValues().move(targetIndex, sourceIndex);
- }
-
-
- protected OrmEclipseLinkConversionValue buildConversionValue(XmlConversionValue xmlConversionValue) {
- return new OrmEclipseLinkConversionValue(this, xmlConversionValue);
- }
-
- protected void syncConversionValues() {
- this.conversionValueContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlConversionValue> getXmlConversionValues() {
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlConversionValue>(this.xmlConverter.getConversionValues());
- }
-
- protected ContextListContainer<OrmEclipseLinkConversionValue, XmlConversionValue> buildConversionValueContainer() {
- ConversionValueContainer container = new ConversionValueContainer();
- container.initialize();
- return container;
- }
-
- /**
- * conversion value container
- */
- protected class ConversionValueContainer
- extends ContextListContainer<OrmEclipseLinkConversionValue, XmlConversionValue> {
-
- @Override
- protected String getContextElementsPropertyName() {
- return CONVERSION_VALUES_LIST;
- }
-
- @Override
- protected OrmEclipseLinkConversionValue buildContextElement(XmlConversionValue resourceElement) {
- return OrmEclipseLinkObjectTypeConverter.this.buildConversionValue(resourceElement);
- }
-
- @Override
- protected ListIterable<XmlConversionValue> getResourceElements() {
- return OrmEclipseLinkObjectTypeConverter.this.getXmlConversionValues();
- }
-
- @Override
- protected XmlConversionValue getResourceElement(OrmEclipseLinkConversionValue contextElement) {
- return contextElement.getXmlConversionValue();
- }
- }
-
-
- // ********** data values **********
-
- public Iterable<String> getDataValues() {
- return new TransformationIterable<OrmEclipseLinkConversionValue, String>(this.getConversionValues()) {
- @Override
- protected String transform(OrmEclipseLinkConversionValue conversionValue) {
- return conversionValue.getDataValue();
- }
- };
- }
-
- public int getDataValuesSize() {
- return this.getConversionValuesSize();
- }
-
-
- // ********** default object value **********
-
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String value) {
- this.setDefaultObjectValue_(value);
- this.xmlConverter.setDefaultObjectValue(value);
- }
-
- protected void setDefaultObjectValue_(String value) {
- String old = this.defaultObjectValue;
- this.defaultObjectValue = value;
- this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, value);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkObjectTypeConverter> getType() {
- return EclipseLinkObjectTypeConverter.class;
- }
-
- protected boolean typeIsFor(JavaResourceAbstractType type, String typeName) {
- return (type != null) && type.getQualifiedName().equals(typeName);
- }
-
- protected boolean typeIsIn(JavaResourceAbstractType type, IPackageFragment packageFragment) {
- return (type != null) && type.isIn(packageFragment);
- }
-
-
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameDataTypeEdits(originalType, newName),
- this.createRenameObjectTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameDataTypeEdits(IType originalType, String newName) {
- return this.dataTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameDataTypeEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameDataTypeEdit(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypeEdits(IType originalType, String newName) {
- return this.objectTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameObjectTypeEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameObjectTypeEdit(originalType, newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- this.createMoveDataTypeEdits(originalType, newPackage),
- this.createMoveObjectTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveDataTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.dataTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameDataTypePackageEdit(String newName) {
- return this.xmlConverter.createRenameDataTypePackageEdit(newName);
- }
-
- protected Iterable<ReplaceEdit> createMoveObjectTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.objectTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameObjectTypePackageEdit(String newName) {
- return this.xmlConverter.createRenameObjectTypePackageEdit(newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameDataTypePackageEdits(originalPackage, newName),
- this.createRenameObjectTypePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameDataTypePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.dataTypeIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.objectTypeIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- this.checkForDuplicateDataValues(messages);
- for (OrmEclipseLinkConversionValue conversionValue : this.getConversionValues()) {
- conversionValue.validate(messages, reporter);
- }
- }
-
- protected void checkForDuplicateDataValues(List<IMessage> messages) {
- for (ArrayList<OrmEclipseLinkConversionValue> dups : this.mapConversionValuesByDataValue().values()) {
- if (dups.size() > 1) {
- for (OrmEclipseLinkConversionValue dup : dups) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.MULTIPLE_OBJECT_VALUES_FOR_DATA_VALUE,
- new String[] {dup.getDataValue()},
- this,
- dup.getDataValueTextRange()
- )
- );
- }
- }
- }
- }
-
- protected HashMap<String, ArrayList<OrmEclipseLinkConversionValue>> mapConversionValuesByDataValue() {
- HashMap<String, ArrayList<OrmEclipseLinkConversionValue>> map = new HashMap<String, ArrayList<OrmEclipseLinkConversionValue>>(this.getConversionValuesSize());
- for (OrmEclipseLinkConversionValue conversionValue : this.getConversionValues()) {
- String dataValue = conversionValue.getDataValue();
- ArrayList<OrmEclipseLinkConversionValue> list = map.get(dataValue);
- if (list == null) {
- list = new ArrayList<OrmEclipseLinkConversionValue>();
- map.put(dataValue, list);
- }
- list.add(conversionValue);
- }
- return map;
- }
-
- @Override
- public boolean isEquivalentTo(JpaNamedContextNode node) {
- return super.isEquivalentTo(node)
- && this.isEquivalentTo((EclipseLinkObjectTypeConverter) node);
- }
-
- protected boolean isEquivalentTo(EclipseLinkObjectTypeConverter converter) {
- return Tools.valuesAreEqual(this.fullyQualifiedObjectType, converter.getFullyQualifiedObjectType()) &&
- Tools.valuesAreEqual(this.fullyQualifiedDataType, converter.getFullyQualifiedDataType()) &&
- Tools.valuesAreEqual(this.defaultObjectValue, converter.getDefaultObjectValue()) &&
- this.conversionValuesAreEquivalentTo(converter);
- }
-
- protected boolean conversionValuesAreEquivalentTo(EclipseLinkObjectTypeConverter converter) {
- // get fixed lists of the conversion values
- ArrayList<OrmEclipseLinkConversionValue> conversionValues1 = CollectionTools.list(this.getConversionValues());
- ArrayList<? extends EclipseLinkConversionValue> conversionValues2 = CollectionTools.list(converter.getConversionValues());
- if (conversionValues1.size() != conversionValues2.size()) {
- return false;
- }
- for (int i = 0; i < conversionValues1.size(); i++) {
- if ( ! conversionValues1.get(i).isEquivalentTo(conversionValues2.get(i))) {
- return false;
- }
- }
- return true;
- }
-
-
- // ********** metadata conversion **********
-
- public void convertFrom(JavaEclipseLinkObjectTypeConverter javaConverter) {
- super.convertFrom(javaConverter);
- this.setDataType(javaConverter.getFullyQualifiedDataType());
- this.setObjectType(javaConverter.getFullyQualifiedObjectType());
- this.setDefaultObjectValue(javaConverter.getDefaultObjectValue());
- for (JavaEclipseLinkConversionValue value : javaConverter.getConversionValues()) {
- this.addConversionValue().convertFrom(value);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java
deleted file mode 100644
index 4468c91467..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToManyMapping.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkOneToManyMapping
- extends AbstractOrmOneToManyMapping<XmlOneToMany>
- implements
- EclipseLinkOneToManyMapping2_0,
- EclipseLinkOrmConvertibleMapping,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkPrivateOwned privateOwned;
-
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
-
- public OrmEclipseLinkOneToManyMapping(OrmPersistentAttribute parent, XmlOneToMany xmlMapping) {
- super(parent, xmlMapping);
- this.privateOwned = new OrmEclipseLinkPrivateOwned(this);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.privateOwned.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- this.converterContainer.update();
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
-
- // ********** private owned **********
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** converters **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.xmlAttributeMapping);
- }
-
- public int getNumberSupportedConverters() {
- return 1;
- }
-
-
- // ********** relationship **********
-
- @Override
- protected OrmOneToManyRelationship2_0 buildRelationship() {
- return new EclipseLinkOrmOneToManyRelationship(this);
- }
-
- @Override
- public EclipseLinkOrmOneToManyRelationship2_0 getRelationship() {
- return (EclipseLinkOrmOneToManyRelationship) super.getRelationship();
- }
-
-
- //************ refactoring ************
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.converterContainer.createMoveTypeEdits(originalType, newPackage)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.converterContainer.createRenamePackageEdits(originalPackage, newName)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.converterContainer.createRenameTypeEdits(originalType, newName)
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO - private owned, join fetch validation
- }
-
-
- @Override
- protected void validateAttributeType(List<IMessage> messages, IReporter reporter) {
- if (this.isVirtualAccess()) {
- if (StringTools.stringIsEmpty(this.getAttributeType())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED,
- new String[] {this.getName()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- if (this.getResolvedAttributeType() == null) {
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType());
- if (jdtType == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedAttributeType()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- }
- }
- super.validateAttributeType(messages, reporter);
- }
-
- protected boolean isVirtualAccess() {
- return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL;
- }
-
- @Override
- protected TextRange getAttributeTypeTextRange() {
- return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java
deleted file mode 100644
index fba126803e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkOneToOneMapping.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkOneToOneMapping
- extends AbstractOrmOneToOneMapping<XmlOneToOne>
- implements EclipseLinkOneToOneMapping
-{
- protected final OrmEclipseLinkPrivateOwned privateOwned;
-
- protected final OrmEclipseLinkJoinFetch joinFetch;
-
-
- protected OrmEclipseLinkOneToOneMapping(OrmPersistentAttribute parent, XmlOneToOne xmlMapping) {
- super(parent, xmlMapping);
- this.privateOwned = new OrmEclipseLinkPrivateOwned(this);
- this.joinFetch = new OrmEclipseLinkJoinFetch(this);
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.privateOwned.synchronizeWithResourceModel();
- this.joinFetch.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.privateOwned.update();
- this.joinFetch.update();
- }
-
-
- // ********** private owned **********
-
- public EclipseLinkPrivateOwned getPrivateOwned() {
- return this.privateOwned;
- }
-
-
- // ********** join fetch **********
-
- public EclipseLinkJoinFetch getJoinFetch() {
- return this.joinFetch;
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO - private owned, join fetch validation
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitDefaults.java
deleted file mode 100644
index f69f857e75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.NamedColumnTextRangeResolver;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-
-/**
- * EclipseLink <code>orm.xml</code> file
- * <br>
- * <code>persistence-unit-defaults</code> element
- */
-public class OrmEclipseLinkPersistenceUnitDefaults
- extends AbstractOrmPersistenceUnitDefaults
- implements EclipseLinkPersistenceUnitDefaults
-{
-
- protected final ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> tenantDiscriminatorColumnContainer;
- protected final OrmReadOnlyTenantDiscriminatorColumn2_3.Owner tenantDiscriminatorColumnOwner;
-
- protected String specifiedGetMethod;
- protected String specifiedSetMethod;
-
- // ********** constructor/initialization **********
-
- public OrmEclipseLinkPersistenceUnitDefaults(OrmPersistenceUnitMetadata parent) {
- super(parent);
- this.tenantDiscriminatorColumnOwner = this.buildTenantDiscriminatorColumnOwner();
- this.tenantDiscriminatorColumnContainer = this.buildTenantDiscriminatorColumnContainer();
- this.specifiedGetMethod = this.buildSpecifiedGetMethod();
- this.specifiedSetMethod = this.buildSpecifiedSetMethod();
- }
-
- @Override
- protected XmlPersistenceUnitDefaults buildXmlPersistenceUnitDefaults() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- }
-
- @Override
- protected XmlPersistenceUnitDefaults getXmlDefaults() {
- return (XmlPersistenceUnitDefaults) super.getXmlDefaults();
- }
-
- @Override
- protected XmlPersistenceUnitDefaults getXmlDefaultsForUpdate() {
- return (XmlPersistenceUnitDefaults) super.getXmlDefaultsForUpdate();
- }
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.syncTenantDiscriminatorColumns();
- this.setSpecifiedGetMethod_(this.buildSpecifiedGetMethod());
- this.setSpecifiedSetMethod_(this.buildSpecifiedSetMethod());
- }
-
- @Override
- public void update() {
- super.update();
- this.updateNodes(this.getTenantDiscriminatorColumns());
- }
-
-
- // ********** tenant discriminator columns **********
-
- public ListIterable<OrmTenantDiscriminatorColumn2_3> getTenantDiscriminatorColumns() {
- return this.tenantDiscriminatorColumnContainer.getContextElements();
- }
-
- public int getTenantDiscriminatorColumnsSize() {
- return this.tenantDiscriminatorColumnContainer.getContextElementsSize();
- }
-
- public boolean hasTenantDiscriminatorColumns() {
- return this.getTenantDiscriminatorColumnsSize() != 0;
- }
-
- public OrmTenantDiscriminatorColumn2_3 getTenantDiscriminatorColumn(int index) {
- return this.tenantDiscriminatorColumnContainer.getContextElement(index);
- }
-
- public OrmTenantDiscriminatorColumn2_3 addTenantDiscriminatorColumn() {
- return this.addTenantDiscriminatorColumn(this.getTenantDiscriminatorColumnsSize());
- }
-
- public OrmTenantDiscriminatorColumn2_3 addTenantDiscriminatorColumn(int index) {
- XmlTenantDiscriminatorColumn xmlJoinColumn = this.buildXmlTenantDiscriminatorColumn();
- OrmTenantDiscriminatorColumn2_3 joinColumn = this.tenantDiscriminatorColumnContainer.addContextElement(index, xmlJoinColumn);
- this.getXmlDefaultsForUpdate().getTenantDiscriminatorColumns().add(index, xmlJoinColumn);
- return joinColumn;
- }
-
- protected XmlTenantDiscriminatorColumn buildXmlTenantDiscriminatorColumn() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn();
- }
-
- public void removeTenantDiscriminatorColumn(OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.removeTenantDiscriminatorColumn(this.tenantDiscriminatorColumnContainer.indexOfContextElement(tenantDiscriminatorColumn));
- }
-
- public void removeTenantDiscriminatorColumn(int index) {
- this.tenantDiscriminatorColumnContainer.removeContextElement(index);
- this.getXmlDefaults().getTenantDiscriminatorColumns().remove(index);
- }
-
- public void moveTenantDiscriminatorColumn(int targetIndex, int sourceIndex) {
- this.tenantDiscriminatorColumnContainer.moveContextElement(targetIndex, sourceIndex);
- this.getXmlDefaults().getTenantDiscriminatorColumns().move(targetIndex, sourceIndex);
- }
-
- protected void syncTenantDiscriminatorColumns() {
- this.tenantDiscriminatorColumnContainer.synchronizeWithResourceModel();
- }
-
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getXmlTenantDiscriminatorColumns() {
- if (getXmlDefaults() == null) {
- return EmptyListIterable.instance();
- }
- // clone to reduce chance of concurrency problems
- return new LiveCloneListIterable<XmlTenantDiscriminatorColumn_2_3>(this.getXmlDefaults().getTenantDiscriminatorColumns());
- }
-
- /**
- * tenant discriminator column container
- */
- protected class TenantDiscriminatorColumnContainer
- extends ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3>
- {
- @Override
- protected String getContextElementsPropertyName() {
- return TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
- @Override
- protected OrmTenantDiscriminatorColumn2_3 buildContextElement(XmlTenantDiscriminatorColumn_2_3 resourceElement) {
- return OrmEclipseLinkPersistenceUnitDefaults.this.buildTenantDiscriminatorColumn(resourceElement);
- }
- @Override
- protected ListIterable<XmlTenantDiscriminatorColumn_2_3> getResourceElements() {
- return OrmEclipseLinkPersistenceUnitDefaults.this.getXmlTenantDiscriminatorColumns();
- }
- @Override
- protected XmlTenantDiscriminatorColumn_2_3 getResourceElement(OrmTenantDiscriminatorColumn2_3 contextElement) {
- return contextElement.getXmlColumn();
- }
- }
-
- protected OrmReadOnlyTenantDiscriminatorColumn2_3.Owner buildTenantDiscriminatorColumnOwner() {
- return new TenantDiscriminatorColumnOwner();
- }
-
- protected OrmTenantDiscriminatorColumn2_3 buildTenantDiscriminatorColumn(XmlTenantDiscriminatorColumn_2_3 xmlTenantDiscriminatorColumn) {
- return new EclipseLinkOrmTenantDiscriminatorColumn2_3(this, this.tenantDiscriminatorColumnOwner, xmlTenantDiscriminatorColumn);
- }
-
- protected ContextListContainer<OrmTenantDiscriminatorColumn2_3, XmlTenantDiscriminatorColumn_2_3> buildTenantDiscriminatorColumnContainer() {
- TenantDiscriminatorColumnContainer container = new TenantDiscriminatorColumnContainer();
- container.initialize();
- return container;
- }
-
-
- // ********** OrmReadOnlyTenantDiscriminatorColumn.Owner implementation **********
-
- protected class TenantDiscriminatorColumnOwner
- implements OrmReadOnlyTenantDiscriminatorColumn2_3.Owner
- {
-
- public String getDefaultContextPropertyName() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_CONTEXT_PROPERTY;
- }
-
- public boolean getDefaultPrimaryKey() {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_PRIMARY_KEY;
- }
-
- public int getDefaultLength() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_LENGTH;
- }
-
- public DiscriminatorType getDefaultDiscriminatorType() {
- return ReadOnlyNamedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE;
- }
-
- /**
- * No default table name in the context of the persistence unit defaults
- */
- public String getDefaultTableName() {
- return null;
- }
-
- public String getDefaultColumnName(ReadOnlyNamedColumn column) {
- return ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME;
- }
-
- /**
- * No table in the context of the persistence unit defaults
- */
- public Table resolveDbTable(String tableName) {
- return null;
- }
-
- public Iterable<String> getCandidateTableNames() {
- return EmptyIterable.instance();
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- /**
- * no column validation can be done in the context of the persistence unit defaults
- */
- public JptValidator buildColumnValidator(ReadOnlyNamedColumn column, NamedColumnTextRangeResolver textRangeResolver) {
- return JptValidator.Null.instance();
- }
-
- public TextRange getValidationTextRange() {
- return OrmEclipseLinkPersistenceUnitDefaults.this.getValidationTextRange();
- }
- }
-
-
- //*************** get method *****************
-
- public String getGetMethod() {
- return this.getSpecifiedGetMethod();
- }
-
- public String getDefaultGetMethod() {
- return null;
- }
-
- public String getSpecifiedGetMethod() {
- return this.specifiedGetMethod;
- }
-
- public void setSpecifiedGetMethod(String getMethod) {
- if (this.valuesAreDifferent(this.specifiedGetMethod, getMethod)) {
- XmlAccessMethods xmlAccessMethods = this.getXmlAccessMethodsForUpdate();
- this.setSpecifiedGetMethod_(getMethod);
- xmlAccessMethods.setGetMethod(getMethod);
- this.removeXmlAccessMethodsIfUnset();
- }
- }
-
- protected void setSpecifiedGetMethod_(String getMethod) {
- String old = this.specifiedGetMethod;
- this.specifiedGetMethod = getMethod;
- this.firePropertyChanged(SPECIFIED_GET_METHOD_PROPERTY, old, getMethod);
- }
-
- protected String buildSpecifiedGetMethod() {
- XmlAccessMethods accessMethods = this.getXmlAccessMethods();
- return accessMethods != null ? accessMethods.getGetMethod() : null;
- }
-
-
- //*************** set method *****************
-
- public String getSetMethod() {
- return this.getSpecifiedSetMethod();
- }
-
- public String getDefaultSetMethod() {
- return null;
- }
-
- public String getSpecifiedSetMethod() {
- return this.specifiedSetMethod;
- }
-
- public void setSpecifiedSetMethod(String setMethod) {
- if (this.valuesAreDifferent(this.specifiedSetMethod, setMethod)) {
- XmlAccessMethods xmlAccessMethods = this.getXmlAccessMethodsForUpdate();
- this.setSpecifiedSetMethod_(setMethod);
- xmlAccessMethods.setSetMethod(setMethod);
- this.removeXmlAccessMethodsIfUnset();
- }
- }
-
- protected void setSpecifiedSetMethod_(String setMethod) {
- String old = this.specifiedSetMethod;
- this.specifiedSetMethod = setMethod;
- this.firePropertyChanged(SPECIFIED_SET_METHOD_PROPERTY, old, setMethod);
- }
-
- protected String buildSpecifiedSetMethod() {
- XmlAccessMethods accessMethods = this.getXmlAccessMethods();
- return accessMethods != null ? accessMethods.getSetMethod() : null;
- }
-
-
- //*************** XML access methods *****************
-
- protected XmlAccessMethods getXmlAccessMethods() {
- XmlPersistenceUnitDefaults xmlDefaults = getXmlDefaults();
- return xmlDefaults != null ? getXmlDefaults().getAccessMethods() : null;
- }
-
- /**
- * Build the XML access methods (and XML defaults and XML metadata if necessary) if it does not exist.
- */
- protected XmlAccessMethods getXmlAccessMethodsForUpdate() {
- XmlPersistenceUnitDefaults xmlDefaults = this.getXmlDefaultsForUpdate();
- XmlAccessMethods xmlAccessMethods = xmlDefaults.getAccessMethods();
- return (xmlAccessMethods != null) ? xmlAccessMethods : this.buildXmlAccessMethods();
- }
-
- protected XmlAccessMethods buildXmlAccessMethods() {
- XmlAccessMethods xmlAccessMethods = this.buildXmlAccessMethods_();
- this.getXmlDefaults().setAccessMethods(xmlAccessMethods);
- return xmlAccessMethods;
- }
-
- protected XmlAccessMethods buildXmlAccessMethods_() {
- return EclipseLinkOrmFactory.eINSTANCE.createXmlAccessMethods();
- }
-
- /**
- * clear the XML access methods (and the XML defaults and XML metadata) if appropriate
- */
- protected void removeXmlAccessMethodsIfUnset() {
- if (this.getXmlAccessMethods().isUnset()) {
- this.getXmlDefaults().setAccessMethods(null);
- this.removeXmlDefaultsIfUnset();
- }
- }
-
- // ********** completion proposals **********
-
- @Override
- public Iterable<String> getXmlCompletionProposals(int pos) {
- Iterable<String> result = super.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- for (OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn : this.getTenantDiscriminatorColumns()) {
- result = tenantDiscriminatorColumn.getXmlCompletionProposals(pos);
- if (result != null) {
- return result;
- }
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitMetadata.java
deleted file mode 100644
index c80019d987..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistenceUnitMetadata.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.AbstractOrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata;
-
-/**
- * <code>eclipselink orm.xml</code> file
- * <br>
- * <code>persistence-unit-metadata</code> element
- */
-public class OrmEclipseLinkPersistenceUnitMetadata
- extends AbstractOrmPersistenceUnitMetadata
-{
-
- public OrmEclipseLinkPersistenceUnitMetadata(EntityMappings parent) {
- super(parent);
- }
-
- @Override
- public EclipseLinkPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return (EclipseLinkPersistenceUnitDefaults) super.getPersistenceUnitDefaults();
- }
-
- @Override
- protected XmlPersistenceUnitMetadata buildXmlPersistenceUnitMetadata_() {
- return EmfTools.create(
- this.getResourceNodeFactory(),
- EclipseLinkOrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata(),
- XmlPersistenceUnitMetadata.class
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java
deleted file mode 100644
index b95dd6f0e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPersistentAttribute.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.JptValidator;
-import org.eclipse.jpt.jpa.core.internal.context.orm.SpecifiedOrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessMethodsHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.EclipseLinkPersistentAttributeValidator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping;
-
-/**
- * EclipseLink
- * <code>orm.xml</code> persistent attribute
- */
-public class OrmEclipseLinkPersistentAttribute
- extends SpecifiedOrmPersistentAttribute
- implements EclipseLinkAccessMethodsHolder
-{
- //TODO defaults from the persistentType if the access is VIRTUAL
- protected String specifiedGetMethod;
- protected String specifiedSetMethod;
-
- public OrmEclipseLinkPersistentAttribute(OrmPersistentType parent, XmlAttributeMapping xmlMapping) {
- super(parent, xmlMapping);
- this.specifiedGetMethod = this.buildSpecifiedGetMethod();
- this.specifiedSetMethod = this.buildSpecifiedSetMethod();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedGetMethod_(this.buildSpecifiedGetMethod());
- this.setSpecifiedSetMethod_(this.buildSpecifiedSetMethod());
- }
-
- //*************** get method *****************
-
- public String getGetMethod() {
- String specifiedGetMethod = this.getSpecifiedGetMethod();
- return (specifiedGetMethod != null) ? specifiedGetMethod : this.getDefaultGetMethod();
- }
-
- public String getDefaultGetMethod() {
- return DEFAULT_GET_METHOD;
- }
-
- public String getSpecifiedGetMethod() {
- return this.specifiedGetMethod;
- }
-
- public void setSpecifiedGetMethod(String getMethod) {
- this.setSpecifiedGetMethod_(getMethod);
- this.getXmlAccessMethods().setGetMethod(getMethod);
- }
-
- protected void setSpecifiedGetMethod_(String getMethod) {
- String old = this.specifiedGetMethod;
- this.specifiedGetMethod = getMethod;
- this.firePropertyChanged(SPECIFIED_GET_METHOD_PROPERTY, old, getMethod);
- }
-
- protected String buildSpecifiedGetMethod() {
- XmlAccessMethods xmlAccessMethods = getXmlAccessMethods();
- return xmlAccessMethods != null ? xmlAccessMethods.getGetMethod() : null;
- }
-
- protected XmlAccessMethodsHolder getXmlAccessMethodsHolder() {
- return this.getXmlAttributeMapping();
- }
-
- protected XmlAccessMethods getXmlAccessMethods() {
- return getXmlAccessMethodsHolder().getAccessMethods();
- }
-
-
- //*************** set method *****************
- public String getSetMethod() {
- String specifiedSetMethod = this.getSpecifiedSetMethod();
- return (specifiedSetMethod != null) ? specifiedSetMethod : this.getDefaultSetMethod();
- }
-
- public String getDefaultSetMethod() {
- return DEFAULT_SET_METHOD;
- }
-
- public String getSpecifiedSetMethod() {
- return this.specifiedSetMethod;
- }
- public void setSpecifiedSetMethod(String setMethod) {
- this.setSpecifiedSetMethod_(setMethod);
- this.getXmlAccessMethods().setSetMethod(setMethod);
- }
-
- protected void setSpecifiedSetMethod_(String setMethod) {
- String old = this.specifiedSetMethod;
- this.specifiedSetMethod = setMethod;
- this.firePropertyChanged(SPECIFIED_SET_METHOD_PROPERTY, old, setMethod);
- }
-
- protected String buildSpecifiedSetMethod() {
- XmlAccessMethods xmlAccessMethods = getXmlAccessMethods();
- return xmlAccessMethods != null ? xmlAccessMethods.getSetMethod() : null;
- }
-
-
- @Override
- protected JavaPersistentAttribute getCachedJavaAttribute() {
- if (this.getAccess() == EclipseLinkAccessType.VIRTUAL) {
- //if VIRTUAL we will always have to build and cache the 'javaAttribute'
- //we clear out the cached 'javaAttribute in setSpecifiedAccess_() and setDefaultAccess_()
- if (this.cachedJavaPersistentAttribute == null) {
- this.cachedJavaPersistentAttribute = new VirtualJavaPersistentAttribute(this.getParent(), this.getXmlAttributeMapping());
- }
- return this.cachedJavaPersistentAttribute;
- }
- return super.getCachedJavaAttribute();
- }
-
- @Override
- protected XmlAttributeMapping getXmlAttributeMapping() {
- return (XmlAttributeMapping) super.getXmlAttributeMapping();
- }
-
- @Override
- protected JptValidator buildAttibuteValidator() {
- return new EclipseLinkPersistentAttributeValidator(this, buildTextRangeResolver());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java
deleted file mode 100644
index 4b5d9640b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkPrivateOwned.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned;
-
-public class OrmEclipseLinkPrivateOwned
- extends AbstractOrmXmlContextNode
- implements EclipseLinkPrivateOwned
-{
- protected boolean privateOwned;
-
-
- public OrmEclipseLinkPrivateOwned(OrmAttributeMapping parent) {
- super(parent);
- this.privateOwned = this.buildPrivateOwned();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setPrivateOwned_(this.buildPrivateOwned());
- }
-
-
- // ********** private owned **********
-
- public boolean isPrivateOwned() {
- return this.privateOwned;
- }
-
- public void setPrivateOwned(boolean privateOwned) {
- this.setPrivateOwned_(privateOwned);
- this.getXmlPrivateOwned().setPrivateOwned(privateOwned);
- }
-
- protected void setPrivateOwned_(boolean privateOwned) {
- boolean old = this.privateOwned;
- this.privateOwned = privateOwned;
- this.firePropertyChanged(PRIVATE_OWNED_PROPERTY, old, privateOwned);
- }
-
- protected boolean buildPrivateOwned() {
- return this.getXmlPrivateOwned().isPrivateOwned();
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmAttributeMapping getParent() {
- return (OrmAttributeMapping) super.getParent();
- }
-
- protected OrmAttributeMapping getAttributeMapping() {
- return this.getParent();
- }
-
- protected XmlAttributeMapping getXmlAttributeMapping() {
- return this.getAttributeMapping().getXmlAttributeMapping();
- }
-
- protected XmlPrivateOwned getXmlPrivateOwned() {
- return (XmlPrivateOwned) this.getXmlAttributeMapping();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getAttributeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlPrivateOwned().getPrivateOwnedTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java
deleted file mode 100644
index 35ecc5d959..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkReadOnly.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmXmlContextNode;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkNonEmbeddableTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly;
-
-public class OrmEclipseLinkReadOnly
- extends AbstractOrmXmlContextNode
- implements EclipseLinkReadOnly
-{
- protected Boolean specifiedReadOnly;
- protected boolean defaultReadOnly;
-
-
- public OrmEclipseLinkReadOnly(OrmEclipseLinkNonEmbeddableTypeMapping parent) {
- super(parent);
- this.specifiedReadOnly = this.buildSpecifiedReadOnly();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setSpecifiedReadOnly_(this.buildSpecifiedReadOnly());
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultReadOnly(this.buildDefaultReadOnly());
- }
-
-
- // ********** read-only **********
-
- public boolean isReadOnly() {
- return (this.specifiedReadOnly != null) ? this.specifiedReadOnly.booleanValue() : this.defaultReadOnly;
- }
-
- public Boolean getSpecifiedReadOnly() {
- return this.specifiedReadOnly;
- }
-
- public void setSpecifiedReadOnly(Boolean readOnly) {
- this.setSpecifiedReadOnly_(readOnly);
- this.getXmlReadOnly().setReadOnly(readOnly);
- }
-
- protected void setSpecifiedReadOnly_(Boolean readOnly) {
- Boolean old = this.specifiedReadOnly;
- this.specifiedReadOnly = readOnly;
- this.firePropertyChanged(SPECIFIED_READ_ONLY_PROPERTY, old, readOnly);
- }
-
- protected Boolean buildSpecifiedReadOnly() {
- return this.getXmlReadOnly().getReadOnly();
- }
-
- public boolean isDefaultReadOnly() {
- return this.defaultReadOnly;
- }
-
- protected void setDefaultReadOnly(boolean readOnly) {
- boolean old = this.defaultReadOnly;
- this.defaultReadOnly = readOnly;
- this.firePropertyChanged(DEFAULT_READ_ONLY_PROPERTY, old, readOnly);
- }
-
- protected boolean buildDefaultReadOnly() {
- EclipseLinkReadOnly javaReadOnly = this.getJavaReadOnlyForDefaults();
- return (javaReadOnly != null) ? javaReadOnly.isReadOnly() : DEFAULT_READ_ONLY;
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmEclipseLinkNonEmbeddableTypeMapping getParent() {
- return (OrmEclipseLinkNonEmbeddableTypeMapping) super.getParent();
- }
-
- protected OrmEclipseLinkNonEmbeddableTypeMapping getTypeMapping() {
- return this.getParent();
- }
-
- protected XmlTypeMapping getXmlTypeMapping() {
- return this.getTypeMapping().getXmlTypeMapping();
- }
-
- protected XmlReadOnly getXmlReadOnly() {
- return (XmlReadOnly) this.getXmlTypeMapping();
- }
-
- protected JavaEclipseLinkNonEmbeddableTypeMapping getJavaTypeMappingForDefaults() {
- return this.getTypeMapping().getJavaTypeMappingForDefaults();
- }
-
- protected EclipseLinkReadOnly getJavaReadOnlyForDefaults() {
- JavaEclipseLinkNonEmbeddableTypeMapping javaTypeMapping = this.getJavaTypeMappingForDefaults();
- return (javaTypeMapping == null) ? null : javaTypeMapping.getReadOnly();
- }
-
-
- // ********** validation **********
-
- public TextRange getValidationTextRange() {
- TextRange textRange = this.getXmlValidationTextRange();
- return (textRange != null) ? textRange : this.getTypeMapping().getValidationTextRange();
- }
-
- protected TextRange getXmlValidationTextRange() {
- return this.getXmlReadOnly().getReadOnlyTextRange();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java
deleted file mode 100644
index 5ea9b0b87c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructConverter.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-
-public class OrmEclipseLinkStructConverter
- extends OrmEclipseLinkConverterClassConverter<XmlStructConverter>
- implements EclipseLinkStructConverter
-{
- public OrmEclipseLinkStructConverter(XmlContextNode parent, XmlStructConverter xmlConverter) {
- super(parent, xmlConverter);
- }
-
-
- // ********** converter class **********
-
- @Override
- protected String getXmlConverterClass() {
- return this.xmlConverter.getConverter();
- }
-
- @Override
- protected void setXmlConverterClass(String converterClass) {
- this.xmlConverter.setConverter(converterClass);
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkStructConverter> getType() {
- return EclipseLinkStructConverter.class;
- }
-
-
- // ********** refactoring **********
-
- @Override
- protected ReplaceEdit createRenameEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameEdit(originalType, newName);
- }
-
- @Override
- protected ReplaceEdit createRenamePackageEdit(String newName) {
- return this.xmlConverter.createRenamePackageEdit(newName);
- }
-
-
- // ********** validation **********
-
- @Override
- protected String getEclipseLinkConverterInterface() {
- return ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected String getEclipseLinkConverterInterfaceErrorMessage() {
- return EclipseLinkJpaValidationMessages.STRUCT_CONVERTER_CLASS_IMPLEMENTS_STRUCT_CONVERTER;
- }
-
- @Override
- protected TextRange getXmlConverterClassTextRange() {
- return this.xmlConverter.getConverterClassTextRange();
- }
-
- // ********** metadata conversion **********
-
- public void convertFrom(JavaEclipseLinkStructConverter javaConverter) {
- super.convertFrom(javaConverter);
- this.setConverterClass(javaConverter.getConverterClass());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3.java
deleted file mode 100644
index eb9be0e741..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructureMapping2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure;
-
-public class OrmEclipseLinkStructureMapping2_3
- extends AbstractOrmAttributeMapping<XmlStructure>
- implements EclipseLinkStructureMapping2_3
-{
- public OrmEclipseLinkStructureMapping2_3(OrmPersistentAttribute parent, XmlStructure xmlMapping) {
- super(parent, xmlMapping);
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
-
- // ********** misc **********
-
- public String getKey() {
- return EclipseLinkMappingKeys.STRUCTURE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public int getXmlSequence() {
- return 100;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public void addXmlAttributeMappingTo(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getStructures().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getStructures().remove(this.xmlAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3Definition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3Definition.java
deleted file mode 100644
index 57c1934e7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkStructureMapping2_3Definition.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure;
-
-public class OrmEclipseLinkStructureMapping2_3Definition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkStructureMapping2_3Definition INSTANCE =
- new OrmEclipseLinkStructureMapping2_3Definition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEclipseLinkStructureMapping2_3Definition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.STRUCTURE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlStructure(),
- XmlStructure.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return new OrmEclipseLinkStructureMapping2_3(parent, (XmlStructure) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java
deleted file mode 100644
index 8bb804af28..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMapping.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation;
-
-public class OrmEclipseLinkTransformationMapping
- extends AbstractOrmAttributeMapping<XmlTransformation>
- implements EclipseLinkTransformationMapping
-{
- public OrmEclipseLinkTransformationMapping(OrmPersistentAttribute parent, XmlTransformation xmlMapping) {
- super(parent, xmlMapping);
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
-
- // ********** misc **********
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public int getXmlSequence() {
- return 85;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public void addXmlAttributeMappingTo(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getTransformations().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getTransformations().remove(this.xmlAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java
deleted file mode 100644
index aec93cdb79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTransformationMappingDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation;
-
-public class OrmEclipseLinkTransformationMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkTransformationMappingDefinition INSTANCE =
- new OrmEclipseLinkTransformationMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEclipseLinkTransformationMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTransformation(),
- XmlTransformation.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildOrmEclipseLinkTransformationMapping(parent, (XmlTransformation) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java
deleted file mode 100644
index a2e753ba40..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkTypeConverter.java
+++ /dev/null
@@ -1,269 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SingleElementIterable;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.text.edits.ReplaceEdit;
-
-public class OrmEclipseLinkTypeConverter
- extends OrmEclipseLinkConverter<XmlTypeConverter>
- implements EclipseLinkTypeConverter
-{
- private String dataType;
- private String fullyQualifiedDataType;
-
- private String objectType;
- private String fullyQualifiedObjectType;
-
-
- public OrmEclipseLinkTypeConverter(XmlContextNode parent, XmlTypeConverter xmlConverter) {
- super(parent, xmlConverter);
- this.dataType = xmlConverter.getDataType();
- this.objectType = xmlConverter.getObjectType();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.setDataType_(this.xmlConverter.getDataType());
- this.setObjectType_(this.xmlConverter.getObjectType());
- }
-
- @Override
- public void update() {
- super.update();
- this.setFullyQualifiedDataType(this.buildFullyQualifiedDataType());
- this.setFullyQualifiedObjectType(this.buildFullyQualifiedObjectType());
- }
-
-
- // ********** data type **********
-
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- this.setDataType_(dataType);
- this.xmlConverter.setDataType(dataType);
- }
-
- protected void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
- public String getFullyQualifiedDataType() {
- return this.fullyQualifiedDataType;
- }
-
- protected void setFullyQualifiedDataType(String dataType) {
- String old = this.fullyQualifiedDataType;
- this.fullyQualifiedDataType = dataType;
- this.firePropertyChanged(FULLY_QUALIFIED_DATA_TYPE_PROPERTY, old, dataType);
- }
-
- protected String buildFullyQualifiedDataType() {
- return this.getMappingFileRoot().getFullyQualifiedName(this.dataType);
- }
-
- protected boolean dataTypeIsFor(String typeName) {
- return this.typeIsFor(this.getDataTypeJavaResourceType(), typeName);
- }
-
- protected boolean dataTypeIsIn(IPackageFragment packageFragment) {
- return this.typeIsIn(this.getDataTypeJavaResourceType(), packageFragment);
- }
-
- protected JavaResourceAbstractType getDataTypeJavaResourceType() {
- if (this.fullyQualifiedDataType == null) {
- return null;
- }
- return this.getJpaProject().getJavaResourceType(this.fullyQualifiedDataType);
- }
-
- // ********** object type **********
-
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- this.setObjectType_(objectType);
- this.xmlConverter.setObjectType(objectType);
- }
-
- protected void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
- public String getFullyQualifiedObjectType() {
- return this.fullyQualifiedObjectType;
- }
-
- protected void setFullyQualifiedObjectType(String objectType) {
- String old = this.fullyQualifiedObjectType;
- this.fullyQualifiedObjectType = objectType;
- this.firePropertyChanged(FULLY_QUALIFIED_OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
- protected String buildFullyQualifiedObjectType() {
- return this.getMappingFileRoot().getFullyQualifiedName(this.objectType);
- }
-
- protected boolean objectTypeIsFor(String typeName) {
- return this.typeIsFor(this.getObjectTypeJavaResourceType(), typeName);
- }
-
- protected boolean objectTypeIsIn(IPackageFragment packageFragment) {
- return this.typeIsIn(this.getObjectTypeJavaResourceType(), packageFragment);
- }
-
- protected JavaResourceAbstractType getObjectTypeJavaResourceType() {
- if (this.fullyQualifiedObjectType == null) {
- return null;
- }
- return this.getJpaProject().getJavaResourceType(this.fullyQualifiedObjectType);
- }
-
-
- // ********** refactoring **********
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameDataTypeEdits(originalType, newName),
- this.createRenameObjectTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameDataTypeEdits(IType originalType, String newName) {
- return this.dataTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameDataTypeEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameDataTypeEdit(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypeEdits(IType originalType, String newName) {
- return this.objectTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypeEdit(originalType, newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameObjectTypeEdit(IType originalType, String newName) {
- return this.xmlConverter.createRenameObjectTypeEdit(originalType, newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- this.createMoveDataTypeEdits(originalType, newPackage),
- this.createMoveObjectTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createMoveDataTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.dataTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameDataTypePackageEdit(String newName) {
- return this.xmlConverter.createRenameDataTypePackageEdit(newName);
- }
-
- protected Iterable<ReplaceEdit> createMoveObjectTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.objectTypeIsFor(originalType.getFullyQualifiedName('.')) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypePackageEdit(newPackage.getElementName())) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected ReplaceEdit createRenameObjectTypePackageEdit(String newName) {
- return this.xmlConverter.createRenameObjectTypePackageEdit(newName);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createRenameDataTypePackageEdits(originalPackage, newName),
- this.createRenameObjectTypePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createRenameDataTypePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.dataTypeIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameDataTypePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- protected Iterable<ReplaceEdit> createRenameObjectTypePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.objectTypeIsIn(originalPackage) ?
- new SingleElementIterable<ReplaceEdit>(this.createRenameObjectTypePackageEdit(newName)) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
-
- // ********** misc **********
-
- public Class<EclipseLinkTypeConverter> getType() {
- return EclipseLinkTypeConverter.class;
- }
-
- protected boolean typeIsFor(JavaResourceAbstractType type, String typeName) {
- return (type != null) && type.getQualifiedName().equals(typeName);
- }
-
- protected boolean typeIsIn(JavaResourceAbstractType type, IPackageFragment packageFragment) {
- return (type != null) && type.isIn(packageFragment);
- }
-
- // ********** validation *********
-
- @Override
- public boolean isEquivalentTo(JpaNamedContextNode node) {
- return super.isEquivalentTo(node)
- && this.isEquivalentTo((EclipseLinkTypeConverter) node);
- }
-
- protected boolean isEquivalentTo(EclipseLinkTypeConverter converter) {
- return Tools.valuesAreEqual(this.fullyQualifiedDataType, converter.getFullyQualifiedDataType()) &&
- Tools.valuesAreEqual(this.fullyQualifiedObjectType, converter.getFullyQualifiedObjectType());
- }
-
- // ********** metadata conversion **********
-
- public void convertFrom(JavaEclipseLinkTypeConverter javaConverter) {
- super.convertFrom(javaConverter);
- this.setDataType(javaConverter.getFullyQualifiedDataType());
- this.setObjectType(javaConverter.getFullyQualifiedObjectType());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java
deleted file mode 100644
index 0e7351cfca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMapping.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne;
-
-public class OrmEclipseLinkVariableOneToOneMapping
- extends AbstractOrmAttributeMapping<XmlVariableOneToOne>
- implements EclipseLinkVariableOneToOneMapping
-{
- public OrmEclipseLinkVariableOneToOneMapping(OrmPersistentAttribute parent, XmlVariableOneToOne xmlMapping) {
- super(parent, xmlMapping);
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public int getXmlSequence() {
- return 65;
- }
-
- public void initializeOn(OrmAttributeMapping newMapping) {
- newMapping.initializeFromOrmAttributeMapping(this);
- }
-
- public void addXmlAttributeMappingTo(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getVariableOneToOnes().add(this.xmlAttributeMapping);
- }
-
- public void removeXmlAttributeMappingFrom(org.eclipse.jpt.jpa.core.resource.orm.Attributes xmlAttributes) {
- ((Attributes) xmlAttributes).getVariableOneToOnes().remove(this.xmlAttributeMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java
deleted file mode 100644
index 308eb723ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVariableOneToOneMappingDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.xml.EmfTools;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne;
-
-public class OrmEclipseLinkVariableOneToOneMappingDefinition
- implements OrmAttributeMappingDefinition
-{
- // singleton
- private static final OrmEclipseLinkVariableOneToOneMappingDefinition INSTANCE =
- new OrmEclipseLinkVariableOneToOneMappingDefinition();
-
-
- /**
- * Return the singleton
- */
- public static OrmAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmEclipseLinkVariableOneToOneMappingDefinition() {
- super();
- }
-
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public XmlAttributeMapping buildResourceMapping(EFactory factory) {
- return EmfTools.create(
- factory,
- EclipseLinkOrmPackage.eINSTANCE.getXmlVariableOneToOne(),
- XmlVariableOneToOne.class);
- }
-
- public OrmAttributeMapping buildContextMapping(
- OrmPersistentAttribute parent,
- XmlAttributeMapping resourceMapping,
- OrmXmlContextNodeFactory factory) {
- return ((EclipseLinkOrmXmlContextNodeFactory) factory).
- buildOrmEclipseLinkVariableOneToOneMapping(parent, (XmlVariableOneToOne) resourceMapping);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java
deleted file mode 100644
index e243c6ecaf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/OrmEclipseLinkVersionMapping.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.List;
-
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmConverter;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.MappingTools;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractOrmVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.DefaultEclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaValidationMessages;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class OrmEclipseLinkVersionMapping
- extends AbstractOrmVersionMapping<XmlVersion>
- implements
- EclipseLinkVersionMapping,
- EclipseLinkOrmConvertibleMapping,
- OrmEclipseLinkConverterContainer.Owner
-{
- protected final OrmEclipseLinkMutable mutable;
-
- protected final OrmEclipseLinkConverterContainer converterContainer;
-
-
- public OrmEclipseLinkVersionMapping(OrmPersistentAttribute parent, XmlVersion xmlMapping) {
- super(parent, xmlMapping);
- this.mutable = new OrmEclipseLinkMutable(this);
- this.converterContainer = this.buildConverterContainer();
- }
-
-
- // ********** synchronize/update **********
-
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- this.mutable.synchronizeWithResourceModel();
- this.converterContainer.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.mutable.update();
- this.converterContainer.update();
- }
-
-
- // ********** attribute type **********
-
- @Override
- protected String buildSpecifiedAttributeType() {
- return this.xmlAttributeMapping.getAttributeType();
- }
-
- @Override
- protected void setSpecifiedAttributeTypeInXml(String attributeType) {
- this.xmlAttributeMapping.setAttributeType(attributeType);
- }
-
-
- // ********** mutable **********
-
- public EclipseLinkMutable getMutable() {
- return this.mutable;
- }
-
- // ********** converters **********
-
- public OrmEclipseLinkConverterContainer getConverterContainer() {
- return this.converterContainer;
- }
-
- protected OrmEclipseLinkConverterContainer buildConverterContainer() {
- return new OrmEclipseLinkConverterContainerImpl(this, this, this.xmlAttributeMapping);
- }
-
- public int getNumberSupportedConverters() {
- return 1;
- }
-
-
- // ********** converter adapters **********
-
- /**
- * put the EclipseLink convert adapter first - this is the order EclipseLink searches
- */
- @Override
- protected Iterable<OrmConverter.Adapter> getConverterAdapters() {
- return new CompositeIterable<OrmConverter.Adapter>(OrmEclipseLinkConvert.Adapter.instance(), super.getConverterAdapters());
- }
-
-
- //************ refactoring ************
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- super.createMoveTypeEdits(originalType, newPackage),
- this.converterContainer.createMoveTypeEdits(originalType, newPackage)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenamePackageEdits(originalPackage, newName),
- this.converterContainer.createRenamePackageEdits(originalPackage, newName)
- );
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- super.createRenameTypeEdits(originalType, newName),
- this.converterContainer.createRenameTypeEdits(originalType, newName)
- );
- }
-
-
- // ********** validation **********
-
- @Override
- public void validate(List<IMessage> messages, IReporter reporter) {
- super.validate(messages, reporter);
- // TODO mutable validation
- }
-
- @Override
- protected void validateAttributeType(List<IMessage> messages) {
- //TODO copied from OrmEclipseLinkBasicMapping
- if (this.isVirtualAccess()) {
- if (StringTools.stringIsEmpty(this.getAttributeType())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_NO_ATTRIBUTE_TYPE_SPECIFIED,
- new String[] {this.getName()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- if (MappingTools.typeIsBasic(this.getJavaProject(), this.getFullyQualifiedAttributeType())) {
- return;
- }
- IType jdtType = JDTTools.findType(this.getJavaProject(), this.getFullyQualifiedAttributeType());
- if (jdtType == null && this.getResolvedAttributeType() == null) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_DOES_NOT_EXIST,
- new String[] {this.getFullyQualifiedAttributeType()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- return;
- }
- }
- if (!ArrayTools.contains(SUPPORTED_TYPE_NAMES, this.getAttributeType())) {
- messages.add(
- DefaultEclipseLinkJpaValidationMessages.buildMessage(
- IMessage.HIGH_SEVERITY,
- EclipseLinkJpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE,
- new String[] {this.getName()},
- this,
- this.getAttributeTypeTextRange()
- )
- );
- }
- }
-
- protected boolean isVirtualAccess() {
- return getPersistentAttribute().getAccess() == EclipseLinkAccessType.VIRTUAL;
- }
-
- protected TextRange getAttributeTypeTextRange() {
- return this.getValidationTextRange(this.xmlAttributeMapping.getAttributeTypeTextRange());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java
deleted file mode 100644
index 0076d351e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentAttribute.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.ClassName;
-import org.eclipse.jpt.common.utility.internal.iterables.ArrayIterable;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.CollectionMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.java.Accessor;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelField;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaPersistentAttribute2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping;
-
-public class VirtualJavaPersistentAttribute extends AbstractJavaJpaContextNode
- implements JavaPersistentAttribute2_0, JavaEclipseLinkPersistentAttribute
-{
- private final XmlAttributeMapping xmlAttributeMapping;
-
- private final JavaAttributeMapping attributeMapping;
-
- public VirtualJavaPersistentAttribute(OrmPersistentType parent, XmlAttributeMapping xmlAttributeMapping) {
- super(parent);
- this.xmlAttributeMapping = xmlAttributeMapping;
- this.attributeMapping = new GenericJavaNullAttributeMapping(this);
- }
-
- public XmlAttributeMapping getXmlAttributeMapping() {
- return this.xmlAttributeMapping;
- }
-
- public JavaAttributeMapping getMapping() {
- return this.attributeMapping;
- }
-
- public JavaAttributeMapping setMappingKey(String key) {
- throw new UnsupportedOperationException("cannot set anything on a virtual java persistent attribute"); //$NON-NLS-1$
- }
-
- public Accessor getAccessor() {
- return null;
- }
-
- public JavaResourceAttribute getResourceAttribute() {
- return null;
- }
-
- public boolean isFor(JavaResourceField resourceField) {
- return false;
- }
-
- public boolean isFor(JavaResourceMethod resourceGetter, JavaResourceMethod resourceSetter) {
- return false;
- }
-
- public boolean contains(int offset, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- public String getTypeName() {
- String typeName = this.xmlAttributeMapping.getAttributeType();
- return typeName == null ? null : this.getEntityMappings().getFullyQualifiedName(typeName);
- }
-
- public boolean typeIsBasic() {
- return false;//not valid for a default basic mapping, specified in orm.xml
- }
-
- public String getSingleReferenceTargetTypeName() {
- return null; //used for building default target entity/embeddable, must be specified in a virtual mapping
- }
-
- public String getMultiReferenceTargetTypeName() {
- return null; //used for building default target entity/target class, must be specified in a virtual mapping
- }
-
- public String getMultiReferenceMapKeyTypeName() {
- return null; //used for building default map key class, must be specified in a virtual mapping
- }
-
- public String getName() {
- return this.xmlAttributeMapping.getName();
- }
-
- public String getMappingKey() {
- return null;
- }
-
- public String getDefaultMappingKey() {
- return null;
- }
-
- public boolean isVirtual() {
- throw new UnsupportedOperationException("Owing orm persistent attribute is specified, this should not be called."); //$NON-NLS-1$
- }
-
- public JavaPersistentAttribute getJavaPersistentAttribute() {
- return this;
- }
-
-
- // ********** JpaStructureNode implementation **********
-
-
- public JpaStructureNode getStructureNode(int textOffset) {
- throw new UnsupportedOperationException("There is no resource for a virtual java persistent attribute"); //$NON-NLS-1$
- }
-
- public TextRange getSelectionTextRange() {
- throw new UnsupportedOperationException("There is no resource for a virtual java persistent attribute"); //$NON-NLS-1$
- }
-
- public ContextType getContextType() {
- throw new UnsupportedOperationException("There is no resource for a virtual java persistent attribute"); //$NON-NLS-1$
- }
-
- public Class<? extends JpaStructureNode> getType() {
- throw new UnsupportedOperationException("There is no resource for a virtual java persistent attribute"); //$NON-NLS-1$
- }
-
- public void dispose() {
- throw new UnsupportedOperationException("There is no resource for a virtual java persistent attribute"); //$NON-NLS-1$
- }
-
- public AccessType getAccess() {
- return null;
- }
-
- public AccessType getSpecifiedAccess() {
- return null;
- }
-
- public void setSpecifiedAccess(AccessType newSpecifiedAccess) {
- throw new UnsupportedOperationException("cannot set anything on a virtual java persistent attribute"); //$NON-NLS-1$
- }
-
- public AccessType getDefaultAccess() {
- return null;
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- public boolean typeIsDateOrCalendar() {
- String typeName = this.getTypeName();
- if (typeName == null) {
- return false;
- }
- return JDTTools.typeIsSubType(this.getJavaProject(), typeName, DATE_TYPE_NAME)
- || JDTTools.typeIsSubType(this.getJavaProject(), typeName, CALENDAR_TYPE_NAME);
- }
-
- public boolean typeIsSerializable() {
- String typeName = this.getTypeName();
- if (typeName == null) {
- return false;
- }
- return JDTTools.typeIsSubType(this.getJavaProject(), typeName, JDTTools.SERIALIZABLE_CLASS_NAME);
- }
-
- public boolean typeIsValidForVariableOneToOne() {
- String typeName = this.getTypeName();
- if (typeName == null) {
- return false;
- }
- IType type = JDTTools.findType(getJavaProject(), typeName);
- try {
- return type != null &&
- type.isInterface() &&
- this.interfaceIsValidForVariableOneToOne(typeName);
- }
- catch (JavaModelException e) {
- JptJpaEclipseLinkCorePlugin.log(e);
- return false;
- }
- }
-
- protected boolean interfaceIsValidForVariableOneToOne(String interfaceName) {
- return ! this.interfaceIsInvalidForVariableOneToOne(interfaceName);
- }
-
- // TODO we could probably add more interfaces to this list...
- protected boolean interfaceIsInvalidForVariableOneToOne(String interfaceName) {
- return (interfaceName == null) ||
- this.typeIsContainer(interfaceName) ||
- interfaceName.equals("org.eclipse.persistence.indirection.ValueHolderInterface"); //$NON-NLS-1$
- }
-
- /**
- * return whether the specified type is one of the container
- * types allowed by the JPA spec
- */
- protected boolean typeIsContainer(String typeName) {
- return this.getJpaContainerDefinition(typeName).isContainer();
- }
-
-
- // ********** metamodel **********
-
- public String getMetamodelContainerFieldTypeName() {
- throw new UnsupportedOperationException("parent OrmPersistentAttribute implements this"); //$NON-NLS-1$
- }
-
- public String getMetamodelContainerFieldMapKeyTypeName() {
- throw new UnsupportedOperationException("parent OrmPersistentAttribute implements this"); //$NON-NLS-1$
- }
-
-
- public String getMetamodelTypeName() {
- String typeName = this.getTypeName();
- if (typeName == null) {
- return MetamodelField.DEFAULT_TYPE_NAME;
- }
- if (ClassName.isPrimitive(typeName)) {
- return ClassName.getWrapperClassName(typeName); // ???
- }
- return typeName;
- }
-
- public JpaContainerDefinition getJpaContainerDefinition() {
- // 'typeName' may include array brackets ("[]")
- // but not generic type arguments (e.g. "<java.lang.String>")
- return this.getJpaContainerDefinition(this.getTypeName());
- }
-
- //I don't think we should be doing this here, I think OrmAttributeMappings should be responsible for their own JpaContainerDefinition
- //Generic can just get it from the JavaPersistentAttribute
- /**
- * Return the JPA container definition corresponding to the specified type;
- * return a "null" definition if the specified type is not "assignable to" one of the
- * container types allowed by the JPA spec.
- */
- protected JpaContainerDefinition getJpaContainerDefinition(String typeName) {
- if (typeName != null) {
- for (JpaContainerDefinition definition : getJpaContainerDefinitions()) {
- if (definition.isAssignableFrom(typeName)) {
- return definition;
- }
- }
- }
- return JpaContainerDefinition.Null.instance();
- }
-
- protected Iterable<JpaContainerDefinition> getJpaContainerDefinitions() {
- return JPA_CONTAINER_DEFINITIONS;
- }
-
- protected static final JpaContainerDefinition[] JPA_CONTAINER_DEFINITION_ARRAY = new JpaContainerDefinition[] {
- new CollectionJpaContainerDefinition(java.util.Set.class, JPA2_0.SET_ATTRIBUTE),
- new CollectionJpaContainerDefinition(java.util.List.class, JPA2_0.LIST_ATTRIBUTE),
- new CollectionJpaContainerDefinition(java.util.Collection.class, JPA2_0.COLLECTION_ATTRIBUTE),
- new MapJpaContainerDefinition(java.util.Map.class, JPA2_0.MAP_ATTRIBUTE)
- };
-
- protected static final Iterable<JpaContainerDefinition> JPA_CONTAINER_DEFINITIONS = new ArrayIterable<JpaContainerDefinition>(JPA_CONTAINER_DEFINITION_ARRAY);
-
-
- /**
- * Abstract JPA container definition
- */
- protected abstract static class AbstractJpaContainerDefinition
- implements JpaContainerDefinition
- {
- protected final Class<?> containerClass;
- protected final String metamodelContainerFieldTypeName;
-
- protected AbstractJpaContainerDefinition(Class<?> containerClass, String metamodelContainerFieldTypeName) {
- super();
- if ((containerClass == null) || (metamodelContainerFieldTypeName == null)) {
- throw new NullPointerException();
- }
- this.containerClass = containerClass;
- this.metamodelContainerFieldTypeName = metamodelContainerFieldTypeName;
- }
-
- public boolean isAssignableFrom(String typeName) {
- try {
- return this.containerClass.isAssignableFrom(Class.forName(typeName));
- }
- catch (ClassNotFoundException e) {
- return false;
- }
- }
-
- public boolean isContainer() {
- return true;
- }
-
- public String getMetamodelContainerFieldTypeName() {
- return this.metamodelContainerFieldTypeName;
- }
-
- public String getMultiReferenceTargetTypeName(JavaResourceAttribute resourceAttribute) {
- throw new UnsupportedOperationException();
- }
-
- public String getMultiReferenceMapKeyTypeName(JavaResourceAttribute resourceAttribute) {
- throw new UnsupportedOperationException();
- }
- }
-
- /**
- * Collection JPA container definition
- */
- protected static class CollectionJpaContainerDefinition
- extends AbstractJpaContainerDefinition
- {
- protected CollectionJpaContainerDefinition(Class<?> collectionClass, String staticMetamodelTypeDeclarationTypeName) {
- super(collectionClass, staticMetamodelTypeDeclarationTypeName);
- }
-
- public String getMetamodelContainerFieldMapKeyTypeName(CollectionMapping mapping) {
- return null;
- }
-
- public boolean isMap() {
- return false;
- }
- }
-
- /**
- * Map JPA container definition
- */
- protected static class MapJpaContainerDefinition
- extends AbstractJpaContainerDefinition
- {
- protected MapJpaContainerDefinition(Class<?> mapClass, String staticMetamodelTypeDeclarationTypeName) {
- super(mapClass, staticMetamodelTypeDeclarationTypeName);
- }
-
- public String getMetamodelContainerFieldMapKeyTypeName(CollectionMapping mapping) {
- return mapping.getMetamodelFieldMapKeyTypeName();
- }
-
- public boolean isMap() {
- return true;
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public OrmPersistentType getParent() {
- return (OrmPersistentType) super.getParent();
- }
-
- public OrmPersistentType getOwningPersistentType() {
- return this.getParent();
- }
-
- public TypeMapping getOwningTypeMapping() {
- return this.getOwningPersistentType().getMapping();
- }
-
- protected EntityMappings getEntityMappings() {
- return (EntityMappings) getParent().getMappingFileRoot();
- }
-
- public String getPrimaryKeyColumnName() {
- throw new UnsupportedOperationException("Owing orm persistent attribute should handle, this should not be called."); //$NON-NLS-1$
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java
deleted file mode 100644
index 725fa84776..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/orm/VirtualJavaPersistentType.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm;
-
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.BodySourceWriter;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ChainIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaJpaContextNode;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.MetamodelSourceType;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaPersistentType2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping;
-import org.eclipse.wst.validation.internal.provisional.core.IMessage;
-import org.eclipse.wst.validation.internal.provisional.core.IReporter;
-
-public class VirtualJavaPersistentType
- extends AbstractJavaJpaContextNode
- implements JavaPersistentType2_0
-{
-
- private final XmlTypeMapping xmlTypeMapping;
-
- protected final JavaTypeMapping mapping;
- protected PersistentType superPersistentType;
-
- public VirtualJavaPersistentType(EclipseLinkOrmPersistentType parent, XmlTypeMapping xmlTypeMapping) {
- super(parent);
- this.xmlTypeMapping = xmlTypeMapping;
- this.mapping = new JavaNullTypeMapping(this);
- }
-
- @Override
- public EclipseLinkOrmPersistentType getParent() {
- return (EclipseLinkOrmPersistentType) super.getParent();
- }
-
- protected EclipseLinkEntityMappings getEntityMappings() {
- return (EclipseLinkEntityMappings) getParent().getMappingFileRoot();
- }
-
-
- // ********** synchronize/update **********
- @Override
- public void synchronizeWithResourceModel() {
- super.synchronizeWithResourceModel();
- }
-
- @Override
- public void update() {
- super.update();
- this.setSuperPersistentType(this.buildSuperPersistentType());
- }
-
-
- // ********** name **********
-
- //The parent OrmPersistentType builds its name from the specified class and package.
- //In SpecifiedOrmPersistentType.updateJavaPersistentType(), it compares the names and
- //rebuilds if the name has changed. We don't need to rebuild the virtual java persistent
- //type based on a name change, it will get rebuilt if the dynamic state changes.
- public String getName() {
- return this.getParent().getName();
- }
-
- public String getSimpleName() {
- return this.getParent().getSimpleName();
- }
-
-
- // ********** access **********
-
- public AccessType getSpecifiedAccess() {
- return null;
- }
-
- public void setSpecifiedAccess(AccessType newSpecifiedAccess) {
- throw new UnsupportedOperationException();
- }
-
- public AccessType getDefaultAccess() {
- return null;
- }
-
- public AccessType getAccess() {
- return null;
- }
-
-
- // ********** mapping **********
-
- public JavaTypeMapping getMapping() {
- return this.mapping;
- }
-
- public String getMappingKey() {
- return this.mapping.getKey();
- }
-
- public void setMappingKey(String key) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isMapped() {
- return false;
- }
-
-
- // ********** super persistent type **********
-
- public PersistentType getSuperPersistentType() {
- return this.superPersistentType;
- }
-
- protected void setSuperPersistentType(PersistentType superPersistentType) {
- PersistentType old = this.superPersistentType;
- this.superPersistentType = superPersistentType;
- this.firePropertyChanged(SUPER_PERSISTENT_TYPE_PROPERTY, old, superPersistentType);
- }
-
- protected PersistentType buildSuperPersistentType() {
- HashSet<JavaResourceType> visited = new HashSet<JavaResourceType>();
- PersistentType spt = this.resolveSuperPersistentType(this.xmlTypeMapping.getParentClass(), visited);
- if (spt == null) {
- return null;
- }
- if (CollectionTools.contains(spt.getInheritanceHierarchy(), this)) {
- return null; // short-circuit in this case, we have circular inheritance
- }
- return spt.isMapped() ? spt : spt.getSuperPersistentType();
- }
-
- /**
- * The JPA spec allows non-persistent types in a persistent type's
- * inheritance hierarchy. We check for a persistent type with the
- * specified name in the persistence unit (Use the EntityMapping
- * API for this because it will append the package name if unqualified).
- * If it is not found we use java resource type and look for <em>its</em> super type.
- * <p>
- * The <code>visited</code> collection is used to detect a cycle in the
- * <em>resource</em> type inheritance hierarchy and prevent the resulting
- * stack overflow. Any cycles in the <em>context</em> type inheritance
- * hierarchy are handled in {@link #buildSuperPersistentType()}.
- */
- protected PersistentType resolveSuperPersistentType(String typeName, Collection<JavaResourceType> visited) {
- if (StringTools.stringIsEmpty(typeName)) {
- return null;
- }
- PersistentType spt = this.resolvePersistentType(typeName);
- if (spt != null) {
- return spt;
- }
- JavaResourceType resourceType = this.resolveJavaResourceType(typeName);
- visited.add(resourceType);
- return (resourceType == null) ? null : this.resolveSuperPersistentType(resourceType.getSuperclassQualifiedName(), visited); // recurse
- }
-
- protected PersistentType resolvePersistentType(String typeName) {
- return getEntityMappings().resolvePersistentType(typeName);
- }
-
- protected JavaResourceType resolveJavaResourceType(String typeName) {
- return (JavaResourceType) this.getEntityMappings().resolveJavaResourceType(typeName, JavaResourceAnnotatedElement.Kind.TYPE);
- }
-
-
- // ********** attributes **********
- //The VirtualJavaPersistentAttributes are built by the OrmEclipseLinkPersistentAttribute, no attributes here
-
- public ListIterable<JavaPersistentAttribute> getAttributes() {
- return EmptyListIterable.instance();
- }
-
- public JavaPersistentAttribute getAttributeNamed(String attributeName) {
- return null;
- }
-
- public boolean hasAnyAnnotatedAttributes() {
- return false;
- }
-
- public JavaPersistentAttribute getAttributeFor(JavaResourceAttribute javaResourceAttribute) {
- return null;
- }
-
- public int getAttributesSize() {
- return 0;
- }
-
- public Iterable<String> getAttributeNames() {
- return EmptyIterable.instance();
- }
-
- public Iterable<ReadOnlyPersistentAttribute> getAllAttributes() {
- return EmptyIterable.instance();
- }
-
- public Iterable<String> getAllAttributeNames() {
- return EmptyIterable.instance();
- }
-
- public ReadOnlyPersistentAttribute resolveAttribute(String attributeName) {
- return null;
- }
-
-
- // ********** inheritance **********
-
- public Iterable<PersistentType> getInheritanceHierarchy() {
- return this.getInheritanceHierarchyOf(this);
- }
-
- public Iterable<PersistentType> getAncestors() {
- return this.getInheritanceHierarchyOf(this.superPersistentType);
- }
-
- protected Iterable<PersistentType> getInheritanceHierarchyOf(PersistentType start) {
- // using a chain iterable to traverse up the inheritance tree
- return new ChainIterable<PersistentType>(start) {
- @Override
- protected PersistentType nextLink(PersistentType persistentType) {
- return persistentType.getSuperPersistentType();
- }
- };
- }
-
-
- // ********** JpaStructureNode implementation **********
-
- public ContextType getContextType() {
- throw new UnsupportedOperationException("There is no resource for a virtual java persistent type"); //$NON-NLS-1$
- }
-
- public Class<? extends JpaStructureNode> getType() {
- throw new UnsupportedOperationException("There is no resource for a virtual java persistent type"); //$NON-NLS-1$
- }
-
- public JpaStructureNode getStructureNode(int textOffset) {
- throw new UnsupportedOperationException("There is no resource for a virtual java persistent type"); //$NON-NLS-1$
- }
-
- public TextRange getSelectionTextRange() {
- throw new UnsupportedOperationException("There is no resource for a virtual java persistent type"); //$NON-NLS-1$
- }
-
-
- // ********** validation **********
-
- public void validate(List<IMessage> messages, IReporter reporter) {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getValidationTextRange() {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getValidationTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-
- // ********** misc **********
-
- public JavaResourceType getJavaResourceType() {
- return null;
- }
-
- public AccessType getOwnerOverrideAccess() {
- throw new UnsupportedOperationException();
- }
-
- public AccessType getOwnerDefaultAccess() {
- throw new UnsupportedOperationException();
- }
-
- public boolean isFor(String typeName) {
- throw new UnsupportedOperationException();
- }
-
- public boolean isIn(IPackageFragment packageFragment) {
- throw new UnsupportedOperationException();
- }
-
- public PersistentType getOverriddenPersistentType() {
- throw new UnsupportedOperationException();
- }
-
- public String getDeclaringTypeName() {
- String className = this.xmlTypeMapping.getClassName();
- int index = className == null ? -1 : className.lastIndexOf('$');
- if (index == -1) {
- return null;
- }
- return className.substring(0, index).replace('$', '.');
- }
-
- public boolean isManaged() {
- throw new UnsupportedOperationException();
- }
-
- public IFile getMetamodelFile() {
- throw new UnsupportedOperationException();
- }
-
- public void synchronizeMetamodel(Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- throw new UnsupportedOperationException();
- }
-
- public void printBodySourceOn(BodySourceWriter pw, Map<String, Collection<MetamodelSourceType>> memberTypeTree) {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.getName());
- }
-
- public void dispose() {
- //nothing to dispose
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java
deleted file mode 100644
index 307c355616..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceXmlContextNodeFactory;
-
-
-public class EclipseLink2_0PersistenceXmlContextNodeFactory
- extends AbstractPersistenceXmlContextNodeFactory
- implements EclipseLinkPersistenceXmlContextNodeFactory
-{
-
- @Override
- public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- return new EclipseLinkPersistenceUnit(parent, xmlPersistenceUnit);
- }
-
- @Override
- public JarFileRef buildJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- return new EclipseLinkJarFileRef(parent, xmlJarFileRef);
- }
-
- public JpaConnection2_0 buildConnection(PersistenceUnit parent) {
- return new EclipseLinkConnection2_0((PersistenceUnit2_0) parent);
- }
-
- public JpaOptions2_0 buildOptions(PersistenceUnit parent) {
- return new EclipseLinkOptions2_0((PersistenceUnit2_0) parent);
- }
-
- public PersistenceUnitProperties buildLogging(PersistenceUnit parent) {
- return new EclipseLinkLogging2_0((PersistenceUnit2_0) parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java
deleted file mode 100644
index 1b37aec558..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLink2_0PersistenceXmlDefinition.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.core.resource.persistence.v2_0.PersistenceV2_0Factory;
-
-public class EclipseLink2_0PersistenceXmlDefinition
- extends AbstractPersistenceXmlDefinition
-{
- // singleton
- private static final PersistenceXmlDefinition INSTANCE = new EclipseLink2_0PersistenceXmlDefinition();
-
- /**
- * Return the singleton
- */
- public static PersistenceXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLink2_0PersistenceXmlDefinition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE;
- }
-
- public EFactory getResourceNodeFactory() {
- return PersistenceV2_0Factory.eINSTANCE;
- }
-
- @Override
- protected PersistenceXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLink2_0PersistenceXmlContextNodeFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java
deleted file mode 100644
index bf63d03e17..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCaching.java
+++ /dev/null
@@ -1,586 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.FlushClearCache;
-
-/**
- * EclipseLinkCaching encapsulates EclipseLink Caching properties.
- */
-public class EclipseLinkCaching extends EclipseLinkPersistenceUnitProperties
- implements Caching
-{
- // ********** EclipseLink properties **********
- private CacheType cacheTypeDefault;
- private Integer cacheSizeDefault;
- private Boolean sharedCacheDefault;
- private FlushClearCache flushClearCache;
-
- private List<CachingEntity> entities;
-
- // ********** constructors **********
- public EclipseLinkCaching(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.entities = new ArrayList<CachingEntity>();
- this.cacheTypeDefault =
- this.getEnumValue(ECLIPSELINK_CACHE_TYPE_DEFAULT, CacheType.values());
- this.cacheSizeDefault =
- this.getIntegerValue(ECLIPSELINK_CACHE_SIZE_DEFAULT);
- this.sharedCacheDefault =
- this.getBooleanValue(ECLIPSELINK_CACHE_SHARED_DEFAULT);
- this.flushClearCache =
- this.getEnumValue(ECLIPSELINK_FLUSH_CLEAR_CACHE, FlushClearCache.values());
-
- Set<PersistenceUnit.Property> cacheTypeProperties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_CACHE_TYPE);
- Set<PersistenceUnit.Property> cacheSizeProperties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_CACHE_SIZE);
- Set<PersistenceUnit.Property> sharedCacheProperties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_SHARED_CACHE);
-
- this.initializeEntitiesCacheType(cacheTypeProperties);
- this.initializeEntitiesCacheSize(cacheSizeProperties);
- this.initializeEntitiesSharedCache(sharedCacheProperties);
- }
-
- private void initializeEntitiesCacheType(Set<PersistenceUnit.Property> cacheTypeProperties) {
- for (PersistenceUnit.Property cacheTypeProperty : cacheTypeProperties) {
- this.setEntityCacheTypeOf(cacheTypeProperty);
- }
- }
-
- private void initializeEntitiesCacheSize(Set<PersistenceUnit.Property> cacheSizeProperties) {
- for (PersistenceUnit.Property cacheSizeProperty : cacheSizeProperties) {
- this.setEntityCacheSizeOf(cacheSizeProperty);
- }
- }
-
- private void initializeEntitiesSharedCache(Set<PersistenceUnit.Property> sharedCacheProperties) {
- for (PersistenceUnit.Property sharedCacheProperty : sharedCacheProperties) {
- this.setEntitySharedCacheOf(sharedCacheProperty);
- }
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_CACHE_TYPE_DEFAULT)) {
- this.cacheTypeDefaultChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_SIZE_DEFAULT)) {
- this.cacheSizeDefaultChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_SHARED_DEFAULT)) {
- this.sharedCacheDefaultChanged(newValue);
- }
- else if (propertyName.startsWith(ECLIPSELINK_CACHE_TYPE)) {
- this.cacheTypeChanged(propertyName, newValue);
- }
- else if (propertyName.startsWith(ECLIPSELINK_CACHE_SIZE)) {
- this.cacheSizeChanged(propertyName, newValue);
- }
- else if (propertyName.startsWith(ECLIPSELINK_SHARED_CACHE)) {
- this.sharedCacheChanged(propertyName, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_FLUSH_CLEAR_CACHE)) {
- this.flushClearCacheChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_CACHE_TYPE_DEFAULT)) {
- this.cacheTypeDefaultChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_SIZE_DEFAULT)) {
- this.cacheSizeDefaultChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_SHARED_DEFAULT)) {
- this.sharedCacheDefaultChanged(null);
- }
- else if (propertyName.startsWith(ECLIPSELINK_CACHE_TYPE)) {
- this.cacheTypeChanged(propertyName, null);
- }
- else if (propertyName.startsWith(ECLIPSELINK_CACHE_SIZE)) {
- this.cacheSizeChanged(propertyName, null);
- }
- else if (propertyName.startsWith(ECLIPSELINK_SHARED_CACHE)) {
- this.sharedCacheChanged(propertyName, null);
- }
- else if (propertyName.equals(ECLIPSELINK_FLUSH_CLEAR_CACHE)) {
- this.flushClearCacheChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key;
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_CACHE_TYPE_DEFAULT,
- CACHE_TYPE_DEFAULT_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_SIZE_DEFAULT,
- CACHE_SIZE_DEFAULT_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_SHARED_DEFAULT,
- SHARED_CACHE_DEFAULT_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_FLUSH_CLEAR_CACHE,
- FLUSH_CLEAR_CACHE_PROPERTY);
-
- // Don't need to initialize propertyNames for:
- // cacheType, sharedCache, cacheSize
- }
-
- /**
- * Method used for identifying the given property.
- */
- @Override
- public boolean itemIsProperty(PersistenceUnit.Property item) {
- boolean isProperty = super.itemIsProperty(item);
-
- if ( ! isProperty && item.getName() != null) {
- if (item.getName().startsWith(ECLIPSELINK_CACHE_TYPE) ||
- item.getName().startsWith(ECLIPSELINK_CACHE_SIZE) ||
- item.getName().startsWith(ECLIPSELINK_SHARED_CACHE)) {
- return true;
- }
- }
- return isProperty;
- }
-
- /**
- * Returns the property name used for change notification of the given
- * property.
- */
- @Override
- public String propertyIdOf(PersistenceUnit.Property property) {
- try {
- return super.propertyIdOf(property);
- }
- catch (IllegalArgumentException e) {
- if (property.getName().startsWith(ECLIPSELINK_CACHE_TYPE)) {
- return CACHE_TYPE_PROPERTY;
- }
- else if (property.getName().startsWith(ECLIPSELINK_CACHE_SIZE)) {
- return CACHE_SIZE_PROPERTY;
- }
- else if (property.getName().startsWith(ECLIPSELINK_SHARED_CACHE)) {
- return SHARED_CACHE_PROPERTY;
- }
- }
- throw new IllegalArgumentException("Illegal property: " + property.toString()); //$NON-NLS-1$
- }
-
- public CachingEntity addEntity(String entityName) {
- if (this.entityExists(entityName)) {
- throw new IllegalStateException("Duplicate entity: " + entityName); //$NON-NLS-1$
- }
- CachingEntity newEntity = this.buildEntity(entityName);
- this.addItemToList(newEntity, this.entities, ENTITIES_LIST);
- return newEntity;
- }
-
- public void removeEntity(String entityName) {
- if ( ! this.entityExists(entityName)) {
- return;
- }
- CachingEntity entity = this.getEntityNamed(entityName);
- this.clearEntity(entity);
- this.removeEntity(entity);
- }
-
- // ********** CacheType **********
- public CacheType getCacheTypeOf(String entityName) {
- CachingEntity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.getCacheType();
- }
-
- public void setCacheTypeOf(String entityName, CacheType newCacheType) {
- CachingEntity old = this.setEntityCacheTypeOf(entityName, newCacheType);
- this.putEnumValue(ECLIPSELINK_CACHE_TYPE, entityName, newCacheType, false);
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, this.getEntityNamed(entityName));
- }
-
- private void cacheTypeChanged(String propertyName, String stringValue) {
- String entityName = this.extractEntityNameOf(propertyName);
- if( ! StringTools.stringIsEmpty(entityName)) {
- CachingEntity old = this.setEntityCacheTypeOf(entityName, stringValue);
- this.firePropertyChanged(CACHE_TYPE_PROPERTY, old, this.getEntityNamed(entityName));
- }
- }
-
- public CacheType getDefaultCacheType() {
- return (this.cacheTypeDefault == null) ? DEFAULT_CACHE_TYPE : this.cacheTypeDefault;
- }
-
- // ********** CacheSize **********
- public Integer getCacheSizeOf(String entityName) {
- CachingEntity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.getCacheSize();
- }
-
- public void setCacheSizeOf(String entityName, Integer newCacheSize) {
- CachingEntity old = this.setEntityCacheSizeOf(entityName, newCacheSize);
- this.putIntegerValue(ECLIPSELINK_CACHE_SIZE + entityName, newCacheSize);
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, this.getEntityNamed(entityName));
- }
-
- private void cacheSizeChanged(String propertyName, String stringValue) {
- String entityName = this.extractEntityNameOf(propertyName);
- if( ! StringTools.stringIsEmpty(entityName)) {
- CachingEntity old = this.setEntityCacheSizeOf(entityName, stringValue);
- this.firePropertyChanged(CACHE_SIZE_PROPERTY, old, this.getEntityNamed(entityName));
- }
- }
-
- public Integer getDefaultCacheSize() {
- return (this.cacheSizeDefault == null) ? DEFAULT_CACHE_SIZE : this.cacheSizeDefault;
- }
-
- // ********** SharedCache **********
- public Boolean getSharedCacheOf(String entityName) {
- CachingEntity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.cacheIsShared();
- }
-
- public void setSharedCacheOf(String entityName, Boolean newSharedCache) {
- CachingEntity old = this.setEntitySharedCacheOf(entityName, newSharedCache);
- this.putBooleanValue(ECLIPSELINK_SHARED_CACHE, entityName, newSharedCache, false);
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, this.getEntityNamed(entityName));
- }
-
- private void sharedCacheChanged(String propertyName, String stringValue) {
- String entityName = this.extractEntityNameOf(propertyName);
- if( ! StringTools.stringIsEmpty(entityName)) {
- CachingEntity old = this.setEntitySharedCacheOf(entityName, stringValue);
- this.firePropertyChanged(SHARED_CACHE_PROPERTY, old, this.getEntityNamed(entityName));
- }
- }
-
- public Boolean getDefaultSharedCache() {
- return (this.sharedCacheDefault == null) ? DEFAULT_SHARED_CACHE : this.sharedCacheDefault;
- }
-
- // ********** CacheTypeDefault **********
- public CacheType getCacheTypeDefault() {
- return this.cacheTypeDefault;
- }
-
- public void setCacheTypeDefault(CacheType newCacheTypeDefault) {
- CacheType old = this.cacheTypeDefault;
- this.cacheTypeDefault = newCacheTypeDefault;
- this.putProperty(CACHE_TYPE_DEFAULT_PROPERTY, newCacheTypeDefault);
- this.firePropertyChanged(CACHE_TYPE_DEFAULT_PROPERTY, old, newCacheTypeDefault);
- }
-
- private void cacheTypeDefaultChanged(String stringValue) {
- CacheType newValue = getEnumValueOf(stringValue, CacheType.values());
- CacheType old = this.cacheTypeDefault;
- this.cacheTypeDefault = newValue;
- this.firePropertyChanged(CACHE_TYPE_DEFAULT_PROPERTY, old, newValue);
- }
-
- public CacheType getDefaultCacheTypeDefault() {
- return DEFAULT_CACHE_TYPE_DEFAULT;
- }
-
- // ********** CacheSizeDefault **********
- public Integer getCacheSizeDefault() {
- return this.cacheSizeDefault;
- }
-
- public void setCacheSizeDefault(Integer newCacheSizeDefault) {
- Integer old = this.cacheSizeDefault;
- this.cacheSizeDefault = newCacheSizeDefault;
- this.putProperty(CACHE_SIZE_DEFAULT_PROPERTY, newCacheSizeDefault);
- this.firePropertyChanged(CACHE_SIZE_DEFAULT_PROPERTY, old, newCacheSizeDefault);
- }
-
- private void cacheSizeDefaultChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
- Integer old = this.cacheSizeDefault;
- this.cacheSizeDefault = newValue;
- this.firePropertyChanged(CACHE_SIZE_DEFAULT_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultCacheSizeDefault() {
- return DEFAULT_CACHE_SIZE_DEFAULT;
- }
-
- // ********** SharedCacheDefault **********
- public Boolean getSharedCacheDefault() {
- return this.sharedCacheDefault;
- }
-
- public void setSharedCacheDefault(Boolean newSharedCacheDefault) {
- Boolean old = this.sharedCacheDefault;
- this.sharedCacheDefault = newSharedCacheDefault;
- this.putProperty(SHARED_CACHE_DEFAULT_PROPERTY, newSharedCacheDefault);
- this.firePropertyChanged(SHARED_CACHE_DEFAULT_PROPERTY, old, newSharedCacheDefault);
- }
-
- private void sharedCacheDefaultChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.sharedCacheDefault;
- this.sharedCacheDefault = newValue;
- this.firePropertyChanged(SHARED_CACHE_DEFAULT_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultSharedCacheDefault() {
- return DEFAULT_SHARED_CACHE_DEFAULT;
- }
-
- // ********** FlushClearCache **********
-
- public FlushClearCache getFlushClearCache() {
- return this.flushClearCache;
- }
-
- public void setFlushClearCache(FlushClearCache newFlushClearCache) {
- FlushClearCache old = this.flushClearCache;
- this.flushClearCache = newFlushClearCache;
- this.putProperty(FLUSH_CLEAR_CACHE_PROPERTY, newFlushClearCache);
- this.firePropertyChanged(FLUSH_CLEAR_CACHE_PROPERTY, old, newFlushClearCache);
- }
-
- private void flushClearCacheChanged(String stringValue) {
- FlushClearCache newValue = getEnumValueOf(stringValue, FlushClearCache.values());
- FlushClearCache old = this.flushClearCache;
- this.flushClearCache = newValue;
- this.firePropertyChanged(FLUSH_CLEAR_CACHE_PROPERTY, old, newValue);
- }
-
- public FlushClearCache getDefaultFlushClearCache() {
- return DEFAULT_FLUSH_CLEAR_CACHE;
- }
-
- // ****** Entity CacheType *******
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheTypeOf(String entityName, String stringValue) {
- if(( ! this.entityExists(entityName)) && StringTools.stringIsEmpty(stringValue)) {
- //this is a property that is currently being added, we don't need to deal with it until the value is set
- return null;
- }
- CacheType newValue = getEnumValueOf(stringValue, CacheType.values());
- return this.setEntityCacheTypeOf(entityName, newValue);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheTypeOf(String entityName, CacheType cacheType) {
- CachingEntity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntityCacheTypeOf(entity, cacheType);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheTypeOf(CachingEntity entity, CacheType cacheType) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- CachingEntity old = entity.clone();
- entity.setCacheType(cacheType);
- return old;
- }
-
- private void setEntityCacheTypeOf(PersistenceUnit.Property cacheTypeProperty) {
- String entityName = this.extractEntityNameOf(cacheTypeProperty);
- this.setEntityCacheTypeOf(entityName, cacheTypeProperty.getValue());
- }
-
- // ****** Entity Cache size *******
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheSizeOf(String entityName, String stringValue) {
- if(( ! this.entityExists(entityName)) && StringTools.stringIsEmpty(stringValue)) {
- //this is a property that is currently being added, we don't need to deal with it until the value is set
- return null;
- }
- Integer newValue = getIntegerValueOf(stringValue);
- return this.setEntityCacheSizeOf(entityName, newValue);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheSizeOf(String entityName, Integer size) {
- CachingEntity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntityCacheSizeOf(entity, size);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntityCacheSizeOf(CachingEntity entity, Integer size) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- CachingEntity old = entity.clone();
- entity.setCacheSize(size);
- return old;
- }
-
- private void setEntityCacheSizeOf(PersistenceUnit.Property cacheSizeProperty) {
- String entityName = this.extractEntityNameOf(cacheSizeProperty);
- this.setEntityCacheSizeOf(entityName, cacheSizeProperty.getValue());
- }
-
- // ****** Entity SharedCache *******
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntitySharedCacheOf(String entityName, String stringValue) {
- if(( ! this.entityExists(entityName)) && StringTools.stringIsEmpty(stringValue)) {
- //this is a property that is currently being added, we don't need to deal with it until the value is set
- return null;
- }
- Boolean newValue = getBooleanValueOf(stringValue);
- return this.setEntitySharedCacheOf(entityName, newValue);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntitySharedCacheOf(String entityName, Boolean sharedCache) {
- CachingEntity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntitySharedCacheOf(entity, sharedCache);
- }
-
- /**
- * Returns the old Entity
- */
- private CachingEntity setEntitySharedCacheOf(CachingEntity entity, Boolean sharedCache) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- CachingEntity old = entity.clone();
- entity.setSharedCache(sharedCache);
- return old;
- }
-
- private void setEntitySharedCacheOf(PersistenceUnit.Property sharedCacheProperty) {
- String entityName = this.extractEntityNameOf(sharedCacheProperty);
- this.setEntitySharedCacheOf(entityName, sharedCacheProperty.getValue());
- }
-
- // ****** convenience methods *******
-
- /**
- * Set all Entity properties to default.
- */
- private void clearEntity(CachingEntity entity) {
- if(entity.isEmpty()) {
- return;
- }
- String entityName = entity.getName();
- this.setCacheTypeOf(entityName, null);
- this.setCacheSizeOf(entityName, null);
- this.setSharedCacheOf(entityName, null);
- }
-
- /**
- * Returns the Entity with the given name.
- */
- private CachingEntity getEntityNamed(String name) {
- for(CachingEntity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return entity;
- }
- }
- return null;
- }
-
- private CachingEntity buildEntity(String name) {
- return new CachingEntity(this, name);
- }
-
- private void removeEntity(CachingEntity entity) {
- if(entity == null) {
- throw new NullPointerException();
- }
- this.removeItemFromList(entity, this.entities, ENTITIES_LIST);
- }
-
- /**
- * Return whether the Entity exist.
- */
- public boolean entityExists(String name) {
- for(CachingEntity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Removes cacheTypeDefault, cacheSizeDefault, flushClearCache properties.
- */
- public void removeDefaultCachingProperties() {
- this.setCacheTypeDefault(null);
- this.setCacheSizeDefault(null);
- this.setFlushClearCache(null);
- }
-
- // ****** entities list *******
-
- public ListIterable<CachingEntity> getEntities() {
- return new LiveCloneListIterable<CachingEntity>(this.entities);
- }
-
- public Iterable<String> getEntityNames() {
- return new TransformationIterable<CachingEntity, String>(this.getEntities()) {
- @Override
- protected String transform(CachingEntity entity) {
- return entity.getName();
- }
- };
- }
-
- public int getEntitiesSize() {
- return this.entities.size();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection.java
deleted file mode 100644
index 9ab04c3bae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection.java
+++ /dev/null
@@ -1,676 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.BatchWriting;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.ExclusiveConnectionMode;
-
-/**
- * EclipseLinkConnection
- */
-public class EclipseLinkConnection extends EclipseLinkPersistenceUnitProperties
- implements Connection
-{
-
- // ********** EclipseLink properties **********
- private BatchWriting batchWriting;
- private Boolean nativeSql;
- private Boolean cacheStatements;
- private Integer cacheStatementsSize;
- protected String driver;
- protected String url;
- protected String user;
- protected String password;
- private Boolean bindParameters;
- private Boolean readConnectionsShared;
- private Integer readConnectionsMin;
- private Integer readConnectionsMax;
- private Integer writeConnectionsMin;
- private Integer writeConnectionsMax;
- private ExclusiveConnectionMode exclusiveConnectionMode;
- private Boolean lazyConnection;
-
-
- // ********** constructors **********
- public EclipseLinkConnection(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.initializeDatabaseConnectionProperties();
-
- this.batchWriting =
- this.getEnumValue(ECLIPSELINK_BATCH_WRITING, BatchWriting.values());
- this.nativeSql =
- this.getBooleanValue(ECLIPSELINK_NATIVE_SQL);
- this.cacheStatements =
- this.getBooleanValue(ECLIPSELINK_CACHE_STATEMENTS);
- this.cacheStatementsSize =
- this.getIntegerValue(ECLIPSELINK_CACHE_STATEMENTS_SIZE);
- this.bindParameters =
- this.getBooleanValue(ECLIPSELINK_BIND_PARAMETERS);
- this.readConnectionsShared =
- this.getBooleanValue(ECLIPSELINK_READ_CONNECTIONS_SHARED);
- this.readConnectionsMin =
- this.getIntegerValue(ECLIPSELINK_READ_CONNECTIONS_MIN);
- this.readConnectionsMax =
- this.getIntegerValue(ECLIPSELINK_READ_CONNECTIONS_MAX);
- this.writeConnectionsMin =
- this.getIntegerValue(ECLIPSELINK_WRITE_CONNECTIONS_MIN);
- this.writeConnectionsMax =
- this.getIntegerValue(ECLIPSELINK_WRITE_CONNECTIONS_MAX);
- this.exclusiveConnectionMode =
- this.getEnumValue(ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE, ExclusiveConnectionMode.values());
- this.lazyConnection =
- this.getBooleanValue(ECLIPSELINK_LAZY_CONNECTION);
- }
-
- protected void initializeDatabaseConnectionProperties() {
- this.driver =
- this.getStringValue(ECLIPSELINK_DRIVER);
- this.url =
- this.getStringValue(ECLIPSELINK_URL);
- this.user =
- this.getStringValue(ECLIPSELINK_USER);
- this.password =
- this.getStringValue(ECLIPSELINK_PASSWORD);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_NATIVE_SQL)) {
- this.nativeSqlChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_BATCH_WRITING)) {
- this.batchWritingChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_STATEMENTS)) {
- this.cacheStatementsChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_DRIVER)) {
- this.driverChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_URL)) {
- this.urlChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_USER)) {
- this.userChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_PASSWORD)) {
- this.passwordChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_BIND_PARAMETERS)) {
- this.bindParametersChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_SHARED)) {
- this.readConnectionsSharedChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_STATEMENTS_SIZE)) {
- this.cacheStatementsSizeChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_MIN)) {
- readConnectionsMinChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_MAX)) {
- readConnectionsMaxChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WRITE_CONNECTIONS_MIN)) {
- writeConnectionsMinChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WRITE_CONNECTIONS_MAX)) {
- writeConnectionsMaxChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE)) {
- this.exclusiveConnectionModeChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_LAZY_CONNECTION)) {
- this.lazyConnectionChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_NATIVE_SQL)) {
- this.nativeSqlChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_BATCH_WRITING)) {
- this.batchWritingChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_STATEMENTS)) {
- this.cacheStatementsChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_DRIVER)) {
- this.driverChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_URL)) {
- this.urlChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_USER)) {
- this.userChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_PASSWORD)) {
- this.passwordChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_BIND_PARAMETERS)) {
- this.bindParametersChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_SHARED)) {
- this.readConnectionsSharedChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_STATEMENTS_SIZE)) {
- this.cacheStatementsSizeChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_MIN)) {
- readConnectionsMinChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_READ_CONNECTIONS_MAX)) {
- readConnectionsMaxChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WRITE_CONNECTIONS_MIN)) {
- writeConnectionsMinChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WRITE_CONNECTIONS_MAX)) {
- writeConnectionsMaxChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE)) {
- this.exclusiveConnectionModeChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_LAZY_CONNECTION)) {
- this.lazyConnectionChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- this.addDatabaseConnectionPropertyNames(propertyNames);
-
- propertyNames.put(
- ECLIPSELINK_NATIVE_SQL,
- NATIVE_SQL_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_BATCH_WRITING,
- BATCH_WRITING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_STATEMENTS,
- CACHE_STATEMENTS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_STATEMENTS_SIZE,
- CACHE_STATEMENTS_SIZE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_BIND_PARAMETERS,
- BIND_PARAMETERS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_READ_CONNECTIONS_SHARED,
- READ_CONNECTIONS_SHARED_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_READ_CONNECTIONS_MIN,
- READ_CONNECTIONS_MIN_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_READ_CONNECTIONS_MAX,
- READ_CONNECTIONS_MAX_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WRITE_CONNECTIONS_MIN,
- WRITE_CONNECTIONS_MIN_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WRITE_CONNECTIONS_MAX,
- WRITE_CONNECTIONS_MAX_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE,
- EXCLUSIVE_CONNECTION_MODE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_LAZY_CONNECTION,
- LAZY_CONNECTION_PROPERTY);
- }
-
- protected void addDatabaseConnectionPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_DRIVER,
- DRIVER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_URL,
- URL_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_USER,
- USER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PASSWORD,
- PASSWORD_PROPERTY);
- }
-
- /**
- * Does all pre-treatment in this method before the property is set
- */
- protected void preSetProperty() {
- // do nothing by default
- }
-
- // ********** NativeSql **********
- public Boolean getNativeSql() {
- return this.nativeSql;
- }
-
- public void setNativeSql(Boolean newNativeSql) {
- this.preSetProperty();
-
- Boolean old = this.nativeSql;
- this.nativeSql = newNativeSql;
- this.putProperty(NATIVE_SQL_PROPERTY, newNativeSql);
- this.firePropertyChanged(NATIVE_SQL_PROPERTY, old, newNativeSql);
- }
-
- private void nativeSqlChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.nativeSql;
- this.nativeSql = newValue;
- this.firePropertyChanged(NATIVE_SQL_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultNativeSql() {
- return DEFAULT_NATIVE_SQL;
- }
-
- // ********** BatchWriting **********
-
- public BatchWriting getBatchWriting() {
- return this.batchWriting;
- }
-
- public void setBatchWriting(BatchWriting newBatchWriting) {
- this.preSetProperty();
-
- BatchWriting old = this.batchWriting;
- this.batchWriting = newBatchWriting;
- this.putProperty(BATCH_WRITING_PROPERTY, newBatchWriting);
- this.firePropertyChanged(BATCH_WRITING_PROPERTY, old, newBatchWriting);
- }
-
- private void batchWritingChanged(String stringValue) {
- BatchWriting newValue = getEnumValueOf(stringValue, BatchWriting.values());
- BatchWriting old = this.batchWriting;
- this.batchWriting = newValue;
- this.firePropertyChanged(BATCH_WRITING_PROPERTY, old, newValue);
- }
-
- public BatchWriting getDefaultBatchWriting() {
- return DEFAULT_BATCH_WRITING;
- }
-
- // ********** CacheStatements **********
- public Boolean getCacheStatements() {
- return this.cacheStatements;
- }
-
- public void setCacheStatements(Boolean newCacheStatements) {
- this.preSetProperty();
-
- Boolean old = this.cacheStatements;
- this.cacheStatements = newCacheStatements;
- this.putProperty(CACHE_STATEMENTS_PROPERTY, newCacheStatements);
- this.firePropertyChanged(CACHE_STATEMENTS_PROPERTY, old, newCacheStatements);
- }
-
- private void cacheStatementsChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.cacheStatements;
- this.cacheStatements = newValue;
- this.firePropertyChanged(CACHE_STATEMENTS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultCacheStatements() {
- return DEFAULT_CACHE_STATEMENTS;
- }
-
- // ********** CacheStatementsSize **********
- public Integer getCacheStatementsSize() {
- return this.cacheStatementsSize;
- }
-
- public void setCacheStatementsSize(Integer newCacheStatementsSize) {
- this.preSetProperty();
-
- Integer old = this.cacheStatementsSize;
- this.cacheStatementsSize = newCacheStatementsSize;
- this.putProperty(CACHE_STATEMENTS_SIZE_PROPERTY, newCacheStatementsSize);
- this.firePropertyChanged(CACHE_STATEMENTS_SIZE_PROPERTY, old, newCacheStatementsSize);
- }
-
- private void cacheStatementsSizeChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.cacheStatementsSize;
- this.cacheStatementsSize = newValue;
- this.firePropertyChanged(CACHE_STATEMENTS_SIZE_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultCacheStatementsSize() {
- return DEFAULT_CACHE_STATEMENTS_SIZE;
- }
-
- // ********** Driver **********
- public String getDriver() {
- return this.driver;
- }
-
- public void setDriver(String newDriver) {
- this.preSetProperty();
-
- String old = this.driver;
- this.driver = newDriver;
- this.putProperty(DRIVER_PROPERTY, newDriver);
- this.firePropertyChanged(DRIVER_PROPERTY, old, newDriver);
- }
-
- protected void driverChanged(String newValue) {
- String old = this.driver;
- this.driver = newValue;
- this.firePropertyChanged(DRIVER_PROPERTY, old, newValue);
- }
-
- public String getDefaultDriver() {
- return DEFAULT_DRIVER;
- }
-
- // ********** URL **********
- public String getUrl() {
- return this.url;
- }
-
- public void setUrl(String newUrl) {
- this.preSetProperty();
-
- String old = this.url;
- this.url = newUrl;
- this.putProperty(URL_PROPERTY, newUrl);
- this.firePropertyChanged(URL_PROPERTY, old, newUrl);
- }
-
- protected void urlChanged(String newValue) {
- String old = this.url;
- this.url = newValue;
- this.firePropertyChanged(URL_PROPERTY, old, newValue);
- }
-
- public String getDefaultUrl() {
- return DEFAULT_URL;
- }
-
- // ********** User **********
- public String getUser() {
- return this.user;
- }
-
- public void setUser(String newUser) {
- this.preSetProperty();
-
- String old = this.user;
- this.user = newUser;
- this.putProperty(USER_PROPERTY, newUser);
- this.firePropertyChanged(USER_PROPERTY, old, newUser);
- }
-
- protected void userChanged(String newValue) {
- String old = this.user;
- this.user = newValue;
- this.firePropertyChanged(USER_PROPERTY, old, newValue);
- }
-
- public String getDefaultUser() {
- return DEFAULT_USER;
- }
-
- // ********** Password **********
- public String getPassword() {
- return this.password;
- }
-
- public void setPassword(String newPassword) {
- this.preSetProperty();
-
- String old = this.password;
- this.password = newPassword;
- this.putProperty(PASSWORD_PROPERTY, newPassword);
- this.firePropertyChanged(PASSWORD_PROPERTY, old, newPassword);
- }
-
- protected void passwordChanged(String newValue) {
- String old = this.password;
- this.password = newValue;
- this.firePropertyChanged(PASSWORD_PROPERTY, old, newValue);
- }
-
- public String getDefaultPassword() {
- return DEFAULT_PASSWORD;
- }
-
- // ********** BindParameters **********
- public Boolean getBindParameters() {
- return this.bindParameters;
- }
-
- public void setBindParameters(Boolean newBindParameters) {
- this.preSetProperty();
-
- Boolean old = this.bindParameters;
- this.bindParameters = newBindParameters;
- this.putProperty(BIND_PARAMETERS_PROPERTY, newBindParameters);
- this.firePropertyChanged(BIND_PARAMETERS_PROPERTY, old, newBindParameters);
- }
-
- private void bindParametersChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.bindParameters;
- this.bindParameters = newValue;
- this.firePropertyChanged(BIND_PARAMETERS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultBindParameters() {
- return DEFAULT_BIND_PARAMETERS;
- }
-
- // ********** ReadConnectionsShared **********
- public Boolean getReadConnectionsShared() {
- return this.readConnectionsShared;
- }
-
- public void setReadConnectionsShared(Boolean newReadConnectionsShared) {
- this.preSetProperty();
-
- Boolean old = this.readConnectionsShared;
- this.readConnectionsShared = newReadConnectionsShared;
- this.putProperty(READ_CONNECTIONS_SHARED_PROPERTY, newReadConnectionsShared);
- this.firePropertyChanged(READ_CONNECTIONS_SHARED_PROPERTY, old, newReadConnectionsShared);
- }
-
- private void readConnectionsSharedChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.readConnectionsShared;
- this.readConnectionsShared = newValue;
- this.firePropertyChanged(READ_CONNECTIONS_SHARED_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultReadConnectionsShared() {
- return DEFAULT_READ_CONNECTIONS_SHARED;
- }
-
- // ********** ReadConnectionsMin **********
- public Integer getReadConnectionsMin() {
- return this.readConnectionsMin;
- }
-
- public void setReadConnectionsMin(Integer newReadConnectionsMin) {
- this.preSetProperty();
-
- Integer old = this.readConnectionsMin;
- this.readConnectionsMin = newReadConnectionsMin;
- this.putProperty(READ_CONNECTIONS_MIN_PROPERTY, newReadConnectionsMin);
- this.firePropertyChanged(READ_CONNECTIONS_MIN_PROPERTY, old, newReadConnectionsMin);
- }
-
- private void readConnectionsMinChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.readConnectionsMin;
- this.readConnectionsMin = newValue;
- this.firePropertyChanged(READ_CONNECTIONS_MIN_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultReadConnectionsMin() {
- return DEFAULT_READ_CONNECTIONS_MIN;
- }
-
- // ********** ReadConnectionsMax **********
- public Integer getReadConnectionsMax() {
- return this.readConnectionsMax;
- }
-
- public void setReadConnectionsMax(Integer newReadConnectionsMax) {
- this.preSetProperty();
-
- Integer old = this.readConnectionsMax;
- this.readConnectionsMax = newReadConnectionsMax;
- this.putProperty(READ_CONNECTIONS_MAX_PROPERTY, newReadConnectionsMax);
- this.firePropertyChanged(READ_CONNECTIONS_MAX_PROPERTY, old, newReadConnectionsMax);
- }
-
- private void readConnectionsMaxChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.readConnectionsMax;
- this.readConnectionsMax = newValue;
- this.firePropertyChanged(READ_CONNECTIONS_MAX_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultReadConnectionsMax() {
- return DEFAULT_READ_CONNECTIONS_MAX;
- }
-
- // ********** WriteConnectionsMin **********
- public Integer getWriteConnectionsMin() {
- return this.writeConnectionsMin;
- }
-
- public void setWriteConnectionsMin(Integer newWriteConnectionsMin) {
- this.preSetProperty();
-
- Integer old = this.writeConnectionsMin;
- this.writeConnectionsMin = newWriteConnectionsMin;
- this.putProperty(WRITE_CONNECTIONS_MIN_PROPERTY, newWriteConnectionsMin);
- this.firePropertyChanged(WRITE_CONNECTIONS_MIN_PROPERTY, old, newWriteConnectionsMin);
- }
-
- private void writeConnectionsMinChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.writeConnectionsMin;
- this.writeConnectionsMin = newValue;
- this.firePropertyChanged(WRITE_CONNECTIONS_MIN_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultWriteConnectionsMin() {
- return DEFAULT_WRITE_CONNECTIONS_MIN;
- }
-
- // ********** WriteConnectionsMax **********
- public Integer getWriteConnectionsMax() {
- return this.writeConnectionsMax;
- }
-
- public void setWriteConnectionsMax(Integer newWriteConnectionsMax) {
- this.preSetProperty();
-
- Integer old = this.writeConnectionsMax;
- this.writeConnectionsMax = newWriteConnectionsMax;
- this.putProperty(WRITE_CONNECTIONS_MAX_PROPERTY, newWriteConnectionsMax);
- this.firePropertyChanged(WRITE_CONNECTIONS_MAX_PROPERTY, old, newWriteConnectionsMax);
- }
-
- private void writeConnectionsMaxChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.writeConnectionsMax;
- this.writeConnectionsMax = newValue;
- this.firePropertyChanged(WRITE_CONNECTIONS_MAX_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultWriteConnectionsMax() {
- return DEFAULT_WRITE_CONNECTIONS_MAX;
- }
-
- // ********** ExclusiveConnectionMode **********
-
- public ExclusiveConnectionMode getExclusiveConnectionMode() {
- return this.exclusiveConnectionMode;
- }
-
- public void setExclusiveConnectionMode(ExclusiveConnectionMode newExclusiveConnectionMode) {
- this.preSetProperty();
-
- ExclusiveConnectionMode old = this.exclusiveConnectionMode;
- this.exclusiveConnectionMode = newExclusiveConnectionMode;
- this.putProperty(EXCLUSIVE_CONNECTION_MODE_PROPERTY, newExclusiveConnectionMode);
- this.firePropertyChanged(EXCLUSIVE_CONNECTION_MODE_PROPERTY, old, newExclusiveConnectionMode);
- }
-
- private void exclusiveConnectionModeChanged(String stringValue) {
- ExclusiveConnectionMode newValue = getEnumValueOf(stringValue, ExclusiveConnectionMode.values());
- ExclusiveConnectionMode old = this.exclusiveConnectionMode;
- this.exclusiveConnectionMode = newValue;
- this.firePropertyChanged(EXCLUSIVE_CONNECTION_MODE_PROPERTY, old, newValue);
- }
-
- public ExclusiveConnectionMode getDefaultExclusiveConnectionMode() {
- return DEFAULT_EXCLUSIVE_CONNECTION_MODE;
- }
-
- // ********** LazyConnection **********
- public Boolean getLazyConnection() {
- return this.lazyConnection;
- }
-
- public void setLazyConnection(Boolean newLazyConnection) {
- this.preSetProperty();
-
- Boolean old = this.lazyConnection;
- this.lazyConnection = newLazyConnection;
- this.putProperty(LAZY_CONNECTION_PROPERTY, newLazyConnection);
- this.firePropertyChanged(LAZY_CONNECTION_PROPERTY, old, newLazyConnection);
- }
-
- private void lazyConnectionChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.lazyConnection;
- this.lazyConnection = newValue;
- this.firePropertyChanged(LAZY_CONNECTION_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultLazyConnection() {
- return DEFAULT_LAZY_CONNECTION;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection2_0.java
deleted file mode 100644
index 50e6aa126d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkConnection2_0.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection2_0;
-
-
-/**
- * EclipseLinkConnection2_0
- */
-public class EclipseLinkConnection2_0 extends EclipseLinkConnection
- implements Connection2_0
-{
-
- // ********** constructors **********
- public EclipseLinkConnection2_0(PersistenceUnit2_0 parent) {
- super(parent);
- }
-
- // ********** initialization **********
- @Override
- protected void initializeDatabaseConnectionProperties() {
- this.driver =
- this.getStringValue(JpaConnection2_0.PERSISTENCE_JDBC_DRIVER);
- this.url =
- this.getStringValue(JpaConnection2_0.PERSISTENCE_JDBC_URL);
- this.user =
- this.getStringValue(JpaConnection2_0.PERSISTENCE_JDBC_USER);
- this.password =
- this.getStringValue(JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD);
- }
-
- @Override
- protected void postInitialize() {
- super.postInitialize();
-
- // Initialize Properties from legacy properties names if not initialized.
- if(this.persistenceUnitKeyExists(ECLIPSELINK_DRIVER)) {
- if(this.driver == null) {
- this.driver = this.getStringValue(ECLIPSELINK_DRIVER);
- }
- }
- if(this.persistenceUnitKeyExists(ECLIPSELINK_URL)) {
- if(this.url == null) {
- this.url = this.getStringValue(ECLIPSELINK_URL);
- }
- }
- if(this.persistenceUnitKeyExists(ECLIPSELINK_USER)) {
- if(this.user == null) {
- this.user = this.getStringValue(ECLIPSELINK_USER);
- }
- }
- if(this.persistenceUnitKeyExists(ECLIPSELINK_PASSWORD)) {
- if(this.password == null) {
- this.password = this.getStringValue(ECLIPSELINK_PASSWORD);
- }
- }
- }
-
- // ********** behavior **********
-
- @Override
- public void propertyValueChanged(String propertyName, String newValue) {
- super.propertyValueChanged(propertyName, newValue);
-
- if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_DRIVER)) {
- this.driverChanged(newValue);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_URL)) {
- this.urlChanged(newValue);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_USER)) {
- this.userChanged(newValue);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD)) {
- this.passwordChanged(newValue);
- }
- }
-
- @Override
- public void propertyRemoved(String propertyName) {
- super.propertyRemoved(propertyName);
-
- if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_DRIVER)) {
- this.driverChanged(null);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_URL)) {
- this.urlChanged(null);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_USER)) {
- this.userChanged(null);
- }
- else if (propertyName.equals(JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD)) {
- this.passwordChanged(null);
- }
- }
-
- @Override
- protected void addDatabaseConnectionPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- JpaConnection2_0.PERSISTENCE_JDBC_DRIVER,
- Connection.DRIVER_PROPERTY);
- propertyNames.put(
- JpaConnection2_0.PERSISTENCE_JDBC_URL,
- Connection.URL_PROPERTY);
- propertyNames.put(
- JpaConnection2_0.PERSISTENCE_JDBC_USER,
- Connection.USER_PROPERTY);
- propertyNames.put(
- JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD,
- Connection.PASSWORD_PROPERTY);
- }
-
- /**
- * Migrate properties names to EclipseLink 2.0 names.
- */
- private void migrateProperties() {
- this.migrateStringProperty(ECLIPSELINK_DRIVER, JpaConnection2_0.PERSISTENCE_JDBC_DRIVER, this.driver);
- this.migrateStringProperty(ECLIPSELINK_URL, JpaConnection2_0.PERSISTENCE_JDBC_URL, this.url);
- this.migrateStringProperty(ECLIPSELINK_USER, JpaConnection2_0.PERSISTENCE_JDBC_USER, this.user);
- this.migrateStringProperty(ECLIPSELINK_PASSWORD, JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD, this.password);
- }
-
- private void migrateStringProperty(String oldKey, String newKey, String value) {
- if(this.persistenceUnitKeyExists(oldKey)) {
- this.getPersistenceUnit().removeProperty(oldKey);
- this.getPersistenceUnit().setProperty(newKey, value);
- }
- }
-
- /**
- * Migrate all properties names before the property is set
- */
- @Override
- protected void preSetProperty() {
-
- this.migrateProperties();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCustomization.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCustomization.java
deleted file mode 100644
index 3d5af04ef5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkCustomization.java
+++ /dev/null
@@ -1,870 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.CompositeIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CustomizationEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Profiler;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Weaving;
-import org.eclipse.text.edits.ReplaceEdit;
-
-/**
- * EclipseLinkCustomization
- */
-public class EclipseLinkCustomization extends EclipseLinkPersistenceUnitProperties
- implements Customization
-{
- // ********** EclipseLink properties **********
- private Boolean throwExceptions;
- private Weaving weaving;
- private Boolean weavingLazy;
- private Boolean weavingChangeTracking;
- private Boolean weavingFetchGroups;
- private Boolean weavingInternal;
- private Boolean weavingEager;
- private Boolean validationOnly;
- private Boolean validateSchema;
- private List<String> sessionCustomizers;
- private String profiler; // storing EclipseLinkStringValue since value can be Profiler or custom class
- private String exceptionHandler;
-
- private List<CustomizationEntity> entities;
-
- // ********** constructors **********
- public EclipseLinkCustomization(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.entities = new ArrayList<CustomizationEntity>();
-
- this.throwExceptions =
- this.getBooleanValue(ECLIPSELINK_THROW_EXCEPTIONS);
- this.weaving =
- this.getEnumValue(ECLIPSELINK_WEAVING, Weaving.values());
- this.weavingLazy =
- this.getBooleanValue(ECLIPSELINK_WEAVING_LAZY);
- this.weavingChangeTracking =
- this.getBooleanValue(ECLIPSELINK_WEAVING_CHANGE_TRACKING);
- this.weavingFetchGroups =
- this.getBooleanValue(ECLIPSELINK_WEAVING_FETCH_GROUPS);
- this.weavingInternal =
- this.getBooleanValue(ECLIPSELINK_WEAVING_INTERNAL);
- this.weavingEager =
- this.getBooleanValue(ECLIPSELINK_WEAVING_EAGER);
- this.validationOnly =
- this.getBooleanValue(ECLIPSELINK_VALIDATION_ONLY);
- this.validateSchema =
- this.getBooleanValue(ECLIPSELINK_VALIDATE_SCHEMA);
- this.initializeSessionCustomizersFromPersistenceUnit();
-
- Set<PersistenceUnit.Property> properties =
- this.getPropertiesSetWithPrefix(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER);
- this.initializeEntitiesCustomizerClass(properties);
-
- this.profiler = this.getProfilerPropertyValue();
- this.exceptionHandler =
- this.getStringValue(ECLIPSELINK_EXCEPTION_HANDLER);
- }
-
- private void initializeSessionCustomizersFromPersistenceUnit() {
- this.sessionCustomizers = this.buildSessionCustomizers();
- }
-
- private List<String> buildSessionCustomizers() {
- return CollectionTools.list(this.convertToValues(this.getPropertiesSetWithPrefix(ECLIPSELINK_SESSION_CUSTOMIZER)));
- }
-
- private Iterable<String> convertToValues(Iterable<PersistenceUnit.Property> properties) {
- return new TransformationIterable<PersistenceUnit.Property, String>(properties) {
- @Override
- protected String transform(PersistenceUnit.Property property) {
- return property.getValue();
- }
- };
- }
-
- private void initializeEntitiesCustomizerClass(Set<PersistenceUnit.Property> descriptorCustomizerProperties) {
- for (PersistenceUnit.Property descriptorCustomizerProperty : descriptorCustomizerProperties) {
- this.setEntityDescriptorCustomizerOf(descriptorCustomizerProperty);
- }
- }
-
- /**
- * Gets the Profiler property from the persistence unit.
- */
- private String getProfilerPropertyValue() {
-
- String value = this.getStringValue(ECLIPSELINK_PROFILER);
- if (value == null) {
- return null; // no property found
- }
- Profiler standardProfiler = this.getEnumValue(ECLIPSELINK_PROFILER, Profiler.values());
- return (standardProfiler == null) ? value : getPropertyStringValueOf(standardProfiler);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_THROW_EXCEPTIONS)) {
- this.throwExceptionsChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING)) {
- this.weavingChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_LAZY)) {
- this.weavingLazyChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_CHANGE_TRACKING)) {
- this.weavingChangeTrackingChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_FETCH_GROUPS)) {
- this.weavingFetchGroupsChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_INTERNAL)) {
- this.weavingInternalChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_EAGER)) {
- this.weavingEagerChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_VALIDATION_ONLY)) {
- this.validationOnlyChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_VALIDATE_SCHEMA)) {
- this.validateSchemaChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- this.sessionCustomizersChanged();
- }
- else if (propertyName.startsWith(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER)) {
- this.descriptorCustomizerChanged(propertyName, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_PROFILER)) {
- this.profilerChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCEPTION_HANDLER)) {
- this.exceptionHandlerChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_THROW_EXCEPTIONS)) {
- this.throwExceptionsChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING)) {
- this.weavingChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_LAZY)) {
- this.weavingLazyChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_CHANGE_TRACKING)) {
- this.weavingChangeTrackingChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_FETCH_GROUPS)) {
- this.weavingFetchGroupsChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_INTERNAL)) {
- this.weavingInternalChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVING_EAGER)) {
- this.weavingEagerChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_VALIDATION_ONLY)) {
- this.validationOnlyChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_VALIDATE_SCHEMA)) {
- this.validateSchemaChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- this.sessionCustomizersChanged();
- }
- else if (propertyName.startsWith(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER)) {
- this.descriptorCustomizerChanged(propertyName, null);
- }
- else if (propertyName.equals(ECLIPSELINK_PROFILER)) {
- this.profilerChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCEPTION_HANDLER)) {
- this.exceptionHandlerChanged(null);
- }
-
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_THROW_EXCEPTIONS,
- THROW_EXCEPTIONS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING,
- WEAVING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_LAZY,
- WEAVING_LAZY_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_CHANGE_TRACKING,
- WEAVING_CHANGE_TRACKING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_FETCH_GROUPS,
- WEAVING_FETCH_GROUPS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_INTERNAL,
- WEAVING_INTERNAL_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVING_EAGER,
- WEAVING_EAGER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_VALIDATION_ONLY,
- VALIDATION_ONLY_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_VALIDATE_SCHEMA,
- VALIDATE_SCHEMA_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSION_CUSTOMIZER,
- SESSION_CUSTOMIZER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PROFILER,
- PROFILER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EXCEPTION_HANDLER,
- EXCEPTION_HANDLER_PROPERTY);
-
- // Don't need to initialize propertyNames for:
- // descriptorCustomizerProperty
- }
-
- /**
- * Method used for identifying the given property.
- */
- @Override
- public boolean itemIsProperty(PersistenceUnit.Property item) {
- boolean isProperty = super.itemIsProperty(item);
-
- if ( ! isProperty && item.getName() != null) {
- if (item.getName().startsWith(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER)) {
- return true;
- }
- }
- return isProperty;
- }
-
- /**
- * Returns the property name used for change notification of the given
- * property.
- */
- @Override
- public String propertyIdOf(PersistenceUnit.Property property) {
- try {
- return super.propertyIdOf(property);
- }
- catch (IllegalArgumentException e) {
- if (property.getName().startsWith(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER)) {
- return DESCRIPTOR_CUSTOMIZER_PROPERTY;
- }
- }
- throw new IllegalArgumentException("Illegal property: " + property); //$NON-NLS-1$
- }
-
- public CustomizationEntity addEntity(String entityName) {
- if (this.entityExists(entityName)) {
- throw new IllegalStateException("Duplicate entity: " + entityName); //$NON-NLS-1$
- }
- CustomizationEntity newEntity = this.buildEntity(entityName);
- this.addItemToList(newEntity, this.entities, ENTITIES_LIST);
- return newEntity;
- }
-
- public void removeEntity(String entityName) {
- if ( ! this.entityExists(entityName)) {
- return;
- }
- CustomizationEntity entity = this.getEntityNamed(entityName);
- this.clearEntity(entity);
- this.removeEntity(entity);
- }
-
-
- // ********** ThrowExceptions **********
- public Boolean getThrowExceptions() {
- return this.throwExceptions;
- }
-
- public void setThrowExceptions(Boolean newThrowExceptions) {
- Boolean old = this.throwExceptions;
- this.throwExceptions = newThrowExceptions;
- this.putProperty(THROW_EXCEPTIONS_PROPERTY, newThrowExceptions);
- this.firePropertyChanged(THROW_EXCEPTIONS_PROPERTY, old, newThrowExceptions);
- }
-
- private void throwExceptionsChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.throwExceptions;
- this.throwExceptions = newValue;
- this.firePropertyChanged(THROW_EXCEPTIONS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultThrowExceptions() {
- return DEFAULT_THROW_EXCEPTIONS;
- }
-
- // ********** WeavingLazy **********
- public Boolean getWeavingLazy() {
- return this.weavingLazy;
- }
-
- public void setWeavingLazy(Boolean newWeavingLazy) {
- Boolean old = this.weavingLazy;
- this.weavingLazy = newWeavingLazy;
- this.putProperty(WEAVING_LAZY_PROPERTY, newWeavingLazy);
- this.firePropertyChanged(WEAVING_LAZY_PROPERTY, old, newWeavingLazy);
- }
-
- private void weavingLazyChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingLazy;
- this.weavingLazy = newValue;
- this.firePropertyChanged(WEAVING_LAZY_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingLazy() {
- return DEFAULT_WEAVING_LAZY;
- }
-
- // ********** WeavingChangeTracking **********
- public Boolean getWeavingChangeTracking() {
- return this.weavingChangeTracking;
- }
-
- public void setWeavingChangeTracking(Boolean newWeavingChangeTracking) {
- Boolean old = this.weavingChangeTracking;
- this.weavingChangeTracking = newWeavingChangeTracking;
- this.putProperty(WEAVING_CHANGE_TRACKING_PROPERTY, newWeavingChangeTracking);
- this.firePropertyChanged(WEAVING_CHANGE_TRACKING_PROPERTY, old, newWeavingChangeTracking);
- }
-
- private void weavingChangeTrackingChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingChangeTracking;
- this.weavingChangeTracking = newValue;
- this.firePropertyChanged(WEAVING_CHANGE_TRACKING_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingChangeTracking() {
- return DEFAULT_WEAVING_CHANGE_TRACKING;
- }
-
- // ********** WeavingFetchGroups **********
- public Boolean getWeavingFetchGroups() {
- return this.weavingFetchGroups;
- }
-
- public void setWeavingFetchGroups(Boolean newWeavingFetchGroups) {
- Boolean old = this.weavingFetchGroups;
- this.weavingFetchGroups = newWeavingFetchGroups;
- this.putProperty(WEAVING_FETCH_GROUPS_PROPERTY, newWeavingFetchGroups);
- this.firePropertyChanged(WEAVING_FETCH_GROUPS_PROPERTY, old, newWeavingFetchGroups);
- }
-
- private void weavingFetchGroupsChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingFetchGroups;
- this.weavingFetchGroups = newValue;
- this.firePropertyChanged(WEAVING_FETCH_GROUPS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingFetchGroups() {
- return DEFAULT_WEAVING_FETCH_GROUPS;
- }
-
- // ********** WeavingInternal **********
- public Boolean getWeavingInternal() {
- return this.weavingInternal;
- }
-
- public void setWeavingInternal(Boolean newWeavingInternal) {
- Boolean old = this.weavingInternal;
- this.weavingInternal = newWeavingInternal;
- this.putProperty(WEAVING_INTERNAL_PROPERTY, newWeavingInternal);
- this.firePropertyChanged(WEAVING_INTERNAL_PROPERTY, old, newWeavingInternal);
- }
-
- private void weavingInternalChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingInternal;
- this.weavingInternal = newValue;
- this.firePropertyChanged(WEAVING_INTERNAL_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingInternal() {
- return DEFAULT_WEAVING_INTERNAL;
- }
-
- // ********** WeavingEager **********
- public Boolean getWeavingEager() {
- return this.weavingEager;
- }
-
- public void setWeavingEager(Boolean newWeavingEager) {
- Boolean old = this.weavingEager;
- this.weavingEager = newWeavingEager;
- this.putProperty(WEAVING_EAGER_PROPERTY, newWeavingEager);
- this.firePropertyChanged(WEAVING_EAGER_PROPERTY, old, newWeavingEager);
- }
-
- private void weavingEagerChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.weavingEager;
- this.weavingEager = newValue;
- this.firePropertyChanged(WEAVING_EAGER_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultWeavingEager() {
- return DEFAULT_WEAVING_EAGER;
- }
-
- // ********** ValidationOnly **********
- public Boolean getValidationOnly() {
- return this.validationOnly;
- }
-
- public void setValidationOnly(Boolean newValidationOnly) {
- Boolean old = this.validationOnly;
- this.validationOnly = newValidationOnly;
- this.putProperty(VALIDATION_ONLY_PROPERTY, newValidationOnly);
- this.firePropertyChanged(VALIDATION_ONLY_PROPERTY, old, newValidationOnly);
- }
-
- private void validationOnlyChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.validationOnly;
- this.validationOnly = newValue;
- this.firePropertyChanged(VALIDATION_ONLY_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultValidationOnly() {
- return DEFAULT_VALIDATION_ONLY;
- }
-
- // ********** ValidateSchema **********
- public Boolean getValidateSchema() {
- return this.validateSchema;
- }
-
- public void setValidateSchema(Boolean newValidateSchema) {
- Boolean old = this.validateSchema;
- this.validateSchema = newValidateSchema;
- this.putProperty(VALIDATE_SCHEMA_PROPERTY, newValidateSchema);
- this.firePropertyChanged(VALIDATE_SCHEMA_PROPERTY, old, newValidateSchema);
- }
-
- private void validateSchemaChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.validateSchema;
- this.validateSchema = newValue;
- this.firePropertyChanged(VALIDATE_SCHEMA_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultValidateSchema() {
- return DEFAULT_VALIDATE_SCHEMA;
- }
-
- // ********** SessionCustomizers **********
- public ListIterable<String> getSessionCustomizers(){
- return new LiveCloneListIterable<String>(this.sessionCustomizers);
- }
-
- public int getSessionCustomizersSize(){
- return this.sessionCustomizers.size();
- }
-
- public boolean sessionCustomizerExists(String sessionCustomizerClassName) {
-
- for (String sessionCustomizer : this.sessionCustomizers) {
- if(sessionCustomizer.equals(sessionCustomizerClassName)) {
- return true;
- }
- }
- return false;
- }
-
- public String addSessionCustomizer(String newSessionCustomizerClassName){
-
- if( ! this.sessionCustomizerExists(newSessionCustomizerClassName)) {
- this.addItemToList(newSessionCustomizerClassName, this.sessionCustomizers, SESSION_CUSTOMIZER_LIST);
- this.putProperty(SESSION_CUSTOMIZER_PROPERTY, newSessionCustomizerClassName, true);
- return newSessionCustomizerClassName;
- }
- return null;
- }
-
- public void removeSessionCustomizer(String className){
- if (this.removeItemFromList(className, this.sessionCustomizers, SESSION_CUSTOMIZER_LIST)) {
- this.removeProperty(SESSION_CUSTOMIZER_PROPERTY, className);
- }
- }
-
- private void sessionCustomizersChanged() {
- this.synchronizeList(this.buildSessionCustomizers(), this.sessionCustomizers, SESSION_CUSTOMIZER_LIST);
- }
-
- // ********** Weaving **********
-
- public Weaving getWeaving() {
- return this.weaving;
- }
-
- public void setWeaving(Weaving newWeaving) {
- Weaving old = this.weaving;
- this.weaving = newWeaving;
- this.putProperty(WEAVING_PROPERTY, newWeaving);
- this.firePropertyChanged(WEAVING_PROPERTY, old, newWeaving);
- }
-
- private void weavingChanged(String stringValue) {
- Weaving newValue = getEnumValueOf(stringValue, Weaving.values());
- Weaving old = this.weaving;
- this.weaving = newValue;
- this.firePropertyChanged(WEAVING_PROPERTY, old, newValue);
- }
-
- public Weaving getDefaultWeaving() {
- return DEFAULT_WEAVING;
- }
-
- // ********** ExceptionHandler **********
- public String getExceptionHandler() {
- return this.exceptionHandler;
- }
-
- public void setExceptionHandler(String newExceptionHandler) {
- String old = this.exceptionHandler;
- this.exceptionHandler = newExceptionHandler;
- this.putProperty(EXCEPTION_HANDLER_PROPERTY, newExceptionHandler);
- this.firePropertyChanged(EXCEPTION_HANDLER_PROPERTY, old, newExceptionHandler);
- }
-
- private void exceptionHandlerChanged(String newValue) {
- String old = this.exceptionHandler;
- this.exceptionHandler = newValue;
- this.firePropertyChanged(EXCEPTION_HANDLER_PROPERTY, old, newValue);
- }
-
- public String getDefaultExceptionHandler() {
- return DEFAULT_EXCEPTION_HANDLER;
- }
-
- // ********** DescriptorCustomizer **********
-
- public String getDescriptorCustomizerOf(String entityName) {
- CustomizationEntity entity = this.getEntityNamed(entityName);
- return (entity == null) ? null : entity.getDescriptorCustomizer();
- }
-
- public void setDescriptorCustomizerOf(String entityName, String newDescriptorCustomizer) {
- CustomizationEntity old = this.setEntityDescriptorCustomizerOf(entityName, newDescriptorCustomizer);
- this.putStringValue(ECLIPSELINK_DESCRIPTOR_CUSTOMIZER, entityName, newDescriptorCustomizer, false);
- this.firePropertyChanged(DESCRIPTOR_CUSTOMIZER_PROPERTY, old, this.getEntityNamed(entityName));
- }
-
- private void descriptorCustomizerChanged(String propertyName, String stringValue) {
- String entityName = this.extractEntityNameOf(propertyName);
- if( ! StringTools.stringIsEmpty(entityName)) {
- CustomizationEntity old = this.setEntityDescriptorCustomizerOf(entityName, stringValue);
- this.firePropertyChanged(DESCRIPTOR_CUSTOMIZER_PROPERTY, old, this.getEntityNamed(entityName));
- }
- }
-
- public String getDefaultDescriptorCustomizer() {
- return DEFAULT_DESCRIPTOR_CUSTOMIZER;
- }
-
- /**
- * Returns the old Entity
- */
- private CustomizationEntity setEntityDescriptorCustomizerOf(String entityName, String descriptorCustomizerClassName) {
- if(( ! this.entityExists(entityName)) && StringTools.stringIsEmpty(descriptorCustomizerClassName)) {
- //this is a property that is currently being added, we don't need to deal with it until the value is set
- return null;
- }
- CustomizationEntity entity = (this.entityExists(entityName)) ?
- this.getEntityNamed(entityName) :
- this.addEntity(entityName);
- return this.setEntityDescriptorCustomizerOf(entity, descriptorCustomizerClassName);
- }
-
- /**
- * Returns the old Entity
- */
- private CustomizationEntity setEntityDescriptorCustomizerOf(CustomizationEntity entity, String descriptorCustomizerClassName) {
- if(entity == null) {
- throw new IllegalArgumentException();
- }
- CustomizationEntity old = entity.clone();
- entity.setDescriptorCustomizer(descriptorCustomizerClassName);
- return old;
- }
-
- /**
- * Convenience method to update the descriptorCustomizerClassName in entities.
- * Returns the old Entity
- */
- private CustomizationEntity setEntityDescriptorCustomizerOf(PersistenceUnit.Property descriptorCustomizerProperty) {
- String entityName = this.extractEntityNameOf(descriptorCustomizerProperty);
- if(StringTools.stringIsEmpty(entityName)) {
- return null;
- }
- return this.setEntityDescriptorCustomizerOf(entityName, descriptorCustomizerProperty.getValue());
- }
-
- // ********** Profiler **********
- /**
- * Returns Profiler or custom profiler class.
- *
- * @return EclipseLink string value for Profiler enum or custom profiler class
- */
- public String getProfiler() {
- return this.profiler;
- }
-
- /**
- * Sets EclipseLink profiler.
- *
- * @param newProfiler - Profiler
- */
- public void setProfiler(Profiler newProfiler) {
- if( newProfiler == null) {
- this.setProfiler_((String) null);
- return;
- }
- this.setProfiler_(getPropertyStringValueOf(newProfiler));
- }
-
- /**
- * Sets EclipseLink profiler or custom profiler.
- *
- * @param newProfiler -
- * Can be a EclipseLink profiler literal or
- * a fully qualified class name of a custom profiler.
- */
- public void setProfiler(String newProfiler) {
- if( newProfiler == null) {
- this.setProfiler_((String) null);
- return;
- }
- Profiler p = Profiler.getProfilerFor(newProfiler);
- if(p == null) { // custom profiler class
- this.setProfiler_(newProfiler);
- }
- else {
- this.setProfiler(p);
- }
- }
-
- private void setProfiler_(String newProfiler) {
- String old = this.profiler;
- this.profiler = newProfiler;
- this.putProperty(PROFILER_PROPERTY, newProfiler);
- this.firePropertyChanged(PROFILER_PROPERTY, old, newProfiler);
- }
-
- private void profilerChanged(String newValue) {
- String old = this.profiler;
- this.profiler = newValue;
- this.firePropertyChanged(PROFILER_PROPERTY, old, newValue);
- }
-
- public String getDefaultProfiler() {
- return DEFAULT_PROFILER;
- }
-
-
- // ****** convenience methods *******
-
- /**
- * Set all Entity properties to default.
- */
- private void clearEntity(CustomizationEntity entity) {
- if(entity.isEmpty()) {
- return;
- }
- String entityName = entity.getName();
- this.setDescriptorCustomizerOf(entityName, null);
- }
-
- /**
- * Returns the Entity with the given name.
- */
- private CustomizationEntity getEntityNamed(String name) {
- for(CustomizationEntity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return entity;
- }
- }
- return null;
- }
-
- private CustomizationEntity buildEntity(String name) {
- return new CustomizationEntity(this, name);
- }
-
- private void removeEntity(CustomizationEntity entity) {
- if(entity == null) {
- throw new NullPointerException();
- }
- this.removeItemFromList(entity, this.entities, ENTITIES_LIST);
- }
-
- /**
- * Return whether the Entity exist.
- */
- public boolean entityExists(String name) {
- for(CustomizationEntity entity: this.entities) {
- if(entity.getName().equals(name)) {
- return true;
- }
- }
- return false;
- }
-
- // ****** entities list *******
-
- public ListIterable<CustomizationEntity> getEntities() {
- return new LiveCloneListIterable<CustomizationEntity>(this.entities);
- }
-
- public Iterable<String> getEntityNames() {
- return new TransformationIterable<CustomizationEntity, String>(this.getEntities()) {
- @Override
- protected String transform(CustomizationEntity entity) {
- return entity.getName();
- }
- };
- }
-
- public int getEntitiesSize() {
- return this.entities.size();
- }
-
-
- // ********** refactoring ************
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createSessionCustomizerRenameTypeEdits(originalType, newName),
- this.createExceptionHandlerRenameTypeEdits(originalType, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createSessionCustomizerRenameTypeEdits(final IType originalType, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<PersistenceUnit.Property, Iterable<ReplaceEdit>>(getPersistenceUnit().getPropertiesNamed(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- @Override
- protected Iterable<ReplaceEdit> transform(PersistenceUnit.Property property) {
- return property.createRenameTypeEdits(originalType, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createExceptionHandlerRenameTypeEdits(IType originalType, String newName) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_EXCEPTION_HANDLER);
- return (property != null) ?
- property.createRenameTypeEdits(originalType, newName) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- this.createSessionCustomizerMoveTypeEdits(originalType, newPackage),
- this.createExceptionHandlerMoveTypeEdits(originalType, newPackage)
- );
- }
-
- protected Iterable<ReplaceEdit> createSessionCustomizerMoveTypeEdits(final IType originalType, final IPackageFragment newPackage) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<PersistenceUnit.Property, Iterable<ReplaceEdit>>(getPersistenceUnit().getPropertiesNamed(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- @Override
- protected Iterable<ReplaceEdit> transform(PersistenceUnit.Property property) {
- return property.createMoveTypeEdits(originalType, newPackage);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createExceptionHandlerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_EXCEPTION_HANDLER);
- return (property != null) ?
- property.createMoveTypeEdits(originalType, newPackage) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return new CompositeIterable<ReplaceEdit>(
- this.createSessionCustomizerRenamePackageEdits(originalPackage, newName),
- this.createExceptionHandlerRenamePackageEdits(originalPackage, newName)
- );
- }
-
- protected Iterable<ReplaceEdit> createSessionCustomizerRenamePackageEdits(final IPackageFragment originalPackage, final String newName) {
- return new CompositeIterable<ReplaceEdit>(
- new TransformationIterable<PersistenceUnit.Property, Iterable<ReplaceEdit>>(getPersistenceUnit().getPropertiesNamed(ECLIPSELINK_SESSION_CUSTOMIZER)) {
- @Override
- protected Iterable<ReplaceEdit> transform(PersistenceUnit.Property property) {
- return property.createRenamePackageEdits(originalPackage, newName);
- }
- }
- );
- }
-
- protected Iterable<ReplaceEdit> createExceptionHandlerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_EXCEPTION_HANDLER);
- return (property != null) ?
- property.createRenamePackageEdits(originalPackage, newName) :
- EmptyIterable.<ReplaceEdit>instance();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkGeneralProperties.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkGeneralProperties.java
deleted file mode 100644
index a431f95779..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkGeneralProperties.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.GeneralProperties;
-
-/**
- * EclipseLinkGeneralProperties
- */
-public class EclipseLinkGeneralProperties extends EclipseLinkPersistenceUnitProperties
- implements GeneralProperties
-{
- // ********** EclipseLink properties **********
- private Boolean excludeEclipselinkOrm;
-
- // ********** constructors **********
- public EclipseLinkGeneralProperties(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
-
- this.excludeEclipselinkOrm =
- this.getBooleanValue(ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM);
- }
-
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM)) {
- excludeEclipselinkOrmChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM)) {
- excludeEclipselinkOrmChanged(null);
- }
- }
-
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM,
- EXCLUDE_ECLIPSELINK_ORM_PROPERTY);
- }
-
-
- // ********** ExcludeEclipselinkOrm **********
- public Boolean getExcludeEclipselinkOrm() {
- return this.excludeEclipselinkOrm;
- }
-
- public void setExcludeEclipselinkOrm(Boolean newExcludeEclipselinkOrm) {
- Boolean old = this.excludeEclipselinkOrm;
- this.excludeEclipselinkOrm = newExcludeEclipselinkOrm;
- this.putProperty(EXCLUDE_ECLIPSELINK_ORM_PROPERTY, newExcludeEclipselinkOrm);
- this.firePropertyChanged(EXCLUDE_ECLIPSELINK_ORM_PROPERTY, old, newExcludeEclipselinkOrm);
- }
-
- private void excludeEclipselinkOrmChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.excludeEclipselinkOrm;
- this.excludeEclipselinkOrm = newValue;
- this.firePropertyChanged(EXCLUDE_ECLIPSELINK_ORM_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultExcludeEclipselinkOrm() {
- return DEFAULT_EXCLUDE_ECLIPSELINK_ORM;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java
deleted file mode 100644
index e1cc5b2cdd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkJarFileRef.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractJarFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJarFileRef;
-
-public class EclipseLinkJarFileRef
- extends AbstractJarFileRef
-{
- public EclipseLinkJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- super(parent, xmlJarFileRef);
- }
-
- @Override
- protected IPath[] buildRuntimeJarFilePathWeb(IPath root, IPath jarFilePath) {
- IPath[] genericPath = super.buildRuntimeJarFilePathWeb(root, jarFilePath);
- return ArrayTools.removeLast(genericPath);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging.java
deleted file mode 100644
index e262cf4b30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging.java
+++ /dev/null
@@ -1,408 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logger;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-import org.eclipse.text.edits.ReplaceEdit;
-
-/**
- * EclipseLinkLogging
- */
-public class EclipseLinkLogging extends EclipseLinkPersistenceUnitProperties
- implements Logging
-{
- // ********** EclipseLink properties **********
- private LoggingLevel level;
- private Boolean timestamp;
- private Boolean thread;
- private Boolean session;
- private Boolean exceptions;
- private String logFileLocation;
- private String logger; // storing EclipseLinkStringValue since value can be Logger or custom class
-
- // ********** constructors **********
- public EclipseLinkLogging(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- // TOREVIEW - handle incorrect String in persistence.xml
- this.level =
- this.getEnumValue(ECLIPSELINK_LEVEL, LoggingLevel.values());
- this.timestamp =
- this.getBooleanValue(ECLIPSELINK_TIMESTAMP);
- this.thread =
- this.getBooleanValue(ECLIPSELINK_THREAD);
- this.session =
- this.getBooleanValue(ECLIPSELINK_SESSION);
- this.exceptions =
- this.getBooleanValue(ECLIPSELINK_EXCEPTIONS);
- this.logFileLocation =
- this.getStringValue(ECLIPSELINK_LOG_FILE_LOCATION);
-
- this.logger = this.getLoggerProtertyValue();
- }
-
- /**
- * Gets the Logger property from the persistence unit.
- */
- private String getLoggerProtertyValue() {
-
- String value = this.getStringValue(ECLIPSELINK_LOGGER);
- if (value == null) {
- return null; // no property found
- }
- Logger standardLogger = this.getEnumValue(ECLIPSELINK_LOGGER, Logger.values());
- return (standardLogger == null) ? value : getPropertyStringValueOf(standardLogger);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_LEVEL)) {
- this.levelChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TIMESTAMP)) {
- this.timestampChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_THREAD)) {
- this.threadChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION)) {
- this.sessionChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCEPTIONS)) {
- this.exceptionsChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_LOG_FILE_LOCATION)) {
- this.logFileLocationChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_LOGGER)) {
- this.loggerChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_LEVEL)) {
- this.levelChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_TIMESTAMP)) {
- this.timestampChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_THREAD)) {
- this.threadChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION)) {
- this.sessionChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_EXCEPTIONS)) {
- this.exceptionsChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_LOG_FILE_LOCATION)) {
- this.logFileLocationChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_LOGGER)) {
- this.loggerChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_LEVEL,
- LEVEL_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TIMESTAMP,
- TIMESTAMP_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_THREAD,
- THREAD_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSION,
- SESSION_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EXCEPTIONS,
- EXCEPTIONS_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_LOG_FILE_LOCATION,
- LOG_FILE_LOCATION_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_LOGGER,
- LOGGER_PROPERTY);
- }
-
- // ********** LoggingLevel **********
-
- public LoggingLevel getLevel() {
- return this.level;
- }
-
- public void setLevel(LoggingLevel newLevel) {
- LoggingLevel old = this.level;
- this.level = newLevel;
- this.putProperty(LEVEL_PROPERTY, newLevel);
- this.firePropertyChanged(LEVEL_PROPERTY, old, newLevel);
- }
-
- private void levelChanged(String stringValue) {
- LoggingLevel newValue = getEnumValueOf(stringValue, LoggingLevel.values());
- LoggingLevel old = this.level;
- this.level = newValue;
- this.firePropertyChanged(LEVEL_PROPERTY, old, newValue);
- }
-
- public LoggingLevel getDefaultLevel() {
- return DEFAULT_LEVEL;
- }
-
- // ********** Timestamp **********
- public Boolean getTimestamp() {
- return this.timestamp;
- }
-
- public void setTimestamp(Boolean newTimestamp) {
- Boolean old = this.timestamp;
- this.timestamp = newTimestamp;
- this.putProperty(TIMESTAMP_PROPERTY, newTimestamp);
- this.firePropertyChanged(TIMESTAMP_PROPERTY, old, newTimestamp);
- }
-
- private void timestampChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.timestamp;
- this.timestamp = newValue;
- this.firePropertyChanged(TIMESTAMP_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultTimestamp() {
- return DEFAULT_TIMESTAMP;
- }
-
- // ********** Thread **********
- public Boolean getThread() {
- return this.thread;
- }
-
- public void setThread(Boolean newThread) {
- Boolean old = this.thread;
- this.thread = newThread;
- this.putProperty(THREAD_PROPERTY, newThread);
- this.firePropertyChanged(THREAD_PROPERTY, old, newThread);
- }
-
- private void threadChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.thread;
- this.thread = newValue;
- this.firePropertyChanged(THREAD_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultThread() {
- return DEFAULT_THREAD;
- }
-
- // ********** Session **********
- public Boolean getSession() {
- return this.session;
- }
-
- public void setSession(Boolean newSession) {
- Boolean old = this.session;
- this.session = newSession;
- this.putProperty(SESSION_PROPERTY, newSession);
- this.firePropertyChanged(SESSION_PROPERTY, old, newSession);
- }
-
- private void sessionChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.session;
- this.session = newValue;
- this.firePropertyChanged(SESSION_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultSession() {
- return DEFAULT_SESSION;
- }
-
- // ********** Exceptions **********
- public Boolean getExceptions() {
- return this.exceptions;
- }
-
- public void setExceptions(Boolean newExceptions) {
- Boolean old = this.exceptions;
- this.exceptions = newExceptions;
- this.putProperty(EXCEPTIONS_PROPERTY, newExceptions);
- this.firePropertyChanged(EXCEPTIONS_PROPERTY, old, newExceptions);
- }
-
- private void exceptionsChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.exceptions;
- this.exceptions = newValue;
- this.firePropertyChanged(EXCEPTIONS_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultExceptions() {
- return DEFAULT_EXCEPTIONS;
- }
-
- // ********** logFileLocation **********
- public String getLogFileLocation() {
- return this.logFileLocation;
- }
-
- public void setLogFileLocation(String newLogFileLocation) {
- String old = this.logFileLocation;
- this.logFileLocation = (StringTools.stringIsNotEmpty(newLogFileLocation)) ?
- newLogFileLocation :
- this.getDefaultLogFileLocation();
- this.putProperty(LOG_FILE_LOCATION_PROPERTY, this.logFileLocation);
- this.firePropertyChanged(LOG_FILE_LOCATION_PROPERTY, old, this.logFileLocation);
- }
-
- private void logFileLocationChanged(String newValue) {
- String old = this.logFileLocation;
- this.logFileLocation = newValue;
- this.firePropertyChanged(LOG_FILE_LOCATION_PROPERTY, old, newValue);
- }
-
- public String getDefaultLogFileLocation() {
- return DEFAULT_LOG_FILE_LOCATION;
- }
-
- // ********** Logger **********
- /**
- * Returns Logger or custom logger class.
- *
- * @return EclipseLink string value for Logger enum or custom logger class
- */
- public String getLogger() {
- return this.logger;
- }
-
- /**
- * Sets EclipseLink logger.
- *
- * @param newLogger - Logger
- */
- public void setLogger(Logger newLogger) {
- if( newLogger == null) {
- this.setLogger_((String) null);
- return;
- }
- this.setLogger_(getPropertyStringValueOf(newLogger));
- }
-
- /**
- * Sets EclipseLink logger or custom logger.
- *
- * @param newLogger -
- * Can be a EclipseLink logger literal or
- * a fully qualified class name of a custom logger.
- */
- public void setLogger(String newLogger) {
- if( newLogger == null) {
- this.setLogger_(null);
- return;
- }
- Logger l = Logger.getLoggerFor(newLogger);
- if(l == null) { // custom Logger class
- this.setLogger_(newLogger);
- }
- else {
- this.setLogger(l);
- }
- }
-
- private void setLogger_(String newLogger) {
- String old = this.logger;
- this.logger = newLogger;
- this.putProperty(LOGGER_PROPERTY, newLogger);
- this.firePropertyChanged(LOGGER_PROPERTY, old, newLogger);
- }
-
- private void loggerChanged(String newValue) {
- String old = this.logger;
- this.logger = newValue;
- this.firePropertyChanged(LOGGER_PROPERTY, old, newValue);
- }
-
- public String getDefaultLogger() {
- return DEFAULT_LOGGER;
- }
-
-
- // ********** refactoring ************
-
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return this.createLoggerRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createLoggerRenameTypeEdits(IType originalType, String newName) {
- //TODO seems like we should have the Property stored in a SessionCustomizer object instead of having to go
- //find all of the Properties from the persistence unit.
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_LOGGER);
- if (property != null) {
- return property.createRenameTypeEdits(originalType, newName);
- }
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.createLoggerMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createLoggerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_LOGGER);
- if (property != null) {
- return property.createMoveTypeEdits(originalType, newPackage);
- }
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.createLoggerRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createLoggerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- //find all of the Properties from the persistence unit.
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_LOGGER);
- if (property != null) {
- return property.createRenamePackageEdits(originalPackage, newName);
- }
- return EmptyIterable.instance();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging2_0.java
deleted file mode 100644
index f9620744b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkLogging2_0.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-
-/**
- * EclipseLinkLogging2_0
- */
-public class EclipseLinkLogging2_0 extends EclipseLinkLogging
- implements Logging2_0
-{
- // ********** EclipseLink properties **********
-
- /**
- * Store Category levels in a map
- * key/value pairs, where:
- * key = Category property id
- * value = value
- */
- private Map<String, LoggingLevel> categoryValues;
-
- private Boolean connection;
-
- private LoggingLevel categoriesDefaultValue;
-
- // ********** constructors **********
- public EclipseLinkLogging2_0(PersistenceUnit2_0 parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- super.initializeProperties();
-
- this.connection =
- this.getBooleanValue(ECLIPSELINK_CONNECTION);
-
- this.categoriesDefaultValue =
- this.getEnumValue(ECLIPSELINK_LEVEL, LoggingLevel.values());
- this.initializeCategory(SQL_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(TRANSACTION_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(EVENT_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(CONNECTION_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(QUERY_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(CACHE_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(PROPAGATION_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(SEQUENCING_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(EJB_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(DMS_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(METAMODEL_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(WEAVER_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(PROPERTIES_CATEGORY_LOGGING_PROPERTY);
- this.initializeCategory(SERVER_CATEGORY_LOGGING_PROPERTY);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
-
- this.categoryValues = new HashMap<String, LoggingLevel>();
- }
-
- /**
- * Convenience method to set a logging level category value from the value in the persistence unit.
- *
- * key = Category property id; value = value (LoggingLevel)
- * @param categoryId - Category property id
- */
- private void initializeCategory(String categoryId) {
- String puKey = this.persistenceUnitKeyOf(categoryId);
- LoggingLevel puValue = this.getEnumValue(puKey, LoggingLevel.values());
-
- this.categoryValues.put(categoryId, puValue);
- }
-
- // ********** behavior **********
-
- @Override
- public void propertyValueChanged(String propertyName, String newValue) {
- super.propertyValueChanged(propertyName, newValue);
-
- if (propertyName.equals(ECLIPSELINK_CONNECTION)) {
- this.connectionChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL, newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL, newValue);
- }
- }
-
- @Override
- public void propertyRemoved(String propertyName) {
- super.propertyRemoved(propertyName);
-
- if (propertyName.equals(ECLIPSELINK_CONNECTION)) {
- this.connectionChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL, null);
- }
- else if (propertyName.equals(ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL)) {
- this.categoryLoggingChanged_(ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL, null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- super.addPropertyNames(propertyNames);
-
- propertyNames.put(
- ECLIPSELINK_CONNECTION,
- CONNECTION_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL,
- SQL_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL,
- TRANSACTION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL,
- EVENT_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL,
- CONNECTION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL,
- QUERY_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL,
- CACHE_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL,
- PROPAGATION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL,
- SEQUENCING_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL,
- EJB_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL,
- DMS_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL,
- EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL,
- METAMODEL_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL,
- WEAVER_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL,
- PROPERTIES_CATEGORY_LOGGING_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL,
- SERVER_CATEGORY_LOGGING_PROPERTY);
- }
-
- // ********** Connection **********
- public Boolean getConnection() {
- return this.connection;
- }
-
- public void setConnection(Boolean newConnection) {
- Boolean old = this.connection;
- this.connection = newConnection;
- this.putProperty(CONNECTION_PROPERTY, newConnection);
- this.firePropertyChanged(CONNECTION_PROPERTY, old, newConnection);
- }
-
- private void connectionChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.connection;
- this.connection = newValue;
- this.firePropertyChanged(CONNECTION_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultConnection() {
- return DEFAULT_CONNECTION;
- }
-
- // ********** Category Levels **********
-
- public LoggingLevel getLevel(String category) {
-
- return this.categoryValues.get(category);
- }
-
- public void setLevel(String category, LoggingLevel newLevel) {
- LoggingLevel old = this.getLevel(category);
- this.categoryValues.put(category, newLevel);
- this.putProperty(category, newLevel);
- this.firePropertyChanged(category, old, newLevel);
- }
-
- private void categoryLoggingChanged_(String eclipselinkKey, String stringValue) {
- String category = this.propertyIdOf(eclipselinkKey);
- this.categoryLoggingChanged(category, stringValue);
- }
-
- private void categoryLoggingChanged(String category, String stringValue) {
- LoggingLevel enumValue = getEnumValueOf(stringValue, LoggingLevel.values());
- LoggingLevel old = this.getLevel(category);
- this.categoryValues.put(category, enumValue);
- this.firePropertyChanged(category, old, enumValue);
- }
-
- public LoggingLevel getCategoriesDefaultLevel() {
- return (this.categoriesDefaultValue == null) ? super.getDefaultLevel() : this.categoriesDefaultValue;
- }
-
- @Override
- public void setLevel(LoggingLevel level) {
- super.setLevel(level);
- this.setDefaultLevel(level);
- }
-
- public void setDefaultLevel(LoggingLevel level) {
- LoggingLevel old = this.categoriesDefaultValue;
- this.categoriesDefaultValue = level;
- this.firePropertyChanged(CATEGORIES_DEFAULT_LOGGING_PROPERTY, old, level);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions.java
deleted file mode 100644
index 6f99ed37f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetDatabase;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetServer;
-import org.eclipse.text.edits.ReplaceEdit;
-
-/**
- * EclipseLinkOptions
- */
-public class EclipseLinkOptions extends EclipseLinkPersistenceUnitProperties
- implements Options
-{
- // ********** EclipseLink properties **********
- private String sessionName;
- private String sessionsXml;
- private Boolean includeDescriptorQueries;
- private String targetDatabase; // storing EclipseLinkStringValue since value can be TargetDatabase or custom class
- private String targetServer; // storing EclipseLinkStringValue since value can be TargetServer or custom class
- private String eventListener;
- private Boolean temporalMutable;
-
-
- // ********** constructors **********
- public EclipseLinkOptions(PersistenceUnit parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- // TOREVIEW - handle incorrect String in persistence.xml
- this.sessionName =
- this.getStringValue(ECLIPSELINK_SESSION_NAME);
- this.sessionsXml =
- this.getStringValue(ECLIPSELINK_SESSIONS_XML);
- this.includeDescriptorQueries =
- this.getBooleanValue(ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES);
- this.targetDatabase = this.getTargetDatabaseFromPersistenceXml();
- this.targetServer = this.getTargetServerFromPersistenceXml();
- this.eventListener =
- this.getStringValue(ECLIPSELINK_SESSION_EVENT_LISTENER);
- this.temporalMutable =
- this.getBooleanValue(ECLIPSELINK_TEMPORAL_MUTABLE);
- }
-
- protected String getTargetDatabaseFromPersistenceXml() {
-
- String value = this.getStringValue(ECLIPSELINK_TARGET_DATABASE);
- if (value == null) {
- return null;
- }
- TargetDatabase standardTargetDatabase = this.getEnumValue(ECLIPSELINK_TARGET_DATABASE, TargetDatabase.values());
- return (standardTargetDatabase == null) ? value : getPropertyStringValueOf(standardTargetDatabase);
- }
-
- protected String getTargetServerFromPersistenceXml() {
-
- String value = this.getStringValue(ECLIPSELINK_TARGET_SERVER);
- if (value == null) {
- return null;
- }
- TargetServer standardTargetServer = this.getEnumValue(ECLIPSELINK_TARGET_SERVER, TargetServer.values());
- return (standardTargetServer == null) ? value : getPropertyStringValueOf(standardTargetServer);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_SESSION_NAME)) {
- this.sessionNameChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSIONS_XML)) {
- this.sessionsXmlChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TARGET_DATABASE)) {
- this.targetDatabaseChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TARGET_SERVER)) {
- this.targetServerChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES)) {
- this.includeDescriptorQueriesChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_EVENT_LISTENER)) {
- this.eventListenerChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_TEMPORAL_MUTABLE)) {
- this.temporalMutableChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_SESSION_NAME)) {
- this.sessionNameChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSIONS_XML)) {
- this.sessionsXmlChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_TARGET_DATABASE)) {
- this.targetDatabaseChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_TARGET_SERVER)) {
- this.targetServerChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES)) {
- this.includeDescriptorQueriesChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_SESSION_EVENT_LISTENER)) {
- this.eventListenerChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_TEMPORAL_MUTABLE)) {
- this.temporalMutableChanged(null);
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = EclipseLink property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_SESSION_NAME,
- SESSION_NAME_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSIONS_XML,
- SESSIONS_XML_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES,
- SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TARGET_DATABASE,
- TARGET_DATABASE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TARGET_SERVER,
- TARGET_SERVER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_SESSION_EVENT_LISTENER,
- SESSION_EVENT_LISTENER_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_TEMPORAL_MUTABLE,
- TEMPORAL_MUTABLE_PROPERTY);
- }
-
-
- // ********** SessionName **********
- public String getSessionName() {
- return this.sessionName;
- }
-
- public void setSessionName(String newSessionName) {
- String old = this.sessionName;
- this.sessionName = newSessionName;
- this.putProperty(SESSION_NAME_PROPERTY, newSessionName);
- this.firePropertyChanged(SESSION_NAME_PROPERTY, old, newSessionName);
- }
-
- private void sessionNameChanged(String newValue) {
- String old = this.sessionName;
- this.sessionName = newValue;
- this.firePropertyChanged(SESSION_NAME_PROPERTY, old, newValue);
- }
-
- public String getDefaultSessionName() {
- return DEFAULT_SESSION_NAME;
- }
-
- // ********** SessionsXml **********
- public String getSessionsXml() {
- return this.sessionsXml;
- }
-
- public void setSessionsXml(String newSessionsXml) {
- String old = this.sessionsXml;
- this.sessionsXml = newSessionsXml;
- this.putProperty(SESSIONS_XML_PROPERTY, newSessionsXml);
- this.firePropertyChanged(SESSIONS_XML_PROPERTY, old, newSessionsXml);
- }
-
- private void sessionsXmlChanged(String newValue) {
- String old = this.sessionsXml;
- this.sessionsXml = newValue;
- this.firePropertyChanged(SESSIONS_XML_PROPERTY, old, newValue);
- }
-
- public String getDefaultSessionsXml() {
- return DEFAULT_SESSIONS_XML;
- }
-
- // ********** IncludeDescriptorQueries **********
- public Boolean getIncludeDescriptorQueries() {
- return this.includeDescriptorQueries;
- }
-
- public void setIncludeDescriptorQueries(Boolean newIncludeDescriptorQueries) {
- Boolean old = this.includeDescriptorQueries;
- this.includeDescriptorQueries = newIncludeDescriptorQueries;
- this.putProperty(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, newIncludeDescriptorQueries);
- this.firePropertyChanged(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, old, newIncludeDescriptorQueries);
- }
-
- private void includeDescriptorQueriesChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.includeDescriptorQueries;
- this.includeDescriptorQueries = newValue;
- this.firePropertyChanged(SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultIncludeDescriptorQueries() {
- return DEFAULT_SESSION_INCLUDE_DESCRIPTOR_QUERIES;
- }
-
- // ********** TargetDatabase **********
- /**
- * Returns TargetDatabase or custom targetDatabase class.
- *
- * @return EclipseLink string value for TargetDatabase enum or custom targetDatabase class
- */
- public String getTargetDatabase() {
- return this.targetDatabase;
- }
-
- /**
- * Sets EclipseLink targetDatabase.
- *
- * @param newTargetDatabase - TargetDatabase
- */
- public void setTargetDatabase(TargetDatabase newTargetDatabase) {
- if( newTargetDatabase == null) {
- this.setTargetDatabase_((String) null);
- return;
- }
- this.setTargetDatabase_(getPropertyStringValueOf(newTargetDatabase));
- }
-
- /**
- * Sets EclipseLink targetDatabase or custom targetDatabase.
- *
- * @param newTargetDatabase -
- * Can be a EclipseLink TargetDatabase literal or
- * a fully qualified class name of a custom targetDatabase.
- */
- public void setTargetDatabase(String newTargetDatabase) {
- if( newTargetDatabase == null) {
- this.setTargetDatabase_((String) null);
- return;
- }
- TargetDatabase customTargetDatabase = TargetDatabase.getTargetDatabaseFor(newTargetDatabase);
- if(customTargetDatabase == null) { // custom TargetDatabase class
- this.setTargetDatabase_(newTargetDatabase);
- }
- else {
- this.setTargetDatabase(customTargetDatabase);
- }
- }
-
- private void setTargetDatabase_(String newTargetDatabase) {
- String old = this.targetDatabase;
- this.targetDatabase = newTargetDatabase;
- this.putProperty(TARGET_DATABASE_PROPERTY, newTargetDatabase);
- this.firePropertyChanged(TARGET_DATABASE_PROPERTY, old, newTargetDatabase);
- }
-
- private void targetDatabaseChanged(String newValue) {
- String old = this.targetDatabase;
- this.targetDatabase = newValue;
- this.firePropertyChanged(TARGET_DATABASE_PROPERTY, old, newValue);
- }
-
- public String getDefaultTargetDatabase() {
- return DEFAULT_TARGET_DATABASE;
- }
-
- // ********** TargetServer **********
- /**
- * Returns TargetServer or custom targetServer class.
- *
- * @return EclipseLink string value for TargetServer enum or custom targetServer class
- */
- public String getTargetServer() {
- return this.targetServer;
- }
-
- /**
- * Sets EclipseLink targetServer.
- *
- * @param newTargetServer - TargetServer
- */
- public void setTargetServer(TargetServer newTargetServer) {
- if( newTargetServer == null) {
- this.setTargetServer_((String) null);
- return;
- }
- this.setTargetServer_(getPropertyStringValueOf(newTargetServer));
- }
-
- /**
- * Sets EclipseLink targetServer or custom targetServer.
- *
- * @param newTargetServer -
- * Can be a EclipseLink TargetServer literal or
- * a fully qualified class name of a custom targetServer.
- */
- public void setTargetServer(String newTargetServer) {
- if( newTargetServer == null) {
- this.setTargetServer_((String) null);
- return;
- }
- TargetServer customTargetServer = TargetServer.getTargetServerFor(newTargetServer);
- if(customTargetServer == null) { // custom TargetServer class
- this.setTargetServer_(newTargetServer);
- }
- else {
- this.setTargetServer(customTargetServer);
- }
- }
-
- private void setTargetServer_(String newTargetServer) {
- String old = this.targetServer;
- this.targetServer = newTargetServer;
- this.putProperty(TARGET_SERVER_PROPERTY, newTargetServer);
- this.firePropertyChanged(TARGET_SERVER_PROPERTY, old, newTargetServer);
- }
-
- private void targetServerChanged(String newValue) {
- String old = this.targetServer;
- this.targetServer = newValue;
- this.firePropertyChanged(TARGET_SERVER_PROPERTY, old, newValue);
- }
-
- public String getDefaultTargetServer() {
- return DEFAULT_TARGET_SERVER;
- }
-
- // ********** EventListener **********
- public String getEventListener() {
- return this.eventListener;
- }
-
- public void setEventListener(String newEventListener) {
- String old = this.eventListener;
- this.eventListener = newEventListener;
- this.putProperty(SESSION_EVENT_LISTENER_PROPERTY, newEventListener);
- this.firePropertyChanged(SESSION_EVENT_LISTENER_PROPERTY, old, newEventListener);
- }
-
- private void eventListenerChanged(String newValue) {
- String old = this.eventListener;
- this.eventListener = newValue;
- this.firePropertyChanged(SESSION_EVENT_LISTENER_PROPERTY, old, newValue);
- }
-
- public String getDefaultEventListener() {
- return DEFAULT_SESSION_EVENT_LISTENER;
- }
-
- // ********** TemporalMutable **********
-
- public Boolean getTemporalMutable() {
- return this.temporalMutable;
- }
-
- public void setTemporalMutable(Boolean newTemporalMutable) {
- Boolean old = this.temporalMutable;
- this.temporalMutable = newTemporalMutable;
- this.putProperty(TEMPORAL_MUTABLE_PROPERTY, newTemporalMutable);
- this.firePropertyChanged(TEMPORAL_MUTABLE_PROPERTY, old, newTemporalMutable);
- }
-
- private void temporalMutableChanged(String stringValue) {
- Boolean newValue = getBooleanValueOf(stringValue);
-
- Boolean old = this.temporalMutable;
- this.temporalMutable = newValue;
- this.firePropertyChanged(TEMPORAL_MUTABLE_PROPERTY, old, newValue);
- }
-
- public Boolean getDefaultTemporalMutable() {
- return DEFAULT_TEMPORAL_MUTABLE;
- }
-
-
- // ********** refactoring ************
-
- @Override
- public Iterable<ReplaceEdit> createRenameTypeEdits(IType originalType, String newName) {
- return this.createEventListenerRenameTypeEdits(originalType, newName);
- }
-
- protected Iterable<ReplaceEdit> createEventListenerRenameTypeEdits(IType originalType, String newName) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_SESSION_EVENT_LISTENER);
- if (property != null) {
- return property.createRenameTypeEdits(originalType, newName);
- }
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<ReplaceEdit> createMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- return this.createEventListenerMoveTypeEdits(originalType, newPackage);
- }
-
- protected Iterable<ReplaceEdit> createEventListenerMoveTypeEdits(IType originalType, IPackageFragment newPackage) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_SESSION_EVENT_LISTENER);
- if (property != null) {
- return property.createMoveTypeEdits(originalType, newPackage);
- }
- return EmptyIterable.instance();
- }
-
- @Override
- public Iterable<ReplaceEdit> createRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- return this.createEventListenerRenamePackageEdits(originalPackage, newName);
- }
-
- protected Iterable<ReplaceEdit> createEventListenerRenamePackageEdits(IPackageFragment originalPackage, String newName) {
- PersistenceUnit.Property property = getPersistenceUnit().getProperty(ECLIPSELINK_SESSION_EVENT_LISTENER);
- if (property != null) {
- return property.createRenamePackageEdits(originalPackage, newName);
- }
- return EmptyIterable.instance();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions2_0.java
deleted file mode 100644
index 179b04a8c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkOptions2_0.java
+++ /dev/null
@@ -1,345 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.List;
-import java.util.Map;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-
-/**
- * EclipseLinkOptions2_0
- */
-public class EclipseLinkOptions2_0 extends EclipseLinkOptions
- implements Options2_0
-{
- // ********** GenericConnection properties **********
- private Integer lockTimeout;
- private Integer queryTimeout;
- private List<String> validationGroupPrePersists;
- private List<String> validationGroupPreUpdates;
- private List<String> validationGroupPreRemoves;
-
- // ********** constructors **********
- public EclipseLinkOptions2_0(PersistenceUnit2_0 parent) {
- super(parent);
- }
-
- // ********** initialization **********
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- super.initializeProperties();
-
- this.lockTimeout =
- this.getIntegerValue(PERSISTENCE_LOCK_TIMEOUT);
- this.queryTimeout =
- this.getIntegerValue(PERSISTENCE_QUERY_TIMEOUT);
-
- // ValidationMode is initialized with the persistence unit element
- this.validationGroupPrePersists = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST);
- this.validationGroupPreUpdates = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE);
- this.validationGroupPreRemoves = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE);
- }
-
- // ********** behavior **********
-
- @Override
- public void propertyValueChanged(String propertyName, String newValue) {
- super.propertyValueChanged(propertyName, newValue);
-
- if (propertyName.equals(PERSISTENCE_LOCK_TIMEOUT)) {
- this.lockTimeoutChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_QUERY_TIMEOUT)) {
- this.queryTimeoutChanged(newValue);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST)) {
- this.validationGroupPrePersistsChanged();
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE)) {
- this.validationGroupPreUpdatesChanged();
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE)) {
- this.validationGroupPreRemovesChanged();
- }
- }
-
- @Override
- public void propertyRemoved(String propertyName) {
- super.propertyRemoved(propertyName);
-
- if (propertyName.equals(PERSISTENCE_LOCK_TIMEOUT)) {
- this.lockTimeoutChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_QUERY_TIMEOUT)) {
- this.queryTimeoutChanged(null);
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST)) {
- this.validationGroupPrePersistsChanged();
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE)) {
- this.validationGroupPreUpdatesChanged();
- }
- else if (propertyName.equals(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE)) {
- this.validationGroupPreRemovesChanged();
- }
- }
-
- /**
- * Adds property names key/value pairs, where:
- * key = PU property key
- * value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- super.addPropertyNames(propertyNames);
-
- propertyNames.put(
- PERSISTENCE_LOCK_TIMEOUT,
- LOCK_TIMEOUT_PROPERTY);
- propertyNames.put(
- PERSISTENCE_QUERY_TIMEOUT,
- QUERY_TIMEOUT_PROPERTY);
- propertyNames.put(
- PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST,
- VALIDATION_GROUP_PRE_PERSIST_PROPERTY);
- propertyNames.put(
- PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE,
- VALIDATION_GROUP_PRE_UPDATE_PROPERTY);
- propertyNames.put(
- PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE,
- VALIDATION_GROUP_PRE_REMOVE_PROPERTY);
- }
-
- @Override
- public PersistenceUnit2_0 getPersistenceUnit() {
- return (PersistenceUnit2_0) super.getPersistenceUnit();
- }
-
- // ********** LockTimeout **********
- public Integer getLockTimeout() {
- return this.lockTimeout;
- }
-
- public void setLockTimeout(Integer newLockTimeout) {
- Integer old = this.lockTimeout;
- this.lockTimeout = newLockTimeout;
- this.putProperty(LOCK_TIMEOUT_PROPERTY, newLockTimeout);
- this.firePropertyChanged(LOCK_TIMEOUT_PROPERTY, old, newLockTimeout);
- }
-
- private void lockTimeoutChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.lockTimeout;
- this.lockTimeout = newValue;
- this.firePropertyChanged(LOCK_TIMEOUT_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultLockTimeout() {
- return DEFAULT_LOCK_TIMEOUT;
- }
-
- // ********** QueryTimeout **********
- public Integer getQueryTimeout() {
- return this.queryTimeout;
- }
-
- public void setQueryTimeout(Integer newQueryTimeout) {
- Integer old = this.queryTimeout;
- this.queryTimeout = newQueryTimeout;
- this.putProperty(QUERY_TIMEOUT_PROPERTY, newQueryTimeout);
- this.firePropertyChanged(QUERY_TIMEOUT_PROPERTY, old, newQueryTimeout);
- }
-
- private void queryTimeoutChanged(String stringValue) {
- Integer newValue = getIntegerValueOf(stringValue);
-
- Integer old = this.queryTimeout;
- this.queryTimeout = newValue;
- this.firePropertyChanged(QUERY_TIMEOUT_PROPERTY, old, newValue);
- }
-
- public Integer getDefaultQueryTimeout() {
- return DEFAULT_QUERY_TIMEOUT;
- }
-
-
- // ********** ValidationGroupPrePersists **********
-
- public ListIterable<String> getValidationGroupPrePersists(){
- return new LiveCloneListIterable<String>(this.validationGroupPrePersists);
- }
-
- public int getValidationGroupPrePersistsSize(){
- return this.validationGroupPrePersists.size();
- }
-
- public boolean validationGroupPrePersistExists(String validationGroupPrePersistClassName) {
-
- for (String validationGroupPrePersist : this.validationGroupPrePersists) {
- if(validationGroupPrePersist.equals(validationGroupPrePersistClassName)) {
- return true;
- }
- }
- return false;
- }
-
- public String addValidationGroupPrePersist(String newPrePersistClassName){
-
- if( ! this.validationGroupPrePersistExists(newPrePersistClassName)) {
- this.validationGroupPrePersists.add(newPrePersistClassName);
- this.putPropertyCompositeValue(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, newPrePersistClassName);
- this.fireListChanged(VALIDATION_GROUP_PRE_PERSIST_LIST, this.validationGroupPrePersists);
- return newPrePersistClassName;
- }
- return null;
- }
-
- public void removeValidationGroupPrePersist(String className){
-
- if(this.removeValidationGroupPrePersist_(className) != null) {
- this.removePropertyCompositeValue(VALIDATION_GROUP_PRE_PERSIST_PROPERTY, className);
- this.fireListChanged(VALIDATION_GROUP_PRE_PERSIST_LIST, this.validationGroupPrePersists);
- }
- }
-
- private String removeValidationGroupPrePersist_(String className){
-
- for (String validationGroupPrePersist : this.getValidationGroupPrePersists()) {
- if(validationGroupPrePersist.equals(className)) {
- this.validationGroupPrePersists.remove(validationGroupPrePersist);
- return validationGroupPrePersist;
- }
- }
- return null;
- }
-
- private void validationGroupPrePersistsChanged() {
- this.validationGroupPrePersists = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST);
- this.fireListChanged(VALIDATION_GROUP_PRE_PERSIST_LIST, this.validationGroupPrePersists);
- }
-
- // ********** ValidationGroupPreUpdates **********
-
- public ListIterable<String> getValidationGroupPreUpdates(){
- return new LiveCloneListIterable<String>(this.validationGroupPreUpdates);
- }
-
- public int getValidationGroupPreUpdatesSize(){
- return this.validationGroupPreUpdates.size();
- }
-
- public boolean validationGroupPreUpdateExists(String validationGroupPreUpdateClassName) {
-
- for (String validationGroupPreUpdate : this.validationGroupPreUpdates) {
- if(validationGroupPreUpdate.equals(validationGroupPreUpdateClassName)) {
- return true;
- }
- }
- return false;
- }
-
- public String addValidationGroupPreUpdate(String newPreUpdateClassName){
-
- if( ! this.validationGroupPreUpdateExists(newPreUpdateClassName)) {
- this.validationGroupPreUpdates.add(newPreUpdateClassName);
- this.putPropertyCompositeValue(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, newPreUpdateClassName);
- this.fireListChanged(VALIDATION_GROUP_PRE_UPDATE_LIST, this.validationGroupPreUpdates);
- return newPreUpdateClassName;
- }
- return null;
- }
-
- public void removeValidationGroupPreUpdate(String className){
-
- if(this.removeValidationGroupPreUpdate_(className) != null) {
- this.removePropertyCompositeValue(VALIDATION_GROUP_PRE_UPDATE_PROPERTY, className);
- this.fireListChanged(VALIDATION_GROUP_PRE_UPDATE_LIST, this.validationGroupPreUpdates);
- }
- }
-
- private String removeValidationGroupPreUpdate_(String className){
-
- for(String validationGroupPreUpdate : this.getValidationGroupPreUpdates()) {
- if(validationGroupPreUpdate.equals(className)) {
- this.validationGroupPreUpdates.remove(validationGroupPreUpdate);
- return validationGroupPreUpdate;
- }
- }
- return null;
- }
-
- private void validationGroupPreUpdatesChanged() {
- this.validationGroupPreUpdates = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE);
- this.fireListChanged(VALIDATION_GROUP_PRE_UPDATE_LIST, this.validationGroupPreUpdates);
- }
-
- // ********** ValidationGroupPreRemoves **********
-
- public ListIterable<String> getValidationGroupPreRemoves(){
- return new LiveCloneListIterable<String>(this.validationGroupPreRemoves);
- }
-
- public int getValidationGroupPreRemovesSize(){
- return this.validationGroupPreRemoves.size();
- }
-
- public boolean validationGroupPreRemoveExists(String validationGroupPreRemoveClassName) {
-
- for (String validationGroupPreRemove : this.validationGroupPreRemoves) {
- if(validationGroupPreRemove.equals(validationGroupPreRemoveClassName)) {
- return true;
- }
- }
- return false;
- }
-
- public String addValidationGroupPreRemove(String newPreRemoveClassName){
-
- if( ! this.validationGroupPreRemoveExists(newPreRemoveClassName)) {
- this.validationGroupPreRemoves.add(newPreRemoveClassName);
- this.putPropertyCompositeValue(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, newPreRemoveClassName);
- this.fireListChanged(VALIDATION_GROUP_PRE_REMOVE_LIST, this.validationGroupPreRemoves);
- return newPreRemoveClassName;
- }
- return null;
- }
-
- public void removeValidationGroupPreRemove(String className){
-
- if(this.removeValidationGroupPreRemove_(className) != null) {
- this.removePropertyCompositeValue(VALIDATION_GROUP_PRE_REMOVE_PROPERTY, className);
- this.fireListChanged(VALIDATION_GROUP_PRE_REMOVE_LIST, this.validationGroupPreRemoves);
- }
- }
-
- private String removeValidationGroupPreRemove_(String className){
-
- for(String validationGroupPreRemove : this.getValidationGroupPreRemoves()) {
- if(validationGroupPreRemove.equals(className)) {
- this.validationGroupPreRemoves.remove(validationGroupPreRemove);
- return validationGroupPreRemove;
- }
- }
- return null;
- }
-
- private void validationGroupPreRemovesChanged() {
- this.validationGroupPreRemoves = this.getCompositeValue(PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE);
- this.fireListChanged(VALIDATION_GROUP_PRE_REMOVE_LIST, this.validationGroupPreRemoves);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java
deleted file mode 100644
index 1888f71619..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceUnitProperties.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Set;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnitProperties;
-
-/**
- * EclipseLinkPersistenceUnitProperties
- *
- * Listens to the propertyListAdapter
- */
-public abstract class EclipseLinkPersistenceUnitProperties extends AbstractPersistenceUnitProperties
-{
- // ********** constructors **********
- protected EclipseLinkPersistenceUnitProperties(PersistenceUnit parent) {
- super(parent);
- }
-
- // ******** Convenience methods ********
-
- protected Set<PersistenceUnit.Property> getPropertiesSetWithPrefix(String keyPrefix) {
- return CollectionTools.set(this.getPersistenceUnit().getPropertiesWithNamePrefix(keyPrefix));
- }
-
- /**
- * Extracts the entityName of the specified property name. If the property name
- * has no suffix, return an empty string.
- */
- protected String extractEntityNameOf(PersistenceUnit.Property property) {
- return extractEntityNameOf(property.getName());
- }
-
- /**
- * Extracts the entityName of the specified string. If the string
- * has no suffix, return an empty string.
- */
- protected String extractEntityNameOf(String propertyName) {
- int index = propertyName.lastIndexOf('.');
- if (index == -1) {
- return ""; //$NON-NLS-1$
- }
- return propertyName.substring(index + 1);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
deleted file mode 100644
index dccd625f54..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlContextNodeFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJarFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-
-
-public class EclipseLinkPersistenceXmlContextNodeFactory
- extends AbstractPersistenceXmlContextNodeFactory
- implements org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceXmlContextNodeFactory
-{
-
- @Override
- public PersistenceUnit buildPersistenceUnit(Persistence parent, XmlPersistenceUnit xmlPersistenceUnit) {
- return new EclipseLinkPersistenceUnit(parent, xmlPersistenceUnit);
- }
-
- @Override
- public JarFileRef buildJarFileRef(PersistenceUnit parent, XmlJarFileRef xmlJarFileRef) {
- return new EclipseLinkJarFileRef(parent, xmlJarFileRef);
- }
-
- public PersistenceUnitProperties buildConnection(PersistenceUnit parent) {
- return new EclipseLinkConnection(parent);
- }
-
- public PersistenceUnitProperties buildOptions(PersistenceUnit parent) {
- return new EclipseLinkOptions(parent);
- }
-
- public PersistenceUnitProperties buildLogging(PersistenceUnit parent) {
- return new EclipseLinkLogging(parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java
deleted file mode 100644
index e522115f3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkPersistenceXmlDefinition.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import org.eclipse.emf.ecore.EFactory;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlContextNodeFactory;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceXmlDefinition;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-
-public class EclipseLinkPersistenceXmlDefinition
- extends AbstractPersistenceXmlDefinition
-{
- // singleton
- private static final PersistenceXmlDefinition INSTANCE = new EclipseLinkPersistenceXmlDefinition();
-
- /**
- * Return the singleton
- */
- public static PersistenceXmlDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkPersistenceXmlDefinition() {
- super();
- }
-
- public JptResourceType getResourceType() {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
-
- public EFactory getResourceNodeFactory() {
- return PersistenceFactory.eINSTANCE;
- }
-
- @Override
- protected PersistenceXmlContextNodeFactory buildContextNodeFactory() {
- return new EclipseLinkPersistenceXmlContextNodeFactory();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkSchemaGeneration.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkSchemaGeneration.java
deleted file mode 100644
index df33932fc6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/context/persistence/EclipseLinkSchemaGeneration.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence;
-
-import java.util.Map;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-
-/**
- * EclipseLinkSchemaGeneration encapsulates EclipseLink SchemaGeneration
- * properties.
- */
-public class EclipseLinkSchemaGeneration
- extends EclipseLinkPersistenceUnitProperties implements SchemaGeneration
-{
- // ********** EclipseLink properties **********
-
- private OutputMode outputMode;
- private DdlGenerationType ddlGenerationType;
- private String createFileName;
- private String dropFileName;
- private String applicationLocation;
-
- // ********** constructors/initialization **********
-
- public EclipseLinkSchemaGeneration(PersistenceUnit parent) {
- super(parent);
- }
-
- /**
- * Initializes properties with values from the persistence unit.
- */
- @Override
- protected void initializeProperties() {
- this.outputMode =
- this.getEnumValue(ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE, OutputMode.values());
- this.ddlGenerationType =
- this.getEnumValue(ECLIPSELINK_DDL_GENERATION_TYPE, DdlGenerationType.values());
- this.createFileName =
- this.getStringValue(ECLIPSELINK_CREATE_FILE_NAME);
- this.dropFileName =
- this.getStringValue(ECLIPSELINK_DROP_FILE_NAME);
- this.applicationLocation =
- this.getStringValue(ECLIPSELINK_APPLICATION_LOCATION);
- }
-
- /**
- * Adds property names key/value pairs, where: key = EclipseLink property
- * key; value = property id
- */
- @Override
- protected void addPropertyNames(Map<String, String> propertyNames) {
- propertyNames.put(
- ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE,
- OUTPUT_MODE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_DDL_GENERATION_TYPE,
- DDL_GENERATION_TYPE_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_CREATE_FILE_NAME,
- CREATE_FILE_NAME_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_DROP_FILE_NAME,
- DROP_FILE_NAME_PROPERTY);
- propertyNames.put(
- ECLIPSELINK_APPLICATION_LOCATION,
- APPLICATION_LOCATION_PROPERTY);
- }
-
- // ********** behavior **********
-
- public void propertyValueChanged(String propertyName, String newValue) {
- if (propertyName.equals(ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE)) {
- this.outputModeChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_DDL_GENERATION_TYPE)) {
- this.ddlGenerationTypeChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_CREATE_FILE_NAME)) {
- this.createFileNameChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_DROP_FILE_NAME)) {
- this.dropFileNameChanged(newValue);
- }
- else if (propertyName.equals(ECLIPSELINK_APPLICATION_LOCATION)) {
- this.applicationLocationChanged(newValue);
- }
- }
-
- public void propertyRemoved(String propertyName) {
- if (propertyName.equals(ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE)) {
- this.outputModeChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_DDL_GENERATION_TYPE)) {
- this.ddlGenerationTypeChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_CREATE_FILE_NAME)) {
- this.createFileNameChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_DROP_FILE_NAME)) {
- this.dropFileNameChanged(null);
- }
- else if (propertyName.equals(ECLIPSELINK_APPLICATION_LOCATION)) {
- this.applicationLocationChanged(null);
- }
- }
-
- // ********** DdlGenerationType **********
- public DdlGenerationType getDdlGenerationType() {
- return this.ddlGenerationType;
- }
-
- public void setDdlGenerationType(DdlGenerationType newDdlGenType) {
- DdlGenerationType old = this.ddlGenerationType;
- this.ddlGenerationType = newDdlGenType;
- this.putProperty(DDL_GENERATION_TYPE_PROPERTY, newDdlGenType);
- this.firePropertyChanged(DDL_GENERATION_TYPE_PROPERTY, old, newDdlGenType);
- }
-
- private void ddlGenerationTypeChanged(String stringValue) {
- DdlGenerationType newValue = getEnumValueOf(stringValue, DdlGenerationType.values());
- DdlGenerationType old = this.ddlGenerationType;
- this.ddlGenerationType = newValue;
- this.firePropertyChanged(DDL_GENERATION_TYPE_PROPERTY, old, newValue);
- }
-
- public DdlGenerationType getDefaultDdlGenerationType() {
- return DEFAULT_SCHEMA_GENERATION_DDL_GENERATION_TYPE;
- }
-
- // ********** OutputMode **********
- public OutputMode getOutputMode() {
- return this.outputMode;
- }
-
- public void setOutputMode(OutputMode newOutputMode) {
- OutputMode old = this.outputMode;
- this.outputMode = newOutputMode;
- this.putProperty(OUTPUT_MODE_PROPERTY, newOutputMode);
- this.firePropertyChanged(OUTPUT_MODE_PROPERTY, old, newOutputMode);
- }
-
- private void outputModeChanged(String stringValue) {
- OutputMode newValue = getEnumValueOf(stringValue, OutputMode.values());
- OutputMode old = this.outputMode;
- this.outputMode = newValue;
- this.firePropertyChanged(OUTPUT_MODE_PROPERTY, old, newValue);
- }
-
- public OutputMode getDefaultOutputMode() {
- return DEFAULT_SCHEMA_GENERATION_OUTPUT_MODE;
- }
-
- // ********** CreateFileName **********
- public String getCreateFileName() {
- return this.createFileName;
- }
-
- public void setCreateFileName(String newCreateFileName) {
- String old = this.createFileName;
- this.createFileName = newCreateFileName;
- this.putProperty(CREATE_FILE_NAME_PROPERTY, newCreateFileName);
- this.firePropertyChanged(CREATE_FILE_NAME_PROPERTY, old, newCreateFileName);
- }
-
- private void createFileNameChanged(String newValue) {
- String old = this.createFileName;
- this.createFileName = newValue;
- this.firePropertyChanged(CREATE_FILE_NAME_PROPERTY, old, newValue);
- }
-
- public String getDefaultCreateFileName() {
- return DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME;
- }
-
- // ********** dropFileName **********
- public String getDropFileName() {
- return this.dropFileName;
- }
-
- public void setDropFileName(String newDropFileName) {
- String old = this.dropFileName;
- this.dropFileName = newDropFileName;
- this.putProperty(DROP_FILE_NAME_PROPERTY, newDropFileName);
- this.firePropertyChanged(DROP_FILE_NAME_PROPERTY, old, newDropFileName);
- }
-
- private void dropFileNameChanged(String newValue) {
- String old = this.dropFileName;
- this.dropFileName = newValue;
- this.firePropertyChanged(DROP_FILE_NAME_PROPERTY, old, newValue);
- }
-
- public String getDefaultDropFileName() {
- return DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME;
- }
-
- // ********** applicationLocation **********
- public String getApplicationLocation() {
- return this.applicationLocation;
- }
-
- public void setApplicationLocation(String newApplicationLocation) {
- String old = this.applicationLocation;
- this.applicationLocation = (StringTools.stringIsNotEmpty(newApplicationLocation)) ?
- newApplicationLocation :
- this.getDefaultApplicationLocation();
- this.putProperty(APPLICATION_LOCATION_PROPERTY, this.applicationLocation);
- this.firePropertyChanged(APPLICATION_LOCATION_PROPERTY, old, this.applicationLocation);
- }
-
- private void applicationLocationChanged(String newValue) {
- String old = this.applicationLocation;
- this.applicationLocation = newValue;
- this.firePropertyChanged(APPLICATION_LOCATION_PROPERTY, old, newValue);
- }
-
- public String getDefaultApplicationLocation() {
- return DEFAULT_SCHEMA_GENERATION_APPLICATION_LOCATION;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java
deleted file mode 100644
index 41965323a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/AbstractEclipseLinkDDLGenerator.java
+++ /dev/null
@@ -1,467 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Properties;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-import org.eclipse.jpt.jpa.core.internal.JptCoreMessages;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.osgi.util.ManifestElement;
-import org.eclipse.wst.validation.ValidationFramework;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleException;
-
-public abstract class AbstractEclipseLinkDDLGenerator extends AbstractJptGenerator
-{
- public static final String LAUNCH_CONFIG_NAME = "Dali EclipseLink Table Generation"; //$NON-NLS-1$
- public static final String DDL_GEN_PACKAGE_NAME = "org.eclipse.jpt.jpa.eclipselink.core.ddlgen"; //$NON-NLS-1$
- public static final String ECLIPSELINK_DDL_GEN_CLASS = DDL_GEN_PACKAGE_NAME + ".Main"; //$NON-NLS-1$
- public static final String ECLIPSELINK_DDL_GEN_JAR_PREFIX = DDL_GEN_PACKAGE_NAME + "_"; //$NON-NLS-1$
- public static final String BUNDLE_CLASSPATH = "Bundle-ClassPath"; //$NON-NLS-1$
- public static final String PROPERTIES_FILE_NAME = "login.properties"; //$NON-NLS-1$
- public static final String TRUE = "true"; //$NON-NLS-1$
- public static final String FALSE = "false"; //$NON-NLS-1$
- public static final String NONE = "NONE"; //$NON-NLS-1$
- private static final String DYNAMIC_PROGRAM_ARGUMENT = "-dynamic"; //$NON-NLS-1$
-
- protected final String puName;
- protected final JpaProject jpaProject;
- protected final OutputMode outputMode;
-
- // ********** constructors **********
-
- protected AbstractEclipseLinkDDLGenerator(String puName, JpaProject jpaProject, OutputMode outputMode) {
- super(JavaCore.create(jpaProject.getProject()));
- this.puName = puName;
- this.jpaProject = jpaProject;
- this.outputMode = outputMode;
- }
-
- // ********** overrides **********
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected String getMainType() {
- return ECLIPSELINK_DDL_GEN_CLASS;
- }
-
- @Override
- protected String getBootstrapJarPrefix() {
- return ECLIPSELINK_DDL_GEN_JAR_PREFIX;
- }
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- SubMonitor sm = SubMonitor.convert(monitor, 2);
- //disconnect since the runtime provider will need to connect to generate the tables
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp != null) {
- cp.disconnect();
- sm.worked(1);
- }
- sm.setWorkRemaining(1);
- this.saveLoginProperties();
- sm.worked(1);
- }
-
- @Override
- protected void postGenerate() {
- super.postGenerate();
- this.reconnect();
- this.validateProject();
- }
-
- // ********** Setting Launch Configuration **********
-
- @Override
- protected void specifyProgramArguments() {
- StringBuffer programArguments = new StringBuffer();
- this.appendProgramArguments(programArguments);
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- // ********** Main arguments **********
-
- protected void appendProgramArguments(StringBuffer programArguments) {
- this.appendPuNameArgument(programArguments);
- this.appendPropertiesFileArgument(programArguments);
- this.appendDebugArgument(programArguments);
- this.appendDynamicArgument(programArguments);
- }
-
- private void appendPuNameArgument(StringBuffer sb) {
- sb.append(" -pu \""); //$NON-NLS-1$
- sb.append(this.puName);
- sb.append("\""); //$NON-NLS-1$
- }
-
- private void appendPropertiesFileArgument(StringBuffer sb) {
- sb.append(" -p \""); //$NON-NLS-1$
- sb.append(this.projectLocation).append("/").append(PROPERTIES_FILE_NAME).append("\""); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- protected void appendDynamicArgument(StringBuffer sb) {
- if (JptJpaEclipseLinkCorePlugin.nodeIsEclipseLinkVersionCompatible(this.jpaProject, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_PLATFORM_VERSION_2_1)) {
- sb.append(' ').append(DYNAMIC_PROGRAM_ARGUMENT);
- }
- }
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // DDL_GEN jar
- classpath.add(this.getBootstrapJarClasspathEntry().getMemento());
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // Osgi Bundles
- classpath.addAll(this.getPersistenceOsgiBundlesMemento());
- // JDBC jar
- classpath.add(this.getJdbcJarClasspathEntry().getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- // meta-inf
- if(this.metaInfIsNotOnClasspath()) {
- classpath.add(this.getMetaInfClasspathEntry().getMemento());
- }
- return classpath;
- }
-
- // ********** behavior **********
-
- //reconnect since we disconnected in preGenerate();
- //ensure the project is fully updated before validating - bug 277236
- protected void reconnect() {
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp != null) {
- cp.connect();
- }
- }
-
- protected void validateProject() {
- new ValidateJob(this.jpaProject.getProject()).schedule();
- }
-
- // ********** ClasspathEntry **********
-
- private IRuntimeClasspathEntry getJdbcJarClasspathEntry() {
- return getArchiveClasspathEntry(this.buildJdbcJarPath());
- }
-
- private IRuntimeClasspathEntry getBundleClasspathEntry(String bundleId) {
- IPath persistClasspath = this.getBundleClasspath(bundleId);
- IRuntimeClasspathEntry bundleEntry = getArchiveClasspathEntry(persistClasspath);
-
- return bundleEntry;
- }
-
- private IRuntimeClasspathEntry getMetaInfClasspathEntry() {
- return getVariableRuntimeClasspathEntry(this.getMetaInfPath());
- }
-
- // ********** EclipseLink properties **********
-
- protected void buildConnectionProperties(Properties properties) {
- this.putProperty(properties,
- Connection.ECLIPSELINK_BIND_PARAMETERS,
- FALSE);
- }
-
- private void buildLoggingProperties(Properties properties) {
- this.putProperty(properties,
- Logging.ECLIPSELINK_LEVEL,
- LoggingLevel.fine);
- this.putProperty(properties,
- Logging.ECLIPSELINK_TIMESTAMP,
- FALSE);
- this.putProperty(properties,
- Logging.ECLIPSELINK_THREAD,
- FALSE);
- this.putProperty(properties,
- Logging.ECLIPSELINK_SESSION,
- FALSE);
- this.putProperty(properties,
- Logging.ECLIPSELINK_EXCEPTIONS,
- TRUE);
- }
-
- protected void buildCustomizationProperties(Properties properties) {
- this.putProperty(properties,
- Customization.ECLIPSELINK_THROW_EXCEPTIONS,
- TRUE);
- }
-
- protected void putProperty(Properties properties, String key, String value) {
- properties.put(key, (value == null) ? "" : value); //$NON-NLS-1$
- }
-
- protected void putProperty(Properties properties, String key, PersistenceXmlEnumValue value) {
- this.putProperty(properties, key, this.getPropertyStringValueOf(value));
- }
-
- /**
- * Returns the Property string value of the given property value.
- */
- protected String getPropertyStringValueOf(PersistenceXmlEnumValue value) {
- if(value == null) {
- return null;
- }
- return value.getPropertyValue();
- }
-
- protected void buildAllProperties(Properties properties) {
- this.buildConnectionProperties(properties);
- this.buildConnectionPoolingProperties(properties);
- this.buildLoggingProperties(properties);
- this.buildCustomizationProperties(properties);
- this.buildDDLModeProperties(properties);
- this.buildProjectLocationProperty(properties);
- }
-
- // ********** private methods **********
-
- private void buildProjectLocationProperty(Properties properties) {
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_APPLICATION_LOCATION,
- this.projectLocation);
- }
-
- private void buildDDLModeProperties(Properties properties) {
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE,
- this.outputMode);
-
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE,
- DdlGenerationType.drop_and_create_tables);
-
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_CREATE_FILE_NAME,
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME);
- this.putProperty(properties,
- SchemaGeneration.ECLIPSELINK_DROP_FILE_NAME,
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME);
- }
-
- private void buildConnectionPoolingProperties(Properties properties) {
- this.putProperty(properties,
- Connection.ECLIPSELINK_READ_CONNECTIONS_SHARED,
- TRUE);
- }
-
- private void saveLoginProperties() {
- String propertiesFile = this.projectLocation + "/" + PROPERTIES_FILE_NAME; //$NON-NLS-1$
-
- Properties elProperties = new Properties();
-
- this.buildAllProperties(elProperties);
- FileOutputStream stream = null;
- try {
- File file = new File(propertiesFile);
- if (!file.exists() && ! file.createNewFile()) {
- throw new RuntimeException("createNewFile() failed: " + file); //$NON-NLS-1$
- }
- stream = new FileOutputStream(file);
- elProperties.store(stream, null);
- }
- catch (Exception e) {
- String message = "Error saving: " + propertiesFile; //$NON-NLS-1$
- throw new RuntimeException(message, e);
- }
- finally {
- this.closeStream(stream);
- }
- }
-
- private void closeStream(OutputStream stream) {
- if (stream != null) {
- try {
- stream.close();
- }
- catch (IOException e) {
- throw new RuntimeException(e);
- }
- }
- }
-
- private IPath getMetaInfPath() {
- JpaXmlResource persistenceXmlResource = this.jpaProject.getPersistenceXmlResource();
- IPath persistenceXmlPath = persistenceXmlResource.getFile().getLocation();
- return persistenceXmlPath.removeLastSegments(2);
- }
-
- private boolean metaInfIsNotOnClasspath() {
- JpaXmlResource persistenceXmlResource = this.jpaProject.getPersistenceXmlResource();
- return ! this.jpaProject.getJavaProject().isOnClasspath(persistenceXmlResource.getFile());
- }
-
- /**
- * Performs validation after tables have been generated
- */
- /* CU private */ class ValidateJob
- extends Job
- {
- private final IProject[] projects;
-
- ValidateJob(IProject project) {
- super(JptCoreMessages.VALIDATE_JOB);
- this.projects = new IProject[] {project};
- }
-
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- try {
- ValidationFramework.getDefault().validate(this.projects, true, false, monitor);
- } catch (CoreException ex) {
- throw new RuntimeException(ex);
- }
- return Status.OK_STATUS;
- }
- }
-
- private IPath buildJdbcJarPath() {
- return new Path(this.getJpaProjectConnectionDriverJarList());
- }
-
- private String getJpaProjectConnectionDriverJarList() {
- ConnectionProfile cp = this.getConnectionProfile();
- return (cp == null) ? "" : cp.getDriverJarList(); //$NON-NLS-1$
- }
-
-
- // ********** Queries **********
-
- protected JpaPlatform getPlatform() {
- return this.jpaProject.getJpaPlatform();
- }
-
- protected ConnectionProfile getConnectionProfile() {
- return this.jpaProject.getConnectionProfile();
- }
-
-
- // ********** Bundles *********
-
- private Collection<String> getPersistenceOsgiBundlesMemento() throws CoreException {
-
- Collection<String> result = new HashSet<String>();
- if (javaxPersistenceBundleExists()) {
- result.add(this.getBundleClasspathEntry(JAVAX_PERSISTENCE_BUNDLE).getMemento());
- result.add(this.getBundleClasspathEntry(ORG_ECLIPSE_PERSISTENCE_CORE_BUNDLE).getMemento());
- result.add(this.getBundleClasspathEntry(ORG_ECLIPSE_PERSISTENCE_ASM_BUNDLE).getMemento());
- result.add(this.getBundleClasspathEntry(ORG_ECLIPSE_PERSISTENCE_ANTLR_BUNDLE).getMemento());
- result.add(this.getBundleClasspathEntry(ORG_ECLIPSE_PERSISTENCE_JPA_BUNDLE).getMemento());
- }
- return result;
- }
-
- private IPath getBundleClasspath(String pluginID) {
- Bundle bundle = Platform.getBundle(pluginID);
- if (bundle == null) {
- throw new RuntimeException(pluginID + " cannot be retrieved from the Platform"); //$NON-NLS-1$
- }
- return this.getClassPath(bundle);
- }
-
- private IPath getClassPath(Bundle bundle) {
- String path = bundle.getHeaders().get(BUNDLE_CLASSPATH);
- if (path == null) {
- path = "."; //$NON-NLS-1$
- }
- ManifestElement[] elements = null;
- try {
- elements = ManifestElement.parseHeader(BUNDLE_CLASSPATH, path);
- }
- catch (BundleException e) {
- throw new RuntimeException("Error parsing bundle header: " + bundle, e); //$NON-NLS-1$
- }
- if (elements != null) {
- for (int i = 0; i < elements.length; ++i) {
- ManifestElement element = elements[i];
- String value = element.getValue();
- if (".".equals(value)) { //$NON-NLS-1$
- value = "/"; //$NON-NLS-1$
- }
- URL url = bundle.getEntry(value);
- if (url != null) {
- try {
- URL resolvedURL = FileLocator.resolve(url);
- String filestring = FileLocator.toFileURL(resolvedURL).getFile();
- if (filestring.startsWith("file:")) { //$NON-NLS-1$
- filestring = filestring.substring(filestring.indexOf(':') + 1);
- }
- if (filestring.endsWith("!/")) { //$NON-NLS-1$
- filestring = filestring.substring(0, filestring.lastIndexOf('!'));
- }
- File file = new File(filestring);
- String filePath = file.getCanonicalPath();
- return new Path(filePath);
- }
- catch (IOException e) {
- throw new RuntimeException("Error locating bundle: " + bundle, e); //$NON-NLS-1$
- }
- }
- }
- }
- return null;
- }
-
- private boolean javaxPersistenceBundleExists() {
- return Platform.getBundle(JAVAX_PERSISTENCE_BUNDLE) != null;
- }
-
- // ********** constants **********
-
- private static final String JAVAX_PERSISTENCE_BUNDLE = "javax.persistence"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_PERSISTENCE_CORE_BUNDLE = "org.eclipse.persistence.core"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_PERSISTENCE_ASM_BUNDLE = "org.eclipse.persistence.asm"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_PERSISTENCE_ANTLR_BUNDLE = "org.eclipse.persistence.antlr"; //$NON-NLS-1$
- private static final String ORG_ECLIPSE_PERSISTENCE_JPA_BUNDLE = "org.eclipse.persistence.jpa"; //$NON-NLS-1$
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLink2_0DDLGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLink2_0DDLGenerator.java
deleted file mode 100644
index 3fc9c1f91f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLink2_0DDLGenerator.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen;
-
-import java.util.Properties;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-
-/**
- * EclipseLink2_0DLLGenerator launches the EclipseLink DDL generator in a separate VM.
- * For this it will create a Java Configuration named "Dali EclipseLink Table Generation"
- * in the target workspace (note: the configuration will be overridden at each run).
- * It will than launch the configuration created with the login information from
- * the current Dali project, and passes it to EclipseLink.
- *
- * Pre-req in PDE environment:
- * org.eclipse.jpt.jpa.eclipselink.core.ddlgen.jar in ECLIPSE_HOME/plugins
- */
-public class EclipseLink2_0DDLGenerator extends AbstractEclipseLinkDDLGenerator
-{
- static final String VALIDATION_MODE_PROPERTY = "javax.persistence.validation.mode"; //$NON-NLS-1$
-
- // ********** constructors **********
-
- public static void generate(String puName, JpaProject project, OutputMode outputMode, IProgressMonitor monitor) {
- if (puName == null || puName.length() == 0 || project == null) {
- throw new NullPointerException();
- }
- new EclipseLink2_0DDLGenerator(puName, project, outputMode).generate(monitor);
- }
-
- private EclipseLink2_0DDLGenerator(String puName, JpaProject jpaProject, OutputMode outputMode) {
- super(puName, jpaProject, outputMode);
- }
-
- // ********** EclipseLink properties **********
-
- @Override
- protected void buildAllProperties(Properties properties) {
- super.buildAllProperties(properties);
-
- this.putProperty(properties,
- VALIDATION_MODE_PROPERTY,
- NONE);
- }
-
- @Override
- protected void buildCustomizationProperties(Properties properties) {
- super.buildCustomizationProperties(properties);
-
- this.putProperty(properties,
- Customization.ECLIPSELINK_WEAVING,
- FALSE);
- }
-
- @Override
- protected void buildConnectionProperties(Properties properties) {
- super.buildConnectionProperties(properties);
- ConnectionProfile cp = this.getConnectionProfile();
-
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_DRIVER,
- (cp == null) ? "" : cp.getDriverClassName()); //$NON-NLS-1$
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_URL,
- (cp == null) ? "" : cp.getURL()); //$NON-NLS-1$
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_USER,
- (cp == null) ? "" : cp.getUserName()); //$NON-NLS-1$
- this.putProperty(properties,
- JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD,
- (cp == null) ? "" : cp.getUserPassword()); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java
deleted file mode 100644
index 8fa4666e07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/ddlgen/EclipseLinkDDLGenerator.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen;
-
-import java.util.Properties;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-
-/**
- * EclipseLinkDLLGenerator launches the EclipseLink DDL generator in a separate VM.
- * For this it will create a Java Configuration named "Dali EclipseLink Table Generation"
- * in the target workspace (note: the configuration will be overridden at each run).
- * It will than launch the configuration created with the login information from
- * the current Dali project, and passes it to EclipseLink.
- *
- * Pre-req in PDE environment:
- * org.eclipse.jpt.jpa.eclipselink.core.ddlgen.jar in ECLIPSE_HOME/plugins
- */
-public class EclipseLinkDDLGenerator extends AbstractEclipseLinkDDLGenerator
-{
-
- // ********** constructors **********
-
- public static void generate(String puName, JpaProject project, OutputMode outputMode, IProgressMonitor monitor) {
- if (puName == null || puName.length() == 0 || project == null) {
- throw new NullPointerException();
- }
- new EclipseLinkDDLGenerator(puName, project, outputMode).generate(monitor);
- }
-
- private EclipseLinkDDLGenerator(String puName, JpaProject jpaProject, OutputMode outputMode) {
- super(puName, jpaProject, outputMode);
- }
-
- @Override
- protected void buildConnectionProperties(Properties properties) {
- super.buildConnectionProperties(properties);
- ConnectionProfile cp = this.getConnectionProfile();
-
- this.putProperty(properties,
- Connection.ECLIPSELINK_DRIVER,
- (cp == null) ? "" : cp.getDriverClassName()); //$NON-NLS-1$
- this.putProperty(properties,
- Connection.ECLIPSELINK_URL,
- (cp == null) ? "" : cp.getURL()); //$NON-NLS-1$
- this.putProperty(properties,
- Connection.ECLIPSELINK_USER,
- (cp == null) ? "" : cp.getUserName()); //$NON-NLS-1$
- this.putProperty(properties,
- Connection.ECLIPSELINK_PASSWORD,
- (cp == null) ? "" : cp.getUserPassword()); //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkEclipseLinkBundlesLibraryValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkEclipseLinkBundlesLibraryValidator.java
deleted file mode 100644
index 451eaf1435..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkEclipseLinkBundlesLibraryValidator.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.libval;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jpa.core.internal.libprov.JpaOsgiBundlesLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jpa.core.internal.libval.AbstractOsgiBundlesLibraryValidator;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.osgi.service.resolver.VersionRange;
-
-public class EclipseLinkEclipseLinkBundlesLibraryValidator
- extends AbstractOsgiBundlesLibraryValidator {
-
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
- JpaOsgiBundlesLibraryProviderInstallOperationConfig jpaConfig
- = (JpaOsgiBundlesLibraryProviderInstallOperationConfig) config;
- Map<String, VersionRange[]> bundleVersionRanges = new HashMap<String, VersionRange[]>();
- JpaPlatformDescription platform = jpaConfig.getJpaPlatform();
- if (EclipseLinkPlatform.VERSION_1_0.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.0, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_1_1.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.1, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_1_2.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[1.2, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_0.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.0, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.0, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_1.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.1, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.1, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_2.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.2, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.2, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_3.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.3, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.3, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.3, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.3, 3.0)")}); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_4.equals(platform)) {
- bundleVersionRanges.put(
- "org.eclipse.persistence.core", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.4, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.jpa", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.4, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.asm", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.4, 3.0)")}); //$NON-NLS-1$
- bundleVersionRanges.put(
- "org.eclipse.persistence.antlr", //$NON-NLS-1$
- new VersionRange[] {new VersionRange("[2.4, 3.0)")}); //$NON-NLS-1$
- }
-
- return validate(jpaConfig, bundleVersionRanges);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkUserLibraryValidator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkUserLibraryValidator.java
deleted file mode 100644
index edfdad3057..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/libval/EclipseLinkUserLibraryValidator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.libval;
-
-import java.util.HashSet;
-import java.util.Set;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jpt.common.core.libprov.JptLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.common.core.libval.LibraryValidator;
-import org.eclipse.jpt.common.eclipselink.core.internal.libval.EclipseLinkLibValUtil;
-import org.eclipse.jpt.jpa.core.internal.libprov.JpaUserLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.osgi.service.resolver.VersionRange;
-
-/**
- * Library validator for EclipseLink user libraries.
- *
- * In order to validate that the correct eclipselink.jar is present in the user library, the version
- * class which appears in standard EclipseLink libraries will be examined and compared against the
- * union of calculated version ranges, depending on the platform specified in the config.
- */
-public class EclipseLinkUserLibraryValidator
- implements LibraryValidator {
-
- public IStatus validate(JptLibraryProviderInstallOperationConfig config) {
- JpaUserLibraryProviderInstallOperationConfig jpaConfig
- = (JpaUserLibraryProviderInstallOperationConfig) config;
- JpaPlatformDescription platform = jpaConfig.getJpaPlatform();
- Set<VersionRange> versionRanges = new HashSet<VersionRange>();
-
- if (EclipseLinkPlatform.VERSION_1_0.equals(platform)) {
- versionRanges.add(new VersionRange("[1.0, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_1_1.equals(platform)) {
- versionRanges.add(new VersionRange("[1.1, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_1_2.equals(platform)) {
- versionRanges.add(new VersionRange("[1.2, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_0.equals(platform)) {
- versionRanges.add(new VersionRange("[2.0, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_1.equals(platform)) {
- versionRanges.add(new VersionRange("[2.1, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_2.equals(platform)) {
- versionRanges.add(new VersionRange("[2.2, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_3.equals(platform)) {
- versionRanges.add(new VersionRange("[2.3, 3.0)")); //$NON-NLS-1$
- }
- else if (EclipseLinkPlatform.VERSION_2_4.equals(platform)) {
- versionRanges.add(new VersionRange("[2.4, 3.0)")); //$NON-NLS-1$
- }
-
- return EclipseLinkLibValUtil.validate(jpaConfig.resolve(), versionRanges);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
deleted file mode 100644
index 2d6b3e56eb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationDataModelProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.operations;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-
-public class EclipseLinkOrmFileCreationDataModelProvider
- extends OrmFileCreationDataModelProvider
-{
- /**
- * required default constructor
- */
- public EclipseLinkOrmFileCreationDataModelProvider() {
- super();
- }
-
-
- @Override
- public IDataModelOperation getDefaultOperation() {
- return new EclipseLinkOrmFileCreationOperation(getDataModel());
- }
-
- @Override
- protected String getDefaultFileName() {
- return JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.lastSegment();
- }
-
- @Override
- protected String getDefaultVersion() {
- JpaProject jpaProject = this.getJpaProject();
- if (jpaProject == null) {
- return null;
- }
- try {
- return jpaProject.getJpaPlatform().getMostRecentSupportedResourceType(
- JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE).getVersion();
- }
- catch (IllegalArgumentException iae) {
- // eclipselink content not supported for project
- return null;
- }
- }
-
- @Override
- protected boolean fileVersionSupported(String fileVersion) {
- return fileVersion.equals(EclipseLink.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink1_1.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink1_2.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_0.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_1.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_2.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_3.SCHEMA_VERSION)
- || fileVersion.equals(EclipseLink2_4.SCHEMA_VERSION);
- }
-
- @Override
- protected boolean fileVersionSupportedForFacetVersion(String fileVersion, String jpaFacetVersion) {
- // assume that platform has been policed for facet version already
- return true;
- }
-
- @Override
- protected boolean isSupportedPlatformId(String id) {
- JpaPlatformDescription platform = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(id);
- if (platform == null) {
- return false;
- }
- return EclipseLinkPlatform.GROUP.equals(platform.getGroup());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java
deleted file mode 100644
index 06573a32b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/operations/EclipseLinkOrmFileCreationOperation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.operations;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationOperation;
-import org.eclipse.jpt.jpa.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.orm.EclipseLinkOrmXmlResourceProvider;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class EclipseLinkOrmFileCreationOperation extends OrmFileCreationOperation
-{
- public EclipseLinkOrmFileCreationOperation(IDataModel dataModel) {
- super(dataModel);
- }
-
-
- @Override
- protected AbstractXmlResourceProvider getXmlResourceProvider(IFile file) {
- return EclipseLinkOrmXmlResourceProvider.getXmlResourceProvider(file);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkArray2_3AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkArray2_3AnnotationDefinition.java
deleted file mode 100644
index 7761ba94c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkArray2_3AnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkArrayAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkArrayAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkArrayAnnotation2_3;
-
-/**
- * org.eclipse.persistence.annotations.Array
- */
-public class EclipseLinkArray2_3AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkArray2_3AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkArray2_3AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkArrayAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkArrayAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkArrayAnnotation2_3.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java
deleted file mode 100644
index ad504bf147..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicCollectionAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkBasicCollectionAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkBasicCollectionAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicCollection
- */
-public class EclipseLinkBasicCollectionAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkBasicCollectionAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkBasicCollectionAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkBasicCollectionAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkBasicCollectionAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicCollectionAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java
deleted file mode 100644
index 24edc251d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkBasicMapAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkBasicMapAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkBasicMapAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicMap
- */
-public class EclipseLinkBasicMapAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkBasicMapAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkBasicMapAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkBasicMapAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkBasicMapAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkBasicMapAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java
deleted file mode 100644
index 8932478ef8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCacheAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Cache
- */
-public class EclipseLinkCacheAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkCacheAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkCacheAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkCacheAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullEclipseLinkCacheAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkCacheAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkCacheAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java
deleted file mode 100644
index 6e9f5ed41a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkChangeTrackingAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ChangeTracking
- */
-public class EclipseLinkChangeTrackingAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkChangeTrackingAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkChangeTrackingAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkChangeTrackingAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkChangeTrackingAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java
deleted file mode 100644
index 78e87d2be3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkClassExtractor2_1AnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkClassExtractorAnnotation2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-
-/**
- * org.eclipse.persistence.annotations.ClassExtractor
- */
-public class EclipseLinkClassExtractor2_1AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkClassExtractor2_1AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkClassExtractor2_1AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkClassExtractorAnnotation2_1(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkClassExtractorAnnotation2_1(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkClassExtractorAnnotation2_1.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java
deleted file mode 100644
index 3ff2c2a540..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConvertAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Convert
- */
-public class EclipseLinkConvertAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkConvertAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkConvertAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkConvertAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkConvertAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkConvertAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java
deleted file mode 100644
index 6999bd36c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverterAnnotationDefinition.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.Converter
- */
-public class EclipseLinkConverterAnnotationDefinition
- implements NestableAnnotationDefinition
-{
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new EclipseLinkConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkConverterAnnotationDefinition() {
- super();
- }
-
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceEclipseLinkConverterAnnotation.buildSourceConverterAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryEclipseLinkConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getNestableAnnotationName() {
- return EclipseLink.CONVERTER;
- }
-
- public String getContainerAnnotationName() {
- return EclipseLink.CONVERTERS;
- }
-
- public String getElementName() {
- return EclipseLink.CONVERTERS__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverters2_2AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverters2_2AnnotationDefinition.java
deleted file mode 100644
index f41706e871..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkConverters2_2AnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverters
- */
-public final class EclipseLinkConverters2_2AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkConverters2_2AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkConverters2_2AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return EclipseLink.CONVERTERS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java
deleted file mode 100644
index d90ab00882..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkCustomizerAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Customizer
- */
-public class EclipseLinkCustomizerAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkCustomizerAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkCustomizerAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkCustomizerAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkCustomizerAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkCustomizerAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java
deleted file mode 100644
index 5a46c5fd4f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkExistenceCheckingAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ExistenceChecking
- */
-public class EclipseLinkExistenceCheckingAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkExistenceCheckingAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkExistenceCheckingAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkExistenceCheckingAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkExistenceCheckingAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkExistenceCheckingAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java
deleted file mode 100644
index b9965fd207..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkJoinFetchAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.JoinFetch
- */
-public class EclipseLinkJoinFetchAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkJoinFetchAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkJoinFetchAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkJoinFetchAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullEclipseLinkJoinFetchAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkJoinFetchAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMapKeyConvert2_0AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMapKeyConvert2_0AnnotationDefinition.java
deleted file mode 100644
index 6ea716b774..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMapKeyConvert2_0AnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkMapKeyConvertAnnotation2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkMapKeyConvertAnnotation2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMapKeyConvertAnnotation2_0;
-
-/**
- * org.eclipse.persistence.annotations.MapKeyConvert
- */
-public class EclipseLinkMapKeyConvert2_0AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkMapKeyConvert2_0AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkMapKeyConvert2_0AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkMapKeyConvertAnnotation2_0(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkMapKeyConvertAnnotation2_0(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMapKeyConvertAnnotation2_0.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMultitenant2_3AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMultitenant2_3AnnotationDefinition.java
deleted file mode 100644
index 2407058445..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMultitenant2_3AnnotationDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-
-public class EclipseLinkMultitenant2_3AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE
- = new EclipseLinkMultitenant2_3AnnotationDefinition();
-
-
- /**
- * Return the singleton
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkMultitenant2_3AnnotationDefinition() {
- super();
- }
-
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkMultitenantAnnotation2_3(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullEclipseLinkMultitenantAnnotation2_3(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkMultitenantAnnotation2_3(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java
deleted file mode 100644
index 448bcf6502..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkMutableAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Mutable
- */
-public class EclipseLinkMutableAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkMutableAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkMutableAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkMutableAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkMutableAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMutableAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java
deleted file mode 100644
index 0ee4683e1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverterAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.ObjectTypeConverter
- */
-public class EclipseLinkObjectTypeConverterAnnotationDefinition
- implements NestableAnnotationDefinition
-{
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new EclipseLinkObjectTypeConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkObjectTypeConverterAnnotationDefinition() {
- super();
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceEclipseLinkObjectTypeConverterAnnotation.buildSourceObjectTypeConverterAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryEclipseLinkObjectTypeConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getNestableAnnotationName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER;
- }
-
- public String getContainerAnnotationName() {
- return EclipseLink.OBJECT_TYPE_CONVERTERS;
- }
-
- public String getElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTERS__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverters2_2AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverters2_2AnnotationDefinition.java
deleted file mode 100644
index 6da2049235..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkObjectTypeConverters2_2AnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverters
- */
-public final class EclipseLinkObjectTypeConverters2_2AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkObjectTypeConverters2_2AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkObjectTypeConverters2_2AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return EclipseLink.OBJECT_TYPE_CONVERTERS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java
deleted file mode 100644
index 73e41c3798..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrimaryKeyAnnotationDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkPrimaryKeyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkPrimaryKeyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrimaryKeyAnnotation;
-
-public class EclipseLinkPrimaryKeyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE
- = new EclipseLinkPrimaryKeyAnnotationDefinition();
-
-
- /**
- * Return the singleton
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkPrimaryKeyAnnotationDefinition() {
- super();
- }
-
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkPrimaryKeyAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkPrimaryKeyAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkPrimaryKeyAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java
deleted file mode 100644
index cd6847e3bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkPrivateOwnedAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrivateOwned
- */
-public class EclipseLinkPrivateOwnedAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkPrivateOwnedAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkPrivateOwnedAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkPrivateOwnedAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkPrivateOwnedAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java
deleted file mode 100644
index 402a0c5fb5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadOnlyAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadOnly
- */
-public class EclipseLinkReadOnlyAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkReadOnlyAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkReadOnlyAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkReadOnlyAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkReadOnlyAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java
deleted file mode 100644
index 94ff51b4a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkReadTransformerAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkReadTransformerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkReadTransformerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- */
-public class EclipseLinkReadTransformerAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkReadTransformerAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkReadTransformerAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkReadTransformerAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkReadTransformerAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkReadTransformerAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java
deleted file mode 100644
index 2628b04df7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverterAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.StructConverter
- */
-public class EclipseLinkStructConverterAnnotationDefinition
- implements NestableAnnotationDefinition
-{
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new EclipseLinkStructConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkStructConverterAnnotationDefinition() {
- super();
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceEclipseLinkStructConverterAnnotation.buildSourceStructConverterAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryEclipseLinkStructConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getNestableAnnotationName() {
- return EclipseLink.STRUCT_CONVERTER;
- }
-
- public String getContainerAnnotationName() {
- return EclipseLink.STRUCT_CONVERTERS;
- }
-
- public String getElementName() {
- return EclipseLink.STRUCT_CONVERTERS__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverters2_2AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverters2_2AnnotationDefinition.java
deleted file mode 100644
index 5034450bc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructConverters2_2AnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverters
- */
-public final class EclipseLinkStructConverters2_2AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkStructConverters2_2AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkStructConverters2_2AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return EclipseLink.STRUCT_CONVERTERS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructure2_3AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructure2_3AnnotationDefinition.java
deleted file mode 100644
index 93e9dcb6d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkStructure2_3AnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkStructureAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkStructureAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructureAnnotation2_3;
-
-/**
- * org.eclipse.persistence.annotations.Sructure
- */
-public class EclipseLinkStructure2_3AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkStructure2_3AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkStructure2_3AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkStructureAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkStructureAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkStructureAnnotation2_3.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.java
deleted file mode 100644
index 404489cd64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-public class EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition
- implements NestableAnnotationDefinition
-{
- // singleton
- private static final NestableAnnotationDefinition INSTANCE
- = new EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition();
-
-
- /**
- * Return the singleton
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkTenantDiscriminatorColumn2_3AnnotationDefinition() {
- super();
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.buildSourceTenantDiscriminatorColumnAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3(parent, jdtAnnotation);
- }
-
- public String getNestableAnnotationName() {
- return EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME;
- }
-
- public String getContainerAnnotationName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMNS;
- }
-
- public String getElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMNS__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.java
deleted file mode 100644
index 38f9023a61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-public final class EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkTenantDiscriminatorColumns2_3AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMNS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java
deleted file mode 100644
index 0d27fb0462..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTransformationAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTransformationAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTransformationAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.Transformation
- */
-public class EclipseLinkTransformationAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkTransformationAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkTransformationAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkTransformationAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- return new NullEclipseLinkTransformationAnnotation(parent);
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkTransformationAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkTransformationAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java
deleted file mode 100644
index 7ce8601795..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverterAnnotationDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotationDefinition;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverter
- */
-public class EclipseLinkTypeConverterAnnotationDefinition
- implements NestableAnnotationDefinition
-{
- // singleton
- private static final NestableAnnotationDefinition INSTANCE = new EclipseLinkTypeConverterAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static NestableAnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkTypeConverterAnnotationDefinition() {
- super();
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement, int index) {
- return SourceEclipseLinkTypeConverterAnnotation.buildSourceTypeConverterAnnotation(parent, annotatedElement, index);
- }
-
- public NestableAnnotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation, int index) {
- return new BinaryEclipseLinkTypeConverterAnnotation(parent, jdtAnnotation);
- }
-
- public String getNestableAnnotationName() {
- return EclipseLink.TYPE_CONVERTER;
- }
-
- public String getContainerAnnotationName() {
- return EclipseLink.TYPE_CONVERTERS;
- }
-
- public String getElementName() {
- return EclipseLink.TYPE_CONVERTERS__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverters2_2AnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverters2_2AnnotationDefinition.java
deleted file mode 100644
index 554eb04bac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkTypeConverters2_2AnnotationDefinition.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryNamedAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceNamedAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-/**
- * org.eclipse.persistence.annotations.TypeConverters
- */
-public final class EclipseLinkTypeConverters2_2AnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkTypeConverters2_2AnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkTypeConverters2_2AnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceNamedAnnotation(parent, annotatedElement, getAnnotationName());
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryNamedAnnotation(parent, jdtAnnotation, getAnnotationName());
- }
-
- public String getAnnotationName() {
- return EclipseLink.TYPE_CONVERTERS;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java
deleted file mode 100644
index bd2b0d5fff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkVariableOneToOneAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkVariableOneToOneAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkVariableOneToOneAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.VariableOneToOne
- */
-public class EclipseLinkVariableOneToOneAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkVariableOneToOneAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkVariableOneToOneAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkVariableOneToOneAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkVariableOneToOneAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkVariableOneToOneAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java
deleted file mode 100644
index 13773e428b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/EclipseLinkWriteTransformerAnnotationDefinition.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.AnnotationDefinition;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary.BinaryEclipseLinkWriteTransformerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source.SourceEclipseLinkWriteTransformerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.WriteTransformer
- */
-public class EclipseLinkWriteTransformerAnnotationDefinition
- implements AnnotationDefinition
-{
- // singleton
- private static final AnnotationDefinition INSTANCE = new EclipseLinkWriteTransformerAnnotationDefinition();
-
- /**
- * Return the singleton.
- */
- public static AnnotationDefinition instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkWriteTransformerAnnotationDefinition() {
- super();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement annotatedElement) {
- return new SourceEclipseLinkWriteTransformerAnnotation(parent, annotatedElement);
- }
-
- public Annotation buildNullAnnotation(JavaResourceAnnotatedElement parent) {
- throw new UnsupportedOperationException();
- }
-
- public Annotation buildAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- return new BinaryEclipseLinkWriteTransformerAnnotation(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkWriteTransformerAnnotation.ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java
deleted file mode 100644
index 2ad0557a48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Cache</code>
- */
-public final class NullEclipseLinkCacheAnnotation
- extends NullAnnotation<EclipseLinkCacheAnnotation>
- implements EclipseLinkCacheAnnotation
-{
- protected NullEclipseLinkCacheAnnotation(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** type
- public CacheType getType() {
- return null;
- }
-
- public void setType(CacheType type) {
- if (type != null) {
- this.addAnnotation().setType(type);
- }
- }
-
- public TextRange getTypeTextRange() {
- return null;
- }
-
- // ***** size
- public Integer getSize() {
- return null;
- }
-
- public void setSize(Integer size) {
- if (size != null) {
- this.addAnnotation().setSize(size);
- }
- }
-
- public TextRange getSizeTextRange() {
- return null;
- }
-
- // ***** shared
- public Boolean getShared() {
- return null;
- }
-
- public void setShared(Boolean shared) {
- if (shared != null) {
- this.addAnnotation().setShared(shared);
- }
- }
-
- public TextRange getSharedTextRange() {
- return null;
- }
-
- // ***** always refresh
- public Boolean getAlwaysRefresh() {
- return null;
- }
-
- public void setAlwaysRefresh(Boolean alwaysRefresh) {
- if (alwaysRefresh != null) {
- this.addAnnotation().setAlwaysRefresh(alwaysRefresh);
- }
- }
-
- public TextRange getAlwaysRefreshTextRange() {
- return null;
- }
-
- // ***** refresh only if newer
- public Boolean getRefreshOnlyIfNewer() {
- return null;
- }
-
- public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- if (refreshOnlyIfNewer != null) {
- this.addAnnotation().setRefreshOnlyIfNewer(refreshOnlyIfNewer);
- }
- }
-
- public TextRange getRefreshOnlyIfNewerTextRange() {
- return null;
- }
-
- // ***** disable hits
- public Boolean getDisableHits() {
- return null;
- }
-
- public void setDisableHits(Boolean disableHits) {
- if (disableHits != null) {
- this.addAnnotation().setDisableHits(disableHits);
- }
- }
-
- public TextRange getDisableHitsTextRange() {
- return null;
- }
-
- // ***** coordination type
- public CacheCoordinationType getCoordinationType() {
- return null;
- }
-
- public void setCoordinationType(CacheCoordinationType coordinationType) {
- if (coordinationType != null) {
- this.addAnnotation().setCoordinationType(coordinationType);
- }
- }
-
- public TextRange getCoordinationTypeTextRange() {
- return null;
- }
-
- // ***** expiry
- public Integer getExpiry() {
- return null;
- }
-
- public void setExpiry(Integer expiry) {
- if (expiry != null) {
- this.addAnnotation().setExpiry(expiry);
- }
- }
-
- public TextRange getExpiryTextRange() {
- return null;
- }
-
- // ***** expiry time of day
- public EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay() {
- return null;
- }
-
- public EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay() {
- return this.addAnnotation().addExpiryTimeOfDay();
- }
-
- public void removeExpiryTimeOfDay() {
- // do nothing
- }
-
- public TextRange getExpiryTimeOfDayTextRange() {
- return null;
- }
-
-
- // ***** isolation
- public CacheIsolationType2_2 getIsolation() {
- return null;
- }
-
- public void setIsolation(CacheIsolationType2_2 isolation) {
- if (isolation != null) {
- this.addAnnotation().setIsolation(isolation);
- }
- }
-
- public TextRange getIsolationTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index a74b6451ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-/**
- * <code>org.eclipse.persistence.annotations.JoinFetch</code>
- */
-public final class NullEclipseLinkJoinFetchAnnotation
- extends NullAnnotation<EclipseLinkJoinFetchAnnotation>
- implements EclipseLinkJoinFetchAnnotation
-{
- protected NullEclipseLinkJoinFetchAnnotation(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** value
- public JoinFetchType getValue() {
- return null;
- }
-
- public void setValue(JoinFetchType value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkMultitenantAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkMultitenantAnnotation2_3.java
deleted file mode 100644
index 479ae5fe50..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkMultitenantAnnotation2_3.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-
-/**
- * <code>org.eclipse.persistence.annotations.Multitenant</code>
- */
-public final class NullEclipseLinkMultitenantAnnotation2_3
- extends NullAnnotation<EclipseLinkMultitenantAnnotation2_3>
- implements EclipseLinkMultitenantAnnotation2_3
-{
- protected NullEclipseLinkMultitenantAnnotation2_3(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public boolean isSpecified() {
- return false;
- }
-
- // ***** type
- public MultitenantType2_3 getValue() {
- return null;
- }
-
- public void setValue(MultitenantType2_3 value) {
- if (value != null) {
- this.addAnnotation().setValue(value);
- }
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return null;
- }
-
- // ***** include criteria
- public Boolean getIncludeCriteria() {
- return null;
- }
-
- public void setIncludeCriteria(Boolean includeCriteria) {
- if (includeCriteria != null) {
- this.addAnnotation().setIncludeCriteria(includeCriteria);
- }
- }
-
- public TextRange getIncludeCriteriaTextRange(CompilationUnit astRoot) {
- return null;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
deleted file mode 100644
index 2243813b9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.resource.java.NullBaseDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * <code>org.eclipse.persistence.annotations.TenantDiscriminatorColumn</code>
- */
-public final class NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3
- extends NullBaseDiscriminatorColumnAnnotation<EclipseLinkTenantDiscriminatorColumnAnnotation2_3>
- implements EclipseLinkTenantDiscriminatorColumnAnnotation2_3
-{
- public NullEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME;
- }
-
- // ***** context property
- public String getContextProperty() {
- return null;
- }
-
- public void setContextProperty(String contextProperty) {
- if (contextProperty != null) {
- this.addAnnotation().setContextProperty(contextProperty);
- }
- }
-
- public TextRange getContextPropertyTextRange() {
- return null;
- }
-
- // ***** table
- public String getTable() {
- return null;
- }
-
- public void setTable(String table) {
- if (table != null) {
- this.addAnnotation().setTable(table);
- }
- }
-
- public TextRange getTableTextRange() {
- return null;
- }
-
- public boolean tableTouches(int pos) {
- return false;
- }
-
- // ***** primary key
- public Boolean getPrimaryKey() {
- return null;
- }
-
- public void setPrimaryKey(Boolean primaryKey) {
- if (primaryKey != null) {
- this.addAnnotation().setPrimaryKey(primaryKey);
- }
- }
-
- public TextRange getPrimaryKeyTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java
deleted file mode 100644
index e2af29cedf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jpt.common.core.internal.resource.java.NullAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Transformation</code>
- */
-public final class NullEclipseLinkTransformationAnnotation
- extends NullAnnotation<EclipseLinkTransformationAnnotation>
- implements EclipseLinkTransformationAnnotation
-{
- protected NullEclipseLinkTransformationAnnotation(JavaResourceAnnotatedElement parent) {
- super(parent);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // ***** fetch
- public FetchType getFetch() {
- return null;
- }
-
- public void setFetch(FetchType fetch) {
- if (fetch != null) {
- this.addAnnotation().setFetch(fetch);
- }
- }
-
- public TextRange getFetchTextRange() {
- return null;
- }
-
- // ***** optional
- public Boolean getOptional() {
- return null;
- }
-
- public void setOptional(Boolean optional) {
- if (optional != null) {
- this.addAnnotation().setOptional(optional);
- }
- }
-
- public TextRange getOptionalTextRange() {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java
deleted file mode 100644
index c508768725..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/NullEclipseLinkWriteTransformerColumnAnnotation.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java;
-
-import org.eclipse.jpt.jpa.core.internal.resource.java.NullColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * <code>javax.persistence.Column</code>
- */
-public final class NullEclipseLinkWriteTransformerColumnAnnotation
- extends NullColumnAnnotation
-{
- public NullEclipseLinkWriteTransformerColumnAnnotation(EclipseLinkWriteTransformerAnnotation parent) {
- super(parent);
- }
-
- private EclipseLinkWriteTransformerAnnotation getWriteTransformerAnnotation() {
- return (EclipseLinkWriteTransformerAnnotation) this.parent;
- }
-
- @Override
- protected ColumnAnnotation addAnnotation() {
- return this.getWriteTransformerAnnotation().addColumn();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkArrayAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkArrayAnnotation.java
deleted file mode 100644
index 756b0efe19..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkArrayAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkArrayAnnotation2_3;
-
-/**
- * org.eclipse.persistence.annotations.Array
- */
-public final class BinaryEclipseLinkArrayAnnotation
- extends BinaryAnnotation
- implements EclipseLinkArrayAnnotation2_3
-{
- public BinaryEclipseLinkArrayAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBaseConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBaseConvertAnnotation.java
deleted file mode 100644
index 95ccb577ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBaseConvertAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBaseConvertAnnotation;
-
-/**
- * <code><ul>
- * <li>org.eclipse.persistence.annotations.Convert
- * <li>org.eclipse.persistence.annotations.MapKeyConvert
- * </ul></code>
- */
-public abstract class BinaryEclipseLinkBaseConvertAnnotation
- extends BinaryAnnotation
- implements EclipseLinkBaseConvertAnnotation
-{
- private String value;
-
- protected BinaryEclipseLinkBaseConvertAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** ConvertAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(this.getValueElementName());
- }
-
- protected abstract String getValueElementName();
-
- public TextRange getValueTextRange() {
- throw new UnsupportedOperationException();
- }
-
- public boolean valueTouches(int pos) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBaseTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBaseTypeConverterAnnotation.java
deleted file mode 100644
index 43439c8899..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBaseTypeConverterAnnotation.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBaseTypeConverterAnnotation;
-
-/**
- * <code>
- * <ul>
- * <li>org.eclipse.persistence.annotations.TypeConverter
- * <li>org.eclipse.persistence.annotations.ObjectTypeConverter
- * </ul>
- * </code>
- */
-abstract class BinaryEclipseLinkBaseTypeConverterAnnotation
- extends BinaryEclipseLinkNamedConverterAnnotation
- implements EclipseLinkBaseTypeConverterAnnotation
-{
- String dataType;
- String objectType;
-
-
- BinaryEclipseLinkBaseTypeConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.dataType = this.buildDataType();
- this.objectType = this.buildObjectType();
- }
-
- @Override
- public void update() {
- super.update();
- this.setDataType_(this.buildDataType());
- this.setObjectType_(this.buildObjectType());
- }
-
-
- // ********** ObjectTypeConverterAnnotation implementation **********
-
- // ***** data type
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- throw new UnsupportedOperationException();
- }
-
- private void setDataType_(String dataType) {
- String old = this.dataType;
- this.dataType = dataType;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, dataType);
- }
-
- public String getFullyQualifiedDataType() {
- return this.dataType;
- }
-
- private String buildDataType() {
- return (String) this.getJdtMemberValue(this.getDataTypeElementName());
- }
-
- public TextRange getDataTypeTextRange() {
- throw new UnsupportedOperationException();
- }
-
- abstract String getDataTypeElementName();
-
- // ***** object type
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- throw new UnsupportedOperationException();
- }
-
- private void setObjectType_(String objectType) {
- String old = this.objectType;
- this.objectType = objectType;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, objectType);
- }
-
- public String getFullyQualifiedObjectType() {
- return this.objectType;
- }
-
- private String buildObjectType() {
- return (String) this.getJdtMemberValue(this.getObjectTypeElementName());
- }
-
- public TextRange getObjectTypeTextRange() {
- throw new UnsupportedOperationException();
- }
-
- abstract String getObjectTypeElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java
deleted file mode 100644
index b3db1a0770..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicCollectionAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicCollection
- */
-public final class BinaryEclipseLinkBasicCollectionAnnotation
- extends BinaryAnnotation
- implements EclipseLinkBasicCollectionAnnotation
-{
- public BinaryEclipseLinkBasicCollectionAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java
deleted file mode 100644
index 90a6124b89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkBasicMapAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicMap
- */
-public final class BinaryEclipseLinkBasicMapAnnotation
- extends BinaryAnnotation
- implements EclipseLinkBasicMapAnnotation
-{
- public BinaryEclipseLinkBasicMapAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java
deleted file mode 100644
index 0153aaaab8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Cache</code>
- */
-public final class BinaryEclipseLinkCacheAnnotation
- extends BinaryAnnotation
- implements EclipseLinkCacheAnnotation
-{
- private CacheType type;
- private Integer size;
- private Boolean shared;
- private Integer expiry;
- private EclipseLinkTimeOfDayAnnotation expiryTimeOfDay;
- private Boolean alwaysRefresh;
- private Boolean refreshOnlyIfNewer;
- private Boolean disableHits;
- private CacheCoordinationType coordinationType;
- private CacheIsolationType2_2 isolation;
-
-
- public BinaryEclipseLinkCacheAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.type = this.buildType();
- this.size = this.buildSize();
- this.shared = this.buildShared();
- this.expiry = this.buildExpiry();
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay();
- this.alwaysRefresh = this.buildAlwaysRefresh();
- this.refreshOnlyIfNewer = this.buildRefreshOnlyIfNewer();
- this.disableHits = this.buildDisableHits();
- this.coordinationType = this.buildCoordinationType();
- this.isolation = this.buildIsolation();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // TODO
- @Override
- public void update() {
- super.update();
- this.setType_(this.buildType());
- this.setSize_(this.buildSize());
- this.setShared_(this.buildShared());
- this.setExpiry_(this.buildExpiry());
- this.updateExpiryTimeOfDay();
- this.setAlwaysRefresh_(this.buildAlwaysRefresh());
- this.setRefreshOnlyIfNewer_(this.buildRefreshOnlyIfNewer());
- this.setDisableHits_(this.buildDisableHits());
- this.setCoordinationType_(this.buildCoordinationType());
- this.setIsolation_(this.buildIsolation());
- }
-
-
- // ********** CacheAnnotation implementation **********
-
- // ***** type
- public CacheType getType() {
- return this.type;
- }
-
- public void setType(CacheType type) {
- throw new UnsupportedOperationException();
- }
-
- private void setType_(CacheType type) {
- CacheType old = this.type;
- this.type = type;
- this.firePropertyChanged(TYPE_PROPERTY, old, type);
- }
-
- private CacheType buildType() {
- return CacheType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CACHE__TYPE));
- }
-
- public TextRange getTypeTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** size
- public Integer getSize() {
- return this.size;
- }
-
- public void setSize(Integer size) {
- throw new UnsupportedOperationException();
- }
-
- private void setSize_(Integer size) {
- Integer old = this.size;
- this.size = size;
- this.firePropertyChanged(SIZE_PROPERTY, old, size);
- }
-
- private Integer buildSize() {
- return (Integer) this.getJdtMemberValue(EclipseLink.CACHE__SIZE);
- }
-
- public TextRange getSizeTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** shared
- public Boolean getShared() {
- return this.shared;
- }
-
- public void setShared(Boolean shared) {
- throw new UnsupportedOperationException();
- }
-
- private void setShared_(Boolean shared) {
- Boolean old = this.shared;
- this.shared = shared;
- this.firePropertyChanged(SHARED_PROPERTY, old, shared);
- }
-
- private Boolean buildShared() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__SHARED);
- }
-
- public TextRange getSharedTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** expiry
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer expiry) {
- throw new UnsupportedOperationException();
- }
-
- private void setExpiry_(Integer expiry) {
- Integer old = this.expiry;
- this.expiry = expiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, expiry);
- }
-
- private Integer buildExpiry() {
- return (Integer) this.getJdtMemberValue(EclipseLink.CACHE__EXPIRY);
- }
-
- public TextRange getExpiryTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** expiry time of day
- public EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay() {
- throw new UnsupportedOperationException();
- }
-
- public void removeExpiryTimeOfDay() {
- throw new UnsupportedOperationException();
- }
-
- private EclipseLinkTimeOfDayAnnotation buildExpiryTimeOfDay() {
- IAnnotation jdtTimeOfDay = this.getJdtExpiryTimeOfDay();
- return (jdtTimeOfDay == null) ? null : this.buildTimeOfDay(jdtTimeOfDay);
- }
-
- private EclipseLinkTimeOfDayAnnotation buildTimeOfDay(IAnnotation jdtTimeOfDay) {
- return new BinaryEclipseLinkTimeOfDayAnnotation(this, jdtTimeOfDay);
- }
-
- private IAnnotation getJdtExpiryTimeOfDay() {
- return (IAnnotation) this.getJdtMemberValue(EclipseLink.CACHE__EXPIRY_TIME_OF_DAY);
- }
-
- private void setExpiryTimeOfDay(EclipseLinkTimeOfDayAnnotation expiryTimeOfDay) {
- EclipseLinkTimeOfDayAnnotation old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = expiryTimeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, expiryTimeOfDay);
- }
-
- // TODO
- private void updateExpiryTimeOfDay() {
- throw new UnsupportedOperationException();
-// IAnnotation jdtTimeOfDay = this.getJdtExpiryTimeOfDay();
-// if (jdtTimeOfDay == null) {
-// this.setExpiryTimeOfDay(null);
-// } else {
-// if (this.expiryTimeOfDay == null) {
-// this.setExpiryTimeOfDay(this.buildTimeOfDay(jdtTimeOfDay));
-// } else {
-// this.expiryTimeOfDay.update(jdtTimeOfDay);
-// }
-// }
- }
-
- public TextRange getExpiryTimeOfDayTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** always refresh
- public Boolean getAlwaysRefresh() {
- return this.alwaysRefresh;
- }
-
- public void setAlwaysRefresh(Boolean alwaysRefresh) {
- throw new UnsupportedOperationException();
- }
-
- private void setAlwaysRefresh_(Boolean alwaysRefresh) {
- Boolean old = this.alwaysRefresh;
- this.alwaysRefresh = alwaysRefresh;
- this.firePropertyChanged(ALWAYS_REFRESH_PROPERTY, old, alwaysRefresh);
- }
-
- private Boolean buildAlwaysRefresh() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__ALWAYS_REFRESH);
- }
-
- public TextRange getAlwaysRefreshTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** refresh only if newer
- public Boolean getRefreshOnlyIfNewer() {
- return this.refreshOnlyIfNewer;
- }
-
- public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- throw new UnsupportedOperationException();
- }
-
- private void setRefreshOnlyIfNewer_(Boolean refreshOnlyIfNewer) {
- Boolean old = this.refreshOnlyIfNewer;
- this.refreshOnlyIfNewer = refreshOnlyIfNewer;
- this.firePropertyChanged(REFRESH_ONLY_IF_NEWER_PROPERTY, old, refreshOnlyIfNewer);
- }
-
- private Boolean buildRefreshOnlyIfNewer() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__REFRESH_ONLY_IF_NEWER);
- }
-
- public TextRange getRefreshOnlyIfNewerTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** disable hits
- public Boolean getDisableHits() {
- return this.disableHits;
- }
-
- public void setDisableHits(Boolean disableHits) {
- throw new UnsupportedOperationException();
- }
-
- private void setDisableHits_(Boolean disableHits) {
- Boolean old = this.disableHits;
- this.disableHits = disableHits;
- this.firePropertyChanged(DISABLE_HITS_PROPERTY, old, disableHits);
- }
-
- private Boolean buildDisableHits() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.CACHE__DISABLE_HITS);
- }
-
- public TextRange getDisableHitsTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** coordination type
- public CacheCoordinationType getCoordinationType() {
- return this.coordinationType;
- }
-
- public void setCoordinationType(CacheCoordinationType coordinationType) {
- throw new UnsupportedOperationException();
- }
-
- private void setCoordinationType_(CacheCoordinationType coordinationType) {
- CacheCoordinationType old = this.coordinationType;
- this.coordinationType = coordinationType;
- this.firePropertyChanged(TYPE_PROPERTY, old, coordinationType);
- }
-
- private CacheCoordinationType buildCoordinationType() {
- return CacheCoordinationType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CACHE__COORDINATION_TYPE));
- }
-
- public TextRange getCoordinationTypeTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** isolation
- public CacheIsolationType2_2 getIsolation() {
- return this.isolation;
- }
-
- public void setIsolation(CacheIsolationType2_2 isolation) {
- throw new UnsupportedOperationException();
- }
-
- private void setIsolation_(CacheIsolationType2_2 isolation) {
- CacheIsolationType2_2 old = this.isolation;
- this.isolation = isolation;
- this.firePropertyChanged(ISOLATION_PROPERTY, old, isolation);
- }
-
- private CacheIsolationType2_2 buildIsolation() {
- return CacheIsolationType2_2.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CACHE__ISOLATION));
- }
-
- public TextRange getIsolationTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java
deleted file mode 100644
index aa4110e45f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkChangeTrackingAnnotation.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.ChangeTracking</code>
- */
-public final class BinaryEclipseLinkChangeTrackingAnnotation
- extends BinaryAnnotation
- implements EclipseLinkChangeTrackingAnnotation
-{
- private ChangeTrackingType value;
-
-
- public BinaryEclipseLinkChangeTrackingAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- // TODO
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** ChangeTrackingAnnotation implementation **********
-
- // ***** value
- public ChangeTrackingType getValue() {
- return this.value;
- }
-
- public void setValue(ChangeTrackingType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(ChangeTrackingType value) {
- ChangeTrackingType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private ChangeTrackingType buildValue() {
- return ChangeTrackingType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.CHANGE_TRACKING__VALUE));
- }
-
- public TextRange getValueTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java
deleted file mode 100644
index a7860cb76b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkClassExtractorAnnotation2_1.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-
-/**
- * org.eclipse.persistence.annotations.ClassExtractor
- */
-public final class BinaryEclipseLinkClassExtractorAnnotation2_1
- extends BinaryAnnotation
- implements EclipseLinkClassExtractorAnnotation2_1
-{
- private String value;
-
-
- public BinaryEclipseLinkClassExtractorAnnotation2_1(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** EclipseLinkClassExtractorAnnotation2_1 implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(EclipseLink.CLASS_EXTRACTOR__VALUE);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** fully-qualified class name
- /**
- * binary is already fully-qualified
- */
- public String getFullyQualifiedClassName() {
- return this.value;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index bf71ec9b6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.ConversionValue</code>
- */
-final class BinaryEclipseLinkConversionValueAnnotation
- extends BinaryAnnotation
- implements EclipseLinkConversionValueAnnotation
-{
- private String dataValue;
- private String objectValue;
-
-
- BinaryEclipseLinkConversionValueAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.dataValue = this.buildDataValue();
- this.objectValue = this.buildObjectValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setDataValue_(this.buildDataValue());
- this.setObjectValue_(this.buildObjectValue());
- }
-
-
- // ********** ConversionValueAnnotation implementation **********
-
- // ***** data value
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String dataValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDataValue_(String dataValue) {
- String old = this.dataValue;
- this.dataValue = dataValue;
- this.firePropertyChanged(DATA_VALUE_PROPERTY, old, dataValue);
- }
-
- private String buildDataValue() {
- return (String) this.getJdtMemberValue(EclipseLink.CONVERSION_VALUE__DATA_VALUE);
- }
-
- public TextRange getDataValueTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** object value
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String objectValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setObjectValue_(String objectValue) {
- String old = this.objectValue;
- this.objectValue = objectValue;
- this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, objectValue);
- }
-
- private String buildObjectValue() {
- return (String) this.getJdtMemberValue(EclipseLink.CONVERSION_VALUE__OBJECT_VALUE);
- }
-
- public TextRange getObjectValueTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java
deleted file mode 100644
index 68b2c9e5bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Convert</code>
- */
-public final class BinaryEclipseLinkConvertAnnotation
- extends BinaryEclipseLinkBaseConvertAnnotation
- implements EclipseLinkConvertAnnotation
-{
- public BinaryEclipseLinkConvertAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return EclipseLink.CONVERT__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java
deleted file mode 100644
index ead46df6a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkConverterAnnotation.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Converter</code>
- */
-public final class BinaryEclipseLinkConverterAnnotation
- extends BinaryEclipseLinkNamedConverterAnnotation
- implements EclipseLinkConverterAnnotation
-{
- private String converterClass;
-
-
- public BinaryEclipseLinkConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.converterClass = this.buildConverterClass();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setConverterClass_(this.buildConverterClass());
- }
-
-
- // ********** BinaryNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.CONVERTER__NAME;
- }
-
- // ********** ConverterAnnotation implementation **********
-
- // ***** converter class
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String converterClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setConverterClass_(String converterClass) {
- String old = this.converterClass;
- this.converterClass = converterClass;
- this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, old, converterClass);
- }
-
- public String getFullyQualifiedConverterClassName() {
- return this.converterClass;
- }
-
- private String buildConverterClass() {
- return (String) this.getJdtMemberValue(EclipseLink.CONVERTER__CONVERTER_CLASS);
- }
-
- public TextRange getConverterClassTextRange() {
- throw new UnsupportedOperationException();
- }
-
- public boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java
deleted file mode 100644
index ee0e7da1b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkCustomizerAnnotation.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Customizer</code>
- */
-public final class BinaryEclipseLinkCustomizerAnnotation
- extends BinaryAnnotation
- implements EclipseLinkCustomizerAnnotation
-{
- private String value;
-
-
- public BinaryEclipseLinkCustomizerAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** CustomizerAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(String value) {
- String old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- // ***** fully-qualified customizer class name
- public String getFullyQualifiedCustomizerClassName() {
- return this.value;
- }
-
- private String buildValue() {
- return (String) this.getJdtMemberValue(EclipseLink.CUSTOMIZER__VALUE);
- }
-
- public TextRange getValueTextRange() {
- throw new UnsupportedOperationException();
- }
-
- public boolean customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java
deleted file mode 100644
index 349b1ac850..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkExistenceCheckingAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType;
-
-/**
- * <code>org.eclipse.persistence.annotations.ExistenceChecking</code>
- */
-public final class BinaryEclipseLinkExistenceCheckingAnnotation
- extends BinaryAnnotation
- implements EclipseLinkExistenceCheckingAnnotation
-{
- private ExistenceType value;
-
-
- public BinaryEclipseLinkExistenceCheckingAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** ExistenceCheckingAnnotation implementation **********
-
- // ***** value
- public ExistenceType getValue() {
- return this.value;
- }
-
- public void setValue(ExistenceType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(ExistenceType value) {
- ExistenceType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private ExistenceType buildValue() {
- return ExistenceType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.EXISTENCE_CHECKING__VALUE));
- }
-
- public TextRange getValueTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index ab16b17e97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-/**
- * <code>org.eclipse.persistence.annotations.JoinFetch</code>
- */
-public final class BinaryEclipseLinkJoinFetchAnnotation
- extends BinaryAnnotation
- implements EclipseLinkJoinFetchAnnotation
-{
- private JoinFetchType value;
-
-
- public BinaryEclipseLinkJoinFetchAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** BinaryJoinFetchAnnotation implementation **********
-
- // ***** value
- public JoinFetchType getValue() {
- return this.value;
- }
-
- public void setValue(JoinFetchType value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(JoinFetchType value) {
- JoinFetchType old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private JoinFetchType buildValue() {
- return JoinFetchType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.JOIN_FETCH__VALUE));
- }
-
- public TextRange getValueTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMapKeyConvertAnnotation2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMapKeyConvertAnnotation2_0.java
deleted file mode 100644
index 80102d72ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMapKeyConvertAnnotation2_0.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMapKeyConvertAnnotation2_0;
-
-/**
- * <code>org.eclipse.persistence.annotations.MapKeyConvert</code>
- */
-public final class BinaryEclipseLinkMapKeyConvertAnnotation2_0
- extends BinaryEclipseLinkBaseConvertAnnotation
- implements EclipseLinkMapKeyConvertAnnotation2_0
-{
-
- public BinaryEclipseLinkMapKeyConvertAnnotation2_0(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMapKeyConvertAnnotation2_0.ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return EclipseLink.MAP_KEY_CONVERT__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation2_3.java
deleted file mode 100644
index 089e362413..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMultitenantAnnotation2_3.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-
-/**
- * org.eclipse.persistence.annotations.Multitenant
- */
-public class BinaryEclipseLinkMultitenantAnnotation2_3
- extends BinaryAnnotation
- implements EclipseLinkMultitenantAnnotation2_3
-{
- private MultitenantType2_3 value;
- private Boolean includeCriteria; // added in EclipseLink 2.4
-
-
- public BinaryEclipseLinkMultitenantAnnotation2_3(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- this.includeCriteria = this.buildIncludeCriteria();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- this.setIncludeCriteria_(this.buildIncludeCriteria());
- }
-
-
- // ********** EclipseLinkMultitenantAnnotation implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** value
- public MultitenantType2_3 getValue() {
- return this.value;
- }
-
- public void setValue(MultitenantType2_3 value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(MultitenantType2_3 value) {
- MultitenantType2_3 old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private MultitenantType2_3 buildValue() {
- return MultitenantType2_3.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.JOIN_FETCH__VALUE));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
- // ***** include criteria
- public Boolean getIncludeCriteria() {
- return this.includeCriteria;
- }
-
- public void setIncludeCriteria(Boolean includeCriteria) {
- throw new UnsupportedOperationException();
- }
-
- private void setIncludeCriteria_(Boolean includeCriteria) {
- Boolean old = this.includeCriteria;
- this.includeCriteria = includeCriteria;
- this.firePropertyChanged(INCLUDE_CRITERIA_PROPERTY, old, includeCriteria);
- }
-
- private Boolean buildIncludeCriteria() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.MULTITENANT__INCLUDE_CRITERIA);
- }
-
- public TextRange getIncludeCriteriaTextRange(CompilationUnit astRoot) {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java
deleted file mode 100644
index 03bfe2b3d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkMutableAnnotation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Mutable</code>
- */
-public final class BinaryEclipseLinkMutableAnnotation
- extends BinaryAnnotation
- implements EclipseLinkMutableAnnotation
-{
- private Boolean value;
-
-
- public BinaryEclipseLinkMutableAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.value = this.buildValue();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setValue_(this.buildValue());
- }
-
-
- // ********** MutableAnnotation implementation **********
-
- // ***** value
- public Boolean getValue() {
- return this.value;
- }
-
- public void setValue(Boolean value) {
- throw new UnsupportedOperationException();
- }
-
- private void setValue_(Boolean value) {
- Boolean old = this.value;
- this.value = value;
- this.firePropertyChanged(VALUE_PROPERTY, old, value);
- }
-
- private Boolean buildValue() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.MUTABLE__VALUE);
- }
-
- public TextRange getValueTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java
deleted file mode 100644
index 908a6e0265..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkNamedConverterAnnotation.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-
-/**
- * <code>
- * <ul>
- * <li>org.eclipse.persistence.annotations.Converter
- * <li>org.eclipse.persistence.annotations.StructConverter
- * <li>org.eclipse.persistence.annotations.TypeConverter
- * <li>org.eclipse.persistence.annotations.ObjectTypeConverter
- * </ul>
- * </code>
- */
-abstract class BinaryEclipseLinkNamedConverterAnnotation
- extends BinaryAnnotation
- implements EclipseLinkNamedConverterAnnotation
-{
- String name;
-
- BinaryEclipseLinkNamedConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.name = this.buildName();
- }
-
- @Override
- public void update() {
- super.update();
- this.setName_(this.buildName());
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** NamedConverterAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- throw new UnsupportedOperationException();
- }
-
- private void setName_(String name) {
- String old = this.name;
- this.name = name;
- this.firePropertyChanged(NAME_PROPERTY, old, name);
- }
-
- private String buildName() {
- return (String) this.getJdtMemberValue(this.getNameElementName());
- }
-
- public TextRange getNameTextRange() {
- throw new UnsupportedOperationException();
- }
-
- abstract String getNameElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java
deleted file mode 100644
index 56f7b6a48f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import java.util.Vector;
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.LiveCloneListIterable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.ObjectTypeConverter</code>
- */
-public final class BinaryEclipseLinkObjectTypeConverterAnnotation
- extends BinaryEclipseLinkBaseTypeConverterAnnotation
- implements EclipseLinkObjectTypeConverterAnnotation
-{
- private String defaultObjectValue;
- private final Vector<EclipseLinkConversionValueAnnotation> conversionValues;
-
-
- public BinaryEclipseLinkObjectTypeConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.defaultObjectValue = this.buildDefaultObjectValue();
- this.conversionValues = this.buildConversionValues();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setDefaultObjectValue_(this.buildDefaultObjectValue());
- this.updateConversionValues();
- }
-
-
- // ********** BinaryNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__NAME;
- }
-
- // ********** BinaryBaseTypeConverterAnnotation implementation **********
-
- @Override
- String getDataTypeElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE;
- }
-
- @Override
- String getObjectTypeElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE;
- }
-
- // ********** ObjectTypeConverterAnnotation implementation **********
-
- // ***** default object value
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String defaultObjectValue) {
- throw new UnsupportedOperationException();
- }
-
- private void setDefaultObjectValue_(String defaultObjectValue) {
- String old = this.defaultObjectValue;
- this.defaultObjectValue = defaultObjectValue;
- this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, defaultObjectValue);
- }
-
- private String buildDefaultObjectValue() {
- return (String) this.getJdtMemberValue(EclipseLink.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE);
- }
-
- public TextRange getDefaultObjectValueTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** conversion values
- public ListIterable<EclipseLinkConversionValueAnnotation> getConversionValues() {
- return new LiveCloneListIterable<EclipseLinkConversionValueAnnotation>(this.conversionValues);
- }
-
- public int getConversionValuesSize() {
- return this.conversionValues.size();
- }
-
- public EclipseLinkConversionValueAnnotation conversionValueAt(int index) {
- return this.conversionValues.get(index);
- }
-
- public EclipseLinkConversionValueAnnotation addConversionValue(int index) {
- throw new UnsupportedOperationException();
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- throw new UnsupportedOperationException();
- }
-
- public void removeConversionValue(int index) {
- throw new UnsupportedOperationException();
- }
-
- private Vector<EclipseLinkConversionValueAnnotation> buildConversionValues() {
- Object[] jdtConversionValues = this.getJdtMemberValues(EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES);
- Vector<EclipseLinkConversionValueAnnotation> result = new Vector<EclipseLinkConversionValueAnnotation>(jdtConversionValues.length);
- for (Object jdtConversionValue : jdtConversionValues) {
- result.add(new BinaryEclipseLinkConversionValueAnnotation(this, (IAnnotation) jdtConversionValue));
- }
- return result;
- }
-
- // TODO
- private void updateConversionValues() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java
deleted file mode 100644
index b9826b04b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrimaryKeyAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrimaryKeyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrimaryKey
- */
-public class BinaryEclipseLinkPrimaryKeyAnnotation
- extends BinaryAnnotation
- implements EclipseLinkPrimaryKeyAnnotation
-{
- public BinaryEclipseLinkPrimaryKeyAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java
deleted file mode 100644
index a565257393..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkPrivateOwnedAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrivateOwned
- */
-public final class BinaryEclipseLinkPrivateOwnedAnnotation
- extends BinaryAnnotation
- implements EclipseLinkPrivateOwnedAnnotation
-{
-
- public BinaryEclipseLinkPrivateOwnedAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java
deleted file mode 100644
index cfcd2aa3e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadOnlyAnnotation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadOnly
- */
-public final class BinaryEclipseLinkReadOnlyAnnotation
- extends BinaryAnnotation
- implements EclipseLinkReadOnlyAnnotation
-{
-
- public BinaryEclipseLinkReadOnlyAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java
deleted file mode 100644
index 5c6c594cde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkReadTransformerAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- */
-public final class BinaryEclipseLinkReadTransformerAnnotation
- extends BinaryEclipseLinkTransformerAnnotation
- implements EclipseLinkReadTransformerAnnotation
-{
-
- public BinaryEclipseLinkReadTransformerAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryTransformerAnnotation implementation **********
-
- @Override
- String getTransformerClassElementName() {
- return EclipseLink.READ_TRANSFORMER__TRANSFORMER_CLASS;
- }
-
- @Override
- String getMethodElementName() {
- return EclipseLink.READ_TRANSFORMER__METHOD;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java
deleted file mode 100644
index f2b838c6b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructConverterAnnotation.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.StructConverter</code>
- */
-public final class BinaryEclipseLinkStructConverterAnnotation
- extends BinaryEclipseLinkNamedConverterAnnotation
- implements EclipseLinkStructConverterAnnotation
-{
- private String converter;
-
-
- public BinaryEclipseLinkStructConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.converter = this.buildConverter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setConverter_(this.buildConverter());
- }
-
-
- // ********** BinaryNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.STRUCT_CONVERTER__NAME;
- }
-
-
- // ********** StructConverterAnnotation implementation **********
-
- // ***** converter
- public String getConverter() {
- return this.converter;
- }
-
- public void setConverter(String converter) {
- throw new UnsupportedOperationException();
- }
-
- private void setConverter_(String converter) {
- String old = this.converter;
- this.converter = converter;
- this.firePropertyChanged(CONVERTER_PROPERTY, old, converter);
- }
-
- private String buildConverter() {
- return (String) this.getJdtMemberValue(EclipseLink.STRUCT_CONVERTER__CONVERTER);
- }
-
- public TextRange getConverterTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructureAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructureAnnotation.java
deleted file mode 100644
index ce41440fe8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkStructureAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructureAnnotation2_3;
-
-/**
- * org.eclipse.persistence.annotations.Structure
- */
-public final class BinaryEclipseLinkStructureAnnotation
- extends BinaryAnnotation
- implements EclipseLinkStructureAnnotation2_3
-{
- public BinaryEclipseLinkStructureAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
deleted file mode 100644
index 7fb00008d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryBaseDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * <code>org.eclipse.persistence.annotations.TenantDiscriminatorColumn</code>
- */
-public final class BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3
- extends BinaryBaseDiscriminatorColumnAnnotation
- implements EclipseLinkTenantDiscriminatorColumnAnnotation2_3
-{
- private String contextProperty;
- private String table;
- private Boolean primaryKey;
-
- public BinaryEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.contextProperty = this.buildContextProperty();
- this.table = this.buildTable();
- this.primaryKey = this.buildPrimaryKey();
- }
-
- public String getAnnotationName() {
- return EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setContextProperty_(this.buildContextProperty());
- this.setTable_(this.buildTable());
- this.setPrimaryKey_(this.buildPrimaryKey());
- }
-
- // ********** BinaryBaseDiscriminatorColumnAnnotation implementation **********
-
- @Override
- protected String getDiscriminatorTypeElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE;
- }
-
- @Override
- protected String getLengthElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__LENGTH;
- }
-
- // ********** BinaryNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
-
- //************* EclipseLinkTenantDiscriminatorColumnAnnotation implementation *************
-
- // ***** contextProperty
- public String getContextProperty() {
- return this.contextProperty;
- }
-
- public void setContextProperty(String contextProperty) {
- throw new UnsupportedOperationException();
- }
-
- private void setContextProperty_(String contextProperty) {
- String old = this.contextProperty;
- this.contextProperty = contextProperty;
- this.firePropertyChanged(CONTEXT_PROPERTY_PROPERTY, old, contextProperty);
- }
-
- private String buildContextProperty() {
- return (String) this.getJdtMemberValue(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY);
- }
-
- public TextRange getContextPropertyTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** table
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String table) {
- throw new UnsupportedOperationException();
- }
-
- private void setTable_(String table) {
- String old = this.table;
- this.table = table;
- this.firePropertyChanged(TABLE_PROPERTY, old, table);
- }
-
- private String buildTable() {
- return (String) this.getJdtMemberValue(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__TABLE);
- }
-
- public TextRange getTableTextRange() {
- throw new UnsupportedOperationException();
- }
-
- public boolean tableTouches(int pos) {
- throw new UnsupportedOperationException();
- }
-
- // ***** primaryKey
- public Boolean getPrimaryKey() {
- return this.primaryKey;
- }
-
- public void setPrimaryKey(Boolean primaryKey) {
- throw new UnsupportedOperationException();
- }
-
- private void setPrimaryKey_(Boolean primaryKey) {
- Boolean old = this.primaryKey;
- this.primaryKey = primaryKey;
- this.firePropertyChanged(PRIMARY_KEY_PROPERTY, old, primaryKey);
- }
-
- private Boolean buildPrimaryKey() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY);
- }
-
- public TextRange getPrimaryKeyTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java
deleted file mode 100644
index 5fce850a9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTimeOfDayAnnotation.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.TimeOfDay</code>
- */
-public final class BinaryEclipseLinkTimeOfDayAnnotation
- extends BinaryAnnotation
- implements EclipseLinkTimeOfDayAnnotation
-{
- private Integer hour;
- private Integer minute;
- private Integer second;
- private Integer millisecond;
-
-
- public BinaryEclipseLinkTimeOfDayAnnotation(JavaResourceNode parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.hour = this.buildHour();
- this.minute = this.buildMinute();
- this.second = this.buildSecond();
- this.millisecond = this.buildMillisecond();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setHour_(this.buildHour());
- this.setMinute_(this.buildMinute());
- this.setSecond_(this.buildSecond());
- this.setMillisecond_(this.buildMillisecond());
- }
-
-
- // ********** TimeOfDayAnnotation implementation **********
-
- // ***** hour
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer hour) {
- throw new UnsupportedOperationException();
- }
-
- private void setHour_(Integer hour) {
- Integer old = this.hour;
- this.hour = hour;
- this.firePropertyChanged(HOUR_PROPERTY, old, hour);
- }
-
- private Integer buildHour() {
- return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__HOUR);
- }
-
- public TextRange getHourTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** minute
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer newMinute) {
- throw new UnsupportedOperationException();
- }
-
- private void setMinute_(Integer newMinute) {
- Integer oldMinute = this.minute;
- this.minute = newMinute;
- this.firePropertyChanged(MINUTE_PROPERTY, oldMinute, newMinute);
- }
-
- private Integer buildMinute() {
- return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__MINUTE);
- }
-
- public TextRange getMinuteTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** second
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer newSecond) {
- throw new UnsupportedOperationException();
- }
-
- private void setSecond_(Integer newSecond) {
- Integer oldSecond = this.second;
- this.second = newSecond;
- this.firePropertyChanged(SECOND_PROPERTY, oldSecond, newSecond);
- }
-
- private Integer buildSecond() {
- return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__SECOND);
- }
-
- public TextRange getSecondTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** millisecond
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer newMillisecond) {
- throw new UnsupportedOperationException();
- }
-
- private void setMillisecond_(Integer newMillisecond) {
- Integer oldMillisecond = this.millisecond;
- this.millisecond = newMillisecond;
- this.firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, newMillisecond);
- }
-
- private Integer buildMillisecond() {
- return (Integer) this.getJdtMemberValue(EclipseLink.TIME_OF_DAY__MILLISECOND);
- }
-
- public TextRange getMillisecondTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java
deleted file mode 100644
index 1a155f1887..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Transformation</code>
- */
-public class BinaryEclipseLinkTransformationAnnotation
- extends BinaryAnnotation
- implements EclipseLinkTransformationAnnotation
-{
- private FetchType fetch;
- private Boolean optional;
-
-
- public BinaryEclipseLinkTransformationAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.fetch = this.buildFetch();
- this.optional = this.buildOptional();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.setFetch_(this.buildFetch());
- this.setOptional_(this.buildOptional());
- }
-
-
- // ********** TransformationAnnotation implementation **********
-
- // ***** fetch
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType fetch) {
- throw new UnsupportedOperationException();
- }
-
- private void setFetch_(FetchType fetch) {
- FetchType old = this.fetch;
- this.fetch = fetch;
- this.firePropertyChanged(FETCH_PROPERTY, old, fetch);
- }
-
- private FetchType buildFetch() {
- return FetchType.fromJavaAnnotationValue(this.getJdtMemberValue(EclipseLink.TRANSFORMATION__FETCH));
- }
-
- public TextRange getFetchTextRange() {
- throw new UnsupportedOperationException();
- }
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- throw new UnsupportedOperationException();
- }
-
- private void setOptional_(Boolean optional) {
- Boolean old = this.optional;
- this.optional = optional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, optional);
- }
-
- private Boolean buildOptional() {
- return (Boolean) this.getJdtMemberValue(EclipseLink.TRANSFORMATION__OPTIONAL);
- }
-
- public TextRange getOptionalTextRange() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java
deleted file mode 100644
index 99c86996c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTransformerAnnotation.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformerAnnotation;
-
-/**
- * <code><ul>
- * <li>org.eclipse.persistence.annotations.ReadTransformer
- * <li>org.eclipse.persistence.annotations.WriteTransformer
- * </ul></code>
- */
-abstract class BinaryEclipseLinkTransformerAnnotation
- extends BinaryAnnotation
- implements EclipseLinkTransformerAnnotation
-{
- private String transformerClass;
- private String method;
-
-
- BinaryEclipseLinkTransformerAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.transformerClass = this.buildTransformerClass();
- this.method = this.buildMethod();
- }
-
- @Override
- public void update() {
- super.update();
- this.setTransformerClass_(this.buildTransformerClass());
- this.setMethod_(this.buildMethod());
- }
-
-
- // ********** TransformerAnnotation implementation **********
-
- // ***** transformer class
- public String getTransformerClass() {
- return this.transformerClass;
- }
-
- public void setTransformerClass(String transformerClass) {
- throw new UnsupportedOperationException();
- }
-
- private void setTransformerClass_(String transformerClass) {
- String old = this.transformerClass;
- this.transformerClass = transformerClass;
- this.firePropertyChanged(TRANSFORMER_CLASS_PROPERTY, old, transformerClass);
- }
-
- private String buildTransformerClass() {
- return (String) this.getJdtMemberValue(this.getTransformerClassElementName());
- }
-
- public TextRange getTransformerClassTextRange() {
- throw new UnsupportedOperationException();
- }
-
- abstract String getTransformerClassElementName();
-
- // ***** method
- public String getMethod() {
- return this.method;
- }
-
- public void setMethod(String method) {
- throw new UnsupportedOperationException();
- }
-
- private void setMethod_(String method) {
- String old = this.method;
- this.method = method;
- this.firePropertyChanged(METHOD_PROPERTY, old, method);
- }
-
- private String buildMethod() {
- return (String) this.getJdtMemberValue(this.getMethodElementName());
- }
-
- public TextRange getMethodTextRange() {
- throw new UnsupportedOperationException();
- }
-
- abstract String getMethodElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index 006fd8f7b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.TypeConverter</code>
- */
-public final class BinaryEclipseLinkTypeConverterAnnotation
- extends BinaryEclipseLinkBaseTypeConverterAnnotation
- implements EclipseLinkTypeConverterAnnotation
-{
- public BinaryEclipseLinkTypeConverterAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** BinaryNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.TYPE_CONVERTER__NAME;
- }
-
-
- // ********** BinaryBaseTypeConverterAnnotation implementation **********
-
- @Override
- String getDataTypeElementName() {
- return EclipseLink.TYPE_CONVERTER__DATA_TYPE;
- }
-
- @Override
- String getObjectTypeElementName() {
- return EclipseLink.TYPE_CONVERTER__OBJECT_TYPE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index 1fcd8aeabb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkVariableOneToOneAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.internal.resource.java.binary.BinaryAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.VariableOneToOne
- */
-public class BinaryEclipseLinkVariableOneToOneAnnotation
- extends BinaryAnnotation
- implements EclipseLinkVariableOneToOneAnnotation
-{
- public BinaryEclipseLinkVariableOneToOneAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java
deleted file mode 100644
index ae32e241ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/binary/BinaryEclipseLinkWriteTransformerAnnotation.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.binary;
-
-import org.eclipse.jdt.core.IAnnotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.internal.resource.java.binary.BinaryColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.NullEclipseLinkWriteTransformerColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.ReadTransformer</code>
- */
-public class BinaryEclipseLinkWriteTransformerAnnotation
- extends BinaryEclipseLinkTransformerAnnotation
- implements EclipseLinkWriteTransformerAnnotation
-{
- private ColumnAnnotation column;
- private final ColumnAnnotation nullColumn;
-
-
- public BinaryEclipseLinkWriteTransformerAnnotation(JavaResourceAnnotatedElement parent, IAnnotation jdtAnnotation) {
- super(parent, jdtAnnotation);
- this.column = this.buildColumn();
- this.nullColumn = this.buildNullColumn();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void update() {
- super.update();
- this.updateColumn();
- }
-
-
- // ********** BinaryTransformerAnnotation implementation **********
-
- @Override
- String getTransformerClassElementName() {
- return EclipseLink.WRITE_TRANSFORMER__TRANSFORMER_CLASS;
- }
-
- @Override
- String getMethodElementName() {
- return EclipseLink.WRITE_TRANSFORMER__METHOD;
- }
-
-
- // ********** WriteTransformerAnnotation implementation **********
-
- // ***** column
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return (this.column != null) ? this.column : this.nullColumn;
- }
-
- public ColumnAnnotation addColumn() {
- throw new UnsupportedOperationException();
- }
-
- public void removeColumn() {
- throw new UnsupportedOperationException();
- }
-
- public TextRange getColumnTextRange() {
- throw new UnsupportedOperationException();
- }
-
- private ColumnAnnotation buildColumn() {
- IAnnotation jdtColumn = this.getJdtColumn();
- return (jdtColumn == null) ? null : this.buildColumn(jdtColumn);
- }
-
- private ColumnAnnotation buildNullColumn() {
- return new NullEclipseLinkWriteTransformerColumnAnnotation(this);
- }
-
- private ColumnAnnotation buildColumn(IAnnotation jdtColumn) {
- return new BinaryColumnAnnotation(this, jdtColumn);
- }
-
- private IAnnotation getJdtColumn() {
- return (IAnnotation) this.getJdtMemberValue(EclipseLink.WRITE_TRANSFORMER__COLUMN);
- }
-
- private void setColumn(ColumnAnnotation column) {
- ColumnAnnotation old = this.column;
- this.column = column;
- this.firePropertyChanged(COLUMN_PROPERTY, old, column);
- }
-
- // TODO
- private void updateColumn() {
- throw new UnsupportedOperationException();
-// IAnnotation jdtColumn = this.getJdtColumn();
-// if (jdtColumn == null) {
-// this.setColumn(null);
-// } else {
-// if (this.column == null) {
-// this.setColumn(this.buildColumn(jdtColumn));
-// } else {
-// this.column.update(jdtColumn);
-// }
-// }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkArrayAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkArrayAnnotation.java
deleted file mode 100644
index 8e23744381..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkArrayAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkArrayAnnotation2_3;
-
-/**
- * org.eclipse.persistence.annotations.Array
- */
-public final class SourceEclipseLinkArrayAnnotation
- extends SourceAnnotation
- implements EclipseLinkArrayAnnotation2_3
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkArrayAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // do nothing
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBaseConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBaseConvertAnnotation.java
deleted file mode 100644
index 2d8193383d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBaseConvertAnnotation.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBaseConvertAnnotation;
-
-/**
- * <code><ul>
- * <li>org.eclipse.persistence.annotations.Convert
- * <li>org.eclipse.persistence.annotations.MapKeyConvert
- * </ul></code>
- */
-public abstract class SourceEclipseLinkBaseConvertAnnotation
- extends SourceAnnotation
- implements EclipseLinkBaseConvertAnnotation
-{
- private final DeclarationAnnotationElementAdapter<String> valueDeclarationAdapter;
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
- private TextRange valueTextRange;
-
-
- protected SourceEclipseLinkBaseConvertAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- super(parent, element, daa);
- this.valueDeclarationAdapter = this.buildValueDeclarationAdapter();
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, this.valueDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** ConvertAnnotation implementation **********
-
- // ***** value
-
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange() {
- return this.valueTextRange;
- }
-
- private TextRange buildValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.valueDeclarationAdapter, astRoot);
- }
-
- public boolean valueTouches(int pos) {
- return this.textRangeTouches(this.valueTextRange, pos);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildValueDeclarationAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(this.daa, this.getValueElementName(), StringExpressionConverter.instance());
- }
-
- protected abstract String getValueElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBaseTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBaseTypeConverterAnnotation.java
deleted file mode 100644
index 60c30de8e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBaseTypeConverterAnnotation.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.TypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBaseTypeConverterAnnotation;
-
-/**
- * <code>
- * <ul>
- * <li>org.eclipse.persistence.annotations.TypeConverter
- * <li>org.eclipse.persistence.annotations.ObjectTypeConverter
- * </ul>
- * </code>
- */
-abstract class SourceEclipseLinkBaseTypeConverterAnnotation
- extends SourceEclipseLinkNamedConverterAnnotation
- implements EclipseLinkBaseTypeConverterAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> dataTypeDeclarationAdapter;
- final AnnotationElementAdapter<String> dataTypeAdapter;
- String dataType;
- TextRange dataTypeTextRange;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- String fullyQualifiedDataType;
- // we need a flag since the f-q name can be null
- boolean fqDataTypeStale = true;
-
- final DeclarationAnnotationElementAdapter<String> objectTypeDeclarationAdapter;
- final AnnotationElementAdapter<String> objectTypeAdapter;
- String objectType;
- TextRange objectTypeTextRange;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- String fullyQualifiedObjectType;
- // we need a flag since the f-q name can be null
- boolean fqObjectTypeStale = true;
-
-
- SourceEclipseLinkBaseTypeConverterAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.dataTypeDeclarationAdapter = this.buildTypeAdapter(this.getDataTypeElementName());
- this.dataTypeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, this.dataTypeDeclarationAdapter);
-
- this.objectTypeDeclarationAdapter = this.buildTypeAdapter(this.getObjectTypeElementName());
- this.objectTypeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, this.objectTypeDeclarationAdapter);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTypeAdapter(String elementName) {
- // false = do not remove annotation when empty
- return new ConversionDeclarationAnnotationElementAdapter<String>(this.daa, elementName, TypeStringExpressionConverter.instance());
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
-
- this.dataType = this.buildDataType(astRoot);
- this.dataTypeTextRange = this.buildDataTypeTextRange(astRoot);
-
- this.objectType = this.buildObjectType(astRoot);
- this.objectTypeTextRange = this.buildObjectTypeTextRange(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
-
- this.syncDataType(this.buildDataType(astRoot));
- this.dataTypeTextRange = this.buildDataTypeTextRange(astRoot);
-
- this.syncObjectType(this.buildObjectType(astRoot));
- this.objectTypeTextRange = this.buildObjectTypeTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.dataType == null) &&
- (this.objectType == null);
- }
-
-
- // ********** BaseTypeConverterAnnotation implementation **********
-
- // ***** data type
- public String getDataType() {
- return this.dataType;
- }
-
- public void setDataType(String dataType) {
- if (this.attributeValueHasChanged(this.dataType, dataType)) {
- this.dataType = dataType;
- this.fqDataTypeStale = true;
- this.dataTypeAdapter.setValue(dataType);
- }
- }
-
- private void syncDataType(String astDataType) {
- if (this.attributeValueHasChanged(this.dataType, astDataType)) {
- this.syncDataType_(astDataType);
- }
- }
-
- private void syncDataType_(String astDataType) {
- String old = this.dataType;
- this.dataType = astDataType;
- this.fqDataTypeStale = true;
- this.firePropertyChanged(DATA_TYPE_PROPERTY, old, astDataType);
- }
-
- private String buildDataType(CompilationUnit astRoot) {
- return this.dataTypeAdapter.getValue(astRoot);
- }
-
- public TextRange getDataTypeTextRange() {
- return this.dataTypeTextRange;
- }
-
- private TextRange buildDataTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.dataTypeDeclarationAdapter, astRoot);
- }
-
- abstract String getDataTypeElementName();
-
- // ***** fully-qualified data type
- public String getFullyQualifiedDataType() {
- if (this.fqDataTypeStale) {
- this.fullyQualifiedDataType = this.buildFullyQualifiedDataType();
- this.fqDataTypeStale = false;
- }
- return this.fullyQualifiedDataType;
- }
-
- private String buildFullyQualifiedDataType() {
- return (this.dataType == null) ? null : this.buildFullyQualifiedDataType_();
- }
-
- private String buildFullyQualifiedDataType_() {
- return ASTTools.resolveFullyQualifiedName(this.dataTypeAdapter.getExpression(this.buildASTRoot()));
- }
-
- // ***** object type
- public String getObjectType() {
- return this.objectType;
- }
-
- public void setObjectType(String objectType) {
- if (this.attributeValueHasChanged(this.objectType, objectType)) {
- this.objectType = objectType;
- this.fqObjectTypeStale = true;
- this.objectTypeAdapter.setValue(objectType);
- }
- }
-
- private void syncObjectType(String astObjectType) {
- if (this.attributeValueHasChanged(this.objectType, astObjectType)) {
- this.syncObjectType_(astObjectType);
- }
- }
-
- private void syncObjectType_(String astObjectType) {
- String old = this.objectType;
- this.objectType = astObjectType;
- this.fqObjectTypeStale = true;
- this.firePropertyChanged(OBJECT_TYPE_PROPERTY, old, astObjectType);
- }
-
- private String buildObjectType(CompilationUnit astRoot) {
- return this.objectTypeAdapter.getValue(astRoot);
- }
-
- public TextRange getObjectTypeTextRange() {
- return this.objectTypeTextRange;
- }
-
- private TextRange buildObjectTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.objectTypeDeclarationAdapter, astRoot);
- }
-
- abstract String getObjectTypeElementName();
-
- // ***** fully-qualified object type
- public String getFullyQualifiedObjectType() {
- if (this.fqObjectTypeStale) {
- this.fullyQualifiedObjectType = this.buildFullyQualifiedObjectType();
- this.fqObjectTypeStale = false;
- }
- return this.fullyQualifiedObjectType;
- }
-
- private String buildFullyQualifiedObjectType() {
- return (this.objectType == null) ? null : this.buildFullyQualifiedObjectType_();
- }
-
- private String buildFullyQualifiedObjectType_() {
- return ASTTools.resolveFullyQualifiedName(this.objectTypeAdapter.getExpression(this.buildASTRoot()));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java
deleted file mode 100644
index e38edd3c39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicCollectionAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicCollectionAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicCollection
- */
-public final class SourceEclipseLinkBasicCollectionAnnotation
- extends SourceAnnotation
- implements EclipseLinkBasicCollectionAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkBasicCollectionAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // do nothing
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java
deleted file mode 100644
index 5e40d37aa8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkBasicMapAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkBasicMapAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.BasicMap
- */
-public final class SourceEclipseLinkBasicMapAnnotation
- extends SourceAnnotation
- implements EclipseLinkBasicMapAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkBasicMapAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // do nothing
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // do nothing
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java
deleted file mode 100644
index fbb6d17075..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,575 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Cache</code>
- */
-public final class SourceEclipseLinkCacheAnnotation
- extends SourceAnnotation
- implements EclipseLinkCacheAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> TYPE_ADAPTER = buildTypeAdapter();
- private final AnnotationElementAdapter<String> typeAdapter;
- private CacheType type;
- private TextRange typeTextRange;
-
- private static final DeclarationAnnotationElementAdapter<Integer> SIZE_ADAPTER = buildSizeAdapter();
- private final AnnotationElementAdapter<Integer> sizeAdapter;
- private Integer size;
- private TextRange sizeTextRange;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> SHARED_ADAPTER = buildSharedAdapter();
- private final AnnotationElementAdapter<Boolean> sharedAdapter;
- private Boolean shared;
- private TextRange sharedTextRange;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> ALWAYS_REFRESH_ADAPTER = buildAlwaysRefreshAdapter();
- private final AnnotationElementAdapter<Boolean> alwaysRefreshAdapter;
- private Boolean alwaysRefresh;
- private TextRange alwaysRefreshTextRange;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> REFRESH_ONLY_IF_NEWER_ADAPTER = buildRefreshOnlyIfNewerAdapter();
- private final AnnotationElementAdapter<Boolean> refreshOnlyIfNewerAdapter;
- private Boolean refreshOnlyIfNewer;
- private TextRange refreshOnlyIfNewerTextRange;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> DISABLE_HITS_ADAPTER = buildDisableHitsAdapter();
- private final AnnotationElementAdapter<Boolean> disableHitsAdapter;
- private Boolean disableHits;
- private TextRange disableHitsTextRange;
-
- private static final DeclarationAnnotationElementAdapter<String> COORDINATION_TYPE_ADAPTER = buildCoordinationTypeAdapter();
- private final AnnotationElementAdapter<String> coordinationTypeAdapter;
- private CacheCoordinationType coordinationType;
- private TextRange coordinationTypeTextRange;
-
- private static final DeclarationAnnotationElementAdapter<Integer> EXPIRY_ADAPTER = buildExpiryAdapter();
- private final AnnotationElementAdapter<Integer> expiryAdapter;
- private Integer expiry;
- private TextRange expiryTextRange;
-
- private static final NestedDeclarationAnnotationAdapter EXPIRY_TIME_OF_DAY_ADAPTER = buildExpiryTimeOfDayAdapter();
- private final ElementAnnotationAdapter expiryTimeOfDayAdapter;
- private EclipseLinkTimeOfDayAnnotation expiryTimeOfDay;
- private TextRange expiryTimeOfDayTextRange;
-
- private static final DeclarationAnnotationElementAdapter<String> ISOLATION_ADAPTER = buildIsolationAdapter();
- private final AnnotationElementAdapter<String> isolationAdapter;
- private CacheIsolationType2_2 isolation;
- private TextRange isolationTextRange;
-
-
- public SourceEclipseLinkCacheAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.typeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, TYPE_ADAPTER);
- this.sizeAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, SIZE_ADAPTER);
- this.sharedAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, SHARED_ADAPTER);
- this.alwaysRefreshAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, ALWAYS_REFRESH_ADAPTER);
- this.refreshOnlyIfNewerAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, REFRESH_ONLY_IF_NEWER_ADAPTER);
- this.disableHitsAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, DISABLE_HITS_ADAPTER);
- this.coordinationTypeAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, COORDINATION_TYPE_ADAPTER);
- this.expiryAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, EXPIRY_ADAPTER);
- this.expiryTimeOfDayAdapter = new ElementAnnotationAdapter(element, EXPIRY_TIME_OF_DAY_ADAPTER);
- this.isolationAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, ISOLATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.type = this.buildType(astRoot);
- this.typeTextRange = this.buildTypeTextRange(astRoot);
-
- this.size = this.buildSize(astRoot);
- this.sizeTextRange = this.buildSizeTextRange(astRoot);
-
- this.shared = this.buildShared(astRoot);
- this.sharedTextRange = this.buildSharedTextRange(astRoot);
-
- this.alwaysRefresh = this.buildAlwaysRefresh(astRoot);
- this.alwaysRefreshTextRange = this.buildAlwaysRefreshTextRange(astRoot);
-
- this.refreshOnlyIfNewer = this.buildRefreshOnlyIfNewer(astRoot);
- this.refreshOnlyIfNewerTextRange = this.buildRefreshOnlyIfNewerTextRange(astRoot);
-
- this.disableHits = this.buildDisableHits(astRoot);
- this.disableHitsTextRange = this.buildDisableHitsTextRange(astRoot);
-
- this.coordinationType = this.buildCoordinationType(astRoot);
- this.coordinationTypeTextRange = this.buildCoordinationTypeTextRange(astRoot);
-
- this.expiry = this.buildExpiry(astRoot);
- this.expiryTextRange = this.buildExpiryTextRange(astRoot);
-
- this.initializeExpiryTimeOfDay(astRoot);
- this.expiryTimeOfDayTextRange = this.buildExpiryTimeOfDayTextRange(astRoot);
-
- this.isolation = this.buildIsolation(astRoot);
- this.isolationTextRange = this.buildIsolationTextRange(astRoot);
- }
-
- private void initializeExpiryTimeOfDay(CompilationUnit astRoot) {
- if (this.expiryTimeOfDayAdapter.getAnnotation(astRoot) != null) {
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay();
- this.expiryTimeOfDay.initialize(astRoot);
- }
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncType(this.buildType(astRoot));
- this.typeTextRange = this.buildTypeTextRange(astRoot);
-
- this.syncSize(this.buildSize(astRoot));
- this.sizeTextRange = this.buildSizeTextRange(astRoot);
-
- this.syncShared(this.buildShared(astRoot));
- this.sharedTextRange = this.buildSharedTextRange(astRoot);
-
- this.syncAlwaysRefresh(this.buildAlwaysRefresh(astRoot));
- this.alwaysRefreshTextRange = this.buildAlwaysRefreshTextRange(astRoot);
-
- this.syncRefreshOnlyIfNewer(this.buildRefreshOnlyIfNewer(astRoot));
- this.refreshOnlyIfNewerTextRange = this.buildRefreshOnlyIfNewerTextRange(astRoot);
-
- this.syncDisableHits(this.buildDisableHits(astRoot));
- this.disableHitsTextRange = this.buildDisableHitsTextRange(astRoot);
-
- this.syncCoordinationType(this.buildCoordinationType(astRoot));
- this.coordinationTypeTextRange = this.buildCoordinationTypeTextRange(astRoot);
-
- this.syncExpiry(this.buildExpiry(astRoot));
- this.expiryTextRange = this.buildExpiryTextRange(astRoot);
-
- this.syncExpiryTimeOfDay(astRoot);
- this.expiryTimeOfDayTextRange = this.buildExpiryTimeOfDayTextRange(astRoot);
-
- this.syncIsolation(this.buildIsolation(astRoot));
- this.isolationTextRange = this.buildIsolationTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.type == null) &&
- (this.size == null) &&
- (this.shared == null) &&
- (this.alwaysRefresh == null) &&
- (this.refreshOnlyIfNewer == null) &&
- (this.disableHits == null) &&
- (this.coordinationType == null) &&
- (this.expiry == null) &&
- (this.expiryTimeOfDay == null) &&
- (this.isolation == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.type);
- }
-
-
- // ********** CacheAnnotation implementation **********
-
- // ***** type
- public CacheType getType() {
- return this.type;
- }
-
- public void setType(CacheType type) {
- if (this.attributeValueHasChanged(this.type, type)) {
- this.type = type;
- this.typeAdapter.setValue(CacheType.toJavaAnnotationValue(type));
- }
- }
-
- private void syncType(CacheType astType) {
- CacheType old = this.type;
- this.type = astType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astType);
- }
-
- private CacheType buildType(CompilationUnit astRoot) {
- return CacheType.fromJavaAnnotationValue(this.typeAdapter.getValue(astRoot));
- }
-
- public TextRange getTypeTextRange() {
- return this.typeTextRange;
- }
-
- private TextRange buildTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(TYPE_ADAPTER, astRoot);
- }
-
- // ***** size
- public Integer getSize() {
- return this.size;
- }
-
- public void setSize(Integer size) {
- if (this.attributeValueHasChanged(this.size, size)) {
- this.size = size;
- this.sizeAdapter.setValue(size);
- }
- }
-
- private void syncSize(Integer astSize) {
- Integer old = this.size;
- this.size = astSize;
- this.firePropertyChanged(SIZE_PROPERTY, old, astSize);
- }
-
- private Integer buildSize(CompilationUnit astRoot) {
- return this.sizeAdapter.getValue(astRoot);
- }
-
- public TextRange getSizeTextRange() {
- return this.sizeTextRange;
- }
-
- private TextRange buildSizeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SIZE_ADAPTER, astRoot);
- }
-
- // ***** shared
- public Boolean getShared() {
- return this.shared;
- }
-
- public void setShared(Boolean shared) {
- if (this.attributeValueHasChanged(this.shared, shared)) {
- this.shared = shared;
- this.sharedAdapter.setValue(shared);
- }
- }
-
- private void syncShared(Boolean astShared) {
- Boolean old = this.shared;
- this.shared = astShared;
- this.firePropertyChanged(SHARED_PROPERTY, old, astShared);
- }
-
- private Boolean buildShared(CompilationUnit astRoot) {
- return this.sharedAdapter.getValue(astRoot);
- }
-
- public TextRange getSharedTextRange() {
- return this.sharedTextRange;
- }
-
- private TextRange buildSharedTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(SHARED_ADAPTER, astRoot);
- }
-
- // ***** always refresh
- public Boolean getAlwaysRefresh() {
- return this.alwaysRefresh;
- }
-
- public void setAlwaysRefresh(Boolean alwaysRefresh) {
- if (this.attributeValueHasChanged(this.alwaysRefresh, alwaysRefresh)) {
- this.alwaysRefresh = alwaysRefresh;
- this.alwaysRefreshAdapter.setValue(alwaysRefresh);
- }
- }
-
- private void syncAlwaysRefresh(Boolean astAlwaysRefresh) {
- Boolean old = this.alwaysRefresh;
- this.alwaysRefresh = astAlwaysRefresh;
- this.firePropertyChanged(ALWAYS_REFRESH_PROPERTY, old, astAlwaysRefresh);
- }
-
- private Boolean buildAlwaysRefresh(CompilationUnit astRoot) {
- return this.alwaysRefreshAdapter.getValue(astRoot);
- }
-
- public TextRange getAlwaysRefreshTextRange() {
- return this.alwaysRefreshTextRange;
- }
-
- private TextRange buildAlwaysRefreshTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ALWAYS_REFRESH_ADAPTER, astRoot);
- }
-
- // ***** refresh only if newer
- public Boolean getRefreshOnlyIfNewer() {
- return this.refreshOnlyIfNewer;
- }
-
- public void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer) {
- if (this.attributeValueHasChanged(this.refreshOnlyIfNewer, refreshOnlyIfNewer)) {
- this.refreshOnlyIfNewer = refreshOnlyIfNewer;
- this.refreshOnlyIfNewerAdapter.setValue(refreshOnlyIfNewer);
- }
- }
-
- private void syncRefreshOnlyIfNewer(Boolean astRefreshOnlyIfNewer) {
- Boolean old = this.refreshOnlyIfNewer;
- this.refreshOnlyIfNewer = astRefreshOnlyIfNewer;
- this.firePropertyChanged(REFRESH_ONLY_IF_NEWER_PROPERTY, old, astRefreshOnlyIfNewer);
- }
-
- private Boolean buildRefreshOnlyIfNewer(CompilationUnit astRoot) {
- return this.refreshOnlyIfNewerAdapter.getValue(astRoot);
- }
-
- public TextRange getRefreshOnlyIfNewerTextRange() {
- return this.refreshOnlyIfNewerTextRange;
- }
-
- private TextRange buildRefreshOnlyIfNewerTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(REFRESH_ONLY_IF_NEWER_ADAPTER, astRoot);
- }
-
- // ***** disable hits
- public Boolean getDisableHits() {
- return this.disableHits;
- }
-
- public void setDisableHits(Boolean disableHits) {
- if (this.attributeValueHasChanged(this.disableHits, disableHits)) {
- this.disableHits = disableHits;
- this.disableHitsAdapter.setValue(disableHits);
- }
- }
-
- private void syncDisableHits(Boolean astDisableHits) {
- Boolean old = this.disableHits;
- this.disableHits = astDisableHits;
- this.firePropertyChanged(DISABLE_HITS_PROPERTY, old, astDisableHits);
- }
-
- private Boolean buildDisableHits(CompilationUnit astRoot) {
- return this.disableHitsAdapter.getValue(astRoot);
- }
-
- public TextRange getDisableHitsTextRange() {
- return this.disableHitsTextRange;
- }
-
- private TextRange buildDisableHitsTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(DISABLE_HITS_ADAPTER, astRoot);
- }
-
- // ***** coordination type
- public CacheCoordinationType getCoordinationType() {
- return this.coordinationType;
- }
-
- public void setCoordinationType(CacheCoordinationType coordinationType) {
- if (this.attributeValueHasChanged(this.coordinationType, coordinationType)) {
- this.coordinationType = coordinationType;
- this.coordinationTypeAdapter.setValue(CacheCoordinationType.toJavaAnnotationValue(coordinationType));
- }
- }
-
- private void syncCoordinationType(CacheCoordinationType astCoordinationType) {
- CacheCoordinationType old = this.coordinationType;
- this.coordinationType = astCoordinationType;
- this.firePropertyChanged(TYPE_PROPERTY, old, astCoordinationType);
- }
-
- private CacheCoordinationType buildCoordinationType(CompilationUnit astRoot) {
- return CacheCoordinationType.fromJavaAnnotationValue(this.coordinationTypeAdapter.getValue(astRoot));
- }
-
- public TextRange getCoordinationTypeTextRange() {
- return this.coordinationTypeTextRange;
- }
-
- private TextRange buildCoordinationTypeTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(COORDINATION_TYPE_ADAPTER, astRoot);
- }
-
- // ***** expiry
- public Integer getExpiry() {
- return this.expiry;
- }
-
- public void setExpiry(Integer expiry) {
- if (this.attributeValueHasChanged(this.expiry, expiry)) {
- this.expiry = expiry;
- this.expiryAdapter.setValue(expiry);
- }
- }
-
- private void syncExpiry(Integer astExpiry) {
- Integer old = this.expiry;
- this.expiry = astExpiry;
- this.firePropertyChanged(EXPIRY_PROPERTY, old, astExpiry);
- }
-
- private Integer buildExpiry(CompilationUnit astRoot) {
- return this.expiryAdapter.getValue(astRoot);
- }
-
- public TextRange getExpiryTextRange() {
- return this.expiryTextRange;
- }
-
- private TextRange buildExpiryTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(EXPIRY_ADAPTER, astRoot);
- }
-
- // ***** expiry time of day
- public EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay() {
- return this.expiryTimeOfDay;
- }
-
- public EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay() {
- if (this.expiryTimeOfDay != null) {
- throw new IllegalStateException("'expiryTimeOfDay' element already exists: " + this.expiryTimeOfDay); //$NON-NLS-1$
- }
- this.expiryTimeOfDay = this.buildExpiryTimeOfDay();
- this.expiryTimeOfDay.newAnnotation();
- return this.expiryTimeOfDay;
- }
-
- public void removeExpiryTimeOfDay() {
- if (this.expiryTimeOfDay == null) {
- throw new IllegalStateException("'expiryTimeOfDay' element does not exist"); //$NON-NLS-1$
- }
- EclipseLinkTimeOfDayAnnotation old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = null;
- old.removeAnnotation();
- }
-
- private EclipseLinkTimeOfDayAnnotation buildExpiryTimeOfDay() {
- return new SourceEclipseLinkTimeOfDayAnnotation(this, this.annotatedElement, EXPIRY_TIME_OF_DAY_ADAPTER);
- }
-
- private void syncExpiryTimeOfDay(CompilationUnit astRoot) {
- if (this.expiryTimeOfDayAdapter.getAnnotation(astRoot) == null) {
- this.syncExpiryTimeOfDay_(null);
- } else {
- if (this.expiryTimeOfDay == null) {
- EclipseLinkTimeOfDayAnnotation tod = this.buildExpiryTimeOfDay();
- tod.initialize(astRoot);
- this.syncExpiryTimeOfDay_(tod);
- } else {
- this.expiryTimeOfDay.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncExpiryTimeOfDay_(EclipseLinkTimeOfDayAnnotation astExpiryTimeOfDay) {
- EclipseLinkTimeOfDayAnnotation old = this.expiryTimeOfDay;
- this.expiryTimeOfDay = astExpiryTimeOfDay;
- this.firePropertyChanged(EXPIRY_TIME_OF_DAY_PROPERTY, old, astExpiryTimeOfDay);
- }
-
- public TextRange getExpiryTimeOfDayTextRange() {
- return this.expiryTimeOfDayTextRange;
- }
-
- private TextRange buildExpiryTimeOfDayTextRange(CompilationUnit astRoot) {
- return this.buildTextRange(this.expiryTimeOfDayAdapter.getAstNode(astRoot));
- }
-
- // ***** isolation
- public CacheIsolationType2_2 getIsolation() {
- return this.isolation;
- }
-
- public void setIsolation(CacheIsolationType2_2 isolation) {
- if (this.attributeValueHasChanged(this.isolation, isolation)) {
- this.isolation = isolation;
- this.isolationAdapter.setValue(CacheIsolationType2_2.toJavaAnnotationValue(isolation));
- }
- }
-
- private void syncIsolation(CacheIsolationType2_2 astIsolation) {
- CacheIsolationType2_2 old = this.isolation;
- this.isolation = astIsolation;
- this.firePropertyChanged(ISOLATION_PROPERTY, old, astIsolation);
- }
-
- private CacheIsolationType2_2 buildIsolation(CompilationUnit astRoot) {
- return CacheIsolationType2_2.fromJavaAnnotationValue(this.isolationAdapter.getValue(astRoot));
- }
-
- public TextRange getIsolationTextRange() {
- return this.isolationTextRange;
- }
-
- private TextRange buildIsolationTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(ISOLATION_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildTypeAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__TYPE);
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildSizeAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__SIZE, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildSharedAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__SHARED, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildExpiryAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__EXPIRY, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildAlwaysRefreshAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__ALWAYS_REFRESH, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildRefreshOnlyIfNewerAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__REFRESH_ONLY_IF_NEWER, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildDisableHitsAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__DISABLE_HITS, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildCoordinationTypeAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__COORDINATION_TYPE);
- }
-
- private static NestedDeclarationAnnotationAdapter buildExpiryTimeOfDayAdapter() {
- return new NestedDeclarationAnnotationAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__EXPIRY_TIME_OF_DAY, EclipseLink.TIME_OF_DAY);
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildIsolationAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CACHE__ISOLATION);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java
deleted file mode 100644
index b028ec3d64..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkChangeTrackingAnnotation.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.ChangeTracking</code>
- */
-public final class SourceEclipseLinkChangeTrackingAnnotation
- extends SourceAnnotation
- implements EclipseLinkChangeTrackingAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private ChangeTrackingType value;
- private TextRange valueTextRange;
-
-
- public SourceEclipseLinkChangeTrackingAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** ChangeTrackingAnnotation implementation **********
-
- // ***** value
- public ChangeTrackingType getValue() {
- return this.value;
- }
-
- public void setValue(ChangeTrackingType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(ChangeTrackingType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(ChangeTrackingType astValue) {
- ChangeTrackingType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private ChangeTrackingType buildValue(CompilationUnit astRoot) {
- return ChangeTrackingType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange() {
- return this.valueTextRange;
- }
-
- private TextRange buildValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CHANGE_TRACKING__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java
deleted file mode 100644
index 959a9b6d5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkClassExtractorAnnotation2_1.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkClassExtractorAnnotation2_1;
-
-/**
- * org.eclipse.persistence.annotations.ClassExtractor
- */
-public final class SourceEclipseLinkClassExtractorAnnotation2_1
- extends SourceAnnotation
- implements EclipseLinkClassExtractorAnnotation2_1
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- private String fullyQualifiedClassName;
- // we need a flag since the f-q name can be null
- private boolean fqClassNameStale = true;
-
-
- public SourceEclipseLinkClassExtractorAnnotation2_1(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** EclipseLinkClassExtractorAnnotation2_1 implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.fqClassNameStale = true;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- if (this.attributeValueHasChanged(this.value, astValue)) {
- this.syncValue_(astValue);
- }
- }
-
- private void syncValue_(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.fqClassNameStale = true;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- // ***** fully-qualified class name
- public String getFullyQualifiedClassName() {
- if (this.fqClassNameStale) {
- this.fullyQualifiedClassName = this.buildFullyQualifiedClassName();
- this.fqClassNameStale = false;
- }
- return this.fullyQualifiedClassName;
- }
-
- private String buildFullyQualifiedClassName() {
- return (this.value == null) ? null : this.buildFullyQualifiedClassName_();
- }
-
- private String buildFullyQualifiedClassName_() {
- return ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(this.buildASTRoot()));
- }
-
-
- // ********** static methods **********
-
- protected static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CLASS_EXTRACTOR__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index a2d5629249..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.ConversionValue</code>
- */
-final class SourceEclipseLinkConversionValueAnnotation
- extends SourceAnnotation
- implements EclipseLinkConversionValueAnnotation
-{
- private DeclarationAnnotationElementAdapter<String> dataValueDeclarationAdapter;
- private AnnotationElementAdapter<String> dataValueAdapter;
- private String dataValue;
- private TextRange dataValueTextRange;
-
- private DeclarationAnnotationElementAdapter<String> objectValueDeclarationAdapter;
- private AnnotationElementAdapter<String> objectValueAdapter;
- private String objectValue;
- private TextRange objectValueTextRange;
-
- public static SourceEclipseLinkConversionValueAnnotation buildNestedSourceConversionValueAnnotation(
- JavaResourceNode parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceEclipseLinkConversionValueAnnotation(parent, element, idaa);
- }
-
- private SourceEclipseLinkConversionValueAnnotation(JavaResourceNode parent, AnnotatedElement element, IndexedDeclarationAnnotationAdapter idaa) {
- super(parent, element, idaa, new ElementIndexedAnnotationAdapter(element, idaa));
- this.dataValueDeclarationAdapter = this.buildDataValueDeclarationAdapter();
- this.dataValueAdapter = this.buildDataValueAdapter();
- this.objectValueDeclarationAdapter = this.buildObjectValueDeclarationAdapter();
- this.objectValueAdapter = this.buildObjectValueAdapter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.dataValue = this.buildDataValue(astRoot);
- this.dataValueTextRange = this.buildDataValueTextRange(astRoot);
-
- this.objectValue = this.buildObjectValue(astRoot);
- this.objectValueTextRange = this.buildObjectValueTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncDataValue(this.buildDataValue(astRoot));
- this.dataValueTextRange = this.buildDataValueTextRange(astRoot);
-
- this.syncObjectValue(this.buildObjectValue(astRoot));
- this.objectValueTextRange = this.buildObjectValueTextRange(astRoot);
- }
-
-
- // ********** ConversionValueAnnotation implementation **********
-
- // ***** data value
- public String getDataValue() {
- return this.dataValue;
- }
-
- public void setDataValue(String dataValue) {
- if (this.attributeValueHasChanged(this.dataValue, dataValue)) {
- this.dataValue = dataValue;
- this.dataValueAdapter.setValue(dataValue);
- }
- }
-
- private void syncDataValue(String astDataValue) {
- String old = this.dataValue;
- this.dataValue = astDataValue;
- this.firePropertyChanged(DATA_VALUE_PROPERTY, old, astDataValue);
- }
-
- private String buildDataValue(CompilationUnit astRoot) {
- return this.dataValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDataValueTextRange() {
- return this.dataValueTextRange;
- }
-
- private TextRange buildDataValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.dataValueDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDataValueDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, EclipseLink.CONVERSION_VALUE__DATA_VALUE);
- }
-
- private AnnotationElementAdapter<String> buildDataValueAdapter() {
- return this.buildStringElementAdapter(this.dataValueDeclarationAdapter);
- }
-
- // ***** object value
- public String getObjectValue() {
- return this.objectValue;
- }
-
- public void setObjectValue(String objectValue) {
- if (this.attributeValueHasChanged(this.objectValue, objectValue)) {
- this.objectValue = objectValue;
- this.objectValueAdapter.setValue(objectValue);
- }
- }
-
- private void syncObjectValue(String astObjectValue) {
- String old = this.objectValue;
- this.objectValue = astObjectValue;
- this.firePropertyChanged(OBJECT_VALUE_PROPERTY, old, astObjectValue);
- }
-
- private String buildObjectValue(CompilationUnit astRoot) {
- return this.objectValueAdapter.getValue(astRoot);
- }
-
- public TextRange getObjectValueTextRange() {
- return this.objectValueTextRange;
- }
-
- private TextRange buildObjectValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.objectValueDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildObjectValueDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, EclipseLink.CONVERSION_VALUE__OBJECT_VALUE);
- }
-
- private AnnotationElementAdapter<String> buildObjectValueAdapter() {
- return this.buildStringElementAdapter(this.objectValueDeclarationAdapter);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.dataValue == null) &&
- (this.objectValue == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.dataValue);
- sb.append("=>"); //$NON-NLS-1$
- sb.append(this.objectValue);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java
deleted file mode 100644
index 9334e2dc0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Convert</code>
- */
-public final class SourceEclipseLinkConvertAnnotation
- extends SourceEclipseLinkBaseConvertAnnotation
- implements EclipseLinkConvertAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkConvertAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return EclipseLink.CONVERT__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java
deleted file mode 100644
index 5a9271d96c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkConverterAnnotation.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Converter</code>
- */
-public final class SourceEclipseLinkConverterAnnotation
- extends SourceEclipseLinkNamedConverterAnnotation
- implements EclipseLinkConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLink.CONVERTERS);
-
- private final DeclarationAnnotationElementAdapter<String> converterClassDeclarationAdapter;
- private final AnnotationElementAdapter<String> converterClassAdapter;
- private String converterClass;
- private TextRange converterClassTextRange;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- private String fullyQualifiedConverterClassName;
- // we need a flag since the f-q name can be null
- private boolean fqConverterClassNameStale = true;
-
-
- public static SourceEclipseLinkConverterAnnotation buildSourceConverterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildConverterDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildConverterAnnotationAdapter(element, idaa);
- return new SourceEclipseLinkConverterAnnotation(
- parent,
- element,
- idaa,
- iaa);
- }
-
- public SourceEclipseLinkConverterAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.converterClassDeclarationAdapter = this.buildConverterDeclarationClassAdapter();
- this.converterClassAdapter = this.buildConverterClassAdapter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.converterClass = this.buildConverterClass(astRoot);
- this.converterClassTextRange = this.buildConverterClassTextRange(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncConverterClass(this.buildConverterClass(astRoot));
- this.converterClassTextRange = this.buildConverterClassTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.converterClass == null);
- }
-
-
- // ********** SourceNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.CONVERTER__NAME;
- }
-
-
- // ********** ConverterAnnotation implementation **********
-
- // ***** converter class
- public String getConverterClass() {
- return this.converterClass;
- }
-
- public void setConverterClass(String converterClass) {
- if (this.attributeValueHasChanged(this.converterClass, converterClass)) {
- this.converterClass = converterClass;
- this.fqConverterClassNameStale = true;
- this.converterClassAdapter.setValue(converterClass);
- }
- }
-
- private void syncConverterClass(String astConverterClass) {
- if (this.attributeValueHasChanged(this.converterClass, astConverterClass)) {
- this.syncConverterClass_(astConverterClass);
- }
- }
-
- private void syncConverterClass_(String astConverterClass) {
- String old = this.converterClass;
- this.converterClass = astConverterClass;
- this.fqConverterClassNameStale = true;
- this.firePropertyChanged(CONVERTER_CLASS_PROPERTY, old, astConverterClass);
- }
-
- private String buildConverterClass(CompilationUnit astRoot) {
- return this.converterClassAdapter.getValue(astRoot);
- }
-
- public TextRange getConverterClassTextRange() {
- return this.converterClassTextRange;
- }
-
- private TextRange buildConverterClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.converterClassDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildConverterDeclarationClassAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(this.daa, EclipseLink.CONVERTER__CONVERTER_CLASS, SimpleTypeStringExpressionConverter.instance());
- }
-
- private AnnotationElementAdapter<String> buildConverterClassAdapter() {
- return this.buildStringElementAdapter(this.converterClassDeclarationAdapter);
- }
-
- public boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- return (this.converterClass != null)
- && ASTTools.typeImplementsInterface(this.converterClassAdapter.getExpression(astRoot), interfaceName);
- }
-
- // ***** fully-qualified converter class name
- public String getFullyQualifiedConverterClassName() {
- if (this.fqConverterClassNameStale) {
- this.fullyQualifiedConverterClassName = this.buildFullyQualifiedConverterClassName();
- this.fqConverterClassNameStale = false;
- }
- return this.fullyQualifiedConverterClassName;
- }
-
- private String buildFullyQualifiedConverterClassName() {
- return (this.converterClass == null) ? null : this.buildFullyQualifiedConverterClassName_();
- }
-
- private String buildFullyQualifiedConverterClassName_() {
- return ASTTools.resolveFullyQualifiedName(this.converterClassAdapter.getExpression(this.buildASTRoot()));
- }
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildConverterAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildConverterDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- ANNOTATION_NAME);
- return idaa;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java
deleted file mode 100644
index 5ed3d70cd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkCustomizerAnnotation.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Customizer</code>
- */
-public final class SourceEclipseLinkCustomizerAnnotation
- extends SourceAnnotation
- implements EclipseLinkCustomizerAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private String value;
- private TextRange valueTextRange;
-
- /**
- * @see org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdClassAnnotation#fullyQualifiedClassName
- */
- private String fullyQualifiedCustomizerClassName;
- // we need a flag since the f-q name can be null
- private boolean fqCustomizerClassNameStale = true;
-
-
- public SourceEclipseLinkCustomizerAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** CustomizerAnnotation implementation **********
-
- // ***** value
- public String getValue() {
- return this.value;
- }
-
- public void setValue(String value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.fqCustomizerClassNameStale = true;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(String astValue) {
- if (this.attributeValueHasChanged(this.value, astValue)) {
- this.syncValue_(astValue);
- }
- }
-
- private void syncValue_(String astValue) {
- String old = this.value;
- this.value = astValue;
- this.fqCustomizerClassNameStale = true;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private String buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange() {
- return this.valueTextRange;
- }
-
- private TextRange buildValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- public boolean customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot) {
- return (this.value != null)
- && ASTTools.typeIsSubTypeOf(this.valueAdapter.getExpression(astRoot), interfaceName);
- }
-
-
- // ***** fully-qualified customizer class name
- public String getFullyQualifiedCustomizerClassName() {
- if (this.fqCustomizerClassNameStale) {
- this.fullyQualifiedCustomizerClassName = this.buildFullyQualifiedCustomizerClassName();
- this.fqCustomizerClassNameStale = false;
- }
- return this.fullyQualifiedCustomizerClassName;
- }
-
- private String buildFullyQualifiedCustomizerClassName() {
- return (this.value == null) ? null : this.buildFullyQualifiedCustomizerClassName_();
- }
-
- private String buildFullyQualifiedCustomizerClassName_() {
- return ASTTools.resolveFullyQualifiedName(this.valueAdapter.getExpression(this.buildASTRoot()));
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.CUSTOMIZER__VALUE, SimpleTypeStringExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java
deleted file mode 100644
index ce4017a341..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkExistenceCheckingAnnotation.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType;
-
-/**
- * <code>org.eclipse.persistence.annotations.ExistenceChecking</code>
- */
-public final class SourceEclipseLinkExistenceCheckingAnnotation
- extends SourceAnnotation
- implements EclipseLinkExistenceCheckingAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private ExistenceType value;
- private TextRange valueTextRange;
-
-
- public SourceEclipseLinkExistenceCheckingAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** ExistenceCheckingAnnotation implementation **********
-
- // ***** value
- public ExistenceType getValue() {
- return this.value;
- }
-
- public void setValue(ExistenceType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(ExistenceType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(ExistenceType astValue) {
- ExistenceType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private ExistenceType buildValue(CompilationUnit astRoot) {
- return ExistenceType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange() {
- return this.valueTextRange;
- }
-
- private TextRange buildValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.EXISTENCE_CHECKING__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index 1302924aac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-/**
- * <code>org.eclipse.persistence.annotations.JoinFetch</code>
- */
-public final class SourceEclipseLinkJoinFetchAnnotation
- extends SourceAnnotation
- implements EclipseLinkJoinFetchAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private JoinFetchType value;
- private TextRange valueTextRange;
-
-
- public SourceEclipseLinkJoinFetchAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** JoinFetchAnnotation implementation **********
-
- // ***** value
- public JoinFetchType getValue() {
- return this.value;
- }
-
- public void setValue(JoinFetchType value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(JoinFetchType.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(JoinFetchType astValue) {
- JoinFetchType old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private JoinFetchType buildValue(CompilationUnit astRoot) {
- return JoinFetchType.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange() {
- return this.valueTextRange;
- }
-
- private TextRange buildValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.JOIN_FETCH__VALUE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMapKeyConvertAnnotation2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMapKeyConvertAnnotation2_0.java
deleted file mode 100644
index bc217e5e2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMapKeyConvertAnnotation2_0.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMapKeyConvertAnnotation2_0;
-
-/**
- * <code>org.eclipse.persistence.annotations.MapKeyConvert</code>
- */
-public final class SourceEclipseLinkMapKeyConvertAnnotation2_0
- extends SourceEclipseLinkBaseConvertAnnotation
- implements EclipseLinkMapKeyConvertAnnotation2_0
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLinkMapKeyConvertAnnotation2_0.ANNOTATION_NAME);
-
-
- public SourceEclipseLinkMapKeyConvertAnnotation2_0(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return EclipseLinkMapKeyConvertAnnotation2_0.ANNOTATION_NAME;
- }
-
- @Override
- protected String getValueElementName() {
- return EclipseLink.MAP_KEY_CONVERT__VALUE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMultitenantAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMultitenantAnnotation2_3.java
deleted file mode 100644
index f3a94f289f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMultitenantAnnotation2_3.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-
-/**
- * org.eclipse.persistence.annotations.Multitenant
- */
-public class SourceEclipseLinkMultitenantAnnotation2_3
- extends SourceAnnotation
- implements EclipseLinkMultitenantAnnotation2_3
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<String> valueAdapter;
- private MultitenantType2_3 value;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> INCLUDE_CRITERIA_ADAPTER = buildIncludeCriteriaAdapter();
- private final AnnotationElementAdapter<Boolean> includeCriteriaAdapter;
- private Boolean includeCriteria;
-
- public SourceEclipseLinkMultitenantAnnotation2_3(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, VALUE_ADAPTER);
- this.includeCriteriaAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, INCLUDE_CRITERIA_ADAPTER);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.includeCriteria = this.buildIncludeCriteria(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.syncIncludeCriteria(this.buildIncludeCriteria(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null) &&
- (this.includeCriteria == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
- // ********** EclipseLinkMultitenantAnnotation implementation **********
-
- public boolean isSpecified() {
- return true;
- }
-
- // ***** value
- public MultitenantType2_3 getValue() {
- return this.value;
- }
-
- public void setValue(MultitenantType2_3 value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(MultitenantType2_3.toJavaAnnotationValue(value));
- }
- }
-
- private void syncValue(MultitenantType2_3 astValue) {
- MultitenantType2_3 old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private MultitenantType2_3 buildValue(CompilationUnit astRoot) {
- return MultitenantType2_3.fromJavaAnnotationValue(this.valueAdapter.getValue(astRoot));
- }
-
- public TextRange getValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
- // ***** include criteria
- public Boolean getIncludeCriteria() {
- return this.includeCriteria;
- }
-
- public void setIncludeCriteria(Boolean includeCriteria) {
- if (this.attributeValueHasChanged(this.includeCriteria, includeCriteria)) {
- this.includeCriteria = includeCriteria;
- this.includeCriteriaAdapter.setValue(includeCriteria);
- }
- }
-
- private void syncIncludeCriteria(Boolean astIncludeCriteria) {
- Boolean old = this.includeCriteria;
- this.includeCriteria = astIncludeCriteria;
- this.firePropertyChanged(INCLUDE_CRITERIA_PROPERTY, old, astIncludeCriteria);
- }
-
- private Boolean buildIncludeCriteria(CompilationUnit astRoot) {
- return this.includeCriteriaAdapter.getValue(astRoot);
- }
-
- public TextRange getIncludeCriteriaTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(INCLUDE_CRITERIA_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<String> buildValueAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.MULTITENANT__VALUE);
- }
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildIncludeCriteriaAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.MULTITENANT__INCLUDE_CRITERIA, BooleanExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java
deleted file mode 100644
index e3337c620b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkMutableAnnotation.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Mutable</code>
- */
-public final class SourceEclipseLinkMutableAnnotation
- extends SourceAnnotation
- implements EclipseLinkMutableAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<Boolean> VALUE_ADAPTER = buildValueAdapter();
- private final AnnotationElementAdapter<Boolean> valueAdapter;
- private Boolean value;
- private TextRange valueTextRange;
-
-
- public SourceEclipseLinkMutableAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.valueAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, VALUE_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.value = this.buildValue(astRoot);
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncValue(this.buildValue(astRoot));
- this.valueTextRange = this.buildValueTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.value == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.value);
- }
-
-
- // ********** MutableAnnotation implementation **********
-
- // ***** value
- public Boolean getValue() {
- return this.value;
- }
-
- public void setValue(Boolean value) {
- if (this.attributeValueHasChanged(this.value, value)) {
- this.value = value;
- this.valueAdapter.setValue(value);
- }
- }
-
- private void syncValue(Boolean astValue) {
- Boolean old = this.value;
- this.value = astValue;
- this.firePropertyChanged(VALUE_PROPERTY, old, astValue);
- }
-
- private Boolean buildValue(CompilationUnit astRoot) {
- return this.valueAdapter.getValue(astRoot);
- }
-
- public TextRange getValueTextRange() {
- return this.valueTextRange;
- }
-
- private TextRange buildValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(VALUE_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.MUTABLE__VALUE, BooleanExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java
deleted file mode 100644
index 0da397ff44..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkNamedConverterAnnotation.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.OverrideAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkNamedConverterAnnotation;
-
-/**
- * <code>
- * <ul>
- * <li>org.eclipse.persistence.annotations.Converter
- * <li>org.eclipse.persistence.annotations.StructConverter
- * <li>org.eclipse.persistence.annotations.TypeConverter
- * <li>org.eclipse.persistence.annotations.ObjectTypeConverter
- * </ul>
- * </code>
- */
-abstract class SourceEclipseLinkNamedConverterAnnotation
- extends SourceAnnotation
- implements EclipseLinkNamedConverterAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> nameDeclarationAdapter;
- final AnnotationElementAdapter<String> nameAdapter;
- String name;
- TextRange nameTextRange;
-
-
- // ********** construction/initialization **********
-
- SourceEclipseLinkNamedConverterAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.nameDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getNameElementName());
- this.nameAdapter = new AnnotatedElementAnnotationElementAdapter<String>(this.annotatedElement, this.nameDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.name = this.buildName(astRoot);
- this.nameTextRange = this.buildNameTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncName(this.buildName(astRoot));
- this.nameTextRange = this.buildNameTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.name == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.name);
- }
-
-
- // ********** NamedConverterAnnotation implementation **********
-
- // ***** name
- public String getName() {
- return this.name;
- }
-
- public void setName(String name) {
- if (this.attributeValueHasChanged(this.name, name)) {
- this.name = name;
- this.nameAdapter.setValue(name);
- }
- }
-
- private void syncName(String astName) {
- String old = this.name;
- this.name = astName;
- this.firePropertyChanged(OverrideAnnotation.NAME_PROPERTY, old, astName);
- }
-
- private String buildName(CompilationUnit astRoot) {
- return this.nameAdapter.getValue(astRoot);
- }
-
- public TextRange getNameTextRange() {
- return this.nameTextRange;
- }
-
- private TextRange buildNameTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.nameDeclarationAdapter, astRoot);
- }
-
- public boolean nameTouches(int pos, CompilationUnit astRoot) {
- return this.elementTouches(this.nameDeclarationAdapter, pos, astRoot);
- }
-
- abstract String getNameElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java
deleted file mode 100644
index 08f215b296..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.StringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.ObjectTypeConverter</code>
- */
-public final class SourceEclipseLinkObjectTypeConverterAnnotation
- extends SourceEclipseLinkBaseTypeConverterAnnotation
- implements EclipseLinkObjectTypeConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLink.OBJECT_TYPE_CONVERTERS);
-
- private final DeclarationAnnotationElementAdapter<String> defaultObjectValueDeclarationAdapter;
- private final AnnotationElementAdapter<String> defaultObjectValueAdapter;
- private String defaultObjectValue;
- private TextRange defaultObjectValueTextRange;
-
- private final ConversionValuesAnnotationContainer conversionValuesContainer = new ConversionValuesAnnotationContainer();
-
-
- public static SourceEclipseLinkObjectTypeConverterAnnotation buildSourceObjectTypeConverterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildObjectTypeConverterDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildObjectTypeConverterAnnotationAdapter(element, idaa);
- return new SourceEclipseLinkObjectTypeConverterAnnotation(
- parent,
- element,
- idaa,
- iaa);
- }
-
- private SourceEclipseLinkObjectTypeConverterAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.defaultObjectValueDeclarationAdapter = this.buildDefaultObjectValueAdapter();
- this.defaultObjectValueAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, this.defaultObjectValueDeclarationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.defaultObjectValue = this.buildDefaultObjectValue(astRoot);
- this.defaultObjectValueTextRange = this.buildDefaultObjectValueTextRange(astRoot);
- this.conversionValuesContainer.initializeFromContainerAnnotation(this.getAstAnnotation(astRoot));
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncDefaultObjectValue(this.buildDefaultObjectValue(astRoot));
- this.defaultObjectValueTextRange = this.buildDefaultObjectValueTextRange(astRoot);
- this.conversionValuesContainer.synchronize(this.getAstAnnotation(astRoot));
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.defaultObjectValue == null) &&
- this.conversionValuesContainer.isEmpty();
- }
-
-
- // ********** SourceNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__NAME;
- }
-
-
- // ********** SourceBaseTypeConverterAnnotation implementation **********
-
- @Override
- String getDataTypeElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE;
- }
-
- @Override
- String getObjectTypeElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE;
- }
-
-
- // ********** ObjectTypeConverterAnnotation implementation **********
-
- // ***** default object value
- public String getDefaultObjectValue() {
- return this.defaultObjectValue;
- }
-
- public void setDefaultObjectValue(String defaultObjectValue) {
- if (this.attributeValueHasChanged(this.defaultObjectValue, defaultObjectValue)) {
- this.defaultObjectValue = defaultObjectValue;
- this.defaultObjectValueAdapter.setValue(defaultObjectValue);
- }
- }
-
- private void syncDefaultObjectValue(String astDefaultObjectValue) {
- String old = this.defaultObjectValue;
- this.defaultObjectValue = astDefaultObjectValue;
- this.firePropertyChanged(DEFAULT_OBJECT_VALUE_PROPERTY, old, astDefaultObjectValue);
- }
-
- private String buildDefaultObjectValue(CompilationUnit astRoot) {
- return this.defaultObjectValueAdapter.getValue(astRoot);
- }
-
- public TextRange getDefaultObjectValueTextRange() {
- return this.defaultObjectValueTextRange;
- }
-
- private TextRange buildDefaultObjectValueTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.defaultObjectValueDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildDefaultObjectValueAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<String>(this.daa, EclipseLink.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, StringExpressionConverter.instance());
- }
-
- // ***** conversion values
-
- public ListIterable<EclipseLinkConversionValueAnnotation> getConversionValues() {
- return this.conversionValuesContainer.getNestedAnnotations();
- }
-
- public int getConversionValuesSize() {
- return this.conversionValuesContainer.getNestedAnnotationsSize();
- }
-
- public EclipseLinkConversionValueAnnotation conversionValueAt(int index) {
- return this.conversionValuesContainer.getNestedAnnotation(index);
- }
-
- public EclipseLinkConversionValueAnnotation addConversionValue(int index) {
- return this.conversionValuesContainer.addNestedAnnotation(index);
- }
-
- public void moveConversionValue(int targetIndex, int sourceIndex) {
- this.conversionValuesContainer.moveNestedAnnotation(targetIndex, sourceIndex);
- }
-
- public void removeConversionValue(int index) {
- this.conversionValuesContainer.removeNestedAnnotation(index);
- }
-
- protected EclipseLinkConversionValueAnnotation buildConversionValue(int index) {
- return SourceEclipseLinkConversionValueAnnotation.buildNestedSourceConversionValueAnnotation(
- this, this.annotatedElement, this.buildConversionValueIndexedDeclarationAnnotationAdapter(index));
- }
-
- private IndexedDeclarationAnnotationAdapter buildConversionValueIndexedDeclarationAnnotationAdapter(int index) {
- return new NestedIndexedDeclarationAnnotationAdapter(
- this.daa, EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES, index, EclipseLink.CONVERSION_VALUE);
- }
-
-
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildObjectTypeConverterAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildObjectTypeConverterDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- ANNOTATION_NAME);
- return idaa;
- }
-
- // ********** hint container **********
- /**
- * adapt the AnnotationContainer interface to the xml schema's xmlns
- */
- class ConversionValuesAnnotationContainer
- extends AnnotationContainer<EclipseLinkConversionValueAnnotation>
- {
- @Override
- protected String getNestedAnnotationsListName() {
- return CONVERSION_VALUES_LIST;
- }
- @Override
- protected String getElementName() {
- return EclipseLink.OBJECT_TYPE_CONVERTER__CONVERSION_VALUES;
- }
- @Override
- protected String getNestedAnnotationName() {
- return EclipseLinkConversionValueAnnotation.ANNOTATION_NAME;
- }
- @Override
- protected EclipseLinkConversionValueAnnotation buildNestedAnnotation(int index) {
- return SourceEclipseLinkObjectTypeConverterAnnotation.this.buildConversionValue(index);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java
deleted file mode 100644
index 467ee1e470..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrimaryKeyAnnotation.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrimaryKeyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrimaryKey
- */
-public class SourceEclipseLinkPrimaryKeyAnnotation
- extends SourceAnnotation
- implements EclipseLinkPrimaryKeyAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER
- = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkPrimaryKeyAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to sync
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java
deleted file mode 100644
index da831d609c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkPrivateOwnedAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.PrivateOwned
- */
-public final class SourceEclipseLinkPrivateOwnedAnnotation
- extends SourceAnnotation
- implements EclipseLinkPrivateOwnedAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkPrivateOwnedAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to sync
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java
deleted file mode 100644
index ae7014e382..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadOnlyAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadOnly
- */
-public final class SourceEclipseLinkReadOnlyAnnotation
- extends SourceAnnotation
- implements EclipseLinkReadOnlyAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkReadOnlyAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to sync
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java
deleted file mode 100644
index 0e7fbd7bf8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkReadTransformerAnnotation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.ReadTransformer
- */
-public final class SourceEclipseLinkReadTransformerAnnotation
- extends SourceEclipseLinkTransformerAnnotation
- implements EclipseLinkReadTransformerAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkReadTransformerAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** SourceTransformerAnnotation implementation **********
-
- @Override
- String getTransformerClassElementName() {
- return EclipseLink.READ_TRANSFORMER__TRANSFORMER_CLASS;
- }
-
- @Override
- String getMethodElementName() {
- return EclipseLink.READ_TRANSFORMER__METHOD;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java
deleted file mode 100644
index 2bc300cc02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructConverterAnnotation.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.StructConverter</code>
- */
-public final class SourceEclipseLinkStructConverterAnnotation
- extends SourceEclipseLinkNamedConverterAnnotation
- implements EclipseLinkStructConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLink.STRUCT_CONVERTERS);
-
- private final DeclarationAnnotationElementAdapter<String> converterDeclarationAdapter;
- private final AnnotationElementAdapter<String> converterAdapter;
- private String converter;
- private TextRange converterTextRange;
-
-
- public static SourceEclipseLinkStructConverterAnnotation buildSourceStructConverterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildStructConverterDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildStructConverterAnnotationAdapter(element, idaa);
- return new SourceEclipseLinkStructConverterAnnotation(
- parent,
- element,
- idaa,
- iaa);
- }
-
- private SourceEclipseLinkStructConverterAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.converterDeclarationAdapter = this.buildConverterDeclarationAdapter();
- this.converterAdapter = this.buildConverterAdapter();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- this.converter = this.buildConverter(astRoot);
- this.converterTextRange = this.buildConverterTextRange(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncConverter(this.buildConverter(astRoot));
- this.converterTextRange = this.buildConverterTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.converter == null);
- }
-
-
- // ********** SourceNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.STRUCT_CONVERTER__NAME;
- }
-
-
- // ********** StructConverterAnnotation implementation **********
-
- // ***** converter
- public String getConverter() {
- return this.converter;
- }
-
- public void setConverter(String converter) {
- if (this.attributeValueHasChanged(this.converter, converter)) {
- this.converter = converter;
- this.converterAdapter.setValue(converter);
- }
- }
-
- private void syncConverter(String astConverter) {
- String old = this.converter;
- this.converter = astConverter;
- this.firePropertyChanged(CONVERTER_PROPERTY, old, astConverter);
- }
-
- private String buildConverter(CompilationUnit astRoot) {
- return this.converterAdapter.getValue(astRoot);
- }
-
- public TextRange getConverterTextRange() {
- return this.converterTextRange;
- }
-
- private TextRange buildConverterTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.converterDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildConverterDeclarationAdapter() {
- return ConversionDeclarationAnnotationElementAdapter.forStrings(this.daa, EclipseLink.STRUCT_CONVERTER__CONVERTER);
- }
-
- private AnnotationElementAdapter<String> buildConverterAdapter() {
- return this.buildStringElementAdapter(this.converterDeclarationAdapter);
- }
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildStructConverterAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildStructConverterDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- ANNOTATION_NAME);
- return idaa;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructureAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructureAnnotation.java
deleted file mode 100644
index db0455c1ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkStructureAnnotation.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructureAnnotation2_3;
-
-/**
- * org.eclipse.persistence.annotations.Structure
- */
-public final class SourceEclipseLinkStructureAnnotation
- extends SourceAnnotation
- implements EclipseLinkStructureAnnotation2_3
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkStructureAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // do nothing
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
deleted file mode 100644
index 7b95520212..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceBaseDiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-/**
- * <code>org.eclipse.persistence.annotations.TenantDiscriminatorColumn</code>
- */
-public final class SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3
- extends SourceBaseDiscriminatorColumnAnnotation
- implements EclipseLinkTenantDiscriminatorColumnAnnotation2_3
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLink.TENANT_DISCRIMINATOR_COLUMNS);
-
- private DeclarationAnnotationElementAdapter<String> contextPropertyDeclarationAdapter;
- private AnnotationElementAdapter<String> contextPropertyAdapter;
- private String contextProperty;
- private TextRange contextPropertyTextRange;
-
- private DeclarationAnnotationElementAdapter<String> tableDeclarationAdapter;
- private AnnotationElementAdapter<String> tableAdapter;
- private String table;
- private TextRange tableTextRange;
-
- private DeclarationAnnotationElementAdapter<Boolean> primaryKeyDeclarationAdapter;
- private AnnotationElementAdapter<Boolean> primaryKeyAdapter;
- private Boolean primaryKey;
- private TextRange primaryKeyTextRange;
-
- public static SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3 buildSourceTenantDiscriminatorColumnAnnotation(
- JavaResourceNode parent,
- AnnotatedElement element) {
-
- return new SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public static SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3 buildSourceTenantDiscriminatorColumnAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement annotatedElement,
- int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildTenantDiscriminatorColumnDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildTenantDiscriminatorColumnAnnotationAdapter(annotatedElement, idaa);
- return new SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(
- parent,
- annotatedElement,
- idaa,
- iaa);
- }
-
-
- public static SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3 buildNestedSourceTenantDiscriminatorColumnAnnotation(
- JavaResourceNode parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter idaa) {
-
- return new SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(parent, element, idaa);
- }
-
- private SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- this(parent, element, daa, new ElementAnnotationAdapter(element, daa));
- }
-
- private SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceNode parent, AnnotatedElement element, IndexedDeclarationAnnotationAdapter idaa) {
- this(parent, element, idaa, new ElementIndexedAnnotationAdapter(element, idaa));
- }
-
- private SourceEclipseLinkTenantDiscriminatorColumnAnnotation2_3(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa, AnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- this.contextPropertyDeclarationAdapter = this.buildContextPropertyDeclarationAdapter();
- this.contextPropertyAdapter = this.buildContextPropertyAdapter();
- this.tableDeclarationAdapter = this.buildTableDeclarationAdapter();
- this.tableAdapter = this.buildTableAdapter();
- this.primaryKeyDeclarationAdapter = this.buildPrimaryKeyDeclarationAdapter();
- this.primaryKeyAdapter = this.buildPrimaryKeyAdapter();
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
-
- this.contextProperty = this.buildContextProperty(astRoot);
- this.contextPropertyTextRange = this.buildContextPropertyTextRange(astRoot);
-
- this.table = this.buildTable(astRoot);
- this.tableTextRange = this.buildTableTextRange(astRoot);
-
- this.primaryKey = this.buildPrimaryKey(astRoot);
- this.primaryKeyTextRange = this.buildPrimaryKeyTextRange(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
-
- this.syncContextProperty(this.buildContextProperty(astRoot));
- this.contextPropertyTextRange = this.buildContextPropertyTextRange(astRoot);
-
- this.syncTable(this.buildTable(astRoot));
- this.tableTextRange = this.buildTableTextRange(astRoot);
-
- this.syncPrimaryKey(this.buildPrimaryKey(astRoot));
- this.primaryKeyTextRange = this.buildPrimaryKeyTextRange(astRoot);
- }
-
- public String getAnnotationName() {
- return EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME;
- }
-
-
- // ********** SourceNamedColumnAnnotation implementation **********
-
- @Override
- protected String getNameElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__NAME;
- }
-
- @Override
- protected String getColumnDefinitionElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- }
-
-
- //************* SourceBaseDiscriminatorColumnAnnotation implementation *************
-
- @Override
- protected String getDiscriminatorTypeElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE;
- }
-
- @Override
- protected String getLengthElementName() {
- return EclipseLink.TENANT_DISCRIMINATOR_COLUMN__LENGTH;
- }
-
-
- //************* TenantDiscriminatorColumnAnnotation implementation *************
-
- // ***** contextProperty
- public String getContextProperty() {
- return this.contextProperty;
- }
-
- public void setContextProperty(String contextProperty) {
- if (this.attributeValueHasChanged(this.contextProperty, contextProperty)) {
- this.contextProperty = contextProperty;
- this.contextPropertyAdapter.setValue(contextProperty);
- }
- }
-
- private void syncContextProperty(String astContextProperty) {
- String old = this.contextProperty;
- this.contextProperty = astContextProperty;
- this.firePropertyChanged(CONTEXT_PROPERTY_PROPERTY, old, astContextProperty);
- }
-
- private String buildContextProperty(CompilationUnit astRoot) {
- return this.contextPropertyAdapter.getValue(astRoot);
- }
-
- public TextRange getContextPropertyTextRange() {
- return this.contextPropertyTextRange;
- }
-
- private TextRange buildContextPropertyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.contextPropertyDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildContextPropertyDeclarationAdapter() {
- return this.buildStringElementAdapter(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY);
- }
-
- private AnnotationElementAdapter<String> buildContextPropertyAdapter() {
- return this.buildStringElementAdapter(this.contextPropertyDeclarationAdapter);
- }
-
- // ***** table
- public String getTable() {
- return this.table;
- }
-
- public void setTable(String table) {
- if (this.attributeValueHasChanged(this.table, table)) {
- this.table = table;
- this.tableAdapter.setValue(table);
- }
- }
-
- private void syncTable(String astTable) {
- String old = this.table;
- this.table = astTable;
- this.firePropertyChanged(TABLE_PROPERTY, old, astTable);
- }
-
- private String buildTable(CompilationUnit astRoot) {
- return this.tableAdapter.getValue(astRoot);
- }
-
- public TextRange getTableTextRange() {
- return this.tableTextRange;
- }
-
- private TextRange buildTableTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.tableDeclarationAdapter, astRoot);
- }
-
- public boolean tableTouches(int pos) {
- return this.textRangeTouches(this.tableTextRange, pos);
- }
-
- private DeclarationAnnotationElementAdapter<String> buildTableDeclarationAdapter() {
- return this.buildStringElementAdapter(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__TABLE);
- }
-
- private AnnotationElementAdapter<String> buildTableAdapter() {
- return this.buildStringElementAdapter(this.tableDeclarationAdapter);
- }
-
- // ***** primaryKey
- public Boolean getPrimaryKey() {
- return this.primaryKey;
- }
-
- public void setPrimaryKey(Boolean primaryKey) {
- if (this.attributeValueHasChanged(this.primaryKey, primaryKey)) {
- this.primaryKey = primaryKey;
- this.primaryKeyAdapter.setValue(primaryKey);
- }
- }
-
- private void syncPrimaryKey(Boolean astPrimaryKey) {
- Boolean old = this.primaryKey;
- this.primaryKey = astPrimaryKey;
- this.firePropertyChanged(PRIMARY_KEY_PROPERTY, old, astPrimaryKey);
- }
-
- private Boolean buildPrimaryKey(CompilationUnit astRoot) {
- return this.primaryKeyAdapter.getValue(astRoot);
- }
-
- public TextRange getPrimaryKeyTextRange() {
- return this.primaryKeyTextRange;
- }
-
- private TextRange buildPrimaryKeyTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.primaryKeyDeclarationAdapter, astRoot);
- }
-
- private DeclarationAnnotationElementAdapter<Boolean> buildPrimaryKeyDeclarationAdapter() {
- return this.buildBooleanElementAdapter(EclipseLink.TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY);
- }
-
- private AnnotationElementAdapter<Boolean> buildPrimaryKeyAdapter() {
- return this.buildBooleanElementAdapter(this.primaryKeyDeclarationAdapter);
- }
-
-
- // ********** misc **********
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.contextProperty == null) &&
- (this.primaryKey == null) &&
- (this.table == null);
- }
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildTenantDiscriminatorColumnAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildTenantDiscriminatorColumnDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- return idaa;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java
deleted file mode 100644
index 53ef14756f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTimeOfDayAnnotation.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NumberIntegerExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.TimeOfDay
- */
-public final class SourceEclipseLinkTimeOfDayAnnotation
- extends SourceAnnotation
- implements EclipseLinkTimeOfDayAnnotation
-{
- private final DeclarationAnnotationElementAdapter<Integer> hourDeclarationAdapter;
- private final AnnotationElementAdapter<Integer> hourAdapter;
- private Integer hour;
- private TextRange hourTextRange;
-
- private final DeclarationAnnotationElementAdapter<Integer> minuteDeclarationAdapter;
- private final AnnotationElementAdapter<Integer> minuteAdapter;
- private Integer minute;
- private TextRange minuteTextRange;
-
- private final DeclarationAnnotationElementAdapter<Integer> secondDeclarationAdapter;
- private final AnnotationElementAdapter<Integer> secondAdapter;
- private Integer second;
- private TextRange secondTextRange;
-
- private final DeclarationAnnotationElementAdapter<Integer> millisecondDeclarationAdapter;
- private final AnnotationElementAdapter<Integer> millisecondAdapter;
- private Integer millisecond;
- private TextRange millisecondTextRange;
-
-
- public SourceEclipseLinkTimeOfDayAnnotation(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- super(parent, element, daa);
- this.hourDeclarationAdapter = buildHourAdapter(daa);
- this.hourAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, this.hourDeclarationAdapter);
- this.minuteDeclarationAdapter = buildMinuteAdapter(daa);
- this.minuteAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, this.minuteDeclarationAdapter);
- this.secondDeclarationAdapter = buildSecondAdapter(daa);
- this.secondAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, this.secondDeclarationAdapter);
- this.millisecondDeclarationAdapter = buildMillisecondAdapter(daa);
- this.millisecondAdapter = new AnnotatedElementAnnotationElementAdapter<Integer>(element, this.millisecondDeclarationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.hour = this.buildHour(astRoot);
- this.hourTextRange = this.buildHourTextRange(astRoot);
-
- this.minute = this.buildMinute(astRoot);
- this.minuteTextRange = this.buildMinuteTextRange(astRoot);
-
- this.second = this.buildSecond(astRoot);
- this.secondTextRange = this.buildSecondTextRange(astRoot);
-
- this.millisecond = this.buildMillisecond(astRoot);
- this.millisecondTextRange = this.buildMillisecondTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncHour(this.buildHour(astRoot));
- this.hourTextRange = this.buildHourTextRange(astRoot);
-
- this.syncMinute(this.buildMinute(astRoot));
- this.minuteTextRange = this.buildMinuteTextRange(astRoot);
-
- this.syncSecond(this.buildSecond(astRoot));
- this.secondTextRange = this.buildSecondTextRange(astRoot);
-
- this.syncMillisecond(this.buildMillisecond(astRoot));
- this.millisecondTextRange = this.buildMillisecondTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.hour == null) &&
- (this.minute == null) &&
- (this.second == null) &&
- (this.millisecond == null);
- }
-
-
- // ********** TimeOfDayAnnotation implementation **********
-
- // ***** hour
- public Integer getHour() {
- return this.hour;
- }
-
- public void setHour(Integer hour) {
- if (this.attributeValueHasChanged(this.hour, hour)) {
- this.hour = hour;
- this.hourAdapter.setValue(hour);
- }
- }
-
- private void syncHour(Integer astHour) {
- Integer old = this.hour;
- this.hour = astHour;
- this.firePropertyChanged(HOUR_PROPERTY, old, astHour);
- }
-
- private Integer buildHour(CompilationUnit astRoot) {
- return this.hourAdapter.getValue(astRoot);
- }
-
- public TextRange getHourTextRange() {
- return this.hourTextRange;
- }
-
- private TextRange buildHourTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.hourDeclarationAdapter, astRoot);
- }
-
- // ***** minute
- public Integer getMinute() {
- return this.minute;
- }
-
- public void setMinute(Integer minute) {
- if (this.attributeValueHasChanged(this.minute, minute)) {
- this.minute = minute;
- this.minuteAdapter.setValue(minute);
- }
- }
-
- private void syncMinute(Integer astMinute) {
- Integer old = this.minute;
- this.minute = astMinute;
- this.firePropertyChanged(MINUTE_PROPERTY, old, astMinute);
- }
-
- private Integer buildMinute(CompilationUnit astRoot) {
- return this.minuteAdapter.getValue(astRoot);
- }
-
- public TextRange getMinuteTextRange() {
- return this.minuteTextRange;
- }
-
- private TextRange buildMinuteTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.minuteDeclarationAdapter, astRoot);
- }
-
- // ***** second
- public Integer getSecond() {
- return this.second;
- }
-
- public void setSecond(Integer newSecond) {
- if (this.attributeValueHasChanged(this.second, newSecond)) {
- this.second = newSecond;
- this.secondAdapter.setValue(newSecond);
- }
- }
-
- private void syncSecond(Integer astSecond) {
- Integer old = this.second;
- this.second = astSecond;
- this.firePropertyChanged(SECOND_PROPERTY, old, astSecond);
- }
-
- private Integer buildSecond(CompilationUnit astRoot) {
- return this.secondAdapter.getValue(astRoot);
- }
-
- public TextRange getSecondTextRange() {
- return this.secondTextRange;
- }
-
- private TextRange buildSecondTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.secondDeclarationAdapter, astRoot);
- }
-
- // ***** millisecond
- public Integer getMillisecond() {
- return this.millisecond;
- }
-
- public void setMillisecond(Integer millisecond) {
- if (this.attributeValueHasChanged(this.millisecond, millisecond)) {
- this.millisecond = millisecond;
- this.millisecondAdapter.setValue(millisecond);
- }
- }
-
- private void syncMillisecond(Integer astMillisecond) {
- Integer oldMillisecond = this.millisecond;
- this.millisecond = astMillisecond;
- this.firePropertyChanged(MILLISECOND_PROPERTY, oldMillisecond, astMillisecond);
- }
-
- private Integer buildMillisecond(CompilationUnit astRoot) {
- return this.millisecondAdapter.getValue(astRoot);
- }
-
- public TextRange getMillisecondTextRange() {
- return this.millisecondTextRange;
- }
-
- private TextRange buildMillisecondTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.millisecondDeclarationAdapter, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<Integer> buildHourAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__HOUR, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildMinuteAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__MINUTE, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildSecondAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__SECOND, NumberIntegerExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<Integer> buildMillisecondAdapter(DeclarationAnnotationAdapter daa) {
- return new ConversionDeclarationAnnotationElementAdapter<Integer>(daa, EclipseLink.TIME_OF_DAY__MILLISECOND, NumberIntegerExpressionConverter.instance());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java
deleted file mode 100644
index fa9c3c0545..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.BooleanExpressionConverter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.EnumDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.Transformation</code>
- */
-public final class SourceEclipseLinkTransformationAnnotation
- extends SourceAnnotation
- implements EclipseLinkTransformationAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private static final DeclarationAnnotationElementAdapter<String> FETCH_ADAPTER = buildFetchAdapter();
- private final AnnotationElementAdapter<String> fetchAdapter;
- private FetchType fetch;
- private TextRange fetchTextRange;
-
- private static final DeclarationAnnotationElementAdapter<Boolean> OPTIONAL_ADAPTER = buildOptionalAdapter();
- private final AnnotationElementAdapter<Boolean> optionalAdapter;
- private Boolean optional;
- private TextRange optionalTextRange;
-
-
- public SourceEclipseLinkTransformationAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.fetchAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, FETCH_ADAPTER);
- this.optionalAdapter = new AnnotatedElementAnnotationElementAdapter<Boolean>(element, OPTIONAL_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.fetch = this.buildFetch(astRoot);
- this.fetchTextRange = this.buildFetchTextRange(astRoot);
-
- this.optional = this.buildOptional(astRoot);
- this.optionalTextRange = this.buildOptionalTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncFetch(this.buildFetch(astRoot));
- this.fetchTextRange = this.buildFetchTextRange(astRoot);
-
- this.syncOptional(this.buildOptional(astRoot));
- this.optionalTextRange = this.buildOptionalTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.fetch == null) &&
- (this.optional == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.fetch);
- }
-
-
- // ********** TransformationAnnotation implementation **********
-
- // ***** fetch
- public FetchType getFetch() {
- return this.fetch;
- }
-
- public void setFetch(FetchType fetch) {
- if (this.attributeValueHasChanged(this.fetch, fetch)) {
- this.fetch = fetch;
- this.fetchAdapter.setValue(FetchType.toJavaAnnotationValue(fetch));
- }
- }
-
- private void syncFetch(FetchType astFetch) {
- FetchType old = this.fetch;
- this.fetch = astFetch;
- this.firePropertyChanged(FETCH_PROPERTY, old, astFetch);
- }
-
- private FetchType buildFetch(CompilationUnit astRoot) {
- return FetchType.fromJavaAnnotationValue(this.fetchAdapter.getValue(astRoot));
- }
-
- public TextRange getFetchTextRange() {
- return this.fetchTextRange;
- }
-
- private TextRange buildFetchTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(FETCH_ADAPTER, astRoot);
- }
-
- // ***** optional
- public Boolean getOptional() {
- return this.optional;
- }
-
- public void setOptional(Boolean optional) {
- if (this.attributeValueHasChanged(this.optional, optional)) {
- this.optional = optional;
- this.optionalAdapter.setValue(optional);
- }
- }
-
- private void syncOptional(Boolean astOptional) {
- Boolean old = this.optional;
- this.optional = astOptional;
- this.firePropertyChanged(OPTIONAL_PROPERTY, old, astOptional);
- }
-
- private Boolean buildOptional(CompilationUnit astRoot) {
- return this.optionalAdapter.getValue(astRoot);
- }
-
- public TextRange getOptionalTextRange() {
- return this.optionalTextRange;
- }
-
- private TextRange buildOptionalTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(OPTIONAL_ADAPTER, astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationElementAdapter<Boolean> buildOptionalAdapter() {
- return new ConversionDeclarationAnnotationElementAdapter<Boolean>(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.TRANSFORMATION__OPTIONAL, BooleanExpressionConverter.instance());
- }
-
- private static DeclarationAnnotationElementAdapter<String> buildFetchAdapter() {
- return new EnumDeclarationAnnotationElementAdapter(DECLARATION_ANNOTATION_ADAPTER, EclipseLink.TRANSFORMATION__FETCH);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java
deleted file mode 100644
index 85ea7825fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTransformerAnnotation.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.AnnotatedElementAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ConversionDeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleTypeStringExpressionConverter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotationElementAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationElementAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformerAnnotation;
-
-/**
- * <code><ul>
- * <li>org.eclipse.persistence.annotations.ReadTransformer
- * <li>org.eclipse.persistence.annotations.WriteTransformer
- * </ul></code>
- */
-abstract class SourceEclipseLinkTransformerAnnotation
- extends SourceAnnotation
- implements EclipseLinkTransformerAnnotation
-{
- final DeclarationAnnotationElementAdapter<String> transformerClassDeclarationAdapter;
- final AnnotationElementAdapter<String> transformerClassAdapter;
- String transformerClass;
- TextRange transformerClassTextRange;
-
- final DeclarationAnnotationElementAdapter<String> methodDeclarationAdapter;
- final AnnotationElementAdapter<String> methodAdapter;
- String method;
- TextRange methodTextRange;
-
-
- SourceEclipseLinkTransformerAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, DeclarationAnnotationAdapter daa) {
- super(parent, element, daa);
- this.transformerClassDeclarationAdapter = new ConversionDeclarationAnnotationElementAdapter<String>(daa, this.getTransformerClassElementName(), SimpleTypeStringExpressionConverter.instance());
- this.transformerClassAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, this.transformerClassDeclarationAdapter);
-
- this.methodDeclarationAdapter = ConversionDeclarationAnnotationElementAdapter.forStrings(daa, this.getMethodElementName());
- this.methodAdapter = new AnnotatedElementAnnotationElementAdapter<String>(element, this.methodDeclarationAdapter);
- }
-
- public void initialize(CompilationUnit astRoot) {
- this.transformerClass = this.buildTransformerClass(astRoot);
- this.transformerClassTextRange = this.buildTransformerClassTextRange(astRoot);
-
- this.method = this.buildMethod(astRoot);
- this.methodTextRange = this.buildMethodTextRange(astRoot);
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- this.syncTransformerClass(this.buildTransformerClass(astRoot));
- this.transformerClassTextRange = this.buildTransformerClassTextRange(astRoot);
-
- this.syncMethod(this.buildMethod(astRoot));
- this.methodTextRange = this.buildMethodTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.transformerClass == null) &&
- (this.method == null);
- }
-
- @Override
- public void toString(StringBuilder sb) {
- sb.append(this.transformerClass);
- }
-
-
- // ********** TransformerAnnotation implementation **********
-
- // ***** transformer class
- public String getTransformerClass() {
- return this.transformerClass;
- }
-
- public void setTransformerClass(String transformerClass) {
- if (this.attributeValueHasChanged(this.transformerClass, transformerClass)) {
- this.transformerClass = transformerClass;
- this.transformerClassAdapter.setValue(transformerClass);
- }
- }
-
- private void syncTransformerClass(String astTransformerClass) {
- String old = this.transformerClass;
- this.transformerClass = astTransformerClass;
- this.firePropertyChanged(TRANSFORMER_CLASS_PROPERTY, old, astTransformerClass);
- }
-
- private String buildTransformerClass(CompilationUnit astRoot) {
- return this.transformerClassAdapter.getValue(astRoot);
- }
-
- public TextRange getTransformerClassTextRange() {
- return this.transformerClassTextRange;
- }
-
- private TextRange buildTransformerClassTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.transformerClassDeclarationAdapter, astRoot);
- }
-
- abstract String getTransformerClassElementName();
-
- // ***** method
- public String getMethod() {
- return this.method;
- }
-
- public void setMethod(String method) {
- if (this.attributeValueHasChanged(this.method, method)) {
- this.method = method;
- this.methodAdapter.setValue(method);
- }
- }
-
- private void syncMethod(String astMethod) {
- String old = this.method;
- this.method = astMethod;
- this.firePropertyChanged(METHOD_PROPERTY, old, astMethod);
- }
-
- private String buildMethod(CompilationUnit astRoot) {
- return this.methodAdapter.getValue(astRoot);
- }
-
- public TextRange getMethodTextRange() {
- return this.methodTextRange;
- }
-
- private TextRange buildMethodTextRange(CompilationUnit astRoot) {
- return this.getElementTextRange(this.methodDeclarationAdapter, astRoot);
- }
-
- abstract String getMethodElementName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index 5900ad9a43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jpt.common.core.internal.utility.jdt.CombinationIndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementIndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedAnnotationAdapter;
-import org.eclipse.jpt.common.core.utility.jdt.IndexedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.TypeConverter</code>
- */
-public final class SourceEclipseLinkTypeConverterAnnotation
- extends SourceEclipseLinkBaseTypeConverterAnnotation
- implements EclipseLinkTypeConverterAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
- private static final DeclarationAnnotationAdapter CONTAINER_DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(EclipseLink.TYPE_CONVERTERS);
-
- public static SourceEclipseLinkTypeConverterAnnotation buildSourceTypeConverterAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element, int index) {
- IndexedDeclarationAnnotationAdapter idaa = buildTypeConverterDeclarationAnnotationAdapter(index);
- IndexedAnnotationAdapter iaa = buildTypeConverterAnnotationAdapter(element, idaa);
- return new SourceEclipseLinkTypeConverterAnnotation(
- parent,
- element,
- idaa,
- iaa);
- }
-
- private SourceEclipseLinkTypeConverterAnnotation(
- JavaResourceAnnotatedElement parent,
- AnnotatedElement element,
- IndexedDeclarationAnnotationAdapter daa,
- IndexedAnnotationAdapter annotationAdapter) {
- super(parent, element, daa, annotationAdapter);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
-
- // ********** SourceNamedConverterAnnotation implementation **********
-
- @Override
- String getNameElementName() {
- return EclipseLink.TYPE_CONVERTER__NAME;
- }
-
-
- // ********** SourceBaseTypeConverterAnnotation implementation **********
-
- @Override
- String getDataTypeElementName() {
- return EclipseLink.TYPE_CONVERTER__DATA_TYPE;
- }
-
- @Override
- String getObjectTypeElementName() {
- return EclipseLink.TYPE_CONVERTER__OBJECT_TYPE;
- }
-
- // ********** static methods **********
-
- private static IndexedAnnotationAdapter buildTypeConverterAnnotationAdapter(AnnotatedElement annotatedElement, IndexedDeclarationAnnotationAdapter idaa) {
- return new ElementIndexedAnnotationAdapter(annotatedElement, idaa);
- }
-
- private static IndexedDeclarationAnnotationAdapter buildTypeConverterDeclarationAnnotationAdapter(int index) {
- IndexedDeclarationAnnotationAdapter idaa =
- new CombinationIndexedDeclarationAnnotationAdapter(
- DECLARATION_ANNOTATION_ADAPTER,
- CONTAINER_DECLARATION_ANNOTATION_ADAPTER,
- index,
- ANNOTATION_NAME);
- return idaa;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index 8e8ee15d3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkVariableOneToOneAnnotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceAnnotation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkVariableOneToOneAnnotation;
-
-/**
- * org.eclipse.persistence.annotations.VariableOneToOne
- */
-public final class SourceEclipseLinkVariableOneToOneAnnotation
- extends SourceAnnotation
- implements EclipseLinkVariableOneToOneAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
-
- public SourceEclipseLinkVariableOneToOneAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- public void initialize(CompilationUnit astRoot) {
- // nothing to initialize
- }
-
- public void synchronizeWith(CompilationUnit astRoot) {
- // nothing to update
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java
deleted file mode 100644
index 4962657e4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/java/source/SourceEclipseLinkWriteTransformerAnnotation.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.source;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ElementAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NestedDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.internal.utility.jdt.SimpleDeclarationAnnotationAdapter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement;
-import org.eclipse.jpt.common.core.utility.jdt.DeclarationAnnotationAdapter;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.resource.java.NullEclipseLinkWriteTransformerColumnAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-/**
- * <code>org.eclipse.persistence.annotations.WriteTransformer</code>
- */
-public final class SourceEclipseLinkWriteTransformerAnnotation
- extends SourceEclipseLinkTransformerAnnotation
- implements EclipseLinkWriteTransformerAnnotation
-{
- private static final DeclarationAnnotationAdapter DECLARATION_ANNOTATION_ADAPTER = new SimpleDeclarationAnnotationAdapter(ANNOTATION_NAME);
-
- private final ElementAnnotationAdapter columnAdapter;
- private ColumnAnnotation column;
- private final ColumnAnnotation nullColumn;
- private TextRange columnTextRange;
-
-
- public SourceEclipseLinkWriteTransformerAnnotation(JavaResourceAnnotatedElement parent, AnnotatedElement element) {
- super(parent, element, DECLARATION_ANNOTATION_ADAPTER);
- this.columnAdapter = new ElementAnnotationAdapter(this.annotatedElement, buildColumnAnnotationAdapter(this.daa));
- this.nullColumn = this.buildNullColumn();
- }
-
- public String getAnnotationName() {
- return ANNOTATION_NAME;
- }
-
- @Override
- public void initialize(CompilationUnit astRoot) {
- super.initialize(astRoot);
- if (this.columnAdapter.getAnnotation(astRoot) != null) {
- this.column = createColumn(this, this.annotatedElement, this.daa);
- this.column.initialize(astRoot);
- }
- this.columnTextRange = this.buildColumnTextRange(astRoot);
- }
-
- @Override
- public void synchronizeWith(CompilationUnit astRoot) {
- super.synchronizeWith(astRoot);
- this.syncColumn(astRoot);
- this.columnTextRange = this.buildColumnTextRange(astRoot);
- }
-
- @Override
- public boolean isUnset() {
- return super.isUnset() &&
- (this.column == null);
- }
-
-
- // ********** SourceTransformerAnnotation implementation **********
-
- @Override
- String getTransformerClassElementName() {
- return EclipseLink.WRITE_TRANSFORMER__TRANSFORMER_CLASS;
- }
-
- @Override
- String getMethodElementName() {
- return EclipseLink.WRITE_TRANSFORMER__METHOD;
- }
-
-
- // ********** WriteTransformerAnnotation implementation **********
-
- // ***** column
- public ColumnAnnotation getColumn() {
- return this.column;
- }
-
- public ColumnAnnotation getNonNullColumn() {
- return (this.column != null) ? this.column : this.nullColumn;
- }
-
- public ColumnAnnotation addColumn() {
- if (this.column != null) {
- throw new IllegalStateException("'column' element already exists: " + this.column); //$NON-NLS-1$
- }
- this.column = createColumn(this, this.annotatedElement, this.daa);
- this.column.newAnnotation();
- return this.column;
- }
-
- public void removeColumn() {
- if (this.column == null) {
- throw new IllegalStateException("'column' element does not exist"); //$NON-NLS-1$
- }
- ColumnAnnotation old = this.column;
- this.column = null;
- old.removeAnnotation();
- }
-
- private void syncColumn(CompilationUnit astRoot) {
- if (this.columnAdapter.getAnnotation(astRoot) == null) {
- this.syncColumn_(null);
- } else {
- if (this.column == null) {
- ColumnAnnotation col = createColumn(this, this.annotatedElement, this.daa);
- col.initialize(astRoot);
- this.syncColumn_(col);
- } else {
- this.column.synchronizeWith(astRoot);
- }
- }
- }
-
- private void syncColumn_(ColumnAnnotation astColumn) {
- ColumnAnnotation old = this.column;
- this.column = astColumn;
- this.firePropertyChanged(COLUMN_PROPERTY, old, astColumn);
- }
-
- private ColumnAnnotation buildNullColumn() {
- return new NullEclipseLinkWriteTransformerColumnAnnotation(this);
- }
-
- public TextRange getColumnTextRange() {
- return this.columnTextRange;
- }
-
- private TextRange buildColumnTextRange(CompilationUnit astRoot) {
- if (this.column != null) {
- return this.column.getTextRange(astRoot);
- }
- return this.getTextRange(astRoot);
- }
-
-
- // ********** static methods **********
-
- private static DeclarationAnnotationAdapter buildColumnAnnotationAdapter(DeclarationAnnotationAdapter writeTransformerAnnotationAdapter) {
- return new NestedDeclarationAnnotationAdapter(writeTransformerAnnotationAdapter, EclipseLink.WRITE_TRANSFORMER__COLUMN, JPA.COLUMN);
- }
-
- private static ColumnAnnotation createColumn(JavaResourceNode parent, AnnotatedElement element, DeclarationAnnotationAdapter writeTransformerAnnotationAdapter) {
- return new SourceColumnAnnotation(parent, element, buildColumnAnnotationAdapter(writeTransformerAnnotationAdapter));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java
deleted file mode 100644
index d6d6be213c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/resource/orm/EclipseLinkOrmXmlResourceProvider.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.resource.orm;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.resource.AbstractXmlResourceProvider;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class EclipseLinkOrmXmlResourceProvider
- extends AbstractXmlResourceProvider
- implements OrmFileCreationDataModelProperties
-{
- /**
- * (Convenience method) Returns an EclipseLink ORM resource model provider for
- * the given file.
- */
- public static EclipseLinkOrmXmlResourceProvider getXmlResourceProvider(IFile file) {
- return getXmlResourceProvider_(file.getProject(), file.getFullPath());
- }
-
- /**
- * (Convenience method) Returns an EclipseLink ORM resource model provider for
- * the given project in the specified runtime location
- */
- public static EclipseLinkOrmXmlResourceProvider getXmlResourceProvider(IProject project, IPath runtimePath) {
- return getXmlResourceProvider_(project, runtimePath);
- }
-
- /**
- * (Convenience method) Returns an EclipseLink ORM resource model provider for
- * the given project in the default runtime location
- */
- public static EclipseLinkOrmXmlResourceProvider getDefaultXmlResourceProvider(IProject project) {
- return getXmlResourceProvider(project, JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- }
-
- private static EclipseLinkOrmXmlResourceProvider getXmlResourceProvider_(IProject project, IPath fullPath) {
- return new EclipseLinkOrmXmlResourceProvider(project, fullPath);
- }
-
-
- public EclipseLinkOrmXmlResourceProvider(IProject project) {
- this(project, JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- }
-
- public EclipseLinkOrmXmlResourceProvider(IProject project, IPath filePath) {
- super(project, filePath, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE);
- }
-
-
- @Override
- protected void populateRoot(Object config) {
- IDataModel dataModel = (IDataModel) config;
- XmlEntityMappings entityMappings = EclipseLinkOrmFactory.eINSTANCE.createXmlEntityMappings();
- entityMappings.setVersion(dataModel.getStringProperty(VERSION));
- getResourceContents().add(entityMappings);
-
- String defaultAccess = (String) dataModel.getProperty(DEFAULT_ACCESS);
- if (defaultAccess != null) {
- XmlPersistenceUnitMetadata puMetadata = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- entityMappings.setPersistenceUnitMetadata(puMetadata);
- XmlPersistenceUnitDefaults puDefaults = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- puMetadata.setPersistenceUnitDefaults(puDefaults);
- puDefaults.setAccess(defaultAccess);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/weave/StaticWeave.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/weave/StaticWeave.java
deleted file mode 100644
index 84f9531c63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/internal/weave/StaticWeave.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.internal.weave;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.IClasspathContainer;
-import org.eclipse.jdt.core.IClasspathEntry;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.launching.IJavaLaunchConfigurationConstants;
-import org.eclipse.jdt.launching.IRuntimeClasspathEntry;
-import org.eclipse.jdt.launching.JavaRuntime;
-import org.eclipse.jpt.common.core.internal.gen.AbstractJptGenerator;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * StaticWeave
- * Running Static Weaving from Project's classpath
- */
-public class StaticWeave extends AbstractJptGenerator
-{
- static public String LAUNCH_CONFIG_NAME = "Static Weaving Run Config"; //$NON-NLS-1$
- static public String WEAVING_PACKAGE_NAME = "org.eclipse.persistence.tools.weaving.jpa"; //$NON-NLS-1$
- static public String WEAVING_CLASS = WEAVING_PACKAGE_NAME + ".StaticWeave"; //$NON-NLS-1$
-
- private String source;
- private String target;
- private String loglevel;
- private String persistenceinfo;
- private final String mainType;
-
- // ********** static methods **********
-
- public static void weave(
- IJavaProject javaProject,
- String source,
- String target,
- String loglevel,
- String persistenceinfo,
- IProgressMonitor monitor) {
-
- if(javaProject == null) {
- throw new NullPointerException("javaProject is null"); //$NON-NLS-1$
- }
-
- new StaticWeave(javaProject,
- source,
- target,
- loglevel,
- persistenceinfo).generate(monitor);
- }
-
- // ********** constructors **********
-
- protected StaticWeave(
- IJavaProject javaProject,
- String source,
- String target,
- String loglevel,
- String persistenceinfo) {
- super(javaProject);
-
- this.source = source;
- this.target = target;
- this.loglevel = loglevel;
- this.persistenceinfo = persistenceinfo;
-
- this.mainType = WEAVING_CLASS;
-
- this.setDebug(false);
- }
-
- // ********** overrides **********
-
- @Override
- protected String getMainType() {
- return this.mainType;
- }
-
- @Override
- protected String getLaunchConfigName() {
- return LAUNCH_CONFIG_NAME;
- }
-
- @Override
- protected void specifyJRE() {
- // do nothing
- }
-
- @Override
- protected void refreshProject() throws CoreException {
- // do nothing
- // 370895 - Static weaving results in infinite builder loop when enabled
- }
-
- // ********** behavior **********
-
- @Override
- protected void preGenerate(IProgressMonitor monitor) {
- // nothing to do yet...
- }
-
- // ********** Launch Configuration Setup **********
-
- @Override
- protected List<String> buildClasspath() throws CoreException {
- List<String> classpath = new ArrayList<String>();
- // Default Project classpath
- classpath.add(this.getDefaultProjectClasspathEntry().getMemento());
- // System Library
- classpath.add(this.getSystemLibraryClasspathEntry().getMemento());
- // Containers classpath
- for(IRuntimeClasspathEntry containerClasspathEntry: this.getContainersClasspathEntries()) {
- classpath.add(containerClasspathEntry.getMemento());
- }
- return classpath;
- }
-
- @Override
- protected void specifyProgramArguments() {
- StringBuffer programArguments = new StringBuffer();
-
- if(StringTools.stringIsEmpty(this.source)) {
- throw new RuntimeException("Source directory cannot be empty"); //$NON-NLS-1$
- }
- if(StringTools.stringIsEmpty(this.target)) {
- throw new RuntimeException("Target directory cannot be empty"); //$NON-NLS-1$
- }
-
- if( ! StringTools.stringIsEmpty(this.loglevel)) {
- programArguments.append("-loglevel "); //$NON-NLS-1$
- programArguments.append(this.loglevel);
- }
-
- if( ! StringTools.stringIsEmpty(this.persistenceinfo)) {
- programArguments.append(" -persistenceinfo "); //$NON-NLS-1$
- programArguments.append(StringTools.quote(this.persistenceinfo));
- }
-
- programArguments.append(' ');
- programArguments.append(StringTools.quote(this.source));
-
- programArguments.append(' ');
- programArguments.append(StringTools.quote(this.target));
-
- this.launchConfig.setAttribute(IJavaLaunchConfigurationConstants.ATTR_PROGRAM_ARGUMENTS, programArguments.toString());
- }
-
- // ********** queries **********
-
- private List<IRuntimeClasspathEntry> getContainersClasspathEntries() throws CoreException {
- ArrayList<IRuntimeClasspathEntry> classpathEntries = new ArrayList<IRuntimeClasspathEntry>();
- for(IClasspathEntry classpathEntry: this.javaProject.getRawClasspath()) {
- if(classpathEntry.getEntryKind() == IClasspathEntry.CPE_CONTAINER) {
- IClasspathContainer container = JavaCore.getClasspathContainer(classpathEntry.getPath(), this.javaProject);
- if(container != null && container.getKind() == IClasspathContainer.K_SYSTEM) {
- classpathEntries.add(
- JavaRuntime.newRuntimeContainerClasspathEntry(
- container.getPath(),
- IRuntimeClasspathEntry.BOOTSTRAP_CLASSES,
- this.javaProject));
- }
- }
- }
- return classpathEntries;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicEmbeddable.java
deleted file mode 100644
index 09d3f9c6cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicEmbeddable.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
-
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaEmbeddable;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaManagedTypeProvider;
-import org.eclipse.persistence.jpa.jpql.spi.IEmbeddable;
-import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeVisitor;
-
-/**
- * This implementation of an {@link IEmbeddable} that represents a dynamic 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.4
- * @since 2.4
- * @author Pascal Filion
- */
-public class EclipseLinkDynamicEmbeddable extends EclipseLinkDynamicManagedType
- implements IEmbeddable {
-
- /**
- * Creates a new <code>EclipseLinkDynamicEmbeddable</code>.
- *
- * @param provider The provider of JPA managed types
- * @param delegate The default implementation of {@link IManagedType}
- */
- public EclipseLinkDynamicEmbeddable(JpaManagedTypeProvider provider,
- JpaEmbeddable delegate) {
-
- super(provider, delegate);
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(IManagedTypeVisitor visitor) {
- visitor.visit(this);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public JpaEmbeddable getDelegate() {
- return (JpaEmbeddable) super.getDelegate();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicEntity.java
deleted file mode 100644
index b121e8e560..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicEntity.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaEntity;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaManagedTypeProvider;
-import org.eclipse.persistence.jpa.jpql.spi.IEntity;
-import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeVisitor;
-import org.eclipse.persistence.jpa.jpql.spi.IQuery;
-
-/**
- * This implementation of an {@link IEntity} that represents a dynamic 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 3.2
- * @since 3.2
- * @author Pascal Filion
- */
-public class EclipseLinkDynamicEntity extends EclipseLinkDynamicManagedType
- implements IEntity {
-
- /**
- * Creates a new <code>EclipseLinkDynamicEmbeddable</code>.
- *
- * @param provider The provider of JPA managed types
- * @param delegate The default implementation of {@link IManagedType}
- */
- public EclipseLinkDynamicEntity(JpaManagedTypeProvider provider, JpaEntity delegate) {
- super(provider, delegate);
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(IManagedTypeVisitor visitor) {
- visitor.visit(this);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public JpaEntity getDelegate() {
- return (JpaEntity) super.getDelegate();
- }
-
- /**
- * {@inheritDoc}
- */
- public String getName() {
- return getDelegate().getName();
- }
-
- /**
- * {@inheritDoc}
- */
- public IQuery getNamedQuery(String queryName) {
- return getDelegate().getNamedQuery(queryName);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicManagedType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicManagedType.java
deleted file mode 100644
index 016b21b74c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicManagedType.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaManagedType;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaManagedTypeProvider;
-import org.eclipse.persistence.jpa.jpql.spi.IManagedType;
-import org.eclipse.persistence.jpa.jpql.spi.IMapping;
-import org.eclipse.persistence.jpa.jpql.spi.IType;
-import org.eclipse.persistence.jpa.jpql.util.iterator.CloneIterator;
-import org.eclipse.persistence.jpa.jpql.util.iterator.IterableIterator;
-
-/**
- * The abstract implementation of a {@link IManagedType} that supports a dynamic managed type.
- *
- * Provisional API: This interface is part of an interim API that is still under development and
- * expected to change significantly before reaching stability. It is available at this early stage
- * to solicit feedback from pioneering adopters on the understanding that any code that uses this
- * API will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- * @author Pascal Filion
- */
-public abstract class EclipseLinkDynamicManagedType implements IManagedType {
-
- /**
- * The default implementation of {@link IManagedType}.
- */
- private JpaManagedType delegate;
-
- /**
- * The cached collection of {@link IMapping mappings} that prevent rebuilding them every time one
- * is requested.
- */
- private Map<String, EclipseLinkDynamicMapping> mappings;
-
- /**
- * The provider of JPA managed types.
- */
- private JpaManagedTypeProvider provider;
-
- /**
- * The cached {@link IType} representing the managed type.
- */
- private EclipseLinkDynamicType type;
-
- /**
- * Creates a new <code>EclipseLinkDynamicManagedType</code>.
- *
- * @param provider The provider of JPA managed types
- * @param delegate The default implementation of {@link IManagedType}
- */
- public EclipseLinkDynamicManagedType(JpaManagedTypeProvider provider,
- JpaManagedType delegate) {
-
- super();
- this.provider = provider;
- this.delegate = delegate;
- }
-
- /**
- * Creates a {@link IType} that supports dynamic type, which means the type cannot be found in
- * the project but is only in memory.
- *
- * @return A new {@link EclipseLinkDynamicType}
- */
- protected EclipseLinkDynamicType buildDynamicType() {
- return new EclipseLinkDynamicType(
- delegate.getProvider().getTypeRepository(),
- delegate.getManagedType().getPersistentType().getName()
- );
- }
-
- /**
- * Creates the external form that needs to wrap the given {@link AttributeMapping}. By default,
- * the call is delegated to {@link IMappingBuilder}.
- *
- * @param mapping The mapping to wrap with a {@link IMapping}
- * @return A new concrete instance of {@link IMapping}
- */
- protected EclipseLinkDynamicMapping buildMapping(EclipseLinkMapping mapping) {
- return new EclipseLinkDynamicMapping(this, mapping);
- }
-
- /**
- * Creates an external form for each {@link AttributeMapping} and stores them by using their
- * mapping name.
- *
- * @return The mappings mapped by their name
- */
- protected Map<String, EclipseLinkDynamicMapping> buildMappings() {
-
- Map<String, EclipseLinkDynamicMapping> mappings = new HashMap<String, EclipseLinkDynamicMapping>();
-
- for (IMapping mapping : delegate.mappings()) {
- mappings.put(mapping.getName(), buildMapping((EclipseLinkMapping) mapping));
- }
-
- return mappings;
- }
-
- /**
- * {@inheritDoc}
- */
- public int compareTo(IManagedType managedType) {
- return delegate.compareTo(managedType);
- }
-
- /**
- * Returns the default implementation of {@link IManagedType} that is wrapped by this one.
- *
- * @return The actual {@link JpaManagedType}
- */
- public JpaManagedType getDelegate() {
- return delegate;
- }
-
- /**
- * {@inheritDoc}
- */
- public IMapping getMappingNamed(String name) {
- initializeMappings();
- return mappings.get(name);
- }
-
- /**
- * {@inheritDoc}
- */
- public JpaManagedTypeProvider getProvider() {
- return provider;
- }
-
- /**
- * {@inheritDoc}
- */
- public IType getType() {
- if (type == null) {
- type = buildDynamicType();
- }
- return type;
- }
-
- /**
- * Initializes this managed type.
- */
- protected void initializeMappings() {
- if (mappings == null) {
- mappings = buildMappings();
- }
- }
-
- /**
- * {@inheritDoc}
- */
- public IterableIterator<IMapping> mappings() {
- initializeMappings();
- return new CloneIterator<IMapping>(mappings.values());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMappedSuperclass.java
deleted file mode 100644
index 604721edea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMappedSuperclass.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
-
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaManagedTypeProvider;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaMappedSuperclass;
-import org.eclipse.persistence.jpa.jpql.spi.IManagedTypeVisitor;
-import org.eclipse.persistence.jpa.jpql.spi.IMappedSuperclass;
-
-/**
- * This implementation of an {@link IMappedSuperclass} that represents a dynamic mapped superclass.
- *
- * Provisional API: This interface is part of an interim API that is still under development and
- * expected to change significantly before reaching stability. It is available at this early stage
- * to solicit feedback from pioneering adopters on the understanding that any code that uses this
- * API will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- * @author Pascal Filion
- */
-public class EclipseLinkDynamicMappedSuperclass extends EclipseLinkDynamicManagedType
- implements IMappedSuperclass {
-
- /**
- * Creates a new <code>EclipseLinkDynamicMappedSuperclass</code>.
- *
- * @param provider The provider of JPA managed types
- * @param delegate The default implementation of {@link IManagedType}
- */
- public EclipseLinkDynamicMappedSuperclass(JpaManagedTypeProvider provider,
- JpaMappedSuperclass delegate) {
-
- super(provider, delegate);
- }
-
- /**
- * {@inheritDoc}
- */
- public void accept(IManagedTypeVisitor visitor) {
- visitor.visit(this);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public JpaMappedSuperclass getDelegate() {
- return (JpaMappedSuperclass) super.getDelegate();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMapping.java
deleted file mode 100644
index 0ee0639678..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicMapping.java
+++ /dev/null
@@ -1,249 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
-
-import java.lang.annotation.Annotation;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaTypeDeclaration;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaTypeRepository;
-import org.eclipse.persistence.jpa.jpql.spi.IEntity;
-import org.eclipse.persistence.jpa.jpql.spi.IManagedType;
-import org.eclipse.persistence.jpa.jpql.spi.IMapping;
-import org.eclipse.persistence.jpa.jpql.spi.IType;
-import org.eclipse.persistence.jpa.jpql.spi.ITypeDeclaration;
-
-/**
- * The abstract implementation of a {@link IMapping} that supports a dynamic mapping.
- *
- * Provisional API: This interface is part of an interim API that is still under development and
- * expected to change significantly before reaching stability. It is available at this early stage
- * to solicit feedback from pioneering adopters on the understanding that any code that uses this
- * API will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- * @author Pascal Filion
- */
-@SuppressWarnings("nls")
-public class EclipseLinkDynamicMapping implements IMapping {
-
- /**
- * The default implementation of {@link IMapping}.
- */
- private EclipseLinkMapping delegate;
-
- /**
- * The parent of this mapping.
- */
- private EclipseLinkDynamicManagedType parent;
-
- /**
- * The {@link IType} of the property represented by the mapping.
- */
- private IType type;
-
- /**
- * The {@link ITypeDeclaration} of the property represented by the mapping.
- */
- private ITypeDeclaration typeDeclaration;
-
- /**
- * Creates a new <code>EclipseLinkDynamicMapping</code>.
- *
- * @param parent The parent of this mapping
- * @param delegate The default implementation of {@link IMapping}
- */
- public EclipseLinkDynamicMapping(EclipseLinkDynamicManagedType parent,
- EclipseLinkMapping delegate) {
-
- super();
- this.parent = parent;
- this.delegate = delegate;
- }
-
- /**
- * Creates the list of {@link ITypeDeclaration type declarations} that represents the generics of
- * the type.
- *
- * @return The list of {@link ITypeDeclaration type declarations} or an empty list if the type is
- * not parameterized
- */
- protected ITypeDeclaration[] buildGenericTypeDeclarations() {
-
- if (delegate.isRelationship() ||
- delegate.isCollection()) {
-
- RelationshipMapping mapping = (RelationshipMapping) delegate.getMapping();
- Entity targetEntity = mapping.getResolvedTargetEntity();
-
- if (targetEntity != null) {
- IEntity entity = parent.getProvider().getEntityNamed(targetEntity.getName());
- return new ITypeDeclaration[] { entity.getType().getTypeDeclaration() };
- }
- }
-
- return new ITypeDeclaration[0];
- }
-
- /**
- * Creates the right {@link IType} and make sure it checks for dynamic type.
- *
- * @return The {@link IType} of this dynamic mapping
- */
- protected IType buildType() {
-
- if (delegate.isCollection() ||
- delegate.isRelationship()) {
-
- IManagedType managedType = parent.getProvider().getManagedType(getTypeName());
-
- if (managedType != null) {
- return managedType.getType();
- }
- }
-
- return getTypeRepository().getType(getTypeName());
- }
-
- /**
- * Creates the right {@link ITypeDeclaration} and make sure it checks for dynamic type.
- *
- * @return The {@link ITypeDeclaration} of this dynamic mapping
- */
- protected ITypeDeclaration buildTypeDeclaration() {
-
- String typeName = getTypeName();
- int dimensionality = 0;
-
- if (StringTools.stringIsNotEmpty(typeName)) {
- int index = typeName.indexOf("[]");
- dimensionality = (typeName.length() - index) / 2;
- }
-
- return new JpaTypeDeclaration(getType(), buildGenericTypeDeclarations(), dimensionality);
- }
-
- /**
- * {@inheritDoc}
- */
- public int compareTo(IMapping mapping) {
- return delegate.compareTo(mapping);
- }
-
- /**
- * Returns the mapping's attribute (typically its parent node in the containment hierarchy).
- *
- * @return The {@link PersistentAttribute}
- */
- public PersistentAttribute getAttribute() {
- return delegate.getMapping().getPersistentAttribute();
- }
-
- /**
- * {@inheritDoc}
- */
- public int getMappingType() {
- return delegate.getMappingType();
- }
-
- /**
- * {@inheritDoc}
- */
- public String getName() {
- return delegate.getName();
- }
-
- /**
- * {@inheritDoc}
- */
- public IManagedType getParent() {
- return parent;
- }
-
- /**
- * {@inheritDoc}
- */
- public IType getType() {
- if (type == null) {
- type = buildType();
- }
- return type;
- }
-
- /**
- * {@inheritDoc}
- */
- public ITypeDeclaration getTypeDeclaration() {
- if (typeDeclaration == null) {
- typeDeclaration = buildTypeDeclaration();
- }
- return typeDeclaration;
- }
-
- /**
- * Returns the type name of the persistent attribute.
- *
- * @return The fully qualified type name
- */
- public String getTypeName() {
- return getAttribute().getTypeName();
- }
-
- /**
- * Returns the type repository for the application.
- *
- * @return The repository of {@link IType ITypes}
- */
- protected JpaTypeRepository getTypeRepository() {
- return parent.getProvider().getTypeRepository();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean hasAnnotation(Class<? extends Annotation> annotationType) {
- return delegate.hasAnnotation(annotationType);
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isCollection() {
- return delegate.isCollection();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isProperty() {
- return delegate.isProperty();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isRelationship() {
- return delegate.isRelationship();
- }
-
- /**
- * {@inheritDoc}
- */
- public boolean isTransient() {
- return delegate.isTransient();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicType.java
deleted file mode 100644
index 0ca34395a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkDynamicType.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
-
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaTypeRepository;
-import org.eclipse.jpt.jpa.core.jpql.spi.SimpleType;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still under development and
- * expected to change significantly before reaching stability. It is available at this early stage
- * to solicit feedback from pioneering adopters on the understanding that any code that uses this
- * API will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- * @author Pascal Filion
- */
-public class EclipseLinkDynamicType extends SimpleType {
-
- /**
- * Creates a new <code>EclipseLinkDynamicType</code>.
- * @param typeRepository
- * @param type
- */
- public EclipseLinkDynamicType(JpaTypeRepository typeRepository, String typeName) {
- super(typeRepository, typeName);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isResolvable() {
- return true;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkManagedTypeBuilder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkManagedTypeBuilder.java
deleted file mode 100644
index bd3b902ff6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkManagedTypeBuilder.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.jpql.spi.IManagedTypeBuilder;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaEmbeddable;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaEntity;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaManagedTypeBuilder;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaManagedTypeProvider;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.persistence.jpa.jpql.spi.IEmbeddable;
-import org.eclipse.persistence.jpa.jpql.spi.IEntity;
-import org.eclipse.persistence.jpa.jpql.spi.IMappedSuperclass;
-import org.eclipse.persistence.jpa.jpql.spi.IMappingBuilder;
-
-/**
- * This implementation of {@link IManagedTypeBuilder} adds support for dynamic managed types.
- *
- * @version 3.2
- * @since 3.2
- * @author Pascal Filion
- */
-public class EclipseLinkManagedTypeBuilder implements IManagedTypeBuilder {
-
- /**
- * This builder is used to create the default implementation of an {@link org.eclipse.persistence.
- * jpa.jpql.spi.IManagedType IManagedType} which is only wrapped if the managed type is dynamic.
- */
- private JpaManagedTypeBuilder builder;
-
- /**
- * Creates a new <code>EclipseLinkManagedTypeBuilder</code>.
- */
- public EclipseLinkManagedTypeBuilder() {
- super();
- builder = new JpaManagedTypeBuilder();
- }
-
- /**
- * {@inheritDoc}
- */
- public IEmbeddable buildEmbeddable(JpaManagedTypeProvider provider,
- Embeddable mappedClass,
- IMappingBuilder<AttributeMapping> mappingBuilder) {
-
- JpaEmbeddable embeddable = (JpaEmbeddable) builder.buildEmbeddable(
- provider,
- mappedClass,
- mappingBuilder
- );
-
- PersistentType persistentType = mappedClass.getPersistentType();
-
- if (persistentType instanceof EclipseLinkOrmPersistentType) {
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) persistentType;
- if (ormPersistentType.isDynamic()) {
- return new EclipseLinkDynamicEmbeddable(provider, embeddable);
- }
- }
-
- return embeddable;
- }
-
- /**
- * {@inheritDoc}
- */
- public IEntity buildEntity(JpaManagedTypeProvider provider,
- Entity mappedClass,
- IMappingBuilder<AttributeMapping> mappingBuilder) {
-
- JpaEntity entity = (JpaEntity) builder.buildEntity(provider, mappedClass, mappingBuilder);
- PersistentType persistentType = mappedClass.getPersistentType();
-
- if (persistentType instanceof EclipseLinkOrmPersistentType) {
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) persistentType;
- if (ormPersistentType.isDynamic()) {
- return new EclipseLinkDynamicEntity(provider, entity);
- }
- }
-
- return entity;
- }
-
- /**
- * {@inheritDoc}
- */
- public IMappedSuperclass buildMappedSuperclass(JpaManagedTypeProvider provider,
- MappedSuperclass mappedClass,
- IMappingBuilder<AttributeMapping> mappingBuilder) {
-
- JpaMappedSuperclass mappedSuperclass = (JpaMappedSuperclass) builder.buildMappedSuperclass(
- provider,
- mappedClass,
- mappingBuilder
- );
-
- PersistentType persistentType = mappedClass.getPersistentType();
-
- if (persistentType instanceof EclipseLinkOrmPersistentType) {
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) persistentType;
- if (ormPersistentType.isDynamic()) {
- return new EclipseLinkDynamicMappedSuperclass(provider, mappedSuperclass);
- }
- }
-
- return mappedSuperclass;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkMapping.java
deleted file mode 100644
index 75e6c20883..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkMapping.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.jpql.spi.JpaMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.persistence.jpa.jpql.spi.IManagedType;
-
-import static org.eclipse.persistence.jpa.jpql.spi.IEclipseLinkMappingType.*;
-import static org.eclipse.persistence.jpa.jpql.spi.IMappingType.*;
-
-/**
- * The EclipseLink implementation of Hermes' {@link IMapping}, which adds EclipseLink specific
- * mapping support.
- *
- * Provisional API: This interface is part of an interim API that is still under development and
- * expected to change significantly before reaching stability. It is available at this early stage
- * to solicit feedback from pioneering adopters on the understanding that any code that uses this
- * API will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.1
- * @author Pascal Filion
- */
-@SuppressWarnings("unused" /* For the extra import statement, see bug 330740 */)
-public class EclipseLinkMapping extends JpaMapping {
-
- /**
- * Creates a new <code>EclipseLinkMapping</code>.
- *
- * @param parent The parent of this mapping
- * @param mapping The design-time {@link AttributeMapping} wrapped by this class
- */
- public EclipseLinkMapping(IManagedType parent, AttributeMapping mapping) {
- super(parent, mapping);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected int calculateMappingType() {
-
- String type = getMapping().getKey();
-
- // Basic Collection
- if (type == EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY) {
- return BASIC_COLLECTION;
- }
-
- // Basic Map
- if (type == EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY) {
- return BASIC_MAP;
- }
-
- // Transformation
- if (type == EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY) {
- return TRANSFORMATION;
- }
-
- // Variable 1:1
- if (type == EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY) {
- return VARIABLE_ONE_TO_ONE;
- }
-
- return super.calculateMappingType();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected AttributeMapping getMapping() {
- return super.getMapping();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isCollection() {
- switch (getMappingType()) {
- case BASIC_COLLECTION:
- case BASIC_MAP:
- case ELEMENT_COLLECTION:
- case MANY_TO_MANY:
- case ONE_TO_MANY: return true;
- default: return false;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean isRelationship() {
- switch (getMappingType()) {
- case ELEMENT_COLLECTION:
- case EMBEDDED_ID:
- case MANY_TO_MANY:
- case MANY_TO_ONE:
- case ONE_TO_MANY:
- case ONE_TO_ONE:
- case VARIABLE_ONE_TO_ONE: return true;
- default: return false;
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkMappingBuilder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkMappingBuilder.java
deleted file mode 100644
index 9e21d20087..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/jpql/spi/EclipseLinkMappingBuilder.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.jpql.spi;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.persistence.jpa.jpql.spi.IManagedType;
-import org.eclipse.persistence.jpa.jpql.spi.IMapping;
-import org.eclipse.persistence.jpa.jpql.spi.IMappingBuilder;
-
-/**
- * An implementation of {@link IMappingBuilder} that creates the EclipseLink version of Hermes's
- * {@link IMapping}.
- *
- * Provisional API: This interface is part of an interim API that is still under development and
- * expected to change significantly before reaching stability. It is available at this early stage
- * to solicit feedback from pioneering adopters on the understanding that any code that uses this
- * API will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.4
- * @since 2.4
- * @author Pascal Filion
- */
-public class EclipseLinkMappingBuilder implements IMappingBuilder<AttributeMapping> {
-
- /**
- * Creates a new <code>EclipseLinkMappingBuilder</code>.
- */
- public EclipseLinkMappingBuilder() {
- super();
- }
-
- /**
- * {@inheritDoc}
- */
- public IMapping buildMapping(IManagedType parent, AttributeMapping value) {
- return new EclipseLinkMapping(parent, value);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java
deleted file mode 100644
index b6401dd3e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/platform/EclipseLinkPlatform.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.platform;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformGroupDescription;
-
-/**
- * Constants pertaining to the EclipseLink JPA platforms and their group
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.0
- */
-public class EclipseLinkPlatform {
-
- public static final JpaPlatformGroupDescription GROUP
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatformGroup("eclipselink"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_1_0
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("org.eclipse.eclipselink.platform"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_1_1
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink1_1"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_1_2
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink1_2"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_0
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_0"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_1
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_1"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_2
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_2"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_3
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_3"); //$NON-NLS-1$
-
- public static final JpaPlatformDescription VERSION_2_4
- = JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform("eclipselink2_4"); //$NON-NLS-1$
-
-
- /**
- * Not for instantiation
- */
- private EclipseLinkPlatform() {}
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheCoordinationType.java
deleted file mode 100644
index c7cdae36a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheCoordinationType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.CacheCoordinationType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum CacheCoordinationType {
-
- SEND_OBJECT_CHANGES(EclipseLink.CACHE_COORDINATION_TYPE__SEND_OBJECT_CHANGES),
- INVALIDATE_CHANGED_OBJECTS(EclipseLink.CACHE_COORDINATION_TYPE__INVALIDATE_CHANGED_OBJECTS),
- SEND_NEW_OBJECTS_WITH_CHANGES(EclipseLink.CACHE_COORDINATION_TYPE__SEND_NEW_OBJECTS_WITH_CHANGES),
- NONE(EclipseLink.CACHE_COORDINATION_TYPE__NONE);
-
-
- private String javaAnnotationValue;
-
- CacheCoordinationType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static CacheCoordinationType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static CacheCoordinationType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (CacheCoordinationType cacheCoordinationType : CacheCoordinationType.values()) {
- if (cacheCoordinationType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return cacheCoordinationType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(CacheCoordinationType cacheCoordinationType) {
- return (cacheCoordinationType == null) ? null : cacheCoordinationType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheIsolationType2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheIsolationType2_2.java
deleted file mode 100644
index e2ff2d7e8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheIsolationType2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.config.CacheIsolationType added in EclipseLink 2.2
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public enum CacheIsolationType2_2 {
-
- SHARED(EclipseLink.CACHE_ISOLATION_TYPE__SHARED),
- PROTECTED(EclipseLink.CACHE_ISOLATION_TYPE__PROTECTED),
- ISOLATED(EclipseLink.CACHE_ISOLATION_TYPE__ISOLATED);
-
-
- private String javaAnnotationValue;
-
- CacheIsolationType2_2(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static CacheIsolationType2_2 fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static CacheIsolationType2_2 fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (CacheIsolationType2_2 cacheCoordinationType : CacheIsolationType2_2.values()) {
- if (cacheCoordinationType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return cacheCoordinationType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(CacheIsolationType2_2 cacheCoordinationType) {
- return (cacheCoordinationType == null) ? null : cacheCoordinationType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheType.java
deleted file mode 100644
index 6f5dd969a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/CacheType.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.CacheType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum CacheType {
-
- FULL(EclipseLink.CACHE_TYPE__FULL),
- WEAK(EclipseLink.CACHE_TYPE__WEAK),
- SOFT(EclipseLink.CACHE_TYPE__SOFT),
- SOFT_WEAK(EclipseLink.CACHE_TYPE__SOFT_WEAK),
- HARD_WEAK(EclipseLink.CACHE_TYPE__HARD_WEAK),
- CACHE(EclipseLink.CACHE_TYPE__CACHE),
- NONE(EclipseLink.CACHE_TYPE__NONE);
-
-
- private String javaAnnotationValue;
-
- CacheType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static CacheType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static CacheType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (CacheType cacheType : CacheType.values()) {
- if (cacheType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return cacheType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(CacheType cacheType) {
- return (cacheType == null) ? null : cacheType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ChangeTrackingType.java
deleted file mode 100644
index f9dac5d315..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ChangeTrackingType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.ChangeTrackingType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum ChangeTrackingType {
-
- ATTRIBUTE(EclipseLink.CHANGE_TRACKING_TYPE__ATTRIBUTE),
- OBJECT(EclipseLink.CHANGE_TRACKING_TYPE__OBJECT),
- DEFERRED(EclipseLink.CHANGE_TRACKING_TYPE__DEFERRED),
- AUTO(EclipseLink.CHANGE_TRACKING_TYPE__AUTO);
-
-
- private String javaAnnotationValue;
-
- ChangeTrackingType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static ChangeTrackingType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static ChangeTrackingType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (ChangeTrackingType changeTrackingType : ChangeTrackingType.values()) {
- if (changeTrackingType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return changeTrackingType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(ChangeTrackingType changeTrackingType) {
- return (changeTrackingType == null) ? null : changeTrackingType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLink.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLink.java
deleted file mode 100644
index 8181de5e09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLink.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * EclipseLink Java-related stuff (annotations etc.)
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-@SuppressWarnings("nls")
-public interface EclipseLink {
-
- // EclipseLink package
- String PACKAGE = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
- String PACKAGE_ = PACKAGE + ".";
-
-
- // ********** API **********
-
- // EclispeLink annotations
- String BASIC_COLLECTION = PACKAGE_ + "BasicCollection";
- String BASIC_MAP = PACKAGE_ + "BasicMap";
- String CACHE = PACKAGE_ + "Cache";
- String CACHE__SHARED = "shared";
- String CACHE__EXPIRY = "expiry";
- String CACHE__EXPIRY_TIME_OF_DAY = "expiryTimeOfDay";
- String CACHE__TYPE = "type";
- String CACHE__SIZE = "size";
- String CACHE__ALWAYS_REFRESH = "alwaysRefresh";
- String CACHE__REFRESH_ONLY_IF_NEWER = "refreshOnlyIfNewer";
- String CACHE__DISABLE_HITS = "disableHits";
- String CACHE__COORDINATION_TYPE = "coordinationType";
- String CHANGE_TRACKING = PACKAGE_ + "ChangeTracking";
- String CHANGE_TRACKING__VALUE = "value";
- String CONVERSION_VALUE = PACKAGE_ + "ConversionValue";
- String CONVERSION_VALUE__DATA_VALUE = "dataValue";
- String CONVERSION_VALUE__OBJECT_VALUE = "objectValue";
- String CONVERT = PACKAGE_ + "Convert";
- String CONVERT__VALUE = "value";
- String CONVERTER = PACKAGE_ + "Converter";
- String CONVERTER__NAME = "name";
- String CONVERTER__CONVERTER_CLASS = "converterClass";
- String CUSTOMIZER = PACKAGE_ + "Customizer";
- String CUSTOMIZER__VALUE = "value";
- String EXISTENCE_CHECKING = PACKAGE_ + "ExistenceChecking";
- String EXISTENCE_CHECKING__VALUE = "value";
- String JOIN_FETCH = PACKAGE_ + "JoinFetch";
- String JOIN_FETCH__VALUE = "value";
- String MUTABLE = PACKAGE_ + "Mutable";
- String MUTABLE__VALUE = "value";
- String OBJECT_TYPE_CONVERTER = PACKAGE_ + "ObjectTypeConverter";
- String OBJECT_TYPE_CONVERTER__NAME = "name";
- String OBJECT_TYPE_CONVERTER__DATA_TYPE = "dataType";
- String OBJECT_TYPE_CONVERTER__OBJECT_TYPE = "objectType";
- String OBJECT_TYPE_CONVERTER__CONVERSION_VALUES = "conversionValues";
- String OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE = "defaultObjectValue";
- String PRIMARY_KEY = PACKAGE_ + "PrimaryKey";
- String PRIMARY_KEY__VALIDATION = "validation";
- String PRIMARY_KEY__CACHE_KEY_TYPE = "cacheKeyType";
- String PRIMARY_KEY__COLUMNS = "columns";
- String PRIVATE_OWNED = PACKAGE_ + "PrivateOwned";
- String READ_ONLY = PACKAGE_ + "ReadOnly";
- String READ_TRANSFORMER = PACKAGE_ + "ReadTransformer";
- String READ_TRANSFORMER__TRANSFORMER_CLASS = "transformerClass";
- String READ_TRANSFORMER__METHOD = "method";
- String STRUCT_CONVERTER = PACKAGE_ + "StructConverter";
- String STRUCT_CONVERTER__NAME = "name";
- String STRUCT_CONVERTER__CONVERTER = "converter";
- String TIME_OF_DAY = PACKAGE_ + "TimeOfDay";
- String TIME_OF_DAY__HOUR = "hour";
- String TIME_OF_DAY__MINUTE = "minute";
- String TIME_OF_DAY__SECOND = "second";
- String TIME_OF_DAY__MILLISECOND = "millisecond";
- String TRANSFORMATION = PACKAGE_ + "Transformation";
- String TRANSFORMATION__FETCH = "fetch";
- String TRANSFORMATION__OPTIONAL = "optional";
- String TYPE_CONVERTER = PACKAGE_ + "TypeConverter";
- String TYPE_CONVERTER__NAME = "name";
- String TYPE_CONVERTER__DATA_TYPE = "dataType";
- String TYPE_CONVERTER__OBJECT_TYPE = "objectType";
- String VARIABLE_ONE_TO_ONE = PACKAGE_ + "VariableOneToOne";
- String WRITE_TRANSFORMER = PACKAGE_ + "WriteTransformer";
- String WRITE_TRANSFORMER__TRANSFORMER_CLASS = "transformerClass";
- String WRITE_TRANSFORMER__METHOD = "method";
- String WRITE_TRANSFORMER__COLUMN = "column";
- String WRITE_TRANSFORMERS = PACKAGE_ + "WriteTransformers";
- String WRITE_TRANSFORMERS__VALUE = "value";
-
- // EclipseLink enums
- String CACHE_COORDINATION_TYPE = PACKAGE_ + "CacheCoordinationType";
- String CACHE_COORDINATION_TYPE_ = CACHE_COORDINATION_TYPE + ".";
- String CACHE_COORDINATION_TYPE__SEND_OBJECT_CHANGES = CACHE_COORDINATION_TYPE_ + "SEND_OBJECT_CHANGES";
- String CACHE_COORDINATION_TYPE__INVALIDATE_CHANGED_OBJECTS = CACHE_COORDINATION_TYPE_ + "INVALIDATE_CHANGED_OBJECTS";
- String CACHE_COORDINATION_TYPE__SEND_NEW_OBJECTS_WITH_CHANGES = CACHE_COORDINATION_TYPE_ + "SEND_NEW_OBJECTS_WITH_CHANGES";
- String CACHE_COORDINATION_TYPE__NONE = CACHE_COORDINATION_TYPE_ + "NONE";
- String CACHE_TYPE = PACKAGE_ + "CacheType";
- String CACHE_TYPE_ = CACHE_TYPE + ".";
- String CACHE_TYPE__FULL = CACHE_TYPE_ + "FULL";
- String CACHE_TYPE__WEAK = CACHE_TYPE_ + "WEAK";
- String CACHE_TYPE__SOFT = CACHE_TYPE_ + "SOFT";
- String CACHE_TYPE__SOFT_WEAK = CACHE_TYPE_ + "SOFT_WEAK";
- String CACHE_TYPE__HARD_WEAK = CACHE_TYPE_ + "HARD_WEAK";
- String CACHE_TYPE__CACHE = CACHE_TYPE_ + "CACHE";
- String CACHE_TYPE__NONE = CACHE_TYPE_ + "NONE";
- String CHANGE_TRACKING_TYPE = PACKAGE_ + "ChangeTrackingType";
- String CHANGE_TRACKING_TYPE_ = CHANGE_TRACKING_TYPE + ".";
- String CHANGE_TRACKING_TYPE__ATTRIBUTE = CHANGE_TRACKING_TYPE_ + "ATTRIBUTE";
- String CHANGE_TRACKING_TYPE__OBJECT = CHANGE_TRACKING_TYPE_ + "OBJECT";
- String CHANGE_TRACKING_TYPE__DEFERRED = CHANGE_TRACKING_TYPE_ + "DEFERRED";
- String CHANGE_TRACKING_TYPE__AUTO = CHANGE_TRACKING_TYPE_ + "AUTO";
- String EXISTENCE_TYPE = PACKAGE_ + "ExistenceType";
- String EXISTENCE_TYPE_ = EXISTENCE_TYPE + ".";
- String EXISTENCE_TYPE__CHECK_CACHE = EXISTENCE_TYPE_ + "CHECK_CACHE";
- String EXISTENCE_TYPE__CHECK_DATABASE = EXISTENCE_TYPE_ + "CHECK_DATABASE";
- String EXISTENCE_TYPE__ASSUME_EXISTENCE = EXISTENCE_TYPE_ + "ASSUME_EXISTENCE";
- String EXISTENCE_TYPE__ASSUME_NON_EXISTENCE = EXISTENCE_TYPE_ + "ASSUME_NON_EXISTENCE";
- String JOIN_FETCH_TYPE = PACKAGE_ + "JoinFetchType";
- String JOIN_FETCH_TYPE_ = JOIN_FETCH_TYPE + ".";
- String JOIN_FETCH_TYPE__INNER = JOIN_FETCH_TYPE_ + "INNER";
- String JOIN_FETCH_TYPE__OUTER = JOIN_FETCH_TYPE_ + "OUTER";
-
-
- // EclispeLink 2.0 annotations
- String MAP_KEY_CONVERT = PACKAGE_ + "MapKeyConvert";
- String MAP_KEY_CONVERT__VALUE = "value";
-
-
- // EclispeLink 2.1 annotations
- String CLASS_EXTRACTOR = PACKAGE_ + "ClassExtractor";
- String CLASS_EXTRACTOR__VALUE = "value";
-
-
- // EclispeLink 2.2 annotations
- String CACHE__ISOLATION = "isolation";
- String CONVERTERS = PACKAGE_ + "Converters";
- String CONVERTERS__VALUE = "value";
- String OBJECT_TYPE_CONVERTERS = PACKAGE_ + "ObjectTypeConverters";
- String OBJECT_TYPE_CONVERTERS__VALUE = "value";
- String STRUCT_CONVERTERS = PACKAGE_ + "StructConverters";
- String STRUCT_CONVERTERS__VALUE = "value";
- String TYPE_CONVERTERS = PACKAGE_ + "TypeConverters";
- String TYPE_CONVERTERS__VALUE = "value";
-
- // EclipseLink 2.2 enums
- String CACHE_ISOLATION_TYPE = "org.eclipse.persistence.config.CacheIsolationType";
- String CACHE_ISOLATION_TYPE_ = CACHE_ISOLATION_TYPE + ".";
- String CACHE_ISOLATION_TYPE__SHARED = CACHE_ISOLATION_TYPE_ + "SHARED";
- String CACHE_ISOLATION_TYPE__PROTECTED = CACHE_ISOLATION_TYPE_ + "PROTECTED";
- String CACHE_ISOLATION_TYPE__ISOLATED = CACHE_ISOLATION_TYPE_ + "ISOLATED";
-
-
- // EclispeLink 2.3 annotations
-
- String ARRAY = PACKAGE_ + "Array";
-
- String MULTITENANT = PACKAGE_ + "Multitenant";
- String MULTITENANT__VALUE = "value";
-
- String MULTITENANT_TYPE = PACKAGE_ + "MultitenantType";
- String MULTITENANT_TYPE_ = MULTITENANT_TYPE + ".";
- String MULTITENANT_TYPE__SINGLE_TABLE = MULTITENANT_TYPE_ + "SINGLE_TABLE";
- String MULTITENANT_TYPE__TABLE_PER_TENANT = MULTITENANT_TYPE_ + "TABLE_PER_TENANT";
- String MULTITENANT_TYPE__VPD = MULTITENANT_TYPE_ + "VPD";
-
- String STRUCTURE = PACKAGE_ + "Structure";
-
- String TENANT_DISCRIMINATOR_COLUMN = PACKAGE_ + "TenantDiscriminatorColumn";
- String TENANT_DISCRIMINATOR_COLUMN__NAME = "name";
- String TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY = "contextProperty";
- String TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = "discriminatorType";
- String TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = "columnDefinition";
- String TENANT_DISCRIMINATOR_COLUMN__LENGTH = "length";
- String TENANT_DISCRIMINATOR_COLUMN__TABLE = "table";
- String TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY = "primaryKey";
-
- String TENANT_DISCRIMINATOR_COLUMNS = PACKAGE_ + "TenantDiscriminatorColumns";
- String TENANT_DISCRIMINATOR_COLUMNS__VALUE = "value";
-
-
- // EclispeLink 2.4 annotations
- String MULTITENANT__INCLUDE_CRITERIA = "includeCriteria";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkArrayAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkArrayAnnotation2_3.java
deleted file mode 100644
index 75ccdbf9a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkArrayAnnotation2_3.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.Array
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkArrayAnnotation2_3
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.ARRAY;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBaseConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBaseConvertAnnotation.java
deleted file mode 100644
index 3ce1026d7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBaseConvertAnnotation.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Common protocol among:<code><ul>
- * <li>org.eclipse.persistence.annotations.Convert
- * <li>org.eclipse.persistence.annotations.MapKeyConvert
- * </ul></code>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkBaseConvertAnnotation
- extends Annotation
-{
- /**
- * Corresponds to the 'value' element of the Convert annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Convert annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Convert annotation.
- */
- TextRange getValueTextRange();
-
- /**
- * Return whether the specified position touches the 'value' element.
- * Return false if the element does not exist.
- */
- boolean valueTouches(int pos);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBaseTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBaseTypeConverterAnnotation.java
deleted file mode 100644
index a5c1433fea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBaseTypeConverterAnnotation.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Common protocol among:<code><ul>
- * <li>org.eclipse.persistence.annotations.TypeConverter
- * <li>org.eclipse.persistence.annotations.ObjectTypeConverter
- * </ul></code>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkBaseTypeConverterAnnotation
- extends EclipseLinkNamedConverterAnnotation
-{
- /**
- * Corresponds to the 'dataType' element of the TypeConverter annotation.
- * Returns null if the element does not exist in Java.
- */
- String getDataType();
- String DATA_TYPE_PROPERTY = "dataType"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'dataType' element of the TypeConverter annotation.
- * Set to null to remove the element.
- */
- void setDataType(String dataType);
-
- /**
- * Return the {@link TextRange} for the 'dataType' element. If the element
- * does not exist return the {@link TextRange} for the TypeConverter annotation.
- */
- TextRange getDataTypeTextRange();
-
- /**
- * Return the fully-qualified data type name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;TypeConverter(dataType = MyDataType.class)
- * </pre>
- * will return <code>"model.MyDataType"</code> if there is an import for
- * <code>model.MyDataType</code>.
- */
- String getFullyQualifiedDataType();
-
- /**
- * Corresponds to the 'objectType' element of the TypeConverter annotation.
- * Returns null if the element does not exist in Java.
- */
- String getObjectType();
- String OBJECT_TYPE_PROPERTY = "objectType"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'objectType' element of the TypeConverter annotation.
- * Set to null to remove the element.
- */
- void setObjectType(String objectType);
-
- /**
- * Return the {@link TextRange} for the 'objectType' element. If the element
- * does not exist return the {@link TextRange} for the TypeConverter annotation.
- */
- TextRange getObjectTypeTextRange();
-
- /**
- * Return the fully-qualified object type name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;TypeConverter(dataType = MyObjectType.class)
- * </pre>
- * will return <code>"model.MyObjectType"</code> if there is an import for
- * <code>model.MyObjectType</code>.
- */
- String getFullyQualifiedObjectType();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java
deleted file mode 100644
index ee73c4fa67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicCollectionAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.BasicCollection
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkBasicCollectionAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.BASIC_COLLECTION;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java
deleted file mode 100644
index 9a12bd45b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkBasicMapAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-
-/**
- * Corresponds to the Eclipselink annotation
- * org.eclipse.persistence.annotations.BasicMap
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkBasicMapAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.BASIC_MAP;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java
deleted file mode 100644
index 8a87266344..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCacheAnnotation.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.Cache</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkCacheAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.CACHE;
-
- /**
- * Corresponds to the 'type' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- CacheType getType();
- String TYPE_PROPERTY = "type"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'type' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setType(CacheType type);
-
- /**
- * Return the {@link TextRange} for the 'type' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getTypeTextRange();
-
-
- /**
- * Corresponds to the 'size' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getSize();
- String SIZE_PROPERTY = "size"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'size' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setSize(Integer size);
-
- /**
- * Return the {@link TextRange} for the 'size' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getSizeTextRange();
-
-
- /**
- * Corresponds to the 'shared' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getShared();
- String SHARED_PROPERTY = "shared"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'shared' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setShared(Boolean shared);
-
- /**
- * Return the {@link TextRange} for the 'shared' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getSharedTextRange();
-
-
- /**
- * Corresponds to the 'expiry' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Integer getExpiry();
- String EXPIRY_PROPERTY = "expiry"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'expiry' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setExpiry(Integer expiry);
-
- /**
- * Return the {@link TextRange} for the 'expiry' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getExpiryTextRange();
-
-
- /**
- * Corresponds to the 'expiryTimeOfDay' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- EclipseLinkTimeOfDayAnnotation getExpiryTimeOfDay();
- String EXPIRY_TIME_OF_DAY_PROPERTY = "expiryTimeOfDay"; //$NON-NLS-1$
-
- EclipseLinkTimeOfDayAnnotation addExpiryTimeOfDay();
-
- void removeExpiryTimeOfDay();
-
- /**
- * Return the {@link TextRange} for the 'expiryTimeOfDay' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getExpiryTimeOfDayTextRange();
-
-
- /**
- * Corresponds to the 'alwaysRefresh' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getAlwaysRefresh();
- String ALWAYS_REFRESH_PROPERTY = "alwaysRefresh"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'alwaysRefresh' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setAlwaysRefresh(Boolean alwaysRefresh);
-
- /**
- * Return the {@link TextRange} for the 'alwaysRefresh' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getAlwaysRefreshTextRange();
-
-
- /**
- * Corresponds to the 'refreshOnlyIfNewer' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getRefreshOnlyIfNewer();
- String REFRESH_ONLY_IF_NEWER_PROPERTY = "refreshOnlyIfNewer"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'refreshOnlyIfNewer' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setRefreshOnlyIfNewer(Boolean refreshOnlyIfNewer);
-
- /**
- * Return the {@link TextRange} for the 'refreshOnlyIfNewer' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getRefreshOnlyIfNewerTextRange();
-
-
- /**
- * Corresponds to the 'disableHits' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getDisableHits();
- String DISABLE_HITS_PROPERTY = "disableHits"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'disableHits' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setDisableHits(Boolean disableHits);
-
- /**
- * Return the {@link TextRange} for the 'disableHits' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getDisableHitsTextRange();
-
-
- /**
- * Corresponds to the 'coordinationType' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- CacheCoordinationType getCoordinationType();
- String COORDINATION_TYPE_PROPERTY = "coordinationType"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'coordinationType' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setCoordinationType(CacheCoordinationType coordinationType);
-
- /**
- * Return the {@link TextRange} for the 'coordinationType' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getCoordinationTypeTextRange();
-
-
- /**
- * Corresponds to the 'isolation' element of the Cache annotation.
- * Return null if the element does not exist in Java.
- */
- CacheIsolationType2_2 getIsolation();
- String ISOLATION_PROPERTY = "isolation"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'isolation' element of the Cache annotation.
- * Set to null to remove the element.
- */
- void setIsolation(CacheIsolationType2_2 isolation);
-
- /**
- * Return the {@link TextRange} for the 'isolation' element.
- * If the element does not exist return the {@link TextRange}
- * for the Cache annotation.
- */
- TextRange getIsolationTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java
deleted file mode 100644
index cfb6167144..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkChangeTrackingAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.ChangeTracking</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkChangeTrackingAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.CHANGE_TRACKING;
-
- /**
- * Corresponds to the 'value' element of the ChangeTracking annotation.
- * Return null if the element does not exist in Java.
- */
- ChangeTrackingType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the ChangeTracking annotation.
- * Set to null to remove the element.
- */
- void setValue(ChangeTrackingType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the ChangeTracking annotation.
- */
- TextRange getValueTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkClassExtractorAnnotation2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkClassExtractorAnnotation2_1.java
deleted file mode 100644
index 3780478606..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkClassExtractorAnnotation2_1.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.ClassExtractor</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 2.3
- */
-public interface EclipseLinkClassExtractorAnnotation2_1
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.CLASS_EXTRACTOR;
-
- /**
- * Corresponds to the 'value' element of the ClassExtractor annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;ClassExtractor(value=MyExtractor.class)
- * </pre>
- * will return "MyExtractor"
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the ClassExtractor annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the ClassExtractor annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
- /**
- * Return the fully-qualified class name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;ClassExtractor(MyExtractor.class)
- * </pre>
- * will return <code>"model.MyExtractor"</code> if there is an import for
- * <code>model.MyExtractor</code>.
- */
- String getFullyQualifiedClassName();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java
deleted file mode 100644
index 5b902d96c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConversionValueAnnotation.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.ConversionValue</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkConversionValueAnnotation
- extends NestableAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.CONVERSION_VALUE;
-
- /**
- * Corresponds to the 'dataValue' element of the ConversionValue annotation.
- * Return null if the element does not exist in Java.
- */
- String getDataValue();
- String DATA_VALUE_PROPERTY = "dataValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'dataValue' element of the ConversionValue annotation.
- * Set to null to remove the element.
- */
- void setDataValue(String dataValue);
-
- /**
- * Return the {@link TextRange} for the 'dataValue' element. If the element
- * does not exist return the {@link TextRange} for the ConversionValue annotation.
- */
- TextRange getDataValueTextRange();
-
-
- /**
- * Corresponds to the 'objectValue' element of the ConversionValue annotation.
- * Return null if the element does not exist in Java.
- */
- String getObjectValue();
- String OBJECT_VALUE_PROPERTY = "objectValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'objectValue' element of the ConversionValue annotation.
- * Set to null to remove the element.
- */
- void setObjectValue(String objectValue);
-
- /**
- * Return the {@link TextRange} for the 'objectValue' element. If the element
- * does not exist return the {@link TextRange} for the ConversionValue annotation.
- */
- TextRange getObjectValueTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java
deleted file mode 100644
index e2d4ebb2e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConvertAnnotation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.Convert</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkConvertAnnotation
- extends EclipseLinkBaseConvertAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.CONVERT;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java
deleted file mode 100644
index d9b57c8e29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkConverterAnnotation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.Converter</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkConverterAnnotation
- extends EclipseLinkNamedConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.CONVERTER;
-
- /**
- * Corresponds to the 'converterClass' element of the Converter annotation.
- * Returns null if the element does not exist in java.
- */
- String getConverterClass();
- String CONVERTER_CLASS_PROPERTY = "converterClass"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'converterClass' element of the Converter annotation.
- * Set to null to remove the element.
- */
- void setConverterClass(String value);
-
- /**
- * Return the fully-qualified converter class name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;Converter(GenderConverter.class)
- * </pre>
- * will return <code>"model.GenderConverter"</code> if there is an import for
- * <code>model.GenderConverter</code>.
- */
- String getFullyQualifiedConverterClassName();
-
- /**
- * Return the {@link TextRange} for the 'converterClass' element. If the element
- * does not exist return the {@link TextRange} for the Converter annotation.
- */
- TextRange getConverterClassTextRange();
-
- /**
- * Return whether the converter class implements the specified interface.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter#ECLIPSELINK_CONVERTER_CLASS_NAME
- */
- boolean converterClassImplementsInterface(String interfaceName, CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java
deleted file mode 100644
index d705533cf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkCustomizerAnnotation.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.Customizer</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- */
-public interface EclipseLinkCustomizerAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.CUSTOMIZER;
-
- /**
- * Corresponds to the 'value' element of the Customizer annotation.
- * Return null if the element does not exist in Java.
- */
- String getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Customizer annotation.
- * Set to null to remove the element.
- */
- void setValue(String value);
-
- /**
- * Return the fully-qualified customizer class name as resolved by the
- * AST's bindings.
- * <pre>
- * &#64;Customizer(EmployeeCustomizer.class)
- * </pre>
- * will return <code>"model.EmployeeCustomizer"</code> if there is an
- * import for <code>model.EmployeeCustomizer</code>.
- */
- String getFullyQualifiedCustomizerClassName();
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Customizer annotation.
- */
- TextRange getValueTextRange();
-
- /**
- * Return whether the customizer class implements the specified interface.
- * @see org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer#ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME
- */
- boolean customizerClassImplementsInterface(String interfaceName, CompilationUnit astRoot);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java
deleted file mode 100644
index e1fd381620..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkExistenceCheckingAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.ExistenceChecking</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkExistenceCheckingAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.EXISTENCE_CHECKING;
-
- /**
- * Corresponds to the 'value' element of the ExistenceChecking annotation.
- * Return null if the element does not exist in Java.
- */
- ExistenceType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the ExistenceChecking annotation.
- * Set to null to remove the element.
- */
- void setValue(ExistenceType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the ExistenceChecking annotation.
- */
- TextRange getValueTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java
deleted file mode 100644
index a4010e8980..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkJoinFetchAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.JoinFetch</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkJoinFetchAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.JOIN_FETCH;
-
- /**
- * Corresponds to the 'value' element of the JoinFetch annotation.
- * Return null if the element does not exist in Java.
- */
- JoinFetchType getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the JoinFetch annotation.
- * Set to null to remove the element.
- */
- void setValue(JoinFetchType value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the JoinFetch annotation.
- */
- TextRange getValueTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMapKeyConvertAnnotation2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMapKeyConvertAnnotation2_0.java
deleted file mode 100644
index 973b35c559..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMapKeyConvertAnnotation2_0.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.MapKeyConvert</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface EclipseLinkMapKeyConvertAnnotation2_0
- extends EclipseLinkBaseConvertAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.MAP_KEY_CONVERT;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMultitenantAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMultitenantAnnotation2_3.java
deleted file mode 100644
index 7cf96e0e02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMultitenantAnnotation2_3.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.Multitenant
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface EclipseLinkMultitenantAnnotation2_3
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.MULTITENANT;
-
- /**
- * Return whether the annotation exists in Java.
- */
- boolean isSpecified();
-
- /**
- * Corresponds to the 'value' element of the Multitenant annotation.
- * Return null if the element does not exist in Java.
- */
- MultitenantType2_3 getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Multitenant annotation.
- * Set to null to remove the element.
- */
- void setValue(MultitenantType2_3 value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Multitenant annotation.
- */
- TextRange getValueTextRange(CompilationUnit astRoot);
-
-
- //********* include criteria added in EclipseLink 2.4 **********
- /**
- * Corresponds to the 'includeCriteria' element of the Multitenant annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getIncludeCriteria();
- String INCLUDE_CRITERIA_PROPERTY = "includeCriteria"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'includeCriteria' element of the Multitenant annotation.
- * Set to null to remove the element.
- */
- void setIncludeCriteria(Boolean includeCriteria);
-
- /**
- * Return the {@link TextRange} for the 'includeCriteria' element.
- * If the element does not exist return the {@link TextRange}
- * for the Multitenant annotation.
- */
- TextRange getIncludeCriteriaTextRange(CompilationUnit astRoot);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java
deleted file mode 100644
index e80842373d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkMutableAnnotation.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the Eclipselink annotation
- * <code>org.eclipse.persistence.annotations.Mutable</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkMutableAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.MUTABLE;
-
- /**
- * Corresponds to the 'value' element of the Mutable annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getValue();
- String VALUE_PROPERTY = "value"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'value' element of the Mutable annotation.
- * Set to null to remove the element.
- */
- void setValue(Boolean value);
-
- /**
- * Return the {@link TextRange} for the 'value' element. If the element
- * does not exist return the {@link TextRange} for the Mutable annotation.
- */
- TextRange getValueTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java
deleted file mode 100644
index 28e47984a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkNamedConverterAnnotation.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Common protocol among:<code><ul>
- * <li>org.eclipse.persistence.annotations.Converter
- * <li>org.eclipse.persistence.annotations.StructConverter
- * <li>org.eclipse.persistence.annotations.TypeConverter
- * <li>org.eclipse.persistence.annotations.ObjectTypeConverter
- * </ul></code>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- */
-public interface EclipseLinkNamedConverterAnnotation
- extends NestableAnnotation
-{
- /**
- * Corresponds to the 'name' element of the *Converter annotation.
- * Return null if the element does not exist in Java.
- */
- String getName();
- String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'name' element of the *Converter annotation.
- * Set to null to remove the element.
- */
- void setName(String value);
-
- /**
- * Return the {@link TextRange} for the 'name' element. If the element
- * does not exist return the {@link TextRange} for the CustomConverter annotation.
- */
- TextRange getNameTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java
deleted file mode 100644
index bd99c847bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkObjectTypeConverterAnnotation.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.ObjectTypeConverter</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkObjectTypeConverterAnnotation
- extends EclipseLinkBaseTypeConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.OBJECT_TYPE_CONVERTER;
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- * Return an empty iterator if the element does not exist in Java.
- */
- ListIterable<EclipseLinkConversionValueAnnotation> getConversionValues();
- String CONVERSION_VALUES_LIST = "conversionValues"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- int getConversionValuesSize();
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- EclipseLinkConversionValueAnnotation conversionValueAt(int index);
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- EclipseLinkConversionValueAnnotation addConversionValue(int index);
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- void moveConversionValue(int targetIndex, int sourceIndex);
-
- /**
- * Corresponds to the 'conversionValues' element of the ObjectTypeConverter annotation.
- */
- void removeConversionValue(int index);
-
-
- /**
- * Corresponds to the 'defaultObjectValue' element of the ObjectTypeConverter annotation.
- * Return null if the element does not exist in Java.
- */
- String getDefaultObjectValue();
- String DEFAULT_OBJECT_VALUE_PROPERTY = "defaultObjectValue"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'defaultObjectValue' element of the ObjectTypeConverter annotation.
- * Set to null to remove the element.
- */
- void setDefaultObjectValue(String value);
-
- /**
- * Return the {@link TextRange} for the 'defaultObjectValue' element. If the element
- * does not exist return the {@link TextRange} for the ObjectTypeConverter annotation.
- */
- TextRange getDefaultObjectValueTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java
deleted file mode 100644
index 11a0731a06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrimaryKeyAnnotation.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.PrimaryKey
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- */
-public interface EclipseLinkPrimaryKeyAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.PRIMARY_KEY;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java
deleted file mode 100644
index ab96344b6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkPrivateOwnedAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.PrivateOwned
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkPrivateOwnedAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.PRIVATE_OWNED;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java
deleted file mode 100644
index a11da33e60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadOnlyAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.ReadOnly
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkReadOnlyAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.READ_ONLY;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java
deleted file mode 100644
index 6c568a3d75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkReadTransformerAnnotation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.ReadTransformer</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkReadTransformerAnnotation
- extends EclipseLinkTransformerAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.READ_TRANSFORMER;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java
deleted file mode 100644
index 2e6ebe0bd7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructConverterAnnotation.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.StructConverter</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkStructConverterAnnotation
- extends EclipseLinkNamedConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.STRUCT_CONVERTER;
-
- /**
- * Corresponds to the 'converter' element of the StructConverter annotation.
- * Returns null if the element does not exist in Java.
- */
- String getConverter();
- String CONVERTER_PROPERTY = "converter"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'converter' element of the StructConverter annotation.
- * Set to null to remove the element.
- */
- void setConverter(String converter);
-
- /**
- * Return the {@link TextRange} for the 'converter' element. If the element
- * does not exist return the {@link TextRange} for the StructConverter annotation.
- */
- TextRange getConverterTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructureAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructureAnnotation2_3.java
deleted file mode 100644
index cebba1ded5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkStructureAnnotation2_3.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * org.eclipse.persistence.annotations.Structure
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 3.2
- */
-public interface EclipseLinkStructureAnnotation2_3
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.STRUCTURE;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
deleted file mode 100644
index 909d6dd884..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.TenantDiscriminatorColumn</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public interface EclipseLinkTenantDiscriminatorColumnAnnotation2_3
- extends DiscriminatorColumnAnnotation, NestableAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.TENANT_DISCRIMINATOR_COLUMN;
-
- // ********** contextProperty **********
-
- /**
- * Corresponds to the 'contextProperty' element of the TenantDiscriminatorColumn annotation.
- * Return null if the element does not exist in Java.
- */
- String getContextProperty();
- String CONTEXT_PROPERTY_PROPERTY = "contextProperty"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'contextProperty' element of the TenantDiscriminatorColumn annotation.
- * Set to null to remove the element.
- */
- void setContextProperty(String contextProperty);
-
- /**
- * Return the {@link TextRange} for the 'contextProperty' element. If the element
- * does not exist return the {@link TextRange} for the TenantDiscriminatorColumn annotation.
- */
- TextRange getContextPropertyTextRange();
-
- // ********** table **********
-
- /**
- * Corresponds to the 'table' element of the TenantDiscriminatorColumn annotation.
- * Return null if the element does not exist in Java.
- */
- String getTable();
- String TABLE_PROPERTY = "table"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'table' element of the TenantDiscriminatorColumn annotation.
- * Set to null to remove the element.
- */
- void setTable(String table);
-
- /**
- * Return the {@link TextRange} for the 'table' element. If the element
- * does not exist return the {@link TextRange} for the TenantDiscriminatorColumn annotation.
- */
- TextRange getTableTextRange();
-
- /**
- * Return whether the specified position touches the 'table' element.
- * Return false if the element does not exist.
- */
- boolean tableTouches(int pos);
-
- // ********** primaryKey **********
-
- /**
- * Corresponds to the 'primaryKey' element of the TenantDiscriminatorColumn annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getPrimaryKey();
- String PRIMARY_KEY_PROPERTY = "primaryKey"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'primaryKey' element of the TenantDiscriminatorColumn annotation.
- * Set to null to remove the element.
- */
- void setPrimaryKey(Boolean primaryKey);
-
- /**
- * Return the {@link TextRange} for the 'primaryKey' element. If the element
- * does not exist return the {@link TextRange} for the TenantDiscriminatorColumn annotation.
- */
- TextRange getPrimaryKeyTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java
deleted file mode 100644
index 38902c7188..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTimeOfDayAnnotation.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.TimeOfDay</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTimeOfDayAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.TIME_OF_DAY;
-
-
- // ********** hour **********
-
- /**
- * Corresponds to the 'hour' element of the TimeOfDay annotation.
- * Return null if the element does not exist in the annotation.
- */
- Integer getHour();
- String HOUR_PROPERTY = "hour"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'hour' element of the TimeOfDay annotation.
- * Set to null to remove the element from the annotation
- */
- void setHour(Integer hour);
-
- /**
- * Return the {@link TextRange} for the 'hour' element. If the element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getHourTextRange();
-
-
- // ********** minute **********
-
- /**
- * Corresponds to the 'minute' element of the TimeOfDay annotation.
- * Return null if the element does not exist in the annotation.
- */
- Integer getMinute();
- String MINUTE_PROPERTY = "minute"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'minute' element of the TimeOfDay annotation.
- * Set to null to remove the element from the annotation
- */
- void setMinute(Integer minute);
-
- /**
- * Return the {@link TextRange} for the 'minute' element. If the element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getMinuteTextRange();
-
-
- // ********** second **********
-
- /**
- * Corresponds to the 'second' element of the TimeOfDay annotation.
- * Return null if the element does not exist in the annotation.
- */
- Integer getSecond();
- String SECOND_PROPERTY = "second"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'second' element of the TimeOfDay annotation.
- * Set to null to remove the element from the annotation
- */
- void setSecond(Integer second);
-
- /**
- * Return the {@link TextRange} for the 'second' element. If the element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getSecondTextRange();
-
-
- // ********** millisecond **********
-
- /**
- * Corresponds to the 'millisecond' element of the TimeOfDay annotation.
- * Return null if the element does not exist in the annotation.
- */
- Integer getMillisecond();
- String MILLISECOND_PROPERTY = "millisecond"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'millisecond' element of the TimeOfDay annotation.
- * Set to null to remove the element from the annotation
- */
- void setMillisecond(Integer millisecond);
-
- /**
- * Return the {@link TextRange} for the 'millisecond' element. If the element
- * does not exist return the {@link TextRange} for the TimeOfDay annotation.
- */
- TextRange getMillisecondTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java
deleted file mode 100644
index 767f0a07ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformationAnnotation.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.Transformation</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTransformationAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.TRANSFORMATION;
-
- /**
- * Corresponds to the 'fetch' element of the Transformation annotation.
- * Return null if the element does not exist in Java.
- */
- FetchType getFetch();
- String FETCH_PROPERTY = "fetch"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'fetch' element of the Transformation annotation.
- * Set to null to remove the element.
- */
- void setFetch(FetchType fetch);
-
- /**
- * Return the {@link TextRange} for the 'fetch' element. If the element
- * does not exist return the {@link TextRange} for the Transformation annotation.
- */
- TextRange getFetchTextRange();
-
-
- /**
- * Corresponds to the 'optional' element of the Transformation annotation.
- * Return null if the element does not exist in Java.
- */
- Boolean getOptional();
- String OPTIONAL_PROPERTY = "optional"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'optional' element of the Transformation annotation.
- * Set to null to remove the element.
- */
- void setOptional(Boolean optional);
-
- /**
- * Return the {@link TextRange} for the 'optional' element. If the element
- * does not exist return the {@link TextRange} for the Transformation annotation.
- */
- TextRange getOptionalTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java
deleted file mode 100644
index d0c0e561cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTransformerAnnotation.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-/**
- * Common protocol among:<code><ul>
- * <li>org.eclipse.persistence.annotations.ReadTransformer
- * <li>org.eclipse.persistence.annotations.WriteTransformer
- * </ul></code>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTransformerAnnotation
- extends Annotation
-{
- /**
- * Corresponds to the 'transformerClass' element of the *Transformer annotation.
- * Return null if the element does not exist in Java.
- * Return the portion of the value preceding ".class".
- * <pre>
- * &#64;ReadTransformer(transformerClass=Employee.class)
- * </pre>
- * will return "Employee".
- */
- String getTransformerClass();
- String TRANSFORMER_CLASS_PROPERTY = "transformerClass"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'transformerClass' element of the *Transformer annotation.
- * Set to null to remove the element.
- */
- void setTransformerClass(String transformerClass);
-
- /**
- * Return the {@link TextRange} for the 'transformerClass' element. If the element
- * does not exist return the {@link TextRange} for the *Transformer annotation.
- */
- TextRange getTransformerClassTextRange();
-
-
- /**
- * Corresponds to the 'method' element of the *Transformer annotation.
- * Return null if the element does not exist in Java.
- */
- String getMethod();
- String METHOD_PROPERTY = "method"; //$NON-NLS-1$
-
- /**
- * Corresponds to the 'method' element of the *Transformer annotation.
- * Set to null to remove the element.
- */
- void setMethod(String method);
-
- /**
- * Return the {@link TextRange} for the 'method' element. If the element
- * does not exist return the {@link TextRange} for the *Transformer annotation.
- */
- TextRange getMethodTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java
deleted file mode 100644
index 044c4ab14e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkTypeConverterAnnotation.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink annotation
- * <code>org.eclipse.persistence.annotations.TypeConverter</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkTypeConverterAnnotation
- extends EclipseLinkBaseTypeConverterAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.TYPE_CONVERTER;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java
deleted file mode 100644
index 91e3f4fd2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkVariableOneToOneAnnotation.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-
-/**
- * Corresponds to EclipseLink annotation
- * org.eclipse.persistence.annotations.VariableOneToOne
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- */
-public interface EclipseLinkVariableOneToOneAnnotation
- extends Annotation
-{
- String ANNOTATION_NAME = EclipseLink.VARIABLE_ONE_TO_ONE;
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java
deleted file mode 100644
index 198dee55da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/EclipseLinkWriteTransformerAnnotation.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-
-/**
- * Corresponds to the Eclipselink annotation
- * <code>org.eclipse.persistence.annotations.WriteTransformer</code>
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public interface EclipseLinkWriteTransformerAnnotation
- extends EclipseLinkTransformerAnnotation
-{
- String ANNOTATION_NAME = EclipseLink.WRITE_TRANSFORMER;
-
- /**
- * Corresponds to the 'column' element of the WriteTransformer annotation.
- * Return null if the element does not exist in Java.
- */
- ColumnAnnotation getColumn();
- String COLUMN_PROPERTY = "column"; //$NON-NLS-1$
-
- /**
- * Return a ColumnAnnotation, but do not return null if the 'column'
- * element does not exist on the WriteTransformer annotation. Instead
- * return a null object.
- */
- ColumnAnnotation getNonNullColumn();
-
- /**
- * Add the 'column' element to the WriteTransformer annotation.
- */
- ColumnAnnotation addColumn();
-
- /**
- * Remove the 'column' element from the WriteTransformer annotation.
- */
- void removeColumn();
-
- /**
- * Return the {@link TextRange} for the 'column' element. If the element
- * does not exist return the {@link TextRange} for the WriteTransformer annotation.
- */
- TextRange getColumnTextRange();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ExistenceType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ExistenceType.java
deleted file mode 100644
index 52782728a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/ExistenceType.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.ExistenceType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum ExistenceType {
-
- CHECK_CACHE(EclipseLink.EXISTENCE_TYPE__CHECK_CACHE),
- CHECK_DATABASE(EclipseLink.EXISTENCE_TYPE__CHECK_DATABASE),
- ASSUME_EXISTENCE(EclipseLink.EXISTENCE_TYPE__ASSUME_EXISTENCE),
- ASSUME_NON_EXISTENCE(EclipseLink.EXISTENCE_TYPE__ASSUME_NON_EXISTENCE);
-
-
- private String javaAnnotationValue;
-
- ExistenceType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static ExistenceType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static ExistenceType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (ExistenceType existenceType : ExistenceType.values()) {
- if (existenceType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return existenceType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(ExistenceType existenceType) {
- return (existenceType == null) ? null : existenceType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/JoinFetchType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/JoinFetchType.java
deleted file mode 100644
index 6ebf81d55c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/JoinFetchType.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-/**
- * Corresponds to the EclipseLink enum
- * org.eclipse.persistence.annotations.JoinFetchType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public enum JoinFetchType {
-
- INNER(EclipseLink.JOIN_FETCH_TYPE__INNER),
- OUTER(EclipseLink.JOIN_FETCH_TYPE__OUTER);
-
-
- private String javaAnnotationValue;
-
- JoinFetchType(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static JoinFetchType fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static JoinFetchType fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (JoinFetchType joinFetchType : JoinFetchType.values()) {
- if (joinFetchType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return joinFetchType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(JoinFetchType joinFetchType) {
- return (joinFetchType == null) ? null : joinFetchType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/MultitenantType2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/MultitenantType2_3.java
deleted file mode 100644
index 2164eba36e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/java/MultitenantType2_3.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.java;
-
-
-/**
- * Corresponds to the EclipseLink JPA enum
- * org.eclipse.persistence.annotations.MultitenantType
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.1
- * @since 3.1
- */
-public enum MultitenantType2_3 {
-
- SINGLE_TABLE(EclipseLink.MULTITENANT_TYPE__SINGLE_TABLE),
- TABLE_PER_TENANT(EclipseLink.MULTITENANT_TYPE__TABLE_PER_TENANT),
- VPD(EclipseLink.MULTITENANT_TYPE__VPD);
-
-
- private String javaAnnotationValue;
-
- MultitenantType2_3(String javaAnnotationValue) {
- if (javaAnnotationValue == null) {
- throw new NullPointerException();
- }
- this.javaAnnotationValue = javaAnnotationValue;
- }
-
- public String getJavaAnnotationValue() {
- return this.javaAnnotationValue;
- }
-
-
- // ********** static methods **********
-
- public static MultitenantType2_3 fromJavaAnnotationValue(Object javaAnnotationValue) {
- return (javaAnnotationValue == null) ? null : fromJavaAnnotationValue_(javaAnnotationValue);
- }
-
- private static MultitenantType2_3 fromJavaAnnotationValue_(Object javaAnnotationValue) {
- for (MultitenantType2_3 multitenantType : MultitenantType2_3.values()) {
- if (multitenantType.getJavaAnnotationValue().equals(javaAnnotationValue)) {
- return multitenantType;
- }
- }
- return null;
- }
-
- public static String toJavaAnnotationValue(MultitenantType2_3 multitenantType) {
- return (multitenantType == null) ? null : multitenantType.getJavaAnnotationValue();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/Attributes.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/Attributes.java
deleted file mode 100644
index 94e3902367..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/Attributes.java
+++ /dev/null
@@ -1,535 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Attributes</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicCollections <em>Basic Collections</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicMaps <em>Basic Maps</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getTransformations <em>Transformations</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getVariableOneToOnes <em>Variable One To Ones</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes()
- * @model kind="class"
- * @generated
- */
-public class Attributes extends org.eclipse.jpt.jpa.core.resource.orm.Attributes implements XmlAttributes_2_3
-{
- /**
- * The cached value of the '{@link #getStructures() <em>Structures</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructures()
- * @generated
- * @ordered
- */
- protected EList<XmlStructure_2_3> structures;
-
- /**
- * The cached value of the '{@link #getArrays() <em>Arrays</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getArrays()
- * @generated
- * @ordered
- */
- protected EList<XmlArray_2_3> arrays;
-
- /**
- * The cached value of the '{@link #getBasicCollections() <em>Basic Collections</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBasicCollections()
- * @generated
- * @ordered
- */
- protected EList<XmlBasicCollection> basicCollections;
-
- /**
- * The cached value of the '{@link #getBasicMaps() <em>Basic Maps</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBasicMaps()
- * @generated
- * @ordered
- */
- protected EList<XmlBasicMap> basicMaps;
-
- /**
- * The cached value of the '{@link #getTransformations() <em>Transformations</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTransformations()
- * @generated
- * @ordered
- */
- protected EList<XmlTransformation> transformations;
-
- /**
- * The cached value of the '{@link #getVariableOneToOnes() <em>Variable One To Ones</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getVariableOneToOnes()
- * @generated
- * @ordered
- */
- protected EList<XmlVariableOneToOne> variableOneToOnes;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected Attributes()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.ATTRIBUTES;
- }
-
- /**
- * Returns the value of the '<em><b>Structures</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Structures</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Structures</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributes_2_3_Structures()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructure_2_3> getStructures()
- {
- if (structures == null)
- {
- structures = new EObjectContainmentEList<XmlStructure_2_3>(XmlStructure_2_3.class, this, EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES);
- }
- return structures;
- }
-
- /**
- * Returns the value of the '<em><b>Arrays</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Arrays</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Arrays</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributes_2_3_Arrays()
- * @model containment="true"
- * @generated
- */
- public EList<XmlArray_2_3> getArrays()
- {
- if (arrays == null)
- {
- arrays = new EObjectContainmentEList<XmlArray_2_3>(XmlArray_2_3.class, this, EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS);
- }
- return arrays;
- }
-
- /**
- * Returns the value of the '<em><b>Basic Collections</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Basic Collections</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Basic Collections</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_BasicCollections()
- * @model containment="true"
- * @generated
- */
- public EList<XmlBasicCollection> getBasicCollections()
- {
- if (basicCollections == null)
- {
- basicCollections = new EObjectContainmentEList<XmlBasicCollection>(XmlBasicCollection.class, this, EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS);
- }
- return basicCollections;
- }
-
- /**
- * Returns the value of the '<em><b>Basic Maps</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Basic Maps</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Basic Maps</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_BasicMaps()
- * @model containment="true"
- * @generated
- */
- public EList<XmlBasicMap> getBasicMaps()
- {
- if (basicMaps == null)
- {
- basicMaps = new EObjectContainmentEList<XmlBasicMap>(XmlBasicMap.class, this, EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS);
- }
- return basicMaps;
- }
-
- /**
- * Returns the value of the '<em><b>Transformations</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Transformations</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Transformations</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_Transformations()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTransformation> getTransformations()
- {
- if (transformations == null)
- {
- transformations = new EObjectContainmentEList<XmlTransformation>(XmlTransformation.class, this, EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS);
- }
- return transformations;
- }
-
- /**
- * Returns the value of the '<em><b>Variable One To Ones</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Variable One To Ones</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Variable One To Ones</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes_VariableOneToOnes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlVariableOneToOne> getVariableOneToOnes()
- {
- if (variableOneToOnes == null)
- {
- variableOneToOnes = new EObjectContainmentEList<XmlVariableOneToOne>(XmlVariableOneToOne.class, this, EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES);
- }
- return variableOneToOnes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- return ((InternalEList<?>)getStructures()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- return ((InternalEList<?>)getArrays()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- return ((InternalEList<?>)getBasicCollections()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- return ((InternalEList<?>)getBasicMaps()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- return ((InternalEList<?>)getTransformations()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- return ((InternalEList<?>)getVariableOneToOnes()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- return getStructures();
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- return getArrays();
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- return getBasicCollections();
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- return getBasicMaps();
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- return getTransformations();
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- return getVariableOneToOnes();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- getStructures().clear();
- getStructures().addAll((Collection<? extends XmlStructure_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- getArrays().clear();
- getArrays().addAll((Collection<? extends XmlArray_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- getBasicCollections().clear();
- getBasicCollections().addAll((Collection<? extends XmlBasicCollection>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- getBasicMaps().clear();
- getBasicMaps().addAll((Collection<? extends XmlBasicMap>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- getTransformations().clear();
- getTransformations().addAll((Collection<? extends XmlTransformation>)newValue);
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- getVariableOneToOnes().clear();
- getVariableOneToOnes().addAll((Collection<? extends XmlVariableOneToOne>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- getStructures().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- getArrays().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- getBasicCollections().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- getBasicMaps().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- getTransformations().clear();
- return;
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- getVariableOneToOnes().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES:
- return structures != null && !structures.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS:
- return arrays != null && !arrays.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_COLLECTIONS:
- return basicCollections != null && !basicCollections.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__BASIC_MAPS:
- return basicMaps != null && !basicMaps.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__TRANSFORMATIONS:
- return transformations != null && !transformations.isEmpty();
- case EclipseLinkOrmPackage.ATTRIBUTES__VARIABLE_ONE_TO_ONES:
- return variableOneToOnes != null && !variableOneToOnes.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAttributes_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES: return EclipseLinkOrmV2_3Package.XML_ATTRIBUTES_23__STRUCTURES;
- case EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS: return EclipseLinkOrmV2_3Package.XML_ATTRIBUTES_23__ARRAYS;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAttributes_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_ATTRIBUTES_23__STRUCTURES: return EclipseLinkOrmPackage.ATTRIBUTES__STRUCTURES;
- case EclipseLinkOrmV2_3Package.XML_ATTRIBUTES_23__ARRAYS: return EclipseLinkOrmPackage.ATTRIBUTES__ARRAYS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- @Override
- public List<XmlAttributeMapping> getAttributeMappings() {
- // convert lists to arrays to avoid ConcurrentModificationException while adding to result list
- ArrayList<XmlAttributeMapping> attributeMappings = new ArrayList<XmlAttributeMapping>();
- CollectionTools.addAll(attributeMappings, this.getIds().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getEmbeddedIds().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getBasics().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getBasicCollections().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getBasicMaps().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getVersions().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getManyToOnes().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getOneToManys().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getOneToOnes().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getVariableOneToOnes().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getManyToManys().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getElementCollections().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getEmbeddeds().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getTransformations().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getTransients().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getArrays().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- CollectionTools.addAll(attributeMappings, this.getStructures().toArray(EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY));
- return attributeMappings;
- }
-
- protected static final XmlAttributeMapping[] EMPTY_XML_ATTRIBUTE_MAPPING_ARRAY = new XmlAttributeMapping[0];
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getAttributes(),
- buildTranslatorChildren());
- }
-
- public static Translator buildTranslator() {
- return buildTranslator(
- EclipseLink.ATTRIBUTES,
- OrmPackage.eINSTANCE.getXmlTypeMapping_Attributes());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- XmlId.buildTranslator(EclipseLink2_0.ID, OrmPackage.eINSTANCE.getAttributes_Ids()),
- XmlEmbeddedId.buildTranslator(EclipseLink2_0.EMBEDDED_ID, OrmPackage.eINSTANCE.getAttributes_EmbeddedIds()),
- XmlBasic.buildTranslator(EclipseLink2_0.BASIC, OrmPackage.eINSTANCE.getAttributes_Basics()),
- XmlBasicCollection.buildTranslator(EclipseLink2_0.BASIC_COLLECTION, EclipseLinkOrmPackage.eINSTANCE.getAttributes_BasicCollections()),
- XmlBasicMap.buildTranslator(EclipseLink2_0.BASIC_MAP, EclipseLinkOrmPackage.eINSTANCE.getAttributes_BasicMaps()),
- XmlVersion.buildTranslator(EclipseLink2_0.VERSION, OrmPackage.eINSTANCE.getAttributes_Versions()),
- XmlManyToOne.buildTranslator(EclipseLink2_0.MANY_TO_ONE, OrmPackage.eINSTANCE.getAttributes_ManyToOnes()),
- XmlOneToMany.buildTranslator(EclipseLink2_0.ONE_TO_MANY, OrmPackage.eINSTANCE.getAttributes_OneToManys()),
- XmlOneToOne.buildTranslator(EclipseLink2_0.ONE_TO_ONE, OrmPackage.eINSTANCE.getAttributes_OneToOnes()),
- XmlVariableOneToOne.buildTranslator(EclipseLink2_0.VARIABLE_ONE_TO_ONE, EclipseLinkOrmPackage.eINSTANCE.getAttributes_VariableOneToOnes()),
- XmlManyToMany.buildTranslator(EclipseLink2_0.MANY_TO_MANY, OrmPackage.eINSTANCE.getAttributes_ManyToManys()),
- XmlElementCollection.buildTranslator(EclipseLink2_0.ELEMENT_COLLECTION, OrmV2_0Package.eINSTANCE.getXmlAttributes_2_0_ElementCollections()),
- XmlEmbedded.buildTranslator(EclipseLink2_0.EMBEDDED, OrmPackage.eINSTANCE.getAttributes_Embeddeds()),
- XmlTransformation.buildTranslator(EclipseLink2_0.TRANSFORMATION, EclipseLinkOrmPackage.eINSTANCE.getAttributes_Transformations()),
- XmlTransient.buildTranslator(EclipseLink2_0.TRANSIENT, OrmPackage.eINSTANCE.getAttributes_Transients()),
- XmlStructure.buildTranslator(EclipseLink2_3.STRUCTURE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlAttributes_2_3_Structures()),
- XmlArray.buildTranslator(EclipseLink2_3.ARRAY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlAttributes_2_3_Arrays()),
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheCoordinationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheCoordinationType.java
deleted file mode 100644
index ce93ec06d2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheCoordinationType.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the literals of the enumeration '<em><b>Cache Coordination Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheCoordinationType()
- * @model
- * @generated
- */
-public enum CacheCoordinationType implements Enumerator
-{
- /**
- * The '<em><b>SEND OBJECT CHANGES</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SEND_OBJECT_CHANGES_VALUE
- * @generated
- * @ordered
- */
- SEND_OBJECT_CHANGES(0, "SEND_OBJECT_CHANGES", "SEND_OBJECT_CHANGES"),
-
- /**
- * The '<em><b>INVALIDATE CHANGED OBJECTS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #INVALIDATE_CHANGED_OBJECTS_VALUE
- * @generated
- * @ordered
- */
- INVALIDATE_CHANGED_OBJECTS(1, "INVALIDATE_CHANGED_OBJECTS", "INVALIDATE_CHANGED_OBJECTS"),
-
- /**
- * The '<em><b>SEND NEW OBJECTS WITH CHANGES</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SEND_NEW_OBJECTS_WITH_CHANGES_VALUE
- * @generated
- * @ordered
- */
- SEND_NEW_OBJECTS_WITH_CHANGES(2, "SEND_NEW_OBJECTS_WITH_CHANGES", "SEND_NEW_OBJECTS_WITH_CHANGES"),
-
- /**
- * The '<em><b>NONE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NONE_VALUE
- * @generated
- * @ordered
- */
- NONE(3, "NONE", "NONE");
-
- /**
- * The '<em><b>SEND OBJECT CHANGES</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SEND OBJECT CHANGES</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SEND_OBJECT_CHANGES
- * @model
- * @generated
- * @ordered
- */
- public static final int SEND_OBJECT_CHANGES_VALUE = 0;
-
- /**
- * The '<em><b>INVALIDATE CHANGED OBJECTS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>INVALIDATE CHANGED OBJECTS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #INVALIDATE_CHANGED_OBJECTS
- * @model
- * @generated
- * @ordered
- */
- public static final int INVALIDATE_CHANGED_OBJECTS_VALUE = 1;
-
- /**
- * The '<em><b>SEND NEW OBJECTS WITH CHANGES</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SEND NEW OBJECTS WITH CHANGES</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SEND_NEW_OBJECTS_WITH_CHANGES
- * @model
- * @generated
- * @ordered
- */
- public static final int SEND_NEW_OBJECTS_WITH_CHANGES_VALUE = 2;
-
- /**
- * The '<em><b>NONE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NONE
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Cache Coordination Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final CacheCoordinationType[] VALUES_ARRAY =
- new CacheCoordinationType[]
- {
- SEND_OBJECT_CHANGES,
- INVALIDATE_CHANGED_OBJECTS,
- SEND_NEW_OBJECTS_WITH_CHANGES,
- NONE,
- };
-
- /**
- * A public read-only list of all the '<em><b>Cache Coordination Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<CacheCoordinationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Cache Coordination Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheCoordinationType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheCoordinationType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Coordination Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheCoordinationType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheCoordinationType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Coordination Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheCoordinationType get(int value)
- {
- switch (value)
- {
- case SEND_OBJECT_CHANGES_VALUE: return SEND_OBJECT_CHANGES;
- case INVALIDATE_CHANGED_OBJECTS_VALUE: return INVALIDATE_CHANGED_OBJECTS;
- case SEND_NEW_OBJECTS_WITH_CHANGES_VALUE: return SEND_NEW_OBJECTS_WITH_CHANGES;
- case NONE_VALUE: return NONE;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private CacheCoordinationType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //CacheCoordinationType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheType.java
deleted file mode 100644
index 2d35af2d10..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/CacheType.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheType()
- * @model
- * @generated
- */
-public enum CacheType implements Enumerator
-{
- /**
- * The '<em><b>FULL</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #FULL_VALUE
- * @generated
- * @ordered
- */
- FULL(0, "FULL", "FULL"),
-
- /**
- * The '<em><b>WEAK</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #WEAK_VALUE
- * @generated
- * @ordered
- */
- WEAK(1, "WEAK", "WEAK"),
-
- /**
- * The '<em><b>SOFT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SOFT_VALUE
- * @generated
- * @ordered
- */
- SOFT(2, "SOFT", "SOFT"),
-
- /**
- * The '<em><b>SOFT WEAK</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SOFT_WEAK_VALUE
- * @generated
- * @ordered
- */
- SOFT_WEAK(3, "SOFT_WEAK", "SOFT_WEAK"),
-
- /**
- * The '<em><b>HARD WEAK</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #HARD_WEAK_VALUE
- * @generated
- * @ordered
- */
- HARD_WEAK(4, "HARD_WEAK", "HARD_WEAK"),
-
- /**
- * The '<em><b>CACHE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CACHE_VALUE
- * @generated
- * @ordered
- */
- CACHE(5, "CACHE", "CACHE"),
-
- /**
- * The '<em><b>NONE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NONE_VALUE
- * @generated
- * @ordered
- */
- NONE(6, "NONE", "NONE");
-
- /**
- * The '<em><b>FULL</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>FULL</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #FULL
- * @model
- * @generated
- * @ordered
- */
- public static final int FULL_VALUE = 0;
-
- /**
- * The '<em><b>WEAK</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>WEAK</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #WEAK
- * @model
- * @generated
- * @ordered
- */
- public static final int WEAK_VALUE = 1;
-
- /**
- * The '<em><b>SOFT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SOFT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SOFT
- * @model
- * @generated
- * @ordered
- */
- public static final int SOFT_VALUE = 2;
-
- /**
- * The '<em><b>SOFT WEAK</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SOFT WEAK</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SOFT_WEAK
- * @model
- * @generated
- * @ordered
- */
- public static final int SOFT_WEAK_VALUE = 3;
-
- /**
- * The '<em><b>HARD WEAK</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>HARD WEAK</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #HARD_WEAK
- * @model
- * @generated
- * @ordered
- */
- public static final int HARD_WEAK_VALUE = 4;
-
- /**
- * The '<em><b>CACHE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CACHE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CACHE
- * @model
- * @generated
- * @ordered
- */
- public static final int CACHE_VALUE = 5;
-
- /**
- * The '<em><b>NONE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NONE
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE_VALUE = 6;
-
- /**
- * An array of all the '<em><b>Cache Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final CacheType[] VALUES_ARRAY =
- new CacheType[]
- {
- FULL,
- WEAK,
- SOFT,
- SOFT_WEAK,
- HARD_WEAK,
- CACHE,
- NONE,
- };
-
- /**
- * A public read-only list of all the '<em><b>Cache Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<CacheType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Cache Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheType get(int value)
- {
- switch (value)
- {
- case FULL_VALUE: return FULL;
- case WEAK_VALUE: return WEAK;
- case SOFT_VALUE: return SOFT;
- case SOFT_WEAK_VALUE: return SOFT_WEAK;
- case HARD_WEAK_VALUE: return HARD_WEAK;
- case CACHE_VALUE: return CACHE;
- case NONE_VALUE: return NONE;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private CacheType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //CacheType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLink.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLink.java
deleted file mode 100644
index eaee4a0baf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLink.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-
-@SuppressWarnings("nls")
-public interface EclipseLink
- extends JPA
-{
- String SCHEMA_NAMESPACE = "http://www.eclipse.org/eclipselink/xsds/persistence/orm";
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_0.xsd";
- String SCHEMA_VERSION = "1.0";
-
- // EclipseLink specific nodes
-
- String ACCESS_METHODS = "access-methods"; //$NON-NLS-1$
- String ACCESS_METHODS__GET_METHOD = "get-method"; //$NON-NLS-1$
- String ACCESS_METHODS__SET_METHOD = "set-method"; //$NON-NLS-1$
-
- String BASIC_COLLECTION = "basic-collection"; //$NON-NLS-1$
-
- String BASIC_MAP = "basic-map"; //$NON-NLS-1$
-
- String CACHE = "cache"; //$NON-NLS-1$
- String CACHE__EXPIRY = "expiry"; //$NON-NLS-1$
- String CACHE__SIZE = "size"; //$NON-NLS-1$
- String CACHE__SHARED = "shared"; //$NON-NLS-1$
- String CACHE__TYPE = "type"; //$NON-NLS-1$
- String CACHE__ALWAYS_REFRESH = "always-refresh"; //$NON-NLS-1$
- String CACHE__REFRESH_ONLY_IF_NEWER = "refresh-only-if-newer"; //$NON-NLS-1$
- String CACHE__DISABLE_HITS = "disable-hits"; //$NON-NLS-1$
- String CACHE__COORDINATION_TYPE = "coordination-type"; //$NON-NLS-1$
-
- String CHANGE_TRACKING = "change-tracking"; //$NON-NLS-1$
-
- String CONVERSION_VALUE = "conversion-value"; //$NON-NLS-1$
- String CONVERSION_VALUE__DATA_VALUE = "data-value"; //$NON-NLS-1$
- String CONVERSION_VALUE__OBJECT_VALUE = "object-value"; //$NON-NLS-1$
-
- String CONVERT = "convert"; //$NON-NLS-1$
-
- String CONVERTER = "converter"; //$NON-NLS-1$
- String CONVERTER__CLASS = "class"; //$NON-NLS-1$
- String CONVERTER__NAME = "name"; //$NON-NLS-1$
-
- String COPY_POLICY = "copy-policy"; //$NON-NLS-1$
- String COPY_POLICY__CLASS = "class"; //$NON-NLS-1$
-
- String CLONE_COPY_POLICY = "clone-copy-policy"; //$NON-NLS-1$
- String CLONE_COPY_POLICY__METHOD = "method"; //$NON-NLS-1$
- String CLONE_COPY_POLICY__WORKING_COPY_METHOD = "working-copy-method"; //$NON-NLS-1$
-
- String CUSTOMIZER = "customizer"; //$NON-NLS-1$
-
- String EXCLUDE_DEFAULT_MAPPINGS = "exclude-default-mappings"; //$NON-NLS-1$
-
- String EXISTENCE_CHECKING = "existence-checking"; //$NON-NLS-1$
-
- String EXPIRY_TIME_OF_DAY = "expiry-time-of-day"; //$NON-NLS-1$
- String EXPIRY_TIME_OF_DAY__HOUR = "hour"; //$NON-NLS-1$
- String EXPIRY_TIME_OF_DAY__MINUTE = "minute"; //$NON-NLS-1$
- String EXPIRY_TIME_OF_DAY__SECOND = "second"; //$NON-NLS-1$
- String EXPIRY_TIME_OF_DAY__MILLISECOND = "millisecond"; //$NON-NLS-1$
-
- String INSTANTIATION_COPY_POLICY = "instantiation-copy-policy"; //$NON-NLS-1$
-
- String JOIN_FETCH = "join-fetch"; //$NON-NLS-1$
-
- String MUTABLE = "mutable"; //$NON-NLS-1$
-
- String NAMED_STORED_PROCEDURE_QUERY = "named-stored-procedure-query"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__NAME = "name"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__HINT = "hint"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS = "result-class"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING = "result-set-mapping"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME = "procedure-name"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET = "returns-result-set"; //$NON-NLS-1$
- String NAMED_STORED_PROCEDURE_QUERY__PARAMETER = "parameter"; //$NON-NLS-1$
- String PARAMETER__DIRECTION = "direction"; //$NON-NLS-1$
- String PARAMETER__NAME = "name"; //$NON-NLS-1$
- String PARAMETER__QUERY_PARAMETER = "query-parameter"; //$NON-NLS-1$
- String PARAMETER__TYPE = "type"; //$NON-NLS-1$
- String PARAMETER__JDBC_TYPE = "jdbc-type"; //$NON-NLS-1$
- String PARAMETER__JDBC_TYPE_NAME = "jdbc-type-name"; //$NON-NLS-1$
-
-
- String OBJECT_TYPE_CONVERTER = "object-type-converter"; //$NON-NLS-1$
- String OBJECT_TYPE_CONVERTER__NAME = "name"; //$NON-NLS-1$
- String OBJECT_TYPE_CONVERTER__DATA_TYPE = "data-type"; //$NON-NLS-1$
- String OBJECT_TYPE_CONVERTER__OBJECT_TYPE = "object-type"; //$NON-NLS-1$
- String OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE = "default-object-value"; //$NON-NLS-1$
-
- String OPTIMISTIC_LOCKING = "optimistic-locking"; //$NON-NLS-1$
- String OPTIMISTIC_LOCKING__SELECTED_COLUMN = "selected-column"; //$NON-NLS-1$
- String OPTIMISTIC_LOCKING__TYPE = "type"; //$NON-NLS-1$
- String OPTIMISTIC_LOCKING__CASCADE = "cascade"; //$NON-NLS-1$
-
- String PRIVATE_OWNED = "private-owned"; //$NON-NLS-1$
-
- String PROPERTY = "property"; //$NON-NLS-1$
- String PROPERTY__NAME = "name"; //$NON-NLS-1$
- String PROPERTY__VALUE = "value"; //$NON-NLS-1$
- String PROPERTY__VALUE_TYPE = "value-type"; //$NON-NLS-1$
-
- String READ_ONLY = "read-only"; //$NON-NLS-1$
-
-
- String STRUCT_CONVERTER = "struct-converter"; //$NON-NLS-1$
- String STRUCT_CONVERTER__NAME = "name"; //$NON-NLS-1$
- String STRUCT_CONVERTER__CONVERTER = "converter"; //$NON-NLS-1$
-
- String TRANSFORMATION = "transformation"; //$NON-NLS-1$
-
- String TYPE = "type"; //$NON-NLS-1$
-
- String TYPE_CONVERTER = "type-converter"; //$NON-NLS-1$
- String TYPE_CONVERTER__NAME = "name"; //$NON-NLS-1$
- String TYPE_CONVERTER__DATA_TYPE = "data-type"; //$NON-NLS-1$
- String TYPE_CONVERTER__OBJECT_TYPE = "object-type"; //$NON-NLS-1$
-
- String VARIABLE_ONE_TO_ONE = "variable-one-to-one"; //$NON-NLS-1$
- String VARIABLE_ONE_TO_ONE__TARGET_INTERFACE = "target-interface"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java
deleted file mode 100644
index 4da6baf902..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmFactory.java
+++ /dev/null
@@ -1,1199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage
- * @generated
- */
-public class EclipseLinkOrmFactory extends EFactoryImpl
-{
-
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmFactory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmFactory init()
- {
- try
- {
- EclipseLinkOrmFactory theEclipseLinkOrmFactory = (EclipseLinkOrmFactory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.xmi");
- if (theEclipseLinkOrmFactory != null)
- {
- return theEclipseLinkOrmFactory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmFactory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmFactory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS: return (EObject)createXmlAccessMethods();
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA: return (EObject)createXmlAdditionalCriteria();
- case EclipseLinkOrmPackage.XML_ARRAY: return (EObject)createXmlArray();
- case EclipseLinkOrmPackage.ATTRIBUTES: return (EObject)createAttributes();
- case EclipseLinkOrmPackage.XML_BASIC: return (EObject)createXmlBasic();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION: return (EObject)createXmlBasicCollection();
- case EclipseLinkOrmPackage.XML_BASIC_MAP: return (EObject)createXmlBasicMap();
- case EclipseLinkOrmPackage.XML_BATCH_FETCH: return (EObject)createXmlBatchFetch();
- case EclipseLinkOrmPackage.XML_CACHE: return (EObject)createXmlCache();
- case EclipseLinkOrmPackage.XML_CACHE_INDEX: return (EObject)createXmlCacheIndex();
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING: return (EObject)createXmlChangeTracking();
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY: return (EObject)createXmlCloneCopyPolicy();
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE: return (EObject)createXmlCollectionTable();
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE: return (EObject)createXmlConversionValue();
- case EclipseLinkOrmPackage.XML_CONVERTER: return (EObject)createXmlConverter();
- case EclipseLinkOrmPackage.XML_COPY_POLICY: return (EObject)createXmlCopyPolicy();
- case EclipseLinkOrmPackage.XML_CUSTOMIZER: return (EObject)createXmlCustomizer();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION: return (EObject)createXmlElementCollection();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE: return (EObject)createXmlEmbeddable();
- case EclipseLinkOrmPackage.XML_EMBEDDED: return (EObject)createXmlEmbedded();
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID: return (EObject)createXmlEmbeddedId();
- case EclipseLinkOrmPackage.XML_ENTITY: return (EObject)createXmlEntity();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS: return (EObject)createXmlEntityMappings();
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE: return (EObject)createXmlFetchAttribute();
- case EclipseLinkOrmPackage.XML_FETCH_GROUP: return (EObject)createXmlFetchGroup();
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING: return (EObject)createXmlHashPartitioning();
- case EclipseLinkOrmPackage.XML_ID: return (EObject)createXmlId();
- case EclipseLinkOrmPackage.XML_INDEX: return (EObject)createXmlIndex();
- case EclipseLinkOrmPackage.XML_INSTANTIATION_COPY_POLICY: return (EObject)createXmlInstantiationCopyPolicy();
- case EclipseLinkOrmPackage.XML_JOIN_TABLE: return (EObject)createXmlJoinTable();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY: return (EObject)createXmlManyToMany();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE: return (EObject)createXmlManyToOne();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS: return (EObject)createXmlMappedSuperclass();
- case EclipseLinkOrmPackage.XML_MULTITENANT: return (EObject)createXmlMultitenant();
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER: return (EObject)createXmlNamedConverter();
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY: return (EObject)createXmlNamedPlsqlStoredFunctionQuery();
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY: return (EObject)createXmlNamedPlsqlStoredProcedureQuery();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY: return (EObject)createXmlNamedStoredFunctionQuery();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY: return (EObject)createXmlNamedStoredProcedureQuery();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER: return (EObject)createXmlObjectTypeConverter();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY: return (EObject)createXmlOneToMany();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE: return (EObject)createXmlOneToOne();
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING: return (EObject)createXmlOptimisticLocking();
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN: return (EObject)createXmlOrderColumn();
- case EclipseLinkOrmPackage.XML_PARTITIONING: return (EObject)createXmlPartitioning();
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS: return (EObject)createXmlPersistenceUnitDefaults();
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA: return (EObject)createXmlPersistenceUnitMetadata();
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING: return (EObject)createXmlPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD: return (EObject)createXmlPlsqlRecord();
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE: return (EObject)createXmlPlsqlTable();
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY: return (EObject)createXmlPrimaryKey();
- case EclipseLinkOrmPackage.XML_PROPERTY: return (EObject)createXmlProperty();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS: return (EObject)createXmlQueryRedirectors();
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING: return (EObject)createXmlRangePartitioning();
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING: return (EObject)createXmlReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_RETURN_INSERT: return (EObject)createXmlReturnInsert();
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING: return (EObject)createXmlRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE: return (EObject)createXmlSecondaryTable();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER: return (EObject)createXmlStoredProcedureParameter();
- case EclipseLinkOrmPackage.XML_STRUCT: return (EObject)createXmlStruct();
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER: return (EObject)createXmlStructConverter();
- case EclipseLinkOrmPackage.XML_STRUCTURE: return (EObject)createXmlStructure();
- case EclipseLinkOrmPackage.XML_TABLE: return (EObject)createXmlTable();
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR: return (EObject)createXmlTableGenerator();
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN: return (EObject)createXmlTenantDiscriminatorColumn();
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY: return (EObject)createXmlTimeOfDay();
- case EclipseLinkOrmPackage.XML_TRANSFORMATION: return (EObject)createXmlTransformation();
- case EclipseLinkOrmPackage.XML_TRANSIENT: return (EObject)createXmlTransient();
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER: return (EObject)createXmlTypeConverter();
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING: return (EObject)createXmlUnionPartitioning();
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING: return (EObject)createXmlValuePartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE: return (EObject)createXmlVariableOneToOne();
- case EclipseLinkOrmPackage.XML_VERSION: return (EObject)createXmlVersion();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmPackage.CACHE_COORDINATION_TYPE:
- return createCacheCoordinationTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.CACHE_TYPE:
- return createCacheTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_TYPE:
- return createXmlChangeTrackingTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.XML_DIRECTION:
- return createXmlDirectionFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.EXISTENCE_TYPE:
- return createExistenceTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.XML_JOIN_FETCH_TYPE:
- return createXmlJoinFetchTypeFromString(eDataType, initialValue);
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING_TYPE:
- return createXmlOptimisticLockingTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmPackage.CACHE_COORDINATION_TYPE:
- return convertCacheCoordinationTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.CACHE_TYPE:
- return convertCacheTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_TYPE:
- return convertXmlChangeTrackingTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.XML_DIRECTION:
- return convertXmlDirectionToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.EXISTENCE_TYPE:
- return convertExistenceTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.XML_JOIN_FETCH_TYPE:
- return convertXmlJoinFetchTypeToString(eDataType, instanceValue);
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING_TYPE:
- return convertXmlOptimisticLockingTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAccessMethods createXmlAccessMethods()
- {
- XmlAccessMethods xmlAccessMethods = new XmlAccessMethods();
- return xmlAccessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlAdditionalCriteria createXmlAdditionalCriteria()
- {
- XmlAdditionalCriteria xmlAdditionalCriteria = new XmlAdditionalCriteria();
- return xmlAdditionalCriteria;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlArray createXmlArray()
- {
- XmlArray xmlArray = new XmlArray();
- return xmlArray;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public Attributes createAttributes()
- {
- Attributes attributes = new Attributes();
- return attributes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasic createXmlBasic()
- {
- XmlBasic xmlBasic = new XmlBasic();
- return xmlBasic;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasicCollection createXmlBasicCollection()
- {
- XmlBasicCollection xmlBasicCollection = new XmlBasicCollection();
- return xmlBasicCollection;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBasicMap createXmlBasicMap()
- {
- XmlBasicMap xmlBasicMap = new XmlBasicMap();
- return xmlBasicMap;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlBatchFetch createXmlBatchFetch()
- {
- XmlBatchFetch xmlBatchFetch = new XmlBatchFetch();
- return xmlBatchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCache createXmlCache()
- {
- XmlCache xmlCache = new XmlCache();
- return xmlCache;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCacheIndex createXmlCacheIndex()
- {
- XmlCacheIndex xmlCacheIndex = new XmlCacheIndex();
- return xmlCacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlChangeTracking createXmlChangeTracking()
- {
- XmlChangeTracking xmlChangeTracking = new XmlChangeTracking();
- return xmlChangeTracking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCloneCopyPolicy createXmlCloneCopyPolicy()
- {
- XmlCloneCopyPolicy xmlCloneCopyPolicy = new XmlCloneCopyPolicy();
- return xmlCloneCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCollectionTable createXmlCollectionTable()
- {
- XmlCollectionTable xmlCollectionTable = new XmlCollectionTable();
- return xmlCollectionTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlConversionValue createXmlConversionValue()
- {
- XmlConversionValue xmlConversionValue = new XmlConversionValue();
- return xmlConversionValue;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlConverter createXmlConverter()
- {
- XmlConverter xmlConverter = new XmlConverter();
- return xmlConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCopyPolicy createXmlCopyPolicy()
- {
- XmlCopyPolicy xmlCopyPolicy = new XmlCopyPolicy();
- return xmlCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlCustomizer createXmlCustomizer()
- {
- XmlCustomizer xmlCustomizer = new XmlCustomizer();
- return xmlCustomizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlElementCollection createXmlElementCollection()
- {
- XmlElementCollection xmlElementCollection = new XmlElementCollection();
- return xmlElementCollection;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddable createXmlEmbeddable()
- {
- XmlEmbeddable xmlEmbeddable = new XmlEmbeddable();
- return xmlEmbeddable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbedded createXmlEmbedded()
- {
- XmlEmbedded xmlEmbedded = new XmlEmbedded();
- return xmlEmbedded;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEmbeddedId createXmlEmbeddedId()
- {
- XmlEmbeddedId xmlEmbeddedId = new XmlEmbeddedId();
- return xmlEmbeddedId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntity createXmlEntity()
- {
- XmlEntity xmlEntity = new XmlEntity();
- return xmlEntity;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlEntityMappings createXmlEntityMappings()
- {
- XmlEntityMappings xmlEntityMappings = new XmlEntityMappings();
- return xmlEntityMappings;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlFetchAttribute createXmlFetchAttribute()
- {
- XmlFetchAttribute xmlFetchAttribute = new XmlFetchAttribute();
- return xmlFetchAttribute;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlFetchGroup createXmlFetchGroup()
- {
- XmlFetchGroup xmlFetchGroup = new XmlFetchGroup();
- return xmlFetchGroup;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlId createXmlId()
- {
- XmlId xmlId = new XmlId();
- return xmlId;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlIndex createXmlIndex()
- {
- XmlIndex xmlIndex = new XmlIndex();
- return xmlIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlInstantiationCopyPolicy createXmlInstantiationCopyPolicy()
- {
- XmlInstantiationCopyPolicy xmlInstantiationCopyPolicy = new XmlInstantiationCopyPolicy();
- return xmlInstantiationCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinTable createXmlJoinTable()
- {
- XmlJoinTable xmlJoinTable = new XmlJoinTable();
- return xmlJoinTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToMany createXmlManyToMany()
- {
- XmlManyToMany xmlManyToMany = new XmlManyToMany();
- return xmlManyToMany;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlManyToOne createXmlManyToOne()
- {
- XmlManyToOne xmlManyToOne = new XmlManyToOne();
- return xmlManyToOne;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMappedSuperclass createXmlMappedSuperclass()
- {
- XmlMappedSuperclass xmlMappedSuperclass = new XmlMappedSuperclass();
- return xmlMappedSuperclass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlMultitenant createXmlMultitenant()
- {
- XmlMultitenant xmlMultitenant = new XmlMultitenant();
- return xmlMultitenant;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedConverter createXmlNamedConverter()
- {
- XmlNamedConverter xmlNamedConverter = new XmlNamedConverter();
- return xmlNamedConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedPlsqlStoredFunctionQuery createXmlNamedPlsqlStoredFunctionQuery()
- {
- XmlNamedPlsqlStoredFunctionQuery xmlNamedPlsqlStoredFunctionQuery = new XmlNamedPlsqlStoredFunctionQuery();
- return xmlNamedPlsqlStoredFunctionQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedPlsqlStoredProcedureQuery createXmlNamedPlsqlStoredProcedureQuery()
- {
- XmlNamedPlsqlStoredProcedureQuery xmlNamedPlsqlStoredProcedureQuery = new XmlNamedPlsqlStoredProcedureQuery();
- return xmlNamedPlsqlStoredProcedureQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedStoredFunctionQuery createXmlNamedStoredFunctionQuery()
- {
- XmlNamedStoredFunctionQuery xmlNamedStoredFunctionQuery = new XmlNamedStoredFunctionQuery();
- return xmlNamedStoredFunctionQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlNamedStoredProcedureQuery createXmlNamedStoredProcedureQuery()
- {
- XmlNamedStoredProcedureQuery xmlNamedStoredProcedureQuery = new XmlNamedStoredProcedureQuery();
- return xmlNamedStoredProcedureQuery;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlObjectTypeConverter createXmlObjectTypeConverter()
- {
- XmlObjectTypeConverter xmlObjectTypeConverter = new XmlObjectTypeConverter();
- return xmlObjectTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToMany createXmlOneToMany()
- {
- XmlOneToMany xmlOneToMany = new XmlOneToMany();
- return xmlOneToMany;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOneToOne createXmlOneToOne()
- {
- XmlOneToOne xmlOneToOne = new XmlOneToOne();
- return xmlOneToOne;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOptimisticLocking createXmlOptimisticLocking()
- {
- XmlOptimisticLocking xmlOptimisticLocking = new XmlOptimisticLocking();
- return xmlOptimisticLocking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOrderColumn createXmlOrderColumn()
- {
- XmlOrderColumn xmlOrderColumn = new XmlOrderColumn();
- return xmlOrderColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitDefaults createXmlPersistenceUnitDefaults()
- {
- XmlPersistenceUnitDefaults xmlPersistenceUnitDefaults = new XmlPersistenceUnitDefaults();
- return xmlPersistenceUnitDefaults;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPersistenceUnitMetadata createXmlPersistenceUnitMetadata()
- {
- XmlPersistenceUnitMetadata xmlPersistenceUnitMetadata = new XmlPersistenceUnitMetadata();
- return xmlPersistenceUnitMetadata;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPrimaryKey createXmlPrimaryKey()
- {
- XmlPrimaryKey xmlPrimaryKey = new XmlPrimaryKey();
- return xmlPrimaryKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlProperty createXmlProperty()
- {
- XmlProperty xmlProperty = new XmlProperty();
- return xmlProperty;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlQueryRedirectors createXmlQueryRedirectors()
- {
- XmlQueryRedirectors xmlQueryRedirectors = new XmlQueryRedirectors();
- return xmlQueryRedirectors;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlReturnInsert createXmlReturnInsert()
- {
- XmlReturnInsert xmlReturnInsert = new XmlReturnInsert();
- return xmlReturnInsert;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlSecondaryTable createXmlSecondaryTable()
- {
- XmlSecondaryTable xmlSecondaryTable = new XmlSecondaryTable();
- return xmlSecondaryTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStoredProcedureParameter createXmlStoredProcedureParameter()
- {
- XmlStoredProcedureParameter xmlStoredProcedureParameter = new XmlStoredProcedureParameter();
- return xmlStoredProcedureParameter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStruct createXmlStruct()
- {
- XmlStruct xmlStruct = new XmlStruct();
- return xmlStruct;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStructConverter createXmlStructConverter()
- {
- XmlStructConverter xmlStructConverter = new XmlStructConverter();
- return xmlStructConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlStructure createXmlStructure()
- {
- XmlStructure xmlStructure = new XmlStructure();
- return xmlStructure;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTable createXmlTable()
- {
- XmlTable xmlTable = new XmlTable();
- return xmlTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTableGenerator createXmlTableGenerator()
- {
- XmlTableGenerator xmlTableGenerator = new XmlTableGenerator();
- return xmlTableGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTenantDiscriminatorColumn createXmlTenantDiscriminatorColumn()
- {
- XmlTenantDiscriminatorColumn xmlTenantDiscriminatorColumn = new XmlTenantDiscriminatorColumn();
- return xmlTenantDiscriminatorColumn;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTimeOfDay createXmlTimeOfDay()
- {
- XmlTimeOfDay xmlTimeOfDay = new XmlTimeOfDay();
- return xmlTimeOfDay;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTransformation createXmlTransformation()
- {
- XmlTransformation xmlTransformation = new XmlTransformation();
- return xmlTransformation;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTransient createXmlTransient()
- {
- XmlTransient xmlTransient = new XmlTransient();
- return xmlTransient;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlTypeConverter createXmlTypeConverter()
- {
- XmlTypeConverter xmlTypeConverter = new XmlTypeConverter();
- return xmlTypeConverter;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlVariableOneToOne createXmlVariableOneToOne()
- {
- XmlVariableOneToOne xmlVariableOneToOne = new XmlVariableOneToOne();
- return xmlVariableOneToOne;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlVersion createXmlVersion()
- {
- XmlVersion xmlVersion = new XmlVersion();
- return xmlVersion;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlHashPartitioning createXmlHashPartitioning()
- {
- XmlHashPartitioning xmlHashPartitioning = new XmlHashPartitioning();
- return xmlHashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPartitioning createXmlPartitioning()
- {
- XmlPartitioning xmlPartitioning = new XmlPartitioning();
- return xmlPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPinnedPartitioning createXmlPinnedPartitioning()
- {
- XmlPinnedPartitioning xmlPinnedPartitioning = new XmlPinnedPartitioning();
- return xmlPinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPlsqlRecord createXmlPlsqlRecord()
- {
- XmlPlsqlRecord xmlPlsqlRecord = new XmlPlsqlRecord();
- return xmlPlsqlRecord;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlPlsqlTable createXmlPlsqlTable()
- {
- XmlPlsqlTable xmlPlsqlTable = new XmlPlsqlTable();
- return xmlPlsqlTable;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlRangePartitioning createXmlRangePartitioning()
- {
- XmlRangePartitioning xmlRangePartitioning = new XmlRangePartitioning();
- return xmlRangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlReplicationPartitioning createXmlReplicationPartitioning()
- {
- XmlReplicationPartitioning xmlReplicationPartitioning = new XmlReplicationPartitioning();
- return xmlReplicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlRoundRobinPartitioning createXmlRoundRobinPartitioning()
- {
- XmlRoundRobinPartitioning xmlRoundRobinPartitioning = new XmlRoundRobinPartitioning();
- return xmlRoundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlUnionPartitioning createXmlUnionPartitioning()
- {
- XmlUnionPartitioning xmlUnionPartitioning = new XmlUnionPartitioning();
- return xmlUnionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlValuePartitioning createXmlValuePartitioning()
- {
- XmlValuePartitioning xmlValuePartitioning = new XmlValuePartitioning();
- return xmlValuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CacheCoordinationType createCacheCoordinationTypeFromString(EDataType eDataType, String initialValue)
- {
- CacheCoordinationType result = CacheCoordinationType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertCacheCoordinationTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CacheType createCacheTypeFromString(EDataType eDataType, String initialValue)
- {
- CacheType result = CacheType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertCacheTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlChangeTrackingType createXmlChangeTrackingTypeFromString(EDataType eDataType, String initialValue)
- {
- XmlChangeTrackingType result = XmlChangeTrackingType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlChangeTrackingTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlDirection createXmlDirectionFromString(EDataType eDataType, String initialValue)
- {
- XmlDirection result = XmlDirection.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlDirectionToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public ExistenceType createExistenceTypeFromString(EDataType eDataType, String initialValue)
- {
- ExistenceType result = ExistenceType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertExistenceTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlJoinFetchType createXmlJoinFetchTypeFromString(EDataType eDataType, String initialValue)
- {
- XmlJoinFetchType result = XmlJoinFetchType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlJoinFetchTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public XmlOptimisticLockingType createXmlOptimisticLockingTypeFromString(EDataType eDataType, String initialValue)
- {
- XmlOptimisticLockingType result = XmlOptimisticLockingType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertXmlOptimisticLockingTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmPackage getEclipseLinkOrmPackage()
- {
- return (EclipseLinkOrmPackage)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmPackage getPackage()
- {
- return EclipseLinkOrmPackage.eINSTANCE;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java
deleted file mode 100644
index 9a17b5212c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmPackage.java
+++ /dev/null
@@ -1,13044 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmPackage extends EPackageImpl
-{
-
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "orm";
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.xmi";
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm";
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmPackage eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage.init();
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods <em>Xml Access Methods</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods()
- * @generated
- */
- public static final int XML_ACCESS_METHODS = 0;
- /**
- * The feature id for the '<em><b>Get Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS__GET_METHOD = 0;
- /**
- * The feature id for the '<em><b>Set Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS__SET_METHOD = 1;
- /**
- * The number of structural features of the '<em>Xml Access Methods</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS_FEATURE_COUNT = 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder <em>Xml Access Methods Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder()
- * @generated
- */
- public static final int XML_ACCESS_METHODS_HOLDER = 1;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS = 0;
- /**
- * The number of structural features of the '<em>Xml Access Methods Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria <em>Xml Additional Criteria</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAdditionalCriteria()
- * @generated
- */
- public static final int XML_ADDITIONAL_CRITERIA = 2;
- /**
- * The feature id for the '<em><b>Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ADDITIONAL_CRITERIA__CRITERIA = EclipseLinkOrmV2_2Package.XML_ADDITIONAL_CRITERIA_22__CRITERIA;
- /**
- * The number of structural features of the '<em>Xml Additional Criteria</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ADDITIONAL_CRITERIA_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_ADDITIONAL_CRITERIA_22_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray <em>Xml Array</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlArray()
- * @generated
- */
- public static final int XML_ARRAY = 3;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__TYPE_CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__OBJECT_TYPE_CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__STRUCT_CONVERTERS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__LOB = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__TEMPORAL = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__ENUMERATED = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9;
- /**
- * 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_ARRAY__COLUMN = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Database Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__DATABASE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Target Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__TARGET_CLASS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY__CONVERT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 13;
- /**
- * The number of structural features of the '<em>Xml Array</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 14;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final int XML_ATTRIBUTE_MAPPING = 4;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__ACCESS = OrmPackage.XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__NAME = OrmPackage.XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__ACCESS_METHODS = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__PROPERTIES = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Attribute Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTE_MAPPING_FEATURE_COUNT = OrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes()
- * @generated
- */
- public static final int ATTRIBUTES = 5;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__DESCRIPTION = OrmPackage.ATTRIBUTES__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Element Collections</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ELEMENT_COLLECTIONS = OrmPackage.ATTRIBUTES__ELEMENT_COLLECTIONS;
- /**
- * The feature id for the '<em><b>Ids</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__IDS = OrmPackage.ATTRIBUTES__IDS;
- /**
- * The feature id for the '<em><b>Embedded Ids</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__EMBEDDED_IDS = OrmPackage.ATTRIBUTES__EMBEDDED_IDS;
- /**
- * The feature id for the '<em><b>Basics</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__BASICS = OrmPackage.ATTRIBUTES__BASICS;
- /**
- * The feature id for the '<em><b>Versions</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__VERSIONS = OrmPackage.ATTRIBUTES__VERSIONS;
- /**
- * The feature id for the '<em><b>Many To Ones</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__MANY_TO_ONES = OrmPackage.ATTRIBUTES__MANY_TO_ONES;
- /**
- * The feature id for the '<em><b>One To Manys</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ONE_TO_MANYS = OrmPackage.ATTRIBUTES__ONE_TO_MANYS;
- /**
- * The feature id for the '<em><b>One To Ones</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ONE_TO_ONES = OrmPackage.ATTRIBUTES__ONE_TO_ONES;
- /**
- * The feature id for the '<em><b>Many To Manys</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__MANY_TO_MANYS = OrmPackage.ATTRIBUTES__MANY_TO_MANYS;
- /**
- * The feature id for the '<em><b>Embeddeds</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__EMBEDDEDS = OrmPackage.ATTRIBUTES__EMBEDDEDS;
- /**
- * The feature id for the '<em><b>Transients</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__TRANSIENTS = OrmPackage.ATTRIBUTES__TRANSIENTS;
- /**
- * The feature id for the '<em><b>Structures</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__STRUCTURES = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Arrays</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__ARRAYS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Basic Collections</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__BASIC_COLLECTIONS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Basic Maps</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__BASIC_MAPS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Transformations</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__TRANSFORMATIONS = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Variable One To Ones</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES__VARIABLE_ONE_TO_ONES = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 5;
- /**
- * The number of structural features of the '<em>Attributes</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTES_FEATURE_COUNT = OrmPackage.ATTRIBUTES_FEATURE_COUNT + 6;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic()
- * @generated
- */
- public static final int XML_BASIC = 6;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__ACCESS = OrmPackage.XML_BASIC__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__NAME = OrmPackage.XML_BASIC__NAME;
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__COLUMN = OrmPackage.XML_BASIC__COLUMN;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__LOB = OrmPackage.XML_BASIC__LOB;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__TEMPORAL = OrmPackage.XML_BASIC__TEMPORAL;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__ENUMERATED = OrmPackage.XML_BASIC__ENUMERATED;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__FETCH = OrmPackage.XML_BASIC__FETCH;
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__OPTIONAL = OrmPackage.XML_BASIC__OPTIONAL;
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__SEQUENCE_GENERATOR = OrmPackage.XML_BASIC_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__TABLE_GENERATOR = OrmPackage.XML_BASIC_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__GENERATED_VALUE = OrmPackage.XML_BASIC_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Return Insert</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__RETURN_INSERT = OrmPackage.XML_BASIC_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Return Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__RETURN_UPDATE = OrmPackage.XML_BASIC_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__INDEX = OrmPackage.XML_BASIC_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__CACHE_INDEX = OrmPackage.XML_BASIC_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__ACCESS_METHODS = OrmPackage.XML_BASIC_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__PROPERTIES = OrmPackage.XML_BASIC_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__ATTRIBUTE_TYPE = OrmPackage.XML_BASIC_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__MUTABLE = OrmPackage.XML_BASIC_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__CONVERT = OrmPackage.XML_BASIC_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__CONVERTERS = OrmPackage.XML_BASIC_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__TYPE_CONVERTERS = OrmPackage.XML_BASIC_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_BASIC_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC__STRUCT_CONVERTERS = OrmPackage.XML_BASIC_FEATURE_COUNT + 15;
- /**
- * The number of structural features of the '<em>Xml Basic</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_FEATURE_COUNT = OrmPackage.XML_BASIC_FEATURE_COUNT + 16;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection()
- * @generated
- */
- public static final int XML_BASIC_COLLECTION = 7;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION__CASCADE_ON_DELETE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The number of structural features of the '<em>Xml Basic Collection</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap()
- * @generated
- */
- public static final int XML_BASIC_MAP = 8;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP__CASCADE_ON_DELETE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The number of structural features of the '<em>Xml Basic Map</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch <em>Xml Batch Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch()
- * @generated
- */
- public static final int XML_BATCH_FETCH = 9;
- /**
- * The feature id for the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH__SIZE = EclipseLinkOrmV2_1Package.XML_BATCH_FETCH_21__SIZE;
- /**
- * The feature id for the '<em><b>Batch Fetch Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH__BATCH_FETCH_TYPE = EclipseLinkOrmV2_1Package.XML_BATCH_FETCH_21__BATCH_FETCH_TYPE;
- /**
- * The number of structural features of the '<em>Xml Batch Fetch</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_FEATURE_COUNT = EclipseLinkOrmV2_1Package.XML_BATCH_FETCH_21_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder <em>Xml Batch Fetch Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder()
- * @generated
- */
- public static final int XML_BATCH_FETCH_HOLDER = 10;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_HOLDER__BATCH_FETCH = 0;
- /**
- * The number of structural features of the '<em>Xml Batch Fetch Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_HOLDER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache <em>Xml Cache</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache()
- * @generated
- */
- public static final int XML_CACHE = 11;
- /**
- * The feature id for the '<em><b>Isolation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__ISOLATION = EclipseLinkOrmV2_2Package.XML_CACHE_22__ISOLATION;
- /**
- * The feature id for the '<em><b>Database Change Notification Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Expiry</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__EXPIRY = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__SIZE = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Shared</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__SHARED = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__TYPE = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Always Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__ALWAYS_REFRESH = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Refresh Only If Newer</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__REFRESH_ONLY_IF_NEWER = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Disable Hits</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__DISABLE_HITS = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Coordination Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__COORDINATION_TYPE = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Expiry Time Of Day</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE__EXPIRY_TIME_OF_DAY = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 9;
- /**
- * The number of structural features of the '<em>Xml Cache</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_CACHE_22_FEATURE_COUNT + 10;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder <em>Xml Cache Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder()
- * @generated
- */
- public static final int XML_CACHE_HOLDER = 12;
- /**
- * The feature id for the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_HOLDER__CACHE = 0;
- /**
- * The feature id for the '<em><b>Existence Checking</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_HOLDER__EXISTENCE_CHECKING = 1;
- /**
- * The number of structural features of the '<em>Xml Cache Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_HOLDER_FEATURE_COUNT = 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex <em>Xml Cache Index</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheIndex()
- * @generated
- */
- public static final int XML_CACHE_INDEX = 13;
- /**
- * The feature id for the '<em><b>Column Names</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_INDEX__COLUMN_NAMES = EclipseLinkOrmV2_4Package.XML_CACHE_INDEX_24__COLUMN_NAMES;
- /**
- * The number of structural features of the '<em>Xml Cache Index</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_INDEX_FEATURE_COUNT = EclipseLinkOrmV2_4Package.XML_CACHE_INDEX_24_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking <em>Xml Change Tracking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking()
- * @generated
- */
- public static final int XML_CHANGE_TRACKING = 14;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CHANGE_TRACKING__TYPE = 0;
- /**
- * The number of structural features of the '<em>Xml Change Tracking</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CHANGE_TRACKING_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder <em>Xml Change Tracking Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder()
- * @generated
- */
- public static final int XML_CHANGE_TRACKING_HOLDER = 15;
- /**
- * The feature id for the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING = 0;
- /**
- * The number of structural features of the '<em>Xml Change Tracking Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CHANGE_TRACKING_HOLDER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy <em>Xml Clone Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy()
- * @generated
- */
- public static final int XML_CLONE_COPY_POLICY = 16;
- /**
- * The feature id for the '<em><b>Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CLONE_COPY_POLICY__METHOD = 0;
- /**
- * The feature id for the '<em><b>Working Copy Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD = 1;
- /**
- * The number of structural features of the '<em>Xml Clone Copy Policy</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CLONE_COPY_POLICY_FEATURE_COUNT = 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable <em>Xml Collection Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionTable()
- * @generated
- */
- public static final int XML_COLLECTION_TABLE = 17;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__NAME = OrmPackage.XML_COLLECTION_TABLE__NAME;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__CATALOG = OrmPackage.XML_COLLECTION_TABLE__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__SCHEMA = OrmPackage.XML_COLLECTION_TABLE__SCHEMA;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__UNIQUE_CONSTRAINTS = OrmPackage.XML_COLLECTION_TABLE__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__JOIN_COLUMNS = OrmPackage.XML_COLLECTION_TABLE__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE__CREATION_SUFFIX = OrmPackage.XML_COLLECTION_TABLE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Collection Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE_FEATURE_COUNT = OrmPackage.XML_COLLECTION_TABLE_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue <em>Xml Conversion Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue()
- * @generated
- */
- public static final int XML_CONVERSION_VALUE = 18;
- /**
- * The feature id for the '<em><b>Data Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERSION_VALUE__DATA_VALUE = 0;
- /**
- * The feature id for the '<em><b>Object Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERSION_VALUE__OBJECT_VALUE = 1;
- /**
- * The number of structural features of the '<em>Xml Conversion Value</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERSION_VALUE_FEATURE_COUNT = 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter <em>Xml Named Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter()
- * @generated
- */
- public static final int XML_NAMED_CONVERTER = 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_NAMED_CONVERTER__NAME = 0;
- /**
- * The number of structural features of the '<em>Xml Named Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_CONVERTER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter <em>Xml Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter()
- * @generated
- */
- public static final int XML_CONVERTER = 19;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER__NAME = XML_NAMED_CONVERTER__NAME;
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER__CLASS_NAME = XML_NAMED_CONVERTER_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER_FEATURE_COUNT = XML_NAMED_CONVERTER_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer <em>Xml Converter Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer()
- * @generated
- */
- public static final int XML_CONVERTER_CONTAINER = 20;
- /**
- * 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_CONVERTER_CONTAINER__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_CONVERTER_CONTAINER__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_CONVERTER_CONTAINER__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_CONVERTER_CONTAINER__STRUCT_CONVERTERS = 3;
- /**
- * The number of structural features of the '<em>Xml Converter Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CONVERTER_CONTAINER_FEATURE_COUNT = 4;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping()
- * @generated
- */
- public static final int XML_CONVERTIBLE_MAPPING = 21;
- /**
- * 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>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 + 0;
- /**
- * 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 + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy <em>Xml Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy()
- * @generated
- */
- public static final int XML_COPY_POLICY = 22;
- /**
- * The feature id for the '<em><b>Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COPY_POLICY__CLASS = 0;
- /**
- * The number of structural features of the '<em>Xml Copy Policy</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COPY_POLICY_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer <em>Xml Customizer</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer()
- * @generated
- */
- public static final int XML_CUSTOMIZER = 23;
- /**
- * The feature id for the '<em><b>Customizer Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME = 0;
- /**
- * The number of structural features of the '<em>Xml Customizer</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CUSTOMIZER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder <em>Xml Customizer Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder()
- * @generated
- */
- public static final int XML_CUSTOMIZER_HOLDER = 24;
- /**
- * The feature id for the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CUSTOMIZER_HOLDER__CUSTOMIZER = 0;
- /**
- * The number of structural features of the '<em>Xml Customizer Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CUSTOMIZER_HOLDER_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION = 25;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ACCESS = OrmPackage.XML_ELEMENT_COLLECTION__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__NAME = OrmPackage.XML_ELEMENT_COLLECTION__NAME;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__LOB = OrmPackage.XML_ELEMENT_COLLECTION__LOB;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__TEMPORAL = OrmPackage.XML_ELEMENT_COLLECTION__TEMPORAL;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ENUMERATED = OrmPackage.XML_ELEMENT_COLLECTION__ENUMERATED;
- /**
- * The feature id for the '<em><b>Order Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ORDER_COLUMN = OrmPackage.XML_ELEMENT_COLLECTION__ORDER_COLUMN;
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ORDER_BY = OrmPackage.XML_ELEMENT_COLLECTION__ORDER_BY;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION__ASSOCIATION_OVERRIDES;
- /**
- * The feature id for the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Map Key Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_TEMPORAL;
- /**
- * The feature id for the '<em><b>Map Key Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ENUMERATED;
- /**
- * The feature id for the '<em><b>Target Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__TARGET_CLASS = OrmPackage.XML_ELEMENT_COLLECTION__TARGET_CLASS;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__FETCH = OrmPackage.XML_ELEMENT_COLLECTION__FETCH;
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY;
- /**
- * The feature id for the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_CLASS = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CLASS;
- /**
- * The feature id for the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_COLUMN;
- /**
- * The feature id for the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS = OrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__COLUMN = OrmPackage.XML_ELEMENT_COLLECTION__COLUMN;
- /**
- * The feature id for the '<em><b>Collection Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__COLLECTION_TABLE = OrmPackage.XML_ELEMENT_COLLECTION__COLLECTION_TABLE;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ACCESS_METHODS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__PROPERTIES = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__CONVERT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES = OrmPackage.XML_ELEMENT_COLLECTION_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_ELEMENT_COLLECTION__CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_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_ELEMENT_COLLECTION__TYPE_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_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_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_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_ELEMENT_COLLECTION__STRUCT_CONVERTERS = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__JOIN_FETCH = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__BATCH_FETCH = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__PINNED_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__RANGE_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__VALUE_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__HASH_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__UNION_PARTITIONING = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__PARTITIONED = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 21;
- /**
- * The feature id for the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__NONCACHEABLE = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Composite Member</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 23;
- /**
- * The feature id for the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION__DELETE_ALL = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 24;
- /**
- * The number of structural features of the '<em>Xml Element Collection</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_FEATURE_COUNT = OrmPackage.XML_ELEMENT_COLLECTION_FEATURE_COUNT + 25;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable()
- * @generated
- */
- public static final int XML_EMBEDDABLE = 26;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ACCESS = OrmPackage.XML_EMBEDDABLE__ACCESS;
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CLASS_NAME = OrmPackage.XML_EMBEDDABLE__CLASS_NAME;
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__METADATA_COMPLETE = OrmPackage.XML_EMBEDDABLE__METADATA_COMPLETE;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__DESCRIPTION = OrmPackage.XML_EMBEDDABLE__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ATTRIBUTES = OrmPackage.XML_EMBEDDABLE__ATTRIBUTES;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ACCESS_METHODS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__PARENT_CLASS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__ASSOCIATION_OVERRIDES = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__PLSQL_RECORDS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__PLSQL_TABLES = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__STRUCT = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CUSTOMIZER = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CHANGE_TRACKING = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CONVERTERS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__TYPE_CONVERTERS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__STRUCT_CONVERTERS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__PROPERTIES = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__COPY_POLICY = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__CLONE_COPY_POLICY = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 17;
- /**
- * The number of structural features of the '<em>Xml Embeddable</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_FEATURE_COUNT = OrmPackage.XML_EMBEDDABLE_FEATURE_COUNT + 18;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded()
- * @generated
- */
- public static final int XML_EMBEDDED = 27;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ACCESS = OrmPackage.XML_EMBEDDED__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__NAME = OrmPackage.XML_EMBEDDED__NAME;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ATTRIBUTE_OVERRIDES = OrmPackage.XML_EMBEDDED__ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ASSOCIATION_OVERRIDES = OrmPackage.XML_EMBEDDED__ASSOCIATION_OVERRIDES;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ACCESS_METHODS = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__PROPERTIES = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED__ATTRIBUTE_TYPE = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Embedded</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_FEATURE_COUNT = OrmPackage.XML_EMBEDDED_FEATURE_COUNT + 3;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId()
- * @generated
- */
- public static final int XML_EMBEDDED_ID = 28;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__ACCESS = OrmPackage.XML_EMBEDDED_ID__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__NAME = OrmPackage.XML_EMBEDDED_ID__NAME;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES = OrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__ACCESS_METHODS = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__PROPERTIES = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID__ATTRIBUTE_TYPE = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Embedded Id</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDED_ID_FEATURE_COUNT = OrmPackage.XML_EMBEDDED_ID_FEATURE_COUNT + 3;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity()
- * @generated
- */
- public static final int XML_ENTITY = 29;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ACCESS = OrmPackage.XML_ENTITY__ACCESS;
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CLASS_NAME = OrmPackage.XML_ENTITY__CLASS_NAME;
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__METADATA_COMPLETE = OrmPackage.XML_ENTITY__METADATA_COMPLETE;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__DESCRIPTION = OrmPackage.XML_ENTITY__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ATTRIBUTES = OrmPackage.XML_ENTITY__ATTRIBUTES;
- /**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_QUERIES = OrmPackage.XML_ENTITY__NAMED_QUERIES;
- /**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_NATIVE_QUERIES = OrmPackage.XML_ENTITY__NAMED_NATIVE_QUERIES;
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__SEQUENCE_GENERATOR = OrmPackage.XML_ENTITY__SEQUENCE_GENERATOR;
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__TABLE_GENERATOR = OrmPackage.XML_ENTITY__TABLE_GENERATOR;
- /**
- * The feature id for the '<em><b>Pre Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRE_PERSIST = OrmPackage.XML_ENTITY__PRE_PERSIST;
- /**
- * The feature id for the '<em><b>Post Persist</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_PERSIST = OrmPackage.XML_ENTITY__POST_PERSIST;
- /**
- * The feature id for the '<em><b>Pre Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRE_REMOVE = OrmPackage.XML_ENTITY__PRE_REMOVE;
- /**
- * The feature id for the '<em><b>Post Remove</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_REMOVE = OrmPackage.XML_ENTITY__POST_REMOVE;
- /**
- * The feature id for the '<em><b>Pre Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRE_UPDATE = OrmPackage.XML_ENTITY__PRE_UPDATE;
- /**
- * The feature id for the '<em><b>Post Update</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_UPDATE = OrmPackage.XML_ENTITY__POST_UPDATE;
- /**
- * The feature id for the '<em><b>Post Load</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__POST_LOAD = OrmPackage.XML_ENTITY__POST_LOAD;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ATTRIBUTE_OVERRIDES = OrmPackage.XML_ENTITY__ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ASSOCIATION_OVERRIDES = OrmPackage.XML_ENTITY__ASSOCIATION_OVERRIDES;
- /**
- * The feature id for the '<em><b>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CACHEABLE = OrmPackage.XML_ENTITY__CACHEABLE;
- /**
- * The feature id for the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ID_CLASS = OrmPackage.XML_ENTITY__ID_CLASS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAME = OrmPackage.XML_ENTITY__NAME;
- /**
- * The feature id for the '<em><b>Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__TABLE = OrmPackage.XML_ENTITY__TABLE;
- /**
- * The feature id for the '<em><b>Secondary Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__SECONDARY_TABLES = OrmPackage.XML_ENTITY__SECONDARY_TABLES;
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS = OrmPackage.XML_ENTITY__PRIMARY_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Inheritance</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__INHERITANCE = OrmPackage.XML_ENTITY__INHERITANCE;
- /**
- * The feature id for the '<em><b>Discriminator Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__DISCRIMINATOR_VALUE = OrmPackage.XML_ENTITY__DISCRIMINATOR_VALUE;
- /**
- * The feature id for the '<em><b>Discriminator Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__DISCRIMINATOR_COLUMN = OrmPackage.XML_ENTITY__DISCRIMINATOR_COLUMN;
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__SQL_RESULT_SET_MAPPINGS = OrmPackage.XML_ENTITY__SQL_RESULT_SET_MAPPINGS;
- /**
- * The feature id for the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS = OrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_LISTENERS;
- /**
- * The feature id for the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS = OrmPackage.XML_ENTITY__EXCLUDE_SUPERCLASS_LISTENERS;
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ENTITY_LISTENERS = OrmPackage.XML_ENTITY__ENTITY_LISTENERS;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ACCESS_METHODS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PARENT_CLASS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PRIMARY_KEY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CACHE_INTERCEPTOR = OrmPackage.XML_ENTITY_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__QUERY_REDIRECTORS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__FETCH_GROUPS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Class Extractor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CLASS_EXTRACTOR = OrmPackage.XML_ENTITY_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__REPLICATION_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PINNED_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__RANGE_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__VALUE_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__HASH_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__UNION_PARTITIONING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PARTITIONED = OrmPackage.XML_ENTITY_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__ADDITIONAL_CRITERIA = OrmPackage.XML_ENTITY_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CASCADE_ON_DELETE = OrmPackage.XML_ENTITY_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__INDEX = OrmPackage.XML_ENTITY_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__MULTITENANT = OrmPackage.XML_ENTITY_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 21;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PLSQL_RECORDS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 23;
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PLSQL_TABLES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 24;
- /**
- * The feature id for the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__STRUCT = OrmPackage.XML_ENTITY_FEATURE_COUNT + 25;
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CACHE_INDEX = OrmPackage.XML_ENTITY_FEATURE_COUNT + 26;
- /**
- * The feature id for the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__READ_ONLY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 27;
- /**
- * The feature id for the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CUSTOMIZER = OrmPackage.XML_ENTITY_FEATURE_COUNT + 28;
- /**
- * The feature id for the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CHANGE_TRACKING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 29;
- /**
- * The feature id for the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CACHE = OrmPackage.XML_ENTITY_FEATURE_COUNT + 30;
- /**
- * The feature id for the '<em><b>Existence Checking</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXISTENCE_CHECKING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 31;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CONVERTERS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 32;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__TYPE_CONVERTERS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 33;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 34;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__STRUCT_CONVERTERS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 35;
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 36;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__PROPERTIES = OrmPackage.XML_ENTITY_FEATURE_COUNT + 37;
- /**
- * The feature id for the '<em><b>Optimistic Locking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__OPTIMISTIC_LOCKING = OrmPackage.XML_ENTITY_FEATURE_COUNT + 38;
- /**
- * The feature id for the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__COPY_POLICY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 39;
- /**
- * The feature id for the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__INSTANTIATION_COPY_POLICY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 40;
- /**
- * The feature id for the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__CLONE_COPY_POLICY = OrmPackage.XML_ENTITY_FEATURE_COUNT + 41;
- /**
- * The feature id for the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS = OrmPackage.XML_ENTITY_FEATURE_COUNT + 42;
- /**
- * The number of structural features of the '<em>Xml Entity</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_FEATURE_COUNT = OrmPackage.XML_ENTITY_FEATURE_COUNT + 43;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS = 30;
- /**
- * The feature id for the '<em><b>Version</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__VERSION = OrmPackage.XML_ENTITY_MAPPINGS__VERSION;
- /**
- * The feature id for the '<em><b>Schema Location</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SCHEMA_LOCATION = OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA_LOCATION;
- /**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS__NAMED_QUERIES;
- /**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS__NAMED_NATIVE_QUERIES;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ACCESS = OrmPackage.XML_ENTITY_MAPPINGS__ACCESS;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__DESCRIPTION = OrmPackage.XML_ENTITY_MAPPINGS__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Persistence Unit Metadata</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA = OrmPackage.XML_ENTITY_MAPPINGS__PERSISTENCE_UNIT_METADATA;
- /**
- * The feature id for the '<em><b>Package</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PACKAGE = OrmPackage.XML_ENTITY_MAPPINGS__PACKAGE;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SCHEMA = OrmPackage.XML_ENTITY_MAPPINGS__SCHEMA;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__CATALOG = OrmPackage.XML_ENTITY_MAPPINGS__CATALOG;
- /**
- * The feature id for the '<em><b>Sequence Generators</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS = OrmPackage.XML_ENTITY_MAPPINGS__SEQUENCE_GENERATORS;
- /**
- * The feature id for the '<em><b>Table Generators</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__TABLE_GENERATORS = OrmPackage.XML_ENTITY_MAPPINGS__TABLE_GENERATORS;
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS = OrmPackage.XML_ENTITY_MAPPINGS__SQL_RESULT_SET_MAPPINGS;
- /**
- * The feature id for the '<em><b>Mapped Superclasses</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES = OrmPackage.XML_ENTITY_MAPPINGS__MAPPED_SUPERCLASSES;
- /**
- * The feature id for the '<em><b>Entities</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ENTITIES = OrmPackage.XML_ENTITY_MAPPINGS__ENTITIES;
- /**
- * The feature id for the '<em><b>Embeddables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__EMBEDDABLES = OrmPackage.XML_ENTITY_MAPPINGS__EMBEDDABLES;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ACCESS_METHODS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PINNED_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__RANGE_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__VALUE_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__HASH_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__UNION_PARTITIONING = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PLSQL_RECORDS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__PLSQL_TABLES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__TYPE_CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 19;
- /**
- * The number of structural features of the '<em>Xml Entity Mappings</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_FEATURE_COUNT = OrmPackage.XML_ENTITY_MAPPINGS_FEATURE_COUNT + 20;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute <em>Xml Fetch Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute()
- * @generated
- */
- public static final int XML_FETCH_ATTRIBUTE = 31;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_ATTRIBUTE__NAME = EclipseLinkOrmV2_1Package.XML_FETCH_ATTRIBUTE_21__NAME;
- /**
- * The number of structural features of the '<em>Xml Fetch Attribute</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_ATTRIBUTE_FEATURE_COUNT = EclipseLinkOrmV2_1Package.XML_FETCH_ATTRIBUTE_21_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup <em>Xml Fetch Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup()
- * @generated
- */
- public static final int XML_FETCH_GROUP = 32;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP__NAME = EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_21__NAME;
- /**
- * The feature id for the '<em><b>Load</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP__LOAD = EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_21__LOAD;
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP__ATTRIBUTES = EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_21__ATTRIBUTES;
- /**
- * The number of structural features of the '<em>Xml Fetch Group</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_FEATURE_COUNT = EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_21_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId()
- * @generated
- */
- public static final int XML_ID = 34;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex <em>Xml Index</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex()
- * @generated
- */
- public static final int XML_INDEX = 35;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy <em>Xml Instantiation Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlInstantiationCopyPolicy()
- * @generated
- */
- public static final int XML_INSTANTIATION_COPY_POLICY = 36;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch <em>Xml Join Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch()
- * @generated
- */
- public static final int XML_JOIN_FETCH = 37;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinTable()
- * @generated
- */
- public static final int XML_JOIN_TABLE = 38;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final int XML_MANY_TO_MANY = 39;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne()
- * @generated
- */
- public static final int XML_MANY_TO_ONE = 40;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS = 41;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable <em>Xml Mutable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable()
- * @generated
- */
- public static final int XML_MUTABLE = 44;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY = 49;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter <em>Xml Object Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter()
- * @generated
- */
- public static final int XML_OBJECT_TYPE_CONVERTER = 50;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final int XML_ONE_TO_MANY = 51;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne()
- * @generated
- */
- public static final int XML_ONE_TO_ONE = 52;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking <em>Xml Optimistic Locking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking()
- * @generated
- */
- public static final int XML_OPTIMISTIC_LOCKING = 53;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn()
- * @generated
- */
- public static final int XML_ORDER_COLUMN = 54;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS = 56;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA = 57;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey <em>Xml Primary Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey()
- * @generated
- */
- public static final int XML_PRIMARY_KEY = 61;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned <em>Xml Private Owned</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned()
- * @generated
- */
- public static final int XML_PRIVATE_OWNED = 62;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty()
- * @generated
- */
- public static final int XML_PROPERTY = 63;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer <em>Xml Property Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer()
- * @generated
- */
- public static final int XML_PROPERTY_CONTAINER = 64;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer()
- * @generated
- */
- public static final int XML_QUERY_CONTAINER = 65;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors <em>Xml Query Redirectors</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors()
- * @generated
- */
- public static final int XML_QUERY_REDIRECTORS = 66;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly <em>Xml Read Only</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly()
- * @generated
- */
- public static final int XML_READ_ONLY = 68;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert <em>Xml Return Insert</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReturnInsert()
- * @generated
- */
- public static final int XML_RETURN_INSERT = 70;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlSecondaryTable()
- * @generated
- */
- public static final int XML_SECONDARY_TABLE = 72;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter()
- * @generated
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER = 73;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter <em>Xml Struct Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter()
- * @generated
- */
- public static final int XML_STRUCT_CONVERTER = 75;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTable()
- * @generated
- */
- public static final int XML_TABLE = 77;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTableGenerator()
- * @generated
- */
- public static final int XML_TABLE_GENERATOR = 78;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay <em>Xml Time Of Day</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay()
- * @generated
- */
- public static final int XML_TIME_OF_DAY = 80;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation()
- * @generated
- */
- public static final int XML_TRANSFORMATION = 81;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransient()
- * @generated
- */
- public static final int XML_TRANSIENT = 82;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter <em>Xml Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter()
- * @generated
- */
- public static final int XML_TYPE_CONVERTER = 83;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne <em>Xml Variable One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne()
- * @generated
- */
- public static final int XML_VARIABLE_ONE_TO_ONE = 87;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion()
- * @generated
- */
- public static final int XML_VERSION = 88;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning <em>Xml Hash Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlHashPartitioning()
- * @generated
- */
- public static final int XML_HASH_PARTITIONING = 33;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_HASH_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_HASH_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Hash Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_HASH_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_HASH_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__ACCESS = OrmPackage.XML_ID__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__NAME = OrmPackage.XML_ID__NAME;
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__COLUMN = OrmPackage.XML_ID__COLUMN;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__LOB = OrmPackage.XML_ID__LOB;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__TEMPORAL = OrmPackage.XML_ID__TEMPORAL;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__ENUMERATED = OrmPackage.XML_ID__ENUMERATED;
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__SEQUENCE_GENERATOR = OrmPackage.XML_ID__SEQUENCE_GENERATOR;
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__TABLE_GENERATOR = OrmPackage.XML_ID__TABLE_GENERATOR;
- /**
- * The feature id for the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__GENERATED_VALUE = OrmPackage.XML_ID__GENERATED_VALUE;
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__INDEX = OrmPackage.XML_ID_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__CACHE_INDEX = OrmPackage.XML_ID_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__ACCESS_METHODS = OrmPackage.XML_ID_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__PROPERTIES = OrmPackage.XML_ID_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__ATTRIBUTE_TYPE = OrmPackage.XML_ID_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__MUTABLE = OrmPackage.XML_ID_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__CONVERT = OrmPackage.XML_ID_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__CONVERTERS = OrmPackage.XML_ID_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__TYPE_CONVERTERS = OrmPackage.XML_ID_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ID_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID__STRUCT_CONVERTERS = OrmPackage.XML_ID_FEATURE_COUNT + 10;
- /**
- * The number of structural features of the '<em>Xml Id</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_FEATURE_COUNT = OrmPackage.XML_ID_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__NAME = EclipseLinkOrmV2_2Package.XML_INDEX_22__NAME;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__SCHEMA = EclipseLinkOrmV2_2Package.XML_INDEX_22__SCHEMA;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__CATALOG = EclipseLinkOrmV2_2Package.XML_INDEX_22__CATALOG;
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__TABLE = EclipseLinkOrmV2_2Package.XML_INDEX_22__TABLE;
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__UNIQUE = EclipseLinkOrmV2_2Package.XML_INDEX_22__UNIQUE;
- /**
- * The feature id for the '<em><b>Column Names</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX__COLUMN_NAMES = EclipseLinkOrmV2_2Package.XML_INDEX_22__COLUMN_NAMES;
- /**
- * The number of structural features of the '<em>Xml Index</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_INDEX_22_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Instantiation Copy Policy</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INSTANTIATION_COPY_POLICY_FEATURE_COUNT = 0;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_FETCH__JOIN_FETCH = 0;
- /**
- * The number of structural features of the '<em>Xml Join Fetch</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_FETCH_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__NAME = OrmPackage.XML_JOIN_TABLE__NAME;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__CATALOG = OrmPackage.XML_JOIN_TABLE__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__SCHEMA = OrmPackage.XML_JOIN_TABLE__SCHEMA;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__UNIQUE_CONSTRAINTS = OrmPackage.XML_JOIN_TABLE__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__JOIN_COLUMNS = OrmPackage.XML_JOIN_TABLE__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Inverse Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS = OrmPackage.XML_JOIN_TABLE__INVERSE_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE__CREATION_SUFFIX = OrmPackage.XML_JOIN_TABLE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Join Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_FEATURE_COUNT = OrmPackage.XML_JOIN_TABLE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ACCESS = OrmPackage.XML_MANY_TO_MANY__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__NAME = OrmPackage.XML_MANY_TO_MANY__NAME;
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__TARGET_ENTITY = OrmPackage.XML_MANY_TO_MANY__TARGET_ENTITY;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__FETCH = OrmPackage.XML_MANY_TO_MANY__FETCH;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__CASCADE = OrmPackage.XML_MANY_TO_MANY__CASCADE;
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAPPED_BY = OrmPackage.XML_MANY_TO_MANY__MAPPED_BY;
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__JOIN_TABLE = OrmPackage.XML_MANY_TO_MANY__JOIN_TABLE;
- /**
- * The feature id for the '<em><b>Order Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ORDER_COLUMN = OrmPackage.XML_MANY_TO_MANY__ORDER_COLUMN;
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ORDER_BY = OrmPackage.XML_MANY_TO_MANY__ORDER_BY;
- /**
- * The feature id for the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Map Key Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_TEMPORAL = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_TEMPORAL;
- /**
- * The feature id for the '<em><b>Map Key Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_ENUMERATED = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_ENUMERATED;
- /**
- * The feature id for the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_CLASS = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_CLASS;
- /**
- * The feature id for the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_COLUMN = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_COLUMN;
- /**
- * The feature id for the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_JOIN_COLUMNS = OrmPackage.XML_MANY_TO_MANY__MAP_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY = OrmPackage.XML_MANY_TO_MANY__MAP_KEY;
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 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_MANY_TO_MANY__CONVERTERS = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 1;
- /**
- * 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_MANY_TO_MANY__TYPE_CONVERTERS = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 2;
- /**
- * 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_MANY_TO_MANY__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 3;
- /**
- * 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_MANY_TO_MANY__STRUCT_CONVERTERS = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__MAP_KEY_CONVERT = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__BATCH_FETCH = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__REPLICATION_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__PINNED_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__RANGE_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__VALUE_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__HASH_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__UNION_PARTITIONING = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__PARTITIONED = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__CASCADE_ON_DELETE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__NON_CACHEABLE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ACCESS_METHODS = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__PROPERTIES = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__ATTRIBUTE_TYPE = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY__JOIN_FETCH = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 21;
- /**
- * The number of structural features of the '<em>Xml Many To Many</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_FEATURE_COUNT = OrmPackage.XML_MANY_TO_MANY_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__ACCESS = OrmPackage.XML_MANY_TO_ONE__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__NAME = OrmPackage.XML_MANY_TO_ONE__NAME;
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__TARGET_ENTITY = OrmPackage.XML_MANY_TO_ONE__TARGET_ENTITY;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__FETCH = OrmPackage.XML_MANY_TO_ONE__FETCH;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__CASCADE = OrmPackage.XML_MANY_TO_ONE__CASCADE;
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__JOIN_TABLE = OrmPackage.XML_MANY_TO_ONE__JOIN_TABLE;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__JOIN_COLUMNS = OrmPackage.XML_MANY_TO_ONE__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__ID = OrmPackage.XML_MANY_TO_ONE__ID;
- /**
- * The feature id for the '<em><b>Maps Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__MAPS_ID = OrmPackage.XML_MANY_TO_ONE__MAPS_ID;
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__OPTIONAL = OrmPackage.XML_MANY_TO_ONE__OPTIONAL;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__BATCH_FETCH = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__REPLICATION_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__PINNED_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__RANGE_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__VALUE_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__HASH_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__UNION_PARTITIONING = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__PARTITIONED = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__NON_CACHEABLE = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__ACCESS_METHODS = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__PROPERTIES = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE__ATTRIBUTE_TYPE = OrmPackage.XML_MANY_TO_ONE_FEATURE_COUNT + 13;
- /**
- * 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 + 14;
- /**
- * 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 + 15;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ACCESS = OrmPackage.XML_MAPPED_SUPERCLASS__ACCESS;
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CLASS_NAME = OrmPackage.XML_MAPPED_SUPERCLASS__CLASS_NAME;
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__METADATA_COMPLETE = OrmPackage.XML_MAPPED_SUPERCLASS__METADATA_COMPLETE;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__DESCRIPTION = OrmPackage.XML_MAPPED_SUPERCLASS__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ATTRIBUTES = OrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTES;
- /**
- * The feature id for the '<em><b>Id Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ID_CLASS = OrmPackage.XML_MAPPED_SUPERCLASS__ID_CLASS;
- /**
- * The feature id for the '<em><b>Exclude Default Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS = OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_LISTENERS;
- /**
- * The feature id for the '<em><b>Exclude Superclass Listeners</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS = OrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_SUPERCLASS_LISTENERS;
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS = OrmPackage.XML_MAPPED_SUPERCLASS__ENTITY_LISTENERS;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ACCESS_METHODS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PARENT_CLASS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PRIMARY_KEY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CACHEABLE = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__FETCH_GROUPS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 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_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR = OrmPackage.XML_MAPPED_SUPERCLASS_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_MAPPED_SUPERCLASS__TABLE_GENERATOR = OrmPackage.XML_MAPPED_SUPERCLASS_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_MAPPED_SUPERCLASS__NAMED_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_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_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__HASH_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 21;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__UNION_PARTITIONING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PARTITIONED = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 23;
- /**
- * The feature id for the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 24;
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__MULTITENANT = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 25;
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 26;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 27;
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 28;
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PLSQL_RECORDS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 29;
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PLSQL_TABLES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 30;
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CACHE_INDEX = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 31;
- /**
- * The feature id for the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__READ_ONLY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 32;
- /**
- * The feature id for the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CUSTOMIZER = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 33;
- /**
- * The feature id for the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CHANGE_TRACKING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 34;
- /**
- * The feature id for the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CACHE = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 35;
- /**
- * The feature id for the '<em><b>Existence Checking</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 36;
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CONVERTERS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 37;
- /**
- * The feature id for the '<em><b>Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 38;
- /**
- * The feature id for the '<em><b>Object Type Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 39;
- /**
- * The feature id for the '<em><b>Struct Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 40;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__PROPERTIES = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 41;
- /**
- * The feature id for the '<em><b>Optimistic Locking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 42;
- /**
- * The feature id for the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__COPY_POLICY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 43;
- /**
- * The feature id for the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 44;
- /**
- * The feature id for the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 45;
- /**
- * The feature id for the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 46;
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_FEATURE_COUNT = OrmPackage.XML_MAPPED_SUPERCLASS_FEATURE_COUNT + 47;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant <em>Xml Multitenant</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant()
- * @generated
- */
- public static final int XML_MULTITENANT = 42;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT__TYPE = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23__TYPE;
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS;
- /**
- * The feature id for the '<em><b>Include Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT__INCLUDE_CRITERIA = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Multitenant</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_MULTITENANT_23_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder <em>Xml Multitenant Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder()
- * @generated
- */
- public static final int XML_MULTITENANT_HOLDER = 43;
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_HOLDER__MULTITENANT = 0;
- /**
- * The number of structural features of the '<em>Xml Multitenant Holder</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_HOLDER_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MUTABLE__MUTABLE = 0;
- /**
- * The number of structural features of the '<em>Xml Mutable</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MUTABLE_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery <em>Xml Named Plsql Stored Function Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredFunctionQuery()
- * @generated
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY = 46;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME = EclipseLinkOrmV2_3Package.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Named Plsql Stored Function Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery <em>Xml Named Plsql Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredProcedureQuery()
- * @generated
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY = 47;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME = EclipseLinkOrmV2_3Package.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Named Plsql Stored Procedure Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery <em>Xml Named Stored Function Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredFunctionQuery()
- * @generated
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY = 48;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY__NAME = EclipseLinkOrmV2_3Package.XML_NAMED_STORED_FUNCTION_QUERY_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Named Stored Function Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_NAMED_STORED_FUNCTION_QUERY_23_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__NAME = 0;
- /**
- * The feature id for the '<em><b>Result Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS = 1;
- /**
- * The feature id for the '<em><b>Result Set Mapping</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING = 2;
- /**
- * The feature id for the '<em><b>Procedure Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME = 3;
- /**
- * The feature id for the '<em><b>Returns Result Set</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET = 4;
- /**
- * The feature id for the '<em><b>Hints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__HINTS = 5;
- /**
- * The feature id for the '<em><b>Parameters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS = 6;
- /**
- * The number of structural features of the '<em>Xml Named Stored Procedure Query</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_PROCEDURE_QUERY_FEATURE_COUNT = 7;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__NAME = XML_NAMED_CONVERTER__NAME;
- /**
- * The feature id for the '<em><b>Data Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__DATA_TYPE = XML_NAMED_CONVERTER_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Object Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE = XML_NAMED_CONVERTER_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Conversion Values</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES = XML_NAMED_CONVERTER_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Default Object Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE = XML_NAMED_CONVERTER_FEATURE_COUNT + 3;
- /**
- * The number of structural features of the '<em>Xml Object Type Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OBJECT_TYPE_CONVERTER_FEATURE_COUNT = XML_NAMED_CONVERTER_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ACCESS = OrmPackage.XML_ONE_TO_MANY__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__NAME = OrmPackage.XML_ONE_TO_MANY__NAME;
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__TARGET_ENTITY = OrmPackage.XML_ONE_TO_MANY__TARGET_ENTITY;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__FETCH = OrmPackage.XML_ONE_TO_MANY__FETCH;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__CASCADE = OrmPackage.XML_ONE_TO_MANY__CASCADE;
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAPPED_BY = OrmPackage.XML_ONE_TO_MANY__MAPPED_BY;
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__JOIN_TABLE = OrmPackage.XML_ONE_TO_MANY__JOIN_TABLE;
- /**
- * The feature id for the '<em><b>Order Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ORDER_COLUMN = OrmPackage.XML_ONE_TO_MANY__ORDER_COLUMN;
- /**
- * The feature id for the '<em><b>Order By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ORDER_BY = OrmPackage.XML_ONE_TO_MANY__ORDER_BY;
- /**
- * The feature id for the '<em><b>Map Key Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_ATTRIBUTE_OVERRIDES;
- /**
- * The feature id for the '<em><b>Map Key Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_TEMPORAL = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_TEMPORAL;
- /**
- * The feature id for the '<em><b>Map Key Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_ENUMERATED = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_ENUMERATED;
- /**
- * The feature id for the '<em><b>Map Key Class</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_CLASS = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_CLASS;
- /**
- * The feature id for the '<em><b>Map Key Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_COLUMN = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_COLUMN;
- /**
- * The feature id for the '<em><b>Map Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_JOIN_COLUMNS = OrmPackage.XML_ONE_TO_MANY__MAP_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Map Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY = OrmPackage.XML_ONE_TO_MANY__MAP_KEY;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__JOIN_COLUMNS = OrmPackage.XML_ONE_TO_MANY__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Orphan Removal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ORPHAN_REMOVAL = OrmPackage.XML_ONE_TO_MANY__ORPHAN_REMOVAL;
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 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_ONE_TO_MANY__CONVERTERS = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 1;
- /**
- * 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_ONE_TO_MANY__TYPE_CONVERTERS = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 2;
- /**
- * 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_ONE_TO_MANY__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 3;
- /**
- * 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_ONE_TO_MANY__STRUCT_CONVERTERS = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__MAP_KEY_CONVERT = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__BATCH_FETCH = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__REPLICATION_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PINNED_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__RANGE_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__VALUE_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__HASH_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__UNION_PARTITIONING = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PARTITIONED = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 15;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__CASCADE_ON_DELETE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 16;
- /**
- * The feature id for the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__NONCACHEABLE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 17;
- /**
- * The feature id for the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__DELETE_ALL = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 18;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ACCESS_METHODS = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 19;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PROPERTIES = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 20;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__ATTRIBUTE_TYPE = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 21;
- /**
- * The feature id for the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__PRIVATE_OWNED = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 22;
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY__JOIN_FETCH = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 23;
- /**
- * The number of structural features of the '<em>Xml One To Many</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_FEATURE_COUNT = OrmPackage.XML_ONE_TO_MANY_FEATURE_COUNT + 24;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ACCESS = OrmPackage.XML_ONE_TO_ONE__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__NAME = OrmPackage.XML_ONE_TO_ONE__NAME;
- /**
- * The feature id for the '<em><b>Target Entity</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__TARGET_ENTITY = OrmPackage.XML_ONE_TO_ONE__TARGET_ENTITY;
- /**
- * The feature id for the '<em><b>Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__FETCH = OrmPackage.XML_ONE_TO_ONE__FETCH;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__CASCADE = OrmPackage.XML_ONE_TO_ONE__CASCADE;
- /**
- * The feature id for the '<em><b>Join Table</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__JOIN_TABLE = OrmPackage.XML_ONE_TO_ONE__JOIN_TABLE;
- /**
- * The feature id for the '<em><b>Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__JOIN_COLUMNS = OrmPackage.XML_ONE_TO_ONE__JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ID = OrmPackage.XML_ONE_TO_ONE__ID;
- /**
- * The feature id for the '<em><b>Maps Id</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__MAPS_ID = OrmPackage.XML_ONE_TO_ONE__MAPS_ID;
- /**
- * The feature id for the '<em><b>Optional</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__OPTIONAL = OrmPackage.XML_ONE_TO_ONE__OPTIONAL;
- /**
- * The feature id for the '<em><b>Mapped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__MAPPED_BY = OrmPackage.XML_ONE_TO_ONE__MAPPED_BY;
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS = OrmPackage.XML_ONE_TO_ONE__PRIMARY_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Orphan Removal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ORPHAN_REMOVAL = OrmPackage.XML_ONE_TO_ONE__ORPHAN_REMOVAL;
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__BATCH_FETCH = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__REPLICATION_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PINNED_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__RANGE_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__VALUE_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__HASH_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__UNION_PARTITIONING = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PARTITIONED = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__CASCADE_ON_DELETE = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__NON_CACHEABLE = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ACCESS_METHODS = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__PROPERTIES = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 13;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE__ATTRIBUTE_TYPE = OrmPackage.XML_ONE_TO_ONE_FEATURE_COUNT + 14;
- /**
- * 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 + 15;
- /**
- * 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 + 16;
- /**
- * 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 + 17;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OPTIMISTIC_LOCKING__TYPE = 0;
- /**
- * The feature id for the '<em><b>Cascade</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OPTIMISTIC_LOCKING__CASCADE = 1;
- /**
- * The feature id for the '<em><b>Selected Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS = 2;
- /**
- * The number of structural features of the '<em>Xml Optimistic Locking</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_OPTIMISTIC_LOCKING_FEATURE_COUNT = 3;
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__COLUMN_DEFINITION = OrmPackage.XML_ORDER_COLUMN__COLUMN_DEFINITION;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__NAME = OrmPackage.XML_ORDER_COLUMN__NAME;
- /**
- * The feature id for the '<em><b>Nullable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__NULLABLE = OrmPackage.XML_ORDER_COLUMN__NULLABLE;
- /**
- * The feature id for the '<em><b>Insertable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__INSERTABLE = OrmPackage.XML_ORDER_COLUMN__INSERTABLE;
- /**
- * The feature id for the '<em><b>Updatable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__UPDATABLE = OrmPackage.XML_ORDER_COLUMN__UPDATABLE;
- /**
- * The feature id for the '<em><b>Correction Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN__CORRECTION_TYPE = OrmPackage.XML_ORDER_COLUMN_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Order Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN_FEATURE_COUNT = OrmPackage.XML_ORDER_COLUMN_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning <em>Xml Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioning()
- * @generated
- */
- public static final int XML_PARTITIONING = 55;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Delimited Identifiers</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__DELIMITED_IDENTIFIERS;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__SCHEMA;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CATALOG;
- /**
- * The feature id for the '<em><b>Cascade Persist</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__CASCADE_PERSIST;
- /**
- * The feature id for the '<em><b>Entity Listeners</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ENTITY_LISTENERS;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Defaults</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT = OrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__DESCRIPTION = OrmPackage.XML_PERSISTENCE_UNIT_METADATA__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Xml Mapping Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE = OrmPackage.XML_PERSISTENCE_UNIT_METADATA__XML_MAPPING_METADATA_COMPLETE;
- /**
- * The feature id for the '<em><b>Persistence Unit Defaults</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS = OrmPackage.XML_PERSISTENCE_UNIT_METADATA__PERSISTENCE_UNIT_DEFAULTS;
- /**
- * The feature id for the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS = OrmPackage.XML_PERSISTENCE_UNIT_METADATA_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Metadata</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_METADATA_FEATURE_COUNT = OrmPackage.XML_PERSISTENCE_UNIT_METADATA_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning <em>Xml Pinned Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPinnedPartitioning()
- * @generated
- */
- public static final int XML_PINNED_PARTITIONING = 58;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PINNED_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_PINNED_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Pinned Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PINNED_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_PINNED_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord <em>Xml Plsql Record</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlRecord()
- * @generated
- */
- public static final int XML_PLSQL_RECORD = 59;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_RECORD__NAME = EclipseLinkOrmV2_3Package.XML_PLSQL_RECORD_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Plsql Record</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_RECORD_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_PLSQL_RECORD_23_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable <em>Xml Plsql Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlTable()
- * @generated
- */
- public static final int XML_PLSQL_TABLE = 60;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_TABLE__NAME = EclipseLinkOrmV2_3Package.XML_PLSQL_TABLE_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Plsql Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_TABLE_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_PLSQL_TABLE_23_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Validation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY__VALIDATION = EclipseLinkOrmV1_1Package.XML_PRIMARY_KEY_11__VALIDATION;
- /**
- * The feature id for the '<em><b>Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY__COLUMNS = EclipseLinkOrmV1_1Package.XML_PRIMARY_KEY_11__COLUMNS;
- /**
- * The feature id for the '<em><b>Cache Key Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY__CACHE_KEY_TYPE = EclipseLinkOrmV1_1Package.XML_PRIMARY_KEY_11_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Primary Key</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_FEATURE_COUNT = EclipseLinkOrmV1_1Package.XML_PRIMARY_KEY_11_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIVATE_OWNED__PRIVATE_OWNED = 0;
- /**
- * The number of structural features of the '<em>Xml Private Owned</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIVATE_OWNED_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY__NAME = 0;
- /**
- * The feature id for the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY__VALUE = 1;
- /**
- * The feature id for the '<em><b>Value Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY__VALUE_TYPE = 2;
- /**
- * The number of structural features of the '<em>Xml Property</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY_FEATURE_COUNT = 3;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY_CONTAINER__PROPERTIES = 0;
- /**
- * The number of structural features of the '<em>Xml Property Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PROPERTY_CONTAINER_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES = 0;
- /**
- * The number of structural features of the '<em>Xml Query Container</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_CONTAINER_FEATURE_COUNT = 1;
- /**
- * The feature id for the '<em><b>All Queries</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__ALL_QUERIES = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__ALL_QUERIES;
- /**
- * The feature id for the '<em><b>Read All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__READ_ALL = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__READ_ALL;
- /**
- * The feature id for the '<em><b>Read Object</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__READ_OBJECT = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__READ_OBJECT;
- /**
- * The feature id for the '<em><b>Report</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__REPORT = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__REPORT;
- /**
- * The feature id for the '<em><b>Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__UPDATE = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__UPDATE;
- /**
- * The feature id for the '<em><b>Insert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__INSERT = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__INSERT;
- /**
- * The feature id for the '<em><b>Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS__DELETE = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20__DELETE;
- /**
- * The number of structural features of the '<em>Xml Query Redirectors</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_FEATURE_COUNT = EclipseLinkOrmV2_0Package.XML_QUERY_REDIRECTORS_20_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning <em>Xml Range Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRangePartitioning()
- * @generated
- */
- public static final int XML_RANGE_PARTITIONING = 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_RANGE_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_RANGE_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Range Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RANGE_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_RANGE_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_READ_ONLY__READ_ONLY = 0;
- /**
- * The number of structural features of the '<em>Xml Read Only</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_READ_ONLY_FEATURE_COUNT = 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning <em>Xml Replication Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReplicationPartitioning()
- * @generated
- */
- public static final int XML_REPLICATION_PARTITIONING = 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_REPLICATION_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_REPLICATION_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Replication Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_REPLICATION_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_REPLICATION_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Return Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RETURN_INSERT__RETURN_ONLY = EclipseLinkOrmV2_1Package.XML_RETURN_INSERT_21__RETURN_ONLY;
- /**
- * The number of structural features of the '<em>Xml Return Insert</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RETURN_INSERT_FEATURE_COUNT = EclipseLinkOrmV2_1Package.XML_RETURN_INSERT_21_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning <em>Xml Round Robin Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRoundRobinPartitioning()
- * @generated
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING = 71;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_ROUND_ROBIN_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Round Robin Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_ROUND_ROBIN_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__NAME = OrmPackage.XML_SECONDARY_TABLE__NAME;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__CATALOG = OrmPackage.XML_SECONDARY_TABLE__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__SCHEMA = OrmPackage.XML_SECONDARY_TABLE__SCHEMA;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__UNIQUE_CONSTRAINTS = OrmPackage.XML_SECONDARY_TABLE__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Primary Key Join Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS = OrmPackage.XML_SECONDARY_TABLE__PRIMARY_KEY_JOIN_COLUMNS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE__CREATION_SUFFIX = OrmPackage.XML_SECONDARY_TABLE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Secondary Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_FEATURE_COUNT = OrmPackage.XML_SECONDARY_TABLE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Direction</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__DIRECTION = 0;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__NAME = 1;
- /**
- * The feature id for the '<em><b>Query Parameter</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER = 2;
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__TYPE = 3;
- /**
- * The feature id for the '<em><b>Jdbc Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE = 4;
- /**
- * The feature id for the '<em><b>Jdbc Type Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME = 5;
- /**
- * The number of structural features of the '<em>Xml Stored Procedure Parameter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STORED_PROCEDURE_PARAMETER_FEATURE_COUNT = 6;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct <em>Xml Struct</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStruct()
- * @generated
- */
- public static final int XML_STRUCT = 74;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT__NAME = EclipseLinkOrmV2_3Package.XML_STRUCT_23__NAME;
- /**
- * The number of structural features of the '<em>Xml Struct</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_FEATURE_COUNT = EclipseLinkOrmV2_3Package.XML_STRUCT_23_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER__NAME = XML_NAMED_CONVERTER__NAME;
- /**
- * The feature id for the '<em><b>Converter</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER__CONVERTER = XML_NAMED_CONVERTER_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Struct Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_CONVERTER_FEATURE_COUNT = XML_NAMED_CONVERTER_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure <em>Xml Structure</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructure()
- * @generated
- */
- public static final int XML_STRUCTURE = 76;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Structure</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__NAME = OrmPackage.XML_TABLE__NAME;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__CATALOG = OrmPackage.XML_TABLE__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__SCHEMA = OrmPackage.XML_TABLE__SCHEMA;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__UNIQUE_CONSTRAINTS = OrmPackage.XML_TABLE__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE__CREATION_SUFFIX = OrmPackage.XML_TABLE_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Table</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_FEATURE_COUNT = OrmPackage.XML_TABLE_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__DESCRIPTION = OrmPackage.XML_TABLE_GENERATOR__DESCRIPTION;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__NAME = OrmPackage.XML_TABLE_GENERATOR__NAME;
- /**
- * The feature id for the '<em><b>Initial Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__INITIAL_VALUE = OrmPackage.XML_TABLE_GENERATOR__INITIAL_VALUE;
- /**
- * The feature id for the '<em><b>Allocation Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__ALLOCATION_SIZE = OrmPackage.XML_TABLE_GENERATOR__ALLOCATION_SIZE;
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__TABLE = OrmPackage.XML_TABLE_GENERATOR__TABLE;
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__CATALOG = OrmPackage.XML_TABLE_GENERATOR__CATALOG;
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__SCHEMA = OrmPackage.XML_TABLE_GENERATOR__SCHEMA;
- /**
- * The feature id for the '<em><b>Pk Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__PK_COLUMN_NAME = OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_NAME;
- /**
- * The feature id for the '<em><b>Value Column Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__VALUE_COLUMN_NAME = OrmPackage.XML_TABLE_GENERATOR__VALUE_COLUMN_NAME;
- /**
- * The feature id for the '<em><b>Pk Column Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__PK_COLUMN_VALUE = OrmPackage.XML_TABLE_GENERATOR__PK_COLUMN_VALUE;
- /**
- * The feature id for the '<em><b>Unique Constraints</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS = OrmPackage.XML_TABLE_GENERATOR__UNIQUE_CONSTRAINTS;
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR__CREATION_SUFFIX = OrmPackage.XML_TABLE_GENERATOR_FEATURE_COUNT + 0;
- /**
- * The number of structural features of the '<em>Xml Table Generator</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_FEATURE_COUNT = OrmPackage.XML_TABLE_GENERATOR_FEATURE_COUNT + 1;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn <em>Xml Tenant Discriminator Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn()
- * @generated
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN = 79;
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__NAME = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN__NAME;
- /**
- * The feature id for the '<em><b>Discriminator Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE;
- /**
- * The feature id for the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__LENGTH = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN__LENGTH;
- /**
- * The feature id for the '<em><b>Context Property</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__TABLE = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Tenant Discriminator Column</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Hour</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__HOUR = 0;
- /**
- * The feature id for the '<em><b>Minute</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__MINUTE = 1;
- /**
- * The feature id for the '<em><b>Second</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__SECOND = 2;
- /**
- * The feature id for the '<em><b>Millisecond</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY__MILLISECOND = 3;
- /**
- * The number of structural features of the '<em>Xml Time Of Day</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TIME_OF_DAY_FEATURE_COUNT = 4;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Transformation</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSFORMATION_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__ACCESS = OrmPackage.XML_TRANSIENT__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__NAME = OrmPackage.XML_TRANSIENT__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__ACCESS_METHODS = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__PROPERTIES = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT__ATTRIBUTE_TYPE = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 2;
- /**
- * The number of structural features of the '<em>Xml Transient</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TRANSIENT_FEATURE_COUNT = OrmPackage.XML_TRANSIENT_FEATURE_COUNT + 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_TYPE_CONVERTER__NAME = XML_NAMED_CONVERTER__NAME;
- /**
- * The feature id for the '<em><b>Data Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_CONVERTER__DATA_TYPE = XML_NAMED_CONVERTER_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Object Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_CONVERTER__OBJECT_TYPE = XML_NAMED_CONVERTER_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the '<em>Xml Type Converter</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_CONVERTER_FEATURE_COUNT = XML_NAMED_CONVERTER_FEATURE_COUNT + 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping <em>Xml Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeMapping()
- * @generated
- */
- public static final int XML_TYPE_MAPPING = 84;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__ACCESS = OrmPackage.XML_TYPE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__CLASS_NAME = OrmPackage.XML_TYPE_MAPPING__CLASS_NAME;
- /**
- * The feature id for the '<em><b>Metadata Complete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__METADATA_COMPLETE = OrmPackage.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_TYPE_MAPPING__DESCRIPTION = OrmPackage.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_TYPE_MAPPING__ATTRIBUTES = OrmPackage.XML_TYPE_MAPPING__ATTRIBUTES;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__ACCESS_METHODS = OrmPackage.XML_TYPE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING__PARENT_CLASS = OrmPackage.XML_TYPE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The number of structural features of the '<em>Xml Type Mapping</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING_FEATURE_COUNT = OrmPackage.XML_TYPE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning <em>Xml Union Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlUnionPartitioning()
- * @generated
- */
- public static final int XML_UNION_PARTITIONING = 85;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNION_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_UNION_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Union Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNION_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_UNION_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning <em>Xml Value Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlValuePartitioning()
- * @generated
- */
- public static final int XML_VALUE_PARTITIONING = 86;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VALUE_PARTITIONING__NAME = EclipseLinkOrmV2_2Package.XML_VALUE_PARTITIONING_22__NAME;
- /**
- * The number of structural features of the '<em>Xml Value Partitioning</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VALUE_PARTITIONING_FEATURE_COUNT = EclipseLinkOrmV2_2Package.XML_VALUE_PARTITIONING_22_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__ACCESS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__NAME = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING__NAME;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__PROPERTIES = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 5;
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 6;
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 7;
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8;
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9;
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10;
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__PARTITIONED = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 11;
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 12;
- /**
- * The feature id for the '<em><b>Target Interface</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 13;
- /**
- * The number of structural features of the '<em>Xml Variable One To One</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_FEATURE_COUNT = OrmPackage.ABSTRACT_XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 14;
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__ACCESS = OrmPackage.XML_VERSION__ACCESS;
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__NAME = OrmPackage.XML_VERSION__NAME;
- /**
- * The feature id for the '<em><b>Column</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__COLUMN = OrmPackage.XML_VERSION__COLUMN;
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__LOB = OrmPackage.XML_VERSION__LOB;
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__TEMPORAL = OrmPackage.XML_VERSION__TEMPORAL;
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__ENUMERATED = OrmPackage.XML_VERSION__ENUMERATED;
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__INDEX = OrmPackage.XML_VERSION_FEATURE_COUNT + 0;
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__ACCESS_METHODS = OrmPackage.XML_VERSION_FEATURE_COUNT + 1;
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__PROPERTIES = OrmPackage.XML_VERSION_FEATURE_COUNT + 2;
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__ATTRIBUTE_TYPE = OrmPackage.XML_VERSION_FEATURE_COUNT + 3;
- /**
- * The feature id for the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION__MUTABLE = OrmPackage.XML_VERSION_FEATURE_COUNT + 4;
- /**
- * The feature id for the '<em><b>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 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_VERSION__CONVERTERS = OrmPackage.XML_VERSION_FEATURE_COUNT + 6;
- /**
- * 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_VERSION__TYPE_CONVERTERS = OrmPackage.XML_VERSION_FEATURE_COUNT + 7;
- /**
- * 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_VERSION__OBJECT_TYPE_CONVERTERS = OrmPackage.XML_VERSION_FEATURE_COUNT + 8;
- /**
- * 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_VERSION__STRUCT_CONVERTERS = OrmPackage.XML_VERSION_FEATURE_COUNT + 9;
- /**
- * The number of structural features of the '<em>Xml Version</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_FEATURE_COUNT = OrmPackage.XML_VERSION_FEATURE_COUNT + 10;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType <em>Cache Coordination Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheCoordinationType()
- * @generated
- */
- public static final int CACHE_COORDINATION_TYPE = 89;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType <em>Cache Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheType()
- * @generated
- */
- public static final int CACHE_TYPE = 90;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingType()
- * @generated
- */
- public static final int XML_CHANGE_TRACKING_TYPE = 91;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection <em>Xml Direction</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlDirection()
- * @generated
- */
- public static final int XML_DIRECTION = 92;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType <em>Existence Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getExistenceType()
- * @generated
- */
- public static final int EXISTENCE_TYPE = 93;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType <em>Xml Join Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetchType()
- * @generated
- */
- public static final int XML_JOIN_FETCH_TYPE = 94;
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType <em>Xml Optimistic Locking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLockingType()
- * @generated
- */
- public static final int XML_OPTIMISTIC_LOCKING_TYPE = 95;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAccessMethodsEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAccessMethodsHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAdditionalCriteriaEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlArrayEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributeMappingEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass attributesEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicCollectionEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicMapEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBatchFetchEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBatchFetchHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCacheEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCacheHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCacheIndexEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlChangeTrackingEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlChangeTrackingHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCloneCopyPolicyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCollectionTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConversionValueEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConverterContainerEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlConvertibleMappingEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCopyPolicyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCustomizerEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCustomizerHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollectionEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddedIdEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappingsEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchAttributeEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchGroupEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIdEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIndexEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlInstantiationCopyPolicyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinFetchEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToManyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOneEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclassEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultitenantEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultitenantHolderEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMutableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedPlsqlStoredFunctionQueryEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedPlsqlStoredProcedureQueryEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedStoredFunctionQueryEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedStoredProcedureQueryEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlObjectTypeConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToManyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOneEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOptimisticLockingEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOrderColumnEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitDefaultsEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitMetadataEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrimaryKeyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrivateOwnedEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPropertyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPropertyContainerEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryContainerEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryRedirectorsEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReadOnlyEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReturnInsertEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSecondaryTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStoredProcedureParameterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructureEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableGeneratorEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTenantDiscriminatorColumnEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTimeOfDayEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransformationEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTransientEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTypeConverterEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTypeMappingEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVariableOneToOneEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersionEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlHashPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPinnedPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPlsqlRecordEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPlsqlTableEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRangePartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReplicationPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRoundRobinPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlUnionPartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlValuePartitioningEClass = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheCoordinationTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlChangeTrackingTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlDirectionEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum existenceTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlJoinFetchTypeEEnum = null;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum xmlOptimisticLockingTypeEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmPackage()
- {
- super(eNS_URI, EclipseLinkOrmFactory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmPackage#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmPackage init()
- {
- if (isInited) return (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmPackage());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmPackage.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmPackage.eNS_URI, theEclipseLinkOrmPackage);
- return theEclipseLinkOrmPackage;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods <em>Xml Access Methods</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Access Methods</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods
- * @generated
- */
- public EClass getXmlAccessMethods()
- {
- return xmlAccessMethodsEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getGetMethod <em>Get Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Get Method</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getGetMethod()
- * @see #getXmlAccessMethods()
- * @generated
- */
- public EAttribute getXmlAccessMethods_GetMethod()
- {
- return (EAttribute)xmlAccessMethodsEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getSetMethod <em>Set Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Set Method</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getSetMethod()
- * @see #getXmlAccessMethods()
- * @generated
- */
- public EAttribute getXmlAccessMethods_SetMethod()
- {
- return (EAttribute)xmlAccessMethodsEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder <em>Xml Access Methods Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Access Methods Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder
- * @generated
- */
- public EClass getXmlAccessMethodsHolder()
- {
- return xmlAccessMethodsHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder#getAccessMethods <em>Access Methods</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Access Methods</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder#getAccessMethods()
- * @see #getXmlAccessMethodsHolder()
- * @generated
- */
- public EReference getXmlAccessMethodsHolder_AccessMethods()
- {
- return (EReference)xmlAccessMethodsHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria <em>Xml Additional Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Additional Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria
- * @generated
- */
- public EClass getXmlAdditionalCriteria()
- {
- return xmlAdditionalCriteriaEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray <em>Xml Array</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Array</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray
- * @generated
- */
- public EClass getXmlArray()
- {
- return xmlArrayEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attribute Mapping</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping
- * @generated
- */
- public EClass getXmlAttributeMapping()
- {
- return xmlAttributeMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping#getAttributeType <em>Attribute Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Attribute Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping#getAttributeType()
- * @see #getXmlAttributeMapping()
- * @generated
- */
- public EAttribute getXmlAttributeMapping_AttributeType()
- {
- return (EAttribute)xmlAttributeMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Attributes</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes
- * @generated
- */
- public EClass getAttributes()
- {
- return attributesEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicCollections <em>Basic Collections</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Basic Collections</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicCollections()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_BasicCollections()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicMaps <em>Basic Maps</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Basic Maps</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getBasicMaps()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_BasicMaps()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getTransformations <em>Transformations</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Transformations</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getTransformations()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_Transformations()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getVariableOneToOnes <em>Variable One To Ones</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Variable One To Ones</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes#getVariableOneToOnes()
- * @see #getAttributes()
- * @generated
- */
- public EReference getAttributes_VariableOneToOnes()
- {
- return (EReference)attributesEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic <em>Xml Basic</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic
- * @generated
- */
- public EClass getXmlBasic()
- {
- return xmlBasicEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Collection</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection
- * @generated
- */
- public EClass getXmlBasicCollection()
- {
- return xmlBasicCollectionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Map</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap
- * @generated
- */
- public EClass getXmlBasicMap()
- {
- return xmlBasicMapEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch <em>Xml Batch Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Batch Fetch</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch
- * @generated
- */
- public EClass getXmlBatchFetch()
- {
- return xmlBatchFetchEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder <em>Xml Batch Fetch Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Batch Fetch Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder
- * @generated
- */
- public EClass getXmlBatchFetchHolder()
- {
- return xmlBatchFetchHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder#getBatchFetch <em>Batch Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Batch Fetch</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder#getBatchFetch()
- * @see #getXmlBatchFetchHolder()
- * @generated
- */
- public EReference getXmlBatchFetchHolder_BatchFetch()
- {
- return (EReference)xmlBatchFetchHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache <em>Xml Cache</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache
- * @generated
- */
- public EClass getXmlCache()
- {
- return xmlCacheEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiry <em>Expiry</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Expiry</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiry()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_Expiry()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getSize <em>Size</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Size</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getSize()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_Size()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getShared <em>Shared</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Shared</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getShared()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_Shared()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getType()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_Type()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getAlwaysRefresh <em>Always Refresh</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Always Refresh</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getAlwaysRefresh()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_AlwaysRefresh()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getRefreshOnlyIfNewer <em>Refresh Only If Newer</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Refresh Only If Newer</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getRefreshOnlyIfNewer()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_RefreshOnlyIfNewer()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDisableHits <em>Disable Hits</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Disable Hits</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDisableHits()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_DisableHits()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getCoordinationType <em>Coordination Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Coordination Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getCoordinationType()
- * @see #getXmlCache()
- * @generated
- */
- public EAttribute getXmlCache_CoordinationType()
- {
- return (EAttribute)xmlCacheEClass.getEStructuralFeatures().get(7);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiryTimeOfDay <em>Expiry Time Of Day</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Expiry Time Of Day</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiryTimeOfDay()
- * @see #getXmlCache()
- * @generated
- */
- public EReference getXmlCache_ExpiryTimeOfDay()
- {
- return (EReference)xmlCacheEClass.getEStructuralFeatures().get(8);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder <em>Xml Cache Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder
- * @generated
- */
- public EClass getXmlCacheHolder()
- {
- return xmlCacheHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getCache <em>Cache</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getCache()
- * @see #getXmlCacheHolder()
- * @generated
- */
- public EReference getXmlCacheHolder_Cache()
- {
- return (EReference)xmlCacheHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getExistenceChecking <em>Existence Checking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Existence Checking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getExistenceChecking()
- * @see #getXmlCacheHolder()
- * @generated
- */
- public EAttribute getXmlCacheHolder_ExistenceChecking()
- {
- return (EAttribute)xmlCacheHolderEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex <em>Xml Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex
- * @generated
- */
- public EClass getXmlCacheIndex()
- {
- return xmlCacheIndexEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking <em>Xml Change Tracking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Change Tracking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking
- * @generated
- */
- public EClass getXmlChangeTracking()
- {
- return xmlChangeTrackingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking#getType()
- * @see #getXmlChangeTracking()
- * @generated
- */
- public EAttribute getXmlChangeTracking_Type()
- {
- return (EAttribute)xmlChangeTrackingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder <em>Xml Change Tracking Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Change Tracking Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder
- * @generated
- */
- public EClass getXmlChangeTrackingHolder()
- {
- return xmlChangeTrackingHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder#getChangeTracking <em>Change Tracking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Change Tracking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder#getChangeTracking()
- * @see #getXmlChangeTrackingHolder()
- * @generated
- */
- public EReference getXmlChangeTrackingHolder_ChangeTracking()
- {
- return (EReference)xmlChangeTrackingHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy <em>Xml Clone Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Clone Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy
- * @generated
- */
- public EClass getXmlCloneCopyPolicy()
- {
- return xmlCloneCopyPolicyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getMethod <em>Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Method</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getMethod()
- * @see #getXmlCloneCopyPolicy()
- * @generated
- */
- public EAttribute getXmlCloneCopyPolicy_Method()
- {
- return (EAttribute)xmlCloneCopyPolicyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getWorkingCopyMethod <em>Working Copy Method</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Working Copy Method</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getWorkingCopyMethod()
- * @see #getXmlCloneCopyPolicy()
- * @generated
- */
- public EAttribute getXmlCloneCopyPolicy_WorkingCopyMethod()
- {
- return (EAttribute)xmlCloneCopyPolicyEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable <em>Xml Collection Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Collection Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable
- * @generated
- */
- public EClass getXmlCollectionTable()
- {
- return xmlCollectionTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue <em>Xml Conversion Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Conversion Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue
- * @generated
- */
- public EClass getXmlConversionValue()
- {
- return xmlConversionValueEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getDataValue <em>Data Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Data Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getDataValue()
- * @see #getXmlConversionValue()
- * @generated
- */
- public EAttribute getXmlConversionValue_DataValue()
- {
- return (EAttribute)xmlConversionValueEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getObjectValue <em>Object Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Object Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getObjectValue()
- * @see #getXmlConversionValue()
- * @generated
- */
- public EAttribute getXmlConversionValue_ObjectValue()
- {
- return (EAttribute)xmlConversionValueEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter <em>Xml Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter
- * @generated
- */
- public EClass getXmlConverter()
- {
- return xmlConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter#getClassName <em>Class Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Class Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter#getClassName()
- * @see #getXmlConverter()
- * @generated
- */
- public EAttribute getXmlConverter_ClassName()
- {
- return (EAttribute)xmlConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer <em>Xml Converter Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Converter Container</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer
- * @generated
- */
- public EClass getXmlConverterContainer()
- {
- return xmlConverterContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getConverters <em>Converters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Converters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getConverters()
- * @see #getXmlConverterContainer()
- * @generated
- */
- public EReference getXmlConverterContainer_Converters()
- {
- return (EReference)xmlConverterContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getTypeConverters <em>Type Converters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Type Converters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getTypeConverters()
- * @see #getXmlConverterContainer()
- * @generated
- */
- public EReference getXmlConverterContainer_TypeConverters()
- {
- return (EReference)xmlConverterContainerEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getObjectTypeConverters <em>Object Type Converters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Object Type Converters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getObjectTypeConverters()
- * @see #getXmlConverterContainer()
- * @generated
- */
- public EReference getXmlConverterContainer_ObjectTypeConverters()
- {
- return (EReference)xmlConverterContainerEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getStructConverters <em>Struct Converters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Struct Converters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getStructConverters()
- * @see #getXmlConverterContainer()
- * @generated
- */
- public EReference getXmlConverterContainer_StructConverters()
- {
- return (EReference)xmlConverterContainerEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Convertible Mapping</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping
- * @generated
- */
- public EClass getXmlConvertibleMapping()
- {
- return xmlConvertibleMappingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping#getConvert <em>Convert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Convert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping#getConvert()
- * @see #getXmlConvertibleMapping()
- * @generated
- */
- public EAttribute getXmlConvertibleMapping_Convert()
- {
- return (EAttribute)xmlConvertibleMappingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy <em>Xml Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy
- * @generated
- */
- public EClass getXmlCopyPolicy()
- {
- return xmlCopyPolicyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_ <em>Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Class</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_()
- * @see #getXmlCopyPolicy()
- * @generated
- */
- public EAttribute getXmlCopyPolicy_Class()
- {
- return (EAttribute)xmlCopyPolicyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer <em>Xml Customizer</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Customizer</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer
- * @generated
- */
- public EClass getXmlCustomizer()
- {
- return xmlCustomizerEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer#getCustomizerClassName <em>Customizer Class Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Customizer Class Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer#getCustomizerClassName()
- * @see #getXmlCustomizer()
- * @generated
- */
- public EAttribute getXmlCustomizer_CustomizerClassName()
- {
- return (EAttribute)xmlCustomizerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder <em>Xml Customizer Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Customizer Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder
- * @generated
- */
- public EClass getXmlCustomizerHolder()
- {
- return xmlCustomizerHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder#getCustomizer <em>Customizer</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Customizer</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder#getCustomizer()
- * @see #getXmlCustomizerHolder()
- * @generated
- */
- public EReference getXmlCustomizerHolder_Customizer()
- {
- return (EReference)xmlCustomizerHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection
- * @generated
- */
- public EClass getXmlElementCollection()
- {
- return xmlElementCollectionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embeddable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable
- * @generated
- */
- public EClass getXmlEmbeddable()
- {
- return xmlEmbeddableEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCopyPolicy <em>Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCopyPolicy()
- * @see #getXmlEmbeddable()
- * @generated
- */
- public EReference getXmlEmbeddable_CopyPolicy()
- {
- return (EReference)xmlEmbeddableEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Instantiation Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getInstantiationCopyPolicy()
- * @see #getXmlEmbeddable()
- * @generated
- */
- public EReference getXmlEmbeddable_InstantiationCopyPolicy()
- {
- return (EReference)xmlEmbeddableEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCloneCopyPolicy <em>Clone Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Clone Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCloneCopyPolicy()
- * @see #getXmlEmbeddable()
- * @generated
- */
- public EReference getXmlEmbeddable_CloneCopyPolicy()
- {
- return (EReference)xmlEmbeddableEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getExcludeDefaultMappings()
- * @see #getXmlEmbeddable()
- * @generated
- */
- public EAttribute getXmlEmbeddable_ExcludeDefaultMappings()
- {
- return (EAttribute)xmlEmbeddableEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded
- * @generated
- */
- public EClass getXmlEmbedded()
- {
- return xmlEmbeddedEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embedded Id</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId
- * @generated
- */
- public EClass getXmlEmbeddedId()
- {
- return xmlEmbeddedIdEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity <em>Xml Entity</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity
- * @generated
- */
- public EClass getXmlEntity()
- {
- return xmlEntityEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getOptimisticLocking <em>Optimistic Locking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Optimistic Locking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getOptimisticLocking()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_OptimisticLocking()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCopyPolicy <em>Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCopyPolicy()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_CopyPolicy()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Instantiation Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getInstantiationCopyPolicy()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_InstantiationCopyPolicy()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCloneCopyPolicy <em>Clone Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Clone Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCloneCopyPolicy()
- * @see #getXmlEntity()
- * @generated
- */
- public EReference getXmlEntity_CloneCopyPolicy()
- {
- return (EReference)xmlEntityEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExcludeDefaultMappings()
- * @see #getXmlEntity()
- * @generated
- */
- public EAttribute getXmlEntity_ExcludeDefaultMappings()
- {
- return (EAttribute)xmlEntityEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings
- * @generated
- */
- public EClass getXmlEntityMappings()
- {
- return xmlEntityMappingsEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute <em>Xml Fetch Attribute</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Attribute</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute
- * @generated
- */
- public EClass getXmlFetchAttribute()
- {
- return xmlFetchAttributeEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup <em>Xml Fetch Group</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Group</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup
- * @generated
- */
- public EClass getXmlFetchGroup()
- {
- return xmlFetchGroupEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId <em>Xml Id</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId
- * @generated
- */
- public EClass getXmlId()
- {
- return xmlIdEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex <em>Xml Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex
- * @generated
- */
- public EClass getXmlIndex()
- {
- return xmlIndexEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy <em>Xml Instantiation Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Instantiation Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy
- * @generated
- */
- public EClass getXmlInstantiationCopyPolicy()
- {
- return xmlInstantiationCopyPolicyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch <em>Xml Join Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Fetch</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch
- * @generated
- */
- public EClass getXmlJoinFetch()
- {
- return xmlJoinFetchEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch#getJoinFetch <em>Join Fetch</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Join Fetch</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch#getJoinFetch()
- * @see #getXmlJoinFetch()
- * @generated
- */
- public EAttribute getXmlJoinFetch_JoinFetch()
- {
- return (EAttribute)xmlJoinFetchEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable
- * @generated
- */
- public EClass getXmlJoinTable()
- {
- return xmlJoinTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany
- * @generated
- */
- public EClass getXmlManyToMany()
- {
- return xmlManyToManyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne
- * @generated
- */
- public EClass getXmlManyToOne()
- {
- return xmlManyToOneEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass
- * @generated
- */
- public EClass getXmlMappedSuperclass()
- {
- return xmlMappedSuperclassEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getOptimisticLocking <em>Optimistic Locking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Optimistic Locking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getOptimisticLocking()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_OptimisticLocking()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCopyPolicy <em>Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCopyPolicy()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_CopyPolicy()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Instantiation Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getInstantiationCopyPolicy()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_InstantiationCopyPolicy()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCloneCopyPolicy <em>Clone Copy Policy</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Clone Copy Policy</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCloneCopyPolicy()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EReference getXmlMappedSuperclass_CloneCopyPolicy()
- {
- return (EReference)xmlMappedSuperclassEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExcludeDefaultMappings()
- * @see #getXmlMappedSuperclass()
- * @generated
- */
- public EAttribute getXmlMappedSuperclass_ExcludeDefaultMappings()
- {
- return (EAttribute)xmlMappedSuperclassEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant <em>Xml Multitenant</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multitenant</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant
- * @generated
- */
- public EClass getXmlMultitenant()
- {
- return xmlMultitenantEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder <em>Xml Multitenant Holder</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multitenant Holder</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder
- * @generated
- */
- public EClass getXmlMultitenantHolder()
- {
- return xmlMultitenantHolderEClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder#getMultitenant <em>Multitenant</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Multitenant</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder#getMultitenant()
- * @see #getXmlMultitenantHolder()
- * @generated
- */
- public EReference getXmlMultitenantHolder_Multitenant()
- {
- return (EReference)xmlMultitenantHolderEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable <em>Xml Mutable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mutable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable
- * @generated
- */
- public EClass getXmlMutable()
- {
- return xmlMutableEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable#getMutable <em>Mutable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Mutable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable#getMutable()
- * @see #getXmlMutable()
- * @generated
- */
- public EAttribute getXmlMutable_Mutable()
- {
- return (EAttribute)xmlMutableEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter <em>Xml Named Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter
- * @generated
- */
- public EClass getXmlNamedConverter()
- {
- return xmlNamedConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter#getName()
- * @see #getXmlNamedConverter()
- * @generated
- */
- public EAttribute getXmlNamedConverter_Name()
- {
- return (EAttribute)xmlNamedConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery <em>Xml Named Plsql Stored Function Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Plsql Stored Function Query</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery
- * @generated
- */
- public EClass getXmlNamedPlsqlStoredFunctionQuery()
- {
- return xmlNamedPlsqlStoredFunctionQueryEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery <em>Xml Named Plsql Stored Procedure Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Plsql Stored Procedure Query</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery
- * @generated
- */
- public EClass getXmlNamedPlsqlStoredProcedureQuery()
- {
- return xmlNamedPlsqlStoredProcedureQueryEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery <em>Xml Named Stored Function Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Stored Function Query</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery
- * @generated
- */
- public EClass getXmlNamedStoredFunctionQuery()
- {
- return xmlNamedStoredFunctionQueryEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Stored Procedure Query</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery
- * @generated
- */
- public EClass getXmlNamedStoredProcedureQuery()
- {
- return xmlNamedStoredProcedureQueryEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getName()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_Name()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultClass <em>Result Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Result Class</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultClass()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_ResultClass()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultSetMapping <em>Result Set Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Result Set Mapping</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultSetMapping()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_ResultSetMapping()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getProcedureName <em>Procedure Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Procedure Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getProcedureName()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_ProcedureName()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getReturnsResultSet <em>Returns Result Set</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Returns Result Set</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getReturnsResultSet()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EAttribute getXmlNamedStoredProcedureQuery_ReturnsResultSet()
- {
- return (EAttribute)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getHints <em>Hints</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Hints</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getHints()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EReference getXmlNamedStoredProcedureQuery_Hints()
- {
- return (EReference)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getParameters <em>Parameters</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Parameters</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getParameters()
- * @see #getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public EReference getXmlNamedStoredProcedureQuery_Parameters()
- {
- return (EReference)xmlNamedStoredProcedureQueryEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter <em>Xml Object Type Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Object Type Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter
- * @generated
- */
- public EClass getXmlObjectTypeConverter()
- {
- return xmlObjectTypeConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDataType <em>Data Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Data Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDataType()
- * @see #getXmlObjectTypeConverter()
- * @generated
- */
- public EAttribute getXmlObjectTypeConverter_DataType()
- {
- return (EAttribute)xmlObjectTypeConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getObjectType <em>Object Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Object Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getObjectType()
- * @see #getXmlObjectTypeConverter()
- * @generated
- */
- public EAttribute getXmlObjectTypeConverter_ObjectType()
- {
- return (EAttribute)xmlObjectTypeConverterEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getConversionValues <em>Conversion Values</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Conversion Values</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getConversionValues()
- * @see #getXmlObjectTypeConverter()
- * @generated
- */
- public EReference getXmlObjectTypeConverter_ConversionValues()
- {
- return (EReference)xmlObjectTypeConverterEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDefaultObjectValue <em>Default Object Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Default Object Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDefaultObjectValue()
- * @see #getXmlObjectTypeConverter()
- * @generated
- */
- public EAttribute getXmlObjectTypeConverter_DefaultObjectValue()
- {
- return (EAttribute)xmlObjectTypeConverterEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany
- * @generated
- */
- public EClass getXmlOneToMany()
- {
- return xmlOneToManyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne
- * @generated
- */
- public EClass getXmlOneToOne()
- {
- return xmlOneToOneEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking <em>Xml Optimistic Locking</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Optimistic Locking</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking
- * @generated
- */
- public EClass getXmlOptimisticLocking()
- {
- return xmlOptimisticLockingEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getType()
- * @see #getXmlOptimisticLocking()
- * @generated
- */
- public EAttribute getXmlOptimisticLocking_Type()
- {
- return (EAttribute)xmlOptimisticLockingEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getCascade <em>Cascade</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getCascade()
- * @see #getXmlOptimisticLocking()
- * @generated
- */
- public EAttribute getXmlOptimisticLocking_Cascade()
- {
- return (EAttribute)xmlOptimisticLockingEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getSelectedColumns <em>Selected Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Selected Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getSelectedColumns()
- * @see #getXmlOptimisticLocking()
- * @generated
- */
- public EReference getXmlOptimisticLocking_SelectedColumns()
- {
- return (EReference)xmlOptimisticLockingEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Order Column</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn
- * @generated
- */
- public EClass getXmlOrderColumn()
- {
- return xmlOrderColumnEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Defaults</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults()
- {
- return xmlPersistenceUnitDefaultsEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Metadata</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata
- * @generated
- */
- public EClass getXmlPersistenceUnitMetadata()
- {
- return xmlPersistenceUnitMetadataEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata#isExcludeDefaultMappings <em>Exclude Default Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Exclude Default Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata#isExcludeDefaultMappings()
- * @see #getXmlPersistenceUnitMetadata()
- * @generated
- */
- public EAttribute getXmlPersistenceUnitMetadata_ExcludeDefaultMappings()
- {
- return (EAttribute)xmlPersistenceUnitMetadataEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey <em>Xml Primary Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Primary Key</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey
- * @generated
- */
- public EClass getXmlPrimaryKey()
- {
- return xmlPrimaryKeyEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned <em>Xml Private Owned</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Private Owned</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned
- * @generated
- */
- public EClass getXmlPrivateOwned()
- {
- return xmlPrivateOwnedEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned#isPrivateOwned <em>Private Owned</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Private Owned</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned#isPrivateOwned()
- * @see #getXmlPrivateOwned()
- * @generated
- */
- public EAttribute getXmlPrivateOwned_PrivateOwned()
- {
- return (EAttribute)xmlPrivateOwnedEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty <em>Xml Property</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Property</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty
- * @generated
- */
- public EClass getXmlProperty()
- {
- return xmlPropertyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getName()
- * @see #getXmlProperty()
- * @generated
- */
- public EAttribute getXmlProperty_Name()
- {
- return (EAttribute)xmlPropertyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValue <em>Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValue()
- * @see #getXmlProperty()
- * @generated
- */
- public EAttribute getXmlProperty_Value()
- {
- return (EAttribute)xmlPropertyEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValueType <em>Value Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Value Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValueType()
- * @see #getXmlProperty()
- * @generated
- */
- public EAttribute getXmlProperty_ValueType()
- {
- return (EAttribute)xmlPropertyEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer <em>Xml Property Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Property Container</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer
- * @generated
- */
- public EClass getXmlPropertyContainer()
- {
- return xmlPropertyContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer#getProperties <em>Properties</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Properties</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer#getProperties()
- * @see #getXmlPropertyContainer()
- * @generated
- */
- public EReference getXmlPropertyContainer_Properties()
- {
- return (EReference)xmlPropertyContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query Container</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer
- * @generated
- */
- public EClass getXmlQueryContainer()
- {
- return xmlQueryContainerEClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer#getNamedStoredProcedureQueries <em>Named Stored Procedure Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Stored Procedure Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer#getNamedStoredProcedureQueries()
- * @see #getXmlQueryContainer()
- * @generated
- */
- public EReference getXmlQueryContainer_NamedStoredProcedureQueries()
- {
- return (EReference)xmlQueryContainerEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors <em>Xml Query Redirectors</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query Redirectors</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors
- * @generated
- */
- public EClass getXmlQueryRedirectors()
- {
- return xmlQueryRedirectorsEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly <em>Xml Read Only</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Read Only</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly
- * @generated
- */
- public EClass getXmlReadOnly()
- {
- return xmlReadOnlyEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly#getReadOnly <em>Read Only</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Read Only</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly#getReadOnly()
- * @see #getXmlReadOnly()
- * @generated
- */
- public EAttribute getXmlReadOnly_ReadOnly()
- {
- return (EAttribute)xmlReadOnlyEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert <em>Xml Return Insert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Return Insert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert
- * @generated
- */
- public EClass getXmlReturnInsert()
- {
- return xmlReturnInsertEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Secondary Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable
- * @generated
- */
- public EClass getXmlSecondaryTable()
- {
- return xmlSecondaryTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Stored Procedure Parameter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter
- * @generated
- */
- public EClass getXmlStoredProcedureParameter()
- {
- return xmlStoredProcedureParameterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getDirection <em>Direction</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Direction</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getDirection()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_Direction()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getName()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_Name()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getQueryParameter <em>Query Parameter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Query Parameter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getQueryParameter()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_QueryParameter()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getType()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_Type()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcType <em>Jdbc Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Jdbc Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcType()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_JdbcType()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcTypeName <em>Jdbc Type Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Jdbc Type Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcTypeName()
- * @see #getXmlStoredProcedureParameter()
- * @generated
- */
- public EAttribute getXmlStoredProcedureParameter_JdbcTypeName()
- {
- return (EAttribute)xmlStoredProcedureParameterEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct <em>Xml Struct</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Struct</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct
- * @generated
- */
- public EClass getXmlStruct()
- {
- return xmlStructEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter <em>Xml Struct Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Struct Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter
- * @generated
- */
- public EClass getXmlStructConverter()
- {
- return xmlStructConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter#getConverter <em>Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter#getConverter()
- * @see #getXmlStructConverter()
- * @generated
- */
- public EAttribute getXmlStructConverter_Converter()
- {
- return (EAttribute)xmlStructConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure <em>Xml Structure</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Structure</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure
- * @generated
- */
- public EClass getXmlStructure()
- {
- return xmlStructureEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable <em>Xml Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable
- * @generated
- */
- public EClass getXmlTable()
- {
- return xmlTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table Generator</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator
- * @generated
- */
- public EClass getXmlTableGenerator()
- {
- return xmlTableGeneratorEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn <em>Xml Tenant Discriminator Column</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Tenant Discriminator Column</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn
- * @generated
- */
- public EClass getXmlTenantDiscriminatorColumn()
- {
- return xmlTenantDiscriminatorColumnEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay <em>Xml Time Of Day</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Time Of Day</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay
- * @generated
- */
- public EClass getXmlTimeOfDay()
- {
- return xmlTimeOfDayEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getHour <em>Hour</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Hour</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getHour()
- * @see #getXmlTimeOfDay()
- * @generated
- */
- public EAttribute getXmlTimeOfDay_Hour()
- {
- return (EAttribute)xmlTimeOfDayEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMinute <em>Minute</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Minute</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMinute()
- * @see #getXmlTimeOfDay()
- * @generated
- */
- public EAttribute getXmlTimeOfDay_Minute()
- {
- return (EAttribute)xmlTimeOfDayEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getSecond <em>Second</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Second</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getSecond()
- * @see #getXmlTimeOfDay()
- * @generated
- */
- public EAttribute getXmlTimeOfDay_Second()
- {
- return (EAttribute)xmlTimeOfDayEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMillisecond <em>Millisecond</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Millisecond</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMillisecond()
- * @see #getXmlTimeOfDay()
- * @generated
- */
- public EAttribute getXmlTimeOfDay_Millisecond()
- {
- return (EAttribute)xmlTimeOfDayEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Transformation</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation
- * @generated
- */
- public EClass getXmlTransformation()
- {
- return xmlTransformationEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient <em>Xml Transient</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Transient</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient
- * @generated
- */
- public EClass getXmlTransient()
- {
- return xmlTransientEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter <em>Xml Type Converter</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Type Converter</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter
- * @generated
- */
- public EClass getXmlTypeConverter()
- {
- return xmlTypeConverterEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getDataType <em>Data Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Data Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getDataType()
- * @see #getXmlTypeConverter()
- * @generated
- */
- public EAttribute getXmlTypeConverter_DataType()
- {
- return (EAttribute)xmlTypeConverterEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getObjectType <em>Object Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Object Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getObjectType()
- * @see #getXmlTypeConverter()
- * @generated
- */
- public EAttribute getXmlTypeConverter_ObjectType()
- {
- return (EAttribute)xmlTypeConverterEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping <em>Xml Type Mapping</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Type Mapping</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping
- * @generated
- */
- public EClass getXmlTypeMapping()
- {
- return xmlTypeMappingEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne <em>Xml Variable One To One</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Variable One To One</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne
- * @generated
- */
- public EClass getXmlVariableOneToOne()
- {
- return xmlVariableOneToOneEClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getTargetInterface <em>Target Interface</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Target Interface</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getTargetInterface()
- * @see #getXmlVariableOneToOne()
- * @generated
- */
- public EAttribute getXmlVariableOneToOne_TargetInterface()
- {
- return (EAttribute)xmlVariableOneToOneEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion <em>Xml Version</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Version</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion
- * @generated
- */
- public EClass getXmlVersion()
- {
- return xmlVersionEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning <em>Xml Hash Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Hash Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning
- * @generated
- */
- public EClass getXmlHashPartitioning()
- {
- return xmlHashPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning <em>Xml Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning
- * @generated
- */
- public EClass getXmlPartitioning()
- {
- return xmlPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning <em>Xml Pinned Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Pinned Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning
- * @generated
- */
- public EClass getXmlPinnedPartitioning()
- {
- return xmlPinnedPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord <em>Xml Plsql Record</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Plsql Record</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord
- * @generated
- */
- public EClass getXmlPlsqlRecord()
- {
- return xmlPlsqlRecordEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable <em>Xml Plsql Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Plsql Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable
- * @generated
- */
- public EClass getXmlPlsqlTable()
- {
- return xmlPlsqlTableEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning <em>Xml Range Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Range Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning
- * @generated
- */
- public EClass getXmlRangePartitioning()
- {
- return xmlRangePartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning <em>Xml Replication Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Replication Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning
- * @generated
- */
- public EClass getXmlReplicationPartitioning()
- {
- return xmlReplicationPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning <em>Xml Round Robin Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Round Robin Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning
- * @generated
- */
- public EClass getXmlRoundRobinPartitioning()
- {
- return xmlRoundRobinPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning <em>Xml Union Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Union Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning
- * @generated
- */
- public EClass getXmlUnionPartitioning()
- {
- return xmlUnionPartitioningEClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning <em>Xml Value Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Value Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning
- * @generated
- */
- public EClass getXmlValuePartitioning()
- {
- return xmlValuePartitioningEClass;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType <em>Cache Coordination Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Cache Coordination Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @generated
- */
- public EEnum getCacheCoordinationType()
- {
- return cacheCoordinationTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType <em>Cache Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Cache Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @generated
- */
- public EEnum getCacheType()
- {
- return cacheTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Change Tracking Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @generated
- */
- public EEnum getXmlChangeTrackingType()
- {
- return xmlChangeTrackingTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection <em>Xml Direction</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Direction</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @generated
- */
- public EEnum getXmlDirection()
- {
- return xmlDirectionEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType <em>Existence Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Existence Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @generated
- */
- public EEnum getExistenceType()
- {
- return existenceTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType <em>Xml Join Fetch Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Join Fetch Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @generated
- */
- public EEnum getXmlJoinFetchType()
- {
- return xmlJoinFetchTypeEEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType <em>Xml Optimistic Locking Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Xml Optimistic Locking Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @generated
- */
- public EEnum getXmlOptimisticLockingType()
- {
- return xmlOptimisticLockingTypeEEnum;
- }
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmFactory getEclipseLinkOrmFactory()
- {
- return (EclipseLinkOrmFactory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlAccessMethodsEClass = createEClass(XML_ACCESS_METHODS);
- createEAttribute(xmlAccessMethodsEClass, XML_ACCESS_METHODS__GET_METHOD);
- createEAttribute(xmlAccessMethodsEClass, XML_ACCESS_METHODS__SET_METHOD);
-
- xmlAccessMethodsHolderEClass = createEClass(XML_ACCESS_METHODS_HOLDER);
- createEReference(xmlAccessMethodsHolderEClass, XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS);
-
- xmlAdditionalCriteriaEClass = createEClass(XML_ADDITIONAL_CRITERIA);
-
- xmlArrayEClass = createEClass(XML_ARRAY);
-
- xmlAttributeMappingEClass = createEClass(XML_ATTRIBUTE_MAPPING);
- createEAttribute(xmlAttributeMappingEClass, XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE);
-
- attributesEClass = createEClass(ATTRIBUTES);
- createEReference(attributesEClass, ATTRIBUTES__BASIC_COLLECTIONS);
- createEReference(attributesEClass, ATTRIBUTES__BASIC_MAPS);
- createEReference(attributesEClass, ATTRIBUTES__TRANSFORMATIONS);
- createEReference(attributesEClass, ATTRIBUTES__VARIABLE_ONE_TO_ONES);
-
- xmlBasicEClass = createEClass(XML_BASIC);
-
- xmlBasicCollectionEClass = createEClass(XML_BASIC_COLLECTION);
-
- xmlBasicMapEClass = createEClass(XML_BASIC_MAP);
-
- xmlBatchFetchEClass = createEClass(XML_BATCH_FETCH);
-
- xmlBatchFetchHolderEClass = createEClass(XML_BATCH_FETCH_HOLDER);
- createEReference(xmlBatchFetchHolderEClass, XML_BATCH_FETCH_HOLDER__BATCH_FETCH);
-
- xmlCacheEClass = createEClass(XML_CACHE);
- createEAttribute(xmlCacheEClass, XML_CACHE__EXPIRY);
- createEAttribute(xmlCacheEClass, XML_CACHE__SIZE);
- createEAttribute(xmlCacheEClass, XML_CACHE__SHARED);
- createEAttribute(xmlCacheEClass, XML_CACHE__TYPE);
- createEAttribute(xmlCacheEClass, XML_CACHE__ALWAYS_REFRESH);
- createEAttribute(xmlCacheEClass, XML_CACHE__REFRESH_ONLY_IF_NEWER);
- createEAttribute(xmlCacheEClass, XML_CACHE__DISABLE_HITS);
- createEAttribute(xmlCacheEClass, XML_CACHE__COORDINATION_TYPE);
- createEReference(xmlCacheEClass, XML_CACHE__EXPIRY_TIME_OF_DAY);
-
- xmlCacheHolderEClass = createEClass(XML_CACHE_HOLDER);
- createEReference(xmlCacheHolderEClass, XML_CACHE_HOLDER__CACHE);
- createEAttribute(xmlCacheHolderEClass, XML_CACHE_HOLDER__EXISTENCE_CHECKING);
-
- xmlCacheIndexEClass = createEClass(XML_CACHE_INDEX);
-
- xmlChangeTrackingEClass = createEClass(XML_CHANGE_TRACKING);
- createEAttribute(xmlChangeTrackingEClass, XML_CHANGE_TRACKING__TYPE);
-
- xmlChangeTrackingHolderEClass = createEClass(XML_CHANGE_TRACKING_HOLDER);
- createEReference(xmlChangeTrackingHolderEClass, XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING);
-
- xmlCloneCopyPolicyEClass = createEClass(XML_CLONE_COPY_POLICY);
- createEAttribute(xmlCloneCopyPolicyEClass, XML_CLONE_COPY_POLICY__METHOD);
- createEAttribute(xmlCloneCopyPolicyEClass, XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD);
-
- xmlCollectionTableEClass = createEClass(XML_COLLECTION_TABLE);
-
- xmlConversionValueEClass = createEClass(XML_CONVERSION_VALUE);
- createEAttribute(xmlConversionValueEClass, XML_CONVERSION_VALUE__DATA_VALUE);
- createEAttribute(xmlConversionValueEClass, XML_CONVERSION_VALUE__OBJECT_VALUE);
-
- xmlConverterEClass = createEClass(XML_CONVERTER);
- createEAttribute(xmlConverterEClass, XML_CONVERTER__CLASS_NAME);
-
- xmlConverterContainerEClass = createEClass(XML_CONVERTER_CONTAINER);
- createEReference(xmlConverterContainerEClass, XML_CONVERTER_CONTAINER__CONVERTERS);
- createEReference(xmlConverterContainerEClass, XML_CONVERTER_CONTAINER__TYPE_CONVERTERS);
- createEReference(xmlConverterContainerEClass, XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS);
- createEReference(xmlConverterContainerEClass, XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS);
-
- xmlConvertibleMappingEClass = createEClass(XML_CONVERTIBLE_MAPPING);
- createEAttribute(xmlConvertibleMappingEClass, XML_CONVERTIBLE_MAPPING__CONVERT);
-
- xmlCopyPolicyEClass = createEClass(XML_COPY_POLICY);
- createEAttribute(xmlCopyPolicyEClass, XML_COPY_POLICY__CLASS);
-
- xmlCustomizerEClass = createEClass(XML_CUSTOMIZER);
- createEAttribute(xmlCustomizerEClass, XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME);
-
- xmlCustomizerHolderEClass = createEClass(XML_CUSTOMIZER_HOLDER);
- createEReference(xmlCustomizerHolderEClass, XML_CUSTOMIZER_HOLDER__CUSTOMIZER);
-
- xmlElementCollectionEClass = createEClass(XML_ELEMENT_COLLECTION);
-
- xmlEmbeddableEClass = createEClass(XML_EMBEDDABLE);
- createEReference(xmlEmbeddableEClass, XML_EMBEDDABLE__COPY_POLICY);
- createEReference(xmlEmbeddableEClass, XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY);
- createEReference(xmlEmbeddableEClass, XML_EMBEDDABLE__CLONE_COPY_POLICY);
- createEAttribute(xmlEmbeddableEClass, XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS);
-
- xmlEmbeddedEClass = createEClass(XML_EMBEDDED);
-
- xmlEmbeddedIdEClass = createEClass(XML_EMBEDDED_ID);
-
- xmlEntityEClass = createEClass(XML_ENTITY);
- createEReference(xmlEntityEClass, XML_ENTITY__OPTIMISTIC_LOCKING);
- createEReference(xmlEntityEClass, XML_ENTITY__COPY_POLICY);
- createEReference(xmlEntityEClass, XML_ENTITY__INSTANTIATION_COPY_POLICY);
- createEReference(xmlEntityEClass, XML_ENTITY__CLONE_COPY_POLICY);
- createEAttribute(xmlEntityEClass, XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS);
-
- xmlEntityMappingsEClass = createEClass(XML_ENTITY_MAPPINGS);
-
- xmlFetchAttributeEClass = createEClass(XML_FETCH_ATTRIBUTE);
-
- xmlFetchGroupEClass = createEClass(XML_FETCH_GROUP);
-
- xmlHashPartitioningEClass = createEClass(XML_HASH_PARTITIONING);
-
- xmlIdEClass = createEClass(XML_ID);
-
- xmlIndexEClass = createEClass(XML_INDEX);
-
- xmlInstantiationCopyPolicyEClass = createEClass(XML_INSTANTIATION_COPY_POLICY);
-
- xmlJoinFetchEClass = createEClass(XML_JOIN_FETCH);
- createEAttribute(xmlJoinFetchEClass, XML_JOIN_FETCH__JOIN_FETCH);
-
- xmlJoinTableEClass = createEClass(XML_JOIN_TABLE);
-
- xmlManyToManyEClass = createEClass(XML_MANY_TO_MANY);
-
- xmlManyToOneEClass = createEClass(XML_MANY_TO_ONE);
-
- xmlMappedSuperclassEClass = createEClass(XML_MAPPED_SUPERCLASS);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__COPY_POLICY);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY);
- createEReference(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY);
- createEAttribute(xmlMappedSuperclassEClass, XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS);
-
- xmlMultitenantEClass = createEClass(XML_MULTITENANT);
-
- xmlMultitenantHolderEClass = createEClass(XML_MULTITENANT_HOLDER);
- createEReference(xmlMultitenantHolderEClass, XML_MULTITENANT_HOLDER__MULTITENANT);
-
- xmlMutableEClass = createEClass(XML_MUTABLE);
- createEAttribute(xmlMutableEClass, XML_MUTABLE__MUTABLE);
-
- xmlNamedConverterEClass = createEClass(XML_NAMED_CONVERTER);
- createEAttribute(xmlNamedConverterEClass, XML_NAMED_CONVERTER__NAME);
-
- xmlNamedPlsqlStoredFunctionQueryEClass = createEClass(XML_NAMED_PLSQL_STORED_FUNCTION_QUERY);
-
- xmlNamedPlsqlStoredProcedureQueryEClass = createEClass(XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY);
-
- xmlNamedStoredFunctionQueryEClass = createEClass(XML_NAMED_STORED_FUNCTION_QUERY);
-
- xmlNamedStoredProcedureQueryEClass = createEClass(XML_NAMED_STORED_PROCEDURE_QUERY);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__NAME);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME);
- createEAttribute(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET);
- createEReference(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__HINTS);
- createEReference(xmlNamedStoredProcedureQueryEClass, XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS);
-
- xmlObjectTypeConverterEClass = createEClass(XML_OBJECT_TYPE_CONVERTER);
- createEAttribute(xmlObjectTypeConverterEClass, XML_OBJECT_TYPE_CONVERTER__DATA_TYPE);
- createEAttribute(xmlObjectTypeConverterEClass, XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE);
- createEReference(xmlObjectTypeConverterEClass, XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES);
- createEAttribute(xmlObjectTypeConverterEClass, XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE);
-
- xmlOneToManyEClass = createEClass(XML_ONE_TO_MANY);
-
- xmlOneToOneEClass = createEClass(XML_ONE_TO_ONE);
-
- xmlOptimisticLockingEClass = createEClass(XML_OPTIMISTIC_LOCKING);
- createEAttribute(xmlOptimisticLockingEClass, XML_OPTIMISTIC_LOCKING__TYPE);
- createEAttribute(xmlOptimisticLockingEClass, XML_OPTIMISTIC_LOCKING__CASCADE);
- createEReference(xmlOptimisticLockingEClass, XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS);
-
- xmlOrderColumnEClass = createEClass(XML_ORDER_COLUMN);
-
- xmlPartitioningEClass = createEClass(XML_PARTITIONING);
-
- xmlPersistenceUnitDefaultsEClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS);
-
- xmlPersistenceUnitMetadataEClass = createEClass(XML_PERSISTENCE_UNIT_METADATA);
- createEAttribute(xmlPersistenceUnitMetadataEClass, XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS);
-
- xmlPinnedPartitioningEClass = createEClass(XML_PINNED_PARTITIONING);
-
- xmlPlsqlRecordEClass = createEClass(XML_PLSQL_RECORD);
-
- xmlPlsqlTableEClass = createEClass(XML_PLSQL_TABLE);
-
- xmlPrimaryKeyEClass = createEClass(XML_PRIMARY_KEY);
-
- xmlPrivateOwnedEClass = createEClass(XML_PRIVATE_OWNED);
- createEAttribute(xmlPrivateOwnedEClass, XML_PRIVATE_OWNED__PRIVATE_OWNED);
-
- xmlPropertyEClass = createEClass(XML_PROPERTY);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__NAME);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__VALUE);
- createEAttribute(xmlPropertyEClass, XML_PROPERTY__VALUE_TYPE);
-
- xmlPropertyContainerEClass = createEClass(XML_PROPERTY_CONTAINER);
- createEReference(xmlPropertyContainerEClass, XML_PROPERTY_CONTAINER__PROPERTIES);
-
- xmlQueryContainerEClass = createEClass(XML_QUERY_CONTAINER);
- createEReference(xmlQueryContainerEClass, XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES);
-
- xmlQueryRedirectorsEClass = createEClass(XML_QUERY_REDIRECTORS);
-
- xmlRangePartitioningEClass = createEClass(XML_RANGE_PARTITIONING);
-
- xmlReadOnlyEClass = createEClass(XML_READ_ONLY);
- createEAttribute(xmlReadOnlyEClass, XML_READ_ONLY__READ_ONLY);
-
- xmlReplicationPartitioningEClass = createEClass(XML_REPLICATION_PARTITIONING);
-
- xmlReturnInsertEClass = createEClass(XML_RETURN_INSERT);
-
- xmlRoundRobinPartitioningEClass = createEClass(XML_ROUND_ROBIN_PARTITIONING);
-
- xmlSecondaryTableEClass = createEClass(XML_SECONDARY_TABLE);
-
- xmlStoredProcedureParameterEClass = createEClass(XML_STORED_PROCEDURE_PARAMETER);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__DIRECTION);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__NAME);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__TYPE);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE);
- createEAttribute(xmlStoredProcedureParameterEClass, XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME);
-
- xmlStructEClass = createEClass(XML_STRUCT);
-
- xmlStructConverterEClass = createEClass(XML_STRUCT_CONVERTER);
- createEAttribute(xmlStructConverterEClass, XML_STRUCT_CONVERTER__CONVERTER);
-
- xmlStructureEClass = createEClass(XML_STRUCTURE);
-
- xmlTableEClass = createEClass(XML_TABLE);
-
- xmlTableGeneratorEClass = createEClass(XML_TABLE_GENERATOR);
-
- xmlTenantDiscriminatorColumnEClass = createEClass(XML_TENANT_DISCRIMINATOR_COLUMN);
-
- xmlTimeOfDayEClass = createEClass(XML_TIME_OF_DAY);
- createEAttribute(xmlTimeOfDayEClass, XML_TIME_OF_DAY__HOUR);
- createEAttribute(xmlTimeOfDayEClass, XML_TIME_OF_DAY__MINUTE);
- createEAttribute(xmlTimeOfDayEClass, XML_TIME_OF_DAY__SECOND);
- createEAttribute(xmlTimeOfDayEClass, XML_TIME_OF_DAY__MILLISECOND);
-
- xmlTransformationEClass = createEClass(XML_TRANSFORMATION);
-
- xmlTransientEClass = createEClass(XML_TRANSIENT);
-
- xmlTypeConverterEClass = createEClass(XML_TYPE_CONVERTER);
- createEAttribute(xmlTypeConverterEClass, XML_TYPE_CONVERTER__DATA_TYPE);
- createEAttribute(xmlTypeConverterEClass, XML_TYPE_CONVERTER__OBJECT_TYPE);
-
- xmlTypeMappingEClass = createEClass(XML_TYPE_MAPPING);
-
- xmlUnionPartitioningEClass = createEClass(XML_UNION_PARTITIONING);
-
- xmlValuePartitioningEClass = createEClass(XML_VALUE_PARTITIONING);
-
- xmlVariableOneToOneEClass = createEClass(XML_VARIABLE_ONE_TO_ONE);
- createEAttribute(xmlVariableOneToOneEClass, XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE);
-
- xmlVersionEClass = createEClass(XML_VERSION);
-
- // Create enums
- cacheCoordinationTypeEEnum = createEEnum(CACHE_COORDINATION_TYPE);
- cacheTypeEEnum = createEEnum(CACHE_TYPE);
- xmlChangeTrackingTypeEEnum = createEEnum(XML_CHANGE_TRACKING_TYPE);
- xmlDirectionEEnum = createEEnum(XML_DIRECTION);
- existenceTypeEEnum = createEEnum(EXISTENCE_TYPE);
- xmlJoinFetchTypeEEnum = createEEnum(XML_JOIN_FETCH_TYPE);
- xmlOptimisticLockingTypeEEnum = createEEnum(XML_OPTIMISTIC_LOCKING_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI);
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Add subpackages
- getESubpackages().add(theEclipseLinkOrmV1_1Package);
- getESubpackages().add(theEclipseLinkOrmV2_0Package);
- getESubpackages().add(theEclipseLinkOrmV2_1Package);
- getESubpackages().add(theEclipseLinkOrmV2_2Package);
- getESubpackages().add(theEclipseLinkOrmV2_3Package);
- getESubpackages().add(theEclipseLinkOrmV2_4Package);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlAdditionalCriteriaEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlAdditionalCriteria_2_2());
- xmlArrayEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlArrayEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlArrayEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlArray_2_3());
- xmlArrayEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlAttributeMappingEClass.getESuperTypes().add(theOrmPackage.getXmlAttributeMapping());
- xmlAttributeMappingEClass.getESuperTypes().add(this.getXmlAccessMethodsHolder());
- xmlAttributeMappingEClass.getESuperTypes().add(this.getXmlPropertyContainer());
- attributesEClass.getESuperTypes().add(theOrmPackage.getAttributes());
- attributesEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlAttributes_2_3());
- xmlBasicEClass.getESuperTypes().add(theOrmPackage.getXmlBasic());
- xmlBasicEClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlBasic_1_1());
- xmlBasicEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlBasic_2_1());
- xmlBasicEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlBasic_2_2());
- xmlBasicEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlBasic_2_4());
- xmlBasicEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlBasicEClass.getESuperTypes().add(this.getXmlMutable());
- xmlBasicEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlBasicEClass.getESuperTypes().add(this.getXmlConverterContainer());
- xmlBasicCollectionEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlBasicCollectionEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlBasicCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlBasicCollection_2_2());
- xmlBasicMapEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlBasicMapEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlBasicMapEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlBasicMap_2_2());
- xmlBatchFetchEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlBatchFetch_2_1());
- xmlCacheEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlCache_2_2());
- xmlCacheEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlCache_2_4());
- xmlCacheIndexEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlCacheIndex_2_4());
- xmlCollectionTableEClass.getESuperTypes().add(theOrmPackage.getXmlCollectionTable());
- xmlCollectionTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlCollectionTable_2_2());
- xmlConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlConvertibleMappingEClass.getESuperTypes().add(theOrmPackage.getXmlConvertibleMapping());
- xmlElementCollectionEClass.getESuperTypes().add(theOrmPackage.getXmlElementCollection());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlElementCollection_2_0());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlElementCollection_2_1());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlElementCollection_2_2());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlElementCollection_2_3());
- xmlElementCollectionEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlElementCollection_2_4());
- xmlEmbeddableEClass.getESuperTypes().add(theOrmPackage.getXmlEmbeddable());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlTypeMapping());
- xmlEmbeddableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlEmbeddable_2_2());
- xmlEmbeddableEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlEmbeddable_2_3());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlCustomizerHolder());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlChangeTrackingHolder());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlConverterContainer());
- xmlEmbeddableEClass.getESuperTypes().add(this.getXmlPropertyContainer());
- xmlEmbeddedEClass.getESuperTypes().add(theOrmPackage.getXmlEmbedded());
- xmlEmbeddedEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlEmbeddedIdEClass.getESuperTypes().add(theOrmPackage.getXmlEmbeddedId());
- xmlEmbeddedIdEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlEntityEClass.getESuperTypes().add(theOrmPackage.getXmlEntity());
- xmlEntityEClass.getESuperTypes().add(this.getXmlTypeMapping());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlEntity_1_1());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlEntity_2_0());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEntity_2_1());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlEntity_2_2());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlEntity_2_3());
- xmlEntityEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlEntity_2_4());
- xmlEntityEClass.getESuperTypes().add(this.getXmlReadOnly());
- xmlEntityEClass.getESuperTypes().add(this.getXmlCustomizerHolder());
- xmlEntityEClass.getESuperTypes().add(this.getXmlChangeTrackingHolder());
- xmlEntityEClass.getESuperTypes().add(this.getXmlCacheHolder());
- xmlEntityEClass.getESuperTypes().add(this.getXmlConverterContainer());
- xmlEntityEClass.getESuperTypes().add(this.getXmlQueryContainer());
- xmlEntityEClass.getESuperTypes().add(this.getXmlPropertyContainer());
- xmlEntityMappingsEClass.getESuperTypes().add(theOrmPackage.getXmlEntityMappings());
- xmlEntityMappingsEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlEntityMappings_2_1());
- xmlEntityMappingsEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlEntityMappings_2_2());
- xmlEntityMappingsEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlEntityMappings_2_3());
- xmlEntityMappingsEClass.getESuperTypes().add(this.getXmlConverterContainer());
- xmlEntityMappingsEClass.getESuperTypes().add(this.getXmlQueryContainer());
- xmlFetchAttributeEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlFetchAttribute_2_1());
- xmlFetchGroupEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlFetchGroup_2_1());
- xmlHashPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlHashPartitioning_2_2());
- xmlIdEClass.getESuperTypes().add(theOrmPackage.getXmlId());
- xmlIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlId_2_2());
- xmlIdEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlId_2_4());
- xmlIdEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlIdEClass.getESuperTypes().add(this.getXmlMutable());
- xmlIdEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlIdEClass.getESuperTypes().add(this.getXmlConverterContainer());
- xmlIndexEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlIndex_2_2());
- xmlJoinTableEClass.getESuperTypes().add(theOrmPackage.getXmlJoinTable());
- xmlJoinTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlJoinTable_2_2());
- xmlManyToManyEClass.getESuperTypes().add(theOrmPackage.getXmlManyToMany());
- xmlManyToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlManyToMany_2_0());
- xmlManyToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlManyToMany_2_1());
- xmlManyToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlManyToMany_2_2());
- xmlManyToManyEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlManyToManyEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlManyToOneEClass.getESuperTypes().add(theOrmPackage.getXmlManyToOne());
- xmlManyToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlManyToOne_2_1());
- xmlManyToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlManyToOne_2_2());
- xmlManyToOneEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlManyToOneEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlMappedSuperclassEClass.getESuperTypes().add(theOrmPackage.getXmlMappedSuperclass());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlTypeMapping());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlMappedSuperclass_1_1());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlMappedSuperclass_2_0());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlMappedSuperclass_2_1());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlMappedSuperclass_2_2());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlMappedSuperclass_2_3());
- xmlMappedSuperclassEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlMappedSuperclass_2_4());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlReadOnly());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlCustomizerHolder());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlChangeTrackingHolder());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlCacheHolder());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlConverterContainer());
- xmlMappedSuperclassEClass.getESuperTypes().add(this.getXmlPropertyContainer());
- xmlMultitenantEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlMultitenant_2_3());
- xmlMultitenantEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlMultitenant_2_4());
- xmlNamedPlsqlStoredFunctionQueryEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlNamedPlsqlStoredFunctionQuery_2_3());
- xmlNamedPlsqlStoredProcedureQueryEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlNamedPlsqlStoredProcedureQuery_2_3());
- xmlNamedStoredFunctionQueryEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlNamedStoredFunctionQuery_2_3());
- xmlObjectTypeConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlOneToManyEClass.getESuperTypes().add(theOrmPackage.getXmlOneToMany());
- xmlOneToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlOneToMany_2_0());
- xmlOneToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlOneToMany_2_1());
- xmlOneToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlOneToMany_2_2());
- xmlOneToManyEClass.getESuperTypes().add(theEclipseLinkOrmV2_4Package.getXmlOneToMany_2_4());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlPrivateOwned());
- xmlOneToManyEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlOneToOneEClass.getESuperTypes().add(theOrmPackage.getXmlOneToOne());
- xmlOneToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlOneToOne_2_1());
- xmlOneToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlOneToOne_2_2());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlPrivateOwned());
- xmlOneToOneEClass.getESuperTypes().add(this.getXmlJoinFetch());
- xmlOrderColumnEClass.getESuperTypes().add(theOrmPackage.getXmlOrderColumn());
- xmlOrderColumnEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlOrderColumn_2_0());
- xmlPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlPartitioning_2_2());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(theOrmPackage.getXmlPersistenceUnitDefaults());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlPersistenceUnitDefaults_2_1());
- xmlPersistenceUnitDefaultsEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlPersistenceUnitDefaults_2_3());
- xmlPersistenceUnitMetadataEClass.getESuperTypes().add(theOrmPackage.getXmlPersistenceUnitMetadata());
- xmlPinnedPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlPinnedPartitioning_2_2());
- xmlPlsqlRecordEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlPlsqlRecord_2_3());
- xmlPlsqlTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlPlsqlTable_2_3());
- xmlPrimaryKeyEClass.getESuperTypes().add(theEclipseLinkOrmV1_1Package.getXmlPrimaryKey_1_1());
- xmlPrimaryKeyEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlPrimaryKey_2_1());
- xmlQueryRedirectorsEClass.getESuperTypes().add(theEclipseLinkOrmV2_0Package.getXmlQueryRedirectors_2_0());
- xmlRangePartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlRangePartitioning_2_2());
- xmlReplicationPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlReplicationPartitioning_2_2());
- xmlReturnInsertEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlReturnInsert_2_1());
- xmlRoundRobinPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlRoundRobinPartitioning_2_2());
- xmlSecondaryTableEClass.getESuperTypes().add(theOrmPackage.getXmlSecondaryTable());
- xmlSecondaryTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlSecondaryTable_2_2());
- xmlStructEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlStruct_2_3());
- xmlStructConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlStructureEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlStructureEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlStructureEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlStructure_2_3());
- xmlTableEClass.getESuperTypes().add(theOrmPackage.getXmlTable());
- xmlTableEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlTable_2_2());
- xmlTableGeneratorEClass.getESuperTypes().add(theOrmPackage.getXmlTableGenerator());
- xmlTableGeneratorEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlTableGenerator_2_2());
- xmlTenantDiscriminatorColumnEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlBaseDiscriminatorColumn());
- xmlTenantDiscriminatorColumnEClass.getESuperTypes().add(theEclipseLinkOrmV2_3Package.getXmlTenantDiscriminatorColumn_2_3());
- xmlTransformationEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlTransformationEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlTransientEClass.getESuperTypes().add(theOrmPackage.getXmlTransient());
- xmlTransientEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlTypeConverterEClass.getESuperTypes().add(this.getXmlNamedConverter());
- xmlTypeMappingEClass.getESuperTypes().add(theOrmPackage.getXmlTypeMapping());
- xmlTypeMappingEClass.getESuperTypes().add(theEclipseLinkOrmV2_1Package.getXmlTypeMapping_2_1());
- xmlUnionPartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlUnionPartitioning_2_2());
- xmlValuePartitioningEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlValuePartitioning_2_2());
- xmlVariableOneToOneEClass.getESuperTypes().add(theOrmPackage.getAbstractXmlAttributeMapping());
- xmlVariableOneToOneEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlVariableOneToOneEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlVariableOneToOne_2_2());
- xmlVersionEClass.getESuperTypes().add(theOrmPackage.getXmlVersion());
- xmlVersionEClass.getESuperTypes().add(theEclipseLinkOrmV2_2Package.getXmlVersion_2_2());
- xmlVersionEClass.getESuperTypes().add(this.getXmlAttributeMapping());
- xmlVersionEClass.getESuperTypes().add(this.getXmlMutable());
- xmlVersionEClass.getESuperTypes().add(this.getXmlConvertibleMapping());
- xmlVersionEClass.getESuperTypes().add(this.getXmlConverterContainer());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlAccessMethodsEClass, XmlAccessMethods.class, "XmlAccessMethods", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAccessMethods_GetMethod(), theXMLTypePackage.getString(), "getMethod", null, 0, 1, XmlAccessMethods.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlAccessMethods_SetMethod(), theXMLTypePackage.getString(), "setMethod", null, 0, 1, XmlAccessMethods.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAccessMethodsHolderEClass, XmlAccessMethodsHolder.class, "XmlAccessMethodsHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAccessMethodsHolder_AccessMethods(), this.getXmlAccessMethods(), null, "accessMethods", null, 0, 1, XmlAccessMethodsHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAdditionalCriteriaEClass, XmlAdditionalCriteria.class, "XmlAdditionalCriteria", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlArrayEClass, XmlArray.class, "XmlArray", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlAttributeMappingEClass, XmlAttributeMapping.class, "XmlAttributeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAttributeMapping_AttributeType(), theXMLTypePackage.getString(), "attributeType", null, 0, 1, XmlAttributeMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(attributesEClass, Attributes.class, "Attributes", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getAttributes_BasicCollections(), this.getXmlBasicCollection(), null, "basicCollections", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_BasicMaps(), this.getXmlBasicMap(), null, "basicMaps", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_Transformations(), this.getXmlTransformation(), null, "transformations", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAttributes_VariableOneToOnes(), this.getXmlVariableOneToOne(), null, "variableOneToOnes", null, 0, -1, Attributes.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBasicEClass, XmlBasic.class, "XmlBasic", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicCollectionEClass, XmlBasicCollection.class, "XmlBasicCollection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBasicMapEClass, XmlBasicMap.class, "XmlBasicMap", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBatchFetchEClass, XmlBatchFetch.class, "XmlBatchFetch", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlBatchFetchHolderEClass, XmlBatchFetchHolder.class, "XmlBatchFetchHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBatchFetchHolder_BatchFetch(), this.getXmlBatchFetch(), null, "batchFetch", null, 0, 1, XmlBatchFetchHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCacheEClass, XmlCache.class, "XmlCache", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCache_Expiry(), theXMLTypePackage.getIntObject(), "expiry", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_Size(), theXMLTypePackage.getIntObject(), "size", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_Shared(), theXMLTypePackage.getBooleanObject(), "shared", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_Type(), this.getCacheType(), "type", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_AlwaysRefresh(), theXMLTypePackage.getBooleanObject(), "alwaysRefresh", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_RefreshOnlyIfNewer(), theXMLTypePackage.getBooleanObject(), "refreshOnlyIfNewer", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_DisableHits(), theXMLTypePackage.getBooleanObject(), "disableHits", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCache_CoordinationType(), this.getCacheCoordinationType(), "coordinationType", "", 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlCache_ExpiryTimeOfDay(), this.getXmlTimeOfDay(), null, "expiryTimeOfDay", null, 0, 1, XmlCache.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCacheHolderEClass, XmlCacheHolder.class, "XmlCacheHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlCacheHolder_Cache(), this.getXmlCache(), null, "cache", null, 0, 1, XmlCacheHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCacheHolder_ExistenceChecking(), this.getExistenceType(), "existenceChecking", "", 0, 1, XmlCacheHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCacheIndexEClass, XmlCacheIndex.class, "XmlCacheIndex", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlChangeTrackingEClass, XmlChangeTracking.class, "XmlChangeTracking", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlChangeTracking_Type(), this.getXmlChangeTrackingType(), "type", null, 0, 1, XmlChangeTracking.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlChangeTrackingHolderEClass, XmlChangeTrackingHolder.class, "XmlChangeTrackingHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlChangeTrackingHolder_ChangeTracking(), this.getXmlChangeTracking(), null, "changeTracking", null, 0, 1, XmlChangeTrackingHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCloneCopyPolicyEClass, XmlCloneCopyPolicy.class, "XmlCloneCopyPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCloneCopyPolicy_Method(), theXMLTypePackage.getString(), "method", null, 0, 1, XmlCloneCopyPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlCloneCopyPolicy_WorkingCopyMethod(), theXMLTypePackage.getString(), "workingCopyMethod", null, 0, 1, XmlCloneCopyPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCollectionTableEClass, XmlCollectionTable.class, "XmlCollectionTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlConversionValueEClass, XmlConversionValue.class, "XmlConversionValue", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlConversionValue_DataValue(), theXMLTypePackage.getString(), "dataValue", null, 0, 1, XmlConversionValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlConversionValue_ObjectValue(), theXMLTypePackage.getString(), "objectValue", null, 0, 1, XmlConversionValue.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlConverterEClass, XmlConverter.class, "XmlConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlConverter_ClassName(), theXMLTypePackage.getString(), "className", null, 0, 1, XmlConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlConverterContainerEClass, XmlConverterContainer.class, "XmlConverterContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlConverterContainer_Converters(), this.getXmlConverter(), null, "converters", null, 0, -1, XmlConverterContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlConverterContainer_TypeConverters(), this.getXmlTypeConverter(), null, "typeConverters", null, 0, -1, XmlConverterContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlConverterContainer_ObjectTypeConverters(), this.getXmlObjectTypeConverter(), null, "objectTypeConverters", null, 0, -1, XmlConverterContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlConverterContainer_StructConverters(), this.getXmlStructConverter(), null, "structConverters", null, 0, -1, XmlConverterContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlConvertibleMappingEClass, XmlConvertibleMapping.class, "XmlConvertibleMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlConvertibleMapping_Convert(), theXMLTypePackage.getString(), "convert", null, 0, 1, XmlConvertibleMapping.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCopyPolicyEClass, XmlCopyPolicy.class, "XmlCopyPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCopyPolicy_Class(), theXMLTypePackage.getString(), "class", null, 0, 1, XmlCopyPolicy.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCustomizerEClass, XmlCustomizer.class, "XmlCustomizer", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCustomizer_CustomizerClassName(), theXMLTypePackage.getString(), "customizerClassName", null, 0, 1, XmlCustomizer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCustomizerHolderEClass, XmlCustomizerHolder.class, "XmlCustomizerHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlCustomizerHolder_Customizer(), theOrmPackage.getXmlClassReference(), null, "customizer", null, 0, 1, XmlCustomizerHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollectionEClass, XmlElementCollection.class, "XmlElementCollection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbeddableEClass, XmlEmbeddable.class, "XmlEmbeddable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEmbeddable_CopyPolicy(), this.getXmlCopyPolicy(), null, "copyPolicy", null, 0, 1, XmlEmbeddable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEmbeddable_InstantiationCopyPolicy(), this.getXmlInstantiationCopyPolicy(), null, "instantiationCopyPolicy", null, 0, 1, XmlEmbeddable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEmbeddable_CloneCopyPolicy(), this.getXmlCloneCopyPolicy(), null, "cloneCopyPolicy", null, 0, 1, XmlEmbeddable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEmbeddable_ExcludeDefaultMappings(), theXMLTypePackage.getBooleanObject(), "excludeDefaultMappings", null, 0, 1, XmlEmbeddable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddedEClass, XmlEmbedded.class, "XmlEmbedded", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEmbeddedIdEClass, XmlEmbeddedId.class, "XmlEmbeddedId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEntityEClass, XmlEntity.class, "XmlEntity", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_OptimisticLocking(), this.getXmlOptimisticLocking(), null, "optimisticLocking", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_CopyPolicy(), this.getXmlCopyPolicy(), null, "copyPolicy", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_InstantiationCopyPolicy(), this.getXmlInstantiationCopyPolicy(), null, "instantiationCopyPolicy", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_CloneCopyPolicy(), this.getXmlCloneCopyPolicy(), null, "cloneCopyPolicy", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_ExcludeDefaultMappings(), theXMLTypePackage.getBooleanObject(), "excludeDefaultMappings", null, 0, 1, XmlEntity.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityMappingsEClass, XmlEntityMappings.class, "XmlEntityMappings", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlFetchAttributeEClass, XmlFetchAttribute.class, "XmlFetchAttribute", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlFetchGroupEClass, XmlFetchGroup.class, "XmlFetchGroup", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlHashPartitioningEClass, XmlHashPartitioning.class, "XmlHashPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlIdEClass, XmlId.class, "XmlId", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlIndexEClass, XmlIndex.class, "XmlIndex", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlInstantiationCopyPolicyEClass, XmlInstantiationCopyPolicy.class, "XmlInstantiationCopyPolicy", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlJoinFetchEClass, XmlJoinFetch.class, "XmlJoinFetch", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlJoinFetch_JoinFetch(), this.getXmlJoinFetchType(), "joinFetch", null, 0, 1, XmlJoinFetch.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinTableEClass, XmlJoinTable.class, "XmlJoinTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToManyEClass, XmlManyToMany.class, "XmlManyToMany", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToOneEClass, XmlManyToOne.class, "XmlManyToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlMappedSuperclassEClass, XmlMappedSuperclass.class, "XmlMappedSuperclass", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_OptimisticLocking(), this.getXmlOptimisticLocking(), null, "optimisticLocking", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_CopyPolicy(), this.getXmlCopyPolicy(), null, "copyPolicy", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_InstantiationCopyPolicy(), this.getXmlInstantiationCopyPolicy(), null, "instantiationCopyPolicy", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_CloneCopyPolicy(), this.getXmlCloneCopyPolicy(), null, "cloneCopyPolicy", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlMappedSuperclass_ExcludeDefaultMappings(), theXMLTypePackage.getBooleanObject(), "excludeDefaultMappings", null, 0, 1, XmlMappedSuperclass.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMultitenantEClass, XmlMultitenant.class, "XmlMultitenant", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlMultitenantHolderEClass, XmlMultitenantHolder.class, "XmlMultitenantHolder", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMultitenantHolder_Multitenant(), this.getXmlMultitenant(), null, "multitenant", null, 0, 1, XmlMultitenantHolder.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMutableEClass, XmlMutable.class, "XmlMutable", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMutable_Mutable(), theXMLTypePackage.getBooleanObject(), "mutable", null, 0, 1, XmlMutable.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedConverterEClass, XmlNamedConverter.class, "XmlNamedConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedConverter_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedPlsqlStoredFunctionQueryEClass, XmlNamedPlsqlStoredFunctionQuery.class, "XmlNamedPlsqlStoredFunctionQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNamedPlsqlStoredProcedureQueryEClass, XmlNamedPlsqlStoredProcedureQuery.class, "XmlNamedPlsqlStoredProcedureQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNamedStoredFunctionQueryEClass, XmlNamedStoredFunctionQuery.class, "XmlNamedStoredFunctionQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlNamedStoredProcedureQueryEClass, XmlNamedStoredProcedureQuery.class, "XmlNamedStoredProcedureQuery", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedStoredProcedureQuery_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedStoredProcedureQuery_ResultClass(), theXMLTypePackage.getString(), "resultClass", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedStoredProcedureQuery_ResultSetMapping(), theXMLTypePackage.getString(), "resultSetMapping", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedStoredProcedureQuery_ProcedureName(), theXMLTypePackage.getString(), "procedureName", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlNamedStoredProcedureQuery_ReturnsResultSet(), theXMLTypePackage.getBooleanObject(), "returnsResultSet", null, 0, 1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlNamedStoredProcedureQuery_Hints(), theOrmPackage.getXmlQueryHint(), null, "hints", null, 0, -1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlNamedStoredProcedureQuery_Parameters(), this.getXmlStoredProcedureParameter(), null, "parameters", null, 0, -1, XmlNamedStoredProcedureQuery.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlObjectTypeConverterEClass, XmlObjectTypeConverter.class, "XmlObjectTypeConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlObjectTypeConverter_DataType(), theXMLTypePackage.getString(), "dataType", null, 0, 1, XmlObjectTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlObjectTypeConverter_ObjectType(), theXMLTypePackage.getString(), "objectType", null, 0, 1, XmlObjectTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlObjectTypeConverter_ConversionValues(), this.getXmlConversionValue(), null, "conversionValues", null, 0, -1, XmlObjectTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlObjectTypeConverter_DefaultObjectValue(), theXMLTypePackage.getString(), "defaultObjectValue", null, 0, 1, XmlObjectTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToManyEClass, XmlOneToMany.class, "XmlOneToMany", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToOneEClass, XmlOneToOne.class, "XmlOneToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOptimisticLockingEClass, XmlOptimisticLocking.class, "XmlOptimisticLocking", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOptimisticLocking_Type(), this.getXmlOptimisticLockingType(), "type", null, 0, 1, XmlOptimisticLocking.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlOptimisticLocking_Cascade(), theXMLTypePackage.getBooleanObject(), "cascade", null, 0, 1, XmlOptimisticLocking.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlOptimisticLocking_SelectedColumns(), theOrmPackage.getXmlColumn(), null, "selectedColumns", null, 0, -1, XmlOptimisticLocking.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOrderColumnEClass, XmlOrderColumn.class, "XmlOrderColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPartitioningEClass, XmlPartitioning.class, "XmlPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPersistenceUnitDefaultsEClass, XmlPersistenceUnitDefaults.class, "XmlPersistenceUnitDefaults", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPersistenceUnitMetadataEClass, XmlPersistenceUnitMetadata.class, "XmlPersistenceUnitMetadata", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPersistenceUnitMetadata_ExcludeDefaultMappings(), theXMLTypePackage.getBoolean(), "excludeDefaultMappings", null, 0, 1, XmlPersistenceUnitMetadata.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPinnedPartitioningEClass, XmlPinnedPartitioning.class, "XmlPinnedPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPlsqlRecordEClass, XmlPlsqlRecord.class, "XmlPlsqlRecord", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPlsqlTableEClass, XmlPlsqlTable.class, "XmlPlsqlTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPrimaryKeyEClass, XmlPrimaryKey.class, "XmlPrimaryKey", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPrivateOwnedEClass, XmlPrivateOwned.class, "XmlPrivateOwned", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPrivateOwned_PrivateOwned(), theXMLTypePackage.getBoolean(), "privateOwned", null, 0, 1, XmlPrivateOwned.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPropertyEClass, XmlProperty.class, "XmlProperty", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlProperty_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlProperty_Value(), theXMLTypePackage.getString(), "value", null, 0, 1, XmlProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlProperty_ValueType(), theXMLTypePackage.getString(), "valueType", null, 0, 1, XmlProperty.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPropertyContainerEClass, XmlPropertyContainer.class, "XmlPropertyContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlPropertyContainer_Properties(), this.getXmlProperty(), null, "properties", null, 0, -1, XmlPropertyContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQueryContainerEClass, XmlQueryContainer.class, "XmlQueryContainer", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlQueryContainer_NamedStoredProcedureQueries(), this.getXmlNamedStoredProcedureQuery(), null, "namedStoredProcedureQueries", null, 0, -1, XmlQueryContainer.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQueryRedirectorsEClass, XmlQueryRedirectors.class, "XmlQueryRedirectors", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlRangePartitioningEClass, XmlRangePartitioning.class, "XmlRangePartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlReadOnlyEClass, XmlReadOnly.class, "XmlReadOnly", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlReadOnly_ReadOnly(), theXMLTypePackage.getBooleanObject(), "readOnly", null, 0, 1, XmlReadOnly.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlReplicationPartitioningEClass, XmlReplicationPartitioning.class, "XmlReplicationPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlReturnInsertEClass, XmlReturnInsert.class, "XmlReturnInsert", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlRoundRobinPartitioningEClass, XmlRoundRobinPartitioning.class, "XmlRoundRobinPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlSecondaryTableEClass, XmlSecondaryTable.class, "XmlSecondaryTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlStoredProcedureParameterEClass, XmlStoredProcedureParameter.class, "XmlStoredProcedureParameter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlStoredProcedureParameter_Direction(), this.getXmlDirection(), "direction", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_QueryParameter(), theXMLTypePackage.getString(), "queryParameter", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_Type(), theXMLTypePackage.getString(), "type", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_JdbcType(), theXMLTypePackage.getIntObject(), "jdbcType", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlStoredProcedureParameter_JdbcTypeName(), theXMLTypePackage.getString(), "jdbcTypeName", null, 0, 1, XmlStoredProcedureParameter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlStructEClass, XmlStruct.class, "XmlStruct", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlStructConverterEClass, XmlStructConverter.class, "XmlStructConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlStructConverter_Converter(), theXMLTypePackage.getString(), "converter", null, 0, 1, XmlStructConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlStructureEClass, XmlStructure.class, "XmlStructure", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTableEClass, XmlTable.class, "XmlTable", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTableGeneratorEClass, XmlTableGenerator.class, "XmlTableGenerator", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTenantDiscriminatorColumnEClass, XmlTenantDiscriminatorColumn.class, "XmlTenantDiscriminatorColumn", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTimeOfDayEClass, XmlTimeOfDay.class, "XmlTimeOfDay", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTimeOfDay_Hour(), theXMLTypePackage.getIntObject(), "hour", null, 0, 1, XmlTimeOfDay.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTimeOfDay_Minute(), theXMLTypePackage.getIntObject(), "minute", null, 0, 1, XmlTimeOfDay.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTimeOfDay_Second(), theXMLTypePackage.getIntObject(), "second", null, 0, 1, XmlTimeOfDay.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTimeOfDay_Millisecond(), theXMLTypePackage.getIntObject(), "millisecond", null, 0, 1, XmlTimeOfDay.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTransformationEClass, XmlTransformation.class, "XmlTransformation", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTransientEClass, XmlTransient.class, "XmlTransient", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlTypeConverterEClass, XmlTypeConverter.class, "XmlTypeConverter", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTypeConverter_DataType(), theXMLTypePackage.getString(), "dataType", null, 0, 1, XmlTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTypeConverter_ObjectType(), theXMLTypePackage.getString(), "objectType", null, 0, 1, XmlTypeConverter.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTypeMappingEClass, XmlTypeMapping.class, "XmlTypeMapping", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlUnionPartitioningEClass, XmlUnionPartitioning.class, "XmlUnionPartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlValuePartitioningEClass, XmlValuePartitioning.class, "XmlValuePartitioning", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlVariableOneToOneEClass, XmlVariableOneToOne.class, "XmlVariableOneToOne", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlVariableOneToOne_TargetInterface(), theXMLTypePackage.getString(), "targetInterface", null, 0, 1, XmlVariableOneToOne.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlVersionEClass, XmlVersion.class, "XmlVersion", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- // Initialize enums and add enum literals
- initEEnum(cacheCoordinationTypeEEnum, CacheCoordinationType.class, "CacheCoordinationType");
- addEEnumLiteral(cacheCoordinationTypeEEnum, CacheCoordinationType.SEND_OBJECT_CHANGES);
- addEEnumLiteral(cacheCoordinationTypeEEnum, CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- addEEnumLiteral(cacheCoordinationTypeEEnum, CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- addEEnumLiteral(cacheCoordinationTypeEEnum, CacheCoordinationType.NONE);
-
- initEEnum(cacheTypeEEnum, CacheType.class, "CacheType");
- addEEnumLiteral(cacheTypeEEnum, CacheType.FULL);
- addEEnumLiteral(cacheTypeEEnum, CacheType.WEAK);
- addEEnumLiteral(cacheTypeEEnum, CacheType.SOFT);
- addEEnumLiteral(cacheTypeEEnum, CacheType.SOFT_WEAK);
- addEEnumLiteral(cacheTypeEEnum, CacheType.HARD_WEAK);
- addEEnumLiteral(cacheTypeEEnum, CacheType.CACHE);
- addEEnumLiteral(cacheTypeEEnum, CacheType.NONE);
-
- initEEnum(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.class, "XmlChangeTrackingType");
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.ATTRIBUTE);
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.OBJECT);
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.DEFERRED);
- addEEnumLiteral(xmlChangeTrackingTypeEEnum, XmlChangeTrackingType.AUTO);
-
- initEEnum(xmlDirectionEEnum, XmlDirection.class, "XmlDirection");
- addEEnumLiteral(xmlDirectionEEnum, XmlDirection.IN);
- addEEnumLiteral(xmlDirectionEEnum, XmlDirection.OUT);
- addEEnumLiteral(xmlDirectionEEnum, XmlDirection.IN_OUT);
- addEEnumLiteral(xmlDirectionEEnum, XmlDirection.OUT_CURSOR);
-
- initEEnum(existenceTypeEEnum, ExistenceType.class, "ExistenceType");
- addEEnumLiteral(existenceTypeEEnum, ExistenceType.CHECK_CACHE);
- addEEnumLiteral(existenceTypeEEnum, ExistenceType.CHECK_DATABASE);
- addEEnumLiteral(existenceTypeEEnum, ExistenceType.ASSUME_EXISTENCE);
- addEEnumLiteral(existenceTypeEEnum, ExistenceType.ASSUME_NON_EXISTENCE);
-
- initEEnum(xmlJoinFetchTypeEEnum, XmlJoinFetchType.class, "XmlJoinFetchType");
- addEEnumLiteral(xmlJoinFetchTypeEEnum, XmlJoinFetchType.INNER);
- addEEnumLiteral(xmlJoinFetchTypeEEnum, XmlJoinFetchType.OUTER);
-
- initEEnum(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.class, "XmlOptimisticLockingType");
- addEEnumLiteral(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.ALL_COLUMNS);
- addEEnumLiteral(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.CHANGED_COLUMNS);
- addEEnumLiteral(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.SELECTED_COLUMNS);
- addEEnumLiteral(xmlOptimisticLockingTypeEEnum, XmlOptimisticLockingType.VERSION_COLUMN);
-
- // Create resource
- createResource(eNS_URI);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods <em>Xml Access Methods</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods()
- * @generated
- */
- public static final EClass XML_ACCESS_METHODS = eINSTANCE.getXmlAccessMethods();
-
- /**
- * The meta object literal for the '<em><b>Get Method</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ACCESS_METHODS__GET_METHOD = eINSTANCE.getXmlAccessMethods_GetMethod();
-
- /**
- * The meta object literal for the '<em><b>Set Method</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ACCESS_METHODS__SET_METHOD = eINSTANCE.getXmlAccessMethods_SetMethod();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder <em>Xml Access Methods Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder()
- * @generated
- */
- public static final EClass XML_ACCESS_METHODS_HOLDER = eINSTANCE.getXmlAccessMethodsHolder();
-
- /**
- * The meta object literal for the '<em><b>Access Methods</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS = eINSTANCE.getXmlAccessMethodsHolder_AccessMethods();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria <em>Xml Additional Criteria</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAdditionalCriteria()
- * @generated
- */
- public static final EClass XML_ADDITIONAL_CRITERIA = eINSTANCE.getXmlAdditionalCriteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray <em>Xml Array</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlArray()
- * @generated
- */
- public static final EClass XML_ARRAY = eINSTANCE.getXmlArray();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping <em>Xml Attribute Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping()
- * @generated
- */
- public static final EClass XML_ATTRIBUTE_MAPPING = eINSTANCE.getXmlAttributeMapping();
-
- /**
- * The meta object literal for the '<em><b>Attribute Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE = eINSTANCE.getXmlAttributeMapping_AttributeType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes <em>Attributes</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.Attributes
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getAttributes()
- * @generated
- */
- public static final EClass ATTRIBUTES = eINSTANCE.getAttributes();
-
- /**
- * The meta object literal for the '<em><b>Basic Collections</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__BASIC_COLLECTIONS = eINSTANCE.getAttributes_BasicCollections();
-
- /**
- * The meta object literal for the '<em><b>Basic Maps</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__BASIC_MAPS = eINSTANCE.getAttributes_BasicMaps();
-
- /**
- * The meta object literal for the '<em><b>Transformations</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__TRANSFORMATIONS = eINSTANCE.getAttributes_Transformations();
-
- /**
- * The meta object literal for the '<em><b>Variable One To Ones</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference ATTRIBUTES__VARIABLE_ONE_TO_ONES = eINSTANCE.getAttributes_VariableOneToOnes();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic <em>Xml Basic</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic()
- * @generated
- */
- public static final EClass XML_BASIC = eINSTANCE.getXmlBasic();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection <em>Xml Basic Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection()
- * @generated
- */
- public static final EClass XML_BASIC_COLLECTION = eINSTANCE.getXmlBasicCollection();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap <em>Xml Basic Map</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap()
- * @generated
- */
- public static final EClass XML_BASIC_MAP = eINSTANCE.getXmlBasicMap();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch <em>Xml Batch Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch()
- * @generated
- */
- public static final EClass XML_BATCH_FETCH = eINSTANCE.getXmlBatchFetch();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder <em>Xml Batch Fetch Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder()
- * @generated
- */
- public static final EClass XML_BATCH_FETCH_HOLDER = eINSTANCE.getXmlBatchFetchHolder();
-
- /**
- * The meta object literal for the '<em><b>Batch Fetch</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BATCH_FETCH_HOLDER__BATCH_FETCH = eINSTANCE.getXmlBatchFetchHolder_BatchFetch();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache <em>Xml Cache</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache()
- * @generated
- */
- public static final EClass XML_CACHE = eINSTANCE.getXmlCache();
-
- /**
- * The meta object literal for the '<em><b>Expiry</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__EXPIRY = eINSTANCE.getXmlCache_Expiry();
-
- /**
- * The meta object literal for the '<em><b>Size</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__SIZE = eINSTANCE.getXmlCache_Size();
-
- /**
- * The meta object literal for the '<em><b>Shared</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__SHARED = eINSTANCE.getXmlCache_Shared();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__TYPE = eINSTANCE.getXmlCache_Type();
-
- /**
- * The meta object literal for the '<em><b>Always Refresh</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__ALWAYS_REFRESH = eINSTANCE.getXmlCache_AlwaysRefresh();
-
- /**
- * The meta object literal for the '<em><b>Refresh Only If Newer</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__REFRESH_ONLY_IF_NEWER = eINSTANCE.getXmlCache_RefreshOnlyIfNewer();
-
- /**
- * The meta object literal for the '<em><b>Disable Hits</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__DISABLE_HITS = eINSTANCE.getXmlCache_DisableHits();
-
- /**
- * The meta object literal for the '<em><b>Coordination Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE__COORDINATION_TYPE = eINSTANCE.getXmlCache_CoordinationType();
-
- /**
- * The meta object literal for the '<em><b>Expiry Time Of Day</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CACHE__EXPIRY_TIME_OF_DAY = eINSTANCE.getXmlCache_ExpiryTimeOfDay();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder <em>Xml Cache Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder()
- * @generated
- */
- public static final EClass XML_CACHE_HOLDER = eINSTANCE.getXmlCacheHolder();
-
- /**
- * The meta object literal for the '<em><b>Cache</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CACHE_HOLDER__CACHE = eINSTANCE.getXmlCacheHolder_Cache();
-
- /**
- * The meta object literal for the '<em><b>Existence Checking</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE_HOLDER__EXISTENCE_CHECKING = eINSTANCE.getXmlCacheHolder_ExistenceChecking();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex <em>Xml Cache Index</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheIndex
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheIndex()
- * @generated
- */
- public static final EClass XML_CACHE_INDEX = eINSTANCE.getXmlCacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking <em>Xml Change Tracking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking()
- * @generated
- */
- public static final EClass XML_CHANGE_TRACKING = eINSTANCE.getXmlChangeTracking();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CHANGE_TRACKING__TYPE = eINSTANCE.getXmlChangeTracking_Type();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder <em>Xml Change Tracking Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder()
- * @generated
- */
- public static final EClass XML_CHANGE_TRACKING_HOLDER = eINSTANCE.getXmlChangeTrackingHolder();
-
- /**
- * The meta object literal for the '<em><b>Change Tracking</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING = eINSTANCE.getXmlChangeTrackingHolder_ChangeTracking();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy <em>Xml Clone Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy()
- * @generated
- */
- public static final EClass XML_CLONE_COPY_POLICY = eINSTANCE.getXmlCloneCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Method</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CLONE_COPY_POLICY__METHOD = eINSTANCE.getXmlCloneCopyPolicy_Method();
-
- /**
- * The meta object literal for the '<em><b>Working Copy Method</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD = eINSTANCE.getXmlCloneCopyPolicy_WorkingCopyMethod();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable <em>Xml Collection Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionTable()
- * @generated
- */
- public static final EClass XML_COLLECTION_TABLE = eINSTANCE.getXmlCollectionTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue <em>Xml Conversion Value</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue()
- * @generated
- */
- public static final EClass XML_CONVERSION_VALUE = eINSTANCE.getXmlConversionValue();
-
- /**
- * The meta object literal for the '<em><b>Data Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERSION_VALUE__DATA_VALUE = eINSTANCE.getXmlConversionValue_DataValue();
-
- /**
- * The meta object literal for the '<em><b>Object Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERSION_VALUE__OBJECT_VALUE = eINSTANCE.getXmlConversionValue_ObjectValue();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter <em>Xml Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter()
- * @generated
- */
- public static final EClass XML_CONVERTER = eINSTANCE.getXmlConverter();
-
- /**
- * The meta object literal for the '<em><b>Class Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERTER__CLASS_NAME = eINSTANCE.getXmlConverter_ClassName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer <em>Xml Converter Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer()
- * @generated
- */
- public static final EClass XML_CONVERTER_CONTAINER = eINSTANCE.getXmlConverterContainer();
-
- /**
- * 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_CONVERTER_CONTAINER__CONVERTERS = eINSTANCE.getXmlConverterContainer_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_CONVERTER_CONTAINER__TYPE_CONVERTERS = eINSTANCE.getXmlConverterContainer_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_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS = eINSTANCE.getXmlConverterContainer_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_CONVERTER_CONTAINER__STRUCT_CONVERTERS = eINSTANCE.getXmlConverterContainer_StructConverters();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping <em>Xml Convertible Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping()
- * @generated
- */
- public static final EClass XML_CONVERTIBLE_MAPPING = eINSTANCE.getXmlConvertibleMapping();
-
- /**
- * The meta object literal for the '<em><b>Convert</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CONVERTIBLE_MAPPING__CONVERT = eINSTANCE.getXmlConvertibleMapping_Convert();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy <em>Xml Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy()
- * @generated
- */
- public static final EClass XML_COPY_POLICY = eINSTANCE.getXmlCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COPY_POLICY__CLASS = eINSTANCE.getXmlCopyPolicy_Class();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer <em>Xml Customizer</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer()
- * @generated
- */
- public static final EClass XML_CUSTOMIZER = eINSTANCE.getXmlCustomizer();
-
- /**
- * The meta object literal for the '<em><b>Customizer Class Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME = eINSTANCE.getXmlCustomizer_CustomizerClassName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder <em>Xml Customizer Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder()
- * @generated
- */
- public static final EClass XML_CUSTOMIZER_HOLDER = eINSTANCE.getXmlCustomizerHolder();
-
- /**
- * The meta object literal for the '<em><b>Customizer</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_CUSTOMIZER_HOLDER__CUSTOMIZER = eINSTANCE.getXmlCustomizerHolder_Customizer();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection <em>Xml Element Collection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION = eINSTANCE.getXmlElementCollection();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable <em>Xml Embeddable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable()
- * @generated
- */
- public static final EClass XML_EMBEDDABLE = eINSTANCE.getXmlEmbeddable();
-
- /**
- * The meta object literal for the '<em><b>Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE__COPY_POLICY = eINSTANCE.getXmlEmbeddable_CopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Instantiation Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY = eINSTANCE.getXmlEmbeddable_InstantiationCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Clone Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE__CLONE_COPY_POLICY = eINSTANCE.getXmlEmbeddable_CloneCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Mappings</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS = eINSTANCE.getXmlEmbeddable_ExcludeDefaultMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded <em>Xml Embedded</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded()
- * @generated
- */
- public static final EClass XML_EMBEDDED = eINSTANCE.getXmlEmbedded();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId <em>Xml Embedded Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId()
- * @generated
- */
- public static final EClass XML_EMBEDDED_ID = eINSTANCE.getXmlEmbeddedId();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity <em>Xml Entity</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity()
- * @generated
- */
- public static final EClass XML_ENTITY = eINSTANCE.getXmlEntity();
-
- /**
- * The meta object literal for the '<em><b>Optimistic Locking</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__OPTIMISTIC_LOCKING = eINSTANCE.getXmlEntity_OptimisticLocking();
-
- /**
- * The meta object literal for the '<em><b>Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__COPY_POLICY = eINSTANCE.getXmlEntity_CopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Instantiation Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__INSTANTIATION_COPY_POLICY = eINSTANCE.getXmlEntity_InstantiationCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Clone Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY__CLONE_COPY_POLICY = eINSTANCE.getXmlEntity_CloneCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Mappings</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS = eINSTANCE.getXmlEntity_ExcludeDefaultMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings <em>Xml Entity Mappings</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS = eINSTANCE.getXmlEntityMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute <em>Xml Fetch Attribute</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute()
- * @generated
- */
- public static final EClass XML_FETCH_ATTRIBUTE = eINSTANCE.getXmlFetchAttribute();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup <em>Xml Fetch Group</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup()
- * @generated
- */
- public static final EClass XML_FETCH_GROUP = eINSTANCE.getXmlFetchGroup();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId <em>Xml Id</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId()
- * @generated
- */
- public static final EClass XML_ID = eINSTANCE.getXmlId();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex <em>Xml Index</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex()
- * @generated
- */
- public static final EClass XML_INDEX = eINSTANCE.getXmlIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy <em>Xml Instantiation Copy Policy</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlInstantiationCopyPolicy
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlInstantiationCopyPolicy()
- * @generated
- */
- public static final EClass XML_INSTANTIATION_COPY_POLICY = eINSTANCE.getXmlInstantiationCopyPolicy();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch <em>Xml Join Fetch</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch()
- * @generated
- */
- public static final EClass XML_JOIN_FETCH = eINSTANCE.getXmlJoinFetch();
-
- /**
- * The meta object literal for the '<em><b>Join Fetch</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_JOIN_FETCH__JOIN_FETCH = eINSTANCE.getXmlJoinFetch_JoinFetch();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable <em>Xml Join Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinTable()
- * @generated
- */
- public static final EClass XML_JOIN_TABLE = eINSTANCE.getXmlJoinTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany <em>Xml Many To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY = eINSTANCE.getXmlManyToMany();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne <em>Xml Many To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE = eINSTANCE.getXmlManyToOne();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass <em>Xml Mapped Superclass</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS = eINSTANCE.getXmlMappedSuperclass();
-
- /**
- * The meta object literal for the '<em><b>Optimistic Locking</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING = eINSTANCE.getXmlMappedSuperclass_OptimisticLocking();
-
- /**
- * The meta object literal for the '<em><b>Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__COPY_POLICY = eINSTANCE.getXmlMappedSuperclass_CopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Instantiation Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY = eINSTANCE.getXmlMappedSuperclass_InstantiationCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Clone Copy Policy</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY = eINSTANCE.getXmlMappedSuperclass_CloneCopyPolicy();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Mappings</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS = eINSTANCE.getXmlMappedSuperclass_ExcludeDefaultMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant <em>Xml Multitenant</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant()
- * @generated
- */
- public static final EClass XML_MULTITENANT = eINSTANCE.getXmlMultitenant();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder <em>Xml Multitenant Holder</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder()
- * @generated
- */
- public static final EClass XML_MULTITENANT_HOLDER = eINSTANCE.getXmlMultitenantHolder();
-
- /**
- * The meta object literal for the '<em><b>Multitenant</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MULTITENANT_HOLDER__MULTITENANT = eINSTANCE.getXmlMultitenantHolder_Multitenant();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable <em>Xml Mutable</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable()
- * @generated
- */
- public static final EClass XML_MUTABLE = eINSTANCE.getXmlMutable();
-
- /**
- * The meta object literal for the '<em><b>Mutable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MUTABLE__MUTABLE = eINSTANCE.getXmlMutable_Mutable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter <em>Xml Named Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter()
- * @generated
- */
- public static final EClass XML_NAMED_CONVERTER = eINSTANCE.getXmlNamedConverter();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_CONVERTER__NAME = eINSTANCE.getXmlNamedConverter_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery <em>Xml Named Plsql Stored Function Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredFunctionQuery()
- * @generated
- */
- public static final EClass XML_NAMED_PLSQL_STORED_FUNCTION_QUERY = eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery <em>Xml Named Plsql Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredProcedureQuery()
- * @generated
- */
- public static final EClass XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY = eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery <em>Xml Named Stored Function Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredFunctionQuery()
- * @generated
- */
- public static final EClass XML_NAMED_STORED_FUNCTION_QUERY = eINSTANCE.getXmlNamedStoredFunctionQuery();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery <em>Xml Named Stored Procedure Query</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery()
- * @generated
- */
- public static final EClass XML_NAMED_STORED_PROCEDURE_QUERY = eINSTANCE.getXmlNamedStoredProcedureQuery();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__NAME = eINSTANCE.getXmlNamedStoredProcedureQuery_Name();
-
- /**
- * The meta object literal for the '<em><b>Result Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS = eINSTANCE.getXmlNamedStoredProcedureQuery_ResultClass();
-
- /**
- * The meta object literal for the '<em><b>Result Set Mapping</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING = eINSTANCE.getXmlNamedStoredProcedureQuery_ResultSetMapping();
-
- /**
- * The meta object literal for the '<em><b>Procedure Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME = eINSTANCE.getXmlNamedStoredProcedureQuery_ProcedureName();
-
- /**
- * The meta object literal for the '<em><b>Returns Result Set</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET = eINSTANCE.getXmlNamedStoredProcedureQuery_ReturnsResultSet();
-
- /**
- * The meta object literal for the '<em><b>Hints</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_NAMED_STORED_PROCEDURE_QUERY__HINTS = eINSTANCE.getXmlNamedStoredProcedureQuery_Hints();
-
- /**
- * The meta object literal for the '<em><b>Parameters</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS = eINSTANCE.getXmlNamedStoredProcedureQuery_Parameters();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter <em>Xml Object Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter()
- * @generated
- */
- public static final EClass XML_OBJECT_TYPE_CONVERTER = eINSTANCE.getXmlObjectTypeConverter();
-
- /**
- * The meta object literal for the '<em><b>Data Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OBJECT_TYPE_CONVERTER__DATA_TYPE = eINSTANCE.getXmlObjectTypeConverter_DataType();
-
- /**
- * The meta object literal for the '<em><b>Object Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE = eINSTANCE.getXmlObjectTypeConverter_ObjectType();
-
- /**
- * The meta object literal for the '<em><b>Conversion Values</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES = eINSTANCE.getXmlObjectTypeConverter_ConversionValues();
-
- /**
- * The meta object literal for the '<em><b>Default Object Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE = eINSTANCE.getXmlObjectTypeConverter_DefaultObjectValue();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany <em>Xml One To Many</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY = eINSTANCE.getXmlOneToMany();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne <em>Xml One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE = eINSTANCE.getXmlOneToOne();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking <em>Xml Optimistic Locking</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking()
- * @generated
- */
- public static final EClass XML_OPTIMISTIC_LOCKING = eINSTANCE.getXmlOptimisticLocking();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OPTIMISTIC_LOCKING__TYPE = eINSTANCE.getXmlOptimisticLocking_Type();
-
- /**
- * The meta object literal for the '<em><b>Cascade</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_OPTIMISTIC_LOCKING__CASCADE = eINSTANCE.getXmlOptimisticLocking_Cascade();
-
- /**
- * The meta object literal for the '<em><b>Selected Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS = eINSTANCE.getXmlOptimisticLocking_SelectedColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn <em>Xml Order Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn()
- * @generated
- */
- public static final EClass XML_ORDER_COLUMN = eINSTANCE.getXmlOrderColumn();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults <em>Xml Persistence Unit Defaults</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_DEFAULTS = eINSTANCE.getXmlPersistenceUnitDefaults();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata <em>Xml Persistence Unit Metadata</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_METADATA = eINSTANCE.getXmlPersistenceUnitMetadata();
-
- /**
- * The meta object literal for the '<em><b>Exclude Default Mappings</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS = eINSTANCE.getXmlPersistenceUnitMetadata_ExcludeDefaultMappings();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey <em>Xml Primary Key</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey()
- * @generated
- */
- public static final EClass XML_PRIMARY_KEY = eINSTANCE.getXmlPrimaryKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned <em>Xml Private Owned</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned()
- * @generated
- */
- public static final EClass XML_PRIVATE_OWNED = eINSTANCE.getXmlPrivateOwned();
-
- /**
- * The meta object literal for the '<em><b>Private Owned</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PRIVATE_OWNED__PRIVATE_OWNED = eINSTANCE.getXmlPrivateOwned_PrivateOwned();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty <em>Xml Property</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty()
- * @generated
- */
- public static final EClass XML_PROPERTY = eINSTANCE.getXmlProperty();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PROPERTY__NAME = eINSTANCE.getXmlProperty_Name();
-
- /**
- * The meta object literal for the '<em><b>Value</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PROPERTY__VALUE = eINSTANCE.getXmlProperty_Value();
-
- /**
- * The meta object literal for the '<em><b>Value Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PROPERTY__VALUE_TYPE = eINSTANCE.getXmlProperty_ValueType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer <em>Xml Property Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer()
- * @generated
- */
- public static final EClass XML_PROPERTY_CONTAINER = eINSTANCE.getXmlPropertyContainer();
-
- /**
- * The meta object literal for the '<em><b>Properties</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PROPERTY_CONTAINER__PROPERTIES = eINSTANCE.getXmlPropertyContainer_Properties();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer <em>Xml Query Container</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer()
- * @generated
- */
- public static final EClass XML_QUERY_CONTAINER = eINSTANCE.getXmlQueryContainer();
-
- /**
- * The meta object literal for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES = eINSTANCE.getXmlQueryContainer_NamedStoredProcedureQueries();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors <em>Xml Query Redirectors</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors()
- * @generated
- */
- public static final EClass XML_QUERY_REDIRECTORS = eINSTANCE.getXmlQueryRedirectors();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly <em>Xml Read Only</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly()
- * @generated
- */
- public static final EClass XML_READ_ONLY = eINSTANCE.getXmlReadOnly();
-
- /**
- * The meta object literal for the '<em><b>Read Only</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_READ_ONLY__READ_ONLY = eINSTANCE.getXmlReadOnly_ReadOnly();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert <em>Xml Return Insert</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReturnInsert()
- * @generated
- */
- public static final EClass XML_RETURN_INSERT = eINSTANCE.getXmlReturnInsert();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable <em>Xml Secondary Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlSecondaryTable()
- * @generated
- */
- public static final EClass XML_SECONDARY_TABLE = eINSTANCE.getXmlSecondaryTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter <em>Xml Stored Procedure Parameter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter()
- * @generated
- */
- public static final EClass XML_STORED_PROCEDURE_PARAMETER = eINSTANCE.getXmlStoredProcedureParameter();
-
- /**
- * The meta object literal for the '<em><b>Direction</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__DIRECTION = eINSTANCE.getXmlStoredProcedureParameter_Direction();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__NAME = eINSTANCE.getXmlStoredProcedureParameter_Name();
-
- /**
- * The meta object literal for the '<em><b>Query Parameter</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER = eINSTANCE.getXmlStoredProcedureParameter_QueryParameter();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__TYPE = eINSTANCE.getXmlStoredProcedureParameter_Type();
-
- /**
- * The meta object literal for the '<em><b>Jdbc Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE = eINSTANCE.getXmlStoredProcedureParameter_JdbcType();
-
- /**
- * The meta object literal for the '<em><b>Jdbc Type Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME = eINSTANCE.getXmlStoredProcedureParameter_JdbcTypeName();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct <em>Xml Struct</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStruct()
- * @generated
- */
- public static final EClass XML_STRUCT = eINSTANCE.getXmlStruct();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter <em>Xml Struct Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter()
- * @generated
- */
- public static final EClass XML_STRUCT_CONVERTER = eINSTANCE.getXmlStructConverter();
-
- /**
- * The meta object literal for the '<em><b>Converter</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STRUCT_CONVERTER__CONVERTER = eINSTANCE.getXmlStructConverter_Converter();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure <em>Xml Structure</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructure()
- * @generated
- */
- public static final EClass XML_STRUCTURE = eINSTANCE.getXmlStructure();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable <em>Xml Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTable()
- * @generated
- */
- public static final EClass XML_TABLE = eINSTANCE.getXmlTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator <em>Xml Table Generator</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTableGenerator()
- * @generated
- */
- public static final EClass XML_TABLE_GENERATOR = eINSTANCE.getXmlTableGenerator();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn <em>Xml Tenant Discriminator Column</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn()
- * @generated
- */
- public static final EClass XML_TENANT_DISCRIMINATOR_COLUMN = eINSTANCE.getXmlTenantDiscriminatorColumn();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay <em>Xml Time Of Day</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay()
- * @generated
- */
- public static final EClass XML_TIME_OF_DAY = eINSTANCE.getXmlTimeOfDay();
-
- /**
- * The meta object literal for the '<em><b>Hour</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TIME_OF_DAY__HOUR = eINSTANCE.getXmlTimeOfDay_Hour();
-
- /**
- * The meta object literal for the '<em><b>Minute</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TIME_OF_DAY__MINUTE = eINSTANCE.getXmlTimeOfDay_Minute();
-
- /**
- * The meta object literal for the '<em><b>Second</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TIME_OF_DAY__SECOND = eINSTANCE.getXmlTimeOfDay_Second();
-
- /**
- * The meta object literal for the '<em><b>Millisecond</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TIME_OF_DAY__MILLISECOND = eINSTANCE.getXmlTimeOfDay_Millisecond();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation <em>Xml Transformation</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation()
- * @generated
- */
- public static final EClass XML_TRANSFORMATION = eINSTANCE.getXmlTransformation();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient <em>Xml Transient</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransient()
- * @generated
- */
- public static final EClass XML_TRANSIENT = eINSTANCE.getXmlTransient();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter <em>Xml Type Converter</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter()
- * @generated
- */
- public static final EClass XML_TYPE_CONVERTER = eINSTANCE.getXmlTypeConverter();
-
- /**
- * The meta object literal for the '<em><b>Data Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TYPE_CONVERTER__DATA_TYPE = eINSTANCE.getXmlTypeConverter_DataType();
-
- /**
- * The meta object literal for the '<em><b>Object Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TYPE_CONVERTER__OBJECT_TYPE = eINSTANCE.getXmlTypeConverter_ObjectType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping <em>Xml Type Mapping</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeMapping()
- * @generated
- */
- public static final EClass XML_TYPE_MAPPING = eINSTANCE.getXmlTypeMapping();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne <em>Xml Variable One To One</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne()
- * @generated
- */
- public static final EClass XML_VARIABLE_ONE_TO_ONE = eINSTANCE.getXmlVariableOneToOne();
-
- /**
- * The meta object literal for the '<em><b>Target Interface</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE = eINSTANCE.getXmlVariableOneToOne_TargetInterface();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion <em>Xml Version</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion()
- * @generated
- */
- public static final EClass XML_VERSION = eINSTANCE.getXmlVersion();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning <em>Xml Hash Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlHashPartitioning()
- * @generated
- */
- public static final EClass XML_HASH_PARTITIONING = eINSTANCE.getXmlHashPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning <em>Xml Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioning()
- * @generated
- */
- public static final EClass XML_PARTITIONING = eINSTANCE.getXmlPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning <em>Xml Pinned Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPinnedPartitioning()
- * @generated
- */
- public static final EClass XML_PINNED_PARTITIONING = eINSTANCE.getXmlPinnedPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord <em>Xml Plsql Record</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlRecord()
- * @generated
- */
- public static final EClass XML_PLSQL_RECORD = eINSTANCE.getXmlPlsqlRecord();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable <em>Xml Plsql Table</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlTable()
- * @generated
- */
- public static final EClass XML_PLSQL_TABLE = eINSTANCE.getXmlPlsqlTable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning <em>Xml Range Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRangePartitioning()
- * @generated
- */
- public static final EClass XML_RANGE_PARTITIONING = eINSTANCE.getXmlRangePartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning <em>Xml Replication Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReplicationPartitioning()
- * @generated
- */
- public static final EClass XML_REPLICATION_PARTITIONING = eINSTANCE.getXmlReplicationPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning <em>Xml Round Robin Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRoundRobinPartitioning()
- * @generated
- */
- public static final EClass XML_ROUND_ROBIN_PARTITIONING = eINSTANCE.getXmlRoundRobinPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning <em>Xml Union Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlUnionPartitioning()
- * @generated
- */
- public static final EClass XML_UNION_PARTITIONING = eINSTANCE.getXmlUnionPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning <em>Xml Value Partitioning</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlValuePartitioning()
- * @generated
- */
- public static final EClass XML_VALUE_PARTITIONING = eINSTANCE.getXmlValuePartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType <em>Cache Coordination Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheCoordinationType()
- * @generated
- */
- public static final EEnum CACHE_COORDINATION_TYPE = eINSTANCE.getCacheCoordinationType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType <em>Cache Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getCacheType()
- * @generated
- */
- public static final EEnum CACHE_TYPE = eINSTANCE.getCacheType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType <em>Xml Change Tracking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingType()
- * @generated
- */
- public static final EEnum XML_CHANGE_TRACKING_TYPE = eINSTANCE.getXmlChangeTrackingType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection <em>Xml Direction</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlDirection()
- * @generated
- */
- public static final EEnum XML_DIRECTION = eINSTANCE.getXmlDirection();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType <em>Existence Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getExistenceType()
- * @generated
- */
- public static final EEnum EXISTENCE_TYPE = eINSTANCE.getExistenceType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType <em>Xml Join Fetch Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetchType()
- * @generated
- */
- public static final EEnum XML_JOIN_FETCH_TYPE = eINSTANCE.getXmlJoinFetchType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType <em>Xml Optimistic Locking Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLockingType()
- * @generated
- */
- public static final EEnum XML_OPTIMISTIC_LOCKING_TYPE = eINSTANCE.getXmlOptimisticLockingType();
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java
deleted file mode 100644
index 57154bbb46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/EclipseLinkOrmXmlResourceFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.wst.common.internal.emf.resource.Renderer;
-import org.eclipse.wst.common.internal.emf.resource.RendererFactory;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResource;
-import org.eclipse.wst.common.internal.emf.resource.TranslatorResourceFactory;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkOrmXmlResourceFactory extends TranslatorResourceFactory
-{
- public EclipseLinkOrmXmlResourceFactory() {
- this(RendererFactory.getDefaultRendererFactory());
- }
-
- public EclipseLinkOrmXmlResourceFactory(RendererFactory aRendererFactory) {
- super(aRendererFactory);
- }
-
- public EclipseLinkOrmXmlResourceFactory(RendererFactory aRendererFactory, boolean listeningForUpdates) {
- super(aRendererFactory, listeningForUpdates);
- }
-
-
- /**
- * @see TranslatorResourceFactory#createResource(URI, Renderer)
- */
- @Override
- protected TranslatorResource createResource(URI uri, Renderer renderer) {
- return new JpaXmlResource(uri, renderer, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, XmlEntityMappings.getRootTranslator());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/ExistenceType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/ExistenceType.java
deleted file mode 100644
index a89707ed20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/ExistenceType.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the literals of the enumeration '<em><b>Existence Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getExistenceType()
- * @model
- * @generated
- */
-public enum ExistenceType implements Enumerator
-{
- /**
- * The '<em><b>CHECK CACHE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CHECK_CACHE_VALUE
- * @generated
- * @ordered
- */
- CHECK_CACHE(0, "CHECK_CACHE", "CHECK_CACHE"),
-
- /**
- * The '<em><b>CHECK DATABASE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CHECK_DATABASE_VALUE
- * @generated
- * @ordered
- */
- CHECK_DATABASE(1, "CHECK_DATABASE", "CHECK_DATABASE"),
-
- /**
- * The '<em><b>ASSUME EXISTENCE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ASSUME_EXISTENCE_VALUE
- * @generated
- * @ordered
- */
- ASSUME_EXISTENCE(2, "ASSUME_EXISTENCE", "ASSUME_EXISTENCE"),
-
- /**
- * The '<em><b>ASSUME NON EXISTENCE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ASSUME_NON_EXISTENCE_VALUE
- * @generated
- * @ordered
- */
- ASSUME_NON_EXISTENCE(3, "ASSUME_NON_EXISTENCE", "ASSUME_NON_EXISTENCE");
-
- /**
- * The '<em><b>CHECK CACHE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CHECK CACHE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CHECK_CACHE
- * @model
- * @generated
- * @ordered
- */
- public static final int CHECK_CACHE_VALUE = 0;
-
- /**
- * The '<em><b>CHECK DATABASE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CHECK DATABASE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CHECK_DATABASE
- * @model
- * @generated
- * @ordered
- */
- public static final int CHECK_DATABASE_VALUE = 1;
-
- /**
- * The '<em><b>ASSUME EXISTENCE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ASSUME EXISTENCE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ASSUME_EXISTENCE
- * @model
- * @generated
- * @ordered
- */
- public static final int ASSUME_EXISTENCE_VALUE = 2;
-
- /**
- * The '<em><b>ASSUME NON EXISTENCE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ASSUME NON EXISTENCE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ASSUME_NON_EXISTENCE
- * @model
- * @generated
- * @ordered
- */
- public static final int ASSUME_NON_EXISTENCE_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Existence Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final ExistenceType[] VALUES_ARRAY =
- new ExistenceType[]
- {
- CHECK_CACHE,
- CHECK_DATABASE,
- ASSUME_EXISTENCE,
- ASSUME_NON_EXISTENCE,
- };
-
- /**
- * A public read-only list of all the '<em><b>Existence Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<ExistenceType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Existence Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static ExistenceType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- ExistenceType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Existence Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static ExistenceType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- ExistenceType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Existence Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static ExistenceType get(int value)
- {
- switch (value)
- {
- case CHECK_CACHE_VALUE: return CHECK_CACHE;
- case CHECK_DATABASE_VALUE: return CHECK_DATABASE;
- case ASSUME_EXISTENCE_VALUE: return ASSUME_EXISTENCE;
- case ASSUME_NON_EXISTENCE_VALUE: return ASSUME_NON_EXISTENCE;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private ExistenceType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //ExistenceType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethods.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethods.java
deleted file mode 100644
index afbd13c1f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethods.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Access Methods</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getGetMethod <em>Get Method</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getSetMethod <em>Set Method</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlAccessMethods extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getGetMethod() <em>Get Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGetMethod()
- * @generated
- * @ordered
- */
- protected static final String GET_METHOD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getGetMethod() <em>Get Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGetMethod()
- * @generated
- * @ordered
- */
- protected String getMethod = GET_METHOD_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSetMethod() <em>Set Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSetMethod()
- * @generated
- * @ordered
- */
- protected static final String SET_METHOD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSetMethod() <em>Set Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSetMethod()
- * @generated
- * @ordered
- */
- protected String setMethod = SET_METHOD_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlAccessMethods()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ACCESS_METHODS;
- }
-
- /**
- * Returns the value of the '<em><b>Get Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Get Method</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Get Method</em>' attribute.
- * @see #setGetMethod(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods_GetMethod()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getGetMethod()
- {
- return getMethod;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getGetMethod <em>Get Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Get Method</em>' attribute.
- * @see #getGetMethod()
- * @generated
- */
- public void setGetMethod(String newGetMethod)
- {
- String oldGetMethod = getMethod;
- getMethod = newGetMethod;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD, oldGetMethod, getMethod));
- }
-
- /**
- * Returns the value of the '<em><b>Set Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Set Method</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Set Method</em>' attribute.
- * @see #setSetMethod(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethods_SetMethod()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSetMethod()
- {
- return setMethod;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethods#getSetMethod <em>Set Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Set Method</em>' attribute.
- * @see #getSetMethod()
- * @generated
- */
- public void setSetMethod(String newSetMethod)
- {
- String oldSetMethod = setMethod;
- setMethod = newSetMethod;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD, oldSetMethod, setMethod));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD:
- return getGetMethod();
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD:
- return getSetMethod();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD:
- setGetMethod((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD:
- setSetMethod((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD:
- setGetMethod(GET_METHOD_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD:
- setSetMethod(SET_METHOD_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__GET_METHOD:
- return GET_METHOD_EDEFAULT == null ? getMethod != null : !GET_METHOD_EDEFAULT.equals(getMethod);
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS__SET_METHOD:
- return SET_METHOD_EDEFAULT == null ? setMethod != null : !SET_METHOD_EDEFAULT.equals(setMethod);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (getMethod: ");
- result.append(getMethod);
- result.append(", setMethod: ");
- result.append(setMethod);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethods(),
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildGetMethodTranslator(),
- buildSetMethodTranslator(),
- };
- }
-
- protected static Translator buildGetMethodTranslator() {
- return new Translator(EclipseLink.ACCESS_METHODS__GET_METHOD, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethods_GetMethod(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSetMethodTranslator() {
- return new Translator(EclipseLink.ACCESS_METHODS__SET_METHOD, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethods_SetMethod(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlAccessMethods
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java
deleted file mode 100644
index 6e33a0f918..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAccessMethodsHolder.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Access Methods Holder</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder#getAccessMethods <em>Access Methods</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAccessMethodsHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- XmlAccessMethods getAccessMethods();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- void setAccessMethods(XmlAccessMethods value);
-
-} // XmlAccessMethodsHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAdditionalCriteria.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAdditionalCriteria.java
deleted file mode 100644
index 15d23edb6f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAdditionalCriteria.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Additional Criteria</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAdditionalCriteria()
- * @model kind="class"
- * @generated
- */
-public class XmlAdditionalCriteria extends AbstractJpaEObject implements XmlAdditionalCriteria_2_2
-{
- /**
- * The default value of the '{@link #getCriteria() <em>Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCriteria()
- * @generated
- * @ordered
- */
- protected static final String CRITERIA_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCriteria() <em>Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCriteria()
- * @generated
- * @ordered
- */
- protected String criteria = CRITERIA_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlAdditionalCriteria()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ADDITIONAL_CRITERIA;
- }
-
- /**
- * Returns the value of the '<em><b>Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Criteria</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Criteria</em>' attribute.
- * @see #setCriteria(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAdditionalCriteria_2_2_Criteria()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCriteria()
- {
- return criteria;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAdditionalCriteria#getCriteria <em>Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Criteria</em>' attribute.
- * @see #getCriteria()
- * @generated
- */
- public void setCriteria(String newCriteria)
- {
- String oldCriteria = criteria;
- criteria = newCriteria;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA, oldCriteria, criteria));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA:
- return getCriteria();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA:
- setCriteria((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA:
- setCriteria(CRITERIA_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ADDITIONAL_CRITERIA__CRITERIA:
- return CRITERIA_EDEFAULT == null ? criteria != null : !CRITERIA_EDEFAULT.equals(criteria);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (criteria: ");
- result.append(criteria);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlAdditionalCriteria(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildCriteriaTranslator()
- };
- }
-
- protected static Translator buildCriteriaTranslator() {
- return new Translator(EclipseLink2_2.CRITERIA, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlAdditionalCriteria_2_2_Criteria());
- }
-
-} // XmlAdditionalCriteria
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java
deleted file mode 100644
index 715c33917a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlArray.java
+++ /dev/null
@@ -1,1303 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.ColumnMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.EnumType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.TemporalType;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Array</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlArray()
- * @model kind="class"
- * @generated
- */
-public class XmlArray extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlArray_2_3, XmlConvertibleMapping
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The default value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected static final boolean LOB_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isLob() <em>Lob</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isLob()
- * @generated
- * @ordered
- */
- protected boolean lob = LOB_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final TemporalType TEMPORAL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTemporal() <em>Temporal</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTemporal()
- * @generated
- * @ordered
- */
- protected TemporalType temporal = TEMPORAL_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final EnumType ENUMERATED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getEnumerated() <em>Enumerated</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getEnumerated()
- * @generated
- * @ordered
- */
- protected EnumType enumerated = ENUMERATED_EDEFAULT;
-
- /**
- * The cached value of the '{@link #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 #getDatabaseType() <em>Database Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDatabaseType()
- * @generated
- * @ordered
- */
- protected static final String DATABASE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDatabaseType() <em>Database Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDatabaseType()
- * @generated
- * @ordered
- */
- protected String databaseType = DATABASE_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTargetClass() <em>Target Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetClass()
- * @generated
- * @ordered
- */
- protected static final String TARGET_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTargetClass() <em>Target Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetClass()
- * @generated
- * @ordered
- */
- protected String targetClass = TARGET_CLASS_EDEFAULT;
-
- /**
- * 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 XmlArray()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ARRAY;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_ARRAY__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_ARRAY__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * 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.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#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.jpa.eclipselink.core.resource.orm.XmlArray#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, EclipseLinkOrmPackage.XML_ARRAY__LOB, oldLob, lob));
- }
-
- /**
- * Returns the value of the '<em><b>Temporal</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.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.jpa.core.resource.orm.TemporalType
- * @see #setTemporal(TemporalType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Temporal()
- * @model
- * @generated
- */
- public TemporalType getTemporal()
- {
- return temporal;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray#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.jpa.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, EclipseLinkOrmPackage.XML_ARRAY__TEMPORAL, oldTemporal, temporal));
- }
-
- /**
- * Returns the value of the '<em><b>Enumerated</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.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.jpa.core.resource.orm.EnumType
- * @see #setEnumerated(EnumType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Enumerated()
- * @model
- * @generated
- */
- public EnumType getEnumerated()
- {
- return enumerated;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray#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.jpa.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, EclipseLinkOrmPackage.XML_ARRAY__ENUMERATED, oldEnumerated, enumerated));
- }
-
- /**
- * 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.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#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, EclipseLinkOrmPackage.XML_ARRAY__COLUMN, oldColumn, newColumn);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray#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 - EclipseLinkOrmPackage.XML_ARRAY__COLUMN, null, msgs);
- if (newColumn != null)
- msgs = ((InternalEObject)newColumn).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ARRAY__COLUMN, null, msgs);
- msgs = basicSetColumn(newColumn, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ARRAY__COLUMN, newColumn, newColumn));
- }
-
- /**
- * Returns the value of the '<em><b>Database Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Database Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Database Type</em>' attribute.
- * @see #setDatabaseType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlArray_2_3_DatabaseType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDatabaseType()
- {
- return databaseType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray#getDatabaseType <em>Database Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Database Type</em>' attribute.
- * @see #getDatabaseType()
- * @generated
- */
- public void setDatabaseType(String newDatabaseType)
- {
- String oldDatabaseType = databaseType;
- databaseType = newDatabaseType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ARRAY__DATABASE_TYPE, oldDatabaseType, databaseType));
- }
-
- /**
- * Returns the value of the '<em><b>Target Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Target Class</em>' attribute.
- * @see #setTargetClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlArray_2_3_TargetClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTargetClass()
- {
- return targetClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray#getTargetClass <em>Target Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Class</em>' attribute.
- * @see #getTargetClass()
- * @generated
- */
- public void setTargetClass(String newTargetClass)
- {
- String oldTargetClass = targetClass;
- targetClass = newTargetClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS, oldTargetClass, targetClass));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlArray#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_ARRAY__CONVERT, oldConvert, convert));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ARRAY__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ARRAY__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ARRAY__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 EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_ARRAY__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_ARRAY__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_ARRAY__LOB:
- return isLob();
- case EclipseLinkOrmPackage.XML_ARRAY__TEMPORAL:
- return getTemporal();
- case EclipseLinkOrmPackage.XML_ARRAY__ENUMERATED:
- return getEnumerated();
- case EclipseLinkOrmPackage.XML_ARRAY__COLUMN:
- return getColumn();
- case EclipseLinkOrmPackage.XML_ARRAY__DATABASE_TYPE:
- return getDatabaseType();
- case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS:
- return getTargetClass();
- case EclipseLinkOrmPackage.XML_ARRAY__CONVERT:
- return getConvert();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__LOB:
- setLob((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__TEMPORAL:
- setTemporal((TemporalType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__ENUMERATED:
- setEnumerated((EnumType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__COLUMN:
- setColumn((XmlColumn)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__DATABASE_TYPE:
- setDatabaseType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS:
- setTargetClass((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__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_ARRAY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__LOB:
- setLob(LOB_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__TEMPORAL:
- setTemporal(TEMPORAL_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__ENUMERATED:
- setEnumerated(ENUMERATED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__COLUMN:
- setColumn((XmlColumn)null);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__DATABASE_TYPE:
- setDatabaseType(DATABASE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS:
- setTargetClass(TARGET_CLASS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ARRAY__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_ARRAY__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ARRAY__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ARRAY__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ARRAY__LOB:
- return lob != LOB_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ARRAY__TEMPORAL:
- return temporal != TEMPORAL_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ARRAY__ENUMERATED:
- return enumerated != ENUMERATED_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ARRAY__COLUMN:
- return column != null;
- case EclipseLinkOrmPackage.XML_ARRAY__DATABASE_TYPE:
- return DATABASE_TYPE_EDEFAULT == null ? databaseType != null : !DATABASE_TYPE_EDEFAULT.equals(databaseType);
- case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS:
- return TARGET_CLASS_EDEFAULT == null ? targetClass != null : !TARGET_CLASS_EDEFAULT.equals(targetClass);
- case EclipseLinkOrmPackage.XML_ARRAY__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 == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ARRAY__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ARRAY__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == org.eclipse.jpt.jpa.core.resource.orm.XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__LOB: return OrmPackage.XML_CONVERTIBLE_MAPPING__LOB;
- case EclipseLinkOrmPackage.XML_ARRAY__TEMPORAL: return OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL;
- case EclipseLinkOrmPackage.XML_ARRAY__ENUMERATED: return OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == ColumnMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__COLUMN: return OrmPackage.COLUMN_MAPPING__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlArray_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__DATABASE_TYPE: return EclipseLinkOrmV2_3Package.XML_ARRAY_23__DATABASE_TYPE;
- case EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS: return EclipseLinkOrmV2_3Package.XML_ARRAY_23__TARGET_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ARRAY__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ARRAY__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ARRAY__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ARRAY__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_ARRAY__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ARRAY__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ARRAY__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_ARRAY__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == org.eclipse.jpt.jpa.core.resource.orm.XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_CONVERTIBLE_MAPPING__LOB: return EclipseLinkOrmPackage.XML_ARRAY__LOB;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__TEMPORAL: return EclipseLinkOrmPackage.XML_ARRAY__TEMPORAL;
- case OrmPackage.XML_CONVERTIBLE_MAPPING__ENUMERATED: return EclipseLinkOrmPackage.XML_ARRAY__ENUMERATED;
- default: return -1;
- }
- }
- if (baseClass == ColumnMapping.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.COLUMN_MAPPING__COLUMN: return EclipseLinkOrmPackage.XML_ARRAY__COLUMN;
- default: return -1;
- }
- }
- if (baseClass == XmlArray_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_ARRAY_23__DATABASE_TYPE: return EclipseLinkOrmPackage.XML_ARRAY__DATABASE_TYPE;
- case EclipseLinkOrmV2_3Package.XML_ARRAY_23__TARGET_CLASS: return EclipseLinkOrmPackage.XML_ARRAY__TARGET_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_ARRAY__CONVERT;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(", lob: ");
- result.append(lob);
- result.append(", temporal: ");
- result.append(temporal);
- result.append(", enumerated: ");
- result.append(enumerated);
- result.append(", databaseType: ");
- result.append(databaseType);
- result.append(", targetClass: ");
- result.append(targetClass);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.ARRAY_ATTRIBUTE_MAPPING_KEY;
- }
-
- public TextRange getEnumeratedTextRange() {
- return getAttributeTextRange(JPA.ENUMERATED);
- }
-
- public TextRange getLobTextRange() {
- return getAttributeTextRange(JPA.LOB);
- }
-
- public TextRange getTemporalTextRange() {
- return getAttributeTextRange(JPA.TEMPORAL);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLink.CONVERT);
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlArray(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildDatabaseTypeTranslator(),
- buildTargetClassTranslator(),
- buildAccessTranslator(),
- buildAttributeTypeTranslator(),
- buildColumnTranslator(),
- buildTemporalTranslator(),
- buildEnumeratedTranslator(),
- buildLobTranslator(),
- buildConvertTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
-
- protected static Translator buildColumnTranslator() {
- return XmlColumn.buildTranslator(JPA.COLUMN, OrmPackage.eINSTANCE.getColumnMapping_Column());
- }
-
- protected static Translator buildTemporalTranslator() {
- return new Translator(JPA.TEMPORAL, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Temporal());
- }
-
- protected static Translator buildEnumeratedTranslator() {
- return new Translator(JPA.ENUMERATED, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Enumerated());
- }
-
- protected static Translator buildLobTranslator() {
- return new EmptyTagBooleanTranslator(JPA.LOB, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Lob());
- }
-
- protected static Translator buildConvertTranslator() {
- return new Translator(EclipseLink.CONVERT, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertibleMapping_Convert());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildDatabaseTypeTranslator() {
- return new Translator(EclipseLink2_3.ARRAY__DATABASE_TYPE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlArray_2_3_DatabaseType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTargetClassTranslator() {
- return new Translator(EclipseLink2_3.ARRAY__TARGET_CLASS, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlArray_2_3_TargetClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_3.ARRAY__ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- // *********** content assist ************
-
- protected TextRange getConvertCodeAssistTextRange() {
- return getElementCodeAssistTextRange(EclipseLink.CONVERT);
- }
-
- public boolean convertTouches(int pos) {
- TextRange textRange = this.getConvertCodeAssistTextRange();
- return (textRange != null) && (textRange.touches(pos));
- }
-} // XmlArray
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java
deleted file mode 100644
index 319f595948..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlAttributeMapping.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml 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.jpa.eclipselink.core.resource.orm.XmlAttributeMapping#getAttributeType <em>Attribute Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlAttributeMapping
- extends org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeMapping,
- XmlAccessMethodsHolder, XmlPropertyContainer
-{
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAttributeType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- void setAttributeType(String value);
-
- TextRange getAttributeTypeTextRange();
-
-} // XmlAttributeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java
deleted file mode 100644
index 04fdac3f60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasic.java
+++ /dev/null
@@ -1,1564 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Basic</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic()
- * @model kind="class"
- * @generated
- */
-public class XmlBasic extends org.eclipse.jpt.jpa.core.resource.orm.XmlBasic implements XmlBasic_1_1, XmlBasic_2_1, XmlBasic_2_2, XmlBasic_2_4, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping, XmlConverterContainer
-{
- /**
- * The cached value of the '{@link #getSequenceGenerator() <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceGenerator()
- * @generated
- * @ordered
- */
- protected XmlSequenceGenerator sequenceGenerator;
- /**
- * The cached value of the '{@link #getTableGenerator() <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableGenerator()
- * @generated
- * @ordered
- */
- protected XmlTableGenerator tableGenerator;
- /**
- * The cached value of the '{@link #getGeneratedValue() <em>Generated Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getGeneratedValue()
- * @generated
- * @ordered
- */
- protected XmlGeneratedValue generatedValue;
-
- /**
- * The cached value of the '{@link #getReturnInsert() <em>Return Insert</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnInsert()
- * @generated
- * @ordered
- */
- protected XmlReturnInsert returnInsert;
- /**
- * The default value of the '{@link #getReturnUpdate() <em>Return Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnUpdate()
- * @generated
- * @ordered
- */
- protected static final Boolean RETURN_UPDATE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getReturnUpdate() <em>Return Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnUpdate()
- * @generated
- * @ordered
- */
- protected Boolean returnUpdate = RETURN_UPDATE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIndex()
- * @generated
- * @ordered
- */
- protected XmlIndex_2_2 index;
- /**
- * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheIndex()
- * @generated
- * @ordered
- */
- protected XmlCacheIndex_2_4 cacheIndex;
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
- /**
- * The 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 default value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected static final String CONVERT_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected String convert = CONVERT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasic()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BASIC;
- }
-
- /**
- * Returns the value of the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mutable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mutable</em>' attribute.
- * @see #setMutable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable_Mutable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getMutable()
- {
- return mutable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getMutable <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mutable</em>' attribute.
- * @see #getMutable()
- * @generated
- */
- public void setMutable(Boolean newMutable)
- {
- Boolean oldMutable = mutable;
- mutable = newMutable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__MUTABLE, oldMutable, mutable));
- }
-
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- public void setConvert(String newConvert)
- {
- String oldConvert = convert;
- convert = newConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__CONVERT, oldConvert, convert));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_BASIC__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Generator</em>' containment reference.
- * @see #setSequenceGenerator(XmlSequenceGenerator)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlGeneratorContainer_SequenceGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlSequenceGenerator getSequenceGenerator()
- {
- return sequenceGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetSequenceGenerator(XmlSequenceGenerator newSequenceGenerator, NotificationChain msgs)
- {
- XmlSequenceGenerator oldSequenceGenerator = sequenceGenerator;
- sequenceGenerator = newSequenceGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getSequenceGenerator <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Generator</em>' containment reference.
- * @see #getSequenceGenerator()
- * @generated
- */
- public void setSequenceGenerator(XmlSequenceGenerator newSequenceGenerator)
- {
- if (newSequenceGenerator != sequenceGenerator)
- {
- NotificationChain msgs = null;
- if (sequenceGenerator != null)
- msgs = ((InternalEObject)sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR, null, msgs);
- if (newSequenceGenerator != null)
- msgs = ((InternalEObject)newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR, null, msgs);
- msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table Generator</em>' containment reference.
- * @see #setTableGenerator(XmlTableGenerator)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlGeneratorContainer_TableGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlTableGenerator getTableGenerator()
- {
- return tableGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTableGenerator(XmlTableGenerator newTableGenerator, NotificationChain msgs)
- {
- XmlTableGenerator oldTableGenerator = tableGenerator;
- tableGenerator = newTableGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR, oldTableGenerator, newTableGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getTableGenerator <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table Generator</em>' containment reference.
- * @see #getTableGenerator()
- * @generated
- */
- public void setTableGenerator(XmlTableGenerator newTableGenerator)
- {
- if (newTableGenerator != tableGenerator)
- {
- NotificationChain msgs = null;
- if (tableGenerator != null)
- msgs = ((InternalEObject)tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR, null, msgs);
- if (newTableGenerator != null)
- msgs = ((InternalEObject)newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR, null, msgs);
- msgs = basicSetTableGenerator(newTableGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR, newTableGenerator, newTableGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Generated Value</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Generated Value</em>' containment reference.
- * @see #setGeneratedValue(XmlGeneratedValue)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_1_1_GeneratedValue()
- * @model containment="true"
- * @generated
- */
- public XmlGeneratedValue getGeneratedValue()
- {
- return generatedValue;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetGeneratedValue(XmlGeneratedValue newGeneratedValue, NotificationChain msgs)
- {
- XmlGeneratedValue oldGeneratedValue = generatedValue;
- generatedValue = newGeneratedValue;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE, oldGeneratedValue, newGeneratedValue);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getGeneratedValue <em>Generated Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Generated Value</em>' containment reference.
- * @see #getGeneratedValue()
- * @generated
- */
- public void setGeneratedValue(XmlGeneratedValue newGeneratedValue)
- {
- if (newGeneratedValue != generatedValue)
- {
- NotificationChain msgs = null;
- if (generatedValue != null)
- msgs = ((InternalEObject)generatedValue).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE, null, msgs);
- if (newGeneratedValue != null)
- msgs = ((InternalEObject)newGeneratedValue).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE, null, msgs);
- msgs = basicSetGeneratedValue(newGeneratedValue, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE, newGeneratedValue, newGeneratedValue));
- }
-
- /**
- * Returns the value of the '<em><b>Return Insert</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Insert</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Insert</em>' containment reference.
- * @see #setReturnInsert(XmlReturnInsert)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_1_ReturnInsert()
- * @model containment="true"
- * @generated
- */
- public XmlReturnInsert getReturnInsert()
- {
- return returnInsert;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReturnInsert(XmlReturnInsert newReturnInsert, NotificationChain msgs)
- {
- XmlReturnInsert oldReturnInsert = returnInsert;
- returnInsert = newReturnInsert;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT, oldReturnInsert, newReturnInsert);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getReturnInsert <em>Return Insert</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Insert</em>' containment reference.
- * @see #getReturnInsert()
- * @generated
- */
- public void setReturnInsert(XmlReturnInsert newReturnInsert)
- {
- if (newReturnInsert != returnInsert)
- {
- NotificationChain msgs = null;
- if (returnInsert != null)
- msgs = ((InternalEObject)returnInsert).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT, null, msgs);
- if (newReturnInsert != null)
- msgs = ((InternalEObject)newReturnInsert).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT, null, msgs);
- msgs = basicSetReturnInsert(newReturnInsert, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT, newReturnInsert, newReturnInsert));
- }
-
- /**
- * Returns the value of the '<em><b>Return Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Update</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Update</em>' attribute.
- * @see #setReturnUpdate(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_1_ReturnUpdate()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReturnUpdate()
- {
- return returnUpdate;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getReturnUpdate <em>Return Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Update</em>' attribute.
- * @see #getReturnUpdate()
- * @generated
- */
- public void setReturnUpdate(Boolean newReturnUpdate)
- {
- Boolean oldReturnUpdate = returnUpdate;
- returnUpdate = newReturnUpdate;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE, oldReturnUpdate, returnUpdate));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_2_Index()
- * @model containment="true"
- * @generated
- */
- public XmlIndex_2_2 getIndex()
- {
- return index;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIndex(XmlIndex_2_2 newIndex, NotificationChain msgs)
- {
- XmlIndex_2_2 oldIndex = index;
- index = newIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__INDEX, oldIndex, newIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- public void setIndex(XmlIndex_2_2 newIndex)
- {
- if (newIndex != index)
- {
- NotificationChain msgs = null;
- if (index != null)
- msgs = ((InternalEObject)index).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__INDEX, null, msgs);
- if (newIndex != null)
- msgs = ((InternalEObject)newIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__INDEX, null, msgs);
- msgs = basicSetIndex(newIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__INDEX, newIndex, newIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasic_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- public XmlCacheIndex_2_4 getCacheIndex()
- {
- return cacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheIndex(XmlCacheIndex_2_4 newCacheIndex, NotificationChain msgs)
- {
- XmlCacheIndex_2_4 oldCacheIndex = cacheIndex;
- cacheIndex = newCacheIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX, oldCacheIndex, newCacheIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- public void setCacheIndex(XmlCacheIndex_2_4 newCacheIndex)
- {
- if (newCacheIndex != cacheIndex)
- {
- NotificationChain msgs = null;
- if (cacheIndex != null)
- msgs = ((InternalEObject)cacheIndex).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX, null, msgs);
- if (newCacheIndex != null)
- msgs = ((InternalEObject)newCacheIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX, null, msgs);
- msgs = basicSetCacheIndex(newCacheIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX, newCacheIndex, newCacheIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_BASIC__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR:
- return basicSetSequenceGenerator(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- return basicSetTableGenerator(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- return basicSetGeneratedValue(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- return basicSetReturnInsert(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- return basicSetIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- return basicSetCacheIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_BASIC__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_BASIC__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- return getTableGenerator();
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- return getGeneratedValue();
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- return getReturnInsert();
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE:
- return getReturnUpdate();
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- return getIndex();
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- return getCacheIndex();
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE:
- return getMutable();
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT:
- return getConvert();
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_BASIC__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_BASIC__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- setReturnInsert((XmlReturnInsert)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE:
- setReturnUpdate((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- setIndex((XmlIndex_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE:
- setMutable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT:
- setConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__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_BASIC__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- setGeneratedValue((XmlGeneratedValue)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- setReturnInsert((XmlReturnInsert)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE:
- setReturnUpdate(RETURN_UPDATE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- setIndex((XmlIndex_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE:
- setMutable(MUTABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT:
- setConvert(CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_BASIC__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_BASIC__SEQUENCE_GENERATOR:
- return sequenceGenerator != null;
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR:
- return tableGenerator != null;
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE:
- return generatedValue != null;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT:
- return returnInsert != null;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE:
- return RETURN_UPDATE_EDEFAULT == null ? returnUpdate != null : !RETURN_UPDATE_EDEFAULT.equals(returnUpdate);
- case EclipseLinkOrmPackage.XML_BASIC__INDEX:
- return index != null;
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX:
- return cacheIndex != null;
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE:
- return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable);
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT:
- return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert);
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_BASIC__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 == XmlGeneratorContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR;
- case EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_1_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE: return EclipseLinkOrmV1_1Package.XML_BASIC_11__GENERATED_VALUE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT: return EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_INSERT;
- case EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE: return EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_UPDATE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__INDEX: return EclipseLinkOrmV2_2Package.XML_BASIC_22__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX: return EclipseLinkOrmV2_4Package.XML_BASIC_24__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__MUTABLE: return EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_BASIC__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__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 == XmlGeneratorContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR: return EclipseLinkOrmPackage.XML_BASIC__SEQUENCE_GENERATOR;
- case OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR: return EclipseLinkOrmPackage.XML_BASIC__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_1_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV1_1Package.XML_BASIC_11__GENERATED_VALUE: return EclipseLinkOrmPackage.XML_BASIC__GENERATED_VALUE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_INSERT: return EclipseLinkOrmPackage.XML_BASIC__RETURN_INSERT;
- case EclipseLinkOrmV2_1Package.XML_BASIC_21__RETURN_UPDATE: return EclipseLinkOrmPackage.XML_BASIC__RETURN_UPDATE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_BASIC_22__INDEX: return EclipseLinkOrmPackage.XML_BASIC__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlBasic_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_BASIC_24__CACHE_INDEX: return EclipseLinkOrmPackage.XML_BASIC__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_BASIC__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_BASIC__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_BASIC__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE: return EclipseLinkOrmPackage.XML_BASIC__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_BASIC__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_BASIC__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_BASIC__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_BASIC__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_BASIC__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(" (returnUpdate: ");
- result.append(returnUpdate);
- result.append(", attributeType: ");
- result.append(attributeType);
- result.append(", mutable: ");
- result.append(mutable);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMutableTextRange() {
- return getAttributeTextRange(EclipseLink.MUTABLE);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLink.CONVERT);
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlBasic(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildFetchTranslator(),
- buildOptionalTranslator(),
- buildAccessTranslator(),
- buildMutableTranslator(),
- buildAttributeTypeTranslator(),
- buildColumnTranslator(),
- buildIndexTranslator(),
- buildCacheIndexTranslator(),
- buildGeneratedValueTranslator(),
- buildLobTranslator(),
- buildTemporalTranslator(),
- buildEnumeratedTranslator(),
- buildConvertTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildTableGeneratorTranslator(),
- buildSequenceGeneratorTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildReturnInsertTranslator(),
- buildReturnUpdateTranslator()};
- }
-
- protected static Translator buildMutableTranslator() {
- return new Translator(EclipseLink.MUTABLE, EclipseLinkOrmPackage.eINSTANCE.getXmlMutable_Mutable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIndexTranslator() {
- return XmlIndex.buildTranslator(EclipseLink2_2.INDEX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlBasic_2_2_Index());
- }
-
- protected static Translator buildCacheIndexTranslator() {
- return XmlCacheIndex.buildTranslator(EclipseLink2_4.CACHE_INDEX, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlBasic_2_4_CacheIndex());
- }
-
- protected static Translator buildGeneratedValueTranslator() {
- return XmlGeneratedValue.buildTranslator(EclipseLink1_1.GENERATED_VALUE, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlBasic_1_1_GeneratedValue());
- }
-
- protected static Translator buildConvertTranslator() {
- return new Translator(EclipseLink.CONVERT, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertibleMapping_Convert());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator.buildTranslator(EclipseLink1_1.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_TableGenerator());
- }
-
- protected static Translator buildSequenceGeneratorTranslator() {
- return XmlSequenceGenerator.buildTranslator(EclipseLink1_1.SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_SequenceGenerator());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildReturnInsertTranslator() {
- return XmlReturnInsert.buildTranslator(EclipseLink2_1.RETURN_INSERT, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBasic_2_1_ReturnInsert());
- }
-
- protected static Translator buildReturnUpdateTranslator() {
- return new Translator(EclipseLink2_1.RETURN_UPDATE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBasic_2_1_ReturnUpdate());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- // *********** content assist ************
-
- protected TextRange getConvertCodeAssistTextRange() {
- return getElementCodeAssistTextRange(EclipseLink.CONVERT);
- }
-
- public boolean convertTouches(int pos) {
- TextRange textRange = this.getConvertCodeAssistTextRange();
- return (textRange != null) && (textRange.touches(pos));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java
deleted file mode 100644
index a7cc8a8985..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicCollection.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Collection Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves. *
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicCollection extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlBasicCollection_2_2
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasicCollection()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BASIC_COLLECTION;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicCollection_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicCollection#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasicCollection_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_BASIC_COLLECTION__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_BASIC_COLLECTION__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasicCollection_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_BASIC_COLLECTION__CASCADE_ON_DELETE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java
deleted file mode 100644
index be9106165b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBasicMap.java
+++ /dev/null
@@ -1,526 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Map Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves. *
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap()
- * @model kind="class"
- * @generated
- */
-public class XmlBasicMap extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlBasicMap_2_2
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBasicMap()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BASIC_MAP;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBasicMap_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasicMap#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasicMap_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_BASIC_MAP_22__CASCADE_ON_DELETE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_BASIC_MAP__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_BASIC_MAP__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_BASIC_MAP__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlBasicMap_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_BASIC_MAP_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_BASIC_MAP__CASCADE_ON_DELETE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetch.java
deleted file mode 100644
index a7301e857d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetch.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xm Batch Fetch</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch()
- * @model kind="class"
- * @generated
- */
-public class XmlBatchFetch extends AbstractJpaEObject implements XmlBatchFetch_2_1
-{
- /**
- * The default value of the '{@link #getSize() <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSize()
- * @generated
- * @ordered
- */
- protected static final Integer SIZE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSize() <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSize()
- * @generated
- * @ordered
- */
- protected Integer size = SIZE_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final BatchFetchType_2_1 BATCH_FETCH_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getBatchFetchType() <em>Batch Fetch Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetchType()
- * @generated
- * @ordered
- */
- protected BatchFetchType_2_1 batchFetchType = BATCH_FETCH_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlBatchFetch()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_BATCH_FETCH;
- }
-
- /**
- * Returns the value of the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Size</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Size</em>' attribute.
- * @see #setSize(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch_2_1_Size()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getSize()
- {
- return size;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch#getSize <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Size</em>' attribute.
- * @see #getSize()
- * @generated
- */
- public void setSize(Integer newSize)
- {
- Integer oldSize = size;
- size = newSize;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE, oldSize, size));
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #setBatchFetchType(BatchFetchType_2_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetch_2_1_BatchFetchType()
- * @model
- * @generated
- */
- public BatchFetchType_2_1 getBatchFetchType()
- {
- return batchFetchType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetch#getBatchFetchType <em>Batch Fetch Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #getBatchFetchType()
- * @generated
- */
- public void setBatchFetchType(BatchFetchType_2_1 newBatchFetchType)
- {
- BatchFetchType_2_1 oldBatchFetchType = batchFetchType;
- batchFetchType = newBatchFetchType == null ? BATCH_FETCH_TYPE_EDEFAULT : newBatchFetchType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE, oldBatchFetchType, batchFetchType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE:
- return getSize();
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE:
- return getBatchFetchType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE:
- setSize((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE:
- setBatchFetchType((BatchFetchType_2_1)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE:
- setSize(SIZE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE:
- setBatchFetchType(BATCH_FETCH_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__SIZE:
- return SIZE_EDEFAULT == null ? size != null : !SIZE_EDEFAULT.equals(size);
- case EclipseLinkOrmPackage.XML_BATCH_FETCH__BATCH_FETCH_TYPE:
- return batchFetchType != BATCH_FETCH_TYPE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (size: ");
- result.append(size);
- result.append(", batchFetchType: ");
- result.append(batchFetchType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildSizeTranslator(),
- buildBatchFetchTypeTranslator(),
- };
- }
-
- protected static Translator buildSizeTranslator() {
- return new Translator(EclipseLink2_1.BATCH_FETCH__SIZE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBatchFetch_2_1_Size(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildBatchFetchTypeTranslator() {
- return new Translator(EclipseLink2_1.BATCH_FETCH__TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlBatchFetch_2_1_BatchFetchType(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmBatchFetch
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetchHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetchHolder.java
deleted file mode 100644
index a1b6747965..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlBatchFetchHolder.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Batch Fetch Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder#getBatchFetch <em>Batch Fetch</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBatchFetchHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- XmlBatchFetch getBatchFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- void setBatchFetch(XmlBatchFetch value);
-
-} // XmlBatchFetchHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCache.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCache.java
deleted file mode 100644
index 3577450bd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCache.java
+++ /dev/null
@@ -1,1029 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Cache</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiry <em>Expiry</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getSize <em>Size</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getShared <em>Shared</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getAlwaysRefresh <em>Always Refresh</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getRefreshOnlyIfNewer <em>Refresh Only If Newer</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDisableHits <em>Disable Hits</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getCoordinationType <em>Coordination Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiryTimeOfDay <em>Expiry Time Of Day</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache()
- * @model kind="class"
- * @generated
- */
-public class XmlCache extends AbstractJpaEObject implements XmlCache_2_2, XmlCache_2_4
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final CacheIsolationType ISOLATION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getIsolation() <em>Isolation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIsolation()
- * @generated
- * @ordered
- */
- protected CacheIsolationType isolation = ISOLATION_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final DatabaseChangeNotificationType DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDatabaseChangeNotificationType() <em>Database Change Notification Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDatabaseChangeNotificationType()
- * @generated
- * @ordered
- */
- protected DatabaseChangeNotificationType databaseChangeNotificationType = DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getExpiry() <em>Expiry</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpiry()
- * @generated
- * @ordered
- */
- protected static final Integer EXPIRY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExpiry() <em>Expiry</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpiry()
- * @generated
- * @ordered
- */
- protected Integer expiry = EXPIRY_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSize() <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSize()
- * @generated
- * @ordered
- */
- protected static final Integer SIZE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSize() <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSize()
- * @generated
- * @ordered
- */
- protected Integer size = SIZE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getShared() <em>Shared</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getShared()
- * @generated
- * @ordered
- */
- protected static final Boolean SHARED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getShared() <em>Shared</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getShared()
- * @generated
- * @ordered
- */
- protected Boolean shared = SHARED_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final CacheType TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected CacheType type = TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getAlwaysRefresh() <em>Always Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAlwaysRefresh()
- * @generated
- * @ordered
- */
- protected static final Boolean ALWAYS_REFRESH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAlwaysRefresh() <em>Always Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAlwaysRefresh()
- * @generated
- * @ordered
- */
- protected Boolean alwaysRefresh = ALWAYS_REFRESH_EDEFAULT;
-
- /**
- * The default value of the '{@link #getRefreshOnlyIfNewer() <em>Refresh Only If Newer</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRefreshOnlyIfNewer()
- * @generated
- * @ordered
- */
- protected static final Boolean REFRESH_ONLY_IF_NEWER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getRefreshOnlyIfNewer() <em>Refresh Only If Newer</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRefreshOnlyIfNewer()
- * @generated
- * @ordered
- */
- protected Boolean refreshOnlyIfNewer = REFRESH_ONLY_IF_NEWER_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDisableHits() <em>Disable Hits</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDisableHits()
- * @generated
- * @ordered
- */
- protected static final Boolean DISABLE_HITS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDisableHits() <em>Disable Hits</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDisableHits()
- * @generated
- * @ordered
- */
- protected Boolean disableHits = DISABLE_HITS_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final CacheCoordinationType COORDINATION_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCoordinationType() <em>Coordination Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCoordinationType()
- * @generated
- * @ordered
- */
- protected CacheCoordinationType coordinationType = COORDINATION_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getExpiryTimeOfDay() <em>Expiry Time Of Day</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExpiryTimeOfDay()
- * @generated
- * @ordered
- */
- protected XmlTimeOfDay expiryTimeOfDay;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCache()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CACHE;
- }
-
- /**
- * Returns the value of the '<em><b>Isolation</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Isolation</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Isolation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see #setIsolation(CacheIsolationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_2_2_Isolation()
- * @model default=""
- * @generated
- */
- public CacheIsolationType getIsolation()
- {
- return isolation;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getIsolation <em>Isolation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Isolation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see #getIsolation()
- * @generated
- */
- public void setIsolation(CacheIsolationType newIsolation)
- {
- CacheIsolationType oldIsolation = isolation;
- isolation = newIsolation == null ? ISOLATION_EDEFAULT : newIsolation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__ISOLATION, oldIsolation, isolation));
- }
-
- /**
- * Returns the value of the '<em><b>Database Change Notification Type</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Database Change Notification Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Database Change Notification Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see #setDatabaseChangeNotificationType(DatabaseChangeNotificationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_2_4_DatabaseChangeNotificationType()
- * @model default=""
- * @generated
- */
- public DatabaseChangeNotificationType getDatabaseChangeNotificationType()
- {
- return databaseChangeNotificationType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDatabaseChangeNotificationType <em>Database Change Notification Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Database Change Notification Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see #getDatabaseChangeNotificationType()
- * @generated
- */
- public void setDatabaseChangeNotificationType(DatabaseChangeNotificationType newDatabaseChangeNotificationType)
- {
- DatabaseChangeNotificationType oldDatabaseChangeNotificationType = databaseChangeNotificationType;
- databaseChangeNotificationType = newDatabaseChangeNotificationType == null ? DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT : newDatabaseChangeNotificationType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE, oldDatabaseChangeNotificationType, databaseChangeNotificationType));
- }
-
- /**
- * Returns the value of the '<em><b>Expiry</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Expiry</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Expiry</em>' attribute.
- * @see #setExpiry(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_Expiry()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getExpiry()
- {
- return expiry;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiry <em>Expiry</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Expiry</em>' attribute.
- * @see #getExpiry()
- * @generated
- */
- public void setExpiry(Integer newExpiry)
- {
- Integer oldExpiry = expiry;
- expiry = newExpiry;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__EXPIRY, oldExpiry, expiry));
- }
-
- /**
- * Returns the value of the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Size</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Size</em>' attribute.
- * @see #setSize(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_Size()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getSize()
- {
- return size;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getSize <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Size</em>' attribute.
- * @see #getSize()
- * @generated
- */
- public void setSize(Integer newSize)
- {
- Integer oldSize = size;
- size = newSize;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__SIZE, oldSize, size));
- }
-
- /**
- * Returns the value of the '<em><b>Shared</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Shared</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Shared</em>' attribute.
- * @see #setShared(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_Shared()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getShared()
- {
- return shared;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getShared <em>Shared</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Shared</em>' attribute.
- * @see #getShared()
- * @generated
- */
- public void setShared(Boolean newShared)
- {
- Boolean oldShared = shared;
- shared = newShared;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__SHARED, oldShared, shared));
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @see #setType(CacheType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_Type()
- * @model
- * @generated
- */
- public CacheType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType
- * @see #getType()
- * @generated
- */
- public void setType(CacheType newType)
- {
- CacheType oldType = type;
- type = newType == null ? TYPE_EDEFAULT : newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__TYPE, oldType, type));
- }
-
- /**
- * Returns the value of the '<em><b>Always Refresh</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Always Refresh</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Always Refresh</em>' attribute.
- * @see #setAlwaysRefresh(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_AlwaysRefresh()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getAlwaysRefresh()
- {
- return alwaysRefresh;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getAlwaysRefresh <em>Always Refresh</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Always Refresh</em>' attribute.
- * @see #getAlwaysRefresh()
- * @generated
- */
- public void setAlwaysRefresh(Boolean newAlwaysRefresh)
- {
- Boolean oldAlwaysRefresh = alwaysRefresh;
- alwaysRefresh = newAlwaysRefresh;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH, oldAlwaysRefresh, alwaysRefresh));
- }
-
- /**
- * Returns the value of the '<em><b>Refresh Only If Newer</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Refresh Only If Newer</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Refresh Only If Newer</em>' attribute.
- * @see #setRefreshOnlyIfNewer(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_RefreshOnlyIfNewer()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getRefreshOnlyIfNewer()
- {
- return refreshOnlyIfNewer;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getRefreshOnlyIfNewer <em>Refresh Only If Newer</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Refresh Only If Newer</em>' attribute.
- * @see #getRefreshOnlyIfNewer()
- * @generated
- */
- public void setRefreshOnlyIfNewer(Boolean newRefreshOnlyIfNewer)
- {
- Boolean oldRefreshOnlyIfNewer = refreshOnlyIfNewer;
- refreshOnlyIfNewer = newRefreshOnlyIfNewer;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER, oldRefreshOnlyIfNewer, refreshOnlyIfNewer));
- }
-
- /**
- * Returns the value of the '<em><b>Disable Hits</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Disable Hits</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Disable Hits</em>' attribute.
- * @see #setDisableHits(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_DisableHits()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getDisableHits()
- {
- return disableHits;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getDisableHits <em>Disable Hits</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Disable Hits</em>' attribute.
- * @see #getDisableHits()
- * @generated
- */
- public void setDisableHits(Boolean newDisableHits)
- {
- Boolean oldDisableHits = disableHits;
- disableHits = newDisableHits;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS, oldDisableHits, disableHits));
- }
-
- /**
- * Returns the value of the '<em><b>Coordination Type</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Coordination Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Coordination Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @see #setCoordinationType(CacheCoordinationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_CoordinationType()
- * @model default=""
- * @generated
- */
- public CacheCoordinationType getCoordinationType()
- {
- return coordinationType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getCoordinationType <em>Coordination Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Coordination Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType
- * @see #getCoordinationType()
- * @generated
- */
- public void setCoordinationType(CacheCoordinationType newCoordinationType)
- {
- CacheCoordinationType oldCoordinationType = coordinationType;
- coordinationType = newCoordinationType == null ? COORDINATION_TYPE_EDEFAULT : newCoordinationType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE, oldCoordinationType, coordinationType));
- }
-
- /**
- * Returns the value of the '<em><b>Expiry Time Of Day</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Expiry Time Of Day</em>' reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Expiry Time Of Day</em>' containment reference.
- * @see #setExpiryTimeOfDay(XmlTimeOfDay)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCache_ExpiryTimeOfDay()
- * @model containment="true"
- * @generated
- */
- public XmlTimeOfDay getExpiryTimeOfDay()
- {
- return expiryTimeOfDay;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetExpiryTimeOfDay(XmlTimeOfDay newExpiryTimeOfDay, NotificationChain msgs)
- {
- XmlTimeOfDay oldExpiryTimeOfDay = expiryTimeOfDay;
- expiryTimeOfDay = newExpiryTimeOfDay;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY, oldExpiryTimeOfDay, newExpiryTimeOfDay);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache#getExpiryTimeOfDay <em>Expiry Time Of Day</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Expiry Time Of Day</em>' containment reference.
- * @see #getExpiryTimeOfDay()
- * @generated
- */
- public void setExpiryTimeOfDay(XmlTimeOfDay newExpiryTimeOfDay)
- {
- if (newExpiryTimeOfDay != expiryTimeOfDay)
- {
- NotificationChain msgs = null;
- if (expiryTimeOfDay != null)
- msgs = ((InternalEObject)expiryTimeOfDay).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY, null, msgs);
- if (newExpiryTimeOfDay != null)
- msgs = ((InternalEObject)newExpiryTimeOfDay).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY, null, msgs);
- msgs = basicSetExpiryTimeOfDay(newExpiryTimeOfDay, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY, newExpiryTimeOfDay, newExpiryTimeOfDay));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- return basicSetExpiryTimeOfDay(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__ISOLATION:
- return getIsolation();
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE:
- return getDatabaseChangeNotificationType();
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY:
- return getExpiry();
- case EclipseLinkOrmPackage.XML_CACHE__SIZE:
- return getSize();
- case EclipseLinkOrmPackage.XML_CACHE__SHARED:
- return getShared();
- case EclipseLinkOrmPackage.XML_CACHE__TYPE:
- return getType();
- case EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH:
- return getAlwaysRefresh();
- case EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER:
- return getRefreshOnlyIfNewer();
- case EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS:
- return getDisableHits();
- case EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE:
- return getCoordinationType();
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- return getExpiryTimeOfDay();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__ISOLATION:
- setIsolation((CacheIsolationType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE:
- setDatabaseChangeNotificationType((DatabaseChangeNotificationType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY:
- setExpiry((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__SIZE:
- setSize((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__SHARED:
- setShared((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__TYPE:
- setType((CacheType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH:
- setAlwaysRefresh((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER:
- setRefreshOnlyIfNewer((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS:
- setDisableHits((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE:
- setCoordinationType((CacheCoordinationType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- setExpiryTimeOfDay((XmlTimeOfDay)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__ISOLATION:
- setIsolation(ISOLATION_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE:
- setDatabaseChangeNotificationType(DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY:
- setExpiry(EXPIRY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__SIZE:
- setSize(SIZE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__SHARED:
- setShared(SHARED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH:
- setAlwaysRefresh(ALWAYS_REFRESH_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER:
- setRefreshOnlyIfNewer(REFRESH_ONLY_IF_NEWER_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS:
- setDisableHits(DISABLE_HITS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE:
- setCoordinationType(COORDINATION_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- setExpiryTimeOfDay((XmlTimeOfDay)null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__ISOLATION:
- return isolation != ISOLATION_EDEFAULT;
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE:
- return databaseChangeNotificationType != DATABASE_CHANGE_NOTIFICATION_TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY:
- return EXPIRY_EDEFAULT == null ? expiry != null : !EXPIRY_EDEFAULT.equals(expiry);
- case EclipseLinkOrmPackage.XML_CACHE__SIZE:
- return SIZE_EDEFAULT == null ? size != null : !SIZE_EDEFAULT.equals(size);
- case EclipseLinkOrmPackage.XML_CACHE__SHARED:
- return SHARED_EDEFAULT == null ? shared != null : !SHARED_EDEFAULT.equals(shared);
- case EclipseLinkOrmPackage.XML_CACHE__TYPE:
- return type != TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_CACHE__ALWAYS_REFRESH:
- return ALWAYS_REFRESH_EDEFAULT == null ? alwaysRefresh != null : !ALWAYS_REFRESH_EDEFAULT.equals(alwaysRefresh);
- case EclipseLinkOrmPackage.XML_CACHE__REFRESH_ONLY_IF_NEWER:
- return REFRESH_ONLY_IF_NEWER_EDEFAULT == null ? refreshOnlyIfNewer != null : !REFRESH_ONLY_IF_NEWER_EDEFAULT.equals(refreshOnlyIfNewer);
- case EclipseLinkOrmPackage.XML_CACHE__DISABLE_HITS:
- return DISABLE_HITS_EDEFAULT == null ? disableHits != null : !DISABLE_HITS_EDEFAULT.equals(disableHits);
- case EclipseLinkOrmPackage.XML_CACHE__COORDINATION_TYPE:
- return coordinationType != COORDINATION_TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_CACHE__EXPIRY_TIME_OF_DAY:
- return expiryTimeOfDay != null;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlCache_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE: return EclipseLinkOrmV2_4Package.XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlCache_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE: return EclipseLinkOrmPackage.XML_CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (isolation: ");
- result.append(isolation);
- result.append(", databaseChangeNotificationType: ");
- result.append(databaseChangeNotificationType);
- result.append(", expiry: ");
- result.append(expiry);
- result.append(", size: ");
- result.append(size);
- result.append(", shared: ");
- result.append(shared);
- result.append(", type: ");
- result.append(type);
- result.append(", alwaysRefresh: ");
- result.append(alwaysRefresh);
- result.append(", refreshOnlyIfNewer: ");
- result.append(refreshOnlyIfNewer);
- result.append(", disableHits: ");
- result.append(disableHits);
- result.append(", coordinationType: ");
- result.append(coordinationType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildExpiryTranslator(),
- buildExpiryTimeOfDayTranslator(),
- buildSizeTranslator(),
- buildSharedTranslator(),
- buildIsolationTranslator(),
- buildTypeTranslator(),
- buildAlwaysRefreshTranslator(),
- buildRefreshOnlyIfNewerTranslator(),
- buildDisableHitsTranslator(),
- buildCoordinationTypeTranslator(),
- buildDatabaseChangeNotificationTypeTranslator(),
- };
- }
-
- protected static Translator buildExpiryTranslator() {
- return new Translator(EclipseLink.CACHE__EXPIRY, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_Expiry());
- }
-
- protected static Translator buildExpiryTimeOfDayTranslator() {
- return XmlTimeOfDay.buildTranslator(EclipseLink.EXPIRY_TIME_OF_DAY, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_ExpiryTimeOfDay());
- }
-
- protected static Translator buildSizeTranslator() {
- return new Translator(EclipseLink.CACHE__SIZE, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_Size(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSharedTranslator() {
- return new Translator(EclipseLink.CACHE__SHARED, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_Shared(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink.CACHE__TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_Type(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAlwaysRefreshTranslator() {
- return new Translator(EclipseLink.CACHE__ALWAYS_REFRESH, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_AlwaysRefresh(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildRefreshOnlyIfNewerTranslator() {
- return new Translator(EclipseLink.CACHE__REFRESH_ONLY_IF_NEWER, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_RefreshOnlyIfNewer(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDisableHitsTranslator() {
- return new Translator(EclipseLink.CACHE__DISABLE_HITS, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_DisableHits(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCoordinationTypeTranslator() {
- return new Translator(EclipseLink.CACHE__COORDINATION_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlCache_CoordinationType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIsolationTranslator() {
- return new Translator(EclipseLink2_2.CACHE__ISOLATION, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlCache_2_2_Isolation(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDatabaseChangeNotificationTypeTranslator() {
- return new Translator(EclipseLink2_4.CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlCache_2_4_DatabaseChangeNotificationType(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlCache
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheHolder.java
deleted file mode 100644
index f0a5c0de09..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheHolder.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Cache Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getCache <em>Cache</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getExistenceChecking <em>Existence Checking</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCacheHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache</em>' containment reference.
- * @see #setCache(XmlCache)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_Cache()
- * @model containment="true"
- * @generated
- */
- XmlCache getCache();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getCache <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache</em>' containment reference.
- * @see #getCache()
- * @generated
- */
- void setCache(XmlCache value);
-
- /**
- * Returns the value of the '<em><b>Existence Checking</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Existence Checking</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #setExistenceChecking(ExistenceType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_ExistenceChecking()
- * @model default=""
- * @generated
- */
- ExistenceType getExistenceChecking();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCacheHolder#getExistenceChecking <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #getExistenceChecking()
- * @generated
- */
- void setExistenceChecking(ExistenceType value);
-
-} // XmlCacheHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheIndex.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheIndex.java
deleted file mode 100644
index aa252f224c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCacheIndex.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.util.EDataTypeEList;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache Index</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheIndex()
- * @model kind="class"
- * @generated
- */
-public class XmlCacheIndex extends AbstractJpaEObject implements XmlCacheIndex_2_4
-{
- /**
- * The cached value of the '{@link #getColumnNames() <em>Column Names</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnNames()
- * @generated
- * @ordered
- */
- protected EList<String> columnNames;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCacheIndex()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CACHE_INDEX;
- }
-
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheIndex_2_4_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public EList<String> getColumnNames()
- {
- if (columnNames == null)
- {
- columnNames = new EDataTypeEList<String>(String.class, this, EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES);
- }
- return columnNames;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES:
- return getColumnNames();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES:
- getColumnNames().clear();
- getColumnNames().addAll((Collection<? extends String>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES:
- getColumnNames().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_INDEX__COLUMN_NAMES:
- return columnNames != null && !columnNames.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (columnNames: ");
- result.append(columnNames);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlCacheIndex(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildColumnNameTranslator()
- };
- }
-
- protected static Translator buildColumnNameTranslator() {
- return new Translator(EclipseLink2_4.CACHE_INDEX__COLUMN_NAME, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlCacheIndex_2_4_ColumnNames());
- }
-} // XmlCacheIndex
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTracking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTracking.java
deleted file mode 100644
index e82bb7751e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTracking.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
-
- * A representation of the model object '<em><b>Xml Change Tracking</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking#getType <em>Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlChangeTracking extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlChangeTrackingType TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected XmlChangeTrackingType type = TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlChangeTracking()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CHANGE_TRACKING;
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see #setType(XmlChangeTrackingType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTracking_Type()
- * @model
- * @generated
- */
- public XmlChangeTrackingType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTracking#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType
- * @see #getType()
- * @generated
- */
- public void setType(XmlChangeTrackingType newType)
- {
- XmlChangeTrackingType oldType = type;
- type = newType == null ? TYPE_EDEFAULT : newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE, oldType, type));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE:
- return getType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE:
- setType((XmlChangeTrackingType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING__TYPE:
- return type != TYPE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (type: ");
- result.append(type);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, Translator.END_TAG_NO_INDENT, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildTypeTranslator()
- };
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink.TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlChangeTracking_Type(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlChangeTracking
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java
deleted file mode 100644
index 3144406326..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingHolder.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Change Tracking Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder#getChangeTracking <em>Change Tracking</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlChangeTrackingHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Change Tracking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Change Tracking</em>' containment reference.
- * @see #setChangeTracking(XmlChangeTracking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder_ChangeTracking()
- * @model containment="true"
- * @generated
- */
- XmlChangeTracking getChangeTracking();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingHolder#getChangeTracking <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Change Tracking</em>' containment reference.
- * @see #getChangeTracking()
- * @generated
- */
- void setChangeTracking(XmlChangeTracking value);
-
-} // XmlChangeTrackingHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingType.java
deleted file mode 100644
index 02a765c6fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlChangeTrackingType.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the literals of the enumeration '<em><b>Xml Change Tracking Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingType()
- * @model
- * @generated
- */
-public enum XmlChangeTrackingType implements Enumerator
-{
- /**
- * The '<em><b>ATTRIBUTE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ATTRIBUTE_VALUE
- * @generated
- * @ordered
- */
- ATTRIBUTE(0, "ATTRIBUTE", "ATTRIBUTE"), /**
- * The '<em><b>OBJECT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OBJECT_VALUE
- * @generated
- * @ordered
- */
- OBJECT(1, "OBJECT", "OBJECT"), /**
- * The '<em><b>DEFERRED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #DEFERRED_VALUE
- * @generated
- * @ordered
- */
- DEFERRED(2, "DEFERRED", "DEFERRED"), /**
- * The '<em><b>AUTO</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #AUTO_VALUE
- * @generated
- * @ordered
- */
- AUTO(3, "AUTO", "AUTO")
- ;
-
- /**
- * The '<em><b>ATTRIBUTE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ATTRIBUTE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ATTRIBUTE
- * @model
- * @generated
- * @ordered
- */
- public static final int ATTRIBUTE_VALUE = 0;
-
-/**
- * The '<em><b>OBJECT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OBJECT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OBJECT
- * @model
- * @generated
- * @ordered
- */
- public static final int OBJECT_VALUE = 1;
-
-/**
- * The '<em><b>DEFERRED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>DEFERRED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #DEFERRED
- * @model
- * @generated
- * @ordered
- */
- public static final int DEFERRED_VALUE = 2;
-
-/**
- * The '<em><b>AUTO</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>AUTO</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #AUTO
- * @model
- * @generated
- * @ordered
- */
- public static final int AUTO_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Xml Change Tracking Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlChangeTrackingType[] VALUES_ARRAY =
- new XmlChangeTrackingType[]
- {
- ATTRIBUTE,
- OBJECT,
- DEFERRED,
- AUTO,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Change Tracking Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlChangeTrackingType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Change Tracking Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlChangeTrackingType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlChangeTrackingType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Change Tracking Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlChangeTrackingType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlChangeTrackingType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Change Tracking Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlChangeTrackingType get(int value)
- {
- switch (value)
- {
- case ATTRIBUTE_VALUE: return ATTRIBUTE;
- case OBJECT_VALUE: return OBJECT;
- case DEFERRED_VALUE: return DEFERRED;
- case AUTO_VALUE: return AUTO;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private XmlChangeTrackingType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlChangeTrackingType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java
deleted file mode 100644
index 772affa448..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCloneCopyPolicy.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Clone Copy Policy</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getMethod <em>Method</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getWorkingCopyMethod <em>Working Copy Method</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlCloneCopyPolicy extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getMethod() <em>Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMethod()
- * @generated
- * @ordered
- */
- protected static final String METHOD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMethod() <em>Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMethod()
- * @generated
- * @ordered
- */
- protected String method = METHOD_EDEFAULT;
-
- /**
- * The default value of the '{@link #getWorkingCopyMethod() <em>Working Copy Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getWorkingCopyMethod()
- * @generated
- * @ordered
- */
- protected static final String WORKING_COPY_METHOD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getWorkingCopyMethod() <em>Working Copy Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getWorkingCopyMethod()
- * @generated
- * @ordered
- */
- protected String workingCopyMethod = WORKING_COPY_METHOD_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCloneCopyPolicy()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CLONE_COPY_POLICY;
- }
-
- /**
- * Returns the value of the '<em><b>Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Method</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Method</em>' attribute.
- * @see #setMethod(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy_Method()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMethod()
- {
- return method;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getMethod <em>Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Method</em>' attribute.
- * @see #getMethod()
- * @generated
- */
- public void setMethod(String newMethod)
- {
- String oldMethod = method;
- method = newMethod;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD, oldMethod, method));
- }
-
- /**
- * Returns the value of the '<em><b>Working Copy Method</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Working Copy Method</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Working Copy Method</em>' attribute.
- * @see #setWorkingCopyMethod(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCloneCopyPolicy_WorkingCopyMethod()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getWorkingCopyMethod()
- {
- return workingCopyMethod;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCloneCopyPolicy#getWorkingCopyMethod <em>Working Copy Method</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Working Copy Method</em>' attribute.
- * @see #getWorkingCopyMethod()
- * @generated
- */
- public void setWorkingCopyMethod(String newWorkingCopyMethod)
- {
- String oldWorkingCopyMethod = workingCopyMethod;
- workingCopyMethod = newWorkingCopyMethod;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD, oldWorkingCopyMethod, workingCopyMethod));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD:
- return getMethod();
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD:
- return getWorkingCopyMethod();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD:
- setMethod((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD:
- setWorkingCopyMethod((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD:
- setMethod(METHOD_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD:
- setWorkingCopyMethod(WORKING_COPY_METHOD_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__METHOD:
- return METHOD_EDEFAULT == null ? method != null : !METHOD_EDEFAULT.equals(method);
- case EclipseLinkOrmPackage.XML_CLONE_COPY_POLICY__WORKING_COPY_METHOD:
- return WORKING_COPY_METHOD_EDEFAULT == null ? workingCopyMethod != null : !WORKING_COPY_METHOD_EDEFAULT.equals(workingCopyMethod);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (method: ");
- result.append(method);
- result.append(", workingCopyMethod: ");
- result.append(workingCopyMethod);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildMethodTranslator(),
- buildWorkingCopyMethodTranslator(),
- };
- }
-
- protected static Translator buildMethodTranslator() {
- return new Translator(EclipseLink.CLONE_COPY_POLICY__METHOD, EclipseLinkOrmPackage.eINSTANCE.getXmlCloneCopyPolicy_Method(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildWorkingCopyMethodTranslator() {
- return new Translator(EclipseLink.CLONE_COPY_POLICY__WORKING_COPY_METHOD, EclipseLinkOrmPackage.eINSTANCE.getXmlCloneCopyPolicy_WorkingCopyMethod(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlCloneCopyPolicy
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCollectionTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCollectionTable.java
deleted file mode 100644
index ec331f1139..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCollectionTable.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Collection Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionTable()
- * @model kind="class"
- * @generated
- */
-public class XmlCollectionTable extends org.eclipse.jpt.jpa.core.resource.orm.XmlCollectionTable implements XmlCollectionTable_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCollectionTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_COLLECTION_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCollectionTable#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlCollectionTable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_COLLECTION_TABLE_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlCollectionTable_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_COLLECTION_TABLE_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_COLLECTION_TABLE__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlCollectionTable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildJoinColumnTranslator(),
- buildUniqueConstraintTranslator()};
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlCollectionTable_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlCollectionTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConversionValue.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConversionValue.java
deleted file mode 100644
index d746c9261e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConversionValue.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Conversion Value</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getDataValue <em>Data Value</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getObjectValue <em>Object Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlConversionValue extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getDataValue() <em>Data Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataValue()
- * @generated
- * @ordered
- */
- protected static final String DATA_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDataValue() <em>Data Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataValue()
- * @generated
- * @ordered
- */
- protected String dataValue = DATA_VALUE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getObjectValue() <em>Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectValue()
- * @generated
- * @ordered
- */
- protected static final String OBJECT_VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getObjectValue() <em>Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectValue()
- * @generated
- * @ordered
- */
- protected String objectValue = OBJECT_VALUE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlConversionValue()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CONVERSION_VALUE;
- }
-
- /**
- * Returns the value of the '<em><b>Data Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Data Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Data Value</em>' attribute.
- * @see #setDataValue(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue_DataValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDataValue()
- {
- return dataValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getDataValue <em>Data Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Data Value</em>' attribute.
- * @see #getDataValue()
- * @generated
- */
- public void setDataValue(String newDataValue)
- {
- String oldDataValue = dataValue;
- dataValue = newDataValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE, oldDataValue, dataValue));
- }
-
- /**
- * Returns the value of the '<em><b>Object Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Value</em>' attribute.
- * @see #setObjectValue(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConversionValue_ObjectValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getObjectValue()
- {
- return objectValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue#getObjectValue <em>Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Value</em>' attribute.
- * @see #getObjectValue()
- * @generated
- */
- public void setObjectValue(String newObjectValue)
- {
- String oldObjectValue = objectValue;
- objectValue = newObjectValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE, oldObjectValue, objectValue));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE:
- return getDataValue();
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE:
- return getObjectValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE:
- setDataValue((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE:
- setObjectValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE:
- setDataValue(DATA_VALUE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE:
- setObjectValue(OBJECT_VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__DATA_VALUE:
- return DATA_VALUE_EDEFAULT == null ? dataValue != null : !DATA_VALUE_EDEFAULT.equals(dataValue);
- case EclipseLinkOrmPackage.XML_CONVERSION_VALUE__OBJECT_VALUE:
- return OBJECT_VALUE_EDEFAULT == null ? objectValue != null : !OBJECT_VALUE_EDEFAULT.equals(objectValue);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (dataValue: ");
- result.append(dataValue);
- result.append(", objectValue: ");
- result.append(objectValue);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getDataValueTextRange() {
- return getAttributeTextRange(EclipseLink.CONVERSION_VALUE__DATA_VALUE);
- }
-
- public TextRange getObjectValueTextRange() {
- return getAttributeTextRange(EclipseLink.CONVERSION_VALUE__OBJECT_VALUE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildDataValueTranslator(),
- buildObjectValueTranslator()
- };
- }
-
- protected static Translator buildDataValueTranslator() {
- return new Translator(EclipseLink.CONVERSION_VALUE__DATA_VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlConversionValue_DataValue(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildObjectValueTranslator() {
- return new Translator(EclipseLink.CONVERSION_VALUE__OBJECT_VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlConversionValue_ObjectValue(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlConversionValue
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverter.java
deleted file mode 100644
index 4461506109..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverter.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml CustomConverter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter()
- * @model kind="class"
- * @generated
- */
-public class XmlConverter extends XmlNamedConverter
-{
- /**
- * The default value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected static final String CLASS_NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getClassName() <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassName()
- * @generated
- * @ordered
- */
- protected String className = CLASS_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Name</em>' attribute.
- * @see #setClassName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverter_ClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getClassName()
- {
- return className;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter#getClassName <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Name</em>' attribute.
- * @see #getClassName()
- * @generated
- */
- public void setClassName(String newClassName)
- {
- String oldClassName = className;
- className = newClassName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME, oldClassName, className));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME:
- return getClassName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME:
- setClassName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME:
- setClassName(CLASS_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER__CLASS_NAME:
- return CLASS_NAME_EDEFAULT == null ? className != null : !CLASS_NAME_EDEFAULT.equals(className);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (className: ");
- result.append(className);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getConverterClassTextRange() {
- return getAttributeTextRange(EclipseLink.CONVERTER__CLASS);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, Translator.END_TAG_NO_INDENT, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildClassTranslator(),
- };
- }
-
- protected static Translator buildClassTranslator() {
- return new Translator(EclipseLink.CONVERTER__CLASS, EclipseLinkOrmPackage.eINSTANCE.getXmlConverter_ClassName(), Translator.DOM_ATTRIBUTE);
- }
-
-
- // ********** refactoring **********
-
- public ReplaceEdit createRenameEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.className.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.CONVERTER__CLASS).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenamePackageEdit(String newPackageName) {
- int packageLength = this.className.lastIndexOf('.');
- if (newPackageName == "") {//$NON-NLS-1$
- //moving to the default package, remove the '.'
- packageLength++;
- }
- if (packageLength == -1) {
- //moving from the default package or unspecified package
- packageLength = 0;
- newPackageName = newPackageName + '.';
- }
- int offset = getAttributeNode(EclipseLink.CONVERTER__CLASS).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newPackageName);
- }
-
-} // XmlConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverterContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverterContainer.java
deleted file mode 100644
index 17fa83b728..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConverterContainer.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Converter Container</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.2
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getConverters <em>Converters</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getTypeConverters <em>Type Converters</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getObjectTypeConverters <em>Object Type Converters</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer#getStructConverters <em>Struct Converters</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlConverterContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- EList<XmlConverter> getConverters();
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- EList<XmlTypeConverter> getTypeConverters();
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- EList<XmlObjectTypeConverter> getObjectTypeConverters();
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- EList<XmlStructConverter> getStructConverters();
-
-} // XmlConverterContainer
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertibleMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertibleMapping.java
deleted file mode 100644
index 81f7b64894..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlConvertibleMapping.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Convertible Mapping</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping#getConvert <em>Convert</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlConvertibleMapping extends org.eclipse.jpt.jpa.core.resource.orm.XmlConvertibleMapping
-{
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getConvert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- void setConvert(String value);
-
- /**
- * Return the {@link TextRange} for the convert element. If the convert element
- * does not exist return the {@link TextRange} for the mapping element.
- */
- TextRange getConvertTextRange();
-
- boolean convertTouches(int pos);
-
-} // XmlConvertibleMapping
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCopyPolicy.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCopyPolicy.java
deleted file mode 100644
index 9b21b431a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCopyPolicy.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Copy Policy</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_ <em>Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlCopyPolicy extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getClass_() <em>Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClass_()
- * @generated
- * @ordered
- */
- protected static final String CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getClass_() <em>Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClass_()
- * @generated
- * @ordered
- */
- protected String class_ = CLASS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCopyPolicy()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_COPY_POLICY;
- }
-
- /**
- * Returns the value of the '<em><b>Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class</em>' attribute.
- * @see #setClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCopyPolicy_Class()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getClass_()
- {
- return class_;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCopyPolicy#getClass_ <em>Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class</em>' attribute.
- * @see #getClass_()
- * @generated
- */
- public void setClass(String newClass)
- {
- String oldClass = class_;
- class_ = newClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS, oldClass, class_));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS:
- return getClass_();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS:
- setClass((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS:
- setClass(CLASS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_COPY_POLICY__CLASS:
- return CLASS_EDEFAULT == null ? class_ != null : !CLASS_EDEFAULT.equals(class_);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (class: ");
- result.append(class_);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildClassTranslator()
- };
- }
-
- protected static Translator buildClassTranslator() {
- return new Translator(EclipseLink.COPY_POLICY__CLASS, EclipseLinkOrmPackage.eINSTANCE.getXmlCopyPolicy_Class(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlCopyPolicy
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizer.java
deleted file mode 100644
index 89c35476dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizer.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Customizer</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer#getCustomizerClassName <em>Customizer Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlCustomizer extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getCustomizerClassName() <em>Customizer Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizerClassName()
- * @generated
- * @ordered
- */
- protected static final String CUSTOMIZER_CLASS_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCustomizerClassName() <em>Customizer Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizerClassName()
- * @generated
- * @ordered
- */
- protected String customizerClassName = CUSTOMIZER_CLASS_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlCustomizer()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_CUSTOMIZER;
- }
-
- /**
- * Returns the value of the '<em><b>Customizer Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer Class Name</em>' attribute.
- * @see #setCustomizerClassName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizer_CustomizerClassName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCustomizerClassName()
- {
- return customizerClassName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizer#getCustomizerClassName <em>Customizer Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer Class Name</em>' attribute.
- * @see #getCustomizerClassName()
- * @generated
- */
- public void setCustomizerClassName(String newCustomizerClassName)
- {
- String oldCustomizerClassName = customizerClassName;
- customizerClassName = newCustomizerClassName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME, oldCustomizerClassName, customizerClassName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME:
- return getCustomizerClassName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME:
- setCustomizerClassName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME:
- setCustomizerClassName(CUSTOMIZER_CLASS_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER__CUSTOMIZER_CLASS_NAME:
- return CUSTOMIZER_CLASS_NAME_EDEFAULT == null ? customizerClassName != null : !CUSTOMIZER_CLASS_NAME_EDEFAULT.equals(customizerClassName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (customizerClassName: ");
- result.append(customizerClassName);
- result.append(')');
- return result.toString();
- }
-
-} // XmlCustomizer
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizerHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizerHolder.java
deleted file mode 100644
index 65349782cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlCustomizerHolder.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Customizer Holder</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder#getCustomizer <em>Customizer</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCustomizerHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer</em>' containment reference.
- * @see #setCustomizer(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getCustomizer();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCustomizerHolder#getCustomizer <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer</em>' containment reference.
- * @see #getCustomizer()
- * @generated
- */
- void setCustomizer(XmlClassReference value);
-
-} // XmlCustomizerHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlDirection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlDirection.java
deleted file mode 100644
index 07c7801060..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlDirection.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Xml Direction</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlDirection()
- * @model
- * @generated
- */
-public enum XmlDirection implements Enumerator
-{
- /**
- * The '<em><b>IN</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #IN_VALUE
- * @generated
- * @ordered
- */
- IN(0, "IN", "IN"),
-
- /**
- * The '<em><b>OUT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OUT_VALUE
- * @generated
- * @ordered
- */
- OUT(1, "OUT", "OUT"),
-
- /**
- * The '<em><b>IN OUT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #IN_OUT_VALUE
- * @generated
- * @ordered
- */
- IN_OUT(2, "IN_OUT", "IN_OUT"),
-
- /**
- * The '<em><b>OUT CURSOR</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OUT_CURSOR_VALUE
- * @generated
- * @ordered
- */
- OUT_CURSOR(3, "OUT_CURSOR", "OUT_CURSOR");
-
- /**
- * The '<em><b>IN</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>IN</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #IN
- * @model
- * @generated
- * @ordered
- */
- public static final int IN_VALUE = 0;
-
- /**
- * The '<em><b>OUT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OUT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OUT
- * @model
- * @generated
- * @ordered
- */
- public static final int OUT_VALUE = 1;
-
- /**
- * The '<em><b>IN OUT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>IN OUT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #IN_OUT
- * @model
- * @generated
- * @ordered
- */
- public static final int IN_OUT_VALUE = 2;
-
- /**
- * The '<em><b>OUT CURSOR</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OUT CURSOR</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OUT_CURSOR
- * @model
- * @generated
- * @ordered
- */
- public static final int OUT_CURSOR_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Xml Direction</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlDirection[] VALUES_ARRAY =
- new XmlDirection[]
- {
- IN,
- OUT,
- IN_OUT,
- OUT_CURSOR,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Direction</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlDirection> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Direction</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlDirection get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlDirection result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Direction</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlDirection getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlDirection result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Direction</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlDirection get(int value)
- {
- switch (value)
- {
- case IN_VALUE: return IN;
- case OUT_VALUE: return OUT;
- case IN_OUT_VALUE: return IN_OUT;
- case OUT_CURSOR_VALUE: return OUT_CURSOR;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private XmlDirection(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlDirection
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java
deleted file mode 100644
index f9d6615893..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlElementCollection.java
+++ /dev/null
@@ -1,2317 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection()
- * @model kind="class"
- * @generated
- */
-public class XmlElementCollection extends org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection implements XmlElementCollection_2_0, XmlElementCollection_2_1, XmlElementCollection_2_2, XmlElementCollection_2_3, XmlElementCollection_2_4
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected static final String CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected String convert = CONVERT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getMapKeyAssociationOverrides() <em>Map Key Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> mapKeyAssociationOverrides;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The default value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected static final String MAP_KEY_CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected String mapKeyConvert = MAP_KEY_CONVERT_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNoncacheable() <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNoncacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NONCACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNoncacheable() <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNoncacheable()
- * @generated
- * @ordered
- */
- protected boolean noncacheable = NONCACHEABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCompositeMember() <em>Composite Member</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCompositeMember()
- * @generated
- * @ordered
- */
- protected static final String COMPOSITE_MEMBER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCompositeMember() <em>Composite Member</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCompositeMember()
- * @generated
- * @ordered
- */
- protected String compositeMember = COMPOSITE_MEMBER_EDEFAULT;
-
- /**
- * The default value of the '{@link #isDeleteAll() <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeleteAll()
- * @generated
- * @ordered
- */
- protected static final boolean DELETE_ALL_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isDeleteAll() <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeleteAll()
- * @generated
- * @ordered
- */
- protected boolean deleteAll = DELETE_ALL_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlElementCollection()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ELEMENT_COLLECTION;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- public void setConvert(String newConvert)
- {
- String oldConvert = convert;
- convert = newConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT, oldConvert, convert));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getMapKeyAssociationOverrides()
- {
- if (mapKeyAssociationOverrides == null)
- {
- mapKeyAssociationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES);
- }
- return mapKeyAssociationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Convert</em>' attribute.
- * @see #setMapKeyConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMapKeyConvert()
- {
- return mapKeyConvert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getMapKeyConvert <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Convert</em>' attribute.
- * @see #getMapKeyConvert()
- * @generated
- */
- public void setMapKeyConvert(String newMapKeyConvert)
- {
- String oldMapKeyConvert = mapKeyConvert;
- mapKeyConvert = newMapKeyConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT, oldMapKeyConvert, mapKeyConvert));
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Noncacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Noncacheable</em>' attribute.
- * @see #setNoncacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_2_Noncacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNoncacheable()
- {
- return noncacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#isNoncacheable <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Noncacheable</em>' attribute.
- * @see #isNoncacheable()
- * @generated
- */
- public void setNoncacheable(boolean newNoncacheable)
- {
- boolean oldNoncacheable = noncacheable;
- noncacheable = newNoncacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE, oldNoncacheable, noncacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Composite Member</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Composite Member</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Composite Member</em>' attribute.
- * @see #setCompositeMember(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_3_CompositeMember()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCompositeMember()
- {
- return compositeMember;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#getCompositeMember <em>Composite Member</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Composite Member</em>' attribute.
- * @see #getCompositeMember()
- * @generated
- */
- public void setCompositeMember(String newCompositeMember)
- {
- String oldCompositeMember = compositeMember;
- compositeMember = newCompositeMember;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER, oldCompositeMember, compositeMember));
- }
-
- /**
- * Returns the value of the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete All</em>' attribute.
- * @see #setDeleteAll(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlElementCollection_2_4_DeleteAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isDeleteAll()
- {
- return deleteAll;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlElementCollection#isDeleteAll <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete All</em>' attribute.
- * @see #isDeleteAll()
- * @generated
- */
- public void setDeleteAll(boolean newDeleteAll)
- {
- boolean oldDeleteAll = deleteAll;
- deleteAll = newDeleteAll;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL, oldDeleteAll, deleteAll));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getMapKeyAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT:
- return getConvert();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- return getMapKeyAssociationOverrides();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT:
- return getMapKeyConvert();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH:
- return getJoinFetch();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE:
- return isNoncacheable();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER:
- return getCompositeMember();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL:
- return isDeleteAll();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT:
- setConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- getMapKeyAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT:
- setMapKeyConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE:
- setNoncacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER:
- setCompositeMember((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL:
- setDeleteAll((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT:
- setConvert(CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT:
- setMapKeyConvert(MAP_KEY_CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE:
- setNoncacheable(NONCACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER:
- setCompositeMember(COMPOSITE_MEMBER_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL:
- setDeleteAll(DELETE_ALL_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT:
- return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES:
- return mapKeyAssociationOverrides != null && !mapKeyAssociationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT:
- return MAP_KEY_CONVERT_EDEFAULT == null ? mapKeyConvert != null : !MAP_KEY_CONVERT_EDEFAULT.equals(mapKeyConvert);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE:
- return noncacheable != NONCACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER:
- return COMPOSITE_MEMBER_EDEFAULT == null ? compositeMember != null : !COMPOSITE_MEMBER_EDEFAULT.equals(compositeMember);
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL:
- return deleteAll != DELETE_ALL_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT: return EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_0.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE: return EclipseLinkOrmV2_2Package.XML_ELEMENT_COLLECTION_22__NONCACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER: return EclipseLinkOrmV2_3Package.XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL: return EclipseLinkOrmV2_4Package.XML_ELEMENT_COLLECTION_24__DELETE_ALL;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_0.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__JOIN_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_ELEMENT_COLLECTION_22__NONCACHEABLE: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__NONCACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__COMPOSITE_MEMBER;
- default: return -1;
- }
- }
- if (baseClass == XmlElementCollection_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_ELEMENT_COLLECTION_24__DELETE_ALL: return EclipseLinkOrmPackage.XML_ELEMENT_COLLECTION__DELETE_ALL;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(", convert: ");
- result.append(convert);
- result.append(", mapKeyConvert: ");
- result.append(mapKeyConvert);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", noncacheable: ");
- result.append(noncacheable);
- result.append(", compositeMember: ");
- result.append(compositeMember);
- result.append(", deleteAll: ");
- result.append(deleteAll);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** validation **********
-
- @Override
- public TextRange getEnumeratedTextRange() {
- return getAttributeTextRange(JPA.ENUMERATED);
- }
-
- @Override
- public TextRange getLobTextRange() {
- return getAttributeTextRange(JPA.LOB);
- }
-
- @Override
- public TextRange getTemporalTextRange() {
- return getAttributeTextRange(JPA.TEMPORAL);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLink.CONVERT);
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlElementCollection(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetClassTranslator(),
- buildFetchTranslator(),
- buildAccessTranslator(),
- buildAttributeTypeTranslator(),
- buildCompositeMemberTranslator(),
- buildOrderByTranslator(),
- buildOrderColumnTranslator(),
- buildMapKeyTranslator(),
- buildMapKeyClassTranslator(),
- buildMapKeyTemporalTranslator(),
- buildMapKeyEnumeratedTranslator(),
- buildMapKeyConvertTranslator(),
- buildMapKeyAttributeOverrideTranslator(),
- buildMapKeyAssociationOverrideTranslator(),
- XmlColumn.buildTranslator(JPA2_0.MAP_KEY_COLUMN, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_MapKeyColumn()),
- XmlJoinColumn.buildTranslator(JPA2_0.MAP_KEY_JOIN_COLUMN, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_MapKeyJoinColumns()),
- XmlColumn.buildTranslator(JPA.COLUMN, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_Column()),
- buildTemporalTranslator(),
- buildEnumeratedTranslator(),
- buildLobTranslator(),
- buildConvertTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters()),
- XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters()),
- XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters()),
- XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters()),
- XmlCollectionTable.buildTranslator(JPA2_0.COLLECTION_TABLE, OrmV2_0Package.eINSTANCE.getXmlElementCollection_2_0_CollectionTable()),
- buildCascadeOnDeleteTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- buildDeleteAllTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- };
- }
-
- protected static Translator buildMapKeyConvertTranslator() {
- return new Translator(JPA2_0.MAP_KEY_CONVERT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlCollectionMapping_2_0_MapKeyConvert());
- }
-
- protected static Translator buildConvertTranslator() {
- return new Translator(EclipseLink.CONVERT, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertibleMapping_Convert());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildMapKeyAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(EclipseLink2_0.MAP_KEY_ASSOCIATION_OVERRIDE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlElementCollection_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlElementCollection_2_2_Noncacheable());
- }
-
- protected static Translator buildCompositeMemberTranslator() {
- return new Translator(EclipseLink2_3.COMPOSITE_MEMBER, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlElementCollection_2_3_CompositeMember(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDeleteAllTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_4.DELETE_ALL, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlElementCollection_2_4_DeleteAll());
- }
-
- // *********** content assist ************
-
- protected TextRange getConvertCodeAssistTextRange() {
- return getElementCodeAssistTextRange(EclipseLink.CONVERT);
- }
-
- public boolean convertTouches(int pos) {
- TextRange textRange = this.getConvertCodeAssistTextRange();
- return (textRange != null) && (textRange.touches(pos));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddable.java
deleted file mode 100644
index 62a8722d7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddable.java
+++ /dev/null
@@ -1,1611 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Embeddable</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCopyPolicy <em>Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCloneCopyPolicy <em>Clone Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddable extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable implements XmlTypeMapping, XmlEmbeddable_2_2, XmlEmbeddable_2_3, XmlCustomizerHolder, XmlChangeTrackingHolder, XmlConverterContainer, XmlPropertyContainer
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The default value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected static final String PARENT_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected String parentClass = PARENT_CLASS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAttributeOverrides() <em>Attribute Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAttributeOverride> attributeOverrides;
-
- /**
- * The cached value of the '{@link #getAssociationOverrides() <em>Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> associationOverrides;
-
- /**
- * The cached value of the '{@link #getPlsqlRecords() <em>Plsql Records</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlRecords()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlRecord_2_3> plsqlRecords;
-
- /**
- * The cached value of the '{@link #getPlsqlTables() <em>Plsql Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlTables()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlTable> plsqlTables;
-
- /**
- * The cached value of the '{@link #getStruct() <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStruct()
- * @generated
- * @ordered
- */
- protected XmlStruct_2_3 struct;
-
- /**
- * The cached value of the '{@link #getCustomizer() <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizer()
- * @generated
- * @ordered
- */
- protected XmlClassReference customizer;
-
- /**
- * The cached value of the '{@link #getChangeTracking() <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getChangeTracking()
- * @generated
- * @ordered
- */
- protected XmlChangeTracking changeTracking;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The cached value of the '{@link #getCopyPolicy() <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCopyPolicy copyPolicy;
-
- /**
- * The cached value of the '{@link #getInstantiationCopyPolicy() <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInstantiationCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlInstantiationCopyPolicy instantiationCopyPolicy;
-
- /**
- * The cached value of the '{@link #getCloneCopyPolicy() <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCloneCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCloneCopyPolicy cloneCopyPolicy;
-
- /**
- * The default value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected static final Boolean EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected Boolean excludeDefaultMappings = EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_EMBEDDABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeOverrideContainer_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES);
- }
- return attributeOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAssociationOverrideContainer_AssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getAssociationOverrides()
- {
- if (associationOverrides == null)
- {
- associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES);
- }
- return associationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeMapping_2_1_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getParentClass()
- {
- return parentClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- public void setParentClass(String newParentClass)
- {
- String oldParentClass = parentClass;
- parentClass = newParentClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS, oldParentClass, parentClass));
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlRecord_2_3> getPlsqlRecords()
- {
- if (plsqlRecords == null)
- {
- plsqlRecords = new EObjectContainmentEList<XmlPlsqlRecord_2_3>(XmlPlsqlRecord_2_3.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS);
- }
- return plsqlRecords;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlTable> getPlsqlTables()
- {
- if (plsqlTables == null)
- {
- plsqlTables = new EObjectContainmentEList<XmlPlsqlTable>(XmlPlsqlTable.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES);
- }
- return plsqlTables;
- }
-
- /**
- * Returns the value of the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct</em>' containment reference.
- * @see #setStruct(XmlStruct_2_3)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_2_3_Struct()
- * @model containment="true"
- * @generated
- */
- public XmlStruct_2_3 getStruct()
- {
- return struct;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStruct(XmlStruct_2_3 newStruct, NotificationChain msgs)
- {
- XmlStruct_2_3 oldStruct = struct;
- struct = newStruct;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT, oldStruct, newStruct);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getStruct <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct</em>' containment reference.
- * @see #getStruct()
- * @generated
- */
- public void setStruct(XmlStruct_2_3 newStruct)
- {
- if (newStruct != struct)
- {
- NotificationChain msgs = null;
- if (struct != null)
- msgs = ((InternalEObject)struct).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT, null, msgs);
- if (newStruct != null)
- msgs = ((InternalEObject)newStruct).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT, null, msgs);
- msgs = basicSetStruct(newStruct, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT, newStruct, newStruct));
- }
-
- /**
- * Returns the value of the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer</em>' containment reference.
- * @see #setCustomizer(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCustomizer()
- {
- return customizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCustomizer(XmlClassReference newCustomizer, NotificationChain msgs)
- {
- XmlClassReference oldCustomizer = customizer;
- customizer = newCustomizer;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER, oldCustomizer, newCustomizer);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCustomizer <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer</em>' containment reference.
- * @see #getCustomizer()
- * @generated
- */
- public void setCustomizer(XmlClassReference newCustomizer)
- {
- if (newCustomizer != customizer)
- {
- NotificationChain msgs = null;
- if (customizer != null)
- msgs = ((InternalEObject)customizer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER, null, msgs);
- if (newCustomizer != null)
- msgs = ((InternalEObject)newCustomizer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER, null, msgs);
- msgs = basicSetCustomizer(newCustomizer, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER, newCustomizer, newCustomizer));
- }
-
- /**
- * Returns the value of the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Change Tracking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Change Tracking</em>' containment reference.
- * @see #setChangeTracking(XmlChangeTracking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder_ChangeTracking()
- * @model containment="true"
- * @generated
- */
- public XmlChangeTracking getChangeTracking()
- {
- return changeTracking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetChangeTracking(XmlChangeTracking newChangeTracking, NotificationChain msgs)
- {
- XmlChangeTracking oldChangeTracking = changeTracking;
- changeTracking = newChangeTracking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING, oldChangeTracking, newChangeTracking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getChangeTracking <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Change Tracking</em>' containment reference.
- * @see #getChangeTracking()
- * @generated
- */
- public void setChangeTracking(XmlChangeTracking newChangeTracking)
- {
- if (newChangeTracking != changeTracking)
- {
- NotificationChain msgs = null;
- if (changeTracking != null)
- msgs = ((InternalEObject)changeTracking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING, null, msgs);
- if (newChangeTracking != null)
- msgs = ((InternalEObject)newChangeTracking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING, null, msgs);
- msgs = basicSetChangeTracking(newChangeTracking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING, newChangeTracking, newChangeTracking));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Copy Policy</em>' containment reference.
- * @see #setCopyPolicy(XmlCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_CopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCopyPolicy getCopyPolicy()
- {
- return copyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCopyPolicy(XmlCopyPolicy newCopyPolicy, NotificationChain msgs)
- {
- XmlCopyPolicy oldCopyPolicy = copyPolicy;
- copyPolicy = newCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY, oldCopyPolicy, newCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCopyPolicy <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Copy Policy</em>' containment reference.
- * @see #getCopyPolicy()
- * @generated
- */
- public void setCopyPolicy(XmlCopyPolicy newCopyPolicy)
- {
- if (newCopyPolicy != copyPolicy)
- {
- NotificationChain msgs = null;
- if (copyPolicy != null)
- msgs = ((InternalEObject)copyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY, null, msgs);
- if (newCopyPolicy != null)
- msgs = ((InternalEObject)newCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY, null, msgs);
- msgs = basicSetCopyPolicy(newCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY, newCopyPolicy, newCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Instantiation Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #setInstantiationCopyPolicy(XmlInstantiationCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_InstantiationCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlInstantiationCopyPolicy getInstantiationCopyPolicy()
- {
- return instantiationCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy, NotificationChain msgs)
- {
- XmlInstantiationCopyPolicy oldInstantiationCopyPolicy = instantiationCopyPolicy;
- instantiationCopyPolicy = newInstantiationCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY, oldInstantiationCopyPolicy, newInstantiationCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #getInstantiationCopyPolicy()
- * @generated
- */
- public void setInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy)
- {
- if (newInstantiationCopyPolicy != instantiationCopyPolicy)
- {
- NotificationChain msgs = null;
- if (instantiationCopyPolicy != null)
- msgs = ((InternalEObject)instantiationCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY, null, msgs);
- if (newInstantiationCopyPolicy != null)
- msgs = ((InternalEObject)newInstantiationCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY, null, msgs);
- msgs = basicSetInstantiationCopyPolicy(newInstantiationCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY, newInstantiationCopyPolicy, newInstantiationCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Clone Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #setCloneCopyPolicy(XmlCloneCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_CloneCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCloneCopyPolicy getCloneCopyPolicy()
- {
- return cloneCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy, NotificationChain msgs)
- {
- XmlCloneCopyPolicy oldCloneCopyPolicy = cloneCopyPolicy;
- cloneCopyPolicy = newCloneCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY, oldCloneCopyPolicy, newCloneCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getCloneCopyPolicy <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #getCloneCopyPolicy()
- * @generated
- */
- public void setCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy)
- {
- if (newCloneCopyPolicy != cloneCopyPolicy)
- {
- NotificationChain msgs = null;
- if (cloneCopyPolicy != null)
- msgs = ((InternalEObject)cloneCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY, null, msgs);
- if (newCloneCopyPolicy != null)
- msgs = ((InternalEObject)newCloneCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY, null, msgs);
- msgs = basicSetCloneCopyPolicy(newCloneCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY, newCloneCopyPolicy, newCloneCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Mappings</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #setExcludeDefaultMappings(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddable_ExcludeDefaultMappings()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getExcludeDefaultMappings()
- {
- return excludeDefaultMappings;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #getExcludeDefaultMappings()
- * @generated
- */
- public void setExcludeDefaultMappings(Boolean newExcludeDefaultMappings)
- {
- Boolean oldExcludeDefaultMappings = excludeDefaultMappings;
- excludeDefaultMappings = newExcludeDefaultMappings;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS, oldExcludeDefaultMappings, excludeDefaultMappings));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- return ((InternalEList<?>)getPlsqlRecords()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- return ((InternalEList<?>)getPlsqlTables()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- return basicSetStruct(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- return basicSetCustomizer(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- return basicSetChangeTracking(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- return basicSetCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- return basicSetInstantiationCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- return basicSetCloneCopyPolicy(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS:
- return getParentClass();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- return getAssociationOverrides();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- return getPlsqlRecords();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- return getPlsqlTables();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- return getStruct();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- return getCustomizer();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- return getChangeTracking();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- return getCopyPolicy();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- return getInstantiationCopyPolicy();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- return getCloneCopyPolicy();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS:
- return getExcludeDefaultMappings();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS:
- setParentClass((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- getAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- getPlsqlRecords().addAll((Collection<? extends XmlPlsqlRecord_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- getPlsqlTables().clear();
- getPlsqlTables().addAll((Collection<? extends XmlPlsqlTable>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- setStruct((XmlStruct_2_3)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- setCustomizer((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS:
- setParentClass(PARENT_CLASS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- getPlsqlTables().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- setStruct((XmlStruct_2_3)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- setCustomizer((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings(EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS:
- return PARENT_CLASS_EDEFAULT == null ? parentClass != null : !PARENT_CLASS_EDEFAULT.equals(parentClass);
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES:
- return associationOverrides != null && !associationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS:
- return plsqlRecords != null && !plsqlRecords.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES:
- return plsqlTables != null && !plsqlTables.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT:
- return struct != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER:
- return customizer != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING:
- return changeTracking != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__COPY_POLICY:
- return copyPolicy != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__INSTANTIATION_COPY_POLICY:
- return instantiationCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CLONE_COPY_POLICY:
- return cloneCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__EXCLUDE_DEFAULT_MAPPINGS:
- return EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT == null ? excludeDefaultMappings != null : !EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT.equals(excludeDefaultMappings);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS: return EclipseLinkOrmV2_1Package.XML_TYPE_MAPPING_21__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES: return OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS: return EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__PLSQL_RECORDS;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES: return EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__PLSQL_TABLES;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT: return EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__STRUCT;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER: return EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_TYPE_MAPPING_21__PARENT_CLASS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES: return EclipseLinkOrmPackage.XML_EMBEDDABLE__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_EMBEDDABLE__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_2.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlEmbeddable_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__PLSQL_RECORDS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_RECORDS;
- case EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__PLSQL_TABLES: return EclipseLinkOrmPackage.XML_EMBEDDABLE__PLSQL_TABLES;
- case EclipseLinkOrmV2_3Package.XML_EMBEDDABLE_23__STRUCT: return EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER: return EclipseLinkOrmPackage.XML_EMBEDDABLE__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_EMBEDDABLE__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_EMBEDDABLE__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_EMBEDDABLE__PROPERTIES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (parentClass: ");
- result.append(parentClass);
- result.append(", excludeDefaultMappings: ");
- result.append(excludeDefaultMappings);
- result.append(')');
- return result.toString();
- }
-
-
- public TextRange getParentClassTextRange() {
- return getAttributeTextRange(EclipseLink2_1.PARENT_CLASS);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildClassTranslator(),
- buildParentClassTranslator(),
- buildAccessTranslator(),
- buildMetadataCompleteTranslator(),
- buildExcludeDefaultMappingsTranslator(),
- buildDescriptionTranslator(),
- buildAccessMethodsTranslator(),
- buildCustomizerTranslator(),
- buildChangeTrackingTranslator(),
- XmlStruct.buildTranslator(EclipseLink2_3.STRUCT, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEmbeddable_2_3_Struct()),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildCopyPolicyTranslator(),
- buildInstantiationCoypPolicyTranslator(),
- buildCloneCopyPolicyTranslator(),
- XmlPlsqlRecord.buildTranslator(EclipseLink2_3.PLSQL_RECORD, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEmbeddable_2_3_PlsqlRecords()),
- XmlPlsqlTable.buildTranslator(EclipseLink2_3.PLSQL_TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEmbeddable_2_3_PlsqlTables()),
- buildPropertyTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- Attributes.buildTranslator()};
- }
-
- protected static Translator buildExcludeDefaultMappingsTranslator() {
- return new Translator(EclipseLink.EXCLUDE_DEFAULT_MAPPINGS, EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable_ExcludeDefaultMappings(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCustomizerTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink.CUSTOMIZER, EclipseLinkOrmPackage.eINSTANCE.getXmlCustomizerHolder_Customizer());
- }
-
- protected static Translator buildChangeTrackingTranslator() {
- return XmlChangeTracking.buildTranslator(EclipseLink.CHANGE_TRACKING, EclipseLinkOrmPackage.eINSTANCE.getXmlChangeTrackingHolder_ChangeTracking());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters());
- }
-
- protected static Translator buildCopyPolicyTranslator() {
- return XmlCopyPolicy.buildTranslator(EclipseLink.COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable_CopyPolicy());
- }
-
- protected static Translator buildInstantiationCoypPolicyTranslator() {
- return XmlInstantiationCopyPolicy.buildTranslator(EclipseLink.INSTANTIATION_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable_InstantiationCopyPolicy());
- }
-
- protected static Translator buildCloneCopyPolicyTranslator() {
- return XmlCloneCopyPolicy.buildTranslator(EclipseLink.CLONE_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddable_CloneCopyPolicy());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildParentClassTranslator() {
- return new Translator(EclipseLink2_2.PARENT_CLASS, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlTypeMapping_2_1_ParentClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAttributeOverrideTranslator() {
- return XmlAttributeOverride.buildTranslator(JPA.ATTRIBUTE_OVERRIDE, OrmPackage.eINSTANCE.getXmlAttributeOverrideContainer_AttributeOverrides());
- }
-
- protected static Translator buildAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(JPA.ASSOCIATION_OVERRIDE, OrmPackage.eINSTANCE.getXmlAssociationOverrideContainer_AssociationOverrides());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java
deleted file mode 100644
index 0ef29e7403..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbedded.java
+++ /dev/null
@@ -1,460 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embedded Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbedded()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbedded extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded implements XmlAttributeMapping
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbedded()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_EMBEDDED;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbedded#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE:
- return getAttributeType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_EMBEDDED__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_EMBEDDED__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_EMBEDDED__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEmbedded(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- buildAttributeTypeTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java
deleted file mode 100644
index ecc164cf96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEmbeddedId.java
+++ /dev/null
@@ -1,460 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embedded Id Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEmbeddedId()
- * @model kind="class"
- * @generated
- */
-public class XmlEmbeddedId extends org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId implements XmlAttributeMapping
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEmbeddedId()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_EMBEDDED_ID;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddedId#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE:
- return getAttributeType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_EMBEDDED_ID__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_EMBEDDED_ID__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_EMBEDDED_ID__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(')');
- return result.toString();
- }
-
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEmbeddedId(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- buildAttributeTypeTranslator(),
- buildAttributeOverrideTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntity.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntity.java
deleted file mode 100644
index f7fa0b881c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntity.java
+++ /dev/null
@@ -1,3797 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Entity</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getOptimisticLocking <em>Optimistic Locking</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCopyPolicy <em>Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCloneCopyPolicy <em>Clone Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity()
- * @model kind="class"
- * @generated
- */
-public class XmlEntity extends org.eclipse.jpt.jpa.core.resource.orm.XmlEntity implements XmlTypeMapping, XmlEntity_1_1, XmlEntity_2_0, XmlEntity_2_1, XmlEntity_2_2, XmlEntity_2_3, XmlEntity_2_4, XmlReadOnly, XmlCustomizerHolder, XmlChangeTrackingHolder, XmlCacheHolder, XmlConverterContainer, XmlQueryContainer, XmlPropertyContainer
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The default value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected static final String PARENT_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected String parentClass = PARENT_CLASS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKey()
- * @generated
- * @ordered
- */
- protected XmlPrimaryKey primaryKey;
-
- /**
- * The cached value of the '{@link #getCacheInterceptor() <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheInterceptor()
- * @generated
- * @ordered
- */
- protected XmlClassReference cacheInterceptor;
-
- /**
- * The cached value of the '{@link #getQueryRedirectors() <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQueryRedirectors()
- * @generated
- * @ordered
- */
- protected XmlQueryRedirectors queryRedirectors;
-
- /**
- * The cached value of the '{@link #getFetchGroups() <em>Fetch Groups</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetchGroups()
- * @generated
- * @ordered
- */
- protected EList<XmlFetchGroup> fetchGroups;
-
- /**
- * The cached value of the '{@link #getClassExtractor() <em>Class Extractor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getClassExtractor()
- * @generated
- * @ordered
- */
- protected XmlClassReference classExtractor;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAdditionalCriteria() <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAdditionalCriteria()
- * @generated
- * @ordered
- */
- protected XmlAdditionalCriteria_2_2 additionalCriteria;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIndex()
- * @generated
- * @ordered
- */
- protected XmlIndex_2_2 index;
-
- /**
- * The cached value of the '{@link #getMultitenant() <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMultitenant()
- * @generated
- * @ordered
- */
- protected XmlMultitenant multitenant;
-
- /**
- * The cached value of the '{@link #getNamedStoredFunctionQueries() <em>Named Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredFunctionQuery_2_3> namedStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredFunctionQueries() <em>Named Plsql Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredFunctionQuery_2_3> namedPlsqlStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredProcedureQueries() <em>Named Plsql Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredProcedureQuery_2_3> namedPlsqlStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getPlsqlRecords() <em>Plsql Records</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlRecords()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlRecord_2_3> plsqlRecords;
-
- /**
- * The cached value of the '{@link #getPlsqlTables() <em>Plsql Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlTables()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlTable> plsqlTables;
-
- /**
- * The cached value of the '{@link #getStruct() <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStruct()
- * @generated
- * @ordered
- */
- protected XmlStruct_2_3 struct;
-
- /**
- * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheIndex()
- * @generated
- * @ordered
- */
- protected XmlCacheIndex_2_4 cacheIndex;
-
- /**
- * The default value of the '{@link #getReadOnly() <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadOnly()
- * @generated
- * @ordered
- */
- protected static final Boolean READ_ONLY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReadOnly() <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadOnly()
- * @generated
- * @ordered
- */
- protected Boolean readOnly = READ_ONLY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getCustomizer() <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizer()
- * @generated
- * @ordered
- */
- protected XmlClassReference customizer;
-
- /**
- * The cached value of the '{@link #getChangeTracking() <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getChangeTracking()
- * @generated
- * @ordered
- */
- protected XmlChangeTracking changeTracking;
-
- /**
- * The cached value of the '{@link #getCache() <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCache()
- * @generated
- * @ordered
- */
- protected XmlCache cache;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final ExistenceType EXISTENCE_CHECKING_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExistenceChecking() <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExistenceChecking()
- * @generated
- * @ordered
- */
- protected ExistenceType existenceChecking = EXISTENCE_CHECKING_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The cached value of the '{@link #getNamedStoredProcedureQueries() <em>Named Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredProcedureQuery> namedStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The cached value of the '{@link #getOptimisticLocking() <em>Optimistic Locking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptimisticLocking()
- * @generated
- * @ordered
- */
- protected XmlOptimisticLocking optimisticLocking;
-
- /**
- * The cached value of the '{@link #getCopyPolicy() <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCopyPolicy copyPolicy;
-
- /**
- * The cached value of the '{@link #getInstantiationCopyPolicy() <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInstantiationCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlInstantiationCopyPolicy instantiationCopyPolicy;
-
- /**
- * The cached value of the '{@link #getCloneCopyPolicy() <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCloneCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCloneCopyPolicy cloneCopyPolicy;
-
- /**
- * The default value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected static final Boolean EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected Boolean excludeDefaultMappings = EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEntity()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ENTITY;
- }
-
- /**
- * Returns the value of the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Only</em>' attribute.
- * @see #setReadOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly_ReadOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReadOnly()
- {
- return readOnly;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getReadOnly <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Only</em>' attribute.
- * @see #getReadOnly()
- * @generated
- */
- public void setReadOnly(Boolean newReadOnly)
- {
- Boolean oldReadOnly = readOnly;
- readOnly = newReadOnly;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY, oldReadOnly, readOnly));
- }
-
- /**
- * Returns the value of the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer</em>' containment reference.
- * @see #setCustomizer(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCustomizer()
- {
- return customizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCustomizer(XmlClassReference newCustomizer, NotificationChain msgs)
- {
- XmlClassReference oldCustomizer = customizer;
- customizer = newCustomizer;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER, oldCustomizer, newCustomizer);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCustomizer <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer</em>' containment reference.
- * @see #getCustomizer()
- * @generated
- */
- public void setCustomizer(XmlClassReference newCustomizer)
- {
- if (newCustomizer != customizer)
- {
- NotificationChain msgs = null;
- if (customizer != null)
- msgs = ((InternalEObject)customizer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER, null, msgs);
- if (newCustomizer != null)
- msgs = ((InternalEObject)newCustomizer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER, null, msgs);
- msgs = basicSetCustomizer(newCustomizer, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER, newCustomizer, newCustomizer));
- }
-
- /**
- * Returns the value of the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Change Tracking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Change Tracking</em>' containment reference.
- * @see #setChangeTracking(XmlChangeTracking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder_ChangeTracking()
- * @model containment="true"
- * @generated
- */
- public XmlChangeTracking getChangeTracking()
- {
- return changeTracking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetChangeTracking(XmlChangeTracking newChangeTracking, NotificationChain msgs)
- {
- XmlChangeTracking oldChangeTracking = changeTracking;
- changeTracking = newChangeTracking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING, oldChangeTracking, newChangeTracking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getChangeTracking <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Change Tracking</em>' containment reference.
- * @see #getChangeTracking()
- * @generated
- */
- public void setChangeTracking(XmlChangeTracking newChangeTracking)
- {
- if (newChangeTracking != changeTracking)
- {
- NotificationChain msgs = null;
- if (changeTracking != null)
- msgs = ((InternalEObject)changeTracking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING, null, msgs);
- if (newChangeTracking != null)
- msgs = ((InternalEObject)newChangeTracking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING, null, msgs);
- msgs = basicSetChangeTracking(newChangeTracking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING, newChangeTracking, newChangeTracking));
- }
-
- /**
- * Returns the value of the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache</em>' containment reference.
- * @see #setCache(XmlCache)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_Cache()
- * @model containment="true"
- * @generated
- */
- public XmlCache getCache()
- {
- return cache;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCache(XmlCache newCache, NotificationChain msgs)
- {
- XmlCache oldCache = cache;
- cache = newCache;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE, oldCache, newCache);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCache <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache</em>' containment reference.
- * @see #getCache()
- * @generated
- */
- public void setCache(XmlCache newCache)
- {
- if (newCache != cache)
- {
- NotificationChain msgs = null;
- if (cache != null)
- msgs = ((InternalEObject)cache).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE, null, msgs);
- if (newCache != null)
- msgs = ((InternalEObject)newCache).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE, null, msgs);
- msgs = basicSetCache(newCache, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE, newCache, newCache));
- }
-
- /**
- * Returns the value of the '<em><b>Existence Checking</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Existence Checking</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #setExistenceChecking(ExistenceType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_ExistenceChecking()
- * @model default=""
- * @generated
- */
- public ExistenceType getExistenceChecking()
- {
- return existenceChecking;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExistenceChecking <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #getExistenceChecking()
- * @generated
- */
- public void setExistenceChecking(ExistenceType newExistenceChecking)
- {
- ExistenceType oldExistenceChecking = existenceChecking;
- existenceChecking = newExistenceChecking == null ? EXISTENCE_CHECKING_EDEFAULT : newExistenceChecking;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING, oldExistenceChecking, existenceChecking));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Optimistic Locking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optimistic Locking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optimistic Locking</em>' containment reference.
- * @see #setOptimisticLocking(XmlOptimisticLocking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_OptimisticLocking()
- * @model containment="true"
- * @generated
- */
- public XmlOptimisticLocking getOptimisticLocking()
- {
- return optimisticLocking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOptimisticLocking(XmlOptimisticLocking newOptimisticLocking, NotificationChain msgs)
- {
- XmlOptimisticLocking oldOptimisticLocking = optimisticLocking;
- optimisticLocking = newOptimisticLocking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING, oldOptimisticLocking, newOptimisticLocking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getOptimisticLocking <em>Optimistic Locking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optimistic Locking</em>' containment reference.
- * @see #getOptimisticLocking()
- * @generated
- */
- public void setOptimisticLocking(XmlOptimisticLocking newOptimisticLocking)
- {
- if (newOptimisticLocking != optimisticLocking)
- {
- NotificationChain msgs = null;
- if (optimisticLocking != null)
- msgs = ((InternalEObject)optimisticLocking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING, null, msgs);
- if (newOptimisticLocking != null)
- msgs = ((InternalEObject)newOptimisticLocking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING, null, msgs);
- msgs = basicSetOptimisticLocking(newOptimisticLocking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING, newOptimisticLocking, newOptimisticLocking));
- }
-
- /**
- * Returns the value of the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Copy Policy</em>' containment reference.
- * @see #setCopyPolicy(XmlCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_CopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCopyPolicy getCopyPolicy()
- {
- return copyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCopyPolicy(XmlCopyPolicy newCopyPolicy, NotificationChain msgs)
- {
- XmlCopyPolicy oldCopyPolicy = copyPolicy;
- copyPolicy = newCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY, oldCopyPolicy, newCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCopyPolicy <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Copy Policy</em>' containment reference.
- * @see #getCopyPolicy()
- * @generated
- */
- public void setCopyPolicy(XmlCopyPolicy newCopyPolicy)
- {
- if (newCopyPolicy != copyPolicy)
- {
- NotificationChain msgs = null;
- if (copyPolicy != null)
- msgs = ((InternalEObject)copyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY, null, msgs);
- if (newCopyPolicy != null)
- msgs = ((InternalEObject)newCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY, null, msgs);
- msgs = basicSetCopyPolicy(newCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY, newCopyPolicy, newCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Instantiation Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #setInstantiationCopyPolicy(XmlInstantiationCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_InstantiationCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlInstantiationCopyPolicy getInstantiationCopyPolicy()
- {
- return instantiationCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy, NotificationChain msgs)
- {
- XmlInstantiationCopyPolicy oldInstantiationCopyPolicy = instantiationCopyPolicy;
- instantiationCopyPolicy = newInstantiationCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY, oldInstantiationCopyPolicy, newInstantiationCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #getInstantiationCopyPolicy()
- * @generated
- */
- public void setInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy)
- {
- if (newInstantiationCopyPolicy != instantiationCopyPolicy)
- {
- NotificationChain msgs = null;
- if (instantiationCopyPolicy != null)
- msgs = ((InternalEObject)instantiationCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY, null, msgs);
- if (newInstantiationCopyPolicy != null)
- msgs = ((InternalEObject)newInstantiationCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY, null, msgs);
- msgs = basicSetInstantiationCopyPolicy(newInstantiationCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY, newInstantiationCopyPolicy, newInstantiationCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Clone Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #setCloneCopyPolicy(XmlCloneCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_CloneCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCloneCopyPolicy getCloneCopyPolicy()
- {
- return cloneCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy, NotificationChain msgs)
- {
- XmlCloneCopyPolicy oldCloneCopyPolicy = cloneCopyPolicy;
- cloneCopyPolicy = newCloneCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY, oldCloneCopyPolicy, newCloneCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCloneCopyPolicy <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #getCloneCopyPolicy()
- * @generated
- */
- public void setCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy)
- {
- if (newCloneCopyPolicy != cloneCopyPolicy)
- {
- NotificationChain msgs = null;
- if (cloneCopyPolicy != null)
- msgs = ((InternalEObject)cloneCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY, null, msgs);
- if (newCloneCopyPolicy != null)
- msgs = ((InternalEObject)newCloneCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY, null, msgs);
- msgs = basicSetCloneCopyPolicy(newCloneCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY, newCloneCopyPolicy, newCloneCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredProcedureQuery> getNamedStoredProcedureQueries()
- {
- if (namedStoredProcedureQueries == null)
- {
- namedStoredProcedureQueries = new EObjectContainmentEList<XmlNamedStoredProcedureQuery>(XmlNamedStoredProcedureQuery.class, this, EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES);
- }
- return namedStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' containment reference.
- * @see #setPrimaryKey(XmlPrimaryKey)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_1_1_PrimaryKey()
- * @model containment="true"
- * @generated
- */
- public XmlPrimaryKey getPrimaryKey()
- {
- return primaryKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPrimaryKey(XmlPrimaryKey newPrimaryKey, NotificationChain msgs)
- {
- XmlPrimaryKey oldPrimaryKey = primaryKey;
- primaryKey = newPrimaryKey;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY, oldPrimaryKey, newPrimaryKey);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getPrimaryKey <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' containment reference.
- * @see #getPrimaryKey()
- * @generated
- */
- public void setPrimaryKey(XmlPrimaryKey newPrimaryKey)
- {
- if (newPrimaryKey != primaryKey)
- {
- NotificationChain msgs = null;
- if (primaryKey != null)
- msgs = ((InternalEObject)primaryKey).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY, null, msgs);
- if (newPrimaryKey != null)
- msgs = ((InternalEObject)newPrimaryKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY, null, msgs);
- msgs = basicSetPrimaryKey(newPrimaryKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY, newPrimaryKey, newPrimaryKey));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Interceptor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #setCacheInterceptor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_0_CacheInterceptor()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCacheInterceptor()
- {
- return cacheInterceptor;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheInterceptor(XmlClassReference newCacheInterceptor, NotificationChain msgs)
- {
- XmlClassReference oldCacheInterceptor = cacheInterceptor;
- cacheInterceptor = newCacheInterceptor;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR, oldCacheInterceptor, newCacheInterceptor);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCacheInterceptor <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #getCacheInterceptor()
- * @generated
- */
- public void setCacheInterceptor(XmlClassReference newCacheInterceptor)
- {
- if (newCacheInterceptor != cacheInterceptor)
- {
- NotificationChain msgs = null;
- if (cacheInterceptor != null)
- msgs = ((InternalEObject)cacheInterceptor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR, null, msgs);
- if (newCacheInterceptor != null)
- msgs = ((InternalEObject)newCacheInterceptor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR, null, msgs);
- msgs = basicSetCacheInterceptor(newCacheInterceptor, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR, newCacheInterceptor, newCacheInterceptor));
- }
-
- /**
- * Returns the value of the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Redirectors</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Redirectors</em>' containment reference.
- * @see #setQueryRedirectors(XmlQueryRedirectors)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_0_QueryRedirectors()
- * @model containment="true"
- * @generated
- */
- public XmlQueryRedirectors getQueryRedirectors()
- {
- return queryRedirectors;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetQueryRedirectors(XmlQueryRedirectors newQueryRedirectors, NotificationChain msgs)
- {
- XmlQueryRedirectors oldQueryRedirectors = queryRedirectors;
- queryRedirectors = newQueryRedirectors;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS, oldQueryRedirectors, newQueryRedirectors);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getQueryRedirectors <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Redirectors</em>' containment reference.
- * @see #getQueryRedirectors()
- * @generated
- */
- public void setQueryRedirectors(XmlQueryRedirectors newQueryRedirectors)
- {
- if (newQueryRedirectors != queryRedirectors)
- {
- NotificationChain msgs = null;
- if (queryRedirectors != null)
- msgs = ((InternalEObject)queryRedirectors).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS, null, msgs);
- if (newQueryRedirectors != null)
- msgs = ((InternalEObject)newQueryRedirectors).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS, null, msgs);
- msgs = basicSetQueryRedirectors(newQueryRedirectors, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS, newQueryRedirectors, newQueryRedirectors));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Fetch Groups</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch Groups</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch Groups</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroupContainer_2_1_FetchGroups()
- * @model containment="true"
- * @generated
- */
- public EList<XmlFetchGroup> getFetchGroups()
- {
- if (fetchGroups == null)
- {
- fetchGroups = new EObjectContainmentEList<XmlFetchGroup>(XmlFetchGroup.class, this, EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS);
- }
- return fetchGroups;
- }
-
- /**
- * Returns the value of the '<em><b>Class Extractor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Extractor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Extractor</em>' containment reference.
- * @see #setClassExtractor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_1_ClassExtractor()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getClassExtractor()
- {
- return classExtractor;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetClassExtractor(XmlClassReference newClassExtractor, NotificationChain msgs)
- {
- XmlClassReference oldClassExtractor = classExtractor;
- classExtractor = newClassExtractor;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR, oldClassExtractor, newClassExtractor);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getClassExtractor <em>Class Extractor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Extractor</em>' containment reference.
- * @see #getClassExtractor()
- * @generated
- */
- public void setClassExtractor(XmlClassReference newClassExtractor)
- {
- if (newClassExtractor != classExtractor)
- {
- NotificationChain msgs = null;
- if (classExtractor != null)
- msgs = ((InternalEObject)classExtractor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR, null, msgs);
- if (newClassExtractor != null)
- msgs = ((InternalEObject)newClassExtractor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR, null, msgs);
- msgs = basicSetClassExtractor(newClassExtractor, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR, newClassExtractor, newClassExtractor));
- }
-
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeMapping_2_1_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getParentClass()
- {
- return parentClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- public void setParentClass(String newParentClass)
- {
- String oldParentClass = parentClass;
- parentClass = newParentClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS, oldParentClass, parentClass));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_2_Index()
- * @model containment="true"
- * @generated
- */
- public XmlIndex_2_2 getIndex()
- {
- return index;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIndex(XmlIndex_2_2 newIndex, NotificationChain msgs)
- {
- XmlIndex_2_2 oldIndex = index;
- index = newIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__INDEX, oldIndex, newIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- public void setIndex(XmlIndex_2_2 newIndex)
- {
- if (newIndex != index)
- {
- NotificationChain msgs = null;
- if (index != null)
- msgs = ((InternalEObject)index).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__INDEX, null, msgs);
- if (newIndex != null)
- msgs = ((InternalEObject)newIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__INDEX, null, msgs);
- msgs = basicSetIndex(newIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__INDEX, newIndex, newIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Multitenant</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Multitenant</em>' containment reference.
- * @see #setMultitenant(XmlMultitenant)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder_Multitenant()
- * @model containment="true"
- * @generated
- */
- public XmlMultitenant getMultitenant()
- {
- return multitenant;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMultitenant(XmlMultitenant newMultitenant, NotificationChain msgs)
- {
- XmlMultitenant oldMultitenant = multitenant;
- multitenant = newMultitenant;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT, oldMultitenant, newMultitenant);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getMultitenant <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Multitenant</em>' containment reference.
- * @see #getMultitenant()
- * @generated
- */
- public void setMultitenant(XmlMultitenant newMultitenant)
- {
- if (newMultitenant != multitenant)
- {
- NotificationChain msgs = null;
- if (multitenant != null)
- msgs = ((InternalEObject)multitenant).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT, null, msgs);
- if (newMultitenant != null)
- msgs = ((InternalEObject)newMultitenant).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT, null, msgs);
- msgs = basicSetMultitenant(newMultitenant, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT, newMultitenant, newMultitenant));
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries()
- {
- if (namedStoredFunctionQueries == null)
- {
- namedStoredFunctionQueries = new EObjectContainmentEList<XmlNamedStoredFunctionQuery_2_3>(XmlNamedStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES);
- }
- return namedStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries()
- {
- if (namedPlsqlStoredFunctionQueries == null)
- {
- namedPlsqlStoredFunctionQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredFunctionQuery_2_3>(XmlNamedPlsqlStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- }
- return namedPlsqlStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries()
- {
- if (namedPlsqlStoredProcedureQueries == null)
- {
- namedPlsqlStoredProcedureQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredProcedureQuery_2_3>(XmlNamedPlsqlStoredProcedureQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- }
- return namedPlsqlStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlRecord_2_3> getPlsqlRecords()
- {
- if (plsqlRecords == null)
- {
- plsqlRecords = new EObjectContainmentEList<XmlPlsqlRecord_2_3>(XmlPlsqlRecord_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS);
- }
- return plsqlRecords;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlTable> getPlsqlTables()
- {
- if (plsqlTables == null)
- {
- plsqlTables = new EObjectContainmentEList<XmlPlsqlTable>(XmlPlsqlTable.class, this, EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES);
- }
- return plsqlTables;
- }
-
- /**
- * Returns the value of the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct</em>' containment reference.
- * @see #setStruct(XmlStruct_2_3)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_3_Struct()
- * @model containment="true"
- * @generated
- */
- public XmlStruct_2_3 getStruct()
- {
- return struct;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetStruct(XmlStruct_2_3 newStruct, NotificationChain msgs)
- {
- XmlStruct_2_3 oldStruct = struct;
- struct = newStruct;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__STRUCT, oldStruct, newStruct);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getStruct <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct</em>' containment reference.
- * @see #getStruct()
- * @generated
- */
- public void setStruct(XmlStruct_2_3 newStruct)
- {
- if (newStruct != struct)
- {
- NotificationChain msgs = null;
- if (struct != null)
- msgs = ((InternalEObject)struct).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__STRUCT, null, msgs);
- if (newStruct != null)
- msgs = ((InternalEObject)newStruct).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__STRUCT, null, msgs);
- msgs = basicSetStruct(newStruct, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__STRUCT, newStruct, newStruct));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- public XmlCacheIndex_2_4 getCacheIndex()
- {
- return cacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheIndex(XmlCacheIndex_2_4 newCacheIndex, NotificationChain msgs)
- {
- XmlCacheIndex_2_4 oldCacheIndex = cacheIndex;
- cacheIndex = newCacheIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX, oldCacheIndex, newCacheIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- public void setCacheIndex(XmlCacheIndex_2_4 newCacheIndex)
- {
- if (newCacheIndex != cacheIndex)
- {
- NotificationChain msgs = null;
- if (cacheIndex != null)
- msgs = ((InternalEObject)cacheIndex).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX, null, msgs);
- if (newCacheIndex != null)
- msgs = ((InternalEObject)newCacheIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX, null, msgs);
- msgs = basicSetCacheIndex(newCacheIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX, newCacheIndex, newCacheIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Additional Criteria</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Additional Criteria</em>' containment reference.
- * @see #setAdditionalCriteria(XmlAdditionalCriteria_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_2_2_AdditionalCriteria()
- * @model containment="true"
- * @generated
- */
- public XmlAdditionalCriteria_2_2 getAdditionalCriteria()
- {
- return additionalCriteria;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAdditionalCriteria(XmlAdditionalCriteria_2_2 newAdditionalCriteria, NotificationChain msgs)
- {
- XmlAdditionalCriteria_2_2 oldAdditionalCriteria = additionalCriteria;
- additionalCriteria = newAdditionalCriteria;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA, oldAdditionalCriteria, newAdditionalCriteria);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getAdditionalCriteria <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Additional Criteria</em>' containment reference.
- * @see #getAdditionalCriteria()
- * @generated
- */
- public void setAdditionalCriteria(XmlAdditionalCriteria_2_2 newAdditionalCriteria)
- {
- if (newAdditionalCriteria != additionalCriteria)
- {
- NotificationChain msgs = null;
- if (additionalCriteria != null)
- msgs = ((InternalEObject)additionalCriteria).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA, null, msgs);
- if (newAdditionalCriteria != null)
- msgs = ((InternalEObject)newAdditionalCriteria).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA, null, msgs);
- msgs = basicSetAdditionalCriteria(newAdditionalCriteria, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA, newAdditionalCriteria, newAdditionalCriteria));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Mappings</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #setExcludeDefaultMappings(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntity_ExcludeDefaultMappings()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getExcludeDefaultMappings()
- {
- return excludeDefaultMappings;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #getExcludeDefaultMappings()
- * @generated
- */
- public void setExcludeDefaultMappings(Boolean newExcludeDefaultMappings)
- {
- Boolean oldExcludeDefaultMappings = excludeDefaultMappings;
- excludeDefaultMappings = newExcludeDefaultMappings;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS, oldExcludeDefaultMappings, excludeDefaultMappings));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- return basicSetPrimaryKey(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- return basicSetCacheInterceptor(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- return basicSetQueryRedirectors(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- return ((InternalEList<?>)getFetchGroups()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- return basicSetClassExtractor(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- return basicSetAdditionalCriteria(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- return basicSetIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- return basicSetMultitenant(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- return ((InternalEList<?>)getPlsqlRecords()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- return ((InternalEList<?>)getPlsqlTables()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- return basicSetStruct(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- return basicSetCacheIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- return basicSetCustomizer(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- return basicSetChangeTracking(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- return basicSetCache(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- return basicSetOptimisticLocking(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- return basicSetCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- return basicSetInstantiationCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- return basicSetCloneCopyPolicy(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS:
- return getParentClass();
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- return getPrimaryKey();
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- return getCacheInterceptor();
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- return getQueryRedirectors();
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- return getFetchGroups();
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- return getClassExtractor();
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- return getAdditionalCriteria();
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- return getIndex();
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- return getMultitenant();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- return getNamedStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return getNamedPlsqlStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return getNamedPlsqlStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- return getPlsqlRecords();
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- return getPlsqlTables();
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- return getStruct();
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- return getCacheIndex();
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY:
- return getReadOnly();
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- return getCustomizer();
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- return getChangeTracking();
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- return getCache();
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING:
- return getExistenceChecking();
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- return getNamedStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- return getOptimisticLocking();
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- return getCopyPolicy();
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- return getInstantiationCopyPolicy();
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- return getCloneCopyPolicy();
- case EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS:
- return getExcludeDefaultMappings();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS:
- setParentClass((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- setPrimaryKey((XmlPrimaryKey)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- setCacheInterceptor((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- setQueryRedirectors((XmlQueryRedirectors)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- getFetchGroups().clear();
- getFetchGroups().addAll((Collection<? extends XmlFetchGroup>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- setClassExtractor((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- setAdditionalCriteria((XmlAdditionalCriteria_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- setIndex((XmlIndex_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- setMultitenant((XmlMultitenant)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- getNamedStoredFunctionQueries().addAll((Collection<? extends XmlNamedStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- getNamedPlsqlStoredFunctionQueries().addAll((Collection<? extends XmlNamedPlsqlStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- getNamedPlsqlStoredProcedureQueries().addAll((Collection<? extends XmlNamedPlsqlStoredProcedureQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- getPlsqlRecords().addAll((Collection<? extends XmlPlsqlRecord_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- getPlsqlTables().clear();
- getPlsqlTables().addAll((Collection<? extends XmlPlsqlTable>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- setStruct((XmlStruct_2_3)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY:
- setReadOnly((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- setCustomizer((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- setCache((XmlCache)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING:
- setExistenceChecking((ExistenceType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- getNamedStoredProcedureQueries().addAll((Collection<? extends XmlNamedStoredProcedureQuery>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- setOptimisticLocking((XmlOptimisticLocking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS:
- setParentClass(PARENT_CLASS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- setPrimaryKey((XmlPrimaryKey)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- setCacheInterceptor((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- setQueryRedirectors((XmlQueryRedirectors)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- getFetchGroups().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- setClassExtractor((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- setAdditionalCriteria((XmlAdditionalCriteria_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- setIndex((XmlIndex_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- setMultitenant((XmlMultitenant)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- getPlsqlTables().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- setStruct((XmlStruct_2_3)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY:
- setReadOnly(READ_ONLY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- setCustomizer((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- setCache((XmlCache)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING:
- setExistenceChecking(EXISTENCE_CHECKING_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- setOptimisticLocking((XmlOptimisticLocking)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings(EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS:
- return PARENT_CLASS_EDEFAULT == null ? parentClass != null : !PARENT_CLASS_EDEFAULT.equals(parentClass);
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY:
- return primaryKey != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR:
- return cacheInterceptor != null;
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS:
- return queryRedirectors != null;
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS:
- return fetchGroups != null && !fetchGroups.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR:
- return classExtractor != null;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA:
- return additionalCriteria != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX:
- return index != null;
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT:
- return multitenant != null;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES:
- return namedStoredFunctionQueries != null && !namedStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return namedPlsqlStoredFunctionQueries != null && !namedPlsqlStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return namedPlsqlStoredProcedureQueries != null && !namedPlsqlStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS:
- return plsqlRecords != null && !plsqlRecords.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES:
- return plsqlTables != null && !plsqlTables.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT:
- return struct != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX:
- return cacheIndex != null;
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY:
- return READ_ONLY_EDEFAULT == null ? readOnly != null : !READ_ONLY_EDEFAULT.equals(readOnly);
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER:
- return customizer != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING:
- return changeTracking != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE:
- return cache != null;
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING:
- return existenceChecking != EXISTENCE_CHECKING_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES:
- return namedStoredProcedureQueries != null && !namedStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY__OPTIMISTIC_LOCKING:
- return optimisticLocking != null;
- case EclipseLinkOrmPackage.XML_ENTITY__COPY_POLICY:
- return copyPolicy != null;
- case EclipseLinkOrmPackage.XML_ENTITY__INSTANTIATION_COPY_POLICY:
- return instantiationCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_ENTITY__CLONE_COPY_POLICY:
- return cloneCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_ENTITY__EXCLUDE_DEFAULT_MAPPINGS:
- return EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT == null ? excludeDefaultMappings != null : !EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT.equals(excludeDefaultMappings);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS: return EclipseLinkOrmV2_1Package.XML_TYPE_MAPPING_21__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_1_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY: return EclipseLinkOrmV1_1Package.XML_ENTITY_11__PRIMARY_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR: return EclipseLinkOrmV2_0Package.XML_ENTITY_20__CACHE_INTERCEPTOR;
- case EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS: return EclipseLinkOrmV2_0Package.XML_ENTITY_20__QUERY_REDIRECTORS;
- default: return -1;
- }
- }
- if (baseClass == XmlFetchGroupContainer_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS: return EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR: return EclipseLinkOrmV2_1Package.XML_ENTITY_21__CLASS_EXTRACTOR;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA: return EclipseLinkOrmV2_2Package.XML_ENTITY_22__ADDITIONAL_CRITERIA;
- case EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_ENTITY_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_ENTITY__INDEX: return EclipseLinkOrmV2_2Package.XML_ENTITY_22__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlMultitenantHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT: return EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__PLSQL_RECORDS;
- case EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__PLSQL_TABLES;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT: return EclipseLinkOrmV2_3Package.XML_ENTITY_23__STRUCT;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX: return EclipseLinkOrmV2_4Package.XML_ENTITY_24__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlReadOnly.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY: return EclipseLinkOrmPackage.XML_READ_ONLY__READ_ONLY;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER: return EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CACHE: return EclipseLinkOrmPackage.XML_CACHE_HOLDER__CACHE;
- case EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING: return EclipseLinkOrmPackage.XML_CACHE_HOLDER__EXISTENCE_CHECKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ENTITY__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_TYPE_MAPPING_21__PARENT_CLASS: return EclipseLinkOrmPackage.XML_ENTITY__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_1_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV1_1Package.XML_ENTITY_11__PRIMARY_KEY: return EclipseLinkOrmPackage.XML_ENTITY__PRIMARY_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_ENTITY_20__CACHE_INTERCEPTOR: return EclipseLinkOrmPackage.XML_ENTITY__CACHE_INTERCEPTOR;
- case EclipseLinkOrmV2_0Package.XML_ENTITY_20__QUERY_REDIRECTORS: return EclipseLinkOrmPackage.XML_ENTITY__QUERY_REDIRECTORS;
- default: return -1;
- }
- }
- if (baseClass == XmlFetchGroupContainer_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS: return EclipseLinkOrmPackage.XML_ENTITY__FETCH_GROUPS;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_ENTITY_21__CLASS_EXTRACTOR: return EclipseLinkOrmPackage.XML_ENTITY__CLASS_EXTRACTOR;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_ENTITY__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ENTITY_22__ADDITIONAL_CRITERIA: return EclipseLinkOrmPackage.XML_ENTITY__ADDITIONAL_CRITERIA;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_ENTITY__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_22__INDEX: return EclipseLinkOrmPackage.XML_ENTITY__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlMultitenantHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT: return EclipseLinkOrmPackage.XML_ENTITY__MULTITENANT;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__PLSQL_RECORDS: return EclipseLinkOrmPackage.XML_ENTITY__PLSQL_RECORDS;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__PLSQL_TABLES: return EclipseLinkOrmPackage.XML_ENTITY__PLSQL_TABLES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_23__STRUCT: return EclipseLinkOrmPackage.XML_ENTITY__STRUCT;
- default: return -1;
- }
- }
- if (baseClass == XmlEntity_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_ENTITY_24__CACHE_INDEX: return EclipseLinkOrmPackage.XML_ENTITY__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlReadOnly.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_READ_ONLY__READ_ONLY: return EclipseLinkOrmPackage.XML_ENTITY__READ_ONLY;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER: return EclipseLinkOrmPackage.XML_ENTITY__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_ENTITY__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_HOLDER__CACHE: return EclipseLinkOrmPackage.XML_ENTITY__CACHE;
- case EclipseLinkOrmPackage.XML_CACHE_HOLDER__EXISTENCE_CHECKING: return EclipseLinkOrmPackage.XML_ENTITY__EXISTENCE_CHECKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ENTITY__PROPERTIES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (parentClass: ");
- result.append(parentClass);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", readOnly: ");
- result.append(readOnly);
- result.append(", existenceChecking: ");
- result.append(existenceChecking);
- result.append(", excludeDefaultMappings: ");
- result.append(excludeDefaultMappings);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReadOnlyTextRange() {
- return getAttributeTextRange(EclipseLink.READ_ONLY);
- }
-
- public TextRange getParentClassTextRange() {
- return getAttributeTextRange(EclipseLink2_1.PARENT_CLASS);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEntity(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildClassTranslator(),
- buildParentClassTranslator(),
- buildAccessTranslator(),
- buildCacheableTranslator(),
- buildMetadataCompleteTranslator(),
- buildReadOnlyTranslator(),
- buildExistenceCheckingTranslator(),
- buildExcludeDefaultMappingsTranslator(),
- buildDescriptionTranslator(),
- buildAccessMethodsTranslator(),
- XmlMultitenant.buildTranslator(EclipseLink2_3.MULTITENANT, EclipseLinkOrmPackage.eINSTANCE.getXmlMultitenantHolder_Multitenant()),
- buildAdditionalCriteriaTranslator(),
- buildCustomizerTranslator(),
- buildChangeTrackingTranslator(),
- buildTableTranslator(),
- buildSecondaryTableTranslator(),
- XmlStruct.buildTranslator(EclipseLink2_3.STRUCT, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_Struct()),
- buildPrimaryKeyJoinColumnTranslator(),
- buildCascadeOnDeleteTranslator(),
- buildIndexTranslator(),
- buildIdClassTranslator(),
- buildPrimaryKeyTranslator(),
- buildInheritanceTranslator(),
- buildDiscriminatorValueTranslator(),
- buildDiscriminatorColumnTranslator(),
- buildClassExtractorTranslator(),
- buildOptimisticLockingTranslator(),
- buildCacheTranslator(),
- buildCacheInterceptorTranslator(),
- buildCacheIndexTranslator(),
- buildFetchGroupsTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildCopyPolicyTranslator(),
- buildInstantiationCoypPolicyTranslator(),
- buildCloneCopyPolicyTranslator(),
- buildSequenceGeneratorTranslator(),
- buildTableGeneratorTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- buildNamedQueryTranslator(),
- buildNamedNativeQueryTranslator(),
- buildNamedStoredProcedureQueryTranslator(),
- XmlNamedStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_NamedStoredFunctionQueries()),
- XmlNamedPlsqlStoredProcedureQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_PROCEDURE_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries()),
- XmlNamedPlsqlStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries()),
- XmlPlsqlRecord.buildTranslator(EclipseLink2_3.PLSQL_RECORD, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_PlsqlRecords()),
- XmlPlsqlTable.buildTranslator(EclipseLink2_3.PLSQL_TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntity_2_3_PlsqlTables()),
- buildSqlResultSetMappingTranslator(),
- buildQueryRedirectorsTranslator(),
- buildExcludeDefaultListenersTranslator(),
- buildExcludeSuperclassListenersTranslator(),
- buildEntityListenersTranslator(),
- buildPrePersistTranslator(),
- buildPostPersistTranslator(),
- buildPreRemoveTranslator(),
- buildPostRemoveTranslator(),
- buildPreUpdateTranslator(),
- buildPostUpdateTranslator(),
- buildPostLoadTranslator(),
- buildPropertyTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- Attributes.buildTranslator()};
- }
-
- protected static Translator buildCustomizerTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink.CUSTOMIZER, EclipseLinkOrmPackage.eINSTANCE.getXmlCustomizerHolder_Customizer());
- }
-
- protected static Translator buildChangeTrackingTranslator() {
- return XmlChangeTracking.buildTranslator(EclipseLink.CHANGE_TRACKING, EclipseLinkOrmPackage.eINSTANCE.getXmlChangeTrackingHolder_ChangeTracking());
- }
-
- protected static Translator buildPrimaryKeyTranslator() {
- return XmlPrimaryKey.buildTranslator(EclipseLink1_1.PRIMARY_KEY, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlEntity_1_1_PrimaryKey());
- }
-
- protected static Translator buildClassExtractorTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink2_1.CLASS_EXTRACTOR, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlEntity_2_1_ClassExtractor());
- }
-
- protected static Translator buildOptimisticLockingTranslator() {
- return XmlOptimisticLocking.buildTranslator(EclipseLink.OPTIMISTIC_LOCKING, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_OptimisticLocking());
- }
-
- protected static Translator buildCacheTranslator() {
- return XmlCache.buildTranslator(EclipseLink.CACHE, EclipseLinkOrmPackage.eINSTANCE.getXmlCacheHolder_Cache());
- }
-
- protected static Translator buildCacheInterceptorTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink2_0.CACHE_INTERCEPTOR, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlEntity_2_0_CacheInterceptor());
- }
-
- protected static Translator buildCacheIndexTranslator() {
- return XmlCacheIndex.buildTranslator(EclipseLink2_4.CACHE_INDEX, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlEntity_2_4_CacheIndex());
- }
-
- protected static Translator buildFetchGroupsTranslator() {
- return XmlFetchGroup.buildTranslator(EclipseLink2_1.FETCH_GROUP, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroupContainer_2_1_FetchGroups());
- }
-
- protected static Translator buildQueryRedirectorsTranslator() {
- return XmlQueryRedirectors.buildTranslator(EclipseLink2_0.QUERY_REDIRECTORS, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlEntity_2_0_QueryRedirectors());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters());
- }
-
- protected static Translator buildCopyPolicyTranslator() {
- return XmlCopyPolicy.buildTranslator(EclipseLink.COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_CopyPolicy());
- }
-
- protected static Translator buildInstantiationCoypPolicyTranslator() {
- return XmlInstantiationCopyPolicy.buildTranslator(EclipseLink.INSTANTIATION_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_InstantiationCopyPolicy());
- }
-
- protected static Translator buildCloneCopyPolicyTranslator() {
- return XmlCloneCopyPolicy.buildTranslator(EclipseLink.CLONE_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_CloneCopyPolicy());
- }
-
- protected static Translator buildReadOnlyTranslator() {
- return new Translator(EclipseLink.READ_ONLY, EclipseLinkOrmPackage.eINSTANCE.getXmlReadOnly_ReadOnly(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildExistenceCheckingTranslator() {
- return new Translator(EclipseLink.EXISTENCE_CHECKING, EclipseLinkOrmPackage.eINSTANCE.getXmlCacheHolder_ExistenceChecking(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildExcludeDefaultMappingsTranslator() {
- return new Translator(EclipseLink.EXCLUDE_DEFAULT_MAPPINGS, EclipseLinkOrmPackage.eINSTANCE.getXmlEntity_ExcludeDefaultMappings(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildNamedStoredProcedureQueryTranslator() {
- return XmlNamedStoredProcedureQuery.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY, EclipseLinkOrmPackage.eINSTANCE.getXmlQueryContainer_NamedStoredProcedureQueries());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildParentClassTranslator() {
- return new Translator(EclipseLink2_1.PARENT_CLASS, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlTypeMapping_2_1_ParentClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAdditionalCriteriaTranslator() {
- return XmlAdditionalCriteria.buildTranslator(EclipseLink2_2.ADDITIONAL_CRITERIA, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntity_2_2_AdditionalCriteria());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntity_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildIndexTranslator() {
- return XmlIndex.buildTranslator(EclipseLink2_2.INDEX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntity_2_2_Index());
- }
-
- protected static Translator buildTableTranslator() {
- return XmlTable.buildTranslator(JPA.TABLE, OrmPackage.eINSTANCE.getXmlEntity_Table());
- }
-
- protected static Translator buildSecondaryTableTranslator() {
- return XmlSecondaryTable.buildTranslator(JPA.SECONDARY_TABLE, OrmPackage.eINSTANCE.getXmlEntity_SecondaryTables());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return XmlTableGenerator.buildTranslator(JPA.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_TableGenerator());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java
deleted file mode 100644
index b02d0a65ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlEntityMappings.java
+++ /dev/null
@@ -1,1368 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleRootTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Entity Mappings</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings()
- * @model kind="class"
- * @generated
- */
-public class XmlEntityMappings extends org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings implements XmlEntityMappings_2_1, XmlEntityMappings_2_2, XmlEntityMappings_2_3, XmlConverterContainer, XmlQueryContainer
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlPartitioning_2_2> partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlReplicationPartitioning_2_2> replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlRoundRobinPartitioning_2_2> roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlPinnedPartitioning_2_2> pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlRangePartitioning_2_2> rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlValuePartitioning_2_2> valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlHashPartitioning_2_2> hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected EList<XmlUnionPartitioning_2_2> unionPartitioning;
-
- /**
- * The cached value of the '{@link #getTenantDiscriminatorColumns() <em>Tenant Discriminator Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTenantDiscriminatorColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlTenantDiscriminatorColumn_2_3> tenantDiscriminatorColumns;
-
- /**
- * The cached value of the '{@link #getNamedStoredFunctionQueries() <em>Named Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredFunctionQuery_2_3> namedStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredFunctionQueries() <em>Named Plsql Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredFunctionQuery_2_3> namedPlsqlStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredProcedureQueries() <em>Named Plsql Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredProcedureQuery_2_3> namedPlsqlStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getPlsqlRecords() <em>Plsql Records</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlRecords()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlRecord_2_3> plsqlRecords;
-
- /**
- * The cached value of the '{@link #getPlsqlTables() <em>Plsql Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlTables()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlTable> plsqlTables;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The cached value of the '{@link #getNamedStoredProcedureQueries() <em>Named Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredProcedureQuery> namedStoredProcedureQueries;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlEntityMappings()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ENTITY_MAPPINGS;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPartitioning_2_2> getPartitioning()
- {
- if (partitioning == null)
- {
- partitioning = new EObjectContainmentEList<XmlPartitioning_2_2>(XmlPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING);
- }
- return partitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlReplicationPartitioning_2_2> getReplicationPartitioning()
- {
- if (replicationPartitioning == null)
- {
- replicationPartitioning = new EObjectContainmentEList<XmlReplicationPartitioning_2_2>(XmlReplicationPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING);
- }
- return replicationPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlRoundRobinPartitioning_2_2> getRoundRobinPartitioning()
- {
- if (roundRobinPartitioning == null)
- {
- roundRobinPartitioning = new EObjectContainmentEList<XmlRoundRobinPartitioning_2_2>(XmlRoundRobinPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING);
- }
- return roundRobinPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPinnedPartitioning_2_2> getPinnedPartitioning()
- {
- if (pinnedPartitioning == null)
- {
- pinnedPartitioning = new EObjectContainmentEList<XmlPinnedPartitioning_2_2>(XmlPinnedPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING);
- }
- return pinnedPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlRangePartitioning_2_2> getRangePartitioning()
- {
- if (rangePartitioning == null)
- {
- rangePartitioning = new EObjectContainmentEList<XmlRangePartitioning_2_2>(XmlRangePartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING);
- }
- return rangePartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlValuePartitioning_2_2> getValuePartitioning()
- {
- if (valuePartitioning == null)
- {
- valuePartitioning = new EObjectContainmentEList<XmlValuePartitioning_2_2>(XmlValuePartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING);
- }
- return valuePartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlHashPartitioning_2_2> getHashPartitioning()
- {
- if (hashPartitioning == null)
- {
- hashPartitioning = new EObjectContainmentEList<XmlHashPartitioning_2_2>(XmlHashPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING);
- }
- return hashPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public EList<XmlUnionPartitioning_2_2> getUnionPartitioning()
- {
- if (unionPartitioning == null)
- {
- unionPartitioning = new EObjectContainmentEList<XmlUnionPartitioning_2_2>(XmlUnionPartitioning_2_2.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING);
- }
- return unionPartitioning;
- }
-
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns()
- {
- if (tenantDiscriminatorColumns == null)
- {
- tenantDiscriminatorColumns = new EObjectContainmentEList<XmlTenantDiscriminatorColumn_2_3>(XmlTenantDiscriminatorColumn_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS);
- }
- return tenantDiscriminatorColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries()
- {
- if (namedStoredFunctionQueries == null)
- {
- namedStoredFunctionQueries = new EObjectContainmentEList<XmlNamedStoredFunctionQuery_2_3>(XmlNamedStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES);
- }
- return namedStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries()
- {
- if (namedPlsqlStoredFunctionQueries == null)
- {
- namedPlsqlStoredFunctionQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredFunctionQuery_2_3>(XmlNamedPlsqlStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- }
- return namedPlsqlStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries()
- {
- if (namedPlsqlStoredProcedureQueries == null)
- {
- namedPlsqlStoredProcedureQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredProcedureQuery_2_3>(XmlNamedPlsqlStoredProcedureQuery_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- }
- return namedPlsqlStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlRecord_2_3> getPlsqlRecords()
- {
- if (plsqlRecords == null)
- {
- plsqlRecords = new EObjectContainmentEList<XmlPlsqlRecord_2_3>(XmlPlsqlRecord_2_3.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS);
- }
- return plsqlRecords;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlEntityMappings_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlTable> getPlsqlTables()
- {
- if (plsqlTables == null)
- {
- plsqlTables = new EObjectContainmentEList<XmlPlsqlTable>(XmlPlsqlTable.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES);
- }
- return plsqlTables;
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredProcedureQuery> getNamedStoredProcedureQueries()
- {
- if (namedStoredProcedureQueries == null)
- {
- namedStoredProcedureQueries = new EObjectContainmentEList<XmlNamedStoredProcedureQuery>(XmlNamedStoredProcedureQuery.class, this, EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES);
- }
- return namedStoredProcedureQueries;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- return ((InternalEList<?>)getPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- return ((InternalEList<?>)getReplicationPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- return ((InternalEList<?>)getRoundRobinPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- return ((InternalEList<?>)getPinnedPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- return ((InternalEList<?>)getRangePartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- return ((InternalEList<?>)getValuePartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- return ((InternalEList<?>)getHashPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- return ((InternalEList<?>)getUnionPartitioning()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- return ((InternalEList<?>)getTenantDiscriminatorColumns()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- return ((InternalEList<?>)getPlsqlRecords()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- return ((InternalEList<?>)getPlsqlTables()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- return getTenantDiscriminatorColumns();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- return getNamedStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return getNamedPlsqlStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return getNamedPlsqlStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- return getPlsqlRecords();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- return getPlsqlTables();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- return getNamedStoredProcedureQueries();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- getPartitioning().clear();
- getPartitioning().addAll((Collection<? extends XmlPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- getReplicationPartitioning().clear();
- getReplicationPartitioning().addAll((Collection<? extends XmlReplicationPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- getRoundRobinPartitioning().clear();
- getRoundRobinPartitioning().addAll((Collection<? extends XmlRoundRobinPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- getPinnedPartitioning().clear();
- getPinnedPartitioning().addAll((Collection<? extends XmlPinnedPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- getRangePartitioning().clear();
- getRangePartitioning().addAll((Collection<? extends XmlRangePartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- getValuePartitioning().clear();
- getValuePartitioning().addAll((Collection<? extends XmlValuePartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- getHashPartitioning().clear();
- getHashPartitioning().addAll((Collection<? extends XmlHashPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- getUnionPartitioning().clear();
- getUnionPartitioning().addAll((Collection<? extends XmlUnionPartitioning_2_2>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- getTenantDiscriminatorColumns().addAll((Collection<? extends XmlTenantDiscriminatorColumn_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- getNamedStoredFunctionQueries().addAll((Collection<? extends XmlNamedStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- getNamedPlsqlStoredFunctionQueries().addAll((Collection<? extends XmlNamedPlsqlStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- getNamedPlsqlStoredProcedureQueries().addAll((Collection<? extends XmlNamedPlsqlStoredProcedureQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- getPlsqlRecords().addAll((Collection<? extends XmlPlsqlRecord_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- getPlsqlTables().clear();
- getPlsqlTables().addAll((Collection<? extends XmlPlsqlTable>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- getNamedStoredProcedureQueries().addAll((Collection<? extends XmlNamedStoredProcedureQuery>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- getPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- getReplicationPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- getRoundRobinPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- getPinnedPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- getRangePartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- getValuePartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- getHashPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- getUnionPartitioning().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- getPlsqlTables().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING:
- return partitioning != null && !partitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING:
- return replicationPartitioning != null && !replicationPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null && !roundRobinPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING:
- return pinnedPartitioning != null && !pinnedPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING:
- return rangePartitioning != null && !rangePartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING:
- return valuePartitioning != null && !valuePartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING:
- return hashPartitioning != null && !hashPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING:
- return unionPartitioning != null && !unionPartitioning.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS:
- return tenantDiscriminatorColumns != null && !tenantDiscriminatorColumns.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES:
- return namedStoredFunctionQueries != null && !namedStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return namedPlsqlStoredFunctionQueries != null && !namedPlsqlStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return namedPlsqlStoredProcedureQueries != null && !namedPlsqlStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS:
- return plsqlRecords != null && !plsqlRecords.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES:
- return plsqlTables != null && !plsqlTables.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES:
- return namedStoredProcedureQueries != null && !namedStoredProcedureQueries.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING;
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES: return EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__PLSQL_TABLES;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__UNION_PARTITIONING;
- default: return -1;
- }
- }
- if (baseClass == XmlEntityMappings_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TENANT_DISCRIMINATOR_COLUMNS;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_RECORDS;
- case EclipseLinkOrmV2_3Package.XML_ENTITY_MAPPINGS_23__PLSQL_TABLES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__PLSQL_TABLES;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_ENTITY_MAPPINGS__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-
- // **************** version -> schema location mapping ********************
-
- private static String namespace = EclipseLink.SCHEMA_NAMESPACE;
-
- @Override
- protected String getNamespace() {
- return namespace;
- }
-
- private static Map<String, String> versionsToSchemaLocations = buildVersionsToSchemaLocations();
-
- private static Map<String, String> buildVersionsToSchemaLocations() {
- Map<String, String> map = new HashMap<String, String>();
- map.put(EclipseLink.SCHEMA_VERSION, EclipseLink.SCHEMA_LOCATION);
- map.put(EclipseLink1_1.SCHEMA_VERSION, EclipseLink1_1.SCHEMA_LOCATION);
- map.put(EclipseLink1_2.SCHEMA_VERSION, EclipseLink1_2.SCHEMA_LOCATION);
- map.put(EclipseLink2_0.SCHEMA_VERSION, EclipseLink2_0.SCHEMA_LOCATION);
- map.put(EclipseLink2_1.SCHEMA_VERSION, EclipseLink2_1.SCHEMA_LOCATION);
- map.put(EclipseLink2_2.SCHEMA_VERSION, EclipseLink2_2.SCHEMA_LOCATION);
- map.put(EclipseLink2_3.SCHEMA_VERSION, EclipseLink2_3.SCHEMA_LOCATION);
- map.put(EclipseLink2_4.SCHEMA_VERSION, EclipseLink2_4.SCHEMA_LOCATION);
- return map;
- }
-
- @Override
- protected String getSchemaLocationForVersion(String version) {
- return versionsToSchemaLocations.get(version);
- }
-
-
- // **************** translators *******************************************
-
- private static final Translator ROOT_TRANSLATOR = buildRootTranslator();
-
- public static Translator getRootTranslator() {
- return ROOT_TRANSLATOR;
- }
-
- private static Translator buildRootTranslator() {
- return new SimpleRootTranslator(
- JPA.ENTITY_MAPPINGS,
- EclipseLinkOrmPackage.eINSTANCE.getXmlEntityMappings(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildVersionTranslator(versionsToSchemaLocations),
- buildNamespaceTranslator(namespace),
- buildSchemaNamespaceTranslator(),
- buildSchemaLocationTranslator(namespace, versionsToSchemaLocations),
- buildDescriptionTranslator(),
- XmlPersistenceUnitMetadata.buildTranslator(JPA.PERSISTENCE_UNIT_METADATA, OrmPackage.eINSTANCE.getXmlEntityMappings_PersistenceUnitMetadata()),
- buildPackageTranslator(),
- buildSchemaTranslator(),
- buildCatalogTranslator(),
- buildAccessTranslator(),
- buildAccessMethodsTranslator(),
- XmlTenantDiscriminatorColumn.buildTranslator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_TenantDiscriminatorColumns()),
- XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters()),
- XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters()),
- XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters()),
- XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters()),
- XmlSequenceGenerator.buildTranslator(JPA.SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getXmlEntityMappings_SequenceGenerators()),
- XmlTableGenerator.buildTranslator(JPA.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlEntityMappings_TableGenerators()),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlEntityMappings_2_2_UnionPartitioning()),
- XmlNamedQuery.buildTranslator(JPA.NAMED_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedQueries()),
- XmlNamedNativeQuery.buildTranslator(JPA.NAMED_NATIVE_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedNativeQueries()),
- XmlNamedStoredProcedureQuery.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY, EclipseLinkOrmPackage.eINSTANCE.getXmlQueryContainer_NamedStoredProcedureQueries()),
- XmlNamedStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_NamedStoredFunctionQueries()),
- XmlNamedPlsqlStoredProcedureQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_PROCEDURE_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries()),
- XmlNamedPlsqlStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries()),
- XmlPlsqlRecord.buildTranslator(EclipseLink2_3.PLSQL_RECORD, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_PlsqlRecords()),
- XmlPlsqlTable.buildTranslator(EclipseLink2_3.PLSQL_TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlEntityMappings_2_3_PlsqlTables()),
- SqlResultSetMapping.buildTranslator(JPA.SQL_RESULT_SET_MAPPING, OrmPackage.eINSTANCE.getXmlEntityMappings_SqlResultSetMappings()),
- XmlMappedSuperclass.buildTranslator(JPA.MAPPED_SUPERCLASS, OrmPackage.eINSTANCE.getXmlEntityMappings_MappedSuperclasses()),
- XmlEntity.buildTranslator(JPA.ENTITY, OrmPackage.eINSTANCE.getXmlEntityMappings_Entities()),
- XmlEmbeddable.buildTranslator(JPA.EMBEDDABLE, OrmPackage.eINSTANCE.getXmlEntityMappings_Embeddables()),
- };
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchAttribute.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchAttribute.java
deleted file mode 100644
index 0a3bde590a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchAttribute.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Attribute</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute()
- * @model kind="class"
- * @generated
- */
-public class XmlFetchAttribute extends AbstractJpaEObject implements XmlFetchAttribute_2_1
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlFetchAttribute()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_FETCH_ATTRIBUTE;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchAttribute_2_1_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_ATTRIBUTE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()};
- }
-
- private static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_1.NAME, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchAttribute_2_1_Name(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchGroup.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchGroup.java
deleted file mode 100644
index 292ffda1c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlFetchGroup.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Group</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup()
- * @model kind="class"
- * @generated
- */
-public class XmlFetchGroup extends AbstractJpaEObject implements XmlFetchGroup_2_1
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getLoad() <em>Load</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLoad()
- * @generated
- * @ordered
- */
- protected static final Boolean LOAD_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLoad() <em>Load</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getLoad()
- * @generated
- * @ordered
- */
- protected Boolean load = LOAD_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAttributes() <em>Attributes</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributes()
- * @generated
- * @ordered
- */
- protected EList<XmlFetchAttribute> attributes;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlFetchGroup()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_FETCH_GROUP;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup_2_1_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Attributes</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attributes</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attributes</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup_2_1_Attributes()
- * @model containment="true"
- * @generated
- */
- public EList<XmlFetchAttribute> getAttributes()
- {
- if (attributes == null)
- {
- attributes = new EObjectContainmentEList<XmlFetchAttribute>(XmlFetchAttribute.class, this, EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES);
- }
- return attributes;
- }
-
- /**
- * Returns the value of the '<em><b>Load</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Load</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Load</em>' attribute.
- * @see #setLoad(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroup_2_1_Load()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getLoad()
- {
- return load;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup#getLoad <em>Load</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Load</em>' attribute.
- * @see #getLoad()
- * @generated
- */
- public void setLoad(Boolean newLoad)
- {
- Boolean oldLoad = load;
- load = newLoad;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD, oldLoad, load));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- return ((InternalEList<?>)getAttributes()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD:
- return getLoad();
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- return getAttributes();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD:
- setLoad((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- getAttributes().clear();
- getAttributes().addAll((Collection<? extends XmlFetchAttribute>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD:
- setLoad(LOAD_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- getAttributes().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__LOAD:
- return LOAD_EDEFAULT == null ? load != null : !LOAD_EDEFAULT.equals(load);
- case EclipseLinkOrmPackage.XML_FETCH_GROUP__ATTRIBUTES:
- return attributes != null && !attributes.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", load: ");
- result.append(load);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildLoadTranslator(),
- buildAttributesTranslator()};
- }
-
- private static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroup_2_1_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- private static Translator buildAttributesTranslator() {
- return XmlFetchAttribute.buildTranslator(EclipseLink2_1.ATTRIBUTE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroup_2_1_Attributes());
- }
-
- protected static Translator buildLoadTranslator() {
- return new Translator(EclipseLink2_1.FETCH_GROUP__LOAD, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroup_2_1_Load(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlHashPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlHashPartitioning.java
deleted file mode 100644
index 0a4f63c6ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlHashPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Hash Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlHashPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlHashPartitioning extends AbstractJpaEObject implements XmlHashPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlHashPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_HASH_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlHashPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlHashPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_HASH_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlHashPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlHashPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlHashPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java
deleted file mode 100644
index 106b98b2d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlId.java
+++ /dev/null
@@ -1,1110 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Id</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId()
- * @model kind="class"
- * @generated
- */
-public class XmlId extends org.eclipse.jpt.jpa.core.resource.orm.XmlId implements XmlId_2_2, XmlId_2_4, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping, XmlConverterContainer
-{
- /**
- * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIndex()
- * @generated
- * @ordered
- */
- protected XmlIndex_2_2 index;
-
- /**
- * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheIndex()
- * @generated
- * @ordered
- */
- protected XmlCacheIndex_2_4 cacheIndex;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The 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 default value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected static final String CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected String convert = CONVERT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlId()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ID;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId_2_2_Index()
- * @model containment="true"
- * @generated
- */
- public XmlIndex_2_2 getIndex()
- {
- return index;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIndex(XmlIndex_2_2 newIndex, NotificationChain msgs)
- {
- XmlIndex_2_2 oldIndex = index;
- index = newIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__INDEX, oldIndex, newIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- public void setIndex(XmlIndex_2_2 newIndex)
- {
- if (newIndex != index)
- {
- NotificationChain msgs = null;
- if (index != null)
- msgs = ((InternalEObject)index).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__INDEX, null, msgs);
- if (newIndex != null)
- msgs = ((InternalEObject)newIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__INDEX, null, msgs);
- msgs = basicSetIndex(newIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__INDEX, newIndex, newIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlId_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- public XmlCacheIndex_2_4 getCacheIndex()
- {
- return cacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheIndex(XmlCacheIndex_2_4 newCacheIndex, NotificationChain msgs)
- {
- XmlCacheIndex_2_4 oldCacheIndex = cacheIndex;
- cacheIndex = newCacheIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__CACHE_INDEX, oldCacheIndex, newCacheIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- public void setCacheIndex(XmlCacheIndex_2_4 newCacheIndex)
- {
- if (newCacheIndex != cacheIndex)
- {
- NotificationChain msgs = null;
- if (cacheIndex != null)
- msgs = ((InternalEObject)cacheIndex).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__CACHE_INDEX, null, msgs);
- if (newCacheIndex != null)
- msgs = ((InternalEObject)newCacheIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__CACHE_INDEX, null, msgs);
- msgs = basicSetCacheIndex(newCacheIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__CACHE_INDEX, newCacheIndex, newCacheIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mutable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mutable</em>' attribute.
- * @see #setMutable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable_Mutable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getMutable()
- {
- return mutable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getMutable <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mutable</em>' attribute.
- * @see #getMutable()
- * @generated
- */
- public void setMutable(Boolean newMutable)
- {
- Boolean oldMutable = mutable;
- mutable = newMutable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__MUTABLE, oldMutable, mutable));
- }
-
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- public void setConvert(String newConvert)
- {
- String oldConvert = convert;
- convert = newConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__CONVERT, oldConvert, convert));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_ID__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ID__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ID__INDEX:
- return basicSetIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- return basicSetCacheIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ID__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ID__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_ID__INDEX:
- return getIndex();
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- return getCacheIndex();
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_ID__MUTABLE:
- return getMutable();
- case EclipseLinkOrmPackage.XML_ID__CONVERT:
- return getConvert();
- case EclipseLinkOrmPackage.XML_ID__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_ID__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_ID__INDEX:
- setIndex((XmlIndex_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__MUTABLE:
- setMutable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__CONVERT:
- setConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ID__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_ID__INDEX:
- setIndex((XmlIndex_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ID__MUTABLE:
- setMutable(MUTABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ID__CONVERT:
- setConvert(CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ID__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ID__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_ID__INDEX:
- return index != null;
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX:
- return cacheIndex != null;
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_ID__MUTABLE:
- return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable);
- case EclipseLinkOrmPackage.XML_ID__CONVERT:
- return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert);
- case EclipseLinkOrmPackage.XML_ID__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ID__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 == XmlId_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__INDEX: return EclipseLinkOrmV2_2Package.XML_ID_22__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlId_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__CACHE_INDEX: return EclipseLinkOrmV2_4Package.XML_ID_24__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__MUTABLE: return EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ID__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ID__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__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 == XmlId_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ID_22__INDEX: return EclipseLinkOrmPackage.XML_ID__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlId_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_ID_24__CACHE_INDEX: return EclipseLinkOrmPackage.XML_ID__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ID__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ID__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ID__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE: return EclipseLinkOrmPackage.XML_ID__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_ID__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_ID__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ID__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ID__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_ID__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(" (attributeType: ");
- result.append(attributeType);
- result.append(", mutable: ");
- result.append(mutable);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMutableTextRange() {
- return getAttributeTextRange(EclipseLink.MUTABLE);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLink.CONVERT);
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlId(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- buildMutableTranslator(),
- buildAttributeTypeTranslator(),
- buildColumnTranslator(),
- buildIndexTranslator(),
- buildCacheIndexTranslator(),
- buildGeneratedValueTranslator(),
- buildTemporalTranslator(),
- buildEnumeratedTranslator(),
- buildConvertTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildTableGeneratorTranslator(),
- buildSequenceGeneratorTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildMutableTranslator() {
- return new Translator(EclipseLink.MUTABLE, EclipseLinkOrmPackage.eINSTANCE.getXmlMutable_Mutable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIndexTranslator() {
- return XmlIndex.buildTranslator(EclipseLink2_2.INDEX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlId_2_2_Index());
- }
-
- protected static Translator buildCacheIndexTranslator() {
- return XmlCacheIndex.buildTranslator(EclipseLink2_4.CACHE_INDEX, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlId_2_4_CacheIndex());
- }
-
- protected static Translator buildConvertTranslator() {
- return new Translator(EclipseLink.CONVERT, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertibleMapping_Convert());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildEnumeratedTranslator() {
- return new Translator(JPA.ENUMERATED, OrmPackage.eINSTANCE.getXmlConvertibleMapping_Enumerated());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return XmlTableGenerator.buildTranslator(JPA.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_TableGenerator());
- }
-
- // *********** content assist ************
-
- protected TextRange getConvertCodeAssistTextRange() {
- return getElementCodeAssistTextRange(EclipseLink.CONVERT);
- }
-
- public boolean convertTouches(int pos) {
- TextRange textRange = this.getConvertCodeAssistTextRange();
- return (textRange != null) && (textRange.touches(pos));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlIndex.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlIndex.java
deleted file mode 100644
index 35a950e5b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlIndex.java
+++ /dev/null
@@ -1,563 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EDataTypeEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Index</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex()
- * @model kind="class"
- * @generated
- */
-public class XmlIndex extends AbstractJpaEObject implements XmlIndex_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected static final String SCHEMA_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSchema() <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSchema()
- * @generated
- * @ordered
- */
- protected String schema = SCHEMA_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected static final String CATALOG_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCatalog() <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCatalog()
- * @generated
- * @ordered
- */
- protected String catalog = CATALOG_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected static final String TABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected String table = TABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getUnique() <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnique()
- * @generated
- * @ordered
- */
- protected static final Boolean UNIQUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUnique() <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnique()
- * @generated
- * @ordered
- */
- protected Boolean unique = UNIQUE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getColumnNames() <em>Column Names</em>}' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumnNames()
- * @generated
- * @ordered
- */
- protected EList<String> columnNames;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlIndex()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_INDEX;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getSchema()
- {
- return schema;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- public void setSchema(String newSchema)
- {
- String oldSchema = schema;
- schema = newSchema;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__SCHEMA, oldSchema, schema));
- }
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCatalog()
- {
- return catalog;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- public void setCatalog(String newCatalog)
- {
- String oldCatalog = catalog;
- catalog = newCatalog;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__CATALOG, oldCatalog, catalog));
- }
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTable()
- {
- return table;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- public void setTable(String newTable)
- {
- String oldTable = table;
- table = newTable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__TABLE, oldTable, table));
- }
-
- /**
- * Returns the value of the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique</em>' attribute.
- * @see #setUnique(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_Unique()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getUnique()
- {
- return unique;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlIndex#getUnique <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Unique</em>' attribute.
- * @see #getUnique()
- * @generated
- */
- public void setUnique(Boolean newUnique)
- {
- Boolean oldUnique = unique;
- unique = newUnique;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_INDEX__UNIQUE, oldUnique, unique));
- }
-
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlIndex_2_2_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public EList<String> getColumnNames()
- {
- if (columnNames == null)
- {
- columnNames = new EDataTypeEList<String>(String.class, this, EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES);
- }
- return columnNames;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_INDEX__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_INDEX__SCHEMA:
- return getSchema();
- case EclipseLinkOrmPackage.XML_INDEX__CATALOG:
- return getCatalog();
- case EclipseLinkOrmPackage.XML_INDEX__TABLE:
- return getTable();
- case EclipseLinkOrmPackage.XML_INDEX__UNIQUE:
- return getUnique();
- case EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES:
- return getColumnNames();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_INDEX__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__SCHEMA:
- setSchema((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__CATALOG:
- setCatalog((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__TABLE:
- setTable((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__UNIQUE:
- setUnique((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES:
- getColumnNames().clear();
- getColumnNames().addAll((Collection<? extends String>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_INDEX__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__SCHEMA:
- setSchema(SCHEMA_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__CATALOG:
- setCatalog(CATALOG_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__UNIQUE:
- setUnique(UNIQUE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES:
- getColumnNames().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_INDEX__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_INDEX__SCHEMA:
- return SCHEMA_EDEFAULT == null ? schema != null : !SCHEMA_EDEFAULT.equals(schema);
- case EclipseLinkOrmPackage.XML_INDEX__CATALOG:
- return CATALOG_EDEFAULT == null ? catalog != null : !CATALOG_EDEFAULT.equals(catalog);
- case EclipseLinkOrmPackage.XML_INDEX__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case EclipseLinkOrmPackage.XML_INDEX__UNIQUE:
- return UNIQUE_EDEFAULT == null ? unique != null : !UNIQUE_EDEFAULT.equals(unique);
- case EclipseLinkOrmPackage.XML_INDEX__COLUMN_NAMES:
- return columnNames != null && !columnNames.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", schema: ");
- result.append(schema);
- result.append(", catalog: ");
- result.append(catalog);
- result.append(", table: ");
- result.append(table);
- result.append(", unique: ");
- result.append(unique);
- result.append(", columnNames: ");
- result.append(columnNames);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlIndex(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildColumnNameTranslator(),
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildTableTranslator(),
- buildUniqueTranslator()
- };
- }
-
- protected static Translator buildColumnNameTranslator() {
- return new Translator(EclipseLink2_2.INDEX__COLUMN_NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_ColumnNames());
- }
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_2.INDEX__NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCatalogTranslator() {
- return new Translator(EclipseLink2_2.INDEX__CATALOG, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Catalog(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSchemaTranslator() {
- return new Translator(EclipseLink2_2.INDEX__SCHEMA, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Schema(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTableTranslator() {
- return new Translator(EclipseLink2_2.INDEX__TABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Table(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildUniqueTranslator() {
- return new BooleanTranslator(EclipseLink2_2.INDEX__UNIQUE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlIndex_2_2_Unique(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlIndex
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java
deleted file mode 100644
index 6b87d945a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlInstantiationCopyPolicy.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Instantiation Policy</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlInstantiationCopyPolicy()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlInstantiationCopyPolicy extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlInstantiationCopyPolicy()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_INSTANTIATION_COPY_POLICY;
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {};
- }
-
-} // XmlInstantiationPolicy
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetch.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetch.java
deleted file mode 100644
index ff86a6f6a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetch.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Join Fetch</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch#getJoinFetch <em>Join Fetch</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlJoinFetch extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- XmlJoinFetchType getJoinFetch();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- void setJoinFetch(XmlJoinFetchType value);
-
- /**
- * Return the {@link TextRange} for the join-fetch element.
- */
- TextRange getJoinFetchTextRange();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetchType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetchType.java
deleted file mode 100644
index aa19b9044f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinFetchType.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the literals of the enumeration '<em><b>Xml Join Fetch Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetchType()
- * @model
- * @generated
- */
-public enum XmlJoinFetchType implements Enumerator
-{
- /**
- * The '<em><b>INNER</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #INNER_VALUE
- * @generated
- * @ordered
- */
- INNER(0, "INNER", "INNER"),
-
- /**
- * The '<em><b>OUTER</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #OUTER_VALUE
- * @generated
- * @ordered
- */
- OUTER(1, "OUTER", "OUTER");
-
- /**
- * The '<em><b>INNER</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>INNER</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #INNER
- * @model
- * @generated
- * @ordered
- */
- public static final int INNER_VALUE = 0;
-
- /**
- * The '<em><b>OUTER</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>OUTER</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #OUTER
- * @model
- * @generated
- * @ordered
- */
- public static final int OUTER_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Xml Join Fetch Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlJoinFetchType[] VALUES_ARRAY =
- new XmlJoinFetchType[]
- {
- INNER,
- OUTER,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Join Fetch Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlJoinFetchType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Join Fetch Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlJoinFetchType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlJoinFetchType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Join Fetch Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlJoinFetchType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlJoinFetchType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Join Fetch Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlJoinFetchType get(int value)
- {
- switch (value)
- {
- case INNER_VALUE: return INNER;
- case OUTER_VALUE: return OUTER;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private XmlJoinFetchType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlJoinFetchType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinTable.java
deleted file mode 100644
index dae31a93cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlJoinTable.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Join Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinTable()
- * @model kind="class"
- * @generated
- */
-public class XmlJoinTable extends org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable implements XmlJoinTable_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlJoinTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_JOIN_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinTable#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinTable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_JOIN_TABLE_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlJoinTable_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_JOIN_TABLE_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_JOIN_TABLE__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlJoinTable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildJoinColumnTranslator(),
- buildInverseJoinColumnTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlJoinTable_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlJoinTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java
deleted file mode 100644
index 08de9fb467..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToMany.java
+++ /dev/null
@@ -1,2041 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Many To Many</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany implements XmlManyToMany_2_0, XmlManyToMany_2_1, XmlManyToMany_2_2, XmlAttributeMapping, XmlJoinFetch
-{
- /**
- * The cached value of the '{@link #getMapKeyAssociationOverrides() <em>Map Key Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> mapKeyAssociationOverrides;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The default value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected static final String MAP_KEY_CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected String mapKeyConvert = MAP_KEY_CONVERT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NON_CACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected boolean nonCacheable = NON_CACHEABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlManyToMany()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MANY_TO_MANY;
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getMapKeyAssociationOverrides()
- {
- if (mapKeyAssociationOverrides == null)
- {
- mapKeyAssociationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES);
- }
- return mapKeyAssociationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Convert</em>' attribute.
- * @see #setMapKeyConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMapKeyConvert()
- {
- return mapKeyConvert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getMapKeyConvert <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Convert</em>' attribute.
- * @see #getMapKeyConvert()
- * @generated
- */
- public void setMapKeyConvert(String newMapKeyConvert)
- {
- String oldMapKeyConvert = mapKeyConvert;
- mapKeyConvert = newMapKeyConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT, oldMapKeyConvert, mapKeyConvert));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToMany_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNonCacheable()
- {
- return nonCacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- public void setNonCacheable(boolean newNonCacheable)
- {
- boolean oldNonCacheable = nonCacheable;
- nonCacheable = newNonCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE, oldNonCacheable, nonCacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getMapKeyAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return getMapKeyAssociationOverrides();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT:
- return getMapKeyConvert();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE:
- return isNonCacheable();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH:
- return getJoinFetch();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- getMapKeyAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT:
- setMapKeyConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE:
- setNonCacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT:
- setMapKeyConvert(MAP_KEY_CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE:
- setNonCacheable(NON_CACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return mapKeyAssociationOverrides != null && !mapKeyAssociationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT:
- return MAP_KEY_CONVERT_EDEFAULT == null ? mapKeyConvert != null : !MAP_KEY_CONVERT_EDEFAULT.equals(mapKeyConvert);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE:
- return nonCacheable != NON_CACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT: return EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_0.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_MANY_TO_MANY_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE: return EclipseLinkOrmV2_2Package.XML_MANY_TO_MANY_22__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_0.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToMany_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_MANY_TO_MANY_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_MANY_TO_MANY_22__NON_CACHEABLE: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_MANY__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (mapKeyConvert: ");
- result.append(mapKeyConvert);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", nonCacheable: ");
- result.append(nonCacheable);
- result.append(", attributeType: ");
- result.append(attributeType);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlManyToMany(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildAccessTranslator(),
- buildMappedByTranslator(),
- buildAttributeTypeTranslator(),
- buildOrderByTranslator(),
- XmlOrderColumn.buildTranslator(JPA2_0.ORDER_COLUMN, OrmV2_0Package.eINSTANCE.getXmlOrderable_2_0_OrderColumn()),
- buildMapKeyTranslator(),
- buildMapKeyClassTranslator(),
- buildMapKeyTemporalTranslator(),
- buildMapKeyEnumeratedTranslator(),
- buildMapKeyConvertTranslator(),
- buildMapKeyAttributeOverrideTranslator(),
- buildMapKeyAssociationOverrideTranslator(),
- buildMapKeyColumnTranslator(),
- buildMapKeyJoinColumnTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildJoinTableTranslator(),
- buildCascadeTranslator(),
- buildCascadeOnDeleteTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- };
- }
-
- protected static Translator buildMapKeyConvertTranslator() {
- return new Translator(JPA2_0.MAP_KEY_CONVERT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlCollectionMapping_2_0_MapKeyConvert());
- }
-
- protected static Translator buildMapKeyAttributeOverrideTranslator() {
- return XmlAttributeOverride.buildTranslator(JPA2_0.MAP_KEY_ATTRIBUTE_OVERRIDE, OrmV2_0Package.eINSTANCE.getXmlMapKeyAttributeOverrideContainer_2_0_MapKeyAttributeOverrides());
- }
-
- protected static Translator buildMapKeyAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(EclipseLink2_0.MAP_KEY_ASSOCIATION_OVERRIDE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters());
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlManyToMany_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableContainer_JoinTable());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlManyToMany_2_2_NonCacheable());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java
deleted file mode 100644
index e19ba013fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlManyToOne.java
+++ /dev/null
@@ -1,1552 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Many To One</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlManyToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne implements XmlManyToOne_2_1, XmlManyToOne_2_2, XmlAttributeMapping, XmlJoinFetch
-{
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NON_CACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected boolean nonCacheable = NON_CACHEABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlManyToOne()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MANY_TO_ONE;
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlManyToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNonCacheable()
- {
- return nonCacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- public void setNonCacheable(boolean newNonCacheable)
- {
- boolean oldNonCacheable = nonCacheable;
- nonCacheable = newNonCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE, oldNonCacheable, nonCacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE:
- return isNonCacheable();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH:
- return getJoinFetch();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE:
- setNonCacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE:
- setNonCacheable(NON_CACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE:
- return nonCacheable != NON_CACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE: return EclipseLinkOrmV2_2Package.XML_MANY_TO_ONE_22__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlManyToOne_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_MANY_TO_ONE_22__NON_CACHEABLE: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_MANY_TO_ONE__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (partitioned: ");
- result.append(partitioned);
- result.append(", nonCacheable: ");
- result.append(nonCacheable);
- result.append(", attributeType: ");
- result.append(attributeType);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
- public TextRange getAttributeTypeTextRange() {
- //no attribute-type for many-to-one
- return getValidationTextRange();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlManyToOne(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildOptionalTranslator(),
- buildAccessTranslator(),
- buildMapsIdTranslator(),
- buildIdTranslator(),
- buildJoinColumnTranslator(),
- buildJoinTableTranslator(),
- buildCascadeTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- };
- }
-
- protected static Translator buildPrivateOwnedTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink.PRIVATE_OWNED, EclipseLinkOrmPackage.eINSTANCE.getXmlPrivateOwned_PrivateOwned());
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableContainer_JoinTable());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlManyToOne_2_2_NonCacheable());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMappedSuperclass.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMappedSuperclass.java
deleted file mode 100644
index 59a83e2c3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMappedSuperclass.java
+++ /dev/null
@@ -1,4020 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlQueryContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Mapped Superclass</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getOptimisticLocking <em>Optimistic Locking</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCopyPolicy <em>Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCloneCopyPolicy <em>Clone Copy Policy</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass()
- * @model kind="class"
- * @generated
- */
-public class XmlMappedSuperclass extends org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass implements XmlTypeMapping, XmlMappedSuperclass_1_1, XmlMappedSuperclass_2_0, XmlMappedSuperclass_2_1, XmlMappedSuperclass_2_2, XmlMappedSuperclass_2_3, XmlMappedSuperclass_2_4, XmlReadOnly, XmlCustomizerHolder, XmlChangeTrackingHolder, XmlCacheHolder, XmlConverterContainer, XmlPropertyContainer
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The default value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected static final String PARENT_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getParentClass() <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParentClass()
- * @generated
- * @ordered
- */
- protected String parentClass = PARENT_CLASS_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKey()
- * @generated
- * @ordered
- */
- protected XmlPrimaryKey primaryKey;
-
- /**
- * The default value of the '{@link #getCacheable() <em>Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheable()
- * @generated
- * @ordered
- */
- protected static final Boolean CACHEABLE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCacheable() <em>Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheable()
- * @generated
- * @ordered
- */
- protected Boolean cacheable = CACHEABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getCacheInterceptor() <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheInterceptor()
- * @generated
- * @ordered
- */
- protected XmlClassReference cacheInterceptor;
-
- /**
- * The cached value of the '{@link #getAssociationOverrides() <em>Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> associationOverrides;
-
- /**
- * The cached value of the '{@link #getAttributeOverrides() <em>Attribute Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAttributeOverride> attributeOverrides;
-
- /**
- * The cached value of the '{@link #getFetchGroups() <em>Fetch Groups</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getFetchGroups()
- * @generated
- * @ordered
- */
- protected EList<XmlFetchGroup> fetchGroups;
-
- /**
- * The cached value of the '{@link #getSequenceGenerator() <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSequenceGenerator()
- * @generated
- * @ordered
- */
- protected XmlSequenceGenerator sequenceGenerator;
-
- /**
- * The cached value of the '{@link #getTableGenerator() <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTableGenerator()
- * @generated
- * @ordered
- */
- protected XmlTableGenerator tableGenerator;
-
- /**
- * The cached value of the '{@link #getNamedQueries() <em>Named Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedQuery> namedQueries;
-
- /**
- * The cached value of the '{@link #getNamedNativeQueries() <em>Named Native Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedNativeQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedNativeQuery> namedNativeQueries;
-
- /**
- * The cached value of the '{@link #getNamedStoredProcedureQueries() <em>Named Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredProcedureQuery> namedStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getSqlResultSetMappings() <em>Sql Result Set Mappings</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSqlResultSetMappings()
- * @generated
- * @ordered
- */
- protected EList<SqlResultSetMapping> sqlResultSetMappings;
-
- /**
- * The cached value of the '{@link #getQueryRedirectors() <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQueryRedirectors()
- * @generated
- * @ordered
- */
- protected XmlQueryRedirectors queryRedirectors;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAdditionalCriteria() <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAdditionalCriteria()
- * @generated
- * @ordered
- */
- protected XmlAdditionalCriteria_2_2 additionalCriteria;
-
- /**
- * The cached value of the '{@link #getMultitenant() <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMultitenant()
- * @generated
- * @ordered
- */
- protected XmlMultitenant multitenant;
-
- /**
- * The cached value of the '{@link #getNamedStoredFunctionQueries() <em>Named Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedStoredFunctionQuery_2_3> namedStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredFunctionQueries() <em>Named Plsql Stored Function Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredFunctionQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredFunctionQuery_2_3> namedPlsqlStoredFunctionQueries;
-
- /**
- * The cached value of the '{@link #getNamedPlsqlStoredProcedureQueries() <em>Named Plsql Stored Procedure Queries</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getNamedPlsqlStoredProcedureQueries()
- * @generated
- * @ordered
- */
- protected EList<XmlNamedPlsqlStoredProcedureQuery_2_3> namedPlsqlStoredProcedureQueries;
-
- /**
- * The cached value of the '{@link #getPlsqlRecords() <em>Plsql Records</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlRecords()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlRecord_2_3> plsqlRecords;
-
- /**
- * The cached value of the '{@link #getPlsqlTables() <em>Plsql Tables</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPlsqlTables()
- * @generated
- * @ordered
- */
- protected EList<XmlPlsqlTable> plsqlTables;
-
- /**
- * The cached value of the '{@link #getCacheIndex() <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheIndex()
- * @generated
- * @ordered
- */
- protected XmlCacheIndex_2_4 cacheIndex;
-
- /**
- * The default value of the '{@link #getReadOnly() <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadOnly()
- * @generated
- * @ordered
- */
- protected static final Boolean READ_ONLY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReadOnly() <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadOnly()
- * @generated
- * @ordered
- */
- protected Boolean readOnly = READ_ONLY_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getCustomizer() <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCustomizer()
- * @generated
- * @ordered
- */
- protected XmlClassReference customizer;
-
- /**
- * The cached value of the '{@link #getChangeTracking() <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getChangeTracking()
- * @generated
- * @ordered
- */
- protected XmlChangeTracking changeTracking;
-
- /**
- * The cached value of the '{@link #getCache() <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCache()
- * @generated
- * @ordered
- */
- protected XmlCache cache;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final ExistenceType EXISTENCE_CHECKING_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExistenceChecking() <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExistenceChecking()
- * @generated
- * @ordered
- */
- protected ExistenceType existenceChecking = EXISTENCE_CHECKING_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The cached value of the '{@link #getOptimisticLocking() <em>Optimistic Locking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getOptimisticLocking()
- * @generated
- * @ordered
- */
- protected XmlOptimisticLocking optimisticLocking;
-
- /**
- * The cached value of the '{@link #getCopyPolicy() <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCopyPolicy copyPolicy;
-
- /**
- * The cached value of the '{@link #getInstantiationCopyPolicy() <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInstantiationCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlInstantiationCopyPolicy instantiationCopyPolicy;
-
- /**
- * The cached value of the '{@link #getCloneCopyPolicy() <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCloneCopyPolicy()
- * @generated
- * @ordered
- */
- protected XmlCloneCopyPolicy cloneCopyPolicy;
-
- /**
- * The default value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected static final Boolean EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected Boolean excludeDefaultMappings = EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlMappedSuperclass()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MAPPED_SUPERCLASS;
- }
-
- /**
- * Returns the value of the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Only</em>' attribute.
- * @see #setReadOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly_ReadOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReadOnly()
- {
- return readOnly;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getReadOnly <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Only</em>' attribute.
- * @see #getReadOnly()
- * @generated
- */
- public void setReadOnly(Boolean newReadOnly)
- {
- Boolean oldReadOnly = readOnly;
- readOnly = newReadOnly;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY, oldReadOnly, readOnly));
- }
-
- /**
- * Returns the value of the '<em><b>Customizer</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Customizer</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Customizer</em>' containment reference.
- * @see #setCustomizer(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCustomizerHolder_Customizer()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCustomizer()
- {
- return customizer;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCustomizer(XmlClassReference newCustomizer, NotificationChain msgs)
- {
- XmlClassReference oldCustomizer = customizer;
- customizer = newCustomizer;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER, oldCustomizer, newCustomizer);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCustomizer <em>Customizer</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Customizer</em>' containment reference.
- * @see #getCustomizer()
- * @generated
- */
- public void setCustomizer(XmlClassReference newCustomizer)
- {
- if (newCustomizer != customizer)
- {
- NotificationChain msgs = null;
- if (customizer != null)
- msgs = ((InternalEObject)customizer).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER, null, msgs);
- if (newCustomizer != null)
- msgs = ((InternalEObject)newCustomizer).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER, null, msgs);
- msgs = basicSetCustomizer(newCustomizer, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER, newCustomizer, newCustomizer));
- }
-
- /**
- * Returns the value of the '<em><b>Change Tracking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Change Tracking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Change Tracking</em>' containment reference.
- * @see #setChangeTracking(XmlChangeTracking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlChangeTrackingHolder_ChangeTracking()
- * @model containment="true"
- * @generated
- */
- public XmlChangeTracking getChangeTracking()
- {
- return changeTracking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetChangeTracking(XmlChangeTracking newChangeTracking, NotificationChain msgs)
- {
- XmlChangeTracking oldChangeTracking = changeTracking;
- changeTracking = newChangeTracking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING, oldChangeTracking, newChangeTracking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getChangeTracking <em>Change Tracking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Change Tracking</em>' containment reference.
- * @see #getChangeTracking()
- * @generated
- */
- public void setChangeTracking(XmlChangeTracking newChangeTracking)
- {
- if (newChangeTracking != changeTracking)
- {
- NotificationChain msgs = null;
- if (changeTracking != null)
- msgs = ((InternalEObject)changeTracking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING, null, msgs);
- if (newChangeTracking != null)
- msgs = ((InternalEObject)newChangeTracking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING, null, msgs);
- msgs = basicSetChangeTracking(newChangeTracking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING, newChangeTracking, newChangeTracking));
- }
-
- /**
- * Returns the value of the '<em><b>Cache</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache</em>' containment reference.
- * @see #setCache(XmlCache)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_Cache()
- * @model containment="true"
- * @generated
- */
- public XmlCache getCache()
- {
- return cache;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCache(XmlCache newCache, NotificationChain msgs)
- {
- XmlCache oldCache = cache;
- cache = newCache;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE, oldCache, newCache);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCache <em>Cache</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache</em>' containment reference.
- * @see #getCache()
- * @generated
- */
- public void setCache(XmlCache newCache)
- {
- if (newCache != cache)
- {
- NotificationChain msgs = null;
- if (cache != null)
- msgs = ((InternalEObject)cache).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE, null, msgs);
- if (newCache != null)
- msgs = ((InternalEObject)newCache).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE, null, msgs);
- msgs = basicSetCache(newCache, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE, newCache, newCache));
- }
-
- /**
- * Returns the value of the '<em><b>Existence Checking</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Existence Checking</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #setExistenceChecking(ExistenceType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheHolder_ExistenceChecking()
- * @model default=""
- * @generated
- */
- public ExistenceType getExistenceChecking()
- {
- return existenceChecking;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExistenceChecking <em>Existence Checking</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Existence Checking</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType
- * @see #getExistenceChecking()
- * @generated
- */
- public void setExistenceChecking(ExistenceType newExistenceChecking)
- {
- ExistenceType oldExistenceChecking = existenceChecking;
- existenceChecking = newExistenceChecking == null ? EXISTENCE_CHECKING_EDEFAULT : newExistenceChecking;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING, oldExistenceChecking, existenceChecking));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Optimistic Locking</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Optimistic Locking</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Optimistic Locking</em>' containment reference.
- * @see #setOptimisticLocking(XmlOptimisticLocking)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_OptimisticLocking()
- * @model containment="true"
- * @generated
- */
- public XmlOptimisticLocking getOptimisticLocking()
- {
- return optimisticLocking;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetOptimisticLocking(XmlOptimisticLocking newOptimisticLocking, NotificationChain msgs)
- {
- XmlOptimisticLocking oldOptimisticLocking = optimisticLocking;
- optimisticLocking = newOptimisticLocking;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING, oldOptimisticLocking, newOptimisticLocking);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getOptimisticLocking <em>Optimistic Locking</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Optimistic Locking</em>' containment reference.
- * @see #getOptimisticLocking()
- * @generated
- */
- public void setOptimisticLocking(XmlOptimisticLocking newOptimisticLocking)
- {
- if (newOptimisticLocking != optimisticLocking)
- {
- NotificationChain msgs = null;
- if (optimisticLocking != null)
- msgs = ((InternalEObject)optimisticLocking).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING, null, msgs);
- if (newOptimisticLocking != null)
- msgs = ((InternalEObject)newOptimisticLocking).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING, null, msgs);
- msgs = basicSetOptimisticLocking(newOptimisticLocking, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING, newOptimisticLocking, newOptimisticLocking));
- }
-
- /**
- * Returns the value of the '<em><b>Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Copy Policy</em>' containment reference.
- * @see #setCopyPolicy(XmlCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_CopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCopyPolicy getCopyPolicy()
- {
- return copyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCopyPolicy(XmlCopyPolicy newCopyPolicy, NotificationChain msgs)
- {
- XmlCopyPolicy oldCopyPolicy = copyPolicy;
- copyPolicy = newCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY, oldCopyPolicy, newCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCopyPolicy <em>Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Copy Policy</em>' containment reference.
- * @see #getCopyPolicy()
- * @generated
- */
- public void setCopyPolicy(XmlCopyPolicy newCopyPolicy)
- {
- if (newCopyPolicy != copyPolicy)
- {
- NotificationChain msgs = null;
- if (copyPolicy != null)
- msgs = ((InternalEObject)copyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY, null, msgs);
- if (newCopyPolicy != null)
- msgs = ((InternalEObject)newCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY, null, msgs);
- msgs = basicSetCopyPolicy(newCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY, newCopyPolicy, newCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Instantiation Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Instantiation Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #setInstantiationCopyPolicy(XmlInstantiationCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_InstantiationCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlInstantiationCopyPolicy getInstantiationCopyPolicy()
- {
- return instantiationCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy, NotificationChain msgs)
- {
- XmlInstantiationCopyPolicy oldInstantiationCopyPolicy = instantiationCopyPolicy;
- instantiationCopyPolicy = newInstantiationCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY, oldInstantiationCopyPolicy, newInstantiationCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getInstantiationCopyPolicy <em>Instantiation Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Instantiation Copy Policy</em>' containment reference.
- * @see #getInstantiationCopyPolicy()
- * @generated
- */
- public void setInstantiationCopyPolicy(XmlInstantiationCopyPolicy newInstantiationCopyPolicy)
- {
- if (newInstantiationCopyPolicy != instantiationCopyPolicy)
- {
- NotificationChain msgs = null;
- if (instantiationCopyPolicy != null)
- msgs = ((InternalEObject)instantiationCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY, null, msgs);
- if (newInstantiationCopyPolicy != null)
- msgs = ((InternalEObject)newInstantiationCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY, null, msgs);
- msgs = basicSetInstantiationCopyPolicy(newInstantiationCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY, newInstantiationCopyPolicy, newInstantiationCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Clone Copy Policy</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Clone Copy Policy</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #setCloneCopyPolicy(XmlCloneCopyPolicy)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_CloneCopyPolicy()
- * @model containment="true"
- * @generated
- */
- public XmlCloneCopyPolicy getCloneCopyPolicy()
- {
- return cloneCopyPolicy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy, NotificationChain msgs)
- {
- XmlCloneCopyPolicy oldCloneCopyPolicy = cloneCopyPolicy;
- cloneCopyPolicy = newCloneCopyPolicy;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY, oldCloneCopyPolicy, newCloneCopyPolicy);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCloneCopyPolicy <em>Clone Copy Policy</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Clone Copy Policy</em>' containment reference.
- * @see #getCloneCopyPolicy()
- * @generated
- */
- public void setCloneCopyPolicy(XmlCloneCopyPolicy newCloneCopyPolicy)
- {
- if (newCloneCopyPolicy != cloneCopyPolicy)
- {
- NotificationChain msgs = null;
- if (cloneCopyPolicy != null)
- msgs = ((InternalEObject)cloneCopyPolicy).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY, null, msgs);
- if (newCloneCopyPolicy != null)
- msgs = ((InternalEObject)newCloneCopyPolicy).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY, null, msgs);
- msgs = basicSetCloneCopyPolicy(newCloneCopyPolicy, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY, newCloneCopyPolicy, newCloneCopyPolicy));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' containment reference.
- * @see #setPrimaryKey(XmlPrimaryKey)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_1_1_PrimaryKey()
- * @model containment="true"
- * @generated
- */
- public XmlPrimaryKey getPrimaryKey()
- {
- return primaryKey;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPrimaryKey(XmlPrimaryKey newPrimaryKey, NotificationChain msgs)
- {
- XmlPrimaryKey oldPrimaryKey = primaryKey;
- primaryKey = newPrimaryKey;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY, oldPrimaryKey, newPrimaryKey);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getPrimaryKey <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' containment reference.
- * @see #getPrimaryKey()
- * @generated
- */
- public void setPrimaryKey(XmlPrimaryKey newPrimaryKey)
- {
- if (newPrimaryKey != primaryKey)
- {
- NotificationChain msgs = null;
- if (primaryKey != null)
- msgs = ((InternalEObject)primaryKey).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY, null, msgs);
- if (newPrimaryKey != null)
- msgs = ((InternalEObject)newPrimaryKey).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY, null, msgs);
- msgs = basicSetPrimaryKey(newPrimaryKey, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY, newPrimaryKey, newPrimaryKey));
- }
-
- /**
- * Returns the value of the '<em><b>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cacheable</em>' attribute.
- * @see #setCacheable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCacheable_2_0_Cacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCacheable()
- {
- return cacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCacheable <em>Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cacheable</em>' attribute.
- * @see #getCacheable()
- * @generated
- */
- public void setCacheable(Boolean newCacheable)
- {
- Boolean oldCacheable = cacheable;
- cacheable = newCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE, oldCacheable, cacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Interceptor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #setCacheInterceptor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_0_CacheInterceptor()
- * @model containment="true"
- * @generated
- */
- public XmlClassReference getCacheInterceptor()
- {
- return cacheInterceptor;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheInterceptor(XmlClassReference newCacheInterceptor, NotificationChain msgs)
- {
- XmlClassReference oldCacheInterceptor = cacheInterceptor;
- cacheInterceptor = newCacheInterceptor;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR, oldCacheInterceptor, newCacheInterceptor);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCacheInterceptor <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #getCacheInterceptor()
- * @generated
- */
- public void setCacheInterceptor(XmlClassReference newCacheInterceptor)
- {
- if (newCacheInterceptor != cacheInterceptor)
- {
- NotificationChain msgs = null;
- if (cacheInterceptor != null)
- msgs = ((InternalEObject)cacheInterceptor).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR, null, msgs);
- if (newCacheInterceptor != null)
- msgs = ((InternalEObject)newCacheInterceptor).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR, null, msgs);
- msgs = basicSetCacheInterceptor(newCacheInterceptor, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR, newCacheInterceptor, newCacheInterceptor));
- }
-
- /**
- * Returns the value of the '<em><b>Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAssociationOverrideContainer_AssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getAssociationOverrides()
- {
- if (associationOverrides == null)
- {
- associationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES);
- }
- return associationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeOverrideContainer_AttributeOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAttributeOverride> getAttributeOverrides()
- {
- if (attributeOverrides == null)
- {
- attributeOverrides = new EObjectContainmentEList<XmlAttributeOverride>(XmlAttributeOverride.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES);
- }
- return attributeOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Fetch Groups</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch Groups</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch Groups</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlFetchGroupContainer_2_1_FetchGroups()
- * @model containment="true"
- * @generated
- */
- public EList<XmlFetchGroup> getFetchGroups()
- {
- if (fetchGroups == null)
- {
- fetchGroups = new EObjectContainmentEList<XmlFetchGroup>(XmlFetchGroup.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS);
- }
- return fetchGroups;
- }
-
- /**
- * Returns the value of the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sequence Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sequence Generator</em>' containment reference.
- * @see #setSequenceGenerator(XmlSequenceGenerator)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlGeneratorContainer_SequenceGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlSequenceGenerator getSequenceGenerator()
- {
- return sequenceGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetSequenceGenerator(XmlSequenceGenerator newSequenceGenerator, NotificationChain msgs)
- {
- XmlSequenceGenerator oldSequenceGenerator = sequenceGenerator;
- sequenceGenerator = newSequenceGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR, oldSequenceGenerator, newSequenceGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getSequenceGenerator <em>Sequence Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Sequence Generator</em>' containment reference.
- * @see #getSequenceGenerator()
- * @generated
- */
- public void setSequenceGenerator(XmlSequenceGenerator newSequenceGenerator)
- {
- if (newSequenceGenerator != sequenceGenerator)
- {
- NotificationChain msgs = null;
- if (sequenceGenerator != null)
- msgs = ((InternalEObject)sequenceGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR, null, msgs);
- if (newSequenceGenerator != null)
- msgs = ((InternalEObject)newSequenceGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR, null, msgs);
- msgs = basicSetSequenceGenerator(newSequenceGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR, newSequenceGenerator, newSequenceGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table Generator</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table Generator</em>' containment reference.
- * @see #setTableGenerator(XmlTableGenerator)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlGeneratorContainer_TableGenerator()
- * @model containment="true"
- * @generated
- */
- public XmlTableGenerator getTableGenerator()
- {
- return tableGenerator;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetTableGenerator(XmlTableGenerator newTableGenerator, NotificationChain msgs)
- {
- XmlTableGenerator oldTableGenerator = tableGenerator;
- tableGenerator = newTableGenerator;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR, oldTableGenerator, newTableGenerator);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getTableGenerator <em>Table Generator</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table Generator</em>' containment reference.
- * @see #getTableGenerator()
- * @generated
- */
- public void setTableGenerator(XmlTableGenerator newTableGenerator)
- {
- if (newTableGenerator != tableGenerator)
- {
- NotificationChain msgs = null;
- if (tableGenerator != null)
- msgs = ((InternalEObject)tableGenerator).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR, null, msgs);
- if (newTableGenerator != null)
- msgs = ((InternalEObject)newTableGenerator).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR, null, msgs);
- msgs = basicSetTableGenerator(newTableGenerator, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR, newTableGenerator, newTableGenerator));
- }
-
- /**
- * Returns the value of the '<em><b>Named Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedQuery> getNamedQueries()
- {
- if (namedQueries == null)
- {
- namedQueries = new EObjectContainmentEList<XmlNamedQuery>(XmlNamedQuery.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES);
- }
- return namedQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Native Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Native Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Native Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedNativeQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedNativeQuery> getNamedNativeQueries()
- {
- if (namedNativeQueries == null)
- {
- namedNativeQueries = new EObjectContainmentEList<XmlNamedNativeQuery>(XmlNamedNativeQuery.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES);
- }
- return namedNativeQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredProcedureQuery> getNamedStoredProcedureQueries()
- {
- if (namedStoredProcedureQueries == null)
- {
- namedStoredProcedureQueries = new EObjectContainmentEList<XmlNamedStoredProcedureQuery>(XmlNamedStoredProcedureQuery.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES);
- }
- return namedStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sql Result Set Mappings</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sql Result Set Mappings</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_1_SqlResultSetMappings()
- * @model containment="true"
- * @generated
- */
- public EList<SqlResultSetMapping> getSqlResultSetMappings()
- {
- if (sqlResultSetMappings == null)
- {
- sqlResultSetMappings = new EObjectContainmentEList<SqlResultSetMapping>(SqlResultSetMapping.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS);
- }
- return sqlResultSetMappings;
- }
-
- /**
- * Returns the value of the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Redirectors</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Redirectors</em>' containment reference.
- * @see #setQueryRedirectors(XmlQueryRedirectors)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_1_QueryRedirectors()
- * @model containment="true"
- * @generated
- */
- public XmlQueryRedirectors getQueryRedirectors()
- {
- return queryRedirectors;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetQueryRedirectors(XmlQueryRedirectors newQueryRedirectors, NotificationChain msgs)
- {
- XmlQueryRedirectors oldQueryRedirectors = queryRedirectors;
- queryRedirectors = newQueryRedirectors;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS, oldQueryRedirectors, newQueryRedirectors);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getQueryRedirectors <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Redirectors</em>' containment reference.
- * @see #getQueryRedirectors()
- * @generated
- */
- public void setQueryRedirectors(XmlQueryRedirectors newQueryRedirectors)
- {
- if (newQueryRedirectors != queryRedirectors)
- {
- NotificationChain msgs = null;
- if (queryRedirectors != null)
- msgs = ((InternalEObject)queryRedirectors).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS, null, msgs);
- if (newQueryRedirectors != null)
- msgs = ((InternalEObject)newQueryRedirectors).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS, null, msgs);
- msgs = basicSetQueryRedirectors(newQueryRedirectors, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS, newQueryRedirectors, newQueryRedirectors));
- }
-
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeMapping_2_1_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getParentClass()
- {
- return parentClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- public void setParentClass(String newParentClass)
- {
- String oldParentClass = parentClass;
- parentClass = newParentClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS, oldParentClass, parentClass));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Additional Criteria</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Additional Criteria</em>' containment reference.
- * @see #setAdditionalCriteria(XmlAdditionalCriteria_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_2_AdditionalCriteria()
- * @model containment="true"
- * @generated
- */
- public XmlAdditionalCriteria_2_2 getAdditionalCriteria()
- {
- return additionalCriteria;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAdditionalCriteria(XmlAdditionalCriteria_2_2 newAdditionalCriteria, NotificationChain msgs)
- {
- XmlAdditionalCriteria_2_2 oldAdditionalCriteria = additionalCriteria;
- additionalCriteria = newAdditionalCriteria;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA, oldAdditionalCriteria, newAdditionalCriteria);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getAdditionalCriteria <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Additional Criteria</em>' containment reference.
- * @see #getAdditionalCriteria()
- * @generated
- */
- public void setAdditionalCriteria(XmlAdditionalCriteria_2_2 newAdditionalCriteria)
- {
- if (newAdditionalCriteria != additionalCriteria)
- {
- NotificationChain msgs = null;
- if (additionalCriteria != null)
- msgs = ((InternalEObject)additionalCriteria).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA, null, msgs);
- if (newAdditionalCriteria != null)
- msgs = ((InternalEObject)newAdditionalCriteria).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA, null, msgs);
- msgs = basicSetAdditionalCriteria(newAdditionalCriteria, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA, newAdditionalCriteria, newAdditionalCriteria));
- }
-
- /**
- * Returns the value of the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Multitenant</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Multitenant</em>' containment reference.
- * @see #setMultitenant(XmlMultitenant)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder_Multitenant()
- * @model containment="true"
- * @generated
- */
- public XmlMultitenant getMultitenant()
- {
- return multitenant;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetMultitenant(XmlMultitenant newMultitenant, NotificationChain msgs)
- {
- XmlMultitenant oldMultitenant = multitenant;
- multitenant = newMultitenant;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT, oldMultitenant, newMultitenant);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getMultitenant <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Multitenant</em>' containment reference.
- * @see #getMultitenant()
- * @generated
- */
- public void setMultitenant(XmlMultitenant newMultitenant)
- {
- if (newMultitenant != multitenant)
- {
- NotificationChain msgs = null;
- if (multitenant != null)
- msgs = ((InternalEObject)multitenant).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT, null, msgs);
- if (newMultitenant != null)
- msgs = ((InternalEObject)newMultitenant).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT, null, msgs);
- msgs = basicSetMultitenant(newMultitenant, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT, newMultitenant, newMultitenant));
- }
-
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries()
- {
- if (namedStoredFunctionQueries == null)
- {
- namedStoredFunctionQueries = new EObjectContainmentEList<XmlNamedStoredFunctionQuery_2_3>(XmlNamedStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES);
- }
- return namedStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries()
- {
- if (namedPlsqlStoredFunctionQueries == null)
- {
- namedPlsqlStoredFunctionQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredFunctionQuery_2_3>(XmlNamedPlsqlStoredFunctionQuery_2_3.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- }
- return namedPlsqlStoredFunctionQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- public EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries()
- {
- if (namedPlsqlStoredProcedureQueries == null)
- {
- namedPlsqlStoredProcedureQueries = new EObjectContainmentEList<XmlNamedPlsqlStoredProcedureQuery_2_3>(XmlNamedPlsqlStoredProcedureQuery_2_3.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- }
- return namedPlsqlStoredProcedureQueries;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlRecord_2_3> getPlsqlRecords()
- {
- if (plsqlRecords == null)
- {
- plsqlRecords = new EObjectContainmentEList<XmlPlsqlRecord_2_3>(XmlPlsqlRecord_2_3.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS);
- }
- return plsqlRecords;
- }
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- public EList<XmlPlsqlTable> getPlsqlTables()
- {
- if (plsqlTables == null)
- {
- plsqlTables = new EObjectContainmentEList<XmlPlsqlTable>(XmlPlsqlTable.class, this, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES);
- }
- return plsqlTables;
- }
-
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- public XmlCacheIndex_2_4 getCacheIndex()
- {
- return cacheIndex;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetCacheIndex(XmlCacheIndex_2_4 newCacheIndex, NotificationChain msgs)
- {
- XmlCacheIndex_2_4 oldCacheIndex = cacheIndex;
- cacheIndex = newCacheIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX, oldCacheIndex, newCacheIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- public void setCacheIndex(XmlCacheIndex_2_4 newCacheIndex)
- {
- if (newCacheIndex != cacheIndex)
- {
- NotificationChain msgs = null;
- if (cacheIndex != null)
- msgs = ((InternalEObject)cacheIndex).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX, null, msgs);
- if (newCacheIndex != null)
- msgs = ((InternalEObject)newCacheIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX, null, msgs);
- msgs = basicSetCacheIndex(newCacheIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX, newCacheIndex, newCacheIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Mappings</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #setExcludeDefaultMappings(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMappedSuperclass_ExcludeDefaultMappings()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getExcludeDefaultMappings()
- {
- return excludeDefaultMappings;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass#getExcludeDefaultMappings <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #getExcludeDefaultMappings()
- * @generated
- */
- public void setExcludeDefaultMappings(Boolean newExcludeDefaultMappings)
- {
- Boolean oldExcludeDefaultMappings = excludeDefaultMappings;
- excludeDefaultMappings = newExcludeDefaultMappings;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS, oldExcludeDefaultMappings, excludeDefaultMappings));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- return basicSetPrimaryKey(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- return basicSetCacheInterceptor(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- return ((InternalEList<?>)getAttributeOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- return ((InternalEList<?>)getFetchGroups()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- return basicSetSequenceGenerator(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- return basicSetTableGenerator(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- return ((InternalEList<?>)getNamedQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- return ((InternalEList<?>)getNamedNativeQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- return ((InternalEList<?>)getSqlResultSetMappings()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- return basicSetQueryRedirectors(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- return basicSetAdditionalCriteria(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- return basicSetMultitenant(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredFunctionQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return ((InternalEList<?>)getNamedPlsqlStoredProcedureQueries()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- return ((InternalEList<?>)getPlsqlRecords()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- return ((InternalEList<?>)getPlsqlTables()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- return basicSetCacheIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- return basicSetCustomizer(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- return basicSetChangeTracking(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- return basicSetCache(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- return basicSetOptimisticLocking(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- return basicSetCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- return basicSetInstantiationCopyPolicy(null, msgs);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- return basicSetCloneCopyPolicy(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS:
- return getParentClass();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- return getPrimaryKey();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE:
- return getCacheable();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- return getCacheInterceptor();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- return getAssociationOverrides();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- return getAttributeOverrides();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- return getFetchGroups();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- return getSequenceGenerator();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- return getTableGenerator();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- return getNamedQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- return getNamedNativeQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- return getNamedStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- return getSqlResultSetMappings();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- return getQueryRedirectors();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- return getAdditionalCriteria();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- return getMultitenant();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- return getNamedStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return getNamedPlsqlStoredFunctionQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return getNamedPlsqlStoredProcedureQueries();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- return getPlsqlRecords();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- return getPlsqlTables();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- return getCacheIndex();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY:
- return getReadOnly();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- return getCustomizer();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- return getChangeTracking();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- return getCache();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING:
- return getExistenceChecking();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- return getOptimisticLocking();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- return getCopyPolicy();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- return getInstantiationCopyPolicy();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- return getCloneCopyPolicy();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS:
- return getExcludeDefaultMappings();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS:
- setParentClass((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- setPrimaryKey((XmlPrimaryKey)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE:
- setCacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- setCacheInterceptor((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- getAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- getAttributeOverrides().addAll((Collection<? extends XmlAttributeOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- getFetchGroups().clear();
- getFetchGroups().addAll((Collection<? extends XmlFetchGroup>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- getNamedQueries().clear();
- getNamedQueries().addAll((Collection<? extends XmlNamedQuery>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- getNamedNativeQueries().addAll((Collection<? extends XmlNamedNativeQuery>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- getNamedStoredProcedureQueries().addAll((Collection<? extends XmlNamedStoredProcedureQuery>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- getSqlResultSetMappings().addAll((Collection<? extends SqlResultSetMapping>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- setQueryRedirectors((XmlQueryRedirectors)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- setAdditionalCriteria((XmlAdditionalCriteria_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- setMultitenant((XmlMultitenant)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- getNamedStoredFunctionQueries().addAll((Collection<? extends XmlNamedStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- getNamedPlsqlStoredFunctionQueries().addAll((Collection<? extends XmlNamedPlsqlStoredFunctionQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- getNamedPlsqlStoredProcedureQueries().addAll((Collection<? extends XmlNamedPlsqlStoredProcedureQuery_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- getPlsqlRecords().addAll((Collection<? extends XmlPlsqlRecord_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- getPlsqlTables().clear();
- getPlsqlTables().addAll((Collection<? extends XmlPlsqlTable>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY:
- setReadOnly((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- setCustomizer((XmlClassReference)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- setCache((XmlCache)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING:
- setExistenceChecking((ExistenceType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- setOptimisticLocking((XmlOptimisticLocking)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS:
- setParentClass(PARENT_CLASS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- setPrimaryKey((XmlPrimaryKey)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE:
- setCacheable(CACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- setCacheInterceptor((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- getAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- getAttributeOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- getFetchGroups().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- setSequenceGenerator((XmlSequenceGenerator)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- setTableGenerator((XmlTableGenerator)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- getNamedQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- getNamedNativeQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- getNamedStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- getSqlResultSetMappings().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- setQueryRedirectors((XmlQueryRedirectors)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- setAdditionalCriteria((XmlAdditionalCriteria_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- setMultitenant((XmlMultitenant)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- getNamedStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- getNamedPlsqlStoredFunctionQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- getNamedPlsqlStoredProcedureQueries().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- getPlsqlRecords().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- getPlsqlTables().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- setCacheIndex((XmlCacheIndex_2_4)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY:
- setReadOnly(READ_ONLY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- setCustomizer((XmlClassReference)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- setChangeTracking((XmlChangeTracking)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- setCache((XmlCache)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING:
- setExistenceChecking(EXISTENCE_CHECKING_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- setOptimisticLocking((XmlOptimisticLocking)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- setCopyPolicy((XmlCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- setInstantiationCopyPolicy((XmlInstantiationCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- setCloneCopyPolicy((XmlCloneCopyPolicy)null);
- return;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings(EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS:
- return PARENT_CLASS_EDEFAULT == null ? parentClass != null : !PARENT_CLASS_EDEFAULT.equals(parentClass);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY:
- return primaryKey != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE:
- return CACHEABLE_EDEFAULT == null ? cacheable != null : !CACHEABLE_EDEFAULT.equals(cacheable);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR:
- return cacheInterceptor != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES:
- return associationOverrides != null && !associationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES:
- return attributeOverrides != null && !attributeOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS:
- return fetchGroups != null && !fetchGroups.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR:
- return sequenceGenerator != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR:
- return tableGenerator != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES:
- return namedQueries != null && !namedQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES:
- return namedNativeQueries != null && !namedNativeQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES:
- return namedStoredProcedureQueries != null && !namedStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS:
- return sqlResultSetMappings != null && !sqlResultSetMappings.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS:
- return queryRedirectors != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA:
- return additionalCriteria != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT:
- return multitenant != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES:
- return namedStoredFunctionQueries != null && !namedStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES:
- return namedPlsqlStoredFunctionQueries != null && !namedPlsqlStoredFunctionQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES:
- return namedPlsqlStoredProcedureQueries != null && !namedPlsqlStoredProcedureQueries.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS:
- return plsqlRecords != null && !plsqlRecords.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES:
- return plsqlTables != null && !plsqlTables.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX:
- return cacheIndex != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY:
- return READ_ONLY_EDEFAULT == null ? readOnly != null : !READ_ONLY_EDEFAULT.equals(readOnly);
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER:
- return customizer != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING:
- return changeTracking != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE:
- return cache != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING:
- return existenceChecking != EXISTENCE_CHECKING_EDEFAULT;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OPTIMISTIC_LOCKING:
- return optimisticLocking != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__COPY_POLICY:
- return copyPolicy != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__INSTANTIATION_COPY_POLICY:
- return instantiationCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CLONE_COPY_POLICY:
- return cloneCopyPolicy != null;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXCLUDE_DEFAULT_MAPPINGS:
- return EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT == null ? excludeDefaultMappings != null : !EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT.equals(excludeDefaultMappings);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS: return EclipseLinkOrmV2_1Package.XML_TYPE_MAPPING_21__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_1_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY: return EclipseLinkOrmV1_1Package.XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheable_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE: return OrmV2_0Package.XML_CACHEABLE_20__CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR: return EclipseLinkOrmV2_0Package.XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES: return OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES: return OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlFetchGroupContainer_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS: return EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS;
- default: return -1;
- }
- }
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR: return OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES: return OrmPackage.XML_QUERY_CONTAINER__NAMED_QUERIES;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES: return OrmPackage.XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS: return EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS: return EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA: return EclipseLinkOrmV2_2Package.XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA;
- default: return -1;
- }
- }
- if (baseClass == XmlMultitenantHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT: return EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES: return EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX: return EclipseLinkOrmV2_4Package.XML_MAPPED_SUPERCLASS_24__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlReadOnly.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY: return EclipseLinkOrmPackage.XML_READ_ONLY__READ_ONLY;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER: return EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE: return EclipseLinkOrmPackage.XML_CACHE_HOLDER__CACHE;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING: return EclipseLinkOrmPackage.XML_CACHE_HOLDER__EXISTENCE_CHECKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_TYPE_MAPPING_21__PARENT_CLASS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARENT_CLASS;
- default: return -1;
- }
- }
- if (baseClass == XmlTypeMapping.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_1_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV1_1Package.XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PRIMARY_KEY;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheable_2_0.class)
- {
- switch (baseFeatureID)
- {
- case OrmV2_0Package.XML_CACHEABLE_20__CACHEABLE: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INTERCEPTOR;
- default: return -1;
- }
- }
- if (baseClass == XmlAssociationOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeOverrideContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ATTRIBUTE_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlFetchGroupContainer_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__FETCH_GROUPS;
- default: return -1;
- }
- }
- if (baseClass == XmlGeneratorContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SEQUENCE_GENERATOR;
- case OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TABLE_GENERATOR;
- default: return -1;
- }
- }
- if (baseClass == XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case OrmPackage.XML_QUERY_CONTAINER__NAMED_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_QUERIES;
- case OrmPackage.XML_QUERY_CONTAINER__NAMED_NATIVE_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_NATIVE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_CONTAINER__NAMED_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_PROCEDURE_QUERIES;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__SQL_RESULT_SET_MAPPINGS;
- case EclipseLinkOrmV2_1Package.XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__QUERY_REDIRECTORS;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__ADDITIONAL_CRITERIA;
- default: return -1;
- }
- }
- if (baseClass == XmlMultitenantHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__MULTITENANT;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_FUNCTION_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__NAMED_PLSQL_STORED_PROCEDURE_QUERIES;
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_RECORDS;
- case EclipseLinkOrmV2_3Package.XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PLSQL_TABLES;
- default: return -1;
- }
- }
- if (baseClass == XmlMappedSuperclass_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_MAPPED_SUPERCLASS_24__CACHE_INDEX: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE_INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlReadOnly.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_READ_ONLY__READ_ONLY: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__READ_ONLY;
- default: return -1;
- }
- }
- if (baseClass == XmlCustomizerHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CUSTOMIZER_HOLDER__CUSTOMIZER: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CUSTOMIZER;
- default: return -1;
- }
- }
- if (baseClass == XmlChangeTrackingHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CHANGE_TRACKING_HOLDER__CHANGE_TRACKING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CHANGE_TRACKING;
- default: return -1;
- }
- }
- if (baseClass == XmlCacheHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CACHE_HOLDER__CACHE: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CACHE;
- case EclipseLinkOrmPackage.XML_CACHE_HOLDER__EXISTENCE_CHECKING: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__EXISTENCE_CHECKING;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_MAPPED_SUPERCLASS__PROPERTIES;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (parentClass: ");
- result.append(parentClass);
- result.append(", cacheable: ");
- result.append(cacheable);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", readOnly: ");
- result.append(readOnly);
- result.append(", existenceChecking: ");
- result.append(existenceChecking);
- result.append(", excludeDefaultMappings: ");
- result.append(excludeDefaultMappings);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getReadOnlyTextRange() {
- return getAttributeTextRange(EclipseLink.READ_ONLY);
- }
-
- public TextRange getCacheableTextRange() {
- return getAttributeTextRange(JPA2_0.CACHEABLE);
- }
-
- public TextRange getParentClassTextRange() {
- return getAttributeTextRange(EclipseLink2_1.PARENT_CLASS);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildClassTranslator(),
- buildParentClassTranslator(),
- buildAccessTranslator(),
- buildCacheableTranslator(),
- buildMetadataCompleteTranslator(),
- buildReadOnlyTranslator(),
- buildExistenceCheckingTranslator(),
- buildExcludeDefaultMappingsTranslator(),
- buildDescriptionTranslator(),
- buildAccessMethodsTranslator(),
- XmlMultitenant.buildTranslator(EclipseLink2_3.MULTITENANT, EclipseLinkOrmPackage.eINSTANCE.getXmlMultitenantHolder_Multitenant()),
- buildAdditionalCriteriaTranslator(),
- buildCustomizerTranslator(),
- buildChangeTrackingTranslator(),
- buildIdClassTranslator(),
- buildPrimaryKeyTranslator(),
- buildOptimisticLockingTranslator(),
- buildCacheTranslator(),
- buildCacheInterceptorTranslator(),
- buildCacheIndexTranslator(),
- buildFetchGroupsTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildCopyPolicyTranslator(),
- buildInstantiationCoypPolicyTranslator(),
- buildCloneCopyPolicyTranslator(),
- buildSequenceGeneratorTranslator(),
- buildTableGeneratorTranslator(),
- buildNamedQueryTranslator(),
- buildNamedNativeQueryTranslator(),
- buildNamedStoredProcedureQueryTranslator(),
- XmlNamedStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries()),
- XmlNamedPlsqlStoredProcedureQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_PROCEDURE_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries()),
- XmlNamedPlsqlStoredFunctionQuery.buildTranslator(EclipseLink2_3.NAMED_PLSQL_STORED_FUNCTION_QUERY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries()),
- XmlPlsqlRecord.buildTranslator(EclipseLink2_3.PLSQL_RECORD, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_PlsqlRecords()),
- XmlPlsqlTable.buildTranslator(EclipseLink2_3.PLSQL_TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMappedSuperclass_2_3_PlsqlTables()),
- buildSqlResultSetMappingTranslator(),
- buildQueryRedirectorsTranslator(),
- buildExcludeDefaultListenersTranslator(),
- buildExcludeSuperclassListenersTranslator(),
- buildEntityListenersTranslator(),
- buildPrePersistTranslator(),
- buildPostPersistTranslator(),
- buildPreRemoveTranslator(),
- buildPostRemoveTranslator(),
- buildPreUpdateTranslator(),
- buildPostUpdateTranslator(),
- buildPostLoadTranslator(),
- buildPropertyTranslator(),
- buildAttributeOverrideTranslator(),
- buildAssociationOverrideTranslator(),
- Attributes.buildTranslator()};
- }
-
- protected static Translator buildCacheableTranslator() {
- return new Translator(JPA2_0.CACHEABLE, OrmV2_0Package.eINSTANCE.getXmlCacheable_2_0_Cacheable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReadOnlyTranslator() {
- return new Translator(EclipseLink.READ_ONLY, EclipseLinkOrmPackage.eINSTANCE.getXmlReadOnly_ReadOnly(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildExistenceCheckingTranslator() {
- return new Translator(EclipseLink.EXISTENCE_CHECKING, EclipseLinkOrmPackage.eINSTANCE.getXmlCacheHolder_ExistenceChecking(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildExcludeDefaultMappingsTranslator() {
- return new Translator(EclipseLink.EXCLUDE_DEFAULT_MAPPINGS, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_ExcludeDefaultMappings(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCustomizerTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink.CUSTOMIZER, EclipseLinkOrmPackage.eINSTANCE.getXmlCustomizerHolder_Customizer());
- }
-
- protected static Translator buildChangeTrackingTranslator() {
- return XmlChangeTracking.buildTranslator(EclipseLink.CHANGE_TRACKING, EclipseLinkOrmPackage.eINSTANCE.getXmlChangeTrackingHolder_ChangeTracking());
- }
-
- protected static Translator buildPrimaryKeyTranslator() {
- return XmlPrimaryKey.buildTranslator(EclipseLink1_1.PRIMARY_KEY, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlMappedSuperclass_1_1_PrimaryKey());
- }
-
- protected static Translator buildOptimisticLockingTranslator() {
- return XmlOptimisticLocking.buildTranslator(EclipseLink.OPTIMISTIC_LOCKING, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_OptimisticLocking());
- }
-
- protected static Translator buildCacheTranslator() {
- return XmlCache.buildTranslator(EclipseLink.CACHE, EclipseLinkOrmPackage.eINSTANCE.getXmlCacheHolder_Cache());
- }
-
- protected static Translator buildCacheInterceptorTranslator() {
- return XmlClassReference.buildTranslator(EclipseLink2_0.CACHE_INTERCEPTOR, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlMappedSuperclass_2_0_CacheInterceptor());
- }
-
- protected static Translator buildCacheIndexTranslator() {
- return XmlCacheIndex.buildTranslator(EclipseLink2_4.CACHE_INDEX, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlMappedSuperclass_2_4_CacheIndex());
- }
-
- protected static Translator buildFetchGroupsTranslator() {
- return XmlFetchGroup.buildTranslator(EclipseLink2_1.FETCH_GROUP, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlFetchGroupContainer_2_1_FetchGroups());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters());
- }
-
- protected static Translator buildCopyPolicyTranslator() {
- return XmlCopyPolicy.buildTranslator(EclipseLink.COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_CopyPolicy());
- }
-
- protected static Translator buildInstantiationCoypPolicyTranslator() {
- return XmlInstantiationCopyPolicy.buildTranslator(EclipseLink.INSTANTIATION_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_InstantiationCopyPolicy());
- }
-
- protected static Translator buildCloneCopyPolicyTranslator() {
- return XmlCloneCopyPolicy.buildTranslator(EclipseLink.CLONE_COPY_POLICY, EclipseLinkOrmPackage.eINSTANCE.getXmlMappedSuperclass_CloneCopyPolicy());
- }
-
- protected static Translator buildSequenceGeneratorTranslator() {
- return XmlSequenceGenerator.buildTranslator(JPA.SEQUENCE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_SequenceGenerator());
- }
-
- protected static Translator buildTableGeneratorTranslator() {
- return org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator.buildTranslator(JPA.TABLE_GENERATOR, OrmPackage.eINSTANCE.getXmlGeneratorContainer_TableGenerator());
- }
-
- protected static Translator buildNamedQueryTranslator() {
- return XmlNamedQuery.buildTranslator(JPA.NAMED_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedQueries());
- }
-
- protected static Translator buildNamedNativeQueryTranslator() {
- return XmlNamedNativeQuery.buildTranslator(JPA.NAMED_NATIVE_QUERY, OrmPackage.eINSTANCE.getXmlQueryContainer_NamedNativeQueries());
- }
-
- protected static Translator buildNamedStoredProcedureQueryTranslator() {
- return XmlNamedStoredProcedureQuery.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY, EclipseLinkOrmPackage.eINSTANCE.getXmlQueryContainer_NamedStoredProcedureQueries());
- }
-
- protected static Translator buildSqlResultSetMappingTranslator() {
- return SqlResultSetMapping.buildTranslator(JPA.SQL_RESULT_SET_MAPPING, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlMappedSuperclass_2_1_SqlResultSetMappings());
- }
-
- protected static Translator buildQueryRedirectorsTranslator() {
- return XmlQueryRedirectors.buildTranslator(EclipseLink2_0.QUERY_REDIRECTORS, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlMappedSuperclass_2_1_QueryRedirectors());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAttributeOverrideTranslator() {
- return XmlAttributeOverride.buildTranslator(JPA.ATTRIBUTE_OVERRIDE, OrmPackage.eINSTANCE.getXmlAttributeOverrideContainer_AttributeOverrides());
- }
-
- protected static Translator buildAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(JPA.ASSOCIATION_OVERRIDE, OrmPackage.eINSTANCE.getXmlAssociationOverrideContainer_AssociationOverrides());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildParentClassTranslator() {
- return new Translator(EclipseLink2_1.PARENT_CLASS, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlTypeMapping_2_1_ParentClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildAdditionalCriteriaTranslator() {
- return XmlAdditionalCriteria.buildTranslator(EclipseLink2_2.ADDITIONAL_CRITERIA, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlMappedSuperclass_2_2_AdditionalCriteria());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java
deleted file mode 100644
index f4fa82820c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenant.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Multitenant</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant()
- * @model kind="class"
- * @generated
- */
-public class XmlMultitenant extends AbstractJpaEObject implements XmlMultitenant_2_3, XmlMultitenant_2_4
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final MultitenantType TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected MultitenantType type = TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getTenantDiscriminatorColumns() <em>Tenant Discriminator Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTenantDiscriminatorColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlTenantDiscriminatorColumn_2_3> tenantDiscriminatorColumns;
-
- /**
- * The default value of the '{@link #getIncludeCriteria() <em>Include Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIncludeCriteria()
- * @generated
- * @ordered
- */
- protected static final Boolean INCLUDE_CRITERIA_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getIncludeCriteria() <em>Include Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIncludeCriteria()
- * @generated
- * @ordered
- */
- protected Boolean includeCriteria = INCLUDE_CRITERIA_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlMultitenant()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_MULTITENANT;
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see #setType(MultitenantType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant_2_3_Type()
- * @model
- * @generated
- */
- public MultitenantType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see #getType()
- * @generated
- */
- public void setType(MultitenantType newType)
- {
- MultitenantType oldType = type;
- type = newType == null ? TYPE_EDEFAULT : newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MULTITENANT__TYPE, oldType, type));
- }
-
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns()
- {
- if (tenantDiscriminatorColumns == null)
- {
- tenantDiscriminatorColumns = new EObjectContainmentEList<XmlTenantDiscriminatorColumn_2_3>(XmlTenantDiscriminatorColumn_2_3.class, this, EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS);
- }
- return tenantDiscriminatorColumns;
- }
-
- /**
- * Returns the value of the '<em><b>Include Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Include Criteria</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Include Criteria</em>' attribute.
- * @see #setIncludeCriteria(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenant_2_4_IncludeCriteria()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getIncludeCriteria()
- {
- return includeCriteria;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant#getIncludeCriteria <em>Include Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Include Criteria</em>' attribute.
- * @see #getIncludeCriteria()
- * @generated
- */
- public void setIncludeCriteria(Boolean newIncludeCriteria)
- {
- Boolean oldIncludeCriteria = includeCriteria;
- includeCriteria = newIncludeCriteria;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA, oldIncludeCriteria, includeCriteria));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- return ((InternalEList<?>)getTenantDiscriminatorColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE:
- return getType();
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- return getTenantDiscriminatorColumns();
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA:
- return getIncludeCriteria();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE:
- setType((MultitenantType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- getTenantDiscriminatorColumns().addAll((Collection<? extends XmlTenantDiscriminatorColumn_2_3>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA:
- setIncludeCriteria((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- return;
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA:
- setIncludeCriteria(INCLUDE_CRITERIA_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__TYPE:
- return type != TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_MULTITENANT__TENANT_DISCRIMINATOR_COLUMNS:
- return tenantDiscriminatorColumns != null && !tenantDiscriminatorColumns.isEmpty();
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA:
- return INCLUDE_CRITERIA_EDEFAULT == null ? includeCriteria != null : !INCLUDE_CRITERIA_EDEFAULT.equals(includeCriteria);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMultitenant_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA: return EclipseLinkOrmV2_4Package.XML_MULTITENANT_24__INCLUDE_CRITERIA;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMultitenant_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_MULTITENANT_24__INCLUDE_CRITERIA: return EclipseLinkOrmPackage.XML_MULTITENANT__INCLUDE_CRITERIA;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (type: ");
- result.append(type);
- result.append(", includeCriteria: ");
- result.append(includeCriteria);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getIncludeCriteriaTextRange() {
- return getAttributeTextRange(EclipseLink2_4.MULTITENANT__INCLUDE_CRITERIA);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlMultitenant(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildTypeTranslator(),
- buildIncludeCriteriaTranslator(),
- buildTenantDiscriminatorColumnsTranslator()
- };
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink2_3.MULTITENANT__TYPE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMultitenant_2_3_Type(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTenantDiscriminatorColumnsTranslator() {
- return XmlTenantDiscriminatorColumn.buildTranslator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlMultitenant_2_3_TenantDiscriminatorColumns());
- }
-
- protected static Translator buildIncludeCriteriaTranslator() {
- return new Translator(EclipseLink2_4.MULTITENANT__INCLUDE_CRITERIA, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlMultitenant_2_4_IncludeCriteria(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlMultitenant
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenantHolder.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenantHolder.java
deleted file mode 100644
index 02bcea382f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMultitenantHolder.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Multitenant Holder</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder#getMultitenant <em>Multitenant</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMultitenantHolder extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Multitenant</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Multitenant</em>' containment reference.
- * @see #setMultitenant(XmlMultitenant)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMultitenantHolder_Multitenant()
- * @model containment="true"
- * @generated
- */
- XmlMultitenant getMultitenant();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder#getMultitenant <em>Multitenant</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Multitenant</em>' containment reference.
- * @see #getMultitenant()
- * @generated
- */
- void setMultitenant(XmlMultitenant value);
-
-} // XmlMultitenantHolder
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMutable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMutable.java
deleted file mode 100644
index 8d79dbdb82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlMutable.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Mutable</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable#getMutable <em>Mutable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMutable extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mutable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mutable</em>' attribute.
- * @see #setMutable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable_Mutable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getMutable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMutable#getMutable <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mutable</em>' attribute.
- * @see #getMutable()
- * @generated
- */
- void setMutable(Boolean value);
-
- /**
- * Return the {@link TextRange} for the mutable attibute.
- */
- TextRange getMutableTextRange();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedConverter.java
deleted file mode 100644
index 04602b05dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedConverter.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Named Converter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlNamedConverter extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedConverter_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedConverter#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_CONVERTER__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getNameTextRange() {
- return getAttributeTextRange(JPA.NAME);
- }
-
- // ********** translators **********
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink.CONVERTER__NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedConverter_Name(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlNamedConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredFunctionQuery.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredFunctionQuery.java
deleted file mode 100644
index d408d33c2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredFunctionQuery.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Plsql Stored Function Query</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredFunctionQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedPlsqlStoredFunctionQuery extends AbstractJpaEObject implements XmlNamedPlsqlStoredFunctionQuery_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedPlsqlStoredFunctionQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredFunctionQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredFunctionQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlNamedPlsqlStoredFunctionQuery
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredProcedureQuery.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredProcedureQuery.java
deleted file mode 100644
index 50af5ce82d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedPlsqlStoredProcedureQuery.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Plsql Stored Procedure Query</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredProcedureQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedPlsqlStoredProcedureQuery extends AbstractJpaEObject implements XmlNamedPlsqlStoredProcedureQuery_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedPlsqlStoredProcedureQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedPlsqlStoredProcedureQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedPlsqlStoredProcedureQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlNamedPlsqlStoredProcedureQuery
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredFunctionQuery.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredFunctionQuery.java
deleted file mode 100644
index 771ec817ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredFunctionQuery.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Stored Function Query</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredFunctionQuery()
- * @model kind="class"
- * @generated
- */
-public class XmlNamedStoredFunctionQuery extends AbstractJpaEObject implements XmlNamedStoredFunctionQuery_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedStoredFunctionQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_STORED_FUNCTION_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredFunctionQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredFunctionQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_FUNCTION_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredFunctionQuery(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.NAMED_STORED_FUNCTION_QUERY__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlNamedStoredFunctionQuery_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlNamedStoredFunctionQuery
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java
deleted file mode 100644
index 12be339a21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlNamedStoredProcedureQuery.java
+++ /dev/null
@@ -1,644 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Stored Procedure Query</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultClass <em>Result Class</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultSetMapping <em>Result Set Mapping</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getProcedureName <em>Procedure Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getReturnsResultSet <em>Returns Result Set</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getHints <em>Hints</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getParameters <em>Parameters</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlNamedStoredProcedureQuery extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getResultClass() <em>Result Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultClass()
- * @generated
- * @ordered
- */
- protected static final String RESULT_CLASS_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getResultClass() <em>Result Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultClass()
- * @generated
- * @ordered
- */
- protected String resultClass = RESULT_CLASS_EDEFAULT;
-
- /**
- * The default value of the '{@link #getResultSetMapping() <em>Result Set Mapping</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultSetMapping()
- * @generated
- * @ordered
- */
- protected static final String RESULT_SET_MAPPING_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getResultSetMapping() <em>Result Set Mapping</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getResultSetMapping()
- * @generated
- * @ordered
- */
- protected String resultSetMapping = RESULT_SET_MAPPING_EDEFAULT;
-
- /**
- * The default value of the '{@link #getProcedureName() <em>Procedure Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProcedureName()
- * @generated
- * @ordered
- */
- protected static final String PROCEDURE_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getProcedureName() <em>Procedure Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProcedureName()
- * @generated
- * @ordered
- */
- protected String procedureName = PROCEDURE_NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getReturnsResultSet() <em>Returns Result Set</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnsResultSet()
- * @generated
- * @ordered
- */
- protected static final Boolean RETURNS_RESULT_SET_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReturnsResultSet() <em>Returns Result Set</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnsResultSet()
- * @generated
- * @ordered
- */
- protected Boolean returnsResultSet = RETURNS_RESULT_SET_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getHints() <em>Hints</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHints()
- * @generated
- * @ordered
- */
- protected EList<XmlQueryHint> hints;
-
- /**
- * The cached value of the '{@link #getParameters() <em>Parameters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getParameters()
- * @generated
- * @ordered
- */
- protected EList<XmlStoredProcedureParameter> parameters;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlNamedStoredProcedureQuery()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_NAMED_STORED_PROCEDURE_QUERY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Result Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Result Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Result Class</em>' attribute.
- * @see #setResultClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_ResultClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getResultClass()
- {
- return resultClass;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultClass <em>Result Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Result Class</em>' attribute.
- * @see #getResultClass()
- * @generated
- */
- public void setResultClass(String newResultClass)
- {
- String oldResultClass = resultClass;
- resultClass = newResultClass;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS, oldResultClass, resultClass));
- }
-
- /**
- * Returns the value of the '<em><b>Result Set Mapping</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Result Set Mapping</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Result Set Mapping</em>' attribute.
- * @see #setResultSetMapping(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_ResultSetMapping()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getResultSetMapping()
- {
- return resultSetMapping;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getResultSetMapping <em>Result Set Mapping</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Result Set Mapping</em>' attribute.
- * @see #getResultSetMapping()
- * @generated
- */
- public void setResultSetMapping(String newResultSetMapping)
- {
- String oldResultSetMapping = resultSetMapping;
- resultSetMapping = newResultSetMapping;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING, oldResultSetMapping, resultSetMapping));
- }
-
- /**
- * Returns the value of the '<em><b>Procedure Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Procedure Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Procedure Name</em>' attribute.
- * @see #setProcedureName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_ProcedureName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getProcedureName()
- {
- return procedureName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getProcedureName <em>Procedure Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Procedure Name</em>' attribute.
- * @see #getProcedureName()
- * @generated
- */
- public void setProcedureName(String newProcedureName)
- {
- String oldProcedureName = procedureName;
- procedureName = newProcedureName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME, oldProcedureName, procedureName));
- }
-
- /**
- * Returns the value of the '<em><b>Returns Result Set</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Returns Result Set</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Returns Result Set</em>' attribute.
- * @see #setReturnsResultSet(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_ReturnsResultSet()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReturnsResultSet()
- {
- return returnsResultSet;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery#getReturnsResultSet <em>Returns Result Set</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Returns Result Set</em>' attribute.
- * @see #getReturnsResultSet()
- * @generated
- */
- public void setReturnsResultSet(Boolean newReturnsResultSet)
- {
- Boolean oldReturnsResultSet = returnsResultSet;
- returnsResultSet = newReturnsResultSet;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET, oldReturnsResultSet, returnsResultSet));
- }
-
- /**
- * Returns the value of the '<em><b>Hints</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hints</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hints</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_Hints()
- * @model containment="true"
- * @generated
- */
- public EList<XmlQueryHint> getHints()
- {
- if (hints == null)
- {
- hints = new EObjectContainmentEList<XmlQueryHint>(XmlQueryHint.class, this, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS);
- }
- return hints;
- }
-
- /**
- * Returns the value of the '<em><b>Parameters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parameters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parameters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlNamedStoredProcedureQuery_Parameters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStoredProcedureParameter> getParameters()
- {
- if (parameters == null)
- {
- parameters = new EObjectContainmentEList<XmlStoredProcedureParameter>(XmlStoredProcedureParameter.class, this, EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS);
- }
- return parameters;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- return ((InternalEList<?>)getHints()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- return ((InternalEList<?>)getParameters()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS:
- return getResultClass();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING:
- return getResultSetMapping();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME:
- return getProcedureName();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET:
- return getReturnsResultSet();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- return getHints();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- return getParameters();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS:
- setResultClass((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING:
- setResultSetMapping((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME:
- setProcedureName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET:
- setReturnsResultSet((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- getHints().clear();
- getHints().addAll((Collection<? extends XmlQueryHint>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- getParameters().clear();
- getParameters().addAll((Collection<? extends XmlStoredProcedureParameter>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS:
- setResultClass(RESULT_CLASS_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING:
- setResultSetMapping(RESULT_SET_MAPPING_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME:
- setProcedureName(PROCEDURE_NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET:
- setReturnsResultSet(RETURNS_RESULT_SET_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- getHints().clear();
- return;
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- getParameters().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS:
- return RESULT_CLASS_EDEFAULT == null ? resultClass != null : !RESULT_CLASS_EDEFAULT.equals(resultClass);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING:
- return RESULT_SET_MAPPING_EDEFAULT == null ? resultSetMapping != null : !RESULT_SET_MAPPING_EDEFAULT.equals(resultSetMapping);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME:
- return PROCEDURE_NAME_EDEFAULT == null ? procedureName != null : !PROCEDURE_NAME_EDEFAULT.equals(procedureName);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET:
- return RETURNS_RESULT_SET_EDEFAULT == null ? returnsResultSet != null : !RETURNS_RESULT_SET_EDEFAULT.equals(returnsResultSet);
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__HINTS:
- return hints != null && !hints.isEmpty();
- case EclipseLinkOrmPackage.XML_NAMED_STORED_PROCEDURE_QUERY__PARAMETERS:
- return parameters != null && !parameters.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", resultClass: ");
- result.append(resultClass);
- result.append(", resultSetMapping: ");
- result.append(resultSetMapping);
- result.append(", procedureName: ");
- result.append(procedureName);
- result.append(", returnsResultSet: ");
- result.append(returnsResultSet);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildResultClassTranslator(),
- buildResultSetMappingTranslator(),
- buildProcedureNameTranslator(),
- buildReturnResultSetTranslator(),
- buildHintTranslator(),
- buildParameterTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildResultClassTranslator() {
- return new Translator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__RESULT_CLASS, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_ResultClass(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildResultSetMappingTranslator() {
- return new Translator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__RESULT_SET_MAPPING, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_ResultSetMapping(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildProcedureNameTranslator() {
- return new Translator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__PROCEDURE_NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_ProcedureName(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReturnResultSetTranslator() {
- return new BooleanTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__RETURNS_RESULT_SET, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_ReturnsResultSet(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildHintTranslator() {
- return XmlQueryHint.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__HINT, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_Hints());
- }
-
- protected static Translator buildParameterTranslator() {
- return XmlStoredProcedureParameter.buildTranslator(EclipseLink.NAMED_STORED_PROCEDURE_QUERY__PARAMETER, EclipseLinkOrmPackage.eINSTANCE.getXmlNamedStoredProcedureQuery_Parameters());
- }
-} // XmlNamedStoredProcedureQuery
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlObjectTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlObjectTypeConverter.java
deleted file mode 100644
index 003aa315bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlObjectTypeConverter.java
+++ /dev/null
@@ -1,487 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Object Type CustomConverter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDataType <em>Data Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getObjectType <em>Object Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getConversionValues <em>Conversion Values</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDefaultObjectValue <em>Default Object Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter()
- * @model kind="class"
- * @generated
- */
-public class XmlObjectTypeConverter extends XmlNamedConverter
-{
- /**
- * The default value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataType()
- * @generated
- * @ordered
- */
- protected static final String DATA_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataType()
- * @generated
- * @ordered
- */
- protected String dataType = DATA_TYPE_EDEFAULT;
- /**
- * The default value of the '{@link #getObjectType() <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectType()
- * @generated
- * @ordered
- */
- protected static final String OBJECT_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getObjectType() <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectType()
- * @generated
- * @ordered
- */
- protected String objectType = OBJECT_TYPE_EDEFAULT;
- /**
- * The cached value of the '{@link #getConversionValues() <em>Conversion Values</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConversionValues()
- * @generated
- * @ordered
- */
- protected EList<XmlConversionValue> conversionValues;
- /**
- * The default value of the '{@link #getDefaultObjectValue() <em>Default Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDefaultObjectValue()
- * @generated
- * @ordered
- */
- protected static final String DEFAULT_OBJECT_VALUE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getDefaultObjectValue() <em>Default Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDefaultObjectValue()
- * @generated
- * @ordered
- */
- protected String defaultObjectValue = DEFAULT_OBJECT_VALUE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlObjectTypeConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_OBJECT_TYPE_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Data Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Data Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Data Type</em>' attribute.
- * @see #setDataType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_DataType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDataType()
- {
- return dataType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDataType <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Data Type</em>' attribute.
- * @see #getDataType()
- * @generated
- */
- public void setDataType(String newDataType)
- {
- String oldDataType = dataType;
- dataType = newDataType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE, oldDataType, dataType));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type</em>' attribute.
- * @see #setObjectType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_ObjectType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getObjectType()
- {
- return objectType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getObjectType <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type</em>' attribute.
- * @see #getObjectType()
- * @generated
- */
- public void setObjectType(String newObjectType)
- {
- String oldObjectType = objectType;
- objectType = newObjectType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE, oldObjectType, objectType));
- }
-
- /**
- * Returns the value of the '<em><b>Conversion Values</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Conversion Values</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Conversion Values</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_ConversionValues()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConversionValue> getConversionValues()
- {
- if (conversionValues == null)
- {
- conversionValues = new EObjectContainmentEList<XmlConversionValue>(XmlConversionValue.class, this, EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES);
- }
- return conversionValues;
- }
-
- /**
- * Returns the value of the '<em><b>Default Object Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Default Object Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Default Object Value</em>' attribute.
- * @see #setDefaultObjectValue(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlObjectTypeConverter_DefaultObjectValue()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDefaultObjectValue()
- {
- return defaultObjectValue;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter#getDefaultObjectValue <em>Default Object Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Default Object Value</em>' attribute.
- * @see #getDefaultObjectValue()
- * @generated
- */
- public void setDefaultObjectValue(String newDefaultObjectValue)
- {
- String oldDefaultObjectValue = defaultObjectValue;
- defaultObjectValue = newDefaultObjectValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, oldDefaultObjectValue, defaultObjectValue));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- return ((InternalEList<?>)getConversionValues()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE:
- return getDataType();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE:
- return getObjectType();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- return getConversionValues();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE:
- return getDefaultObjectValue();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE:
- setDataType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE:
- setObjectType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- getConversionValues().clear();
- getConversionValues().addAll((Collection<? extends XmlConversionValue>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE:
- setDefaultObjectValue((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE:
- setDataType(DATA_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE:
- setObjectType(OBJECT_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- getConversionValues().clear();
- return;
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE:
- setDefaultObjectValue(DEFAULT_OBJECT_VALUE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DATA_TYPE:
- return DATA_TYPE_EDEFAULT == null ? dataType != null : !DATA_TYPE_EDEFAULT.equals(dataType);
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__OBJECT_TYPE:
- return OBJECT_TYPE_EDEFAULT == null ? objectType != null : !OBJECT_TYPE_EDEFAULT.equals(objectType);
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__CONVERSION_VALUES:
- return conversionValues != null && !conversionValues.isEmpty();
- case EclipseLinkOrmPackage.XML_OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE:
- return DEFAULT_OBJECT_VALUE_EDEFAULT == null ? defaultObjectValue != null : !DEFAULT_OBJECT_VALUE_EDEFAULT.equals(defaultObjectValue);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (dataType: ");
- result.append(dataType);
- result.append(", objectType: ");
- result.append(objectType);
- result.append(", defaultObjectValue: ");
- result.append(defaultObjectValue);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildConversionValueTranslator(),
- buildDefaultObjectValueTranslator(),
- buildNameTranslator(),
- buildDataTypeTranslator(),
- buildObjectTypeTranslator(),
- };
- }
-
- protected static Translator buildConversionValueTranslator() {
- return XmlConversionValue.buildTranslator(EclipseLink.CONVERSION_VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlObjectTypeConverter_ConversionValues());
- }
-
- protected static Translator buildDefaultObjectValueTranslator() {
- return new Translator(EclipseLink.OBJECT_TYPE_CONVERTER__DEFAULT_OBJECT_VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlObjectTypeConverter_DefaultObjectValue());
- }
-
- protected static Translator buildDataTypeTranslator() {
- return new Translator(EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlObjectTypeConverter_DataType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildObjectTypeTranslator() {
- return new Translator(EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlObjectTypeConverter_ObjectType(), Translator.DOM_ATTRIBUTE);
- }
-
-
- // ********** refactoring **********
-
- public ReplaceEdit createRenameDataTypeEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.dataType.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenameDataTypePackageEdit(String newPackageName) {
- int packageLength = this.dataType.lastIndexOf('.');
- if (newPackageName == "") {//$NON-NLS-1$
- //moving to the default package, remove the '.'
- packageLength++;
- }
- if (packageLength == -1) {
- //moving from the default package or unspecified package
- packageLength = 0;
- newPackageName = newPackageName + '.';
- }
- int offset = getAttributeNode(EclipseLink.OBJECT_TYPE_CONVERTER__DATA_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newPackageName);
- }
-
- public ReplaceEdit createRenameObjectTypeEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.objectType.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenameObjectTypePackageEdit(String newPackageName) {
- int packageLength = this.objectType.lastIndexOf('.');
- if (newPackageName == "") {//$NON-NLS-1$
- //moving to the default package, remove the '.'
- packageLength++;
- }
- if (packageLength == -1) {
- //moving from the default package or unspecified package
- packageLength = 0;
- newPackageName = newPackageName + '.';
- }
- int offset = getAttributeNode(EclipseLink.OBJECT_TYPE_CONVERTER__OBJECT_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newPackageName);
- }
-
-} // XmlObjectTypeConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java
deleted file mode 100644
index efd291dee1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToMany.java
+++ /dev/null
@@ -1,2220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLink2_4;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml One To Many</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToMany extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany implements XmlOneToMany_2_0, XmlOneToMany_2_1, XmlOneToMany_2_2, XmlOneToMany_2_4, XmlAttributeMapping, XmlPrivateOwned, XmlJoinFetch
-{
- /**
- * The cached value of the '{@link #getMapKeyAssociationOverrides() <em>Map Key Association Overrides</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyAssociationOverrides()
- * @generated
- * @ordered
- */
- protected EList<XmlAssociationOverride> mapKeyAssociationOverrides;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * The default value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected static final String MAP_KEY_CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMapKeyConvert() <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMapKeyConvert()
- * @generated
- * @ordered
- */
- protected String mapKeyConvert = MAP_KEY_CONVERT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNoncacheable() <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNoncacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NONCACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNoncacheable() <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNoncacheable()
- * @generated
- * @ordered
- */
- protected boolean noncacheable = NONCACHEABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isDeleteAll() <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeleteAll()
- * @generated
- * @ordered
- */
- protected static final boolean DELETE_ALL_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isDeleteAll() <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isDeleteAll()
- * @generated
- * @ordered
- */
- protected boolean deleteAll = DELETE_ALL_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isPrivateOwned()
- * @generated
- * @ordered
- */
- protected static final boolean PRIVATE_OWNED_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isPrivateOwned()
- * @generated
- * @ordered
- */
- protected boolean privateOwned = PRIVATE_OWNED_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOneToMany()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ONE_TO_MANY;
- }
-
- /**
- * Returns the value of the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Private Owned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Private Owned</em>' attribute.
- * @see #setPrivateOwned(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned_PrivateOwned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isPrivateOwned()
- {
- return privateOwned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#isPrivateOwned <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Private Owned</em>' attribute.
- * @see #isPrivateOwned()
- * @generated
- */
- public void setPrivateOwned(boolean newPrivateOwned)
- {
- boolean oldPrivateOwned = privateOwned;
- privateOwned = newPrivateOwned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED, oldPrivateOwned, privateOwned));
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- * @model containment="true"
- * @generated
- */
- public EList<XmlAssociationOverride> getMapKeyAssociationOverrides()
- {
- if (mapKeyAssociationOverrides == null)
- {
- mapKeyAssociationOverrides = new EObjectContainmentEList<XmlAssociationOverride>(XmlAssociationOverride.class, this, EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES);
- }
- return mapKeyAssociationOverrides;
- }
-
- /**
- * Returns the value of the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Convert</em>' attribute.
- * @see #setMapKeyConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getMapKeyConvert()
- {
- return mapKeyConvert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getMapKeyConvert <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Convert</em>' attribute.
- * @see #getMapKeyConvert()
- * @generated
- */
- public void setMapKeyConvert(String newMapKeyConvert)
- {
- String oldMapKeyConvert = mapKeyConvert;
- mapKeyConvert = newMapKeyConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT, oldMapKeyConvert, mapKeyConvert));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Noncacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Noncacheable</em>' attribute.
- * @see #setNoncacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany_2_2_Noncacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNoncacheable()
- {
- return noncacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#isNoncacheable <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Noncacheable</em>' attribute.
- * @see #isNoncacheable()
- * @generated
- */
- public void setNoncacheable(boolean newNoncacheable)
- {
- boolean oldNoncacheable = noncacheable;
- noncacheable = newNoncacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE, oldNoncacheable, noncacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete All</em>' attribute.
- * @see #setDeleteAll(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToMany_2_4_DeleteAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isDeleteAll()
- {
- return deleteAll;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#isDeleteAll <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete All</em>' attribute.
- * @see #isDeleteAll()
- * @generated
- */
- public void setDeleteAll(boolean newDeleteAll)
- {
- boolean oldDeleteAll = deleteAll;
- deleteAll = newDeleteAll;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL, oldDeleteAll, deleteAll));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return ((InternalEList<?>)getMapKeyAssociationOverrides()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTERS:
- return ((InternalEList<?>)getStructConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return getMapKeyAssociationOverrides();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTERS:
- return getStructConverters();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT:
- return getMapKeyConvert();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE:
- return isNoncacheable();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL:
- return isDeleteAll();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED:
- return isPrivateOwned();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH:
- return getJoinFetch();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- getMapKeyAssociationOverrides().addAll((Collection<? extends XmlAssociationOverride>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- getStructConverters().addAll((Collection<? extends XmlStructConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT:
- setMapKeyConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE:
- setNoncacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL:
- setDeleteAll((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED:
- setPrivateOwned((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- getMapKeyAssociationOverrides().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTERS:
- getStructConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT:
- setMapKeyConvert(MAP_KEY_CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE:
- setNoncacheable(NONCACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL:
- setDeleteAll(DELETE_ALL_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED:
- setPrivateOwned(PRIVATE_OWNED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES:
- return mapKeyAssociationOverrides != null && !mapKeyAssociationOverrides.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTERS:
- return structConverters != null && !structConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT:
- return MAP_KEY_CONVERT_EDEFAULT == null ? mapKeyConvert != null : !MAP_KEY_CONVERT_EDEFAULT.equals(mapKeyConvert);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE:
- return noncacheable != NONCACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL:
- return deleteAll != DELETE_ALL_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED:
- return privateOwned != PRIVATE_OWNED_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT: return EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_0.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_ONE_TO_MANY_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE: return EclipseLinkOrmV2_2Package.XML_ONE_TO_MANY_22__NONCACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_4.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL: return EclipseLinkOrmV2_4Package.XML_ONE_TO_MANY_24__DELETE_ALL;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPrivateOwned.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlMapKeyAssociationOverrideContainer_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_ASSOCIATION_OVERRIDES;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__STRUCT_CONVERTERS;
- default: return -1;
- }
- }
- if (baseClass == XmlCollectionMapping_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__MAP_KEY_CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_0.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ONE_TO_MANY_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_ONE_TO_MANY_22__NONCACHEABLE: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__NONCACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToMany_2_4.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_4Package.XML_ONE_TO_MANY_24__DELETE_ALL: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__DELETE_ALL;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPrivateOwned.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_MANY__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (mapKeyConvert: ");
- result.append(mapKeyConvert);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", noncacheable: ");
- result.append(noncacheable);
- result.append(", deleteAll: ");
- result.append(deleteAll);
- result.append(", attributeType: ");
- result.append(attributeType);
- result.append(", privateOwned: ");
- result.append(privateOwned);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getPrivateOwnedTextRange() {
- return getElementTextRange(EclipseLink.PRIVATE_OWNED);
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlOneToMany(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildAccessTranslator(),
- buildMappedByTranslator(),
- buildOrphanRemovalTranslator(),
- buildAttributeTypeTranslator(),
- buildOrderByTranslator(),
- XmlOrderColumn.buildTranslator(JPA2_0.ORDER_COLUMN, OrmV2_0Package.eINSTANCE.getXmlOrderable_2_0_OrderColumn()),
- buildMapKeyTranslator(),
- buildMapKeyClassTranslator(),
- buildMapKeyTemporalTranslator(),
- buildMapKeyEnumeratedTranslator(),
- buildMapKeyConvertTranslator(),
- buildMapKeyAttributeOverrideTranslator(),
- buildMapKeyAssociationOverrideTranslator(),
- buildMapKeyColumnTranslator(),
- buildMapKeyJoinColumnTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildJoinTableTranslator(),
- buildJoinColumnTranslator(),
- buildCascadeTranslator(),
- buildCascadeOnDeleteTranslator(),
- buildPrivateOwnedTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- buildDeleteAllTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- };
- }
-
- protected static Translator buildMapKeyConvertTranslator() {
- return new Translator(JPA2_0.MAP_KEY_CONVERT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlCollectionMapping_2_0_MapKeyConvert());
- }
-
- protected static Translator buildMapKeyAssociationOverrideTranslator() {
- return XmlAssociationOverride.buildTranslator(EclipseLink2_0.MAP_KEY_ASSOCIATION_OVERRIDE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters());
- }
-
- protected static Translator buildPrivateOwnedTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink.PRIVATE_OWNED, EclipseLinkOrmPackage.eINSTANCE.getXmlPrivateOwned_PrivateOwned());
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlOneToMany_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableContainer_JoinTable());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlOneToMany_2_2_Noncacheable());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-
- protected static Translator buildDeleteAllTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_4.DELETE_ALL, EclipseLinkOrmV2_4Package.eINSTANCE.getXmlOneToMany_2_4_DeleteAll());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java
deleted file mode 100644
index 33abefac2a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOneToOne.java
+++ /dev/null
@@ -1,1717 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.jpa.core.resource.orm.CascadeType;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml One To One</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlOneToOne extends org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne implements XmlOneToOne_2_1, XmlOneToOne_2_2, XmlAttributeMapping, XmlPrivateOwned, XmlJoinFetch
-{
- /**
- * The cached value of the '{@link #getBatchFetch() <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getBatchFetch()
- * @generated
- * @ordered
- */
- protected XmlBatchFetch batchFetch;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_ON_DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascadeOnDelete() <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascadeOnDelete()
- * @generated
- * @ordered
- */
- protected Boolean cascadeOnDelete = CASCADE_ON_DELETE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NON_CACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected boolean nonCacheable = NON_CACHEABLE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isPrivateOwned()
- * @generated
- * @ordered
- */
- protected static final boolean PRIVATE_OWNED_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isPrivateOwned() <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isPrivateOwned()
- * @generated
- * @ordered
- */
- protected boolean privateOwned = PRIVATE_OWNED_EDEFAULT;
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlJoinFetchType JOIN_FETCH_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJoinFetch() <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJoinFetch()
- * @generated
- * @ordered
- */
- protected XmlJoinFetchType joinFetch = JOIN_FETCH_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOneToOne()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ONE_TO_ONE;
- }
-
- /**
- * Returns the value of the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch</em>' containment reference.
- * @see #setBatchFetch(XmlBatchFetch)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlBatchFetchHolder_BatchFetch()
- * @model containment="true"
- * @generated
- */
- public XmlBatchFetch getBatchFetch()
- {
- return batchFetch;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetBatchFetch(XmlBatchFetch newBatchFetch, NotificationChain msgs)
- {
- XmlBatchFetch oldBatchFetch = batchFetch;
- batchFetch = newBatchFetch;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH, oldBatchFetch, newBatchFetch);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getBatchFetch <em>Batch Fetch</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch</em>' containment reference.
- * @see #getBatchFetch()
- * @generated
- */
- public void setBatchFetch(XmlBatchFetch newBatchFetch)
- {
- if (newBatchFetch != batchFetch)
- {
- NotificationChain msgs = null;
- if (batchFetch != null)
- msgs = ((InternalEObject)batchFetch).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH, null, msgs);
- if (newBatchFetch != null)
- msgs = ((InternalEObject)newBatchFetch).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH, null, msgs);
- msgs = basicSetBatchFetch(newBatchFetch, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH, newBatchFetch, newBatchFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascadeOnDelete()
- {
- return cascadeOnDelete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- public void setCascadeOnDelete(Boolean newCascadeOnDelete)
- {
- Boolean oldCascadeOnDelete = cascadeOnDelete;
- cascadeOnDelete = newCascadeOnDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE, oldCascadeOnDelete, cascadeOnDelete));
- }
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOneToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNonCacheable()
- {
- return nonCacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- public void setNonCacheable(boolean newNonCacheable)
- {
- boolean oldNonCacheable = nonCacheable;
- nonCacheable = newNonCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE, oldNonCacheable, nonCacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Private Owned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Private Owned</em>' attribute.
- * @see #setPrivateOwned(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned_PrivateOwned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isPrivateOwned()
- {
- return privateOwned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#isPrivateOwned <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Private Owned</em>' attribute.
- * @see #isPrivateOwned()
- * @generated
- */
- public void setPrivateOwned(boolean newPrivateOwned)
- {
- boolean oldPrivateOwned = privateOwned;
- privateOwned = newPrivateOwned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED, oldPrivateOwned, privateOwned));
- }
-
- /**
- * Returns the value of the '<em><b>Join Fetch</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Join Fetch</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #setJoinFetch(XmlJoinFetchType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlJoinFetch_JoinFetch()
- * @model
- * @generated
- */
- public XmlJoinFetchType getJoinFetch()
- {
- return joinFetch;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getJoinFetch <em>Join Fetch</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Join Fetch</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType
- * @see #getJoinFetch()
- * @generated
- */
- public void setJoinFetch(XmlJoinFetchType newJoinFetch)
- {
- XmlJoinFetchType oldJoinFetch = joinFetch;
- joinFetch = newJoinFetch == null ? JOIN_FETCH_EDEFAULT : newJoinFetch;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH, oldJoinFetch, joinFetch));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- return basicSetBatchFetch(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- return getBatchFetch();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE:
- return getCascadeOnDelete();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE:
- return isNonCacheable();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED:
- return isPrivateOwned();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH:
- return getJoinFetch();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE:
- setCascadeOnDelete((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE:
- setNonCacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED:
- setPrivateOwned((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH:
- setJoinFetch((XmlJoinFetchType)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- setBatchFetch((XmlBatchFetch)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE:
- setCascadeOnDelete(CASCADE_ON_DELETE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE:
- setNonCacheable(NON_CACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED:
- setPrivateOwned(PRIVATE_OWNED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH:
- setJoinFetch(JOIN_FETCH_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH:
- return batchFetch != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE:
- return CASCADE_ON_DELETE_EDEFAULT == null ? cascadeOnDelete != null : !CASCADE_ON_DELETE_EDEFAULT.equals(cascadeOnDelete);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE:
- return nonCacheable != NON_CACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED:
- return privateOwned != PRIVATE_OWNED_EDEFAULT;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH:
- return joinFetch != JOIN_FETCH_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH: return EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE: return EclipseLinkOrmV2_2Package.XML_ONE_TO_ONE_22__CASCADE_ON_DELETE;
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE: return EclipseLinkOrmV2_2Package.XML_ONE_TO_ONE_22__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPrivateOwned.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH: return EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlBatchFetchHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__BATCH_FETCH;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlOneToOne_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_ONE_TO_ONE_22__CASCADE_ON_DELETE: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__CASCADE_ON_DELETE;
- case EclipseLinkOrmV2_2Package.XML_ONE_TO_ONE_22__NON_CACHEABLE: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__NON_CACHEABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPrivateOwned.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PRIVATE_OWNED__PRIVATE_OWNED: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__PRIVATE_OWNED;
- default: return -1;
- }
- }
- if (baseClass == XmlJoinFetch.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH: return EclipseLinkOrmPackage.XML_ONE_TO_ONE__JOIN_FETCH;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (partitioned: ");
- result.append(partitioned);
- result.append(", cascadeOnDelete: ");
- result.append(cascadeOnDelete);
- result.append(", nonCacheable: ");
- result.append(nonCacheable);
- result.append(", attributeType: ");
- result.append(attributeType);
- result.append(", privateOwned: ");
- result.append(privateOwned);
- result.append(", joinFetch: ");
- result.append(joinFetch);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getPrivateOwnedTextRange() {
- return getElementTextRange(EclipseLink.PRIVATE_OWNED);
- }
-
- public TextRange getJoinFetchTextRange() {
- return getElementTextRange(EclipseLink.JOIN_FETCH);
- }
-
- public TextRange getAttributeTypeTextRange() {
- //no attribute-type for one-to-one
- return getValidationTextRange();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlOneToOne(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetEntityTranslator(),
- buildFetchTranslator(),
- buildOptionalTranslator(),
- buildAccessTranslator(),
- buildMappedByTranslator(),
- buildOrphanRemovalTranslator(),
- buildMapsIdTranslator(),
- buildIdTranslator(),
- buildPrimaryKeyJoinColumnTranslator(),
- buildJoinColumnTranslator(),
- buildJoinTableTranslator(),
- buildCascadeTranslator(),
- buildCascadeOnDeleteTranslator(),
- buildPrivateOwnedTranslator(),
- buildJoinFetchTranslator(),
- buildBatchFetchTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator(),
- buildNoncacheableTranslator(),
- XmlPartitioning.buildTranslator(EclipseLink2_2.PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning()),
- XmlReplicationPartitioning.buildTranslator(EclipseLink2_2.REPLICATION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning()),
- XmlRoundRobinPartitioning.buildTranslator(EclipseLink2_2.ROUND_ROBIN_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning()),
- XmlPinnedPartitioning.buildTranslator(EclipseLink2_2.PINNED_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning()),
- XmlRangePartitioning.buildTranslator(EclipseLink2_2.RANGE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning()),
- XmlValuePartitioning.buildTranslator(EclipseLink2_2.VALUE_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning()),
- XmlHashPartitioning.buildTranslator(EclipseLink2_2.HASH_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning()),
- XmlUnionPartitioning.buildTranslator(EclipseLink2_2.UNION_PARTITIONING, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning()),
- buildPartitionedTranslator(),
- };
- }
-
- protected static Translator buildPrivateOwnedTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink.PRIVATE_OWNED, EclipseLinkOrmPackage.eINSTANCE.getXmlPrivateOwned_PrivateOwned());
- }
-
- protected static Translator buildJoinFetchTranslator() {
- return new Translator(EclipseLink.JOIN_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlJoinFetch_JoinFetch());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildBatchFetchTranslator() {
- return XmlBatchFetch.buildTranslator(EclipseLink2_1.BATCH_FETCH, EclipseLinkOrmPackage.eINSTANCE.getXmlBatchFetchHolder_BatchFetch());
- }
-
- protected static Translator buildCascadeOnDeleteTranslator() {
- return CascadeType.buildTranslator(EclipseLink2_2.CASCADE_ON_DELETE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlOneToOne_2_2_CascadeOnDelete());
- }
-
- protected static Translator buildJoinTableTranslator() {
- return XmlJoinTable.buildTranslator(JPA.JOIN_TABLE, OrmPackage.eINSTANCE.getXmlJoinTableContainer_JoinTable());
- }
-
- protected static Translator buildNoncacheableTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink2_2.NONCACHEABLE, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlOneToOne_2_2_NonCacheable());
- }
-
- protected static Translator buildPartitionedTranslator() {
- return new Translator(EclipseLink2_2.PARTITIONING_GROUP__PARTITIONED, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLocking.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLocking.java
deleted file mode 100644
index 2a10792549..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLocking.java
+++ /dev/null
@@ -1,373 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.BooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Optimistic Locking</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getCascade <em>Cascade</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getSelectedColumns <em>Selected Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlOptimisticLocking extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlOptimisticLockingType TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected XmlOptimisticLockingType type = TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getCascade() <em>Cascade</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected static final Boolean CASCADE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCascade() <em>Cascade</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCascade()
- * @generated
- * @ordered
- */
- protected Boolean cascade = CASCADE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getSelectedColumns() <em>Selected Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSelectedColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlColumn> selectedColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOptimisticLocking()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_OPTIMISTIC_LOCKING;
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see #setType(XmlOptimisticLockingType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking_Type()
- * @model
- * @generated
- */
- public XmlOptimisticLockingType getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLockingType
- * @see #getType()
- * @generated
- */
- public void setType(XmlOptimisticLockingType newType)
- {
- XmlOptimisticLockingType oldType = type;
- type = newType == null ? TYPE_EDEFAULT : newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE, oldType, type));
- }
-
- /**
- * Returns the value of the '<em><b>Cascade</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade</em>' attribute.
- * @see #setCascade(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking_Cascade()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getCascade()
- {
- return cascade;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOptimisticLocking#getCascade <em>Cascade</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade</em>' attribute.
- * @see #getCascade()
- * @generated
- */
- public void setCascade(Boolean newCascade)
- {
- Boolean oldCascade = cascade;
- cascade = newCascade;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE, oldCascade, cascade));
- }
-
- /**
- * Returns the value of the '<em><b>Selected Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Selected Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Selected Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLocking_SelectedColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlColumn> getSelectedColumns()
- {
- if (selectedColumns == null)
- {
- selectedColumns = new EObjectContainmentEList<XmlColumn>(XmlColumn.class, this, EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS);
- }
- return selectedColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- return ((InternalEList<?>)getSelectedColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE:
- return getType();
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE:
- return getCascade();
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- return getSelectedColumns();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE:
- setType((XmlOptimisticLockingType)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE:
- setCascade((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- getSelectedColumns().clear();
- getSelectedColumns().addAll((Collection<? extends XmlColumn>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE:
- setCascade(CASCADE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- getSelectedColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__TYPE:
- return type != TYPE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__CASCADE:
- return CASCADE_EDEFAULT == null ? cascade != null : !CASCADE_EDEFAULT.equals(cascade);
- case EclipseLinkOrmPackage.XML_OPTIMISTIC_LOCKING__SELECTED_COLUMNS:
- return selectedColumns != null && !selectedColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (type: ");
- result.append(type);
- result.append(", cascade: ");
- result.append(cascade);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildTypeTranslator(),
- buildCascadeTranslator(),
- buildSelectedColumnTranslator(),
- };
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink.OPTIMISTIC_LOCKING__TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlOptimisticLocking_Type(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCascadeTranslator() {
- return new BooleanTranslator(EclipseLink.OPTIMISTIC_LOCKING__CASCADE, EclipseLinkOrmPackage.eINSTANCE.getXmlOptimisticLocking_Cascade(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSelectedColumnTranslator() {
- return XmlColumn.buildTranslator(EclipseLink.OPTIMISTIC_LOCKING__SELECTED_COLUMN, EclipseLinkOrmPackage.eINSTANCE.getXmlOptimisticLocking_SelectedColumns());
- }
-
-} // XmlOptimisticLocking
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLockingType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLockingType.java
deleted file mode 100644
index 508934af9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOptimisticLockingType.java
+++ /dev/null
@@ -1,294 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Xml Optimistic Locking Type</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOptimisticLockingType()
- * @model
- * @generated
- */
-public enum XmlOptimisticLockingType implements Enumerator
-{
- /**
- * The '<em><b>ALL COLUMNS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ALL_COLUMNS_VALUE
- * @generated
- * @ordered
- */
- ALL_COLUMNS(0, "ALL_COLUMNS", "ALL_COLUMNS"),
-
- /**
- * The '<em><b>CHANGED COLUMNS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CHANGED_COLUMNS_VALUE
- * @generated
- * @ordered
- */
- CHANGED_COLUMNS(1, "CHANGED_COLUMNS", "CHANGED_COLUMNS"),
-
- /**
- * The '<em><b>SELECTED COLUMNS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SELECTED_COLUMNS_VALUE
- * @generated
- * @ordered
- */
- SELECTED_COLUMNS(2, "SELECTED_COLUMNS", "SELECTED_COLUMNS"),
-
- /**
- * The '<em><b>VERSION COLUMN</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #VERSION_COLUMN_VALUE
- * @generated
- * @ordered
- */
- VERSION_COLUMN(3, "VERSION_COLUMN", "VERSION_COLUMN");
-
- /**
- * The '<em><b>ALL COLUMNS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ALL COLUMNS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ALL_COLUMNS
- * @model
- * @generated
- * @ordered
- */
- public static final int ALL_COLUMNS_VALUE = 0;
-
- /**
- * The '<em><b>CHANGED COLUMNS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CHANGED COLUMNS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CHANGED_COLUMNS
- * @model
- * @generated
- * @ordered
- */
- public static final int CHANGED_COLUMNS_VALUE = 1;
-
- /**
- * The '<em><b>SELECTED COLUMNS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SELECTED COLUMNS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SELECTED_COLUMNS
- * @model
- * @generated
- * @ordered
- */
- public static final int SELECTED_COLUMNS_VALUE = 2;
-
- /**
- * The '<em><b>VERSION COLUMN</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>VERSION COLUMN</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #VERSION_COLUMN
- * @model
- * @generated
- * @ordered
- */
- public static final int VERSION_COLUMN_VALUE = 3;
-
- /**
- * An array of all the '<em><b>Xml Optimistic Locking Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final XmlOptimisticLockingType[] VALUES_ARRAY =
- new XmlOptimisticLockingType[]
- {
- ALL_COLUMNS,
- CHANGED_COLUMNS,
- SELECTED_COLUMNS,
- VERSION_COLUMN,
- };
-
- /**
- * A public read-only list of all the '<em><b>Xml Optimistic Locking Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<XmlOptimisticLockingType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Xml Optimistic Locking Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlOptimisticLockingType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlOptimisticLockingType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Optimistic Locking Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlOptimisticLockingType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- XmlOptimisticLockingType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Xml Optimistic Locking Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static XmlOptimisticLockingType get(int value)
- {
- switch (value)
- {
- case ALL_COLUMNS_VALUE: return ALL_COLUMNS;
- case CHANGED_COLUMNS_VALUE: return CHANGED_COLUMNS;
- case SELECTED_COLUMNS_VALUE: return SELECTED_COLUMNS;
- case VERSION_COLUMN_VALUE: return VERSION_COLUMN;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private XmlOptimisticLockingType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlOptimisticLockingType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOrderColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOrderColumn.java
deleted file mode 100644
index f6273a9229..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlOrderColumn.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Order Column</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlOrderColumn extends org.eclipse.jpt.jpa.core.resource.orm.XmlOrderColumn implements XmlOrderColumn_2_0
-{
-
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final OrderCorrectionType_2_0 CORRECTION_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCorrectionType() <em>Correction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCorrectionType()
- * @generated
- * @ordered
- */
- protected OrderCorrectionType_2_0 correctionType = CORRECTION_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlOrderColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ORDER_COLUMN;
- }
-
- /**
- * Returns the value of the '<em><b>Correction Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Correction Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Correction Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #setCorrectionType(OrderCorrectionType_2_0)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlOrderColumn_2_0_CorrectionType()
- * @model
- * @generated
- */
- public OrderCorrectionType_2_0 getCorrectionType()
- {
- return correctionType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOrderColumn#getCorrectionType <em>Correction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Correction Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #getCorrectionType()
- * @generated
- */
- public void setCorrectionType(OrderCorrectionType_2_0 newCorrectionType)
- {
- OrderCorrectionType_2_0 oldCorrectionType = correctionType;
- correctionType = newCorrectionType == null ? CORRECTION_TYPE_EDEFAULT : newCorrectionType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE, oldCorrectionType, correctionType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE:
- return getCorrectionType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE:
- setCorrectionType((OrderCorrectionType_2_0)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE:
- setCorrectionType(CORRECTION_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE:
- return correctionType != CORRECTION_TYPE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlOrderColumn_2_0.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE: return EclipseLinkOrmV2_0Package.XML_ORDER_COLUMN_20__CORRECTION_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlOrderColumn_2_0.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_0Package.XML_ORDER_COLUMN_20__CORRECTION_TYPE: return EclipseLinkOrmPackage.XML_ORDER_COLUMN__CORRECTION_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (correctionType: ");
- result.append(correctionType);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildNullableTranslator(),
- buildInsertableTranslator(),
- buildUpdatableTranslator(),
- buildColumnDefinitionTranslator(),
- buildCorrectionTypeTranslator(),
- };
- }
-
- protected static Translator buildCorrectionTypeTranslator() {
- return new Translator(EclipseLink2_0.CORRECTION_TYPE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlOrderColumn_2_0_CorrectionType(), Translator.DOM_ATTRIBUTE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPartitioning.java
deleted file mode 100644
index 314ca5d908..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPartitioning.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlPartitioning extends AbstractJpaEObject implements XmlPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java
deleted file mode 100644
index 9dedcb8ce9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitDefaults.java
+++ /dev/null
@@ -1,374 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Defaults</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistenceUnitDefaults extends org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults implements XmlPersistenceUnitDefaults_2_1, XmlPersistenceUnitDefaults_2_3
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getTenantDiscriminatorColumns() <em>Tenant Discriminator Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTenantDiscriminatorColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlTenantDiscriminatorColumn_2_3> tenantDiscriminatorColumns;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnitDefaults()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PERSISTENCE_UNIT_DEFAULTS;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns()
- {
- if (tenantDiscriminatorColumns == null)
- {
- tenantDiscriminatorColumns = new EObjectContainmentEList<XmlTenantDiscriminatorColumn_2_3>(XmlTenantDiscriminatorColumn_2_3.class, this, EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS);
- }
- return tenantDiscriminatorColumns;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- return ((InternalEList<?>)getTenantDiscriminatorColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- return getTenantDiscriminatorColumns();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- getTenantDiscriminatorColumns().addAll((Collection<? extends XmlTenantDiscriminatorColumn_2_3>)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- getTenantDiscriminatorColumns().clear();
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS:
- return tenantDiscriminatorColumns != null && !tenantDiscriminatorColumns.isEmpty();
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPersistenceUnitDefaults_2_1.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPersistenceUnitDefaults_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS: return EclipseLinkOrmV2_3Package.XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPersistenceUnitDefaults_2_1.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- if (baseClass == XmlPersistenceUnitDefaults_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS: return EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_DEFAULTS__TENANT_DISCRIMINATOR_COLUMNS;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPersistenceUnitDefaults(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildDescriptionTranslator(),
- buildSchemaTranslator(),
- buildCatalogTranslator(),
- buildDelimitedIdentifiersTranslator(),
- buildAccessTranslator(),
- buildAccessMethodsTranslator(),
- buildCascadePersistTranslator(),
- buildTenantDiscriminatorColumnsTranslator(),
- buildEntityListenersTranslator()
- };
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildTenantDiscriminatorColumnsTranslator() {
- return XmlTenantDiscriminatorColumn.buildTranslator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns());
- }
-} // XmlPersistenceUnitDefaults
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java
deleted file mode 100644
index fcec1babc6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPersistenceUnitMetadata.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.EmptyTagBooleanTranslator;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Metadata</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata#isExcludeDefaultMappings <em>Exclude Default Mappings</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata()
- * @model kind="class"
- * @generated
- */
-public class XmlPersistenceUnitMetadata extends org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata
-{
- /**
- * The default value of the '{@link #isExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected static final boolean EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isExcludeDefaultMappings() <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isExcludeDefaultMappings()
- * @generated
- * @ordered
- */
- protected boolean excludeDefaultMappings = EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPersistenceUnitMetadata()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PERSISTENCE_UNIT_METADATA;
- }
-
- /**
- * Returns the value of the '<em><b>Exclude Default Mappings</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Exclude Default Mappings</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #setExcludeDefaultMappings(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPersistenceUnitMetadata_ExcludeDefaultMappings()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isExcludeDefaultMappings()
- {
- return excludeDefaultMappings;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata#isExcludeDefaultMappings <em>Exclude Default Mappings</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Exclude Default Mappings</em>' attribute.
- * @see #isExcludeDefaultMappings()
- * @generated
- */
- public void setExcludeDefaultMappings(boolean newExcludeDefaultMappings)
- {
- boolean oldExcludeDefaultMappings = excludeDefaultMappings;
- excludeDefaultMappings = newExcludeDefaultMappings;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS, oldExcludeDefaultMappings, excludeDefaultMappings));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS:
- return isExcludeDefaultMappings();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS:
- setExcludeDefaultMappings(EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PERSISTENCE_UNIT_METADATA__EXCLUDE_DEFAULT_MAPPINGS:
- return excludeDefaultMappings != EXCLUDE_DEFAULT_MAPPINGS_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (excludeDefaultMappings: ");
- result.append(excludeDefaultMappings);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildDescriptionTranslator(),
- buildXmlMappingMetadataCompleteTranslator(),
- buildExcludeDefaultMappingsTranslator(),
- XmlPersistenceUnitDefaults.buildTranslator(JPA.PERSISTENCE_UNIT_DEFAULTS, OrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata_PersistenceUnitDefaults())
- };
- }
-
- protected static Translator buildExcludeDefaultMappingsTranslator() {
- return new EmptyTagBooleanTranslator(EclipseLink.EXCLUDE_DEFAULT_MAPPINGS, EclipseLinkOrmPackage.eINSTANCE.getXmlPersistenceUnitMetadata_ExcludeDefaultMappings());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPinnedPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPinnedPartitioning.java
deleted file mode 100644
index 49d3b010cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPinnedPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Pinned Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPinnedPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlPinnedPartitioning extends AbstractJpaEObject implements XmlPinnedPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPinnedPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PINNED_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPinnedPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPinnedPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PINNED_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPinnedPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlPinnedPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlPinnedPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlRecord.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlRecord.java
deleted file mode 100644
index 0e11f9a16e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlRecord.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Plsql Record</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlRecord()
- * @model kind="class"
- * @generated
- */
-public class XmlPlsqlRecord extends AbstractJpaEObject implements XmlPlsqlRecord_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPlsqlRecord()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PLSQL_RECORD;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlRecord_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlRecord#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_RECORD__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPlsqlRecord(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.PLSQL_RECORD__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlPlsqlRecord_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlPlsqlRecord
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlTable.java
deleted file mode 100644
index 9933871f4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPlsqlTable.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Plsql Table</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlTable()
- * @model kind="class"
- * @generated
- */
-public class XmlPlsqlTable extends AbstractJpaEObject implements XmlPlsqlTable_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPlsqlTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PLSQL_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPlsqlTable_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PLSQL_TABLE__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPlsqlTable(),
- buildTranslatorChildren());
- }
-
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.PLSQL_TABLE__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlPlsqlTable_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlPlsqlTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrimaryKey.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrimaryKey.java
deleted file mode 100644
index 6344aa61f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrimaryKey.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Primary Key</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey()
- * @model kind="class"
- * @generated
- */
-public class XmlPrimaryKey extends AbstractJpaEObject implements XmlPrimaryKey_1_1, XmlPrimaryKey_2_1
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final IdValidationType_1_1 VALIDATION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValidation() <em>Validation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValidation()
- * @generated
- * @ordered
- */
- protected IdValidationType_1_1 validation = VALIDATION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getColumns() <em>Columns</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getColumns()
- * @generated
- * @ordered
- */
- protected EList<XmlColumn> columns;
-
- /**
- * The default value of the '{@link #getCacheKeyType() <em>Cache Key Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheKeyType()
- * @generated
- * @ordered
- */
- protected static final CacheKeyType_2_1 CACHE_KEY_TYPE_EDEFAULT = CacheKeyType_2_1.ID_VALUE;
-
- /**
- * The cached value of the '{@link #getCacheKeyType() <em>Cache Key Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCacheKeyType()
- * @generated
- * @ordered
- */
- protected CacheKeyType_2_1 cacheKeyType = CACHE_KEY_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlPrimaryKey()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PRIMARY_KEY;
- }
-
- /**
- * Returns the value of the '<em><b>Validation</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Validation</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Validation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #setValidation(IdValidationType_1_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey_1_1_Validation()
- * @model
- * @generated
- */
- public IdValidationType_1_1 getValidation()
- {
- return validation;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey#getValidation <em>Validation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Validation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #getValidation()
- * @generated
- */
- public void setValidation(IdValidationType_1_1 newValidation)
- {
- IdValidationType_1_1 oldValidation = validation;
- validation = newValidation == null ? VALIDATION_EDEFAULT : newValidation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION, oldValidation, validation));
- }
-
- /**
- * Returns the value of the '<em><b>Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey_1_1_Columns()
- * @model containment="true"
- * @generated
- */
- public EList<XmlColumn> getColumns()
- {
- if (columns == null)
- {
- columns = new EObjectContainmentEList<XmlColumn>(XmlColumn.class, this, EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS);
- }
- return columns;
- }
-
- /**
- * Returns the value of the '<em><b>Cache Key Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Key Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Key Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #setCacheKeyType(CacheKeyType_2_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrimaryKey_2_1_CacheKeyType()
- * @model
- * @generated
- */
- public CacheKeyType_2_1 getCacheKeyType()
- {
- return cacheKeyType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey#getCacheKeyType <em>Cache Key Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Key Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #getCacheKeyType()
- * @generated
- */
- public void setCacheKeyType(CacheKeyType_2_1 newCacheKeyType)
- {
- CacheKeyType_2_1 oldCacheKeyType = cacheKeyType;
- cacheKeyType = newCacheKeyType == null ? CACHE_KEY_TYPE_EDEFAULT : newCacheKeyType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE, oldCacheKeyType, cacheKeyType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- return ((InternalEList<?>)getColumns()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION:
- return getValidation();
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- return getColumns();
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE:
- return getCacheKeyType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION:
- setValidation((IdValidationType_1_1)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- getColumns().clear();
- getColumns().addAll((Collection<? extends XmlColumn>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE:
- setCacheKeyType((CacheKeyType_2_1)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION:
- setValidation(VALIDATION_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- getColumns().clear();
- return;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE:
- setCacheKeyType(CACHE_KEY_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__VALIDATION:
- return validation != VALIDATION_EDEFAULT;
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__COLUMNS:
- return columns != null && !columns.isEmpty();
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE:
- return cacheKeyType != CACHE_KEY_TYPE_EDEFAULT;
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlPrimaryKey_2_1.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE: return EclipseLinkOrmV2_1Package.XML_PRIMARY_KEY_21__CACHE_KEY_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlPrimaryKey_2_1.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_1Package.XML_PRIMARY_KEY_21__CACHE_KEY_TYPE: return EclipseLinkOrmPackage.XML_PRIMARY_KEY__CACHE_KEY_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (validation: ");
- result.append(validation);
- result.append(", cacheKeyType: ");
- result.append(cacheKeyType);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlPrimaryKey(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildValidationTranslator(),
- buildCacheKeyTypeTranslator(),
- buildColumnTranslator()
- };
- }
-
- protected static Translator buildValidationTranslator() {
- return new Translator(EclipseLink1_1.PRIMARY_KEY__VALIDATION, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlPrimaryKey_1_1_Validation(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildCacheKeyTypeTranslator() {
- return new Translator(EclipseLink2_1.CACHE_KEY_TYPE, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlPrimaryKey_2_1_CacheKeyType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildColumnTranslator() {
- return XmlColumn.buildTranslator(EclipseLink1_1.PRIMARY_KEY__COLUMN, EclipseLinkOrmV1_1Package.eINSTANCE.getXmlPrimaryKey_1_1_Columns());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrivateOwned.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrivateOwned.java
deleted file mode 100644
index 98d1914012..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPrivateOwned.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Private Owned</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned#isPrivateOwned <em>Private Owned</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPrivateOwned extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Private Owned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Private Owned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Private Owned</em>' attribute.
- * @see #setPrivateOwned(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPrivateOwned_PrivateOwned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isPrivateOwned();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrivateOwned#isPrivateOwned <em>Private Owned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Private Owned</em>' attribute.
- * @see #isPrivateOwned()
- * @generated
- */
- void setPrivateOwned(boolean value);
-
- /**
- * Return the {@link TextRange} for the private-owned attibute.
- */
- TextRange getPrivateOwnedTextRange();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlProperty.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlProperty.java
deleted file mode 100644
index 7b064d3e1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlProperty.java
+++ /dev/null
@@ -1,362 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Property</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValue <em>Value</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValueType <em>Value Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlProperty extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected static final String VALUE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValue() <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValue()
- * @generated
- * @ordered
- */
- protected String value = VALUE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getValueType() <em>Value Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValueType()
- * @generated
- * @ordered
- */
- protected static final String VALUE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getValueType() <em>Value Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValueType()
- * @generated
- * @ordered
- */
- protected String valueType = VALUE_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlProperty()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_PROPERTY;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PROPERTY__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Value</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value</em>' attribute.
- * @see #setValue(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty_Value()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getValue()
- {
- return value;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValue <em>Value</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value</em>' attribute.
- * @see #getValue()
- * @generated
- */
- public void setValue(String newValue)
- {
- String oldValue = value;
- value = newValue;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PROPERTY__VALUE, oldValue, value));
- }
-
- /**
- * Returns the value of the '<em><b>Value Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Type</em>' attribute.
- * @see #setValueType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlProperty_ValueType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getValueType()
- {
- return valueType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty#getValueType <em>Value Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Type</em>' attribute.
- * @see #getValueType()
- * @generated
- */
- public void setValueType(String newValueType)
- {
- String oldValueType = valueType;
- valueType = newValueType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE, oldValueType, valueType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE:
- return getValue();
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE:
- return getValueType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE:
- setValue((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE:
- setValueType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE:
- setValue(VALUE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE:
- setValueType(VALUE_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE:
- return VALUE_EDEFAULT == null ? value != null : !VALUE_EDEFAULT.equals(value);
- case EclipseLinkOrmPackage.XML_PROPERTY__VALUE_TYPE:
- return VALUE_TYPE_EDEFAULT == null ? valueType != null : !VALUE_TYPE_EDEFAULT.equals(valueType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(", value: ");
- result.append(value);
- result.append(", valueType: ");
- result.append(valueType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildValueTranslator(),
- buildValueTypeTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink.PROPERTY__NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlProperty_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildValueTranslator() {
- return new Translator(EclipseLink.PROPERTY__VALUE, EclipseLinkOrmPackage.eINSTANCE.getXmlProperty_Value(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildValueTypeTranslator() {
- return new Translator(EclipseLink.PROPERTY__VALUE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlProperty_ValueType(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlProperty
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPropertyContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPropertyContainer.java
deleted file mode 100644
index 3eba00d2c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlPropertyContainer.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Property Container</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPropertyContainer#getProperties <em>Properties</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPropertyContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- EList<XmlProperty> getProperties();
-
-} // XmlPropertyContainer
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryContainer.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryContainer.java
deleted file mode 100644
index 4afab0cb94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryContainer.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Query Container</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer#getNamedStoredProcedureQueries <em>Named Stored Procedure Queries</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlQueryContainer extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlNamedStoredProcedureQuery}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryContainer_NamedStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedStoredProcedureQuery> getNamedStoredProcedureQueries();
-
-} // XmlQueryContainer
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryRedirectors.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryRedirectors.java
deleted file mode 100644
index a2b1e96876..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlQueryRedirectors.java
+++ /dev/null
@@ -1,654 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Query Redirectors</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors()
- * @model kind="class"
- * @generated
- */
-public class XmlQueryRedirectors extends AbstractJpaEObject implements XmlQueryRedirectors_2_0
-{
- /**
- * The default value of the '{@link #getAllQueries() <em>All Queries</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllQueries()
- * @generated
- * @ordered
- */
- protected static final String ALL_QUERIES_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAllQueries() <em>All Queries</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAllQueries()
- * @generated
- * @ordered
- */
- protected String allQueries = ALL_QUERIES_EDEFAULT;
-
- /**
- * The default value of the '{@link #getReadAll() <em>Read All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadAll()
- * @generated
- * @ordered
- */
- protected static final String READ_ALL_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReadAll() <em>Read All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadAll()
- * @generated
- * @ordered
- */
- protected String readAll = READ_ALL_EDEFAULT;
-
- /**
- * The default value of the '{@link #getReadObject() <em>Read Object</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadObject()
- * @generated
- * @ordered
- */
- protected static final String READ_OBJECT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReadObject() <em>Read Object</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReadObject()
- * @generated
- * @ordered
- */
- protected String readObject = READ_OBJECT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getReport() <em>Report</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReport()
- * @generated
- * @ordered
- */
- protected static final String REPORT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReport() <em>Report</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReport()
- * @generated
- * @ordered
- */
- protected String report = REPORT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getUpdate() <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdate()
- * @generated
- * @ordered
- */
- protected static final String UPDATE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getUpdate() <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUpdate()
- * @generated
- * @ordered
- */
- protected String update = UPDATE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getInsert() <em>Insert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsert()
- * @generated
- * @ordered
- */
- protected static final String INSERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getInsert() <em>Insert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getInsert()
- * @generated
- * @ordered
- */
- protected String insert = INSERT_EDEFAULT;
-
- /**
- * The default value of the '{@link #getDelete() <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDelete()
- * @generated
- * @ordered
- */
- protected static final String DELETE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDelete() <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDelete()
- * @generated
- * @ordered
- */
- protected String delete = DELETE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlQueryRedirectors()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_QUERY_REDIRECTORS;
- }
-
- /**
- * Returns the value of the '<em><b>All Queries</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>All Queries</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>All Queries</em>' attribute.
- * @see #setAllQueries(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_AllQueries()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAllQueries()
- {
- return allQueries;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getAllQueries <em>All Queries</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>All Queries</em>' attribute.
- * @see #getAllQueries()
- * @generated
- */
- public void setAllQueries(String newAllQueries)
- {
- String oldAllQueries = allQueries;
- allQueries = newAllQueries;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES, oldAllQueries, allQueries));
- }
-
- /**
- * Returns the value of the '<em><b>Read All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read All</em>' attribute.
- * @see #setReadAll(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_ReadAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReadAll()
- {
- return readAll;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getReadAll <em>Read All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read All</em>' attribute.
- * @see #getReadAll()
- * @generated
- */
- public void setReadAll(String newReadAll)
- {
- String oldReadAll = readAll;
- readAll = newReadAll;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL, oldReadAll, readAll));
- }
-
- /**
- * Returns the value of the '<em><b>Read Object</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Object</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Object</em>' attribute.
- * @see #setReadObject(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_ReadObject()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReadObject()
- {
- return readObject;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getReadObject <em>Read Object</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Object</em>' attribute.
- * @see #getReadObject()
- * @generated
- */
- public void setReadObject(String newReadObject)
- {
- String oldReadObject = readObject;
- readObject = newReadObject;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT, oldReadObject, readObject));
- }
-
- /**
- * Returns the value of the '<em><b>Report</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Report</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Report</em>' attribute.
- * @see #setReport(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Report()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getReport()
- {
- return report;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getReport <em>Report</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Report</em>' attribute.
- * @see #getReport()
- * @generated
- */
- public void setReport(String newReport)
- {
- String oldReport = report;
- report = newReport;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT, oldReport, report));
- }
-
- /**
- * Returns the value of the '<em><b>Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Update</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Update</em>' attribute.
- * @see #setUpdate(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Update()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getUpdate()
- {
- return update;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getUpdate <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Update</em>' attribute.
- * @see #getUpdate()
- * @generated
- */
- public void setUpdate(String newUpdate)
- {
- String oldUpdate = update;
- update = newUpdate;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE, oldUpdate, update));
- }
-
- /**
- * Returns the value of the '<em><b>Insert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Insert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Insert</em>' attribute.
- * @see #setInsert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Insert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getInsert()
- {
- return insert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getInsert <em>Insert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Insert</em>' attribute.
- * @see #getInsert()
- * @generated
- */
- public void setInsert(String newInsert)
- {
- String oldInsert = insert;
- insert = newInsert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT, oldInsert, insert));
- }
-
- /**
- * Returns the value of the '<em><b>Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete</em>' attribute.
- * @see #setDelete(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlQueryRedirectors_2_0_Delete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDelete()
- {
- return delete;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors#getDelete <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete</em>' attribute.
- * @see #getDelete()
- * @generated
- */
- public void setDelete(String newDelete)
- {
- String oldDelete = delete;
- delete = newDelete;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE, oldDelete, delete));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES:
- return getAllQueries();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL:
- return getReadAll();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT:
- return getReadObject();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT:
- return getReport();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE:
- return getUpdate();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT:
- return getInsert();
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE:
- return getDelete();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES:
- setAllQueries((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL:
- setReadAll((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT:
- setReadObject((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT:
- setReport((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE:
- setUpdate((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT:
- setInsert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE:
- setDelete((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES:
- setAllQueries(ALL_QUERIES_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL:
- setReadAll(READ_ALL_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT:
- setReadObject(READ_OBJECT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT:
- setReport(REPORT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE:
- setUpdate(UPDATE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT:
- setInsert(INSERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE:
- setDelete(DELETE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__ALL_QUERIES:
- return ALL_QUERIES_EDEFAULT == null ? allQueries != null : !ALL_QUERIES_EDEFAULT.equals(allQueries);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_ALL:
- return READ_ALL_EDEFAULT == null ? readAll != null : !READ_ALL_EDEFAULT.equals(readAll);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__READ_OBJECT:
- return READ_OBJECT_EDEFAULT == null ? readObject != null : !READ_OBJECT_EDEFAULT.equals(readObject);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__REPORT:
- return REPORT_EDEFAULT == null ? report != null : !REPORT_EDEFAULT.equals(report);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__UPDATE:
- return UPDATE_EDEFAULT == null ? update != null : !UPDATE_EDEFAULT.equals(update);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__INSERT:
- return INSERT_EDEFAULT == null ? insert != null : !INSERT_EDEFAULT.equals(insert);
- case EclipseLinkOrmPackage.XML_QUERY_REDIRECTORS__DELETE:
- return DELETE_EDEFAULT == null ? delete != null : !DELETE_EDEFAULT.equals(delete);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (allQueries: ");
- result.append(allQueries);
- result.append(", readAll: ");
- result.append(readAll);
- result.append(", readObject: ");
- result.append(readObject);
- result.append(", report: ");
- result.append(report);
- result.append(", update: ");
- result.append(update);
- result.append(", insert: ");
- result.append(insert);
- result.append(", delete: ");
- result.append(delete);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- EclipseLinkOrmPackage.eINSTANCE.getXmlQueryRedirectors(),
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildAllQueriesTranslator(),
- buildReadAllTranslator(),
- buildReadObjectTranslator(),
- buildReportTranslator(),
- buildUpdateTranslator(),
- buildInsertTranslator(),
- buildDeleteTranslator(),
- };
- }
-
- protected static Translator buildAllQueriesTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__ALL_QUERIES, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReadAllTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__READ_ALL, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_ReadAll(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReadObjectTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__READ_OBJECT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_ReadObject(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildReportTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__REPORT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildUpdateTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__UPDATE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildInsertTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__INSERT, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildDeleteTranslator() {
- return new Translator(EclipseLink2_0.QUERY_REDIRECTORS__DELETE, EclipseLinkOrmV2_0Package.eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlQueryRedirectors
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRangePartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRangePartitioning.java
deleted file mode 100644
index b168ad07ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRangePartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Range Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRangePartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlRangePartitioning extends AbstractJpaEObject implements XmlRangePartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlRangePartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_RANGE_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRangePartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRangePartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RANGE_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlRangePartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlRangePartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlRangePartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReadOnly.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReadOnly.java
deleted file mode 100644
index b4f928abf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReadOnly.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Read Only</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly#getReadOnly <em>Read Only</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlReadOnly extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Read Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Only</em>' attribute.
- * @see #setReadOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReadOnly_ReadOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getReadOnly();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReadOnly#getReadOnly <em>Read Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Only</em>' attribute.
- * @see #getReadOnly()
- * @generated
- */
- void setReadOnly(Boolean value);
-
- /**
- * Return the {@link TextRange} for the read-only attibute.
- */
- TextRange getReadOnlyTextRange();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReplicationPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReplicationPartitioning.java
deleted file mode 100644
index 14607841ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReplicationPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Replication Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReplicationPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlReplicationPartitioning extends AbstractJpaEObject implements XmlReplicationPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlReplicationPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_REPLICATION_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReplicationPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReplicationPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_REPLICATION_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlReplicationPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlReplicationPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlReplicationPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReturnInsert.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReturnInsert.java
deleted file mode 100644
index 0762f0007a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlReturnInsert.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Return Insert</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReturnInsert()
- * @model kind="class"
- * @generated
- */
-public class XmlReturnInsert extends AbstractJpaEObject implements XmlReturnInsert_2_1
-{
- /**
- * The default value of the '{@link #getReturnOnly() <em>Return Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnOnly()
- * @generated
- * @ordered
- */
- protected static final Boolean RETURN_ONLY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getReturnOnly() <em>Return Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReturnOnly()
- * @generated
- * @ordered
- */
- protected Boolean returnOnly = RETURN_ONLY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlReturnInsert()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_RETURN_INSERT;
- }
-
- /**
- * Returns the value of the '<em><b>Return Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Only</em>' attribute.
- * @see #setReturnOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlReturnInsert_2_1_ReturnOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getReturnOnly()
- {
- return returnOnly;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert#getReturnOnly <em>Return Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Only</em>' attribute.
- * @see #getReturnOnly()
- * @generated
- */
- public void setReturnOnly(Boolean newReturnOnly)
- {
- Boolean oldReturnOnly = returnOnly;
- returnOnly = newReturnOnly;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY, oldReturnOnly, returnOnly));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY:
- return getReturnOnly();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY:
- setReturnOnly((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY:
- setReturnOnly(RETURN_ONLY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_RETURN_INSERT__RETURN_ONLY:
- return RETURN_ONLY_EDEFAULT == null ? returnOnly != null : !RETURN_ONLY_EDEFAULT.equals(returnOnly);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (returnOnly: ");
- result.append(returnOnly);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildReturnOnlyTranslator()};
- }
-
- protected static Translator buildReturnOnlyTranslator() {
- return new Translator(EclipseLink2_1.RETURN_ONLY, EclipseLinkOrmV2_1Package.eINSTANCE.getXmlReturnInsert_2_1_ReturnOnly());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRoundRobinPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRoundRobinPartitioning.java
deleted file mode 100644
index d67d354ab8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlRoundRobinPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Round Robin Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRoundRobinPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlRoundRobinPartitioning extends AbstractJpaEObject implements XmlRoundRobinPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlRoundRobinPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_ROUND_ROBIN_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlRoundRobinPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlRoundRobinPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_ROUND_ROBIN_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlRoundRobinPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlRoundRobinPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlRoundRobinPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlSecondaryTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlSecondaryTable.java
deleted file mode 100644
index 502d043f47..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlSecondaryTable.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Secondary Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlSecondaryTable()
- * @model kind="class"
- * @generated
- */
-public class XmlSecondaryTable extends org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable implements XmlSecondaryTable_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlSecondaryTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_SECONDARY_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlSecondaryTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlSecondaryTable#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlSecondaryTable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_SECONDARY_TABLE_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlSecondaryTable_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_SECONDARY_TABLE_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_SECONDARY_TABLE__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlSecondaryTable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildPrimaryKeyJoinColumnsTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlSecondaryTable_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlSecondaryTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java
deleted file mode 100644
index 4c219d0fc0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStoredProcedureParameter.java
+++ /dev/null
@@ -1,590 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Stored Procedure Parameter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getDirection <em>Direction</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getQueryParameter <em>Query Parameter</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcType <em>Jdbc Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcTypeName <em>Jdbc Type Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlStoredProcedureParameter extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * changed this to null and removed the generated flag so emf won't generate over it
- * we don't want a default for enums, just null if the tag does not exist
- */
- protected static final XmlDirection DIRECTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDirection() <em>Direction</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDirection()
- * @generated
- * @ordered
- */
- protected XmlDirection direction = DIRECTION_EDEFAULT;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getQueryParameter() <em>Query Parameter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQueryParameter()
- * @generated
- * @ordered
- */
- protected static final String QUERY_PARAMETER_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getQueryParameter() <em>Query Parameter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getQueryParameter()
- * @generated
- * @ordered
- */
- protected String queryParameter = QUERY_PARAMETER_EDEFAULT;
-
- /**
- * The default value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected static final String TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getType() <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getType()
- * @generated
- * @ordered
- */
- protected String type = TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getJdbcType() <em>Jdbc Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJdbcType()
- * @generated
- * @ordered
- */
- protected static final Integer JDBC_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJdbcType() <em>Jdbc Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJdbcType()
- * @generated
- * @ordered
- */
- protected Integer jdbcType = JDBC_TYPE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getJdbcTypeName() <em>Jdbc Type Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJdbcTypeName()
- * @generated
- * @ordered
- */
- protected static final String JDBC_TYPE_NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getJdbcTypeName() <em>Jdbc Type Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getJdbcTypeName()
- * @generated
- * @ordered
- */
- protected String jdbcTypeName = JDBC_TYPE_NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlStoredProcedureParameter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_STORED_PROCEDURE_PARAMETER;
- }
-
- /**
- * Returns the value of the '<em><b>Direction</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Direction</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Direction</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @see #setDirection(XmlDirection)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_Direction()
- * @model
- * @generated
- */
- public XmlDirection getDirection()
- {
- return direction;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getDirection <em>Direction</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Direction</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlDirection
- * @see #getDirection()
- * @generated
- */
- public void setDirection(XmlDirection newDirection)
- {
- XmlDirection oldDirection = direction;
- direction = newDirection == null ? DIRECTION_EDEFAULT : newDirection;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION, oldDirection, direction));
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME, oldName, name));
- }
-
- /**
- * Returns the value of the '<em><b>Query Parameter</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Parameter</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Parameter</em>' attribute.
- * @see #setQueryParameter(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_QueryParameter()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getQueryParameter()
- {
- return queryParameter;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getQueryParameter <em>Query Parameter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Parameter</em>' attribute.
- * @see #getQueryParameter()
- * @generated
- */
- public void setQueryParameter(String newQueryParameter)
- {
- String oldQueryParameter = queryParameter;
- queryParameter = newQueryParameter;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER, oldQueryParameter, queryParameter));
- }
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see #setType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_Type()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getType()
- {
- return type;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see #getType()
- * @generated
- */
- public void setType(String newType)
- {
- String oldType = type;
- type = newType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE, oldType, type));
- }
-
- /**
- * Returns the value of the '<em><b>Jdbc Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Jdbc Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Jdbc Type</em>' attribute.
- * @see #setJdbcType(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_JdbcType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getJdbcType()
- {
- return jdbcType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcType <em>Jdbc Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Jdbc Type</em>' attribute.
- * @see #getJdbcType()
- * @generated
- */
- public void setJdbcType(Integer newJdbcType)
- {
- Integer oldJdbcType = jdbcType;
- jdbcType = newJdbcType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE, oldJdbcType, jdbcType));
- }
-
- /**
- * Returns the value of the '<em><b>Jdbc Type Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Jdbc Type Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Jdbc Type Name</em>' attribute.
- * @see #setJdbcTypeName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStoredProcedureParameter_JdbcTypeName()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getJdbcTypeName()
- {
- return jdbcTypeName;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStoredProcedureParameter#getJdbcTypeName <em>Jdbc Type Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Jdbc Type Name</em>' attribute.
- * @see #getJdbcTypeName()
- * @generated
- */
- public void setJdbcTypeName(String newJdbcTypeName)
- {
- String oldJdbcTypeName = jdbcTypeName;
- jdbcTypeName = newJdbcTypeName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME, oldJdbcTypeName, jdbcTypeName));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION:
- return getDirection();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME:
- return getName();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER:
- return getQueryParameter();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE:
- return getType();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE:
- return getJdbcType();
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME:
- return getJdbcTypeName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION:
- setDirection((XmlDirection)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME:
- setName((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER:
- setQueryParameter((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE:
- setType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE:
- setJdbcType((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME:
- setJdbcTypeName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION:
- setDirection(DIRECTION_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME:
- setName(NAME_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER:
- setQueryParameter(QUERY_PARAMETER_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE:
- setType(TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE:
- setJdbcType(JDBC_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME:
- setJdbcTypeName(JDBC_TYPE_NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__DIRECTION:
- return direction != DIRECTION_EDEFAULT;
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__QUERY_PARAMETER:
- return QUERY_PARAMETER_EDEFAULT == null ? queryParameter != null : !QUERY_PARAMETER_EDEFAULT.equals(queryParameter);
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__TYPE:
- return TYPE_EDEFAULT == null ? type != null : !TYPE_EDEFAULT.equals(type);
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE:
- return JDBC_TYPE_EDEFAULT == null ? jdbcType != null : !JDBC_TYPE_EDEFAULT.equals(jdbcType);
- case EclipseLinkOrmPackage.XML_STORED_PROCEDURE_PARAMETER__JDBC_TYPE_NAME:
- return JDBC_TYPE_NAME_EDEFAULT == null ? jdbcTypeName != null : !JDBC_TYPE_NAME_EDEFAULT.equals(jdbcTypeName);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (direction: ");
- result.append(direction);
- result.append(", name: ");
- result.append(name);
- result.append(", queryParameter: ");
- result.append(queryParameter);
- result.append(", type: ");
- result.append(type);
- result.append(", jdbcType: ");
- result.append(jdbcType);
- result.append(", jdbcTypeName: ");
- result.append(jdbcTypeName);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildDirectionTranslator(),
- buildNameTranslator(),
- buildQueryParameterTranslator(),
- buildTypeTranslator(),
- buildJdbcTypeTranslator(),
- buildJdbcTypeNameTranslator(),
- };
- }
-
- protected static Translator buildDirectionTranslator() {
- return new Translator(EclipseLink.PARAMETER__DIRECTION, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_Direction(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink.PARAMETER__NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_Name(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildQueryParameterTranslator() {
- return new Translator(EclipseLink.PARAMETER__QUERY_PARAMETER, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_QueryParameter(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTypeTranslator() {
- return new Translator(EclipseLink.PARAMETER__TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_Type(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildJdbcTypeTranslator() {
- return new Translator(EclipseLink.PARAMETER__JDBC_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_JdbcType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildJdbcTypeNameTranslator() {
- return new Translator(EclipseLink.PARAMETER__JDBC_TYPE_NAME, EclipseLinkOrmPackage.eINSTANCE.getXmlStoredProcedureParameter_JdbcTypeName(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlStoredProcedureParameter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStruct.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStruct.java
deleted file mode 100644
index 498236b916..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStruct.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Struct</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStruct()
- * @model kind="class"
- * @generated
- */
-public class XmlStruct extends AbstractJpaEObject implements XmlStruct_2_3
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlStruct()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_STRUCT;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStruct_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStruct#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCT__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlStruct(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(EclipseLink2_3.STRUCT__NAME, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlStruct_2_3_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlStruct
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructConverter.java
deleted file mode 100644
index 9b2715fa6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructConverter.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Struct CustomConverter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter#getConverter <em>Converter</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter()
- * @model kind="class"
- * @generated
- */
-public class XmlStructConverter extends XmlNamedConverter
-{
- /**
- * The default value of the '{@link #getConverter() <em>Converter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected static final String CONVERTER_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getConverter() <em>Converter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverter()
- * @generated
- * @ordered
- */
- protected String converter = CONVERTER_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlStructConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_STRUCT_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Converter</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>CustomConverter</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converter</em>' attribute.
- * @see #setConverter(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructConverter_Converter()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConverter()
- {
- return converter;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter#getConverter <em>Converter</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Converter</em>' attribute.
- * @see #getConverter()
- * @generated
- */
- public void setConverter(String newConverter)
- {
- String oldConverter = converter;
- converter = newConverter;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER, oldConverter, converter));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER:
- return getConverter();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER:
- setConverter((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER:
- setConverter(CONVERTER_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCT_CONVERTER__CONVERTER:
- return CONVERTER_EDEFAULT == null ? converter != null : !CONVERTER_EDEFAULT.equals(converter);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (converter: ");
- result.append(converter);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getConverterClassTextRange() {
- return getAttributeTextRange(EclipseLink.STRUCT_CONVERTER__CONVERTER);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildConverterTranslator()
- };
- }
-
- protected static Translator buildConverterTranslator() {
- return new Translator(EclipseLink.STRUCT_CONVERTER__CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlStructConverter_Converter(), Translator.DOM_ATTRIBUTE);
- }
-
-
- // ********** refactoring **********
-
- public ReplaceEdit createRenameEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.converter.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.STRUCT_CONVERTER__CONVERTER).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenamePackageEdit(String newPackageName) {
- int packageLength = this.converter.lastIndexOf('.');
- if (newPackageName == "") {//$NON-NLS-1$
- //moving to the default package, remove the '.'
- packageLength++;
- }
- if (packageLength == -1) {
- //moving from the default package or unspecified package
- packageLength = 0;
- newPackageName = newPackageName + '.';
- }
- int offset = getAttributeNode(EclipseLink.STRUCT_CONVERTER__CONVERTER).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newPackageName);
- }
-} // XmlStructConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java
deleted file mode 100644
index bb7cf9a70c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlStructure.java
+++ /dev/null
@@ -1,468 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Structure</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlStructure()
- * @model kind="class"
- * @generated
- */
-public class XmlStructure extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlStructure_2_3
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlStructure()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_STRUCTURE;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructure#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE:
- return getAttributeType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlStructure_2_3.class)
- {
- switch (derivedFeatureID)
- {
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_STRUCTURE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_STRUCTURE__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_STRUCTURE__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlStructure_2_3.class)
- {
- switch (baseFeatureID)
- {
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.STRUCTURE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlStructure(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- buildAttributeTypeTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_3.STRUCTURE__ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-} // XmlStructure
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTable.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTable.java
deleted file mode 100644
index 33d9d07657..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTable.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Table</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTable()
- * @model kind="class"
- * @generated
- */
-public class XmlTable extends org.eclipse.jpt.jpa.core.resource.orm.XmlTable implements XmlTable_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTable()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TABLE;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTable#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTable_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_TABLE_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTable_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_TABLE_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_TABLE__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTable(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildUniqueConstraintTranslator()
- };
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlTable_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlTable
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTableGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTableGenerator.java
deleted file mode 100644
index a314c639bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTableGenerator.java
+++ /dev/null
@@ -1,274 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * A representation of the model object '<em><b>Xml Table Generator</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTableGenerator()
- * @model kind="class"
- * @generated
- */
-public class XmlTableGenerator extends org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator implements XmlTableGenerator_2_2
-{
- /**
- * The default value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected static final String CREATION_SUFFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getCreationSuffix() <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getCreationSuffix()
- * @generated
- * @ordered
- */
- protected String creationSuffix = CREATION_SUFFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTableGenerator()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TABLE_GENERATOR;
- }
-
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTableGenerator_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getCreationSuffix()
- {
- return creationSuffix;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTableGenerator#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- public void setCreationSuffix(String newCreationSuffix)
- {
- String oldCreationSuffix = creationSuffix;
- creationSuffix = newCreationSuffix;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX, oldCreationSuffix, creationSuffix));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX:
- return getCreationSuffix();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX:
- setCreationSuffix((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX:
- setCreationSuffix(CREATION_SUFFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX:
- return CREATION_SUFFIX_EDEFAULT == null ? creationSuffix != null : !CREATION_SUFFIX_EDEFAULT.equals(creationSuffix);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTableGenerator_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX: return EclipseLinkOrmV2_2Package.XML_TABLE_GENERATOR_22__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTableGenerator_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_TABLE_GENERATOR_22__CREATION_SUFFIX: return EclipseLinkOrmPackage.XML_TABLE_GENERATOR__CREATION_SUFFIX;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (creationSuffix: ");
- result.append(creationSuffix);
- result.append(')');
- return result.toString();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTableGenerator(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTableTranslator(),
- buildCatalogTranslator(),
- buildSchemaTranslator(),
- buildCreationSuffixTranslator(),
- buildPkColumnNameTranslator(),
- buildValueColumnNameTranslator(),
- buildPkColumnValueTranslator(),
- buildInitialValueTranslator(),
- buildAllocationSizeTranslator(),
- buildDescriptionTranslator(),
- XmlUniqueConstraint.buildTranslator(JPA.UNIQUE_CONSTRAINT, OrmPackage.eINSTANCE.getXmlTableGenerator_UniqueConstraints())
- };
- }
-
- protected static Translator buildCreationSuffixTranslator() {
- return new Translator(EclipseLink2_2.CREATION_SUFFIX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlTableGenerator_2_2_CreationSuffix(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlTableGenerator
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java
deleted file mode 100644
index 5d14eec74d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTenantDiscriminatorColumn.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlBaseDiscriminatorColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Tenant Discriminator</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn()
- * @model kind="class"
- * @generated
- */
-public class XmlTenantDiscriminatorColumn extends AbstractXmlBaseDiscriminatorColumn implements XmlTenantDiscriminatorColumn_2_3
-{
- /**
- * The default value of the '{@link #getContextProperty() <em>Context Property</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getContextProperty()
- * @generated
- * @ordered
- */
- protected static final String CONTEXT_PROPERTY_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getContextProperty() <em>Context Property</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getContextProperty()
- * @generated
- * @ordered
- */
- protected String contextProperty = CONTEXT_PROPERTY_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected static final String TABLE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getTable() <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTable()
- * @generated
- * @ordered
- */
- protected String table = TABLE_EDEFAULT;
- /**
- * The default value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKey()
- * @generated
- * @ordered
- */
- protected static final Boolean PRIMARY_KEY_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getPrimaryKey() <em>Primary Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPrimaryKey()
- * @generated
- * @ordered
- */
- protected Boolean primaryKey = PRIMARY_KEY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTenantDiscriminatorColumn()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TENANT_DISCRIMINATOR_COLUMN;
- }
- /**
- * Returns the value of the '<em><b>Context Property</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Context Property</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Context Property</em>' attribute.
- * @see #setContextProperty(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_ContextProperty()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getContextProperty()
- {
- return contextProperty;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getContextProperty <em>Context Property</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Context Property</em>' attribute.
- * @see #getContextProperty()
- * @generated
- */
- public void setContextProperty(String newContextProperty)
- {
- String oldContextProperty = contextProperty;
- contextProperty = newContextProperty;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY, oldContextProperty, contextProperty));
- }
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTable()
- {
- return table;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- public void setTable(String newTable)
- {
- String oldTable = table;
- table = newTable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE, oldTable, table));
- }
-
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' attribute.
- * @see #setPrimaryKey(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTenantDiscriminatorColumn_2_3_PrimaryKey()
- * @model
- * @generated
- */
- public Boolean getPrimaryKey()
- {
- return primaryKey;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTenantDiscriminatorColumn#getPrimaryKey <em>Primary Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' attribute.
- * @see #getPrimaryKey()
- * @generated
- */
- public void setPrimaryKey(Boolean newPrimaryKey)
- {
- Boolean oldPrimaryKey = primaryKey;
- primaryKey = newPrimaryKey;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY, oldPrimaryKey, primaryKey));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY:
- return getContextProperty();
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE:
- return getTable();
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY:
- return getPrimaryKey();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY:
- setContextProperty((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE:
- setTable((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY:
- setPrimaryKey((Boolean)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY:
- setContextProperty(CONTEXT_PROPERTY_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE:
- setTable(TABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY:
- setPrimaryKey(PRIMARY_KEY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY:
- return CONTEXT_PROPERTY_EDEFAULT == null ? contextProperty != null : !CONTEXT_PROPERTY_EDEFAULT.equals(contextProperty);
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE:
- return TABLE_EDEFAULT == null ? table != null : !TABLE_EDEFAULT.equals(table);
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY:
- return PRIMARY_KEY_EDEFAULT == null ? primaryKey != null : !PRIMARY_KEY_EDEFAULT.equals(primaryKey);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTenantDiscriminatorColumn_2_3.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY: return EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE: return EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE;
- case EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY: return EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlTenantDiscriminatorColumn_2_3.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY: return EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY;
- case EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE: return EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__TABLE;
- case EclipseLinkOrmV2_3Package.XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY: return EclipseLinkOrmPackage.XML_TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (contextProperty: ");
- result.append(contextProperty);
- result.append(", table: ");
- result.append(table);
- result.append(", primaryKey: ");
- result.append(primaryKey);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getTableTextRange() {
- return getAttributeTextRange(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__TABLE);
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTenantDiscriminatorColumn(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildContextPropertyTranslator(),
- buildDiscriminatorTypeTranslator(),
- buildColumnDefinitionTranslator(),
- buildLengthTranslator(),
- buildTableTranslator(),
- buildPrimaryKeyTranslator()
- };
- }
-
- protected static Translator buildContextPropertyTranslator() {
- return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_ContextProperty(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildTableTranslator() {
- return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__TABLE, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_Table(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildPrimaryKeyTranslator() {
- return new Translator(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY, EclipseLinkOrmV2_3Package.eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_PrimaryKey(), Translator.DOM_ATTRIBUTE);
- }
- // *********** content assist ***********
-
- public TextRange getTableCodeAssistTextRange() {
- return getAttributeCodeAssistTextRange(EclipseLink2_3.TENANT_DISCRIMINATOR_COLUMN__TABLE);
- }
-
- public boolean tableTouches(int pos) {
- TextRange textRange = this.getTableCodeAssistTextRange();
- return (textRange != null) && (textRange.touches(pos));
- }
-} // XmlTenantDiscriminator
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTimeOfDay.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTimeOfDay.java
deleted file mode 100644
index ea0c735488..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTimeOfDay.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Time Of Day</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getHour <em>Hour</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMinute <em>Minute</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getSecond <em>Second</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMillisecond <em>Millisecond</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay()
- * @model kind="class"
- * @extends JpaEObject
- * @generated
- */
-public class XmlTimeOfDay extends AbstractJpaEObject implements JpaEObject
-{
- /**
- * The default value of the '{@link #getHour() <em>Hour</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHour()
- * @generated
- * @ordered
- */
- protected static final Integer HOUR_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getHour() <em>Hour</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHour()
- * @generated
- * @ordered
- */
- protected Integer hour = HOUR_EDEFAULT;
-
- /**
- * The default value of the '{@link #getMinute() <em>Minute</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinute()
- * @generated
- * @ordered
- */
- protected static final Integer MINUTE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMinute() <em>Minute</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMinute()
- * @generated
- * @ordered
- */
- protected Integer minute = MINUTE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getSecond() <em>Second</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSecond()
- * @generated
- * @ordered
- */
- protected static final Integer SECOND_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getSecond() <em>Second</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getSecond()
- * @generated
- * @ordered
- */
- protected Integer second = SECOND_EDEFAULT;
-
- /**
- * The default value of the '{@link #getMillisecond() <em>Millisecond</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMillisecond()
- * @generated
- * @ordered
- */
- protected static final Integer MILLISECOND_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getMillisecond() <em>Millisecond</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getMillisecond()
- * @generated
- * @ordered
- */
- protected Integer millisecond = MILLISECOND_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTimeOfDay()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TIME_OF_DAY;
- }
-
- /**
- * Returns the value of the '<em><b>Hour</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hour</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hour</em>' attribute.
- * @see #setHour(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay_Hour()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getHour()
- {
- return hour;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getHour <em>Hour</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hour</em>' attribute.
- * @see #getHour()
- * @generated
- */
- public void setHour(Integer newHour)
- {
- Integer oldHour = hour;
- hour = newHour;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR, oldHour, hour));
- }
-
- /**
- * Returns the value of the '<em><b>Minute</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Minute</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Minute</em>' attribute.
- * @see #setMinute(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay_Minute()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getMinute()
- {
- return minute;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMinute <em>Minute</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Minute</em>' attribute.
- * @see #getMinute()
- * @generated
- */
- public void setMinute(Integer newMinute)
- {
- Integer oldMinute = minute;
- minute = newMinute;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE, oldMinute, minute));
- }
-
- /**
- * Returns the value of the '<em><b>Second</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Second</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Second</em>' attribute.
- * @see #setSecond(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay_Second()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getSecond()
- {
- return second;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getSecond <em>Second</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Second</em>' attribute.
- * @see #getSecond()
- * @generated
- */
- public void setSecond(Integer newSecond)
- {
- Integer oldSecond = second;
- second = newSecond;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND, oldSecond, second));
- }
-
- /**
- * Returns the value of the '<em><b>Millisecond</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Millisecond</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Millisecond</em>' attribute.
- * @see #setMillisecond(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTimeOfDay_Millisecond()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- public Integer getMillisecond()
- {
- return millisecond;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTimeOfDay#getMillisecond <em>Millisecond</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Millisecond</em>' attribute.
- * @see #getMillisecond()
- * @generated
- */
- public void setMillisecond(Integer newMillisecond)
- {
- Integer oldMillisecond = millisecond;
- millisecond = newMillisecond;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND, oldMillisecond, millisecond));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR:
- return getHour();
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE:
- return getMinute();
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND:
- return getSecond();
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND:
- return getMillisecond();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR:
- setHour((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE:
- setMinute((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND:
- setSecond((Integer)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND:
- setMillisecond((Integer)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR:
- setHour(HOUR_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE:
- setMinute(MINUTE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND:
- setSecond(SECOND_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND:
- setMillisecond(MILLISECOND_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__HOUR:
- return HOUR_EDEFAULT == null ? hour != null : !HOUR_EDEFAULT.equals(hour);
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MINUTE:
- return MINUTE_EDEFAULT == null ? minute != null : !MINUTE_EDEFAULT.equals(minute);
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__SECOND:
- return SECOND_EDEFAULT == null ? second != null : !SECOND_EDEFAULT.equals(second);
- case EclipseLinkOrmPackage.XML_TIME_OF_DAY__MILLISECOND:
- return MILLISECOND_EDEFAULT == null ? millisecond != null : !MILLISECOND_EDEFAULT.equals(millisecond);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (hour: ");
- result.append(hour);
- result.append(", minute: ");
- result.append(minute);
- result.append(", second: ");
- result.append(second);
- result.append(", millisecond: ");
- result.append(millisecond);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildHourTranslator(),
- buildMinuteTranslator(),
- buildSecondTranslator(),
- buildMillisecondTranslator(),
- };
- }
-
- protected static Translator buildHourTranslator() {
- return new Translator(EclipseLink.EXPIRY_TIME_OF_DAY__HOUR, EclipseLinkOrmPackage.eINSTANCE.getXmlTimeOfDay_Hour(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildMinuteTranslator() {
- return new Translator(EclipseLink.EXPIRY_TIME_OF_DAY__MINUTE, EclipseLinkOrmPackage.eINSTANCE.getXmlTimeOfDay_Minute(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildSecondTranslator() {
- return new Translator(EclipseLink.EXPIRY_TIME_OF_DAY__SECOND, EclipseLinkOrmPackage.eINSTANCE.getXmlTimeOfDay_Second(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildMillisecondTranslator() {
- return new Translator(EclipseLink.EXPIRY_TIME_OF_DAY__MILLISECOND, EclipseLinkOrmPackage.eINSTANCE.getXmlTimeOfDay_Millisecond(), Translator.DOM_ATTRIBUTE);
- }
-
-} // XmlTimeOfDay
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java
deleted file mode 100644
index ab377138a5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransformation.java
+++ /dev/null
@@ -1,463 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Transformation Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves. *
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransformation()
- * @model kind="class"
- * @generated
- */
-public class XmlTransformation extends AbstractXmlAttributeMapping implements XmlAttributeMapping
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTransformation()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TRANSFORMATION;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransformation#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE:
- return getAttributeType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_TRANSFORMATION__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_TRANSFORMATION__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_TRANSFORMATION__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
-// buildFetchTranslator(),
-// buildOptionalTranslator(),
- buildAccessTranslator(),
-// buildMutableTranslator(),
- buildAttributeTypeTranslator(),
-// buildReadTransformerTranslator(),
-// buildWriteTransformerTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java
deleted file mode 100644
index 7cb7a55e27..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTransient.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Transient</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTransient()
- * @model kind="class"
- * @generated
- */
-public class XmlTransient extends org.eclipse.jpt.jpa.core.resource.orm.XmlTransient implements XmlAttributeMapping
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTransient()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TRANSIENT;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTransient#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE:
- return getAttributeType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_TRANSIENT__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_TRANSIENT__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_TRANSIENT__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getAttributeTypeTextRange() {
- //no attribute-type for one-to-one
- return getValidationTextRange();
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- EclipseLinkOrmPackage.eINSTANCE.getXmlTransient(),
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeConverter.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeConverter.java
deleted file mode 100644
index 7096edbd93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeConverter.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.text.edits.ReplaceEdit;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Type CustomConverter</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.1
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getDataType <em>Data Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getObjectType <em>Object Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter()
- * @model kind="class"
- * @generated
- */
-public class XmlTypeConverter extends XmlNamedConverter
-{
- /**
- * The default value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataType()
- * @generated
- * @ordered
- */
- protected static final String DATA_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getDataType() <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getDataType()
- * @generated
- * @ordered
- */
- protected String dataType = DATA_TYPE_EDEFAULT;
- /**
- * The default value of the '{@link #getObjectType() <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectType()
- * @generated
- * @ordered
- */
- protected static final String OBJECT_TYPE_EDEFAULT = null;
- /**
- * The cached value of the '{@link #getObjectType() <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectType()
- * @generated
- * @ordered
- */
- protected String objectType = OBJECT_TYPE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlTypeConverter()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_TYPE_CONVERTER;
- }
-
- /**
- * Returns the value of the '<em><b>Data Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Data Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Data Type</em>' attribute.
- * @see #setDataType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter_DataType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getDataType()
- {
- return dataType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getDataType <em>Data Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Data Type</em>' attribute.
- * @see #getDataType()
- * @generated
- */
- public void setDataType(String newDataType)
- {
- String oldDataType = dataType;
- dataType = newDataType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE, oldDataType, dataType));
- }
-
- /**
- * Returns the value of the '<em><b>Object Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type</em>' attribute.
- * @see #setObjectType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeConverter_ObjectType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getObjectType()
- {
- return objectType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter#getObjectType <em>Object Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Object Type</em>' attribute.
- * @see #getObjectType()
- * @generated
- */
- public void setObjectType(String newObjectType)
- {
- String oldObjectType = objectType;
- objectType = newObjectType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE, oldObjectType, objectType));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE:
- return getDataType();
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE:
- return getObjectType();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE:
- setDataType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE:
- setObjectType((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE:
- setDataType(DATA_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE:
- setObjectType(OBJECT_TYPE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__DATA_TYPE:
- return DATA_TYPE_EDEFAULT == null ? dataType != null : !DATA_TYPE_EDEFAULT.equals(dataType);
- case EclipseLinkOrmPackage.XML_TYPE_CONVERTER__OBJECT_TYPE:
- return OBJECT_TYPE_EDEFAULT == null ? objectType != null : !OBJECT_TYPE_EDEFAULT.equals(objectType);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (dataType: ");
- result.append(dataType);
- result.append(", objectType: ");
- result.append(objectType);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- Translator.END_TAG_NO_INDENT,
- buildTranslatorChildren()
- );
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildDataTypeTranslator(),
- buildObjectTypeTranslator(),
- };
- }
-
- protected static Translator buildDataTypeTranslator() {
- return new Translator(EclipseLink.TYPE_CONVERTER__DATA_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlTypeConverter_DataType(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildObjectTypeTranslator() {
- return new Translator(EclipseLink.TYPE_CONVERTER__OBJECT_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlTypeConverter_ObjectType(), Translator.DOM_ATTRIBUTE);
- }
-
-
- // ********** refactoring **********
-
- public ReplaceEdit createRenameDataTypeEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.dataType.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.TYPE_CONVERTER__DATA_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenameDataTypePackageEdit(String newPackageName) {
- int packageLength = this.dataType.lastIndexOf('.');
- if (newPackageName == "") {//$NON-NLS-1$
- //moving to the default package, remove the '.'
- packageLength++;
- }
- if (packageLength == -1) {
- //moving from the default package or unspecified package
- packageLength = 0;
- newPackageName = newPackageName + '.';
- }
- int offset = getAttributeNode(EclipseLink.TYPE_CONVERTER__DATA_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newPackageName);
- }
-
- public ReplaceEdit createRenameObjectTypeEdit(IType originalType, String newName) {
- String originalName = originalType.getTypeQualifiedName();
- int nameIndex = this.objectType.lastIndexOf(originalName);
- int offset = getAttributeNode(EclipseLink.TYPE_CONVERTER__OBJECT_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset + nameIndex, originalName.length(), newName);
- }
-
- public ReplaceEdit createRenameObjectTypePackageEdit(String newPackageName) {
- int packageLength = this.objectType.lastIndexOf('.');
- if (newPackageName == "") {//$NON-NLS-1$
- //moving to the default package, remove the '.'
- packageLength++;
- }
- if (packageLength == -1) {
- //moving from the default package or unspecified package
- packageLength = 0;
- newPackageName = newPackageName + '.';
- }
- int offset = getAttributeNode(EclipseLink.TYPE_CONVERTER__OBJECT_TYPE).getValueRegionStartOffset() + 1; // +1 = opening double quote
- return new ReplaceEdit(offset, packageLength, newPackageName);
- }
-
-} // XmlTypeConverter
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeMapping.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeMapping.java
deleted file mode 100644
index 47128bd90f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlTypeMapping.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Type Mapping</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlTypeMapping()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTypeMapping extends org.eclipse.jpt.jpa.core.resource.orm.XmlTypeMapping, XmlTypeMapping_2_1
-{
-} // XmlTypeMapping
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlUnionPartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlUnionPartitioning.java
deleted file mode 100644
index 67b5c220b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlUnionPartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Union Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlUnionPartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlUnionPartitioning extends AbstractJpaEObject implements XmlUnionPartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlUnionPartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_UNION_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlUnionPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlUnionPartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_UNION_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlUnionPartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlUnionPartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlUnionPartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlValuePartitioning.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlValuePartitioning.java
deleted file mode 100644
index e1782a71b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlValuePartitioning.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import org.eclipse.emf.common.notify.Notification;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-
-import org.eclipse.jpt.jpa.core.resource.orm.JPA;
-import org.eclipse.jpt.jpa.core.resource.xml.AbstractJpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Value Partitioning</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlValuePartitioning()
- * @model kind="class"
- * @generated
- */
-public class XmlValuePartitioning extends AbstractJpaEObject implements XmlValuePartitioning_2_2
-{
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlValuePartitioning()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_VALUE_PARTITIONING;
- }
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlValuePartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlValuePartitioning#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- public void setName(String newName)
- {
- String oldName = name;
- name = newName;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME, oldName, name));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME:
- return getName();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME:
- setName((String)newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public void eUnset(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME:
- setName(NAME_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VALUE_PARTITIONING__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (name: ");
- result.append(name);
- result.append(')');
- return result.toString();
- }
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlValuePartitioning(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator()
- };
- }
-
- protected static Translator buildNameTranslator() {
- return new Translator(JPA.NAME, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlValuePartitioning_2_2_Name(), Translator.DOM_ATTRIBUTE);
- }
-} // XmlValuePartitioning
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java
deleted file mode 100644
index 6189e84eb7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVariableOneToOne.java
+++ /dev/null
@@ -1,1374 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.AbstractXmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Variable One To One Impl</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.2
- * @since 2.2
- *
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getTargetInterface <em>Target Interface</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne()
- * @model kind="class"
- * @generated
- */
-public class XmlVariableOneToOne extends AbstractXmlAttributeMapping implements XmlAttributeMapping, XmlVariableOneToOne_2_2
-{
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getPartitioning() <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPartitioning_2_2 partitioning;
-
- /**
- * The cached value of the '{@link #getReplicationPartitioning() <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getReplicationPartitioning()
- * @generated
- * @ordered
- */
- protected XmlReplicationPartitioning_2_2 replicationPartitioning;
-
- /**
- * The cached value of the '{@link #getRoundRobinPartitioning() <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRoundRobinPartitioning()
- * @generated
- * @ordered
- */
- protected XmlRoundRobinPartitioning_2_2 roundRobinPartitioning;
-
- /**
- * The cached value of the '{@link #getPinnedPartitioning() <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPinnedPartitioning()
- * @generated
- * @ordered
- */
- protected XmlPinnedPartitioning_2_2 pinnedPartitioning;
-
- /**
- * The cached value of the '{@link #getRangePartitioning() <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getRangePartitioning()
- * @generated
- * @ordered
- */
- protected XmlRangePartitioning_2_2 rangePartitioning;
-
- /**
- * The cached value of the '{@link #getValuePartitioning() <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getValuePartitioning()
- * @generated
- * @ordered
- */
- protected XmlValuePartitioning_2_2 valuePartitioning;
-
- /**
- * The cached value of the '{@link #getHashPartitioning() <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getHashPartitioning()
- * @generated
- * @ordered
- */
- protected XmlHashPartitioning_2_2 hashPartitioning;
-
- /**
- * The cached value of the '{@link #getUnionPartitioning() <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getUnionPartitioning()
- * @generated
- * @ordered
- */
- protected XmlUnionPartitioning_2_2 unionPartitioning;
-
- /**
- * The default value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected static final String PARTITIONED_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPartitioned() <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getPartitioned()
- * @generated
- * @ordered
- */
- protected String partitioned = PARTITIONED_EDEFAULT;
-
- /**
- * The default value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected static final boolean NON_CACHEABLE_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isNonCacheable() <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #isNonCacheable()
- * @generated
- * @ordered
- */
- protected boolean nonCacheable = NON_CACHEABLE_EDEFAULT;
-
- /**
- * The default value of the '{@link #getTargetInterface() <em>Target Interface</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetInterface()
- * @generated
- * @ordered
- */
- protected static final String TARGET_INTERFACE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getTargetInterface() <em>Target Interface</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTargetInterface()
- * @generated
- * @ordered
- */
- protected String targetInterface = TARGET_INTERFACE_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlVariableOneToOne()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_VARIABLE_ONE_TO_ONE;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPartitioning_2_2 getPartitioning()
- {
- return partitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPartitioning(XmlPartitioning_2_2 newPartitioning, NotificationChain msgs)
- {
- XmlPartitioning_2_2 oldPartitioning = partitioning;
- partitioning = newPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING, oldPartitioning, newPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- public void setPartitioning(XmlPartitioning_2_2 newPartitioning)
- {
- if (newPartitioning != partitioning)
- {
- NotificationChain msgs = null;
- if (partitioning != null)
- msgs = ((InternalEObject)partitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING, null, msgs);
- if (newPartitioning != null)
- msgs = ((InternalEObject)newPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING, null, msgs);
- msgs = basicSetPartitioning(newPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING, newPartitioning, newPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlReplicationPartitioning_2_2 getReplicationPartitioning()
- {
- return replicationPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning, NotificationChain msgs)
- {
- XmlReplicationPartitioning_2_2 oldReplicationPartitioning = replicationPartitioning;
- replicationPartitioning = newReplicationPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING, oldReplicationPartitioning, newReplicationPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- public void setReplicationPartitioning(XmlReplicationPartitioning_2_2 newReplicationPartitioning)
- {
- if (newReplicationPartitioning != replicationPartitioning)
- {
- NotificationChain msgs = null;
- if (replicationPartitioning != null)
- msgs = ((InternalEObject)replicationPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- if (newReplicationPartitioning != null)
- msgs = ((InternalEObject)newReplicationPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING, null, msgs);
- msgs = basicSetReplicationPartitioning(newReplicationPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING, newReplicationPartitioning, newReplicationPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning()
- {
- return roundRobinPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning, NotificationChain msgs)
- {
- XmlRoundRobinPartitioning_2_2 oldRoundRobinPartitioning = roundRobinPartitioning;
- roundRobinPartitioning = newRoundRobinPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, oldRoundRobinPartitioning, newRoundRobinPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- public void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 newRoundRobinPartitioning)
- {
- if (newRoundRobinPartitioning != roundRobinPartitioning)
- {
- NotificationChain msgs = null;
- if (roundRobinPartitioning != null)
- msgs = ((InternalEObject)roundRobinPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- if (newRoundRobinPartitioning != null)
- msgs = ((InternalEObject)newRoundRobinPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, null, msgs);
- msgs = basicSetRoundRobinPartitioning(newRoundRobinPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING, newRoundRobinPartitioning, newRoundRobinPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlPinnedPartitioning_2_2 getPinnedPartitioning()
- {
- return pinnedPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning, NotificationChain msgs)
- {
- XmlPinnedPartitioning_2_2 oldPinnedPartitioning = pinnedPartitioning;
- pinnedPartitioning = newPinnedPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING, oldPinnedPartitioning, newPinnedPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- public void setPinnedPartitioning(XmlPinnedPartitioning_2_2 newPinnedPartitioning)
- {
- if (newPinnedPartitioning != pinnedPartitioning)
- {
- NotificationChain msgs = null;
- if (pinnedPartitioning != null)
- msgs = ((InternalEObject)pinnedPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING, null, msgs);
- if (newPinnedPartitioning != null)
- msgs = ((InternalEObject)newPinnedPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING, null, msgs);
- msgs = basicSetPinnedPartitioning(newPinnedPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING, newPinnedPartitioning, newPinnedPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlRangePartitioning_2_2 getRangePartitioning()
- {
- return rangePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning, NotificationChain msgs)
- {
- XmlRangePartitioning_2_2 oldRangePartitioning = rangePartitioning;
- rangePartitioning = newRangePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING, oldRangePartitioning, newRangePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- public void setRangePartitioning(XmlRangePartitioning_2_2 newRangePartitioning)
- {
- if (newRangePartitioning != rangePartitioning)
- {
- NotificationChain msgs = null;
- if (rangePartitioning != null)
- msgs = ((InternalEObject)rangePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING, null, msgs);
- if (newRangePartitioning != null)
- msgs = ((InternalEObject)newRangePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING, null, msgs);
- msgs = basicSetRangePartitioning(newRangePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING, newRangePartitioning, newRangePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlValuePartitioning_2_2 getValuePartitioning()
- {
- return valuePartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning, NotificationChain msgs)
- {
- XmlValuePartitioning_2_2 oldValuePartitioning = valuePartitioning;
- valuePartitioning = newValuePartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING, oldValuePartitioning, newValuePartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- public void setValuePartitioning(XmlValuePartitioning_2_2 newValuePartitioning)
- {
- if (newValuePartitioning != valuePartitioning)
- {
- NotificationChain msgs = null;
- if (valuePartitioning != null)
- msgs = ((InternalEObject)valuePartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING, null, msgs);
- if (newValuePartitioning != null)
- msgs = ((InternalEObject)newValuePartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING, null, msgs);
- msgs = basicSetValuePartitioning(newValuePartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING, newValuePartitioning, newValuePartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlHashPartitioning_2_2 getHashPartitioning()
- {
- return hashPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning, NotificationChain msgs)
- {
- XmlHashPartitioning_2_2 oldHashPartitioning = hashPartitioning;
- hashPartitioning = newHashPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING, oldHashPartitioning, newHashPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- public void setHashPartitioning(XmlHashPartitioning_2_2 newHashPartitioning)
- {
- if (newHashPartitioning != hashPartitioning)
- {
- NotificationChain msgs = null;
- if (hashPartitioning != null)
- msgs = ((InternalEObject)hashPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING, null, msgs);
- if (newHashPartitioning != null)
- msgs = ((InternalEObject)newHashPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING, null, msgs);
- msgs = basicSetHashPartitioning(newHashPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING, newHashPartitioning, newHashPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- public XmlUnionPartitioning_2_2 getUnionPartitioning()
- {
- return unionPartitioning;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning, NotificationChain msgs)
- {
- XmlUnionPartitioning_2_2 oldUnionPartitioning = unionPartitioning;
- unionPartitioning = newUnionPartitioning;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING, oldUnionPartitioning, newUnionPartitioning);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- public void setUnionPartitioning(XmlUnionPartitioning_2_2 newUnionPartitioning)
- {
- if (newUnionPartitioning != unionPartitioning)
- {
- NotificationChain msgs = null;
- if (unionPartitioning != null)
- msgs = ((InternalEObject)unionPartitioning).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING, null, msgs);
- if (newUnionPartitioning != null)
- msgs = ((InternalEObject)newUnionPartitioning).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING, null, msgs);
- msgs = basicSetUnionPartitioning(newUnionPartitioning, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING, newUnionPartitioning, newUnionPartitioning));
- }
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getPartitioned()
- {
- return partitioned;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- public void setPartitioned(String newPartitioned)
- {
- String oldPartitioned = partitioned;
- partitioned = newPartitioned;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED, oldPartitioned, partitioned));
- }
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- public boolean isNonCacheable()
- {
- return nonCacheable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- public void setNonCacheable(boolean newNonCacheable)
- {
- boolean oldNonCacheable = nonCacheable;
- nonCacheable = newNonCacheable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE, oldNonCacheable, nonCacheable));
- }
-
- /**
- * Returns the value of the '<em><b>Target Interface</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Interface</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 Interface</em>' attribute.
- * @see #setTargetInterface(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVariableOneToOne_TargetInterface()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getTargetInterface()
- {
- return targetInterface;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVariableOneToOne#getTargetInterface <em>Target Interface</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Interface</em>' attribute.
- * @see #getTargetInterface()
- * @generated
- */
- public void setTargetInterface(String newTargetInterface)
- {
- String oldTargetInterface = targetInterface;
- targetInterface = newTargetInterface;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE, oldTargetInterface, targetInterface));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- return basicSetPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return basicSetReplicationPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return basicSetRoundRobinPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- return basicSetPinnedPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- return basicSetRangePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- return basicSetValuePartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- return basicSetHashPartitioning(null, msgs);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- return basicSetUnionPartitioning(null, msgs);
- }
- return super.eInverseRemove(otherEnd, featureID, msgs);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- return getPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return getReplicationPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return getRoundRobinPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- return getPinnedPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- return getRangePartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- return getValuePartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- return getHashPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- return getUnionPartitioning();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED:
- return getPartitioned();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE:
- return isNonCacheable();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE:
- return getTargetInterface();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @SuppressWarnings("unchecked")
- @Override
- public void eSet(int featureID, Object newValue)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED:
- setPartitioned((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE:
- setNonCacheable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE:
- setTargetInterface((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_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- setPartitioning((XmlPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- setReplicationPartitioning((XmlReplicationPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- setRoundRobinPartitioning((XmlRoundRobinPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- setPinnedPartitioning((XmlPinnedPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- setRangePartitioning((XmlRangePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- setValuePartitioning((XmlValuePartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- setHashPartitioning((XmlHashPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- setUnionPartitioning((XmlUnionPartitioning_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED:
- setPartitioned(PARTITIONED_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE:
- setNonCacheable(NON_CACHEABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE:
- setTargetInterface(TARGET_INTERFACE_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING:
- return partitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING:
- return replicationPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING:
- return roundRobinPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING:
- return pinnedPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING:
- return rangePartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING:
- return valuePartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING:
- return hashPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING:
- return unionPartitioning != null;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED:
- return PARTITIONED_EDEFAULT == null ? partitioned != null : !PARTITIONED_EDEFAULT.equals(partitioned);
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE:
- return nonCacheable != NON_CACHEABLE_EDEFAULT;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__TARGET_INTERFACE:
- return TARGET_INTERFACE_EDEFAULT == null ? targetInterface != null : !TARGET_INTERFACE_EDEFAULT.equals(targetInterface);
- }
- return super.eIsSet(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED: return EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlVariableOneToOne_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE: return EclipseLinkOrmV2_2Package.XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE;
- default: return -1;
- }
- }
- return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass)
- {
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlPartitioningGroup_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__REPLICATION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__ROUND_ROBIN_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PINNED_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__RANGE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__VALUE_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__HASH_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__HASH_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__UNION_PARTITIONING: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__UNION_PARTITIONING;
- case EclipseLinkOrmV2_2Package.XML_PARTITIONING_GROUP_22__PARTITIONED: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__PARTITIONED;
- default: return -1;
- }
- }
- if (baseClass == XmlVariableOneToOne_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE: return EclipseLinkOrmPackage.XML_VARIABLE_ONE_TO_ONE__NON_CACHEABLE;
- default: return -1;
- }
- }
- return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- if (eIsProxy()) return super.toString();
-
- StringBuffer result = new StringBuffer(super.toString());
- result.append(" (attributeType: ");
- result.append(attributeType);
- result.append(", partitioned: ");
- result.append(partitioned);
- result.append(", nonCacheable: ");
- result.append(nonCacheable);
- result.append(", targetInterface: ");
- result.append(targetInterface);
- result.append(')');
- return result.toString();
- }
-
- public String getMappingKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(elementName, structuralFeature, buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildTargetInterfaceTranslator(),
- buildAccessTranslator(),
- };
- }
- // ********** translators **********
-
- protected static Translator buildTargetInterfaceTranslator() {
- return new Translator(EclipseLink.VARIABLE_ONE_TO_ONE__TARGET_INTERFACE, EclipseLinkOrmPackage.eINSTANCE.getXmlVariableOneToOne_TargetInterface(), Translator.DOM_ATTRIBUTE);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java
deleted file mode 100644
index 6161799d48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/XmlVersion.java
+++ /dev/null
@@ -1,990 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm;
-
-import java.util.Collection;
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.NotificationChain;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.jpt.common.core.internal.utility.translators.SimpleTranslator;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2;
-import org.eclipse.wst.common.internal.emf.resource.Translator;
-
-/**
- * <!-- begin-user-doc -->
- *
- * A representation of the model object '<em><b>Xml Version</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.1
- *
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion()
- * @model kind="class"
- * @generated
- */
-public class XmlVersion extends org.eclipse.jpt.jpa.core.resource.orm.XmlVersion implements XmlVersion_2_2, XmlAttributeMapping, XmlMutable, XmlConvertibleMapping, XmlConverterContainer
-{
- /**
- * The cached value of the '{@link #getIndex() <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getIndex()
- * @generated
- * @ordered
- */
- protected XmlIndex_2_2 index;
-
- /**
- * The cached value of the '{@link #getAccessMethods() <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAccessMethods()
- * @generated
- * @ordered
- */
- protected XmlAccessMethods accessMethods;
-
- /**
- * The cached value of the '{@link #getProperties() <em>Properties</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getProperties()
- * @generated
- * @ordered
- */
- protected EList<XmlProperty> properties;
-
- /**
- * The default value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected static final String ATTRIBUTE_TYPE_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getAttributeType() <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getAttributeType()
- * @generated
- * @ordered
- */
- protected String attributeType = ATTRIBUTE_TYPE_EDEFAULT;
-
- /**
- * The 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 default value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected static final String CONVERT_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getConvert() <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConvert()
- * @generated
- * @ordered
- */
- protected String convert = CONVERT_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getConverters() <em>Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlConverter> converters;
-
- /**
- * The cached value of the '{@link #getTypeConverters() <em>Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlTypeConverter> typeConverters;
-
- /**
- * The cached value of the '{@link #getObjectTypeConverters() <em>Object Type Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getObjectTypeConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlObjectTypeConverter> objectTypeConverters;
-
- /**
- * The cached value of the '{@link #getStructConverters() <em>Struct Converters</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #getStructConverters()
- * @generated
- * @ordered
- */
- protected EList<XmlStructConverter> structConverters;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- protected XmlVersion()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- protected EClass eStaticClass()
- {
- return EclipseLinkOrmPackage.Literals.XML_VERSION;
- }
-
- /**
- * Returns the value of the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attribute Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attribute Type</em>' attribute.
- * @see #setAttributeType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAttributeMapping_AttributeType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getAttributeType()
- {
- return attributeType;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getAttributeType <em>Attribute Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Attribute Type</em>' attribute.
- * @see #getAttributeType()
- * @generated
- */
- public void setAttributeType(String newAttributeType)
- {
- String oldAttributeType = attributeType;
- attributeType = newAttributeType;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE, oldAttributeType, attributeType));
- }
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlVersion_2_2_Index()
- * @model containment="true"
- * @generated
- */
- public XmlIndex_2_2 getIndex()
- {
- return index;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetIndex(XmlIndex_2_2 newIndex, NotificationChain msgs)
- {
- XmlIndex_2_2 oldIndex = index;
- index = newIndex;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__INDEX, oldIndex, newIndex);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- public void setIndex(XmlIndex_2_2 newIndex)
- {
- if (newIndex != index)
- {
- NotificationChain msgs = null;
- if (index != null)
- msgs = ((InternalEObject)index).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__INDEX, null, msgs);
- if (newIndex != null)
- msgs = ((InternalEObject)newIndex).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__INDEX, null, msgs);
- msgs = basicSetIndex(newIndex, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__INDEX, newIndex, newIndex));
- }
-
- /**
- * Returns the value of the '<em><b>Mutable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Mutable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Mutable</em>' attribute.
- * @see #setMutable(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlMutable_Mutable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- public Boolean getMutable()
- {
- return mutable;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getMutable <em>Mutable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Mutable</em>' attribute.
- * @see #getMutable()
- * @generated
- */
- public void setMutable(Boolean newMutable)
- {
- Boolean oldMutable = mutable;
- mutable = newMutable;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__MUTABLE, oldMutable, mutable));
- }
-
- /**
- * Returns the value of the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Convert</em>' attribute.
- * @see #setConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConvertibleMapping_Convert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- public String getConvert()
- {
- return convert;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getConvert <em>Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Convert</em>' attribute.
- * @see #getConvert()
- * @generated
- */
- public void setConvert(String newConvert)
- {
- String oldConvert = convert;
- convert = newConvert;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__CONVERT, oldConvert, convert));
- }
-
- /**
- * Returns the value of the '<em><b>Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_Converters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlConverter> getConverters()
- {
- if (converters == null)
- {
- converters = new EObjectContainmentEList<XmlConverter>(XmlConverter.class, this, EclipseLinkOrmPackage.XML_VERSION__CONVERTERS);
- }
- return converters;
- }
-
- /**
- * Returns the value of the '<em><b>Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_TypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlTypeConverter> getTypeConverters()
- {
- if (typeConverters == null)
- {
- typeConverters = new EObjectContainmentEList<XmlTypeConverter>(XmlTypeConverter.class, this, EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTERS);
- }
- return typeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Object Type Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Object Type Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Object Type Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_ObjectTypeConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlObjectTypeConverter> getObjectTypeConverters()
- {
- if (objectTypeConverters == null)
- {
- objectTypeConverters = new EObjectContainmentEList<XmlObjectTypeConverter>(XmlObjectTypeConverter.class, this, EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTERS);
- }
- return objectTypeConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Struct Converters</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct Converters</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct Converters</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlConverterContainer_StructConverters()
- * @model containment="true"
- * @generated
- */
- public EList<XmlStructConverter> getStructConverters()
- {
- if (structConverters == null)
- {
- structConverters = new EObjectContainmentEList<XmlStructConverter>(XmlStructConverter.class, this, EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTERS);
- }
- return structConverters;
- }
-
- /**
- * Returns the value of the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Access Methods</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Access Methods</em>' containment reference.
- * @see #setAccessMethods(XmlAccessMethods)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlAccessMethodsHolder_AccessMethods()
- * @model containment="true"
- * @generated
- */
- public XmlAccessMethods getAccessMethods()
- {
- return accessMethods;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public NotificationChain basicSetAccessMethods(XmlAccessMethods newAccessMethods, NotificationChain msgs)
- {
- XmlAccessMethods oldAccessMethods = accessMethods;
- accessMethods = newAccessMethods;
- if (eNotificationRequired())
- {
- ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS, oldAccessMethods, newAccessMethods);
- if (msgs == null) msgs = notification; else msgs.add(notification);
- }
- return msgs;
- }
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion#getAccessMethods <em>Access Methods</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Access Methods</em>' containment reference.
- * @see #getAccessMethods()
- * @generated
- */
- public void setAccessMethods(XmlAccessMethods newAccessMethods)
- {
- if (newAccessMethods != accessMethods)
- {
- NotificationChain msgs = null;
- if (accessMethods != null)
- msgs = ((InternalEObject)accessMethods).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS, null, msgs);
- if (newAccessMethods != null)
- msgs = ((InternalEObject)newAccessMethods).eInverseAdd(this, EOPPOSITE_FEATURE_BASE - EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS, null, msgs);
- msgs = basicSetAccessMethods(newAccessMethods, msgs);
- if (msgs != null) msgs.dispatch();
- }
- else if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS, newAccessMethods, newAccessMethods));
- }
-
- /**
- * Returns the value of the '<em><b>Properties</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlProperty}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Properties</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Properties</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage#getXmlPropertyContainer_Properties()
- * @model containment="true"
- * @generated
- */
- public EList<XmlProperty> getProperties()
- {
- if (properties == null)
- {
- properties = new EObjectContainmentEList<XmlProperty>(XmlProperty.class, this, EclipseLinkOrmPackage.XML_VERSION__PROPERTIES);
- }
- return properties;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs)
- {
- switch (featureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__INDEX:
- return basicSetIndex(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- return basicSetAccessMethods(null, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- return ((InternalEList<?>)getProperties()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTERS:
- return ((InternalEList<?>)getConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTERS:
- return ((InternalEList<?>)getTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTERS:
- return ((InternalEList<?>)getObjectTypeConverters()).basicRemove(otherEnd, msgs);
- case EclipseLinkOrmPackage.XML_VERSION__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_VERSION__INDEX:
- return getIndex();
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- return getAccessMethods();
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- return getProperties();
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE:
- return getAttributeType();
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE:
- return getMutable();
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT:
- return getConvert();
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTERS:
- return getConverters();
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTERS:
- return getTypeConverters();
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTERS:
- return getObjectTypeConverters();
- case EclipseLinkOrmPackage.XML_VERSION__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_VERSION__INDEX:
- setIndex((XmlIndex_2_2)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- getProperties().clear();
- getProperties().addAll((Collection<? extends XmlProperty>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE:
- setAttributeType((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE:
- setMutable((Boolean)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT:
- setConvert((String)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTERS:
- getConverters().clear();
- getConverters().addAll((Collection<? extends XmlConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTERS:
- getTypeConverters().clear();
- getTypeConverters().addAll((Collection<? extends XmlTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- getObjectTypeConverters().addAll((Collection<? extends XmlObjectTypeConverter>)newValue);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__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_VERSION__INDEX:
- setIndex((XmlIndex_2_2)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- setAccessMethods((XmlAccessMethods)null);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- getProperties().clear();
- return;
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE:
- setAttributeType(ATTRIBUTE_TYPE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE:
- setMutable(MUTABLE_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT:
- setConvert(CONVERT_EDEFAULT);
- return;
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTERS:
- getConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTERS:
- getTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTERS:
- getObjectTypeConverters().clear();
- return;
- case EclipseLinkOrmPackage.XML_VERSION__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_VERSION__INDEX:
- return index != null;
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS:
- return accessMethods != null;
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES:
- return properties != null && !properties.isEmpty();
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE:
- return ATTRIBUTE_TYPE_EDEFAULT == null ? attributeType != null : !ATTRIBUTE_TYPE_EDEFAULT.equals(attributeType);
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE:
- return MUTABLE_EDEFAULT == null ? mutable != null : !MUTABLE_EDEFAULT.equals(mutable);
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT:
- return CONVERT_EDEFAULT == null ? convert != null : !CONVERT_EDEFAULT.equals(convert);
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTERS:
- return converters != null && !converters.isEmpty();
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTERS:
- return typeConverters != null && !typeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTERS:
- return objectTypeConverters != null && !objectTypeConverters.isEmpty();
- case EclipseLinkOrmPackage.XML_VERSION__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 == XmlVersion_2_2.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__INDEX: return EclipseLinkOrmV2_2Package.XML_VERSION_22__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__PROPERTIES: return EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__MUTABLE: return EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__CONVERT: return EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (derivedFeatureID)
- {
- case EclipseLinkOrmPackage.XML_VERSION__CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
- case EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_VERSION__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__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 == XmlVersion_2_2.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmV2_2Package.XML_VERSION_22__INDEX: return EclipseLinkOrmPackage.XML_VERSION__INDEX;
- default: return -1;
- }
- }
- if (baseClass == XmlAccessMethodsHolder.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS: return EclipseLinkOrmPackage.XML_VERSION__ACCESS_METHODS;
- default: return -1;
- }
- }
- if (baseClass == XmlPropertyContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_PROPERTY_CONTAINER__PROPERTIES: return EclipseLinkOrmPackage.XML_VERSION__PROPERTIES;
- default: return -1;
- }
- }
- if (baseClass == XmlAttributeMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE: return EclipseLinkOrmPackage.XML_VERSION__ATTRIBUTE_TYPE;
- default: return -1;
- }
- }
- if (baseClass == XmlMutable.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_MUTABLE__MUTABLE: return EclipseLinkOrmPackage.XML_VERSION__MUTABLE;
- default: return -1;
- }
- }
- if (baseClass == XmlConvertibleMapping.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTIBLE_MAPPING__CONVERT: return EclipseLinkOrmPackage.XML_VERSION__CONVERT;
- default: return -1;
- }
- }
- if (baseClass == XmlConverterContainer.class)
- {
- switch (baseFeatureID)
- {
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS: return EclipseLinkOrmPackage.XML_VERSION__CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_VERSION__TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS: return EclipseLinkOrmPackage.XML_VERSION__OBJECT_TYPE_CONVERTERS;
- case EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS: return EclipseLinkOrmPackage.XML_VERSION__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(" (attributeType: ");
- result.append(attributeType);
- result.append(", mutable: ");
- result.append(mutable);
- result.append(", convert: ");
- result.append(convert);
- result.append(')');
- return result.toString();
- }
-
- public TextRange getMutableTextRange() {
- return getAttributeTextRange(EclipseLink.MUTABLE);
- }
-
- public TextRange getConvertTextRange() {
- return getElementTextRange(EclipseLink.CONVERT);
- }
-
- public TextRange getAttributeTypeTextRange() {
- return getAttributeTextRange(EclipseLink2_1.ATTRIBUTE_TYPE);
- }
-
-
- // ********** translators **********
-
- public static Translator buildTranslator(String elementName, EStructuralFeature structuralFeature) {
- return new SimpleTranslator(
- elementName,
- structuralFeature,
- EclipseLinkOrmPackage.eINSTANCE.getXmlVersion(),
- buildTranslatorChildren());
- }
-
- private static Translator[] buildTranslatorChildren() {
- return new Translator[] {
- buildNameTranslator(),
- buildAccessTranslator(),
- buildMutableTranslator(),
- buildAttributeTypeTranslator(),
- buildColumnTranslator(),
- buildIndexTranslator(),
- buildTemporalTranslator(),
- buildConvertTranslator(),
- buildConverterTranslator(),
- buildTypeConverterTranslator(),
- buildObjectTypeConverterTranslator(),
- buildStructConverterTranslator(),
- buildPropertyTranslator(),
- buildAccessMethodsTranslator()
- };
- }
-
- protected static Translator buildMutableTranslator() {
- return new Translator(EclipseLink.MUTABLE, EclipseLinkOrmPackage.eINSTANCE.getXmlMutable_Mutable(), Translator.DOM_ATTRIBUTE);
- }
-
- protected static Translator buildIndexTranslator() {
- return XmlIndex.buildTranslator(EclipseLink2_2.INDEX, EclipseLinkOrmV2_2Package.eINSTANCE.getXmlVersion_2_2_Index());
- }
-
- protected static Translator buildConvertTranslator() {
- return new Translator(EclipseLink.CONVERT, EclipseLinkOrmPackage.eINSTANCE.getXmlConvertibleMapping_Convert());
- }
-
- protected static Translator buildConverterTranslator() {
- return XmlConverter.buildTranslator(EclipseLink.CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_Converters());
- }
-
- protected static Translator buildTypeConverterTranslator() {
- return XmlTypeConverter.buildTranslator(EclipseLink.TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_TypeConverters());
- }
-
- protected static Translator buildObjectTypeConverterTranslator() {
- return XmlObjectTypeConverter.buildTranslator(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_ObjectTypeConverters());
- }
-
- protected static Translator buildStructConverterTranslator() {
- return XmlStructConverter.buildTranslator(EclipseLink.STRUCT_CONVERTER, EclipseLinkOrmPackage.eINSTANCE.getXmlConverterContainer_StructConverters());
- }
-
- protected static Translator buildPropertyTranslator() {
- return XmlProperty.buildTranslator(EclipseLink.PROPERTY, EclipseLinkOrmPackage.eINSTANCE.getXmlPropertyContainer_Properties());
- }
-
- protected static Translator buildAccessMethodsTranslator() {
- return XmlAccessMethods.buildTranslator(EclipseLink.ACCESS_METHODS, EclipseLinkOrmPackage.eINSTANCE.getXmlAccessMethodsHolder_AccessMethods());
- }
-
- protected static Translator buildAttributeTypeTranslator() {
- return new Translator(EclipseLink2_1.ATTRIBUTE_TYPE, EclipseLinkOrmPackage.eINSTANCE.getXmlAttributeMapping_AttributeType(), Translator.DOM_ATTRIBUTE);
- }
-
- // *********** content assist ************
-
- protected TextRange getConvertCodeAssistTextRange() {
- return getElementCodeAssistTextRange(EclipseLink.CONVERT);
- }
-
- public boolean convertTouches(int pos) {
- TextRange textRange = this.getConvertCodeAssistTextRange();
- return (textRange != null) && (textRange.touches(pos));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java
deleted file mode 100644
index 67a19897f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLink1_1.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-
-@SuppressWarnings("nls")
-public interface EclipseLink1_1
- extends EclipseLink
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_1.xsd";
- String SCHEMA_VERSION = "1.1";
-
- // EclipseLink 1.1 specific nodes
-
- String PRIMARY_KEY = "primary-key"; //$NON-NLS-1$
- String PRIMARY_KEY__VALIDATION = "validation"; //$NON-NLS-1$
- String PRIMARY_KEY__COLUMN = "column"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java
deleted file mode 100644
index e96e4dc88e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Factory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package
- * @generated
- */
-public class EclipseLinkOrmV1_1Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV1_1Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV1_1Factory init()
- {
- try
- {
- EclipseLinkOrmV1_1Factory theEclipseLinkOrmV1_1Factory = (EclipseLinkOrmV1_1Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v1_1.xmi");
- if (theEclipseLinkOrmV1_1Factory != null)
- {
- return theEclipseLinkOrmV1_1Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV1_1Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV1_1Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV1_1Package.ID_VALIDATION_TYPE_11:
- return createIdValidationType_1_1FromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV1_1Package.ID_VALIDATION_TYPE_11:
- return convertIdValidationType_1_1ToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public IdValidationType_1_1 createIdValidationType_1_1FromString(EDataType eDataType, String initialValue)
- {
- IdValidationType_1_1 result = IdValidationType_1_1.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertIdValidationType_1_1ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV1_1Package getEclipseLinkOrmV1_1Package()
- {
- return (EclipseLinkOrmV1_1Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV1_1Package getPackage()
- {
- return EclipseLinkOrmV1_1Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV1_1Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java
deleted file mode 100644
index 42e5d8554d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/EclipseLinkOrmV1_1Package.java
+++ /dev/null
@@ -1,696 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV1_1Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v1_1";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v1_1.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV1_1Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1 <em>Xml Basic 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlBasic_1_1()
- * @generated
- */
- public static final int XML_BASIC_11 = 0;
-
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_11__SEQUENCE_GENERATOR = OrmPackage.XML_GENERATOR_CONTAINER__SEQUENCE_GENERATOR;
-
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_11__TABLE_GENERATOR = OrmPackage.XML_GENERATOR_CONTAINER__TABLE_GENERATOR;
-
- /**
- * The feature id for the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_11__GENERATED_VALUE = OrmPackage.XML_GENERATOR_CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic 11</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_11_FEATURE_COUNT = OrmPackage.XML_GENERATOR_CONTAINER_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1 <em>Xml Entity 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlEntity_1_1()
- * @generated
- */
- public static final int XML_ENTITY_11 = 1;
-
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_11__PRIMARY_KEY = 0;
-
- /**
- * The number of structural features of the '<em>Xml Entity 11</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_11_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1 <em>Xml Mapped Superclass 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlMappedSuperclass_1_1()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_11 = 2;
-
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY = 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 11</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_11_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1 <em>Xml Primary Key 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1()
- * @generated
- */
- public static final int XML_PRIMARY_KEY_11 = 3;
-
- /**
- * The feature id for the '<em><b>Validation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_11__VALIDATION = 0;
-
- /**
- * The feature id for the '<em><b>Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_11__COLUMNS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Primary Key 11</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_11_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1 <em>Id Validation Type 11</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getIdValidationType_1_1()
- * @generated
- */
- public static final int ID_VALIDATION_TYPE_11 = 4;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasic_1_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_1_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_1_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrimaryKey_1_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum idValidationType_1_1EEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV1_1Package()
- {
- super(eNS_URI, EclipseLinkOrmV1_1Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV1_1Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV1_1Package init()
- {
- if (isInited) return (EclipseLinkOrmV1_1Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV1_1Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV1_1Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV1_1Package.eNS_URI, theEclipseLinkOrmV1_1Package);
- return theEclipseLinkOrmV1_1Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1 <em>Xml Basic 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1
- * @generated
- */
- public EClass getXmlBasic_1_1()
- {
- return xmlBasic_1_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1#getGeneratedValue <em>Generated Value</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Generated Value</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1#getGeneratedValue()
- * @see #getXmlBasic_1_1()
- * @generated
- */
- public EReference getXmlBasic_1_1_GeneratedValue()
- {
- return (EReference)xmlBasic_1_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1 <em>Xml Entity 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1
- * @generated
- */
- public EClass getXmlEntity_1_1()
- {
- return xmlEntity_1_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1#getPrimaryKey <em>Primary Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Primary Key</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1#getPrimaryKey()
- * @see #getXmlEntity_1_1()
- * @generated
- */
- public EReference getXmlEntity_1_1_PrimaryKey()
- {
- return (EReference)xmlEntity_1_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1 <em>Xml Mapped Superclass 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1
- * @generated
- */
- public EClass getXmlMappedSuperclass_1_1()
- {
- return xmlMappedSuperclass_1_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1#getPrimaryKey <em>Primary Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Primary Key</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1#getPrimaryKey()
- * @see #getXmlMappedSuperclass_1_1()
- * @generated
- */
- public EReference getXmlMappedSuperclass_1_1_PrimaryKey()
- {
- return (EReference)xmlMappedSuperclass_1_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1 <em>Xml Primary Key 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Primary Key 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1
- * @generated
- */
- public EClass getXmlPrimaryKey_1_1()
- {
- return xmlPrimaryKey_1_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getValidation <em>Validation</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Validation</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getValidation()
- * @see #getXmlPrimaryKey_1_1()
- * @generated
- */
- public EAttribute getXmlPrimaryKey_1_1_Validation()
- {
- return (EAttribute)xmlPrimaryKey_1_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getColumns <em>Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getColumns()
- * @see #getXmlPrimaryKey_1_1()
- * @generated
- */
- public EReference getXmlPrimaryKey_1_1_Columns()
- {
- return (EReference)xmlPrimaryKey_1_1EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1 <em>Id Validation Type 11</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Id Validation Type 11</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @generated
- */
- public EEnum getIdValidationType_1_1()
- {
- return idValidationType_1_1EEnum;
- }
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV1_1Factory getEclipseLinkOrmV1_1Factory()
- {
- return (EclipseLinkOrmV1_1Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlBasic_1_1EClass = createEClass(XML_BASIC_11);
- createEReference(xmlBasic_1_1EClass, XML_BASIC_11__GENERATED_VALUE);
-
- xmlEntity_1_1EClass = createEClass(XML_ENTITY_11);
- createEReference(xmlEntity_1_1EClass, XML_ENTITY_11__PRIMARY_KEY);
-
- xmlMappedSuperclass_1_1EClass = createEClass(XML_MAPPED_SUPERCLASS_11);
- createEReference(xmlMappedSuperclass_1_1EClass, XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY);
-
- xmlPrimaryKey_1_1EClass = createEClass(XML_PRIMARY_KEY_11);
- createEAttribute(xmlPrimaryKey_1_1EClass, XML_PRIMARY_KEY_11__VALIDATION);
- createEReference(xmlPrimaryKey_1_1EClass, XML_PRIMARY_KEY_11__COLUMNS);
-
- // Create enums
- idValidationType_1_1EEnum = createEEnum(ID_VALIDATION_TYPE_11);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlBasic_1_1EClass.getESuperTypes().add(theOrmPackage.getXmlGeneratorContainer());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlBasic_1_1EClass, XmlBasic_1_1.class, "XmlBasic_1_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBasic_1_1_GeneratedValue(), theOrmPackage.getXmlGeneratedValue(), null, "generatedValue", null, 0, 1, XmlBasic_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntity_1_1EClass, XmlEntity_1_1.class, "XmlEntity_1_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_1_1_PrimaryKey(), theEclipseLinkOrmPackage.getXmlPrimaryKey(), null, "primaryKey", null, 0, 1, XmlEntity_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_1_1EClass, XmlMappedSuperclass_1_1.class, "XmlMappedSuperclass_1_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_1_1_PrimaryKey(), theEclipseLinkOrmPackage.getXmlPrimaryKey(), null, "primaryKey", null, 0, 1, XmlMappedSuperclass_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPrimaryKey_1_1EClass, XmlPrimaryKey_1_1.class, "XmlPrimaryKey_1_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPrimaryKey_1_1_Validation(), this.getIdValidationType_1_1(), "validation", null, 0, 1, XmlPrimaryKey_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPrimaryKey_1_1_Columns(), theOrmPackage.getXmlColumn(), null, "columns", null, 0, -1, XmlPrimaryKey_1_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(idValidationType_1_1EEnum, IdValidationType_1_1.class, "IdValidationType_1_1");
- addEEnumLiteral(idValidationType_1_1EEnum, IdValidationType_1_1.NULL);
- addEEnumLiteral(idValidationType_1_1EEnum, IdValidationType_1_1.ZERO);
- addEEnumLiteral(idValidationType_1_1EEnum, IdValidationType_1_1.NONE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1 <em>Xml Basic 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlBasic_1_1()
- * @generated
- */
- public static final EClass XML_BASIC_11 = eINSTANCE.getXmlBasic_1_1();
-
- /**
- * The meta object literal for the '<em><b>Generated Value</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BASIC_11__GENERATED_VALUE = eINSTANCE.getXmlBasic_1_1_GeneratedValue();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1 <em>Xml Entity 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlEntity_1_1()
- * @generated
- */
- public static final EClass XML_ENTITY_11 = eINSTANCE.getXmlEntity_1_1();
-
- /**
- * The meta object literal for the '<em><b>Primary Key</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_11__PRIMARY_KEY = eINSTANCE.getXmlEntity_1_1_PrimaryKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1 <em>Xml Mapped Superclass 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlMappedSuperclass_1_1()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_11 = eINSTANCE.getXmlMappedSuperclass_1_1();
-
- /**
- * The meta object literal for the '<em><b>Primary Key</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_11__PRIMARY_KEY = eINSTANCE.getXmlMappedSuperclass_1_1_PrimaryKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1 <em>Xml Primary Key 11</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1()
- * @generated
- */
- public static final EClass XML_PRIMARY_KEY_11 = eINSTANCE.getXmlPrimaryKey_1_1();
-
- /**
- * The meta object literal for the '<em><b>Validation</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PRIMARY_KEY_11__VALIDATION = eINSTANCE.getXmlPrimaryKey_1_1_Validation();
-
- /**
- * The meta object literal for the '<em><b>Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PRIMARY_KEY_11__COLUMNS = eINSTANCE.getXmlPrimaryKey_1_1_Columns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1 <em>Id Validation Type 11</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getIdValidationType_1_1()
- * @generated
- */
- public static final EEnum ID_VALIDATION_TYPE_11 = eINSTANCE.getIdValidationType_1_1();
-
- }
-
-} //EclipseLinkOrmV1_1Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java
deleted file mode 100644
index 86526aa17f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/IdValidationType_1_1.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Id Validation Type 11</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getIdValidationType_1_1()
- * @model
- * @generated
- */
-public enum IdValidationType_1_1 implements Enumerator
-{
- /**
- * The '<em><b>NULL</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NULL_VALUE
- * @generated
- * @ordered
- */
- NULL(0, "NULL", "NULL"),
-
- /**
- * The '<em><b>ZERO</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ZERO_VALUE
- * @generated
- * @ordered
- */
- ZERO(2, "ZERO", "ZERO"),
-
- /**
- * The '<em><b>NONE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NONE_VALUE
- * @generated
- * @ordered
- */
- NONE(2, "NONE", "NONE");
-
- /**
- * The '<em><b>NULL</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NULL</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NULL
- * @model
- * @generated
- * @ordered
- */
- public static final int NULL_VALUE = 0;
-
- /**
- * The '<em><b>ZERO</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ZERO</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ZERO
- * @model
- * @generated
- * @ordered
- */
- public static final int ZERO_VALUE = 2;
-
- /**
- * The '<em><b>NONE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NONE
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Id Validation Type 11</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final IdValidationType_1_1[] VALUES_ARRAY =
- new IdValidationType_1_1[]
- {
- NULL,
- ZERO,
- NONE,
- };
-
- /**
- * A public read-only list of all the '<em><b>Id Validation Type 11</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<IdValidationType_1_1> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Id Validation Type 11</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static IdValidationType_1_1 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- IdValidationType_1_1 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Id Validation Type 11</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static IdValidationType_1_1 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- IdValidationType_1_1 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Id Validation Type 11</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static IdValidationType_1_1 get(int value)
- {
- switch (value)
- {
- case NULL_VALUE: return NULL;
- case ZERO_VALUE: return ZERO;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private IdValidationType_1_1(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //IdValidationType_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java
deleted file mode 100644
index 62f5765c4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlBasic_1_1.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratorContainer;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic 11</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1#getGeneratedValue <em>Generated Value</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlBasic_1_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlBasic_1_1 extends XmlGeneratorContainer
-{
- /**
- * Returns the value of the '<em><b>Generated Value</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Generated Value</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Generated Value</em>' containment reference.
- * @see #setGeneratedValue(XmlGeneratedValue)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlBasic_1_1_GeneratedValue()
- * @model containment="true"
- * @generated
- */
- XmlGeneratedValue getGeneratedValue();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlBasic_1_1#getGeneratedValue <em>Generated Value</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Generated Value</em>' containment reference.
- * @see #getGeneratedValue()
- * @generated
- */
- void setGeneratedValue(XmlGeneratedValue value);
-
-} // XmlBasic_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java
deleted file mode 100644
index 69bdd82004..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlEntity_1_1.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 11</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1#getPrimaryKey <em>Primary Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlEntity_1_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntity_1_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' containment reference.
- * @see #setPrimaryKey(XmlPrimaryKey)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlEntity_1_1_PrimaryKey()
- * @model containment="true"
- * @generated
- */
- XmlPrimaryKey getPrimaryKey();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlEntity_1_1#getPrimaryKey <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' containment reference.
- * @see #getPrimaryKey()
- * @generated
- */
- void setPrimaryKey(XmlPrimaryKey value);
-
-} // XmlEntity_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java
deleted file mode 100644
index 7451f79963..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlMappedSuperclass_1_1.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPrimaryKey;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 11</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1#getPrimaryKey <em>Primary Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlMappedSuperclass_1_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMappedSuperclass_1_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' containment reference.
- * @see #setPrimaryKey(XmlPrimaryKey)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlMappedSuperclass_1_1_PrimaryKey()
- * @model containment="true"
- * @generated
- */
- XmlPrimaryKey getPrimaryKey();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlMappedSuperclass_1_1#getPrimaryKey <em>Primary Key</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' containment reference.
- * @see #getPrimaryKey()
- * @generated
- */
- void setPrimaryKey(XmlPrimaryKey value);
-
-} // XmlMappedSuperclass_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java
deleted file mode 100644
index 8388ed1714..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_1/XmlPrimaryKey_1_1.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlColumn;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Primary Key 11</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getValidation <em>Validation</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getColumns <em>Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPrimaryKey_1_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Validation</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Validation</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Validation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #setValidation(IdValidationType_1_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1_Validation()
- * @model
- * @generated
- */
- IdValidationType_1_1 getValidation();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.XmlPrimaryKey_1_1#getValidation <em>Validation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Validation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.IdValidationType_1_1
- * @see #getValidation()
- * @generated
- */
- void setValidation(IdValidationType_1_1 value);
-
- /**
- * Returns the value of the '<em><b>Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlColumn}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package#getXmlPrimaryKey_1_1_Columns()
- * @model containment="true"
- * @generated
- */
- EList<XmlColumn> getColumns();
-
-} // XmlPrimaryKey_1_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java
deleted file mode 100644
index 9ae73b0371..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v1_2/EclipseLink1_2.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-
-@SuppressWarnings("nls")
-public interface EclipseLink1_2
- extends EclipseLink1_1
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_1_2.xsd";
- String SCHEMA_VERSION = "1.2";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java
deleted file mode 100644
index f7663cce81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLink2_0.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.JPA2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_0
- extends EclipseLink1_1, JPA2_0
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_0.xsd";
- String SCHEMA_VERSION = "2.0";
-
- // EclipseLink 2.0 specific nodes
-
- String CACHE_INTERCEPTOR = "cache-interceptor";
-
- String CORRECTION_TYPE = "correction-type";
- String MAP_KEY_ASSOCIATION_OVERRIDE = "map-key-association-override";
-
- String QUERY_REDIRECTORS = "query-redirectors";
- String QUERY_REDIRECTORS__ALL_QUERIES = "all-queries";
- String QUERY_REDIRECTORS__READ_ALL = "read-all";
- String QUERY_REDIRECTORS__READ_OBJECT = "read-object";
- String QUERY_REDIRECTORS__REPORT = "report";
- String QUERY_REDIRECTORS__UPDATE = "update";
- String QUERY_REDIRECTORS__INSERT = "insert";
- String QUERY_REDIRECTORS__DELETE = "delete";
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java
deleted file mode 100644
index 9c17c127d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Factory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package
- * @generated
- */
-public class EclipseLinkOrmV2_0Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_0Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_0Factory init()
- {
- try
- {
- EclipseLinkOrmV2_0Factory theEclipseLinkOrmV2_0Factory = (EclipseLinkOrmV2_0Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_0.xmi");
- if (theEclipseLinkOrmV2_0Factory != null)
- {
- return theEclipseLinkOrmV2_0Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_0Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_0Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_0Package.ORDER_CORRECTION_TYPE_20:
- return createOrderCorrectionType_2_0FromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_0Package.ORDER_CORRECTION_TYPE_20:
- return convertOrderCorrectionType_2_0ToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public OrderCorrectionType_2_0 createOrderCorrectionType_2_0FromString(EDataType eDataType, String initialValue)
- {
- OrderCorrectionType_2_0 result = OrderCorrectionType_2_0.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertOrderCorrectionType_2_0ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_0Package getEclipseLinkOrmV2_0Package()
- {
- return (EclipseLinkOrmV2_0Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_0Package getPackage()
- {
- return EclipseLinkOrmV2_0Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_0Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java
deleted file mode 100644
index a6c55ca98b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/EclipseLinkOrmV2_0Package.java
+++ /dev/null
@@ -1,1533 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.OrmV2_0Package;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_0Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_0";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_0.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_0Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0 <em>Xml Map Key Association Override Container 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMapKeyAssociationOverrideContainer_2_0()
- * @generated
- */
- public static final int XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20 = 4;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES = 0;
-
- /**
- * The number of structural features of the '<em>Xml Map Key Association Override Container 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0 <em>Xml Collection Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCollectionMapping_2_0()
- * @generated
- */
- public static final int XML_COLLECTION_MAPPING_20 = 0;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_MAPPING_20__MAP_KEY_ASSOCIATION_OVERRIDES = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES;
-
- /**
- * The feature id for the '<em><b>Converters</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_MAPPING_20__CONVERTERS = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_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_COLLECTION_MAPPING_20__TYPE_CONVERTERS = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_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_COLLECTION_MAPPING_20__OBJECT_TYPE_CONVERTERS = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_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_COLLECTION_MAPPING_20__STRUCT_CONVERTERS = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Xml Collection Mapping 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_MAPPING_20_FEATURE_COUNT = XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20_FEATURE_COUNT + 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0 <em>Xml Element Collection 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlElementCollection_2_0()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_20 = 1;
-
- /**
- * The feature id for the '<em><b>Access</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__ACCESS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ACCESS;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__NAME = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__NAME;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__ACCESS_METHODS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ACCESS_METHODS;
-
- /**
- * The feature id for the '<em><b>Properties</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__PROPERTIES = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__PROPERTIES;
-
- /**
- * The feature id for the '<em><b>Attribute Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__ATTRIBUTE_TYPE = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING__ATTRIBUTE_TYPE;
-
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__LOB = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__TEMPORAL = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__ENUMERATED = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__CONVERT = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__MAP_KEY_ASSOCIATION_OVERRIDES = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_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_ELEMENT_COLLECTION_20__CONVERTERS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_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_ELEMENT_COLLECTION_20__TYPE_CONVERTERS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_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_ELEMENT_COLLECTION_20__OBJECT_TYPE_CONVERTERS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_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_ELEMENT_COLLECTION_20__STRUCT_CONVERTERS = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 8;
-
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20__MAP_KEY_CONVERT = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 9;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_20_FEATURE_COUNT = EclipseLinkOrmPackage.XML_ATTRIBUTE_MAPPING_FEATURE_COUNT + 10;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0 <em>Xml Entity 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0()
- * @generated
- */
- public static final int XML_ENTITY_20 = 2;
-
- /**
- * The feature id for the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_20__CACHE_INTERCEPTOR = 0;
-
- /**
- * The feature id for the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_20__QUERY_REDIRECTORS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Entity 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_20_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0 <em>Xml Many To Many 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlManyToMany_2_0()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_20 = 3;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20__MAP_KEY_ASSOCIATION_OVERRIDES = XML_COLLECTION_MAPPING_20__MAP_KEY_ASSOCIATION_OVERRIDES;
-
- /**
- * 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_MANY_TO_MANY_20__CONVERTERS = XML_COLLECTION_MAPPING_20__CONVERTERS;
-
- /**
- * 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_MANY_TO_MANY_20__TYPE_CONVERTERS = XML_COLLECTION_MAPPING_20__TYPE_CONVERTERS;
-
- /**
- * 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_MANY_TO_MANY_20__OBJECT_TYPE_CONVERTERS = XML_COLLECTION_MAPPING_20__OBJECT_TYPE_CONVERTERS;
-
- /**
- * 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_MANY_TO_MANY_20__STRUCT_CONVERTERS = XML_COLLECTION_MAPPING_20__STRUCT_CONVERTERS;
-
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20__MAP_KEY_CONVERT = XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_20_FEATURE_COUNT = XML_COLLECTION_MAPPING_20_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0 <em>Xml Mapped Superclass 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMappedSuperclass_2_0()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_20 = 5;
-
- /**
- * The feature id for the '<em><b>Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_20__CACHEABLE = OrmV2_0Package.XML_CACHEABLE_20__CACHEABLE;
-
- /**
- * The feature id for the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR = OrmV2_0Package.XML_CACHEABLE_20_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_20_FEATURE_COUNT = OrmV2_0Package.XML_CACHEABLE_20_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0 <em>Xml One To Many 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOneToMany_2_0()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_20 = 6;
-
- /**
- * The feature id for the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20__MAP_KEY_ASSOCIATION_OVERRIDES = XML_COLLECTION_MAPPING_20__MAP_KEY_ASSOCIATION_OVERRIDES;
-
- /**
- * 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_ONE_TO_MANY_20__CONVERTERS = XML_COLLECTION_MAPPING_20__CONVERTERS;
-
- /**
- * 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_ONE_TO_MANY_20__TYPE_CONVERTERS = XML_COLLECTION_MAPPING_20__TYPE_CONVERTERS;
-
- /**
- * 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_ONE_TO_MANY_20__OBJECT_TYPE_CONVERTERS = XML_COLLECTION_MAPPING_20__OBJECT_TYPE_CONVERTERS;
-
- /**
- * 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_ONE_TO_MANY_20__STRUCT_CONVERTERS = XML_COLLECTION_MAPPING_20__STRUCT_CONVERTERS;
-
- /**
- * The feature id for the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20__MAP_KEY_CONVERT = XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT;
-
- /**
- * The number of structural features of the '<em>Xml One To Many 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_20_FEATURE_COUNT = XML_COLLECTION_MAPPING_20_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0 <em>Xml Order Column 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOrderColumn_2_0()
- * @generated
- */
- public static final int XML_ORDER_COLUMN_20 = 7;
-
- /**
- * The feature id for the '<em><b>Correction Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN_20__CORRECTION_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Order Column 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ORDER_COLUMN_20_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0 <em>Xml Query Redirectors 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0()
- * @generated
- */
- public static final int XML_QUERY_REDIRECTORS_20 = 8;
-
- /**
- * The feature id for the '<em><b>All Queries</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__ALL_QUERIES = 0;
-
- /**
- * The feature id for the '<em><b>Read All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__READ_ALL = 1;
-
- /**
- * The feature id for the '<em><b>Read Object</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__READ_OBJECT = 2;
-
- /**
- * The feature id for the '<em><b>Report</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__REPORT = 3;
-
- /**
- * The feature id for the '<em><b>Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__UPDATE = 4;
-
- /**
- * The feature id for the '<em><b>Insert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__INSERT = 5;
-
- /**
- * The feature id for the '<em><b>Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20__DELETE = 6;
-
- /**
- * The number of structural features of the '<em>Xml Query Redirectors 20</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_QUERY_REDIRECTORS_20_FEATURE_COUNT = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0 <em>Order Correction Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getOrderCorrectionType_2_0()
- * @generated
- */
- public static final int ORDER_CORRECTION_TYPE_20 = 9;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCollectionMapping_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToMany_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMapKeyAssociationOverrideContainer_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToMany_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOrderColumn_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlQueryRedirectors_2_0EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum orderCorrectionType_2_0EEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_0Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_0Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_0Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_0Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_0Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_0Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_0Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_0Package.eNS_URI, theEclipseLinkOrmV2_0Package);
- return theEclipseLinkOrmV2_0Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0 <em>Xml Collection Mapping 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Collection Mapping 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0
- * @generated
- */
- public EClass getXmlCollectionMapping_2_0()
- {
- return xmlCollectionMapping_2_0EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0#getMapKeyConvert <em>Map Key Convert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Map Key Convert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0#getMapKeyConvert()
- * @see #getXmlCollectionMapping_2_0()
- * @generated
- */
- public EAttribute getXmlCollectionMapping_2_0_MapKeyConvert()
- {
- return (EAttribute)xmlCollectionMapping_2_0EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0 <em>Xml Element Collection 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @generated
- */
- public EClass getXmlElementCollection_2_0()
- {
- return xmlElementCollection_2_0EClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0 <em>Xml Entity 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0
- * @generated
- */
- public EClass getXmlEntity_2_0()
- {
- return xmlEntity_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getCacheInterceptor <em>Cache Interceptor</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Interceptor</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getCacheInterceptor()
- * @see #getXmlEntity_2_0()
- * @generated
- */
- public EReference getXmlEntity_2_0_CacheInterceptor()
- {
- return (EReference)xmlEntity_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getQueryRedirectors <em>Query Redirectors</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Query Redirectors</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getQueryRedirectors()
- * @see #getXmlEntity_2_0()
- * @generated
- */
- public EReference getXmlEntity_2_0_QueryRedirectors()
- {
- return (EReference)xmlEntity_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0 <em>Xml Many To Many 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @generated
- */
- public EClass getXmlManyToMany_2_0()
- {
- return xmlManyToMany_2_0EClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0 <em>Xml Map Key Association Override Container 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Map Key Association Override Container 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0
- * @generated
- */
- public EClass getXmlMapKeyAssociationOverrideContainer_2_0()
- {
- return xmlMapKeyAssociationOverrideContainer_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0#getMapKeyAssociationOverrides <em>Map Key Association Overrides</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Map Key Association Overrides</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0#getMapKeyAssociationOverrides()
- * @see #getXmlMapKeyAssociationOverrideContainer_2_0()
- * @generated
- */
- public EReference getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- {
- return (EReference)xmlMapKeyAssociationOverrideContainer_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0 <em>Xml Mapped Superclass 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_0()
- {
- return xmlMappedSuperclass_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0#getCacheInterceptor <em>Cache Interceptor</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Interceptor</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0#getCacheInterceptor()
- * @see #getXmlMappedSuperclass_2_0()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_0_CacheInterceptor()
- {
- return (EReference)xmlMappedSuperclass_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0 <em>Xml One To Many 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @generated
- */
- public EClass getXmlOneToMany_2_0()
- {
- return xmlOneToMany_2_0EClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0 <em>Xml Order Column 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Order Column 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @generated
- */
- public EClass getXmlOrderColumn_2_0()
- {
- return xmlOrderColumn_2_0EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0#getCorrectionType <em>Correction Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Correction Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0#getCorrectionType()
- * @see #getXmlOrderColumn_2_0()
- * @generated
- */
- public EAttribute getXmlOrderColumn_2_0_CorrectionType()
- {
- return (EAttribute)xmlOrderColumn_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0 <em>Xml Query Redirectors 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Query Redirectors 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0
- * @generated
- */
- public EClass getXmlQueryRedirectors_2_0()
- {
- return xmlQueryRedirectors_2_0EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getAllQueries <em>All Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>All Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getAllQueries()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_AllQueries()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadAll <em>Read All</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Read All</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadAll()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_ReadAll()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadObject <em>Read Object</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Read Object</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadObject()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_ReadObject()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReport <em>Report</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Report</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReport()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_Report()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getUpdate <em>Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Update</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getUpdate()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_Update()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getInsert <em>Insert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Insert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getInsert()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_Insert()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getDelete <em>Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getDelete()
- * @see #getXmlQueryRedirectors_2_0()
- * @generated
- */
- public EAttribute getXmlQueryRedirectors_2_0_Delete()
- {
- return (EAttribute)xmlQueryRedirectors_2_0EClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0 <em>Order Correction Type 20</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Order Correction Type 20</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @generated
- */
- public EEnum getOrderCorrectionType_2_0()
- {
- return orderCorrectionType_2_0EEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_0Factory getEclipseLinkOrmV2_0Factory()
- {
- return (EclipseLinkOrmV2_0Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlCollectionMapping_2_0EClass = createEClass(XML_COLLECTION_MAPPING_20);
- createEAttribute(xmlCollectionMapping_2_0EClass, XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT);
-
- xmlElementCollection_2_0EClass = createEClass(XML_ELEMENT_COLLECTION_20);
-
- xmlEntity_2_0EClass = createEClass(XML_ENTITY_20);
- createEReference(xmlEntity_2_0EClass, XML_ENTITY_20__CACHE_INTERCEPTOR);
- createEReference(xmlEntity_2_0EClass, XML_ENTITY_20__QUERY_REDIRECTORS);
-
- xmlManyToMany_2_0EClass = createEClass(XML_MANY_TO_MANY_20);
-
- xmlMapKeyAssociationOverrideContainer_2_0EClass = createEClass(XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20);
- createEReference(xmlMapKeyAssociationOverrideContainer_2_0EClass, XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES);
-
- xmlMappedSuperclass_2_0EClass = createEClass(XML_MAPPED_SUPERCLASS_20);
- createEReference(xmlMappedSuperclass_2_0EClass, XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR);
-
- xmlOneToMany_2_0EClass = createEClass(XML_ONE_TO_MANY_20);
-
- xmlOrderColumn_2_0EClass = createEClass(XML_ORDER_COLUMN_20);
- createEAttribute(xmlOrderColumn_2_0EClass, XML_ORDER_COLUMN_20__CORRECTION_TYPE);
-
- xmlQueryRedirectors_2_0EClass = createEClass(XML_QUERY_REDIRECTORS_20);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__ALL_QUERIES);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__READ_ALL);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__READ_OBJECT);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__REPORT);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__UPDATE);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__INSERT);
- createEAttribute(xmlQueryRedirectors_2_0EClass, XML_QUERY_REDIRECTORS_20__DELETE);
-
- // Create enums
- orderCorrectionType_2_0EEnum = createEEnum(ORDER_CORRECTION_TYPE_20);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
- OrmV2_0Package theOrmV2_0Package = (OrmV2_0Package)EPackage.Registry.INSTANCE.getEPackage(OrmV2_0Package.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlCollectionMapping_2_0EClass.getESuperTypes().add(this.getXmlMapKeyAssociationOverrideContainer_2_0());
- xmlCollectionMapping_2_0EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlConverterContainer());
- xmlElementCollection_2_0EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAttributeMapping());
- xmlElementCollection_2_0EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlConvertibleMapping());
- xmlElementCollection_2_0EClass.getESuperTypes().add(this.getXmlCollectionMapping_2_0());
- xmlManyToMany_2_0EClass.getESuperTypes().add(this.getXmlCollectionMapping_2_0());
- xmlMappedSuperclass_2_0EClass.getESuperTypes().add(theOrmV2_0Package.getXmlCacheable_2_0());
- xmlOneToMany_2_0EClass.getESuperTypes().add(this.getXmlCollectionMapping_2_0());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlCollectionMapping_2_0EClass, XmlCollectionMapping_2_0.class, "XmlCollectionMapping_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCollectionMapping_2_0_MapKeyConvert(), theXMLTypePackage.getString(), "mapKeyConvert", null, 0, 1, XmlCollectionMapping_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_0EClass, XmlElementCollection_2_0.class, "XmlElementCollection_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEntity_2_0EClass, XmlEntity_2_0.class, "XmlEntity_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_0_CacheInterceptor(), theOrmPackage.getXmlClassReference(), null, "cacheInterceptor", null, 0, 1, XmlEntity_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_0_QueryRedirectors(), theEclipseLinkOrmPackage.getXmlQueryRedirectors(), null, "queryRedirectors", null, 0, 1, XmlEntity_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlManyToMany_2_0EClass, XmlManyToMany_2_0.class, "XmlManyToMany_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlMapKeyAssociationOverrideContainer_2_0EClass, XmlMapKeyAssociationOverrideContainer_2_0.class, "XmlMapKeyAssociationOverrideContainer_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides(), theOrmPackage.getXmlAssociationOverride(), null, "mapKeyAssociationOverrides", null, 0, -1, XmlMapKeyAssociationOverrideContainer_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_2_0EClass, XmlMappedSuperclass_2_0.class, "XmlMappedSuperclass_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_0_CacheInterceptor(), theOrmPackage.getXmlClassReference(), null, "cacheInterceptor", null, 0, 1, XmlMappedSuperclass_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToMany_2_0EClass, XmlOneToMany_2_0.class, "XmlOneToMany_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOrderColumn_2_0EClass, XmlOrderColumn_2_0.class, "XmlOrderColumn_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOrderColumn_2_0_CorrectionType(), this.getOrderCorrectionType_2_0(), "correctionType", null, 0, 1, XmlOrderColumn_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlQueryRedirectors_2_0EClass, XmlQueryRedirectors_2_0.class, "XmlQueryRedirectors_2_0", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlQueryRedirectors_2_0_AllQueries(), theXMLTypePackage.getString(), "allQueries", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_ReadAll(), theXMLTypePackage.getString(), "readAll", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_ReadObject(), theXMLTypePackage.getString(), "readObject", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_Report(), theXMLTypePackage.getString(), "report", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_Update(), theXMLTypePackage.getString(), "update", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_Insert(), theXMLTypePackage.getString(), "insert", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlQueryRedirectors_2_0_Delete(), theXMLTypePackage.getString(), "delete", null, 0, 1, XmlQueryRedirectors_2_0.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(orderCorrectionType_2_0EEnum, OrderCorrectionType_2_0.class, "OrderCorrectionType_2_0");
- addEEnumLiteral(orderCorrectionType_2_0EEnum, OrderCorrectionType_2_0.READ);
- addEEnumLiteral(orderCorrectionType_2_0EEnum, OrderCorrectionType_2_0.READ_WRITE);
- addEEnumLiteral(orderCorrectionType_2_0EEnum, OrderCorrectionType_2_0.EXCEPTION);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0 <em>Xml Collection Mapping 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCollectionMapping_2_0()
- * @generated
- */
- public static final EClass XML_COLLECTION_MAPPING_20 = eINSTANCE.getXmlCollectionMapping_2_0();
-
- /**
- * The meta object literal for the '<em><b>Map Key Convert</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLLECTION_MAPPING_20__MAP_KEY_CONVERT = eINSTANCE.getXmlCollectionMapping_2_0_MapKeyConvert();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0 <em>Xml Element Collection 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlElementCollection_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlElementCollection_2_0()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_20 = eINSTANCE.getXmlElementCollection_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0 <em>Xml Entity 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0()
- * @generated
- */
- public static final EClass XML_ENTITY_20 = eINSTANCE.getXmlEntity_2_0();
-
- /**
- * The meta object literal for the '<em><b>Cache Interceptor</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_20__CACHE_INTERCEPTOR = eINSTANCE.getXmlEntity_2_0_CacheInterceptor();
-
- /**
- * The meta object literal for the '<em><b>Query Redirectors</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_20__QUERY_REDIRECTORS = eINSTANCE.getXmlEntity_2_0_QueryRedirectors();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0 <em>Xml Many To Many 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlManyToMany_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlManyToMany_2_0()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY_20 = eINSTANCE.getXmlManyToMany_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0 <em>Xml Map Key Association Override Container 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMapKeyAssociationOverrideContainer_2_0()
- * @generated
- */
- public static final EClass XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20 = eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0();
-
- /**
- * The meta object literal for the '<em><b>Map Key Association Overrides</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAP_KEY_ASSOCIATION_OVERRIDE_CONTAINER_20__MAP_KEY_ASSOCIATION_OVERRIDES = eINSTANCE.getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0 <em>Xml Mapped Superclass 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMappedSuperclass_2_0()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_20 = eINSTANCE.getXmlMappedSuperclass_2_0();
-
- /**
- * The meta object literal for the '<em><b>Cache Interceptor</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_20__CACHE_INTERCEPTOR = eINSTANCE.getXmlMappedSuperclass_2_0_CacheInterceptor();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0 <em>Xml One To Many 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOneToMany_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOneToMany_2_0()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_20 = eINSTANCE.getXmlOneToMany_2_0();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0 <em>Xml Order Column 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOrderColumn_2_0()
- * @generated
- */
- public static final EClass XML_ORDER_COLUMN_20 = eINSTANCE.getXmlOrderColumn_2_0();
-
- /**
- * The meta object literal for the '<em><b>Correction Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ORDER_COLUMN_20__CORRECTION_TYPE = eINSTANCE.getXmlOrderColumn_2_0_CorrectionType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0 <em>Xml Query Redirectors 20</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0()
- * @generated
- */
- public static final EClass XML_QUERY_REDIRECTORS_20 = eINSTANCE.getXmlQueryRedirectors_2_0();
-
- /**
- * The meta object literal for the '<em><b>All Queries</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__ALL_QUERIES = eINSTANCE.getXmlQueryRedirectors_2_0_AllQueries();
-
- /**
- * The meta object literal for the '<em><b>Read All</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__READ_ALL = eINSTANCE.getXmlQueryRedirectors_2_0_ReadAll();
-
- /**
- * The meta object literal for the '<em><b>Read Object</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__READ_OBJECT = eINSTANCE.getXmlQueryRedirectors_2_0_ReadObject();
-
- /**
- * The meta object literal for the '<em><b>Report</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__REPORT = eINSTANCE.getXmlQueryRedirectors_2_0_Report();
-
- /**
- * The meta object literal for the '<em><b>Update</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__UPDATE = eINSTANCE.getXmlQueryRedirectors_2_0_Update();
-
- /**
- * The meta object literal for the '<em><b>Insert</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__INSERT = eINSTANCE.getXmlQueryRedirectors_2_0_Insert();
-
- /**
- * The meta object literal for the '<em><b>Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_QUERY_REDIRECTORS_20__DELETE = eINSTANCE.getXmlQueryRedirectors_2_0_Delete();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0 <em>Order Correction Type 20</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getOrderCorrectionType_2_0()
- * @generated
- */
- public static final EEnum ORDER_CORRECTION_TYPE_20 = eINSTANCE.getOrderCorrectionType_2_0();
-
- }
-
-} //EclipseLinkOrmV2_0Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java
deleted file mode 100644
index d9a1f50eb9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/OrderCorrectionType_2_0.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Order Column Correction Type 20</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getOrderCorrectionType_2_0()
- * @model
- * @generated
- */
-public enum OrderCorrectionType_2_0 implements Enumerator
-{
- /**
- * The '<em><b>READ</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #READ_VALUE
- * @generated
- * @ordered
- */
- READ(0, "READ", "READ"),
-
- /**
- * The '<em><b>READ WRITE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #READ_WRITE_VALUE
- * @generated
- * @ordered
- */
- READ_WRITE(1, "READ_WRITE", "READ_WRITE"),
-
- /**
- * The '<em><b>EXCEPTION</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #EXCEPTION_VALUE
- * @generated
- * @ordered
- */
- EXCEPTION(2, "EXCEPTION", "EXCEPTION");
-
- /**
- * The '<em><b>READ</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>READ</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #READ
- * @model
- * @generated
- * @ordered
- */
- public static final int READ_VALUE = 0;
-
- /**
- * The '<em><b>READ WRITE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>READ WRITE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #READ_WRITE
- * @model
- * @generated
- * @ordered
- */
- public static final int READ_WRITE_VALUE = 1;
-
- /**
- * The '<em><b>EXCEPTION</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>EXCEPTION</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #EXCEPTION
- * @model
- * @generated
- * @ordered
- */
- public static final int EXCEPTION_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Order Correction Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final OrderCorrectionType_2_0[] VALUES_ARRAY =
- new OrderCorrectionType_2_0[]
- {
- READ,
- READ_WRITE,
- EXCEPTION,
- };
-
- /**
- * A public read-only list of all the '<em><b>Order Correction Type 20</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<OrderCorrectionType_2_0> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Order Correction Type 20</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static OrderCorrectionType_2_0 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- OrderCorrectionType_2_0 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Order Correction Type 20</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static OrderCorrectionType_2_0 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- OrderCorrectionType_2_0 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Order Correction Type 20</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static OrderCorrectionType_2_0 get(int value)
- {
- switch (value)
- {
- case READ_VALUE: return READ;
- case READ_WRITE_VALUE: return READ_WRITE;
- case EXCEPTION_VALUE: return EXCEPTION;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private OrderCorrectionType_2_0(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //OrderColumnCorrectionType_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java
deleted file mode 100644
index 1c09a599ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCacheInterceptor_2_0.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache Interceptor2 0</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCacheInterceptor_2_0#getClassName <em>Class Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCacheInterceptor_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCacheInterceptor_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Class Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Name</em>' attribute.
- * @see #setClassName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCacheInterceptor_2_0_ClassName()
- * @model
- * @generated
- */
- String getClassName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCacheInterceptor_2_0#getClassName <em>Class Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Name</em>' attribute.
- * @see #getClassName()
- * @generated
- */
- void setClassName(String value);
-
-} // XmlCacheInterceptor2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java
deleted file mode 100644
index b44dbf73be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlCollectionMapping_2_0.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Collection Mapping 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0#getMapKeyConvert <em>Map Key Convert</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCollectionMapping_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlCollectionMapping_2_0 extends XmlMapKeyAssociationOverrideContainer_2_0, XmlConverterContainer
-{
- /**
- * Returns the value of the '<em><b>Map Key Convert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Convert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Convert</em>' attribute.
- * @see #setMapKeyConvert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlCollectionMapping_2_0_MapKeyConvert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getMapKeyConvert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlCollectionMapping_2_0#getMapKeyConvert <em>Map Key Convert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Map Key Convert</em>' attribute.
- * @see #getMapKeyConvert()
- * @generated
- */
- void setMapKeyConvert(String value);
-
-} // XmlCollectionMapping_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java
deleted file mode 100644
index 76487d15df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlElementCollection_2_0.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlElementCollection_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlElementCollection_2_0 extends XmlAttributeMapping, XmlConvertibleMapping, XmlCollectionMapping_2_0
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java
deleted file mode 100644
index 142a7d844f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlEntity_2_0.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity2 0</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getCacheInterceptor <em>Cache Interceptor</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getQueryRedirectors <em>Query Redirectors</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntity_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Interceptor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #setCacheInterceptor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0_CacheInterceptor()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getCacheInterceptor();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getCacheInterceptor <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #getCacheInterceptor()
- * @generated
- */
- void setCacheInterceptor(XmlClassReference value);
-
- /**
- * Returns the value of the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Redirectors</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Redirectors</em>' containment reference.
- * @see #setQueryRedirectors(XmlQueryRedirectors)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlEntity_2_0_QueryRedirectors()
- * @model containment="true"
- * @generated
- */
- XmlQueryRedirectors getQueryRedirectors();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlEntity_2_0#getQueryRedirectors <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Redirectors</em>' containment reference.
- * @see #getQueryRedirectors()
- * @generated
- */
- void setQueryRedirectors(XmlQueryRedirectors value);
-
-} // XmlEntity2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java
deleted file mode 100644
index 7d80cffea7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlManyToMany_2_0.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To Many 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlManyToMany_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany_2_0 extends XmlCollectionMapping_2_0
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java
deleted file mode 100644
index 5e56cca4f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMapKeyAssociationOverrideContainer_2_0.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Map Key Association Override Container2 0</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMapKeyAssociationOverrideContainer_2_0#getMapKeyAssociationOverrides <em>Map Key Association Overrides</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMapKeyAssociationOverrideContainer_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMapKeyAssociationOverrideContainer_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Map Key Association Overrides</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Map Key Association Overrides</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Map Key Association Overrides</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMapKeyAssociationOverrideContainer_2_0_MapKeyAssociationOverrides()
- * @model containment="true"
- * @generated
- */
- EList<XmlAssociationOverride> getMapKeyAssociationOverrides();
-
-} // XmlMapKeyAssociationOverrideContainer2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java
deleted file mode 100644
index 20cb2803d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlMappedSuperclass_2_0.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlCacheable_2_0;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0#getCacheInterceptor <em>Cache Interceptor</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMappedSuperclass_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMappedSuperclass_2_0 extends XmlCacheable_2_0
-{
-
- /**
- * Returns the value of the '<em><b>Cache Interceptor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Interceptor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #setCacheInterceptor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlMappedSuperclass_2_0_CacheInterceptor()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getCacheInterceptor();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlMappedSuperclass_2_0#getCacheInterceptor <em>Cache Interceptor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Interceptor</em>' containment reference.
- * @see #getCacheInterceptor()
- * @generated
- */
- void setCacheInterceptor(XmlClassReference value);
-
-} // XmlMappedSuperclass_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java
deleted file mode 100644
index 7df503683c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOneToMany_2_0.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To Many 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOneToMany_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany_2_0 extends XmlCollectionMapping_2_0
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java
deleted file mode 100644
index f7c5c71ed6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlOrderColumn_2_0.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Order Column 20</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0#getCorrectionType <em>Correction Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOrderColumn_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlOrderColumn_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Correction Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Correction Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Correction Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #setCorrectionType(OrderCorrectionType_2_0)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlOrderColumn_2_0_CorrectionType()
- * @model
- * @generated
- */
- OrderCorrectionType_2_0 getCorrectionType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlOrderColumn_2_0#getCorrectionType <em>Correction Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Correction Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.OrderCorrectionType_2_0
- * @see #getCorrectionType()
- * @generated
- */
- void setCorrectionType(OrderCorrectionType_2_0 value);
-
-} // XmlOrderColumn_2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java
deleted file mode 100644
index 38fa1162ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_0/XmlQueryRedirectors_2_0.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Query Redirectors2 0</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getAllQueries <em>All Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadAll <em>Read All</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadObject <em>Read Object</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReport <em>Report</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getUpdate <em>Update</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getInsert <em>Insert</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getDelete <em>Delete</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlQueryRedirectors_2_0 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>All Queries</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>All Queries</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>All Queries</em>' attribute.
- * @see #setAllQueries(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_AllQueries()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getAllQueries();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getAllQueries <em>All Queries</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>All Queries</em>' attribute.
- * @see #getAllQueries()
- * @generated
- */
- void setAllQueries(String value);
-
- /**
- * Returns the value of the '<em><b>Read All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read All</em>' attribute.
- * @see #setReadAll(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_ReadAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getReadAll();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadAll <em>Read All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read All</em>' attribute.
- * @see #getReadAll()
- * @generated
- */
- void setReadAll(String value);
-
- /**
- * Returns the value of the '<em><b>Read Object</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Read Object</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Read Object</em>' attribute.
- * @see #setReadObject(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_ReadObject()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getReadObject();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReadObject <em>Read Object</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Read Object</em>' attribute.
- * @see #getReadObject()
- * @generated
- */
- void setReadObject(String value);
-
- /**
- * Returns the value of the '<em><b>Report</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Report</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Report</em>' attribute.
- * @see #setReport(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Report()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getReport();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getReport <em>Report</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Report</em>' attribute.
- * @see #getReport()
- * @generated
- */
- void setReport(String value);
-
- /**
- * Returns the value of the '<em><b>Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Update</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Update</em>' attribute.
- * @see #setUpdate(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Update()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getUpdate();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getUpdate <em>Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Update</em>' attribute.
- * @see #getUpdate()
- * @generated
- */
- void setUpdate(String value);
-
- /**
- * Returns the value of the '<em><b>Insert</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Insert</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Insert</em>' attribute.
- * @see #setInsert(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Insert()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getInsert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getInsert <em>Insert</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Insert</em>' attribute.
- * @see #getInsert()
- * @generated
- */
- void setInsert(String value);
-
- /**
- * Returns the value of the '<em><b>Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete</em>' attribute.
- * @see #setDelete(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package#getXmlQueryRedirectors_2_0_Delete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.XmlQueryRedirectors_2_0#getDelete <em>Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete</em>' attribute.
- * @see #getDelete()
- * @generated
- */
- void setDelete(String value);
-
-} // XmlQueryRedirectors2_0
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java
deleted file mode 100644
index 6dda927b61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/BatchFetchType_2_1.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Batch Fetch Type 21</b></em>',
- * and utility methods for working with them.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getBatchFetchType_2_1()
- * @model
- * @generated
- */
-public enum BatchFetchType_2_1 implements Enumerator
-{
- /**
- * The '<em><b>JOIN</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #JOIN_VALUE
- * @generated
- * @ordered
- */
- JOIN(0, "JOIN", "JOIN"),
-
- /**
- * The '<em><b>EXISTS</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #EXISTS_VALUE
- * @generated
- * @ordered
- */
- EXISTS(1, "EXISTS", "EXISTS"),
-
- /**
- * The '<em><b>IN</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #IN_VALUE
- * @generated
- * @ordered
- */
- IN(2, "IN", "IN");
-
- /**
- * The '<em><b>JOIN</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>JOIN</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #JOIN
- * @model
- * @generated
- * @ordered
- */
- public static final int JOIN_VALUE = 0;
-
- /**
- * The '<em><b>EXISTS</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>EXISTS</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #EXISTS
- * @model
- * @generated
- * @ordered
- */
- public static final int EXISTS_VALUE = 1;
-
- /**
- * The '<em><b>IN</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>IN</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #IN
- * @model
- * @generated
- * @ordered
- */
- public static final int IN_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Batch Fetch Type 21</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final BatchFetchType_2_1[] VALUES_ARRAY =
- new BatchFetchType_2_1[]
- {
- JOIN,
- EXISTS,
- IN,
- };
-
- /**
- * A public read-only list of all the '<em><b>Batch Fetch Type 21</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<BatchFetchType_2_1> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Batch Fetch Type 21</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static BatchFetchType_2_1 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- BatchFetchType_2_1 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Batch Fetch Type 21</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static BatchFetchType_2_1 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- BatchFetchType_2_1 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Batch Fetch Type 21</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static BatchFetchType_2_1 get(int value)
- {
- switch (value)
- {
- case JOIN_VALUE: return JOIN;
- case EXISTS_VALUE: return EXISTS;
- case IN_VALUE: return IN;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private BatchFetchType_2_1(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //BatchFetchType_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java
deleted file mode 100644
index 6d36604765..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/CacheKeyType_2_1.java
+++ /dev/null
@@ -1,258 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Cache Key Type 21</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getCacheKeyType_2_1()
- * @model
- * @generated
- */
-public enum CacheKeyType_2_1 implements Enumerator
-{
- /**
- * The '<em><b>ID VALUE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ID_VALUE_VALUE
- * @generated
- * @ordered
- */
- ID_VALUE(0, "ID_VALUE", "ID_VALUE"),
-
- /**
- * The '<em><b>CACHE KEY</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #CACHE_KEY_VALUE
- * @generated
- * @ordered
- */
- CACHE_KEY(1, "CACHE_KEY", "CACHE_KEY"),
-
- /**
- * The '<em><b>AUTO</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #AUTO_VALUE
- * @generated
- * @ordered
- */
- AUTO(2, "AUTO", "AUTO");
-
- /**
- * The '<em><b>ID VALUE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ID VALUE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ID_VALUE
- * @model
- * @generated
- * @ordered
- */
- public static final int ID_VALUE_VALUE = 0;
-
- /**
- * The '<em><b>CACHE KEY</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>CACHE KEY</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #CACHE_KEY
- * @model
- * @generated
- * @ordered
- */
- public static final int CACHE_KEY_VALUE = 1;
-
- /**
- * The '<em><b>AUTO</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>AUTO</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #AUTO
- * @model
- * @generated
- * @ordered
- */
- public static final int AUTO_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Cache Key Type 21</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final CacheKeyType_2_1[] VALUES_ARRAY =
- new CacheKeyType_2_1[]
- {
- ID_VALUE,
- CACHE_KEY,
- AUTO,
- };
-
- /**
- * A public read-only list of all the '<em><b>Cache Key Type 21</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<CacheKeyType_2_1> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Cache Key Type 21</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheKeyType_2_1 get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheKeyType_2_1 result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Key Type 21</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheKeyType_2_1 getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheKeyType_2_1 result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Key Type 21</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheKeyType_2_1 get(int value)
- {
- switch (value)
- {
- case ID_VALUE_VALUE: return ID_VALUE;
- case CACHE_KEY_VALUE: return CACHE_KEY;
- case AUTO_VALUE: return AUTO;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private CacheKeyType_2_1(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //CacheKeyType_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java
deleted file mode 100644
index 5bd544a267..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLink2_1.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_1
- extends EclipseLink2_0
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_1.xsd";
- String SCHEMA_VERSION = "2.1";
-
-
- // EclipseLink 2.1 specific nodes
-
- String ATTRIBUTE = "attribute";
- String ATTRIBUTE_TYPE = "attribute-type";
- String BATCH_FETCH = "batch-fetch";
- String BATCH_FETCH__SIZE = "size";
- String BATCH_FETCH__TYPE = "type";
- String CACHE_KEY_TYPE = "cache-key-type";
- String CLASS_EXTRACTOR = "class-extractor";
- String FETCH_GROUP = "fetch-group";
- String FETCH_GROUP__LOAD = "load";
- String PARENT_CLASS = "parent-class";
- String RETURN_INSERT = "return-insert";
- String RETURN_ONLY = "return-only";
- String RETURN_UPDATE = "return-update";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkAccessType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkAccessType.java
deleted file mode 100644
index 1673534f88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkAccessType.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface EclipseLinkAccessType
-{
- String VIRTUAL = "VIRTUAL"; //$NON-NLS-1$
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java
deleted file mode 100644
index b3d74cbfef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Factory.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package
- * @generated
- */
-public class EclipseLinkOrmV2_1Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_1Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_1Factory init()
- {
- try
- {
- EclipseLinkOrmV2_1Factory theEclipseLinkOrmV2_1Factory = (EclipseLinkOrmV2_1Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_1.xmi");
- if (theEclipseLinkOrmV2_1Factory != null)
- {
- return theEclipseLinkOrmV2_1Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_1Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_1Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_1Package.CACHE_KEY_TYPE_21:
- return createCacheKeyType_2_1FromString(eDataType, initialValue);
- case EclipseLinkOrmV2_1Package.BATCH_FETCH_TYPE_21:
- return createBatchFetchType_2_1FromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_1Package.CACHE_KEY_TYPE_21:
- return convertCacheKeyType_2_1ToString(eDataType, instanceValue);
- case EclipseLinkOrmV2_1Package.BATCH_FETCH_TYPE_21:
- return convertBatchFetchType_2_1ToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CacheKeyType_2_1 createCacheKeyType_2_1FromString(EDataType eDataType, String initialValue)
- {
- CacheKeyType_2_1 result = CacheKeyType_2_1.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertCacheKeyType_2_1ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public BatchFetchType_2_1 createBatchFetchType_2_1FromString(EDataType eDataType, String initialValue)
- {
- BatchFetchType_2_1 result = BatchFetchType_2_1.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertBatchFetchType_2_1ToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_1Package getEclipseLinkOrmV2_1Package()
- {
- return (EclipseLinkOrmV2_1Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_1Package getPackage()
- {
- return EclipseLinkOrmV2_1Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_1Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java
deleted file mode 100644
index fa04a9fa08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/EclipseLinkOrmV2_1Package.java
+++ /dev/null
@@ -1,1975 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_1Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_1";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_1.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_1Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1 <em>Xml Basic 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1()
- * @generated
- */
- public static final int XML_BASIC_21 = 0;
-
- /**
- * The feature id for the '<em><b>Return Insert</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_21__RETURN_INSERT = 0;
-
- /**
- * The feature id for the '<em><b>Return Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_21__RETURN_UPDATE = 1;
-
- /**
- * The number of structural features of the '<em>Xml Basic 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_21_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1 <em>Xml Batch Fetch 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1()
- * @generated
- */
- public static final int XML_BATCH_FETCH_21 = 1;
-
- /**
- * The feature id for the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_21__SIZE = 0;
-
- /**
- * The feature id for the '<em><b>Batch Fetch Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_21__BATCH_FETCH_TYPE = 1;
-
- /**
- * The number of structural features of the '<em>Xml Batch Fetch 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BATCH_FETCH_21_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1 <em>Xml Element Collection 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlElementCollection_2_1()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_21 = 2;
-
- /**
- * The feature id for the '<em><b>Join Fetch</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_21__JOIN_FETCH = EclipseLinkOrmPackage.XML_JOIN_FETCH__JOIN_FETCH;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_JOIN_FETCH_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_JOIN_FETCH_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1 <em>Xml Type Mapping 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlTypeMapping_2_1()
- * @generated
- */
- public static final int XML_TYPE_MAPPING_21 = 16;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING_21__ACCESS_METHODS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
-
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING_21__PARENT_CLASS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Type Mapping 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TYPE_MAPPING_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1 <em>Xml Fetch Group Container 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroupContainer_2_1()
- * @generated
- */
- public static final int XML_FETCH_GROUP_CONTAINER_21 = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1 <em>Xml Entity 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntity_2_1()
- * @generated
- */
- public static final int XML_ENTITY_21 = 3;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21__ACCESS_METHODS = XML_TYPE_MAPPING_21__ACCESS_METHODS;
-
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21__PARENT_CLASS = XML_TYPE_MAPPING_21__PARENT_CLASS;
-
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21__FETCH_GROUPS = XML_TYPE_MAPPING_21_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Class Extractor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21__CLASS_EXTRACTOR = XML_TYPE_MAPPING_21_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Entity 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_21_FEATURE_COUNT = XML_TYPE_MAPPING_21_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1 <em>Xml Entity Mappings 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntityMappings_2_1()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS_21 = 4;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_21__ACCESS_METHODS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
-
- /**
- * The number of structural features of the '<em>Xml Entity Mappings 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1 <em>Xml Fetch Attribute 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchAttribute_2_1()
- * @generated
- */
- public static final int XML_FETCH_ATTRIBUTE_21 = 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_FETCH_ATTRIBUTE_21__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Fetch Attribute 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_ATTRIBUTE_21_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1 <em>Xml Fetch Group 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1()
- * @generated
- */
- public static final int XML_FETCH_GROUP_21 = 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_FETCH_GROUP_21__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Load</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_21__LOAD = 1;
-
- /**
- * The feature id for the '<em><b>Attributes</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_21__ATTRIBUTES = 2;
-
- /**
- * The number of structural features of the '<em>Xml Fetch Group 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_21_FEATURE_COUNT = 3;
-
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Fetch Group Container 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_FETCH_GROUP_CONTAINER_21_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1 <em>Xml Many To Many 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToMany_2_1()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_21 = 8;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1 <em>Xml Many To One 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToOne_2_1()
- * @generated
- */
- public static final int XML_MANY_TO_ONE_21 = 9;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
-
- /**
- * The number of structural features of the '<em>Xml Many To One 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1 <em>Xml Mapped Superclass 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_21 = 10;
-
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__ASSOCIATION_OVERRIDES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER__ASSOCIATION_OVERRIDES;
-
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__ATTRIBUTE_OVERRIDES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Fetch Groups</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__FETCH_GROUPS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Sequence Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__SEQUENCE_GENERATOR = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Table Generator</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__TABLE_GENERATOR = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Named Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__NAMED_QUERIES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Named Native Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__NAMED_NATIVE_QUERIES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Named Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__NAMED_STORED_PROCEDURE_QUERIES = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__ACCESS_METHODS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 7;
-
- /**
- * The feature id for the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__PARENT_CLASS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 8;
-
- /**
- * The feature id for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 9;
-
- /**
- * The feature id for the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 10;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_21_FEATURE_COUNT = OrmPackage.XML_ASSOCIATION_OVERRIDE_CONTAINER_FEATURE_COUNT + 11;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1 <em>Xml One To Many 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToMany_2_1()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_21 = 11;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
-
- /**
- * The number of structural features of the '<em>Xml One To Many 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1 <em>Xml One To One 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToOne_2_1()
- * @generated
- */
- public static final int XML_ONE_TO_ONE_21 = 12;
-
- /**
- * The feature id for the '<em><b>Batch Fetch</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_21__BATCH_FETCH = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER__BATCH_FETCH;
-
- /**
- * The number of structural features of the '<em>Xml One To One 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_BATCH_FETCH_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1 <em>Xml Persistence Unit Defaults 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPersistenceUnitDefaults_2_1()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_21 = 13;
-
- /**
- * The feature id for the '<em><b>Access Methods</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_21__ACCESS_METHODS = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER__ACCESS_METHODS;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Defaults 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_21_FEATURE_COUNT = EclipseLinkOrmPackage.XML_ACCESS_METHODS_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1 <em>Xml Return Insert 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlReturnInsert_2_1()
- * @generated
- */
- public static final int XML_RETURN_INSERT_21 = 15;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1 <em>Xml Primary Key 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPrimaryKey_2_1()
- * @generated
- */
- public static final int XML_PRIMARY_KEY_21 = 14;
-
- /**
- * The feature id for the '<em><b>Cache Key Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_21__CACHE_KEY_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Primary Key 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PRIMARY_KEY_21_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Return Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RETURN_INSERT_21__RETURN_ONLY = 0;
-
- /**
- * The number of structural features of the '<em>Xml Return Insert 21</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RETURN_INSERT_21_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1 <em>Cache Key Type 21</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getCacheKeyType_2_1()
- * @generated
- */
- public static final int CACHE_KEY_TYPE_21 = 17;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1 <em>Batch Fetch Type 21</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getBatchFetchType_2_1()
- * @generated
- */
- public static final int BATCH_FETCH_TYPE_21 = 18;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasic_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBatchFetch_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappings_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchAttribute_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchGroup_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlFetchGroupContainer_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToMany_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOne_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToMany_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOne_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitDefaults_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReturnInsert_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTypeMapping_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPrimaryKey_2_1EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheKeyType_2_1EEnum = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum batchFetchType_2_1EEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_1Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_1Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_1Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_1Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_1Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_1Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_1Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_1Package.eNS_URI, theEclipseLinkOrmV2_1Package);
- return theEclipseLinkOrmV2_1Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1 <em>Xml Basic 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1
- * @generated
- */
- public EClass getXmlBasic_2_1()
- {
- return xmlBasic_2_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnInsert <em>Return Insert</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Return Insert</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnInsert()
- * @see #getXmlBasic_2_1()
- * @generated
- */
- public EReference getXmlBasic_2_1_ReturnInsert()
- {
- return (EReference)xmlBasic_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnUpdate <em>Return Update</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Return Update</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnUpdate()
- * @see #getXmlBasic_2_1()
- * @generated
- */
- public EAttribute getXmlBasic_2_1_ReturnUpdate()
- {
- return (EAttribute)xmlBasic_2_1EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1 <em>Xml Batch Fetch 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Batch Fetch 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1
- * @generated
- */
- public EClass getXmlBatchFetch_2_1()
- {
- return xmlBatchFetch_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getSize <em>Size</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Size</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getSize()
- * @see #getXmlBatchFetch_2_1()
- * @generated
- */
- public EAttribute getXmlBatchFetch_2_1_Size()
- {
- return (EAttribute)xmlBatchFetch_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getBatchFetchType <em>Batch Fetch Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Batch Fetch Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getBatchFetchType()
- * @see #getXmlBatchFetch_2_1()
- * @generated
- */
- public EAttribute getXmlBatchFetch_2_1_BatchFetchType()
- {
- return (EAttribute)xmlBatchFetch_2_1EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1 <em>Xml Element Collection 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1
- * @generated
- */
- public EClass getXmlElementCollection_2_1()
- {
- return xmlElementCollection_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1 <em>Xml Entity 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1
- * @generated
- */
- public EClass getXmlEntity_2_1()
- {
- return xmlEntity_2_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getClassExtractor <em>Class Extractor</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Class Extractor</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getClassExtractor()
- * @see #getXmlEntity_2_1()
- * @generated
- */
- public EReference getXmlEntity_2_1_ClassExtractor()
- {
- return (EReference)xmlEntity_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1 <em>Xml Entity Mappings 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Mappings 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1
- * @generated
- */
- public EClass getXmlEntityMappings_2_1()
- {
- return xmlEntityMappings_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1 <em>Xml Fetch Attribute 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Attribute 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1
- * @generated
- */
- public EClass getXmlFetchAttribute_2_1()
- {
- return xmlFetchAttribute_2_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1#getName()
- * @see #getXmlFetchAttribute_2_1()
- * @generated
- */
- public EAttribute getXmlFetchAttribute_2_1_Name()
- {
- return (EAttribute)xmlFetchAttribute_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1 <em>Xml Fetch Group 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Group 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1
- * @generated
- */
- public EClass getXmlFetchGroup_2_1()
- {
- return xmlFetchGroup_2_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getName()
- * @see #getXmlFetchGroup_2_1()
- * @generated
- */
- public EAttribute getXmlFetchGroup_2_1_Name()
- {
- return (EAttribute)xmlFetchGroup_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getAttributes <em>Attributes</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Attributes</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getAttributes()
- * @see #getXmlFetchGroup_2_1()
- * @generated
- */
- public EReference getXmlFetchGroup_2_1_Attributes()
- {
- return (EReference)xmlFetchGroup_2_1EClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getLoad <em>Load</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Load</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getLoad()
- * @see #getXmlFetchGroup_2_1()
- * @generated
- */
- public EAttribute getXmlFetchGroup_2_1_Load()
- {
- return (EAttribute)xmlFetchGroup_2_1EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1 <em>Xml Fetch Group Container 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Fetch Group Container 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1
- * @generated
- */
- public EClass getXmlFetchGroupContainer_2_1()
- {
- return xmlFetchGroupContainer_2_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1#getFetchGroups <em>Fetch Groups</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Fetch Groups</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1#getFetchGroups()
- * @see #getXmlFetchGroupContainer_2_1()
- * @generated
- */
- public EReference getXmlFetchGroupContainer_2_1_FetchGroups()
- {
- return (EReference)xmlFetchGroupContainer_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1 <em>Xml Many To Many 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1
- * @generated
- */
- public EClass getXmlManyToMany_2_1()
- {
- return xmlManyToMany_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1 <em>Xml Many To One 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1
- * @generated
- */
- public EClass getXmlManyToOne_2_1()
- {
- return xmlManyToOne_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1 <em>Xml Mapped Superclass 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_1()
- {
- return xmlMappedSuperclass_2_1EClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Sql Result Set Mappings</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getSqlResultSetMappings()
- * @see #getXmlMappedSuperclass_2_1()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_1_SqlResultSetMappings()
- {
- return (EReference)xmlMappedSuperclass_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getQueryRedirectors <em>Query Redirectors</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Query Redirectors</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getQueryRedirectors()
- * @see #getXmlMappedSuperclass_2_1()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_1_QueryRedirectors()
- {
- return (EReference)xmlMappedSuperclass_2_1EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1 <em>Xml One To Many 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1
- * @generated
- */
- public EClass getXmlOneToMany_2_1()
- {
- return xmlOneToMany_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1 <em>Xml One To One 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1
- * @generated
- */
- public EClass getXmlOneToOne_2_1()
- {
- return xmlOneToOne_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1 <em>Xml Persistence Unit Defaults 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Defaults 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults_2_1()
- {
- return xmlPersistenceUnitDefaults_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1 <em>Xml Return Insert 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Return Insert 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1
- * @generated
- */
- public EClass getXmlReturnInsert_2_1()
- {
- return xmlReturnInsert_2_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1#getReturnOnly <em>Return Only</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Return Only</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1#getReturnOnly()
- * @see #getXmlReturnInsert_2_1()
- * @generated
- */
- public EAttribute getXmlReturnInsert_2_1_ReturnOnly()
- {
- return (EAttribute)xmlReturnInsert_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1 <em>Xml Type Mapping 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Type Mapping 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1
- * @generated
- */
- public EClass getXmlTypeMapping_2_1()
- {
- return xmlTypeMapping_2_1EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1#getParentClass <em>Parent Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Parent Class</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1#getParentClass()
- * @see #getXmlTypeMapping_2_1()
- * @generated
- */
- public EAttribute getXmlTypeMapping_2_1_ParentClass()
- {
- return (EAttribute)xmlTypeMapping_2_1EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1 <em>Xml Primary Key 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Primary Key 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1
- * @generated
- */
- public EClass getXmlPrimaryKey_2_1()
- {
- return xmlPrimaryKey_2_1EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1#getCacheKeyType <em>Cache Key Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cache Key Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1#getCacheKeyType()
- * @see #getXmlPrimaryKey_2_1()
- * @generated
- */
- public EAttribute getXmlPrimaryKey_2_1_CacheKeyType()
- {
- return (EAttribute)xmlPrimaryKey_2_1EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1 <em>Cache Key Type 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Cache Key Type 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @generated
- */
- public EEnum getCacheKeyType_2_1()
- {
- return cacheKeyType_2_1EEnum;
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1 <em>Batch Fetch Type 21</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Batch Fetch Type 21</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @generated
- */
- public EEnum getBatchFetchType_2_1()
- {
- return batchFetchType_2_1EEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_1Factory getEclipseLinkOrmV2_1Factory()
- {
- return (EclipseLinkOrmV2_1Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlBasic_2_1EClass = createEClass(XML_BASIC_21);
- createEReference(xmlBasic_2_1EClass, XML_BASIC_21__RETURN_INSERT);
- createEAttribute(xmlBasic_2_1EClass, XML_BASIC_21__RETURN_UPDATE);
-
- xmlBatchFetch_2_1EClass = createEClass(XML_BATCH_FETCH_21);
- createEAttribute(xmlBatchFetch_2_1EClass, XML_BATCH_FETCH_21__SIZE);
- createEAttribute(xmlBatchFetch_2_1EClass, XML_BATCH_FETCH_21__BATCH_FETCH_TYPE);
-
- xmlElementCollection_2_1EClass = createEClass(XML_ELEMENT_COLLECTION_21);
-
- xmlEntity_2_1EClass = createEClass(XML_ENTITY_21);
- createEReference(xmlEntity_2_1EClass, XML_ENTITY_21__CLASS_EXTRACTOR);
-
- xmlEntityMappings_2_1EClass = createEClass(XML_ENTITY_MAPPINGS_21);
-
- xmlFetchAttribute_2_1EClass = createEClass(XML_FETCH_ATTRIBUTE_21);
- createEAttribute(xmlFetchAttribute_2_1EClass, XML_FETCH_ATTRIBUTE_21__NAME);
-
- xmlFetchGroup_2_1EClass = createEClass(XML_FETCH_GROUP_21);
- createEAttribute(xmlFetchGroup_2_1EClass, XML_FETCH_GROUP_21__NAME);
- createEAttribute(xmlFetchGroup_2_1EClass, XML_FETCH_GROUP_21__LOAD);
- createEReference(xmlFetchGroup_2_1EClass, XML_FETCH_GROUP_21__ATTRIBUTES);
-
- xmlFetchGroupContainer_2_1EClass = createEClass(XML_FETCH_GROUP_CONTAINER_21);
- createEReference(xmlFetchGroupContainer_2_1EClass, XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS);
-
- xmlManyToMany_2_1EClass = createEClass(XML_MANY_TO_MANY_21);
-
- xmlManyToOne_2_1EClass = createEClass(XML_MANY_TO_ONE_21);
-
- xmlMappedSuperclass_2_1EClass = createEClass(XML_MAPPED_SUPERCLASS_21);
- createEReference(xmlMappedSuperclass_2_1EClass, XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS);
- createEReference(xmlMappedSuperclass_2_1EClass, XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS);
-
- xmlOneToMany_2_1EClass = createEClass(XML_ONE_TO_MANY_21);
-
- xmlOneToOne_2_1EClass = createEClass(XML_ONE_TO_ONE_21);
-
- xmlPersistenceUnitDefaults_2_1EClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS_21);
-
- xmlPrimaryKey_2_1EClass = createEClass(XML_PRIMARY_KEY_21);
- createEAttribute(xmlPrimaryKey_2_1EClass, XML_PRIMARY_KEY_21__CACHE_KEY_TYPE);
-
- xmlReturnInsert_2_1EClass = createEClass(XML_RETURN_INSERT_21);
- createEAttribute(xmlReturnInsert_2_1EClass, XML_RETURN_INSERT_21__RETURN_ONLY);
-
- xmlTypeMapping_2_1EClass = createEClass(XML_TYPE_MAPPING_21);
- createEAttribute(xmlTypeMapping_2_1EClass, XML_TYPE_MAPPING_21__PARENT_CLASS);
-
- // Create enums
- cacheKeyType_2_1EEnum = createEEnum(CACHE_KEY_TYPE_21);
- batchFetchType_2_1EEnum = createEEnum(BATCH_FETCH_TYPE_21);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlElementCollection_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlJoinFetch());
- xmlElementCollection_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlEntity_2_1EClass.getESuperTypes().add(this.getXmlTypeMapping_2_1());
- xmlEntity_2_1EClass.getESuperTypes().add(this.getXmlFetchGroupContainer_2_1());
- xmlEntityMappings_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAccessMethodsHolder());
- xmlManyToMany_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlManyToOne_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theOrmPackage.getXmlAssociationOverrideContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theOrmPackage.getXmlAttributeOverrideContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(this.getXmlFetchGroupContainer_2_1());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theOrmPackage.getXmlGeneratorContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theOrmPackage.getXmlQueryContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlQueryContainer());
- xmlMappedSuperclass_2_1EClass.getESuperTypes().add(this.getXmlTypeMapping_2_1());
- xmlOneToMany_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlOneToOne_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlBatchFetchHolder());
- xmlPersistenceUnitDefaults_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAccessMethodsHolder());
- xmlTypeMapping_2_1EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlAccessMethodsHolder());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlBasic_2_1EClass, XmlBasic_2_1.class, "XmlBasic_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBasic_2_1_ReturnInsert(), theEclipseLinkOrmPackage.getXmlReturnInsert(), null, "returnInsert", null, 0, 1, XmlBasic_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBasic_2_1_ReturnUpdate(), theXMLTypePackage.getBooleanObject(), "returnUpdate", null, 0, 1, XmlBasic_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBatchFetch_2_1EClass, XmlBatchFetch_2_1.class, "XmlBatchFetch_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlBatchFetch_2_1_Size(), theXMLTypePackage.getIntObject(), "size", null, 0, 1, XmlBatchFetch_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlBatchFetch_2_1_BatchFetchType(), this.getBatchFetchType_2_1(), "batchFetchType", null, 0, 1, XmlBatchFetch_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_1EClass, XmlElementCollection_2_1.class, "XmlElementCollection_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEntity_2_1EClass, XmlEntity_2_1.class, "XmlEntity_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_1_ClassExtractor(), theOrmPackage.getXmlClassReference(), null, "classExtractor", null, 0, 1, XmlEntity_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityMappings_2_1EClass, XmlEntityMappings_2_1.class, "XmlEntityMappings_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlFetchAttribute_2_1EClass, XmlFetchAttribute_2_1.class, "XmlFetchAttribute_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlFetchAttribute_2_1_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlFetchAttribute_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlFetchGroup_2_1EClass, XmlFetchGroup_2_1.class, "XmlFetchGroup_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlFetchGroup_2_1_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlFetchGroup_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlFetchGroup_2_1_Load(), theXMLTypePackage.getBooleanObject(), "load", null, 0, 1, XmlFetchGroup_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlFetchGroup_2_1_Attributes(), theEclipseLinkOrmPackage.getXmlFetchAttribute(), null, "attributes", null, 0, -1, XmlFetchGroup_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlFetchGroupContainer_2_1EClass, XmlFetchGroupContainer_2_1.class, "XmlFetchGroupContainer_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlFetchGroupContainer_2_1_FetchGroups(), theEclipseLinkOrmPackage.getXmlFetchGroup(), null, "fetchGroups", null, 0, -1, XmlFetchGroupContainer_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlManyToMany_2_1EClass, XmlManyToMany_2_1.class, "XmlManyToMany_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlManyToOne_2_1EClass, XmlManyToOne_2_1.class, "XmlManyToOne_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlMappedSuperclass_2_1EClass, XmlMappedSuperclass_2_1.class, "XmlMappedSuperclass_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_1_SqlResultSetMappings(), theOrmPackage.getSqlResultSetMapping(), null, "sqlResultSetMappings", null, 0, -1, XmlMappedSuperclass_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_1_QueryRedirectors(), theEclipseLinkOrmPackage.getXmlQueryRedirectors(), null, "queryRedirectors", null, 0, 1, XmlMappedSuperclass_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToMany_2_1EClass, XmlOneToMany_2_1.class, "XmlOneToMany_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlOneToOne_2_1EClass, XmlOneToOne_2_1.class, "XmlOneToOne_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPersistenceUnitDefaults_2_1EClass, XmlPersistenceUnitDefaults_2_1.class, "XmlPersistenceUnitDefaults_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlPrimaryKey_2_1EClass, XmlPrimaryKey_2_1.class, "XmlPrimaryKey_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPrimaryKey_2_1_CacheKeyType(), this.getCacheKeyType_2_1(), "cacheKeyType", null, 0, 1, XmlPrimaryKey_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlReturnInsert_2_1EClass, XmlReturnInsert_2_1.class, "XmlReturnInsert_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlReturnInsert_2_1_ReturnOnly(), theXMLTypePackage.getBooleanObject(), "returnOnly", null, 0, 1, XmlReturnInsert_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTypeMapping_2_1EClass, XmlTypeMapping_2_1.class, "XmlTypeMapping_2_1", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTypeMapping_2_1_ParentClass(), theXMLTypePackage.getString(), "parentClass", null, 0, 1, XmlTypeMapping_2_1.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(cacheKeyType_2_1EEnum, CacheKeyType_2_1.class, "CacheKeyType_2_1");
- addEEnumLiteral(cacheKeyType_2_1EEnum, CacheKeyType_2_1.ID_VALUE);
- addEEnumLiteral(cacheKeyType_2_1EEnum, CacheKeyType_2_1.CACHE_KEY);
- addEEnumLiteral(cacheKeyType_2_1EEnum, CacheKeyType_2_1.AUTO);
-
- initEEnum(batchFetchType_2_1EEnum, BatchFetchType_2_1.class, "BatchFetchType_2_1");
- addEEnumLiteral(batchFetchType_2_1EEnum, BatchFetchType_2_1.JOIN);
- addEEnumLiteral(batchFetchType_2_1EEnum, BatchFetchType_2_1.EXISTS);
- addEEnumLiteral(batchFetchType_2_1EEnum, BatchFetchType_2_1.IN);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1 <em>Xml Basic 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1()
- * @generated
- */
- public static final EClass XML_BASIC_21 = eINSTANCE.getXmlBasic_2_1();
-
- /**
- * The meta object literal for the '<em><b>Return Insert</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BASIC_21__RETURN_INSERT = eINSTANCE.getXmlBasic_2_1_ReturnInsert();
-
- /**
- * The meta object literal for the '<em><b>Return Update</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC_21__RETURN_UPDATE = eINSTANCE.getXmlBasic_2_1_ReturnUpdate();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1 <em>Xml Batch Fetch 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1()
- * @generated
- */
- public static final EClass XML_BATCH_FETCH_21 = eINSTANCE.getXmlBatchFetch_2_1();
-
- /**
- * The meta object literal for the '<em><b>Size</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BATCH_FETCH_21__SIZE = eINSTANCE.getXmlBatchFetch_2_1_Size();
-
- /**
- * The meta object literal for the '<em><b>Batch Fetch Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BATCH_FETCH_21__BATCH_FETCH_TYPE = eINSTANCE.getXmlBatchFetch_2_1_BatchFetchType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1 <em>Xml Element Collection 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlElementCollection_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlElementCollection_2_1()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_21 = eINSTANCE.getXmlElementCollection_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1 <em>Xml Entity 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntity_2_1()
- * @generated
- */
- public static final EClass XML_ENTITY_21 = eINSTANCE.getXmlEntity_2_1();
-
- /**
- * The meta object literal for the '<em><b>Class Extractor</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_21__CLASS_EXTRACTOR = eINSTANCE.getXmlEntity_2_1_ClassExtractor();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1 <em>Xml Entity Mappings 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntityMappings_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntityMappings_2_1()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS_21 = eINSTANCE.getXmlEntityMappings_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1 <em>Xml Fetch Attribute 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchAttribute_2_1()
- * @generated
- */
- public static final EClass XML_FETCH_ATTRIBUTE_21 = eINSTANCE.getXmlFetchAttribute_2_1();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_FETCH_ATTRIBUTE_21__NAME = eINSTANCE.getXmlFetchAttribute_2_1_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1 <em>Xml Fetch Group 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1()
- * @generated
- */
- public static final EClass XML_FETCH_GROUP_21 = eINSTANCE.getXmlFetchGroup_2_1();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_FETCH_GROUP_21__NAME = eINSTANCE.getXmlFetchGroup_2_1_Name();
-
- /**
- * The meta object literal for the '<em><b>Attributes</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_FETCH_GROUP_21__ATTRIBUTES = eINSTANCE.getXmlFetchGroup_2_1_Attributes();
-
- /**
- * The meta object literal for the '<em><b>Load</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_FETCH_GROUP_21__LOAD = eINSTANCE.getXmlFetchGroup_2_1_Load();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1 <em>Xml Fetch Group Container 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroupContainer_2_1()
- * @generated
- */
- public static final EClass XML_FETCH_GROUP_CONTAINER_21 = eINSTANCE.getXmlFetchGroupContainer_2_1();
-
- /**
- * The meta object literal for the '<em><b>Fetch Groups</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_FETCH_GROUP_CONTAINER_21__FETCH_GROUPS = eINSTANCE.getXmlFetchGroupContainer_2_1_FetchGroups();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1 <em>Xml Many To Many 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToMany_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToMany_2_1()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY_21 = eINSTANCE.getXmlManyToMany_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1 <em>Xml Many To One 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlManyToOne_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToOne_2_1()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE_21 = eINSTANCE.getXmlManyToOne_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1 <em>Xml Mapped Superclass 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_21 = eINSTANCE.getXmlMappedSuperclass_2_1();
-
- /**
- * The meta object literal for the '<em><b>Sql Result Set Mappings</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_21__SQL_RESULT_SET_MAPPINGS = eINSTANCE.getXmlMappedSuperclass_2_1_SqlResultSetMappings();
-
- /**
- * The meta object literal for the '<em><b>Query Redirectors</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_21__QUERY_REDIRECTORS = eINSTANCE.getXmlMappedSuperclass_2_1_QueryRedirectors();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1 <em>Xml One To Many 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToMany_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToMany_2_1()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_21 = eINSTANCE.getXmlOneToMany_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1 <em>Xml One To One 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlOneToOne_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToOne_2_1()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE_21 = eINSTANCE.getXmlOneToOne_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1 <em>Xml Persistence Unit Defaults 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPersistenceUnitDefaults_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPersistenceUnitDefaults_2_1()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_DEFAULTS_21 = eINSTANCE.getXmlPersistenceUnitDefaults_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1 <em>Xml Return Insert 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlReturnInsert_2_1()
- * @generated
- */
- public static final EClass XML_RETURN_INSERT_21 = eINSTANCE.getXmlReturnInsert_2_1();
-
- /**
- * The meta object literal for the '<em><b>Return Only</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_RETURN_INSERT_21__RETURN_ONLY = eINSTANCE.getXmlReturnInsert_2_1_ReturnOnly();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1 <em>Xml Type Mapping 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlTypeMapping_2_1()
- * @generated
- */
- public static final EClass XML_TYPE_MAPPING_21 = eINSTANCE.getXmlTypeMapping_2_1();
-
- /**
- * The meta object literal for the '<em><b>Parent Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TYPE_MAPPING_21__PARENT_CLASS = eINSTANCE.getXmlTypeMapping_2_1_ParentClass();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1 <em>Xml Primary Key 21</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPrimaryKey_2_1()
- * @generated
- */
- public static final EClass XML_PRIMARY_KEY_21 = eINSTANCE.getXmlPrimaryKey_2_1();
-
- /**
- * The meta object literal for the '<em><b>Cache Key Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PRIMARY_KEY_21__CACHE_KEY_TYPE = eINSTANCE.getXmlPrimaryKey_2_1_CacheKeyType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1 <em>Cache Key Type 21</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getCacheKeyType_2_1()
- * @generated
- */
- public static final EEnum CACHE_KEY_TYPE_21 = eINSTANCE.getCacheKeyType_2_1();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1 <em>Batch Fetch Type 21</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getBatchFetchType_2_1()
- * @generated
- */
- public static final EEnum BATCH_FETCH_TYPE_21 = eINSTANCE.getBatchFetchType_2_1();
-
- }
-
-} //EclipseLinkOrmV2_1Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java
deleted file mode 100644
index 86e4709861..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBasic_2_1.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlReturnInsert;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnInsert <em>Return Insert</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnUpdate <em>Return Update</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasic_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Return Insert</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Insert</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Insert</em>' containment reference.
- * @see #setReturnInsert(XmlReturnInsert)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1_ReturnInsert()
- * @model containment="true"
- * @generated
- */
- XmlReturnInsert getReturnInsert();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnInsert <em>Return Insert</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Insert</em>' containment reference.
- * @see #getReturnInsert()
- * @generated
- */
- void setReturnInsert(XmlReturnInsert value);
-
- /**
- * Returns the value of the '<em><b>Return Update</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Update</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Update</em>' attribute.
- * @see #setReturnUpdate(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBasic_2_1_ReturnUpdate()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getReturnUpdate();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBasic_2_1#getReturnUpdate <em>Return Update</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Update</em>' attribute.
- * @see #getReturnUpdate()
- * @generated
- */
- void setReturnUpdate(Boolean value);
-} // XmlBasic_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java
deleted file mode 100644
index 24e9b3379c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlBatchFetch_2_1.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Batch Fetch 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getSize <em>Size</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getBatchFetchType <em>Batch Fetch Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBatchFetch_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Size</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Size</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Size</em>' attribute.
- * @see #setSize(Integer)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1_Size()
- * @model dataType="org.eclipse.emf.ecore.xml.type.IntObject"
- * @generated
- */
- Integer getSize();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getSize <em>Size</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Size</em>' attribute.
- * @see #getSize()
- * @generated
- */
- void setSize(Integer value);
-
- /**
- * Returns the value of the '<em><b>Batch Fetch Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Batch Fetch Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Batch Fetch Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #setBatchFetchType(BatchFetchType_2_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlBatchFetch_2_1_BatchFetchType()
- * @model
- * @generated
- */
- BatchFetchType_2_1 getBatchFetchType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlBatchFetch_2_1#getBatchFetchType <em>Batch Fetch Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Batch Fetch Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.BatchFetchType_2_1
- * @see #getBatchFetchType()
- * @generated
- */
- void setBatchFetchType(BatchFetchType_2_1 value);
-
-} // XmlBatchFetch_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java
deleted file mode 100644
index b894cf2422..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlElementCollection_2_1.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetch;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlElementCollection_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlElementCollection_2_1 extends XmlJoinFetch, XmlBatchFetchHolder
-{
-
-} // XmlElementCollection_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java
deleted file mode 100644
index 50d417e5e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntityMappings_2_1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity Mappings 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntityMappings_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntityMappings_2_1 extends XmlAccessMethodsHolder
-{
-} // XmlEntityMappings_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java
deleted file mode 100644
index 327b151912..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlEntity_2_1.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlClassReference;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getClassExtractor <em>Class Extractor</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntity_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntity_2_1 extends XmlTypeMapping_2_1, XmlFetchGroupContainer_2_1
-{
- /**
- * Returns the value of the '<em><b>Class Extractor</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Class Extractor</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Class Extractor</em>' containment reference.
- * @see #setClassExtractor(XmlClassReference)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlEntity_2_1_ClassExtractor()
- * @model containment="true"
- * @generated
- */
- XmlClassReference getClassExtractor();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlEntity_2_1#getClassExtractor <em>Class Extractor</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Class Extractor</em>' containment reference.
- * @see #getClassExtractor()
- * @generated
- */
- void setClassExtractor(XmlClassReference value);
-
-} // XmlEntity_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java
deleted file mode 100644
index 82ccb4cde7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchAttribute_2_1.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Attribute 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchAttribute_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlFetchAttribute_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchAttribute_2_1_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchAttribute_2_1#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlFetchAttribute_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java
deleted file mode 100644
index b3e8bf93cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroupContainer_2_1.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Group Container 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroupContainer_2_1#getFetchGroups <em>Fetch Groups</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroupContainer_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlFetchGroupContainer_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Fetch Groups</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchGroup}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Fetch Groups</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Fetch Groups</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroupContainer_2_1_FetchGroups()
- * @model containment="true"
- * @generated
- */
- EList<XmlFetchGroup> getFetchGroups();
-
-} // XmlFetchGroupContainer_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java
deleted file mode 100644
index ce3e4dc0b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlFetchGroup_2_1.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Fetch Group 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getLoad <em>Load</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getAttributes <em>Attributes</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlFetchGroup_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Attributes</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlFetchAttribute}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Attributes</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Attributes</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1_Attributes()
- * @model containment="true"
- * @generated
- */
- EList<XmlFetchAttribute> getAttributes();
-
- /**
- * Returns the value of the '<em><b>Load</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Load</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Load</em>' attribute.
- * @see #setLoad(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlFetchGroup_2_1_Load()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getLoad();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlFetchGroup_2_1#getLoad <em>Load</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Load</em>' attribute.
- * @see #getLoad()
- * @generated
- */
- void setLoad(Boolean value);
-
-} // XmlFetchGroup_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java
deleted file mode 100644
index 737924fb13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToMany_2_1.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To Many 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToMany_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany_2_1 extends XmlBatchFetchHolder
-{
-
-} // XmlManyToMany_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java
deleted file mode 100644
index 38619f5aa9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlManyToOne_2_1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To One 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlManyToOne_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToOne_2_1 extends XmlBatchFetchHolder
-{
-} // XmlManyToOne_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java
deleted file mode 100644
index 51569a5617..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlMappedSuperclass_2_1.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratorContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlQueryContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryRedirectors;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getSqlResultSetMappings <em>Sql Result Set Mappings</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getQueryRedirectors <em>Query Redirectors</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMappedSuperclass_2_1 extends XmlAssociationOverrideContainer, XmlAttributeOverrideContainer, XmlFetchGroupContainer_2_1, XmlGeneratorContainer, XmlQueryContainer, org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlQueryContainer, XmlTypeMapping_2_1
-{
- /**
- * Returns the value of the '<em><b>Sql Result Set Mappings</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.core.resource.orm.SqlResultSetMapping}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sql Result Set Mappings</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Sql Result Set Mappings</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1_SqlResultSetMappings()
- * @model containment="true"
- * @generated
- */
- EList<SqlResultSetMapping> getSqlResultSetMappings();
-
- /**
- * Returns the value of the '<em><b>Query Redirectors</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Query Redirectors</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Query Redirectors</em>' containment reference.
- * @see #setQueryRedirectors(XmlQueryRedirectors)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlMappedSuperclass_2_1_QueryRedirectors()
- * @model containment="true"
- * @generated
- */
- XmlQueryRedirectors getQueryRedirectors();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlMappedSuperclass_2_1#getQueryRedirectors <em>Query Redirectors</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Query Redirectors</em>' containment reference.
- * @see #getQueryRedirectors()
- * @generated
- */
- void setQueryRedirectors(XmlQueryRedirectors value);
-
-} // XmlMappedSuperclass_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java
deleted file mode 100644
index b597c3a375..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToMany_2_1.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To Many 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToMany_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany_2_1 extends XmlBatchFetchHolder
-{
-
-} // XmlOneToMany_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java
deleted file mode 100644
index 38cc74ba5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlOneToOne_2_1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBatchFetchHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To One 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlOneToOne_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToOne_2_1 extends XmlBatchFetchHolder
-{
-} // XmlOneToOne_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java
deleted file mode 100644
index f7e8e87111..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPersistenceUnitDefaults_2_1.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Defaults 21</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 2.3
- * @since 2.3
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPersistenceUnitDefaults_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlPersistenceUnitDefaults_2_1 extends XmlAccessMethodsHolder
-{
-} // XmlPersistenceUnitDefaults_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java
deleted file mode 100644
index 0127f3b912..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlPrimaryKey_2_1.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Primary Key 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1#getCacheKeyType <em>Cache Key Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPrimaryKey_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPrimaryKey_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Key Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Key Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Key Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #setCacheKeyType(CacheKeyType_2_1)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlPrimaryKey_2_1_CacheKeyType()
- * @model
- * @generated
- */
- CacheKeyType_2_1 getCacheKeyType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlPrimaryKey_2_1#getCacheKeyType <em>Cache Key Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Key Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.CacheKeyType_2_1
- * @see #getCacheKeyType()
- * @generated
- */
- void setCacheKeyType(CacheKeyType_2_1 value);
-
-} // XmlPrimaryKey_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java
deleted file mode 100644
index f8fa5eb769..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlReturnInsert_2_1.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Return Insert 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1#getReturnOnly <em>Return Only</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlReturnInsert_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlReturnInsert_2_1 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Return Only</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Return Only</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Return Only</em>' attribute.
- * @see #setReturnOnly(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlReturnInsert_2_1_ReturnOnly()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getReturnOnly();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlReturnInsert_2_1#getReturnOnly <em>Return Only</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Return Only</em>' attribute.
- * @see #getReturnOnly()
- * @generated
- */
- void setReturnOnly(Boolean value);
-
-} // XmlReturnInsert_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlTypeMapping_2_1.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlTypeMapping_2_1.java
deleted file mode 100644
index 3ec86112f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_1/XmlTypeMapping_2_1.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Type Mapping 21</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1#getParentClass <em>Parent Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlTypeMapping_2_1()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTypeMapping_2_1 extends XmlAccessMethodsHolder
-{
-
- /**
- * Returns the value of the '<em><b>Parent Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Parent Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Parent Class</em>' attribute.
- * @see #setParentClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package#getXmlTypeMapping_2_1_ParentClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getParentClass();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.XmlTypeMapping_2_1#getParentClass <em>Parent Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Parent Class</em>' attribute.
- * @see #getParentClass()
- * @generated
- */
- void setParentClass(String value);
-
- TextRange getParentClassTextRange();
-} // XmlTypeMapping_2_1
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/CacheIsolationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/CacheIsolationType.java
deleted file mode 100644
index 74ad68e591..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/CacheIsolationType.java
+++ /dev/null
@@ -1,257 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Cache Isolation Type</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getCacheIsolationType()
- * @model
- * @generated
- */
-public enum CacheIsolationType implements Enumerator
-{
- /**
- * The '<em><b>SHARED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SHARED_VALUE
- * @generated
- * @ordered
- */
- SHARED(0, "SHARED", "SHARED"),
-
- /**
- * The '<em><b>PROTECTED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #PROTECTED_VALUE
- * @generated
- * @ordered
- */
- PROTECTED(1, "PROTECTED", "PROTECTED"),
-
- /**
- * The '<em><b>ISOLATED</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #ISOLATED_VALUE
- * @generated
- * @ordered
- */
- ISOLATED(2, "ISOLATED", "ISOLATED");
-
- /**
- * The '<em><b>SHARED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SHARED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SHARED
- * @model
- * @generated
- * @ordered
- */
- public static final int SHARED_VALUE = 0;
-
- /**
- * The '<em><b>PROTECTED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>PROTECTED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #PROTECTED
- * @model
- * @generated
- * @ordered
- */
- public static final int PROTECTED_VALUE = 1;
-
- /**
- * The '<em><b>ISOLATED</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>ISOLATED</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #ISOLATED
- * @model
- * @generated
- * @ordered
- */
- public static final int ISOLATED_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Cache Isolation Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final CacheIsolationType[] VALUES_ARRAY =
- new CacheIsolationType[]
- {
- SHARED,
- PROTECTED,
- ISOLATED,
- };
-
- /**
- * A public read-only list of all the '<em><b>Cache Isolation Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<CacheIsolationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Cache Isolation Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheIsolationType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheIsolationType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Isolation Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheIsolationType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- CacheIsolationType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Cache Isolation Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static CacheIsolationType get(int value)
- {
- switch (value)
- {
- case SHARED_VALUE: return SHARED;
- case PROTECTED_VALUE: return PROTECTED;
- case ISOLATED_VALUE: return ISOLATED;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private CacheIsolationType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //CacheIsolationType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLink2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLink2_2.java
deleted file mode 100644
index 5a7bceea1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLink2_2.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_2
- extends EclipseLink2_1
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_2.xsd";
- String SCHEMA_VERSION = "2.2";
-
-
- // EclipseLink 2.2 specific nodes
- String ADDITIONAL_CRITERIA = "additional-criteria";
- String CACHE__ISOLATION = "isolation";
- String CASCADE_ON_DELETE = "cascade-on-delete";
- String CREATION_SUFFIX = "creation-suffix";
- String CRITERIA = "criteria";
- String HASH_PARTITIONING = "hash-partitioning";
- String INDEX = "index";
- String INDEX__COLUMN_NAME = "column-name";
- String INDEX__NAME = "name";
- String INDEX__CATALOG = "catalog";
- String INDEX__SCHEMA = "schema";
- String INDEX__TABLE = "table";
- String INDEX__UNIQUE = "unique";
- String NONCACHEABLE = "noncacheable";
- String PARTITIONING = "partitioning";
- String PARTITIONING_GROUP__PARTITIONED = "partitioned";
- String PINNED_PARTITIONING = "pinned-partitioning";
- String RANGE_PARTITIONING = "range-partitioning";
- String REPLICATION_PARTITIONING = "replication-partitioning";
- String ROUND_ROBIN_PARTITIONING = "round-robin-partitioning";
- String UNION_PARTITIONING = "union-partitioning";
- String VALUE_PARTITIONING = "value-partitioning";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Factory.java
deleted file mode 100644
index ceb547f4bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Factory.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package
- * @generated
- */
-public class EclipseLinkOrmV2_2Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_2Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_2Factory init()
- {
- try
- {
- EclipseLinkOrmV2_2Factory theEclipseLinkOrmV2_2Factory = (EclipseLinkOrmV2_2Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_2.xmi");
- if (theEclipseLinkOrmV2_2Factory != null)
- {
- return theEclipseLinkOrmV2_2Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_2Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_2Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_2Package.CACHE_ISOLATION_TYPE:
- return createCacheIsolationTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_2Package.CACHE_ISOLATION_TYPE:
- return convertCacheIsolationTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public CacheIsolationType createCacheIsolationTypeFromString(EDataType eDataType, String initialValue)
- {
- CacheIsolationType result = CacheIsolationType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertCacheIsolationTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_2Package getEclipseLinkOrmV2_2Package()
- {
- return (EclipseLinkOrmV2_2Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_2Package getPackage()
- {
- return EclipseLinkOrmV2_2Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_2Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Package.java
deleted file mode 100644
index e5d5def471..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/EclipseLinkOrmV2_2Package.java
+++ /dev/null
@@ -1,4616 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_2Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_2";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_2.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_2Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2 <em>Xml Additional Criteria 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlAdditionalCriteria_2_2()
- * @generated
- */
- public static final int XML_ADDITIONAL_CRITERIA_22 = 0;
-
- /**
- * The feature id for the '<em><b>Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ADDITIONAL_CRITERIA_22__CRITERIA = 0;
-
- /**
- * The number of structural features of the '<em>Xml Additional Criteria 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ADDITIONAL_CRITERIA_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2 <em>Xml Basic 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasic_2_2()
- * @generated
- */
- public static final int XML_BASIC_22 = 1;
-
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_22__INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2 <em>Xml Basic Collection 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicCollection_2_2()
- * @generated
- */
- public static final int XML_BASIC_COLLECTION_22 = 2;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic Collection 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_COLLECTION_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2 <em>Xml Basic Map 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicMap_2_2()
- * @generated
- */
- public static final int XML_BASIC_MAP_22 = 3;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP_22__CASCADE_ON_DELETE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic Map 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_MAP_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2 <em>Xml Cache 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCache_2_2()
- * @generated
- */
- public static final int XML_CACHE_22 = 4;
-
- /**
- * The feature id for the '<em><b>Isolation</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_22__ISOLATION = 0;
-
- /**
- * The number of structural features of the '<em>Xml Cache 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2 <em>Xml Collection Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCollectionTable_2_2()
- * @generated
- */
- public static final int XML_COLLECTION_TABLE_22 = 5;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Collection Table 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_COLLECTION_TABLE_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2 <em>Xml Partitioning Group 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2()
- * @generated
- */
- public static final int XML_PARTITIONING_GROUP_22 = 20;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__PARTITIONING = 0;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING = 1;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING = 2;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING = 3;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING = 4;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING = 5;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__HASH_PARTITIONING = 6;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__UNION_PARTITIONING = 7;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22__PARTITIONED = 8;
-
- /**
- * The number of structural features of the '<em>Xml Partitioning Group 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_GROUP_22_FEATURE_COUNT = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2 <em>Xml Element Collection 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_22 = 6;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22__NONCACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2 <em>Xml Entity 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2()
- * @generated
- */
- public static final int XML_ENTITY_22 = 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2 <em>Xml Entity Mappings 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS_22 = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2 <em>Xml Hash Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlHashPartitioning_2_2()
- * @generated
- */
- public static final int XML_HASH_PARTITIONING_22 = 10;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2 <em>Xml Many To Many 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2()
- * @generated
- */
- public static final int XML_MANY_TO_MANY_22 = 14;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2 <em>Xml Many To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToOne_2_2()
- * @generated
- */
- public static final int XML_MANY_TO_ONE_22 = 15;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2 <em>Xml One To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2()
- * @generated
- */
- public static final int XML_ONE_TO_ONE_22 = 17;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2 <em>Xml One To Many 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_22 = 18;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2 <em>Xml Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioning_2_2()
- * @generated
- */
- public static final int XML_PARTITIONING_22 = 19;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2 <em>Xml Pinned Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPinnedPartitioning_2_2()
- * @generated
- */
- public static final int XML_PINNED_PARTITIONING_22 = 21;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2 <em>Xml Range Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRangePartitioning_2_2()
- * @generated
- */
- public static final int XML_RANGE_PARTITIONING_22 = 22;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2 <em>Xml Replication Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlReplicationPartitioning_2_2()
- * @generated
- */
- public static final int XML_REPLICATION_PARTITIONING_22 = 23;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2 <em>Xml Round Robin Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRoundRobinPartitioning_2_2()
- * @generated
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING_22 = 24;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2 <em>Xml Embeddable 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEmbeddable_2_2()
- * @generated
- */
- public static final int XML_EMBEDDABLE_22 = 7;
-
- /**
- * The feature id for the '<em><b>Attribute Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_22__ATTRIBUTE_OVERRIDES = OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER__ATTRIBUTE_OVERRIDES;
-
- /**
- * The feature id for the '<em><b>Association Overrides</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_22__ASSOCIATION_OVERRIDES = OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Embeddable 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_22_FEATURE_COUNT = OrmPackage.XML_ATTRIBUTE_OVERRIDE_CONTAINER_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__ADDITIONAL_CRITERIA = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22__INDEX = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Entity 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__PARTITIONING = 0;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING = 1;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING = 2;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING = 3;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING = 4;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING = 5;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING = 6;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING = 7;
-
- /**
- * The number of structural features of the '<em>Xml Entity Mappings 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_22_FEATURE_COUNT = 8;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_HASH_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Hash Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_HASH_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2 <em>Xml Id 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlId_2_2()
- * @generated
- */
- public static final int XML_ID_22 = 11;
-
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_22__INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Id 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2 <em>Xml Index 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2()
- * @generated
- */
- public static final int XML_INDEX_22 = 12;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__NAME = 0;
-
- /**
- * The feature id for the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__SCHEMA = 1;
-
- /**
- * The feature id for the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__CATALOG = 2;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__TABLE = 3;
-
- /**
- * The feature id for the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__UNIQUE = 4;
-
- /**
- * The feature id for the '<em><b>Column Names</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22__COLUMN_NAMES = 5;
-
- /**
- * The number of structural features of the '<em>Xml Index 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_INDEX_22_FEATURE_COUNT = 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2 <em>Xml Join Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlJoinTable_2_2()
- * @generated
- */
- public static final int XML_JOIN_TABLE_22 = 13;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Join Table 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_JOIN_TABLE_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22__NON_CACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml Many To Many 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_MANY_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22__NON_CACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Many To One 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MANY_TO_ONE_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2 <em>Xml Mapped Superclass 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlMappedSuperclass_2_2()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_22 = 16;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22__NON_CACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml One To One 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_ONE_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__CASCADE_ON_DELETE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22__NONCACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The number of structural features of the '<em>Xml One To Many 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PINNED_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Pinned Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PINNED_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RANGE_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Range Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_RANGE_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_REPLICATION_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Replication Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_REPLICATION_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Round Robin Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ROUND_ROBIN_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2 <em>Xml Secondary Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlSecondaryTable_2_2()
- * @generated
- */
- public static final int XML_SECONDARY_TABLE_22 = 25;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Secondary Table 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_SECONDARY_TABLE_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2 <em>Xml Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTable_2_2()
- * @generated
- */
- public static final int XML_TABLE_22 = 26;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Table 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2 <em>Xml Table Generator 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTableGenerator_2_2()
- * @generated
- */
- public static final int XML_TABLE_GENERATOR_22 = 27;
-
- /**
- * The feature id for the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_22__CREATION_SUFFIX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Table Generator 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TABLE_GENERATOR_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2 <em>Xml Union Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlUnionPartitioning_2_2()
- * @generated
- */
- public static final int XML_UNION_PARTITIONING_22 = 28;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNION_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Union Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_UNION_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2 <em>Xml Value Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlValuePartitioning_2_2()
- * @generated
- */
- public static final int XML_VALUE_PARTITIONING_22 = 29;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VALUE_PARTITIONING_22__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Value Partitioning 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VALUE_PARTITIONING_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2 <em>Xml Variable One To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVariableOneToOne_2_2()
- * @generated
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22 = 30;
-
- /**
- * The feature id for the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__PARTITIONING = XML_PARTITIONING_GROUP_22__PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__REPLICATION_PARTITIONING = XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__ROUND_ROBIN_PARTITIONING = XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__PINNED_PARTITIONING = XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__RANGE_PARTITIONING = XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__VALUE_PARTITIONING = XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__HASH_PARTITIONING = XML_PARTITIONING_GROUP_22__HASH_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__UNION_PARTITIONING = XML_PARTITIONING_GROUP_22__UNION_PARTITIONING;
-
- /**
- * The feature id for the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__PARTITIONED = XML_PARTITIONING_GROUP_22__PARTITIONED;
-
- /**
- * The feature id for the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Xml Variable One To One 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VARIABLE_ONE_TO_ONE_22_FEATURE_COUNT = XML_PARTITIONING_GROUP_22_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2 <em>Xml Version 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVersion_2_2()
- * @generated
- */
- public static final int XML_VERSION_22 = 31;
-
- /**
- * The feature id for the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_22__INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Version 22</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_VERSION_22_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType <em>Cache Isolation Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getCacheIsolationType()
- * @generated
- */
- public static final int CACHE_ISOLATION_TYPE = 32;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAdditionalCriteria_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasic_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicCollection_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasicMap_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCache_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCollectionTable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappings_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlHashPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToMany_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlManyToOne_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToOne_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToMany_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPartitioningGroup_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPinnedPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRangePartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlReplicationPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlRoundRobinPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlId_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlIndex_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlJoinTable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlSecondaryTable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTable_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTableGenerator_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlUnionPartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlValuePartitioning_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVariableOneToOne_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlVersion_2_2EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum cacheIsolationTypeEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_2Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_2Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_2Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_2Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_2Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_2Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_2Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_2Package.eNS_URI, theEclipseLinkOrmV2_2Package);
- return theEclipseLinkOrmV2_2Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2 <em>Xml Additional Criteria 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Additional Criteria 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2
- * @generated
- */
- public EClass getXmlAdditionalCriteria_2_2()
- {
- return xmlAdditionalCriteria_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2#getCriteria <em>Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2#getCriteria()
- * @see #getXmlAdditionalCriteria_2_2()
- * @generated
- */
- public EAttribute getXmlAdditionalCriteria_2_2_Criteria()
- {
- return (EAttribute)xmlAdditionalCriteria_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2 <em>Xml Basic 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2
- * @generated
- */
- public EClass getXmlBasic_2_2()
- {
- return xmlBasic_2_2EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2#getIndex <em>Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2#getIndex()
- * @see #getXmlBasic_2_2()
- * @generated
- */
- public EReference getXmlBasic_2_2_Index()
- {
- return (EReference)xmlBasic_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2 <em>Xml Basic Collection 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Collection 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2
- * @generated
- */
- public EClass getXmlBasicCollection_2_2()
- {
- return xmlBasicCollection_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2#getCascadeOnDelete()
- * @see #getXmlBasicCollection_2_2()
- * @generated
- */
- public EAttribute getXmlBasicCollection_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlBasicCollection_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2 <em>Xml Basic Map 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic Map 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2
- * @generated
- */
- public EClass getXmlBasicMap_2_2()
- {
- return xmlBasicMap_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2#getCascadeOnDelete()
- * @see #getXmlBasicMap_2_2()
- * @generated
- */
- public EAttribute getXmlBasicMap_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlBasicMap_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2 <em>Xml Cache 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2
- * @generated
- */
- public EClass getXmlCache_2_2()
- {
- return xmlCache_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2#getIsolation <em>Isolation</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Isolation</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2#getIsolation()
- * @see #getXmlCache_2_2()
- * @generated
- */
- public EAttribute getXmlCache_2_2_Isolation()
- {
- return (EAttribute)xmlCache_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2 <em>Xml Collection Table 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Collection Table 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2
- * @generated
- */
- public EClass getXmlCollectionTable_2_2()
- {
- return xmlCollectionTable_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2#getCreationSuffix()
- * @see #getXmlCollectionTable_2_2()
- * @generated
- */
- public EAttribute getXmlCollectionTable_2_2_CreationSuffix()
- {
- return (EAttribute)xmlCollectionTable_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2 <em>Xml Element Collection 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2
- * @generated
- */
- public EClass getXmlElementCollection_2_2()
- {
- return xmlElementCollection_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#getCascadeOnDelete()
- * @see #getXmlElementCollection_2_2()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlElementCollection_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#isNoncacheable <em>Noncacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Noncacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#isNoncacheable()
- * @see #getXmlElementCollection_2_2()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_2_Noncacheable()
- {
- return (EAttribute)xmlElementCollection_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2 <em>Xml Entity 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2
- * @generated
- */
- public EClass getXmlEntity_2_2()
- {
- return xmlEntity_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getCascadeOnDelete()
- * @see #getXmlEntity_2_2()
- * @generated
- */
- public EAttribute getXmlEntity_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlEntity_2_2EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getIndex <em>Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getIndex()
- * @see #getXmlEntity_2_2()
- * @generated
- */
- public EReference getXmlEntity_2_2_Index()
- {
- return (EReference)xmlEntity_2_2EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2 <em>Xml Entity Mappings 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Mappings 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2
- * @generated
- */
- public EClass getXmlEntityMappings_2_2()
- {
- return xmlEntityMappings_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPartitioning <em>Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_Partitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Replication Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getReplicationPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_ReplicationPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Round Robin Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRoundRobinPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_RoundRobinPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Pinned Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPinnedPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_PinnedPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRangePartitioning <em>Range Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Range Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRangePartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_RangePartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getValuePartitioning <em>Value Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Value Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getValuePartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_ValuePartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getHashPartitioning <em>Hash Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Hash Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getHashPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_HashPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getUnionPartitioning <em>Union Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Union Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getUnionPartitioning()
- * @see #getXmlEntityMappings_2_2()
- * @generated
- */
- public EReference getXmlEntityMappings_2_2_UnionPartitioning()
- {
- return (EReference)xmlEntityMappings_2_2EClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2 <em>Xml Hash Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Hash Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2
- * @generated
- */
- public EClass getXmlHashPartitioning_2_2()
- {
- return xmlHashPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2#getName()
- * @see #getXmlHashPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlHashPartitioning_2_2_Name()
- {
- return (EAttribute)xmlHashPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getAdditionalCriteria <em>Additional Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Additional Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getAdditionalCriteria()
- * @see #getXmlEntity_2_2()
- * @generated
- */
- public EReference getXmlEntity_2_2_AdditionalCriteria()
- {
- return (EReference)xmlEntity_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2 <em>Xml Many To Many 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To Many 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2
- * @generated
- */
- public EClass getXmlManyToMany_2_2()
- {
- return xmlManyToMany_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#getCascadeOnDelete()
- * @see #getXmlManyToMany_2_2()
- * @generated
- */
- public EAttribute getXmlManyToMany_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlManyToMany_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#isNonCacheable <em>Non Cacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Cacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#isNonCacheable()
- * @see #getXmlManyToMany_2_2()
- * @generated
- */
- public EAttribute getXmlManyToMany_2_2_NonCacheable()
- {
- return (EAttribute)xmlManyToMany_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2 <em>Xml Many To One 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Many To One 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2
- * @generated
- */
- public EClass getXmlManyToOne_2_2()
- {
- return xmlManyToOne_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2#isNonCacheable <em>Non Cacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Cacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2#isNonCacheable()
- * @see #getXmlManyToOne_2_2()
- * @generated
- */
- public EAttribute getXmlManyToOne_2_2_NonCacheable()
- {
- return (EAttribute)xmlManyToOne_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2 <em>Xml One To One 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To One 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2
- * @generated
- */
- public EClass getXmlOneToOne_2_2()
- {
- return xmlOneToOne_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#getCascadeOnDelete()
- * @see #getXmlOneToOne_2_2()
- * @generated
- */
- public EAttribute getXmlOneToOne_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlOneToOne_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Cacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#isNonCacheable()
- * @see #getXmlOneToOne_2_2()
- * @generated
- */
- public EAttribute getXmlOneToOne_2_2_NonCacheable()
- {
- return (EAttribute)xmlOneToOne_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2 <em>Xml One To Many 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2
- * @generated
- */
- public EClass getXmlOneToMany_2_2()
- {
- return xmlOneToMany_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Cascade On Delete</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#getCascadeOnDelete()
- * @see #getXmlOneToMany_2_2()
- * @generated
- */
- public EAttribute getXmlOneToMany_2_2_CascadeOnDelete()
- {
- return (EAttribute)xmlOneToMany_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#isNoncacheable <em>Noncacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Noncacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#isNoncacheable()
- * @see #getXmlOneToMany_2_2()
- * @generated
- */
- public EAttribute getXmlOneToMany_2_2_Noncacheable()
- {
- return (EAttribute)xmlOneToMany_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2 <em>Xml Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2
- * @generated
- */
- public EClass getXmlPartitioning_2_2()
- {
- return xmlPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2#getName()
- * @see #getXmlPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlPartitioning_2_2_Name()
- {
- return (EAttribute)xmlPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2 <em>Xml Partitioning Group 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Partitioning Group 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2
- * @generated
- */
- public EClass getXmlPartitioningGroup_2_2()
- {
- return xmlPartitioningGroup_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioning <em>Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_Partitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Replication Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getReplicationPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Round Robin Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRoundRobinPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Pinned Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPinnedPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_PinnedPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRangePartitioning <em>Range Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Range Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRangePartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_RangePartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getValuePartitioning <em>Value Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Value Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getValuePartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_ValuePartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getHashPartitioning <em>Hash Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Hash Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getHashPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_HashPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(6);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getUnionPartitioning <em>Union Partitioning</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Union Partitioning</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getUnionPartitioning()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EReference getXmlPartitioningGroup_2_2_UnionPartitioning()
- {
- return (EReference)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(7);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioned <em>Partitioned</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Partitioned</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioned()
- * @see #getXmlPartitioningGroup_2_2()
- * @generated
- */
- public EAttribute getXmlPartitioningGroup_2_2_Partitioned()
- {
- return (EAttribute)xmlPartitioningGroup_2_2EClass.getEStructuralFeatures().get(8);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2 <em>Xml Pinned Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Pinned Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2
- * @generated
- */
- public EClass getXmlPinnedPartitioning_2_2()
- {
- return xmlPinnedPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2#getName()
- * @see #getXmlPinnedPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlPinnedPartitioning_2_2_Name()
- {
- return (EAttribute)xmlPinnedPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2 <em>Xml Range Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Range Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2
- * @generated
- */
- public EClass getXmlRangePartitioning_2_2()
- {
- return xmlRangePartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2#getName()
- * @see #getXmlRangePartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlRangePartitioning_2_2_Name()
- {
- return (EAttribute)xmlRangePartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2 <em>Xml Replication Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Replication Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2
- * @generated
- */
- public EClass getXmlReplicationPartitioning_2_2()
- {
- return xmlReplicationPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2#getName()
- * @see #getXmlReplicationPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlReplicationPartitioning_2_2_Name()
- {
- return (EAttribute)xmlReplicationPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2 <em>Xml Round Robin Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Round Robin Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2
- * @generated
- */
- public EClass getXmlRoundRobinPartitioning_2_2()
- {
- return xmlRoundRobinPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2#getName()
- * @see #getXmlRoundRobinPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlRoundRobinPartitioning_2_2_Name()
- {
- return (EAttribute)xmlRoundRobinPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2 <em>Xml Embeddable 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embeddable 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2
- * @generated
- */
- public EClass getXmlEmbeddable_2_2()
- {
- return xmlEmbeddable_2_2EClass;
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2 <em>Xml Id 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2
- * @generated
- */
- public EClass getXmlId_2_2()
- {
- return xmlId_2_2EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2#getIndex <em>Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2#getIndex()
- * @see #getXmlId_2_2()
- * @generated
- */
- public EReference getXmlId_2_2_Index()
- {
- return (EReference)xmlId_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2 <em>Xml Index 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Index 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2
- * @generated
- */
- public EClass getXmlIndex_2_2()
- {
- return xmlIndex_2_2EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getName()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Name()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getSchema <em>Schema</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Schema</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getSchema()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Schema()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getCatalog <em>Catalog</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Catalog</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getCatalog()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Catalog()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getTable()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Table()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getUnique <em>Unique</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Unique</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getUnique()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_Unique()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getColumnNames <em>Column Names</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>Column Names</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getColumnNames()
- * @see #getXmlIndex_2_2()
- * @generated
- */
- public EAttribute getXmlIndex_2_2_ColumnNames()
- {
- return (EAttribute)xmlIndex_2_2EClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2 <em>Xml Join Table 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Join Table 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2
- * @generated
- */
- public EClass getXmlJoinTable_2_2()
- {
- return xmlJoinTable_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2#getCreationSuffix()
- * @see #getXmlJoinTable_2_2()
- * @generated
- */
- public EAttribute getXmlJoinTable_2_2_CreationSuffix()
- {
- return (EAttribute)xmlJoinTable_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2 <em>Xml Mapped Superclass 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_2()
- {
- return xmlMappedSuperclass_2_2EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2#getAdditionalCriteria <em>Additional Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Additional Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2#getAdditionalCriteria()
- * @see #getXmlMappedSuperclass_2_2()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_2_AdditionalCriteria()
- {
- return (EReference)xmlMappedSuperclass_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2 <em>Xml Secondary Table 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Secondary Table 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2
- * @generated
- */
- public EClass getXmlSecondaryTable_2_2()
- {
- return xmlSecondaryTable_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2#getCreationSuffix()
- * @see #getXmlSecondaryTable_2_2()
- * @generated
- */
- public EAttribute getXmlSecondaryTable_2_2_CreationSuffix()
- {
- return (EAttribute)xmlSecondaryTable_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2 <em>Xml Table 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2
- * @generated
- */
- public EClass getXmlTable_2_2()
- {
- return xmlTable_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2#getCreationSuffix()
- * @see #getXmlTable_2_2()
- * @generated
- */
- public EAttribute getXmlTable_2_2_CreationSuffix()
- {
- return (EAttribute)xmlTable_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2 <em>Xml Table Generator 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Table Generator 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2
- * @generated
- */
- public EClass getXmlTableGenerator_2_2()
- {
- return xmlTableGenerator_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2#getCreationSuffix <em>Creation Suffix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Creation Suffix</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2#getCreationSuffix()
- * @see #getXmlTableGenerator_2_2()
- * @generated
- */
- public EAttribute getXmlTableGenerator_2_2_CreationSuffix()
- {
- return (EAttribute)xmlTableGenerator_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2 <em>Xml Union Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Union Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2
- * @generated
- */
- public EClass getXmlUnionPartitioning_2_2()
- {
- return xmlUnionPartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2#getName()
- * @see #getXmlUnionPartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlUnionPartitioning_2_2_Name()
- {
- return (EAttribute)xmlUnionPartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2 <em>Xml Value Partitioning 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Value Partitioning 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2
- * @generated
- */
- public EClass getXmlValuePartitioning_2_2()
- {
- return xmlValuePartitioning_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2#getName()
- * @see #getXmlValuePartitioning_2_2()
- * @generated
- */
- public EAttribute getXmlValuePartitioning_2_2_Name()
- {
- return (EAttribute)xmlValuePartitioning_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2 <em>Xml Variable One To One 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Variable One To One 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2
- * @generated
- */
- public EClass getXmlVariableOneToOne_2_2()
- {
- return xmlVariableOneToOne_2_2EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Non Cacheable</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2#isNonCacheable()
- * @see #getXmlVariableOneToOne_2_2()
- * @generated
- */
- public EAttribute getXmlVariableOneToOne_2_2_NonCacheable()
- {
- return (EAttribute)xmlVariableOneToOne_2_2EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2 <em>Xml Version 22</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Version 22</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2
- * @generated
- */
- public EClass getXmlVersion_2_2()
- {
- return xmlVersion_2_2EClass;
- }
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2#getIndex <em>Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2#getIndex()
- * @see #getXmlVersion_2_2()
- * @generated
- */
- public EReference getXmlVersion_2_2_Index()
- {
- return (EReference)xmlVersion_2_2EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType <em>Cache Isolation Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Cache Isolation Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @generated
- */
- public EEnum getCacheIsolationType()
- {
- return cacheIsolationTypeEEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_2Factory getEclipseLinkOrmV2_2Factory()
- {
- return (EclipseLinkOrmV2_2Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlAdditionalCriteria_2_2EClass = createEClass(XML_ADDITIONAL_CRITERIA_22);
- createEAttribute(xmlAdditionalCriteria_2_2EClass, XML_ADDITIONAL_CRITERIA_22__CRITERIA);
-
- xmlBasic_2_2EClass = createEClass(XML_BASIC_22);
- createEReference(xmlBasic_2_2EClass, XML_BASIC_22__INDEX);
-
- xmlBasicCollection_2_2EClass = createEClass(XML_BASIC_COLLECTION_22);
- createEAttribute(xmlBasicCollection_2_2EClass, XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE);
-
- xmlBasicMap_2_2EClass = createEClass(XML_BASIC_MAP_22);
- createEAttribute(xmlBasicMap_2_2EClass, XML_BASIC_MAP_22__CASCADE_ON_DELETE);
-
- xmlCache_2_2EClass = createEClass(XML_CACHE_22);
- createEAttribute(xmlCache_2_2EClass, XML_CACHE_22__ISOLATION);
-
- xmlCollectionTable_2_2EClass = createEClass(XML_COLLECTION_TABLE_22);
- createEAttribute(xmlCollectionTable_2_2EClass, XML_COLLECTION_TABLE_22__CREATION_SUFFIX);
-
- xmlElementCollection_2_2EClass = createEClass(XML_ELEMENT_COLLECTION_22);
- createEAttribute(xmlElementCollection_2_2EClass, XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE);
- createEAttribute(xmlElementCollection_2_2EClass, XML_ELEMENT_COLLECTION_22__NONCACHEABLE);
-
- xmlEmbeddable_2_2EClass = createEClass(XML_EMBEDDABLE_22);
-
- xmlEntity_2_2EClass = createEClass(XML_ENTITY_22);
- createEReference(xmlEntity_2_2EClass, XML_ENTITY_22__ADDITIONAL_CRITERIA);
- createEAttribute(xmlEntity_2_2EClass, XML_ENTITY_22__CASCADE_ON_DELETE);
- createEReference(xmlEntity_2_2EClass, XML_ENTITY_22__INDEX);
-
- xmlEntityMappings_2_2EClass = createEClass(XML_ENTITY_MAPPINGS_22);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING);
- createEReference(xmlEntityMappings_2_2EClass, XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING);
-
- xmlHashPartitioning_2_2EClass = createEClass(XML_HASH_PARTITIONING_22);
- createEAttribute(xmlHashPartitioning_2_2EClass, XML_HASH_PARTITIONING_22__NAME);
-
- xmlId_2_2EClass = createEClass(XML_ID_22);
- createEReference(xmlId_2_2EClass, XML_ID_22__INDEX);
-
- xmlIndex_2_2EClass = createEClass(XML_INDEX_22);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__NAME);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__SCHEMA);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__CATALOG);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__TABLE);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__UNIQUE);
- createEAttribute(xmlIndex_2_2EClass, XML_INDEX_22__COLUMN_NAMES);
-
- xmlJoinTable_2_2EClass = createEClass(XML_JOIN_TABLE_22);
- createEAttribute(xmlJoinTable_2_2EClass, XML_JOIN_TABLE_22__CREATION_SUFFIX);
-
- xmlManyToMany_2_2EClass = createEClass(XML_MANY_TO_MANY_22);
- createEAttribute(xmlManyToMany_2_2EClass, XML_MANY_TO_MANY_22__CASCADE_ON_DELETE);
- createEAttribute(xmlManyToMany_2_2EClass, XML_MANY_TO_MANY_22__NON_CACHEABLE);
-
- xmlManyToOne_2_2EClass = createEClass(XML_MANY_TO_ONE_22);
- createEAttribute(xmlManyToOne_2_2EClass, XML_MANY_TO_ONE_22__NON_CACHEABLE);
-
- xmlMappedSuperclass_2_2EClass = createEClass(XML_MAPPED_SUPERCLASS_22);
- createEReference(xmlMappedSuperclass_2_2EClass, XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA);
-
- xmlOneToOne_2_2EClass = createEClass(XML_ONE_TO_ONE_22);
- createEAttribute(xmlOneToOne_2_2EClass, XML_ONE_TO_ONE_22__CASCADE_ON_DELETE);
- createEAttribute(xmlOneToOne_2_2EClass, XML_ONE_TO_ONE_22__NON_CACHEABLE);
-
- xmlOneToMany_2_2EClass = createEClass(XML_ONE_TO_MANY_22);
- createEAttribute(xmlOneToMany_2_2EClass, XML_ONE_TO_MANY_22__CASCADE_ON_DELETE);
- createEAttribute(xmlOneToMany_2_2EClass, XML_ONE_TO_MANY_22__NONCACHEABLE);
-
- xmlPartitioning_2_2EClass = createEClass(XML_PARTITIONING_22);
- createEAttribute(xmlPartitioning_2_2EClass, XML_PARTITIONING_22__NAME);
-
- xmlPartitioningGroup_2_2EClass = createEClass(XML_PARTITIONING_GROUP_22);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__HASH_PARTITIONING);
- createEReference(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__UNION_PARTITIONING);
- createEAttribute(xmlPartitioningGroup_2_2EClass, XML_PARTITIONING_GROUP_22__PARTITIONED);
-
- xmlPinnedPartitioning_2_2EClass = createEClass(XML_PINNED_PARTITIONING_22);
- createEAttribute(xmlPinnedPartitioning_2_2EClass, XML_PINNED_PARTITIONING_22__NAME);
-
- xmlRangePartitioning_2_2EClass = createEClass(XML_RANGE_PARTITIONING_22);
- createEAttribute(xmlRangePartitioning_2_2EClass, XML_RANGE_PARTITIONING_22__NAME);
-
- xmlReplicationPartitioning_2_2EClass = createEClass(XML_REPLICATION_PARTITIONING_22);
- createEAttribute(xmlReplicationPartitioning_2_2EClass, XML_REPLICATION_PARTITIONING_22__NAME);
-
- xmlRoundRobinPartitioning_2_2EClass = createEClass(XML_ROUND_ROBIN_PARTITIONING_22);
- createEAttribute(xmlRoundRobinPartitioning_2_2EClass, XML_ROUND_ROBIN_PARTITIONING_22__NAME);
-
- xmlSecondaryTable_2_2EClass = createEClass(XML_SECONDARY_TABLE_22);
- createEAttribute(xmlSecondaryTable_2_2EClass, XML_SECONDARY_TABLE_22__CREATION_SUFFIX);
-
- xmlTable_2_2EClass = createEClass(XML_TABLE_22);
- createEAttribute(xmlTable_2_2EClass, XML_TABLE_22__CREATION_SUFFIX);
-
- xmlTableGenerator_2_2EClass = createEClass(XML_TABLE_GENERATOR_22);
- createEAttribute(xmlTableGenerator_2_2EClass, XML_TABLE_GENERATOR_22__CREATION_SUFFIX);
-
- xmlUnionPartitioning_2_2EClass = createEClass(XML_UNION_PARTITIONING_22);
- createEAttribute(xmlUnionPartitioning_2_2EClass, XML_UNION_PARTITIONING_22__NAME);
-
- xmlValuePartitioning_2_2EClass = createEClass(XML_VALUE_PARTITIONING_22);
- createEAttribute(xmlValuePartitioning_2_2EClass, XML_VALUE_PARTITIONING_22__NAME);
-
- xmlVariableOneToOne_2_2EClass = createEClass(XML_VARIABLE_ONE_TO_ONE_22);
- createEAttribute(xmlVariableOneToOne_2_2EClass, XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE);
-
- xmlVersion_2_2EClass = createEClass(XML_VERSION_22);
- createEReference(xmlVersion_2_2EClass, XML_VERSION_22__INDEX);
-
- // Create enums
- cacheIsolationTypeEEnum = createEEnum(CACHE_ISOLATION_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
- OrmPackage theOrmPackage = (OrmPackage)EPackage.Registry.INSTANCE.getEPackage(OrmPackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- xmlElementCollection_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlEmbeddable_2_2EClass.getESuperTypes().add(theOrmPackage.getXmlAttributeOverrideContainer());
- xmlEmbeddable_2_2EClass.getESuperTypes().add(theOrmPackage.getXmlAssociationOverrideContainer());
- xmlEntity_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlManyToMany_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlManyToOne_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlMappedSuperclass_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlOneToOne_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlOneToMany_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
- xmlVariableOneToOne_2_2EClass.getESuperTypes().add(this.getXmlPartitioningGroup_2_2());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlAdditionalCriteria_2_2EClass, XmlAdditionalCriteria_2_2.class, "XmlAdditionalCriteria_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlAdditionalCriteria_2_2_Criteria(), theXMLTypePackage.getString(), "criteria", null, 0, 1, XmlAdditionalCriteria_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBasic_2_2EClass, XmlBasic_2_2.class, "XmlBasic_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBasic_2_2_Index(), this.getXmlIndex_2_2(), null, "index", null, 0, 1, XmlBasic_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBasicCollection_2_2EClass, XmlBasicCollection_2_2.class, "XmlBasicCollection_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlBasicCollection_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlBasicCollection_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlBasicMap_2_2EClass, XmlBasicMap_2_2.class, "XmlBasicMap_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlBasicMap_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlBasicMap_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCache_2_2EClass, XmlCache_2_2.class, "XmlCache_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCache_2_2_Isolation(), this.getCacheIsolationType(), "isolation", "", 0, 1, XmlCache_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCollectionTable_2_2EClass, XmlCollectionTable_2_2.class, "XmlCollectionTable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCollectionTable_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlCollectionTable_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_2EClass, XmlElementCollection_2_2.class, "XmlElementCollection_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlElementCollection_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlElementCollection_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlElementCollection_2_2_Noncacheable(), theXMLTypePackage.getBoolean(), "noncacheable", null, 0, 1, XmlElementCollection_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddable_2_2EClass, XmlEmbeddable_2_2.class, "XmlEmbeddable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- initEClass(xmlEntity_2_2EClass, XmlEntity_2_2.class, "XmlEntity_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_2_AdditionalCriteria(), this.getXmlAdditionalCriteria_2_2(), null, "additionalCriteria", null, 0, 1, XmlEntity_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlEntity_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlEntity_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_2_Index(), this.getXmlIndex_2_2(), null, "index", null, 0, 1, XmlEntity_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityMappings_2_2EClass, XmlEntityMappings_2_2.class, "XmlEntityMappings_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntityMappings_2_2_Partitioning(), this.getXmlPartitioning_2_2(), null, "partitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_ReplicationPartitioning(), this.getXmlReplicationPartitioning_2_2(), null, "replicationPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_RoundRobinPartitioning(), this.getXmlRoundRobinPartitioning_2_2(), null, "roundRobinPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_PinnedPartitioning(), this.getXmlPinnedPartitioning_2_2(), null, "pinnedPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_RangePartitioning(), this.getXmlRangePartitioning_2_2(), null, "rangePartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_ValuePartitioning(), this.getXmlValuePartitioning_2_2(), null, "valuePartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_HashPartitioning(), this.getXmlHashPartitioning_2_2(), null, "hashPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_2_UnionPartitioning(), this.getXmlUnionPartitioning_2_2(), null, "unionPartitioning", null, 0, -1, XmlEntityMappings_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlHashPartitioning_2_2EClass, XmlHashPartitioning_2_2.class, "XmlHashPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlHashPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlHashPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlId_2_2EClass, XmlId_2_2.class, "XmlId_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlId_2_2_Index(), this.getXmlIndex_2_2(), null, "index", null, 0, 1, XmlId_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlIndex_2_2EClass, XmlIndex_2_2.class, "XmlIndex_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlIndex_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_Schema(), theXMLTypePackage.getString(), "schema", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_Catalog(), theXMLTypePackage.getString(), "catalog", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_Unique(), theXMLTypePackage.getBooleanObject(), "unique", null, 0, 1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlIndex_2_2_ColumnNames(), theXMLTypePackage.getString(), "columnNames", null, 0, -1, XmlIndex_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlJoinTable_2_2EClass, XmlJoinTable_2_2.class, "XmlJoinTable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlJoinTable_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlJoinTable_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlManyToMany_2_2EClass, XmlManyToMany_2_2.class, "XmlManyToMany_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlManyToMany_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlManyToMany_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlManyToMany_2_2_NonCacheable(), theXMLTypePackage.getBoolean(), "nonCacheable", null, 0, 1, XmlManyToMany_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlManyToOne_2_2EClass, XmlManyToOne_2_2.class, "XmlManyToOne_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlManyToOne_2_2_NonCacheable(), theXMLTypePackage.getBoolean(), "nonCacheable", null, 0, 1, XmlManyToOne_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_2_2EClass, XmlMappedSuperclass_2_2.class, "XmlMappedSuperclass_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_2_AdditionalCriteria(), this.getXmlAdditionalCriteria_2_2(), null, "additionalCriteria", null, 0, 1, XmlMappedSuperclass_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToOne_2_2EClass, XmlOneToOne_2_2.class, "XmlOneToOne_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOneToOne_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlOneToOne_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlOneToOne_2_2_NonCacheable(), theXMLTypePackage.getBoolean(), "nonCacheable", null, 0, 1, XmlOneToOne_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToMany_2_2EClass, XmlOneToMany_2_2.class, "XmlOneToMany_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOneToMany_2_2_CascadeOnDelete(), theXMLTypePackage.getBooleanObject(), "cascadeOnDelete", null, 0, 1, XmlOneToMany_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlOneToMany_2_2_Noncacheable(), theXMLTypePackage.getBoolean(), "noncacheable", null, 0, 1, XmlOneToMany_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPartitioning_2_2EClass, XmlPartitioning_2_2.class, "XmlPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPartitioningGroup_2_2EClass, XmlPartitioningGroup_2_2.class, "XmlPartitioningGroup_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlPartitioningGroup_2_2_Partitioning(), this.getXmlPartitioning_2_2(), null, "partitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_ReplicationPartitioning(), this.getXmlReplicationPartitioning_2_2(), null, "replicationPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_RoundRobinPartitioning(), this.getXmlRoundRobinPartitioning_2_2(), null, "roundRobinPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_PinnedPartitioning(), this.getXmlPinnedPartitioning_2_2(), null, "pinnedPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_RangePartitioning(), this.getXmlRangePartitioning_2_2(), null, "rangePartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_ValuePartitioning(), this.getXmlValuePartitioning_2_2(), null, "valuePartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_HashPartitioning(), this.getXmlHashPartitioning_2_2(), null, "hashPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlPartitioningGroup_2_2_UnionPartitioning(), this.getXmlUnionPartitioning_2_2(), null, "unionPartitioning", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlPartitioningGroup_2_2_Partitioned(), theXMLTypePackage.getString(), "partitioned", null, 0, 1, XmlPartitioningGroup_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPinnedPartitioning_2_2EClass, XmlPinnedPartitioning_2_2.class, "XmlPinnedPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPinnedPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlPinnedPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlRangePartitioning_2_2EClass, XmlRangePartitioning_2_2.class, "XmlRangePartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlRangePartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlRangePartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlReplicationPartitioning_2_2EClass, XmlReplicationPartitioning_2_2.class, "XmlReplicationPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlReplicationPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlReplicationPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlRoundRobinPartitioning_2_2EClass, XmlRoundRobinPartitioning_2_2.class, "XmlRoundRobinPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlRoundRobinPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlRoundRobinPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlSecondaryTable_2_2EClass, XmlSecondaryTable_2_2.class, "XmlSecondaryTable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlSecondaryTable_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlSecondaryTable_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTable_2_2EClass, XmlTable_2_2.class, "XmlTable_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTable_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlTable_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTableGenerator_2_2EClass, XmlTableGenerator_2_2.class, "XmlTableGenerator_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTableGenerator_2_2_CreationSuffix(), theXMLTypePackage.getString(), "creationSuffix", null, 0, 1, XmlTableGenerator_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlUnionPartitioning_2_2EClass, XmlUnionPartitioning_2_2.class, "XmlUnionPartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlUnionPartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlUnionPartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlValuePartitioning_2_2EClass, XmlValuePartitioning_2_2.class, "XmlValuePartitioning_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlValuePartitioning_2_2_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlValuePartitioning_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlVariableOneToOne_2_2EClass, XmlVariableOneToOne_2_2.class, "XmlVariableOneToOne_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlVariableOneToOne_2_2_NonCacheable(), theXMLTypePackage.getBoolean(), "nonCacheable", null, 0, 1, XmlVariableOneToOne_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlVersion_2_2EClass, XmlVersion_2_2.class, "XmlVersion_2_2", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlVersion_2_2_Index(), this.getXmlIndex_2_2(), null, "index", null, 0, 1, XmlVersion_2_2.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(cacheIsolationTypeEEnum, CacheIsolationType.class, "CacheIsolationType");
- addEEnumLiteral(cacheIsolationTypeEEnum, CacheIsolationType.SHARED);
- addEEnumLiteral(cacheIsolationTypeEEnum, CacheIsolationType.PROTECTED);
- addEEnumLiteral(cacheIsolationTypeEEnum, CacheIsolationType.ISOLATED);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2 <em>Xml Additional Criteria 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlAdditionalCriteria_2_2()
- * @generated
- */
- public static final EClass XML_ADDITIONAL_CRITERIA_22 = eINSTANCE.getXmlAdditionalCriteria_2_2();
-
- /**
- * The meta object literal for the '<em><b>Criteria</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ADDITIONAL_CRITERIA_22__CRITERIA = eINSTANCE.getXmlAdditionalCriteria_2_2_Criteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2 <em>Xml Basic 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasic_2_2()
- * @generated
- */
- public static final EClass XML_BASIC_22 = eINSTANCE.getXmlBasic_2_2();
-
- /**
- * The meta object literal for the '<em><b>Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BASIC_22__INDEX = eINSTANCE.getXmlBasic_2_2_Index();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2 <em>Xml Basic Collection 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicCollection_2_2()
- * @generated
- */
- public static final EClass XML_BASIC_COLLECTION_22 = eINSTANCE.getXmlBasicCollection_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC_COLLECTION_22__CASCADE_ON_DELETE = eINSTANCE.getXmlBasicCollection_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2 <em>Xml Basic Map 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicMap_2_2()
- * @generated
- */
- public static final EClass XML_BASIC_MAP_22 = eINSTANCE.getXmlBasicMap_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_BASIC_MAP_22__CASCADE_ON_DELETE = eINSTANCE.getXmlBasicMap_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2 <em>Xml Cache 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCache_2_2()
- * @generated
- */
- public static final EClass XML_CACHE_22 = eINSTANCE.getXmlCache_2_2();
-
- /**
- * The meta object literal for the '<em><b>Isolation</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE_22__ISOLATION = eINSTANCE.getXmlCache_2_2_Isolation();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2 <em>Xml Collection Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCollectionTable_2_2()
- * @generated
- */
- public static final EClass XML_COLLECTION_TABLE_22 = eINSTANCE.getXmlCollectionTable_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_COLLECTION_TABLE_22__CREATION_SUFFIX = eINSTANCE.getXmlCollectionTable_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2 <em>Xml Element Collection 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_22 = eINSTANCE.getXmlElementCollection_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_22__CASCADE_ON_DELETE = eINSTANCE.getXmlElementCollection_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Noncacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_22__NONCACHEABLE = eINSTANCE.getXmlElementCollection_2_2_Noncacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2 <em>Xml Entity 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2()
- * @generated
- */
- public static final EClass XML_ENTITY_22 = eINSTANCE.getXmlEntity_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ENTITY_22__CASCADE_ON_DELETE = eINSTANCE.getXmlEntity_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_22__INDEX = eINSTANCE.getXmlEntity_2_2_Index();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2 <em>Xml Entity Mappings 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS_22 = eINSTANCE.getXmlEntityMappings_2_2();
-
- /**
- * The meta object literal for the '<em><b>Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_Partitioning();
-
- /**
- * The meta object literal for the '<em><b>Replication Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__REPLICATION_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_ReplicationPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Round Robin Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__ROUND_ROBIN_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_RoundRobinPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Pinned Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__PINNED_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_PinnedPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Range Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__RANGE_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_RangePartitioning();
-
- /**
- * The meta object literal for the '<em><b>Value Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__VALUE_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_ValuePartitioning();
-
- /**
- * The meta object literal for the '<em><b>Hash Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__HASH_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_HashPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Union Partitioning</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_22__UNION_PARTITIONING = eINSTANCE.getXmlEntityMappings_2_2_UnionPartitioning();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2 <em>Xml Hash Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlHashPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_HASH_PARTITIONING_22 = eINSTANCE.getXmlHashPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_HASH_PARTITIONING_22__NAME = eINSTANCE.getXmlHashPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '<em><b>Additional Criteria</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_22__ADDITIONAL_CRITERIA = eINSTANCE.getXmlEntity_2_2_AdditionalCriteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2 <em>Xml Many To Many 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2()
- * @generated
- */
- public static final EClass XML_MANY_TO_MANY_22 = eINSTANCE.getXmlManyToMany_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MANY_TO_MANY_22__CASCADE_ON_DELETE = eINSTANCE.getXmlManyToMany_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Non Cacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MANY_TO_MANY_22__NON_CACHEABLE = eINSTANCE.getXmlManyToMany_2_2_NonCacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2 <em>Xml Many To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToOne_2_2()
- * @generated
- */
- public static final EClass XML_MANY_TO_ONE_22 = eINSTANCE.getXmlManyToOne_2_2();
-
- /**
- * The meta object literal for the '<em><b>Non Cacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MANY_TO_ONE_22__NON_CACHEABLE = eINSTANCE.getXmlManyToOne_2_2_NonCacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2 <em>Xml One To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2()
- * @generated
- */
- public static final EClass XML_ONE_TO_ONE_22 = eINSTANCE.getXmlOneToOne_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_ONE_22__CASCADE_ON_DELETE = eINSTANCE.getXmlOneToOne_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Non Cacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_ONE_22__NON_CACHEABLE = eINSTANCE.getXmlOneToOne_2_2_NonCacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2 <em>Xml One To Many 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_22 = eINSTANCE.getXmlOneToMany_2_2();
-
- /**
- * The meta object literal for the '<em><b>Cascade On Delete</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_MANY_22__CASCADE_ON_DELETE = eINSTANCE.getXmlOneToMany_2_2_CascadeOnDelete();
-
- /**
- * The meta object literal for the '<em><b>Noncacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_MANY_22__NONCACHEABLE = eINSTANCE.getXmlOneToMany_2_2_Noncacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2 <em>Xml Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_PARTITIONING_22 = eINSTANCE.getXmlPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PARTITIONING_22__NAME = eINSTANCE.getXmlPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2 <em>Xml Partitioning Group 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2()
- * @generated
- */
- public static final EClass XML_PARTITIONING_GROUP_22 = eINSTANCE.getXmlPartitioningGroup_2_2();
-
- /**
- * The meta object literal for the '<em><b>Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_Partitioning();
-
- /**
- * The meta object literal for the '<em><b>Replication Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__REPLICATION_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_ReplicationPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Round Robin Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__ROUND_ROBIN_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_RoundRobinPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Pinned Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__PINNED_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_PinnedPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Range Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__RANGE_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_RangePartitioning();
-
- /**
- * The meta object literal for the '<em><b>Value Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__VALUE_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_ValuePartitioning();
-
- /**
- * The meta object literal for the '<em><b>Hash Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__HASH_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_HashPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Union Partitioning</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PARTITIONING_GROUP_22__UNION_PARTITIONING = eINSTANCE.getXmlPartitioningGroup_2_2_UnionPartitioning();
-
- /**
- * The meta object literal for the '<em><b>Partitioned</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PARTITIONING_GROUP_22__PARTITIONED = eINSTANCE.getXmlPartitioningGroup_2_2_Partitioned();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2 <em>Xml Pinned Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPinnedPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_PINNED_PARTITIONING_22 = eINSTANCE.getXmlPinnedPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PINNED_PARTITIONING_22__NAME = eINSTANCE.getXmlPinnedPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2 <em>Xml Range Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRangePartitioning_2_2()
- * @generated
- */
- public static final EClass XML_RANGE_PARTITIONING_22 = eINSTANCE.getXmlRangePartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_RANGE_PARTITIONING_22__NAME = eINSTANCE.getXmlRangePartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2 <em>Xml Replication Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlReplicationPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_REPLICATION_PARTITIONING_22 = eINSTANCE.getXmlReplicationPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_REPLICATION_PARTITIONING_22__NAME = eINSTANCE.getXmlReplicationPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2 <em>Xml Round Robin Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRoundRobinPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_ROUND_ROBIN_PARTITIONING_22 = eINSTANCE.getXmlRoundRobinPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ROUND_ROBIN_PARTITIONING_22__NAME = eINSTANCE.getXmlRoundRobinPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2 <em>Xml Embeddable 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEmbeddable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEmbeddable_2_2()
- * @generated
- */
- public static final EClass XML_EMBEDDABLE_22 = eINSTANCE.getXmlEmbeddable_2_2();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2 <em>Xml Id 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlId_2_2()
- * @generated
- */
- public static final EClass XML_ID_22 = eINSTANCE.getXmlId_2_2();
-
- /**
- * The meta object literal for the '<em><b>Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ID_22__INDEX = eINSTANCE.getXmlId_2_2_Index();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2 <em>Xml Index 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2()
- * @generated
- */
- public static final EClass XML_INDEX_22 = eINSTANCE.getXmlIndex_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__NAME = eINSTANCE.getXmlIndex_2_2_Name();
-
- /**
- * The meta object literal for the '<em><b>Schema</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__SCHEMA = eINSTANCE.getXmlIndex_2_2_Schema();
-
- /**
- * The meta object literal for the '<em><b>Catalog</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__CATALOG = eINSTANCE.getXmlIndex_2_2_Catalog();
-
- /**
- * The meta object literal for the '<em><b>Table</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__TABLE = eINSTANCE.getXmlIndex_2_2_Table();
-
- /**
- * The meta object literal for the '<em><b>Unique</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__UNIQUE = eINSTANCE.getXmlIndex_2_2_Unique();
-
- /**
- * The meta object literal for the '<em><b>Column Names</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_INDEX_22__COLUMN_NAMES = eINSTANCE.getXmlIndex_2_2_ColumnNames();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2 <em>Xml Join Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlJoinTable_2_2()
- * @generated
- */
- public static final EClass XML_JOIN_TABLE_22 = eINSTANCE.getXmlJoinTable_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_JOIN_TABLE_22__CREATION_SUFFIX = eINSTANCE.getXmlJoinTable_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2 <em>Xml Mapped Superclass 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlMappedSuperclass_2_2()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_22 = eINSTANCE.getXmlMappedSuperclass_2_2();
-
- /**
- * The meta object literal for the '<em><b>Additional Criteria</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_22__ADDITIONAL_CRITERIA = eINSTANCE.getXmlMappedSuperclass_2_2_AdditionalCriteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2 <em>Xml Secondary Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlSecondaryTable_2_2()
- * @generated
- */
- public static final EClass XML_SECONDARY_TABLE_22 = eINSTANCE.getXmlSecondaryTable_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_SECONDARY_TABLE_22__CREATION_SUFFIX = eINSTANCE.getXmlSecondaryTable_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2 <em>Xml Table 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTable_2_2()
- * @generated
- */
- public static final EClass XML_TABLE_22 = eINSTANCE.getXmlTable_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_22__CREATION_SUFFIX = eINSTANCE.getXmlTable_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2 <em>Xml Table Generator 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTableGenerator_2_2()
- * @generated
- */
- public static final EClass XML_TABLE_GENERATOR_22 = eINSTANCE.getXmlTableGenerator_2_2();
-
- /**
- * The meta object literal for the '<em><b>Creation Suffix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TABLE_GENERATOR_22__CREATION_SUFFIX = eINSTANCE.getXmlTableGenerator_2_2_CreationSuffix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2 <em>Xml Union Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlUnionPartitioning_2_2()
- * @generated
- */
- public static final EClass XML_UNION_PARTITIONING_22 = eINSTANCE.getXmlUnionPartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_UNION_PARTITIONING_22__NAME = eINSTANCE.getXmlUnionPartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2 <em>Xml Value Partitioning 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlValuePartitioning_2_2()
- * @generated
- */
- public static final EClass XML_VALUE_PARTITIONING_22 = eINSTANCE.getXmlValuePartitioning_2_2();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_VALUE_PARTITIONING_22__NAME = eINSTANCE.getXmlValuePartitioning_2_2_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2 <em>Xml Variable One To One 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVariableOneToOne_2_2()
- * @generated
- */
- public static final EClass XML_VARIABLE_ONE_TO_ONE_22 = eINSTANCE.getXmlVariableOneToOne_2_2();
-
- /**
- * The meta object literal for the '<em><b>Non Cacheable</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_VARIABLE_ONE_TO_ONE_22__NON_CACHEABLE = eINSTANCE.getXmlVariableOneToOne_2_2_NonCacheable();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2 <em>Xml Version 22</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVersion_2_2()
- * @generated
- */
- public static final EClass XML_VERSION_22 = eINSTANCE.getXmlVersion_2_2();
-
- /**
- * The meta object literal for the '<em><b>Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_VERSION_22__INDEX = eINSTANCE.getXmlVersion_2_2_Index();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType <em>Cache Isolation Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getCacheIsolationType()
- * @generated
- */
- public static final EEnum CACHE_ISOLATION_TYPE = eINSTANCE.getCacheIsolationType();
-
- }
-
-} //EclipseLinkOrmV2_2Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlAdditionalCriteria_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlAdditionalCriteria_2_2.java
deleted file mode 100644
index 3b131f3abc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlAdditionalCriteria_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Additional Criteria 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2#getCriteria <em>Criteria</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlAdditionalCriteria_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAdditionalCriteria_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Criteria</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Criteria</em>' attribute.
- * @see #setCriteria(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlAdditionalCriteria_2_2_Criteria()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCriteria();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlAdditionalCriteria_2_2#getCriteria <em>Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Criteria</em>' attribute.
- * @see #getCriteria()
- * @generated
- */
- void setCriteria(String value);
-
-} // XmlAdditionalCriteria_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicCollection_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicCollection_2_2.java
deleted file mode 100644
index af8f99d010..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicCollection_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Collection 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicCollection_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasicCollection_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicCollection_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
-} // XmlBasicCollection_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicMap_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicMap_2_2.java
deleted file mode 100644
index 1fccc92fe3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasicMap_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic Map 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicMap_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasicMap_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasicMap_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasicMap_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
-} // XmlBasicMap_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasic_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasic_2_2.java
deleted file mode 100644
index 6eb2e28aca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlBasic_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2#getIndex <em>Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasic_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasic_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlBasic_2_2_Index()
- * @model containment="true"
- * @generated
- */
- XmlIndex_2_2 getIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlBasic_2_2#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- void setIndex(XmlIndex_2_2 value);
-
-} // XmlBasic_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCache_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCache_2_2.java
deleted file mode 100644
index a51a7c9920..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCache_2_2.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache2 2</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2#getIsolation <em>Isolation</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCache_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCache_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Isolation</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Isolation</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Isolation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see #setIsolation(CacheIsolationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCache_2_2_Isolation()
- * @model default=""
- * @generated
- */
- CacheIsolationType getIsolation();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCache_2_2#getIsolation <em>Isolation</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Isolation</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType
- * @see #getIsolation()
- * @generated
- */
- void setIsolation(CacheIsolationType value);
-
-} // XmlCache2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCollectionTable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCollectionTable_2_2.java
deleted file mode 100644
index 87dab02df6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlCollectionTable_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Collection Table 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCollectionTable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCollectionTable_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlCollectionTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlCollectionTable_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlCollectionTable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlElementCollection_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlElementCollection_2_2.java
deleted file mode 100644
index ebed8e887e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlElementCollection_2_2.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#isNoncacheable <em>Noncacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlElementCollection_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Noncacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Noncacheable</em>' attribute.
- * @see #setNoncacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlElementCollection_2_2_Noncacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNoncacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlElementCollection_2_2#isNoncacheable <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Noncacheable</em>' attribute.
- * @see #isNoncacheable()
- * @generated
- */
- void setNoncacheable(boolean value);
-
-} // XmlElementCollection_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEmbeddable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEmbeddable_2_2.java
deleted file mode 100644
index 883653bcca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEmbeddable_2_2.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverrideContainer;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embeddable 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEmbeddable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEmbeddable_2_2 extends XmlAttributeOverrideContainer, XmlAssociationOverrideContainer
-{
-
-} // XmlEmbeddable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntityMappings_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntityMappings_2_2.java
deleted file mode 100644
index cb303b5216..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntityMappings_2_2.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity Mappings 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPartitioning <em>Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getRangePartitioning <em>Range Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getValuePartitioning <em>Value Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getHashPartitioning <em>Hash Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntityMappings_2_2#getUnionPartitioning <em>Union Partitioning</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntityMappings_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlPartitioning_2_2> getPartitioning();
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlReplicationPartitioning_2_2> getReplicationPartitioning();
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlRoundRobinPartitioning_2_2> getRoundRobinPartitioning();
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlPinnedPartitioning_2_2> getPinnedPartitioning();
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlRangePartitioning_2_2> getRangePartitioning();
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlValuePartitioning_2_2> getValuePartitioning();
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlHashPartitioning_2_2> getHashPartitioning();
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntityMappings_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- EList<XmlUnionPartitioning_2_2> getUnionPartitioning();
-
-} // XmlEntityMappings_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntity_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntity_2_2.java
deleted file mode 100644
index cd27063979..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlEntity_2_2.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getAdditionalCriteria <em>Additional Criteria</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getIndex <em>Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntity_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2_Index()
- * @model containment="true"
- * @generated
- */
- XmlIndex_2_2 getIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- void setIndex(XmlIndex_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Additional Criteria</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Additional Criteria</em>' containment reference.
- * @see #setAdditionalCriteria(XmlAdditionalCriteria_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlEntity_2_2_AdditionalCriteria()
- * @model containment="true"
- * @generated
- */
- XmlAdditionalCriteria_2_2 getAdditionalCriteria();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlEntity_2_2#getAdditionalCriteria <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Additional Criteria</em>' containment reference.
- * @see #getAdditionalCriteria()
- * @generated
- */
- void setAdditionalCriteria(XmlAdditionalCriteria_2_2 value);
-
-} // XmlEntity_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlHashPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlHashPartitioning_2_2.java
deleted file mode 100644
index b5535220e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlHashPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Hash Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlHashPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlHashPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlHashPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlHashPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlHashPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlId_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlId_2_2.java
deleted file mode 100644
index c0e2b70fc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlId_2_2.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlId_2_2.java,v 1.1 2011/02/06 02:13:00 kmoore Exp $
- */
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Id 22</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2#getIndex <em>Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlId_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlId_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlId_2_2_Index()
- * @model containment="true"
- * @generated
- */
- XmlIndex_2_2 getIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlId_2_2#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- void setIndex(XmlIndex_2_2 value);
-
-} // XmlId_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlIndex_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlIndex_2_2.java
deleted file mode 100644
index 98d259385b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlIndex_2_2.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Index 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getSchema <em>Schema</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getCatalog <em>Catalog</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getUnique <em>Unique</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getColumnNames <em>Column Names</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlIndex_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Schema</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Schema</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Schema</em>' attribute.
- * @see #setSchema(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Schema()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getSchema();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getSchema <em>Schema</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Schema</em>' attribute.
- * @see #getSchema()
- * @generated
- */
- void setSchema(String value);
-
- /**
- * Returns the value of the '<em><b>Catalog</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Catalog</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Catalog</em>' attribute.
- * @see #setCatalog(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Catalog()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCatalog();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getCatalog <em>Catalog</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Catalog</em>' attribute.
- * @see #getCatalog()
- * @generated
- */
- void setCatalog(String value);
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- void setTable(String value);
-
- /**
- * Returns the value of the '<em><b>Unique</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Unique</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Unique</em>' attribute.
- * @see #setUnique(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_Unique()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getUnique();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlIndex_2_2#getUnique <em>Unique</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Unique</em>' attribute.
- * @see #getUnique()
- * @generated
- */
- void setUnique(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlIndex_2_2_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- EList<String> getColumnNames();
-
-} // XmlIndex_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlJoinTable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlJoinTable_2_2.java
deleted file mode 100644
index 33db965771..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlJoinTable_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Join Table 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlJoinTable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlJoinTable_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlJoinTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlJoinTable_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlJoinTable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToMany_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToMany_2_2.java
deleted file mode 100644
index 328c0dc19d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToMany_2_2.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To Many 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#isNonCacheable <em>Non Cacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToMany_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToMany_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNonCacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToMany_2_2#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- void setNonCacheable(boolean value);
-
-} // XmlManyToMany_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToOne_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToOne_2_2.java
deleted file mode 100644
index f9ed6b9270..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlManyToOne_2_2.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Many To One 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2#isNonCacheable <em>Non Cacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToOne_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlManyToOne_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlManyToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNonCacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlManyToOne_2_2#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- void setNonCacheable(boolean value);
-
-} // XmlManyToOne_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlMappedSuperclass_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlMappedSuperclass_2_2.java
deleted file mode 100644
index f949aa8c74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlMappedSuperclass_2_2.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2#getAdditionalCriteria <em>Additional Criteria</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlMappedSuperclass_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMappedSuperclass_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Additional Criteria</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Additional Criteria</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Additional Criteria</em>' containment reference.
- * @see #setAdditionalCriteria(XmlAdditionalCriteria_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlMappedSuperclass_2_2_AdditionalCriteria()
- * @model containment="true"
- * @generated
- */
- XmlAdditionalCriteria_2_2 getAdditionalCriteria();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlMappedSuperclass_2_2#getAdditionalCriteria <em>Additional Criteria</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Additional Criteria</em>' containment reference.
- * @see #getAdditionalCriteria()
- * @generated
- */
- void setAdditionalCriteria(XmlAdditionalCriteria_2_2 value);
-
-} // XmlMappedSuperclass_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToMany_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToMany_2_2.java
deleted file mode 100644
index 6807ef6f1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToMany_2_2.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To Many 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#isNoncacheable <em>Noncacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToMany_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Noncacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Noncacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Noncacheable</em>' attribute.
- * @see #setNoncacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToMany_2_2_Noncacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNoncacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToMany_2_2#isNoncacheable <em>Noncacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Noncacheable</em>' attribute.
- * @see #isNoncacheable()
- * @generated
- */
- void setNoncacheable(boolean value);
-
-} // XmlOneToMany_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToOne_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToOne_2_2.java
deleted file mode 100644
index cc745a9b5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlOneToOne_2_2.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To One 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlOneToOne_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Cascade On Delete</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cascade On Delete</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cascade On Delete</em>' attribute.
- * @see #setCascadeOnDelete(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2_CascadeOnDelete()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getCascadeOnDelete();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#getCascadeOnDelete <em>Cascade On Delete</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cascade On Delete</em>' attribute.
- * @see #getCascadeOnDelete()
- * @generated
- */
- void setCascadeOnDelete(Boolean value);
-
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlOneToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNonCacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- void setNonCacheable(boolean value);
-
-} // XmlOneToOne_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioningGroup_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioningGroup_2_2.java
deleted file mode 100644
index 30dbd3998c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioningGroup_2_2.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Partitioning Group2 2</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioning <em>Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRangePartitioning <em>Range Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getValuePartitioning <em>Value Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getHashPartitioning <em>Hash Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getUnionPartitioning <em>Union Partitioning</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioned <em>Partitioned</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPartitioningGroup_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioning</em>' containment reference.
- * @see #setPartitioning(XmlPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_Partitioning()
- * @model containment="true"
- * @generated
- */
- XmlPartitioning_2_2 getPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioning <em>Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioning</em>' containment reference.
- * @see #getPartitioning()
- * @generated
- */
- void setPartitioning(XmlPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Replication Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Replication Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #setReplicationPartitioning(XmlReplicationPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_ReplicationPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlReplicationPartitioning_2_2 getReplicationPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getReplicationPartitioning <em>Replication Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Replication Partitioning</em>' containment reference.
- * @see #getReplicationPartitioning()
- * @generated
- */
- void setReplicationPartitioning(XmlReplicationPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Round Robin Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Round Robin Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_RoundRobinPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlRoundRobinPartitioning_2_2 getRoundRobinPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRoundRobinPartitioning <em>Round Robin Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Round Robin Partitioning</em>' containment reference.
- * @see #getRoundRobinPartitioning()
- * @generated
- */
- void setRoundRobinPartitioning(XmlRoundRobinPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Pinned Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Pinned Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #setPinnedPartitioning(XmlPinnedPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_PinnedPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlPinnedPartitioning_2_2 getPinnedPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPinnedPartitioning <em>Pinned Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Pinned Partitioning</em>' containment reference.
- * @see #getPinnedPartitioning()
- * @generated
- */
- void setPinnedPartitioning(XmlPinnedPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Range Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Range Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Range Partitioning</em>' containment reference.
- * @see #setRangePartitioning(XmlRangePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_RangePartitioning()
- * @model containment="true"
- * @generated
- */
- XmlRangePartitioning_2_2 getRangePartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getRangePartitioning <em>Range Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Range Partitioning</em>' containment reference.
- * @see #getRangePartitioning()
- * @generated
- */
- void setRangePartitioning(XmlRangePartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Value Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Value Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Value Partitioning</em>' containment reference.
- * @see #setValuePartitioning(XmlValuePartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_ValuePartitioning()
- * @model containment="true"
- * @generated
- */
- XmlValuePartitioning_2_2 getValuePartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getValuePartitioning <em>Value Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Value Partitioning</em>' containment reference.
- * @see #getValuePartitioning()
- * @generated
- */
- void setValuePartitioning(XmlValuePartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Hash Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Hash Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #setHashPartitioning(XmlHashPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_HashPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlHashPartitioning_2_2 getHashPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getHashPartitioning <em>Hash Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Hash Partitioning</em>' containment reference.
- * @see #getHashPartitioning()
- * @generated
- */
- void setHashPartitioning(XmlHashPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Union Partitioning</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Union Partitioning</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Union Partitioning</em>' containment reference.
- * @see #setUnionPartitioning(XmlUnionPartitioning_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_UnionPartitioning()
- * @model containment="true"
- * @generated
- */
- XmlUnionPartitioning_2_2 getUnionPartitioning();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getUnionPartitioning <em>Union Partitioning</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Union Partitioning</em>' containment reference.
- * @see #getUnionPartitioning()
- * @generated
- */
- void setUnionPartitioning(XmlUnionPartitioning_2_2 value);
-
- /**
- * Returns the value of the '<em><b>Partitioned</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Partitioned</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Partitioned</em>' attribute.
- * @see #setPartitioned(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioningGroup_2_2_Partitioned()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getPartitioned();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioningGroup_2_2#getPartitioned <em>Partitioned</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Partitioned</em>' attribute.
- * @see #getPartitioned()
- * @generated
- */
- void setPartitioned(String value);
-
-} // XmlPartitioningGroup2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioning_2_2.java
deleted file mode 100644
index c11826e163..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPinnedPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPinnedPartitioning_2_2.java
deleted file mode 100644
index 4ff0d03d03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlPinnedPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Pinned Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPinnedPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPinnedPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlPinnedPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlPinnedPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlPinnedPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRangePartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRangePartitioning_2_2.java
deleted file mode 100644
index 526a939fe6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRangePartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Range Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRangePartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlRangePartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRangePartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRangePartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlRangePartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlReplicationPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlReplicationPartitioning_2_2.java
deleted file mode 100644
index 536dd2597c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlReplicationPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Replication Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlReplicationPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlReplicationPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlReplicationPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlReplicationPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlReplicationPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRoundRobinPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRoundRobinPartitioning_2_2.java
deleted file mode 100644
index 7a2bb0f9d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlRoundRobinPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Round Robin Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRoundRobinPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlRoundRobinPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlRoundRobinPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlRoundRobinPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlRoundRobinPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlSecondaryTable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlSecondaryTable_2_2.java
deleted file mode 100644
index 860e82acf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlSecondaryTable_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Secondary Table 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlSecondaryTable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlSecondaryTable_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlSecondaryTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlSecondaryTable_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlSecondaryTable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTableGenerator_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTableGenerator_2_2.java
deleted file mode 100644
index 6fde551d1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTableGenerator_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Table Generator 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTableGenerator_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlTableGenerator_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTableGenerator_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTableGenerator_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlTableGenerator_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTable_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTable_2_2.java
deleted file mode 100644
index 4a620143e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlTable_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Table 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2#getCreationSuffix <em>Creation Suffix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTable_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlTable_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Creation Suffix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Creation Suffix</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Creation Suffix</em>' attribute.
- * @see #setCreationSuffix(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlTable_2_2_CreationSuffix()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCreationSuffix();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlTable_2_2#getCreationSuffix <em>Creation Suffix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Creation Suffix</em>' attribute.
- * @see #getCreationSuffix()
- * @generated
- */
- void setCreationSuffix(String value);
-
-} // XmlTable_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlUnionPartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlUnionPartitioning_2_2.java
deleted file mode 100644
index 23926069ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlUnionPartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Union Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlUnionPartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlUnionPartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlUnionPartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlUnionPartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlUnionPartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlValuePartitioning_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlValuePartitioning_2_2.java
deleted file mode 100644
index 6871869bb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlValuePartitioning_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Value Partitioning 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlValuePartitioning_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlValuePartitioning_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlValuePartitioning_2_2_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlValuePartitioning_2_2#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
-} // XmlValuePartitioning_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVariableOneToOne_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVariableOneToOne_2_2.java
deleted file mode 100644
index ee10991c84..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVariableOneToOne_2_2.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Variable One To One 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVariableOneToOne_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlVariableOneToOne_2_2 extends XmlPartitioningGroup_2_2
-{
- /**
- * Returns the value of the '<em><b>Non Cacheable</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Non Cacheable</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Non Cacheable</em>' attribute.
- * @see #setNonCacheable(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVariableOneToOne_2_2_NonCacheable()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isNonCacheable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVariableOneToOne_2_2#isNonCacheable <em>Non Cacheable</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Non Cacheable</em>' attribute.
- * @see #isNonCacheable()
- * @generated
- */
- void setNonCacheable(boolean value);
-
-} // XmlVariableOneToOne_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVersion_2_2.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVersion_2_2.java
deleted file mode 100644
index 6b92520779..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_2/XmlVersion_2_2.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Version 22</b></em>'.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2#getIndex <em>Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVersion_2_2()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlVersion_2_2 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Index</em>' containment reference.
- * @see #setIndex(XmlIndex_2_2)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package#getXmlVersion_2_2_Index()
- * @model containment="true"
- * @generated
- */
- XmlIndex_2_2 getIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.XmlVersion_2_2#getIndex <em>Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Index</em>' containment reference.
- * @see #getIndex()
- * @generated
- */
- void setIndex(XmlIndex_2_2 value);
-
-} // XmlVersion_2_2
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java
deleted file mode 100644
index 544889224a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLink2_3.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_3
- extends EclipseLink2_2
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_3.xsd";
- String SCHEMA_VERSION = "2.3";
-
- // EclipseLink 2.3 specific nodes
- String ARRAY = "array";
- String ARRAY__DATABASE_TYPE = "database-type";
- String ARRAY__TARGET_CLASS = "target-class";
- String ARRAY__ATTRIBUTE_TYPE = "attribute-type";
-
- String COMPOSITE_MEMBER = "composite-member";
-
- String MULTITENANT = "multitenant";
- String MULTITENANT__TYPE = "type";
- String MULTITENANT_TYPE = "multiltenant-type";
-
- String NAMED_STORED_FUNCTION_QUERY = "named-stored-function-query";
- String NAMED_STORED_FUNCTION_QUERY__NAME = "nname";
- String NAMED_PLSQL_STORED_PROCEDURE_QUERY = "named-plsql-stored-procedure-query";
- String NAMED_PLSQL_STORED_PROCEDURE_QUERY__NAME = "name";
- String NAMED_PLSQL_STORED_FUNCTION_QUERY = "named-plsql-stored-function-query";
- String NAMED_PLSQL_STORED_FUNCTION_QUERY__NAME = "name";
- String PLSQL_RECORD = "plsql-record";
- String PLSQL_RECORD__NAME = "name";
- String PLSQL_TABLE = "plsql-table";
- String PLSQL_TABLE__NAME = "name";
- String STRUCT = "struct";
- String STRUCT__NAME = "name";
- String STRUCTURE = "structure";
- String STRUCTURE__ATTRIBUTE_TYPE = "attribute-type";
-
- String TENANT_DISCRIMINATOR_COLUMN = "tenant-discriminator-column";
- String TENANT_DISCRIMINATOR_COLUMN__CONTEXT_PROPERTY = "context-property";
- String TENANT_DISCRIMINATOR_COLUMN__PRIMARY_KEY= "primary-key";
- String TENANT_DISCRIMINATOR_COLUMN__TABLE = "table";
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Factory.java
deleted file mode 100644
index a9cb1f678f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Factory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package
- * @generated
- */
-public class EclipseLinkOrmV2_3Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_3Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_3Factory init()
- {
- try
- {
- EclipseLinkOrmV2_3Factory theEclipseLinkOrmV2_3Factory = (EclipseLinkOrmV2_3Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_3.xmi");
- if (theEclipseLinkOrmV2_3Factory != null)
- {
- return theEclipseLinkOrmV2_3Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_3Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_3Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_3Package.MULTITENANT_TYPE:
- return createMultitenantTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_3Package.MULTITENANT_TYPE:
- return convertMultitenantTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public MultitenantType createMultitenantTypeFromString(EDataType eDataType, String initialValue)
- {
- MultitenantType result = MultitenantType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertMultitenantTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_3Package getEclipseLinkOrmV2_3Package()
- {
- return (EclipseLinkOrmV2_3Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_3Package getPackage()
- {
- return EclipseLinkOrmV2_3Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_3Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java
deleted file mode 100644
index 48ac7bba13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/EclipseLinkOrmV2_3Package.java
+++ /dev/null
@@ -1,2607 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_3Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_3";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_3.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_3Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3 <em>Xml Embeddable 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3()
- * @generated
- */
- public static final int XML_EMBEDDABLE_23 = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3 <em>Xml Multitenant 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3()
- * @generated
- */
- public static final int XML_MULTITENANT_23 = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3 <em>Xml Entity 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3()
- * @generated
- */
- public static final int XML_ENTITY_23 = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3 <em>Xml Mapped Superclass 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_23 = 6;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3 <em>Xml Entity Mappings 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3()
- * @generated
- */
- public static final int XML_ENTITY_MAPPINGS_23 = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3 <em>Xml Named Plsql Stored Function Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredFunctionQuery_2_3()
- * @generated
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23 = 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3 <em>Xml Named Plsql Stored Procedure Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredProcedureQuery_2_3()
- * @generated
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23 = 9;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3 <em>Xml Named Stored Function Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedStoredFunctionQuery_2_3()
- * @generated
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY_23 = 10;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3 <em>Xml Persistence Unit Defaults 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPersistenceUnitDefaults_2_3()
- * @generated
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_23 = 11;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3 <em>Xml Plsql Record 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlRecord_2_3()
- * @generated
- */
- public static final int XML_PLSQL_RECORD_23 = 12;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3 <em>Xml Plsql Table 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlTable_2_3()
- * @generated
- */
- public static final int XML_PLSQL_TABLE_23 = 13;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3 <em>Xml Struct 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStruct_2_3()
- * @generated
- */
- public static final int XML_STRUCT_23 = 14;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3 <em>Xml Attributes 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3()
- * @generated
- */
- public static final int XML_ATTRIBUTES_23 = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3 <em>Xml Structure 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStructure_2_3()
- * @generated
- */
- public static final int XML_STRUCTURE_23 = 16;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3 <em>Xml Array 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlArray_2_3()
- * @generated
- */
- public static final int XML_ARRAY_23 = 0;
-
- /**
- * The 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_ARRAY_23__CONVERTERS = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__CONVERTERS;
-
- /**
- * 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_ARRAY_23__TYPE_CONVERTERS = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__TYPE_CONVERTERS;
-
- /**
- * 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_ARRAY_23__OBJECT_TYPE_CONVERTERS = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__OBJECT_TYPE_CONVERTERS;
-
- /**
- * 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_ARRAY_23__STRUCT_CONVERTERS = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER__STRUCT_CONVERTERS;
-
- /**
- * The feature id for the '<em><b>Lob</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY_23__LOB = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Temporal</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY_23__TEMPORAL = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Enumerated</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY_23__ENUMERATED = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER_FEATURE_COUNT + 2;
-
- /**
- * 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_ARRAY_23__COLUMN = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Database Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY_23__DATABASE_TYPE = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Target Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY_23__TARGET_CLASS = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Array 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ARRAY_23_FEATURE_COUNT = EclipseLinkOrmPackage.XML_CONVERTER_CONTAINER_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Structures</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTES_23__STRUCTURES = 0;
-
- /**
- * The feature id for the '<em><b>Arrays</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTES_23__ARRAYS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Attributes 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ATTRIBUTES_23_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3 <em>Xml Tenant Discriminator Column 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23 = 15;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3 <em>Xml Element Collection 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlElementCollection_2_3()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_23 = 2;
-
- /**
- * The feature id for the '<em><b>Composite Member</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER = 0;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_23__PLSQL_RECORDS = 0;
-
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_23__PLSQL_TABLES = 1;
-
- /**
- * The feature id for the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_23__STRUCT = 2;
-
- /**
- * The number of structural features of the '<em>Xml Embeddable 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_EMBEDDABLE_23_FEATURE_COUNT = 3;
-
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__MULTITENANT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT;
-
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__PLSQL_RECORDS = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__PLSQL_TABLES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 4;
-
- /**
- * The feature id for the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23__STRUCT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 5;
-
- /**
- * The number of structural features of the '<em>Xml Entity 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_23_FEATURE_COUNT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 6;
-
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS = 0;
-
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES = 1;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = 2;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = 3;
-
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS = 4;
-
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23__PLSQL_TABLES = 5;
-
- /**
- * The number of structural features of the '<em>Xml Entity Mappings 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_MAPPINGS_23_FEATURE_COUNT = 6;
-
- /**
- * The feature id for the '<em><b>Multitenant</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__MULTITENANT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER__MULTITENANT;
-
- /**
- * The feature id for the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 2;
-
- /**
- * The feature id for the '<em><b>Plsql Records</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 3;
-
- /**
- * The feature id for the '<em><b>Plsql Tables</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 4;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_23_FEATURE_COUNT = EclipseLinkOrmPackage.XML_MULTITENANT_HOLDER_FEATURE_COUNT + 5;
-
- /**
- * The feature id for the '<em><b>Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_23__TYPE = 0;
-
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS = 1;
-
- /**
- * The number of structural features of the '<em>Xml Multitenant 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_23_FEATURE_COUNT = 2;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Named Plsql Stored Function Query 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Named Plsql Stored Procedure Query 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Named Stored Function Query 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_NAMED_STORED_FUNCTION_QUERY_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS = 0;
-
- /**
- * The number of structural features of the '<em>Xml Persistence Unit Defaults 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PERSISTENCE_UNIT_DEFAULTS_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_RECORD_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Plsql Record 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_RECORD_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_TABLE_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Plsql Table 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_PLSQL_TABLE_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_23__NAME = 0;
-
- /**
- * The number of structural features of the '<em>Xml Struct 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCT_23_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Column Definition</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__COLUMN_DEFINITION = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN__COLUMN_DEFINITION;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__NAME = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN__NAME;
-
- /**
- * The feature id for the '<em><b>Discriminator Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__DISCRIMINATOR_TYPE = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN__DISCRIMINATOR_TYPE;
-
- /**
- * The feature id for the '<em><b>Length</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__LENGTH = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN__LENGTH;
-
- /**
- * The feature id for the '<em><b>Context Property</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 0;
-
- /**
- * The feature id for the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 1;
-
- /**
- * The feature id for the '<em><b>Primary Key</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 2;
-
- /**
- * The number of structural features of the '<em>Xml Tenant Discriminator Column 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_TENANT_DISCRIMINATOR_COLUMN_23_FEATURE_COUNT = OrmPackage.XML_BASE_DISCRIMINATOR_COLUMN_FEATURE_COUNT + 3;
-
- /**
- * The number of structural features of the '<em>Xml Structure 23</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_STRUCTURE_23_FEATURE_COUNT = 0;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType <em>Multitenant Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getMultitenantType()
- * @generated
- */
- public static final int MULTITENANT_TYPE = 17;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEmbeddable_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultitenant_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedPlsqlStoredFunctionQuery_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedPlsqlStoredProcedureQuery_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlNamedStoredFunctionQuery_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntityMappings_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPersistenceUnitDefaults_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPlsqlRecord_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlPlsqlTable_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStruct_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlTenantDiscriminatorColumn_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlAttributes_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlStructure_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlArray_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_3EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum multitenantTypeEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_3Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_3Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_3Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_3Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_3Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_3Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI) : EclipseLinkOrmV2_4Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_3Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_4Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_3Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_4Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_3Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_3Package.eNS_URI, theEclipseLinkOrmV2_3Package);
- return theEclipseLinkOrmV2_3Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3 <em>Xml Embeddable 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Embeddable 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3
- * @generated
- */
- public EClass getXmlEmbeddable_2_3()
- {
- return xmlEmbeddable_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlRecords <em>Plsql Records</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Records</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlRecords()
- * @see #getXmlEmbeddable_2_3()
- * @generated
- */
- public EReference getXmlEmbeddable_2_3_PlsqlRecords()
- {
- return (EReference)xmlEmbeddable_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlTables <em>Plsql Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Tables</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlTables()
- * @see #getXmlEmbeddable_2_3()
- * @generated
- */
- public EReference getXmlEmbeddable_2_3_PlsqlTables()
- {
- return (EReference)xmlEmbeddable_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getStruct <em>Struct</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Struct</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getStruct()
- * @see #getXmlEmbeddable_2_3()
- * @generated
- */
- public EReference getXmlEmbeddable_2_3_Struct()
- {
- return (EReference)xmlEmbeddable_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3 <em>Xml Multitenant 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multitenant 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3
- * @generated
- */
- public EClass getXmlMultitenant_2_3()
- {
- return xmlMultitenant_2_3EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getType <em>Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getType()
- * @see #getXmlMultitenant_2_3()
- * @generated
- */
- public EAttribute getXmlMultitenant_2_3_Type()
- {
- return (EAttribute)xmlMultitenant_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Tenant Discriminator Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getTenantDiscriminatorColumns()
- * @see #getXmlMultitenant_2_3()
- * @generated
- */
- public EReference getXmlMultitenant_2_3_TenantDiscriminatorColumns()
- {
- return (EReference)xmlMultitenant_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3 <em>Xml Named Plsql Stored Function Query 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Plsql Stored Function Query 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3
- * @generated
- */
- public EClass getXmlNamedPlsqlStoredFunctionQuery_2_3()
- {
- return xmlNamedPlsqlStoredFunctionQuery_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3#getName()
- * @see #getXmlNamedPlsqlStoredFunctionQuery_2_3()
- * @generated
- */
- public EAttribute getXmlNamedPlsqlStoredFunctionQuery_2_3_Name()
- {
- return (EAttribute)xmlNamedPlsqlStoredFunctionQuery_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3 <em>Xml Named Plsql Stored Procedure Query 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Plsql Stored Procedure Query 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3
- * @generated
- */
- public EClass getXmlNamedPlsqlStoredProcedureQuery_2_3()
- {
- return xmlNamedPlsqlStoredProcedureQuery_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3#getName()
- * @see #getXmlNamedPlsqlStoredProcedureQuery_2_3()
- * @generated
- */
- public EAttribute getXmlNamedPlsqlStoredProcedureQuery_2_3_Name()
- {
- return (EAttribute)xmlNamedPlsqlStoredProcedureQuery_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3 <em>Xml Named Stored Function Query 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Named Stored Function Query 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3
- * @generated
- */
- public EClass getXmlNamedStoredFunctionQuery_2_3()
- {
- return xmlNamedStoredFunctionQuery_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3#getName()
- * @see #getXmlNamedStoredFunctionQuery_2_3()
- * @generated
- */
- public EAttribute getXmlNamedStoredFunctionQuery_2_3_Name()
- {
- return (EAttribute)xmlNamedStoredFunctionQuery_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3 <em>Xml Entity 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3
- * @generated
- */
- public EClass getXmlEntity_2_3()
- {
- return xmlEntity_2_3EClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedStoredFunctionQueries()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_NamedStoredFunctionQueries()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredFunctionQueries()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Procedure Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredProcedureQueries()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlRecords <em>Plsql Records</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Records</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlRecords()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_PlsqlRecords()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlTables <em>Plsql Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Tables</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlTables()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_PlsqlTables()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getStruct <em>Struct</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Struct</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getStruct()
- * @see #getXmlEntity_2_3()
- * @generated
- */
- public EReference getXmlEntity_2_3_Struct()
- {
- return (EReference)xmlEntity_2_3EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3 <em>Xml Mapped Superclass 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_3()
- {
- return xmlMappedSuperclass_2_3EClass;
- }
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedStoredFunctionQueries()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredFunctionQueries()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Procedure Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredProcedureQueries()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlRecords <em>Plsql Records</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Records</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlRecords()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_PlsqlRecords()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlTables <em>Plsql Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Tables</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlTables()
- * @see #getXmlMappedSuperclass_2_3()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_3_PlsqlTables()
- {
- return (EReference)xmlMappedSuperclass_2_3EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3 <em>Xml Entity Mappings 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity Mappings 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3
- * @generated
- */
- public EClass getXmlEntityMappings_2_3()
- {
- return xmlEntityMappings_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Tenant Discriminator Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getTenantDiscriminatorColumns()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_TenantDiscriminatorColumns()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedStoredFunctionQueries()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_NamedStoredFunctionQueries()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Function Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredFunctionQueries()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Named Plsql Stored Procedure Queries</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredProcedureQueries()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(3);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlRecords <em>Plsql Records</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Records</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlRecords()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_PlsqlRecords()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(4);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlTables <em>Plsql Tables</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Plsql Tables</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlTables()
- * @see #getXmlEntityMappings_2_3()
- * @generated
- */
- public EReference getXmlEntityMappings_2_3_PlsqlTables()
- {
- return (EReference)xmlEntityMappings_2_3EClass.getEStructuralFeatures().get(5);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3 <em>Xml Persistence Unit Defaults 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Persistence Unit Defaults 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3
- * @generated
- */
- public EClass getXmlPersistenceUnitDefaults_2_3()
- {
- return xmlPersistenceUnitDefaults_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Tenant Discriminator Columns</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3#getTenantDiscriminatorColumns()
- * @see #getXmlPersistenceUnitDefaults_2_3()
- * @generated
- */
- public EReference getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns()
- {
- return (EReference)xmlPersistenceUnitDefaults_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3 <em>Xml Plsql Record 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Plsql Record 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3
- * @generated
- */
- public EClass getXmlPlsqlRecord_2_3()
- {
- return xmlPlsqlRecord_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3#getName()
- * @see #getXmlPlsqlRecord_2_3()
- * @generated
- */
- public EAttribute getXmlPlsqlRecord_2_3_Name()
- {
- return (EAttribute)xmlPlsqlRecord_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3 <em>Xml Plsql Table 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Plsql Table 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3
- * @generated
- */
- public EClass getXmlPlsqlTable_2_3()
- {
- return xmlPlsqlTable_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3#getName()
- * @see #getXmlPlsqlTable_2_3()
- * @generated
- */
- public EAttribute getXmlPlsqlTable_2_3_Name()
- {
- return (EAttribute)xmlPlsqlTable_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3 <em>Xml Struct 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Struct 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3
- * @generated
- */
- public EClass getXmlStruct_2_3()
- {
- return xmlStruct_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3#getName()
- * @see #getXmlStruct_2_3()
- * @generated
- */
- public EAttribute getXmlStruct_2_3_Name()
- {
- return (EAttribute)xmlStruct_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3 <em>Xml Tenant Discriminator Column 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Tenant Discriminator Column 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3
- * @generated
- */
- public EClass getXmlTenantDiscriminatorColumn_2_3()
- {
- return xmlTenantDiscriminatorColumn_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty <em>Context Property</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Context Property</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty()
- * @see #getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public EAttribute getXmlTenantDiscriminatorColumn_2_3_ContextProperty()
- {
- return (EAttribute)xmlTenantDiscriminatorColumn_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable <em>Table</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Table</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable()
- * @see #getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public EAttribute getXmlTenantDiscriminatorColumn_2_3_Table()
- {
- return (EAttribute)xmlTenantDiscriminatorColumn_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey <em>Primary Key</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Primary Key</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey()
- * @see #getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public EAttribute getXmlTenantDiscriminatorColumn_2_3_PrimaryKey()
- {
- return (EAttribute)xmlTenantDiscriminatorColumn_2_3EClass.getEStructuralFeatures().get(2);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3 <em>Xml Attributes 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Attributes 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3
- * @generated
- */
- public EClass getXmlAttributes_2_3()
- {
- return xmlAttributes_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getStructures <em>Structures</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Structures</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getStructures()
- * @see #getXmlAttributes_2_3()
- * @generated
- */
- public EReference getXmlAttributes_2_3_Structures()
- {
- return (EReference)xmlAttributes_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getArrays <em>Arrays</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference list '<em>Arrays</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getArrays()
- * @see #getXmlAttributes_2_3()
- * @generated
- */
- public EReference getXmlAttributes_2_3_Arrays()
- {
- return (EReference)xmlAttributes_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3 <em>Xml Structure 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Structure 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3
- * @generated
- */
- public EClass getXmlStructure_2_3()
- {
- return xmlStructure_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3 <em>Xml Array 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Array 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3
- * @generated
- */
- public EClass getXmlArray_2_3()
- {
- return xmlArray_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3#getDatabaseType <em>Database Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Database Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3#getDatabaseType()
- * @see #getXmlArray_2_3()
- * @generated
- */
- public EAttribute getXmlArray_2_3_DatabaseType()
- {
- return (EAttribute)xmlArray_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3#getTargetClass <em>Target Class</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Target Class</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3#getTargetClass()
- * @see #getXmlArray_2_3()
- * @generated
- */
- public EAttribute getXmlArray_2_3_TargetClass()
- {
- return (EAttribute)xmlArray_2_3EClass.getEStructuralFeatures().get(1);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3 <em>Xml Element Collection 23</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 23</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3
- * @generated
- */
- public EClass getXmlElementCollection_2_3()
- {
- return xmlElementCollection_2_3EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3#getCompositeMember <em>Composite Member</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Composite Member</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3#getCompositeMember()
- * @see #getXmlElementCollection_2_3()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_3_CompositeMember()
- {
- return (EAttribute)xmlElementCollection_2_3EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType <em>Multitenant Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Multitenant Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @generated
- */
- public EEnum getMultitenantType()
- {
- return multitenantTypeEEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_3Factory getEclipseLinkOrmV2_3Factory()
- {
- return (EclipseLinkOrmV2_3Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlArray_2_3EClass = createEClass(XML_ARRAY_23);
- createEAttribute(xmlArray_2_3EClass, XML_ARRAY_23__DATABASE_TYPE);
- createEAttribute(xmlArray_2_3EClass, XML_ARRAY_23__TARGET_CLASS);
-
- xmlAttributes_2_3EClass = createEClass(XML_ATTRIBUTES_23);
- createEReference(xmlAttributes_2_3EClass, XML_ATTRIBUTES_23__STRUCTURES);
- createEReference(xmlAttributes_2_3EClass, XML_ATTRIBUTES_23__ARRAYS);
-
- xmlElementCollection_2_3EClass = createEClass(XML_ELEMENT_COLLECTION_23);
- createEAttribute(xmlElementCollection_2_3EClass, XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER);
-
- xmlEmbeddable_2_3EClass = createEClass(XML_EMBEDDABLE_23);
- createEReference(xmlEmbeddable_2_3EClass, XML_EMBEDDABLE_23__PLSQL_RECORDS);
- createEReference(xmlEmbeddable_2_3EClass, XML_EMBEDDABLE_23__PLSQL_TABLES);
- createEReference(xmlEmbeddable_2_3EClass, XML_EMBEDDABLE_23__STRUCT);
-
- xmlEntity_2_3EClass = createEClass(XML_ENTITY_23);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__PLSQL_RECORDS);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__PLSQL_TABLES);
- createEReference(xmlEntity_2_3EClass, XML_ENTITY_23__STRUCT);
-
- xmlEntityMappings_2_3EClass = createEClass(XML_ENTITY_MAPPINGS_23);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS);
- createEReference(xmlEntityMappings_2_3EClass, XML_ENTITY_MAPPINGS_23__PLSQL_TABLES);
-
- xmlMappedSuperclass_2_3EClass = createEClass(XML_MAPPED_SUPERCLASS_23);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS);
- createEReference(xmlMappedSuperclass_2_3EClass, XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES);
-
- xmlMultitenant_2_3EClass = createEClass(XML_MULTITENANT_23);
- createEAttribute(xmlMultitenant_2_3EClass, XML_MULTITENANT_23__TYPE);
- createEReference(xmlMultitenant_2_3EClass, XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS);
-
- xmlNamedPlsqlStoredFunctionQuery_2_3EClass = createEClass(XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23);
- createEAttribute(xmlNamedPlsqlStoredFunctionQuery_2_3EClass, XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23__NAME);
-
- xmlNamedPlsqlStoredProcedureQuery_2_3EClass = createEClass(XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23);
- createEAttribute(xmlNamedPlsqlStoredProcedureQuery_2_3EClass, XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23__NAME);
-
- xmlNamedStoredFunctionQuery_2_3EClass = createEClass(XML_NAMED_STORED_FUNCTION_QUERY_23);
- createEAttribute(xmlNamedStoredFunctionQuery_2_3EClass, XML_NAMED_STORED_FUNCTION_QUERY_23__NAME);
-
- xmlPersistenceUnitDefaults_2_3EClass = createEClass(XML_PERSISTENCE_UNIT_DEFAULTS_23);
- createEReference(xmlPersistenceUnitDefaults_2_3EClass, XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS);
-
- xmlPlsqlRecord_2_3EClass = createEClass(XML_PLSQL_RECORD_23);
- createEAttribute(xmlPlsqlRecord_2_3EClass, XML_PLSQL_RECORD_23__NAME);
-
- xmlPlsqlTable_2_3EClass = createEClass(XML_PLSQL_TABLE_23);
- createEAttribute(xmlPlsqlTable_2_3EClass, XML_PLSQL_TABLE_23__NAME);
-
- xmlStruct_2_3EClass = createEClass(XML_STRUCT_23);
- createEAttribute(xmlStruct_2_3EClass, XML_STRUCT_23__NAME);
-
- xmlTenantDiscriminatorColumn_2_3EClass = createEClass(XML_TENANT_DISCRIMINATOR_COLUMN_23);
- createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY);
- createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE);
- createEAttribute(xmlTenantDiscriminatorColumn_2_3EClass, XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY);
-
- xmlStructure_2_3EClass = createEClass(XML_STRUCTURE_23);
-
- // Create enums
- multitenantTypeEEnum = createEEnum(MULTITENANT_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI);
- 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
- xmlArray_2_3EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlConverterContainer());
- xmlArray_2_3EClass.getESuperTypes().add(theOrmPackage.getXmlConvertibleMapping());
- xmlArray_2_3EClass.getESuperTypes().add(theOrmPackage.getColumnMapping());
- xmlEntity_2_3EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlMultitenantHolder());
- xmlMappedSuperclass_2_3EClass.getESuperTypes().add(theEclipseLinkOrmPackage.getXmlMultitenantHolder());
- xmlTenantDiscriminatorColumn_2_3EClass.getESuperTypes().add(theOrmPackage.getXmlBaseDiscriminatorColumn());
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlArray_2_3EClass, XmlArray_2_3.class, "XmlArray_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlArray_2_3_DatabaseType(), theXMLTypePackage.getString(), "databaseType", null, 0, 1, XmlArray_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlArray_2_3_TargetClass(), theXMLTypePackage.getString(), "targetClass", null, 0, 1, XmlArray_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlAttributes_2_3EClass, XmlAttributes_2_3.class, "XmlAttributes_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlAttributes_2_3_Structures(), this.getXmlStructure_2_3(), null, "structures", null, 0, -1, XmlAttributes_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlAttributes_2_3_Arrays(), this.getXmlArray_2_3(), null, "arrays", null, 0, -1, XmlAttributes_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_3EClass, XmlElementCollection_2_3.class, "XmlElementCollection_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlElementCollection_2_3_CompositeMember(), theXMLTypePackage.getString(), "compositeMember", null, 0, 1, XmlElementCollection_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEmbeddable_2_3EClass, XmlEmbeddable_2_3.class, "XmlEmbeddable_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEmbeddable_2_3_PlsqlRecords(), this.getXmlPlsqlRecord_2_3(), null, "plsqlRecords", null, 0, -1, XmlEmbeddable_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEmbeddable_2_3_PlsqlTables(), theEclipseLinkOrmPackage.getXmlPlsqlTable(), null, "plsqlTables", null, 0, -1, XmlEmbeddable_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEmbeddable_2_3_Struct(), this.getXmlStruct_2_3(), null, "struct", null, 0, 1, XmlEmbeddable_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntity_2_3EClass, XmlEntity_2_3.class, "XmlEntity_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_3_NamedStoredFunctionQueries(), this.getXmlNamedStoredFunctionQuery_2_3(), null, "namedStoredFunctionQueries", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries(), this.getXmlNamedPlsqlStoredFunctionQuery_2_3(), null, "namedPlsqlStoredFunctionQueries", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries(), this.getXmlNamedPlsqlStoredProcedureQuery_2_3(), null, "namedPlsqlStoredProcedureQueries", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_PlsqlRecords(), this.getXmlPlsqlRecord_2_3(), null, "plsqlRecords", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_PlsqlTables(), theEclipseLinkOrmPackage.getXmlPlsqlTable(), null, "plsqlTables", null, 0, -1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntity_2_3_Struct(), this.getXmlStruct_2_3(), null, "struct", null, 0, 1, XmlEntity_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntityMappings_2_3EClass, XmlEntityMappings_2_3.class, "XmlEntityMappings_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntityMappings_2_3_TenantDiscriminatorColumns(), this.getXmlTenantDiscriminatorColumn_2_3(), null, "tenantDiscriminatorColumns", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_NamedStoredFunctionQueries(), this.getXmlNamedStoredFunctionQuery_2_3(), null, "namedStoredFunctionQueries", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries(), this.getXmlNamedPlsqlStoredFunctionQuery_2_3(), null, "namedPlsqlStoredFunctionQueries", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries(), this.getXmlNamedPlsqlStoredProcedureQuery_2_3(), null, "namedPlsqlStoredProcedureQueries", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_PlsqlRecords(), this.getXmlPlsqlRecord_2_3(), null, "plsqlRecords", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlEntityMappings_2_3_PlsqlTables(), theEclipseLinkOrmPackage.getXmlPlsqlTable(), null, "plsqlTables", null, 0, -1, XmlEntityMappings_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_2_3EClass, XmlMappedSuperclass_2_3.class, "XmlMappedSuperclass_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries(), this.getXmlNamedStoredFunctionQuery_2_3(), null, "namedStoredFunctionQueries", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries(), this.getXmlNamedPlsqlStoredFunctionQuery_2_3(), null, "namedPlsqlStoredFunctionQueries", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries(), this.getXmlNamedPlsqlStoredProcedureQuery_2_3(), null, "namedPlsqlStoredProcedureQueries", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_3_PlsqlRecords(), this.getXmlPlsqlRecord_2_3(), null, "plsqlRecords", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMappedSuperclass_2_3_PlsqlTables(), theEclipseLinkOrmPackage.getXmlPlsqlTable(), null, "plsqlTables", null, 0, -1, XmlMappedSuperclass_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMultitenant_2_3EClass, XmlMultitenant_2_3.class, "XmlMultitenant_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMultitenant_2_3_Type(), this.getMultitenantType(), "type", null, 0, 1, XmlMultitenant_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getXmlMultitenant_2_3_TenantDiscriminatorColumns(), this.getXmlTenantDiscriminatorColumn_2_3(), null, "tenantDiscriminatorColumns", null, 0, -1, XmlMultitenant_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedPlsqlStoredFunctionQuery_2_3EClass, XmlNamedPlsqlStoredFunctionQuery_2_3.class, "XmlNamedPlsqlStoredFunctionQuery_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedPlsqlStoredFunctionQuery_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedPlsqlStoredFunctionQuery_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedPlsqlStoredProcedureQuery_2_3EClass, XmlNamedPlsqlStoredProcedureQuery_2_3.class, "XmlNamedPlsqlStoredProcedureQuery_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedPlsqlStoredProcedureQuery_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedPlsqlStoredProcedureQuery_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlNamedStoredFunctionQuery_2_3EClass, XmlNamedStoredFunctionQuery_2_3.class, "XmlNamedStoredFunctionQuery_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlNamedStoredFunctionQuery_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlNamedStoredFunctionQuery_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPersistenceUnitDefaults_2_3EClass, XmlPersistenceUnitDefaults_2_3.class, "XmlPersistenceUnitDefaults_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns(), this.getXmlTenantDiscriminatorColumn_2_3(), null, "tenantDiscriminatorColumns", null, 0, -1, XmlPersistenceUnitDefaults_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPlsqlRecord_2_3EClass, XmlPlsqlRecord_2_3.class, "XmlPlsqlRecord_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPlsqlRecord_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlPlsqlRecord_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlPlsqlTable_2_3EClass, XmlPlsqlTable_2_3.class, "XmlPlsqlTable_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlPlsqlTable_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlPlsqlTable_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlStruct_2_3EClass, XmlStruct_2_3.class, "XmlStruct_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlStruct_2_3_Name(), theXMLTypePackage.getString(), "name", null, 0, 1, XmlStruct_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlTenantDiscriminatorColumn_2_3EClass, XmlTenantDiscriminatorColumn_2_3.class, "XmlTenantDiscriminatorColumn_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlTenantDiscriminatorColumn_2_3_ContextProperty(), theXMLTypePackage.getString(), "contextProperty", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTenantDiscriminatorColumn_2_3_Table(), theXMLTypePackage.getString(), "table", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getXmlTenantDiscriminatorColumn_2_3_PrimaryKey(), ecorePackage.getEBooleanObject(), "primaryKey", null, 0, 1, XmlTenantDiscriminatorColumn_2_3.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlStructure_2_3EClass, XmlStructure_2_3.class, "XmlStructure_2_3", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
-
- // Initialize enums and add enum literals
- initEEnum(multitenantTypeEEnum, MultitenantType.class, "MultitenantType");
- addEEnumLiteral(multitenantTypeEEnum, MultitenantType.SINGLE_TABLE);
- addEEnumLiteral(multitenantTypeEEnum, MultitenantType.TABLE_PER_TENANT);
- addEEnumLiteral(multitenantTypeEEnum, MultitenantType.VPD);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3 <em>Xml Embeddable 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3()
- * @generated
- */
- public static final EClass XML_EMBEDDABLE_23 = eINSTANCE.getXmlEmbeddable_2_3();
-
- /**
- * The meta object literal for the '<em><b>Plsql Records</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE_23__PLSQL_RECORDS = eINSTANCE.getXmlEmbeddable_2_3_PlsqlRecords();
-
- /**
- * The meta object literal for the '<em><b>Plsql Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE_23__PLSQL_TABLES = eINSTANCE.getXmlEmbeddable_2_3_PlsqlTables();
-
- /**
- * The meta object literal for the '<em><b>Struct</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_EMBEDDABLE_23__STRUCT = eINSTANCE.getXmlEmbeddable_2_3_Struct();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3 <em>Xml Multitenant 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3()
- * @generated
- */
- public static final EClass XML_MULTITENANT_23 = eINSTANCE.getXmlMultitenant_2_3();
-
- /**
- * The meta object literal for the '<em><b>Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MULTITENANT_23__TYPE = eINSTANCE.getXmlMultitenant_2_3_Type();
-
- /**
- * The meta object literal for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MULTITENANT_23__TENANT_DISCRIMINATOR_COLUMNS = eINSTANCE.getXmlMultitenant_2_3_TenantDiscriminatorColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3 <em>Xml Named Plsql Stored Function Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredFunctionQuery_2_3()
- * @generated
- */
- public static final EClass XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23 = eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_PLSQL_STORED_FUNCTION_QUERY_23__NAME = eINSTANCE.getXmlNamedPlsqlStoredFunctionQuery_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3 <em>Xml Named Plsql Stored Procedure Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredProcedureQuery_2_3()
- * @generated
- */
- public static final EClass XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23 = eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_PLSQL_STORED_PROCEDURE_QUERY_23__NAME = eINSTANCE.getXmlNamedPlsqlStoredProcedureQuery_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3 <em>Xml Named Stored Function Query 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedStoredFunctionQuery_2_3()
- * @generated
- */
- public static final EClass XML_NAMED_STORED_FUNCTION_QUERY_23 = eINSTANCE.getXmlNamedStoredFunctionQuery_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_NAMED_STORED_FUNCTION_QUERY_23__NAME = eINSTANCE.getXmlNamedStoredFunctionQuery_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3 <em>Xml Entity 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3()
- * @generated
- */
- public static final EClass XML_ENTITY_23 = eINSTANCE.getXmlEntity_2_3();
-
- /**
- * The meta object literal for the '<em><b>Named Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__NAMED_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlEntity_2_3_NamedStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = eINSTANCE.getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries();
-
- /**
- * The meta object literal for the '<em><b>Plsql Records</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__PLSQL_RECORDS = eINSTANCE.getXmlEntity_2_3_PlsqlRecords();
-
- /**
- * The meta object literal for the '<em><b>Plsql Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__PLSQL_TABLES = eINSTANCE.getXmlEntity_2_3_PlsqlTables();
-
- /**
- * The meta object literal for the '<em><b>Struct</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_23__STRUCT = eINSTANCE.getXmlEntity_2_3_Struct();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3 <em>Xml Mapped Superclass 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_23 = eINSTANCE.getXmlMappedSuperclass_2_3();
-
- /**
- * The meta object literal for the '<em><b>Named Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__NAMED_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = eINSTANCE.getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries();
-
- /**
- * The meta object literal for the '<em><b>Plsql Records</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__PLSQL_RECORDS = eINSTANCE.getXmlMappedSuperclass_2_3_PlsqlRecords();
-
- /**
- * The meta object literal for the '<em><b>Plsql Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_23__PLSQL_TABLES = eINSTANCE.getXmlMappedSuperclass_2_3_PlsqlTables();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3 <em>Xml Entity Mappings 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3()
- * @generated
- */
- public static final EClass XML_ENTITY_MAPPINGS_23 = eINSTANCE.getXmlEntityMappings_2_3();
-
- /**
- * The meta object literal for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__TENANT_DISCRIMINATOR_COLUMNS = eINSTANCE.getXmlEntityMappings_2_3_TenantDiscriminatorColumns();
-
- /**
- * The meta object literal for the '<em><b>Named Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__NAMED_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlEntityMappings_2_3_NamedStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_FUNCTION_QUERIES = eINSTANCE.getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries();
-
- /**
- * The meta object literal for the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__NAMED_PLSQL_STORED_PROCEDURE_QUERIES = eINSTANCE.getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries();
-
- /**
- * The meta object literal for the '<em><b>Plsql Records</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__PLSQL_RECORDS = eINSTANCE.getXmlEntityMappings_2_3_PlsqlRecords();
-
- /**
- * The meta object literal for the '<em><b>Plsql Tables</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_MAPPINGS_23__PLSQL_TABLES = eINSTANCE.getXmlEntityMappings_2_3_PlsqlTables();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3 <em>Xml Persistence Unit Defaults 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPersistenceUnitDefaults_2_3()
- * @generated
- */
- public static final EClass XML_PERSISTENCE_UNIT_DEFAULTS_23 = eINSTANCE.getXmlPersistenceUnitDefaults_2_3();
-
- /**
- * The meta object literal for the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_PERSISTENCE_UNIT_DEFAULTS_23__TENANT_DISCRIMINATOR_COLUMNS = eINSTANCE.getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3 <em>Xml Plsql Record 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlRecord_2_3()
- * @generated
- */
- public static final EClass XML_PLSQL_RECORD_23 = eINSTANCE.getXmlPlsqlRecord_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PLSQL_RECORD_23__NAME = eINSTANCE.getXmlPlsqlRecord_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3 <em>Xml Plsql Table 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlTable_2_3()
- * @generated
- */
- public static final EClass XML_PLSQL_TABLE_23 = eINSTANCE.getXmlPlsqlTable_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_PLSQL_TABLE_23__NAME = eINSTANCE.getXmlPlsqlTable_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3 <em>Xml Struct 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStruct_2_3()
- * @generated
- */
- public static final EClass XML_STRUCT_23 = eINSTANCE.getXmlStruct_2_3();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_STRUCT_23__NAME = eINSTANCE.getXmlStruct_2_3_Name();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3 <em>Xml Tenant Discriminator Column 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3()
- * @generated
- */
- public static final EClass XML_TENANT_DISCRIMINATOR_COLUMN_23 = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3();
-
- /**
- * The meta object literal for the '<em><b>Context Property</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__CONTEXT_PROPERTY = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_ContextProperty();
-
- /**
- * The meta object literal for the '<em><b>Table</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__TABLE = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_Table();
-
- /**
- * The meta object literal for the '<em><b>Primary Key</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_TENANT_DISCRIMINATOR_COLUMN_23__PRIMARY_KEY = eINSTANCE.getXmlTenantDiscriminatorColumn_2_3_PrimaryKey();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3 <em>Xml Attributes 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3()
- * @generated
- */
- public static final EClass XML_ATTRIBUTES_23 = eINSTANCE.getXmlAttributes_2_3();
-
- /**
- * The meta object literal for the '<em><b>Structures</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ATTRIBUTES_23__STRUCTURES = eINSTANCE.getXmlAttributes_2_3_Structures();
-
- /**
- * The meta object literal for the '<em><b>Arrays</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ATTRIBUTES_23__ARRAYS = eINSTANCE.getXmlAttributes_2_3_Arrays();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3 <em>Xml Structure 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStructure_2_3()
- * @generated
- */
- public static final EClass XML_STRUCTURE_23 = eINSTANCE.getXmlStructure_2_3();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3 <em>Xml Array 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlArray_2_3()
- * @generated
- */
- public static final EClass XML_ARRAY_23 = eINSTANCE.getXmlArray_2_3();
-
- /**
- * The meta object literal for the '<em><b>Database Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ARRAY_23__DATABASE_TYPE = eINSTANCE.getXmlArray_2_3_DatabaseType();
-
- /**
- * The meta object literal for the '<em><b>Target Class</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ARRAY_23__TARGET_CLASS = eINSTANCE.getXmlArray_2_3_TargetClass();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3 <em>Xml Element Collection 23</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlElementCollection_2_3()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_23 = eINSTANCE.getXmlElementCollection_2_3();
-
- /**
- * The meta object literal for the '<em><b>Composite Member</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_23__COMPOSITE_MEMBER = eINSTANCE.getXmlElementCollection_2_3_CompositeMember();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType <em>Multitenant Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getMultitenantType()
- * @generated
- */
- public static final EEnum MULTITENANT_TYPE = eINSTANCE.getMultitenantType();
-
- }
-
-} //EclipseLinkOrmV2_3Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/MultitenantType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/MultitenantType.java
deleted file mode 100644
index c963c264f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/MultitenantType.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Multitenant Type</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getMultitenantType()
- * @model
- * @generated
- */
-public enum MultitenantType implements Enumerator
-{
- /**
- * The '<em><b>SINGLE TABLE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #SINGLE_TABLE_VALUE
- * @generated
- * @ordered
- */
- SINGLE_TABLE(0, "SINGLE_TABLE", "SINGLE_TABLE"),
-
- /**
- * The '<em><b>TABLE PER TENANT</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #TABLE_PER_TENANT_VALUE
- * @generated
- * @ordered
- */
- TABLE_PER_TENANT(1, "TABLE_PER_TENANT", "TABLE_PER_TENANT"), /**
- * The '<em><b>VPD</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #VPD_VALUE
- * @generated
- * @ordered
- */
- VPD(2, "VPD", "VPD");
-
- /**
- * The '<em><b>SINGLE TABLE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>SINGLE TABLE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #SINGLE_TABLE
- * @model
- * @generated
- * @ordered
- */
- public static final int SINGLE_TABLE_VALUE = 0;
-
- /**
- * The '<em><b>TABLE PER TENANT</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>TABLE PER TENANT</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #TABLE_PER_TENANT
- * @model
- * @generated
- * @ordered
- */
- public static final int TABLE_PER_TENANT_VALUE = 1;
-
- /**
- * The '<em><b>VPD</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>VPD</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #VPD
- * @model
- * @generated
- * @ordered
- */
- public static final int VPD_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Multitenant Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final MultitenantType[] VALUES_ARRAY =
- new MultitenantType[]
- {
- SINGLE_TABLE,
- TABLE_PER_TENANT,
- VPD,
- };
-
- /**
- * A public read-only list of all the '<em><b>Multitenant Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<MultitenantType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Multitenant Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static MultitenantType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- MultitenantType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Multitenant Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static MultitenantType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- MultitenantType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Multitenant Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static MultitenantType get(int value)
- {
- switch (value)
- {
- case SINGLE_TABLE_VALUE: return SINGLE_TABLE;
- case TABLE_PER_TENANT_VALUE: return TABLE_PER_TENANT;
- case VPD_VALUE: return VPD;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private MultitenantType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //XmlMultitenantType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlArray_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlArray_2_3.java
deleted file mode 100644
index 6e8ae080a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlArray_2_3.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.orm.ColumnMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverterContainer;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Array 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3#getDatabaseType <em>Database Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3#getTargetClass <em>Target Class</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlArray_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlArray_2_3 extends XmlConverterContainer, XmlConvertibleMapping, ColumnMapping
-{
-
- /**
- * Returns the value of the '<em><b>Database Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Database Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Database Type</em>' attribute.
- * @see #setDatabaseType(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlArray_2_3_DatabaseType()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getDatabaseType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3#getDatabaseType <em>Database Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Database Type</em>' attribute.
- * @see #getDatabaseType()
- * @generated
- */
- void setDatabaseType(String value);
-
- /**
- * Returns the value of the '<em><b>Target Class</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Class</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Target Class</em>' attribute.
- * @see #setTargetClass(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlArray_2_3_TargetClass()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTargetClass();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3#getTargetClass <em>Target Class</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Target Class</em>' attribute.
- * @see #getTargetClass()
- * @generated
- */
- void setTargetClass(String value);
-} // XmlArray_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlAttributes_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlAttributes_2_3.java
deleted file mode 100644
index 91905162a2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlAttributes_2_3.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Attributes 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getStructures <em>Structures</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlAttributes_2_3#getArrays <em>Arrays</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlAttributes_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Structures</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStructure_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Structures</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Structures</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3_Structures()
- * @model containment="true"
- * @generated
- */
- EList<XmlStructure_2_3> getStructures();
-
- /**
- * Returns the value of the '<em><b>Arrays</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlArray_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Arrays</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Arrays</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlAttributes_2_3_Arrays()
- * @model containment="true"
- * @generated
- */
- EList<XmlArray_2_3> getArrays();
-
-} // XmlAttributes_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlElementCollection_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlElementCollection_2_3.java
deleted file mode 100644
index f098a869f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlElementCollection_2_3.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/**
- * <copyright>
- * </copyright>
- *
- * $Id: XmlElementCollection_2_3.java,v 1.1 2011/06/24 15:49:56 kmoore Exp $
- */
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3#getCompositeMember <em>Composite Member</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlElementCollection_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlElementCollection_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Composite Member</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Composite Member</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Composite Member</em>' attribute.
- * @see #setCompositeMember(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlElementCollection_2_3_CompositeMember()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getCompositeMember();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlElementCollection_2_3#getCompositeMember <em>Composite Member</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Composite Member</em>' attribute.
- * @see #getCompositeMember()
- * @generated
- */
- void setCompositeMember(String value);
-
-} // XmlElementCollection_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEmbeddable_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEmbeddable_2_3.java
deleted file mode 100644
index 51e4eb93a9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEmbeddable_2_3.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Embeddable 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlRecords <em>Plsql Records</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getPlsqlTables <em>Plsql Tables</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getStruct <em>Struct</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEmbeddable_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlRecord_2_3> getPlsqlRecords();
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlTable> getPlsqlTables();
-
- /**
- * Returns the value of the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct</em>' containment reference.
- * @see #setStruct(XmlStruct_2_3)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEmbeddable_2_3_Struct()
- * @model containment="true"
- * @generated
- */
- XmlStruct_2_3 getStruct();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEmbeddable_2_3#getStruct <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct</em>' containment reference.
- * @see #getStruct()
- * @generated
- */
- void setStruct(XmlStruct_2_3 value);
-
-} // XmlEmbeddable_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntityMappings_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntityMappings_2_3.java
deleted file mode 100644
index 9c1ddf28bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntityMappings_2_3.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity Mappings 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlRecords <em>Plsql Records</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntityMappings_2_3#getPlsqlTables <em>Plsql Tables</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntityMappings_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns();
-
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries();
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlRecord_2_3> getPlsqlRecords();
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntityMappings_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlTable> getPlsqlTables();
-
-} // XmlEntityMappings_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntity_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntity_2_3.java
deleted file mode 100644
index dd27d915d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlEntity_2_3.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlRecords <em>Plsql Records</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getPlsqlTables <em>Plsql Tables</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getStruct <em>Struct</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlEntity_2_3 extends XmlMultitenantHolder
-{
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries();
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlRecord_2_3> getPlsqlRecords();
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlTable> getPlsqlTables();
-
- /**
- * Returns the value of the '<em><b>Struct</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Struct</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Struct</em>' containment reference.
- * @see #setStruct(XmlStruct_2_3)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlEntity_2_3_Struct()
- * @model containment="true"
- * @generated
- */
- XmlStruct_2_3 getStruct();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlEntity_2_3#getStruct <em>Struct</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Struct</em>' containment reference.
- * @see #getStruct()
- * @generated
- */
- void setStruct(XmlStruct_2_3 value);
-
-} // XmlEntity_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMappedSuperclass_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMappedSuperclass_2_3.java
deleted file mode 100644
index 2868c3f44b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMappedSuperclass_2_3.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedStoredFunctionQueries <em>Named Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredFunctionQueries <em>Named Plsql Stored Function Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getNamedPlsqlStoredProcedureQueries <em>Named Plsql Stored Procedure Queries</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlRecords <em>Plsql Records</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMappedSuperclass_2_3#getPlsqlTables <em>Plsql Tables</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlMappedSuperclass_2_3 extends XmlMultitenantHolder
-{
- /**
- * Returns the value of the '<em><b>Named Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_NamedStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedStoredFunctionQuery_2_3> getNamedStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Function Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Function Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Function Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_NamedPlsqlStoredFunctionQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredFunctionQuery_2_3> getNamedPlsqlStoredFunctionQueries();
-
- /**
- * Returns the value of the '<em><b>Named Plsql Stored Procedure Queries</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Named Plsql Stored Procedure Queries</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_NamedPlsqlStoredProcedureQueries()
- * @model containment="true"
- * @generated
- */
- EList<XmlNamedPlsqlStoredProcedureQuery_2_3> getNamedPlsqlStoredProcedureQueries();
-
- /**
- * Returns the value of the '<em><b>Plsql Records</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Records</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Records</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_PlsqlRecords()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlRecord_2_3> getPlsqlRecords();
-
- /**
- * Returns the value of the '<em><b>Plsql Tables</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPlsqlTable}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Plsql Tables</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Plsql Tables</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMappedSuperclass_2_3_PlsqlTables()
- * @model containment="true"
- * @generated
- */
- EList<XmlPlsqlTable> getPlsqlTables();
-
-} // XmlMappedSuperclass_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java
deleted file mode 100644
index 907e1e1000..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlMultitenant_2_3.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Multitenant 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getType <em>Type</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMultitenant_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Type</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see #setType(MultitenantType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3_Type()
- * @model
- * @generated
- */
- MultitenantType getType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlMultitenant_2_3#getType <em>Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType
- * @see #getType()
- * @generated
- */
- void setType(MultitenantType value);
-
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlMultitenant_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns();
-} // XmlMultitenant_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3.java
deleted file mode 100644
index 6cd2cf408d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredFunctionQuery_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Plsql Stored Function Query2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredFunctionQuery_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedPlsqlStoredFunctionQuery_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredFunctionQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredFunctionQuery_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlNamedPlsqlStoredFunctionQuery2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3.java
deleted file mode 100644
index f4ffe08590..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedPlsqlStoredProcedureQuery_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Plsql Stored Procedure Query2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredProcedureQuery_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedPlsqlStoredProcedureQuery_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedPlsqlStoredProcedureQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedPlsqlStoredProcedureQuery_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlNamedPlsqlStoredProcedureQuery2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedStoredFunctionQuery_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedStoredFunctionQuery_2_3.java
deleted file mode 100644
index 6d5b9b62d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlNamedStoredFunctionQuery_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Named Stored Function Query2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedStoredFunctionQuery_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlNamedStoredFunctionQuery_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlNamedStoredFunctionQuery_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlNamedStoredFunctionQuery_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlNamedStoredFunctionQuery2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPersistenceUnitDefaults_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPersistenceUnitDefaults_2_3.java
deleted file mode 100644
index e63726e7f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPersistenceUnitDefaults_2_3.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Persistence Unit Defaults 23</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPersistenceUnitDefaults_2_3#getTenantDiscriminatorColumns <em>Tenant Discriminator Columns</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPersistenceUnitDefaults_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPersistenceUnitDefaults_2_3 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Tenant Discriminator Columns</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Tenant Discriminator Columns</em>' containment reference list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Tenant Discriminator Columns</em>' containment reference list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPersistenceUnitDefaults_2_3_TenantDiscriminatorColumns()
- * @model containment="true"
- * @generated
- */
- EList<XmlTenantDiscriminatorColumn_2_3> getTenantDiscriminatorColumns();
-
-} // XmlPersistenceUnitDefaults_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlRecord_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlRecord_2_3.java
deleted file mode 100644
index 19892e1459..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlRecord_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Plsql Record2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlRecord_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPlsqlRecord_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlRecord_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlRecord_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlPlsqlRecord2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlTable_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlTable_2_3.java
deleted file mode 100644
index 254d000c31..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlPlsqlTable_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Plsql Table2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlTable_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlPlsqlTable_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlPlsqlTable_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlPlsqlTable_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlPlsqlTable2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStruct_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStruct_2_3.java
deleted file mode 100644
index 9cd71de2f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStruct_2_3.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Struct2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3#getName <em>Name</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStruct_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlStruct_2_3 extends JpaEObject
-{
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStruct_2_3_Name()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlStruct_2_3#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-} // XmlStruct2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStructure_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStructure_2_3.java
deleted file mode 100644
index 8447e700b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlStructure_2_3.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Structure 23</b></em>'.
- * <!-- end-user-doc -->
- *
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlStructure_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlStructure_2_3 extends JpaEObject
-{
-} // XmlStructure_2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java
deleted file mode 100644
index 8de9ea123c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_3/XmlTenantDiscriminatorColumn_2_3.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlBaseDiscriminatorColumn;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Tenant Discriminator2 3</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty <em>Context Property</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable <em>Table</em>}</li>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey <em>Primary Key</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3()
- * @model kind="class" interface="true" abstract="true"
- * @generated
- */
-public interface XmlTenantDiscriminatorColumn_2_3 extends XmlBaseDiscriminatorColumn
-{
-
- /**
- * Returns the value of the '<em><b>Context Property</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Context Property</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Context Property</em>' attribute.
- * @see #setContextProperty(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_ContextProperty()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getContextProperty();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getContextProperty <em>Context Property</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Context Property</em>' attribute.
- * @see #getContextProperty()
- * @generated
- */
- void setContextProperty(String value);
-
- /**
- * Returns the value of the '<em><b>Table</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Table</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Table</em>' attribute.
- * @see #setTable(String)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_Table()
- * @model dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- String getTable();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getTable <em>Table</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Table</em>' attribute.
- * @see #getTable()
- * @generated
- */
- void setTable(String value);
-
- /**
- * Returns the value of the '<em><b>Primary Key</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Primary Key</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Primary Key</em>' attribute.
- * @see #setPrimaryKey(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package#getXmlTenantDiscriminatorColumn_2_3_PrimaryKey()
- * @model
- * @generated
- */
- Boolean getPrimaryKey();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.XmlTenantDiscriminatorColumn_2_3#getPrimaryKey <em>Primary Key</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Primary Key</em>' attribute.
- * @see #getPrimaryKey()
- * @generated
- */
- void setPrimaryKey(Boolean value);
-
- TextRange getTableTextRange();
-
- boolean tableTouches(int pos);
-} // XmlTenantDiscriminator2_3
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/DatabaseChangeNotificationType.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/DatabaseChangeNotificationType.java
deleted file mode 100644
index d293742434..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/DatabaseChangeNotificationType.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Database Change Notification Type</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getDatabaseChangeNotificationType()
- * @model
- * @generated
- */
-public enum DatabaseChangeNotificationType implements Enumerator
-{
- /**
- * The '<em><b>NONE</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #NONE_VALUE
- * @generated
- * @ordered
- */
- NONE(0, "NONE", "NONE"),
-
- /**
- * The '<em><b>INVALIDATION</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #INVALIDATION_VALUE
- * @generated
- * @ordered
- */
- INVALIDATION(1, "INVALIDATION", "INVALIDATION");
-
- /**
- * The '<em><b>NONE</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>NONE</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #NONE
- * @model
- * @generated
- * @ordered
- */
- public static final int NONE_VALUE = 0;
-
- /**
- * The '<em><b>INVALIDATION</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>INVALIDATION</b></em>' literal object isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @see #INVALIDATION
- * @model
- * @generated
- * @ordered
- */
- public static final int INVALIDATION_VALUE = 1;
-
- /**
- * An array of all the '<em><b>Database Change Notification Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static final DatabaseChangeNotificationType[] VALUES_ARRAY =
- new DatabaseChangeNotificationType[]
- {
- NONE,
- INVALIDATION,
- };
-
- /**
- * A public read-only list of all the '<em><b>Database Change Notification Type</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final List<DatabaseChangeNotificationType> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Database Change Notification Type</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DatabaseChangeNotificationType get(String literal)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- DatabaseChangeNotificationType result = VALUES_ARRAY[i];
- if (result.toString().equals(literal))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Database Change Notification Type</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DatabaseChangeNotificationType getByName(String name)
- {
- for (int i = 0; i < VALUES_ARRAY.length; ++i)
- {
- DatabaseChangeNotificationType result = VALUES_ARRAY[i];
- if (result.getName().equals(name))
- {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Database Change Notification Type</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static DatabaseChangeNotificationType get(int value)
- {
- switch (value)
- {
- case NONE_VALUE: return NONE;
- case INVALIDATION_VALUE: return INVALIDATION;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private DatabaseChangeNotificationType(int value, String name, String literal)
- {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public int getValue()
- {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String getLiteral()
- {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String toString()
- {
- return literal;
- }
-
-} //DatabaseChangeNotificationType
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java
deleted file mode 100644
index d4000b74c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLink2_4.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-
-
-@SuppressWarnings("nls")
-public interface EclipseLink2_4
- extends EclipseLink2_2
-{
- String SCHEMA_NAMESPACE = EclipseLink.SCHEMA_NAMESPACE;
- String SCHEMA_LOCATION = "http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_4.xsd";
- String SCHEMA_VERSION = "2.4";
-
- // EclipseLink 2.4 specific nodes
- String CACHE__DATABASE_CHANGE_NOTIFICATION_TYPE = "database-change-notification-type";
- String CACHE_INDEX = "cache-index";
- String CACHE_INDEX__COLUMN_NAME = "column-name";
- String DELETE_ALL = "delete-all";
- String MULTITENANT__INCLUDE_CRITERIA = "include-criteria";
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Factory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Factory.java
deleted file mode 100644
index f882e85117..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Factory.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.impl.EFactoryImpl;
-
-import org.eclipse.emf.ecore.plugin.EcorePlugin;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Factory</b> for the model.
- * It provides a create method for each non-abstract class of the model.
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package
- * @generated
- */
-public class EclipseLinkOrmV2_4Factory extends EFactoryImpl
-{
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_4Factory eINSTANCE = init();
-
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static EclipseLinkOrmV2_4Factory init()
- {
- try
- {
- EclipseLinkOrmV2_4Factory theEclipseLinkOrmV2_4Factory = (EclipseLinkOrmV2_4Factory)EPackage.Registry.INSTANCE.getEFactory("jpt.eclipselink.orm.v2_4.xmi");
- if (theEclipseLinkOrmV2_4Factory != null)
- {
- return theEclipseLinkOrmV2_4Factory;
- }
- }
- catch (Exception exception)
- {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new EclipseLinkOrmV2_4Factory();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_4Factory()
- {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public EObject create(EClass eClass)
- {
- switch (eClass.getClassifierID())
- {
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_4Package.DATABASE_CHANGE_NOTIFICATION_TYPE:
- return createDatabaseChangeNotificationTypeFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue)
- {
- switch (eDataType.getClassifierID())
- {
- case EclipseLinkOrmV2_4Package.DATABASE_CHANGE_NOTIFICATION_TYPE:
- return convertDatabaseChangeNotificationTypeToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public DatabaseChangeNotificationType createDatabaseChangeNotificationTypeFromString(EDataType eDataType, String initialValue)
- {
- DatabaseChangeNotificationType result = DatabaseChangeNotificationType.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public String convertDatabaseChangeNotificationTypeToString(EDataType eDataType, Object instanceValue)
- {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public EclipseLinkOrmV2_4Package getEclipseLinkOrmV2_4Package()
- {
- return (EclipseLinkOrmV2_4Package)getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @deprecated
- * @generated
- */
- @Deprecated
- public static EclipseLinkOrmV2_4Package getPackage()
- {
- return EclipseLinkOrmV2_4Package.eINSTANCE;
- }
-
-} //EclipseLinkOrmV2_4Factory
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Package.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Package.java
deleted file mode 100644
index 014b58d70d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/EclipseLinkOrmV2_4Package.java
+++ /dev/null
@@ -1,1099 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
-
-import org.eclipse.jpt.jpa.core.resource.orm.OrmPackage;
-
-import org.eclipse.jpt.jpa.core.resource.xml.CommonPackage;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmPackage;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLinkOrmV1_1Package;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLinkOrmV2_0Package;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkOrmV2_1Package;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLinkOrmV2_2Package;
-
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLinkOrmV2_3Package;
-
-/**
- * <!-- begin-user-doc -->
- * The <b>Package</b> for the model.
- * It contains accessors for the meta objects to represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Factory
- * @model kind="package"
- * @generated
- */
-public class EclipseLinkOrmV2_4Package extends EPackageImpl
-{
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNAME = "v2_4";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_URI = "jpt.eclipselink.orm.v2_4.xmi";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final String eNS_PREFIX = "org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EclipseLinkOrmV2_4Package eINSTANCE = org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4 <em>Xml Multitenant 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMultitenant_2_4()
- * @generated
- */
- public static final int XML_MULTITENANT_24 = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4 <em>Xml Element Collection 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlElementCollection_2_4()
- * @generated
- */
- public static final int XML_ELEMENT_COLLECTION_24 = 3;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4 <em>Xml One To Many 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlOneToMany_2_4()
- * @generated
- */
- public static final int XML_ONE_TO_MANY_24 = 8;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4 <em>Xml Entity 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlEntity_2_4()
- * @generated
- */
- public static final int XML_ENTITY_24 = 4;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4 <em>Xml Basic 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlBasic_2_4()
- * @generated
- */
- public static final int XML_BASIC_24 = 0;
-
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_24__CACHE_INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Basic 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_BASIC_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4 <em>Xml Cache 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCache_2_4()
- * @generated
- */
- public static final int XML_CACHE_24 = 1;
-
- /**
- * The feature id for the '<em><b>Database Change Notification Type</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE = 0;
-
- /**
- * The number of structural features of the '<em>Xml Cache 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4 <em>Xml Cache Index 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCacheIndex_2_4()
- * @generated
- */
- public static final int XML_CACHE_INDEX_24 = 2;
-
- /**
- * The feature id for the '<em><b>Column Names</b></em>' attribute list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_INDEX_24__COLUMN_NAMES = 0;
-
- /**
- * The number of structural features of the '<em>Xml Cache Index 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_CACHE_INDEX_24_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_24__DELETE_ALL = 0;
-
- /**
- * The number of structural features of the '<em>Xml Element Collection 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ELEMENT_COLLECTION_24_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_24__CACHE_INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Entity 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ENTITY_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4 <em>Xml Id 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlId_2_4()
- * @generated
- */
- public static final int XML_ID_24 = 5;
-
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_24__CACHE_INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Id 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ID_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4 <em>Xml Mapped Superclass 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMappedSuperclass_2_4()
- * @generated
- */
- public static final int XML_MAPPED_SUPERCLASS_24 = 6;
-
- /**
- * The feature id for the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_24__CACHE_INDEX = 0;
-
- /**
- * The number of structural features of the '<em>Xml Mapped Superclass 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MAPPED_SUPERCLASS_24_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Include Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_24__INCLUDE_CRITERIA = 0;
-
- /**
- * The number of structural features of the '<em>Xml Multitenant 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_MULTITENANT_24_FEATURE_COUNT = 1;
-
- /**
- * The feature id for the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_24__DELETE_ALL = 0;
-
- /**
- * The number of structural features of the '<em>Xml One To Many 24</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- * @ordered
- */
- public static final int XML_ONE_TO_MANY_24_FEATURE_COUNT = 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType <em>Database Change Notification Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getDatabaseChangeNotificationType()
- * @generated
- */
- public static final int DATABASE_CHANGE_NOTIFICATION_TYPE = 9;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMultitenant_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlElementCollection_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlOneToMany_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlEntity_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlBasic_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCache_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlCacheIndex_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlId_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EClass xmlMappedSuperclass_2_4EClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private EEnum databaseChangeNotificationTypeEEnum = null;
-
- /**
- * Creates an instance of the model <b>Package</b>, registered with
- * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
- * package URI value.
- * <p>Note: the correct way to create the package is via the static
- * factory method {@link #init init()}, which also performs
- * initialization of the package, or returns the registered package,
- * if one already exists.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.emf.ecore.EPackage.Registry
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#eNS_URI
- * @see #init()
- * @generated
- */
- private EclipseLinkOrmV2_4Package()
- {
- super(eNS_URI, EclipseLinkOrmV2_4Factory.eINSTANCE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private static boolean isInited = false;
-
- /**
- * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
- *
- * <p>This method is used to initialize {@link EclipseLinkOrmV2_4Package#eINSTANCE} when that field is accessed.
- * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see #eNS_URI
- * @see #createPackageContents()
- * @see #initializePackageContents()
- * @generated
- */
- public static EclipseLinkOrmV2_4Package init()
- {
- if (isInited) return (EclipseLinkOrmV2_4Package)EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_4Package.eNS_URI);
-
- // Obtain or create and register package
- EclipseLinkOrmV2_4Package theEclipseLinkOrmV2_4Package = (EclipseLinkOrmV2_4Package)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof EclipseLinkOrmV2_4Package ? EPackage.Registry.INSTANCE.get(eNS_URI) : new EclipseLinkOrmV2_4Package());
-
- isInited = true;
-
- // Initialize simple dependencies
- OrmPackage.eINSTANCE.eClass();
- CommonPackage.eINSTANCE.eClass();
- XMLTypePackage.eINSTANCE.eClass();
-
- // Obtain or create and register interdependencies
- EclipseLinkOrmPackage theEclipseLinkOrmPackage = (EclipseLinkOrmPackage)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) instanceof EclipseLinkOrmPackage ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmPackage.eNS_URI) : EclipseLinkOrmPackage.eINSTANCE);
- EclipseLinkOrmV1_1Package theEclipseLinkOrmV1_1Package = (EclipseLinkOrmV1_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) instanceof EclipseLinkOrmV1_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV1_1Package.eNS_URI) : EclipseLinkOrmV1_1Package.eINSTANCE);
- EclipseLinkOrmV2_0Package theEclipseLinkOrmV2_0Package = (EclipseLinkOrmV2_0Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) instanceof EclipseLinkOrmV2_0Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_0Package.eNS_URI) : EclipseLinkOrmV2_0Package.eINSTANCE);
- EclipseLinkOrmV2_1Package theEclipseLinkOrmV2_1Package = (EclipseLinkOrmV2_1Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) instanceof EclipseLinkOrmV2_1Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_1Package.eNS_URI) : EclipseLinkOrmV2_1Package.eINSTANCE);
- EclipseLinkOrmV2_2Package theEclipseLinkOrmV2_2Package = (EclipseLinkOrmV2_2Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) instanceof EclipseLinkOrmV2_2Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_2Package.eNS_URI) : EclipseLinkOrmV2_2Package.eINSTANCE);
- EclipseLinkOrmV2_3Package theEclipseLinkOrmV2_3Package = (EclipseLinkOrmV2_3Package)(EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) instanceof EclipseLinkOrmV2_3Package ? EPackage.Registry.INSTANCE.getEPackage(EclipseLinkOrmV2_3Package.eNS_URI) : EclipseLinkOrmV2_3Package.eINSTANCE);
-
- // Create package meta-data objects
- theEclipseLinkOrmV2_4Package.createPackageContents();
- theEclipseLinkOrmPackage.createPackageContents();
- theEclipseLinkOrmV1_1Package.createPackageContents();
- theEclipseLinkOrmV2_0Package.createPackageContents();
- theEclipseLinkOrmV2_1Package.createPackageContents();
- theEclipseLinkOrmV2_2Package.createPackageContents();
- theEclipseLinkOrmV2_3Package.createPackageContents();
-
- // Initialize created meta-data
- theEclipseLinkOrmV2_4Package.initializePackageContents();
- theEclipseLinkOrmPackage.initializePackageContents();
- theEclipseLinkOrmV1_1Package.initializePackageContents();
- theEclipseLinkOrmV2_0Package.initializePackageContents();
- theEclipseLinkOrmV2_1Package.initializePackageContents();
- theEclipseLinkOrmV2_2Package.initializePackageContents();
- theEclipseLinkOrmV2_3Package.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theEclipseLinkOrmV2_4Package.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(EclipseLinkOrmV2_4Package.eNS_URI, theEclipseLinkOrmV2_4Package);
- return theEclipseLinkOrmV2_4Package;
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4 <em>Xml Multitenant 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Multitenant 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4
- * @generated
- */
- public EClass getXmlMultitenant_2_4()
- {
- return xmlMultitenant_2_4EClass;
- }
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4#getIncludeCriteria <em>Include Criteria</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Include Criteria</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4#getIncludeCriteria()
- * @see #getXmlMultitenant_2_4()
- * @generated
- */
- public EAttribute getXmlMultitenant_2_4_IncludeCriteria()
- {
- return (EAttribute)xmlMultitenant_2_4EClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4 <em>Xml Element Collection 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Element Collection 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4
- * @generated
- */
- public EClass getXmlElementCollection_2_4()
- {
- return xmlElementCollection_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4#isDeleteAll <em>Delete All</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Delete All</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4#isDeleteAll()
- * @see #getXmlElementCollection_2_4()
- * @generated
- */
- public EAttribute getXmlElementCollection_2_4_DeleteAll()
- {
- return (EAttribute)xmlElementCollection_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4 <em>Xml One To Many 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml One To Many 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4
- * @generated
- */
- public EClass getXmlOneToMany_2_4()
- {
- return xmlOneToMany_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4#isDeleteAll <em>Delete All</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Delete All</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4#isDeleteAll()
- * @see #getXmlOneToMany_2_4()
- * @generated
- */
- public EAttribute getXmlOneToMany_2_4_DeleteAll()
- {
- return (EAttribute)xmlOneToMany_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4 <em>Xml Entity 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Entity 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4
- * @generated
- */
- public EClass getXmlEntity_2_4()
- {
- return xmlEntity_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4#getCacheIndex <em>Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4#getCacheIndex()
- * @see #getXmlEntity_2_4()
- * @generated
- */
- public EReference getXmlEntity_2_4_CacheIndex()
- {
- return (EReference)xmlEntity_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4 <em>Xml Basic 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Basic 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4
- * @generated
- */
- public EClass getXmlBasic_2_4()
- {
- return xmlBasic_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4#getCacheIndex <em>Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4#getCacheIndex()
- * @see #getXmlBasic_2_4()
- * @generated
- */
- public EReference getXmlBasic_2_4_CacheIndex()
- {
- return (EReference)xmlBasic_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4 <em>Xml Cache 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4
- * @generated
- */
- public EClass getXmlCache_2_4()
- {
- return xmlCache_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4#getDatabaseChangeNotificationType <em>Database Change Notification Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute '<em>Database Change Notification Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4#getDatabaseChangeNotificationType()
- * @see #getXmlCache_2_4()
- * @generated
- */
- public EAttribute getXmlCache_2_4_DatabaseChangeNotificationType()
- {
- return (EAttribute)xmlCache_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4 <em>Xml Cache Index 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Cache Index 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4
- * @generated
- */
- public EClass getXmlCacheIndex_2_4()
- {
- return xmlCacheIndex_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the attribute list '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4#getColumnNames <em>Column Names</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the attribute list '<em>Column Names</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4#getColumnNames()
- * @see #getXmlCacheIndex_2_4()
- * @generated
- */
- public EAttribute getXmlCacheIndex_2_4_ColumnNames()
- {
- return (EAttribute)xmlCacheIndex_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4 <em>Xml Id 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Id 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4
- * @generated
- */
- public EClass getXmlId_2_4()
- {
- return xmlId_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4#getCacheIndex <em>Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4#getCacheIndex()
- * @see #getXmlId_2_4()
- * @generated
- */
- public EReference getXmlId_2_4_CacheIndex()
- {
- return (EReference)xmlId_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4 <em>Xml Mapped Superclass 24</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for class '<em>Xml Mapped Superclass 24</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4
- * @generated
- */
- public EClass getXmlMappedSuperclass_2_4()
- {
- return xmlMappedSuperclass_2_4EClass;
- }
-
-
- /**
- * Returns the meta object for the containment reference '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4#getCacheIndex <em>Cache Index</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for the containment reference '<em>Cache Index</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4#getCacheIndex()
- * @see #getXmlMappedSuperclass_2_4()
- * @generated
- */
- public EReference getXmlMappedSuperclass_2_4_CacheIndex()
- {
- return (EReference)xmlMappedSuperclass_2_4EClass.getEStructuralFeatures().get(0);
- }
-
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType <em>Database Change Notification Type</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the meta object for enum '<em>Database Change Notification Type</em>'.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @generated
- */
- public EEnum getDatabaseChangeNotificationType()
- {
- return databaseChangeNotificationTypeEEnum;
- }
-
-
- /**
- * Returns the factory that creates the instances of the model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @return the factory that creates the instances of the model.
- * @generated
- */
- public EclipseLinkOrmV2_4Factory getEclipseLinkOrmV2_4Factory()
- {
- return (EclipseLinkOrmV2_4Factory)getEFactoryInstance();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isCreated = false;
-
- /**
- * Creates the meta-model objects for the package. This method is
- * guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void createPackageContents()
- {
- if (isCreated) return;
- isCreated = true;
-
- // Create classes and their features
- xmlBasic_2_4EClass = createEClass(XML_BASIC_24);
- createEReference(xmlBasic_2_4EClass, XML_BASIC_24__CACHE_INDEX);
-
- xmlCache_2_4EClass = createEClass(XML_CACHE_24);
- createEAttribute(xmlCache_2_4EClass, XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE);
-
- xmlCacheIndex_2_4EClass = createEClass(XML_CACHE_INDEX_24);
- createEAttribute(xmlCacheIndex_2_4EClass, XML_CACHE_INDEX_24__COLUMN_NAMES);
-
- xmlElementCollection_2_4EClass = createEClass(XML_ELEMENT_COLLECTION_24);
- createEAttribute(xmlElementCollection_2_4EClass, XML_ELEMENT_COLLECTION_24__DELETE_ALL);
-
- xmlEntity_2_4EClass = createEClass(XML_ENTITY_24);
- createEReference(xmlEntity_2_4EClass, XML_ENTITY_24__CACHE_INDEX);
-
- xmlId_2_4EClass = createEClass(XML_ID_24);
- createEReference(xmlId_2_4EClass, XML_ID_24__CACHE_INDEX);
-
- xmlMappedSuperclass_2_4EClass = createEClass(XML_MAPPED_SUPERCLASS_24);
- createEReference(xmlMappedSuperclass_2_4EClass, XML_MAPPED_SUPERCLASS_24__CACHE_INDEX);
-
- xmlMultitenant_2_4EClass = createEClass(XML_MULTITENANT_24);
- createEAttribute(xmlMultitenant_2_4EClass, XML_MULTITENANT_24__INCLUDE_CRITERIA);
-
- xmlOneToMany_2_4EClass = createEClass(XML_ONE_TO_MANY_24);
- createEAttribute(xmlOneToMany_2_4EClass, XML_ONE_TO_MANY_24__DELETE_ALL);
-
- // Create enums
- databaseChangeNotificationTypeEEnum = createEEnum(DATABASE_CHANGE_NOTIFICATION_TYPE);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- private boolean isInitialized = false;
-
- /**
- * Complete the initialization of the package and its meta-model. This
- * method is guarded to have no affect on any invocation but its first.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public void initializePackageContents()
- {
- if (isInitialized) return;
- isInitialized = true;
-
- // Initialize package
- setName(eNAME);
- setNsPrefix(eNS_PREFIX);
- setNsURI(eNS_URI);
-
- // Obtain other dependent packages
- XMLTypePackage theXMLTypePackage = (XMLTypePackage)EPackage.Registry.INSTANCE.getEPackage(XMLTypePackage.eNS_URI);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
-
- // Initialize classes and features; add operations and parameters
- initEClass(xmlBasic_2_4EClass, XmlBasic_2_4.class, "XmlBasic_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlBasic_2_4_CacheIndex(), this.getXmlCacheIndex_2_4(), null, "cacheIndex", null, 0, 1, XmlBasic_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCache_2_4EClass, XmlCache_2_4.class, "XmlCache_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCache_2_4_DatabaseChangeNotificationType(), this.getDatabaseChangeNotificationType(), "databaseChangeNotificationType", "", 0, 1, XmlCache_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlCacheIndex_2_4EClass, XmlCacheIndex_2_4.class, "XmlCacheIndex_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlCacheIndex_2_4_ColumnNames(), theXMLTypePackage.getString(), "columnNames", null, 0, -1, XmlCacheIndex_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlElementCollection_2_4EClass, XmlElementCollection_2_4.class, "XmlElementCollection_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlElementCollection_2_4_DeleteAll(), theXMLTypePackage.getBoolean(), "deleteAll", null, 0, 1, XmlElementCollection_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlEntity_2_4EClass, XmlEntity_2_4.class, "XmlEntity_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlEntity_2_4_CacheIndex(), this.getXmlCacheIndex_2_4(), null, "cacheIndex", null, 0, 1, XmlEntity_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlId_2_4EClass, XmlId_2_4.class, "XmlId_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlId_2_4_CacheIndex(), this.getXmlCacheIndex_2_4(), null, "cacheIndex", null, 0, 1, XmlId_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMappedSuperclass_2_4EClass, XmlMappedSuperclass_2_4.class, "XmlMappedSuperclass_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getXmlMappedSuperclass_2_4_CacheIndex(), this.getXmlCacheIndex_2_4(), null, "cacheIndex", null, 0, 1, XmlMappedSuperclass_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlMultitenant_2_4EClass, XmlMultitenant_2_4.class, "XmlMultitenant_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlMultitenant_2_4_IncludeCriteria(), theXMLTypePackage.getBooleanObject(), "includeCriteria", null, 0, 1, XmlMultitenant_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(xmlOneToMany_2_4EClass, XmlOneToMany_2_4.class, "XmlOneToMany_2_4", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getXmlOneToMany_2_4_DeleteAll(), theXMLTypePackage.getBoolean(), "deleteAll", null, 0, 1, XmlOneToMany_2_4.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(databaseChangeNotificationTypeEEnum, DatabaseChangeNotificationType.class, "DatabaseChangeNotificationType");
- addEEnumLiteral(databaseChangeNotificationTypeEEnum, DatabaseChangeNotificationType.NONE);
- addEEnumLiteral(databaseChangeNotificationTypeEEnum, DatabaseChangeNotificationType.INVALIDATION);
- }
-
- /**
- * <!-- begin-user-doc -->
- * Defines literals for the meta objects that represent
- * <ul>
- * <li>each class,</li>
- * <li>each feature of each class,</li>
- * <li>each enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- * @generated
- */
- public interface Literals
- {
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4 <em>Xml Multitenant 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMultitenant_2_4()
- * @generated
- */
- public static final EClass XML_MULTITENANT_24 = eINSTANCE.getXmlMultitenant_2_4();
-
- /**
- * The meta object literal for the '<em><b>Include Criteria</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_MULTITENANT_24__INCLUDE_CRITERIA = eINSTANCE.getXmlMultitenant_2_4_IncludeCriteria();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4 <em>Xml Element Collection 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlElementCollection_2_4()
- * @generated
- */
- public static final EClass XML_ELEMENT_COLLECTION_24 = eINSTANCE.getXmlElementCollection_2_4();
-
- /**
- * The meta object literal for the '<em><b>Delete All</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ELEMENT_COLLECTION_24__DELETE_ALL = eINSTANCE.getXmlElementCollection_2_4_DeleteAll();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4 <em>Xml One To Many 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlOneToMany_2_4()
- * @generated
- */
- public static final EClass XML_ONE_TO_MANY_24 = eINSTANCE.getXmlOneToMany_2_4();
-
- /**
- * The meta object literal for the '<em><b>Delete All</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_ONE_TO_MANY_24__DELETE_ALL = eINSTANCE.getXmlOneToMany_2_4_DeleteAll();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4 <em>Xml Entity 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlEntity_2_4()
- * @generated
- */
- public static final EClass XML_ENTITY_24 = eINSTANCE.getXmlEntity_2_4();
-
- /**
- * The meta object literal for the '<em><b>Cache Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ENTITY_24__CACHE_INDEX = eINSTANCE.getXmlEntity_2_4_CacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4 <em>Xml Basic 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlBasic_2_4()
- * @generated
- */
- public static final EClass XML_BASIC_24 = eINSTANCE.getXmlBasic_2_4();
-
- /**
- * The meta object literal for the '<em><b>Cache Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_BASIC_24__CACHE_INDEX = eINSTANCE.getXmlBasic_2_4_CacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4 <em>Xml Cache 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCache_2_4()
- * @generated
- */
- public static final EClass XML_CACHE_24 = eINSTANCE.getXmlCache_2_4();
-
- /**
- * The meta object literal for the '<em><b>Database Change Notification Type</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE_24__DATABASE_CHANGE_NOTIFICATION_TYPE = eINSTANCE.getXmlCache_2_4_DatabaseChangeNotificationType();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4 <em>Xml Cache Index 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCacheIndex_2_4()
- * @generated
- */
- public static final EClass XML_CACHE_INDEX_24 = eINSTANCE.getXmlCacheIndex_2_4();
-
- /**
- * The meta object literal for the '<em><b>Column Names</b></em>' attribute list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EAttribute XML_CACHE_INDEX_24__COLUMN_NAMES = eINSTANCE.getXmlCacheIndex_2_4_ColumnNames();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4 <em>Xml Id 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlId_2_4()
- * @generated
- */
- public static final EClass XML_ID_24 = eINSTANCE.getXmlId_2_4();
-
- /**
- * The meta object literal for the '<em><b>Cache Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_ID_24__CACHE_INDEX = eINSTANCE.getXmlId_2_4_CacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4 <em>Xml Mapped Superclass 24</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMappedSuperclass_2_4()
- * @generated
- */
- public static final EClass XML_MAPPED_SUPERCLASS_24 = eINSTANCE.getXmlMappedSuperclass_2_4();
-
- /**
- * The meta object literal for the '<em><b>Cache Index</b></em>' containment reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @generated
- */
- public static final EReference XML_MAPPED_SUPERCLASS_24__CACHE_INDEX = eINSTANCE.getXmlMappedSuperclass_2_4_CacheIndex();
-
- /**
- * The meta object literal for the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType <em>Database Change Notification Type</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getDatabaseChangeNotificationType()
- * @generated
- */
- public static final EEnum DATABASE_CHANGE_NOTIFICATION_TYPE = eINSTANCE.getDatabaseChangeNotificationType();
-
- }
-
-} //EclipseLinkOrmV2_4Package
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlBasic_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlBasic_2_4.java
deleted file mode 100644
index b21c332b05..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlBasic_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Basic 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4#getCacheIndex <em>Cache Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlBasic_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlBasic_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlBasic_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- XmlCacheIndex_2_4 getCacheIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlBasic_2_4#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- void setCacheIndex(XmlCacheIndex_2_4 value);
-
-} // XmlBasic_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCacheIndex_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCacheIndex_2_4.java
deleted file mode 100644
index 86a129458b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCacheIndex_2_4.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.emf.common.util.EList;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache Index 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCacheIndex_2_4#getColumnNames <em>Column Names</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCacheIndex_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCacheIndex_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Column Names</b></em>' attribute list.
- * The list contents are of type {@link java.lang.String}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Column Names</em>' attribute list isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Column Names</em>' attribute list.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCacheIndex_2_4_ColumnNames()
- * @model unique="false" dataType="org.eclipse.emf.ecore.xml.type.String"
- * @generated
- */
- EList<String> getColumnNames();
-
-} // XmlCacheIndex_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCache_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCache_2_4.java
deleted file mode 100644
index 745c03b914..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlCache_2_4.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Cache2 4</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4#getDatabaseChangeNotificationType <em>Database Change Notification Type</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCache_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlCache_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Database Change Notification Type</b></em>' attribute.
- * The default value is <code>""</code>.
- * The literals are from the enumeration {@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Database Change Notification Type</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Database Change Notification Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see #setDatabaseChangeNotificationType(DatabaseChangeNotificationType)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlCache_2_4_DatabaseChangeNotificationType()
- * @model default=""
- * @generated
- */
- DatabaseChangeNotificationType getDatabaseChangeNotificationType();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlCache_2_4#getDatabaseChangeNotificationType <em>Database Change Notification Type</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Database Change Notification Type</em>' attribute.
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.DatabaseChangeNotificationType
- * @see #getDatabaseChangeNotificationType()
- * @generated
- */
- void setDatabaseChangeNotificationType(DatabaseChangeNotificationType value);
-
-} // XmlCache2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlElementCollection_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlElementCollection_2_4.java
deleted file mode 100644
index 8564b2b1ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlElementCollection_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Element Collection 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4#isDeleteAll <em>Delete All</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlElementCollection_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlElementCollection_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete All</em>' attribute.
- * @see #setDeleteAll(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlElementCollection_2_4_DeleteAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isDeleteAll();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlElementCollection_2_4#isDeleteAll <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete All</em>' attribute.
- * @see #isDeleteAll()
- * @generated
- */
- void setDeleteAll(boolean value);
-
-} // XmlElementCollection_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlEntity_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlEntity_2_4.java
deleted file mode 100644
index 0d7a419336..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlEntity_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Entity 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4#getCacheIndex <em>Cache Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlEntity_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlEntity_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlEntity_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- XmlCacheIndex_2_4 getCacheIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlEntity_2_4#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- void setCacheIndex(XmlCacheIndex_2_4 value);
-
-} // XmlEntity_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlId_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlId_2_4.java
deleted file mode 100644
index 2e108a7a81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlId_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Id 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4#getCacheIndex <em>Cache Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlId_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlId_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlId_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- XmlCacheIndex_2_4 getCacheIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlId_2_4#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- void setCacheIndex(XmlCacheIndex_2_4 value);
-
-} // XmlId_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMappedSuperclass_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMappedSuperclass_2_4.java
deleted file mode 100644
index 823e4f8eee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMappedSuperclass_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Mapped Superclass 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4#getCacheIndex <em>Cache Index</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMappedSuperclass_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMappedSuperclass_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Cache Index</b></em>' containment reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Cache Index</em>' containment reference isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Cache Index</em>' containment reference.
- * @see #setCacheIndex(XmlCacheIndex_2_4)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMappedSuperclass_2_4_CacheIndex()
- * @model containment="true"
- * @generated
- */
- XmlCacheIndex_2_4 getCacheIndex();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMappedSuperclass_2_4#getCacheIndex <em>Cache Index</em>}' containment reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Cache Index</em>' containment reference.
- * @see #getCacheIndex()
- * @generated
- */
- void setCacheIndex(XmlCacheIndex_2_4 value);
-
-} // XmlMappedSuperclass_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMultitenant_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMultitenant_2_4.java
deleted file mode 100644
index b3755a2595..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlMultitenant_2_4.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml Multitenant 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4#getIncludeCriteria <em>Include Criteria</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMultitenant_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlMultitenant_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Include Criteria</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Include Criteria</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Include Criteria</em>' attribute.
- * @see #setIncludeCriteria(Boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlMultitenant_2_4_IncludeCriteria()
- * @model dataType="org.eclipse.emf.ecore.xml.type.BooleanObject"
- * @generated
- */
- Boolean getIncludeCriteria();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlMultitenant_2_4#getIncludeCriteria <em>Include Criteria</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Include Criteria</em>' attribute.
- * @see #getIncludeCriteria()
- * @generated
- */
- void setIncludeCriteria(Boolean value);
-
- TextRange getIncludeCriteriaTextRange();
-
-} // XmlMultitenant_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlOneToMany_2_4.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlOneToMany_2_4.java
deleted file mode 100644
index 87cd3826bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.core/src/org/eclipse/jpt/jpa/eclipselink/core/resource/orm/v2_4/XmlOneToMany_2_4.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4;
-
-import org.eclipse.jpt.jpa.core.resource.xml.JpaEObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Xml One To Many 24</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4#isDeleteAll <em>Delete All</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlOneToMany_2_4()
- * @model kind="class" interface="true" abstract="true"
- * @extends JpaEObject
- * @generated
- */
-public interface XmlOneToMany_2_4 extends JpaEObject
-{
- /**
- * Returns the value of the '<em><b>Delete All</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Delete All</em>' attribute isn't clear,
- * there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- * @return the value of the '<em>Delete All</em>' attribute.
- * @see #setDeleteAll(boolean)
- * @see org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.EclipseLinkOrmV2_4Package#getXmlOneToMany_2_4_DeleteAll()
- * @model dataType="org.eclipse.emf.ecore.xml.type.Boolean"
- * @generated
- */
- boolean isDeleteAll();
-
- /**
- * Sets the value of the '{@link org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_4.XmlOneToMany_2_4#isDeleteAll <em>Delete All</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- * @param value the new value of the '<em>Delete All</em>' attribute.
- * @see #isDeleteAll()
- * @generated
- */
- void setDeleteAll(boolean value);
-
-} // XmlOneToMany_2_4
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.classpath
deleted file mode 100644
index 9db8d26e1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.project b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.project
deleted file mode 100644
index c7731357c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index f6024ff45c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:20 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index acbc8f55e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,62 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.eclipselink.ui;singleton:=true
-Bundle-Version: 2.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="3.8.0",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.eclipselink.core;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.eclipselink.core;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.ui;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.navigator;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.forms;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks.ui;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.jpt.common.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jpa.gen;bundle-version="[2.1.0,3.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.8.0,4.0.0)"
-Export-Package: org.eclipse.jpt.jpa.eclipselink.ui,
- org.eclipse.jpt.jpa.eclipselink.ui.internal;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.commands;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen.wizards;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.details;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.dialogs;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.handlers;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.schema.generation;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.persistencexml.details;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.structure;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.caching;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.customization;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.logging;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.options;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.weave;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.conversion.java;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.gen;x-internal:=true
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/about.html b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/build.properties
deleted file mode 100644
index 18a62e43cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.xml,\
- plugin.properties
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.properties
deleted file mode 100644
index 20b4678684..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.properties
+++ /dev/null
@@ -1,37 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName= Dali Java Persistence Tools - EclipseLink Support - UI
-providerName=Eclipse Web Tools Platform
-
-eclipseLinkWizardCategoryName=EclipseLink
-newEclipseLinkMappingFileWizardName=EclipseLink ORM Mapping File
-newEclipseLinkJpaMappingFileWizardDesc=Create an EclipseLink ORM mapping file
-newDynamicEntityFromTableWizardName=Dynamic Entities from Tables
-newDynamicEntityFromTableWizardDesc=Create dynamic entities from database tables
-
-generateDynamicEntities=Generate Dynamic Entities from Tables...
-
-convertJavaConverters=Java Converters...
-jpaNode = JPA
-eclipseLinkNode = EclipseLink
-
-addVirtualAttribute = Add Virtual Attribute... \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml
deleted file mode 100644
index c42430f428..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml
+++ /dev/null
@@ -1,308 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2012 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.jpt.jpa.ui.jpaPlatformUis">
-
- <jpaPlatformUi
- id="org.eclipse.eclipselink.platform.ui"
- jpaPlatform="org.eclipse.eclipselink.platform"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLinkJpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink1_1.ui"
- jpaPlatform="eclipselink1_1"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLink1_1JpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink1_2.ui"
- jpaPlatform="eclipselink1_2"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLink1_2JpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink2_0.ui"
- jpaPlatform="eclipselink2_0"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLink2_0JpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink2_1.ui"
- jpaPlatform="eclipselink2_1"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLink2_1JpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink2_2.ui"
- jpaPlatform="eclipselink2_2"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLink2_2JpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink2_3.ui"
- jpaPlatform="eclipselink2_3"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLink2_3JpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="eclipselink2_4.ui"
- jpaPlatform="eclipselink2_4"
- factoryClass="org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLink2_4JpaPlatformUiFactory"/>
- </extension>
-
-
- <extension
- point="org.eclipse.ui.newWizards">
-
- <category
- id="org.eclipse.jpt.jpa.eclipselink"
- name="%eclipseLinkWizardCategoryName"
- parentCategory="org.eclipse.jpt.jpa"/>
-
- <wizard
- id="org.eclipse.jpt.jpa.eclipselink.ui.wizard.newEclipseLinkMappingFile"
- name="%newEclipseLinkMappingFileWizardName"
- icon="platform:/plugin/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpa_file_wiz.gif"
- category="org.eclipse.jpt.jpa/org.eclipse.jpt.jpa.eclipselink">
- <description>%newEclipseLinkJpaMappingFileWizardDesc</description>
- <class class="org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.EclipseLinkMappingFileWizard">
- <parameter name="javaeeartifact" value="true"/>
- <parameter name="menuIndex" value="40" />
- <parameter name="jptartifact" value="true"/>
- </class>
- </wizard>
-
- <wizard
- category="org.eclipse.jpt.jpa/org.eclipse.jpt.jpa.eclipselink"
- class="org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.gen.GenerateDynamicEntitiesFromSchemaWizard"
- icon="platform:/plugin/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpa_file_wiz.gif"
- id="org.eclipse.jpt.jpa.eclipselink.ui.wizard.newDynamicEntitiesFromTables"
- name="%newDynamicEntityFromTableWizardName">
- <description>%newDynamicEntityFromTableWizardDesc</description>
- <selection class="org.eclipse.core.resources.IResource"/>
- </wizard>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
-
- <commonWizard
- menuGroupId="org.eclipse.jpt.jpa.ui"
- type="new"
- wizardId="org.eclipse.jpt.jpa.eclipselink.ui.wizard.newEclipseLinkMappingFile">
- <enablement>
- <and>
- <or>
- <instanceof value="org.eclipse.core.resources.IProject"/>
- <instanceof value="org.eclipse.core.resources.IFolder"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragmentRoot"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
- </or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"
- forcePluginActivation="true"/>
- </adapt>
- <adapt type = "org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription">
- <test property="org.eclipse.jpt.jpa.core.jpaPlatformGroup"
- value="eclipselink"/>
- </adapt>
- </and>
- </enablement>
- </commonWizard>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
-
- <perspectiveExtension
- targetID="org.eclipse.jpt.ui.jpaPerspective">
- <newWizardShortcut
- id="org.eclipse.jpt.jpa.eclipselink.ui.wizard.newEclipseLinkMappingFile">
- </newWizardShortcut>
- </perspectiveExtension>
-
- </extension>
-
- <extension
- point="org.eclipse.ui.propertyPages">
-
- <page
- id="org.eclipse.jpt.jpa.eclipselink.ui.eclipselinkProjectProperties"
- name="%eclipseLinkNode"
- category="org.eclipse.jpt.jpa.ui.jpaProjectProperties"
- class="org.eclipse.jpt.jpa.eclipselink.ui.internal.weave.EclipselinkPreferencePage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"/>
- </adapt>
- </enabledWhen>
- </page>
-
- </extension>
-
- <!-- ***** commands ***** -->
-
- <extension
- point="org.eclipse.ui.commands">
-
- <command
- id="org.eclipse.jpt.jpa.eclipselink.ui.persistentTypeAddVirtualAttribute"
- name="%addVirtualAttribute"
- categoryId="org.eclipse.jpt.jpa.ui.jpaStructureViewCommands"/>
-
- <command
- id="org.eclipse.jpt.jpa.eclipselink.ui.convertJavaConverters"
- name="%convertJavaConverters"
- categoryId="org.eclipse.jpt.jpa.ui.jpaMetadataConversionCommands"/>
-
- <command
- id="org.eclipse.jpt.jpa.eclipselink.ui.generateDynamicEntities"
- name="%generateDynamicEntities"/>
-
- </extension>
-
- <!-- ***** handlers ***** -->
-
- <extension
- point="org.eclipse.ui.handlers">
-
- <handler
- commandId="org.eclipse.jpt.jpa.eclipselink.ui.persistentTypeAddVirtualAttribute"
- class="org.eclipse.jpt.jpa.eclipselink.ui.internal.handlers.AddVirtualAttributeHandler">
- <activeWhen>
- <and>
- <with variable="activePartId">
- <equals value="org.eclipse.jpt.ui.jpaStructureView"/>
- </with>
- <with variable="selection">
- <count value="1"/>
- <iterate operator="and">
- <instanceof value="org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType"/>
- <test property="org.eclipse.jpt.jpa.core.isCompatibleVersion" value="&apos;2.1&apos;"/>
- </iterate>
- </with>
- </and>
- </activeWhen>
- </handler>
-
- <handler
- commandId="org.eclipse.jpt.jpa.eclipselink.ui.convertJavaConverters"
- class="org.eclipse.jpt.jpa.eclipselink.ui.internal.commands.JavaConverterConversionHandler">
- </handler>
-
- <handler
- commandId="org.eclipse.jpt.jpa.eclipselink.ui.generateDynamicEntities"
- class="org.eclipse.jpt.jpa.eclipselink.ui.internal.commands.GenerateDynamicEntitiesHandler">
- </handler>
-
- </extension>
-
-
- <!-- ***** menus ***** -->
-
- <extension
- point="org.eclipse.ui.menus">
-
- <!-- contributions to the "JPA Tools" submenu -->
- <menuContribution
- locationURI="popup:org.eclipse.jpt.jpa.ui.menu.JpaTools?after=generate">
-
- <command
- commandId="org.eclipse.jpt.jpa.eclipselink.ui.generateDynamicEntities">
- <visibleWhen>
- <with
- variable="selection">
- <and>
- <count value="1"/>
- <iterate>
- <and>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"/>
- </adapt>
- <adapt type="org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription">
- <test
- property="org.eclipse.jpt.jpa.core.jpaPlatformGroup"
- value="eclipselink"/>
- </adapt>
- </and>
- </iterate>
- </and>
- </with>
- </visibleWhen>
- </command>
-
- </menuContribution>
-
- <!-- contributions to objects in the JPA structure view -->
- <menuContribution
- locationURI="popup:org.eclipse.jpt.ui.jpaStructureView">
-
- <command
- commandId="org.eclipse.jpt.jpa.eclipselink.ui.persistentTypeAddVirtualAttribute">
- <visibleWhen>
- <with variable="selection">
- <count value="1"/>
- <iterate operator="and">
- <instanceof value="org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType"/>
- <test property="org.eclipse.jpt.jpa.core.isCompatibleVersion" value="&apos;2.1&apos;"/>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- </menuContribution>
-
- </extension>
-
- <extension
- point="org.eclipse.ui.menus">
-
- <!-- contributions to "Move to XML" submenu-->
- <menuContribution
- locationURI="popup:org.eclipse.jpt.jpa.ui.menu.moveToXml">
-
- <command
- commandId="org.eclipse.jpt.jpa.eclipselink.ui.convertJavaConverters">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- ifEmpty="false"
- operator="and">
- <adapt
- type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"/>
- </adapt>
- <adapt type = "org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription">
- <test
- property="org.eclipse.jpt.jpa.core.jpaPlatformGroup"
- value="eclipselink"/>
- </adapt>
- </iterate>
- </with>
- </visibleWhen>
- </command>
-
- </menuContribution>
-
- </extension>
-
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui.properties
deleted file mode 100644
index afe60d3098..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui.properties
+++ /dev/null
@@ -1,409 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-MappingFileWizard_title=New EclipseLink Mapping File
-MappingFileWizardPage_newFile_title=EclipseLink mapping file
-MappingFileWizardPage_newFile_desc=Specify EclipseLink mapping file name and location
-MappingFileWizardPage_options_title=EclipseLink mapping file
-MappingFileWizardPage_options_desc=Specify EclipseLink mapping file options
-
-PersistenceXmlGeneralTab_name = Name:
-PersistenceXmlGeneralTab_provider = Provider:
-PersistenceXmlGeneralTab_browse = Browse...
-PersistenceXmlGeneralTab_description = Description:
-
-# General
-PersistenceXmlGeneralTab_title = General
-PersistenceXmlGeneralTab_generalSectionTitle = General
-PersistenceXmlGeneralTab_mappedClassesSectionTitle = Managed Classes
-PersistenceXmlGeneralTab_mappedClassesSectionDescription=Specify the list of classes to be managed in this persistence unit.
-PersistenceXmlGeneralTab_xmlMappingFilesSectionTitle = XML Mapping Files
-PersistenceXmlGeneralTab_xmlMappingFilesSectionDescription=Specify the XML mapping files for this persistence unit.
-
-PersistenceXmlGeneralTab_nameLabel = Name:
-PersistenceXmlGeneralTab_persistenceProviderLabel = Persistence Provider:
-PersistenceXmlGeneralTab_descriptionLabel = Description:
-
-PersistenceXmlGeneralTab_excludeUnlistedMappedClasses=Exclude unlisted classes
-PersistenceXmlGeneralTab_excludeUnlistedMappedClassesWithDefault=Exclude unlisted classes ({0})
-PersistenceXmlGeneralTab_mappedClassesNoName=<name not set>
-PersistenceXmlGeneralTab_open=Open
-
-PersistenceXmlGeneralTab_xmlMappingFilesDialog_title=JPA XML Mapping File Selection
-PersistenceXmlGeneralTab_xmlMappingFilesDialog_message=Choose the XML mapping files to be added to the persistence unit.
-PersistenceXmlGeneralTab_ormNoName=<name not set>
-PersistenceXmlGeneralTab_excludeEclipselinkOrm=Exclude unlisted EclipseLink XML mapping file
-PersistenceXmlGeneralTab_excludeEclipselinkOrmWithDefault=Exclude unlisted EclipseLink XML mapping file ({0})
-
-# Connection
-PersistenceXmlConnectionTab_title = Connection
-PersistenceXmlConnectionTab_sectionTitle = Persistence Unit Connection
-PersistenceXmlConnectionTab_sectionDescription = Configure the data source or JDBC connection properties.
-
-PersistenceXmlConnectionTab_transactionTypeLabel = Transaction type:
-
-TransactionTypeComposite_jta = JTA
-TransactionTypeComposite_resource_local = Resource Local
-
-PersistenceXmlConnectionTab_nativeSqlLabel = Native SQL
-PersistenceXmlConnectionTab_nativeSqlLabelDefault = Native SQL ({0})
-
-PersistenceXmlConnectionTab_batchWritingLabel = Batch writing:
-
-BatchWritingComposite_none = None
-BatchWritingComposite_jdbc = JDBC
-BatchWritingComposite_buffered = Buffered
-BatchWritingComposite_oracle_jdbc = Oracle JDBC
-
-PersistenceXmlConnectionTab_cacheStatementsLabel = Statement caching:
-
-PersistenceXmlConnectionTab_jtaDataSourceLabel = JTA data source:
-PersistenceXmlConnectionTab_nonJtaDataSourceLabel = Non-JTA data source:
-
-PersistenceXmlConnectionTab_driverLabel = Driver:
-PersistenceXmlConnectionTab_urlLabel = URL:
-PersistenceXmlConnectionTab_userLabel = User:
-PersistenceXmlConnectionTab_passwordLabel = Password:
-PersistenceXmlConnectionTab_bindParametersLabel = Bind parameters
-PersistenceXmlConnectionTab_bindParametersLabelDefault = Bind parameters ({0})
-
-PersistenceXmlConnectionTab_readConnectionsSharedLabel = Shared
-PersistenceXmlConnectionTab_readConnectionsSharedLabelDefault = Shared ({0})
-PersistenceXmlConnectionTab_readConnectionsSectionTitle = Read Connection
-PersistenceXmlConnectionTab_readConnectionsMinLabel = Minimum:
-PersistenceXmlConnectionTab_readConnectionsMaxLabel = Maximum:
-PersistenceXmlConnectionTab_writeConnectionsSectionTitle = Write Connection
-PersistenceXmlConnectionTab_writeConnectionsMinLabel = Minimum:
-PersistenceXmlConnectionTab_writeConnectionsMaxLabel = Maximum:
-
-ConnectionPropertiesComposite_Database_GroupBox = Database
-
-JdbcPropertiesComposite_EclipseLinkConnectionPool_GroupBox = EclipseLink connection pool
-
-JdbcConnectionPropertiesComposite_ConnectionDialog_Message = &Enter connection name or pattern (*, ?, or camel case):
-JdbcConnectionPropertiesComposite_ConnectionDialog_Title = Connection Selection
-
-JdbcExclusiveConnectionsPropertiesComposite_GroupBox = Exclusive connections
-
-PersistenceXmlConnectionTab_exclusiveConnectionModeLabel = Exclusive connection mode:
-
-JdbcExclusiveConnectionModeComposite_always = Always
-JdbcExclusiveConnectionModeComposite_isolated = Isolated
-JdbcExclusiveConnectionModeComposite_transactional = Transactional
-
-PersistenceXmlConnectionTab_lazyConnectionLabel = Lazy connection acquisition
-PersistenceXmlConnectionTab_lazyConnectionLabelDefault = Lazy connection acquisition ({0})
-
-# SchemaGeneration
-PersistenceXmlSchemaGenerationTab_title = Schema Generation
-PersistenceXmlSchemaGenerationTab_sectionTitle = Persistence Unit Schema Generation
-PersistenceXmlSchemaGenerationTab_sectionDescription = Configure the EclipseLink schema generation properties.
-
-PersistenceXmlSchemaGenerationTab_defaultDot = Default (.)
-
-PersistenceXmlSchemaGenerationTab_ddlGenerationTypeLabel = DDL generation type:
-PersistenceXmlSchemaGenerationTab_outputModeLabel = Output mode:
-PersistenceXmlSchemaGenerationTab_createDdlFileNameLabel = Create DDL file name:
-PersistenceXmlSchemaGenerationTab_dropDdlFileNameLabel = Drop DDL file name:
-
-OutputModeComposite_both = Both
-OutputModeComposite_sql_script = Sql-script
-OutputModeComposite_database = Database
-
-DdlGenerationTypeComposite_none = None
-DdlGenerationTypeComposite_create_tables = Create Tables
-DdlGenerationTypeComposite_drop_and_create_tables = Drop and Create Tables
-
-PersistenceXmlSchemaGenerationTab_ddlGenerationLocationLabel = DDL generation location:
-
-DdlGenerationLocationComposite_dialogTitle = Generation Location
-DdlGenerationLocationComposite_dialogMessage = Choose a folder for the generated DDL files:
-
-# Caching
-PersistenceXmlCachingTab_title = Caching
-PersistenceXmlCachingTab_sectionTitle = Persistence Unit Caching
-PersistenceXmlCachingTab_sectionDescription = Configure the session or entity specific EclipseLink caching properties.
-
-CacheDefaultsComposite_groupTitle = Defaults
-
-PersistenceXmlCachingTab_defaultCacheTypeLabel = Default cache type:
-PersistenceXmlCachingTab_cacheTypeLabel = Cache type:
-
-PersistenceXmlCachingTab_defaultSharedCacheLabel = Shared cache ({0})
-PersistenceXmlCachingTab_sharedCacheLabel = Shared cache
-
-PersistenceXmlCachingTab_defaultSharedCacheDefaultLabel = Default shared cache ({0})
-PersistenceXmlCachingTab_sharedCacheDefaultLabel = Default shared cache
-
-CacheSizeComposite_cacheSize=Cache size:
-
-CacheTypeComposite_full = Full
-CacheTypeComposite_hard_weak = Weak with Hard Subcache
-CacheTypeComposite_none = None
-CacheTypeComposite_soft = Soft
-CacheTypeComposite_soft_weak = Weak with Soft Subcache
-CacheTypeComposite_weak = Weak
-
-DefaultCacheSizeComposite_defaultCacheSize=Default cache size:
-
-DefaultCacheTypeComposite_full = Full
-DefaultCacheTypeComposite_hard_weak = Weak With Hard Subcache
-DefaultCacheTypeComposite_none = None
-DefaultCacheTypeComposite_soft = Soft
-DefaultCacheTypeComposite_soft_weak = Weak with Soft Subcache
-DefaultCacheTypeComposite_weak = Weak
-
-EntityDialog_selectEntity = Select an Entity
-EntityDialog_name = Name:
-
-CachingEntityListComposite_groupTitle = Entity caching
-CachingEntityListComposite_editButton = Edit...
-
-CachingEntityListComposite_dialogMessage=&Enter type name prefix or pattern (*, ?, or camel case):
-CachingEntityListComposite_dialogTitle=Entity Selection
-
-PersistenceXmlCachingTab_FlushClearCacheLabel = Flush clear cache:
-
-FlushClearCacheComposite_drop = Drop
-FlushClearCacheComposite_drop_invalidate = Drop Invalidate
-FlushClearCacheComposite_merge = Merge
-
-# Customization
-PersistenceXmlCustomizationTab_title = Customization
-PersistenceXmlCustomizationTab_sectionTitle = Persistence Unit Customization
-PersistenceXmlCustomizationTab_sectionDescription = Set default or entity specific EclipseLink customization and validation properties.
-
-PersistenceXmlCustomizationTab_weavingPropertiesGroupBox = Weaving
-PersistenceXmlCustomizationTab_weavingLabel = Weaving:
-
-PersistenceXmlCustomizationTab_weavingLazyLabelDefault = Lazy ({0})
-PersistenceXmlCustomizationTab_weavingLazyLabel = Lazy
-
-PersistenceXmlCustomizationTab_weavingFetchGroupsLabelDefault = Fetch groups ({0})
-PersistenceXmlCustomizationTab_weavingFetchGroupsLabel = Fetch groups
-
-PersistenceXmlCustomizationTab_weavingInternalLabel = Internal
-PersistenceXmlCustomizationTab_weavingInternalLabelDefault = Internal ({0})
-
-PersistenceXmlCustomizationTab_weavingEagerLabel = Eager
-PersistenceXmlCustomizationTab_weavingEagerLabelDefault = Eager ({0})
-
-PersistenceXmlCustomizationTab_weavingChangeTrackingLabelDefault = Change tracking ({0})
-PersistenceXmlCustomizationTab_weavingChangeTrackingLabel = Change tracking
-
-PersistenceXmlCustomizationTab_validationOnlyLabel = Validation only
-PersistenceXmlCustomizationTab_validationOnlyLabelDefault = Validation only ({0})
-
-PersistenceXmlCustomizationTab_validateSchemaLabel = Mapping files schema validation
-PersistenceXmlCustomizationTab_validateSchemaLabelDefault = Mapping files schema validation ({0})
-
-PersistenceXmlCustomizationTab_throwExceptionsLabelDefault = Throw exceptions ({0})
-PersistenceXmlCustomizationTab_throwExceptionsLabel = Throw exceptions
-
-PersistenceXmlCustomizationTab_exceptionHandlerLabel = Exception handler:
-
-WeavingComposite_true_ = Weave Dynamically
-WeavingComposite_false_ = No Weaving
-WeavingComposite_static_ = Weave Statically
-
-CustomizationEntityListComposite_groupTitle = Descriptor customizers
-CustomizationEntityListComposite_editButton = Edit...
-
-CustomizationEntityListComposite_dialogMessage=&Enter type name prefix or pattern (*, ?, or camel case):
-CustomizationEntityListComposite_dialogTitle=Entity Selection
-
-PersistenceXmlCustomizationTab_customizerLabel = Customizer:
-PersistenceXmlCustomizationTab_sessionCustomizerLabel = Session customizers
-
-PersistenceXmlCustomizationTab_noName=<name not set>
-
-PersistenceXmlCustomizationTab_profilerLabel = Profiler:
-PersistenceXmlCustomizationTab_browse = Browse...
-
-ProfilerComposite_performance_profiler = Performance Profiler
-ProfilerComposite_query_monitor = Query Monitor
-ProfilerComposite_no_profiler = No Profiler
-
-# Logging
-PersistenceXmlLoggingTab_title = Logging
-PersistenceXmlLoggingTab_sectionTitle = Persistence Unit Logging
-PersistenceXmlLoggingTab_sectionDescription = Configure the EclipseLink logging properties.
-PersistenceXmlLoggingTab_defaultStdout = Default (stdout)
-
-PersistenceXmlLoggingTab_categoryLoggingLevelSectionTitle = Logging Categories
-PersistenceXmlLoggingTab_loggingLevelLabel = Logging level:
-
-PersistenceXmlLoggingTab_sqlLoggingLevelLabel = SQL:
-PersistenceXmlLoggingTab_transactionLoggingLevelLabel = Transaction:
-PersistenceXmlLoggingTab_eventLoggingLevelLabel = Event:
-PersistenceXmlLoggingTab_connectionLoggingLevelLabel = Connection:
-PersistenceXmlLoggingTab_queryLoggingLevelLabel = Query:
-PersistenceXmlLoggingTab_cacheLoggingLevelLabel = Cache:
-PersistenceXmlLoggingTab_propagationLoggingLevelLabel = Propagation:
-PersistenceXmlLoggingTab_sequencingLoggingLevelLabel = Sequencing:
-PersistenceXmlLoggingTab_ejbLoggingLevelLabel = EJB:
-PersistenceXmlLoggingTab_dmsLoggingLevelLabel = DMS:
-PersistenceXmlLoggingTab_ejb_or_metadataLoggingLevelLabel = EJB or metadata:
-PersistenceXmlLoggingTab_jpa_metamodelLoggingLevelLabel = JPA metamodel:
- PersistenceXmlLoggingTab_weaverLoggingLevelLabel = Weaving:
-PersistenceXmlLoggingTab_propertiesLoggingLevelLabel = Properties:
-PersistenceXmlLoggingTab_serverLoggingLevelLabel = Server:
-
-LoggingLevelComposite_off = Off
-LoggingLevelComposite_severe = Severe
-LoggingLevelComposite_warning = Warning
-LoggingLevelComposite_info = Info
-LoggingLevelComposite_config = Config
-LoggingLevelComposite_fine = Fine
-LoggingLevelComposite_finer = Finer
-LoggingLevelComposite_finest = Finest
-LoggingLevelComposite_all = All
-
-EclipseLinkCategoryLoggingLevelComposite_off = Off
-EclipseLinkCategoryLoggingLevelComposite_severe = Severe
-EclipseLinkCategoryLoggingLevelComposite_warning = Warning
-EclipseLinkCategoryLoggingLevelComposite_info = Info
-EclipseLinkCategoryLoggingLevelComposite_config = Config
-EclipseLinkCategoryLoggingLevelComposite_fine = Fine
-EclipseLinkCategoryLoggingLevelComposite_finer = Finer
-EclipseLinkCategoryLoggingLevelComposite_finest = Finest
-EclipseLinkCategoryLoggingLevelComposite_all = All
-
-PersistenceXmlLoggingTab_loggerLabel = Logger:
-PersistenceXmlLoggingTab_browse = Browse...
-LoggerComposite_default_logger = Default Logger
-LoggerComposite_java_logger = Java Logger
-LoggerComposite_server_logger = Server Logger
-
-PersistenceXmlLoggingTab_timestampLabel = Timestamp
-PersistenceXmlLoggingTab_timestampLabelDefault = Timestamp ({0})
-PersistenceXmlLoggingTab_threadLabel = Thread
-PersistenceXmlLoggingTab_threadLabelDefault = Thread ({0})
-PersistenceXmlLoggingTab_sessionLabel = Session
-PersistenceXmlLoggingTab_sessionLabelDefault = Session ({0})
-PersistenceXmlLoggingTab_exceptionsLabel = Exceptions
-PersistenceXmlLoggingTab_exceptionsLabelDefault = Exceptions ({0})
-PersistenceXmlLoggingTab_connectionLabel = Connection
-PersistenceXmlLoggingTab_connectionLabelDefault = Connection ({0})
-
-PersistenceXmlLoggingTab_loggersLabel = Loggers:
-
-PersistenceXmlLoggingTab_loggingFileLabel = Log file:
-
-LoggingFileLocationComposite_dialogTitle = Choose a log file
-
-# Options
-PersistenceXmlOptionsTab_title = Options
-PersistenceXmlOptionsTab_sessionSectionTitle = EclipseLink Session Options
-PersistenceXmlOptionsTab_sessionSectionDescription = Configure the EclipseLink session options.
-
-PersistenceXmlOptionsTab_sessionName = Session name:
-PersistenceXmlOptionsTab_sessionsXml = Sessions XML:
-
-PersistenceXmlOptionsTab_includeDescriptorQueriesLabel = Include descriptor queries
-PersistenceXmlOptionsTab_includeDescriptorQueriesLabelDefault = Include descriptor queries ({0})
-
-PersistenceXmlOptionsTab_eventListenerLabel = Event listener:
-PersistenceXmlOptionsTab_targetDatabaseLabel = Target database:
-
-PersistenceXmlOptionsTab_miscellaneousSectionTitle = Miscellaneous Options
-PersistenceXmlOptionsTab_miscellaneousSectionDescription = Configure the miscellaneous options.
-
-PersistenceXmlOptionsTab_temporalMutableLabel = Temporal mutable
-PersistenceXmlOptionsTab_temporalMutableLabelDefault = Temporal mutable ({0})
-
-PersistenceXmlOptionsTab_noName=<name not set>
-
-TargetDatabaseComposite_attunity = Attunity
-TargetDatabaseComposite_auto = Auto
-TargetDatabaseComposite_cloudscape = Cloudscape
-TargetDatabaseComposite_database = Database
-TargetDatabaseComposite_db2 = DB2
-TargetDatabaseComposite_db2mainframe = DB2Mainframe
-TargetDatabaseComposite_dbase = DBase
-TargetDatabaseComposite_derby = Derby
-TargetDatabaseComposite_hsql = HSQL
-TargetDatabaseComposite_informix = Informix
-TargetDatabaseComposite_javadb = JavaDB
-TargetDatabaseComposite_maxdb = MaxDB
-TargetDatabaseComposite_mysql = MySQL
-TargetDatabaseComposite_oracle = Oracle
-TargetDatabaseComposite_oracle11 = Oracle11
-TargetDatabaseComposite_oracle10 = Oracle10g
-TargetDatabaseComposite_oracle9 = Oracle9i
-TargetDatabaseComposite_oracle8 = Oracle8i
-TargetDatabaseComposite_pointbase = PointBase
-TargetDatabaseComposite_postgresql = PostgreSQL
-TargetDatabaseComposite_sqlanywhere = SQLAnywhere
-TargetDatabaseComposite_sqlserver = SQLServer
-TargetDatabaseComposite_sybase = Sybase
-TargetDatabaseComposite_symfoware = Symfoware
-TargetDatabaseComposite_timesten = TimesTen
-
-PersistenceXmlOptionsTab_targetServerLabel = Target server:
-
-TargetServerComposite_none = None
-TargetServerComposite_oc4j = OC4J
-TargetServerComposite_sunas9 = SunAS9
-TargetServerComposite_websphere = WebSphere
-TargetServerComposite_websphere_6_1 = WebSphere 6.1
-TargetServerComposite_websphere_7 = WebSphere 7
-TargetServerComposite_weblogic = WebLogic
-TargetServerComposite_weblogic_9 = WebLogic 9
-TargetServerComposite_weblogic_10 = WebLogic 10
-TargetServerComposite_jboss = JBoss
-TargetServerComposite_netweaver_7_1 = SAP NetWeaver 7.1
-
-# DDLGeneration
-EclipseLinkDDLGeneratorUi_generatingDDLWarningTitle = Generating Tables
-EclipseLinkDDLGeneratorUi_generatingDDLWarningMessage = Warning: Generating tables will DROP existing tables and{0}CREATE new tables based on the Entities in your project.{1}Are you sure you want to continue?
-EclipseLinkDDLGeneratorUi_error = Error
-ECLIPSELINK_GENERATE_TABLES_JOB = Generating Tables from Entities
-ECLIPSELINK_GENERATE_TABLES_TASK = Generating
-
-GenerationOutputModeWizardPage_title = Schema Generation
-GenerationOutputModeWizardPage_desc = Select DDL generation action
-GenerationOutputModeWizardPage_generationOutputMode = Generation Output Mode
-
-# MetadataConversion
-JavaMetadataConversion_noConvertersToConvert=No Java converters to convert
-JavaConverterConversionWizardPage_title = Java Converter Metadata Conversion
-JavaConverterConversionWizardPage_description = Move all the annotated JPA converters to XML as mapping file level metadata
-JavaMetadataConversion_equivalentConvertersWarningTitle=Equivalent Converters Found
-JavaMetadataConversion_equivalentConvertersWarningMessage=Warning: Equivalent converters are found. Only one of these converters will be converted while the rest will be deleted. Do you want to continue?
-JavaMetadataConversion_equivalentGeneratorsWarningTitle=Equivalent Generators Found
-JavaMetadataConversion_equivalentGeneratorsWarningMessage=Warning: Equivalent generators are found. Only one of these generators will be converted while the rest will be deleted. Do you want to continue?
-JavaMetadataConversion_equivalentQueriesWarningTitle=Equivalent Queries Found
-JavaMetadataConversion_equivalentQueriesWarningMessage=Warning: Equivalent queries are found. Only one of these queries will be converted while the rest will be deleted. Do you want to continue?
-
-# Static Weaving
-EclipselinkPreferencePage_description = Configure EclipseLink specific preferences for the project:
-EclipselinkPreferencePage_staticWeavingGroupBox = Static weaving
-EclipselinkPreferencePage_weaveClassesOnBuildLabel = Weave classes on build
-EclipselinkPreferencePage_sourceLabel = Source classes:
-EclipselinkPreferencePage_selectSourceLabel = Select Source Classes
-EclipselinkPreferencePage_sourceFolderSelectionLabel = Source classes folder selection
-EclipselinkPreferencePage_targetLabel = Target classes:
-EclipselinkPreferencePage_selectTargetLabel = Select Target Classes
-EclipselinkPreferencePage_targetFolderSelectionLabel = Target classes folder selection
-EclipselinkPreferencePage_persistenceInfoLabel = Persistence XML Root (optional):
-EclipselinkPreferencePage_selectPersistenceInfoLabel = Select Persistence XML Root
-EclipselinkPreferencePage_persistenceInfoFolderSelectionLabel = Persistence XML root folder selection
-EclipselinkPreferencePage_logLevelLabel = Log level:
-EclipselinkPreferencePage_browse = Browse...
-
-# Add Virtual Attribute
-AddVirtualAttributeDialog_title=Add Virtual Attribute
-AddVirtualAttributeDialog_nameLabel=Name:
-AddVirtualAttributeDialog_mappingLabel=Map as:
-AddVirtualAttributeDialog_attributeTypeLabel=Attribute type:
-AddVirtualAttributeDialog_noMappingKeyError=You must specify a mapping type
-AddVirtualAttributeDialog_noNameError=You must specify a name
-AddVirtualAttributeDialog_noAttributeTypeError=You must specify an attribute type
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_details.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_details.properties
deleted file mode 100644
index 28b41f7c90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_details.properties
+++ /dev/null
@@ -1,171 +0,0 @@
-################################################################################
-# Copyright (c) 2008, 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-EclipseLinkBasicCollectionMappingUiProvider_label = Basic Collection
-EclipseLinkBasicCollectionMappingUiProvider_linkLabel = basic collection
-
-EclipseLinkBasicMapMappingUiProvider_label = Basic Map
-EclipseLinkBasicMapMappingUiProvider_linkLabel = basic map
-
-EclipseLinkTransformationMappingUiProvider_label = Transformation
-EclipseLinkTransformationMappingUiProvider_linkLabel = transformation
-
-EclipseLinkVariableOneToOneMappingUiProvider_label = Variable One to One
-EclipseLinkVariableOneToOneMappingUiProvider_linkLabel = variable one to one
-
-EclipseLinkCacheTypeComposite_label = Type:
-EclipseLinkCacheTypeComposite_full = Full
-EclipseLinkCacheTypeComposite_weak = Weak
-EclipseLinkCacheTypeComposite_soft = Soft
-EclipseLinkCacheTypeComposite_soft_weak = Weak with Soft Subcache
-EclipseLinkCacheTypeComposite_hard_weak = Weak with Hard Subcache
-EclipseLinkCacheTypeComposite_cache = Cache
-EclipseLinkCacheTypeComposite_none = None
-
-EclipseLinkCacheSizeComposite_size = Size:
-
-EclipseLinkCacheCoordinationTypeComposite_label = Coordination type:
-EclipseLinkCacheCoordinationTypeComposite_send_object_changes = Send Object Changes
-EclipseLinkCacheCoordinationTypeComposite_invalidate_changed_objects = Invalidate Changed Objects
-EclipseLinkCacheCoordinationTypeComposite_send_new_objects_with_changes = Send New Objects with Changes
-EclipseLinkCacheCoordinationTypeComposite_none = None
-
-EclipseLinkCachingComposite_sharedLabelDefault = Shared ({0})
-EclipseLinkCachingComposite_sharedLabel = Shared
-EclipseLinkCachingComposite_advanced = Advanced
-
-EclipseLinkChangeTrackingComposite_label = Change tracking:
-EclipseLinkChangeTrackingComposite_attribute = Attribute
-EclipseLinkChangeTrackingComposite_object = Object
-EclipseLinkChangeTrackingComposite_deferred = Deferred
-EclipseLinkChangeTrackingComposite_auto = Auto
-
-EclipseLinkConvertComposite_converterNameLabel = Converter name:
-
-EclipseLinkConverterComposite_nameTextLabel = Name:
-EclipseLinkConverterComposite_classLabel = Class:
-
-EclipseLinkCustomizerComposite_classLabel = Customizer class:
-
-EclipseLinkConvertersComposite_customConverter = Custom
-EclipseLinkConvertersComposite_objectTypeConverter = Object type
-EclipseLinkConvertersComposite_structConverter = Struct
-EclipseLinkConvertersComposite_typeConverter = Type
-
-EclipseLinkAlwaysRefreshComposite_alwaysRefreshDefault = Always refresh ({0})
-EclipseLinkAlwaysRefreshComposite_alwaysRefreshLabel = Always refresh
-EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerDefault = Refresh only if newer ({0})
-EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerLabel = Refresh only if newer
-EclipseLinkDisableHitsComposite_disableHitsDefault = Disable hits ({0})
-EclipseLinkDisableHitsComposite_disableHitsLabel = Disable hits
-
-TypeSection_converted = Converted
-
-EclipseLinkTypeMappingComposite_advanced = Advanced
-EclipseLinkTypeMappingComposite_caching = Caching
-EclipseLinkTypeMappingComposite_converters = Converters
-EclipseLinkTypeMappingComposite_multitenancy = Multitenancy
-
-EclipseLinkExistenceCheckingComposite_label = Existence checking:
-EclipseLinkExistenceCheckingComposite_check_cache = Check Cache
-EclipseLinkExistenceCheckingComposite_check_database = Check Cache then Database
-EclipseLinkExistenceCheckingComposite_assume_existence = Assume Existence
-EclipseLinkExistenceCheckingComposite_assume_non_existence = Assume Non-Existence
-
-EclipseLinkExpiryComposite_expirySection = Expiry
-
-EclipseLinkExpiryComposite_noExpiry = No expiry
-EclipseLinkExpiryComposite_timeToLiveExpiry = Time to live expiry
-EclipseLinkExpiryComposite_timeToLiveExpiryExpireAfter = Expire after
-EclipseLinkExpiryComposite_timeToLiveExpiryMilliseconds = milliseconds
-EclipseLinkExpiryComposite_dailyExpiry = Daily expiry
-EclipseLinkExpiryComposite_timeOfDayExpiryExpireAt = Expire at
-
-
-EclipseLinkJoinFetchComposite_label = Join fetch:
-EclipseLinkJoinFetchComposite_inner = Inner
-EclipseLinkJoinFetchComposite_outer = Outer
-
-EclipseLinkMutableComposite_mutableLabel=Mutable
-EclipseLinkMutableComposite_mutableLabelDefault=Mutable ({0})
-EclipseLinkMutableComposite_true=True
-EclipseLinkMutableComposite_false=False
-
-EclipseLinkObjectTypeConverterComposite_dataTypeLabel = Data type:
-EclipseLinkObjectTypeConverterComposite_objectTypeLabel = Object type:
-EclipseLinkObjectTypeConverterComposite_conversionValueEdit = Edit...
-EclipseLinkObjectTypeConverterComposite_conversionValuesDataValueColumn = Data Value
-EclipseLinkObjectTypeConverterComposite_conversionValuesObjectValueColumn = Object Value
-EclipseLinkObjectTypeConverterComposite_defaultObjectValueLabel = Default object value:
-EclipseLinkObjectTypeConverterComposite_conversionValuesGroupTitle = Conversion values
-EclipseLinkConversionValueDialog_addConversionValue = Add Conversion Value
-EclipseLinkConversionValueDialog_editConversionValue = Edit Conversion Value
-EclipseLinkConversionValueDialog_addConversionValueDescriptionTitle = Create new conversion value
-EclipseLinkConversionValueDialog_addConversionValueDescription = Create a new conversion value setting both the 'data value' and the 'object value'
-EclipseLinkConversionValueDialog_editConversionValueDescriptionTitle = Edit conversion value
-EclipseLinkConversionValueDialog_editConversionValueDescription = Edit the conversion value, changing the 'data value' or 'object value'
-
-EclipseLinkConversionValueDialog_dataValue = Data value:
-EclipseLinkConversionValueDialog_objectValue = Object value:
-EclipseLinkConversionValueStateObject_dataValueMustBeSpecified = A data value must be specified.
-EclipseLinkConversionValueStateObject_objectValueMustBeSpecified = An object value must be specified.
-EclipseLinkConversionValueStateObject_dataValueAlreadyExists = This data value is already specified, cannot map multiple object values to the same data value.
-
-
-EclipseLinkPrivateOwnedComposite_privateOwnedLabel = Private owned
-EclipseLinkReadOnlyComposite_readOnlyLabel = Read-only
-EclipseLinkReadOnlyComposite_readOnlyWithDefault = Read-only ({0})
-EclipseLinkTypeConverterComposite_dataTypeLabel = Data type:
-EclipseLinkTypeConverterComposite_objectTypeLabel = Object type:
-
-DefaultEclipseLinkOneToOneMappingUiProvider_label=Default (One to One)
-DefaultEclipseLinkVariableOneToOneMappingUiProvider_label=Default (Variable One to One)
-DefaultEclipseLinkOneToManyMappingUiProvider_label=Default (One to Many)
-DefaultEclipseLinkOneToOneMappingUiProvider_linkLabel=default (one to one)
-DefaultEclipseLinkVariableOneToOneMappingUiProvider_linkLabel=default (variable one to one)
-DefaultEclipseLinkOneToManyMappingUiProvider_linkLabel=default (one to many)
-
-
-EclipseLinkConverterDialog_name=Name:
-EclipseLinkConverterDialog_converterType=Type:
-EclipseLinkConverterDialog_addConverter=Add Converter
-EclipseLinkConverterDialog_addConverterDescriptionTitle=Create new converter
-EclipseLinkConverterDialog_addConverterDescription=Create a new converter setting both the 'name' and the 'type'
-EclipseLinkConverterStateObject_nameExists =The given name already exists. This converter may override the existing one(s) with the same name.
-EclipseLinkConverterStateObject_nameIsReserved = The given name is a reserved name
-EclipseLinkConverterStateObject_nameMustBeSpecified = A name must be specified.
-EclipseLinkConverterStateObject_typeMustBeSpecified = A converter type must be specified.
-
-EclipseLinkMappedSuperclassComposite_queries=Queries
-
-TenantDiscriminatorColumns_groupLabel=Tenant discriminator columns
-TenantDiscriminatorColumnComposite_nameLabel=Name:
-TenantDiscriminatorColumnComposite_defaultTenantDiscriminatorColumnNameLabel=Default ({0})
-TenantDiscriminatorColumnComposite_tableLabel=Table:
-TenantDiscriminatorColumnComposite_contextPropertyLabel=Context property:
-TenantDiscriminatorColumnComposite_discriminatorTypeLabel=Discriminator type:
-TenantDiscriminatorColumnComposite_lengthLabel=Length:
-TenantDiscriminatorColumnComposite_columnDefinitionLabel=Column definition:
-TenantDiscriminatorColumnComposite_primaryKeyWithDefault=Primary key ({0})
-TenantDiscriminatorColumnComposite_primaryKey=Primary key
-
-EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite_collapsibleSection=Tenant Discriminator Columns
-EclipseLinkMultitenancy_overrideDefaultTenantDiscriminatorColumns=Override default
-
-EclipseLinkMultitenancyComposite_strategy=Multitenant strategy:
-EclipseLinkMultitenancyComposite_single_table=Single Table
-EclipseLinkMultitenancyComposite_table_per_tenant=Table Per Tenant
-EclipseLinkMultitenancyComposite_vpd=VPD
-EclipseLinkMultitenancyComposite_includeCriteria=Include criteria
-EclipseLinkMultitenancyComposite_includeCriteriaWithDefault=Include criteria ({0})
-
-EclipseLinkConvertersComposite_maxConvertersErrorMessage=Maximum number of converters supported on this element is {0}.
-
-OrmAttributeTypeComposite_attributeType=Attribute type:
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_dynamic_entity_gen.properties b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_dynamic_entity_gen.properties
deleted file mode 100644
index b2eac7d4c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/property_files/eclipselink_ui_dynamic_entity_gen.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-###############################################################################
-# Copyright (c) 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-
-GenerateDynamicEntitiesWizard_generateEntities=Generate Dynamic Entities
-GenerateDynamicEntitiesWizard_defaultTablePage_domainJavaClass=Dynamic class defaults
-GenerateDynamicEntitiesWizard_defaultTablePage_xmlMappingFile=XML Mapping File:
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/JptJpaEclipseLinkUiPlugin.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/JptJpaEclipseLinkUiPlugin.java
deleted file mode 100644
index 4cd3365542..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/JptJpaEclipseLinkUiPlugin.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-/**
- * The activator class controls the plug-in life cycle
- *
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public class JptJpaEclipseLinkUiPlugin extends AbstractUIPlugin
-{
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.eclipselink.ui";
-
-
- // ********** singleton **********
- private static JptJpaEclipseLinkUiPlugin INSTANCE;
-
- /**
- * Returns the singleton Plugin
- */
- public static JptJpaEclipseLinkUiPlugin instance() {
- return INSTANCE;
- }
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(msg, null);
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(throwable.getLocalizedMessage(), throwable);
- }
-
- /**
- * Log the specified message and exception or error.
- */
- public static void log(String msg, Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, throwable));
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
-
- // ********** Image API **********
- /**
- * This gets a .gif from the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if (! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if (! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * This returns an image for a .gif from the icons folder
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
-
- // ********** constructors **********
- public JptJpaEclipseLinkUiPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/EclipseLinkHelpContextIds.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/EclipseLinkHelpContextIds.java
deleted file mode 100644
index 2db3d045aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/EclipseLinkHelpContextIds.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal;
-
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-
-/**
- * Help context ids for the Dali EclipseLink UI.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- */
-@SuppressWarnings("nls")
-public interface EclipseLinkHelpContextIds {
-
- //ContextID prefix
- public static final String PREFIX = JptJpaUiPlugin.PLUGIN_ID + ".";
-
- //Persistent Type composites
- public static final String CACHING_ALWAYS_REFRESH = PREFIX + "caching_alwaysRefresh";
- public static final String CACHING_CACHE_COORDINATION_TYPE = PREFIX + "caching_cacheCoordinationType";
- public static final String CACHING_CACHE_TYPE = PREFIX + "caching_cacheType";
- public static final String CACHING_DISABLE_HITS = PREFIX + "caching_disableHits";
- public static final String CACHING_REFRESH_ONLY_IF_NEWER = PREFIX + "caching_refreshOnlyIfNewer";
- public static final String CACHING_SHARED = PREFIX + "caching_shared";
-
- //Persistence Xml Editor
- public static final String PERSISTENCE_CACHING = PREFIX + "persistence_caching";
- public static final String PERSISTENCE_CUSTOMIZATION = PREFIX + "persistence_customization";
- public static final String PERSISTENCE_LOGGING = PREFIX + "persistence_logging";
- public static final String PERSISTENCE_OPTIONS = PREFIX + "persistence_options";
- public static final String PERSISTENCE_SCHEMA_GENERATION = PREFIX + "persistence_schemaGeneration";
-
- public static final String PERSISTENCE_CACHING_DEFAULT_SHARED = PREFIX + "caching_defaultShared";
- public static final String PERSISTENCE_CACHING_DEFAULT_SIZE = PREFIX + "caching_defaultSize";
- public static final String PERSISTENCE_CACHING_DEFAULT_TYPE = PREFIX + "caching_defaultType";
-
- public static final String PERSISTENCE_LOGGING_EXCEPTIONS = PREFIX + "logging_exceptions";
- public static final String PERSISTENCE_LOGGING_LEVEL = PREFIX + "logging_level";
- public static final String PERSISTENCE_LOGGING_SESSION = PREFIX + "logging_session";
- public static final String PERSISTENCE_LOGGING_THREAD = PREFIX + "logging_thread";
- public static final String PERSISTENCE_LOGGING_TIMESTAMP = PREFIX + "logging_timeStamp";
-
- public static final String PERSISTENCE_OPTIONS_SESSION_NAME = PREFIX + "options_sessionName";
- public static final String PERSISTENCE_OPTIONS_SESSIONS_XML = PREFIX + "options_sessionsXml";
- public static final String PERSISTENCE_OPTIONS_TARGET_DATABASE = PREFIX + "options_targetDatabase";
- public static final String PERSISTENCE_OPTIONS_TARGET_SERVER = PREFIX + "options_targetServer";
-
- public static final String MULTITENANCY_STRATEGY = PREFIX + "multitenancy_strategy";
- public static final String MULTITENANCY_INCLUDE_CRITERIA = PREFIX + "multitenancy_includeCriteria";
- public static final String MULTITENANCY_TENANT_DISCRIMINATOR_COLUMNS = PREFIX + "multitenancy_tenantDiscriminatorColumns";
- public static final String TENANT_DISCRIMINATOR_COLUMN_NAME = PREFIX + "tenantDiscriminatorColumn_name";
- public static final String TENANT_DISCRIMINATOR_COLUMN_TABLE = PREFIX + "tenantDiscriminatorColumn_table";
- public static final String TENANT_DISCRIMINATOR_COLUMN_CONTEXT_PROPERTY = PREFIX + "tenantDiscriminatorColumn_contextProperty";
- public static final String TENANT_DISCRIMINATOR_COLUMN_DISCRIMINATOR_TYPE = PREFIX + "tenantDiscriminatorColumn_discriminatorType";
- public static final String TENANT_DISCRIMINATOR_COLUMN_PRIMARY_KEY = PREFIX + "tenantDiscriminatorColumn_primaryKey";
- public static final String TENANT_DISCRIMINATOR_COLUMN_LENGTH = PREFIX + "tenantDiscriminatorColumn_length";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/EclipseLinkUiMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/EclipseLinkUiMessages.java
deleted file mode 100644
index 282c437065..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/EclipseLinkUiMessages.java
+++ /dev/null
@@ -1,424 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by ElipseLink UI.
- */
-public class EclipseLinkUiMessages {
-
- public static String MappingFileWizard_title;
- public static String MappingFileWizardPage_newFile_title;
- public static String MappingFileWizardPage_newFile_desc;
- public static String MappingFileWizardPage_options_title;
- public static String MappingFileWizardPage_options_desc;
-
- public static String PersistenceXmlGeneralTab_name;
- public static String PersistenceXmlGeneralTab_provider;
- public static String PersistenceXmlGeneralTab_browse;
- public static String PersistenceXmlGeneralTab_description;
-
- // General
- public static String PersistenceXmlGeneralTab_title;
- public static String PersistenceXmlGeneralTab_generalSectionTitle;
- public static String PersistenceXmlGeneralTab_mappedClassesSectionTitle;
- public static String PersistenceXmlGeneralTab_mappedClassesSectionDescription;
- public static String PersistenceXmlGeneralTab_xmlMappingFilesSectionTitle;
- public static String PersistenceXmlGeneralTab_xmlMappingFilesSectionDescription;
-
- public static String PersistenceXmlGeneralTab_nameLabel;
- public static String PersistenceXmlGeneralTab_persistenceProviderLabel;
- public static String PersistenceXmlGeneralTab_descriptionLabel;
-
- public static String PersistenceXmlGeneralTab_excludeUnlistedMappedClasses;
- public static String PersistenceXmlGeneralTab_excludeUnlistedMappedClassesWithDefault;
- public static String PersistenceXmlGeneralTab_mappedClassesNoName;
- public static String PersistenceXmlGeneralTab_open;
-
- public static String PersistenceXmlGeneralTab_xmlMappingFilesDialog_title;
- public static String PersistenceXmlGeneralTab_xmlMappingFilesDialog_message;
- public static String PersistenceXmlGeneralTab_ormNoName;
- public static String PersistenceXmlGeneralTab_excludeEclipselinkOrm;
- public static String PersistenceXmlGeneralTab_excludeEclipselinkOrmWithDefault;
-
- // Connection
- public static String PersistenceXmlConnectionTab_title;
- public static String PersistenceXmlConnectionTab_sectionTitle;
- public static String PersistenceXmlConnectionTab_sectionDescription;
-
- public static String PersistenceXmlConnectionTab_transactionTypeLabel;
-
- public static String ConnectionPropertiesComposite_Database_GroupBox;
-
- public static String JdbcPropertiesComposite_EclipseLinkConnectionPool_GroupBox;
-
- public static String JdbcConnectionPropertiesComposite_ConnectionDialog_Message;
- public static String JdbcConnectionPropertiesComposite_ConnectionDialog_Title;
-
- public static String TransactionTypeComposite_jta;
- public static String TransactionTypeComposite_resource_local;
-
- public static String PersistenceXmlConnectionTab_nativeSqlLabel;
- public static String PersistenceXmlConnectionTab_nativeSqlLabelDefault;
-
- public static String PersistenceXmlConnectionTab_batchWritingLabel;
-
- public static String BatchWritingComposite_none;
- public static String BatchWritingComposite_jdbc;
- public static String BatchWritingComposite_buffered;
- public static String BatchWritingComposite_oracle_jdbc;
-
- public static String PersistenceXmlConnectionTab_cacheStatementsLabel;
-
- public static String PersistenceXmlConnectionTab_jtaDataSourceLabel;
- public static String PersistenceXmlConnectionTab_nonJtaDataSourceLabel;
-
- public static String PersistenceXmlConnectionTab_driverLabel;
- public static String PersistenceXmlConnectionTab_urlLabel;
- public static String PersistenceXmlConnectionTab_userLabel;
- public static String PersistenceXmlConnectionTab_passwordLabel;
- public static String PersistenceXmlConnectionTab_bindParametersLabel;
- public static String PersistenceXmlConnectionTab_bindParametersLabelDefault;
-
- public static String PersistenceXmlConnectionTab_readConnectionsSharedLabel;
- public static String PersistenceXmlConnectionTab_readConnectionsSharedLabelDefault;
- public static String PersistenceXmlConnectionTab_readConnectionsSectionTitle;
- public static String PersistenceXmlConnectionTab_readConnectionsMinLabel;
- public static String PersistenceXmlConnectionTab_readConnectionsMaxLabel;
- public static String PersistenceXmlConnectionTab_writeConnectionsSectionTitle;
- public static String PersistenceXmlConnectionTab_writeConnectionsMinLabel;
- public static String PersistenceXmlConnectionTab_writeConnectionsMaxLabel;
-
- public static String JdbcExclusiveConnectionsPropertiesComposite_GroupBox;
-
- public static String PersistenceXmlConnectionTab_exclusiveConnectionModeLabel;
- public static String PersistenceXmlConnectionTab_lazyConnectionLabel;
- public static String PersistenceXmlConnectionTab_lazyConnectionLabelDefault;
-
- public static String JdbcExclusiveConnectionModeComposite_always;
- public static String JdbcExclusiveConnectionModeComposite_isolated;
- public static String JdbcExclusiveConnectionModeComposite_transactional;
-
- // SchemaGeneration
- public static String PersistenceXmlSchemaGenerationTab_title;
- public static String PersistenceXmlSchemaGenerationTab_sectionTitle;
- public static String PersistenceXmlSchemaGenerationTab_sectionDescription;
- public static String PersistenceXmlSchemaGenerationTab_defaultDot;
-
- public static String PersistenceXmlSchemaGenerationTab_ddlGenerationTypeLabel;
- public static String PersistenceXmlSchemaGenerationTab_outputModeLabel;
-
- public static String PersistenceXmlSchemaGenerationTab_createDdlFileNameLabel;
- public static String PersistenceXmlSchemaGenerationTab_dropDdlFileNameLabel;
-
- public static String OutputModeComposite_both;
- public static String OutputModeComposite_sql_script;
- public static String OutputModeComposite_database;
-
- public static String DdlGenerationTypeComposite_none;
- public static String DdlGenerationTypeComposite_create_tables;
- public static String DdlGenerationTypeComposite_drop_and_create_tables;
-
- public static String PersistenceXmlSchemaGenerationTab_ddlGenerationLocationLabel;
-
- public static String DdlGenerationLocationComposite_dialogTitle;
- public static String DdlGenerationLocationComposite_dialogMessage;
-
- // Caching
- public static String PersistenceXmlCachingTab_title;
- public static String PersistenceXmlCachingTab_sectionTitle;
- public static String PersistenceXmlCachingTab_sectionDescription;
-
- public static String CacheDefaultsComposite_groupTitle;
-
- public static String PersistenceXmlCachingTab_defaultCacheTypeLabel;
- public static String PersistenceXmlCachingTab_cacheTypeLabel;
-
- public static String PersistenceXmlCachingTab_defaultSharedCacheLabel;
- public static String PersistenceXmlCachingTab_sharedCacheLabel;
-
- public static String PersistenceXmlCachingTab_defaultSharedCacheDefaultLabel;
- public static String PersistenceXmlCachingTab_sharedCacheDefaultLabel;
-
- public static String CacheSizeComposite_cacheSize;
-
- public static String CacheTypeComposite_full;
- public static String CacheTypeComposite_hard_weak;
- public static String CacheTypeComposite_none;
- public static String CacheTypeComposite_soft;
- public static String CacheTypeComposite_soft_weak;
- public static String CacheTypeComposite_weak;
-
- public static String DefaultCacheSizeComposite_defaultCacheSize;
-
- public static String DefaultCacheTypeComposite_full;
- public static String DefaultCacheTypeComposite_hard_weak;
- public static String DefaultCacheTypeComposite_none;
- public static String DefaultCacheTypeComposite_soft;
- public static String DefaultCacheTypeComposite_soft_weak;
- public static String DefaultCacheTypeComposite_weak;
-
- public static String EntityDialog_selectEntity;
- public static String EntityDialog_name;
-
- public static String CachingEntityListComposite_groupTitle;
- public static String CachingEntityListComposite_editButton;
-
- public static String CachingEntityListComposite_dialogMessage;
- public static String CachingEntityListComposite_dialogTitle;
-
- public static String PersistenceXmlCachingTab_FlushClearCacheLabel;
-
- public static String FlushClearCacheComposite_drop;
- public static String FlushClearCacheComposite_drop_invalidate;
- public static String FlushClearCacheComposite_merge;
-
- // Customization
- public static String PersistenceXmlCustomizationTab_title;
- public static String PersistenceXmlCustomizationTab_sectionTitle;
- public static String PersistenceXmlCustomizationTab_sectionDescription;
-
- public static String PersistenceXmlCustomizationTab_weavingPropertiesGroupBox;
- public static String PersistenceXmlCustomizationTab_weavingLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingLazyLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingLazyLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingChangeTrackingLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingChangeTrackingLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingFetchGroupsLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingFetchGroupsLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingInternalLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingInternalLabel;
-
- public static String PersistenceXmlCustomizationTab_weavingEagerLabelDefault;
- public static String PersistenceXmlCustomizationTab_weavingEagerLabel;
-
- public static String PersistenceXmlCustomizationTab_throwExceptionsLabelDefault;
- public static String PersistenceXmlCustomizationTab_throwExceptionsLabel;
-
- public static String PersistenceXmlCustomizationTab_exceptionHandlerLabel;
-
- public static String WeavingComposite_true_;
- public static String WeavingComposite_false_;
- public static String WeavingComposite_static_;
-
- public static String CustomizationEntityListComposite_groupTitle;
- public static String CustomizationEntityListComposite_editButton;
-
- public static String CustomizationEntityListComposite_dialogMessage;
- public static String CustomizationEntityListComposite_dialogTitle;
-
- public static String PersistenceXmlCustomizationTab_customizerLabel;
- public static String PersistenceXmlCustomizationTab_sessionCustomizerLabel;
- public static String PersistenceXmlCustomizationTab_noName;
-
- public static String PersistenceXmlCustomizationTab_validationOnlyLabel;
- public static String PersistenceXmlCustomizationTab_validationOnlyLabelDefault;
-
- public static String PersistenceXmlCustomizationTab_validateSchemaLabel;
- public static String PersistenceXmlCustomizationTab_validateSchemaLabelDefault;
-
- public static String PersistenceXmlCustomizationTab_profilerLabel;
- public static String PersistenceXmlCustomizationTab_browse;
-
- public static String ProfilerComposite_performance_profiler;
- public static String ProfilerComposite_query_monitor;
- public static String ProfilerComposite_no_profiler;
-
- // Logging
- public static String PersistenceXmlLoggingTab_title;
- public static String PersistenceXmlLoggingTab_sectionTitle;
- public static String PersistenceXmlLoggingTab_sectionDescription;
- public static String PersistenceXmlLoggingTab_defaultStdout;
-
- public static String PersistenceXmlLoggingTab_categoryLoggingLevelSectionTitle;
- public static String PersistenceXmlLoggingTab_loggingLevelLabel;
- public static String PersistenceXmlLoggingTab_sqlLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_transactionLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_eventLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_connectionLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_queryLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_cacheLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_propagationLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_sequencingLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_ejbLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_dmsLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_ejb_or_metadataLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_jpa_metamodelLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_weaverLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_propertiesLoggingLevelLabel;
- public static String PersistenceXmlLoggingTab_serverLoggingLevelLabel;
-
- public static String LoggingLevelComposite_off;
- public static String LoggingLevelComposite_severe;
- public static String LoggingLevelComposite_warning;
- public static String LoggingLevelComposite_info;
- public static String LoggingLevelComposite_config;
- public static String LoggingLevelComposite_fine;
- public static String LoggingLevelComposite_finer;
- public static String LoggingLevelComposite_finest;
- public static String LoggingLevelComposite_all;
-
- public static String EclipseLinkCategoryLoggingLevelComposite_off;
- public static String EclipseLinkCategoryLoggingLevelComposite_severe;
- public static String EclipseLinkCategoryLoggingLevelComposite_warning;
- public static String EclipseLinkCategoryLoggingLevelComposite_info;
- public static String EclipseLinkCategoryLoggingLevelComposite_config;
- public static String EclipseLinkCategoryLoggingLevelComposite_fine;
- public static String EclipseLinkCategoryLoggingLevelComposite_finer;
- public static String EclipseLinkCategoryLoggingLevelComposite_finest;
- public static String EclipseLinkCategoryLoggingLevelComposite_all;
-
- public static String PersistenceXmlLoggingTab_loggerLabel;
- public static String PersistenceXmlLoggingTab_browse;
-
- public static String LoggerComposite_default_logger;
- public static String LoggerComposite_java_logger;
- public static String LoggerComposite_server_logger;
-
- public static String PersistenceXmlLoggingTab_timestampLabel;
- public static String PersistenceXmlLoggingTab_timestampLabelDefault;
- public static String PersistenceXmlLoggingTab_threadLabel;
- public static String PersistenceXmlLoggingTab_threadLabelDefault;
- public static String PersistenceXmlLoggingTab_sessionLabel;
- public static String PersistenceXmlLoggingTab_sessionLabelDefault;
- public static String PersistenceXmlLoggingTab_exceptionsLabel;
- public static String PersistenceXmlLoggingTab_exceptionsLabelDefault;
- public static String PersistenceXmlLoggingTab_connectionLabel;
- public static String PersistenceXmlLoggingTab_connectionLabelDefault;
-
- public static String PersistenceXmlLoggingTab_loggersLabel;
- public static String PersistenceXmlLoggingTab_loggingFileLabel;
-
- public static String LoggingFileLocationComposite_dialogTitle;
-
- // Session Options
- public static String PersistenceXmlOptionsTab_title;
- public static String PersistenceXmlOptionsTab_sessionSectionTitle;
- public static String PersistenceXmlOptionsTab_sessionSectionDescription;
-
- public static String PersistenceXmlOptionsTab_sessionName;
- public static String PersistenceXmlOptionsTab_sessionsXml;
-
- public static String PersistenceXmlOptionsTab_includeDescriptorQueriesLabel;
- public static String PersistenceXmlOptionsTab_includeDescriptorQueriesLabelDefault;
-
- public static String PersistenceXmlOptionsTab_eventListenerLabel;
- public static String PersistenceXmlOptionsTab_targetDatabaseLabel;
-
- public static String PersistenceXmlOptionsTab_miscellaneousSectionTitle;
- public static String PersistenceXmlOptionsTab_miscellaneousSectionDescription;
-
- public static String PersistenceXmlOptionsTab_temporalMutableLabel;
- public static String PersistenceXmlOptionsTab_temporalMutableLabelDefault;
-
- public static String TargetDatabaseComposite_attunity;
- public static String TargetDatabaseComposite_auto;
- public static String TargetDatabaseComposite_cloudscape;
- public static String TargetDatabaseComposite_database;
- public static String TargetDatabaseComposite_db2;
- public static String TargetDatabaseComposite_db2mainframe;
- public static String TargetDatabaseComposite_dbase;
- public static String TargetDatabaseComposite_derby;
- public static String TargetDatabaseComposite_hsql;
- public static String TargetDatabaseComposite_informix;
- public static String TargetDatabaseComposite_javadb;
- public static String TargetDatabaseComposite_maxdb;
- public static String TargetDatabaseComposite_mysql;
- public static String TargetDatabaseComposite_oracle;
- public static String TargetDatabaseComposite_oracle11;
- public static String TargetDatabaseComposite_oracle10;
- public static String TargetDatabaseComposite_oracle9;
- public static String TargetDatabaseComposite_oracle8;
- public static String TargetDatabaseComposite_pointbase;
- public static String TargetDatabaseComposite_postgresql;
- public static String TargetDatabaseComposite_sqlanywhere;
- public static String TargetDatabaseComposite_sqlserver;
- public static String TargetDatabaseComposite_sybase;
- public static String TargetDatabaseComposite_symfoware;
- public static String TargetDatabaseComposite_timesten;
-
- public static String PersistenceXmlOptionsTab_targetServerLabel;
- public static String PersistenceXmlOptionsTab_noName;
-
- public static String TargetServerComposite_none;
- public static String TargetServerComposite_oc4j;
- public static String TargetServerComposite_sunas9;
- public static String TargetServerComposite_websphere;
- public static String TargetServerComposite_websphere_6_1;
- public static String TargetServerComposite_websphere_7;
- public static String TargetServerComposite_weblogic;
- public static String TargetServerComposite_weblogic_9;
- public static String TargetServerComposite_weblogic_10;
- public static String TargetServerComposite_jboss;
- public static String TargetServerComposite_netweaver_7_1;
-
- // DDL Generation
- public static String EclipseLinkDDLGeneratorUi_generatingDDLWarningTitle;
- public static String EclipseLinkDDLGeneratorUi_generatingDDLWarningMessage;
- public static String EclipseLinkDDLGeneratorUi_error;
- public static String ECLIPSELINK_GENERATE_TABLES_JOB;
- public static String ECLIPSELINK_GENERATE_TABLES_TASK;
-
- public static String GenerationOutputModeWizardPage_title;
- public static String GenerationOutputModeWizardPage_desc;
- public static String GenerationOutputModeWizardPage_generationOutputMode;
-
- // Metadata Conversion
- public static String JavaMetadataConversion_noConvertersToConvert;
- public static String JavaConverterConversionWizardPage_title;
- public static String JavaConverterConversionWizardPage_description;
- public static String JavaMetadataConversion_equivalentConvertersWarningTitle;
- public static String JavaMetadataConversion_equivalentConvertersWarningMessage;
- public static String JavaMetadataConversion_equivalentGeneratorsWarningTitle;
- public static String JavaMetadataConversion_equivalentGeneratorsWarningMessage;
- public static String JavaMetadataConversion_equivalentQueriesWarningTitle;
- public static String JavaMetadataConversion_equivalentQueriesWarningMessage;
-
- // Static Weaving
- public static String EclipselinkPreferencePage_description;
- public static String EclipselinkPreferencePage_staticWeavingGroupBox;
- public static String EclipselinkPreferencePage_weaveClassesOnBuildLabel;
- public static String EclipselinkPreferencePage_sourceLabel;
- public static String EclipselinkPreferencePage_selectSourceLabel;
- public static String EclipselinkPreferencePage_sourceFolderSelectionLabel;
- public static String EclipselinkPreferencePage_targetLabel;
- public static String EclipselinkPreferencePage_selectTargetLabel;
- public static String EclipselinkPreferencePage_targetFolderSelectionLabel;
- public static String EclipselinkPreferencePage_persistenceInfoLabel;
- public static String EclipselinkPreferencePage_selectPersistenceInfoLabel;
- public static String EclipselinkPreferencePage_persistenceInfoFolderSelectionLabel;
- public static String EclipselinkPreferencePage_logLevelLabel;
- public static String EclipselinkPreferencePage_browse;
-
- public static String AddVirtualAttributeDialog_title;
- public static String AddVirtualAttributeDialog_nameLabel;
- public static String AddVirtualAttributeDialog_mappingLabel;
- public static String AddVirtualAttributeDialog_attributeTypeLabel;
- public static String AddVirtualAttributeDialog_noMappingKeyError;
- public static String AddVirtualAttributeDialog_noNameError;
- public static String AddVirtualAttributeDialog_noAttributeTypeError;
-
- private static final String BUNDLE_NAME = "eclipselink_ui"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = EclipseLinkUiMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private EclipseLinkUiMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/GenerateDynamicEntitiesHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/GenerateDynamicEntitiesHandler.java
deleted file mode 100644
index 9dbb01f26c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/GenerateDynamicEntitiesHandler.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.commands;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.gen.GenerateDynamicEntitiesFromSchemaWizard;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-
-public class GenerateDynamicEntitiesHandler
- extends AbstractHandler {
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- this.execute_(event);
- return null;
- }
-
- private void execute_(ExecutionEvent event) throws ExecutionException {
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
- JpaProject project = PlatformTools.getAdapter(selection.getFirstElement(), JpaProject.class);
- GenerateDynamicEntitiesFromSchemaWizard wizard = new GenerateDynamicEntitiesFromSchemaWizard(project, selection);
- WizardDialog dialog = new WizardDialog(HandlerUtil.getActiveShellChecked(event), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if (returnCode != Window.OK) {
- return;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/JavaConverterConversionHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/JavaConverterConversionHandler.java
deleted file mode 100644
index a90c210266..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/commands/JavaConverterConversionHandler.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.commands;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.platform.EclipseLinkJpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.internal.commands.AbstractJavaMetadataConversionHandler;
-
-public class JavaConverterConversionHandler
- extends AbstractJavaMetadataConversionHandler
-{
- public JavaConverterConversionHandler() {
- super();
- }
-
- @Override
- protected void convertJavaMetadata(JpaProject jpaProject) {
- this.getJpaPlatformUi(jpaProject).convertJavaConverterMetadataToGlobal(jpaProject);
- }
-
- @Override
- protected EclipseLinkJpaPlatformUi getJpaPlatformUi(JpaProject project) {
- return (EclipseLinkJpaPlatformUi) super.getJpaPlatformUi(project);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
deleted file mode 100644
index 57954d42cf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/EclipseLinkDDLGeneratorUi.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen;
-
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.ui.internal.dialogs.OptionalMessageDialog;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen.EclipseLinkDDLGenerator;
-import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiPlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen.wizards.GenerateDDLWizard;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * EclipseLinkDLLGeneratorUi is used by the EclipseLinkPlatformUi to initiate
- * the execution of EclipseLink DDL generator.
- */
-public class EclipseLinkDDLGeneratorUi
-{
- private final JpaProject project;
- private static final String CR = StringTools.CR;
-
- // ********** constructors **********
-
- public static void generate(JpaProject project) {
- new EclipseLinkDDLGeneratorUi(project).generate();
- }
-
- protected EclipseLinkDDLGeneratorUi(JpaProject project) {
- super();
- if (project == null) {
- throw new NullPointerException();
- }
- this.project = project;
- }
-
- // ********** behavior **********
-
- protected void generate() {
-
- PersistenceUnit persistenceUnit = this.getPersistenceUnits().iterator().next(); // Take the first persistenceUnit
- String puName = persistenceUnit.getName();
-
- GenerateDDLWizard wizard = new GenerateDDLWizard(this.project);
- WizardDialog wizardDialog = new WizardDialog(this.getCurrentShell(), wizard);
- wizardDialog.create();
- if(wizard.getPageCount() > 0) {
- int returnCode = wizardDialog.open();
- if (returnCode == Window.CANCEL) {
- return;
- }
- }
- OutputMode outputMode = wizard.getOutputMode();
-
- if((outputMode != OutputMode.sql_script) && ( ! this.displayGeneratingDDLWarning())) {
- return;
- }
- WorkspaceJob job = this.buildGenerateDDLJob(puName, this.project, outputMode);
- job.schedule();
- }
-
- protected WorkspaceJob buildGenerateDDLJob(String puName, JpaProject project, OutputMode outputMode) {
- return new GenerateDDLJob(puName, project, outputMode);
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
- private boolean displayGeneratingDDLWarning() {
- if (!OptionalMessageDialog.isDialogEnabled(OverwriteConfirmerDialog.ID)) {
- return true;
- } else {
- OverwriteConfirmerDialog dialog = new OverwriteConfirmerDialog(this.getCurrentShell());
- return dialog.open() == IDialogConstants.YES_ID;
- }
- }
-
- // ********** Persistence Unit **********
-
- protected JpaPlatform getPlatform() {
- return this.project.getJpaPlatform();
- }
-
- protected ListIterable<PersistenceUnit> getPersistenceUnits() {
- return this.getPersistence().getPersistenceUnits();
- }
-
- protected Persistence getPersistence() {
- return this.project.getRootContextNode().getPersistenceXml().getPersistence();
- }
-
- // ********** runnable **********
-
- protected static class GenerateDDLJob extends WorkspaceJob {
- private final String puName;
- private final JpaProject project;
- private final OutputMode outputMode;
-
- public GenerateDDLJob(String puName, JpaProject project, OutputMode outputMode) {
- super(EclipseLinkUiMessages.ECLIPSELINK_GENERATE_TABLES_JOB);
- this.puName = puName;
- this.project = project;
- this.outputMode = outputMode;
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- SubMonitor sm = SubMonitor.convert(monitor, EclipseLinkUiMessages.ECLIPSELINK_GENERATE_TABLES_TASK, 1);
- try {
- this.ddlGeneratorGenerate(this.puName, this.project, this.outputMode, sm.newChild(1));
- }
- catch (OperationCanceledException e) {
- return Status.CANCEL_STATUS;
- }
- catch (RuntimeException re) {
- this.logException(re);
- }
- return Status.OK_STATUS;
- }
-
- protected void ddlGeneratorGenerate(String puName, JpaProject project, OutputMode outputMode, IProgressMonitor monitor) {
- EclipseLinkDDLGenerator.generate(puName, project, outputMode, monitor);
- }
-
- protected void logException(RuntimeException re) {
- String msg = re.getMessage();
- String message = (msg == null) ? re.toString() : msg;
- this.displayError(message);
- JptJpaEclipseLinkUiPlugin.log(re);
- }
-
- private void displayError(final String message) {
- SWTUtil.syncExec(new Runnable() {
- public void run() {
- MessageDialog.openError(
- getShell(),
- EclipseLinkUiMessages.EclipseLinkDDLGeneratorUi_error,
- message
- );
- }
- });
- }
-
- protected Shell getShell() {
- Display display = Display.getCurrent();
- Shell shell = (display == null) ? null : display.getActiveShell();
- if (shell == null && display != null) {
- Shell[] shells = display.getShells();
- if (shells.length > 0)
- shell = shells[0];
- }
- return shell;
- }
- }
-
- // ********** overwrite dialog **********
-
- static class OverwriteConfirmerDialog extends OptionalMessageDialog {
-
- private static final String ID= "dontShowOverwriteExistingTablesFromClasses.warning"; //$NON-NLS-1$
-
- OverwriteConfirmerDialog(Shell parent) {
- super(ID, parent,
- EclipseLinkUiMessages.EclipseLinkDDLGeneratorUi_generatingDDLWarningTitle,
- NLS.bind(EclipseLinkUiMessages.EclipseLinkDDLGeneratorUi_generatingDDLWarningMessage, CR, CR + CR),
- MessageDialog.WARNING,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 1);
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- this.createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false);
- this.createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
- }
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java
deleted file mode 100644
index 1997961d1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/EclipseLink2_0DDLGeneratorUi.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen.wizards;
-
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.ddlgen.EclipseLink2_0DDLGenerator;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen.EclipseLinkDDLGeneratorUi;
-
-/**
- * EclipseLink2_0DDLGeneratorUi
- */
-public class EclipseLink2_0DDLGeneratorUi extends EclipseLinkDDLGeneratorUi
-{
-
- // ********** static method **********
-
- public static void generate(JpaProject project) {
- new EclipseLink2_0DDLGeneratorUi(project).generate();
- }
-
- // ********** constructors **********
-
- private EclipseLink2_0DDLGeneratorUi(JpaProject project) {
- super(project);
- }
-
- // ********** behavior **********
-
- @Override
- protected WorkspaceJob buildGenerateDDLJob(String puName, JpaProject project, OutputMode outputMode) {
- return new Generate2_0DDLJob(puName, project, outputMode);
- }
-
- // ********** runnable **********
-
- protected static class Generate2_0DDLJob extends EclipseLinkDDLGeneratorUi.GenerateDDLJob {
-
- public Generate2_0DDLJob(String puName, JpaProject project, OutputMode outputMode) {
- super(puName, project, outputMode);
- }
-
- @Override
- protected void ddlGeneratorGenerate(String puName, JpaProject project, OutputMode outputMode, IProgressMonitor monitor) {
- EclipseLink2_0DDLGenerator.generate(puName, project, outputMode, monitor);
- }
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/GenerateDDLWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/GenerateDDLWizard.java
deleted file mode 100644
index 38a9409d06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/GenerateDDLWizard.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen.wizards;
-
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.wizards.DatabaseSchemaWizardPage;
-
-/**
- * GenerateDDLWizard
- */
-public class GenerateDDLWizard extends Wizard {
-
- private JpaProject jpaProject;
-
- private DatabaseSchemaWizardPage dbSettingsPage;
- private GenerationOutputModeWizardPage generationOutputModePage;
-
- // ********** constructor **********
-
- public GenerateDDLWizard(JpaProject jpaProject) {
- super();
- this.jpaProject = jpaProject;
- this.setWindowTitle(JptUiMessages.GenerateDDLWizard_title);
- }
-
- // ********** IWizard implementation **********
-
- @Override
- public void addPages() {
- super.addPages();
- if(this.getJpaProjectConnectionProfile() == null) {
- this.dbSettingsPage = new DatabaseSchemaWizardPage(this.jpaProject);
- this.addPage(this.dbSettingsPage);
- }
- this.generationOutputModePage = new GenerationOutputModeWizardPage();
- this.addPage(this.generationOutputModePage);
- }
-
- @Override
- public boolean performFinish() {
- return (this.getJpaProjectConnectionProfile() != null);
- }
-
- @Override
- public boolean canFinish() {
- return this.dbSettingsPageCanFinish() && this.generationOutputModePageCanFinish();
- }
-
- // ********** intra-wizard methods **********
-
- public OutputMode getOutputMode() {
- return this.generationOutputModePage.getOutputMode();
- }
-
- // ********** internal methods **********
-
- private boolean dbSettingsPageCanFinish() {
- return (this.dbSettingsPage != null) ? this.dbSettingsPage.isPageComplete() : true;
- }
-
- private boolean generationOutputModePageCanFinish() {
- return this.generationOutputModePage.isPageComplete();
- }
-
- private ConnectionProfile getJpaProjectConnectionProfile() {
- return this.jpaProject.getConnectionProfile();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/GenerationOutputModeWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/GenerationOutputModeWizardPage.java
deleted file mode 100644
index a1e60d4d0e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/ddlgen/wizards/GenerationOutputModeWizardPage.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen.wizards;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * GenerationOutputModeWizardPage
- */
-public class GenerationOutputModeWizardPage extends WizardPage {
-
- GenerationOutputModeGroup outputModeGroup;
-
- public GenerationOutputModeWizardPage() {
- super("Database Schema"); //$NON-NLS-1$
- this.setTitle(EclipseLinkUiMessages.GenerationOutputModeWizardPage_title);
- this.setMessage(EclipseLinkUiMessages.GenerationOutputModeWizardPage_desc);
- }
-
- public void createControl(Composite parent) {
- this.setPageComplete(true);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- this.outputModeGroup = new GenerationOutputModeGroup(composite);
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- // ********** intra-wizard methods **********
-
- public OutputMode getOutputMode() {
- return this.outputModeGroup.getOutputMode();
- }
-
-
- // ********** Generation OutputMode Group **********
-
- class GenerationOutputModeGroup {
- private OutputMode outputMode;
-
- private final Button databaseButton;
- private final Button sqlScriptButton;
- private final Button bothButton;
-
- // ********** constructor **********
-
- private GenerationOutputModeGroup(Composite parent) {
- super();
- Group outputModeGroup = new Group(parent, SWT.NONE);
- GridLayout layout = new GridLayout(3, false);
- outputModeGroup.setLayout(layout);
- outputModeGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- outputModeGroup.setText(EclipseLinkUiMessages.GenerationOutputModeWizardPage_generationOutputMode);
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(this.group, JpaHelpContextIds.XXX);
-
- SelectionListener outputModeButtonListener = this.buildOutputModeRadioButtonListener();
-
- this.databaseButton = this.buildRadioButton(outputModeGroup,
- EclipseLinkUiMessages.OutputModeComposite_database, outputModeButtonListener, 3);
-
- this.sqlScriptButton = this.buildRadioButton(outputModeGroup,
- EclipseLinkUiMessages.OutputModeComposite_sql_script, outputModeButtonListener, 3);
-
- this.bothButton = this.buildRadioButton(outputModeGroup,
- EclipseLinkUiMessages.OutputModeComposite_both, outputModeButtonListener, 3);
-
- this.databaseButton.setSelection(true);
- this.outputModeButtonChanged();
- }
-
- // ********** listeners **********
-
- private SelectionListener buildOutputModeRadioButtonListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- outputModeButtonChanged();
- }
- };
- }
-
- // ********** internal methods **********
-
- private void outputModeButtonChanged() {
-
- if(this.databaseButton.getSelection()) {
- this.outputMode = OutputMode.database;
- }
- else if(this.sqlScriptButton.getSelection()) {
- this.outputMode = OutputMode.sql_script;
- }
- else if(this.bothButton.getSelection()) {
- this.outputMode = OutputMode.both;
- }
- }
-
- private Button buildRadioButton(Composite parent, String text, SelectionListener listener, int horizontalSpan) {
- Button radioButton = new Button(parent, SWT.RADIO);
- GridData gridData = new GridData();
- gridData.horizontalSpan = horizontalSpan;
- radioButton.setLayoutData(gridData);
- radioButton.setText(text);
- radioButton.addSelectionListener(listener);
- return radioButton;
- }
-
- private OutputMode getOutputMode() {
- return this.outputMode;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkArrayMapping2_3UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkArrayMapping2_3UiDefinition.java
deleted file mode 100644
index 11a0dda8fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkArrayMapping2_3UiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkArrayMapping2_3;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.JptUiDetailsMessages2_0;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkArrayMapping2_3UiDefinition<M, T extends EclipseLinkArrayMapping2_3>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkArrayMapping2_3UiDefinition() {
- super();
- }
-
- public Image getImage() {
- return JptJpaUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return JptUiDetailsMessages2_0.ArrayMapping2_3_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages2_0.ArrayMapping2_3_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.ARRAY_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkBasicCollectionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkBasicCollectionMappingUiDefinition.java
deleted file mode 100644
index ea4bfeb0b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkBasicCollectionMappingUiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkBasicCollectionMappingUiDefinition<M, T extends EclipseLinkBasicCollectionMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkBasicCollectionMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JptJpaUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkBasicCollectionMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkBasicCollectionMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkBasicMapMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkBasicMapMappingUiDefinition.java
deleted file mode 100644
index 8784ef4ec8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkBasicMapMappingUiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkBasicMapMappingUiDefinition<M, T extends EclipseLinkBasicMapMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkBasicMapMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JptJpaUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkBasicMapMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkBasicMapMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkStructureMapping2_3UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkStructureMapping2_3UiDefinition.java
deleted file mode 100644
index f293506590..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkStructureMapping2_3UiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructureMapping2_3;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.JptUiDetailsMessages2_0;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkStructureMapping2_3UiDefinition<M, T extends EclipseLinkStructureMapping2_3>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkStructureMapping2_3UiDefinition() {
- super();
- }
-
- public Image getImage() {
- return JptJpaUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return JptUiDetailsMessages2_0.StructureMapping2_3_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages2_0.StructureMapping2_3_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.STRUCTURE_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkTransformationMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkTransformationMappingUiDefinition.java
deleted file mode 100644
index e684b086ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkTransformationMappingUiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkTransformationMappingUiDefinition<M, T extends EclipseLinkTransformationMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkTransformationMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JptJpaUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkTransformationMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkTransformationMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkVariableOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkVariableOneToOneMappingUiDefinition.java
deleted file mode 100644
index fe7a51fad1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/AbstractEclipseLinkVariableOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEclipseLinkVariableOneToOneMappingUiDefinition<M, T extends EclipseLinkVariableOneToOneMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEclipseLinkVariableOneToOneMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JptJpaUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkVariableOneToOneMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.EclipseLinkVariableOneToOneMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLink2_4ProjectFlagModel.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLink2_4ProjectFlagModel.java
deleted file mode 100644
index 48265eae68..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLink2_4ProjectFlagModel.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-
-/**
- * Flag indicating whether the JPA project supports EclipseLink 2.4
- */
-public class EclipseLink2_4ProjectFlagModel<T extends JpaNode>
- extends TransformationPropertyValueModel<T, Boolean>
-{
- public EclipseLink2_4ProjectFlagModel(PropertyValueModel<T> jpaProjectModel) {
- super(jpaProjectModel);
- }
-
- @Override
- protected Boolean transform_(T value) {
- return Boolean.valueOf(JptJpaEclipseLinkCorePlugin.nodeIsEclipseLink2_4Compatible(value));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAlwaysRefreshComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAlwaysRefreshComposite.java
deleted file mode 100644
index 769bd0ce67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkAlwaysRefreshComposite.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-
-/**
- * This composite simply shows a tri-state check box for the Always Refresh option.
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkAlwaysRefreshComposite extends Pane<EclipseLinkCaching>
-{
- /**
- * Creates a new <code>OptionalComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkAlwaysRefreshComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent)
- {
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkAlwaysRefreshComposite_alwaysRefreshLabel,
- buildAlwaysRefreshHolder(),
- buildAlwaysRefreshStringHolder(),
- EclipseLinkHelpContextIds.CACHING_ALWAYS_REFRESH
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildAlwaysRefreshHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_ALWAYS_REFRESH_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedAlwaysRefresh();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedAlwaysRefresh(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildAlwaysRefreshStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultAlwaysRefreshHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkAlwaysRefreshComposite_alwaysRefreshDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkAlwaysRefreshComposite_alwaysRefreshLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultAlwaysRefreshHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_ALWAYS_REFRESH_PROPERTY,
- EclipseLinkCaching.DEFAULT_ALWAYS_REFRESH_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedAlwaysRefresh() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultAlwaysRefresh());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkArrayMapping2_3Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkArrayMapping2_3Composite.java
deleted file mode 100644
index 1ecb68d3d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkArrayMapping2_3Composite.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkArrayMapping2_3;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkArrayMapping2_3Composite extends Pane<EclipseLinkArrayMapping2_3>
- implements JpaComposite
-{
- public EclipseLinkArrayMapping2_3Composite(PropertyValueModel<? extends EclipseLinkArrayMapping2_3> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicCollectionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicCollectionMappingComposite.java
deleted file mode 100644
index db4e28e583..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicCollectionMappingComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkBasicCollectionMappingComposite extends Pane<EclipseLinkBasicCollectionMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkBasicCollectionMappingComposite(PropertyValueModel<? extends EclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMapMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMapMappingComposite.java
deleted file mode 100644
index 97e61eac55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMapMappingComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkBasicMapMappingComposite extends Pane<EclipseLinkBasicMapMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkBasicMapMappingComposite(PropertyValueModel<? extends EclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java
deleted file mode 100644
index d2752c0ca1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkBasicMappingComposite.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.LobConverter;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractBasicMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EnumTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TemporalTypeComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EnumTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | MutableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | LobComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see ColumnComposite
- * @see EnumTypeComposite
- * @see FetchTypeComposite
- * @see LobComposite
- * @see OptionalComposite
- * @see TemporalTypeComposite
- *
- * @version 3.2
- * @since 2.1
- */
-public abstract class EclipseLinkBasicMappingComposite<T extends BasicMapping> extends AbstractBasicMappingComposite<T>
-{
- /**
- * Creates a new <code>BasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IBasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected EclipseLinkBasicMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeBasicSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, addSubPane(container, 4));
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeTypeSection(Composite container) {
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- // No converter
- Button noConverterButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_default,
- buildConverterBooleanHolder(null),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- // Lob
- Button lobButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_lob,
- buildConverterBooleanHolder(LobConverter.class),
- null);
- ((GridData) lobButton.getLayoutData()).horizontalSpan = 2;
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_temporal,
- buildConverterBooleanHolder(BaseTemporalConverter.class),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), container, getWidgetFactory()));
-
-
- // Enumerated
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_enumerated,
- buildConverterBooleanHolder(BaseEnumeratedConverter.class),
- null);
- registerSubPane(new EnumTypeComposite(buildEnumeratedConverterHolder(converterHolder), container, getWidgetFactory()));
-
- // EclipseLink Converter
- Button elConverterButton = addRadioButton(
- container,
- EclipseLinkUiDetailsMessages.TypeSection_converted,
- buildConverterBooleanHolder(EclipseLinkConvert.class),
- null);
- ((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
-
- Pane<EclipseLinkConvert> convertComposite = buildConvertComposite(buildEclipseLinkConverterHolder(converterHolder), container);
- GridData gridData = (GridData) convertComposite.getControl().getLayoutData();
- gridData.horizontalSpan = 2;
- gridData.horizontalIndent = 20;
- registerSubPane(convertComposite);
- }
-
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new EclipseLinkConvertComposite(convertHolder, container, getWidgetFactory());
- }
-
- protected PropertyValueModel<EclipseLinkMutable> buildMutableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkMutable>(getSubjectHolder()) {
- @Override
- protected EclipseLinkMutable buildValue_() {
- return ((EclipseLinkBasicMapping) this.subject).getMutable();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, EclipseLinkConvert>(converterHolder) {
- @Override
- protected EclipseLinkConvert transform_(Converter converter) {
- return converter.getType() == EclipseLinkConvert.class ? (EclipseLinkConvert) converter : null;
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<EclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected PropertyValueModel<EclipseLinkConverterContainer> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<T, EclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return ((EclipseLinkBasicMapping) this.subject).getConverterContainer();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheCoordinationTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheCoordinationTypeComposite.java
deleted file mode 100644
index afb47f9168..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheCoordinationTypeComposite.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * ----------------------------------------------------------------------------
- * | ----------------------------------------------------- |
- * | Coordination Type: | |v| |
- * | ----------------------------------------------------- |
- * ----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkCacheCoordinationTypeComposite extends Pane<EclipseLinkCaching> {
-
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCacheCoordinationTypeComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private EnumFormComboViewer<EclipseLinkCaching, EclipseLinkCacheCoordinationType> addCacheCoordinationTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkCaching, EclipseLinkCacheCoordinationType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkCaching.DEFAULT_COORDINATION_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkCaching.SPECIFIED_COORDINATION_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkCacheCoordinationType[] getChoices() {
- return EclipseLinkCacheCoordinationType.values();
- }
-
- @Override
- protected EclipseLinkCacheCoordinationType getDefaultValue() {
- return getSubject().getDefaultCoordinationType();
- }
-
- @Override
- protected String displayString(EclipseLinkCacheCoordinationType value) {
- switch (value) {
- case INVALIDATE_CHANGED_OBJECTS :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheCoordinationTypeComposite_invalidate_changed_objects;
- case SEND_NEW_OBJECTS_WITH_CHANGES :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheCoordinationTypeComposite_send_new_objects_with_changes;
- case SEND_OBJECT_CHANGES :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheCoordinationTypeComposite_send_object_changes;
- case NONE :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheCoordinationTypeComposite_none;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected EclipseLinkCacheCoordinationType getValue() {
- return getSubject().getSpecifiedCoordinationType();
- }
-
- @Override
- protected void setValue(EclipseLinkCacheCoordinationType value) {
- getSubject().setSpecifiedCoordinationType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkCacheCoordinationTypeComposite_label,
- addCacheCoordinationTypeCombo(container),
- EclipseLinkHelpContextIds.CACHING_CACHE_COORDINATION_TYPE
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheSizeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheSizeComposite.java
deleted file mode 100644
index fd1b778beb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheSizeComposite.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * ----------------------------------------------------------------------------
- * | --------------- |
- * | Size: | I |I| Default (XXX) |
- * | --------------- |
- * ----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkCacheSizeComposite extends Pane<EclipseLinkCaching> {
-
- /**
- * Creates a new <code>CacheSizeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCacheSizeComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addSizeCombo(container);
- }
-
- private void addSizeCombo(Composite container) {
- new IntegerCombo<EclipseLinkCaching>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheSizeComposite_size;
- }
-
- @Override
- protected String getHelpId() {
- return null;//JpaHelpContextIds.MAPPING_COLUMN_LENGTH;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Integer>(getSubjectHolder(), EclipseLinkCaching.DEFAULT_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultSize());
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Integer>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedSize();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setSpecifiedSize(value);
- }
- };
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheTypeComposite.java
deleted file mode 100644
index d3c7f2da2f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCacheTypeComposite.java
+++ /dev/null
@@ -1,119 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * ----------------------------------------------------------------------------
- * | ------------------------------------------------------------------ |
- * | Type: | |v| |
- * | ------------------------------------------------------------------ |
- * ----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkCacheTypeComposite extends Pane<EclipseLinkCaching> {
-
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCacheTypeComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private EnumFormComboViewer<EclipseLinkCaching, EclipseLinkCacheType> addCacheTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkCaching, EclipseLinkCacheType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkCaching.DEFAULT_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkCaching.SPECIFIED_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkCacheType[] getChoices() {
- return EclipseLinkCacheType.values();
- }
-
- @Override
- protected EclipseLinkCacheType getDefaultValue() {
- return getSubject().getDefaultType();
- }
-
- @Override
- protected String displayString(EclipseLinkCacheType value) {
- switch (value) {
- case FULL :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheTypeComposite_full;
- case WEAK :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheTypeComposite_weak;
- case SOFT :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheTypeComposite_soft;
- case SOFT_WEAK :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheTypeComposite_soft_weak;
- case HARD_WEAK :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheTypeComposite_hard_weak;
- case CACHE :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheTypeComposite_cache;
- case NONE :
- return EclipseLinkUiDetailsMessages.EclipseLinkCacheTypeComposite_none;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected EclipseLinkCacheType getValue() {
- return getSubject().getSpecifiedType();
- }
-
- @Override
- protected void setValue(EclipseLinkCacheType value) {
- getSubject().setSpecifiedType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkCacheTypeComposite_label,
- addCacheTypeCombo(container),
- EclipseLinkHelpContextIds.CACHING_CACHE_TYPE
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCaching2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCaching2_0Composite.java
deleted file mode 100644
index 11dd9f23bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCaching2_0Composite.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.JavaEclipseLinkEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.JptUiDetailsMessages2_0;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 3.0
- * @since 3.0
- */
-public abstract class EclipseLinkCaching2_0Composite<T extends EclipseLinkCaching> extends Pane<T>
-{
-
- protected EclipseLinkCaching2_0Composite(Pane<?> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- PropertyValueModel<Cacheable2_0> cacheableHolder = buildCacheableHolder();
-
- //Shared Check box, uncheck this and the rest of the panel is disabled
- addTriStateCheckBoxWithDefault(
- addSubPane(container, 8),
- JptUiDetailsMessages2_0.Entity_cacheableLabel,
- buildSpecifiedCacheableHolder(cacheableHolder),
- buildCacheableStringHolder(cacheableHolder),
- JpaHelpContextIds.ENTITY_CACHEABLE
- );
-
- Composite subPane = addSubPane(container, 0, 16);
-
- Collection<Pane<?>> panes = new ArrayList<Pane<?>>();
-
- this.initializeTypeSection(subPane, panes);
-
- // Advanced sub-pane
- Composite advancedSection = addCollapsibleSubSection(
- subPane,
- EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_advanced,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
-
- initializeAdvancedPane(addSubPane(advancedSection, 0, 16), panes);
-
- new PaneEnabler(buildCacheableEnabler(cacheableHolder), panes);
-
- initializeExistenceCheckingComposite(addSubPane(container, 8));
- }
-
- protected PropertyValueModel<Cacheable2_0> buildCacheableHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Cacheable2_0>(getSubjectHolder()) {
- @Override
- protected Cacheable2_0 buildValue_() {
- return ((CacheableHolder2_0) this.subject).getCacheable();
- }
- };
- }
-
- protected void initializeTypeSection(Composite container, Collection<Pane<?>> panes) {
- panes.add(new EclipseLinkCacheTypeComposite(this, container));
- panes.add(new EclipseLinkCacheSizeComposite(this, container));
- }
-
- protected void initializeAdvancedPane(Composite container, Collection<Pane<?>> panes) {
- panes.add(new EclipseLinkExpiryComposite(this, container));
- panes.add(new EclipseLinkAlwaysRefreshComposite(this, container));
- panes.add(new EclipseLinkRefreshOnlyIfNewerComposite(this, container));
- panes.add(new EclipseLinkDisableHitsComposite(this, container));
- panes.add(new EclipseLinkCacheCoordinationTypeComposite(this, container));
- }
-
- protected abstract void initializeExistenceCheckingComposite(Composite parent);
-
- private PropertyValueModel<Boolean> buildCacheableEnabler(PropertyValueModel<Cacheable2_0> cacheableHolder) {
- return new PropertyAspectAdapter<Cacheable2_0, Boolean>(
- cacheableHolder,
- Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY,
- Cacheable2_0.DEFAULT_CACHEABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isCacheable());
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildSpecifiedCacheableHolder(PropertyValueModel<Cacheable2_0> cacheableHolder) {
- return new PropertyAspectAdapter<Cacheable2_0, Boolean>(cacheableHolder, Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedCacheable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedCacheable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildCacheableStringHolder(PropertyValueModel<Cacheable2_0> cacheableHolder) {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultCacheableHolder(cacheableHolder)) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages2_0.Entity_cacheableWithDefaultLabel, defaultStringValue);
- }
- return JptUiDetailsMessages2_0.Entity_cacheableLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultCacheableHolder(PropertyValueModel<Cacheable2_0> cacheableHolder) {
- return new PropertyAspectAdapter<Cacheable2_0, Boolean>(
- cacheableHolder,
- Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY,
- Cacheable2_0.DEFAULT_CACHEABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedCacheable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultCacheable());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java
deleted file mode 100644
index 44d4d6f793..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCachingComposite.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.JavaEclipseLinkEntityComposite;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 2.1
- * @since 2.1
- */
-public abstract class EclipseLinkCachingComposite<T extends EclipseLinkCaching> extends Pane<T>
-{
-
- protected EclipseLinkCachingComposite(Pane<?> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- //Shared Check box, uncheck this and the rest of the panel is disabled
- addTriStateCheckBoxWithDefault(
- addSubPane(container, 8),
- EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_sharedLabel,
- buildSpecifiedSharedHolder(),
- buildSharedStringHolder(),
- EclipseLinkHelpContextIds.CACHING_SHARED
- );
-
- Composite subPane = addSubPane(container, 0, 16);
-
- Collection<Pane<?>> panes = new ArrayList<Pane<?>>();
-
- panes.add(new EclipseLinkCacheTypeComposite(this, subPane));
- panes.add(new EclipseLinkCacheSizeComposite(this, subPane));
-
- // Advanced sub-pane
- Composite advancedSection = addCollapsibleSubSection(
- subPane,
- EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_advanced,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
-
- initializeAdvancedPane(addSubPane(advancedSection, 0, 16), panes);
-
- new PaneEnabler(buildSharedCacheEnabler(), panes);
-
- initializeExistenceCheckingComposite(addSubPane(container, 8));
- }
-
- protected void initializeAdvancedPane(Composite container, Collection<Pane<?>> panes) {
- panes.add(new EclipseLinkExpiryComposite(this, container));
- panes.add(new EclipseLinkAlwaysRefreshComposite(this, container));
- panes.add(new EclipseLinkRefreshOnlyIfNewerComposite(this, container));
- panes.add(new EclipseLinkDisableHitsComposite(this, container));
- panes.add(new EclipseLinkCacheCoordinationTypeComposite(this, container));
- }
-
- protected abstract void initializeExistenceCheckingComposite(Composite parent);
-
- private PropertyValueModel<Boolean> buildSharedCacheEnabler() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY,
- EclipseLinkCaching.DEFAULT_SHARED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isShared());
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildSpecifiedSharedHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedShared();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedShared(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildSharedStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultSharedHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_sharedLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkCachingComposite_sharedLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultSharedHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_SHARED_PROPERTY,
- EclipseLinkCaching.DEFAULT_SHARED_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedShared() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultShared());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkChangeTrackingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkChangeTrackingComposite.java
deleted file mode 100644
index 5a58119c0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkChangeTrackingComposite.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -------------------------------------------------------------------------
- * | ---------------------------------------------- |
- * | Change Tracking : | |v| |
- * | ---------------------------------------------- |
- * -------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkChangeTracking
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkChangeTrackingComposite extends Pane<EclipseLinkChangeTracking> {
-
- /**
- * Creates a new <code>ChangeTrackingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkChangeTrackingComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkChangeTracking> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkChangeTrackingComposite_label),
- addChangeTrackingTypeCombo(container).getControl(),
- null
- );
- }
-
- private EnumFormComboViewer<EclipseLinkChangeTracking, EclipseLinkChangeTrackingType> addChangeTrackingTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkChangeTracking, EclipseLinkChangeTrackingType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkChangeTracking.DEFAULT_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkChangeTracking.SPECIFIED_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkChangeTrackingType[] getChoices() {
- return EclipseLinkChangeTrackingType.values();
- }
-
- @Override
- protected EclipseLinkChangeTrackingType getDefaultValue() {
- return getSubject().getDefaultType();
- }
-
- @Override
- protected String displayString(EclipseLinkChangeTrackingType value) {
- switch (value) {
- case ATTRIBUTE :
- return EclipseLinkUiDetailsMessages.EclipseLinkChangeTrackingComposite_attribute;
- case AUTO :
- return EclipseLinkUiDetailsMessages.EclipseLinkChangeTrackingComposite_auto;
- case DEFERRED :
- return EclipseLinkUiDetailsMessages.EclipseLinkChangeTrackingComposite_deferred;
- case OBJECT :
- return EclipseLinkUiDetailsMessages.EclipseLinkChangeTrackingComposite_object;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected EclipseLinkChangeTrackingType getValue() {
- return getSubject().getSpecifiedType();
- }
-
- @Override
- protected void setValue(EclipseLinkChangeTrackingType value) {
- getSubject().setSpecifiedType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java
deleted file mode 100644
index 853d408a63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueDialog.java
+++ /dev/null
@@ -1,209 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.Set;
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Clients can use this dialog to prompt the user for SecondaryTable settings.
- * Use the following once the dialog is closed:
- * @see #getSelectedTable()
- * @see #getSelectedCatalog()
- * @see #getSelectedSchema()
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkConversionValueDialog extends ValidatingDialog<EclipseLinkConversionValueStateObject> {
-
- /**
- * when creating a new EclipseLinkConversionValue, 'conversionValue' will be null
- */
- private final EclipseLinkConversionValue conversionValue;
-
- private EclipseLinkObjectTypeConverter objectTypeConverter;
-
- // ********** constructors **********
-
- /**
- * Use this constructor to create a new conversion value
- */
- public EclipseLinkConversionValueDialog(Shell parent, EclipseLinkObjectTypeConverter objectTypeConverter) {
- this(parent,objectTypeConverter, null);
- }
-
- /**
- * Use this constructor to edit an existing conversion value
- */
- public EclipseLinkConversionValueDialog(Shell parent, EclipseLinkObjectTypeConverter objectTypeConverter, EclipseLinkConversionValue conversionValue) {
- super(parent);
- this.objectTypeConverter = objectTypeConverter;
- this.conversionValue = conversionValue;
- }
-
- @Override
- protected EclipseLinkConversionValueStateObject buildStateObject() {
- String dataValue = null;
- String objectValue = null;
- Set<String> dataValues = CollectionTools.set(this.objectTypeConverter.getDataValues(), this.objectTypeConverter.getDataValuesSize());
- if (isEditDialog()) {
- dataValue = this.conversionValue.getDataValue();
- objectValue = this.conversionValue.getObjectValue();
- //remove *this* dataValue, don't want a duplicate data value error
- dataValues.remove(dataValue);
- }
- return new EclipseLinkConversionValueStateObject(
- dataValue,
- objectValue,
- dataValues);
- }
-
- // ********** open **********
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(this.getTitle());
- }
-
- @Override
- protected String getTitle() {
- return (this.isAddDialog()) ?
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_addConversionValue
- :
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_editConversionValue;
- }
-
- @Override
- protected String getDescriptionTitle() {
- return (this.isAddDialog()) ?
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_addConversionValueDescriptionTitle
- :
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_editConversionValueDescriptionTitle;
- }
-
- @Override
- protected String getDescription() {
- return (this.isAddDialog()) ?
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_addConversionValueDescription
- :
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_editConversionValueDescription;
- }
-
- @Override
- protected DialogPane<EclipseLinkConversionValueStateObject> buildLayout(Composite container) {
- return new ConversionValueDialogPane(container);
- }
-
- @Override
- public void create() {
- super.create();
-
- ConversionValueDialogPane pane = (ConversionValueDialogPane) getPane();
- pane.selectAll();
-
- getButton(OK).setEnabled(false);
- }
-
-
- // ********** convenience methods **********
-
- protected boolean isAddDialog() {
- return this.conversionValue == null;
- }
-
- protected boolean isEditDialog() {
- return ! this.isAddDialog();
- }
-
-
- // ********** public API **********
-
- /**
- * Return the data value set in the text widget.
- */
- public String getDataValue() {
- return getSubject().getDataValue();
- }
-
- /**
- * Return the object value set in the text widget.
- */
- public String getObjectValue() {
- return getSubject().getObjectValue();
- }
-
- private class ConversionValueDialogPane extends DialogPane<EclipseLinkConversionValueStateObject> {
-
- private Text dataValueText;
- private Text objectValueText;
-
- ConversionValueDialogPane(Composite parent) {
- super(EclipseLinkConversionValueDialog.this.getSubjectHolder(), parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.dataValueText = addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_dataValue,
- buildDataValueHolder()
- );
-
- this.objectValueText = addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConversionValueDialog_objectValue,
- buildObjectValueHolder()
- );
- }
-
- private ModifiablePropertyValueModel<String> buildDataValueHolder() {
- return new PropertyAspectAdapter<EclipseLinkConversionValueStateObject, String>(getSubjectHolder(), EclipseLinkConversionValueStateObject.DATA_VALUE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDataValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setDataValue(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildObjectValueHolder() {
- return new PropertyAspectAdapter<EclipseLinkConversionValueStateObject, String>(getSubjectHolder(), EclipseLinkConversionValueStateObject.OBJECT_VALUE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getObjectValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setObjectValue(value);
- }
- };
- }
-
- void selectAll() {
- this.dataValueText.selectAll();
- this.objectValueText.selectAll();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueStateObject.java
deleted file mode 100644
index baaff3a14d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConversionValueStateObject.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jpt.common.ui.internal.widgets.NewNameDialog;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.common.utility.internal.node.Problem;
-
-/**
- * This is the state object used by the <code>NewNameDialog</code>, which stores
- * the current name and validates it when it is modified.
- *
- * @see NewNameDialog
- *
- * @version 2.1
- * @since 2.1
- */
-@SuppressWarnings("nls")
-final class EclipseLinkConversionValueStateObject extends AbstractNode
-{
- /**
- * The initial dataValue or <code>null</code>
- */
- private String dataValue;
-
- /**
- * The collection of data values that can't be used or an empty collection
- */
- private Collection<String> dataValues;
-
- /**
- * The initial objectValue or <code>null</code>
- */
- private String objectValue;
-
- /**
- * The <code>Validator</code> used to validate this state object.
- */
- private Validator validator;
-
- /**
- * Notifies a change in the data value property.
- */
- static final String DATA_VALUE_PROPERTY = "dataValue";
-
- /**
- * Notifies a change in the object value property.
- */
- static final String OBJECT_VALUE_PROPERTY = "objectValue";
-
- /**
- * Creates a new <code>NewNameStateObject</code>.
- *
- * @param name The initial input or <code>null</code> if no initial value can
- * be specified
- * @param names The collection of names that can't be used or an empty
- * collection if none are available
- */
- EclipseLinkConversionValueStateObject(String dataValue, String objectValue, Collection<String> dataValues) {
- super(null);
-
- this.dataValue = dataValue;
- this.objectValue = objectValue;
- this.dataValues = dataValues;
- }
-
- private void addDataValueProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.dataValue)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConversionValueStateObject_dataValueMustBeSpecified, IMessageProvider.ERROR));
- }
- else if (this.dataValues.contains(this.dataValue)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConversionValueStateObject_dataValueAlreadyExists, IMessageProvider.ERROR));
- }
- }
-
- private void addObjectValueProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.objectValue)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConversionValueStateObject_objectValueMustBeSpecified, IMessageProvider.ERROR));
- }
- }
-
- @Override
- protected void addProblemsTo(List<Problem> currentProblems) {
- super.addProblemsTo(currentProblems);
- addDataValueProblemsTo(currentProblems);
- addObjectValueProblemsTo(currentProblems);
- }
-
- @Override
- protected void checkParent(Node parentNode) {
- //not parent
- }
-
- public String displayString() {
- return null;
- }
-
- String getDataValue() {
- return this.dataValue;
- }
-
- String getObjectValue() {
- return this.objectValue;
- }
-
- public void setDataValue(String dataValue) {
- String oldDataValue = this.dataValue;
- this.dataValue = dataValue;
- firePropertyChanged(DATA_VALUE_PROPERTY, oldDataValue, dataValue);
- }
-
- public void setObjectValue(String objectValue) {
- String oldObjectValue = this.objectValue;
- this.objectValue = objectValue;
- firePropertyChanged(OBJECT_VALUE_PROPERTY, oldObjectValue, objectValue);
- }
-
- @Override
- public void setValidator(Validator validator) {
- this.validator = validator;
- }
-
- @Override
- public Validator getValidator() {
- return this.validator;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java
deleted file mode 100644
index 7cf9ed8509..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertComposite.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.ArrayList;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.NonEmptyStringFilter;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.FilteringCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SetCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Enum Type: | |v| |
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConvert
- * @see EclipseLinkBasicMappingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkConvertComposite
- extends Pane<EclipseLinkConvert>
-{
-
- /**
- * A key used to represent the default value, this is required to convert
- * the selected item from a combo to an empty string. This key is most
- * likely never typed the user and it will help to convert the value to
- * an empty string when it's time to set the new selected value into the
- * model.
- */
- protected static String DEFAULT_KEY = "?!#!?#?#?default?#?!#?!#?"; //$NON-NLS-1$
-
-
- /**
- * Creates a new <code>EnumTypeComposite</code>.
- */
- public EclipseLinkConvertComposite(PropertyValueModel<? extends EclipseLinkConvert> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConvertComposite_converterNameLabel,
- buildConvertNameListHolder(),
- buildConvertNameHolder(),
- buildNameConverter(),
- null
- );
- SWTUtil.attachDefaultValueHandler(combo);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected final ModifiablePropertyValueModel<String> buildConvertNameHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.SPECIFIED_CONVERTER_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getSpecifiedConverterName();
- }
-
- @Override
- protected void setValue_(String value) {
- // Convert the default value to the default converter
- if ((value != null) && (value.startsWith(DEFAULT_KEY))) {
- value = EclipseLinkConvert.DEFAULT_CONVERTER_NAME;
- }
- this.subject.setSpecifiedConverterName(value);
- }
- };
- }
-
- private ListValueModel<String> buildConvertNameListHolder() {
- java.util.List<ListValueModel<String>> list = new ArrayList<ListValueModel<String>>();
- list.add(buildDefaultNameListHolder());
- list.add(buildReservedConverterNameListHolder());
- list.add(buildSortedConverterNamesModel());
- return new CompositeListValueModel<ListValueModel<String>, String>(list);
- }
-
- protected ListValueModel<String> buildDefaultNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- buildDefaultNameHolder()
- );
- }
-
- private ModifiablePropertyValueModel<String> buildDefaultNameHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, String>(getSubjectHolder(), EclipseLinkConvert.DEFAULT_CONVERTER_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- String name = this.subject.getDefaultConverterName();
-
- if (name == null) {
- name = DEFAULT_KEY;
- }
- else {
- name = DEFAULT_KEY + name;
- }
-
- return name;
- }
- };
- }
-
- private StringConverter<String> buildNameConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
-
- if (getSubject() == null) {
- return value;
- }
-
- if (value == null) {
- value = getSubject().getDefaultConverterName();
-
- if (value != null) {
- value = DEFAULT_KEY + value;
- }
- else {
- value = DEFAULT_KEY;
- }
- }
-
- if (value.startsWith(DEFAULT_KEY)) {
- String defaultName = value.substring(DEFAULT_KEY.length());
-
- if (defaultName.length() > 0) {
- value = NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultName
- );
- }
- else {
- value = NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- EclipseLinkConvert.NO_CONVERTER
- );
- }
- }
-
- return value;
- }
- };
- }
-
- protected ListValueModel<String> buildReservedConverterNameListHolder() {
- return new StaticListValueModel<String>(EclipseLinkConvert.RESERVED_CONVERTER_NAMES);
- }
-
- protected ListValueModel<String> buildSortedConverterNamesModel() {
- return new SortedListValueModelAdapter<String>(this.buildUniqueConverterNamesModel());
- }
-
- protected CollectionValueModel<String> buildUniqueConverterNamesModel() {
- return new SetCollectionValueModel<String>(this.buildConverterNamesModel());
- }
-
- protected CollectionValueModel<String> buildConverterNamesModel() {
- return new FilteringCollectionValueModel<String>(this.buildConverterNamesModel_(), NonEmptyStringFilter.instance());
- }
-
- protected ListValueModel<String> buildConverterNamesModel_() {
- return new TransformationListValueModel<EclipseLinkConverter, String>(this.buildConvertersModel()) {
- @Override
- protected String transformItem_(EclipseLinkConverter converter) {
- return converter.getName();
- }
- };
- }
-
- protected ListValueModel<EclipseLinkConverter> buildConvertersModel() {
- return new ItemPropertyListValueModelAdapter<EclipseLinkConverter>(this.buildConvertersModel_(), JpaNamedContextNode.NAME_PROPERTY);
- }
-
- protected CollectionValueModel<EclipseLinkConverter> buildConvertersModel_() {
- return new CollectionAspectAdapter<EclipseLinkPersistenceUnit, EclipseLinkConverter>(this.buildPersistenceUnitHolder(), EclipseLinkPersistenceUnit.CONVERTERS_COLLECTION) {
- @Override
- protected Iterable<EclipseLinkConverter> getIterable() {
- return this.subject.getConverters();
- }
- @Override
- protected int size_() {
- return this.subject.getConvertersSize();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkPersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<EclipseLinkConvert, EclipseLinkPersistenceUnit>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConvert, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkConvert value) {
- if (getSubject() != null && getSubject().getParent().getPersistentAttribute().isVirtual()) {
- return Boolean.FALSE;
- }
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java
deleted file mode 100644
index c3b5787506..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkConvertersComposite.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkConverterDialog;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * This pane shows the list of custom converters, object type converters,
- * struct converters, and type converters.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ConverterComposite or ObjectTypeConverterComposite | |
- * | | or StructConverterComposite or TypeConverterComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 3.2
- * @since 2.1
- */
-public class EclipseLinkConvertersComposite extends Pane<EclipseLinkConverterContainer>
-{
- private AddRemoveListPane<EclipseLinkConverterContainer> listPane;
- private EclipseLinkCustomConverterComposite converterComposite;
- private EclipseLinkObjectTypeConverterComposite objectTypeConverterComposite;
- private EclipseLinkStructConverterComposite structConverterComposite;
- private EclipseLinkTypeConverterComposite typeConverterComposite;
- private ModifiablePropertyValueModel<EclipseLinkConverter> selectedConverterHolder;
-
- public EclipseLinkConvertersComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkConverterContainer> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.selectedConverterHolder = buildSelectedConverterHolder();
- }
-
- private ModifiablePropertyValueModel<EclipseLinkConverter> buildSelectedConverterHolder() {
- return new SimplePropertyValueModel<EclipseLinkConverter>();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // List pane
- this.listPane = addListPane(container);
- this.installPaneEnabler();
-
- // Property pane
- PageBook pageBook = new PageBook(container, SWT.NULL);
- pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- this.converterComposite = new EclipseLinkCustomConverterComposite(
- buildCustomConverterHolder(),
- pageBook,
- getWidgetFactory()
- );
- registerSubPane(this.converterComposite);
-
- this.objectTypeConverterComposite = new EclipseLinkObjectTypeConverterComposite(
- buildObjectTypeConverterHolder(),
- pageBook,
- getWidgetFactory()
- );
- registerSubPane(this.objectTypeConverterComposite);
-
- this.structConverterComposite = new EclipseLinkStructConverterComposite(
- buildStructConverterHolder(),
- pageBook,
- getWidgetFactory()
- );
- registerSubPane(this.structConverterComposite);
-
- this.typeConverterComposite = new EclipseLinkTypeConverterComposite(
- buildTypeConverterHolder(),
- pageBook,
- getWidgetFactory()
- );
- registerSubPane(this.typeConverterComposite);
-
- installPaneSwitcher(pageBook);
- }
-
- private AddRemoveListPane<EclipseLinkConverterContainer> addListPane(Composite container) {
-
- return new AddRemoveListPane<EclipseLinkConverterContainer>(
- this,
- container,
- buildConvertersAdapter(),
- buildDisplayableConvertersListHolder(),
- this.selectedConverterHolder,
- buildConvertersListLabelProvider(),
- null
- );
- }
-
- private void installPaneSwitcher(PageBook pageBook) {
- new ControlSwitcher(this.selectedConverterHolder, buildPaneTransformer(), pageBook);
- }
-
- private Adapter buildConvertersAdapter() {
-
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addConverter();
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- if (((EclipseLinkConverter) item).getType() == EclipseLinkCustomConverter.class) {
- getSubject().removeCustomConverter((EclipseLinkCustomConverter) item);
- }
- else if (((EclipseLinkConverter) item).getType() == EclipseLinkObjectTypeConverter.class) {
- getSubject().removeObjectTypeConverter((EclipseLinkObjectTypeConverter) item);
- }
- else if (((EclipseLinkConverter) item).getType() == EclipseLinkStructConverter.class) {
- getSubject().removeStructConverter((EclipseLinkStructConverter) item);
- }
- else if (((EclipseLinkConverter) item).getType() == EclipseLinkTypeConverter.class) {
- getSubject().removeTypeConverter((EclipseLinkTypeConverter) item);
- }
- }
- }
- };
- }
-
- private void addConverter() {
- this.addEclipseLinkConverterFromDialog(this.buildEclipseLinkConverterDialog());
- }
-
- protected EclipseLinkConverterDialog buildEclipseLinkConverterDialog() {
- return new EclipseLinkConverterDialog(this.getShell(), this.getSubject());
- }
-
- protected void addEclipseLinkConverterFromDialog(EclipseLinkConverterDialog dialog) {
- if (dialog.open() != Window.OK) {
- return;
- }
- Class<? extends EclipseLinkConverter> converterType = dialog.getConverterType();
- EclipseLinkConverter converter;
- if (converterType == EclipseLinkCustomConverter.class) {
- converter = this.getSubject().addCustomConverter(getSubject().getCustomConvertersSize());
- }
- else if (converterType == EclipseLinkObjectTypeConverter.class) {
- converter = this.getSubject().addObjectTypeConverter(getSubject().getObjectTypeConvertersSize());
- }
- else if (converterType == EclipseLinkStructConverter.class) {
- converter = this.getSubject().addStructConverter(getSubject().getStructConvertersSize());
- }
- else if (converterType == EclipseLinkTypeConverter.class) {
- converter = this.getSubject().addTypeConverter(getSubject().getTypeConvertersSize());
- }
- else {
- throw new IllegalArgumentException();
- }
- converter.setName(dialog.getName());
- this.selectedConverterHolder.setValue(converter);//so that it gets selected in the List for the user to edit
- }
-
- private Transformer<EclipseLinkConverter, Control> buildPaneTransformer() {
- return new Transformer<EclipseLinkConverter, Control>() {
- public Control transform(EclipseLinkConverter converter) {
- if (converter == null) {
- return null;
- }
-
- if (converter.getType() == EclipseLinkCustomConverter.class) {
- return EclipseLinkConvertersComposite.this.converterComposite.getControl();
- }
- if (converter.getType() == EclipseLinkObjectTypeConverter.class) {
- return EclipseLinkConvertersComposite.this.objectTypeConverterComposite.getControl();
- }
- if (converter.getType() == EclipseLinkStructConverter.class) {
- return EclipseLinkConvertersComposite.this.structConverterComposite.getControl();
- }
- if (converter.getType() == EclipseLinkTypeConverter.class) {
- return EclipseLinkConvertersComposite.this.typeConverterComposite.getControl();
- }
-
- return null;
- }
- };
- }
-
- private ListValueModel<EclipseLinkConverter> buildDisplayableConvertersListHolder() {
- return new ItemPropertyListValueModelAdapter<EclipseLinkConverter>(
- buildEclipseLinkConvertersHolder(),
- JpaNamedContextNode.NAME_PROPERTY
- );
- }
-
- private ListValueModel<EclipseLinkConverter> buildEclipseLinkConvertersHolder() {
- List<ListValueModel<? extends EclipseLinkConverter>> list = new ArrayList<ListValueModel<? extends EclipseLinkConverter>>();
- list.add(buildCustomConvertersListHolder());
- list.add(buildObjectTypeConvertersListHolder());
- list.add(buildStructConvertersListHolder());
- list.add(buildTypeConvertersListHolder());
- return new CompositeListValueModel<ListValueModel<? extends EclipseLinkConverter>, EclipseLinkConverter>(list);
- }
-
- private ListValueModel<EclipseLinkCustomConverter> buildCustomConvertersListHolder() {
- return new ListAspectAdapter<EclipseLinkConverterContainer, EclipseLinkCustomConverter>(
- getSubjectHolder(),
- EclipseLinkConverterContainer.CUSTOM_CONVERTERS_LIST)
- {
- @Override
- protected ListIterable<EclipseLinkCustomConverter> getListIterable() {
- return new SuperListIterableWrapper<EclipseLinkCustomConverter>(this.subject.getCustomConverters());
- }
-
- @Override
- protected int size_() {
- return this.subject.getCustomConvertersSize();
- }
- };
- }
-
- private ListValueModel<EclipseLinkObjectTypeConverter> buildObjectTypeConvertersListHolder() {
- return new ListAspectAdapter<EclipseLinkConverterContainer, EclipseLinkObjectTypeConverter>(
- getSubjectHolder(),
- EclipseLinkConverterContainer.OBJECT_TYPE_CONVERTERS_LIST)
- {
- @Override
- protected ListIterable<EclipseLinkObjectTypeConverter> getListIterable() {
- return new SuperListIterableWrapper<EclipseLinkObjectTypeConverter>(this.subject.getObjectTypeConverters());
- }
-
- @Override
- protected int size_() {
- return this.subject.getObjectTypeConvertersSize();
- }
- };
- }
-
- private ListValueModel<EclipseLinkStructConverter> buildStructConvertersListHolder() {
- return new ListAspectAdapter<EclipseLinkConverterContainer, EclipseLinkStructConverter>(
- getSubjectHolder(),
- EclipseLinkConverterContainer.STRUCT_CONVERTERS_LIST)
- {
- @Override
- protected ListIterable<EclipseLinkStructConverter> getListIterable() {
- return new SuperListIterableWrapper<EclipseLinkStructConverter>(this.subject.getStructConverters());
- }
-
- @Override
- protected int size_() {
- return this.subject.getStructConvertersSize();
- }
- };
- }
-
- private ListValueModel<EclipseLinkTypeConverter> buildTypeConvertersListHolder() {
- return new ListAspectAdapter<EclipseLinkConverterContainer, EclipseLinkTypeConverter>(
- getSubjectHolder(),
- EclipseLinkConverterContainer.TYPE_CONVERTERS_LIST)
- {
- @Override
- protected ListIterable<EclipseLinkTypeConverter> getListIterable() {
- return new SuperListIterableWrapper<EclipseLinkTypeConverter>(this.subject.getTypeConverters());
- }
-
- @Override
- protected int size_() {
- return this.subject.getTypeConvertersSize();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkCustomConverter> buildCustomConverterHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkCustomConverter>(this.selectedConverterHolder) {
- @Override
- protected EclipseLinkCustomConverter transform_(EclipseLinkConverter value) {
- return value.getType() == EclipseLinkCustomConverter.class ? (EclipseLinkCustomConverter) value : null;
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkObjectTypeConverter> buildObjectTypeConverterHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkObjectTypeConverter>(this.selectedConverterHolder) {
- @Override
- protected EclipseLinkObjectTypeConverter transform_(EclipseLinkConverter value) {
- return value.getType() == EclipseLinkObjectTypeConverter.class ? (EclipseLinkObjectTypeConverter) value : null;
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkStructConverter> buildStructConverterHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkStructConverter>(this.selectedConverterHolder) {
- @Override
- protected EclipseLinkStructConverter transform_(EclipseLinkConverter value) {
- return value.getType() == EclipseLinkStructConverter.class ? (EclipseLinkStructConverter) value : null;
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkTypeConverter> buildTypeConverterHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConverter, EclipseLinkTypeConverter>(this.selectedConverterHolder) {
- @Override
- protected EclipseLinkTypeConverter transform_(EclipseLinkConverter value) {
- return value.getType() == EclipseLinkTypeConverter.class ? (EclipseLinkTypeConverter) value : null;
- }
- };
- }
-
- private ILabelProvider buildConvertersListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((EclipseLinkConverter) element).getName();
- }
- };
- }
-
- private void installPaneEnabler() {
- new PaneEnabler(
- this.buildPaneEnablerHolder(),
- this.listPane
- );
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<EclipseLinkConverterContainer, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkConverterContainer value) {
- return (value != null);
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java
deleted file mode 100644
index 0039b1b393..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomConverterComposite.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterClassConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Name: | ||
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConverter
- * @see EclipseLinkConvertComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkCustomConverterComposite extends Pane<EclipseLinkCustomConverter>
-{
-
- /**
- * Creates a new <code>ConverterComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCustomConverterComposite(PropertyValueModel<? extends EclipseLinkCustomConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_nameTextLabel,
- buildNameTextHolder());
-
- addClassChooser(container);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected ModifiablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkCustomConverter, String>(
- getSubjectHolder(), JpaNamedContextNode.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
-
- private ClassChooserPane<EclipseLinkCustomConverter> addClassChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkCustomConverter>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkCustomConverter, String>(getSubjectHolder(), EclipseLinkConverterClassConverter.CONVERTER_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getConverterClass();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setConverterClass(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getConverterClass();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_classLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setConverterClass(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return EclipseLinkCustomConverter.ECLIPSELINK_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedConverterClass();
- }
- };
- }
-
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkCustomConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkCustomConverter value) {
-// if (getSubject() != null && getSubject().getParent().getPersistentAttribute().isVirtual()) {
-// return Boolean.FALSE;
-// }
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomizerComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomizerComposite.java
deleted file mode 100644
index dd76b5ce33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkCustomizerComposite.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @see EclipseLinkCustomizer
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkCustomizerComposite extends Pane<EclipseLinkCustomizer>
-{
- /**
- * Creates a new <code>CustomizerComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkCustomizerComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkCustomizer> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new CustomizerClassChooserComboPane(this, container);
- }
-
- private class CustomizerClassChooserComboPane
- extends ClassChooserComboPane<EclipseLinkCustomizer>
- {
- public CustomizerClassChooserComboPane(Pane<EclipseLinkCustomizer> parentPane, Composite parent) {
- super(parentPane, parent);
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getSpecifiedCustomizerClass();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setSpecifiedCustomizerClass(className);
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkCustomizerComposite_classLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedCustomizerClass();
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return EclipseLinkCustomizer.ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME;
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getCustomizerClassEnclosingTypeSeparator();
- }
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkCustomizer, String>(
- getSubjectHolder(),
- EclipseLinkCustomizer.SPECIFIED_CUSTOMIZER_CLASS_PROPERTY,
- EclipseLinkCustomizer.DEFAULT_CUSTOMIZER_CLASS_PROPERTY) {
-
- @Override
- protected String buildValue_() {
- String value = this.subject.getSpecifiedCustomizerClass();
- return (value == null) ? defaultText(this.subject) : value;
- }
-
- @Override
- protected void setValue_(String value) {
- if (value == null
- || value.length() == 0
- || value.equals(defaultText(this.subject))) {
- value = null;
- }
- this.subject.setSpecifiedCustomizerClass(value);
- }
- };
- }
-
- protected String defaultText(EclipseLinkCustomizer customizer) {
- String defaultClassName = customizer.getDefaultCustomizerClass();
- return (defaultClassName == null) ?
- JptCommonUiMessages.NoneSelected
- : NLS.bind(JptCommonUiMessages.DefaultWithOneParam, defaultClassName);
- }
-
- @Override
- protected ListValueModel<String> buildClassListHolder() {
- return new PropertyListValueModelAdapter<String>(
- new PropertyAspectAdapter<EclipseLinkCustomizer, String>(
- getSubjectHolder(), EclipseLinkCustomizer.DEFAULT_CUSTOMIZER_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return defaultText(this.subject);
- }
- });
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkDisableHitsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkDisableHitsComposite.java
deleted file mode 100644
index 56ae323acd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkDisableHitsComposite.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows a tri-state check box for the Disable Hits option.
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkDisableHitsComposite extends Pane<EclipseLinkCaching>
-{
- /**
- * Creates a new <code>OptionalComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkDisableHitsComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent)
- {
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkDisableHitsComposite_disableHitsLabel,
- buildDisableHitsHolder(),
- buildDisableHitsStringHolder(),
- EclipseLinkHelpContextIds.CACHING_DISABLE_HITS
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildDisableHitsHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_DISABLE_HITS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedDisableHits();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedDisableHits(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildDisableHitsStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultDisableHitsHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkDisableHitsComposite_disableHitsDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkDisableHitsComposite_disableHitsLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultDisableHitsHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_DISABLE_HITS_PROPERTY,
- EclipseLinkCaching.DEFAULT_DISABLE_HITS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedDisableHits() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultDisableHits());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMapping2_0Composite.java
deleted file mode 100644
index 9828df15e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkElementCollectionMapping2_0Composite.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class EclipseLinkElementCollectionMapping2_0Composite<T extends ElementCollectionMapping2_0>
- extends AbstractElementCollectionMapping2_0Composite<T>
-{
-
- protected EclipseLinkElementCollectionMapping2_0Composite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeElementCollectionCollapsibleSection(container);
- initializeValueCollapsibleSection(container);
- initializeKeyCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeOrderingCollapsibleSection(container);
- }
-
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<EclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected PropertyValueModel<EclipseLinkConverterContainer> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<T, EclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return ((EclipseLinkElementCollectionMapping2_0) this.subject).getConverterContainer();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkEmbeddableAdvancedComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkEmbeddableAdvancedComposite.java
deleted file mode 100644
index f34b6ce371..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkEmbeddableAdvancedComposite.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEmbeddable;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkEmbeddableAdvancedComposite extends Pane<Embeddable> {
-
- public EclipseLinkEmbeddableAdvancedComposite(
- Pane<? extends Embeddable> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_advanced
- );
-
- new EclipseLinkCustomizerComposite(this, buildCustomizerHolder(), container);
- new EclipseLinkChangeTrackingComposite(this, buildChangeTrackingHolder(), container);
- }
-
- private PropertyValueModel<EclipseLinkCustomizer> buildCustomizerHolder() {
- return new PropertyAspectAdapter<Embeddable, EclipseLinkCustomizer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkCustomizer buildValue_() {
- return ((EclipseLinkEmbeddable) this.subject).getCustomizer();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkChangeTracking> buildChangeTrackingHolder() {
- return new PropertyAspectAdapter<Embeddable, EclipseLinkChangeTracking>(getSubjectHolder()) {
- @Override
- protected EclipseLinkChangeTracking buildValue_() {
- return ((EclipseLinkEmbeddable) this.subject).getChangeTracking();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkEntityAdvancedComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkEntityAdvancedComposite.java
deleted file mode 100644
index 5c262b66b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkEntityAdvancedComposite.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkEntityAdvancedComposite extends Pane<Entity> {
-
- public EclipseLinkEntityAdvancedComposite(
- Pane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_advanced
- );
-
- new EclipseLinkReadOnlyComposite(this, buildReadOnlyHolder(), container);
- new EclipseLinkCustomizerComposite(this, buildCustomizerHolder(), container);
- new EclipseLinkChangeTrackingComposite(this, buildChangeTrackingHolder(), container);
- }
-
- private PropertyValueModel<EclipseLinkReadOnly> buildReadOnlyHolder() {
- return new PropertyAspectAdapter<Entity, EclipseLinkReadOnly>(getSubjectHolder()) {
- @Override
- protected EclipseLinkReadOnly buildValue_() {
- return ((EclipseLinkEntity) this.subject).getReadOnly();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkCustomizer> buildCustomizerHolder() {
- return new PropertyAspectAdapter<Entity, EclipseLinkCustomizer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkCustomizer buildValue_() {
- return ((EclipseLinkEntity) this.subject).getCustomizer();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkChangeTracking> buildChangeTrackingHolder() {
- return new PropertyAspectAdapter<Entity, EclipseLinkChangeTracking>(getSubjectHolder()) {
- @Override
- protected EclipseLinkChangeTracking buildValue_() {
- return ((EclipseLinkEntity) this.subject).getChangeTracking();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java
deleted file mode 100644
index a52b96fd97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkExpiryComposite.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Expiry -------------------------------------------------------------- | |
- * | | | |
- * | | o No expiry | |
- * | | ---------------- | |
- * | | o Time to live expiry Expire after | I |I| milliseconds | |
- * | | ---------------- | |
- * | | -------------------- | |
- * | | o Daily expiry Expire at | HH:MM:SS:AM/PM |I| | |
- * | | -------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkTimeOfDay
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkExpiryComposite extends Pane<EclipseLinkCaching> {
- protected PropertyValueModel<Boolean> ttlEnabled;
-
- public EclipseLinkExpiryComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * lazy init because we need it while the superclass constructor is
- * executing
- */
- protected PropertyValueModel<Boolean> getTtlEnabled() {
- if (this.ttlEnabled == null) {
- this.ttlEnabled = this.buildTimeToLiveExpiryEnabler();
- }
- return this.ttlEnabled;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Expiry group pane
- Group expiryGroupPane = addTitledGroup(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_expirySection,
- 2,
- null
- );
-
- // No Expiry radio button
- Button button = addRadioButton(
- expiryGroupPane,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_noExpiry,
- buildNoExpiryHolder(),
- null
- );
- GridData gridData = new GridData();
- gridData.horizontalSpan = 2;
- button.setLayoutData(gridData);
-
-
- // Time To Live Expiry radio button
- addRadioButton(
- expiryGroupPane,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_timeToLiveExpiry,
- buildExpiryHolder(),
- null
- );
-
- addTimeToLiveComposite(expiryGroupPane);
-
- // Daily Expiry radio button
- addRadioButton(
- expiryGroupPane,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_dailyExpiry,
- buildTimeOfDayExpiryBooleanHolder(),
- null
- );
-
- addTimeOfDayComposite(expiryGroupPane);
- }
-
- protected void addTimeToLiveComposite(Composite parent) {
- Composite container = this.addSubPane(parent, 3, 0, 10, 0, 0);
-
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_timeToLiveExpiryExpireAfter,
- this.getTtlEnabled()
- );
-
- IntegerCombo<?> combo = addTimeToLiveExpiryCombo(container);
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = false;
- combo.getControl().setLayoutData(gridData);
-
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_timeToLiveExpiryMilliseconds,
- this.getTtlEnabled()
- );
- }
-
- protected void addTimeOfDayComposite(Composite parent) {
- Composite container = this.addSubPane(parent, 2, 0, 10, 0, 0);
-
- PropertyValueModel<Boolean> todEnabled = this.buildTimeOfDayExpiryEnabler();
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExpiryComposite_timeOfDayExpiryExpireAt,
- todEnabled
- );
-
- PropertyValueModel<EclipseLinkTimeOfDay> timeOfDayExpiryHolder = buildTimeOfDayExpiryHolder();
- addDateTime(
- container,
- buildTimeOfDayExpiryHourHolder(timeOfDayExpiryHolder),
- buildTimeOfDayExpiryMinuteHolder(timeOfDayExpiryHolder),
- buildTimeOfDayExpirySecondHolder(timeOfDayExpiryHolder),
- null,
- todEnabled
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildNoExpiryHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.EXPIRY_PROPERTY,
- EclipseLinkCaching.EXPIRY_TIME_OF_DAY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiry() == null && this.subject.getExpiryTimeOfDay() == null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setExpiry(null);
- if (this.subject.getExpiryTimeOfDay() != null) {
- this.subject.removeExpiryTimeOfDay();
- }
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildExpiryHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.EXPIRY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiry() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setExpiry(Integer.valueOf(0));
- }
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildTimeOfDayExpiryBooleanHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.EXPIRY_TIME_OF_DAY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiryTimeOfDay() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE && this.subject.getExpiryTimeOfDay() == null) {
- this.subject.addExpiryTimeOfDay();
- }
- }
- };
- }
-
- private IntegerCombo<EclipseLinkCaching> addTimeToLiveExpiryCombo(Composite container) {
- return new IntegerCombo<EclipseLinkCaching>(this, container) {
-
- @Override
- protected Combo addIntegerCombo(Composite container) {
- return this.addEditableCombo(
- container,
- buildDefaultListHolder(),
- buildSelectedItemStringHolder(),
- StringConverter.Default.<String>instance(),
- EclipseLinkExpiryComposite.this.getTtlEnabled()
- );
- }
-
- @Override
- protected String getLabelText() {
- throw new UnsupportedOperationException();
- }
-
-
- @Override
- protected String getHelpId() {
- return null;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(0);
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Integer>(getSubjectHolder(), EclipseLinkCaching.EXPIRY_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getExpiry();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setExpiry(value);
- }
- };
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildTimeToLiveExpiryEnabler() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.EXPIRY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiry() != null);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildTimeOfDayExpiryEnabler() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.EXPIRY_TIME_OF_DAY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getExpiryTimeOfDay() != null);
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkTimeOfDay> buildTimeOfDayExpiryHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, EclipseLinkTimeOfDay>(getSubjectHolder(), EclipseLinkCaching.EXPIRY_TIME_OF_DAY_PROPERTY) {
- @Override
- protected EclipseLinkTimeOfDay buildValue_() {
- return this.subject.getExpiryTimeOfDay();
- }
- };
- }
-
- private ModifiablePropertyValueModel<Integer> buildTimeOfDayExpiryHourHolder(PropertyValueModel<EclipseLinkTimeOfDay> timeOfDayExpiryHolder) {
- return new PropertyAspectAdapter<EclipseLinkTimeOfDay, Integer>(
- timeOfDayExpiryHolder,
- EclipseLinkTimeOfDay.HOUR_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getHour();
- }
-
- @Override
- protected void setValue_(Integer hour) {
- this.subject.setHour(hour);
- }
- };
- }
-
- private ModifiablePropertyValueModel<Integer> buildTimeOfDayExpiryMinuteHolder(PropertyValueModel<EclipseLinkTimeOfDay> timeOfDayExpiryHolder) {
- return new PropertyAspectAdapter<EclipseLinkTimeOfDay, Integer>(
- timeOfDayExpiryHolder,
- EclipseLinkTimeOfDay.MINUTE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getMinute();
- }
-
- @Override
- protected void setValue_(Integer minute) {
- this.subject.setMinute(minute);
- }
- };
- }
-
- private ModifiablePropertyValueModel<Integer> buildTimeOfDayExpirySecondHolder(PropertyValueModel<EclipseLinkTimeOfDay> timeOfDayExpiryHolder) {
- return new PropertyAspectAdapter<EclipseLinkTimeOfDay, Integer>(
- timeOfDayExpiryHolder,
- EclipseLinkTimeOfDay.SECOND_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSecond();
- }
-
- @Override
- protected void setValue_(Integer second) {
- this.subject.setSecond(second);
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java
deleted file mode 100644
index bc5ba09e79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkIdMappingComposite.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractIdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.TemporalTypeComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class EclipseLinkIdMappingComposite<T extends IdMapping>
- extends AbstractIdMappingComposite<T>
-{
- protected EclipseLinkIdMappingComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeIdSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeTypeSection(Composite container) {
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- // No converter
- Button noConverterButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_default,
- buildConverterBooleanHolder(null),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_temporal,
- buildConverterBooleanHolder(BaseTemporalConverter.class),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), container, getWidgetFactory()));
-
- // EclipseLink Converter
- Button elConverterButton = addRadioButton(
- container,
- EclipseLinkUiDetailsMessages.TypeSection_converted,
- buildConverterBooleanHolder(EclipseLinkConvert.class),
- null);
- ((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
-
- Pane<EclipseLinkConvert> convertComposite = buildConvertComposite(buildEclipseLinkConverterHolder(converterHolder), container);
- GridData gridData = (GridData) convertComposite.getControl().getLayoutData();
- gridData.horizontalSpan = 2;
- gridData.horizontalIndent = 20;
- registerSubPane(convertComposite);
- }
-
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new EclipseLinkConvertComposite(convertHolder, container, getWidgetFactory());
- }
-
- protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, EclipseLinkConvert>(converterHolder) {
- @Override
- protected EclipseLinkConvert transform_(Converter converter) {
- return converter.getType() == EclipseLinkConvert.class ? (EclipseLinkConvert) converter : null;
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkMutable> buildMutableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkMutable>(getSubjectHolder()) {
- @Override
- protected EclipseLinkMutable buildValue_() {
- return ((EclipseLinkIdMapping) this.subject).getMutable();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<EclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected PropertyValueModel<EclipseLinkConverterContainer> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<IdMapping, EclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return ((EclipseLinkIdMapping) this.subject).getConverterContainer();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java
deleted file mode 100644
index df171368ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkJoinFetchComposite.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.FetchableMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.ui.internal.details.BasicMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.java.JavaManyToManyMapping2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------------- |
- * | Join Fetch: | |v| |
- * | ---------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see FetchableMapping
- * @see BasicMappingComposite - A container of this widget
- * @see JavaManyToManyMapping2_0Composite - A container of this widget
- * @see OrmManyToOneMappingComposite - A container of this widget
- * @see OrmOneToManyMappingComposite - A container of this widget
- * @see OrmOneToOneMappingComposite - A container of this widget
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkJoinFetchComposite extends Pane<EclipseLinkJoinFetch> {
-
- /**
- * Creates a new <code>JoinFetchComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkJoinFetchComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkJoinFetch> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addLabeledComposite(
- container,
- addLabel(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkJoinFetchComposite_label),
- addJoinFetchTypeCombo(container).getControl(),
- null
- );
- }
-
-
- private EnumFormComboViewer<EclipseLinkJoinFetch, EclipseLinkJoinFetchType> addJoinFetchTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkJoinFetch, EclipseLinkJoinFetchType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkJoinFetch.VALUE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkJoinFetchType[] getChoices() {
- return EclipseLinkJoinFetchType.values();
- }
-
- @Override
- protected EclipseLinkJoinFetchType getDefaultValue() {
- return null;
- }
-
- @Override
- protected String displayString(EclipseLinkJoinFetchType value) {
- switch (value) {
- case INNER :
- return EclipseLinkUiDetailsMessages.EclipseLinkJoinFetchComposite_inner;
- case OUTER :
- return EclipseLinkUiDetailsMessages.EclipseLinkJoinFetchComposite_outer;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected String nullDisplayString() {
- return JptCommonUiMessages.NoneSelected;
- }
-
- @Override
- protected EclipseLinkJoinFetchType getValue() {
- return getSubject().getValue();
- }
-
- @Override
- protected void setValue(EclipseLinkJoinFetchType value) {
- getSubject().setValue(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java
deleted file mode 100644
index 12693963e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToManyMappingComposite.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToManyJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToManyJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link CascadeComposite}
- * @see {@link OrderingComposite}
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkManyToManyMappingComposite<T extends ManyToManyMapping>
- extends AbstractManyToManyMappingComposite<T, ManyToManyRelationship>
- implements JpaComposite
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkManyToManyMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<ManyToManyMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkRelationshipMapping) this.subject).getJoinFetch();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<EclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected PropertyValueModel<EclipseLinkConverterContainer> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<ManyToManyMapping, EclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return ((EclipseLinkManyToManyMapping) this.subject).getConverterContainer();
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToOneMappingComposite.java
deleted file mode 100644
index 6f02f8a73d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkManyToOneMappingComposite.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToOneJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToOneJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link OptionalComposite}
- * @see {@link CascadeComposite}
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkManyToOneMappingComposite<T extends ManyToOneMapping>
- extends AbstractManyToOneMappingComposite<T, ManyToOneRelationship>
-{
- /**
- * Creates a new <code>EclipseLinkManyToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkManyToOneMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkRelationshipMapping) this.subject).getJoinFetch();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMappedSuperclassAdvancedComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMappedSuperclassAdvancedComposite.java
deleted file mode 100644
index 05dac7b39a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMappedSuperclassAdvancedComposite.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkMappedSuperclassAdvancedComposite extends Pane<MappedSuperclass> {
-
- public EclipseLinkMappedSuperclassAdvancedComposite(
- Pane<? extends MappedSuperclass> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_advanced
- );
-
- new EclipseLinkReadOnlyComposite(this, buildReadOnlyHolder(), container);
- new EclipseLinkCustomizerComposite(this, buildCustomizerHolder(), container);
- new EclipseLinkChangeTrackingComposite(this, buildChangeTrackingHolder(), container);
- }
-
- private PropertyValueModel<EclipseLinkReadOnly> buildReadOnlyHolder() {
- return new PropertyAspectAdapter<MappedSuperclass, EclipseLinkReadOnly>(getSubjectHolder()) {
- @Override
- protected EclipseLinkReadOnly buildValue_() {
- return ((EclipseLinkMappedSuperclass) this.subject).getReadOnly();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkCustomizer> buildCustomizerHolder() {
- return new PropertyAspectAdapter<MappedSuperclass, EclipseLinkCustomizer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkCustomizer buildValue_() {
- return ((EclipseLinkMappedSuperclass) this.subject).getCustomizer();
- }
- };
- }
-
- private PropertyValueModel<EclipseLinkChangeTracking> buildChangeTrackingHolder() {
- return new PropertyAspectAdapter<MappedSuperclass, EclipseLinkChangeTracking>(getSubjectHolder()) {
- @Override
- protected EclipseLinkChangeTracking buildValue_() {
- return ((EclipseLinkMappedSuperclass) this.subject).getChangeTracking();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMultitenancyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMultitenancyComposite.java
deleted file mode 100644
index d680a36f4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMultitenancyComposite.java
+++ /dev/null
@@ -1,399 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ReadOnlyWritablePropertyValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ValueListAdapter;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.TenantDiscriminatorColumnsComposite.TenantDiscriminatorColumnsEditor;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ----------------------------------------------- | |
- * | Multitenant strategy: | EnumComboViewer |v| | |
- * | ----------------------------------------------- | |
- * | |
- * | - Tenant discriminator columns ---------------------------------------- | |
- * | | | |
- * | | x Override Default | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | TenantDiscriminatorColumnsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- *
- * @version 3.1
- * @since 3.1
- */
-public class EclipseLinkMultitenancyComposite extends Pane<EclipseLinkMultitenancy2_3>
-{
- private TenantDiscriminatorColumnsComposite<EclipseLinkMultitenancy2_3> tenantDiscriminatorColumnsComposite;
-
- public EclipseLinkMultitenancyComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkMultitenancy2_3> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- int groupBoxMargin = getGroupBoxMargin();
-
- Composite subPane = addSubPane(
- container, 0, groupBoxMargin, 0, groupBoxMargin
- );
-
- // Strategy widgets
- addLabeledComposite(
- subPane,
- addCheckBox(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkMultitenancyComposite_strategy,
- builMultitenantHolder(),
- null
- ),
- addMultitenantStrategyCombo(subPane).getControl(),
- EclipseLinkHelpContextIds.MULTITENANCY_STRATEGY
- );
-
- // Include criteria tri-state check box
- TriStateCheckBox includeCriteriaCheckBox = addTriStateCheckBoxWithDefault(
- subPane,
- EclipseLinkUiDetailsMessages.EclipseLinkMultitenancyComposite_includeCriteria,
- buildIncludeCriteriaHolder(),
- buildIncludeCriteriaStringHolder(),
- EclipseLinkHelpContextIds.MULTITENANCY_INCLUDE_CRITERIA);
-
- SWTTools.controlVisibleState(new EclipseLink2_4ProjectFlagModel<EclipseLinkMultitenancy2_3>(this.getSubjectHolder()), includeCriteriaCheckBox.getCheckBox());
-
- // Tenant discriminator columns group pane
- Group tenantDiscriminatorColumnGroupPane = addTitledGroup(
- container,
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumns_groupLabel
- );
-
- // Override Default Tenant Discriminator Columns check box
- addCheckBox(
- addSubPane(tenantDiscriminatorColumnGroupPane, 8),
- EclipseLinkUiDetailsMessages.EclipseLinkMultitenancy_overrideDefaultTenantDiscriminatorColumns,
- buildOverrideDefaultTenantDiscriminatorColumnHolder(),
- null
- );
-
- this.tenantDiscriminatorColumnsComposite = this.buildTenantDiscriminatorColumnsComposite(tenantDiscriminatorColumnGroupPane);
-
- this.tenantDiscriminatorColumnsComposite.installListPaneEnabler(new TenantDiscriminatorColumnPaneEnablerHolder());
- }
-
- private ModifiablePropertyValueModel<Boolean> builMultitenantHolder() {
- return new PropertyAspectAdapter<EclipseLinkMultitenancy2_3, Boolean>(getSubjectHolder(), EclipseLinkMultitenancy2_3.SPECIFIED_MULTITENANT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isSpecifiedMultitenant());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedMultitenant(value.booleanValue());
- }
- };
- }
- private EnumFormComboViewer<EclipseLinkMultitenancy2_3, EclipseLinkMultitenantType2_3> addMultitenantStrategyCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkMultitenancy2_3, EclipseLinkMultitenantType2_3>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkMultitenancy2_3.DEFAULT_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkMultitenancy2_3.SPECIFIED_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkMultitenantType2_3[] getChoices() {
- return EclipseLinkMultitenantType2_3.values();
- }
-
- @Override
- protected EclipseLinkMultitenantType2_3 getDefaultValue() {
- return getSubject().getDefaultType();
- }
-
- @Override
- protected String displayString(EclipseLinkMultitenantType2_3 value) {
- switch (value) {
- case SINGLE_TABLE :
- return EclipseLinkUiDetailsMessages.EclipseLinkMultitenancyComposite_single_table;
- case TABLE_PER_TENANT :
- return EclipseLinkUiDetailsMessages.EclipseLinkMultitenancyComposite_table_per_tenant;
- case VPD :
- return EclipseLinkUiDetailsMessages.EclipseLinkMultitenancyComposite_vpd;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected EclipseLinkMultitenantType2_3 getValue() {
- return getSubject().getSpecifiedType();
- }
-
- @Override
- protected void setValue(EclipseLinkMultitenantType2_3 value) {
- getSubject().setSpecifiedType(value);
- }
- };
- }
-
- ModifiablePropertyValueModel<Boolean> buildIncludeCriteriaHolder() {
- return new PropertyAspectAdapter<EclipseLinkMultitenancy2_3, Boolean>(getSubjectHolder(), EclipseLinkMultitenancy2_3.SPECIFIED_INCLUDE_CRITERIA_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedIncludeCriteria();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedIncludeCriteria(value);
- }
- };
- }
-
- PropertyValueModel<String> buildIncludeCriteriaStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultIncludeCriteriaHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkMultitenancyComposite_includeCriteriaWithDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkMultitenancyComposite_includeCriteria;
- }
- };
- }
-
- PropertyValueModel<Boolean> buildDefaultIncludeCriteriaHolder() {
- return new PropertyAspectAdapter<EclipseLinkMultitenancy2_3, Boolean>(
- getSubjectHolder(),
- EclipseLinkMultitenancy2_3.SPECIFIED_INCLUDE_CRITERIA_PROPERTY,
- EclipseLinkMultitenancy2_3.DEFAULT_INCLUDE_CRITERIA_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedIncludeCriteria() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isIncludeCriteria());
- }
- };
- }
-
- protected TenantDiscriminatorColumnsComposite<EclipseLinkMultitenancy2_3> buildTenantDiscriminatorColumnsComposite(Composite container) {
- return new TenantDiscriminatorColumnsComposite<EclipseLinkMultitenancy2_3>(
- getSubjectHolder(),
- container,
- getWidgetFactory(),
- buildTenantDiscriminatorColumnsEditor());
- }
-
- protected TenantDiscriminatorColumnsEditor<EclipseLinkMultitenancy2_3> buildTenantDiscriminatorColumnsEditor() {
- return new TenantDiscriminatorColumnsProvider();
- }
-
- class TenantDiscriminatorColumnsProvider implements TenantDiscriminatorColumnsEditor<EclipseLinkMultitenancy2_3> {
-
- public void addTenantDiscriminatorColumn(EclipseLinkMultitenancy2_3 subject) {
- TenantDiscriminatorColumn2_3 column = subject.addSpecifiedTenantDiscriminatorColumn();
- column.setSpecifiedName(ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME);
- }
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns(EclipseLinkMultitenancy2_3 subject) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(subject.getDefaultTenantDiscriminatorColumns());
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize(EclipseLinkMultitenancy2_3 subject) {
- return subject.getDefaultTenantDiscriminatorColumnsSize();
- }
-
- public String getDefaultTenantDiscriminatorsListPropertyName() {
- return EclipseLinkMultitenancy2_3.DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns(EclipseLinkMultitenancy2_3 subject) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(subject.getSpecifiedTenantDiscriminatorColumns());
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize(EclipseLinkMultitenancy2_3 subject) {
- return subject.getSpecifiedTenantDiscriminatorColumnsSize();
- }
-
- public String getSpecifiedTenantDiscriminatorsListPropertyName() {
- return EclipseLinkMultitenancy2_3.SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns(EclipseLinkMultitenancy2_3 subject) {
- return subject.hasSpecifiedTenantDiscriminatorColumns();
- }
-
- public void removeTenantDiscriminatorColumns(EclipseLinkMultitenancy2_3 subject, int[] selectedIndices) {
- for (int index = selectedIndices.length; index-- > 0; ) {
- subject.removeSpecifiedTenantDiscriminatorColumn(selectedIndices[index]);
- }
- }
- }
-
- void setSelectedTenantDiscriminatorColumn(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.tenantDiscriminatorColumnsComposite.setSelectedTenantDiscriminatorColumn(tenantDiscriminatorColumn);
- }
-
- private ModifiablePropertyValueModel<Boolean> buildOverrideDefaultTenantDiscriminatorColumnHolder() {
- return new OverrideDefaultTenantDiscriminatorColumnHolder();
- }
-
- ListValueModel<ReadOnlyTenantDiscriminatorColumn2_3> buildSpecifiedTenantDiscriminatorColumnsListHolder() {
- return new ListAspectAdapter<EclipseLinkMultitenancy2_3, ReadOnlyTenantDiscriminatorColumn2_3>(
- getSubjectHolder(), EclipseLinkMultitenancy2_3.SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST) {
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getListIterable() {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(this.subject.getSpecifiedTenantDiscriminatorColumns());
- }
- @Override
- protected int size_() {
- return this.subject.getSpecifiedTenantDiscriminatorColumnsSize();
- }
- };
- }
-
- private class OverrideDefaultTenantDiscriminatorColumnHolder
- extends ListPropertyValueModelAdapter<Boolean>
- implements ModifiablePropertyValueModel<Boolean>
- {
- public OverrideDefaultTenantDiscriminatorColumnHolder() {
- super(buildSpecifiedTenantDiscriminatorColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.listModel.size() > 0);
- }
-
- public void setValue(Boolean value) {
- updateTenantDiscriminatorColumns(value.booleanValue());
- }
-
- private void updateTenantDiscriminatorColumns(boolean selected) {
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- EclipseLinkMultitenancy2_3 subject = getSubject();
-
- if (selected) {
- TenantDiscriminatorColumn2_3 newTenantDiscriminatorColumn = subject.addSpecifiedTenantDiscriminatorColumn();
- newTenantDiscriminatorColumn.setSpecifiedName(ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME);
- }
- // Remove all the specified tenant discriminator columns
- else {
- for (int index = subject.getSpecifiedTenantDiscriminatorColumnsSize(); --index >= 0; ) {
- subject.removeSpecifiedTenantDiscriminatorColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
- }
-
- /* CU private */ class TenantDiscriminatorColumnPaneEnablerHolder
- extends TransformationPropertyValueModel<EclipseLinkMultitenancy2_3, Boolean>
- {
- private StateChangeListener stateChangeListener;
-
- TenantDiscriminatorColumnPaneEnablerHolder() {
- super(
- new ValueListAdapter<EclipseLinkMultitenancy2_3>(
- new ReadOnlyWritablePropertyValueModelWrapper<EclipseLinkMultitenancy2_3>(getSubjectHolder()),
- EclipseLinkMultitenancy2_3.SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST
- )
- );
- this.stateChangeListener = this.buildStateChangeListener();
- }
-
- private StateChangeListener buildStateChangeListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- TenantDiscriminatorColumnPaneEnablerHolder.this.valueStateChanged();
- }
- };
- }
-
- void valueStateChanged() {
- Object old = this.value;
- this.value = this.transform(this.valueModel.getValue());
- this.firePropertyChanged(VALUE, old, this.value);
- }
-
- @Override
- protected Boolean transform(EclipseLinkMultitenancy2_3 v) {
- return (v == null) ? Boolean.FALSE : super.transform(v);
- }
-
- @Override
- protected Boolean transform_(EclipseLinkMultitenancy2_3 v) {
- return Boolean.valueOf(v.getSpecifiedTenantDiscriminatorColumnsSize() > 0);
- }
-
- @Override
- protected void engageModel() {
- super.engageModel();
- this.valueModel.addStateChangeListener(this.stateChangeListener);
- }
-
- @Override
- protected void disengageModel() {
- this.valueModel.removeStateChangeListener(this.stateChangeListener);
- super.disengageModel();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMutableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMutableComposite.java
deleted file mode 100644
index 226c36fec8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkMutableComposite.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows a tri-state check box for the Mutable option.
- *
- * @see EclipseLinkMutable
- * @see EclipseLinkBasicMappingComposite - A container of this pane
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkMutableComposite extends Pane<EclipseLinkMutable>
-{
- /**
- * Creates a new <code>MutableComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkMutableComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkMutable> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkMutableComposite_mutableLabel,
- buildMutableHolder(),
- buildMutableStringHolder(),
- null
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildMutableHolder() {
- return new PropertyAspectAdapter<EclipseLinkMutable, Boolean>(getSubjectHolder(), EclipseLinkMutable.SPECIFIED_MUTABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedMutable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedMutable(value);
- }
-
- };
- }
-
- private PropertyValueModel<String> buildMutableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultMutableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkMutableComposite_mutableLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkMutableComposite_mutableLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultMutableHolder() {
- return new PropertyAspectAdapter<EclipseLinkMutable, Boolean>(
- getSubjectHolder(),
- EclipseLinkMutable.SPECIFIED_MUTABLE_PROPERTY,
- EclipseLinkMutable.DEFAULT_MUTABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedMutable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultMutable());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java
deleted file mode 100644
index b926359657..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkObjectTypeConverterComposite.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveTablePane;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Name: | ||
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConverter
- * @see EclipseLinkConvertComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkObjectTypeConverterComposite extends Pane<EclipseLinkObjectTypeConverter>
-{
-
- /**
- * Creates a new <code>ObjectTypeConverterComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkObjectTypeConverterComposite(PropertyValueModel<? extends EclipseLinkObjectTypeConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_nameTextLabel,
- buildNameTextHolder());
-
- addDataTypeChooser(container);
- addObjectTypeChooser(container);
-
- addConversionValuesTable(container);
-
- addLabeledEditableCombo(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_defaultObjectValueLabel,
- buildDefaultObjectValueListHolder(),
- buildDefaultObjectValueHolder(),
- buildStringConverter(),
- null
- );
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected ModifiablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkObjectTypeConverter, String>(
- getSubjectHolder(), JpaNamedContextNode.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
- private ClassChooserPane<EclipseLinkObjectTypeConverter> addDataTypeChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkObjectTypeConverter>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkObjectTypeConverter, String>(getSubjectHolder(), EclipseLinkObjectTypeConverter.DATA_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDataType();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setDataType(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getDataType();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_dataTypeLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setDataType(className);
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedDataType();
- }
- };
- }
-
- private ClassChooserPane<EclipseLinkObjectTypeConverter> addObjectTypeChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkObjectTypeConverter>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkObjectTypeConverter, String>(getSubjectHolder(), EclipseLinkObjectTypeConverter.OBJECT_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getObjectType();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setObjectType(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getObjectType();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_objectTypeLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setObjectType(className);
- }
-
- @Override
- protected int getTypeDialogStyle() {
- return IJavaElementSearchConstants.CONSIDER_CLASSES_AND_ENUMS;
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedObjectType();
- }
- };
- }
-
- protected void addConversionValuesTable(Composite container) {
-
- // Join Columns group pane
- Group conversionValuesGroupPane = addTitledGroup(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_conversionValuesGroupTitle
- );
-
- ModifiablePropertyValueModel<EclipseLinkConversionValue> conversionValueHolder =
- buildConversionValueHolder();
- // Conversion Values add/remove list pane
- new AddRemoveTablePane<EclipseLinkObjectTypeConverter>(
- this,
- conversionValuesGroupPane,
- buildConversionValuesAdapter(),
- buildConversionValuesListModel(),
- conversionValueHolder,
- buildConversionValuesLabelProvider(),
- null//TODO need a help context id for this
- ) {
- @Override
- protected ColumnAdapter<EclipseLinkConversionValue> buildColumnAdapter() {
- return new ConversionValueColumnAdapter();
- }
- };
-
- }
-
- protected ModifiablePropertyValueModel<EclipseLinkConversionValue> buildConversionValueHolder() {
- return new SimplePropertyValueModel<EclipseLinkConversionValue>();
- }
-
- protected AddRemoveListPane.Adapter buildConversionValuesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- EclipseLinkConversionValueDialog dialog = buildConversionValueDialogForAdd();
- addConversionValueFromDialog(dialog, listSelectionModel);
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_conversionValueEdit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- EclipseLinkConversionValue conversionValue = (EclipseLinkConversionValue) listSelectionModel.selectedValue();
- EclipseLinkConversionValueDialog dialog = new EclipseLinkConversionValueDialog(getShell(), getSubject(), conversionValue);
- editConversionValueFromDialog(dialog, conversionValue);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- EclipseLinkObjectTypeConverter converter = getSubject();
- int[] selectedIndices = listSelectionModel.selectedIndices();
-
- for (int index = selectedIndices.length; --index >= 0; ) {
- converter.removeConversionValue(selectedIndices[index]);
- }
- }
- };
- }
-
-
- protected EclipseLinkConversionValueDialog buildConversionValueDialogForAdd() {
- return new EclipseLinkConversionValueDialog(getShell(), getSubject());
- }
-
- protected void addConversionValueFromDialog(EclipseLinkConversionValueDialog dialog, ObjectListSelectionModel listSelectionModel) {
- if (dialog.open() != Window.OK) {
- return;
- }
-
- EclipseLinkConversionValue conversionValue = this.getSubject().addConversionValue();
- conversionValue.setDataValue(dialog.getDataValue());
- conversionValue.setObjectValue(dialog.getObjectValue());
-
- listSelectionModel.setSelectedValue(conversionValue);
- }
-
- protected void editConversionValueFromDialog(EclipseLinkConversionValueDialog dialog, EclipseLinkConversionValue conversionValue) {
- if (dialog.open() != Window.OK) {
- return;
- }
-
- conversionValue.setDataValue(dialog.getDataValue());
- conversionValue.setObjectValue(dialog.getObjectValue());
- }
-
- private ListValueModel<EclipseLinkConversionValue> buildConversionValuesListModel() {
- return new ItemPropertyListValueModelAdapter<EclipseLinkConversionValue>(buildConversionValuesListHolder(),
- EclipseLinkConversionValue.DATA_VALUE_PROPERTY,
- EclipseLinkConversionValue.OBJECT_VALUE_PROPERTY);
- }
-
- private ListValueModel<EclipseLinkConversionValue> buildConversionValuesListHolder() {
- return new ListAspectAdapter<EclipseLinkObjectTypeConverter, EclipseLinkConversionValue>(getSubjectHolder(), EclipseLinkObjectTypeConverter.CONVERSION_VALUES_LIST) {
- @Override
- protected ListIterable<EclipseLinkConversionValue> getListIterable() {
- return new SuperListIterableWrapper<EclipseLinkConversionValue>(this.subject.getConversionValues());
- }
-
- @Override
- protected int size_() {
- return this.subject.getConversionValuesSize();
- }
- };
- }
-
- private ITableLabelProvider buildConversionValuesLabelProvider() {
- return new TableLabelProvider();
- }
-
- protected ListValueModel<String> buildDefaultObjectValueListHolder() {
- return new TransformationListValueModel<EclipseLinkConversionValue, String>(buildConversionValuesListModel()) {
- @Override
- protected String transformItem(EclipseLinkConversionValue conversionValue) {
- return conversionValue.getObjectValue();
- }
- };
- }
-
- protected ModifiablePropertyValueModel<String> buildDefaultObjectValueHolder() {
- return new PropertyAspectAdapter<EclipseLinkObjectTypeConverter, String>(
- getSubjectHolder(), EclipseLinkObjectTypeConverter.DEFAULT_OBJECT_VALUE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDefaultObjectValue();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value != null && value.length() == 0) {
- value = null;
- }
- this.subject.setDefaultObjectValue(value);
- }
- };
- }
-
- protected final StringConverter<String> buildStringConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- return (value == null) ? "" : value; //$NON-NLS-1$
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkObjectTypeConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkObjectTypeConverter value) {
- return Boolean.valueOf(value != null);
- }
- };
- }
-
- private class TableLabelProvider extends LabelProvider
- implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
-
- EclipseLinkConversionValue conversionValue = (EclipseLinkConversionValue) element;
- String value = null;
-
- switch (columnIndex) {
- case ConversionValueColumnAdapter.DATA_VALUE_COLUMN: {
- value = conversionValue.getDataValue();
- break;
- }
-
- case ConversionValueColumnAdapter.OBJECT_VALUE_COLUMN: {
- value = conversionValue.getObjectValue();
- break;
- }
- }
-
- if (value == null) {
- value = ""; //$NON-NLS-1$
- }
-
- return value;
- }
- }
-
- private static class ConversionValueColumnAdapter implements ColumnAdapter<EclipseLinkConversionValue> {
-
- public static final int COLUMN_COUNT = 2;
- //public static final int SELECTION_COLUMN = 0;
- public static final int DATA_VALUE_COLUMN = 0;
- public static final int OBJECT_VALUE_COLUMN = 1;
-
- private ModifiablePropertyValueModel<String> buildDataValueHolder(EclipseLinkConversionValue subject) {
- return new PropertyAspectAdapter<EclipseLinkConversionValue, String>(EclipseLinkConversionValue.DATA_VALUE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return this.subject.getDataValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setDataValue(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildObjectValueHolder(EclipseLinkConversionValue subject) {
- return new PropertyAspectAdapter<EclipseLinkConversionValue, String>(EclipseLinkConversionValue.OBJECT_VALUE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return this.subject.getObjectValue();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setObjectValue(value);
- }
- };
- }
-
- public ModifiablePropertyValueModel<?>[] cellModels(EclipseLinkConversionValue subject) {
- ModifiablePropertyValueModel<?>[] holders = new ModifiablePropertyValueModel<?>[COLUMN_COUNT];
- //holders[SELECTION_COLUMN] = new SimplePropertyValueModel<Object>();
- holders[DATA_VALUE_COLUMN] = buildDataValueHolder(subject);
- holders[OBJECT_VALUE_COLUMN] = buildObjectValueHolder(subject);
- return holders;
- }
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int columnIndex) {
-
- switch (columnIndex) {
- case ConversionValueColumnAdapter.DATA_VALUE_COLUMN: {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_conversionValuesDataValueColumn;
- }
-
- case ConversionValueColumnAdapter.OBJECT_VALUE_COLUMN: {
- return EclipseLinkUiDetailsMessages.EclipseLinkObjectTypeConverterComposite_conversionValuesObjectValueColumn;
- }
-
- default: {
- return null;
- }
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToManyJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToManyJoiningStrategyPane.java
deleted file mode 100644
index 75cb9f7fde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToManyJoiningStrategyPane.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinColumnJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinTableJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.MappedByJoiningStrategyPane;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkOneToManyJoiningStrategyPane
- extends Pane<EclipseLinkOneToManyRelationship>
-{
- public EclipseLinkOneToManyJoiningStrategyPane(
- Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkOneToManyRelationship> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages.Joining_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_mappedByLabel,
- MappedByJoiningStrategyPane.buildUsesMappedByJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new MappedByJoiningStrategyPane(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinColumnJoiningLabel,
- JoinColumnJoiningStrategyPane.buildUsesJoinColumnJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- JoinColumnJoiningStrategyPane.
- buildJoinColumnJoiningStrategyPaneWithIncludeOverrideCheckBox(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinTableJoiningLabel,
- JoinTableJoiningStrategyPane.buildUsesJoinTableJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new JoinTableJoiningStrategyPane(this, composite);
-
- addSubPane(composite, 5);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToManyMappingComposite.java
deleted file mode 100644
index 7432fa9f43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToManyMappingComposite.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkOneToManyJoiningStrategyPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkJoinFetchComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkvateOwnedComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToOneMapping
- * @see CascadeComposite
- * @see EclipseLinkJoinFetchComposite
- * @see EclipseLinkJoinFetchComposite
- * @see EclipseLinkOneToManyJoiningStrategyPane
- * @see FetchTypeComposite
- * @see OrderingComposite
- * @see TargetEntityComposite
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkOneToManyMappingComposite<T extends OneToManyMapping>
- extends AbstractOneToManyMappingComposite<T, EclipseLinkOneToManyRelationship>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipselinkOneToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkOneToManyMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new EclipseLinkOneToManyJoiningStrategyPane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<EclipseLinkPrivateOwned> buildPrivateOwnableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkPrivateOwned>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return ((EclipseLinkOneToManyMapping) this.subject).getPrivateOwned();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkOneToManyMapping) this.subject).getJoinFetch();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<EclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected PropertyValueModel<EclipseLinkConverterContainer> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<OneToManyMapping, EclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return ((EclipseLinkOneToManyMapping) this.subject).getConverterContainer();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToOneMappingComposite.java
deleted file mode 100644
index 68a64c196c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkOneToOneMappingComposite.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class EclipseLinkOneToOneMappingComposite<T extends OneToOneMapping>
- extends AbstractOneToOneMappingComposite<T, OneToOneRelationship>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipselinkOneToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkOneToOneMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkOneToOneMapping)this.subject).getJoinFetch();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkPrivateOwned> buildPrivateOwnableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkPrivateOwned>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return ((EclipseLinkOneToOneMapping)this.subject).getPrivateOwned();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkPrivateOwnedComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkPrivateOwnedComposite.java
deleted file mode 100644
index a02c942142..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkPrivateOwnedComposite.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows the Lob check box.
- *
- * @see BasicMapping
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkPrivateOwnedComposite extends Pane<EclipseLinkPrivateOwned>
-{
- /**
- * Creates a new <code>PrivateOwnedComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkPrivateOwnedComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkPrivateOwned> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- private PropertyAspectAdapter<EclipseLinkPrivateOwned, Boolean> buildPrivateOwnedHolder() {
-
- return new PropertyAspectAdapter<EclipseLinkPrivateOwned, Boolean>(getSubjectHolder(), EclipseLinkPrivateOwned.PRIVATE_OWNED_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isPrivateOwned());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setPrivateOwned(value.booleanValue());
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addCheckBox(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkPrivateOwnedComposite_privateOwnedLabel,
- buildPrivateOwnedHolder(),
- null
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkReadOnlyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkReadOnlyComposite.java
deleted file mode 100644
index 7d3841738f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkReadOnlyComposite.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows the Read Only check box.
- *
- * @see EclipseLinkReadOnly
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkReadOnlyComposite extends Pane<EclipseLinkReadOnly>
-{
- /**
- * Creates a new <code>ReadOnlyComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkReadOnlyComposite(Pane<?> parentPane,
- PropertyValueModel<? extends EclipseLinkReadOnly> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // read-only check box
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkReadOnlyComposite_readOnlyLabel,
- buildSpecifiedReadOnlyHolder(),
- buildReadOnlyStringHolder(),
- null
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildSpecifiedReadOnlyHolder() {
- return new PropertyAspectAdapter<EclipseLinkReadOnly, Boolean>(
- getSubjectHolder(),
- EclipseLinkReadOnly.SPECIFIED_READ_ONLY_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedReadOnly();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedReadOnly(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildReadOnlyStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultReadOnlyHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkReadOnlyComposite_readOnlyWithDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkReadOnlyComposite_readOnlyLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultReadOnlyHolder() {
- return new PropertyAspectAdapter<EclipseLinkReadOnly, Boolean>(
- getSubjectHolder(),
- EclipseLinkReadOnly.SPECIFIED_READ_ONLY_PROPERTY,
- EclipseLinkReadOnly.DEFAULT_READ_ONLY_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedReadOnly() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultReadOnly());
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkRefreshOnlyIfNewerComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkRefreshOnlyIfNewerComposite.java
deleted file mode 100644
index fca6dc8019..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkRefreshOnlyIfNewerComposite.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows a tri-state check box for the Refresh Only If Newer option.
- *
- * @see EclipseLinkCaching
- * @see EclipseLinkCachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkRefreshOnlyIfNewerComposite extends Pane<EclipseLinkCaching>
-{
- /**
- * Creates a new <code>OptionalComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkRefreshOnlyIfNewerComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent)
- {
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerLabel,
- buildRefreshOnlyIfNewerHolder(),
- buildRefreshOnlyIfNewerStringHolder(),
- EclipseLinkHelpContextIds.CACHING_REFRESH_ONLY_IF_NEWER
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildRefreshOnlyIfNewerHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(getSubjectHolder(), EclipseLinkCaching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedRefreshOnlyIfNewer();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedRefreshOnlyIfNewer(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildRefreshOnlyIfNewerStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultRefreshOnlyIfNewerHolder()) {
-
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultRefreshOnlyIfNewerHolder() {
- return new PropertyAspectAdapter<EclipseLinkCaching, Boolean>(
- getSubjectHolder(),
- EclipseLinkCaching.SPECIFIED_REFRESH_ONLY_IF_NEWER_PROPERTY,
- EclipseLinkCaching.DEFAULT_REFRESH_ONLY_IF_NEWER_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedRefreshOnlyIfNewer() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultRefreshOnlyIfNewer());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructConverterComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructConverterComposite.java
deleted file mode 100644
index d063e580bd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructConverterComposite.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterClassConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Name: | ||
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConverter
- * @see EclipseLinkConvertComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkStructConverterComposite extends Pane<EclipseLinkStructConverter>
-{
-
- /**
- * Creates a new <code>StructConverterComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkStructConverterComposite(PropertyValueModel<? extends EclipseLinkStructConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_nameTextLabel,
- buildNameTextHolder());
-
- addClassChooser(container);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected ModifiablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkStructConverter, String>(
- getSubjectHolder(), JpaNamedContextNode.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
-
- private ClassChooserPane<EclipseLinkStructConverter> addClassChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkStructConverter>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkStructConverter, String>(getSubjectHolder(), EclipseLinkConverterClassConverter.CONVERTER_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getConverterClass();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setConverterClass(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getConverterClass();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_classLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setConverterClass(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return EclipseLinkStructConverter.ECLIPSELINK_STRUCT_CONVERTER_CLASS_NAME;
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedConverterClass();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkStructConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkStructConverter value) {
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructureMapping2_3Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructureMapping2_3Composite.java
deleted file mode 100644
index 3feebf540b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkStructureMapping2_3Composite.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructureMapping2_3;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkStructureMapping2_3Composite extends Pane<EclipseLinkStructureMapping2_3>
- implements JpaComposite
-{
- public EclipseLinkStructureMapping2_3Composite(PropertyValueModel<? extends EclipseLinkStructureMapping2_3> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTransformationMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTransformationMappingComposite.java
deleted file mode 100644
index 07b38a103c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTransformationMappingComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkTransformationMappingComposite extends Pane<EclipseLinkTransformationMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkTransformationMappingComposite(PropertyValueModel<? extends EclipseLinkTransformationMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTypeConverterComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTypeConverterComposite.java
deleted file mode 100644
index 3b6e904e12..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkTypeConverterComposite.java
+++ /dev/null
@@ -1,210 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Name: | ||
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkConverter
- * @see EclipseLinkConvertComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class EclipseLinkTypeConverterComposite extends Pane<EclipseLinkTypeConverter>
-{
-
- /**
- * Creates a new <code>TypeConverterComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EclipseLinkTypeConverterComposite(PropertyValueModel<? extends EclipseLinkTypeConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterComposite_nameTextLabel,
- buildNameTextHolder());
-
- addDataTypeChooser(container);
- addObjectTypeChooser(container);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
- protected ModifiablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkTypeConverter, String>(
- getSubjectHolder(), JpaNamedContextNode.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
-
- private ClassChooserPane<EclipseLinkTypeConverter> addDataTypeChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkTypeConverter>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkTypeConverter, String>(getSubjectHolder(), EclipseLinkTypeConverter.DATA_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDataType();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setDataType(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getDataType();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkTypeConverterComposite_dataTypeLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setDataType(className);
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedDataType();
- }
- };
- }
-
- private ClassChooserPane<EclipseLinkTypeConverter> addObjectTypeChooser(Composite container) {
-
- return new ClassChooserPane<EclipseLinkTypeConverter>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EclipseLinkTypeConverter, String>(getSubjectHolder(), EclipseLinkTypeConverter.OBJECT_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getObjectType();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
-
- this.subject.setObjectType(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getObjectType();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.EclipseLinkTypeConverterComposite_objectTypeLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setObjectType(className);
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getEnclosingTypeSeparator();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedObjectType();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<EclipseLinkTypeConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EclipseLinkTypeConverter value) {
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java
deleted file mode 100644
index 1cfb87b759..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkUiDetailsMessages.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * The localized strings used by the mapping panes.
- *
- * @version 2.3
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class EclipseLinkUiDetailsMessages extends NLS {
-
- public static String EclipseLinkBasicCollectionMappingUiProvider_label;
- public static String EclipseLinkBasicCollectionMappingUiProvider_linkLabel;
-
- public static String EclipseLinkBasicMapMappingUiProvider_label;
- public static String EclipseLinkBasicMapMappingUiProvider_linkLabel;
-
- public static String EclipseLinkTransformationMappingUiProvider_label;
- public static String EclipseLinkTransformationMappingUiProvider_linkLabel;
-
- public static String EclipseLinkVariableOneToOneMappingUiProvider_label;
- public static String EclipseLinkVariableOneToOneMappingUiProvider_linkLabel;
-
- public static String EclipseLinkCacheTypeComposite_label;
- public static String EclipseLinkCacheTypeComposite_full;
- public static String EclipseLinkCacheTypeComposite_weak;
- public static String EclipseLinkCacheTypeComposite_soft;
- public static String EclipseLinkCacheTypeComposite_soft_weak;
- public static String EclipseLinkCacheTypeComposite_hard_weak;
- public static String EclipseLinkCacheTypeComposite_cache;
- public static String EclipseLinkCacheTypeComposite_none;
- public static String EclipseLinkTypeMappingComposite_advanced;
- public static String EclipseLinkTypeMappingComposite_caching;
- public static String EclipseLinkTypeMappingComposite_converters;
- public static String EclipseLinkTypeMappingComposite_multitenancy;
-
- public static String EclipseLinkCacheSizeComposite_size;
- public static String EclipseLinkCacheCoordinationTypeComposite_label;
- public static String EclipseLinkCacheCoordinationTypeComposite_send_object_changes;
- public static String EclipseLinkCacheCoordinationTypeComposite_invalidate_changed_objects;
- public static String EclipseLinkCacheCoordinationTypeComposite_send_new_objects_with_changes;
- public static String EclipseLinkCacheCoordinationTypeComposite_none;
-
- public static String EclipseLinkCachingComposite_sharedLabelDefault;
- public static String EclipseLinkCachingComposite_sharedLabel;
- public static String EclipseLinkCachingComposite_advanced;
- public static String EclipseLinkAlwaysRefreshComposite_alwaysRefreshDefault;
- public static String EclipseLinkAlwaysRefreshComposite_alwaysRefreshLabel;
- public static String EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerDefault;
- public static String EclipseLinkRefreshOnlyIfNewerComposite_refreshOnlyIfNewerLabel;
- public static String EclipseLinkDisableHitsComposite_disableHitsDefault;
- public static String EclipseLinkDisableHitsComposite_disableHitsLabel;
-
- public static String EclipseLinkChangeTrackingComposite_label;
- public static String EclipseLinkChangeTrackingComposite_attribute;
- public static String EclipseLinkChangeTrackingComposite_object;
- public static String EclipseLinkChangeTrackingComposite_deferred;
- public static String EclipseLinkChangeTrackingComposite_auto;
-
- public static String EclipseLinkConvertComposite_converterNameLabel;
-
- public static String EclipseLinkConverterComposite_nameTextLabel;
- public static String EclipseLinkConverterComposite_classLabel;
-
- public static String EclipseLinkConvertersComposite_customConverter;
- public static String EclipseLinkConvertersComposite_objectTypeConverter;
- public static String EclipseLinkConvertersComposite_structConverter;
- public static String EclipseLinkConvertersComposite_typeConverter;
-
- public static String EclipseLinkConvertersComposite_maxConvertersErrorMessage;
-
- public static String EclipseLinkCustomizerComposite_classLabel;
-
- public static String TypeSection_converted;
-
- public static String EclipseLinkExistenceCheckingComposite_label;
- public static String EclipseLinkExistenceCheckingComposite_check_cache;
- public static String EclipseLinkExistenceCheckingComposite_check_database;
- public static String EclipseLinkExistenceCheckingComposite_assume_existence;
- public static String EclipseLinkExistenceCheckingComposite_assume_non_existence;
-
- public static String EclipseLinkExpiryComposite_expirySection;
- public static String EclipseLinkExpiryComposite_noExpiry;
- public static String EclipseLinkExpiryComposite_timeToLiveExpiry;
- public static String EclipseLinkExpiryComposite_timeToLiveExpiryExpireAfter;
- public static String EclipseLinkExpiryComposite_timeToLiveExpiryMilliseconds;
- public static String EclipseLinkExpiryComposite_dailyExpiry;
- public static String EclipseLinkExpiryComposite_timeOfDayExpiryExpireAt;
-
- public static String EclipseLinkJoinFetchComposite_label;
- public static String EclipseLinkJoinFetchComposite_inner;
- public static String EclipseLinkJoinFetchComposite_outer;
-
- public static String EclipseLinkMutableComposite_mutableLabel;
- public static String EclipseLinkMutableComposite_mutableLabelDefault;
- public static String EclipseLinkMutableComposite_true;
- public static String EclipseLinkMutableComposite_false;
-
- public static String EclipseLinkObjectTypeConverterComposite_dataTypeLabel;
- public static String EclipseLinkObjectTypeConverterComposite_objectTypeLabel;
- public static String EclipseLinkObjectTypeConverterComposite_conversionValueEdit;
- public static String EclipseLinkObjectTypeConverterComposite_conversionValuesDataValueColumn;
- public static String EclipseLinkObjectTypeConverterComposite_conversionValuesObjectValueColumn;
- public static String EclipseLinkObjectTypeConverterComposite_defaultObjectValueLabel;
- public static String EclipseLinkObjectTypeConverterComposite_conversionValuesGroupTitle;
-
- public static String EclipseLinkConversionValueDialog_addConversionValue;
- public static String EclipseLinkConversionValueDialog_editConversionValue;
- public static String EclipseLinkConversionValueDialog_addConversionValueDescriptionTitle;
- public static String EclipseLinkConversionValueDialog_editConversionValueDescriptionTitle;
- public static String EclipseLinkConversionValueDialog_addConversionValueDescription;
- public static String EclipseLinkConversionValueDialog_editConversionValueDescription;
-
- public static String EclipseLinkConversionValueDialog_dataValue;
- public static String EclipseLinkConversionValueDialog_objectValue;
- public static String EclipseLinkConversionValueStateObject_dataValueMustBeSpecified;
- public static String EclipseLinkConversionValueStateObject_objectValueMustBeSpecified;
- public static String EclipseLinkConversionValueStateObject_dataValueAlreadyExists;
-
- public static String EclipseLinkPrivateOwnedComposite_privateOwnedLabel;
-
- public static String EclipseLinkReadOnlyComposite_readOnlyLabel;
- public static String EclipseLinkReadOnlyComposite_readOnlyWithDefault;
-
- public static String EclipseLinkTypeConverterComposite_dataTypeLabel;
- public static String EclipseLinkTypeConverterComposite_objectTypeLabel;
-
- public static String DefaultEclipseLinkOneToOneMappingUiProvider_label;
- public static String DefaultEclipseLinkVariableOneToOneMappingUiProvider_label;
- public static String DefaultEclipseLinkOneToManyMappingUiProvider_label;
- public static String DefaultEclipseLinkOneToOneMappingUiProvider_linkLabel;
- public static String DefaultEclipseLinkVariableOneToOneMappingUiProvider_linkLabel;
- public static String DefaultEclipseLinkOneToManyMappingUiProvider_linkLabel;
-
- public static String EclipseLinkConverterDialog_name;
- public static String EclipseLinkConverterDialog_converterType;
- public static String EclipseLinkConverterDialog_addConverter;
- public static String EclipseLinkConverterDialog_addConverterDescriptionTitle;
- public static String EclipseLinkConverterDialog_addConverterDescription;
- public static String EclipseLinkConverterStateObject_nameExists;
- public static String EclipseLinkConverterStateObject_nameIsReserved;
- public static String EclipseLinkConverterStateObject_nameMustBeSpecified;
- public static String EclipseLinkConverterStateObject_typeMustBeSpecified;
-
- public static String EclipseLinkMappedSuperclassComposite_queries;
-
- public static String TenantDiscriminatorColumns_groupLabel;
- public static String TenantDiscriminatorColumnComposite_nameLabel;
- public static String TenantDiscriminatorColumnComposite_defaultTenantDiscriminatorColumnNameLabel;
- public static String TenantDiscriminatorColumnComposite_tableLabel;
- public static String TenantDiscriminatorColumnComposite_contextPropertyLabel;
- public static String TenantDiscriminatorColumnComposite_discriminatorTypeLabel;
- public static String TenantDiscriminatorColumnComposite_lengthLabel;
- public static String TenantDiscriminatorColumnComposite_columnDefinitionLabel;
- public static String TenantDiscriminatorColumnComposite_primaryKeyWithDefault;
- public static String TenantDiscriminatorColumnComposite_primaryKey;
-
- public static String EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite_collapsibleSection;
- public static String EclipseLinkMultitenancy_overrideDefaultTenantDiscriminatorColumns;
-
- public static String EclipseLinkMultitenancyComposite_strategy;
- public static String EclipseLinkMultitenancyComposite_single_table;
- public static String EclipseLinkMultitenancyComposite_table_per_tenant;
- public static String EclipseLinkMultitenancyComposite_vpd;
- public static String EclipseLinkMultitenancyComposite_includeCriteria;
- public static String EclipseLinkMultitenancyComposite_includeCriteriaWithDefault;
-
- public static String OrmAttributeTypeComposite_attributeType;
-
- static {
- NLS.initializeMessages("eclipselink_ui_details", EclipseLinkUiDetailsMessages.class);
- }
-
- private EclipseLinkUiDetailsMessages() {
- throw new UnsupportedOperationException();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVariableOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVariableOneToOneMappingComposite.java
deleted file mode 100644
index ed914eae69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVariableOneToOneMappingComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.2
- * @since 2.2
- */
-public class EclipseLinkVariableOneToOneMappingComposite extends Pane<EclipseLinkVariableOneToOneMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkVariableOneToOneMappingComposite(PropertyValueModel<? extends EclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java
deleted file mode 100644
index b4df84bb1d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/EclipseLinkVersionMappingComposite.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractVersionMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.TemporalTypeComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | MutableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see VersionMapping
- * @see ColumnComposite
- * @see TemporalTypeComposite
- *
- * @version 3.2
- * @since 2.1
- */
-public abstract class EclipseLinkVersionMappingComposite<T extends VersionMapping>
- extends AbstractVersionMappingComposite<T>
-{
- /**
- * Creates a new <code>VersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IVersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected EclipseLinkVersionMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeVersionSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeTypeSection(Composite container) {
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- // No converter
- Button noConverterButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_default,
- buildConverterBooleanHolder(null),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_temporal,
- buildConverterBooleanHolder(BaseTemporalConverter.class),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), container, getWidgetFactory()));
-
- // EclipseLink Converter
- Button elConverterButton = addRadioButton(
- container,
- EclipseLinkUiDetailsMessages.TypeSection_converted,
- buildConverterBooleanHolder(EclipseLinkConvert.class),
- null);
- ((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
-
- Pane<EclipseLinkConvert> convertComposite = buildConvertComposite(buildEclipseLinkConverterHolder(converterHolder), container);
- GridData gridData = (GridData) convertComposite.getControl().getLayoutData();
- gridData.horizontalSpan = 2;
- gridData.horizontalIndent = 20;
- registerSubPane(convertComposite);
- }
-
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new EclipseLinkConvertComposite(convertHolder, container, getWidgetFactory());
- }
-
-
- protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, EclipseLinkConvert>(converterHolder) {
- @Override
- protected EclipseLinkConvert transform_(Converter converter) {
- return (converter != null && converter.getType() == EclipseLinkConvert.class) ? (EclipseLinkConvert) converter : null;
- }
- };
- }
-
- protected PropertyValueModel<Converter> buildConverterHolder() {
- return new PropertyAspectAdapter<T, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Converter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- protected PropertyValueModel<BaseTemporalConverter> buildTemporalConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, BaseTemporalConverter>(converterHolder) {
- @Override
- protected BaseTemporalConverter transform_(Converter converter) {
- return converter.getType() == BaseTemporalConverter.class ? (BaseTemporalConverter) converter : null;
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkMutable> buildMutableHolder() {
- return new PropertyAspectAdapter<T, EclipseLinkMutable>(getSubjectHolder()) {
- @Override
- protected EclipseLinkMutable buildValue_() {
- return ((EclipseLinkVersionMapping) this.subject).getMutable();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<EclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected PropertyValueModel<EclipseLinkConverterContainer> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<VersionMapping, EclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected EclipseLinkConverterContainer buildValue_() {
- return ((EclipseLinkVersionMapping) this.subject).getConverterContainer();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnComposite.java
deleted file mode 100644
index 5266145bb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnComposite.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.ui.internal.widgets.ComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyTableColumn;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.db.ColumnCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.DatabaseObjectCombo;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-public class TenantDiscriminatorColumnComposite extends Pane<ReadOnlyTenantDiscriminatorColumn2_3> {
-
- public TenantDiscriminatorColumnComposite(Pane<?> parentPane,
- PropertyValueModel<ReadOnlyTenantDiscriminatorColumn2_3> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumnComposite_nameLabel,
- addNameCombo(container),
- EclipseLinkHelpContextIds.TENANT_DISCRIMINATOR_COLUMN_NAME);
-
- // Table widgets
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumnComposite_tableLabel,
- addTableCombo(container),
- EclipseLinkHelpContextIds.TENANT_DISCRIMINATOR_COLUMN_TABLE);
-
- // Context property widgets
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumnComposite_contextPropertyLabel,
- addContextPropertyCombo(container),
- EclipseLinkHelpContextIds.TENANT_DISCRIMINATOR_COLUMN_CONTEXT_PROPERTY);
-
- // Discriminator Type widgets
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumnComposite_discriminatorTypeLabel,
- addDiscriminatorTypeCombo(container),
- EclipseLinkHelpContextIds.TENANT_DISCRIMINATOR_COLUMN_DISCRIMINATOR_TYPE
- );
- // Length widgets
- addLengthCombo(container);
-
- // Column Definition widgets
- addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumnComposite_columnDefinitionLabel,
- buildColumnDefinitionHolder(getSubjectHolder())
- );
-
- // Primary key tri-state check box
- TriStateCheckBox pkCheckBox = addTriStateCheckBoxWithDefault(
- addSubPane(container, 4),
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumnComposite_primaryKey,
- buildPrimaryKeyHolder(),
- buildPrimaryKeyStringHolder(),
- EclipseLinkHelpContextIds.TENANT_DISCRIMINATOR_COLUMN_PRIMARY_KEY);
-
- SWTTools.controlVisibleState(new EclipseLink2_4ProjectFlagModel<ReadOnlyTenantDiscriminatorColumn2_3>(this.getSubjectHolder()), pkCheckBox.getCheckBox());
- }
-
- private ColumnCombo<ReadOnlyTenantDiscriminatorColumn2_3> addNameCombo(Composite container) {
-
- return new ColumnCombo<ReadOnlyTenantDiscriminatorColumn2_3>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyNamedColumn.DEFAULT_NAME_PROPERTY);
- propertyNames.add(ReadOnlyNamedColumn.SPECIFIED_NAME_PROPERTY);
- propertyNames.add(ReadOnlyTableColumn.DEFAULT_TABLE_PROPERTY);
- propertyNames.add(ReadOnlyTableColumn.SPECIFIED_TABLE_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- if (propertyName == ReadOnlyTableColumn.DEFAULT_TABLE_PROPERTY ||
- propertyName == ReadOnlyTableColumn.SPECIFIED_TABLE_PROPERTY) {
- this.doPopulate();
- } else {
- super.propertyChanged(propertyName);
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- ((TenantDiscriminatorColumn2_3) this.getSubject()).setSpecifiedName(value);
- }
-
- @Override
- protected Table getDbTable_() {
- ReadOnlyTenantDiscriminatorColumn2_3 column = this.getSubject();
- return (column == null) ? null : column.getDbTable();
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedName();
- }
-
- @Override
- protected String buildNullDefaultValueEntry() {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- JptCommonUiMessages.NoneSelected);
- }
-
- @Override
- public String toString() {
- return "TenantDiscriminatorColumnComposite.nameCombo"; //$NON-NLS-1$
- }
- };
- }
-
- private Pane<ReadOnlyTenantDiscriminatorColumn2_3> addTableCombo(Composite container) {
-
- return new DatabaseObjectCombo<ReadOnlyTenantDiscriminatorColumn2_3>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyTableColumn.DEFAULT_TABLE_PROPERTY);
- propertyNames.add(ReadOnlyTableColumn.SPECIFIED_TABLE_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return this.getSubject().getDefaultTable();
- }
-
- @Override
- protected void setValue(String value) {
- ((TenantDiscriminatorColumn2_3) this.getSubject()).setSpecifiedTable(value);
- }
-
- @Override
- protected String getValue() {
- return this.getSubject().getSpecifiedTable();
- }
-
- // TODO we need to listen for this list to change...
- @Override
- protected Iterable<String> getValues_() {
- ReadOnlyTenantDiscriminatorColumn2_3 column = this.getSubject();
- return (column != null) ? column.getCandidateTableNames() : EmptyIterable.<String> instance();
- }
-
- @Override
- protected String buildNullDefaultValueEntry() {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- JptCommonUiMessages.NoneSelected);
- }
-
- @Override
- public String toString() {
- return "TenantDiscriminatorColumnComposite.tableCombo"; //$NON-NLS-1$
- }
- };
- }
-
- private Pane<ReadOnlyTenantDiscriminatorColumn2_3> addContextPropertyCombo(Composite container) {
-
- return new ComboPane<ReadOnlyTenantDiscriminatorColumn2_3>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_CONTEXT_PROPERTY);
- propertyNames.add(ReadOnlyTenantDiscriminatorColumn2_3.SPECIFIED_CONTEXT_PROPERTY_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return this.getSubject().getDefaultContextProperty();
- }
-
- @Override
- protected void setValue(String value) {
- ((TenantDiscriminatorColumn2_3) this.getSubject()).setSpecifiedContextProperty(value);
- }
-
- @Override
- protected String getValue() {
- return this.getSubject().getSpecifiedContextProperty();
- }
-
- @Override
- protected Iterable<String> getValues() {
- return EmptyIterable.<String> instance();
- }
-
- @Override
- protected String buildNullDefaultValueEntry() {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- JptCommonUiMessages.NoneSelected);
- }
-
- @Override
- public String toString() {
- return "TenantDiscriminatorColumnComposite.contextPropertyCombo"; //$NON-NLS-1$
- }
- };
- }
-
- private EnumFormComboViewer<ReadOnlyTenantDiscriminatorColumn2_3, DiscriminatorType> addDiscriminatorTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<ReadOnlyTenantDiscriminatorColumn2_3, DiscriminatorType>(
- this,
- getSubjectHolder(),
- container)
- {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyNamedDiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE_PROPERTY);
- propertyNames.add(ReadOnlyNamedDiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY);
- }
-
- @Override
- protected DiscriminatorType[] getChoices() {
- return DiscriminatorType.values();
- }
-
- @Override
- protected DiscriminatorType getDefaultValue() {
- return getSubject().getDefaultDiscriminatorType();
- }
-
- @Override
- protected String displayString(DiscriminatorType value) {
- switch (value) {
- case CHAR :
- return JptUiDetailsMessages.DiscriminatorColumnComposite_char;
- case INTEGER :
- return JptUiDetailsMessages.DiscriminatorColumnComposite_integer;
- case STRING :
- return JptUiDetailsMessages.DiscriminatorColumnComposite_string;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected String nullDisplayString() {
- return JptCommonUiMessages.NoneSelected;
- }
-
- @Override
- protected DiscriminatorType getValue() {
- return getSubject().getSpecifiedDiscriminatorType();
- }
-
- @Override
- protected void setValue(DiscriminatorType value) {
- ((TenantDiscriminatorColumn2_3) this.getSubject()).setSpecifiedDiscriminatorType(value);
- }
- };
- }
-
- private void addLengthCombo(Composite container) {
- new IntegerCombo<ReadOnlyTenantDiscriminatorColumn2_3>(this, container) {
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.ColumnComposite_length;
- }
-
- @Override
- protected String getHelpId() {
- return EclipseLinkHelpContextIds.TENANT_DISCRIMINATOR_COLUMN_LENGTH;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<ReadOnlyTenantDiscriminatorColumn2_3, Integer>(getSubjectHolder(), ReadOnlyNamedDiscriminatorColumn.DEFAULT_LENGTH_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultLength());
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<ReadOnlyTenantDiscriminatorColumn2_3, Integer>(getSubjectHolder(), ReadOnlyNamedDiscriminatorColumn.SPECIFIED_LENGTH_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedLength();
- }
-
- @Override
- protected void setValue_(Integer value) {
- ((TenantDiscriminatorColumn2_3) this.subject).setSpecifiedLength(value);
- }
- };
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildColumnDefinitionHolder(PropertyValueModel<ReadOnlyTenantDiscriminatorColumn2_3> discriminatorColumnHolder) {
- return new PropertyAspectAdapter<ReadOnlyTenantDiscriminatorColumn2_3, String>(discriminatorColumnHolder, ReadOnlyNamedColumn.COLUMN_DEFINITION_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getColumnDefinition();
- }
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- ((TenantDiscriminatorColumn2_3) this.subject).setColumnDefinition(value);
- }
- };
- }
-
- ModifiablePropertyValueModel<Boolean> buildPrimaryKeyHolder() {
- return new PropertyAspectAdapter<ReadOnlyTenantDiscriminatorColumn2_3, Boolean>(getSubjectHolder(), ReadOnlyTenantDiscriminatorColumn2_3.SPECIFIED_PRIMARY_KEY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedPrimaryKey();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- ((TenantDiscriminatorColumn2_3) this.subject).setSpecifiedPrimaryKey(value);
- }
- };
- }
-
- PropertyValueModel<String> buildPrimaryKeyStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultPrimaryKeyHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiDetailsMessages.TenantDiscriminatorColumnComposite_primaryKeyWithDefault, defaultStringValue);
- }
- return EclipseLinkUiDetailsMessages.TenantDiscriminatorColumnComposite_primaryKey;
- }
- };
- }
-
- PropertyValueModel<Boolean> buildDefaultPrimaryKeyHolder() {
- return new PropertyAspectAdapter<ReadOnlyTenantDiscriminatorColumn2_3, Boolean>(
- getSubjectHolder(),
- ReadOnlyTenantDiscriminatorColumn2_3.SPECIFIED_PRIMARY_KEY_PROPERTY,
- ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_PRIMARY_KEY_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedPrimaryKey() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isPrimaryKey());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnsComposite.java
deleted file mode 100644
index d9ab0cdf4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/TenantDiscriminatorColumnsComposite.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.EventListener;
-import java.util.EventObject;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.AbstractAdapter;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.ChangeSupport;
-import org.eclipse.jpt.common.utility.internal.model.SingleAspectChangeSupport;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
-
- *
- * @version 3.1
- * @since 3.1
- */
-public class TenantDiscriminatorColumnsComposite<T extends JpaNode> extends Pane<T>
-{
- /**
- * The editor used to perform the common behaviors defined in the list pane.
- */
- TenantDiscriminatorColumnsEditor<T> tenantDiscriminatorColumnsEditor;
-
- private AddRemoveListPane<T> listPane;
- private Pane<ReadOnlyTenantDiscriminatorColumn2_3> tenantDiscriminatorColumnPane;
- private ModifiablePropertyValueModel<ReadOnlyTenantDiscriminatorColumn2_3> tenantDiscriminatorColumnHolder;
-
- public TenantDiscriminatorColumnsComposite(Pane<? extends T> parentPane,
- Composite parent,
- TenantDiscriminatorColumnsEditor<T> tenantDiscriminatorColumnsEditor) {
-
- super(parentPane, parent);
- this.tenantDiscriminatorColumnsEditor = tenantDiscriminatorColumnsEditor;
- initializeLayout2();
- }
-
- public TenantDiscriminatorColumnsComposite(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- TenantDiscriminatorColumnsEditor<T> tenantDiscriminatorColumnsEditor,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- this.tenantDiscriminatorColumnsEditor = tenantDiscriminatorColumnsEditor;
- initializeLayout2();
- }
-
- public TenantDiscriminatorColumnsComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory,
- TenantDiscriminatorColumnsEditor<T> tenantDiscriminatorColumnsEditor) {
-
- super(subjectHolder, parent, widgetFactory);
- this.tenantDiscriminatorColumnsEditor = tenantDiscriminatorColumnsEditor;
- initializeLayout2();
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.tenantDiscriminatorColumnHolder = buildTenantDiscriminatorColumnHolder();
- }
-
- private ModifiablePropertyValueModel<ReadOnlyTenantDiscriminatorColumn2_3> buildTenantDiscriminatorColumnHolder() {
- return new SimplePropertyValueModel<ReadOnlyTenantDiscriminatorColumn2_3>();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- //see intiailizeLayout2()
- }
-
- private void initializeLayout2() {
- this.listPane = new AddRemoveListPane<T>(
- this,
- getControl(),
- buildTenantDiscriminatorColumnsAdapter(),
- buildTenantDiscriminatorColumnsListModel(),
- this.tenantDiscriminatorColumnHolder,
- buildTenantDiscriminatorColumnsListLabelProvider(),
- EclipseLinkHelpContextIds.MULTITENANCY_TENANT_DISCRIMINATOR_COLUMNS,
- false
- );
-
- // Property pane
- PageBook pageBook = new PageBook(getControl(), SWT.NULL);
- pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- //Tenant Discriminator Column property pane
- this.tenantDiscriminatorColumnPane = this.buildTenantDiscriminatorColumnComposite(pageBook);
-
-
- installPaneSwitcher(pageBook);
- }
-
- protected Pane<ReadOnlyTenantDiscriminatorColumn2_3> buildTenantDiscriminatorColumnComposite(PageBook pageBook) {
- return new TenantDiscriminatorColumnComposite(
- this,
- this.tenantDiscriminatorColumnHolder,
- pageBook
- );
- }
-
- private void installPaneSwitcher(PageBook pageBook) {
- new ControlSwitcher(this.tenantDiscriminatorColumnHolder, this.tenantDiscriminatorColumnPane.getControl(), pageBook);
- }
-
- String buildTenantDiscriminatorColumnLabel(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- if (tenantDiscriminatorColumn.isVirtual() || tenantDiscriminatorColumn.getSpecifiedName() == null) {
- return NLS.bind(
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumnComposite_defaultTenantDiscriminatorColumnNameLabel,
- tenantDiscriminatorColumn.getName()
- );
- }
- return tenantDiscriminatorColumn.getName();
- }
-
- private Adapter buildTenantDiscriminatorColumnsAdapter() {
- return new AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- TenantDiscriminatorColumnsComposite.this.tenantDiscriminatorColumnsEditor.addTenantDiscriminatorColumn(getSubject());
- }
-
- @Override
- public boolean hasOptionalButton() {
- return false;
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- TenantDiscriminatorColumnsComposite.this.tenantDiscriminatorColumnsEditor.removeTenantDiscriminatorColumns(getSubject(), listSelectionModel.selectedIndices());
- }
- };
- }
-
- private ListValueModel<ReadOnlyTenantDiscriminatorColumn2_3> buildTenantDiscriminatorColumnsListModel() {
- return new LocalItemPropertyListValueModelAdapter<ReadOnlyTenantDiscriminatorColumn2_3>(buildTenantDiscriminatorColumnsListHolder(),
- ReadOnlyNamedColumn.SPECIFIED_NAME_PROPERTY,
- ReadOnlyNamedColumn.DEFAULT_NAME_PROPERTY);
- }
-
- private ListValueModel<ReadOnlyTenantDiscriminatorColumn2_3> buildTenantDiscriminatorColumnsListHolder() {
- List<ListValueModel<ReadOnlyTenantDiscriminatorColumn2_3>> list = new ArrayList<ListValueModel<ReadOnlyTenantDiscriminatorColumn2_3>>();
- list.add(buildDefaultTenantDiscriminatorColumnListHolder());
- list.add(buildSpecifiedTenantDiscriminatorColumnsListHolder());
- return new CompositeListValueModel<ListValueModel<ReadOnlyTenantDiscriminatorColumn2_3>, ReadOnlyTenantDiscriminatorColumn2_3>(list);
- }
-
- private ListValueModel<ReadOnlyTenantDiscriminatorColumn2_3> buildSpecifiedTenantDiscriminatorColumnsListHolder() {
- return new ListAspectAdapter<T, ReadOnlyTenantDiscriminatorColumn2_3>(getSubjectHolder(), this.tenantDiscriminatorColumnsEditor.getSpecifiedTenantDiscriminatorsListPropertyName()) {
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getListIterable() {
- return TenantDiscriminatorColumnsComposite.this.tenantDiscriminatorColumnsEditor.getSpecifiedTenantDiscriminatorColumns(this.subject);
- }
-
- @Override
- protected int size_() {
- return TenantDiscriminatorColumnsComposite.this.tenantDiscriminatorColumnsEditor.getSpecifiedTenantDiscriminatorColumnsSize(this.subject);
- }
- };
- }
-
- private ListValueModel<ReadOnlyTenantDiscriminatorColumn2_3> buildDefaultTenantDiscriminatorColumnListHolder() {
- return new ListAspectAdapter<T, ReadOnlyTenantDiscriminatorColumn2_3>(getSubjectHolder(), this.tenantDiscriminatorColumnsEditor.getDefaultTenantDiscriminatorsListPropertyName()) {
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getListIterable() {
- return TenantDiscriminatorColumnsComposite.this.tenantDiscriminatorColumnsEditor.getDefaultTenantDiscriminatorColumns(this.subject);
- }
-
- @Override
- protected int size_() {
- return TenantDiscriminatorColumnsComposite.this.tenantDiscriminatorColumnsEditor.getDefaultTenantDiscriminatorColumnsSize(this.subject);
- }
- };
- }
-
- private ILabelProvider buildTenantDiscriminatorColumnsListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return buildTenantDiscriminatorColumnLabel((ReadOnlyTenantDiscriminatorColumn2_3) element);
- }
- };
- }
-
- public void installListPaneEnabler(PropertyValueModel<Boolean> paneEnablerHolder) {
- new PaneEnabler(paneEnablerHolder, this.listPane);
- }
-
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
- this.listPane.enableWidgets(enabled);
- }
-
- public void setSelectedTenantDiscriminatorColumn(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.listPane.setSelectedItem(tenantDiscriminatorColumn);
- }
-
- /**
- * The editor is used to complete the behavior of this pane.
- */
- public static interface TenantDiscriminatorColumnsEditor<T> {
-
- /**
- * Add a tenant discriminator column to the given subject
- */
- void addTenantDiscriminatorColumn(T subject);
-
- /**
- * Return whether the subject has specified tenant discriminator columns
- */
- boolean hasSpecifiedTenantDiscriminatorColumns(T subject);
-
- /**
- * Return the specified tenant discriminator from the given subject
- */
- ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns(T subject);
-
- /**
- * Return the number of specified join columns on the given subject
- */
- int getSpecifiedTenantDiscriminatorColumnsSize(T subject);
-
- /**
- * Return the default tenant discriminator columns from the given subject or null.
- */
- ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns(T subject);
-
- /**
- * Return the number of default tenant discriminator on the given subject
- */
- int getDefaultTenantDiscriminatorColumnsSize(T subject);
-
- /**
- * Return the property name of the specified tenant discriminator columns list
- */
- String getSpecifiedTenantDiscriminatorsListPropertyName();
-
- /**
- * Return the property name of the default tenant discriminator columns list
- */
- String getDefaultTenantDiscriminatorsListPropertyName();
-
- /**
- * Remove the tenant discriminator columns at the specified indices from the subject
- */
- void removeTenantDiscriminatorColumns(T subject, int[] selectedIndices);
- }
-
- private class LocalItemPropertyListValueModelAdapter<E> extends ItemPropertyListValueModelAdapter<E> {
-
- public LocalItemPropertyListValueModelAdapter(ListValueModel<E> listHolder, String... propertyNames) {
- super(listHolder, propertyNames);
- }
-
- public LocalItemPropertyListValueModelAdapter(CollectionValueModel<E> collectionHolder, String[] propertyNames) {
- super(collectionHolder, propertyNames);
- }
-
- /**
- * bug 310720
- * Override to just fire an itemReplaced event instead of a listChanged event.
- * An aspect of the item as changed, so no reason to say that the entire list has changed.
- * Added a LocalChangeSupport so that I can fire a ListReplacedEvent for an old list
- * and new list containing the same item.
- */
- @Override
- protected void itemAspectChanged(EventObject event) {
- Object item = event.getSource();
- this.getChangeSupport().fireItemsReplaced(
- new ListReplaceEvent(this, LIST_VALUES, CollectionTools.indexOf(this.listHolder, item), item, item));
- }
-
- @Override
- protected ChangeSupport buildChangeSupport() {
- return new LocalChangeSupport(this, ListChangeListener.class, ListValueModel.LIST_VALUES);
- }
-
- private class LocalChangeSupport extends SingleAspectChangeSupport {
- public LocalChangeSupport(Model source, Class<? extends EventListener> validListenerClass, String validAspectName) {
- super(source, validListenerClass, validAspectName);
- }
- @Override
- public boolean fireItemsReplaced(ListReplaceEvent event) {
- this.check(LIST_CHANGE_LISTENER_CLASS, event.getListName());
- if (event.getItemsSize() != 0) {
- this.fireItemsReplaced_(event);
- return true;
- }
- return false;
- }
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEmbeddableComposite.java
deleted file mode 100644
index 5c414a5f90..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEmbeddableComposite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertersComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkEmbeddableAdvancedComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddableComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see JavaUiFactory - The factory creating this pane
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractJavaEclipseLinkEmbeddableComposite extends AbstractEmbeddableComposite<JavaEmbeddable>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractJavaEclipseLinkEmbeddableComposite(PropertyValueModel<? extends JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeConvertersCollapsibleSection(container);
- initializeAdvancedCollapsibleSection(container);
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
-
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<JavaEclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected PropertyValueModel<JavaEclipseLinkConverterContainer> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<JavaEmbeddable, JavaEclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkConverterContainer buildValue_() {
- return ((JavaEclipseLinkEmbeddable) this.subject).getConverterContainer();
- }
- };
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkEmbeddableAdvancedComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntity2_xComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntity2_xComposite.java
deleted file mode 100644
index ba5b700720..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntity2_xComposite.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EntityNameComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TableComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Entity2_0OverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Generation2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Queries2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink 2.x Java entity.
- *
- * @see JavaEclipseLinkEntity
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 3.1
- * @since 3.1
- */
-public abstract class AbstractJavaEclipseLinkEntity2_xComposite
- extends AbstractJavaEclipseLinkEntityComposite<JavaEntity>
-{
- /**
- * Creates a new <code>EclipseLinkJavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractJavaEclipseLinkEntity2_xComposite(
- PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEntitySection(Composite container) {
- new TableComposite(this, container);
- new EntityNameComposite(this, container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaEntity, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
- @Override
- protected void initializeAttributeOverridesSection(Composite container) {
- new Entity2_0OverridesComposite(this, container);
- }
-
- @Override
- protected void initializeGeneratorsSection(Composite container, PropertyValueModel<GeneratorContainer> generatorContainerHolder) {
- new Generation2_0Composite(this, generatorContainerHolder, container);
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<JavaEclipseLinkCaching> cachingHolder) {
- new JavaEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-
- @Override
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new Queries2_0Composite(this, queryContainerHolder, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntityComposite.java
deleted file mode 100644
index 9cc6bb1f26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkEntityComposite.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertersComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkEntityAdvancedComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaInheritanceComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaSecondaryTablesComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java entity.
- *
- * @see JavaEclipseLinkEntity
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractJavaEclipseLinkEntityComposite<T extends JavaEntity>
- extends AbstractEntityComposite<T>
-{
- /**
- * Creates a new <code>EclipseLinkJavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractJavaEclipseLinkEntityComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityCollapsibleSection(container);
- this.initializeCachingCollapsibleSectionPane(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeInheritanceCollapsibleSection(container);
- this.initializeAttributeOverridesCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeSecondaryTablesCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- protected void initializeCachingCollapsibleSectionPane(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching);
- initializeCachingSection(container, buildCachingHolder());
- }
-
- protected void initializeCachingSection(Composite container, PropertyValueModel<JavaEclipseLinkCaching> cachingHolder) {
- new JavaEclipseLinkCachingComposite(this, cachingHolder, container);
- }
-
- private PropertyAspectAdapter<JavaEntity, JavaEclipseLinkCaching> buildCachingHolder() {
- return new PropertyAspectAdapter<JavaEntity, JavaEclipseLinkCaching>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkCaching buildValue_() {
- return ((JavaEclipseLinkEntity) this.subject).getCaching();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters);
- this.initializeConvertersSection(container, buildConverterHolderValueModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<JavaEclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- private PropertyValueModel<JavaEclipseLinkConverterContainer> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<JavaEntity, JavaEclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkConverterContainer buildValue_() {
- return ((JavaEclipseLinkEntity) this.subject).getConverterContainer();
- }
- };
- }
-
- @Override
- protected void initializeSecondaryTablesSection(Composite container) {
- new JavaSecondaryTablesComposite(this, container);
- }
-
- @Override
- protected void initializeInheritanceSection(Composite container) {
- new JavaInheritanceComposite(this, container);
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkEntityAdvancedComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkMappedSuperclassComposite.java
deleted file mode 100644
index 68e4528d67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/AbstractJavaEclipseLinkMappedSuperclassComposite.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertersComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMappedSuperclassAdvancedComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractJavaMappedSuperclassComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java Mapped Superclass.
- *
- * @see EclipseLinkMappedSuperclass
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractJavaEclipseLinkMappedSuperclassComposite
- extends AbstractJavaMappedSuperclassComposite
- implements JpaComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractJavaEclipseLinkMappedSuperclassComposite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeMappedSuperclassCollapsibleSection(container);
- this.initializeCachingCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
-
- protected void initializeCachingCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching);
- this.initializeCachingSection(container, buildCachingHolder());
- }
-
- protected void initializeCachingSection(Composite container, PropertyValueModel<JavaEclipseLinkCaching> cachingHolder) {
- new JavaEclipseLinkCachingComposite(this, cachingHolder, container);
- }
-
- private PropertyAspectAdapter<JavaMappedSuperclass, JavaEclipseLinkCaching> buildCachingHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, JavaEclipseLinkCaching>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkCaching buildValue_() {
- return ((JavaEclipseLinkMappedSuperclass) this.subject).getCaching();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters);
- this.initializeConvertersSection(container, buildConverterHolderValueModel());
- }
-
- private PropertyValueModel<JavaEclipseLinkConverterContainer> buildConverterHolderValueModel() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, JavaEclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkConverterContainer buildValue_() {
- return ((JavaEclipseLinkMappedSuperclass) this.subject).getConverterContainer();
- }
- };
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<JavaEclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkMappedSuperclassAdvancedComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToManyMappingUiDefinition.java
deleted file mode 100644
index 4db8ddceba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToManyMappingUiDefinition.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToManyMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class DefaultJavaEclipseLinkOneToManyMappingUiDefinition
- extends AbstractOneToManyMappingUiDefinition<ReadOnlyPersistentAttribute, JavaOneToManyMapping>
- implements DefaultJavaAttributeMappingUiDefinition<JavaOneToManyMapping>
-{
- // singleton
- private static final DefaultJavaEclipseLinkOneToManyMappingUiDefinition INSTANCE =
- new DefaultJavaEclipseLinkOneToManyMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingUiDefinition<JavaOneToManyMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private DefaultJavaEclipseLinkOneToManyMappingUiDefinition() {
- super();
- }
-
-
- @Override
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkOneToManyMappingUiProvider_label;
- }
-
- @Override
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkOneToManyMappingUiProvider_linkLabel;
- }
-
- @Override
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getDefaultKey());
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToOneMappingUiDefinition.java
deleted file mode 100644
index c89858c9c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToOneMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class DefaultJavaEclipseLinkOneToOneMappingUiDefinition
- extends AbstractOneToOneMappingUiDefinition<ReadOnlyPersistentAttribute, JavaOneToOneMapping>
- implements DefaultJavaAttributeMappingUiDefinition<JavaOneToOneMapping>
-{
- // singleton
- private static final DefaultJavaEclipseLinkOneToOneMappingUiDefinition INSTANCE =
- new DefaultJavaEclipseLinkOneToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingUiDefinition<JavaOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private DefaultJavaEclipseLinkOneToOneMappingUiDefinition() {
- super();
- }
-
-
- @Override
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkOneToOneMappingUiProvider_label;
- }
-
- @Override
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkOneToOneMappingUiProvider_linkLabel;
- }
-
- @Override
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getDefaultKey());
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.java
deleted file mode 100644
index 094b261aee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkVariableOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition
- extends AbstractMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkVariableOneToOneMapping>
- implements DefaultJavaAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping>
-{
- // singleton
- private static final DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition INSTANCE =
- new DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition() {
- super();
- }
-
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-
- public Image getImage() {
- return JptJpaUiPlugin.getImage(JptUiIcons.JPA_CONTENT);
- }
-
- public String getLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkVariableOneToOneMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return EclipseLinkUiDetailsMessages.DefaultEclipseLinkVariableOneToOneMappingUiProvider_linkLabel;
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkVariableOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink1_2JavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink1_2JavaResourceUiDefinition.java
deleted file mode 100644
index ef11d76788..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink1_2JavaResourceUiDefinition.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.java.AbstractJavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedIdMappingUDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.NullJavaAttributeMappingUiDefinition;
-
-public class EclipseLink1_2JavaResourceUiDefinition extends AbstractJavaResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLink1_2JavaResourceUiDefinition();
-
- /**
- * Return the singleton.
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * zero-argument constructor
- */
- protected EclipseLink1_2JavaResourceUiDefinition() {
- super();
- }
-
- @Override
- protected JavaUiFactory buildJavaUiFactory() {
- return new EclipseLink1_2JavaUiFactory();
- }
-
- @Override
- protected void addSpecifiedAttributeMappingUiDefinitionsTo(List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
- definitions.add(JavaIdMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedIdMappingUDefinition.instance());
- definitions.add(JavaBasicMappingUiDefinition.instance());
- definitions.add(JavaVersionMappingUiDefinition.instance());
- definitions.add(JavaManyToOneMappingUiDefinition.instance());
- definitions.add(JavaOneToManyMappingUiDefinition.instance());
- definitions.add(JavaOneToOneMappingUiDefinition.instance());
- definitions.add(JavaManyToManyMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedMappingUiDefinition.instance());
- definitions.add(JavaTransientMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addDefaultAttributeMappingUiDefinitionsTo(List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) {
- definitions.add(DefaultBasicMappingUiDefinition.instance());
- definitions.add(DefaultEmbeddedMappingUiDefinition.instance());
- definitions.add(NullJavaAttributeMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToOneMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToManyMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedTypeMappingUiDefinitionsTo(List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
- definitions.add(JavaEntityUiDefinition.instance());
- definitions.add(JavaMappedSuperclassUiDefinition.instance());
- definitions.add(JavaEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink1_2JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink1_2JavaUiFactory.java
deleted file mode 100644
index 642544b3c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink1_2JavaUiFactory.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLink1_2JavaUiFactory extends EclipseLinkJavaUiFactory
-{
- public EclipseLink1_2JavaUiFactory() {
- super();
- }
-
-
- // **************** java type mapping composites ***************************
-
- @Override
- public JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkMappedSuperclass1_2Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEntity1_2Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEmbeddableComposite(
- PropertyValueModel<JavaEmbeddable> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEmbeddable1_2Composite(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_0JavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_0JavaResourceUiDefinition.java
deleted file mode 100644
index bab151acc5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_0JavaResourceUiDefinition.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.java.AbstractJavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedIdMappingUDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.NullJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.java.JavaElementCollectionMapping2_0UiDefinition;
-
-public class EclipseLink2_0JavaResourceUiDefinition
- extends AbstractJavaResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLink2_0JavaResourceUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * zero-argument constructor
- */
- protected EclipseLink2_0JavaResourceUiDefinition() {
- super();
- }
-
-
- @Override
- protected JavaUiFactory buildJavaUiFactory() {
- return new EclipseLink2_0JavaUiFactory();
- }
-
- @Override
- protected void addSpecifiedAttributeMappingUiDefinitionsTo(
- List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(JavaEclipseLinkIdMapping2_0UiDefinition.instance());
- definitions.add(JavaEmbeddedIdMappingUDefinition.instance());
- definitions.add(JavaBasicMappingUiDefinition.instance());
- definitions.add(JavaVersionMappingUiDefinition.instance());
- definitions.add(JavaManyToOneMappingUiDefinition.instance());
- definitions.add(JavaOneToManyMappingUiDefinition.instance());
- definitions.add(JavaOneToOneMappingUiDefinition.instance());
- definitions.add(JavaManyToManyMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedMappingUiDefinition.instance());
- definitions.add(JavaTransientMappingUiDefinition.instance());
-
- definitions.add(JavaEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkTransformationMappingUiDefinition.instance());
-
- definitions.add(JavaElementCollectionMapping2_0UiDefinition.instance());
- }
-
- @Override
- protected void addDefaultAttributeMappingUiDefinitionsTo(
- List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) {
-
- definitions.add(DefaultBasicMappingUiDefinition.instance());
- definitions.add(DefaultEmbeddedMappingUiDefinition.instance());
- definitions.add(NullJavaAttributeMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToOneMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToManyMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedTypeMappingUiDefinitionsTo(
- List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(JavaEntityUiDefinition.instance());
- definitions.add(JavaMappedSuperclassUiDefinition.instance());
- definitions.add(JavaEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_0JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_0JavaUiFactory.java
deleted file mode 100644
index 84d2fe97dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_0JavaUiFactory.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.EmbeddedIdMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.jpa2.details.java.JavaUiFactory2_0;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLink2_0JpaUiFactory
- */
-public class EclipseLink2_0JavaUiFactory
- extends EclipseLink1_2JavaUiFactory
- implements JavaUiFactory2_0
-{
- public EclipseLink2_0JavaUiFactory() {
- super();
- }
-
-
- // **************** java type mapping composites ***************************
-
- @Override
- public JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEntity2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkMappedSuperclass2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** java attribute mapping composites **********************
-
- @Override
- public JpaComposite createJavaIdMappingComposite(
- PropertyValueModel<JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEmbeddedIdMappingComposite(
- PropertyValueModel<JavaEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EmbeddedIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaElementCollectionMapping2_0Composite(
- PropertyValueModel<JavaElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToManyMappingComposite(
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkOneToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToOneMappingComposite(
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkOneToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToOneMappingComposite(
- PropertyValueModel<JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkManyToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToManyMappingComposite(
- PropertyValueModel<JavaManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkManyToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_3JavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_3JavaResourceUiDefinition.java
deleted file mode 100644
index c8789789c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_3JavaResourceUiDefinition.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.java.AbstractJavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedIdMappingUDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.NullJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.java.JavaElementCollectionMapping2_0UiDefinition;
-
-public class EclipseLink2_3JavaResourceUiDefinition
- extends AbstractJavaResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLink2_3JavaResourceUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * zero-argument constructor
- */
- protected EclipseLink2_3JavaResourceUiDefinition() {
- super();
- }
-
-
- @Override
- protected JavaUiFactory buildJavaUiFactory() {
- return new EclipseLink2_3JavaUiFactory();
- }
-
- @Override
- protected void addSpecifiedAttributeMappingUiDefinitionsTo(
- List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(JavaEclipseLinkIdMapping2_0UiDefinition.instance());
- definitions.add(JavaEmbeddedIdMappingUDefinition.instance());
- definitions.add(JavaBasicMappingUiDefinition.instance());
- definitions.add(JavaVersionMappingUiDefinition.instance());
- definitions.add(JavaManyToOneMappingUiDefinition.instance());
- definitions.add(JavaOneToManyMappingUiDefinition.instance());
- definitions.add(JavaOneToOneMappingUiDefinition.instance());
- definitions.add(JavaManyToManyMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedMappingUiDefinition.instance());
- definitions.add(JavaTransientMappingUiDefinition.instance());
-
- definitions.add(JavaEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkTransformationMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkArrayMapping2_3UiDefinition.instance());
- definitions.add(JavaEclipseLinkStructureMapping2_3UiDefinition.instance());
-
- definitions.add(JavaElementCollectionMapping2_0UiDefinition.instance());
- }
-
- @Override
- protected void addDefaultAttributeMappingUiDefinitionsTo(
- List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) {
-
- definitions.add(DefaultBasicMappingUiDefinition.instance());
- definitions.add(DefaultEmbeddedMappingUiDefinition.instance());
- definitions.add(NullJavaAttributeMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToOneMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToManyMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedTypeMappingUiDefinitionsTo(
- List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(JavaEntityUiDefinition.instance());
- definitions.add(JavaMappedSuperclassUiDefinition.instance());
- definitions.add(JavaEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_3JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_3JavaUiFactory.java
deleted file mode 100644
index 044d308da8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLink2_3JavaUiFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.jpa2.details.java.JavaUiFactory2_0;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLink2_0JpaUiFactory
- */
-public class EclipseLink2_3JavaUiFactory
- extends EclipseLink2_0JavaUiFactory
- implements JavaUiFactory2_0
-{
- public EclipseLink2_3JavaUiFactory() {
- super();
- }
-
-
- // **************** java type mapping composites ***************************
-
- @Override
- public JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEntity2_3Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkMappedSuperclass2_3Composite(subjectHolder, parent, widgetFactory);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLinkJavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLinkJavaResourceUiDefinition.java
deleted file mode 100644
index cc2eb3d14b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLinkJavaResourceUiDefinition.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.java.AbstractJavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedIdMappingUDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.NullJavaAttributeMappingUiDefinition;
-
-public class EclipseLinkJavaResourceUiDefinition
- extends AbstractJavaResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkJavaResourceUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * zero-argument constructor
- */
- protected EclipseLinkJavaResourceUiDefinition() {
- super();
- }
-
-
- @Override
- protected JavaUiFactory buildJavaUiFactory() {
- return new EclipseLinkJavaUiFactory();
- }
-
- @Override
- protected void addSpecifiedAttributeMappingUiDefinitionsTo(
- List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(JavaIdMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedIdMappingUDefinition.instance());
- definitions.add(JavaBasicMappingUiDefinition.instance());
- definitions.add(JavaVersionMappingUiDefinition.instance());
- definitions.add(JavaManyToOneMappingUiDefinition.instance());
- definitions.add(JavaOneToManyMappingUiDefinition.instance());
- definitions.add(JavaOneToOneMappingUiDefinition.instance());
- definitions.add(JavaManyToManyMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedMappingUiDefinition.instance());
- definitions.add(JavaTransientMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(JavaEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addDefaultAttributeMappingUiDefinitionsTo(
- List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) {
-
- definitions.add(DefaultBasicMappingUiDefinition.instance());
- definitions.add(DefaultEmbeddedMappingUiDefinition.instance());
- definitions.add(NullJavaAttributeMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToOneMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkOneToManyMappingUiDefinition.instance());
- definitions.add(DefaultJavaEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedTypeMappingUiDefinitionsTo(
- List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(JavaEntityUiDefinition.instance());
- definitions.add(JavaMappedSuperclassUiDefinition.instance());
- definitions.add(JavaEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLinkJavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLinkJavaUiFactory.java
deleted file mode 100644
index f867821a66..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/EclipseLinkJavaUiFactory.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicCollectionMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicMapMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToOneMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkTransformationMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkVariableOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkJavaUiFactory extends BaseJavaUiFactory
-{
- public EclipseLinkJavaUiFactory() {
- super();
- }
-
- // **************** java type mapping composites ***************************
-
- @Override
- public JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEntityComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEmbeddableComposite(
- PropertyValueModel<JavaEmbeddable> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEclipseLinkEmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** java attribute mapping composites **********************
-
- @Override
- public JpaComposite createJavaIdMappingComposite(
- PropertyValueModel<JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaBasicMappingComposite(
- PropertyValueModel<JavaBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaVersionMappingComposite(
- PropertyValueModel<JavaVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEclipseLinkVersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToOneMappingComposite(
- PropertyValueModel<JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToManyMappingComposite(
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToOneMappingComposite(
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToManyMappingComposite(
- PropertyValueModel<JavaManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEclipseLinkBasicMapMappingComposite(
- PropertyValueModel<EclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkBasicMapMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEclipseLinkBasicCollectionMappingComposite(
- PropertyValueModel<EclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkBasicCollectionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEclipseLinkVariableOneToOneMappingComposite(
- PropertyValueModel<EclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkVariableOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEclipseLinkTransformationMappingComposite(
- PropertyValueModel<EclipseLinkTransformationMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EclipseLinkTransformationMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkArrayMapping2_3UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkArrayMapping2_3UiDefinition.java
deleted file mode 100644
index 91ef3e112e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkArrayMapping2_3UiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkArrayMapping2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkArrayMapping2_3UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkArrayMapping2_3Composite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkArrayMapping2_3UiDefinition
- extends AbstractEclipseLinkArrayMapping2_3UiDefinition<ReadOnlyPersistentAttribute, EclipseLinkArrayMapping2_3>
- implements JavaAttributeMappingUiDefinition<EclipseLinkArrayMapping2_3>
-{
- // singleton
- private static final JavaEclipseLinkArrayMapping2_3UiDefinition INSTANCE =
- new JavaEclipseLinkArrayMapping2_3UiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkArrayMapping2_3> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkArrayMapping2_3UiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkArrayMapping2_3> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkArrayMapping2_3Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicCollectionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicCollectionMappingUiDefinition.java
deleted file mode 100644
index 6315dca2da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicCollectionMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicCollectionMappingComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkBasicCollectionMappingUiDefinition
- extends AbstractEclipseLinkBasicCollectionMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkBasicCollectionMapping>
- implements JavaAttributeMappingUiDefinition<EclipseLinkBasicCollectionMapping>
-{
- // singleton
- private static final JavaEclipseLinkBasicCollectionMappingUiDefinition INSTANCE =
- new JavaEclipseLinkBasicCollectionMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkBasicCollectionMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkBasicCollectionMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkBasicCollectionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMapMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMapMappingUiDefinition.java
deleted file mode 100644
index 58922cced3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMapMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicMapMappingComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkBasicMapMappingUiDefinition
- extends AbstractEclipseLinkBasicMapMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkBasicMapMapping>
- implements JavaAttributeMappingUiDefinition<EclipseLinkBasicMapMapping>
-{
- // singleton
- private static final JavaEclipseLinkBasicMapMappingUiDefinition INSTANCE =
- new JavaEclipseLinkBasicMapMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkBasicMapMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkBasicMapMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkBasicMapMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMappingComposite.java
deleted file mode 100644
index f96456654a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkBasicMappingComposite.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicMappingComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkBasicMappingComposite extends EclipseLinkBasicMappingComposite<BasicMapping>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkBasicMappingComposite(PropertyValueModel<? extends BasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeBasicCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkCaching2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkCaching2_0Composite.java
deleted file mode 100644
index e22419ae34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkCaching2_0Composite.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkAlwaysRefreshComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheSizeComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheTypeComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCaching2_0Composite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkDisableHitsComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkRefreshOnlyIfNewerComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 3.0
- * @since 3.0
- */
-public class JavaEclipseLinkCaching2_0Composite extends EclipseLinkCaching2_0Composite<JavaEclipseLinkCaching>
-{
-
- public JavaEclipseLinkCaching2_0Composite(Pane<?> parentPane,
- PropertyValueModel<JavaEclipseLinkCaching> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeExistenceCheckingComposite(Composite parent) {
- new JavaEclipseLinkExistenceCheckingComposite(this, parent);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkCachingComposite.java
deleted file mode 100644
index 15514ce19c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkCachingComposite.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkAlwaysRefreshComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheSizeComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheTypeComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCachingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkDisableHitsComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkRefreshOnlyIfNewerComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching2_0
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 2.1
- * @since 2.1
- */
-public class JavaEclipseLinkCachingComposite extends EclipseLinkCachingComposite<JavaEclipseLinkCaching>
-{
-
- public JavaEclipseLinkCachingComposite(Pane<?> parentPane,
- PropertyValueModel<JavaEclipseLinkCaching> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeExistenceCheckingComposite(Composite parent) {
- new JavaEclipseLinkExistenceCheckingComposite(this, parent);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkElementCollectionMapping2_0Composite.java
deleted file mode 100644
index 8b7db1d49a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkElementCollectionMapping2_0Composite.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkElementCollectionMapping2_0Composite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CollectionTable2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.TargetClassComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkElementCollectionMapping2_0Composite
- extends EclipseLinkElementCollectionMapping2_0Composite<JavaElementCollectionMapping2_0>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkElementCollectionMapping2_0Composite(PropertyValueModel<? extends JavaElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeElementCollectionSection(Composite container) {
- new TargetClassComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchHolder(), container);
- new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container);
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchHolder() {
- return new PropertyAspectAdapter<JavaElementCollectionMapping2_0, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkElementCollectionMapping2_0) this.subject).getJoinFetch();
- }
- };
- }
-
-
- @Override
- protected void initializeBasicValueTypeSection(Composite typeSection) {
- super.initializeBasicValueTypeSection(typeSection);
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
-
- // EclipseLink Converter
- Button elConverterButton = addRadioButton(
- typeSection,
- EclipseLinkUiDetailsMessages.TypeSection_converted,
- buildConverterBooleanHolder(EclipseLinkConvert.class),
- null);
- ((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
-
- Pane<EclipseLinkConvert> convertComposite = buildConvertComposite(buildEclipseLinkConverterHolder(converterHolder), typeSection);
- GridData gridData = (GridData) convertComposite.getControl().getLayoutData();
- gridData.horizontalSpan = 2;
- gridData.horizontalIndent = 20;
- registerSubPane(convertComposite);
- }
-
- protected PropertyValueModel<Converter> buildConverterHolder() {
- return new PropertyAspectAdapter<ConvertibleMapping, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Converter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildConverterBooleanHolder(final Class<? extends Converter> converterType) {
- return new PropertyAspectAdapter<ConvertibleMapping, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getType() == converterType);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(converterType);
- }
- }
- };
- }
-
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new EclipseLinkConvertComposite(convertHolder, container, getWidgetFactory());
- }
-
- protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, EclipseLinkConvert>(converterHolder) {
- @Override
- protected EclipseLinkConvert transform_(Converter converter) {
- return converter.getType() == EclipseLinkConvert.class ? (EclipseLinkConvert) converter : null;
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddable1_2Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddable1_2Composite.java
deleted file mode 100644
index 3c222e51f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddable1_2Composite.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see JavaUiFactory - The factory creating this pane
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.1
- */
-public class JavaEclipseLinkEmbeddable1_2Composite extends AbstractJavaEclipseLinkEmbeddableComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkEmbeddable1_2Composite(PropertyValueModel<? extends JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEmbeddableCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- @Override
- protected void initializeEmbeddableSection(Composite container) {
- new AccessTypeComposite(this, buildAccessHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaEmbeddable, AccessHolder>(
- getSubjectHolder())
- {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddableComposite.java
deleted file mode 100644
index 4e530bdd45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEmbeddableComposite.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see JavaUiFactory - The factory creating this pane
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.1
- */
-public class JavaEclipseLinkEmbeddableComposite extends AbstractJavaEclipseLinkEmbeddableComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkEmbeddableComposite(PropertyValueModel<? extends JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity1_2Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity1_2Composite.java
deleted file mode 100644
index 2d0ceafed0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity1_2Composite.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EntityNameComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TableComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink1.2 Java entity.
- *
- * @see JavaEclipseLinkEntity
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.2
- */
-public class JavaEclipseLinkEntity1_2Composite
- extends AbstractJavaEclipseLinkEntityComposite<JavaEntity>
-{
- /**
- * Creates a new <code>EclipseLinkJavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkEntity1_2Composite(
- PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEntitySection(Composite container) {
- new TableComposite(this, container);
- new EntityNameComposite(this, container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaEntity, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_0Composite.java
deleted file mode 100644
index 6bdc55c5bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_0Composite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink 2.0 Java entity.
- *
- * @see JavaEclipseLinkEntity
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 3.1
- * @since 2.2
- */
-public class JavaEclipseLinkEntity2_0Composite
- extends AbstractJavaEclipseLinkEntity2_xComposite
-{
- /**
- * Creates a new <code>EclipseLinkJavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkEntity2_0Composite(
- PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_3Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_3Composite.java
deleted file mode 100644
index cb8ec5d7aa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntity2_3Composite.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMultitenancyComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink 2.3 Java entity.
- *
- * @version 3.1
- * @since 3.1
- */
-public class JavaEclipseLinkEntity2_3Composite
- extends AbstractJavaEclipseLinkEntity2_xComposite
-{
- public JavaEclipseLinkEntity2_3Composite(
- PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityCollapsibleSection(container);
- this.initializeCachingCollapsibleSectionPane(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeInheritanceCollapsibleSection(container);
- this.initializeAttributeOverridesCollapsibleSection(container);
- this.initializeMultitenancyCollapsibleSectionPane(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeSecondaryTablesCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- protected void initializeMultitenancyCollapsibleSectionPane(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_multitenancy);
- this.initializeMultitenancySection(container, buildMultitenancyHolder());
- }
-
- protected void initializeMultitenancySection(Composite container, PropertyValueModel<JavaEclipseLinkMultitenancy2_3> multitenancyHolder) {
- new EclipseLinkMultitenancyComposite(this, multitenancyHolder, container);
- }
-
- private PropertyAspectAdapter<JavaEntity, JavaEclipseLinkMultitenancy2_3> buildMultitenancyHolder() {
- return new PropertyAspectAdapter<JavaEntity, JavaEclipseLinkMultitenancy2_3>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkMultitenancy2_3 buildValue_() {
- return ((JavaEclipseLinkEntity) this.subject).getMultitenancy();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntityComposite.java
deleted file mode 100644
index 33b4aa98ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkEntityComposite.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java entity.
- *
- * @see JavaEclipseLinkEntity
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.1
- * @since 2.1
- */
-public class JavaEclipseLinkEntityComposite
- extends AbstractJavaEclipseLinkEntityComposite<JavaEntity>
-{
- /**
- * Creates a new <code>EclipseLinkJavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkEntityComposite(
- PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkExistenceCheckingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkExistenceCheckingComposite.java
deleted file mode 100644
index 5720e445be..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkExistenceCheckingComposite.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -------------------------------------------------------------------------
- * | ---------------------------------------------- |
- * | x Existence Checking: | |v| |
- * | ---------------------------------------------- |
- * -------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see CachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class JavaEclipseLinkExistenceCheckingComposite extends Pane<JavaEclipseLinkCaching> {
-
- /**
- * Creates a new <code>ExistenceCheckingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public JavaEclipseLinkExistenceCheckingComposite(Pane<? extends JavaEclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- addCheckBox(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_label,
- buildExistenceCheckingHolder(),
- null
- ),
- addExistenceCheckingTypeCombo(container).getControl(),
- null
- );
- }
-
- private EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType> addExistenceCheckingTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkCaching.DEFAULT_EXISTENCE_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkCaching.SPECIFIED_EXISTENCE_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkExistenceType[] getChoices() {
- return EclipseLinkExistenceType.values();
- }
-
- @Override
- protected EclipseLinkExistenceType getDefaultValue() {
- return getSubject().getDefaultExistenceType();
- }
-
- @Override
- protected String displayString(EclipseLinkExistenceType value) {
- switch (value) {
- case CHECK_CACHE :
- return EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_check_cache;
- case CHECK_DATABASE :
- return EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_check_database;
- case ASSUME_EXISTENCE :
- return EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_assume_existence;
- case ASSUME_NON_EXISTENCE :
- return EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_assume_non_existence;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected EclipseLinkExistenceType getValue() {
- return getSubject().getSpecifiedExistenceType();
- }
-
- @Override
- protected void setValue(EclipseLinkExistenceType value) {
- getSubject().setSpecifiedExistenceType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildExistenceCheckingHolder() {
- return new PropertyAspectAdapter<JavaEclipseLinkCaching, Boolean>(getSubjectHolder(), JavaEclipseLinkCaching.EXISTENCE_CHECKING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isExistenceChecking());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setExistenceChecking(value.booleanValue());
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMapping2_0Composite.java
deleted file mode 100644
index 6e943d9b13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMapping2_0Composite.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkIdMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.IdMapping2_0MappedByRelationshipPane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.IdMappingGeneration2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkIdMapping2_0Composite
- extends EclipseLinkIdMappingComposite<JavaIdMapping>
-{
- public JavaEclipseLinkIdMapping2_0Composite(
- PropertyValueModel<? extends JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeIdCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeGenerationCollapsibleSection(container);
- }
-
- @Override
- protected void initializeIdSection(Composite container) {
- new IdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new ColumnComposite(this, buildColumnHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeGenerationCollapsibleSection(Composite container) {
- new IdMappingGeneration2_0Composite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMapping2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMapping2_0UiDefinition.java
deleted file mode 100644
index cfc2505a78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMapping2_0UiDefinition.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaIdMappingUiDefinition;
-
-public class JavaEclipseLinkIdMapping2_0UiDefinition
- extends JavaIdMappingUiDefinition
-{
- // singleton
- private static final JavaEclipseLinkIdMapping2_0UiDefinition INSTANCE =
- new JavaEclipseLinkIdMapping2_0UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static JavaAttributeMappingUiDefinition<JavaIdMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaEclipseLinkIdMapping2_0UiDefinition() {
- super();
- }
-
-
- @Override
- public boolean isEnabledFor(ReadOnlyPersistentAttribute mappableObject) {
- // a default eclipselink 1-1 mapping can not be mapped as an id, as mapping it
- // that way will actually result in a default 1-1 with an id derived identity
- return Tools.valuesAreDifferent(
- mappableObject.getDefaultMappingKey(),
- MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMappingComposite.java
deleted file mode 100644
index 747e1091fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkIdMappingComposite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkIdMappingComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkIdMappingComposite
- extends EclipseLinkIdMappingComposite<IdMapping>
-{
- public JavaEclipseLinkIdMappingComposite(
- PropertyValueModel<? extends IdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeIdCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeGenerationCollapsibleSection(container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToManyMapping2_0Composite.java
deleted file mode 100644
index ff0a1e3aa1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkManyToManyMapping2_0Composite
- extends EclipseLinkManyToManyMappingComposite<ManyToManyMapping>
-{
- public JavaEclipseLinkManyToManyMapping2_0Composite(
- PropertyValueModel<? extends ManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeManyToManyCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeOrderingCollapsibleSection(container);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, this.buildJoinFetchableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-
- protected PropertyValueModel<ManyToManyRelationship> buildEclipseLinkJoiningHolder() {
- return new TransformationPropertyValueModel<ManyToManyMapping, ManyToManyRelationship>(this.getSubjectHolder()) {
- @Override
- protected ManyToManyRelationship transform_(ManyToManyMapping value) {
- return value.getRelationship();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToOneMapping2_0Composite.java
deleted file mode 100644
index 1b7a0e8750..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkManyToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractManyToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkManyToOneMapping2_0Composite
- extends AbstractManyToOneMapping2_0Composite<JavaManyToOneMapping, JavaManyToOneRelationship2_0>
-{
- public JavaEclipseLinkManyToOneMapping2_0Composite(
- PropertyValueModel<? extends JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<JavaManyToOneMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkJoinFetchMapping) this.subject).getJoinFetch();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass1_2Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass1_2Composite.java
deleted file mode 100644
index 90d44d0892..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass1_2Composite.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java Mapped Superclass.
- *
- * @see EclipseLinkMappedSuperclass
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.1
- */
-public class JavaEclipseLinkMappedSuperclass1_2Composite
- extends AbstractJavaEclipseLinkMappedSuperclassComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkMappedSuperclass1_2Composite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeMappedSuperclassSection(Composite container) {
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_0Composite.java
deleted file mode 100644
index 79b795926f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_0Composite.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java Mapped Superclass.
- *
- * @see EclipseLinkMappedSuperclass
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.3
- */
-public class JavaEclipseLinkMappedSuperclass2_0Composite
- extends AbstractJavaEclipseLinkMappedSuperclassComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkMappedSuperclass2_0Composite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeMappedSuperclassSection(Composite container) {
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<JavaEclipseLinkCaching> cachingHolder) {
- new JavaEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_3Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_3Composite.java
deleted file mode 100644
index b58a546bd6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclass2_3Composite.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMultitenancyComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink 2.3 Java Mapped Superclass.
- *
- * @see EclipseLinkMappedSuperclass
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 3.1
- * @since 3.1
- */
-public class JavaEclipseLinkMappedSuperclass2_3Composite
- extends AbstractJavaEclipseLinkMappedSuperclassComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkMappedSuperclass2_3Composite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeMappedSuperclassCollapsibleSection(container);
- this.initializeCachingCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeMultitenancyCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- @Override
- protected void initializeMappedSuperclassSection(Composite container) {
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<JavaEclipseLinkCaching> cachingHolder) {
- new JavaEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-
- protected void initializeMultitenancyCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_multitenancy);
- this.initializeMultitenancySection(container, buildMultitenancyHolder());
- }
-
- protected void initializeMultitenancySection(Composite container, PropertyValueModel<JavaEclipseLinkMultitenancy2_3> multitenancyHolder) {
- new EclipseLinkMultitenancyComposite(this, multitenancyHolder, container);
- }
-
- private PropertyAspectAdapter<JavaMappedSuperclass, JavaEclipseLinkMultitenancy2_3> buildMultitenancyHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, JavaEclipseLinkMultitenancy2_3>(getSubjectHolder()) {
- @Override
- protected JavaEclipseLinkMultitenancy2_3 buildValue_() {
- return ((JavaEclipseLinkMappedSuperclass) this.subject).getMultitenancy();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclassComposite.java
deleted file mode 100644
index c7cb0b2dec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkMappedSuperclassComposite.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an EclipseLink Java Mapped Superclass.
- *
- * @see EclipseLinkMappedSuperclass
- * @see EclipselinkJpaUiFactory - The factory creating this pane
- *
- * @version 2.1
- * @since 2.1
- */
-public class JavaEclipseLinkMappedSuperclassComposite
- extends AbstractJavaEclipseLinkMappedSuperclassComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkMappedSuperclassComposite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java
deleted file mode 100644
index b3745710ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkOneToManyMapping2_0Composite
- extends EclipseLinkOneToManyMappingComposite<JavaOneToManyMapping>
-{
- public JavaEclipseLinkOneToManyMapping2_0Composite(
- PropertyValueModel<? extends JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeOneToManyCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeOrderingCollapsibleSection(container);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, this.buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, this.buildPrivateOwnableHolder(), container);
- new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<JavaOneToManyMapping, OrphanRemovable2_0>(this.getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToOneMapping2_0Composite.java
deleted file mode 100644
index beb154c98d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkOneToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractOneToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OneToOneJoiningStrategy2_0Pane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkOneToOneMapping2_0Composite
- extends AbstractOneToOneMapping2_0Composite<JavaOneToOneMapping, JavaOneToOneRelationship2_0>
-{
- public JavaEclipseLinkOneToOneMapping2_0Composite(
- PropertyValueModel<? extends JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new OrphanRemoval2_0Composite(this, buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToOneJoiningStrategy2_0Pane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<JavaOneToOneMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkOneToOneMapping) this.subject).getJoinFetch();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkPrivateOwned> buildPrivateOwnableHolder() {
- return new PropertyAspectAdapter<JavaOneToOneMapping, EclipseLinkPrivateOwned>(this.getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return ((EclipseLinkOneToOneMapping) this.subject).getPrivateOwned();
- }
- };
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<JavaOneToOneMapping, OrphanRemovable2_0>(this.getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkStructureMapping2_3UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkStructureMapping2_3UiDefinition.java
deleted file mode 100644
index 726c2ccf1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkStructureMapping2_3UiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructureMapping2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkStructureMapping2_3UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkStructureMapping2_3Composite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkStructureMapping2_3UiDefinition
- extends AbstractEclipseLinkStructureMapping2_3UiDefinition<ReadOnlyPersistentAttribute, EclipseLinkStructureMapping2_3>
- implements JavaAttributeMappingUiDefinition<EclipseLinkStructureMapping2_3>
-{
- // singleton
- private static final JavaEclipseLinkStructureMapping2_3UiDefinition INSTANCE =
- new JavaEclipseLinkStructureMapping2_3UiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkStructureMapping2_3> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkStructureMapping2_3UiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkStructureMapping2_3> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkStructureMapping2_3Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkTransformationMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkTransformationMappingUiDefinition.java
deleted file mode 100644
index 0a835248d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkTransformationMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkTransformationMappingComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkTransformationMappingUiDefinition
- extends AbstractEclipseLinkTransformationMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkTransformationMapping>
- implements JavaAttributeMappingUiDefinition<EclipseLinkTransformationMapping>
-{
- // singleton
- private static final JavaEclipseLinkTransformationMappingUiDefinition INSTANCE =
- new JavaEclipseLinkTransformationMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkTransformationMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkTransformationMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkTransformationMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkTransformationMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVariableOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVariableOneToOneMappingUiDefinition.java
deleted file mode 100644
index 3aed33b3ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVariableOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkVariableOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkVariableOneToOneMappingUiDefinition
- extends AbstractEclipseLinkVariableOneToOneMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkVariableOneToOneMapping>
- implements JavaAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping>
-{
- // singleton
- private static final JavaEclipseLinkVariableOneToOneMappingUiDefinition INSTANCE =
- new JavaEclipseLinkVariableOneToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEclipseLinkVariableOneToOneMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<EclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkVariableOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVersionMappingComposite.java
deleted file mode 100644
index 447eb1f7d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/java/JavaEclipseLinkVersionMappingComposite.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkVersionMappingComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEclipseLinkVersionMappingComposite
- extends EclipseLinkVersionMappingComposite<VersionMapping>
-{
- /**
- * Creates a new <code>EclipseLinkOrmVersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>VersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEclipseLinkVersionMappingComposite(PropertyValueModel<? extends VersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeVersionCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java
deleted file mode 100644
index cd33a5bfb3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractEclipseLinkEntityMappingsDetailsPage.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertersComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractEntityMappingsDetailsPage;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsGeneratorsComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPackageChooser;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmQueriesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.PersistenceUnitMetadataComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmGeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmQueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ConvertersComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see AbstractEclipseLinkEntityMappingsDetailsPage - The parent container
- * @see CatalogCombo
- * @see EnumFormComboViewer
- * @see EntityMappingsGeneratorsComposite
- * @see OrmPackageChooser
- * @see OrmQueriesComposite
- * @see PersistenceUnitMetadataComposite
- * @see SchemaCombo
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractEclipseLinkEntityMappingsDetailsPage extends AbstractEntityMappingsDetailsPage
-{
- /**
- * Creates a new <code>EclipseLinkEntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractEclipseLinkEntityMappingsDetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityMappingsCollapsibleSection(container);
- this.initializePersistenceUnitMetadataCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
-
- this.initializeConvertersSection(container);
- }
-
- protected void initializeConvertersSection(Composite container) {
- new EclipseLinkConvertersComposite(
- this,
- this.buildConverterHolder(),
- container
- );
- }
-
- private PropertyValueModel<OrmEclipseLinkConverterContainer> buildConverterHolder() {
- return new PropertyAspectAdapter<EntityMappings, OrmEclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkConverterContainer buildValue_() {
- return ((EclipseLinkEntityMappings) this.subject).getConverterContainer();
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntity2_xComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntity2_xComposite.java
deleted file mode 100644
index 4c2c1df450..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntity2_xComposite.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Entity2_0OverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Generation2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Queries2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractOrmEclipseLinkEntity2_xComposite extends AbstractOrmEclipseLinkEntityComposite
-{
- protected AbstractOrmEclipseLinkEntity2_xComposite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeAttributeOverridesSection(Composite container) {
- new Entity2_0OverridesComposite(this, container);
- }
-
- @Override
- protected void initializeGeneratorsSection(Composite container, PropertyValueModel<GeneratorContainer> generatorContainerHolder) {
- new Generation2_0Composite(this, generatorContainerHolder, container);
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-
- @Override
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new Queries2_0Composite(this, queryContainerHolder, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java
deleted file mode 100644
index f3c6372a17..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkEntityComposite.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertersComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkEntityAdvancedComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractOrmEclipseLinkEntityComposite extends AbstractOrmEntityComposite
-{
- protected AbstractOrmEclipseLinkEntityComposite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityCollapsibleSection(container);
- this.initializeCachingCollapsibleSectionPane(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeInheritanceCollapsibleSection(container);
- this.initializeAttributeOverridesCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeSecondaryTablesCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- protected void initializeCachingCollapsibleSectionPane(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching);
- initializeCachingSection(container, buildCachingHolder());
- }
-
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCachingComposite(this, cachingHolder, container);
- }
-
-
- private PropertyAspectAdapter<OrmEntity, OrmEclipseLinkCaching> buildCachingHolder() {
- return new PropertyAspectAdapter<OrmEntity, OrmEclipseLinkCaching>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkCaching buildValue_() {
- return ((OrmEclipseLinkEntity) this.subject).getCaching();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters);
- this.initializeConvertersSection(container, buildConverterContainerModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<OrmEclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- private PropertyValueModel<OrmEclipseLinkConverterContainer> buildConverterContainerModel() {
- return new PropertyAspectAdapter<OrmEntity, OrmEclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkConverterContainer buildValue_() {
- return ((OrmEclipseLinkEntity) this.subject).getConverterContainer();
- }
- };
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkEntityAdvancedComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java
deleted file mode 100644
index 94e34d7f99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/AbstractOrmEclipseLinkMappedSuperclassComposite.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertersComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMappedSuperclassAdvancedComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappedSuperclassComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.MetadataCompleteComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmJavaClassChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractOrmEclipseLinkMappedSuperclassComposite
- extends AbstractMappedSuperclassComposite<OrmMappedSuperclass>
- implements JpaComposite
-{
- protected AbstractOrmEclipseLinkMappedSuperclassComposite(
- PropertyValueModel<? extends OrmMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeMappedSuperclassCollapsibleSection(container);
- this.initializeCachingCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- @Override
- protected void initializeMappedSuperclassSection(Composite container) {
- new OrmJavaClassChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- new MetadataCompleteComposite(this, getSubjectHolder(), container);
- }
-
- protected void initializeCachingCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_caching);
- this.initializeCachingSection(container, buildCachingHolder());
- }
-
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCachingComposite(this, cachingHolder, container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<OrmMappedSuperclass, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
- private PropertyAspectAdapter<OrmMappedSuperclass, OrmEclipseLinkCaching> buildCachingHolder() {
- return new PropertyAspectAdapter<OrmMappedSuperclass, OrmEclipseLinkCaching>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkCaching buildValue_() {
- return ((OrmEclipseLinkMappedSuperclass) this.subject).getCaching();
- }
- };
- }
-
- protected void initializeConvertersCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters);
- this.initializeConvertersSection(container, buildConverterContainerModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<OrmEclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- private PropertyValueModel<OrmEclipseLinkConverterContainer> buildConverterContainerModel() {
- return new PropertyAspectAdapter<OrmMappedSuperclass, OrmEclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkConverterContainer buildValue_() {
- return ((OrmEclipseLinkMappedSuperclass) this.subject).getConverterContainer();
- }
- };
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkMappedSuperclassAdvancedComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java
deleted file mode 100644
index 4049f9d0f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/BaseEclipseLinkOrmXmlUiFactory.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TransientMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.BaseOrmXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class BaseEclipseLinkOrmXmlUiFactory extends BaseOrmXmlUiFactory
-{
- // **************** orm type mapping composites ****************************
-
- @Override
- public JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEntityComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddableComposite(
- PropertyValueModel<OrmEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** orm attribute mapping composites ***********************
-
- @Override
- public JpaComposite createOrmIdMappingComposite(
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmBasicMappingComposite(
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmVersionMappingComposite(
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkVersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToOneMappingComposite(
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmOneToManyMappingComposite(
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmOneToOneMappingComposite(
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToManyMappingComposite(
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmTransientMappingComposite(
- PropertyValueModel<OrmTransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new TransientMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLink2_3PersistenceUnitMetadataComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLink2_3PersistenceUnitMetadataComposite.java
deleted file mode 100644
index d29110cf30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLink2_3PersistenceUnitMetadataComposite.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.TenantDiscriminatorColumnsComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.TenantDiscriminatorColumnsComposite.TenantDiscriminatorColumnsEditor;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsPage;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.JptUiDetailsOrmMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.PersistenceUnitMetadataComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.Jpa2_0FlagTransformer;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | - Persistence Unit ------------------------------------------------------ |
- * | |
- * | x XML Mapping Metadata Complete |
- * | |
- * | x Cascade Persist |
- * | |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnitMetadata
- * @see OrmPersistenceUnitDefaults
- * @see EntityMappingsDetailsPage - The parent container
- * @see CatalogCombo
- * @see SchemaCombo
- * @see EnumFormComboViewer
- *
- * @version 3.1
- * @since 3.1
- */
-public class EclipseLink2_3PersistenceUnitMetadataComposite extends PersistenceUnitMetadataComposite
-{
-
- protected TenantDiscriminatorColumnsComposite<OrmPersistenceUnitDefaults> tenantDiscriminatorColumnsComposite;
-
- public EclipseLink2_3PersistenceUnitMetadataComposite(Pane<?> parentPane,
- PropertyValueModel<? extends OrmPersistenceUnitMetadata> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Section
- container = addCollapsibleSection(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_persistenceUnitSection
- );
-
- // XML mapping metadata complete check box
- addCheckBox(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_xmlMappingMetadataCompleteCheckBox,
- buildXmlMappingMetadataCompleteHolder(),
- JpaHelpContextIds.ENTITY_ORM_XML
- );
-
- // Cascade Persist check-box
- addCheckBox(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_cascadePersistCheckBox,
- buildCascadePersistHolder(),
- JpaHelpContextIds.ENTITY_ORM_CASCADE
- );
-
- // Schema widgets
- addLabeledComposite(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_schema,
- addSchemaCombo(container),
- JpaHelpContextIds.ENTITY_ORM_SCHEMA
- );
-
- // Catalog widgets
- addLabeledComposite(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_catalog,
- addCatalogCombo(container),
- JpaHelpContextIds.ENTITY_ORM_CATALOG
- );
-
- new AccessTypeComposite(this, this.getPersistenceUnitDefaultsHolder(), container);
-
- // Delimited Identifiers check-box
- Button diCheckBox = this.addCheckBox(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_delimitedIdentifiersCheckBox,
- this.buildDelimitedIdentifiersHolder(),
- JpaHelpContextIds.ENTITY_ORM_DELIMITED_IDENTIFIERS
- );
-
- SWTTools.controlVisibleState(Jpa2_0FlagTransformer.convertToFlagModel(this.getSubjectHolder()), diCheckBox);
-
-
- // Tenant discriminator columns group pane
- Group tenantDiscriminatorColumnGroupPane = addTitledGroup(
- container,
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumns_groupLabel
- );
-
- this.tenantDiscriminatorColumnsComposite = new TenantDiscriminatorColumnsComposite<OrmPersistenceUnitDefaults>(
- getPersistenceUnitDefaultsHolder(),
- tenantDiscriminatorColumnGroupPane,
- getWidgetFactory(),
- buildTenantDiscriminatorColumnsEditor()
- );
-
- installTenantDiscriminatorColumnsPaneEnabler(this.tenantDiscriminatorColumnsComposite);
- }
-
- protected void installTenantDiscriminatorColumnsPaneEnabler(TenantDiscriminatorColumnsComposite<OrmPersistenceUnitDefaults> pane) {
- pane.installListPaneEnabler(buildPaneEnablerHolder());
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<OrmPersistenceUnitDefaults, Boolean>(getPersistenceUnitDefaultsHolder()) {
- @Override
- protected Boolean transform(OrmPersistenceUnitDefaults value) {
- return Boolean.valueOf(value != null);
- }
- };
- }
-
- protected TenantDiscriminatorColumnsEditor<OrmPersistenceUnitDefaults> buildTenantDiscriminatorColumnsEditor() {
- return new TenantDiscriminatorColumnsProvider();
- }
-
- class TenantDiscriminatorColumnsProvider implements TenantDiscriminatorColumnsEditor<OrmPersistenceUnitDefaults> {
-
- public void addTenantDiscriminatorColumn(OrmPersistenceUnitDefaults subject) {
- OrmTenantDiscriminatorColumn2_3 column = ((EclipseLinkPersistenceUnitDefaults) subject).addTenantDiscriminatorColumn();
- column.setSpecifiedName(ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME);
- }
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns(OrmPersistenceUnitDefaults subject) {
- return EmptyListIterable.instance();
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize(OrmPersistenceUnitDefaults subject) {
- return 0;
- }
-
- public String getDefaultTenantDiscriminatorsListPropertyName() {
- return ""; //$NON-NLS-1$
- }
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns(OrmPersistenceUnitDefaults subject) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(((EclipseLinkPersistenceUnitDefaults) subject).getTenantDiscriminatorColumns());
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize(OrmPersistenceUnitDefaults subject) {
- return ((EclipseLinkPersistenceUnitDefaults) subject).getTenantDiscriminatorColumnsSize();
- }
-
- public String getSpecifiedTenantDiscriminatorsListPropertyName() {
- return EclipseLinkPersistenceUnitDefaults.TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns(OrmPersistenceUnitDefaults subject) {
- return ((EclipseLinkPersistenceUnitDefaults) subject).hasTenantDiscriminatorColumns();
- }
-
- public void removeTenantDiscriminatorColumns(OrmPersistenceUnitDefaults subject, int[] selectedIndices) {
- for (int index = selectedIndices.length; index-- > 0; ) {
- ((EclipseLinkPersistenceUnitDefaults) subject).removeTenantDiscriminatorColumn(selectedIndices[index]);
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java
deleted file mode 100644
index fade87acf0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterDialog.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-public class EclipseLinkConverterDialog
- extends ValidatingDialog<EclipseLinkConverterStateObject>
-{
- /**
- * The associated converter container
- */
- EclipseLinkConverterContainer converterContainer;
-
- // ********** constructors **********
-
- /**
- * Use this constructor to edit an existing conversion value
- */
- public EclipseLinkConverterDialog(Shell parent, EclipseLinkConverterContainer converterContainer) {
- super(parent);
- this.converterContainer = converterContainer;
- }
-
- @Override
- protected EclipseLinkConverterStateObject buildStateObject() {
- return new EclipseLinkConverterStateObject(this.converterContainer);
- }
-
- // ********** open **********
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(this.getTitle());
- }
-
- @Override
- protected String getTitle() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_addConverter;
- }
-
- @Override
- protected String getDescriptionTitle() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_addConverterDescriptionTitle;
- }
-
- @Override
- protected String getDescription() {
- return EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_addConverterDescription;
- }
-
- @Override
- protected DialogPane<EclipseLinkConverterStateObject> buildLayout(Composite container) {
- return new ConversionValueDialogPane(container);
- }
-
- @Override
- public void create() {
- super.create();
-
- ConversionValueDialogPane pane = (ConversionValueDialogPane) getPane();
- pane.selectAll();
-
- getButton(OK).setEnabled(false);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the data value set in the text widget.
- */
- public String getName() {
- return getSubject().getName();
- }
-
- /**
- * Return the object value set in the text widget.
- */
- public Class<? extends EclipseLinkConverter> getConverterType() {
- return getSubject().getConverterType();
- }
-
- private class ConversionValueDialogPane extends DialogPane<EclipseLinkConverterStateObject> {
-
- private Text nameText;
-
- ConversionValueDialogPane(Composite parent) {
- super(EclipseLinkConverterDialog.this.getSubjectHolder(), parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.nameText = addLabeledText(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_name,
- buildNameHolder()
- );
-
- addLabeledCombo(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkConverterDialog_converterType,
- buildConverterTypeListHolder(),
- buildConverterTypeHolder(),
- buildStringConverter(),
- null);
- }
-
- protected ListValueModel<Class<? extends EclipseLinkConverter>> buildConverterTypeListHolder() {
- return new StaticListValueModel<Class<? extends EclipseLinkConverter>>(EclipseLinkConverter.TYPES);
- }
-
- private StringConverter<Class<? extends EclipseLinkConverter>> buildStringConverter() {
- return new StringConverter<Class<? extends EclipseLinkConverter>>() {
- public String convertToString(Class<? extends EclipseLinkConverter> value) {
- if (value == null) {
- return null;
- }
- if (value == EclipseLinkCustomConverter.class) {
- return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_customConverter;
- }
- if (value == EclipseLinkObjectTypeConverter.class) {
- return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_objectTypeConverter;
- }
- if (value == EclipseLinkStructConverter.class) {
- return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_structConverter;
- }
- if (value == EclipseLinkTypeConverter.class) {
- return EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_typeConverter;
- }
- return value.getSimpleName();
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildNameHolder() {
- return new PropertyAspectAdapter<EclipseLinkConverterStateObject, String>(getSubjectHolder(), EclipseLinkConverterStateObject.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<Class<? extends EclipseLinkConverter>> buildConverterTypeHolder() {
- return new PropertyAspectAdapter<EclipseLinkConverterStateObject, Class<? extends EclipseLinkConverter>>(getSubjectHolder(), EclipseLinkConverterStateObject.CONVERTER_TYPE_PROPERTY) {
- @Override
- protected Class<? extends EclipseLinkConverter> buildValue_() {
- return this.subject.getConverterType();
- }
-
- @Override
- protected void setValue_(Class<? extends EclipseLinkConverter> value) {
- this.subject.setConverterType(value);
- }
- };
- }
-
- void selectAll() {
- this.nameText.selectAll();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java
deleted file mode 100644
index 74f1bf2929..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkConverterStateObject.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.common.utility.internal.node.Problem;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-
-/**
- * This is the state object used by the <code>EclipseLinkConverterDialog</code>, which stores
- * the current name and validates it when it is modified.
- *
- * @see EclipseLinkConverterDialog
- *
- * @version 3.2
- * @since 2.1
- */
-final class EclipseLinkConverterStateObject extends AbstractNode
-{
- /**
- * The initial name or <code>null</code>
- */
- private String name;
-
- /**
- * The initial converterType or <code>null</code>
- */
- private Class<? extends EclipseLinkConverter> converterType;
-
- /**
- * The <code>Validator</code> used to validate this state object.
- */
- private Validator validator;
-
- /**
- * The associated converter container
- */
- private EclipseLinkConverterContainer converterContainer;
-
- /**
- * Notifies a change in the data value property.
- */
- static final String NAME_PROPERTY = "name"; //$NON-NLS-1$
-
- /**
- * Notifies a change in the object value property.
- */
- static final String CONVERTER_TYPE_PROPERTY = "converterType"; //$NON-NLS-1$
-
-
- EclipseLinkConverterStateObject(EclipseLinkConverterContainer converterContainer) {
- super(null);
- this.converterContainer = converterContainer;
- }
-
- private boolean addNumberOfConvertersProblemsTo(List<Problem> currentProblems) {
- if (this.converterContainer.getNumberSupportedConverters() <= this.converterContainer.getConvertersSize()) {
- currentProblems.add(
- buildProblem(
- EclipseLinkUiDetailsMessages.EclipseLinkConvertersComposite_maxConvertersErrorMessage,
- IMessageProvider.ERROR,
- Integer.valueOf(this.converterContainer.getNumberSupportedConverters())));
- return false;
- }
- return true;
- }
-
- private void addNameProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.name)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConverterStateObject_nameMustBeSpecified, IMessageProvider.ERROR));
- }
- else if (names().contains(this.name)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConverterStateObject_nameExists, IMessageProvider.WARNING));
- } else if (ArrayTools.contains(EclipseLinkConvert.RESERVED_CONVERTER_NAMES, this.name)) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConverterStateObject_nameIsReserved, IMessageProvider.ERROR));
- }
- }
-
- private void addConverterTypeProblemsTo(List<Problem> currentProblems) {
- if (this.converterType == null) {
- currentProblems.add(buildProblem(EclipseLinkUiDetailsMessages.EclipseLinkConverterStateObject_typeMustBeSpecified, IMessageProvider.ERROR));
- }
- }
-
- @Override
- protected void addProblemsTo(List<Problem> currentProblems) {
- super.addProblemsTo(currentProblems);
- boolean continueValidating = this.addNumberOfConvertersProblemsTo(currentProblems);
- if (continueValidating) {
- this.addNameProblemsTo(currentProblems);
- this.addConverterTypeProblemsTo(currentProblems);
- }
- }
-
- private List<String> names() {
- List<String> names = new ArrayList<String>();
- for (EclipseLinkConverter converter : this.getPersistenceUnit().getAllConverters()){
- names.add(converter.getName());
- }
- return names ;
- }
-
- private EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) this.converterContainer.getPersistenceUnit();
- }
-
- @Override
- protected void checkParent(Node parentNode) {
- //no parent
- }
-
- public String displayString() {
- return null;
- }
-
- String getName() {
- return this.name;
- }
-
- Class<? extends EclipseLinkConverter> getConverterType() {
- return this.converterType;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public void setConverterType(Class<? extends EclipseLinkConverter> newConverterType) {
- Class<? extends EclipseLinkConverter> oldConverterType = this.converterType;
- this.converterType = newConverterType;
- firePropertyChanged(CONVERTER_TYPE_PROPERTY, oldConverterType, newConverterType);
- }
-
- @Override
- public void setValidator(Validator validator) {
- this.validator = validator;
- }
-
- @Override
- public Validator getValidator() {
- return this.validator;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsPage.java
deleted file mode 100644
index 55fd4380f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsPage.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsGeneratorsComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPackageChooser;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmQueriesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.PersistenceUnitMetadataComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappingsGenerators2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmQueries2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmGeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmQueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ConvertersComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see EclipseLinkEntityMappings2_0DetailsPage - The parent container
- * @see CatalogCombo
- * @see EnumFormComboViewer
- * @see EntityMappingsGeneratorsComposite
- * @see OrmPackageChooser
- * @see OrmQueriesComposite
- * @see PersistenceUnitMetadataComposite
- * @see SchemaCombo
- *
- * @version 2.3
- * @since 2.1
- */
-public class EclipseLinkEntityMappings2_0DetailsPage extends AbstractEclipseLinkEntityMappingsDetailsPage
-{
- /**
- * Creates a new <code>EclipseLinkEntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkEntityMappings2_0DetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeGeneratorsCollapsibleSection(Composite container) {
- new EntityMappingsGenerators2_0Composite(this, container);
- }
-
- @Override
- protected void initializeQueriesCollapsibleSection(Composite container) {
- new OrmQueries2_0Composite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsProvider.java
deleted file mode 100644
index 24cc9f6e46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_0DetailsProvider.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityMappingsDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPageManager}
- * when the information comes from the XML file (either from the persistence
- * configuration or from the Mappings Descriptor).
- *
- * @version 3.1
- * @since 2.2
- */
-public class EclipseLinkEntityMappings2_0DetailsProvider
- extends AbstractEntityMappingsDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new EclipseLinkEntityMappings2_0DetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkEntityMappings2_0DetailsProvider() {
- super();
- }
-
-
- @Override
- protected boolean providesDetails(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE) ||
- resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE) ||
- resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_2_RESOURCE_TYPE);
- }
-
- public JpaDetailsPageManager<? extends JpaStructureNode> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkEntityMappings2_0DetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsPage.java
deleted file mode 100644
index fb5f43a3e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsPage.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappingsGenerators2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmQueries2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmGeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmQueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ConvertersComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TenantDiscriminatorColumnsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- *
- * @version 3.1
- * @since 3.1
- */
-public class EclipseLinkEntityMappings2_3DetailsPage extends AbstractEclipseLinkEntityMappingsDetailsPage
-{
- /**
- * Creates a new <code>EclipseLinkEntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkEntityMappings2_3DetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityMappingsCollapsibleSection(container);
- this.initializePersistenceUnitMetadataCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeMultitenancyCollapsibleSection(container);
- }
-
- @Override
- protected void initializeGeneratorsCollapsibleSection(Composite container) {
- new EntityMappingsGenerators2_0Composite(this, container);
- }
-
- @Override
- protected void initializeQueriesCollapsibleSection(Composite container) {
- new OrmQueries2_0Composite(this, container);
- }
-
- @Override
- protected void initializePersistenceUnitMetadataCollapsibleSection(Composite container) {
- new EclipseLink2_3PersistenceUnitMetadataComposite(
- this,
- buildPersistentUnitMetadataHolder(),
- addSubPane(container, 5)
- );
- }
-
- protected void initializeMultitenancyCollapsibleSection(Composite container) {
- new EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite(this, container).getControl();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsProvider.java
deleted file mode 100644
index fa2e449002..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappings2_3DetailsProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityMappingsDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPageManager}
- * when the information comes from the XML file (either from the persistence
- * configuration or from the Mappings Descriptor).
- *
- * @version 3.1
- * @since 3.1
- */
-public class EclipseLinkEntityMappings2_3DetailsProvider
- extends AbstractEntityMappingsDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new EclipseLinkEntityMappings2_3DetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkEntityMappings2_3DetailsProvider() {
- super();
- }
-
-
- @Override
- protected boolean providesDetails(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_3_RESOURCE_TYPE) ||
- resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_4_RESOURCE_TYPE);
- }
-
- public JpaDetailsPageManager<? extends JpaStructureNode> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkEntityMappings2_3DetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java
deleted file mode 100644
index 3939440cff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsPage.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsGeneratorsComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPackageChooser;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmQueriesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.PersistenceUnitMetadataComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmGeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmQueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ConvertersComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see EclipseLinkEntityMappingsDetailsPage - The parent container
- * @see CatalogCombo
- * @see EnumFormComboViewer
- * @see EntityMappingsGeneratorsComposite
- * @see OrmPackageChooser
- * @see OrmQueriesComposite
- * @see PersistenceUnitMetadataComposite
- * @see SchemaCombo
- *
- * @version 2.2
- * @since 2.1
- */
-public class EclipseLinkEntityMappingsDetailsPage extends AbstractEclipseLinkEntityMappingsDetailsPage
-{
- /**
- * Creates a new <code>EclipseLinkEntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EclipseLinkEntityMappingsDetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java
deleted file mode 100644
index 92305d4a4a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsDetailsProvider.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityMappingsDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPageManager}
- * when the information comes from the XML file (either from the persistence
- * configuration or from the Mappings Descriptor).
- *
- * @version 2.2
- * @since 2.2
- */
-public class EclipseLinkEntityMappingsDetailsProvider
- extends AbstractEntityMappingsDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new EclipseLinkEntityMappingsDetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkEntityMappingsDetailsProvider() {
- super();
- }
-
-
- @Override
- protected boolean providesDetails(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE)
- || resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE)
- || resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE);
- }
-
- public JpaDetailsPageManager<? extends JpaStructureNode> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkEntityMappingsDetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite.java
deleted file mode 100644
index 65584d2503..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ReadOnlyWritablePropertyValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ValueListAdapter;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.ReadOnlyTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.TenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.TenantDiscriminatorColumnsComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.TenantDiscriminatorColumnsComposite.TenantDiscriminatorColumnsEditor;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-public class EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite extends Pane<EntityMappings> {
-
- private TenantDiscriminatorColumnsComposite<EntityMappings> tenantDiscriminatorColumnsComposite;
-
- public EclipseLinkEntityMappingsTenantDiscriminatorColumnsComposite(Pane<? extends EntityMappings> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_multitenancy
- );
-
- // Tenant discriminator columns group pane
- Group tenantDiscriminatorColumnGroupPane = addTitledGroup(
- container,
- EclipseLinkUiDetailsMessages.TenantDiscriminatorColumns_groupLabel
- );
-
- // Override Default Tenant Discriminator Columns check box
- addCheckBox(
- addSubPane(tenantDiscriminatorColumnGroupPane, 8),
- EclipseLinkUiDetailsMessages.EclipseLinkMultitenancy_overrideDefaultTenantDiscriminatorColumns,
- buildOverrideDefaultTenantDiscriminatorColumnHolder(),
- null
- );
-
- this.tenantDiscriminatorColumnsComposite = this.buildTenantDiscriminatorColumnsComposite(tenantDiscriminatorColumnGroupPane);
-
- this.tenantDiscriminatorColumnsComposite.installListPaneEnabler(new TenantDiscriminatorColumnPaneEnablerHolder());
- }
-
- protected TenantDiscriminatorColumnsComposite<EntityMappings> buildTenantDiscriminatorColumnsComposite(Composite container) {
- return new TenantDiscriminatorColumnsComposite<EntityMappings>(
- getSubjectHolder(),
- container,
- getWidgetFactory(),
- buildTenantDiscriminatorColumnsEditor());
- }
-
-
- protected TenantDiscriminatorColumnsEditor<EntityMappings> buildTenantDiscriminatorColumnsEditor() {
- return new TenantDiscriminatorColumnsProvider();
- }
-
- class TenantDiscriminatorColumnsProvider implements TenantDiscriminatorColumnsEditor<EntityMappings> {
-
- public void addTenantDiscriminatorColumn(EntityMappings subject) {
- OrmTenantDiscriminatorColumn2_3 column = ((EclipseLinkEntityMappings) subject).addSpecifiedTenantDiscriminatorColumn();
- column.setSpecifiedName(ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME);
- }
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getDefaultTenantDiscriminatorColumns(EntityMappings subject) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(((EclipseLinkEntityMappings) subject).getDefaultTenantDiscriminatorColumns());
- }
-
- public int getDefaultTenantDiscriminatorColumnsSize(EntityMappings subject) {
- return ((EclipseLinkEntityMappings) subject).getDefaultTenantDiscriminatorColumnsSize();
- }
-
- public String getDefaultTenantDiscriminatorsListPropertyName() {
- return EclipseLinkEntityMappings.DEFAULT_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
-
- public ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getSpecifiedTenantDiscriminatorColumns(EntityMappings subject) {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(((EclipseLinkEntityMappings) subject).getSpecifiedTenantDiscriminatorColumns());
- }
-
- public int getSpecifiedTenantDiscriminatorColumnsSize(EntityMappings subject) {
- return ((EclipseLinkEntityMappings) subject).getSpecifiedTenantDiscriminatorColumnsSize();
- }
-
- public String getSpecifiedTenantDiscriminatorsListPropertyName() {
- return EclipseLinkEntityMappings.SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST;
- }
-
- public boolean hasSpecifiedTenantDiscriminatorColumns(EntityMappings subject) {
- return ((EclipseLinkEntityMappings) subject).hasSpecifiedTenantDiscriminatorColumns();
- }
-
- public void removeTenantDiscriminatorColumns(EntityMappings subject, int[] selectedIndices) {
- for (int index = selectedIndices.length; index-- > 0; ) {
- ((EclipseLinkEntityMappings) subject).removeSpecifiedTenantDiscriminatorColumn(selectedIndices[index]);
- }
- }
- }
-
- void setSelectedTenantDiscriminatorColumn(ReadOnlyTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn) {
- this.tenantDiscriminatorColumnsComposite.setSelectedTenantDiscriminatorColumn(tenantDiscriminatorColumn);
- }
-
- private ModifiablePropertyValueModel<Boolean> buildOverrideDefaultTenantDiscriminatorColumnHolder() {
- return new OverrideDefaultTenantDiscriminatorColumnHolder();
- }
-
- ListValueModel<ReadOnlyTenantDiscriminatorColumn2_3> buildSpecifiedTenantDiscriminatorColumnsListHolder() {
- return new ListAspectAdapter<EntityMappings, ReadOnlyTenantDiscriminatorColumn2_3>(
- getSubjectHolder(), EclipseLinkEntityMappings.SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST) {
- @Override
- protected ListIterable<ReadOnlyTenantDiscriminatorColumn2_3> getListIterable() {
- return new SuperListIterableWrapper<ReadOnlyTenantDiscriminatorColumn2_3>(((EclipseLinkEntityMappings) this.subject).getSpecifiedTenantDiscriminatorColumns());
- }
-
- @Override
- protected int size_() {
- return ((EclipseLinkEntityMappings) this.subject).getSpecifiedTenantDiscriminatorColumnsSize();
- }
- };
- }
-
- private class OverrideDefaultTenantDiscriminatorColumnHolder
- extends ListPropertyValueModelAdapter<Boolean>
- implements ModifiablePropertyValueModel<Boolean>
- {
- public OverrideDefaultTenantDiscriminatorColumnHolder() {
- super(buildSpecifiedTenantDiscriminatorColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.listModel.size() > 0);
- }
-
- public void setValue(Boolean value) {
- updateTenantDiscriminatorColumns(value.booleanValue());
- }
-
- private void updateTenantDiscriminatorColumns(boolean selected) {
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- EclipseLinkEntityMappings subject = (EclipseLinkEntityMappings) getSubject();
-
- if (selected) {
- TenantDiscriminatorColumn2_3 newTenantDiscriminatorColumn = subject.addSpecifiedTenantDiscriminatorColumn();
- newTenantDiscriminatorColumn.setSpecifiedName(ReadOnlyTenantDiscriminatorColumn2_3.DEFAULT_NAME);
- }
- // Remove all the specified tenant discriminator columns
- else {
- for (int index = subject.getSpecifiedTenantDiscriminatorColumnsSize(); --index >= 0; ) {
- subject.removeSpecifiedTenantDiscriminatorColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
- }
-
- /* CU private */ class TenantDiscriminatorColumnPaneEnablerHolder
- extends TransformationPropertyValueModel<EntityMappings, Boolean>
- {
- private StateChangeListener stateChangeListener;
-
- TenantDiscriminatorColumnPaneEnablerHolder() {
- super(
- new ValueListAdapter<EntityMappings>(
- new ReadOnlyWritablePropertyValueModelWrapper<EntityMappings>(getSubjectHolder()),
- EclipseLinkEntityMappings.SPECIFIED_TENANT_DISCRIMINATOR_COLUMNS_LIST
- )
- );
- this.stateChangeListener = this.buildStateChangeListener();
- }
-
- private StateChangeListener buildStateChangeListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- TenantDiscriminatorColumnPaneEnablerHolder.this.valueStateChanged();
- }
- };
- }
-
- void valueStateChanged() {
- Object old = this.value;
- this.value = this.transform(this.valueModel.getValue());
- firePropertyChanged(VALUE, old, this.value);
- }
-
- @Override
- protected Boolean transform(EntityMappings v) {
- return (v == null) ? Boolean.FALSE : super.transform(v);
- }
-
- @Override
- protected Boolean transform_(EntityMappings v) {
- return Boolean.valueOf(((EclipseLinkEntityMappings) v).getSpecifiedTenantDiscriminatorColumnsSize() > 0);
- }
-
- @Override
- protected void engageModel() {
- super.engageModel();
- this.valueModel.addStateChangeListener(this.stateChangeListener);
- }
-
- @Override
- protected void disengageModel() {
- this.valueModel.removeStateChangeListener(this.stateChangeListener);
- super.disengageModel();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_1UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_1UiDefinition.java
deleted file mode 100644
index 3c1553efac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_1UiDefinition.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-
-public class EclipseLinkOrmXml1_1UiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml1_1UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml1_1UiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml1_1UiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return OrmXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_1UiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_1UiFactory.java
deleted file mode 100644
index 654e751cfe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_1UiFactory.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkOrmXml1_1UiFactory extends BaseEclipseLinkOrmXmlUiFactory
-{
- // **************** orm attribute mapping composites ***********************
-
- @Override
- public JpaComposite createOrmIdMappingComposite(
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkIdMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedIdMappingComposite(
- PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEmbeddedIdMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmBasicMappingComposite(
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkBasicMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmVersionMappingComposite(
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkVersionMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToOneMappingComposite(
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToOneMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public JpaComposite createOrmOneToManyMappingComposite(
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToManyMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- @SuppressWarnings("unchecked")
- public JpaComposite createOrmOneToOneMappingComposite(
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToOneMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToManyMappingComposite(
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToManyMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedMappingComposite(
- PropertyValueModel<OrmEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEmbeddedMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_2UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_2UiDefinition.java
deleted file mode 100644
index 46d56c8b9e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml1_2UiDefinition.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-
-public class EclipseLinkOrmXml1_2UiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml1_2UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml1_2UiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml1_1UiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return OrmXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiDefinition.java
deleted file mode 100644
index b82cbf9f36..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiDefinition.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0UiDefinition;
-
-public class EclipseLinkOrmXml2_0UiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml2_0UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_0UiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml2_0UiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_0_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return OrmXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
-
- definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiFactory.java
deleted file mode 100644
index ae64260644..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_0UiFactory.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.jpa2.details.orm.OrmXmlUiFactory2_0;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkOrmXml2_0UiFactory
- extends BaseEclipseLinkOrmXmlUiFactory
- implements OrmXmlUiFactory2_0
-{
- @Override
- public JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEntity2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkMappedSuperclass2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- // **************** orm attribute mapping composites ***********************
-
- @Override
- public JpaComposite createOrmIdMappingComposite(
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedMappingComposite(
- PropertyValueModel<OrmEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEmbeddedMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedIdMappingComposite(
- PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEmbeddedIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmBasicMappingComposite(
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkBasicMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmVersionMappingComposite(
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkVersionMapping1_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToOneMappingComposite(
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmOneToManyMappingComposite(
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmOneToOneMappingComposite(
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkOneToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToManyMappingComposite(
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkManyToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmElementCollectionMapping2_0Composite(
- PropertyValueModel<OrmElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_1UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_1UiDefinition.java
deleted file mode 100644
index c6ac7d7062..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_1UiDefinition.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0UiDefinition;
-
-public class EclipseLinkOrmXml2_1UiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml2_1UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- protected EclipseLinkOrmXml2_1UiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml2_1UiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_1_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return OrmXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
-
- definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_1UiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_1UiFactory.java
deleted file mode 100644
index 837f7e82d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_1UiFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkOrmXml2_1UiFactory
- extends EclipseLinkOrmXml2_0UiFactory
-{
-
- @Override
- public JpaComposite createOrmElementCollectionMapping2_0Composite(
- PropertyValueModel<OrmElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkElementCollectionMapping2_1Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkMappedSuperclass2_1Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_2UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_2UiDefinition.java
deleted file mode 100644
index 56eb710775..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_2UiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-
-public class EclipseLinkOrmXml2_2UiDefinition extends EclipseLinkOrmXml2_1UiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml2_2UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_2UiDefinition() {
- super();
- }
-
-
- @Override
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_2_RESOURCE_TYPE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_3UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_3UiDefinition.java
deleted file mode 100644
index 3d59de59ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_3UiDefinition.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0UiDefinition;
-
-
-public class EclipseLinkOrmXml2_3UiDefinition
- extends EclipseLinkOrmXml2_1UiDefinition {
-
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml2_3UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_3UiDefinition() {
- super();
- }
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml2_3UiFactory();
- }
-
- @Override
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_3_RESOURCE_TYPE);
- }
-
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
-
- definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance());
- definitions.add(OrmEclipseLinkArrayMapping2_3UiDefinition.instance());
- definitions.add(OrmEclipseLinkStructureMapping2_3UiDefinition.instance());
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_3UiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_3UiFactory.java
deleted file mode 100644
index fe0ce5fc9a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_3UiFactory.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkOrmXml2_3UiFactory
- extends EclipseLinkOrmXml2_0UiFactory
-{
- @Override
- public JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkEntity2_3Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEclipseLinkMappedSuperclass2_3Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_4UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_4UiDefinition.java
deleted file mode 100644
index ffcf0a78d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXml2_4UiDefinition.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0UiDefinition;
-
-
-public class EclipseLinkOrmXml2_4UiDefinition
- extends EclipseLinkOrmXml2_1UiDefinition {
-
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXml2_4UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXml2_4UiDefinition() {
- super();
- }
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXml2_3UiFactory();
- }
-
- @Override
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_2_4_RESOURCE_TYPE);
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
-
- definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance());
- definitions.add(OrmEclipseLinkArrayMapping2_3UiDefinition.instance());
- definitions.add(OrmEclipseLinkStructureMapping2_3UiDefinition.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java
deleted file mode 100644
index 47da418dcb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiDefinition.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-
-public class EclipseLinkOrmXmlUiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkOrmXmlUiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkOrmXmlUiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new EclipseLinkOrmXmlUiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_0_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return OrmXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmEclipseLinkBasicCollectionMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkBasicMapMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkVariableOneToOneMappingUiDefinition.instance());
- definitions.add(OrmEclipseLinkTransformationMappingUiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java
deleted file mode 100644
index 36e300c097..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/EclipseLinkOrmXmlUiFactory.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-public class EclipseLinkOrmXmlUiFactory extends BaseEclipseLinkOrmXmlUiFactory
-{
- //nothing
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmAttributeTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmAttributeTypeComposite.java
deleted file mode 100644
index 2119f7e8ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmAttributeTypeComposite.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmAttributeTypeComposite
- extends ClassChooserPane<AttributeMapping>
-{
- public OrmAttributeTypeComposite(Pane<?> parentPane,
- PropertyValueModel<? extends AttributeMapping> subjectHolder,
- Composite parent) {
-
- this(parentPane, subjectHolder, parent, buildVirtualAttributeModel(subjectHolder));
- }
-
- public OrmAttributeTypeComposite(Pane<?> parentPane,
- PropertyValueModel<? extends AttributeMapping> subjectHolder,
- Composite parent,
- PropertyValueModel<Boolean> enabledModel) {
-
- super(parentPane, subjectHolder, parent, enabledModel);
- }
-
- @Override
- protected JavaTypeCompletionProcessor buildJavaTypeCompletionProcessor() {
- return new JavaTypeCompletionProcessor(true, true);
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiDetailsMessages.OrmAttributeTypeComposite_attributeType;
- }
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<AttributeMapping, String>(
- getSubjectHolder(),
- OrmAttributeMapping.DEFAULT_ATTRIBUTE_TYPE_PROPERTY,
- OrmAttributeMapping.SPECIFIED_ATTRIBUTE_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- if (this.subject.getPersistentAttribute().isVirtual()) {
- return this.subject.getPersistentAttribute().getTypeName();
- }
- //get the attributeType instead of the specifiedAttributeType.
- //this widget will only be enabled if the mapping is VIRTUAL access
- //so we don't need to display the default differently
- return ((OrmAttributeMapping) this.subject).getAttributeType();
- }
-
- @Override
- protected void setValue_(String value) {
- if (this.subject.getPersistentAttribute().isVirtual()) {
- return;
- }
- if (value.length() == 0) {
- value = null;
- }
- // we can safely cast to an orm.xml mapping since it is not virtual
- ((OrmAttributeMapping) this.subject).setSpecifiedAttributeType(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return ((OrmAttributeMapping) getSubject()).getAttributeType();
- }
-
- @Override
- protected void setClassName(String className) {
- ((OrmAttributeMapping) getSubject()).setSpecifiedAttributeType(className);
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- private static PropertyValueModel<AccessHolder> buildAccessHolderHolder(PropertyValueModel<? extends AttributeMapping> mappingHolder) {
- return new PropertyAspectAdapter<AttributeMapping, AccessHolder>(mappingHolder) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- private static PropertyValueModel<Boolean> buildVirtualAttributeModel(PropertyValueModel<? extends AttributeMapping> mappingHolder) {
- return new PropertyAspectAdapter<AccessHolder, Boolean>(
- buildAccessHolderHolder(mappingHolder),
- AccessHolder.SPECIFIED_ACCESS_PROPERTY,
- AccessHolder.DEFAULT_ACCESS_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- if (this.subject == null) {
- return Boolean.FALSE;
- }
- return this.buildValue_();
- }
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getAccess() == EclipseLinkAccessType.VIRTUAL);
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkArrayMapping2_3UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkArrayMapping2_3UiDefinition.java
deleted file mode 100644
index ad000afce5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkArrayMapping2_3UiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkArrayMapping2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkArrayMapping2_3UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkArrayMapping2_3Composite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkArrayMapping2_3UiDefinition
- extends AbstractEclipseLinkArrayMapping2_3UiDefinition<ReadOnlyPersistentAttribute, EclipseLinkArrayMapping2_3>
- implements OrmAttributeMappingUiDefinition<EclipseLinkArrayMapping2_3>
-{
- // singleton
- private static final OrmEclipseLinkArrayMapping2_3UiDefinition INSTANCE =
- new OrmEclipseLinkArrayMapping2_3UiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<EclipseLinkArrayMapping2_3> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkArrayMapping2_3UiDefinition() {
- super();
- }
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<EclipseLinkArrayMapping2_3> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkArrayMapping2_3Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMapping1_1Composite.java
deleted file mode 100644
index f8eff7837e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMapping1_1Composite.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.2
- * @since 2.2
- */
-public class OrmEclipseLinkBasicCollectionMapping1_1Composite extends Pane<EclipseLinkBasicCollectionMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkBasicCollectionMapping1_1Composite(PropertyValueModel<? extends EclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EclipseLinkBasicCollectionMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java
deleted file mode 100644
index 20d7eb523b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicCollectionMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicCollectionMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkBasicCollectionMappingUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicCollectionMappingComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkBasicCollectionMappingUiDefinition
- extends AbstractEclipseLinkBasicCollectionMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkBasicCollectionMapping>
- implements OrmAttributeMappingUiDefinition<EclipseLinkBasicCollectionMapping>
-{
- // singleton
- private static final OrmEclipseLinkBasicCollectionMappingUiDefinition INSTANCE =
- new OrmEclipseLinkBasicCollectionMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<EclipseLinkBasicCollectionMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkBasicCollectionMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<EclipseLinkBasicCollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkBasicCollectionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMapping1_1Composite.java
deleted file mode 100644
index 42c83957c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMapping1_1Composite.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * @version 2.2
- * @since 2.2
- */
-public class OrmEclipseLinkBasicMapMapping1_1Composite extends Pane<EclipseLinkBasicMapMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EclipseLinkBasicCollectionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkBasicMapMapping1_1Composite(PropertyValueModel<? extends EclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EclipseLinkBasicMapMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java
deleted file mode 100644
index 901be5bfc9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkBasicMapMappingUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicMapMappingComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkBasicMapMappingUiDefinition
- extends AbstractEclipseLinkBasicMapMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkBasicMapMapping>
- implements OrmAttributeMappingUiDefinition<EclipseLinkBasicMapMapping>
-{
- // singleton
- private static final OrmEclipseLinkBasicMapMappingUiDefinition INSTANCE =
- new OrmEclipseLinkBasicMapMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<EclipseLinkBasicMapMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkBasicMapMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<EclipseLinkBasicMapMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkBasicMapMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java
deleted file mode 100644
index 45d8dbfac9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMapping1_1Composite.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkBasicMapping1_1Composite extends EclipseLinkBasicMappingComposite<BasicMapping>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkBasicMapping1_1Composite(PropertyValueModel<? extends BasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeBasicCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- }
-
- @Override
- protected void initializeBasicSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, addSubPane(container, 4));
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<BasicMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java
deleted file mode 100644
index 8b1fc2234d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkBasicMappingComposite.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkBasicMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkBasicMappingComposite extends EclipseLinkBasicMappingComposite<BasicMapping>
-{
- /**
- * Creates a new <code>EclipseLinkOrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkBasicMappingComposite(PropertyValueModel<? extends BasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeBasicSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, addSubPane(container, 4));
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCaching2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCaching2_0Composite.java
deleted file mode 100644
index 445f3ce413..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCaching2_0Composite.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkAlwaysRefreshComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheSizeComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheTypeComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCaching2_0Composite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkDisableHitsComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkRefreshOnlyIfNewerComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.JavaEclipseLinkEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 3.0
- * @since 3.0
- */
-public class OrmEclipseLinkCaching2_0Composite extends EclipseLinkCaching2_0Composite<OrmEclipseLinkCaching>
-{
-
- public OrmEclipseLinkCaching2_0Composite(Pane<?> parentPane,
- PropertyValueModel<OrmEclipseLinkCaching> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeExistenceCheckingComposite(Composite parent) {
- new OrmEclipseLinkExistenceCheckingComposite(this, parent);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java
deleted file mode 100644
index cf0dd25520..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkCachingComposite.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkAlwaysRefreshComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheSizeComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCacheTypeComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkCachingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkDisableHitsComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkRefreshOnlyIfNewerComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.JavaEclipseLinkEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane shows the caching options.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | x Shared |
- * | CacheTypeComposite |
- * | CacheSizeComposite |
- * | > Advanced |
- * | ExpiryComposite |
- * | AlwaysRefreshComposite |
- * | RefreshOnlyIfNewerComposite |
- * | DisableHitsComposite |
- * | CacheCoordinationComposite |
- * | ExistenceTypeComposite |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EclipseLinkCaching
- * @see JavaEclipseLinkEntityComposite - The parent container
- * @see EclipseLinkCacheTypeComposite
- * @see EclipseLinkCacheSizeComposite
- * @see EclipseLinkAlwaysRefreshComposite
- * @see EclipseLinkRefreshOnlyIfNewerComposite
- * @see EclipseLinkDisableHitsComposite
- *
- * @version 2.1
- * @since 2.1
- */
-public class OrmEclipseLinkCachingComposite extends EclipseLinkCachingComposite<OrmEclipseLinkCaching>
-{
-
- public OrmEclipseLinkCachingComposite(Pane<?> parentPane,
- PropertyValueModel<OrmEclipseLinkCaching> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeExistenceCheckingComposite(Composite parent) {
- new OrmEclipseLinkExistenceCheckingComposite(this, parent);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_0Composite.java
deleted file mode 100644
index cc53250494..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_0Composite.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkElementCollectionMapping2_0Composite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CollectionTable2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.TargetClassComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkElementCollectionMapping2_0Composite
- extends EclipseLinkElementCollectionMapping2_0Composite<ElementCollectionMapping2_0>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkElementCollectionMapping2_0Composite(PropertyValueModel<? extends ElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeElementCollectionSection(Composite container) {
- new TargetClassComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- @Override
- protected void initializeBasicValueTypeSection(Composite typeSection) {
- super.initializeBasicValueTypeSection(typeSection);
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
-
- // EclipseLink Converter
- Button elConverterButton = addRadioButton(
- typeSection,
- EclipseLinkUiDetailsMessages.TypeSection_converted,
- buildConverterBooleanHolder(EclipseLinkConvert.class),
- null);
- ((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
-
- Pane<EclipseLinkConvert> convertComposite = buildConvertComposite(buildEclipseLinkConverterHolder(converterHolder), typeSection);
- GridData gridData = (GridData) convertComposite.getControl().getLayoutData();
- gridData.horizontalSpan = 2;
- gridData.horizontalIndent = 20;
- registerSubPane(convertComposite);
- }
-
- protected PropertyValueModel<Converter> buildConverterHolder() {
- return new PropertyAspectAdapter<ConvertibleMapping, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Converter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildConverterBooleanHolder(final Class<? extends Converter> converterType) {
- return new PropertyAspectAdapter<ConvertibleMapping, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getType() == converterType);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(converterType);
- }
- }
- };
- }
-
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new EclipseLinkConvertComposite(convertHolder, container, getWidgetFactory());
- }
-
- protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, EclipseLinkConvert>(converterHolder) {
- @Override
- protected EclipseLinkConvert transform_(Converter converter) {
- return converter.getType() == EclipseLinkConvert.class ? (EclipseLinkConvert) converter : null;
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java
deleted file mode 100644
index b7026f07f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkElementCollectionMapping2_1Composite.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkElementCollectionMapping2_0Composite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CollectionTable2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.TargetClassComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkElementCollectionMapping2_1Composite
- extends EclipseLinkElementCollectionMapping2_0Composite<ElementCollectionMapping2_0>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkElementCollectionMapping2_1Composite(PropertyValueModel<? extends ElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeElementCollectionSection(Composite container) {
- new TargetClassComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchHolder(), container);
- new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkElementCollectionMapping2_0) this.subject).getJoinFetch();
- }
- };
- }
-
- @Override
- protected void initializeBasicValueTypeSection(Composite typeSection) {
- super.initializeBasicValueTypeSection(typeSection);
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
-
- // EclipseLink Converter
- Button elConverterButton = addRadioButton(
- typeSection,
- EclipseLinkUiDetailsMessages.TypeSection_converted,
- buildConverterBooleanHolder(EclipseLinkConvert.class),
- null);
- ((GridData) elConverterButton.getLayoutData()).horizontalSpan = 2;
-
- Pane<EclipseLinkConvert> convertComposite = buildConvertComposite(buildEclipseLinkConverterHolder(converterHolder), typeSection);
- GridData gridData = (GridData) convertComposite.getControl().getLayoutData();
- gridData.horizontalSpan = 2;
- gridData.horizontalIndent = 20;
- registerSubPane(convertComposite);
- }
-
- protected PropertyValueModel<Converter> buildConverterHolder() {
- return new PropertyAspectAdapter<ConvertibleMapping, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Converter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildConverterBooleanHolder(final Class<? extends Converter> converterType) {
- return new PropertyAspectAdapter<ConvertibleMapping, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getType() == converterType);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(converterType);
- }
- }
- };
- }
-
- protected Pane<EclipseLinkConvert> buildConvertComposite(PropertyValueModel<EclipseLinkConvert> convertHolder, Composite container) {
- return new EclipseLinkConvertComposite(convertHolder, container, getWidgetFactory());
- }
-
- protected PropertyValueModel<EclipseLinkConvert> buildEclipseLinkConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, EclipseLinkConvert>(converterHolder) {
- @Override
- protected EclipseLinkConvert transform_(Converter converter) {
- return converter.getType() == EclipseLinkConvert.class ? (EclipseLinkConvert) converter : null;
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java
deleted file mode 100644
index cf12bc8da5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddableComposite.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkConvertersComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkEmbeddableAdvancedComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.MetadataCompleteComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmJavaClassChooser;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.1
- */
-public class OrmEclipseLinkEmbeddableComposite
- extends AbstractEmbeddableComposite<OrmEmbeddable>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkEmbeddableComposite(PropertyValueModel<? extends OrmEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEmbeddableCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeAdvancedCollapsibleSection(container);
- }
-
- @Override
- protected void initializeEmbeddableSection(Composite container) {
- new OrmJavaClassChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new MetadataCompleteComposite(this, getSubjectHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<OrmEmbeddable, AccessHolder>(
- getSubjectHolder())
- {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
- protected void initializeConvertersCollapsibleSection(Composite container) {
-
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_converters
- );
- initializeConvertersSection(container, this.buildConverterContainerModel());
- }
-
- protected void initializeConvertersSection(Composite container, PropertyValueModel<OrmEclipseLinkConverterContainer> converterHolder) {
- new EclipseLinkConvertersComposite(this, converterHolder, container);
- }
-
- private PropertyValueModel<OrmEclipseLinkConverterContainer> buildConverterContainerModel() {
- return new PropertyAspectAdapter<OrmEmbeddable, OrmEclipseLinkConverterContainer>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkConverterContainer buildValue_() {
- return ((OrmEclipseLinkEmbeddable) this.subject).getConverterContainer();
- }
- };
- }
-
- protected void initializeAdvancedCollapsibleSection(Composite container) {
- new EclipseLinkEmbeddableAdvancedComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java
deleted file mode 100644
index 2a5ccdade8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping1_1Composite.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedIdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkEmbeddedIdMapping1_1Composite
- extends AbstractEmbeddedIdMappingComposite<EmbeddedIdMapping>
-{
- public OrmEclipseLinkEmbeddedIdMapping1_1Composite(
- PropertyValueModel<? extends EmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeEmbeddedIdSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
-
- new EmbeddedMappingOverridesComposite(
- this,
- container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EmbeddedIdMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java
deleted file mode 100644
index 8933f37b3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedIdMapping2_0Composite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.EmbeddedIdMapping2_0MappedByRelationshipPane;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkEmbeddedIdMapping2_0Composite
- extends OrmEclipseLinkEmbeddedIdMapping1_1Composite
-{
- public OrmEclipseLinkEmbeddedIdMapping2_0Composite(
- PropertyValueModel<? extends EmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeEmbeddedIdSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
-
- new EmbeddedIdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new EmbeddedMappingOverridesComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java
deleted file mode 100644
index 84af284756..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping1_1Composite.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EmbeddedAttributeOverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkEmbeddedMapping1_1Composite
- extends AbstractEmbeddedMappingComposite<EmbeddedMapping>
-{
- /**
- * Creates a new <code>EmbeddedMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>EmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkEmbeddedMapping1_1Composite(PropertyValueModel<? extends EmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEmbeddedSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
-
- new EmbeddedMappingOverridesComposite(
- this,
- container
- );
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EmbeddedMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping2_0Composite.java
deleted file mode 100644
index 2c5f5987ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEmbeddedMapping2_0Composite.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.EmbeddedMapping2_0OverridesComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EmbeddedAttributeOverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- * @see BaseJavaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkEmbeddedMapping2_0Composite
- extends AbstractEmbeddedMappingComposite<EmbeddedMapping>
-{
- /**
- * Creates a new <code>EmbeddedMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>EmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkEmbeddedMapping2_0Composite(PropertyValueModel<? extends EmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEmbeddedSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
-
- new EmbeddedMapping2_0OverridesComposite(
- this,
- container
- );
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EmbeddedMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_0Composite.java
deleted file mode 100644
index 280bd08ab1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_0Composite.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkEntity2_0Composite extends AbstractOrmEclipseLinkEntity2_xComposite
-{
- public OrmEclipseLinkEntity2_0Composite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_3Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_3Composite.java
deleted file mode 100644
index f2195a2840..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntity2_3Composite.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMultitenancyComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkEntity2_3Composite extends AbstractOrmEclipseLinkEntity2_xComposite
-{
- public OrmEclipseLinkEntity2_3Composite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityCollapsibleSection(container);
- this.initializeCachingCollapsibleSectionPane(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeInheritanceCollapsibleSection(container);
- this.initializeAttributeOverridesCollapsibleSection(container);
- this.initializeMultitenancyCollapsibleSectionPane(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeSecondaryTablesCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- protected void initializeMultitenancyCollapsibleSectionPane(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_multitenancy);
- initializeMultitenancySection(container, buildMultitenancyHolder());
- }
-
- protected void initializeMultitenancySection(Composite container, PropertyValueModel<OrmEclipseLinkMultitenancy2_3> multitenancyHolder) {
- new EclipseLinkMultitenancyComposite(this, multitenancyHolder, container);
- }
-
- private PropertyAspectAdapter<OrmEntity, OrmEclipseLinkMultitenancy2_3> buildMultitenancyHolder() {
- return new PropertyAspectAdapter<OrmEntity, OrmEclipseLinkMultitenancy2_3>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkMultitenancy2_3 buildValue_() {
- return ((OrmEclipseLinkEntity) this.subject).getMultitenancy();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java
deleted file mode 100644
index 5a694741b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkEntityComposite.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkEntityComposite extends AbstractOrmEclipseLinkEntityComposite
-{
- public OrmEclipseLinkEntityComposite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java
deleted file mode 100644
index 989081b890..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkExistenceCheckingComposite.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -------------------------------------------------------------------------
- * | ---------------------------------------------- |
- * | x Existence Checking: | |v| |
- * | ---------------------------------------------- |
- * -------------------------------------------------------------------------</pre>
- *
- * @see EclipseLinkCaching
- * @see CachingComposite - A container of this widget
- *
- * @version 2.1
- * @since 2.1
- */
-public class OrmEclipseLinkExistenceCheckingComposite extends Pane<EclipseLinkCaching> {
-
- /**
- * Creates a new <code>ExistenceCheckingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrmEclipseLinkExistenceCheckingComposite(Pane<? extends EclipseLinkCaching> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_label,
- addExistenceCheckingTypeCombo(container).getControl(),
- null
- );
- }
-
- private EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType> addExistenceCheckingTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<EclipseLinkCaching, EclipseLinkExistenceType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EclipseLinkCaching.DEFAULT_EXISTENCE_TYPE_PROPERTY);
- propertyNames.add(EclipseLinkCaching.SPECIFIED_EXISTENCE_TYPE_PROPERTY);
- }
-
- @Override
- protected EclipseLinkExistenceType[] getChoices() {
- return EclipseLinkExistenceType.values();
- }
-
- @Override
- protected EclipseLinkExistenceType getDefaultValue() {
- return getSubject().getDefaultExistenceType();
- }
-
- @Override
- protected String displayString(EclipseLinkExistenceType value) {
- switch (value) {
- case CHECK_CACHE :
- return EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_check_cache;
- case CHECK_DATABASE :
- return EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_check_database;
- case ASSUME_EXISTENCE :
- return EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_assume_existence;
- case ASSUME_NON_EXISTENCE :
- return EclipseLinkUiDetailsMessages.EclipseLinkExistenceCheckingComposite_assume_non_existence;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected EclipseLinkExistenceType getValue() {
- return getSubject().getSpecifiedExistenceType();
- }
-
- @Override
- protected void setValue(EclipseLinkExistenceType value) {
- getSubject().setSpecifiedExistenceType(value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping1_1Composite.java
deleted file mode 100644
index 4c576c790c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping1_1Composite.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkIdMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkIdMapping1_1Composite
- extends EclipseLinkIdMappingComposite<IdMapping>
-{
- public OrmEclipseLinkIdMapping1_1Composite(
- PropertyValueModel<? extends IdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeIdCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeGenerationCollapsibleSection(container);
- }
-
- @Override
- protected void initializeIdSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<IdMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping2_0Composite.java
deleted file mode 100644
index ad00b36d8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMapping2_0Composite.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.IdMapping2_0MappedByRelationshipPane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.IdMappingGeneration2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkIdMapping2_0Composite
- extends OrmEclipseLinkIdMapping1_1Composite
-{
- public OrmEclipseLinkIdMapping2_0Composite(
- PropertyValueModel<? extends IdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new IdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- @Override
- protected void initializeGenerationCollapsibleSection(Composite container) {
- new IdMappingGeneration2_0Composite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java
deleted file mode 100644
index 83fe510fb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkIdMappingComposite.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkIdMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkIdMappingComposite
- extends EclipseLinkIdMappingComposite<IdMapping>
-{
- public OrmEclipseLinkIdMappingComposite(
- PropertyValueModel<? extends IdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeIdSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java
deleted file mode 100644
index 3cef067c46..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping1_1Composite.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToManyJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToManyJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link CascadeComposite}
- * @see {@link OrderingComposite}
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkManyToManyMapping1_1Composite
- extends EclipseLinkManyToManyMappingComposite<OrmManyToManyMapping>
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkManyToManyMapping1_1Composite(PropertyValueModel<? extends OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java
deleted file mode 100644
index 5caa9bf269..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkManyToManyMapping2_0Composite
- extends EclipseLinkManyToManyMappingComposite<OrmManyToManyMapping>
-{
- public OrmEclipseLinkManyToManyMapping2_0Composite(
- PropertyValueModel<? extends OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeManyToManyCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeOrderingCollapsibleSection(container);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java
deleted file mode 100644
index 54ecddc9f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToManyMappingComposite.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToManyJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToManyJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link CascadeComposite}
- * @see {@link OrderingComposite}
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkManyToManyMappingComposite
- extends EclipseLinkManyToManyMappingComposite<OrmManyToManyMapping>
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkManyToManyMappingComposite(PropertyValueModel<? extends OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping1_1Composite.java
deleted file mode 100644
index b1c3616433..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping1_1Composite.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToOneJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToOneJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link OptionalComposite}
- * @see {@link CascadeComposite}
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkManyToOneMapping1_1Composite
- extends EclipseLinkManyToOneMappingComposite<ManyToOneMapping>
-{
- /**
- * Creates a new <code>EclipseLink1_1ManyToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkManyToOneMapping1_1Composite(PropertyValueModel<? extends ManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ManyToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping2_0Composite.java
deleted file mode 100644
index 89bd4f9bd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractManyToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkManyToOneMapping2_0Composite
- extends AbstractManyToOneMapping2_0Composite<ManyToOneMapping, ManyToOneRelationship2_0>
-{
- public OrmEclipseLinkManyToOneMapping2_0Composite(
- PropertyValueModel<? extends ManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ManyToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<ManyToOneMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkJoinFetchMapping) this.subject).getJoinFetch();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java
deleted file mode 100644
index fd1fb6daf9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkManyToOneMappingComposite.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkManyToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToOneJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToOneJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link OptionalComposite}
- * @see {@link CascadeComposite}
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkManyToOneMappingComposite
- extends EclipseLinkManyToOneMappingComposite<ManyToOneMapping>
-{
- /**
- * Creates a new <code>EclipseLink1_1ManyToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkManyToOneMappingComposite(PropertyValueModel<? extends ManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ManyToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_0Composite.java
deleted file mode 100644
index 88a3d983ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_0Composite.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkMappedSuperclass2_0Composite
- extends AbstractOrmEclipseLinkMappedSuperclassComposite
-{
- public OrmEclipseLinkMappedSuperclass2_0Composite(
- PropertyValueModel<? extends OrmMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_1Composite.java
deleted file mode 100644
index 858af0c74e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_1Composite.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.QueriesComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkMappedSuperclass2_1Composite
- extends AbstractOrmEclipseLinkMappedSuperclassComposite {
-
- public OrmEclipseLinkMappedSuperclass2_1Composite(
- PropertyValueModel<? extends OrmMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeMappedSuperclassCollapsibleSection(container);
- this.initializeCachingCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-
- protected void initializeQueriesCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkMappedSuperclassComposite_queries);
- this.initializeQueriesSection(container, buildQueryContainerHolder());
-
- }
-
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new QueriesComposite(this, queryContainerHolder, container);
- }
-
- private PropertyValueModel<QueryContainer> buildQueryContainerHolder() {
- return new PropertyAspectAdapter<OrmMappedSuperclass, QueryContainer>(
- getSubjectHolder()) {
- @Override
- protected QueryContainer buildValue_() {
- return ((OrmEclipseLinkMappedSuperclass) this.subject).getQueryContainer();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_3Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_3Composite.java
deleted file mode 100644
index da19c373fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclass2_3Composite.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMultitenancyComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.QueriesComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkMappedSuperclass2_3Composite
- extends AbstractOrmEclipseLinkMappedSuperclassComposite {
-
- public OrmEclipseLinkMappedSuperclass2_3Composite(
- PropertyValueModel<? extends OrmMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeMappedSuperclassCollapsibleSection(container);
- this.initializeCachingCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeMultitenancyCollapsibleSection(container);
- this.initializeConvertersCollapsibleSection(container);
- this.initializeAdvancedCollapsibleSection(container);
- }
-
- @Override
- protected void initializeCachingSection(Composite container, PropertyValueModel<OrmEclipseLinkCaching> cachingHolder) {
- new OrmEclipseLinkCaching2_0Composite(this, cachingHolder, container);
- }
-
- protected void initializeQueriesCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkMappedSuperclassComposite_queries);
- this.initializeQueriesSection(container, buildQueryContainerHolder());
-
- }
-
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new QueriesComposite(this, queryContainerHolder, container);
- }
-
- private PropertyValueModel<QueryContainer> buildQueryContainerHolder() {
- return new PropertyAspectAdapter<OrmMappedSuperclass, QueryContainer>(
- getSubjectHolder()) {
- @Override
- protected QueryContainer buildValue_() {
- return ((OrmEclipseLinkMappedSuperclass) this.subject).getQueryContainer();
- }
- };
- }
-
- protected void initializeMultitenancyCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- EclipseLinkUiDetailsMessages.EclipseLinkTypeMappingComposite_multitenancy);
- this.initializeMultitenancySection(container, buildMultitenancyHolder());
- }
-
- protected void initializeMultitenancySection(Composite container, PropertyValueModel<OrmEclipseLinkMultitenancy2_3> multitenancyHolder) {
- new EclipseLinkMultitenancyComposite(this, multitenancyHolder, container);
- }
-
- private PropertyAspectAdapter<OrmMappedSuperclass, OrmEclipseLinkMultitenancy2_3> buildMultitenancyHolder() {
- return new PropertyAspectAdapter<OrmMappedSuperclass, OrmEclipseLinkMultitenancy2_3>(getSubjectHolder()) {
- @Override
- protected OrmEclipseLinkMultitenancy2_3 buildValue_() {
- return ((OrmEclipseLinkMappedSuperclass) this.subject).getMultitenancy();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java
deleted file mode 100644
index c1b6e3fa23..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkMappedSuperclassComposite.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkMappedSuperclassComposite
- extends AbstractOrmEclipseLinkMappedSuperclassComposite
-{
- public OrmEclipseLinkMappedSuperclassComposite(
- PropertyValueModel<? extends OrmMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java
deleted file mode 100644
index e89de26f6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping1_1Composite.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class OrmEclipseLinkOneToManyMapping1_1Composite
- extends EclipseLinkOneToManyMappingComposite<OneToManyMapping>
-{
- public OrmEclipseLinkOneToManyMapping1_1Composite(
- PropertyValueModel<? extends OneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToManyMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java
deleted file mode 100644
index 697b7fe60c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class OrmEclipseLinkOneToManyMapping2_0Composite
- extends EclipseLinkOneToManyMappingComposite<OneToManyMapping>
-{
- public OrmEclipseLinkOneToManyMapping2_0Composite(
- PropertyValueModel<? extends OneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeOneToManyCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- initializeOrderingCollapsibleSection(container);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, this.buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, this.buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, this.buildPrivateOwnableHolder(), container);
- new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToManyMapping, AccessHolder>(this.getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<OneToManyMapping, OrphanRemovable2_0>(this.getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java
deleted file mode 100644
index 9d3114dd56..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToManyMappingComposite.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-
-public class OrmEclipseLinkOneToManyMappingComposite
- extends EclipseLinkOneToManyMappingComposite<OneToManyMapping>
-{
- public OrmEclipseLinkOneToManyMappingComposite(
- PropertyValueModel<? extends OneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToManyMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping1_1Composite.java
deleted file mode 100644
index 386e7aa9b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping1_1Composite.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.MappedByPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OneToOneJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AccessTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OneToOneJoiningStrategyPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkJoinFetchComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkPrivateOwnedComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToOneMapping
- * @see AccessTypeComposite
- * @see CascadeComposite
- * @see EclipseLinkJoinFetchComposite
- * @see EclipseLinkPrivateOwnedComposite
- * @see FetchTypeComposite
- * @see MappedByPane
- * @see OneToOneJoiningStrategyPane
- * @see OptionalComposite
- * @see TargetEntityComposite
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEclipseLinkOneToOneMapping1_1Composite
-extends EclipseLinkOneToOneMappingComposite<OneToOneMapping>
-{
- /**
- * Creates a new <code>Eclipselink1_1OneToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkOneToOneMapping1_1Composite(PropertyValueModel<? extends OneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping2_0Composite.java
deleted file mode 100644
index de6a10b7dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractOneToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OneToOneJoiningStrategy2_0Pane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkOneToOneMapping2_0Composite
- extends AbstractOneToOneMapping2_0Composite<OneToOneMapping, OneToOneRelationship2_0>
-{
- public OrmEclipseLinkOneToOneMapping2_0Composite(
- PropertyValueModel<? extends OneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new OrphanRemoval2_0Composite(this, buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToOneJoiningStrategy2_0Pane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkJoinFetch> buildJoinFetchableHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, EclipseLinkJoinFetch>(getSubjectHolder()) {
- @Override
- protected EclipseLinkJoinFetch buildValue_() {
- return ((EclipseLinkOneToOneMapping) this.subject).getJoinFetch();
- }
- };
- }
-
- protected PropertyValueModel<EclipseLinkPrivateOwned> buildPrivateOwnableHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, EclipseLinkPrivateOwned>(getSubjectHolder()) {
- @Override
- protected EclipseLinkPrivateOwned buildValue_() {
- return ((EclipseLinkOneToOneMapping) this.subject).getPrivateOwned();
- }
- };
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, OrphanRemovable2_0>(getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java
deleted file mode 100644
index e67e9d51fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkOneToOneMappingComposite.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkJoinFetchComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkPrivateOwnedComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.MappedByPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OneToOneJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AccessTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OneToOneJoiningStrategyPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkJoinFetchComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EclipseLinkPrivateOwnedComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToOneMapping
- * @see AccessTypeComposite
- * @see CascadeComposite
- * @see EclipseLinkJoinFetchComposite
- * @see EclipseLinkPrivateOwnedComposite
- * @see FetchTypeComposite
- * @see MappedByPane
- * @see OneToOneJoiningStrategyPane
- * @see OptionalComposite
- * @see TargetEntityComposite
- *
- * @version 2.2
- * @since 2.2
- */
-public class OrmEclipseLinkOneToOneMappingComposite
-extends EclipseLinkOneToOneMappingComposite<OneToOneMapping>
-{
- /**
- * Creates a new <code>Eclipselink1_1OneToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkOneToOneMappingComposite(PropertyValueModel<? extends OneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new EclipseLinkJoinFetchComposite(this, buildJoinFetchableHolder(), container);
- new OptionalComposite(this, container);
- new EclipseLinkPrivateOwnedComposite(this, buildPrivateOwnableHolder(), container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkStructureMapping2_3UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkStructureMapping2_3UiDefinition.java
deleted file mode 100644
index 1d9d5960f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkStructureMapping2_3UiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructureMapping2_3;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkStructureMapping2_3UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkStructureMapping2_3Composite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkStructureMapping2_3UiDefinition
- extends AbstractEclipseLinkStructureMapping2_3UiDefinition<ReadOnlyPersistentAttribute, EclipseLinkStructureMapping2_3>
- implements OrmAttributeMappingUiDefinition<EclipseLinkStructureMapping2_3>
-{
- // singleton
- private static final OrmEclipseLinkStructureMapping2_3UiDefinition INSTANCE =
- new OrmEclipseLinkStructureMapping2_3UiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<EclipseLinkStructureMapping2_3> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkStructureMapping2_3UiDefinition() {
- super();
- }
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<EclipseLinkStructureMapping2_3> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkStructureMapping2_3Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java
deleted file mode 100644
index 06ba78f760..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkTransformationMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTransformationMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkTransformationMappingUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkTransformationMappingComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkTransformationMappingUiDefinition
- extends AbstractEclipseLinkTransformationMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkTransformationMapping>
- implements OrmAttributeMappingUiDefinition<EclipseLinkTransformationMapping>
-{
- // singleton
- private static final OrmEclipseLinkTransformationMappingUiDefinition INSTANCE =
- new OrmEclipseLinkTransformationMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<EclipseLinkTransformationMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkTransformationMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<EclipseLinkTransformationMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkTransformationMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java
deleted file mode 100644
index bbf3b0dc07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVariableOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVariableOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.AbstractEclipseLinkVariableOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkVariableOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkVariableOneToOneMappingUiDefinition
- extends AbstractEclipseLinkVariableOneToOneMappingUiDefinition<ReadOnlyPersistentAttribute, EclipseLinkVariableOneToOneMapping>
- implements OrmAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping>
-{
- // singleton
- private static final OrmEclipseLinkVariableOneToOneMappingUiDefinition INSTANCE =
- new OrmEclipseLinkVariableOneToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<EclipseLinkVariableOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEclipseLinkVariableOneToOneMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<EclipseLinkVariableOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkVariableOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java
deleted file mode 100644
index 52f9b576af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMapping1_1Composite.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkVersionMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkVersionMapping1_1Composite
- extends EclipseLinkVersionMappingComposite<VersionMapping>
-{
- /**
- * Creates a new <code>EclipseLinkOrmVersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>VersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkVersionMapping1_1Composite(PropertyValueModel<? extends VersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeVersionCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- initializeConvertersCollapsibleSection(container);
- }
-
- @Override
- protected void initializeVersionSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<VersionMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java
deleted file mode 100644
index 2935f682e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/details/orm/OrmEclipseLinkVersionMappingComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkMutableComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.EclipseLinkVersionMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEclipseLinkVersionMappingComposite
- extends EclipseLinkVersionMappingComposite<VersionMapping>
-{
- /**
- * Creates a new <code>EclipseLinkOrmVersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>VersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEclipseLinkVersionMappingComposite(PropertyValueModel<? extends VersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeVersionSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new OrmAttributeTypeComposite(this, getSubjectHolder(), container);
- new EclipseLinkMutableComposite(this, buildMutableHolder(), container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/dialogs/AddVirtualAttributeDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/dialogs/AddVirtualAttributeDialog.java
deleted file mode 100644
index d4f1a90f49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/dialogs/AddVirtualAttributeDialog.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.dialogs;
-
-import java.util.Comparator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiPlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-import com.ibm.icu.text.Collator;
-
-public class AddVirtualAttributeDialog extends StatusDialog
-{
- private EclipseLinkOrmPersistentType persistentType;
- private Text nameText;
- private ComboViewer mappingCombo;
-
- private Text attributeTypeText;
-
- private Button attributeTypeBrowseButton;
-
- private OrmPersistentAttribute addedAttribute;
-
- public AddVirtualAttributeDialog(Shell parentShell, EclipseLinkOrmPersistentType persistentType) {
- super(parentShell);
- this.persistentType = persistentType;
- setTitle(EclipseLinkUiMessages.AddVirtualAttributeDialog_title);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
-
- Composite composite = new Composite(dialogArea, SWT.NULL);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setLayout(new GridLayout(3, false));
-
- createLabel(composite, 1, EclipseLinkUiMessages.AddVirtualAttributeDialog_nameLabel);
-
- this.nameText = createText(composite, 2);
- this.nameText.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validate();
- }
- }
- );
-
- createLabel(composite, 1, EclipseLinkUiMessages.AddVirtualAttributeDialog_mappingLabel);
-
- this.mappingCombo = new ComboViewer(createCombo(composite, 2));
- this.mappingCombo.getCombo().setFocus();
- this.mappingCombo.setContentProvider(
- new IStructuredContentProvider() {
- public void dispose() {
- //nothing to dispose
- }
-
- public Object[] getElements(Object inputElement) {
- return ArrayTools.array(
- CollectionTools.sort(
- ((JpaPlatformUi) inputElement).attributeMappingUiDefinitions(AddVirtualAttributeDialog.this.persistentType.getResourceType()),
- getProvidersComparator()));
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- //input will not change
- }
- });
- this.mappingCombo.setLabelProvider(
- new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((MappingUiDefinition<?,?>) element).getLabel();
- }
- });
- this.mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- validate();
- }
- });
- JpaPlatformUi jpaPlatformUi = (JpaPlatformUi) this.persistentType.getJpaPlatform().getAdapter(JpaPlatformUi.class);
- this.mappingCombo.setInput(jpaPlatformUi);
- this.mappingCombo.getCombo().select(0); // select Basic to begin
-
- createLabel(composite, 1, EclipseLinkUiMessages.AddVirtualAttributeDialog_attributeTypeLabel);
-
- this.attributeTypeText = createAttributeTypeText(composite);
- this.attributeTypeText.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validate();
- }
- }
- );
-
- this.attributeTypeBrowseButton = createButton(composite, JptUiMessages.General_browse);
- this.attributeTypeBrowseButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- IType type = chooseType();
- if (type != null) {
- attributeTypeText.setText(type.getFullyQualifiedName('$'));
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- this.nameText.setFocus();
-
- applyDialogFont(dialogArea);
-
- validate();
-
- return dialogArea;
- }
-
- protected Comparator<MappingUiDefinition<?,?>> getProvidersComparator() {
- return new Comparator<MappingUiDefinition<?,?>>() {
- public int compare(MappingUiDefinition<?,?> item1, MappingUiDefinition<?,?> item2) {
- String displayString1 = item1.getLabel();
- String displayString2 = item2.getLabel();
- return Collator.getInstance().compare(displayString1, displayString2);
- }
- };
- }
-
- private Label createLabel(Composite container, int span, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- private Text createText(Composite container, int span) {
- Text text = new Text(container, SWT.BORDER | SWT.SINGLE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- gd.widthHint = 250;
- text.setLayoutData(gd);
- return text;
- }
-
- private Text createAttributeTypeText(Composite container) {
- // TODO bug 156185 - when this is fixed there should be api for this
- JavaTypeCompletionProcessor javaTypeCompletionProcessor = new JavaTypeCompletionProcessor(true/*enableBaseTypes*/, false);
- IPackageFragmentRoot pfr = getPackageFragmentRoot();
- if (pfr != null) {
- javaTypeCompletionProcessor.setPackageFragment(pfr.getPackageFragment(""));
- }
-
- Text text = new Text(container, SWT.BORDER | SWT.SINGLE);
-
- ControlContentAssistHelper.createTextContentAssistant(
- text,
- javaTypeCompletionProcessor
- );
-
- text.setLayoutData(getFieldGridData());
- return text;
- }
-
- protected GridData getFieldGridData() {
- int margin = FieldDecorationRegistry.getDefault()
- .getMaximumDecorationWidth();
- GridData data = new GridData();
- data.horizontalAlignment = SWT.FILL;
- data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH + margin;
- data.horizontalIndent = margin;
- data.grabExcessHorizontalSpace = true;
- return data;
- }
-
- protected IPackageFragmentRoot getPackageFragmentRoot() {
- try {
- return this.getJpaProject().getJavaProject().getPackageFragmentRoots()[0];
- } catch (JavaModelException ex) {
- JptJpaEclipseLinkUiPlugin.log(ex);
- return null;
- }
- }
-
- private Combo createCombo(Composite container, int span) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- combo.setLayoutData(gd);
- return combo;
- }
-
- private Button createButton(Composite container, String text) {
- Button button = new Button(container, SWT.NONE);
- button.setText(text);
- return button;
- }
-
- private JpaProject getJpaProject() {
- return this.persistentType.getJpaProject();
- }
-
- public String getAttributeType() {
- return this.attributeTypeText.getText();
- }
-
- public String getAttributeName() {
- return this.nameText.getText();
- }
-
- public String getMappingKey() {
- StructuredSelection selection = (StructuredSelection) this.mappingCombo.getSelection();
- return (selection.isEmpty()) ? null : ((MappingUiDefinition<?,?>) selection.getFirstElement()).getKey();
- }
-
- protected IType chooseType() {
- IJavaElement[] elements= new IJavaElement[] { getJpaProject().getJavaProject() };
- IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
-
- SelectionDialog typeSelectionDialog;
- try {
- typeSelectionDialog =
- JavaUI.createTypeDialog(
- getShell(), service, scope,
- IJavaElementSearchConstants.CONSIDER_ALL_TYPES,
- false, getAttributeType());
- }
- catch (JavaModelException e) {
- JptJpaEclipseLinkUiPlugin.log(e);
- throw new RuntimeException(e);
- }
- typeSelectionDialog.setTitle(JptUiMessages.AddPersistentClassDialog_classDialog_title);
- typeSelectionDialog.setMessage(JptUiMessages.AddPersistentClassDialog_classDialog_message);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
- return null;
- }
-
- private void validate() {
- if (StringTools.stringIsEmpty(this.getAttributeName())) {
- updateStatus(
- new Status(
- IStatus.ERROR, JptJpaEclipseLinkUiPlugin.PLUGIN_ID,
- EclipseLinkUiMessages.AddVirtualAttributeDialog_noNameError));
- return;
- }
- if (this.getMappingKey() == null) {
- updateStatus(
- new Status(
- IStatus.ERROR, JptJpaEclipseLinkUiPlugin.PLUGIN_ID,
- EclipseLinkUiMessages.AddVirtualAttributeDialog_noMappingKeyError));
- return;
- }
- if (StringTools.stringIsEmpty(this.getAttributeType())) {
- updateStatus(
- new Status(
- IStatus.ERROR, JptJpaEclipseLinkUiPlugin.PLUGIN_ID,
- EclipseLinkUiMessages.AddVirtualAttributeDialog_noAttributeTypeError));
- return;
- }
-
- updateStatus(Status.OK_STATUS);
- }
-
-
- @Override
- protected void okPressed() {
- this.addedAttribute = this.persistentType.addVirtualAttribute(getAttributeName(), getMappingKey(), getAttributeType());
- super.okPressed();
- }
-
- public OrmPersistentAttribute openAndReturnAttribute() {
- super.open();
- return this.addedAttribute;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/handlers/AddVirtualAttributeHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/handlers/AddVirtualAttributeHandler.java
deleted file mode 100644
index a07f9e1874..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/handlers/AddVirtualAttributeHandler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.handlers;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.dialogs.AddVirtualAttributeDialog;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Add a virtual attribute (no underlying java attribute) to the selected persistent type.
- * This handler is only active if <em>one</em> EclipseLink ORM persistent type is selected.
- * <p>
- * See <code>org.eclipse.jpt.jpa.eclipselink.ui/plugin.xml</code>.
- */
-public class AddVirtualAttributeHandler
- extends AbstractHandler
-{
- public Object execute(ExecutionEvent event) throws ExecutionException {
- this.execute_(event);
- return null;
- }
-
- private void execute_(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
- EclipseLinkOrmPersistentType persistentType = (EclipseLinkOrmPersistentType) selection.getFirstElement();
-
- AddVirtualAttributeDialog dialog = new AddVirtualAttributeDialog(window.getShell(), persistentType);
- dialog.create();
- dialog.setBlockOnOpen(true);
- OrmPersistentAttribute attribute = dialog.openAndReturnAttribute();
-
- if (attribute != null) {
- JpaSelectionManager selectionManager = PlatformTools.getAdapter(window, JpaSelectionManager.class);
- selectionManager.setSelection(attribute);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java
deleted file mode 100644
index c04baff4ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.structure.EclipseLinkPersistenceStructureItemContentProviderFactory;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.AbstractPersistenceXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceStructureItemLabelProviderFactory;
-
-public class EclipseLinkPersistenceXmlUiDefinition
- extends AbstractPersistenceXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkPersistenceXmlUiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkPersistenceXmlUiDefinition() {
- super();
- }
-
-
- @Override
- protected PersistenceXmlUiFactory buildPersistenceXmlUiFactory() {
- return new EclipseLinkPersistenceXmlUiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- public static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
- new SimpleItemTreeStateProviderFactoryProvider(
- EclipseLinkPersistenceStructureItemContentProviderFactory.instance(),
- PersistenceStructureItemLabelProviderFactory.instance()
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiFactory.java
deleted file mode 100644
index d232e203db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/EclipseLinkPersistenceXmlUiFactory.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching.PersistenceXmlCachingTab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection.PersistenceXmlConnectionTab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization.PersistenceXmlCustomizationTab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general.EclipseLinkPersistenceUnitGeneralComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging.PersistenceXmlLoggingTab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options.PersistenceXmlOptionsTab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.schema.generation.PersistenceXmlSchemaGenerationTab;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceUnitPropertiesComposite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkPersistenceXmlUiFactory implements PersistenceXmlUiFactory
-{
- // ********** constructors **********
-
- public EclipseLinkPersistenceXmlUiFactory() {
- super();
- }
-
- // **************** persistence unit composites ****************************
-
- public ListIterator<JpaPageComposite> createPersistenceUnitComposites(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- ArrayList<JpaPageComposite> pages = new ArrayList<JpaPageComposite>(8);
-
- PropertyValueModel<EclipseLinkPersistenceUnit> eclipseLinkPersistenceUnitHolder =
- this.buildEclipseLinkPersistenceUnitHolder(subjectHolder);
-
- pages.add(this.buildGeneralTab(subjectHolder, parent, widgetFactory));
- pages.add(this.buildConnectionTab(subjectHolder, parent, widgetFactory));
- pages.add(this.buildCustomizationTab(eclipseLinkPersistenceUnitHolder, parent, widgetFactory));
- pages.add(this.buildCachingTab(eclipseLinkPersistenceUnitHolder, parent, widgetFactory));
- pages.add(this.buildLoggingTab(eclipseLinkPersistenceUnitHolder, parent, widgetFactory));
- pages.add(this.buildOptionsTab(subjectHolder, parent, widgetFactory));
- pages.add(this.buildSchemaGenerationTab(eclipseLinkPersistenceUnitHolder, parent, widgetFactory));
- pages.add(this.buildPropertiesTab(subjectHolder, parent, widgetFactory));
-
- return pages.listIterator();
- }
-
- // ********** persistence unit tabs **********
-
- protected EclipseLinkPersistenceUnitGeneralComposite buildGeneralTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EclipseLinkPersistenceUnitGeneralComposite(subjectHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlConnectionTab<? extends Connection> buildConnectionTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Connection> connectionHolder = this.buildConnectionHolder(subjectHolder);
-
- return new PersistenceXmlConnectionTab<Connection>(connectionHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlCustomizationTab<? extends Customization> buildCustomizationTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Customization> customizationHolder = this.buildCustomizationHolder(subjectHolder);
-
- return new PersistenceXmlCustomizationTab<Customization>(customizationHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlCachingTab<? extends Caching> buildCachingTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Caching> cachingHolder = this.buildCachingHolder(subjectHolder);
-
- return new PersistenceXmlCachingTab<Caching>(cachingHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlLoggingTab<? extends Logging> buildLoggingTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Logging> loggingHolder = this.buildLoggingHolder(subjectHolder);
-
- return new PersistenceXmlLoggingTab<Logging>(loggingHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlOptionsTab<? extends Options> buildOptionsTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Options> optionsHolder = this.buildOptionsHolder(subjectHolder);
-
- return new PersistenceXmlOptionsTab<Options>(optionsHolder, parent, widgetFactory);
- }
-
- protected PersistenceXmlSchemaGenerationTab buildSchemaGenerationTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<SchemaGeneration> schemaGenHolder = this.buildSchemaGenerationHolder(subjectHolder);
-
- return new PersistenceXmlSchemaGenerationTab(schemaGenHolder, parent, widgetFactory);
- }
-
- protected PersistenceUnitPropertiesComposite buildPropertiesTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new PersistenceUnitPropertiesComposite(subjectHolder, parent, widgetFactory);
- }
-
- // ********** private methods **********
-
- private PropertyValueModel<EclipseLinkPersistenceUnit> buildEclipseLinkPersistenceUnitHolder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, EclipseLinkPersistenceUnit>(subjectHolder) {
- @Override
- protected EclipseLinkPersistenceUnit transform_(PersistenceUnit value) {
- return (EclipseLinkPersistenceUnit) value;
- }
- };
- }
-
- private PropertyValueModel<Connection> buildConnectionHolder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, Connection>(subjectHolder) {
- @Override
- protected Connection transform_(PersistenceUnit value) {
-
- return ((EclipseLinkPersistenceUnit)value).getConnection();
- }
- };
- }
-
- protected PropertyValueModel<Customization> buildCustomizationHolder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, Customization>(subjectHolder) {
- @Override
- protected Customization transform_(EclipseLinkPersistenceUnit value) {
- return value.getCustomization();
- }
- };
- }
-
- protected PropertyValueModel<Caching> buildCachingHolder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, Caching>(subjectHolder) {
- @Override
- protected Caching transform_(EclipseLinkPersistenceUnit value) {
- return value.getCaching();
- }
- };
- }
-
- private PropertyValueModel<Logging> buildLoggingHolder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, Logging>(subjectHolder) {
- @Override
- protected Logging transform_(EclipseLinkPersistenceUnit value) {
- return value.getLogging();
- }
- };
- }
-
- private PropertyValueModel<Options> buildOptionsHolder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, Options>(subjectHolder) {
- @Override
- protected Options transform_(PersistenceUnit value) {
-
- return ((EclipseLinkPersistenceUnit)value).getOptions();
- }
- };
- }
-
- private PropertyValueModel<SchemaGeneration> buildSchemaGenerationHolder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, SchemaGeneration>(subjectHolder) {
- @Override
- protected SchemaGeneration transform_(EclipseLinkPersistenceUnit value) {
- return value.getSchemaGeneration();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheDefaultsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheDefaultsComposite.java
deleted file mode 100644
index 698161c1fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheDefaultsComposite.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheDefaultsComposite
- */
-public class CacheDefaultsComposite<T extends Caching> extends Pane<T>
-{
- public CacheDefaultsComposite(Pane<T> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- this.initializeCacheDefaultsPane(parent);
- }
-
- protected void initializeCacheDefaultsPane(Composite parent) {
-
- Composite defaultPane = this.addTitledGroup(
- parent,
- EclipseLinkUiMessages.CacheDefaultsComposite_groupTitle
- );
-
- this.initializeCacheDefaultsComposites(defaultPane);
- }
-
- protected void initializeCacheDefaultsComposites(Composite parent) {
-
- // Default Cache Type
- new DefaultCacheTypeComposite(this, parent);
-
- // Default Cache Size
- new DefaultCacheSizeComposite<T>(this, parent);
-
- // Default Shared Cache
- new DefaultSharedCacheComposite(this, parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheSizeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheSizeComposite.java
deleted file mode 100644
index 74b0b5fa89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheSizeComposite.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheSizeComposite
- */
-public class CacheSizeComposite extends Pane<CachingEntity>
-{
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public CacheSizeComposite(Pane<CachingEntity> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addCacheSizeCombo(container);
- }
-
- private void addCacheSizeCombo(Composite container) {
- new IntegerCombo<CachingEntity>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.CacheSizeComposite_cacheSize;
- }
-
- @Override
- protected String getHelpId() {
- return EclipseLinkHelpContextIds.PERSISTENCE_CACHING;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Caching, Integer>(buildCachingHolder(), Caching.CACHE_SIZE_DEFAULT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- Integer value = this.subject.getCacheSizeDefault();
- if (value == null) {
- value = this.subject.getDefaultCacheSizeDefault();
- }
- return value;
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<CachingEntity, Integer>(this.getSubjectHolder(), CachingEntity.CACHE_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return getSubjectParent().getCacheSizeOf(getSubjectName());
- }
-
- @Override
- protected void setValue_(Integer value) {
- getSubjectParent().setCacheSizeOf(getSubjectName(), value);
- }
- };
- }
- };
- }
-
- private String getSubjectName() {
- return this.getSubjectHolder().getValue().getName();
- }
-
- private Caching getSubjectParent() {
- return this.getSubjectHolder().getValue().getParent();
- }
-
- private PropertyValueModel<Caching> buildCachingHolder() {
- return new TransformationPropertyValueModel<CachingEntity, Caching>(this.getSubjectHolder()) {
- @Override
- protected Caching transform_(CachingEntity value) {
- return value.getParent();
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheTypeComposite.java
deleted file mode 100644
index 25a014a48e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/CacheTypeComposite.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheTypeComposite
- */
-public class CacheTypeComposite extends Pane<CachingEntity>
-{
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public CacheTypeComposite(Pane<CachingEntity> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_cacheTypeLabel,
- new CacheTypeCombo(container),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING
- );
- }
-
- private class CacheTypeCombo extends EnumFormComboViewer<CachingEntity, CacheType> {
-
- private CacheTypeCombo(Composite parent) {
- super(CacheTypeComposite.this, parent);
- }
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(CachingEntity.CACHE_TYPE_PROPERTY);
- }
-
- private PropertyValueModel<Caching> buildCachingHolder() {
- return new TransformationPropertyValueModel<CachingEntity, Caching>(getSubjectHolder()) {
- @Override
- protected Caching transform_(CachingEntity value) {
- return value.getParent();
- }
- };
- }
-
- private PropertyValueModel<CacheType> buildDefaultCacheTypeHolder() {
- return new PropertyAspectAdapter<Caching, CacheType>(buildCachingHolder(), Caching.CACHE_TYPE_DEFAULT_PROPERTY) {
- @Override
- protected CacheType buildValue_() {
- CacheType cacheType = subject.getCacheTypeDefault();
- if (cacheType == null) {
- cacheType = subject.getDefaultCacheTypeDefault();
- }
- return cacheType;
- }
- };
- }
-
- private PropertyChangeListener buildDefaultCachingTypePropertyChangeListener() {
- return new SWTPropertyChangeListenerWrapper(
- buildDefaultCachingTypePropertyChangeListener_()
- );
- }
-
- private PropertyChangeListener buildDefaultCachingTypePropertyChangeListener_() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- if ((e.getNewValue() != null) && !getCombo().isDisposed()) {
- CacheTypeCombo.this.doPopulate();
- }
- }
- };
- }
-
- @Override
- protected CacheType[] getChoices() {
- return CacheType.values();
- }
-
- @Override
- protected CacheType getDefaultValue() {
- return getSubjectParent().getDefaultCacheType();
- }
-
- @Override
- protected String displayString(CacheType value) {
- switch (value) {
- case full :
- return EclipseLinkUiMessages.CacheTypeComposite_full;
- case weak :
- return EclipseLinkUiMessages.CacheTypeComposite_weak;
- case soft :
- return EclipseLinkUiMessages.CacheTypeComposite_soft;
- case soft_weak :
- return EclipseLinkUiMessages.CacheTypeComposite_soft_weak;
- case hard_weak :
- return EclipseLinkUiMessages.CacheTypeComposite_hard_weak;
- case none :
- return EclipseLinkUiMessages.CacheTypeComposite_none;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected void doPopulate() {
- // This is required to allow the class loader to let the listener
- // written above to access this method
- super.doPopulate();
- }
-
- @Override
- protected CacheType getValue() {
- return getSubjectParent().getCacheTypeOf(getSubjectName());
- }
-
- @Override
- protected void initialize() {
- super.initialize();
-
- PropertyValueModel<CacheType> defaultCacheTypeHolder =
- buildDefaultCacheTypeHolder();
-
- defaultCacheTypeHolder.addPropertyChangeListener(
- PropertyValueModel.VALUE,
- buildDefaultCachingTypePropertyChangeListener()
- );
- }
-
- @Override
- protected void setValue(CacheType value) {
- getSubjectParent().setCacheTypeOf(getSubjectName(), value);
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
- }
-
- private String getSubjectName() {
- return this.getSubjectHolder().getValue().getName();
- }
-
- private Caching getSubjectParent() {
- return this.getSubjectHolder().getValue().getParent();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultCacheSizeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultCacheSizeComposite.java
deleted file mode 100644
index 15288d7837..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultCacheSizeComposite.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheSizeComposite
- */
-public class DefaultCacheSizeComposite<T extends Caching> extends Pane<T>
-{
- /**
- * Creates a new <code>CacheTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public DefaultCacheSizeComposite(Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
-
-
- @Override
- protected void initializeLayout(Composite container) {
- addDefaultCacheSizeCombo(container);
- }
-
- private void addDefaultCacheSizeCombo(Composite container) {
- new IntegerCombo<Caching>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.DefaultCacheSizeComposite_defaultCacheSize;
- }
-
- @Override
- protected String getHelpId() {
- return EclipseLinkHelpContextIds.PERSISTENCE_CACHING_DEFAULT_SIZE;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Caching, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultCacheSizeDefault();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Caching, Integer>(getSubjectHolder(), Caching.CACHE_SIZE_DEFAULT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getCacheSizeDefault();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setCacheSizeDefault(value);
- }
- };
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultCacheTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultCacheTypeComposite.java
deleted file mode 100644
index ce98727a8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultCacheTypeComposite.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DefaultCacheTypeComposite
- */
-public class DefaultCacheTypeComposite extends Pane<Caching>
-{
- /**
- * Creates a new <code>DefaultCacheTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public DefaultCacheTypeComposite(
- Pane<? extends Caching> parentComposite,
- Composite parent) {
-
- super( parentComposite, parent);
- }
-
- private EnumFormComboViewer<Caching, CacheType> buildDefaultCacheTypeCombo(Composite container) {
- return new EnumFormComboViewer<Caching, CacheType>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Caching.CACHE_TYPE_DEFAULT_PROPERTY);
- }
-
- @Override
- protected CacheType[] getChoices() {
- return CacheType.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected CacheType getDefaultValue() {
- return getSubject().getDefaultCacheTypeDefault();
- }
-
- @Override
- protected String displayString(CacheType value) {
- switch (value) {
- case full :
- return EclipseLinkUiMessages.CacheTypeComposite_full;
- case weak :
- return EclipseLinkUiMessages.CacheTypeComposite_weak;
- case soft :
- return EclipseLinkUiMessages.CacheTypeComposite_soft;
- case soft_weak :
- return EclipseLinkUiMessages.CacheTypeComposite_soft_weak;
- case hard_weak :
- return EclipseLinkUiMessages.CacheTypeComposite_hard_weak;
- case none :
- return EclipseLinkUiMessages.CacheTypeComposite_none;
- default :
- throw new IllegalStateException();
- }
-
- }
-
- @Override
- protected CacheType getValue() {
- return getSubject().getCacheTypeDefault();
- }
-
- @Override
- protected void setValue(CacheType value) {
- getSubject().setCacheTypeDefault(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_defaultCacheTypeLabel,
- this.buildDefaultCacheTypeCombo( container),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING_DEFAULT_TYPE
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultSharedCacheComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultSharedCacheComposite.java
deleted file mode 100644
index b7aa220caf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/DefaultSharedCacheComposite.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DefaultShareCacheComposite
- */
-public class DefaultSharedCacheComposite extends Pane<Caching>
-{
- /**
- * Creates a new <code>DefaultShareCacheComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public DefaultSharedCacheComposite(
- Pane<? extends Caching> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_sharedCacheDefaultLabel,
- this.buildDefaultSharedCacheHolder(),
- this.buildDefaultSharedCacheStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING_DEFAULT_SHARED
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildDefaultSharedCacheHolder() {
- return new PropertyAspectAdapter<Caching, Boolean>(getSubjectHolder(), Caching.SHARED_CACHE_DEFAULT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSharedCacheDefault();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSharedCacheDefault(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildDefaultSharedCacheStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultDefaultSharedCacheHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCachingTab_defaultSharedCacheDefaultLabel, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCachingTab_sharedCacheDefaultLabel;
- }
- };
- }
- private PropertyValueModel<Boolean> buildDefaultDefaultSharedCacheHolder() {
- return new PropertyAspectAdapter<Caching, Boolean>(
- getSubjectHolder(),
- Caching.SHARED_CACHE_DEFAULT_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSharedCacheDefault() != null) {
- return null;
- }
- return this.subject.getDefaultSharedCacheDefault();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java
deleted file mode 100644
index dbc3dbd616..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EclipseLinkCachingComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkCachingComposite
- */
-public class EclipseLinkCachingComposite<T extends Caching> extends Pane<T>
-{
- public EclipseLinkCachingComposite(Pane<T> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- Composite container = this.addSection(
- parent,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionTitle,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionDescription
- );
-
- // Defaults
- new CacheDefaultsComposite<T>(this, container);
- // EntitiesList
- new EntityListComposite<T>(this, container);
- // Flush Clear Cache
- new FlushClearCacheComposite(this, container);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EntityCachingPropertyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EntityCachingPropertyComposite.java
deleted file mode 100644
index 75db700c32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EntityCachingPropertyComposite.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @version 2.0
- * @since 2.0
- */
-public class EntityCachingPropertyComposite extends Pane<CachingEntity> {
-
- /**
- * Creates a new <code>EntityCachingPropertyComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public EntityCachingPropertyComposite(Pane<? extends Caching> parentComposite,
- PropertyValueModel<CachingEntity> subjectHolder,
- Composite parent) {
-
- super(parentComposite, subjectHolder, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Cache Type
- new CacheTypeComposite(this, container);
-
- // Cache Size
- new CacheSizeComposite(this, container);
-
- // Share Cache
- new SharedCacheComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EntityListComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EntityListComposite.java
deleted file mode 100644
index a2bc198203..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/EntityListComposite.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiPlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * EntityListComposite
- */
-public class EntityListComposite<T extends Caching> extends Pane<T>
-{
- ModifiablePropertyValueModel<CachingEntity> entityHolder;
-
- public EntityListComposite(Pane<T> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.entityHolder = this.buildEntityHolder();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addTitledGroup(
- container,
- EclipseLinkUiMessages.CachingEntityListComposite_groupTitle
- );
-
- // Entities add/remove list pane
- new AddRemoveListPane<Caching>(
- this,
- container,
- this.buildEntitiesAdapter(),
- this.buildEntitiesListHolder(),
- this.entityHolder,
- this.buildEntityLabelProvider(),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING
- );
-
- // Entity Caching property pane
- EntityCachingPropertyComposite pane = new EntityCachingPropertyComposite(
- this,
- this.entityHolder,
- container
- );
- this.installPaneEnabler(this.entityHolder, pane);
- }
-
- private AddRemoveListPane.Adapter buildEntitiesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- EntityListComposite.this.addEntities(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- Caching caching = getSubject();
- for (Object item : listSelectionModel.selectedValues()) {
- CachingEntity entityCaching = (CachingEntity) item;
- caching.removeEntity(entityCaching.getName());
- }
- }
- };
- }
-
- private void addEntities(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseEntity();
-
- if (type != null) {
- String entityName = this.getEntityName(type.getFullyQualifiedName());
- if (entityName == null) {
- entityName = type.getElementName();
- }
-
- if( ! this.getSubject().entityExists(entityName)) {
- this.getSubject().addEntity(entityName);
- int index = CollectionTools.indexOf(this.getSubject().getEntityNames(), entityName);
- CachingEntity entity = (CachingEntity) listSelectionModel.getListModel().getElementAt(index);
- listSelectionModel.setSelectedValue(entity);
- this.entityHolder.setValue(entity);
- }
- }
- }
-
- private String getEntityName(String fullyQualifiedTypeName) {
-
- org.eclipse.jpt.jpa.core.context.Entity entity = getSubject().getPersistenceUnit().getEntity(fullyQualifiedTypeName);
- return (entity != null) ? entity.getName() : null;
- }
-
- private IType chooseEntity() {
- IJavaProject javaProject = getJavaProject();
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- ""
- );
- }
- catch (JavaModelException e) {
- JptJpaEclipseLinkUiPlugin.log(e);
- return null;
- }
- typeSelectionDialog.setTitle(EclipseLinkUiMessages.CachingEntityListComposite_dialogTitle);
- typeSelectionDialog.setMessage(EclipseLinkUiMessages.CachingEntityListComposite_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
- return null;
- }
-
- private IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- private ILabelProvider buildEntityLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- CachingEntity entityCaching = (CachingEntity) element;
- return entityCaching.getName();
- }
- };
- }
-
- private ModifiablePropertyValueModel<CachingEntity> buildEntityHolder() {
- return new SimplePropertyValueModel<CachingEntity>();
- }
-
- private ListValueModel<CachingEntity> buildEntitiesListHolder() {
- return new ListAspectAdapter<Caching, CachingEntity>(
- this.getSubjectHolder(), Caching.ENTITIES_LIST) {
- @Override
- protected ListIterable<CachingEntity> getListIterable() {
- return this.subject.getEntities();
- }
- @Override
- protected int size_() {
- return this.subject.getEntitiesSize();
- }
- };
- }
-
- private void installPaneEnabler(ModifiablePropertyValueModel<CachingEntity> entityHolder,
- EntityCachingPropertyComposite pane) {
-
- new PaneEnabler(
- this.buildPaneEnablerHolder(entityHolder),
- pane
- );
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder(ModifiablePropertyValueModel<CachingEntity> entityHolder) {
- return new TransformationPropertyValueModel<CachingEntity, Boolean>(entityHolder) {
- @Override
- protected Boolean transform_(CachingEntity value) {
- return value.entityNameIsValid();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java
deleted file mode 100644
index 87f3042da1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/FlushClearCacheComposite.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.FlushClearCache;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * FlushClearCacheComposite
- */
-public class FlushClearCacheComposite extends Pane<Caching>
-{
- /**
- * Creates a new <code>FlushClearCacheComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public FlushClearCacheComposite(
- Pane<? extends Caching> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.addLabeledComposite(
- parent,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_FlushClearCacheLabel,
- this.addFlushClearCacheCombo(parent),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING
- );
- }
-
- private EnumFormComboViewer<Caching, FlushClearCache> addFlushClearCacheCombo(Composite container) {
- return new EnumFormComboViewer<Caching, FlushClearCache>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Caching.FLUSH_CLEAR_CACHE_PROPERTY);
- }
-
- @Override
- protected FlushClearCache[] getChoices() {
- return FlushClearCache.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected FlushClearCache getDefaultValue() {
- return this.getSubject().getDefaultFlushClearCache();
- }
-
- @Override
- protected String displayString(FlushClearCache value) {
- switch (value) {
- case drop :
- return EclipseLinkUiMessages.FlushClearCacheComposite_drop;
- case drop_invalidate :
- return EclipseLinkUiMessages.FlushClearCacheComposite_drop_invalidate;
- case merge :
- return EclipseLinkUiMessages.FlushClearCacheComposite_merge;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected FlushClearCache getValue() {
- return this.getSubject().getFlushClearCache();
- }
-
- @Override
- protected void setValue(FlushClearCache value) {
- this.getSubject().setFlushClearCache(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/PersistenceXmlCachingTab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/PersistenceXmlCachingTab.java
deleted file mode 100644
index 8dfbd3c17d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/PersistenceXmlCachingTab.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlCachingTab
- */
-public class PersistenceXmlCachingTab<T extends Caching>
- extends Pane<T>
- implements JpaPageComposite
-{
- public PersistenceXmlCachingTab(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- new EclipseLinkCachingComposite<T>(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_CACHING;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlCachingTab_title;
- }
-
- // ********** Layout **********
-
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
-
- Composite container = addPane(parent, layout);
- updateGridData(container);
-
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/SharedCacheComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/SharedCacheComposite.java
deleted file mode 100644
index 206145de1b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/caching/SharedCacheComposite.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.ui.internal.widgets.TriStateCheckBox;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SharedCacheComposite
- */
-public class SharedCacheComposite extends Pane<CachingEntity>
-{
- private TriStateCheckBox sharedCacheCheckBox;
-
- /**
- * Creates a new <code>ShareCacheComposite</code>.
- *
- * @param parentController The parent container of this one
- * @param parent The parent container
- */
- public SharedCacheComposite(Pane<CachingEntity> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private PropertyValueModel<Caching> buildCachingHolder() {
- return new TransformationPropertyValueModel<CachingEntity, Caching>(this.getSubjectHolder()) {
- @Override
- protected Caching transform_(CachingEntity value) {
- return value.getParent();
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultAndNonDefaultSharedCacheHolder() {
- return new ListPropertyValueModelAdapter<Boolean>(
- buildDefaultAndNonDefaultSharedCacheListHolder()
- ) {
- @Override
- protected Boolean buildValue() {
- // If the number of ListValueModel equals 1, that means the shared
- // Cache properties is not set (partially selected), which means we
- // want to see the default value appended to the text
- if (this.listModel.size() == 1) {
- return (Boolean) this.listModel.listIterator().next();
- }
- return null;
- }
- };
- }
-
- private ListValueModel<Boolean> buildDefaultAndNonDefaultSharedCacheListHolder() {
- ArrayList<ListValueModel<Boolean>> holders = new ArrayList<ListValueModel<Boolean>>(2);
- holders.add(buildSharedCacheListHolder());
- holders.add(buildDefaultSharedCacheListHolder());
-
- return new CompositeListValueModel<ListValueModel<Boolean>, Boolean>(
- holders
- );
- }
-
- private PropertyValueModel<Boolean> buildDefaultSharedCacheHolder() {
- return new PropertyAspectAdapter<Caching, Boolean>(buildCachingHolder(), Caching.SHARED_CACHE_DEFAULT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Boolean value = this.subject.getSharedCacheDefault();
- if (value == null) {
- value = this.subject.getDefaultSharedCacheDefault();
- }
- return value;
- }
- };
- }
-
- private ListValueModel<Boolean> buildDefaultSharedCacheListHolder() {
- return new PropertyListValueModelAdapter<Boolean>(
- buildDefaultSharedCacheHolder()
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildSharedCacheHolder() {
- return new PropertyAspectAdapter<CachingEntity, Boolean>(
- getSubjectHolder(), CachingEntity.SHARED_CACHE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return getSubjectParent().getSharedCacheOf(getSubjectName());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- getSubjectParent().setSharedCacheOf(getSubjectName(), value);
- }
- };
- }
-
- private String getSubjectName() {
- return this.getSubjectHolder().getValue().getName();
- }
-
- private Caching getSubjectParent() {
- return this.getSubjectHolder().getValue().getParent();
- }
-
- private ListValueModel<Boolean> buildSharedCacheListHolder() {
- return new PropertyListValueModelAdapter<Boolean>(
- buildSharedCacheHolder()
- );
- }
-
- private PropertyValueModel<String> buildSharedCacheStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultAndNonDefaultSharedCacheHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCachingTab_defaultSharedCacheLabel, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCachingTab_sharedCacheLabel;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.sharedCacheCheckBox = this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCachingTab_sharedCacheLabel,
- this.buildSharedCacheHolder(),
- this.buildSharedCacheStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CACHING
- );
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/BatchWritingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/BatchWritingComposite.java
deleted file mode 100644
index 19272784b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/BatchWritingComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.BatchWriting;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * BatchWritingComposite
- */
-public class BatchWritingComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>BatchWritingComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public BatchWritingComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super( parentComposite, parent);
- }
-
- private EnumFormComboViewer<Connection, BatchWriting> addBatchWritingCombo(Composite container) {
- return new EnumFormComboViewer<Connection, BatchWriting>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Connection.BATCH_WRITING_PROPERTY);
- }
-
- @Override
- protected BatchWriting[] getChoices() {
- return BatchWriting.values();
- }
-
- @Override
- protected BatchWriting getDefaultValue() {
- return getSubject().getDefaultBatchWriting();
- }
-
- @Override
- protected String displayString(BatchWriting value) {
- switch (value) {
- case buffered :
- return EclipseLinkUiMessages.BatchWritingComposite_buffered;
- case jdbc :
- return EclipseLinkUiMessages.BatchWritingComposite_jdbc;
- case none :
- return EclipseLinkUiMessages.BatchWritingComposite_none;
- case oracle_jdbc :
- return EclipseLinkUiMessages.BatchWritingComposite_oracle_jdbc;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected BatchWriting getValue() {
- return getSubject().getBatchWriting();
- }
-
- @Override
- protected void setValue(BatchWriting value) {
- getSubject().setBatchWriting(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_batchWritingLabel,
- this.addBatchWritingCombo( container),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java
deleted file mode 100644
index 4bbcb8d129..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/CacheStatementsPropertiesComposite.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheStatementsPropertiesComposite
- */
-public class CacheStatementsPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public CacheStatementsPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- ModifiablePropertyValueModel<Boolean> cacheStatementsHolder = buildCacheStatementsHolder();
-
- container = this.addSubPane(container, 3, 5, 0, 0, 0);
-
- this.addTriStateCheckBox(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_cacheStatementsLabel,
- cacheStatementsHolder,
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- IntegerCombo<?> combo = addCacheStatementsSizeCombo(container);
-
- this.installControlEnabler(cacheStatementsHolder, combo);
- }
-
- private ModifiablePropertyValueModel<Boolean> buildCacheStatementsHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(getSubjectHolder(), Connection.CACHE_STATEMENTS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getCacheStatements();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setCacheStatements(value);
- }
-
- @Override
- protected synchronized void subjectChanged() {
- Boolean oldValue = this.getValue();
- super.subjectChanged();
- Boolean newValue = this.getValue();
-
- // Make sure the default value is appended to the text
- if (oldValue == newValue && newValue == null) {
- this.fireAspectChanged(Boolean.TRUE, newValue);
- }
- }
- };
- }
-
- private IntegerCombo<Connection> addCacheStatementsSizeCombo(Composite container) {
- return new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected Combo addIntegerCombo(Composite container) {
- return this.addEditableCombo(
- container,
- buildDefaultListHolder(),
- buildSelectedItemStringHolder(),
- StringConverter.Default.<String>instance());
- }
-
- @Override
- protected String getLabelText() {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultCacheStatementsSize();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.CACHE_STATEMENTS_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getCacheStatementsSize();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setCacheStatementsSize(value);
- }
- };
- }
- };
- }
-
- private void installControlEnabler(ModifiablePropertyValueModel<Boolean> cacheStatementsHolder, IntegerCombo<?> combo) {
-
- new PaneEnabler(cacheStatementsHolder, combo);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/ConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/ConnectionPropertiesComposite.java
deleted file mode 100644
index f08a3728e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/ConnectionPropertiesComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ConnectionPropertiesComposite
- */
-public class ConnectionPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public ConnectionPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = addTitledGroup(
- container,
- EclipseLinkUiMessages.ConnectionPropertiesComposite_Database_GroupBox
- );
-
- // Data source
- new DataSourcePropertiesComposite<T>(this, container);
- // EclipseLink Connection Pool
- new JdbcPropertiesComposite<T>(this, container);
- // Exclusive Connections
- new JdbcExclusiveConnectionsPropertiesComposite<T>(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/DataSourcePropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/DataSourcePropertiesComposite.java
deleted file mode 100644
index 64080cd763..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/DataSourcePropertiesComposite.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * @version 2.0
- * @since 2.0
- */
-public class DataSourcePropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>DataSourcePropertiesComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public DataSourcePropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private ModifiablePropertyValueModel<String> buildJtaDataSourceHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(buildPersistenceUnitHolder(), PersistenceUnit.JTA_DATA_SOURCE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getJtaDataSource();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setJtaDataSource(value);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildJTADataSourceHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return Boolean.valueOf(this.transform2(value));
- }
- private boolean transform2(PersistenceUnitTransactionType value) {
- return value == null || value == PersistenceUnitTransactionType.JTA;
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildNonJtaDataSourceHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(buildPersistenceUnitHolder(), PersistenceUnit.NON_JTA_DATA_SOURCE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getNonJtaDataSource();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setNonJtaDataSource(value);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildNonJTADataSourceHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return Boolean.valueOf(value == PersistenceUnitTransactionType.RESOURCE_LOCAL);
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitTransactionType> buildTransactionTypeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, PersistenceUnitTransactionType>(
- buildPersistenceUnitHolder(),
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY,
- PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY) {
- @Override
- protected PersistenceUnitTransactionType buildValue_() {
- return this.subject.getTransactionType();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<Connection, PersistenceUnit>(getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
-
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = getGroupBoxMargin();
-
- container = addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
-
- // JTA Data Source
- PropertyValueModel<Boolean> jtaEnabled = this.buildJTADataSourceHolder();
- Label jtaLabel = addLabel(container, EclipseLinkUiMessages.PersistenceXmlConnectionTab_jtaDataSourceLabel, jtaEnabled);
- Text jtaText = addText(container, this.buildJtaDataSourceHolder(), this.getHelpID(), jtaEnabled);
- this.addLabeledComposite(container, jtaLabel, jtaText, this.getHelpID());
-
- // Non-JTA Data Source
- PropertyValueModel<Boolean> nonJtaEnabled = this.buildNonJTADataSourceHolder();
- Label nonJtaLabel = addLabel(container, EclipseLinkUiMessages.PersistenceXmlConnectionTab_nonJtaDataSourceLabel, nonJtaEnabled);
- Text nonJtaText = addText(container, buildNonJtaDataSourceHolder(), this.getHelpID(), nonJtaEnabled);
- this.addLabeledComposite(container, nonJtaLabel, nonJtaText, this.getHelpID());
- }
-
- public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkConnectionComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkConnectionComposite.java
deleted file mode 100644
index 014c004b62..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/EclipseLinkConnectionComposite.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkConnectionComposite
- */
-public class EclipseLinkConnectionComposite<T extends Connection>
- extends Pane<T>
-{
- public EclipseLinkConnectionComposite(
- Pane<T> subjectHolder,
- Composite container) {
- super(subjectHolder, container, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = getGroupBoxMargin() * 2;
-
- container = addSection(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_sectionTitle,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_sectionDescription
- );
-
- Composite subPane = addSubPane(
- container,
- 0, groupBoxMargin, 10, groupBoxMargin
- );
-
- new TransactionTypeComposite<T>(this, subPane);
-
- new BatchWritingComposite<T>(this, subPane);
-
- new CacheStatementsPropertiesComposite<T>(this, subPane);
-
- new NativeSqlComposite<T>(this, subPane);
-
- new ConnectionPropertiesComposite<T>(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcBindParametersComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcBindParametersComposite.java
deleted file mode 100644
index 71d2fa018c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcBindParametersComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcBindParametersComposite
- */
-public class JdbcBindParametersComposite extends Pane<Connection>
-{
- /**
- * Creates a new <code>JdbcBindParametersComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcBindParametersComposite(
- Pane<? extends Connection> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_bindParametersLabel,
- this.buildBindParametersHolder(),
- this.buildBindParametersStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildBindParametersHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(getSubjectHolder(), Connection.BIND_PARAMETERS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getBindParameters();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setBindParameters(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildBindParametersStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultBindParametersHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlConnectionTab_bindParametersLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_bindParametersLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultBindParametersHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(
- getSubjectHolder(),
- Connection.BIND_PARAMETERS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getBindParameters() != null) {
- return null;
- }
- return this.subject.getDefaultBindParameters();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcConnectionPropertiesComposite.java
deleted file mode 100644
index b936d8a50d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcConnectionPropertiesComposite.java
+++ /dev/null
@@ -1,342 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import java.util.Comparator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.ConnectionProfileFactory;
-import org.eclipse.jpt.jpa.db.JptJpaDbPlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiPlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
-
-/**
- * JdbcConnectionPropertiesComposite
- */
-@SuppressWarnings("nls")
-public class JdbcConnectionPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * The constant ID used to retrieve the dialog settings.
- */
- private static final String DIALOG_SETTINGS = "org.eclipse.jpt.jpa.eclipselink.ui.dialogs.ConnectionDialog";
-
- public JdbcConnectionPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private ModifiablePropertyValueModel<String> buildPasswordHolder() {
- return new PropertyAspectAdapter<Connection, String>(getSubjectHolder(), Connection.PASSWORD_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getPassword();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setPassword(value);
- }
- };
- }
-
- private Runnable buildPopulateFromConnectionAction() {
- return new Runnable() {
- public void run() {
- promptConnection();
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildUrlHolder() {
- return new PropertyAspectAdapter<Connection, String>(getSubjectHolder(), Connection.URL_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getUrl();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setUrl(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildUserHolder() {
- return new PropertyAspectAdapter<Connection, String>(getSubjectHolder(), Connection.USER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getUser();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setUser(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Populate from Connection hyperlink
- this.addHyperlink(
- container,
- JptUiPersistence2_0Messages.JdbcConnectionPropertiesComposite_populateFromConnectionHyperLink,
- buildPopulateFromConnectionAction()
- );
-
- // Driver
- new JdbcDriverComposite(this, container);
-
- // Url
- this.addLabeledText(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_urlLabel,
- buildUrlHolder()
- );
-
- // User
- this.addLabeledText(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_userLabel,
- buildUserHolder()
- );
-
- // Password
- this.addLabeledPasswordText(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_passwordLabel,
- buildPasswordHolder()
- );
-
- // Bind Parameters
- new JdbcBindParametersComposite(this, container);
- }
-
- void promptConnection() {
-
- ConnectionSelectionDialog dialog = new ConnectionSelectionDialog();
-
- if (dialog.open() != IDialogConstants.OK_ID) {
- return;
- }
-
- String name = (String) dialog.getResult()[0];
- ConnectionProfile cp = this.getConnectionProfileFactory().buildConnectionProfile(name);
-
- Connection connection = getSubject();
- connection.setUrl((cp == null) ? "" : cp.getURL());
- connection.setUser((cp == null) ? "" : cp.getUserName());
- connection.setPassword((cp == null) ? "" : cp.getUserPassword());
- connection.setDriver((cp == null) ? "" : cp.getDriverClassName());
- }
-
- ConnectionProfileFactory getConnectionProfileFactory() {
- // we allow the user to select any connection profile and simply
- // take the settings from it (user, password, etc.) and give them
- // to the EclipseLink connection, so we go
- // to the db plug-in directly to get the factory
- return JptJpaDbPlugin.getConnectionProfileFactory();
- }
-
- // broaden access a bit
- Shell getShell_() {
- return this.getShell();
- }
-
- /**
- * This dialog shows the list of possible connection names and lets the user
- * the option to filter them using a search field.
- */
- protected class ConnectionSelectionDialog extends FilteredItemsSelectionDialog {
-
- /**
- * Creates a new <code>MappingSelectionDialog</code>.
- */
- protected ConnectionSelectionDialog() {
- super(JdbcConnectionPropertiesComposite.this.getShell_(), false);
- setMessage(EclipseLinkUiMessages.JdbcConnectionPropertiesComposite_ConnectionDialog_Message);
- setTitle(EclipseLinkUiMessages.JdbcConnectionPropertiesComposite_ConnectionDialog_Title);
- setListLabelProvider(buildLabelProvider());
- setDetailsLabelProvider(buildLabelProvider());
- }
-
- protected ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public Image getImage(Object element) {
- return null;
- }
-
- @Override
- public String getText(Object element) {
- return (element == null) ? "" : element.toString();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Control createExtendedContentArea(Composite parent) {
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected ItemsFilter createFilter() {
- return new ConnectionItemsFilter();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void fillContentProvider(AbstractContentProvider provider,
- ItemsFilter itemsFilter,
- IProgressMonitor monitor) throws CoreException {
-
- Iterable<String> profileNames = this.getConnectionProfileNames();
- SubMonitor sm = SubMonitor.convert(monitor, CollectionTools.size(profileNames));
-
- // Add the connection names to the dialog
- for (String name : profileNames) {
- provider.add(name, itemsFilter);
- sm.worked(1);
- }
- }
-
- private Iterable<String> getConnectionProfileNames() {
- return JdbcConnectionPropertiesComposite.this.getConnectionProfileFactory().getConnectionProfileNames();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected IDialogSettings getDialogSettings() {
-
- IDialogSettings dialogSettings = JptJpaEclipseLinkUiPlugin.instance().getDialogSettings();
- IDialogSettings settings = dialogSettings.getSection(DIALOG_SETTINGS);
-
- if (settings == null) {
- settings = dialogSettings.addNewSection(DIALOG_SETTINGS);
- }
-
- return settings;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String getElementName(Object object) {
- return object.toString();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Comparator<String> getItemsComparator() {
- return new Comparator<String>() {
- public int compare(String item1, String item2) {
- return item1.compareTo(item2);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected IStatus validateItem(Object item) {
-
- if (item == null) {
- return new Status(IStatus.ERROR, JptJpaEclipseLinkUiPlugin.PLUGIN_ID, IStatus.ERROR, "", null);
- }
-
- return Status.OK_STATUS;
- }
-
- /**
- * Create the filter responsible to remove any connection name based on
- * the pattern entered in the text field.
- */
- private class ConnectionItemsFilter extends ItemsFilter {
-
- /**
- * Creates a new <code>ConnectionItemsFilter</code>.
- */
- ConnectionItemsFilter() {
-
- super();
-
- // Make sure that if the pattern is empty, we specify * in order
- // to show all the mapping types
- if (StringTools.stringIsEmpty(getPattern())) {
- patternMatcher.setPattern("*");
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public boolean isConsistentItem(Object item) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public boolean matchItem(Object item) {
- return matches(item.toString());
- }
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcDriverComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcDriverComposite.java
deleted file mode 100644
index e665ac0537..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcDriverComposite.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcDriverComposite
- */
-public class JdbcDriverComposite extends Pane<Connection>
-{
- /**
- * Creates a new <code>EventListenerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public JdbcDriverComposite(Pane<? extends Connection> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private ClassChooserPane<Connection> initializeClassChooser(Composite container) {
-
- return new ClassChooserPane<Connection>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Connection, String>(
- this.getSubjectHolder(), Connection.DRIVER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDriver();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setDriver(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return this.getSubject().getDriver();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_driverLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setDriver(className);
- }
-
- @Override
- protected boolean allowTypeCreation() {
- //Does not make sense to allow the user to create a new Driver class
- return false;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeClassChooser(container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionModeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionModeComposite.java
deleted file mode 100644
index 52c88d81af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionModeComposite.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.ExclusiveConnectionMode;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ExclusiveConnectionModeComposite
- */
-public class JdbcExclusiveConnectionModeComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>ExclusiveConnectionModeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcExclusiveConnectionModeComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_exclusiveConnectionModeLabel,
- this.addExclusiveConnectionModeCombo(container),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private EnumFormComboViewer<Connection, ExclusiveConnectionMode> addExclusiveConnectionModeCombo(Composite container) {
- return new EnumFormComboViewer<Connection, ExclusiveConnectionMode>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Connection.EXCLUSIVE_CONNECTION_MODE_PROPERTY);
- }
-
- @Override
- protected ExclusiveConnectionMode[] getChoices() {
- return ExclusiveConnectionMode.values();
- }
-
- @Override
- protected ExclusiveConnectionMode getDefaultValue() {
- return this.getSubject().getDefaultExclusiveConnectionMode();
- }
-
- @Override
- protected String displayString(ExclusiveConnectionMode value) {
- switch (value) {
- case always :
- return EclipseLinkUiMessages.JdbcExclusiveConnectionModeComposite_always;
- case isolated :
- return EclipseLinkUiMessages.JdbcExclusiveConnectionModeComposite_isolated;
- case transactional :
- return EclipseLinkUiMessages.JdbcExclusiveConnectionModeComposite_transactional;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected ExclusiveConnectionMode getValue() {
- return this.getSubject().getExclusiveConnectionMode();
- }
-
- @Override
- protected void setValue(ExclusiveConnectionMode value) {
- this.getSubject().setExclusiveConnectionMode(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionsPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionsPropertiesComposite.java
deleted file mode 100644
index 046b785107..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcExclusiveConnectionsPropertiesComposite.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcExclusiveConnectionsPropertiesComposite
- */
-public class JdbcExclusiveConnectionsPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public JdbcExclusiveConnectionsPropertiesComposite(Pane<T> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addTitledGroup(
- this.addSubPane(container, 10),
- EclipseLinkUiMessages.JdbcExclusiveConnectionsPropertiesComposite_GroupBox
- );
-
- // Exclusive connection mode
- new JdbcExclusiveConnectionModeComposite<T>(this, container);
-
- // Lazy Connection
- new JdbcLazyConnectionComposite<T>(this, container);
-
- this.installPaneEnabler();
- }
-
- private void installPaneEnabler() {
- new PaneEnabler(this.buildPaneEnablerHolder(), this);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(this.buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return value == PersistenceUnitTransactionType.RESOURCE_LOCAL;
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitTransactionType> buildTransactionTypeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, PersistenceUnitTransactionType>(
- this.buildPersistenceUnitHolder(),
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY,
- PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY) {
- @Override
- protected PersistenceUnitTransactionType buildValue_() {
- return this.subject.getTransactionType();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<Connection, PersistenceUnit>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcLazyConnectionComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcLazyConnectionComposite.java
deleted file mode 100644
index 74d4edab20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcLazyConnectionComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcLazyConnectionComposite
- */
-public class JdbcLazyConnectionComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcLazyConnectionComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcLazyConnectionComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_lazyConnectionLabel,
- this.buildLazyConnectionHolder(),
- this.buildLazyConnectionStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildLazyConnectionHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(this.getSubjectHolder(), Connection.LAZY_CONNECTION_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getLazyConnection();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setLazyConnection(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildLazyConnectionStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(this.buildDefaultLazyConnectionHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlConnectionTab_lazyConnectionLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_lazyConnectionLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultLazyConnectionHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(
- this.getSubjectHolder(),
- Connection.LAZY_CONNECTION_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getLazyConnection() != null) {
- return null;
- }
- return this.subject.getDefaultLazyConnection();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcPropertiesComposite.java
deleted file mode 100644
index bcd471e2e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcPropertiesComposite.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcPropertiesComposite
- */
-public class JdbcPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public JdbcPropertiesComposite(Pane<T> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addTitledGroup(
- this.addSubPane(container, 10),
- EclipseLinkUiMessages.JdbcPropertiesComposite_EclipseLinkConnectionPool_GroupBox
- );
-
- // Connection Properties
- new JdbcConnectionPropertiesComposite<T>(this, container);
-
- container = this.addPane(container, new GridLayout(2, true));
-
- // Read Connection
- new JdbcReadConnectionPropertiesComposite<T>(this, container);
- // Write Connection
- new JdbcWriteConnectionPropertiesComposite<T>(this, container);
-
- this.installPaneEnabler();
- }
-
- private void installPaneEnabler() {
- new PaneEnabler(this.buildPaneEnablerHolder(), this);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(this.buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return value == PersistenceUnitTransactionType.RESOURCE_LOCAL;
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitTransactionType> buildTransactionTypeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, PersistenceUnitTransactionType>(
- this.buildPersistenceUnitHolder(),
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY,
- PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY) {
- @Override
- protected PersistenceUnitTransactionType buildValue_() {
- return this.subject.getTransactionType();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<Connection, PersistenceUnit>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionPropertiesComposite.java
deleted file mode 100644
index 0136e6a62e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionPropertiesComposite.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcReadConnectionPropertiesComposite
- */
-public class JdbcReadConnectionPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public JdbcReadConnectionPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addCollapsibleSubSection(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsSectionTitle,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE) //exapanded
- );
-
- GridData data = (GridData) container.getLayoutData();
- data.verticalAlignment = SWT.TOP;
-
- data = (GridData) getControl().getLayoutData();
- data.verticalAlignment = SWT.TOP;
-
- // Read Connections Shared
- new JdbcReadConnectionsSharedComposite<T>(this, container);
-
- // Read Connections Minimum
- new JdbcReadConnectionsMinComposite<T>(this, container);
-
- // Read Connections Maximum
- new JdbcReadConnectionsMaxComposite<T>(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMaxComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMaxComposite.java
deleted file mode 100644
index 3748d4b84e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMaxComposite.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcReadConnectionsMaxComposite
- */
-public class JdbcReadConnectionsMaxComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcReadConnectionsMaxComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcReadConnectionsMaxComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- addReadConnectionsMaxCombo(container);
- }
-
- private void addReadConnectionsMaxCombo(Composite container) {
- new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsMaxLabel;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultReadConnectionsMax();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.READ_CONNECTIONS_MAX_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getReadConnectionsMax();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setReadConnectionsMax(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMinComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMinComposite.java
deleted file mode 100644
index 272cde3166..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsMinComposite.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcReadConnectionsMinComposite
- */
-public class JdbcReadConnectionsMinComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcReadConnectionsMinComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcReadConnectionsMinComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addReadConnectionsMinCombo(container);
- }
-
- private void addReadConnectionsMinCombo(Composite container) {
- new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsMinLabel;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultReadConnectionsMin();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.READ_CONNECTIONS_MIN_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getReadConnectionsMin();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setReadConnectionsMin(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsSharedComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsSharedComposite.java
deleted file mode 100644
index 40341774ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcReadConnectionsSharedComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ReadConnectionsSharedComposite
- */
-public class JdbcReadConnectionsSharedComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>ReadConnectionsSharedComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcReadConnectionsSharedComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsSharedLabel,
- this.buildReadConnectionsSharedHolder(),
- this.buildReadConnectionsSharedStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildReadConnectionsSharedHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(getSubjectHolder(), Connection.READ_CONNECTIONS_SHARED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getReadConnectionsShared();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setReadConnectionsShared(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildReadConnectionsSharedStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultReadConnectionsSharedHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsSharedLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_readConnectionsSharedLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultReadConnectionsSharedHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(
- getSubjectHolder(),
- Connection.READ_CONNECTIONS_SHARED_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getReadConnectionsShared() != null) {
- return null;
- }
- return this.subject.getDefaultReadConnectionsShared();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionPropertiesComposite.java
deleted file mode 100644
index 7a7b431563..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionPropertiesComposite.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcWriteConnectionPropertiesComposite
- */
-@SuppressWarnings("nls")
-public class JdbcWriteConnectionPropertiesComposite<T extends Connection>
- extends Pane<T>
-{
- public JdbcWriteConnectionPropertiesComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addCollapsibleSubSection(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_writeConnectionsSectionTitle,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE) //exapanded
- );
-
- GridData data = (GridData) container.getLayoutData();
- data.verticalAlignment = SWT.TOP;
-
- data = (GridData) getControl().getLayoutData();
- data.verticalAlignment = SWT.TOP;
-
- // This will add space to have the same layout than read connection pool
- Button space = this.getWidgetFactory().createCheckBox(container, "m");
- Point size = space.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- container = this.addSubPane(container, size.y + 5);
- space.dispose();
-
- // Write Connections Minimum
- new JdbcWriteConnectionsMinComposite<T>(this, container);
-
- // Write Connections Maximum
- new JdbcWriteConnectionsMaxComposite<T>(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMaxComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMaxComposite.java
deleted file mode 100644
index f0ef8aa24a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMaxComposite.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcWriteConnectionsMaxComposite
- */
-public class JdbcWriteConnectionsMaxComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcWriteConnectionsMaxComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcWriteConnectionsMaxComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addWriteConnectionsMaxCombo(container);
- }
-
- private void addWriteConnectionsMaxCombo(Composite container) {
- new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_writeConnectionsMaxLabel;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultWriteConnectionsMax();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.WRITE_CONNECTIONS_MAX_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getWriteConnectionsMax();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setWriteConnectionsMax(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMinComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMinComposite.java
deleted file mode 100644
index bd3b320a99..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/JdbcWriteConnectionsMinComposite.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcWriteConnectionsMinComposite
- */
-public class JdbcWriteConnectionsMinComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>JdbcWriteConnectionsMinComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public JdbcWriteConnectionsMinComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addWriteConnectionsMinCombo(container);
- }
-
- private void addWriteConnectionsMinCombo(Composite container) {
- new IntegerCombo<Connection>(this, container) {
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_writeConnectionsMinLabel;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultWriteConnectionsMin();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Connection, Integer>(getSubjectHolder(), Connection.WRITE_CONNECTIONS_MIN_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getWriteConnectionsMin();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setWriteConnectionsMin(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/NativeSqlComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/NativeSqlComposite.java
deleted file mode 100644
index 4f3f9f5be9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/NativeSqlComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * NativeSqlComposite
- */
-public class NativeSqlComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>NativeSqlComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public NativeSqlComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_nativeSqlLabel,
- this.buildNativeSqlHolder(),
- this.buildNativeSqlStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildNativeSqlHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(getSubjectHolder(), Connection.NATIVE_SQL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getNativeSql();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNativeSql(value);
- }
-
- };
- }
-
- private PropertyValueModel<String> buildNativeSqlStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultNativeSqlHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlConnectionTab_nativeSqlLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_nativeSqlLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultNativeSqlHolder() {
- return new PropertyAspectAdapter<Connection, Boolean>(
- getSubjectHolder(),
- Connection.NATIVE_SQL_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getNativeSql() != null) {
- return null;
- }
- return this.subject.getDefaultNativeSql();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/PersistenceXmlConnectionTab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/PersistenceXmlConnectionTab.java
deleted file mode 100644
index ddd14367ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/PersistenceXmlConnectionTab.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlConnectionTab
- */
-public class PersistenceXmlConnectionTab<T extends Connection>
- extends Pane<T>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- public PersistenceXmlConnectionTab(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkConnectionComposite<T>(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlConnectionTab_title;
- }
-
- // ********** Layout **********
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
- Composite container = this.addPane(parent, layout);
- this.updateGridData(container);
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/TransactionTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/TransactionTypeComposite.java
deleted file mode 100644
index 0b7fc8b535..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/connection/TransactionTypeComposite.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.connection;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * TransactionTypeComposite
- */
-public class TransactionTypeComposite<T extends Connection>
- extends Pane<T>
-{
- /**
- * Creates a new <code>TransactionTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public TransactionTypeComposite(
- Pane<T> parentComposite,
- Composite parent) {
-
- super( parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlConnectionTab_transactionTypeLabel,
- this.addTransactionTypeCombo( container),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-
- private EnumFormComboViewer<PersistenceUnit, PersistenceUnitTransactionType> addTransactionTypeCombo(Composite container) {
- return new EnumFormComboViewer<PersistenceUnit, PersistenceUnitTransactionType>(this, this.buildPersistenceUnitHolder(), container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY);
- propertyNames.add(PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY);
- }
-
- @Override
- protected PersistenceUnitTransactionType[] getChoices() {
- return PersistenceUnitTransactionType.values();
- }
-
- @Override
- protected PersistenceUnitTransactionType getDefaultValue() {
- return this.getSubject().getDefaultTransactionType();
- }
-
- @Override
- protected String displayString(PersistenceUnitTransactionType value) {
- switch (value) {
- case JTA :
- return EclipseLinkUiMessages.TransactionTypeComposite_jta;
- case RESOURCE_LOCAL :
- return EclipseLinkUiMessages.TransactionTypeComposite_resource_local;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected PersistenceUnitTransactionType getValue() {
- return this.getSubject().getSpecifiedTransactionType();
- }
-
- @Override
- protected void setValue(PersistenceUnitTransactionType value) {
- this.getSubject().setSpecifiedTransactionType(value);
-
- if (value == PersistenceUnitTransactionType.RESOURCE_LOCAL) {
- clearJTAProperties();
- }
- else {
- clearResourceLocalProperties();
- }
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<Connection, PersistenceUnit>(getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
-
- }
-
- private void clearJTAProperties() {
- getSubject().getPersistenceUnit().setJtaDataSource(null);
- }
-
- private void clearResourceLocalProperties() {
- Connection connection = this.getSubject();
- connection.getPersistenceUnit().setNonJtaDataSource(null);
- connection.setDriver(null);
- connection.setUrl(null);
- connection.setUser(null);
- connection.setPassword(null);
- connection.setBindParameters(null);
- connection.setWriteConnectionsMax(null);
- connection.setWriteConnectionsMin(null);
- connection.setReadConnectionsMax(null);
- connection.setReadConnectionsMin(null);
- connection.setReadConnectionsShared(null);
- connection.setExclusiveConnectionMode(null);
- connection.setLazyConnection(null);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/CustomizerComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/CustomizerComposite.java
deleted file mode 100644
index 74295f1a35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/CustomizerComposite.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CustomizationEntity;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CustomizerComposite
- */
-public class CustomizerComposite extends Pane<CustomizationEntity>
-{
- /**
- * Creates a new <code>CustomizerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public CustomizerComposite(Pane<? extends CustomizationEntity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private ClassChooserPane<CustomizationEntity> initializeClassChooser(Composite container) {
-
- return new ClassChooserPane<CustomizationEntity>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<CustomizationEntity, String>(
- this.getSubjectHolder(), CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return getSubjectParent().getDescriptorCustomizerOf(getSubjectName());
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
- getSubjectParent().setDescriptorCustomizerOf(getSubjectName(), value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubjectParent().getDescriptorCustomizerOf(getSubjectName());
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_customizerLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubjectParent().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubjectParent().setDescriptorCustomizerOf(getSubjectName(), className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return EclipseLinkCustomizer.ECLIPSELINK_DESCRIPTOR_CUSTOMIZER_CLASS_NAME;
- }
- };
- }
-
- private String getSubjectName() {
- return this.getSubjectHolder().getValue().getName();
- }
-
- private Customization getSubjectParent() {
- return this.getSubjectHolder().getValue().getParent();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeClassChooser(container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java
deleted file mode 100644
index eda7fae366..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EclipseLinkCustomizationComposite.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * PersistenceUnitCustomizationComposite
- */
-public class EclipseLinkCustomizationComposite<T extends Customization> extends Pane<T>
-{
- public EclipseLinkCustomizationComposite(Pane<T> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- Section section = getWidgetFactory().createSection(parent, SWT.FLAT | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
- section.setText(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_sectionTitle);
- section.setDescription(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_sectionDescription);
- section.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- Composite composite = this.addSubPane(section);
- section.setClient(composite);
-
- // Default pane
- int groupBoxMargin = this.getGroupBoxMargin();
-
- Composite defaultPane = this.addSubPane(
- composite,
- 0, groupBoxMargin, 0, groupBoxMargin
- );
-
- // Weaving Group
- new WeavingPropertiesComposite(this, defaultPane);
-
- // Validation Only
- new ValidationOnlyComposite(this, defaultPane);
-
- // Mapping Files Validate Schema
- new ValidateSchemaComposite(this, defaultPane);
-
- // Throw Exceptions
- new ThrowExceptionsComposite(this, defaultPane);
-
- // Exception Handler
- new ExceptionHandlerComposite(this, defaultPane);
-
- // Session Customizer
- new SessionCustomizersComposite(this, composite);
-
- this.buildEntityListComposite(composite);
-
- // Profiler:
- new ProfilerComposite(this, composite);
- }
-
- protected void buildEntityListComposite(Composite parent) {
- new EntityListComposite(this, parent);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EntityCustomizationPropertyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EntityCustomizationPropertyComposite.java
deleted file mode 100644
index e6f59d3972..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EntityCustomizationPropertyComposite.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CustomizationEntity;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EntityCustomizationPropertyComposite
- */
-public class EntityCustomizationPropertyComposite extends Pane<CustomizationEntity> {
-
- /**
- * Creates a new <code>EntityCustomizationPropertyComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public EntityCustomizationPropertyComposite(Pane<Customization> parentComposite,
- PropertyValueModel<CustomizationEntity> subjectHolder,
- Composite parent) {
-
- super(parentComposite, subjectHolder, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Customizer
- new CustomizerComposite(this, container);
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EntityListComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EntityListComposite.java
deleted file mode 100644
index dd1a69730c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/EntityListComposite.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CustomizationEntity;
-import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiPlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * EntityListComposite
- */
-public class EntityListComposite extends Pane<Customization>
-{
- private ModifiablePropertyValueModel<CustomizationEntity> entityHolder;
-
- public EntityListComposite(Pane<? extends Customization> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.entityHolder = this.buildEntityHolder();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addTitledGroup(
- container,
- EclipseLinkUiMessages.CustomizationEntityListComposite_groupTitle
- );
-
- // Entities add/remove list pane
- new AddRemoveListPane<Customization>(
- this,
- container,
- this.buildEntitiesAdapter(),
- this.buildEntitiesListHolder(),
- this.entityHolder,
- this.buildEntityLabelProvider(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
-
- // Entity Customization property pane
- EntityCustomizationPropertyComposite pane = new EntityCustomizationPropertyComposite(
- this,
- this.entityHolder,
- container
- );
- this.installPaneEnabler(this.entityHolder, pane);
- }
-
- private AddRemoveListPane.Adapter buildEntitiesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- EntityListComposite.this.addEntities(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- Customization customization = getSubject();
- for (Object item : listSelectionModel.selectedValues()) {
- CustomizationEntity entityCustomization = (CustomizationEntity) item;
- customization.removeEntity(entityCustomization.getName());
- }
- }
- };
- }
-
- private void addEntities(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseEntity();
-
- if (type != null) {
- String entityName = this.getEntityName(type.getFullyQualifiedName());
- if (entityName == null) {
- entityName = type.getElementName();
- }
-
- if( ! this.getSubject().entityExists(entityName)) {
- this.getSubject().addEntity(entityName);
- int index = CollectionTools.indexOf(this.getSubject().getEntityNames(), entityName);
- CustomizationEntity entity = (CustomizationEntity) listSelectionModel.getListModel().getElementAt(index);
- listSelectionModel.setSelectedValue(entity);
- this.entityHolder.setValue(entity);
- }
- }
- }
-
- private String getEntityName(String fullyQualifiedTypeName) {
-
- org.eclipse.jpt.jpa.core.context.Entity entity = getSubject().getPersistenceUnit().getEntity(fullyQualifiedTypeName);
- return entity != null ? entity.getName() : null;
- }
-
- private IType chooseEntity() {
- IJavaProject javaProject = getJavaProject();
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- ""
- );
- }
- catch (JavaModelException e) {
- JptJpaEclipseLinkUiPlugin.log(e);
- return null;
- }
- typeSelectionDialog.setTitle(EclipseLinkUiMessages.CustomizationEntityListComposite_dialogTitle);
- typeSelectionDialog.setMessage(EclipseLinkUiMessages.CustomizationEntityListComposite_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
- return null;
- }
-
- private IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- private ILabelProvider buildEntityLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- CustomizationEntity entityCustomization = (CustomizationEntity) element;
- return entityCustomization.getName();
- }
- };
- }
-
- private ModifiablePropertyValueModel<CustomizationEntity> buildEntityHolder() {
- return new SimplePropertyValueModel<CustomizationEntity>();
- }
-
- private ListValueModel<CustomizationEntity> buildEntitiesListHolder() {
- return new ListAspectAdapter<Customization, CustomizationEntity>(
- this.getSubjectHolder(), Customization.ENTITIES_LIST) {
- @Override
- protected ListIterable<CustomizationEntity> getListIterable() {
- return this.subject.getEntities();
- }
- @Override
- protected int size_() {
- return this.subject.getEntitiesSize();
- }
- };
- }
-
- private void installPaneEnabler(ModifiablePropertyValueModel<CustomizationEntity> entityHolder,
- EntityCustomizationPropertyComposite pane) {
-
- new PaneEnabler(
- this.buildPaneEnablerHolder(entityHolder),
- pane
- );
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder(ModifiablePropertyValueModel<CustomizationEntity> entityHolder) {
- return new TransformationPropertyValueModel<CustomizationEntity, Boolean>(entityHolder) {
- @Override
- protected Boolean transform_(CustomizationEntity value) {
- return value.entityNameIsValid();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java
deleted file mode 100644
index b723aeb79d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ExceptionHandlerComposite.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ExceptionHandlerComposite
- */
-public class ExceptionHandlerComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>ExceptionHandlerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public ExceptionHandlerComposite(Pane<? extends Customization> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private ClassChooserPane<Customization> initializeClassChooser(Composite container) {
-
- return new ClassChooserPane<Customization>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Customization, String>(
- this.getSubjectHolder(), Customization.EXCEPTION_HANDLER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getExceptionHandler();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setExceptionHandler(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return this.getSubject().getExceptionHandler();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_exceptionHandlerLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setExceptionHandler(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return Customization.ECLIPSELINK_EXCEPTION_HANDLER_CLASS_NAME;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeClassChooser(container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/PersistenceXmlCustomizationTab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/PersistenceXmlCustomizationTab.java
deleted file mode 100644
index 05f7414140..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/PersistenceXmlCustomizationTab.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlCustomizationTabItem
- */
-public class PersistenceXmlCustomizationTab<T extends Customization>
- extends Pane<T>
- implements JpaPageComposite
-{
- public PersistenceXmlCustomizationTab(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.buildEclipseLinkCustomizationComposite(container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_title;
- }
-
- // ********** Layout **********
-
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
-
- Composite container = addPane(parent, layout);
- updateGridData(container);
-
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-
- protected void buildEclipseLinkCustomizationComposite(Composite container) {
- new EclipseLinkCustomizationComposite<T>(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ProfilerComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ProfilerComposite.java
deleted file mode 100644
index 3b07cedc57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ProfilerComposite.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Profiler;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import com.ibm.icu.text.Collator;
-
-/**
- * ProfilerComposite
- */
-public class ProfilerComposite extends ClassChooserComboPane<Customization>
-{
-
- /**
- * Creates a new <code>ProfilerComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public ProfilerComposite(
- Pane<? extends Customization> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected String getClassName() {
- return Profiler.getProfilerClassName(this.getSubject().getProfiler());
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_profilerLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Customization, String>(this.getSubjectHolder(), Customization.PROFILER_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = this.subject.getProfiler();
- if (name == null) {
- name = ProfilerComposite.this.getDefaultValue(this.subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(this.subject).equals(value)) {
- value = null;
- }
- this.subject.setProfiler(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildDefaultProfilerHolder() {
- return new PropertyAspectAdapter<Customization, String>(this.getSubjectHolder(), Customization.DEFAULT_PROFILER) {
- @Override
- protected String buildValue_() {
- return ProfilerComposite.this.getDefaultValue(this.subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultProfilerListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultProfilerHolder()
- );
- }
-
- private String buildDisplayString(String profilerName) {
-
- switch (Profiler.valueOf(profilerName)) {
- case no_profiler: {
- return EclipseLinkUiMessages.ProfilerComposite_no_profiler;
- }
- case performance_profiler: {
- return EclipseLinkUiMessages.ProfilerComposite_performance_profiler;
- }
- case query_monitor: {
- return EclipseLinkUiMessages.ProfilerComposite_query_monitor;
- }
- default: {
- return null;
- }
- }
- }
-
- private Comparator<String> buildProfilerComparator() {
- return new Comparator<String>() {
- public int compare(String profiler1, String profiler2) {
- profiler1 = buildDisplayString(profiler1);
- profiler2 = buildDisplayString(profiler2);
- return Collator.getInstance().compare(profiler1, profiler2);
- }
- };
- }
-
- @Override
- protected StringConverter<String> buildClassConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- try {
- Profiler.valueOf(value);
- value = buildDisplayString(value);
- }
- catch (Exception e) {
- // Ignore since the value is not a Profiler
- }
- return value;
- }
- };
- }
-
-
- @Override
- protected ListValueModel<String> buildClassListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(this.buildDefaultProfilerListHolder());
- holders.add(this.buildProfilersListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private Iterator<String> buildProfilers() {
- return new TransformationIterator<Profiler, String>(CollectionTools.iterator(Profiler.values())) {
- @Override
- protected String transform(Profiler next) {
- return next.name();
- }
- };
- }
-
- private CollectionValueModel<String> buildProfilersCollectionHolder() {
- return new SimpleCollectionValueModel<String>(
- CollectionTools.collection(this.buildProfilers())
- );
- }
-
- private ListValueModel<String> buildProfilersListHolder() {
- return new SortedListValueModelAdapter<String>(
- this.buildProfilersCollectionHolder(),
- this.buildProfilerComparator()
- );
- }
-
- private String getDefaultValue(Customization subject) {
- String defaultValue = subject.getDefaultProfiler();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setProfiler(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return Customization.ECLIPSELINK_SESSION_PROFILER_CLASS_NAME;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/SessionCustomizersComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/SessionCustomizersComposite.java
deleted file mode 100644
index c21f8e76fc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/SessionCustomizersComposite.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiPlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * SessionCustomizersComposite
- */
-public class SessionCustomizersComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>SessionCustomizerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public SessionCustomizersComposite(Pane<? extends Customization> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- private void addSessionCustomizerClass(ObjectListSelectionModel listSelectionModel) {
-
- IType type = chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName('$');
- if( ! this.getSubject().sessionCustomizerExists(className)) {
-
- String classRef = this.getSubject().addSessionCustomizer(className);
- listSelectionModel.setSelectedValue(classRef);
- }
- }
- }
-
- private Adapter buildAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addSessionCustomizerClass(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeSessionCustomizer((String) item);
- }
- }
- };
- }
-
- private ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
-
- @Override
- public String getText(Object element) {
- String name = (String) element;
-
- if (name == null) {
- name = EclipseLinkUiMessages.PersistenceXmlCustomizationTab_noName;
- }
- return name;
- }
- };
- }
-
- private ListValueModel<String> buildListHolder() {
- return new ListAspectAdapter<Customization, String>(getSubjectHolder(), Customization.SESSION_CUSTOMIZER_LIST) {
- @Override
- protected ListIterable<String> getListIterable() {
- return subject.getSessionCustomizers();
- }
-
- @Override
- protected int size_() {
- return subject.getSessionCustomizersSize();
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildSelectedItemHolder() {
- return new SimplePropertyValueModel<String>();
- }
-
- /**
- * Prompts the user the Open Type dialog.
- *
- * @return Either the selected type or <code>null</code> if the user
- * canceled the dialog
- */
- private IType chooseType() {
- IJavaProject javaProject = getJavaProject();
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- ""
- );
- }
- catch (JavaModelException e) {
- JptJpaEclipseLinkUiPlugin.log(e);
- return null;
- }
-
- typeSelectionDialog.setTitle(JptCommonUiMessages.ClassChooserPane_dialogTitle);
- typeSelectionDialog.setMessage(JptCommonUiMessages.ClassChooserPane_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
-
- return null;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Description
- container = addTitledGroup(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_sessionCustomizerLabel
- );
-
- // List pane
- new AddRemoveListPane<Customization>(
- this,
- container,
- buildAdapter(),
- buildListHolder(),
- buildSelectedItemHolder(),
- buildLabelProvider()
- )
- {
- @Override
- protected void initializeTable(Table table) {
- super.initializeTable(table);
-
- Composite container = table.getParent();
- GridData gridData = (GridData) container.getLayoutData();
- gridData.heightHint = 75;
- }
- };
- }
-
- private IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ThrowExceptionsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ThrowExceptionsComposite.java
deleted file mode 100644
index b6e5a939a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ThrowExceptionsComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ThrowExceptionsComposite
- */
-public class ThrowExceptionsComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>ThrowExceptionsComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ThrowExceptionsComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_throwExceptionsLabel,
- this.buildThrowExceptionsHolder(),
- this.buildThrowExceptionsStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildThrowExceptionsHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.THROW_EXCEPTIONS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getThrowExceptions();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setThrowExceptions(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildThrowExceptionsStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultThrowExceptionsHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_throwExceptionsLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_throwExceptionsLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultThrowExceptionsHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.THROW_EXCEPTIONS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getThrowExceptions() != null) {
- return null;
- }
- return this.subject.getDefaultThrowExceptions();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ValidateSchemaComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ValidateSchemaComposite.java
deleted file mode 100644
index 1d1e12a836..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ValidateSchemaComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ValidateSchemaComposite
- */
-public class ValidateSchemaComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>ValidateSchemaComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidateSchemaComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validateSchemaLabel,
- this.buildValidateSchemaHolder(),
- this.buildValidateSchemaStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildValidateSchemaHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.VALIDATE_SCHEMA_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getValidateSchema();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setValidateSchema(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildValidateSchemaStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultValidateSchemaHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validateSchemaLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validateSchemaLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultValidateSchemaHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.VALIDATE_SCHEMA_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getValidateSchema() != null) {
- return null;
- }
- return this.subject.getDefaultValidateSchema();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java
deleted file mode 100644
index 0bceaa9834..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/ValidationOnlyComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ValidationOnlyComposite
- */
-public class ValidationOnlyComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>ValidationOnlyComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidationOnlyComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validationOnlyLabel,
- this.buildValidationOnlyHolder(),
- this.buildValidationOnlyStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildValidationOnlyHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.VALIDATION_ONLY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getValidationOnly();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setValidationOnly(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildValidationOnlyStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultValidationOnlyHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validationOnlyLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_validationOnlyLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultValidationOnlyHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.VALIDATION_ONLY_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getValidationOnly() != null) {
- return null;
- }
- return this.subject.getDefaultValidationOnly();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingChangeTrackingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingChangeTrackingComposite.java
deleted file mode 100644
index 8f2d45b882..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingChangeTrackingComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingChangeTrackingComposite
- */
-public class WeavingChangeTrackingComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingChangeTrackingComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingChangeTrackingComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingChangeTrackingLabel,
- this.buildWeavingChangeTrackingHolder(),
- this.buildWeavingChangeTrackingStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildWeavingChangeTrackingHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_CHANGE_TRACKING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingChangeTracking();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingChangeTracking(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingChangeTrackingStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingChangeTrackingHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingChangeTrackingLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingChangeTrackingLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultWeavingChangeTrackingHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_CHANGE_TRACKING_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingChangeTracking() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingChangeTracking();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingComposite.java
deleted file mode 100644
index d4c5c3c905..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingComposite.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Weaving;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingComposite
- */
-public class WeavingComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super( parentComposite, parent);
- }
-
- private EnumFormComboViewer<Customization, Weaving> addWeavingCombo(Composite container) {
- return new EnumFormComboViewer<Customization, Weaving>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Customization.WEAVING_PROPERTY);
- }
-
- @Override
- protected Weaving[] getChoices() {
- return Weaving.values();
- }
-
- @Override
- protected Weaving getDefaultValue() {
- return getSubject().getDefaultWeaving();
- }
-
- @Override
- protected String displayString(Weaving value) {
- switch (value) {
- case true_ :
- return EclipseLinkUiMessages.WeavingComposite_true_;
- case false_ :
- return EclipseLinkUiMessages.WeavingComposite_false_;
- case static_ :
- return EclipseLinkUiMessages.WeavingComposite_static_;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected Weaving getValue() {
- return getSubject().getWeaving();
- }
-
- @Override
- protected void setValue(Weaving value) {
- getSubject().setWeaving(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingLabel,
- this.addWeavingCombo( container),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingEagerComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingEagerComposite.java
deleted file mode 100644
index 27c1affcbb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingEagerComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingEagerComposite
- */
-public class WeavingEagerComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingEagerComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingEagerComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingEagerLabel,
- this.buildWeavingEagerHolder(),
- this.buildWeavingEagerStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildWeavingEagerHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_EAGER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingEager();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingEager(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingEagerStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingEagerHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingEagerLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingEagerLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultWeavingEagerHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_EAGER_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingEager() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingEager();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingFetchGroupsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingFetchGroupsComposite.java
deleted file mode 100644
index 98747053dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingFetchGroupsComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingFetchGroupsComposite
- */
-public class WeavingFetchGroupsComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingFetchGroupsComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingFetchGroupsComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingFetchGroupsLabel,
- this.buildWeavingFetchGroupsHolder(),
- this.buildWeavingFetchGroupsStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildWeavingFetchGroupsHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_FETCH_GROUPS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingFetchGroups();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingFetchGroups(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingFetchGroupsStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingFetchGroupsHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingFetchGroupsLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingFetchGroupsLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultWeavingFetchGroupsHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_FETCH_GROUPS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingFetchGroups() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingFetchGroups();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingInternalComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingInternalComposite.java
deleted file mode 100644
index 34fcf48b63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingInternalComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingInternalComposite
- */
-public class WeavingInternalComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingInternalComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingInternalComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingInternalLabel,
- this.buildWeavingInternalHolder(),
- this.buildWeavingInternalStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildWeavingInternalHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_INTERNAL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingInternal();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingInternal(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingInternalStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingInternalHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingInternalLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingInternalLabel;
- }
- };
- }
-
-
- private PropertyValueModel<Boolean> buildDefaultWeavingInternalHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_INTERNAL_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingInternal() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingInternal();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingLazyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingLazyComposite.java
deleted file mode 100644
index 6080b37e29..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingLazyComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingLazyComposite
- */
-public class WeavingLazyComposite extends Pane<Customization>
-{
- /**
- * Creates a new <code>WeavingLazyComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public WeavingLazyComposite(
- Pane<? extends Customization> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingLazyLabel,
- this.buildWeavingLazyHolder(),
- this.buildWeavingLazyStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_CUSTOMIZATION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildWeavingLazyHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(getSubjectHolder(), Customization.WEAVING_LAZY_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getWeavingLazy();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setWeavingLazy(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildWeavingLazyStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultWeavingLazyHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingLazyLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingLazyLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultWeavingLazyHolder() {
- return new PropertyAspectAdapter<Customization, Boolean>(
- getSubjectHolder(),
- Customization.WEAVING_LAZY_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getWeavingLazy() != null) {
- return null;
- }
- return this.subject.getDefaultWeavingLazy();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingPropertiesComposite.java
deleted file mode 100644
index f4de4eaeba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/customization/WeavingPropertiesComposite.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * WeavingPropertiesComposite
- */
-public class WeavingPropertiesComposite extends Pane<Customization>
-{
- public WeavingPropertiesComposite(Pane<? extends Customization> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- Composite weavingGroup = this.addTitledGroup(
- this.addSubPane(parent, 10),
- EclipseLinkUiMessages.PersistenceXmlCustomizationTab_weavingPropertiesGroupBox
- );
-
- // Weaving
- new WeavingComposite(this, weavingGroup);
-
- // Weaving Lazy
- new WeavingLazyComposite(this, weavingGroup);
-
- // Weaving Fetch Groups
- new WeavingFetchGroupsComposite(this, weavingGroup);
-
- // Weaving Internal
- new WeavingInternalComposite(this, weavingGroup);
-
- // Weaving Eager
- new WeavingEagerComposite(this, weavingGroup);
-
- // Weaving Change Tracking
- new WeavingChangeTrackingComposite(this, weavingGroup);
-
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralComposite.java
deleted file mode 100644
index 883a4b3959..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitGeneralComposite.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceUnitGeneralComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkPersistenceUnitGeneralComposite
- */
-public class EclipseLinkPersistenceUnitGeneralComposite
- extends PersistenceUnitGeneralComposite
-{
- // ********** constructors **********
- public EclipseLinkPersistenceUnitGeneralComposite(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite container,
- WidgetFactory widgetFactory) {
- super(subjectHolder, container, widgetFactory);
- }
-
- // ********** initialization **********
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeGeneralPane(container);
- this.initializeMappedClassesPane(container);
- this.initializeJPAMappingDescriptorsPane(container);
- this.initializeJarFilesPane(container);
- }
-
- protected void initializeJPAMappingDescriptorsPane(Composite container) {
-
- container = addCollapsibleSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_jpaMappingDescriptors,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_jpaMappingDescriptors_description
- );
-
- updateGridData(container);
- updateGridData(container.getParent());
-
- new EclipseLinkPersistenceUnitMappingFilesComposite(this, container);
- }
-
- protected void initializeJarFilesPane(Composite container) {
-
- container = addCollapsibleSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_jarFiles
- );
-
- updateGridData(container);
- updateGridData(container.getParent());
-
- new EclipseLinkPersistenceUnitJarFilesComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitJarFilesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitJarFilesComposite.java
deleted file mode 100644
index 25a7415cc5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitJarFilesComposite.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.ArchiveFileSelectionDialog;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceUnitJarFilesComposite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.ArchiveFileSelectionDialog.DeploymentPathCalculator;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLinkPersistenceUnitJarFilesComposite
- extends PersistenceUnitJarFilesComposite
-{
- public EclipseLinkPersistenceUnitJarFilesComposite(
- Pane<? extends PersistenceUnit> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected DeploymentPathCalculator buildJarFileDeploymentPathCalculator() {
- return new EclipseLinkDeploymentPathCalculator();
- }
-
-
- private static class EclipseLinkDeploymentPathCalculator
- extends ArchiveFileSelectionDialog.ModuleDeploymentPathCalculator
- {
- @Override
- public String calculateDeploymentPath(IFile file) {
- String baseDeploymentPath = super.calculateDeploymentPath(file);
- if (JptJpaCorePlugin.projectHasWebFacet(file.getProject())) {
- return "../" + baseDeploymentPath;
- }
- else {
- return baseDeploymentPath;
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitMappingFilesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitMappingFilesComposite.java
deleted file mode 100644
index 575456e430..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/general/EclipseLinkPersistenceUnitMappingFilesComposite.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.general;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.GeneralProperties;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceUnitGeneralComposite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceUnitMappingFilesComposite;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitGeneralComposite - The parent container
- * @see AddRemoveListPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class EclipseLinkPersistenceUnitMappingFilesComposite extends PersistenceUnitMappingFilesComposite
-{
- /**
- * Creates a new <code>PersistenceUnitMappingFilesComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public EclipseLinkPersistenceUnitMappingFilesComposite(Pane<? extends PersistenceUnit> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addMappingFilesList(container);
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlGeneralTab_excludeEclipselinkOrm,
- this.buildExcludeEclipselinkOrmHolder(),
- this.buildExcludeEclipselinkOrmStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_GENERAL
- );
- }
-
- protected PropertyValueModel<GeneralProperties> buildGeneralPropertiesHolder() {
- return new TransformationPropertyValueModel<PersistenceUnit, GeneralProperties>(getSubjectHolder()) {
- @Override
- protected GeneralProperties transform_(PersistenceUnit persistenceUnit) {
- return ((EclipseLinkPersistenceUnit) persistenceUnit).getGeneralProperties();
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildExcludeEclipselinkOrmHolder() {
- return new PropertyAspectAdapter<GeneralProperties, Boolean>(
- buildGeneralPropertiesHolder(),
- GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getExcludeEclipselinkOrm();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setExcludeEclipselinkOrm(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildExcludeEclipselinkOrmStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultExcludeEclipselinkOrmHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlGeneralTab_excludeEclipselinkOrmWithDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlGeneralTab_excludeEclipselinkOrm;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultExcludeEclipselinkOrmHolder() {
- return new PropertyAspectAdapter<GeneralProperties, Boolean>(
- buildGeneralPropertiesHolder(),
- GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getExcludeEclipselinkOrm() != null) {
- return null;
- }
- return this.subject.getDefaultExcludeEclipselinkOrm();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java
deleted file mode 100644
index 5c16de6981..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/EclipseLinkLoggingComposite.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * EclipseLinkLoggingComposite
- */
-public class EclipseLinkLoggingComposite<T extends Logging>
- extends Pane<T>
-{
- public EclipseLinkLoggingComposite(
- Pane<T> subjectHolder,
- Composite container) {
- super(subjectHolder, container, false);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- Section section = getWidgetFactory().createSection(parent, SWT.FLAT | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
- section.setText(EclipseLinkUiMessages.PersistenceXmlLoggingTab_sectionTitle);
- section.setDescription(EclipseLinkUiMessages.PersistenceXmlLoggingTab_sectionDescription);
- Composite composite = getWidgetFactory().createComposite(section);
- composite.setLayout(new GridLayout(1, false));
- section.setClient(composite);
- this.updateGridData(composite);
- this.updateGridData(composite.getParent());
-
- // LoggingLevel:
- new LoggingLevelComposite(this, composite);
-
- // Boolean properties group
- this.logPropertiesComposite(composite);
-
- // LoggingFile:
- new LoggingFileLocationComposite(this, composite);
-
- // Logger:
- new LoggerComposite(this, composite);
-
- return;
- }
-
- protected void logPropertiesComposite(Composite parent) {
-
- // Timestamp:
- new TimestampComposite(this, parent);
-
- // Thread:
- new ThreadComposite(this, parent);
-
- // Session:
- new SessionComposite(this, parent);
-
- // Exceptions:
- new ExceptionsComposite(this, parent);
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/ExceptionsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/ExceptionsComposite.java
deleted file mode 100644
index 97b0105d43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/ExceptionsComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ExceptionsComposite
- */
-public class ExceptionsComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>ExceptionsComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ExceptionsComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_exceptionsLabel,
- this.buildExceptionsHolder(),
- this.buildExceptionsStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_EXCEPTIONS
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildExceptionsHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(getSubjectHolder(), Logging.EXCEPTIONS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getExceptions();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setExceptions(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildExceptionsStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultExceptionsHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_exceptionsLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_exceptionsLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultExceptionsHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(
- getSubjectHolder(),
- Logging.EXCEPTIONS_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getExceptions() != null) {
- return null;
- }
- return this.subject.getDefaultExceptions();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggerComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggerComposite.java
deleted file mode 100644
index 1bfe19b2b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggerComposite.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logger;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import com.ibm.icu.text.Collator;
-
-/**
- * LoggerComposite
- */
-public class LoggerComposite extends ClassChooserComboPane<Logging>
-{
- /**
- * Creates a new <code>LoggerComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public LoggerComposite(
- Pane<? extends Logging> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected String getClassName() {
- if (this.getSubject().getLogger() == null) {
- return Logger.default_logger.getClassName();
- }
- return Logger.getLoggerClassName(this.getSubject().getLogger());
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_loggerLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return Logging.ECLIPSELINK_LOGGER_CLASS_NAME;
- }
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Logging, String>(this.getSubjectHolder(), Logging.LOGGER_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = this.subject.getLogger();
- if (name == null) {
- name = LoggerComposite.this.getDefaultValue(this.subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(this.subject).equals(value)) {
- value = null;
- }
- this.subject.setLogger(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildDefaultLoggerHolder() {
- return new PropertyAspectAdapter<Logging, String>(this.getSubjectHolder(), Logging.DEFAULT_LOGGER) {
- @Override
- protected String buildValue_() {
- return LoggerComposite.this.getDefaultValue(this.subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultLoggerListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultLoggerHolder()
- );
- }
-
- private String buildDisplayString(String loggerName) {
-
- switch (Logger.valueOf(loggerName)) {
- case default_logger: {
- return EclipseLinkUiMessages.LoggerComposite_default_logger;
- }
- case java_logger: {
- return EclipseLinkUiMessages.LoggerComposite_java_logger;
- }
- case server_logger: {
- return EclipseLinkUiMessages.LoggerComposite_server_logger;
- }
- default: {
- return null;
- }
- }
- }
-
- private Comparator<String> buildLoggerComparator() {
- return new Comparator<String>() {
- public int compare(String logger1, String logger2) {
- logger1 = buildDisplayString(logger1);
- logger2 = buildDisplayString(logger2);
- return Collator.getInstance().compare(logger1, logger2);
- }
- };
- }
-
- @Override
- protected StringConverter<String> buildClassConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- try {
- Logger.valueOf(value);
- value = buildDisplayString(value);
- }
- catch (Exception e) {
- // Ignore since the value is not a Logger
- }
- return value;
- }
- };
- }
-
- @Override
- protected ListValueModel<String> buildClassListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(this.buildDefaultLoggerListHolder());
- holders.add(this.buildLoggersListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private Iterator<String> buildLoggers() {
- return new TransformationIterator<Logger, String>(CollectionTools.iterator(Logger.values())) {
- @Override
- protected String transform(Logger next) {
- return next.name();
- }
- };
- }
-
- private CollectionValueModel<String> buildLoggersCollectionHolder() {
- return new SimpleCollectionValueModel<String>(
- CollectionTools.collection(this.buildLoggers())
- );
- }
-
- private ListValueModel<String> buildLoggersListHolder() {
- return new SortedListValueModelAdapter<String>(
- this.buildLoggersCollectionHolder(),
- this.buildLoggerComparator()
- );
- }
-
- private String getDefaultValue(Logging subject) {
- String defaultValue = subject.getDefaultLogger();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setLogger(className);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggingFileLocationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggingFileLocationComposite.java
deleted file mode 100644
index 052fdf5be9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggingFileLocationComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.FileChooserComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * LoggingFileLocationComposite
- */
-public class LoggingFileLocationComposite extends Pane<Logging>
-{
- public LoggingFileLocationComposite(Pane<? extends Logging> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- new FileChooserComboPane<Logging>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Logging, String>(
- getSubjectHolder(), Logging.LOG_FILE_LOCATION_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getLogFileLocation();
- if (name == null) {
- name = defaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (defaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setLogFileLocation(value);
- }
- };
- }
-
- private String defaultValue(Logging subject) {
- String defaultValue = subject.getDefaultLogFileLocation();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- else {
- return this.getDefaultString();
- }
- }
-
- @Override
- protected String getDefaultString() {
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_defaultStdout;
- }
-
- @Override
- protected String getDialogTitle() {
- return EclipseLinkUiMessages.LoggingFileLocationComposite_dialogTitle;
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_loggingFileLabel;
- }
-
- @Override
- protected String getProjectPath() {
- return this.getSubject().getJpaProject().getProject().getLocation().toString();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggingLevelComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggingLevelComposite.java
deleted file mode 100644
index 9af650bc97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/LoggingLevelComposite.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * LoggingLevelComposite
- */
-public class LoggingLevelComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>LoggingLevelComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public LoggingLevelComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private EnumFormComboViewer<Logging, LoggingLevel> addLoggingLevelCombo(Composite container) {
- return new EnumFormComboViewer<Logging, LoggingLevel>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Logging.LEVEL_PROPERTY);
- }
-
- @Override
- protected LoggingLevel[] getChoices() {
- return LoggingLevel.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected LoggingLevel getDefaultValue() {
- return this.getSubject().getDefaultLevel();
- }
-
- @Override
- protected String displayString(LoggingLevel value) {
- switch (value) {
- case all :
- return EclipseLinkUiMessages.LoggingLevelComposite_all;
- case config :
- return EclipseLinkUiMessages.LoggingLevelComposite_config;
- case fine :
- return EclipseLinkUiMessages.LoggingLevelComposite_fine;
- case finer :
- return EclipseLinkUiMessages.LoggingLevelComposite_finer;
- case finest :
- return EclipseLinkUiMessages.LoggingLevelComposite_finest;
- case info :
- return EclipseLinkUiMessages.LoggingLevelComposite_info;
- case off :
- return EclipseLinkUiMessages.LoggingLevelComposite_off;
- case severe :
- return EclipseLinkUiMessages.LoggingLevelComposite_severe;
- case warning :
- return EclipseLinkUiMessages.LoggingLevelComposite_warning;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected LoggingLevel getValue() {
- return this.getSubject().getLevel();
- }
-
- @Override
- protected void setValue(LoggingLevel value) {
- this.getSubject().setLevel(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_loggingLevelLabel,
- this.addLoggingLevelCombo(container),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_LEVEL
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/PersistenceXmlLoggingTab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/PersistenceXmlLoggingTab.java
deleted file mode 100644
index c7eb00aa8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/PersistenceXmlLoggingTab.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlLoggingTab
- */
-public class PersistenceXmlLoggingTab<T extends Logging>
- extends Pane<T>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- public PersistenceXmlLoggingTab(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkLoggingComposite<T>(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_LOGGING;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_title;
- }
-
- // ********** Layout **********
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
- Composite container = this.addPane(parent, layout);
- this.updateGridData(container);
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/SessionComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/SessionComposite.java
deleted file mode 100644
index 349fbb2110..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/SessionComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SessionComposite
- */
-public class SessionComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>SessionComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public SessionComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_sessionLabel,
- this.buildSessionHolder(),
- this.buildSessionStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_SESSION
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildSessionHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(getSubjectHolder(), Logging.SESSION_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSession();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSession(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildSessionStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultSessionHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_sessionLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_sessionLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultSessionHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(
- getSubjectHolder(),
- Logging.SESSION_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSession() != null) {
- return null;
- }
- return this.subject.getDefaultSession();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/ThreadComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/ThreadComposite.java
deleted file mode 100644
index 460170e9d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/ThreadComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ThreadComposite
- */
-public class ThreadComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>ThreadComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ThreadComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_threadLabel,
- this.buildThreadHolder(),
- this.buildThreadStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_THREAD
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildThreadHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(getSubjectHolder(), Logging.THREAD_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getThread();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setThread(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildThreadStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultThreadHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_threadLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_threadLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultThreadHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(
- getSubjectHolder(),
- Logging.THREAD_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getThread() != null) {
- return null;
- }
- return this.subject.getDefaultThread();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/TimestampComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/TimestampComposite.java
deleted file mode 100644
index 743c8e0992..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/logging/TimestampComposite.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * TimestampComposite
- */
-public class TimestampComposite extends Pane<Logging>
-{
- /**
- * Creates a new <code>TimestampComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public TimestampComposite(
- Pane<? extends Logging> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_timestampLabel,
- this.buildTimestampHolder(),
- this.buildTimestampStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_TIMESTAMP
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildTimestampHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(getSubjectHolder(), Logging.TIMESTAMP_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getTimestamp();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setTimestamp(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildTimestampStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultTimestampHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_timestampLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_timestampLabel;
- }
- };
- }
- private PropertyValueModel<Boolean> buildDefaultTimestampHolder() {
- return new PropertyAspectAdapter<Logging, Boolean>(
- getSubjectHolder(),
- Logging.TIMESTAMP_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getTimestamp() != null) {
- return null;
- }
- return this.subject.getDefaultTimestamp();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EclipseLinkOptionsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EclipseLinkOptionsComposite.java
deleted file mode 100644
index 1396f30a3a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EclipseLinkOptionsComposite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkOptionsComposite
- */
-public class EclipseLinkOptionsComposite<T extends Options> extends Pane<T>
-{
- public EclipseLinkOptionsComposite(
- Pane<T> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container, false);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.initializeSessionOptionsPane(parent);
- this.initializeMiscellaneousPane(parent);
- }
-
- private void initializeSessionOptionsPane(Composite parent) {
- Composite composite = this.addSection(parent,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionSectionTitle,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionSectionDescription);
-
- this.updateGridData(composite);
- this.updateGridData(composite.getParent());
-
- new SessionNameComposite(this, composite);
-
- new SessionsXmlComposite(this, composite);
-
- new TargetDatabaseComposite(this, composite);
-
- new TargetServerComposite(this, composite);
-
- new EventListenerComposite(this, composite);
-
- new IncludeDescriptorQueriesComposite(this, composite);
-
- return;
- }
-
- protected Composite initializeMiscellaneousPane(Composite container) {
-
- this.updateGridData(container);
- this.updateGridData(container.getParent());
-
- Composite composite = this.addSection(container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_miscellaneousSectionTitle,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_miscellaneousSectionDescription);
-
- this.updateGridData(composite);
- this.updateGridData(composite.getParent());
-
- new TemporalMutableComposite(this, composite);
-
- return composite;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EventListenerComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EventListenerComposite.java
deleted file mode 100644
index a117e1a0cd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/EventListenerComposite.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EventListenerComposite
- */
-public class EventListenerComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>EventListenerComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public EventListenerComposite(Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private ClassChooserPane<Options> initializeClassChooser(Composite container) {
-
- return new ClassChooserPane<Options>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<Options, String>(
- this.getSubjectHolder(), Options.SESSION_EVENT_LISTENER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getEventListener();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setEventListener(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return this.getSubject().getEventListener();
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_eventListenerLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setEventListener(className);
- }
-
- @Override
- protected String getSuperInterfaceName() {
- return Options.ECLIPSELINK_EVENT_LISTENER_CLASS_NAME;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeClassChooser(container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/IncludeDescriptorQueriesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/IncludeDescriptorQueriesComposite.java
deleted file mode 100644
index c9d4576b6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/IncludeDescriptorQueriesComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * IncludeDescriptorQueriesComposite
- */
-public class IncludeDescriptorQueriesComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>IncludeDescriptorQueriesComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public IncludeDescriptorQueriesComposite(
- Pane<? extends Options> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_includeDescriptorQueriesLabel,
- this.buildIncludeDescriptorQueriesHolder(),
- this.buildIncludeDescriptorQueriesStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildIncludeDescriptorQueriesHolder() {
- return new PropertyAspectAdapter<Options, Boolean>(getSubjectHolder(), Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getIncludeDescriptorQueries();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setIncludeDescriptorQueries(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildIncludeDescriptorQueriesStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultIncludeDescriptorQueriesHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlOptionsTab_includeDescriptorQueriesLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_includeDescriptorQueriesLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultIncludeDescriptorQueriesHolder() {
- return new PropertyAspectAdapter<Options, Boolean>(
- getSubjectHolder(),
- Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getIncludeDescriptorQueries() != null) {
- return null;
- }
- return this.subject.getDefaultIncludeDescriptorQueries();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/PersistenceXmlOptionsTab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/PersistenceXmlOptionsTab.java
deleted file mode 100644
index ee58f8fb55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/PersistenceXmlOptionsTab.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlOptionsTab
- */
-public class PersistenceXmlOptionsTab<T extends Options>
- extends Pane<T>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- public PersistenceXmlOptionsTab(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkOptionsComposite<T>(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_title;
- }
-
- // ********** Layout **********
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
- Composite container = this.addPane(parent, layout);
- this.updateGridData(container);
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/SessionNameComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/SessionNameComposite.java
deleted file mode 100644
index c104501b51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/SessionNameComposite.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SessionNameComposite
- */
-public class SessionNameComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>SessionNameComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public SessionNameComposite(
- Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultSessionNameHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.DEFAULT_SESSION_NAME) {
- @Override
- protected String buildValue_() {
- return SessionNameComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultSessionNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultSessionNameHolder()
- );
- }
-
- private ModifiablePropertyValueModel<String> buildSessionNameHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.SESSION_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getSessionName();
- if (name == null) {
- name = SessionNameComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setSessionName(value);
- }
- };
- }
-
- private String getDefaultValue(Options subject) {
- String defaultValue = subject.getDefaultSessionName();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionName,
- this.buildDefaultSessionNameListHolder(),
- this.buildSessionNameHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS_SESSION_NAME
- );
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java
deleted file mode 100644
index fa56c59ad6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/SessionsXmlComposite.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SessionsXmlComposite
- */
-public class SessionsXmlComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>SessionsXmlComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public SessionsXmlComposite(
- Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultSessionsXmlFileNameHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.DEFAULT_SESSIONS_XML) {
- @Override
- protected String buildValue_() {
- return SessionsXmlComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultSessionsXmlFileNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultSessionsXmlFileNameHolder()
- );
- }
-
- private ModifiablePropertyValueModel<String> buildSessionsXmlFileNameHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.SESSIONS_XML_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getSessionsXml();
- if (name == null) {
- name = SessionsXmlComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setSessionsXml(value);
- }
- };
- }
-
- private String getDefaultValue(Options subject) {
- String defaultValue = subject.getDefaultSessionsXml();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_sessionsXml,
- this.buildDefaultSessionsXmlFileNameListHolder(),
- this.buildSessionsXmlFileNameHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS_SESSIONS_XML
- );
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java
deleted file mode 100644
index 122de1cd8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TargetDatabaseComposite.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetDatabase;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import com.ibm.icu.text.Collator;
-
-/**
- * TargetDatabaseComposite
- */
-public class TargetDatabaseComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>TargetDatabaseComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TargetDatabaseComposite(
- Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultTargetDatabaseHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.DEFAULT_TARGET_DATABASE) {
- @Override
- protected String buildValue_() {
- return TargetDatabaseComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultTargetDatabaseListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultTargetDatabaseHolder()
- );
- }
-
- private String buildDisplayString(String targetDatabaseName) {
- switch (TargetDatabase.valueOf(targetDatabaseName)) {
- case attunity :
- return EclipseLinkUiMessages.TargetDatabaseComposite_attunity;
- case auto :
- return EclipseLinkUiMessages.TargetDatabaseComposite_auto;
- case cloudscape :
- return EclipseLinkUiMessages.TargetDatabaseComposite_cloudscape;
- case database :
- return EclipseLinkUiMessages.TargetDatabaseComposite_database;
- case db2 :
- return EclipseLinkUiMessages.TargetDatabaseComposite_db2;
- case db2mainframe :
- return EclipseLinkUiMessages.TargetDatabaseComposite_db2mainframe;
- case dbase :
- return EclipseLinkUiMessages.TargetDatabaseComposite_dbase;
- case derby :
- return EclipseLinkUiMessages.TargetDatabaseComposite_derby;
- case hsql :
- return EclipseLinkUiMessages.TargetDatabaseComposite_hsql;
- case informix :
- return EclipseLinkUiMessages.TargetDatabaseComposite_informix;
- case javadb :
- return EclipseLinkUiMessages.TargetDatabaseComposite_javadb;
- case maxdb :
- return EclipseLinkUiMessages.TargetDatabaseComposite_maxdb;
- case mysql :
- return EclipseLinkUiMessages.TargetDatabaseComposite_mysql;
- case oracle :
- return EclipseLinkUiMessages.TargetDatabaseComposite_oracle;
- case oracle10 :
- return EclipseLinkUiMessages.TargetDatabaseComposite_oracle10;
- case oracle11 :
- return EclipseLinkUiMessages.TargetDatabaseComposite_oracle11;
- case oracle8 :
- return EclipseLinkUiMessages.TargetDatabaseComposite_oracle8;
- case oracle9 :
- return EclipseLinkUiMessages.TargetDatabaseComposite_oracle9;
- case pointbase :
- return EclipseLinkUiMessages.TargetDatabaseComposite_pointbase;
- case postgresql :
- return EclipseLinkUiMessages.TargetDatabaseComposite_postgresql;
- case sqlanywhere :
- return EclipseLinkUiMessages.TargetDatabaseComposite_sqlanywhere;
- case sqlserver :
- return EclipseLinkUiMessages.TargetDatabaseComposite_sqlserver;
- case sybase :
- return EclipseLinkUiMessages.TargetDatabaseComposite_sybase;
- case symfoware :
- return EclipseLinkUiMessages.TargetDatabaseComposite_symfoware;
- case timesten :
- return EclipseLinkUiMessages.TargetDatabaseComposite_timesten;
- default :
- throw new IllegalStateException();
- }
- }
-
- private Comparator<String> buildTargetDatabaseComparator() {
- return new Comparator<String>() {
- public int compare(String targetDatabase1, String targetDatabase2) {
- targetDatabase1 = buildDisplayString(targetDatabase1);
- targetDatabase2 = buildDisplayString(targetDatabase2);
- return Collator.getInstance().compare(targetDatabase1, targetDatabase2);
- }
- };
- }
-
- private StringConverter<String> buildTargetDatabaseConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- try {
- TargetDatabase.valueOf(value);
- value = buildDisplayString(value);
- }
- catch (Exception e) {
- // Ignore since the value is not a TargetDatabase
- }
- return value;
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildTargetDatabaseHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.TARGET_DATABASE_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getTargetDatabase();
- if (name == null) {
- name = TargetDatabaseComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setTargetDatabase(value);
- }
- };
- }
-
- private ListValueModel<String> buildTargetDatabaseListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(buildDefaultTargetDatabaseListHolder());
- holders.add(buildTargetDatabasesListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private Iterator<String> buildTargetDatabases() {
- return new TransformationIterator<TargetDatabase, String>(CollectionTools.iterator(TargetDatabase.values())) {
- @Override
- protected String transform(TargetDatabase next) {
- return next.name();
- }
- };
- }
-
- private CollectionValueModel<String> buildTargetDatabasesCollectionHolder() {
- return new SimpleCollectionValueModel<String>(
- CollectionTools.collection(buildTargetDatabases())
- );
- }
-
- private ListValueModel<String> buildTargetDatabasesListHolder() {
- return new SortedListValueModelAdapter<String>(
- buildTargetDatabasesCollectionHolder(),
- buildTargetDatabaseComparator()
- );
- }
-
- private String getDefaultValue(Options subject) {
- String defaultValue = subject.getDefaultTargetDatabase();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_targetDatabaseLabel,
- this.buildTargetDatabaseListHolder(),
- this.buildTargetDatabaseHolder(),
- this.buildTargetDatabaseConverter(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS_TARGET_DATABASE
- );
-
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TargetServerComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TargetServerComposite.java
deleted file mode 100644
index f92fa70f0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TargetServerComposite.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.Iterator;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetServer;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import com.ibm.icu.text.Collator;
-
-/**
- * TargetServerComposite
- */
-public class TargetServerComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>TargetServerComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TargetServerComposite(
- Pane<? extends Options> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultTargetServerHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.DEFAULT_TARGET_SERVER) {
- @Override
- protected String buildValue_() {
- return TargetServerComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultTargetServerListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultTargetServerHolder()
- );
- }
-
- private String buildDisplayString(String targetServerName) {
- switch (TargetServer.valueOf(targetServerName)) {
- case jboss :
- return EclipseLinkUiMessages.TargetServerComposite_jboss;
- case netweaver_7_1 :
- return EclipseLinkUiMessages.TargetServerComposite_netweaver_7_1;
- case none :
- return EclipseLinkUiMessages.TargetServerComposite_none;
- case oc4j :
- return EclipseLinkUiMessages.TargetServerComposite_oc4j;
- case sunas9 :
- return EclipseLinkUiMessages.TargetServerComposite_sunas9;
- case weblogic :
- return EclipseLinkUiMessages.TargetServerComposite_weblogic;
- case weblogic_10 :
- return EclipseLinkUiMessages.TargetServerComposite_weblogic_10;
- case weblogic_9 :
- return EclipseLinkUiMessages.TargetServerComposite_weblogic_9;
- case websphere :
- return EclipseLinkUiMessages.TargetServerComposite_websphere;
- case websphere_6_1 :
- return EclipseLinkUiMessages.TargetServerComposite_websphere_6_1;
- case websphere_7 :
- return EclipseLinkUiMessages.TargetServerComposite_websphere_7;
- default :
- throw new IllegalStateException();
- }
- }
-
- private Comparator<String> buildTargetServerComparator() {
- return new Comparator<String>() {
- public int compare(String targetServer1, String targetServer2) {
- targetServer1 = buildDisplayString(targetServer1);
- targetServer2 = buildDisplayString(targetServer2);
- return Collator.getInstance().compare(targetServer1, targetServer2);
- }
- };
- }
-
- private StringConverter<String> buildTargetServerConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- try {
- TargetServer.valueOf(value);
- value = buildDisplayString(value);
- }
- catch (Exception e) {
- // Ignore since the value is not a TargetServer
- }
- return value;
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildTargetServerHolder() {
- return new PropertyAspectAdapter<Options, String>(this.getSubjectHolder(), Options.TARGET_SERVER_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getTargetServer();
- if (name == null) {
- name = TargetServerComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setTargetServer(value);
- }
- };
- }
-
- private ListValueModel<String> buildTargetServerListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(buildDefaultTargetServerListHolder());
- holders.add(buildTargetServersListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private Iterator<String> buildTargetServers() {
- return new TransformationIterator<TargetServer, String>(CollectionTools.iterator(TargetServer.values())) {
- @Override
- protected String transform(TargetServer next) {
- return next.name();
- }
- };
- }
-
- private CollectionValueModel<String> buildTargetServersCollectionHolder() {
- return new SimpleCollectionValueModel<String>(
- CollectionTools.collection(buildTargetServers())
- );
- }
-
- private ListValueModel<String> buildTargetServersListHolder() {
- return new SortedListValueModelAdapter<String>(
- buildTargetServersCollectionHolder(),
- buildTargetServerComparator()
- );
- }
-
- private String getDefaultValue(Options subject) {
- String defaultValue = subject.getDefaultTargetServer();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_targetServerLabel,
- this.buildTargetServerListHolder(),
- this.buildTargetServerHolder(),
- this.buildTargetServerConverter(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS_TARGET_SERVER
- );
-
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TemporalMutableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TemporalMutableComposite.java
deleted file mode 100644
index 0bbfbce083..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/options/TemporalMutableComposite.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * TemporalMutableComposite
- */
-public class TemporalMutableComposite extends Pane<Options>
-{
- /**
- * Creates a new <code>TemporalMutableComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public TemporalMutableComposite(
- Pane<? extends Options> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlOptionsTab_temporalMutableLabel,
- this.buildTemporalMutableHolder(),
- this.buildTemporalMutableStringHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_OPTIONS
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildTemporalMutableHolder() {
- return new PropertyAspectAdapter<Options, Boolean>(getSubjectHolder(), Options.TEMPORAL_MUTABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getTemporalMutable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setTemporalMutable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildTemporalMutableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultTemporalMutableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlOptionsTab_temporalMutableLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlOptionsTab_temporalMutableLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultTemporalMutableHolder() {
- return new PropertyAspectAdapter<Options, Boolean>(
- getSubjectHolder(),
- Options.TEMPORAL_MUTABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getTemporalMutable() != null) {
- return null;
- }
- return this.subject.getDefaultTemporalMutable();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java
deleted file mode 100644
index 6ab6de68a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/CreateDdlFileNameComposite.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CreateDdlFileNameComposite
- */
-public class CreateDdlFileNameComposite extends Pane<SchemaGeneration>
-{
- /**
- * Creates a new <code>CreateDdlFileNameComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public CreateDdlFileNameComposite(
- Pane<? extends SchemaGeneration> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultCreateDdlFileNameHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(this.getSubjectHolder(), SchemaGeneration.DEFAULT_SCHEMA_GENERATION_CREATE_FILE_NAME) {
- @Override
- protected String buildValue_() {
- return CreateDdlFileNameComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultCreateDdlFileNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultCreateDdlFileNameHolder()
- );
- }
-
- private ModifiablePropertyValueModel<String> buildCreateDdlFileNameHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(this.getSubjectHolder(), SchemaGeneration.CREATE_FILE_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getCreateFileName();
- if (name == null) {
- name = CreateDdlFileNameComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setCreateFileName(value);
- }
- };
- }
-
- private String getDefaultValue(SchemaGeneration subject) {
- String defaultValue = subject.getDefaultCreateFileName();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_createDdlFileNameLabel,
- this.buildDefaultCreateDdlFileNameListHolder(),
- this.buildCreateDdlFileNameHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION
- );
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationLocationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationLocationComposite.java
deleted file mode 100644
index 3db55a53bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationLocationComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.FolderChooserComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DdlGenerationLocationComposite
- */
-public class DdlGenerationLocationComposite extends Pane<SchemaGeneration>
-{
- public DdlGenerationLocationComposite(Pane<? extends SchemaGeneration> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- new FolderChooserComboPane<SchemaGeneration>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(
- getSubjectHolder(), SchemaGeneration.APPLICATION_LOCATION_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getApplicationLocation();
- if (name == null) {
- name = defaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (defaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setApplicationLocation(value);
- }
- };
- }
-
- private String defaultValue(SchemaGeneration subject) {
- String defaultValue = subject.getDefaultApplicationLocation();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- else {
- return this.getDefaultString();
- }
- }
-
- @Override
- protected String getDefaultString() {
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_defaultDot;
- }
-
- @Override
- protected String getDialogMessage() {
- return EclipseLinkUiMessages.DdlGenerationLocationComposite_dialogMessage;
- }
-
- @Override
- protected String getDialogTitle() {
- return EclipseLinkUiMessages.DdlGenerationLocationComposite_dialogTitle;
- }
-
- @Override
- protected String getLabelText() {
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_ddlGenerationLocationLabel;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationTypeComposite.java
deleted file mode 100644
index 8f7a65cca8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DdlGenerationTypeComposite.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.schema.generation;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DdlGenerationTypeComposite
- */
-public class DdlGenerationTypeComposite
- extends Pane<SchemaGeneration>
-{
- /**
- * Creates a new <code>DdlGenerationTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public DdlGenerationTypeComposite(
- Pane<? extends SchemaGeneration> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private EnumFormComboViewer<SchemaGeneration, DdlGenerationType> addDdlGenerationTypeCombo(Composite container) {
- return new EnumFormComboViewer<SchemaGeneration, DdlGenerationType>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY);
- }
-
- @Override
- protected DdlGenerationType[] getChoices() {
- return DdlGenerationType.values();
- }
-
- @Override
- protected DdlGenerationType getDefaultValue() {
- return this.getSubject().getDefaultDdlGenerationType();
- }
-
- @Override
- protected String displayString(DdlGenerationType value) {
- switch (value) {
- case create_tables :
- return EclipseLinkUiMessages.DdlGenerationTypeComposite_create_tables;
- case drop_and_create_tables :
- return EclipseLinkUiMessages.DdlGenerationTypeComposite_drop_and_create_tables;
- case none :
- return EclipseLinkUiMessages.DdlGenerationTypeComposite_none;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected DdlGenerationType getValue() {
- return this.getSubject().getDdlGenerationType();
- }
-
- @Override
- protected void setValue(DdlGenerationType value) {
- this.getSubject().setDdlGenerationType(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_ddlGenerationTypeLabel,
- addDdlGenerationTypeCombo( container),
- EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java
deleted file mode 100644
index 528f1d984f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/DropDdlFileNameComposite.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * DropDdlFileNameComposite
- */
-public class DropDdlFileNameComposite extends Pane<SchemaGeneration>
-{
- /**
- * Creates a new <code>DropDdlFileNameComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public DropDdlFileNameComposite(
- Pane<? extends SchemaGeneration> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private PropertyValueModel<String> buildDefaultDropDdlFileNameHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(this.getSubjectHolder(), SchemaGeneration.DEFAULT_SCHEMA_GENERATION_DROP_FILE_NAME) {
- @Override
- protected String buildValue_() {
- return DropDdlFileNameComposite.this.getDefaultValue(subject);
- }
- };
- }
-
- private ListValueModel<String> buildDefaultDropDdlFileNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultDropDdlFileNameHolder()
- );
- }
-
- private ModifiablePropertyValueModel<String> buildDropDdlFileNameHolder() {
- return new PropertyAspectAdapter<SchemaGeneration, String>(this.getSubjectHolder(), SchemaGeneration.DROP_FILE_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = subject.getDropFileName();
- if (name == null) {
- name = DropDdlFileNameComposite.this.getDefaultValue(subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (DropDdlFileNameComposite.this.getDefaultValue(subject).equals(value)) {
- value = null;
- }
- subject.setDropFileName(value);
- }
- };
- }
-
- private String getDefaultValue(SchemaGeneration subject) {
- String defaultValue = subject.getDefaultDropFileName();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_dropDdlFileNameLabel,
- this.buildDefaultDropDdlFileNameListHolder(),
- this.buildDropDdlFileNameHolder(),
- EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION
- );
- SWTUtil.attachDefaultValueHandler(combo);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/EclipseLinkSchemaGenerationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/EclipseLinkSchemaGenerationComposite.java
deleted file mode 100644
index 957ba3c31b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/EclipseLinkSchemaGenerationComposite.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkSchemaGenerationComposite
- */
-public class EclipseLinkSchemaGenerationComposite
- extends Pane<SchemaGeneration>
-{
- public EclipseLinkSchemaGenerationComposite(
- Pane<SchemaGeneration> subjectHolder,
- Composite container) {
- super(subjectHolder, container, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = addSection(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_sectionTitle,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_sectionDescription
- );
-
- // DDL Generation Type:
- new DdlGenerationTypeComposite(this, container);
- // Output Mode:
- new OutputModeComposite(this, container);
- // DDL Generation Location
- new DdlGenerationLocationComposite(this, container);
- // Create DDL File Name:
- new CreateDdlFileNameComposite(this, container);
- // Drop DDL File Name:
- new DropDdlFileNameComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/OutputModeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/OutputModeComposite.java
deleted file mode 100644
index 73aa5054e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/OutputModeComposite.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.schema.generation;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * OutputModeComposite
- */
-public class OutputModeComposite extends Pane<SchemaGeneration>
-{
- /**
- * Creates a new <code>OutputModeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public OutputModeComposite(
- Pane<? extends SchemaGeneration> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private EnumFormComboViewer<SchemaGeneration, OutputMode> addBuildOutputModeCombo(Composite container) {
- return new EnumFormComboViewer<SchemaGeneration, OutputMode>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(SchemaGeneration.OUTPUT_MODE_PROPERTY);
- }
-
- @Override
- protected OutputMode[] getChoices() {
- return OutputMode.values();
- }
-
- @Override
- protected OutputMode getDefaultValue() {
- return this.getSubject().getDefaultOutputMode();
- }
-
- @Override
- protected String displayString(OutputMode value) {
- switch (value) {
- case both :
- return EclipseLinkUiMessages.OutputModeComposite_both;
- case database :
- return EclipseLinkUiMessages.OutputModeComposite_database;
- case sql_script :
- return EclipseLinkUiMessages.OutputModeComposite_sql_script;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected OutputMode getValue() {
- return this.getSubject().getOutputMode();
- }
-
- @Override
- protected void setValue(OutputMode value) {
- this.getSubject().setOutputMode(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addLabeledComposite(
- container,
- EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_outputModeLabel,
- this.addBuildOutputModeCombo(container),
- EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/PersistenceXmlSchemaGenerationTab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/PersistenceXmlSchemaGenerationTab.java
deleted file mode 100644
index cd961341e5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistence/schema/generation/PersistenceXmlSchemaGenerationTab.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.schema.generation;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkHelpContextIds;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlSchemaGenerationTab
- */
-public class PersistenceXmlSchemaGenerationTab
- extends Pane<SchemaGeneration>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- public PersistenceXmlSchemaGenerationTab(
- PropertyValueModel<SchemaGeneration> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkSchemaGenerationComposite(this, container);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return EclipseLinkHelpContextIds.PERSISTENCE_SCHEMA_GENERATION;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return EclipseLinkUiMessages.PersistenceXmlSchemaGenerationTab_title;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistencexml/details/EclipseLinkPersistenceUnitItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistencexml/details/EclipseLinkPersistenceUnitItemContentProvider.java
deleted file mode 100644
index 1163e50266..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/persistencexml/details/EclipseLinkPersistenceUnitItemContentProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.persistencexml.details;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.core.context.MappingFile;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.structure.EclipseLinkPersistenceUnitItemContentProvider.ImpliedEclipseLinkMappingFileRefModel;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.PersistenceUnitItemContentProvider;
-
-/**
- * Item content provider for project explorer.
- */
-public class EclipseLinkPersistenceUnitItemContentProvider
- extends PersistenceUnitItemContentProvider
-{
- public EclipseLinkPersistenceUnitItemContentProvider(EclipseLinkPersistenceUnit persistenceUnit, Manager manager) {
- super(persistenceUnit, manager);
- }
-
- @Override
- protected void addChildrenModelsTo(ArrayList<CollectionValueModel<? extends JpaContextNode>> list) {
- super.addChildrenModelsTo(list);
- // add after the implied mapping file
- list.add(3, this.buildImpliedEclipseLinkMappingFilesModel());
- }
-
-
- // ********** implied EclipseLink mapping file **********
-
- /**
- * No need to filter this list model as it will be empty if the wrapped
- * property model is <code>null</code>.
- */
- protected CollectionValueModel<MappingFile> buildImpliedEclipseLinkMappingFilesModel() {
- return new PropertyCollectionValueModelAdapter<MappingFile>(this.buildImpliedEclipseLinkMappingFileModel());
- }
-
- protected PropertyValueModel<MappingFile> buildImpliedEclipseLinkMappingFileModel() {
- return new ImpliedEclipseLinkMappingFileModel(this.buildImpliedEclipseLinkMappingFileRefModel());
- }
-
- public static class ImpliedEclipseLinkMappingFileModel
- extends PropertyAspectAdapter<MappingFileRef, MappingFile>
- {
- public ImpliedEclipseLinkMappingFileModel(PropertyValueModel<MappingFileRef> refModel) {
- super(refModel, MappingFileRef.MAPPING_FILE_PROPERTY);
- }
- @Override
- protected MappingFile buildValue_() {
- return this.subject.getMappingFile();
- }
- }
-
- protected PropertyValueModel<MappingFileRef> buildImpliedEclipseLinkMappingFileRefModel() {
- return new ImpliedEclipseLinkMappingFileRefModel((EclipseLinkPersistenceUnit) this.item);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/AbstractEclipseLinkJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/AbstractEclipseLinkJpaPlatformUi.java
deleted file mode 100644
index a6c334325e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/AbstractEclipseLinkJpaPlatformUi.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.conversion.java.EclipseLinkJavaConverterConversionWizardPage;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.conversion.java.EclipseLinkJavaGeneratorConversionWizardPage;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.conversion.java.EclipseLinkJavaQueryConversionWizardPage;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.base.AbstractJpaPlatformUi;
-
-public abstract class AbstractEclipseLinkJpaPlatformUi
- extends AbstractJpaPlatformUi
- implements EclipseLinkJpaPlatformUi
-{
- protected AbstractEclipseLinkJpaPlatformUi(
- ItemTreeStateProviderFactoryProvider navigatorFactoryProvider,
- JpaPlatformUiProvider platformUiProvider
- ) {
- super(navigatorFactoryProvider, platformUiProvider);
- }
-
- // ********** metadata conversion **********
-
- public void convertJavaQueryMetadataToGlobal(JpaProject jpaProject) {
- this.openInDialog(new EclipseLinkJavaQueryConversionWizardPage(jpaProject));
- }
-
- public void convertJavaGeneratorMetadataToGlobal(JpaProject jpaProject) {
- this.openInDialog(new EclipseLinkJavaGeneratorConversionWizardPage(jpaProject));
- }
-
- public void convertJavaConverterMetadataToGlobal(JpaProject jpaProject) {
- this.openInDialog(new EclipseLinkJavaConverterConversionWizardPage(jpaProject));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_0JpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_0JpaPlatformUi.java
deleted file mode 100644
index 3cecd98f50..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_0JpaPlatformUi.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen.EclipseLinkDDLGeneratorUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-
-public class EclipseLink1_0JpaPlatformUi
- extends AbstractEclipseLinkJpaPlatformUi
-{
- public EclipseLink1_0JpaPlatformUi(
- ItemTreeStateProviderFactoryProvider navigatorFactoryProvider,
- JpaPlatformUiProvider platformUiProvider
- ) {
- super(navigatorFactoryProvider, platformUiProvider);
- }
-
- // ********** DDL generation **********
-
- public void generateDDL(JpaProject project, IStructuredSelection selection) {
- EclipseLinkDDLGeneratorUi.generate(project);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_1JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_1JpaPlatformUiFactory.java
deleted file mode 100644
index 1be0e52fb6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_1JpaPlatformUiFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-
-public class EclipseLink1_1JpaPlatformUiFactory
- implements JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink1_1JpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink1_0JpaPlatformUi(
- EclipseLinkJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
- EclipseLink1_1JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_1JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_1JpaPlatformUiProvider.java
deleted file mode 100644
index 4adc7691c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_1JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLinkJavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-
-public class EclipseLink1_1JpaPlatformUiProvider
- extends AbstractJpaPlatformUiProvider
-{
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink1_1JpaPlatformUiProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private EclipseLink1_1JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLinkJavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_2JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_2JpaPlatformUiFactory.java
deleted file mode 100644
index 763e3282a1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_2JpaPlatformUiFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-
-public class EclipseLink1_2JpaPlatformUiFactory
- implements JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink1_2JpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink1_0JpaPlatformUi(
- EclipseLinkJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
- EclipseLink1_2JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_2JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_2JpaPlatformUiProvider.java
deleted file mode 100644
index e5a9c557fd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink1_2JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLink1_2JavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_2UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-
-public class EclipseLink1_2JpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink1_2JpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLink1_2JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLink1_2JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUi.java
deleted file mode 100644
index 953afc83c9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUi.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.ddlgen.wizards.EclipseLink2_0DDLGeneratorUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-
-public class EclipseLink2_0JpaPlatformUi
- extends AbstractEclipseLinkJpaPlatformUi
-{
- public EclipseLink2_0JpaPlatformUi(
- ItemTreeStateProviderFactoryProvider navigatorFactoryProvider,
- JpaPlatformUiProvider platformUiProvider
- ) {
- super(navigatorFactoryProvider, platformUiProvider);
- }
-
- // ********** DDL generation **********
-
- public void generateDDL(JpaProject project, IStructuredSelection selection) {
- EclipseLink2_0DDLGeneratorUi.generate(project);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUiFactory.java
deleted file mode 100644
index 8ca8cdbb9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUiFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-
-public class EclipseLink2_0JpaPlatformUiFactory
- implements JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink2_0JpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink2_0JpaPlatformUi(
- EclipseLinkJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
- EclipseLink2_0JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUiProvider.java
deleted file mode 100644
index 1a3ed11365..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_0JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLink2_0JavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_2UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.EclipseLinkPersistenceXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
-
-/**
- * EclipseLink2_0JpaPlatformUiProvider
- */
-public class EclipseLink2_0JpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink2_0JpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLink2_0JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappings2_0DetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappings2_0DetailsProvider.instance());
- }
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLink2_0JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(OrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXml2_0UiDefinition.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_1JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_1JpaPlatformUiFactory.java
deleted file mode 100644
index be41d483ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_1JpaPlatformUiFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-
-public class EclipseLink2_1JpaPlatformUiFactory
- extends EclipseLink2_0JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink2_1JpaPlatformUiFactory() {
- super();
- }
-
- @Override
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink2_0JpaPlatformUi(
- EclipseLinkJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
- EclipseLink2_1JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_1JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_1JpaPlatformUiProvider.java
deleted file mode 100644
index a341f14256..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_1JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLink2_0JavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_2UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.EclipseLinkPersistenceXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
-
-/**
- * EclipseLink2_1JpaPlatformUiProvider
- */
-public class EclipseLink2_1JpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink2_1JpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLink2_1JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappings2_0DetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappings2_0DetailsProvider.instance());
- }
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLink2_0JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(OrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_1UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXml2_0UiDefinition.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_2JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_2JpaPlatformUiFactory.java
deleted file mode 100644
index 7007063acf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_2JpaPlatformUiFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-
-public class EclipseLink2_2JpaPlatformUiFactory
- extends EclipseLink2_0JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink2_2JpaPlatformUiFactory() {
- super();
- }
-
- @Override
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink2_0JpaPlatformUi(
- EclipseLinkJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
- EclipseLink2_2JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_2JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_2JpaPlatformUiProvider.java
deleted file mode 100644
index 74a2f9aab7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_2JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLink2_0JavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_2UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_2UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.EclipseLinkPersistenceXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
-
-/**
- * EclipseLink2_2JpaPlatformUiProvider
- */
-public class EclipseLink2_2JpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink2_2JpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLink2_2JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappings2_0DetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappings2_0DetailsProvider.instance());
- }
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLink2_0JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(OrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_2UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXml2_0UiDefinition.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_3JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_3JpaPlatformUiFactory.java
deleted file mode 100644
index a0271e5b14..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_3JpaPlatformUiFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-
-public class EclipseLink2_3JpaPlatformUiFactory
- extends EclipseLink2_0JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink2_3JpaPlatformUiFactory() {
- super();
- }
-
- @Override
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink2_0JpaPlatformUi(
- EclipseLinkJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
- EclipseLink2_3JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_3JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_3JpaPlatformUiProvider.java
deleted file mode 100644
index f875175ff0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_3JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLink2_3JavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappings2_3DetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_2UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_2UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_3UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.EclipseLinkPersistenceXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
-
-
-public class EclipseLink2_3JpaPlatformUiProvider
- extends AbstractJpaPlatformUiProvider {
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink2_3JpaPlatformUiProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private EclipseLink2_3JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappings2_0DetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappings2_0DetailsProvider.instance());
- providers.add(EclipseLinkEntityMappings2_3DetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLink2_3JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(OrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_2UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_3UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXml2_0UiDefinition.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_4JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_4JpaPlatformUiFactory.java
deleted file mode 100644
index 742d891617..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_4JpaPlatformUiFactory.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-
-public class EclipseLink2_4JpaPlatformUiFactory
- extends EclipseLink2_0JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLink2_4JpaPlatformUiFactory() {
- super();
- }
-
- @Override
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink2_0JpaPlatformUi(
- EclipseLinkJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
- EclipseLink2_4JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_4JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_4JpaPlatformUiProvider.java
deleted file mode 100644
index f236928ee6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLink2_4JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLink2_3JavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappings2_3DetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml1_2UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_1UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_2UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_3UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXml2_4UiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.EclipseLinkPersistenceXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
-
-
-public class EclipseLink2_4JpaPlatformUiProvider
- extends AbstractJpaPlatformUiProvider {
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLink2_4JpaPlatformUiProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private EclipseLink2_4JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappings2_0DetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappings2_0DetailsProvider.instance());
- providers.add(EclipseLinkEntityMappings2_3DetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLink2_3JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(OrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml1_2UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_0UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_1UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_2UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_3UiDefinition.instance());
- definitions.add(EclipseLinkOrmXml2_4UiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXml2_0UiDefinition.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUi.java
deleted file mode 100644
index eebfb76392..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUi.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-
-public interface EclipseLinkJpaPlatformUi
- extends JpaPlatformUi
-{
- void convertJavaConverterMetadataToGlobal(JpaProject jpaProject);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiFactory.java
deleted file mode 100644
index d52c28990f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiFactory.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericNavigatorItemLabelProviderFactory;
-
-public class EclipseLinkJpaPlatformUiFactory
- implements JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public EclipseLinkJpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new EclipseLink1_0JpaPlatformUi(
- NAVIGATOR_FACTORY_PROVIDER,
- EclipseLinkJpaPlatformUiProvider.instance()
- );
- }
-
- public static final ItemTreeStateProviderFactoryProvider NAVIGATOR_FACTORY_PROVIDER =
- new SimpleItemTreeStateProviderFactoryProvider(
- EclipseLinkNavigatorItemContentProviderFactory.instance(),
- GenericNavigatorItemLabelProviderFactory.instance()
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiProvider.java
deleted file mode 100644
index d5614514e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkJpaPlatformUiProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.java.EclipseLinkJavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkEntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.details.orm.EclipseLinkOrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-
-public class EclipseLinkJpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new EclipseLinkJpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private EclipseLinkJpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EclipseLinkEntityMappingsDetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(EclipseLinkJavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkOrmXmlUiDefinition.instance());
- definitions.add(EclipseLinkPersistenceXmlUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkNavigatorItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkNavigatorItemContentProviderFactory.java
deleted file mode 100644
index bdc48a5057..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/platform/EclipseLinkNavigatorItemContentProviderFactory.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.platform;
-
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistencexml.details.EclipseLinkPersistenceUnitItemContentProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericNavigatorItemContentProviderFactory;
-
-public class EclipseLinkNavigatorItemContentProviderFactory
- extends GenericNavigatorItemContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new EclipseLinkNavigatorItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected EclipseLinkNavigatorItemContentProviderFactory() {
- super();
- }
-
- @Override
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof EclipseLinkPersistenceUnit) {
- return new EclipseLinkPersistenceUnitItemContentProvider((EclipseLinkPersistenceUnit) item, manager);
- }
- return super.buildProvider(item, manager);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceStructureItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceStructureItemContentProviderFactory.java
deleted file mode 100644
index 8d6ce1855c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceStructureItemContentProviderFactory.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceStructureItemContentProviderFactory;
-
-public class EclipseLinkPersistenceStructureItemContentProviderFactory
- extends PersistenceStructureItemContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new EclipseLinkPersistenceStructureItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected EclipseLinkPersistenceStructureItemContentProviderFactory() {
- super();
- }
-
- @Override
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof EclipseLinkPersistenceUnit) {
- return new EclipseLinkPersistenceUnitItemContentProvider((EclipseLinkPersistenceUnit) item, manager);
- }
- return super.buildProvider(item, manager);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceUnitItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceUnitItemContentProvider.java
deleted file mode 100644
index ea9cbd8924..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/structure/EclipseLinkPersistenceUnitItemContentProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.structure;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider;
-
-/**
- * Item content provider for structure view.
- */
-public class EclipseLinkPersistenceUnitItemContentProvider
- extends PersistenceUnitItemContentProvider
-{
- public EclipseLinkPersistenceUnitItemContentProvider(EclipseLinkPersistenceUnit persistenceUnit, Manager manager) {
- super(persistenceUnit, manager);
- }
- @Override
- protected void addChildrenModelsTo(ArrayList<ListValueModel<? extends JpaStructureNode>> list) {
- super.addChildrenModelsTo(list);
- // add after the implied mapping file
- list.add(3, this.buildImpliedEclipseLinkMappingFileRefsModel());
- }
-
- protected ListValueModel<MappingFileRef> buildImpliedEclipseLinkMappingFileRefsModel() {
- return new PropertyListValueModelAdapter<MappingFileRef>(this.buildImpliedEclipseLinkMappingFileRefModel());
- }
-
- protected PropertyValueModel<MappingFileRef> buildImpliedEclipseLinkMappingFileRefModel() {
- return new ImpliedEclipseLinkMappingFileRefModel((EclipseLinkPersistenceUnit) this.item);
- }
-
- public static class ImpliedEclipseLinkMappingFileRefModel
- extends PropertyAspectAdapter<EclipseLinkPersistenceUnit, MappingFileRef>
- {
- public ImpliedEclipseLinkMappingFileRefModel(EclipseLinkPersistenceUnit persistenceUnit) {
- super(EclipseLinkPersistenceUnit.IMPLIED_ECLIPSELINK_MAPPING_FILE_REF_PROPERTY, persistenceUnit);
- }
- @Override
- protected MappingFileRef buildValue_() {
- return this.subject.getImpliedEclipseLinkMappingFileRef();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLink2_0PersistenceXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLink2_0PersistenceXmlUiFactory.java
deleted file mode 100644
index 66109843f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLink2_0PersistenceXmlUiFactory.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiFactory;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching.PersistenceXmlCachingTab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization.PersistenceXmlCustomizationTab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging.PersistenceXmlLoggingTab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options.PersistenceXmlOptionsTab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.caching.PersistenceXmlCaching2_0Tab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.customization.PersistenceXmlCustomization2_0Tab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.logging.PersistenceXmlLogging2_0Tab;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.options.PersistenceXmlOptions2_0Tab;
-import org.eclipse.swt.widgets.Composite;
-
-public class EclipseLink2_0PersistenceXmlUiFactory extends EclipseLinkPersistenceXmlUiFactory
-{
- // ********** constructors **********
-
- public EclipseLink2_0PersistenceXmlUiFactory() {
- super();
- }
-
- // ********** persistence unit tabs **********
-
- @Override
- protected PersistenceXmlCustomizationTab<Customization> buildCustomizationTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Customization> customizationHolder = this.buildCustomizationHolder(subjectHolder);
-
- return new PersistenceXmlCustomization2_0Tab(customizationHolder, parent, widgetFactory);
- }
-
- @Override
- protected PersistenceXmlCachingTab<Caching> buildCachingTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Caching> cachingHolder = this.buildCachingHolder(subjectHolder);
-
- return new PersistenceXmlCaching2_0Tab(cachingHolder, parent, widgetFactory);
- }
-
- @Override
- protected PersistenceXmlLoggingTab<? extends Logging2_0> buildLoggingTab(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Logging2_0> logging2_0Holder = this.buildLogging2_0Holder(subjectHolder);
-
- return new PersistenceXmlLogging2_0Tab(logging2_0Holder, parent, widgetFactory);
- }
-
- @Override
- protected PersistenceXmlOptionsTab<Options2_0> buildOptionsTab(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- PropertyValueModel<Options2_0> options2_0Holder = this.buildOptions2_0Holder(subjectHolder);
-
- return new PersistenceXmlOptions2_0Tab(options2_0Holder, parent, widgetFactory);
- }
-
- // ********** private methods **********
-
- private PropertyValueModel<Logging2_0> buildLogging2_0Holder(
- PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<EclipseLinkPersistenceUnit, Logging2_0>(subjectHolder) {
- @Override
- protected Logging2_0 transform_(EclipseLinkPersistenceUnit value) {
-
- return (Logging2_0) value.getLogging();
- }
- };
- }
-
- private PropertyValueModel<Options2_0> buildOptions2_0Holder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, Options2_0>(subjectHolder) {
- @Override
- protected Options2_0 transform_(PersistenceUnit value) {
-
- return (Options2_0) ((PersistenceUnit2_0)value).getOptions();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java
deleted file mode 100644
index df03c31cdf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/EclipseLinkPersistenceXml2_0UiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.EclipseLinkPersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.AbstractPersistenceXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiFactory;
-
-public class EclipseLinkPersistenceXml2_0UiDefinition
- extends AbstractPersistenceXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new EclipseLinkPersistenceXml2_0UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EclipseLinkPersistenceXml2_0UiDefinition() {
- super();
- }
-
-
- @Override
- protected PersistenceXmlUiFactory buildPersistenceXmlUiFactory() {
- return new EclipseLink2_0PersistenceXmlUiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return EclipseLinkPersistenceXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/CacheDefaults2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/CacheDefaults2_0Composite.java
deleted file mode 100644
index 9e9136a970..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/CacheDefaults2_0Composite.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.caching;
-
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching.CacheDefaultsComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching.DefaultCacheSizeComposite;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching.DefaultCacheTypeComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * CacheDefaults2_0Composite
- */
-public class CacheDefaults2_0Composite extends CacheDefaultsComposite<Caching>
-{
- public CacheDefaults2_0Composite(Pane<Caching> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.initializeCacheDefaultsComposites(parent);
- this.installPaneEnabler();
- }
-
- @Override
- protected void initializeCacheDefaultsComposites(Composite parent) {
-
- // Default Cache Type
- new DefaultCacheTypeComposite(this, parent);
-
- // Default Cache Size
- new DefaultCacheSizeComposite<Caching>(this, parent);
-
- }
-
- // ********** private methods **********
-
- private void installPaneEnabler() {
- new PaneEnabler(this.buildPaneEnablerHolder(), this);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<SharedCacheMode, Boolean>(this.buildSharedCacheModeHolder()) {
- @Override
- protected Boolean transform(SharedCacheMode value) {
- return value != SharedCacheMode.NONE;
- }
- };
- }
-
- private PropertyValueModel<SharedCacheMode> buildSharedCacheModeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit2_0, SharedCacheMode>(
- this.buildPersistenceUnit2_0Holder(),
- PersistenceUnit2_0.SPECIFIED_SHARED_CACHE_MODE_PROPERTY,
- PersistenceUnit2_0.DEFAULT_SHARED_CACHE_MODE_PROPERTY) {
- @Override
- protected SharedCacheMode buildValue_() {
- return this.subject.getSharedCacheMode();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit2_0> buildPersistenceUnit2_0Holder() {
- return new PropertyAspectAdapter<Caching, PersistenceUnit2_0>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit2_0 buildValue_() {
- return (PersistenceUnit2_0) this.subject.getPersistenceUnit();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/EclipseLinkCaching2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/EclipseLinkCaching2_0Composite.java
deleted file mode 100644
index 14bb1e1d7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/EclipseLinkCaching2_0Composite.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.caching;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching.EclipseLinkCachingComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options.SharedCacheModeComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * EclipseLinkCaching2_0Composite
- */
-public class EclipseLinkCaching2_0Composite extends EclipseLinkCachingComposite<Caching>
-{
- public EclipseLinkCaching2_0Composite(
- Pane<Caching> subjectHolder,
- Composite container) {
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- Section section = getWidgetFactory().createSection(parent, SWT.FLAT | ExpandableComposite.TITLE_BAR | Section.DESCRIPTION);
- section.setText(EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionTitle);
- section.setDescription(EclipseLinkUiMessages.PersistenceXmlCachingTab_sectionDescription);
- Composite composite = getWidgetFactory().createComposite(section);
- composite.setLayout(new GridLayout(1, false));
- section.setClient(composite);
- this.updateGridData(composite);
- this.updateGridData(composite.getParent());
-
- // SharedCacheMode
- new SharedCacheModeComposite(this, this.buildPersistenceUnit2_0Holder(), composite);
- // Defaults
- new CacheDefaults2_0Composite(this, composite);
- // Flush Clear Cache
- new FlushClearCache2_0Composite(this, composite);
- }
-
- private PropertyValueModel<PersistenceUnit2_0> buildPersistenceUnit2_0Holder() {
- return new PropertyAspectAdapter<Caching, PersistenceUnit2_0>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit2_0 buildValue_() {
- return (PersistenceUnit2_0) this.subject.getPersistenceUnit();
- }
- };
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/FlushClearCache2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/FlushClearCache2_0Composite.java
deleted file mode 100644
index 3b528f6142..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/FlushClearCache2_0Composite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.caching;
-
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching.FlushClearCacheComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * FlushClearCache2_0Composite
- */
-public class FlushClearCache2_0Composite extends FlushClearCacheComposite
-{
- /**
- * Creates a new <code>FlushClearCache2_0Composite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public FlushClearCache2_0Composite(
- Pane<? extends Caching> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- super.initializeLayout(parent);
-
- this.installPaneEnabler();
- }
-
- // ********** private methods **********
-
- private void installPaneEnabler() {
- new PaneEnabler(this.buildPaneEnablerHolder(), this);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<SharedCacheMode, Boolean>(this.buildSharedCacheModeHolder()) {
- @Override
- protected Boolean transform(SharedCacheMode value) {
- return value != SharedCacheMode.NONE;
- }
- };
- }
-
- private PropertyValueModel<SharedCacheMode> buildSharedCacheModeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit2_0, SharedCacheMode>(
- this.buildPersistenceUnit2_0Holder(),
- PersistenceUnit2_0.SPECIFIED_SHARED_CACHE_MODE_PROPERTY,
- PersistenceUnit2_0.DEFAULT_SHARED_CACHE_MODE_PROPERTY) {
- @Override
- protected SharedCacheMode buildValue_() {
- return this.subject.getSharedCacheMode();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit2_0> buildPersistenceUnit2_0Holder() {
- return new PropertyAspectAdapter<Caching, PersistenceUnit2_0>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit2_0 buildValue_() {
- return (PersistenceUnit2_0) this.subject.getPersistenceUnit();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/PersistenceXmlCaching2_0Tab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/PersistenceXmlCaching2_0Tab.java
deleted file mode 100644
index 116dc65da4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/caching/PersistenceXmlCaching2_0Tab.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.caching;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.caching.PersistenceXmlCachingTab;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlCaching2_0Tab
- */
-public class PersistenceXmlCaching2_0Tab extends PersistenceXmlCachingTab<Caching>
-{
- public PersistenceXmlCaching2_0Tab(
- PropertyValueModel<Caching> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- new EclipseLinkCaching2_0Composite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/customization/EclipseLinkCustomization2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/customization/EclipseLinkCustomization2_0Composite.java
deleted file mode 100644
index ce0de967b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/customization/EclipseLinkCustomization2_0Composite.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.customization;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization.EclipseLinkCustomizationComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkCustomization2_0Composite
- */
-public class EclipseLinkCustomization2_0Composite extends EclipseLinkCustomizationComposite<Customization>
-{
- public EclipseLinkCustomization2_0Composite(
- Pane<Customization> subjectHolder,
- Composite container) {
- super(subjectHolder, container);
- }
-
- @Override
- protected void buildEntityListComposite(Composite parent) {
- // do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/customization/PersistenceXmlCustomization2_0Tab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/customization/PersistenceXmlCustomization2_0Tab.java
deleted file mode 100644
index 83db6df75a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/customization/PersistenceXmlCustomization2_0Tab.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.customization;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.customization.PersistenceXmlCustomizationTab;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlCustomization2_0Tab
- */
-public class PersistenceXmlCustomization2_0Tab extends PersistenceXmlCustomizationTab<Customization>
-{
- public PersistenceXmlCustomization2_0Tab(
- PropertyValueModel<Customization> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void buildEclipseLinkCustomizationComposite(Composite container) {
- new EclipseLinkCustomization2_0Composite(this, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java
deleted file mode 100644
index c2210f96f9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/ConnectionComposite.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.logging;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ConnectionComposite
- */
-public class ConnectionComposite extends Pane<Logging2_0>
-{
- /**
- * Creates a new <code>ConnectionComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ConnectionComposite(
- Pane<? extends Logging2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLabel,
- this.buildConnectionHolder(),
- this.buildConnectionStringHolder(),
- null
-// EclipseLinkHelpContextIds.PERSISTENCE_LOGGING_CONNECTION // TODO
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildConnectionHolder() {
- return new PropertyAspectAdapter<Logging2_0, Boolean>(getSubjectHolder(), Logging2_0.CONNECTION_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getConnection();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setConnection(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildConnectionStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(this.buildDefaultConnectionHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLabelDefault, defaultStringValue);
- }
- return EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultConnectionHolder() {
- return new PropertyAspectAdapter<Logging2_0, Boolean>(
- getSubjectHolder(),
- Logging2_0.CONNECTION_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getConnection() != null) {
- return null;
- }
- return this.subject.getDefaultConnection();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkCategoryLoggingLevelComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkCategoryLoggingLevelComposite.java
deleted file mode 100644
index 5192b28283..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkCategoryLoggingLevelComposite.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.logging;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkCategoryLoggingLevelComposite
- */
-public class EclipseLinkCategoryLoggingLevelComposite extends Pane<Logging2_0>
-{
-
- /**
- * Creates a new <code>EclipseLinkCategoryLoggingLevelComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public EclipseLinkCategoryLoggingLevelComposite(
- Pane<Logging2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.SQL_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_sqlLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.TRANSACTION_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.EVENT_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_eventLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.CONNECTION_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_connectionLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.QUERY_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_queryLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.CACHE_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_cacheLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.PROPAGATION_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_propagationLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.SEQUENCING_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_sequencingLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.EJB_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_ejbLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.DMS_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_dmsLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_ejb_or_metadataLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.METAMODEL_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_jpa_metamodelLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.WEAVER_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_weaverLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.PROPERTIES_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_propertiesLoggingLevelLabel);
-
- new CategoryLoggingLevelComboViewer(this, parent, Logging2_0.SERVER_CATEGORY_LOGGING_PROPERTY, EclipseLinkUiMessages.PersistenceXmlLoggingTab_serverLoggingLevelLabel);
- }
-
-
-
- private class CategoryLoggingLevelComboViewer extends Pane<Logging2_0>
- {
- private static final String DEFAULT_PROPERTY = Logging2_0.CATEGORIES_DEFAULT_LOGGING_PROPERTY;
- final private String category;
- final private String labelString;
-
- /**
- * Creates a new <code>CategoryLoggingLevelComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public CategoryLoggingLevelComboViewer(
- Pane<? extends Logging2_0> parentComposite,
- Composite parent,
- String property,
- String labelString) {
- super(parentComposite, parent);
-
- this.category = property;
- this.labelString = labelString;
- initializeLayout2(this.getControl());
- }
-
- private EnumFormComboViewer<Logging2_0, LoggingLevel> addLoggingLevelCombo(Composite container) {
- return new EnumFormComboViewer<Logging2_0, LoggingLevel>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(DEFAULT_PROPERTY);
- propertyNames.add(Logging2_0.SQL_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.TRANSACTION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.EVENT_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.CONNECTION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.QUERY_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.CACHE_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.PROPAGATION_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.SEQUENCING_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.EJB_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.DMS_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.METAMODEL_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.WEAVER_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.PROPERTIES_CATEGORY_LOGGING_PROPERTY);
- propertyNames.add(Logging2_0.SERVER_CATEGORY_LOGGING_PROPERTY);
- }
-
- @Override
- protected LoggingLevel[] getChoices() {
- return LoggingLevel.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected LoggingLevel getDefaultValue() {
- return this.getSubject().getCategoriesDefaultLevel();
- }
-
- @Override
- protected String displayString(LoggingLevel value) {
- switch (value) {
- case all :
- return EclipseLinkUiMessages.EclipseLinkCategoryLoggingLevelComposite_all;
- case config :
- return EclipseLinkUiMessages.EclipseLinkCategoryLoggingLevelComposite_config;
- case fine :
- return EclipseLinkUiMessages.EclipseLinkCategoryLoggingLevelComposite_fine;
- case finer :
- return EclipseLinkUiMessages.EclipseLinkCategoryLoggingLevelComposite_finer;
- case finest :
- return EclipseLinkUiMessages.EclipseLinkCategoryLoggingLevelComposite_finest;
- case info :
- return EclipseLinkUiMessages.EclipseLinkCategoryLoggingLevelComposite_info;
- case off :
- return EclipseLinkUiMessages.EclipseLinkCategoryLoggingLevelComposite_off;
- case severe :
- return EclipseLinkUiMessages.EclipseLinkCategoryLoggingLevelComposite_severe;
- case warning :
- return EclipseLinkUiMessages.EclipseLinkCategoryLoggingLevelComposite_warning;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected LoggingLevel getValue() {
- return this.getSubject().getLevel(category);
- }
-
- @Override
- protected void setValue(LoggingLevel value) {
- this.getSubject().setLevel(category, value);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- if( propertyName != category && propertyName != DEFAULT_PROPERTY) return;
- super.propertyChanged(propertyName);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // see initializeLayout2
- }
-
- protected void initializeLayout2(Composite parent) {
- this.addLabeledComposite(
- parent,
- this.labelString,
- this.addLoggingLevelCombo(parent),
- null // TODO
- );
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java
deleted file mode 100644
index 7503618004..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/EclipseLinkLogging2_0Composite.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.logging;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging.EclipseLinkLoggingComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkLogging2_0Composite
- */
-public class EclipseLinkLogging2_0Composite extends EclipseLinkLoggingComposite<Logging2_0>
-{
-
- public EclipseLinkLogging2_0Composite(
- Pane<Logging2_0> subjectHolder,
- Composite container) {
- super(subjectHolder, container);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- super.initializeLayout(parent);
-
- Composite categoryLoggingSection = this.addCollapsibleSubSection(
- this.addSubPane(parent, 0, 16),
- EclipseLinkUiMessages.PersistenceXmlLoggingTab_categoryLoggingLevelSectionTitle,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
-
- this.addCategoryLoggingLevelComposite(categoryLoggingSection);
- }
-
- protected void addCategoryLoggingLevelComposite(Composite parent) {
- new EclipseLinkCategoryLoggingLevelComposite(this, parent);
- }
-
- @Override
- protected void logPropertiesComposite(Composite parent) {
- super.logPropertiesComposite(parent);
-
- // Connection:
- new ConnectionComposite(this, parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/PersistenceXmlLogging2_0Tab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/PersistenceXmlLogging2_0Tab.java
deleted file mode 100644
index ec4bc98e30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/logging/PersistenceXmlLogging2_0Tab.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.logging;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.logging.PersistenceXmlLoggingTab;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlLogging2_0Tab
- */
-public class PersistenceXmlLogging2_0Tab extends PersistenceXmlLoggingTab<Logging2_0>
-{
- // ********** constructors/initialization **********
- public PersistenceXmlLogging2_0Tab(
- PropertyValueModel<Logging2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkLogging2_0Composite(this, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/EclipseLinkOptions2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/EclipseLinkOptions2_0Composite.java
deleted file mode 100644
index 4f52bbd266..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/EclipseLinkOptions2_0Composite.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options.EclipseLinkOptionsComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EclipseLinkOptions2_0Composite
- */
-public class EclipseLinkOptions2_0Composite extends EclipseLinkOptionsComposite<Options2_0>
-{
- public EclipseLinkOptions2_0Composite(
- Pane<Options2_0> subjectHolder,
- Composite container) {
- super(subjectHolder, container);
- }
-
- @Override
- protected Composite initializeMiscellaneousPane(Composite container) {
- Composite composite = super.initializeMiscellaneousPane(container);
-
- new LockingConfigurationComposite(this, composite);
- new QueryConfigurationComposite(this, composite);
- new ValidationConfigurationComposite(this, composite);
- return composite;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/LockingConfigurationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/LockingConfigurationComposite.java
deleted file mode 100644
index 19656f8129..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/LockingConfigurationComposite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * LockingConfigurationComposite
- */
-public class LockingConfigurationComposite extends Pane<Options2_0>
-{
- /**
- * Creates a new <code>LockingConfigurationComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public LockingConfigurationComposite(
- Pane<Options2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addLockTimeoutCombo(container);
- }
-
- private void addLockTimeoutCombo(Composite container) {
- new IntegerCombo<Options2_0>(this, container) {
-
- @Override
- protected String getLabelText() {
- return JptUiPersistence2_0Messages.LockingConfigurationComposite_lockTimeoutLabel;
- }
-
- @Override
- protected String getHelpId() {
- return null; // TODO
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Options2_0, Integer>(this.getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultLockTimeout();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Options2_0, Integer>(this.getSubjectHolder(), Options2_0.LOCK_TIMEOUT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getLockTimeout();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setLockTimeout(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/PersistenceXmlOptions2_0Tab.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/PersistenceXmlOptions2_0Tab.java
deleted file mode 100644
index 8a556e1169..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/PersistenceXmlOptions2_0Tab.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.persistence.options.PersistenceXmlOptionsTab;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * PersistenceXmlOptions2_0Tab
- */
-public class PersistenceXmlOptions2_0Tab extends PersistenceXmlOptionsTab<Options2_0>
-{
- // ********** constructors/initialization **********
- public PersistenceXmlOptions2_0Tab(
- PropertyValueModel<Options2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new EclipseLinkOptions2_0Composite(this, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/QueryConfigurationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/QueryConfigurationComposite.java
deleted file mode 100644
index 994dc7bc6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/QueryConfigurationComposite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * QueryConfigurationComposite
- */
-public class QueryConfigurationComposite extends Pane<Options2_0>
-{
- /**
- * Creates a new <code>QueryConfigurationComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public QueryConfigurationComposite(
- Pane<Options2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addQueryTimeoutCombo(container);
- }
-
- private void addQueryTimeoutCombo(Composite container) {
- new IntegerCombo<Options2_0>(this, container) {
-
- @Override
- protected String getLabelText() {
- return JptUiPersistence2_0Messages.QueryConfigurationComposite_queryTimeoutLabel;
- }
-
- @Override
- protected String getHelpId() {
- return null; // TODO
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Options2_0, Integer>(this.getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultQueryTimeout();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Options2_0, Integer>(this.getSubjectHolder(), Options2_0.QUERY_TIMEOUT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getQueryTimeout();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setQueryTimeout(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/ValidationConfigurationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/ValidationConfigurationComposite.java
deleted file mode 100644
index d7847c4ce3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/ValidationConfigurationComposite.java
+++ /dev/null
@@ -1,382 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.options;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiPlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * ValidationConfigurationComposite
- */
-public class ValidationConfigurationComposite extends Pane<Options2_0>
-{
- /**
- * Creates a new <code>ValidationGroupComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidationConfigurationComposite(
- Pane<Options2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- // ValidationMode
- new ValidationModeComposite(this, this.buildPersistenceUnit2_0Holder(), parent);
-
- // ValidationGroupPrePersist
- this.addGroupPrePersistListPane(parent);
-
- // ValidationGroupPreUpdate
- this.addGroupPreUpdateListPane(parent);
-
- // ValidationGroupPreRemove
- this.addGroupPreRemoveListPane(parent);
- }
-
- // ********** ValidationGroupPrePersists **********
-
- private void addGroupPrePersistListPane(Composite parent) {
-
- this.addLabeledComposite(parent,
- JptUiPersistence2_0Messages.ValidationConfigurationComposite_groupPrePersistLabel,
- this.addPrePersistListPane(parent),
- null // TODO Help
- );
- }
-
- private AddRemoveListPane<Options2_0> addPrePersistListPane(Composite parent) {
-
- // List pane
- AddRemoveListPane<Options2_0> listPane = new AddRemoveListPane<Options2_0>(
- this,
- parent,
- this.buildPrePersistAdapter(),
- this.buildPrePersistListHolder(),
- this.buildSelectedItemHolder(),
- this.buildLabelProvider()
- )
- {
- @Override
- protected void initializeTable(Table table) {
- super.initializeTable(table);
-
- Composite container = table.getParent();
- GridData gridData = (GridData) container.getLayoutData();
- gridData.heightHint = 75;
- }
- };
- return listPane;
- }
-
- private Adapter buildPrePersistAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPrePersistClass(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeValidationGroupPrePersist((String) item);
- }
- }
- };
- }
-
- private ListValueModel<String> buildPrePersistListHolder() {
- return new ListAspectAdapter<Options2_0, String>(getSubjectHolder(), Options2_0.VALIDATION_GROUP_PRE_PERSIST_LIST) {
- @Override
- protected ListIterable<String> getListIterable() {
- return subject.getValidationGroupPrePersists();
- }
-
- @Override
- protected int size_() {
- return subject.getValidationGroupPrePersistsSize();
- }
- };
- }
-
- private void addPrePersistClass(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName('$');
- if( ! this.getSubject().validationGroupPrePersistExists(className)) {
-
- String classRef = this.getSubject().addValidationGroupPrePersist(className);
- listSelectionModel.setSelectedValue(classRef);
- }
- }
- }
-
- // ********** ValidationGroupPreUpdates **********
-
- private void addGroupPreUpdateListPane(Composite parent) {
-
- this.addLabeledComposite(parent,
- JptUiPersistence2_0Messages.ValidationConfigurationComposite_groupPreUpdateLabel,
- this.addPreUpdateListPane(parent),
- null // TODO Help
- );
- }
-
- private AddRemoveListPane<Options2_0> addPreUpdateListPane(Composite parent) {
-
- // List pane
- AddRemoveListPane<Options2_0> listPane = new AddRemoveListPane<Options2_0>(
- this,
- parent,
- this.buildPreUpdateAdapter(),
- this.buildPreUpdateListHolder(),
- this.buildSelectedItemHolder(),
- this.buildLabelProvider()
- )
- {
- @Override
- protected void initializeTable(Table table) {
- super.initializeTable(table);
-
- Composite container = table.getParent();
- GridData gridData = (GridData) container.getLayoutData();
- gridData.heightHint = 75;
- }
- };
- return listPane;
- }
-
- private Adapter buildPreUpdateAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPreUpdateClass(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeValidationGroupPreUpdate((String) item);
- }
- }
- };
- }
-
- private ListValueModel<String> buildPreUpdateListHolder() {
- return new ListAspectAdapter<Options2_0, String>(getSubjectHolder(), Options2_0.VALIDATION_GROUP_PRE_UPDATE_LIST) {
- @Override
- protected ListIterable<String> getListIterable() {
- return subject.getValidationGroupPreUpdates();
- }
-
- @Override
- protected int size_() {
- return subject.getValidationGroupPreUpdatesSize();
- }
- };
- }
-
- private void addPreUpdateClass(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName('$');
- if( ! this.getSubject().validationGroupPreUpdateExists(className)) {
-
- String classRef = this.getSubject().addValidationGroupPreUpdate(className);
- listSelectionModel.setSelectedValue(classRef);
- }
- }
- }
-
- // ********** ValidationGroupPreRemoves **********
-
- private void addGroupPreRemoveListPane(Composite parent) {
-
- this.addLabeledComposite(parent,
- JptUiPersistence2_0Messages.ValidationConfigurationComposite_groupPreRemoveLabel,
- this.addPreRemoveListPane(parent),
- null // TODO Help
- );
- }
-
- private AddRemoveListPane<Options2_0> addPreRemoveListPane(Composite parent) {
-
- // List pane
- AddRemoveListPane<Options2_0> listPane = new AddRemoveListPane<Options2_0>(
- this,
- parent,
- this.buildPreRemoveAdapter(),
- this.buildPreRemoveListHolder(),
- this.buildSelectedItemHolder(),
- this.buildLabelProvider()
- )
- {
- @Override
- protected void initializeTable(Table table) {
- super.initializeTable(table);
-
- Composite container = table.getParent();
- GridData gridData = (GridData) container.getLayoutData();
- gridData.heightHint = 75;
- }
- };
- return listPane;
- }
-
- private Adapter buildPreRemoveAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPreRemoveClass(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeValidationGroupPreRemove((String) item);
- }
- }
- };
- }
-
- private ListValueModel<String> buildPreRemoveListHolder() {
- return new ListAspectAdapter<Options2_0, String>(getSubjectHolder(), Options2_0.VALIDATION_GROUP_PRE_REMOVE_LIST) {
- @Override
- protected ListIterable<String> getListIterable() {
- return subject.getValidationGroupPreRemoves();
- }
-
- @Override
- protected int size_() {
- return subject.getValidationGroupPreRemovesSize();
- }
- };
- }
-
- private void addPreRemoveClass(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName('$');
- if( ! this.getSubject().validationGroupPreRemoveExists(className)) {
-
- String classRef = this.getSubject().addValidationGroupPreRemove(className);
- listSelectionModel.setSelectedValue(classRef);
- }
- }
- }
-
-
- // ********** Private methods **********
-
- private ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
-
- @Override
- public String getText(Object element) {
- String name = (String) element;
-
- if (name == null) {
- name = EclipseLinkUiMessages.PersistenceXmlOptionsTab_noName;
- }
- return name;
- }
- };
- }
-
- /**
- * Prompts the user the Open Type dialog.
- *
- * @return Either the selected type or <code>null</code> if the user
- * canceled the dialog
- */
- private IType chooseType() {
- IJavaProject javaProject = this.getSubject().getJpaProject().getJavaProject();
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- ""
- );
- }
- catch (JavaModelException e) {
- JptJpaEclipseLinkUiPlugin.log(e);
- return null;
- }
-
- typeSelectionDialog.setTitle(JptCommonUiMessages.ClassChooserPane_dialogTitle);
- typeSelectionDialog.setMessage(JptCommonUiMessages.ClassChooserPane_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
-
- return null;
- }
-
- private ModifiablePropertyValueModel<String> buildSelectedItemHolder() {
- return new SimplePropertyValueModel<String>();
- }
-
- private PropertyValueModel<PersistenceUnit2_0> buildPersistenceUnit2_0Holder() {
- return new TransformationPropertyValueModel<Options2_0, PersistenceUnit2_0>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit2_0 transform_(Options2_0 value) {
- return (PersistenceUnit2_0) value.getPersistenceUnit();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/ValidationModeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/ValidationModeComposite.java
deleted file mode 100644
index d8623bd0c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/v2_0/persistence/options/ValidationModeComposite.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.v2_0.persistence.options;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.ValidationMode;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ValidationModeComposite
- */
-public class ValidationModeComposite extends Pane<PersistenceUnit2_0>
-{
- /**
- * Creates a new <code>ValidationModeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidationModeComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends PersistenceUnit2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.addLabeledComposite(
- parent,
- JptUiPersistence2_0Messages.ValidationModeComposite_validationModeLabel,
- this.addValidationModeCombo(parent),
- null // TODO
- );
- }
-
- private EnumFormComboViewer<PersistenceUnit2_0, ValidationMode> addValidationModeCombo(Composite parent) {
-
- return new EnumFormComboViewer<PersistenceUnit2_0, ValidationMode>(this, this.getSubjectHolder(), parent) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnit2_0.SPECIFIED_VALIDATION_MODE_PROPERTY);
- }
-
- @Override
- protected ValidationMode[] getChoices() {
- return ValidationMode.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected ValidationMode getDefaultValue() {
- return this.getSubject().getDefaultValidationMode();
- }
-
- @Override
- protected String displayString(ValidationMode value) {
- switch (value) {
- case AUTO :
- return JptUiPersistence2_0Messages.ValidationModeComposite_auto;
- case CALLBACK :
- return JptUiPersistence2_0Messages.ValidationModeComposite_callback;
- case NONE :
- return JptUiPersistence2_0Messages.ValidationModeComposite_none;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected ValidationMode getValue() {
- return this.getSubject().getSpecifiedValidationMode();
- }
-
- @Override
- protected void setValue(ValidationMode value) {
- this.getSubject().setSpecifiedValidationMode(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/weave/EclipselinkPreferencePage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/weave/EclipselinkPreferencePage.java
deleted file mode 100644
index 1c684cdd58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/weave/EclipselinkPreferencePage.java
+++ /dev/null
@@ -1,498 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.weave;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.eclipselink.core.builder.StaticWeavingBuilderConfigurator;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.DirectoryDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-public class EclipselinkPreferencePage extends PropertyPage {
-
- private StaticWeavingBuilderConfigurator configurator;
- private StaticWeavingComposite staticWeavingComposite;
-
- // ********** constructors **********
-
- public EclipselinkPreferencePage() {
- super();
- setDescription(EclipseLinkUiMessages.EclipselinkPreferencePage_description);
- }
-
- // ********** overrides **********
-
- @Override
- public boolean performOk() {
- super.performOk();
-
- if(this.staticWeaveClasses()) {
- if( ! this.projectHasStaticWeavingBuilder()) {
- this.configurator.addBuilder();
- }
- this.updateProjectStaticWeavingPreferences();
- }
- else {
- this.configurator.removeBuilder();
- this.removeProjectStaticWeavingPreferences();
- }
- return true;
- }
-
- @Override
- protected Control createContents(Composite parent) {
- this.configurator = new StaticWeavingBuilderConfigurator(this.getProject());
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.noDefaultAndApplyButton();
- this.staticWeavingComposite = new StaticWeavingComposite(composite);
-
- return composite;
- }
-
- // ********** preferences **********
-
- private void updateProjectStaticWeavingPreferences() {
- String location = StringTools.stringIsEmpty(this.getSourceFolder()) ? this.getDefaultSource() : this.getSourceFolder();
- this.configurator.setSourceLocationPreference(location);
- location = StringTools.stringIsEmpty(this.getTargetFolder()) ? this.getDefaultTarget() : this.getTargetFolder();
- this.configurator.setTargetLocationPreference(location);
- location = StringTools.stringIsEmpty(this.getPersistenceInfo()) ? this.getDefaultPersistenceInfo() : this.getPersistenceInfo();
- this.configurator.setPersistenceInfoPreference(location);
- this.configurator.setLogLevelPreference(this.getLogLevel());
- }
-
- private void removeProjectStaticWeavingPreferences() {
-
- this.configurator.removeSourceLocationPreference();
- this.configurator.removeTargetLocationPreference();
- this.configurator.removeLogLevelPreference();
- this.configurator.removePersistenceInfoPreference();
- }
-
- // ********** internal methods **********
-
- private boolean projectHasStaticWeavingBuilder() {
- return this.configurator.projectHasStaticWeavingBuilder();
- }
-
- private IProject getProject() {
- IAdaptable adaptable= this.getElement();
- return adaptable == null ? null : (IProject)adaptable.getAdapter(IProject.class);
- }
-
- private String makeRelativeToProjectPath(String filePath) {
- Path path = new Path(filePath);
- IPath relativePath = path.makeRelativeTo(this.getProject().getLocation());
- return relativePath.toOSString();
- }
-
- // ********** getters *********
-
- private boolean staticWeaveClasses() {
- return this.staticWeavingComposite.getStaticWeaveCheckBoxValue();
- }
-
- private String getSourceFolder() {
- return this.staticWeavingComposite.getSourceFolder();
- }
-
- private String getTargetFolder() {
- return this.staticWeavingComposite.getTargetFolder();
- }
-
- private String getPersistenceInfo() {
- return this.staticWeavingComposite.getPersistenceInfoFolder();
- }
-
- private String getLogLevel() {
- return this.staticWeavingComposite.getLogLevel();
- }
-
- // ********** queries *********
-
- private String getSourcePreference() {
- return this.configurator.getSourceLocationPreference();
- }
-
- private String getTargetPreference() {
- return this.configurator.getTargetLocationPreference();
- }
-
- private String getPersistenceInfoPreference() {
- return this.configurator.getPersistenceInfoPreference();
- }
-
- private String getLogLevelPreference() {
- return this.configurator.getLogLevelPreference();
- }
-
- private String getDefaultSource() {
- return this.configurator.getDefaultSourceLocation();
- }
-
- private String getDefaultTarget() {
- return this.configurator.getDefaultTargetLocation();
- }
-
- private String getDefaultPersistenceInfo() {
- return this.configurator.getDefaultPersistenceInfo();
- }
-
- private String getDefaultLogLevel() {
- return this.configurator.getDefaultLogLevel();
- }
-
- // ********** StaticWeavingComposite **********
-
- class StaticWeavingComposite {
- private final Button staticWeaveClassesCheckBox;
- private final Label sourceLabel;
- private final Text sourceFolderText;
- private final Button browseSourceButton;
- private final Label targetLabel;
- private final Text targetFolderText;
- private final Button browseTargetButton;
- private final Label persistenceInfoLabel;
- private final Text persistenceInfoText;
- private final Button browsePersistenceInfoButton;
-
- private final Label logLevelLabel;
- private final Combo logLevelComboBox;
- private String logLevel;
-
- // ********** constructor **********
-
- private StaticWeavingComposite(Composite parent) {
- super();
- Group weavingGroup = new Group(parent, SWT.NONE);
- GridLayout layout = new GridLayout(3, false);
- layout.verticalSpacing= convertVerticalDLUsToPixels(0);
- weavingGroup.setLayout(layout);
- weavingGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- weavingGroup.setText(EclipseLinkUiMessages.EclipselinkPreferencePage_staticWeavingGroupBox);
-
- // checkbox
- this.staticWeaveClassesCheckBox = this.buildStaticWeaveCheckBox(weavingGroup,
- EclipseLinkUiMessages.EclipselinkPreferencePage_weaveClassesOnBuildLabel,
- this.buildStaticWeaveCheckBoxListener(), 3);
- // source
- this.sourceLabel = this.buildLabel(weavingGroup, 1, EclipseLinkUiMessages.EclipselinkPreferencePage_sourceLabel);
- this.sourceFolderText = this.buildText(weavingGroup, 1);
- this.browseSourceButton = this.buildBrowseButton(weavingGroup,
- this.buildBrowseSourceButtonSelectionListener(
- EclipseLinkUiMessages.EclipselinkPreferencePage_selectSourceLabel,
- EclipseLinkUiMessages.EclipselinkPreferencePage_sourceFolderSelectionLabel));
- // target
- this.targetLabel = this.buildLabel(weavingGroup, 1, EclipseLinkUiMessages.EclipselinkPreferencePage_targetLabel);
- this.targetFolderText = this.buildText(weavingGroup, 1);
- this.browseTargetButton = this.buildBrowseButton(weavingGroup,
- this.buildBrowseTargetButtonSelectionListener(
- EclipseLinkUiMessages.EclipselinkPreferencePage_selectTargetLabel,
- EclipseLinkUiMessages.EclipselinkPreferencePage_targetFolderSelectionLabel));
- // log level combo-box
- this.logLevelLabel = this.buildLabel(weavingGroup, 1, EclipseLinkUiMessages.EclipselinkPreferencePage_logLevelLabel);
- this.logLevelComboBox = this.buildLogLevelComboBox(weavingGroup, 1);
- this.buildFiller(weavingGroup);
- // persistenceInfo
- this.persistenceInfoLabel = this.buildLabel(weavingGroup, 1, EclipseLinkUiMessages.EclipselinkPreferencePage_persistenceInfoLabel);
- this.persistenceInfoText = this.buildText(weavingGroup, 1);
- this.browsePersistenceInfoButton = this.buildBrowseButton(weavingGroup,
- this.buildBrowsePersistenceInfoButtonSelectionListener(
- EclipseLinkUiMessages.EclipselinkPreferencePage_selectPersistenceInfoLabel,
- EclipseLinkUiMessages.EclipselinkPreferencePage_persistenceInfoFolderSelectionLabel));
-
- // initialize staticWeave checkbox
- this.staticWeaveClassesCheckBox.setSelection(projectHasStaticWeavingBuilder());
-
- this.staticWeaveCheckBoxChanged();
- }
-
- // ********** listeners **********
-
- private SelectionListener buildStaticWeaveCheckBoxListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- staticWeaveCheckBoxChanged();
- }
- };
- }
-
- private void staticWeaveCheckBoxChanged() {
- boolean enabled = this.getStaticWeaveCheckBoxValue();
-
- this.setSourceEnabled(enabled);
- this.setTargetEnabled(enabled);
- this.setPersistenceInfoEnabled(enabled);
- this.setLogLevelEnabled(enabled);
-
- if(this.getStaticWeaveCheckBoxValue()) {
- this.initializeFromPreferences();
- }
- else {
- this.clearAll();
- }
- }
-
- private SelectionListener buildLogLevelComboBoxSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // nothing special for "default" (double-click?)
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- StaticWeavingComposite.this.selectedLogLevelChanged();
- }
- @Override
- public String toString() {
- return "EclipselinkPreferencePage logLevel combo-box selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- private void selectedLogLevelChanged() {
- this.logLevel = this.logLevelComboBox.getText();
- }
-
- // ********** UI controls **********
-
- private void initializeFromPreferences() {
- // source
- this.sourceFolderText.setText(getSourcePreference());
- // target
- this.targetFolderText.setText(getTargetPreference());
- // persistenceInfo
- String persistenceInfo = (getPersistenceInfoPreference() != null) ? getPersistenceInfoPreference() : ""; //$NON-NLS-1$
- this.persistenceInfoText.setText(persistenceInfo);
- // log level
- this.logLevel = getLogLevelPreference();
- this.logLevelComboBox.select(this.logLevelComboBox.indexOf(this.logLevel));
- }
-
- private void clearAll() {
- // source
- this.sourceFolderText.setText(""); //$NON-NLS-1$
- // target
- this.targetFolderText.setText(""); //$NON-NLS-1$
- // persistenceInfo
- this.persistenceInfoText.setText(""); //$NON-NLS-1$
- // log level
- this.logLevel = getDefaultLogLevel();
- this.logLevelComboBox.select(this.logLevelComboBox.indexOf(this.logLevel));
- }
-
- private void setSourceEnabled(boolean enabled) {
- this.sourceLabel.setEnabled(enabled);
- this.sourceFolderText.setEnabled(enabled);
- this.browseSourceButton.setEnabled(enabled);
- }
-
- private void setTargetEnabled(boolean enabled) {
- this.targetLabel.setEnabled(enabled);
- this.targetFolderText.setEnabled(enabled);
- this.browseTargetButton.setEnabled(enabled);
- }
-
- private void setPersistenceInfoEnabled(boolean enabled) {
- this.persistenceInfoLabel.setEnabled(enabled);
- this.persistenceInfoText.setEnabled(enabled);
- this.browsePersistenceInfoButton.setEnabled(enabled);
- }
-
- private void setLogLevelEnabled(boolean enabled) {
- this.logLevelLabel.setEnabled(enabled);
- this.logLevelComboBox.setEnabled(enabled);
- }
-
- private Button buildBrowseButton(Composite parent, SelectionListener selectionListener) {
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(gridData);
-
- // Browse buttons
- Button browseButton = new Button(buttonComposite, SWT.PUSH);
- browseButton.setText(EclipseLinkUiMessages.EclipselinkPreferencePage_browse);
- gridData = new GridData();
- gridData.horizontalAlignment= GridData.FILL;
- gridData.grabExcessHorizontalSpace= true;
- browseButton.setLayoutData(gridData);
-
- browseButton.addSelectionListener(selectionListener);
- return browseButton;
- }
-
- private SelectionListener buildBrowseSourceButtonSelectionListener(final String title, final String description) {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- String directory = promptFolder(title, description, getSourceFolder());
- if ( ! StringTools.stringIsEmpty(directory)) {
- StaticWeavingComposite.this.sourceFolderText.setText(makeRelativeToProjectPath(directory));
- }
- }
- };
- }
-
- private SelectionListener buildBrowseTargetButtonSelectionListener(final String title, final String description) {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- String directory = promptFolder(title, description, getTargetFolder());
- if ( ! StringTools.stringIsEmpty(directory)) {
- StaticWeavingComposite.this.targetFolderText.setText(makeRelativeToProjectPath(directory));
- }
- }
- };
- }
-
- private SelectionListener buildBrowsePersistenceInfoButtonSelectionListener(final String title, final String description) {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
-
- String directory = promptFolder(title, description, getPersistenceInfoFolder());
- if ( ! StringTools.stringIsEmpty(directory)) {
- StaticWeavingComposite.this.persistenceInfoText.setText(makeRelativeToProjectPath(directory));
- }
- }
- };
- }
-
- private Button buildStaticWeaveCheckBox(Composite parent, String text, SelectionListener listener, int horizontalSpan) {
- Button radioButton = new Button(parent, SWT.CHECK);
- GridData gridData = new GridData();
- gridData.horizontalSpan = horizontalSpan;
- radioButton.setLayoutData(gridData);
- radioButton.setText(text);
- radioButton.addSelectionListener(listener);
- return radioButton;
- }
-
- private Text buildText(Composite parent, int horizontalSpan) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- gridData.horizontalSpan = horizontalSpan;
- text.setLayoutData(gridData);
- return text;
- }
-
- private Combo buildLogLevelComboBox(Composite parent, int horizontalSpan) {
- Combo combo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- GridData gridData = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
- gridData.horizontalAlignment = SWT.FILL;
- gridData.horizontalSpan = horizontalSpan;
- gridData.grabExcessHorizontalSpace = true ;
- combo.setLayoutData(gridData);
- combo.addSelectionListener(this.buildLogLevelComboBoxSelectionListener());
-
- this.populateLogLevelComboBox(combo);
- return combo;
- }
-
- private void buildFiller(Composite parent) {
- new Label(parent, SWT.NULL);
- }
-
- private void populateLogLevelComboBox(Combo combo) {
- combo.removeAll();
-
- for (LoggingLevel value : configurator.getLogLevelValues()) {
- combo.add(value.getPropertyValue());
- }
- }
-
- private Label buildLabel(Composite parent, int span, String text) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(text);
- GridData gridData = new GridData();
- gridData.horizontalSpan = span;
- label.setLayoutData(gridData);
- return label;
- }
-
- // ********** getters *********
-
- private String getSourceFolder() {
- return this.sourceFolderText.getText();
- }
-
- private String getTargetFolder() {
- return this.targetFolderText.getText();
- }
-
- private String getPersistenceInfoFolder() {
- return this.persistenceInfoText.getText();
- }
-
- private String getLogLevel() {
- return this.logLevel;
- }
-
- private boolean getStaticWeaveCheckBoxValue() {
- return this.staticWeaveClassesCheckBox.getSelection();
- }
-
- // ********** internal methods **********
-
- /**
- * The browse button was clicked, its action invokes this action which should
- * prompt the user to select a folder and set it.
- */
- private String promptFolder(String title, String description, String relativeLocation) {
-
- DirectoryDialog dialog = new DirectoryDialog(getShell());
- dialog.setText(title);
- dialog.setMessage(description);
- dialog.setFilterPath(this.filterPath(relativeLocation));
- String directory = dialog.open();
- return directory;
- }
-
- protected String filterPath(String relativeLocation) {
- IPath location = getProject().getLocation();
- if( ! StringTools.stringIsEmpty(relativeLocation)) {
- location = location.append(relativeLocation);
- }
- return location.toPortableString();
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizard.java
deleted file mode 100644
index ed57313e71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/EclipseLinkMappingFileWizard.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.wizards.orm.MappingFileNewFileWizardPage;
-import org.eclipse.jpt.jpa.ui.internal.wizards.orm.MappingFileOptionsWizardPage;
-import org.eclipse.jpt.jpa.ui.internal.wizards.orm.MappingFileWizard;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-/**
- * This is referenced in the plugin.xml as an org.eclipse.ui.newWizards extension
- */
-@SuppressWarnings("restriction")
-public class EclipseLinkMappingFileWizard
- extends MappingFileWizard {
-
- public EclipseLinkMappingFileWizard() {
- this(null);
- }
-
- public EclipseLinkMappingFileWizard(IDataModel dataModel) {
- super(dataModel);
- setWindowTitle(EclipseLinkUiMessages.MappingFileWizard_title);
- }
-
-
- @Override
- protected MappingFileNewFileWizardPage buildMappingFileNewFileWizardPage() {
- return new MappingFileNewFileWizardPage(
- "Page_1", this.mungedSelection, getDataModel(),
- EclipseLinkUiMessages.MappingFileWizardPage_newFile_title,
- EclipseLinkUiMessages.MappingFileWizardPage_newFile_desc);
- }
-
- @Override
- protected MappingFileOptionsWizardPage buildMappingFileOptionsWizardPage() {
- return new MappingFileOptionsWizardPage(
- "Page_2", getDataModel(),
- EclipseLinkUiMessages.MappingFileWizardPage_options_title,
- EclipseLinkUiMessages.MappingFileWizardPage_options_desc);
- }
-
- public static IPath createNewMappingFile(IStructuredSelection selection, String xmlFileName) {
- EclipseLinkMappingFileWizard wizard = new EclipseLinkMappingFileWizard(
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider()));
- return MappingFileWizard.createMappingFile(selection, xmlFileName, wizard);
- }
-
- @Override
- protected IDataModelProvider getDefaultProvider() {
- return new EclipseLinkOrmFileCreationDataModelProvider();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/EmbeddedEclipseLinkMappingFileWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/EmbeddedEclipseLinkMappingFileWizard.java
deleted file mode 100644
index 4da312f65f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/EmbeddedEclipseLinkMappingFileWizard.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.ui.internal.wizards.orm.MappingFileWizard;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * This wizard will create a new EclipseLink mapping file without opening it
- * afterwards.
- * It can be used within other wizards where opening the mapping file is
- * unnecessary, making the process smoother.
- */
-public class EmbeddedEclipseLinkMappingFileWizard
- extends EclipseLinkMappingFileWizard
-{
- public static IPath createNewMappingFile(IStructuredSelection selection) {
- return createNewMappingFile(selection, null);
- }
-
- public static IPath createNewMappingFile(IStructuredSelection selection, String xmlFileName) {
- if (xmlFileName == null) {
- xmlFileName = DEFAULT_XML_FILE_NAME;
- }
- EmbeddedEclipseLinkMappingFileWizard wizard = new EmbeddedEclipseLinkMappingFileWizard(DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider()));
- return MappingFileWizard.createMappingFile(selection, xmlFileName, wizard);
- }
-
- public static final String DEFAULT_XML_FILE_NAME = "eclipselink-orm.xml"; //$NON-NLS-1$
-
-
- public EmbeddedEclipseLinkMappingFileWizard() {
- super();
- }
-
- public EmbeddedEclipseLinkMappingFileWizard(IDataModel dataModel) {
- super(dataModel);
- }
-
- @Override
- public boolean performFinish() {
- return this.createMappingFile();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/SelectEclipseLinkMappingFileDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/SelectEclipseLinkMappingFileDialog.java
deleted file mode 100644
index 693b64c841..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/SelectEclipseLinkMappingFileDialog.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.jpa.ui.internal.wizards.SelectMappingFileDialog;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Only EclipseLink mapping file will show up on EclipseLink platform with this dialog
- */
-public class SelectEclipseLinkMappingFileDialog
- extends SelectMappingFileDialog
-{
- public SelectEclipseLinkMappingFileDialog(Shell parent, IProject project) {
- super(parent, project);
- }
-
- public SelectEclipseLinkMappingFileDialog(Shell parent, IProject project, ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
- super(parent, project, labelProvider, contentProvider);
- }
-
- @Override
- protected void openNewMappingFileWizard() {
- IPath path = EmbeddedEclipseLinkMappingFileWizard.createNewMappingFile(new StructuredSelection(super.project));
- this.updateDialog(path);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaConverterConversionWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaConverterConversionWizardPage.java
deleted file mode 100644
index 6f51cb1cab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaConverterConversionWizardPage.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.conversion.java;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-
-public class EclipseLinkJavaConverterConversionWizardPage
- extends EclipseLinkJavaMetadataConversionWizardPage
-{
- public EclipseLinkJavaConverterConversionWizardPage(JpaProject jpaProject) {
- super(jpaProject, EclipseLinkUiMessages.JavaConverterConversionWizardPage_title, EclipseLinkUiMessages.JavaConverterConversionWizardPage_description);
- }
-
- @Override
- protected boolean hasConvertibleJavaMetadata_() {
- return this.getPersistenceUnit().hasConvertibleJavaConverters();
- }
-
- @Override
- protected String getMissingJavaMetadataWarningMessage() {
- return EclipseLinkUiMessages.JavaMetadataConversion_noConvertersToConvert;
- }
-
- /**
- * Mapping file must be an EclipseLink ORM file.
- */
- @Override
- protected IContentType getMappingFileContentType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE;
- }
-
- @Override
- protected ConversionCommand.Strategy getConversionCommandStrategy() {
- return CONVERSION_COMMAND_STRATEGY;
- }
-
- public static final ConversionCommandStrategy CONVERSION_COMMAND_STRATEGY = new ConversionCommandStrategy();
-
- protected static class ConversionCommandStrategy
- implements ConversionCommand.Strategy
- {
- public void execute(EntityMappings entityMappings, IProgressMonitor monitor) {
- ((EclipseLinkPersistenceUnit) entityMappings.getPersistenceUnit()).convertJavaConverters((EclipseLinkEntityMappings) entityMappings, monitor);
- }
- }
-
- @Override
- protected boolean hasAnyEquivalentJavaMetadata_() {
- return this.getPersistenceUnit().hasAnyEquivalentJavaConverters();
- }
-
- @Override
- public String getEquivalentJavaMetadataWarningDialogTitle() {
- return EclipseLinkUiMessages.JavaMetadataConversion_equivalentConvertersWarningTitle;
- }
-
- @Override
- public String getEquivalentJavaMetadataWarningDialogMessage() {
- return EclipseLinkUiMessages.JavaMetadataConversion_equivalentConvertersWarningMessage;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaGeneratorConversionWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaGeneratorConversionWizardPage.java
deleted file mode 100644
index bb7814776d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaGeneratorConversionWizardPage.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.conversion.java;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java.GenericJavaGeneratorConversionWizardPage;
-
-public class EclipseLinkJavaGeneratorConversionWizardPage
- extends EclipseLinkJavaMetadataConversionWizardPage
-{
- public EclipseLinkJavaGeneratorConversionWizardPage(JpaProject jpaProject) {
- super(jpaProject, JptUiMessages.JavaGeneratorConversionWizardPage_title, JptUiMessages.JavaGeneratorConversionWizardPage_description);
- }
-
- @Override
- protected boolean hasConvertibleJavaMetadata_() {
- return this.persistenceUnit.hasConvertibleJavaGenerators();
- }
-
- @Override
- protected String getMissingJavaMetadataWarningMessage() {
- return JptUiMessages.JavaMetadataConversion_noGeneratorsToConvert;
- }
-
- @Override
- protected ConversionCommand.Strategy getConversionCommandStrategy() {
- return GenericJavaGeneratorConversionWizardPage.CONVERSION_COMMAND_STRATEGY;
- }
-
- @Override
- protected boolean hasAnyEquivalentJavaMetadata_() {
- return this.getPersistenceUnit().hasAnyEquivalentJavaGenerators();
- }
-
- @Override
- public String getEquivalentJavaMetadataWarningDialogTitle() {
- return EclipseLinkUiMessages.JavaMetadataConversion_equivalentGeneratorsWarningTitle;
- }
-
- @Override
- public String getEquivalentJavaMetadataWarningDialogMessage() {
- return EclipseLinkUiMessages.JavaMetadataConversion_equivalentGeneratorsWarningMessage;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaMetadataConversionWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaMetadataConversionWizardPage.java
deleted file mode 100644
index 277d4c7396..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaMetadataConversionWizardPage.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.conversion.java;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.common.ui.internal.dialogs.OptionalMessageDialog;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.EmbeddedEclipseLinkMappingFileWizard;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.SelectEclipseLinkMappingFileDialog;
-import org.eclipse.jpt.jpa.ui.internal.jface.XmlMappingFileViewerFilter;
-import org.eclipse.jpt.jpa.ui.internal.wizards.SelectMappingFileDialog;
-import org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java.JavaMetadataConversionWizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-public abstract class EclipseLinkJavaMetadataConversionWizardPage
- extends JavaMetadataConversionWizardPage
-{
- public EclipseLinkJavaMetadataConversionWizardPage(JpaProject jpaProject, String title, String description) {
- super(jpaProject, title, description);
- }
-
- @Override
- protected ViewerFilter buildSelectMappingFileDialogViewerFilter() {
- return new XmlMappingFileViewerFilter(this.jpaProject, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE);
- }
-
- @Override
- protected IPath openNewMappingFileWizard() {
- return EmbeddedEclipseLinkMappingFileWizard.createNewMappingFile(new StructuredSelection(this.jpaProject.getProject()));
- }
-
- @Override
- protected SelectMappingFileDialog buildSelectMappingFileDialog() {
- return new SelectEclipseLinkMappingFileDialog(this.getShell(), this.jpaProject.getProject());
- }
-
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) this.persistenceUnit;
- }
-
- @Override
- protected IPath getDefaultMappingFileRuntimPath() {
- return JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH;
- }
-
- @Override
- protected IContentType getMappingFileContentType() {
- return JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE;
- }
-
-
- // ********** finish **********
-
- @Override
- protected final boolean isOKToConvert() {
- if (this.hasAnyEquivalentJavaMetadata()) {
- return this.userWantsToContinueWithEquivalentJavaMetadata();
- }
- return super.isOKToConvert();
- }
-
- protected final boolean hasAnyEquivalentJavaMetadata() {
- return (this.persistenceUnit != null) && this.hasAnyEquivalentJavaMetadata_();
- }
-
- /**
- * Pre-condition: the {@link #persistenceUnit persistence unit}
- * is not <code>null</code>.
- */
- protected abstract boolean hasAnyEquivalentJavaMetadata_();
-
-
- // ********** equivalent Java metadata warning dialog **********
-
- /**
- * Return whether the user wants to continue the conversion even though
- * the persistence unit contains "equivalent" Java metadata (e.g. one or
- * more of the Java queries are "equivalent").
- */
- protected boolean userWantsToContinueWithEquivalentJavaMetadata() {
- if ( ! OptionalMessageDialog.isDialogEnabled(EquivalentJavaMetadataWarningDialog.ID)) {
- return true; // ?
- }
- MessageDialog dialog = this.buildEquivalentJavaMetadataWarningDialog();
- return dialog.open() == IDialogConstants.YES_ID;
- }
-
- protected MessageDialog buildEquivalentJavaMetadataWarningDialog() {
- return new EquivalentJavaMetadataWarningDialog(this.getShell(), this.getEquivalentJavaMetadataWarningDialogTitle(), this.getEquivalentJavaMetadataWarningDialogMessage());
- }
-
- protected abstract String getEquivalentJavaMetadataWarningDialogTitle();
-
- protected abstract String getEquivalentJavaMetadataWarningDialogMessage();
-
-
- /* CU private */ static class EquivalentJavaMetadataWarningDialog
- extends OptionalMessageDialog
- {
- static final String ID = "dontShowEquivalentMetadataExisting.warning"; //$NON-NLS-1$
-
- EquivalentJavaMetadataWarningDialog(Shell parent, String title, String message) {
- super(ID, parent, title, message, MessageDialog.WARNING,
- new String[] {IDialogConstants.YES_LABEL, IDialogConstants.NO_LABEL},
- 1);
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- this.createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false);
- this.createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaQueryConversionWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaQueryConversionWizardPage.java
deleted file mode 100644
index 6a2ce64df3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/conversion/java/EclipseLinkJavaQueryConversionWizardPage.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.conversion.java;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.EclipseLinkUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java.GenericJavaQueryConversionWizardPage;
-
-public class EclipseLinkJavaQueryConversionWizardPage
- extends EclipseLinkJavaMetadataConversionWizardPage
-{
- public EclipseLinkJavaQueryConversionWizardPage(JpaProject jpaProject) {
- super(jpaProject, JptUiMessages.JavaQueryConversionWizardPage_title, JptUiMessages.JavaQueryConversionWizardPage_description);
- }
-
- @Override
- protected boolean hasConvertibleJavaMetadata_() {
- return this.persistenceUnit.hasConvertibleJavaQueries();
- }
-
- @Override
- protected String getMissingJavaMetadataWarningMessage() {
- return JptUiMessages.JavaMetadataConversion_noQueriesToConvert;
- }
-
- @Override
- protected ConversionCommand.Strategy getConversionCommandStrategy() {
- return GenericJavaQueryConversionWizardPage.CONVERSION_COMMAND_STRATEGY;
- }
-
- @Override
- protected boolean hasAnyEquivalentJavaMetadata_() {
- return this.getPersistenceUnit().hasAnyEquivalentJavaQueries();
- }
-
- @Override
- public String getEquivalentJavaMetadataWarningDialogTitle() {
- return EclipseLinkUiMessages.JavaMetadataConversion_equivalentQueriesWarningTitle;
- }
-
- @Override
- public String getEquivalentJavaMetadataWarningDialogMessage() {
- return EclipseLinkUiMessages.JavaMetadataConversion_equivalentQueriesWarningMessage;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicDefaultTableGenerationWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicDefaultTableGenerationWizardPage.java
deleted file mode 100644
index 46c38f9062..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicDefaultTableGenerationWizardPage.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.SelectEclipseLinkMappingFileDialog;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.jface.XmlMappingFileViewerFilter;
-import org.eclipse.jpt.jpa.ui.internal.wizards.SelectMappingFileDialog;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.EntityWizardMsg;
-import org.eclipse.jpt.jpa.ui.internal.wizards.gen.DefaultTableGenerationWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-public class DynamicDefaultTableGenerationWizardPage extends
- DefaultTableGenerationWizardPage {
-
- private Label xmlMappingFileLabel;
- private Text xmlMappingFileText;
- private Button xmlMappingFileBrowseButton;
-
- public DynamicDefaultTableGenerationWizardPage(JpaProject jpaProject) {
- super(jpaProject);
- }
-
- @Override
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
- Composite composite = new Composite(parent, SWT.NULL);
- int nColumns= 4 ;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- composite.setLayout(layout);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.GENERATE_ENTITIES_WIZARD_CUSTOMIZE_DEFAULT_ENTITY_GENERATION);
-
- createXmlMappingFileGroup(composite);
- createDomainJavaClassesPropertiesGroup(composite, 4);
- defaultTableGenPanel = new DynamicTableGenPanel(composite, 4, true, this);
-
- setControl(composite);
-
- this.setPageComplete( true );
- }
-
- @Override
- protected void createDomainJavaClassesPropertiesGroup(Composite composite, int columns) {
- Group parent = new Group( composite, SWT.NONE);
- parent.setText( JptJpaEclipseLinkUiEntityGenMessages.GenerateDynamicEntitiesWizard_defaultTablePage_domainJavaClass);
- parent.setLayout(new GridLayout( columns, false));
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = columns;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = false;
- parent.setLayoutData(layoutData);
-
- createPackageControls(parent, columns);
- }
-
- private void createXmlMappingFileGroup(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(3, false));
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- this.xmlMappingFileLabel = new Label(composite, SWT.LEFT);
- this.xmlMappingFileLabel.setText(JptJpaEclipseLinkUiEntityGenMessages.GenerateDynamicEntitiesWizard_defaultTablePage_xmlMappingFile);
- this.xmlMappingFileLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- this.xmlMappingFileText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- this.xmlMappingFileText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- this.xmlMappingFileText.addModifyListener(new ModifyListener() {
-
- public void modifyText(ModifyEvent e) {
- handleXmlMappingFileTextModified();
- }
- });
-
- this.xmlMappingFileBrowseButton = new Button(composite, SWT.PUSH);
- this.xmlMappingFileBrowseButton.setText(EntityWizardMsg.BROWSE_BUTTON_LABEL);
- GridData browseButtonData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- browseButtonData.horizontalSpan = 1;
- this.xmlMappingFileBrowseButton.setLayoutData(browseButtonData);
- this.xmlMappingFileBrowseButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- handleXmlMappingFileButtonPressed();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- }
-
- private void handleXmlMappingFileTextModified() {
- this.getCustomizer().setXmlMappingFile(this.xmlMappingFileText.getText());
-// validate();
- }
-
- private void handleXmlMappingFileButtonPressed() {
-
- ViewerFilter filter = getDialogViewerFilter(this.jpaProject);
- ITreeContentProvider contentProvider = new WorkbenchContentProvider();
- ILabelProvider labelProvider = new WorkbenchLabelProvider();
- SelectMappingFileDialog dialog = new SelectEclipseLinkMappingFileDialog(getShell(), this.jpaProject.getProject(), labelProvider, contentProvider);
- dialog.setTitle(JptUiMessages.SelectMappingFileDialog_title);
- dialog.setMessage(JptUiMessages.SelectMappingFileDialog_message);
- dialog.addFilter(filter);
-
- String ormFileName = this.xmlMappingFileText.getText();
- JpaXmlResource resource = jpaProject.getMappingFileXmlResource(new Path(ormFileName));
- IFile initialSelection = (resource != null) ? resource.getFile() : null;
- dialog.setInput(this.jpaProject.getProject());
-
- if (initialSelection != null) {
- dialog.setInitialSelection(initialSelection);
- }
- if (dialog.open() == Window.OK) {
- String chosenName = dialog.getChosenName();
- this.xmlMappingFileText.setText(chosenName);
- this.getCustomizer().setXmlMappingFile(chosenName);
- }
-// validate();
- }
-
- protected ViewerFilter getDialogViewerFilter(JpaProject jpaProject) {
- return new XmlMappingFileViewerFilter(jpaProject, JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE);
- }
-
- public void setVisible(boolean visible){
- super.setVisible(visible);
- if(visible){
- this.xmlMappingFileText.setText(this.getCustomizer().getXmlMappingFile());
-// validate();
- }
- }
-
-// private void validate() {
-// String errorMessage = null;
-// JpaXmlResource ormXmlResource = getOrmXmlResource();
-// if (ormXmlResource == null) {
-// errorMessage = JptUiMessages.JpaMakePersistentWizardPage_mappingFileDoesNotExistError;
-// }
-// setErrorMessage(errorMessage);
-// setPageComplete(errorMessage == null);
-// }
-
- protected JpaXmlResource getOrmXmlResource() {
- return this.jpaProject.getMappingFileXmlResource(new Path(this.xmlMappingFileText.getText()));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicTableGenPanel.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicTableGenPanel.java
deleted file mode 100644
index 4acc359d1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicTableGenPanel.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.jpa.ui.internal.wizards.gen.JptUiEntityGenMessages;
-import org.eclipse.jpt.jpa.ui.internal.wizards.gen.TableGenPanel;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-
-public class DynamicTableGenPanel extends TableGenPanel {
-
- public DynamicTableGenPanel(Composite parent, int columns , boolean isDefaultTable, WizardPage wizardPage){
- super(parent, columns, isDefaultTable, wizardPage);
- }
-
- @Override
- protected void createTableMappingPropertiesGroup(Composite composite, int columns) {
- Group parent = new Group(composite, SWT.NONE );
- parent.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_tableMapping);
- parent.setLayout(new GridLayout(columns, false));
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = columns;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = false;
- parent.setLayoutData(layoutData);
-
- createClassNameControl(parent, columns);
-
- createIdGeneratorControls(parent, columns);
-
- //AssociationFetch and CollectionType only available for default table generation
- if ( isDefaultTable ) {
- createAssociationFetchControls(parent, columns);
- createCollectionTypeControls(parent, columns);
- }
- }
-
- @Override
- protected void updateAccessControls(){
- //do nothing, not applicable for Dynamic
- }
-
- @Override
- protected void updateGenerateOptionalAnnotationControls(){
- //do nothing, not applicable for Dynamic
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicTablesAndColumnsCustomizationWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicTablesAndColumnsCustomizationWizardPage.java
deleted file mode 100644
index 0577d33655..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/DynamicTablesAndColumnsCustomizationWizardPage.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenColumn;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenTable;
-import org.eclipse.jpt.jpa.ui.internal.wizards.gen.ColumnGenPanel;
-import org.eclipse.jpt.jpa.ui.internal.wizards.gen.TablesAndColumnsCustomizationWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-public class DynamicTablesAndColumnsCustomizationWizardPage extends
- TablesAndColumnsCustomizationWizardPage {
-
- public DynamicTablesAndColumnsCustomizationWizardPage(JpaProject jpaProject, ResourceManager resourceManager) {
- super(jpaProject, resourceManager);
- }
-
- @Override
- protected void updateTabelGenDetail(ORMGenTable table) {
- this.selectedTable = table;
- if(tableGenDetatilGroup==null){
- tableGenDetatilGroup = new Composite(detailPanel, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 4;
- tableGenDetatilGroup.setLayout(gridLayout);
-
- this.tableGenPanel = new DynamicTableGenPanel(tableGenDetatilGroup, 4 , false, this );
-
- }
- this.tableGenPanel.setORMGenTable(table);
- this.tableGenPanel.updateControls();
-
- this.detailPanelStatckLayout.topControl = tableGenDetatilGroup;
- this.detailPanel.layout();
-
- String baseClass = StringTools.stringIsEmpty(table.getExtends()) ? "" : table.getExtends();
- setSuperClass(baseClass, true);
- setSuperInterfaces(table.getImplements(), true);
-
- detailPanel.getParent().layout();
- }
-
- @Override
- protected void updateColumnGenDetail(ORMGenColumn column) {
- if(columnGenDetatilGroup==null){
- columnGenDetatilGroup = new Composite(detailPanel, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 4;
- columnGenDetatilGroup.setLayout(gridLayout);
- this.columnGenPanel = new ColumnGenPanel(columnGenDetatilGroup, 4, getCustomizer() , this, true);
- }
- columnGenPanel.setColumn(column);
- this.detailPanelStatckLayout.topControl = columnGenDetatilGroup;
- this.detailPanel.layout();
- detailPanel.getParent().layout();
- }
-
- @Override
- public boolean isDynamic(){
- return true;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/GenerateDynamicEntitiesFromSchemaWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/GenerateDynamicEntitiesFromSchemaWizard.java
deleted file mode 100644
index 9eb90a08bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/GenerateDynamicEntitiesFromSchemaWizard.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.gen;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResourceRuleFactory;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.eclipselink.ui.JptJpaEclipseLinkUiPlugin;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.wizards.gen.GenerateEntitiesFromSchemaWizard;
-import org.eclipse.jpt.jpa.ui.internal.wizards.gen.TableAssociationsWizardPage;
-import org.eclipse.jpt.jpa.ui.internal.wizards.gen.TablesSelectorWizardPage;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-public class GenerateDynamicEntitiesFromSchemaWizard extends GenerateEntitiesFromSchemaWizard
- implements INewWizard {
-
- public static final String HELP_CONTEXT_ID = JptJpaUiPlugin.PLUGIN_ID + ".GenerateEntitiesFromSchemaWizard"; //$NON-NLS-1$
-
-
- public GenerateDynamicEntitiesFromSchemaWizard() {
- super();
- this.setWindowTitle(JptJpaEclipseLinkUiEntityGenMessages.GenerateDynamicEntitiesWizard_generateEntities);
- }
-
- public GenerateDynamicEntitiesFromSchemaWizard( JpaProject jpaProject, IStructuredSelection selection) {
- super(jpaProject, selection);
- this.setWindowTitle(JptJpaEclipseLinkUiEntityGenMessages.GenerateDynamicEntitiesWizard_generateEntities);
- }
-
- @Override
- protected void addMainPages() {
- this.tablesSelectorPage = new TablesSelectorWizardPage(this.jpaProject, this.resourceManager, true);
- this.addPage(this.tablesSelectorPage);
-
- this.tableAssociationsPage = new TableAssociationsWizardPage(this.jpaProject, this.resourceManager);
- this.addPage(this.tableAssociationsPage);
-
- this.defaultTableGenerationPage = new DynamicDefaultTableGenerationWizardPage(this.jpaProject);
- this.addPage(this.defaultTableGenerationPage);
- this.defaultTableGenerationPage.init(this.selection);
-
- this.tablesAndColumnsCustomizationPage = new DynamicTablesAndColumnsCustomizationWizardPage(this.jpaProject, this.resourceManager);
- this.addPage(this.tablesAndColumnsCustomizationPage);
- this.tablesAndColumnsCustomizationPage.init(this.selection);
- }
-
- @Override
- protected String getCustomizationFileName() {
- ConnectionProfile profile = getProjectConnectionProfile();
- String connection = profile == null ? "" : profile.getName();
- String name = "org.eclipse.jpt.jpa.gen.dynamic." + (connection == null ? "" :connection.replace(' ', '-')); //$NON-NLS-1$
- Schema schema = getDefaultSchema();
- if ( schema!= null ) {
- name += "." + schema.getName();//$NON-NLS-1$
- }
- return name.toLowerCase();
- }
-
- @Override
- protected void scheduleGenerateEntitiesJob(
- OverwriteConfirmer overwriteConfirmer) {
- WorkspaceJob genEntitiesJob = new GenerateEntitiesJob(this.jpaProject, getCustomizer(), overwriteConfirmer, true);
- genEntitiesJob.schedule();
-
- //open file after generation
- String xmlMappingFileLocation = getCustomizer().getXmlMappingFile();
- JpaXmlResource jpaXmlResource = this.jpaProject.getMappingFileXmlResource(new Path(xmlMappingFileLocation));
- IFile mappingFile;
- if(jpaXmlResource!=null){
- mappingFile = jpaXmlResource.getFile();
- }
- else{
- IProject project = jpaProject.getProject();
- IContainer container = ((ProjectResourceLocator) project.getAdapter(ProjectResourceLocator.class)).getDefaultResourceLocation();
- mappingFile = container.getFile(new Path(xmlMappingFileLocation.substring(xmlMappingFileLocation.lastIndexOf("/")))); //$NON-NLS-1$
- }
- OpenXmlMappingFileJob openXmlMappingFileJob = new OpenXmlMappingFileJob(this.jpaProject, mappingFile);
- openXmlMappingFileJob.schedule();
- }
-
- @Override
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- super.init(workbench, selection);
-
- this.setWindowTitle(JptJpaEclipseLinkUiEntityGenMessages.GenerateDynamicEntitiesWizard_generateEntities);
- }
-
- public static class OpenXmlMappingFileJob extends WorkspaceJob {
- final JpaProject jpaProject;
- final IFile mappingFile;
-
- public OpenXmlMappingFileJob(JpaProject jpaProject, IFile mappingFile) {
- super("Open XML File");
- this.jpaProject = jpaProject;
- this.mappingFile = mappingFile;
- IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
- this.setRule(ruleFactory.modifyRule(jpaProject.getProject()));
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- try {
- postGeneration(this.jpaProject,this.mappingFile);
- } catch (InvocationTargetException e) {
- throw new CoreException(new Status(IStatus.ERROR, JptJpaEclipseLinkUiPlugin.PLUGIN_ID, "error", e));
- }
- return Status.OK_STATUS;
- }
-
- private void postGeneration(JpaProject jpaProject, IFile mappingFile) throws InvocationTargetException {
- try {
- openEditor(mappingFile);
- }
- catch (Exception cantOpen) {
- throw new InvocationTargetException(cantOpen);
- }
- }
-
- private void openEditor(final IFile file) {
- if (file != null) {
- SWTUtil.asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- JptJpaUiPlugin.log(e);
- }
- }
- });
- }
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/JptJpaEclipseLinkUiEntityGenMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/JptJpaEclipseLinkUiEntityGenMessages.java
deleted file mode 100644
index 8434698e73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.eclipselink.ui/src/org/eclipse/jpt/jpa/eclipselink/ui/internal/wizards/gen/JptJpaEclipseLinkUiEntityGenMessages.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.ui.internal.wizards.gen;
-
-import org.eclipse.osgi.util.NLS;
-
-public class JptJpaEclipseLinkUiEntityGenMessages {
- private static final String BUNDLE_NAME = "eclipselink_ui_dynamic_entity_gen"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptJpaEclipseLinkUiEntityGenMessages.class;
-
- public static String GenerateDynamicEntitiesWizard_generateEntities;
-
- //Default table gen properties
- public static String GenerateDynamicEntitiesWizard_defaultTablePage_domainJavaClass;
- public static String GenerateDynamicEntitiesWizard_defaultTablePage_xmlMappingFile;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptJpaEclipseLinkUiEntityGenMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.gen/.classpath
deleted file mode 100644
index 8f257414e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/.classpath
+++ /dev/null
@@ -1,8 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.gen/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/.project b/jpa/plugins/org.eclipse.jpt.jpa.gen/.project
deleted file mode 100644
index 3e6e8c6148..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.gen</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.gen/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 051d6a3c89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:26 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.gen/META-INF/MANIFEST.MF
deleted file mode 100644
index 32afdc659e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,25 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.gen
-Bundle-Version: 2.2.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Export-Package: org.eclipse.jpt.jpa.gen.internal;x-internal:=true,
- org.eclipse.jpt.jpa.gen.internal.util;x-internal:=true
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.apache.commons.collections;bundle-version="[3.2.0,4.0.0)",
- org.apache.commons.lang;bundle-version="[2.1.0,3.0.0)",
- org.apache.velocity;bundle-version="[1.5.0,2.0.0)",
- org.jdom;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)"
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/about.html b/jpa/plugins/org.eclipse.jpt.jpa.gen/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.gen/build.properties
deleted file mode 100644
index 4fe875d02e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/build.properties
+++ /dev/null
@@ -1,18 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- plugin.properties,\
- templates/
-jars.compile.order = .
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.gen/component.xml
deleted file mode 100644
index ff5a350e51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.gen"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jpa.gen" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.gen/plugin.properties
deleted file mode 100644
index 9537a25a08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Entity Gen
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/property_files/jpt_gen.properties b/jpa/plugins/org.eclipse.jpt.jpa.gen/property_files/jpt_gen.properties
deleted file mode 100644
index db907a2472..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/property_files/jpt_gen.properties
+++ /dev/null
@@ -1,20 +0,0 @@
-################################################################################
-# Copyright (c) 2008, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-PackageGenerator_taskName=Generate Entities
-GenScope_taskName=Build Database Model
-EntityGenerator_taskName=Generate Entity: {0}
-Error_Generating_Entities = Error Generating Entities
-
-Delete_Folder_Error = "The directory {0} could not be deleted."
-Delete_File_Error = "The file {0} could not be deleted."
-File_Read_Only_Error= "The file {0} could not be modified because write access is denied.\nPlease make sure that the file is not marked as readonly in the file system."
-
-Templates_notFound = Unable to find JPA entities generation templates in plugin \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/Association.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/Association.java
deleted file mode 100644
index 889b4a7d6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/Association.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.util.List;
-
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-/**
- * Represents an ORM association.
- * There are two types of associations:
- * <ul><li>simple association: An association between two database tables.
- * The <em>referrer</code> table is the one containing the foreign key
- * , the <em>referenced</code> table is the other party.<br>
- *
- * <li>many to many association: An association between two tables joined by
- * a <em>join table</em>.
- * In the example AUTHOR, BOOK, AUTHOR_BOOK, The referrer and referenced are
- * AUTHOR and BOOK, and the join table is AUTHOR_BOOK.
- * </ul>
- *
- */
-public class Association implements java.io.Serializable
-{
- private final static long serialVersionUID = 2;
-
- public static final String MANY_TO_ONE = "many-to-one";
- public static final String MANY_TO_MANY = "many-to-many";
- public static final String ONE_TO_ONE = "one-to-one";
- public static final String ONE_TO_MANY = "one-to-many";
-
- public static final String BI_DI = "bi-di";
- public static final String NORMAL_DI = "normal-di"; //referrer->referenced
- public static final String OPPOSITE_DI = "opposite-di"; //referenced->referrer
-
- private transient ORMGenCustomizer mCustomizer;
- private String mReferrerTableName;
- private String mReferencedTableName;
- private String mJoinTableName;
-
- private List<String> mReferrerColNames; /*String objects*/
- private List<String> mReferencedColNames; /*String objects*/
- private List<String> mReferrerJoinColNames; /*String objects*/
- private List<String> mReferencedJoinColNames; /*String objects*/
-
- private transient List<ORMGenColumn> mReferrerCols; /*ORMGenColumn objects*/
- private transient List<ORMGenColumn> mReferencedCols; /*ORMGenColumn objects*/
- private transient List<ORMGenColumn> mReferrerJoinCols; /*ORMGenColumn objects*/
- private transient List<ORMGenColumn> mReferencedJoinCols; /*ORMGenColumn objects*/
-
- private String mCardinality;
- private String mDirectionality;
- private byte mFlags = GENERATED;
-
- private AssociationRole mReferrerRole;
- private AssociationRole mReferencedRole;
-
- private transient ForeignKey mForeignKey;
-
- /*constants for mFlags*/
- /*whether the association should be generated*/
- private static final byte GENERATED = 1 << 0;
- /*whether the association is custom (i.e is not auto computed from foreign keys relationships).*/
- private static final byte CUSTOM = 1 << 1;
-
- /**
- * The simple association constructor.
- * The 2 tables are joined when the values of each column in
- * referrerColNames match its corresponding column in referencedColNames.
- *
- * @param referrerTableName The "foreign key" table.
- * @param referrerColNames The column names in the referrer table.
- * @param referencedTableName The "primary key" table.
- * @param referencedColNames The column names in the referenced table.
- */
- public Association(ORMGenCustomizer customizer, String referrerTableName, List<String> referrerColNames
- , String referencedTableName, List<String> referencedColNames) {
- super();
-
- mCustomizer = customizer;
- mReferrerTableName = referrerTableName;
- mReferencedTableName = referencedTableName;
- mReferrerColNames = referrerColNames;
- mReferencedColNames = referencedColNames;
-
- mCardinality = MANY_TO_ONE;
- mDirectionality = BI_DI;
-
- setCustom(true);
- }
- /**
- * The many to many constructor.
- * The 2 tables are joined when the values of each column in
- * referrerColNames match its corresponding column in referrerJoinColNames
- * , and each column in referencedColNames match its corresponding column in referencedJoinColNames.
- *
- */
- public Association(ORMGenCustomizer customizer, String referrerTableName, List<String> referrerColNames
- , String referencedTableName, List<String> referencedColNames
- , String joinTableName, List<String> referrerJoinColNames, List<String> referencedJoinColNames) {
- super();
-
- mCustomizer = customizer;
- mReferrerTableName = referrerTableName;
- mReferencedTableName = referencedTableName;
- mReferrerColNames = referrerColNames;
- mReferencedColNames = referencedColNames;
- mJoinTableName = joinTableName;
- mReferrerJoinColNames = referrerJoinColNames;
- mReferencedJoinColNames = referencedJoinColNames;
-
- mCardinality = MANY_TO_MANY;
- mDirectionality = BI_DI;
-
- setCustom(true);
- }
- /**
- * Empty constructor needed by the deserialization (should not be used otherwise).
- */
- public Association() {
- }
- /**
- * Computes the cardinality basedon the forign key definitions.
- */
- public void computeCardinality() {
- /*by default the association is many-to-one unless the foreign key
- * is also the primary key, in which case it is a one-to-one.*/
- mCardinality = MANY_TO_ONE;
-
- List<ORMGenColumn> referrerCols = getReferrerColumns();
- List<ORMGenColumn> pkCols = getReferrerTable().getPrimaryKeyColumns();
- if (pkCols.size() == referrerCols.size()) {
- boolean isFkPk = true;
- for (int i = 0, n = pkCols.size(); i < n; ++i) {
- if (!((ORMGenColumn)pkCols.get(i)).getName().equals(((ORMGenColumn)referrerCols.get(i)).getName())) {
- isFkPk = false;
- break;
- }
- }
- if (isFkPk) {
- mCardinality = ONE_TO_ONE;
- }
- }
-
- setCustom(false);
- }
- /**
- * Called after the asscociations are deserialized to attach
- * the customizer object.
- */
- protected void restore(ORMGenCustomizer customizer) {
- mCustomizer = customizer;
-
- if (mReferrerRole != null) {
- mReferrerRole.restore(this);
- }
- if (mReferencedRole != null) {
- mReferencedRole.restore(this);
- }
- }
- public ORMGenTable getReferrerTable() {
- return mCustomizer.getTable(mReferrerTableName);
- }
- public String getReferrerTableName() {
- return mReferrerTableName;
- }
- public ORMGenTable getReferencedTable() {
- return mCustomizer.getTable(mReferencedTableName);
- }
- public String getReferencedTableName() {
- return mReferencedTableName;
- }
- public ORMGenTable getJoinTable() {
- return mCustomizer.getTable(mJoinTableName);
- }
- public String getJoinTableName() {
- return mJoinTableName;
- }
- /**
- * Returns the <code>ORMGenColumn</code> objects for the referrer
- * columns.
- */
- public List<ORMGenColumn> getReferrerColumns() {
- if (mReferrerCols == null) {
- ORMGenTable referrerTable = getReferrerTable();
- mReferrerCols = referrerTable.getColumnsByNames(mReferrerColNames);
- }
- return mReferrerCols;
- }
- public List<String> getReferrerColumnNames() {
- return mReferrerColNames;
- }
- /**
- * Returns the <code>ORMGenColumn</code> objects for the referenced
- * columns.
- */
- public List<ORMGenColumn> getReferencedColumns() {
- if (mReferencedCols == null) {
- mReferencedCols = getReferencedTable().getColumnsByNames(mReferencedColNames);
- }
- return mReferencedCols;
- }
- public List<String> getReferencedColumnNames() {
- return mReferencedColNames;
- }
- public List<ORMGenColumn> getReferrerJoinColumns() {
- if (mReferrerJoinCols == null) {
- mReferrerJoinCols = getJoinTable().getColumnsByNames(mReferrerJoinColNames);
- }
- return mReferrerJoinCols;
- }
- public List<String> getReferrerJoinColumnNames() {
- return mReferrerJoinColNames;
- }
- public List<ORMGenColumn> getReferencedJoinColumns() {
- if (mReferencedJoinCols == null) {
- mReferencedJoinCols = getJoinTable().getColumnsByNames(mReferencedJoinColNames);
- }
- return mReferencedJoinCols;
- }
- public List<String> getReferencedJoinColumnNames() {
- return mReferencedJoinColNames;
- }
- /**
- * Returns the association cardinality, one of {@link #MANY_TO_ONE}|{@link #MANY_TO_MANY}
- * |{@link #ONE_TO_ONE}|{@link #ONE_TO_MANY}
- */
- public String getCardinality() {
- return mCardinality;
- }
- public void setCardinality(String cardinality) {
- assert(cardinality.equals(MANY_TO_ONE) || cardinality.equals(MANY_TO_MANY) || cardinality.equals(ONE_TO_ONE) || cardinality.equals(ONE_TO_MANY));
- mCardinality = cardinality;
- }
- /**
- * Returns the association directionality, one of {@link #BI_DI}|{@link #NORMAL_DI}
- * |{@link #OPPOSITE_DI}
- */
- public String getDirectionality() {
- return mDirectionality;
- }
- public void setDirectionality(String dir) {
- assert(dir.equals(BI_DI) || dir.equals(NORMAL_DI) || dir.equals(OPPOSITE_DI));
- if (!dir.equals(mDirectionality)) {
- mDirectionality = dir;
-
- if (dir.equals(NORMAL_DI)) {
- mReferencedRole = null;
- } else if (dir.equals(OPPOSITE_DI)) {
- mReferrerRole = null;
- }
- }
- }
-
- /**
- * Tests whether this association is bidirectional.
- * This is a shortcut for <code>getDirectionality().equals(BI_DI)</code>.
- */
- public boolean isBidirectional() {
- return mDirectionality.equals(BI_DI);
- }
- /**
- * Returns true of this association should be generated.
- */
- public boolean isGenerated() {
- return (mFlags & GENERATED) != 0;
- }
- public void setGenerated(boolean generated) {
- if (generated != isGenerated()) {
- if (generated) {
- mFlags |= GENERATED;
- } else {
- mFlags &= ~GENERATED;
- }
- mReferrerRole = mReferencedRole = null;
- }
- }
- /**
- * Returns true of this association is custom (i.e is not auto computed from foreign keys relationships).
- */
- public boolean isCustom() {
- return (mFlags & CUSTOM) != 0;
- }
- public void setCustom(boolean custom) {
- if (custom) {
- mFlags |= CUSTOM;
- } else {
- mFlags &= ~CUSTOM;
- }
- }
- /**
- * Returns the association role for the referrer side, or null
- * if none (i.e if the directionality does not include it).
- */
- public AssociationRole getReferrerRole() {
- if (mReferrerRole == null && isGenerated()) {
- if (!getDirectionality().equals(OPPOSITE_DI)) { //BI_DI or NORMAL_DI
- mReferrerRole = new AssociationRole(this, true/*isReferrerEnd*/);
- }
- }
- return mReferrerRole;
- }
- /**
- * Returns the association role for the referenced side, or null
- * if none (i.e if the directionality does not include it).
- */
- public AssociationRole getReferencedRole() {
- if (mReferencedRole == null && isGenerated()) {
- if (!getDirectionality().equals(Association.NORMAL_DI)) { //BI_DI or OPPOSITE_DI
- mReferencedRole = new AssociationRole(this, false/*isReferrerEnd*/);
- }
- }
- return mReferencedRole;
- }
- /**
- * Tests whether this association is valid (valid table and column names).
- */
- protected boolean isValid(){
- if (!isValidTableAndColumns(mReferrerTableName, mReferrerColNames)
- || !isValidTableAndColumns(mReferencedTableName, mReferencedColNames)) {
- return false;
- }
- if (mJoinTableName != null) {
- if (!isValidTableAndColumns(mJoinTableName, mReferrerJoinColNames)
- || !isValidTableAndColumns(mJoinTableName, mReferencedJoinColNames)) {
- return false;
- }
- }
- return true;
- }
- private boolean isValidTableAndColumns(String tableName, List<String> columnNames) {
- ORMGenTable table = mCustomizer.getTable(tableName);
- if (table == null) {
- return false;
- }
- for (int i = 0, n = columnNames.size(); i < n; ++i) {
- String colName = (String)columnNames.get(i);
- if (table.getColumnByName(colName) == null) {
- return false;
- }
- }
- return true;
- }
-
- public void setForeignKey(ForeignKey foreignKey) {
- this.mForeignKey = foreignKey;
-
- }
- public ForeignKey getForeignKey(){
- return this.mForeignKey;
- };
- public boolean equals(Object obj) {
- if( this == obj )
- return true;
- if( obj instanceof Association ){
- Association association2 = (Association)obj;
- if (!this.getReferrerTableName().equals(association2.getReferrerTableName())
- || !this.getReferencedTableName().equals(association2.getReferencedTableName())
- || !StringUtil.equalObjects(this.getJoinTableName(), association2.getJoinTableName())
- || !this.getReferrerColumnNames().equals(association2.getReferrerColumnNames())
- || !this.getReferencedColumnNames().equals(association2.getReferencedColumnNames())
- ) {
- return false;
- }
- /*the 2 association have the same referrer, referenced and join table*/
- //If MTO or OTM association
- if (this.getJoinTableName() == null) {
- return true;
- }
- if (this.getReferrerJoinColumnNames().equals(association2.getReferrerJoinColumnNames())
- && this.getReferencedJoinColumnNames().equals(association2.getReferencedJoinColumnNames())) {
- return true;
- }
- }
- return false;
- }
- public String toString(){
- return mReferrerTableName + " " + mCardinality + " " + mReferencedTableName ;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/AssociationRole.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/AssociationRole.java
deleted file mode 100644
index 733d0f3501..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/AssociationRole.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Represents an association role (the referrer or referenced role).
- *
- */
-public class AssociationRole implements java.io.Serializable
-{
- private transient Association mAssociation; //transient: see restore
- private boolean mIsReferrerRole;
- private String mPropertyName;
- private String mCascade;
-
- private final static long serialVersionUID = 1;
-
- AssociationRole(Association association, boolean isReferrerRole) {
- super();
-
- mAssociation = association;
- mIsReferrerRole = isReferrerRole;
- }
-
- /**
- * Empty constructor needed by the deserialization (should not be used otherwise).
- */
- public AssociationRole() {
- }
-
- /**
- * Called after the asscociations are deserialized to attach
- * the customizer object.
- */
- protected void restore(Association association) {
- mAssociation = association;
- }
-
- public Association getAssociation() {
- return mAssociation;
- }
-
- public boolean isReferrerRole() {
- return mIsReferrerRole;
- }
-
- /**
- * Returns the opposite role or null if the association
- * is not bi directional.
- */
- public AssociationRole getOppositeRole() {
- Association association = getAssociation();
- if (!association.getDirectionality().equals(Association.BI_DI)) {
- return null;
- }
- if (isReferrerRole()) {
- return association.getReferencedRole();
- } else {
- return association.getReferrerRole();
- }
- }
-
- /**
- * Returns the association cardinality, one of {@link #MANY_TO_ONE}|{@link #MANY_TO_MANY}
- * |{@link #ONE_TO_ONE}|{@link #ONE_TO_MANY}
- */
- public String getCardinality() {
- String type = mAssociation.getCardinality();
- if (!mIsReferrerRole) {
- if (type.equals(Association.ONE_TO_MANY)) {
- type = Association.MANY_TO_ONE;
- } else if (type.equals(Association.MANY_TO_ONE)) {
- type = Association.ONE_TO_MANY;
- }
- }
- return type;
- }
-
- public ORMGenTable getReferrerTable() {
- if (mIsReferrerRole) {
- return mAssociation.getReferrerTable();
- } else {
- return mAssociation.getReferencedTable();
- }
- }
-
- public List<ORMGenColumn> getReferrerColumns(){
- if (mIsReferrerRole) {
- return mAssociation.getReferrerColumns();
- } else {
- return mAssociation.getReferencedColumns();
- }
- }
-
- /**
- * Returns the referenced column corresponding to a referrer column.
- */
- public ORMGenColumn getReferencedColumn(String referrerColumn) {
- boolean hasJoinTable = mAssociation.getJoinTable() != null;
- List<ORMGenColumn> referrerColumns = getReferrerColumns();
- for (int i = 0, n = referrerColumns.size(); i < n; ++i) {
- ORMGenColumn column = referrerColumns.get(i);
- if (column.getName().equals(referrerColumn)) {
- if (hasJoinTable) {
- return getReferrerJoinColumns().get(i);
- } else {
- return getReferencedColumns().get(i);
- }
- }
- }
- assert(false);
- return null;
- }
-
- /**
- * Returns the referrer column corresponding to a referenced column.
- */
- public ORMGenColumn getReferrerColumn(String referencedColumn) {
- boolean hasJoinTable = mAssociation.getJoinTable() != null;
- List<ORMGenColumn> referencedColumns = getReferencedColumns();
- for (int i = 0, n = referencedColumns.size(); i < n; ++i) {
- ORMGenColumn column = referencedColumns.get(i);
- if (column.getName().equals(referencedColumn)) {
- if (hasJoinTable) {
- return getReferencedJoinColumns().get(i);
- } else {
- return getReferrerColumns().get(i);
- }
- }
- }
- assert(false);
- return null;
- }
-
- public ORMGenTable getReferencedTable() {
- if (mIsReferrerRole) {
- return mAssociation.getReferencedTable();
- } else {
- return mAssociation.getReferrerTable();
- }
- }
-
- public List<ORMGenColumn> getReferencedColumns() {
- if (mIsReferrerRole) {
- return mAssociation.getReferencedColumns();
- } else {
- return mAssociation.getReferrerColumns();
- }
- }
-
- public List<ORMGenColumn> getReferrerJoinColumns() {
- if (mIsReferrerRole) {
- return mAssociation.getReferrerJoinColumns();
- } else {
- return mAssociation.getReferencedJoinColumns();
- }
- }
- public List<ORMGenColumn> getReferencedJoinColumns() {
- if (mIsReferrerRole) {
- return mAssociation.getReferencedJoinColumns();
- } else {
- return mAssociation.getReferrerJoinColumns();
- }
- }
-
- /**
- * Returns the name that should be used by the generator for
- * the property corresponding to this role.
- */
- public String getPropertyName() {
- if (mPropertyName != null) { //if the user explicitly set it then don't be too smart
- return mPropertyName;
- }
- return getDefaultPropertyName();
- }
-
- private String getDefaultPropertyName() {
- String propName = "";
- ORMGenTable referrerTable = getReferrerTable();
- ORMGenTable referencedTable = getReferencedTable();
-
- boolean isSingular = isSingular();
- propName = referencedTable.getVarName(isSingular);
-
- List<AssociationRole> clashingRoles = new java.util.ArrayList<AssociationRole>(); //roles with our same referrer and referenced tables (i.e would yield the same property name in the same bean)
- /*make sure there is no role with the same name.*/
- for (Iterator<AssociationRole> iter = referrerTable.getAssociationRoles().iterator(); iter.hasNext(); ) {
- AssociationRole role = iter.next();
- if (role.getReferrerTable().getName().equals(referrerTable.getName())
- && role.getReferencedTable().getName().equals(referencedTable.getName())
- && role.isSingular() == isSingular) {
- clashingRoles.add(role);
- }
- }
- if (clashingRoles.size() > 1) {
- int index = clashingRoles.indexOf(this);
- assert(index >= 0);
- propName += index+1;
- }
-
- /*make sure there is no column with the same name.*/
- for (Iterator<ORMGenColumn> iter = referrerTable.getColumns().iterator(); iter.hasNext(); ) {
- ORMGenColumn column = iter.next();
- if (column.getPropertyName().equals(propName)) {
- String prefix = isSingular ? "Bean" : "Set";
- propName += prefix;
- break;
- }
- }
-
- return propName;
- }
-
- private boolean isSingular() {
- String cardinality = getCardinality();
- return cardinality.equals(Association.ONE_TO_ONE) || cardinality.equals(Association.MANY_TO_ONE);
- }
-
- /**
- * Changes the name that should be used by the generator for
- * the property corresponding to this role.
- * If the argument name is null or empty string then the
- * default computed name is used.
- */
- public void setPropertyName(String name) {
- if (name != null && name.length() == 0) {
- name = null;
- }
- if (name != null && name.equals(getDefaultPropertyName())) {
- name = null;
- }
- mPropertyName = name;
- }
-
- /**
- * Returns the cascade value for this role.
- * An empty string will return if none.
- */
- public String getCascade() {
- return mCascade;
- }
-
- public void setCascade(String cascade) {
- // if no checkbox is selected, set cascade to an empty string
- if (cascade != null && cascade.length() == 0) {
- cascade = StringTools.EMPTY_STRING;
- }
- mCascade = cascade;
- }
-
- /**
- * Returns a descriptive string used in a comment in the generated
- * file (from the Velocity template).
- */
- public String getDescription() {
- //<!-- $directionality $cardinality association to $referencedClassName -->
- String directionality;
- if (getAssociation().getDirectionality().equals(Association.BI_DI)) {
- directionality = "bi-directional";
- } else {
- directionality = "uni-directional";
- }
- return directionality + " " + getAssociation().getCardinality() + " association to " + getReferencedTable().getClassName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/BaseEntityGenCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/BaseEntityGenCustomizer.java
deleted file mode 100644
index 8e34042a60..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/BaseEntityGenCustomizer.java
+++ /dev/null
@@ -1,278 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.io.File;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.gen.internal.util.DTPUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-/**
- * Default implementation of ORMGenCustomizer according to JPA specification for
- * entity generation.
- *
- * This is used to retrieve/change the properties from the wizard and is also
- * passed as a context object to Velocity.
- */
-public class BaseEntityGenCustomizer extends ORMGenCustomizer
- implements java.io.Serializable
-{
- private final static long serialVersionUID = 1;
-
- /* mapping kinds */
- private static final String BASIC_MAPPING_KIND = "basic"; //$NON-NLS-1$
- private static final String ID_MAPPING_KIND = "id"; //$NON-NLS-1$
- private static final String VERSION_MAPPING_KIND = "version"; //$NON-NLS-1$
-
- /*
- * the strings for generator names. These appear in a combo box and used by
- * the Velocity template processing.
- */
- private static final String AUTO_GENERATOR = "auto"; //$NON-NLS-1$
- private static final String NONE_GENERATOR = "none"; //$NON-NLS-1$
- private static final String IDENTITY_GENERATOR = "identity"; //$NON-NLS-1$
- private static final String SEQUENCE_GENERATOR = "sequence"; //$NON-NLS-1$
- private static final String TABLE_GENERATOR = "table"; //$NON-NLS-1$
-
- public BaseEntityGenCustomizer() {
- super();
- }
-
- @Override
- public void init(File file, Schema schema) {
- super.init(file, schema);
- }
-
- // -----------------------------------------
- // ------ ORMGenCustomizer methods
- // -----------------------------------------
- @Override
- public List<String> getAllIdGenerators() {
- List<String> result = new java.util.ArrayList<String>(5);
- /* add in the order in which they would appear in the combo */
- result.add(AUTO_GENERATOR);
- result.add(IDENTITY_GENERATOR);
- result.add(SEQUENCE_GENERATOR);
- result.add(TABLE_GENERATOR);
- result.add(NONE_GENERATOR);
- return result;
- }
-
- @Override
- public String getNoIdGenerator() {
- return NONE_GENERATOR;
- }
-
- @Override
- public String getIdentityIdGenerator() {
- return IDENTITY_GENERATOR;
- }
-
- @Override
- public Set<String> getSequenceIdGenerators() {
- Set<String> result = new java.util.HashSet<String>(3);
- result.add(SEQUENCE_GENERATOR);
- return result;
- }
-
- @Override
- public String getPropertyTypeFromColumn(Column column) {
- return DTPUtil.getJavaType(column);
- }
-
- @Override
- @SuppressWarnings("nls")
- public String[] getAllPropertyTypes() {
- /*
- * Java primitive types, wrapper of the primitive types ,
- * java.lang.String, java.math.BigInteger, java.math.BigDecimal,
- * java.util.Date, java.util.Calendar, java.sql.Date, java.sql.Time,
- * java.sql.Timestamp, byte[], Byte[], char[], Character[], enums, and
- * any other type that implements Serializable.
- */
- // return in the order that will be used in the combo
- return new String[] {
- "boolean",
- "Boolean",
- "byte",
- "Byte",
- "byte[]",
- "char",
- "char[]",
- "Character",
- "Character[]",
- "double",
- "Double",
- "float",
- "Float",
- "int",
- "Integer",
- "long",
- "Long",
- "Object",
- "short",
- "Short",
- "String",
- java.math.BigDecimal.class.getName(),
- java.math.BigInteger.class.getName(),
- java.util.Calendar.class.getName(),
- java.util.Date.class.getName(),
- java.sql.Date.class.getName(),
- java.sql.Time.class.getName(),
- java.sql.Timestamp.class.getName()
- };
- }
-
- @Override
- public String[] getAllMappingKinds() {
- return new String[] {
- BASIC_MAPPING_KIND, ID_MAPPING_KIND, VERSION_MAPPING_KIND
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String getBasicMappingKind() {
- return BASIC_MAPPING_KIND;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String getIdMappingKind() {
- return ID_MAPPING_KIND;
- }
-
- @Override
- public boolean editCascade(AssociationRole role) {
- return false;
- }
-
- @Override
- protected boolean manySideIsAssociationOwner() {
- return true;
- }
-
- // -----------------------------------------
- // ---- Velocity templates methods
- // -----------------------------------------
- /**
- * Returns the cascades annotation member value, or empty string if none.
- * Empty string is returned instead of null because Velocity does not like
- * null when used in #set.
- */
- public String genCascades(AssociationRole role) {
- List<String> cascades = StringUtil.strToList(role.getCascade(), ',', true/* trim */);
- if (cascades == null) {
- return ""; //$NON-NLS-1$
- }
- StringBuffer buffer = new StringBuffer();
- buffer.append( '{' );
- for (int i = 0, n = cascades.size(); i < n; ++i) {
- String cascade = cascades.get(i);
- String enumStr;
- if (cascade.equals(TagNames.ALL_CASCADE)) {
- enumStr = "CascadeType.ALL"; //$NON-NLS-1$
- }
- else if (cascade.equals(TagNames.PERSIST_CASCADE)) {
- enumStr = "CascadeType.PERSIST"; //$NON-NLS-1$
- }
- else if (cascade.equals(TagNames.MERGE_CASCADE)) {
- enumStr = "CascadeType.MERGE"; //$NON-NLS-1$
- }
- else if (cascade.equals(TagNames.REMOVE_CASCADE)) {
- enumStr = "CascadeType.REMOVE"; //$NON-NLS-1$
- }
- else {
- assert (cascade.equals(TagNames.REFRESH_CASCADE));
- enumStr = "CascadeType.REFRESH"; //$NON-NLS-1$
- }
- if (i != 0) {
- buffer.append(", "); //$NON-NLS-1$
- }
- buffer.append(enumStr);
- }
- buffer.append('}');
- return buffer.toString();
- }
-
- public String genCascadesXml(AssociationRole role) {
- List<String> cascades = StringUtil.strToList(role.getCascade(), ',', true/* trim */);
- if (cascades == null) {
- return ""; //$NON-NLS-1$
- }
- StringBuffer buffer = new StringBuffer();
- for (int i = 0, n = cascades.size(); i < n; ++i) {
- String cascade = cascades.get(i);
- String enumStr;
- if (cascade.equals(TagNames.ALL_CASCADE)) {
- enumStr = "<cascade-all></cascade-all>"; //$NON-NLS-1$
- }
- else if (cascade.equals(TagNames.PERSIST_CASCADE)) {
- enumStr = "<cascade-persist></cascade-persist>"; //$NON-NLS-1$
- }
- else if (cascade.equals(TagNames.MERGE_CASCADE)) {
- enumStr = "<cascade-merge></cascade-merge>"; //$NON-NLS-1$
- }
- else if (cascade.equals(TagNames.REMOVE_CASCADE)) {
- enumStr = "<cascade-remove></cascade-remove>"; //$NON-NLS-1$
- }
- else {
- assert (cascade.equals(TagNames.REFRESH_CASCADE));
- enumStr = "<cascade-refresh></cascade-refresh>"; //$NON-NLS-1$
- }
- if (i != 0) {
- buffer.append("\n\t\t\t\t\t"); //$NON-NLS-1$
- }
- buffer.append(enumStr);
- }
- return buffer.toString();
- }
-
- /**
- * Returns the fetch type annotation member value, or empty string if none.
- * Empty string is returned instead of null because Velocity does not like
- * null when used in #set.
- */
- @Override
- public String genFetch(ORMGenTable table) {
- String fetch = table.getDefaultFetch();
- if (fetch == null || ORMGenTable.DEFAULT_FETCH.equals(fetch)) {
- return ""; //$NON-NLS-1$
- }
- else if (fetch.equals(ORMGenTable.LAZY_FETCH)) {
- return "FetchType.LAZY"; //$NON-NLS-1$
- }
- else {
- return "FetchType.EAGER"; //$NON-NLS-1$
- }
- }
-
- @Override
- public String genFetchXml(ORMGenTable table) {
- String fetch = table.getDefaultFetch();
- if (fetch == null || ORMGenTable.DEFAULT_FETCH.equals(fetch)) {
- return ""; //$NON-NLS-1$
- }
- else if (fetch.equals(ORMGenTable.LAZY_FETCH)) {
- return "LAZY"; //$NON-NLS-1$
- }
- else {
- return "EAGER"; //$NON-NLS-1$
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/DatabaseAnnotationNameBuilder.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/DatabaseAnnotationNameBuilder.java
deleted file mode 100644
index 91b53c1338..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/DatabaseAnnotationNameBuilder.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Table;
-
-
-/**
- * Provide a pluggable way to determine whether and how the entity generator
- * prints the names of various database objects.
- */
-public interface DatabaseAnnotationNameBuilder {
-
- /**
- * Given the name of an entity and the table to which it is mapped,
- * build and return a string to be used as the value for the entity's
- * Table annotation's 'name' element. Return null if the entity
- * maps to the table by default.
- */
- String buildTableAnnotationName(String entityName, Table table);
-
- /**
- * Given the name of an attribute (field or property) and the column
- * to which it is mapped,
- * build and return a string to be used as the value for the attribute's
- * Column annotation's 'name' element. Return null if the attribute
- * maps to the column by default.
- */
- String buildColumnAnnotationName(String attributeName, Column column);
-
- /**
- * Given the name of an attribute (field or property) and the
- * many-to-one or many-to-many foreign key to which it is mapped,
- * build and return a string to be used as the value for the attribute's
- * JoinColumn annotation's 'name' element. Return null if the attribute
- * maps to the join column by default.
- * The specified foreign key consists of a single column pair whose
- * referenced column is the single-column primary key of the foreign
- * key's referenced table.
- */
- String buildJoinColumnAnnotationName(String attributeName, ForeignKey foreignKey);
-
- /**
- * Build and return a string to be used as the value for a JoinColumn
- * annotation's 'name' or 'referencedColumnName' element.
- * This is called for many-to-one and many-to-many mappings when
- * the default join column name and/or referenced column name are/is
- * not applicable.
- * @see buildJoinColumnAnnotationName(String, ForeignKey)
- */
- String buildJoinColumnAnnotationName(Column column);
-
- /**
- * Build and return a string to be used as the value for a JoinTable
- * annotation's 'name' element.
- * This is called for many-to-many mappings when the default
- * join table name is not applicable.
- */
- String buildJoinTableAnnotationName(Table table);
-
-
- /**
- * The default implementation simple returns the database object's name,
- * unaltered.
- */
- final class Default
- implements DatabaseAnnotationNameBuilder
- {
- public static final DatabaseAnnotationNameBuilder INSTANCE = new Default();
- public static DatabaseAnnotationNameBuilder instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Default() {
- super();
- }
- public String buildTableAnnotationName(String entityName, Table table) {
- return table.getName();
- }
- public String buildColumnAnnotationName(String attributeName, Column column) {
- return column.getName();
- }
- public String buildJoinColumnAnnotationName(String attributeName, ForeignKey foreignKey) {
- return foreignKey.getColumnPair().getBaseColumn().getName();
- }
- public String buildJoinColumnAnnotationName(Column column) {
- return column.getName();
- }
- public String buildJoinTableAnnotationName(Table table) {
- return table.getName();
- }
- @Override
- public String toString() {
- return StringTools.buildSingletonToString(this);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptGenMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptGenMessages.java
deleted file mode 100644
index 16073bc071..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptGenMessages.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali entity generation.
- */
-public class JptGenMessages {
-
- public static String PackageGenerator_taskName;
- public static String GenScope_taskName;
- public static String EntityGenerator_taskName;
- public static String Templates_notFound;
- public static String Error_Generating_Entities;
- public static String Delete_Folder_Error;
- public static String Delete_File_Error;
- public static String File_Read_Only_Error;
-
- private static final String BUNDLE_NAME = "jpt_gen"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptGenMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptGenMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptJpaGenPlugin.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptJpaGenPlugin.java
deleted file mode 100644
index d99645f6b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/JptJpaGenPlugin.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.ILog;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.osgi.framework.Bundle;
-
-public class JptJpaGenPlugin {
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.gen";
- public static void logException ( String msg, Throwable e ) {
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- ILog log = Platform.getLog(bundle);
- log.log(new Status(IStatus.ERROR, PLUGIN_ID, msg, e ));
- }
-
- public static void logException( CoreException ce ) {
- IStatus status = ce.getStatus();
- Bundle bundle = Platform.getBundle(PLUGIN_ID);
- ILog log = Platform.getLog(bundle);
- log.log(new Status(IStatus.ERROR, PLUGIN_ID, status.getMessage(), ce));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java
deleted file mode 100644
index 6fed0571d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenColumn.java
+++ /dev/null
@@ -1,419 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.util.Collections;
-import java.util.Iterator;
-
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.gen.internal.util.EntityGenTools;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-
-/**
- * Represents the ORM generation properties for a database
- * column.
- *
- * <p>This is designed to be created/changed by the generation wizard,
- * and generated using Velocity templates.
- * The modified properties (if any) are persisted/retrieved using
- * <code>ORMGenCustomizer</code>.
- *
- */
-public class ORMGenColumn
-{
- private Table mTable;
- private Column mDbColumn;
- private ORMGenCustomizer mCustomizer;
- private ORMGenTable mGenTable;
- private static String JAVA_LANG_PACKAGE = "java.lang."; //$NON-NLS-1$
-
- public ORMGenColumn(Column dbColumn, ORMGenCustomizer customizer) {
- super();
-
- mDbColumn = dbColumn;
- mCustomizer = customizer;
- mTable = dbColumn.getTable();
- }
-
- public ORMGenCustomizer getCustomizer() {
- return mCustomizer;
- }
-
- public void setGenTable(ORMGenTable ormGenTable) {
- mGenTable = ormGenTable;
- }
-
- protected String customized(String propName) {
- return getCustomizer().getProperty(propName, mTable.getName(), getDbName());
- }
-
- protected boolean customizedBoolean(String propName) {
- return getCustomizer().getBooleanProperty(propName, mTable.getName(), getDbName());
- }
-
- protected void setCustomized(String propName, String value) {
- if (value != null && value.length() == 0) {
- value = null;
- }
- getCustomizer().setProperty(propName, value, mTable.getName(), getDbName());
- }
-
- protected void setCustomizedBoolean(String propName, boolean value, boolean defaultValue) {
- if (defaultValue == value) {
- setCustomized(propName, null); //remove the property
- } else {
- getCustomizer().setBooleanProperty(propName, value, mTable.getName(), getDbName());
- }
- }
-
- /**
- * Returns the column name.
- */
- public String getName() {
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().
- buildColumnAnnotationName(mDbColumn.getName(), mDbColumn);
- return annotationName != null ? annotationName : mDbColumn.getName();
- }
-
- public String getDbName() {
- return mDbColumn.getName();
- }
-
- public String getJoinColumnName(){
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().
- buildJoinColumnAnnotationName(mDbColumn);
- return annotationName != null ? annotationName : mDbColumn.getName();
- }
-
- public Column getDbColumn() {
- return this.mDbColumn;
- }
-
- /**
- * Returns the generated bean property name for the given column.
- * Does not return null.
- */
- public String getPropertyName() {
- String name = customized(PROPERTY_NAME);
- if (name == null) {
- //name = StringUtil.columnNameToVarName(getName());
- name = EntityGenTools.convertToUniqueJavaStyleAttributeName(getDbName(), Collections.<String>emptySet());
- }
- return name;
- }
-
- public void setPropertyName(String name) {
- if (!StringUtil.equalObjects(name, getPropertyName())) {
- setCustomized(PROPERTY_NAME, name);
- }
- }
-
- /**
- * Return true if the values of name element in the @Column is default
- * so we can skip generating the annotation
- *
- * @return true
- */
- public boolean isDefault(){
- return isDefaultname() && isUpdateable() && isInsertable();
- }
-
- /**
- * Return true if the values of name element in the @Column is default
- * so we can skip generating the annotation
- *
- * @return true
- */
- public boolean isDefaultname(){
- String propName = getPropertyName();
-// String dbColumnName = getName();
-// return propName.equalsIgnoreCase( dbColumnName );
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().
- buildColumnAnnotationName(propName, this.mDbColumn );
- return annotationName==null;
- }
-
- /**
- * Return true if the values of name element in the @Column is default
- * so we can skip generating the annotation
- *
- * @return true
- */
- public boolean isDefaultJoinColumnName(String associationRolePropName){
- if( !this.mDbColumn.isPartOfForeignKey()){
- return false;
- }
-
- Iterable<ForeignKey> it = mDbColumn.getTable().getForeignKeys();
- Iterator<ForeignKey> i = it.iterator();
- while( i.hasNext() ){
- ForeignKey fk = i.next();
- Column c = fk.getBaseColumns().iterator().next();
- if( c.equals( this.mDbColumn ) ){
- try{
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().
- buildJoinColumnAnnotationName(associationRolePropName, fk );
- return annotationName==null;
- }catch(Exception e){
- //catch the case that referenced table has multiple primary key columns
- return false;
- }
- }
- }
- return false;
- }
-
-
- /**
- * Returns the column type.
- * Does not return null.
- */
- public String getPropertyType() {
- String type = customized(PROPERTY_TYPE);
- if (type == null) {
- type = getCustomizer().getPropertyTypeFromColumn( this.mDbColumn );
- }
- if( type.startsWith(JAVA_LANG_PACKAGE) ) {
- type = type.substring( JAVA_LANG_PACKAGE.length() );
- }
- if( type.equals("java.sql.Date")){ //$NON-NLS-1$
- type = "java.util.Date"; //$NON-NLS-1$
- }
-
- return type;
- }
-
- public String getSimplePropertyType() {
- return mGenTable.getSimplifiedColType( getPropertyType() );
- }
-
- public void setPropertyType(String type) {
- if (!StringUtil.equalObjects(type, getPropertyType())) {
- setCustomized(PROPERTY_TYPE, type);
- }
- }
- /**
- * Returns true if the column type is numeric.
- */
- public boolean isNumeric() {
- boolean ret = this.mDbColumn.isNumeric();
- return ret;
- }
-
- /**
- * Returns the mapping kind, one of {@link #PROPERTY_MAPPING_KIND}|{@link #ID_MAPPING_KIND}
- * |{@link #VERSION_MAPPING_KIND}|{@link #TIMESTAMP_MAPPING_KIND}.
- *
- * This method does not return null (defaults to basic property type).
- */
- public String getMappingKind() {
- String kind = customized(MAPPING_KIND);
- if (kind == null) {
- kind = getCustomizer().getBasicMappingKind();
-
- if ( this.mDbColumn.isPartOfPrimaryKey()
- && this.mDbColumn.getTable().getPrimaryKeyColumnsSize() == 1) {
- kind = getCustomizer().getIdMappingKind();
- }
- }
- return kind;
- }
-
- public void setMappingKind(String mappingKind) {
- if (!StringUtil.equalObjects(mappingKind, getMappingKind())) {
- setCustomized(MAPPING_KIND, mappingKind);
- }
- }
-
- public boolean isNullable() {
- return this.mDbColumn.isNullable();
- }
-
- public int getSize() {
- if ( this.mDbColumn.isNumeric()){
- return mDbColumn.getPrecision();
- }
- return mDbColumn.getLength();
- }
-
- public int getDecimalDigits() {
- if ( this.mDbColumn.isNumeric() ){
- return mDbColumn.getScale();
- }
- return -1;
- }
-
- public boolean isPrimaryKey() {
- return this.mDbColumn.isPartOfPrimaryKey();
- }
-
- public boolean isPartOfCompositePrimaryKey() {
- return this.mDbColumn.isPartOfPrimaryKey() &&
- this.mTable.getPrimaryKeyColumnsSize() > 1;
- }
-
- public boolean isForeignKey() {
- return this.mDbColumn.isPartOfForeignKey();
- }
-
- public boolean isUnique() {
- return this.mDbColumn.isPartOfUniqueConstraint();
- }
-
- public String getPropertyDescription() {
- return customized(PROPERTY_DESC);
- }
-
- public boolean isDataTypeLOB() {
- return this.mDbColumn.isLOB();
- }
-
- public boolean isNeedMapTemporalType() {
- String propertyType = this.getPropertyType();
- return ( propertyType.equals("java.util.Date") || propertyType.equals("java.util.Calendar") ); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- public String getTemporalType() {
- String defaultType = getCustomizer().getPropertyTypeFromColumn( this.mDbColumn );
- if( defaultType.equals("java.sql.Date")){ //$NON-NLS-1$
- return "DATE"; //$NON-NLS-1$
- }else if( defaultType.equals("java.sql.Time")){ //$NON-NLS-1$
- return "TIME"; //$NON-NLS-1$
- }else {
- return "TIMESTAMP"; //$NON-NLS-1$
- }
- }
-
- /**
- * Returns the generated property getter scope, one of {@link #PUBLIC_SCOPE}|{@link #PROTECTED_SCOPE}
- * |{@link #PRIVATE_SCOPE}.
- * This method never returns null (defaults to public).
- */
- public String getPropertyGetScope() {
- String scope = customized(PROPERTY_GET_SCOPE);
- if (scope == null) {
- scope = PUBLIC_SCOPE;
- }
- return scope;
- }
-
- public void setPropertyGetScope(String scope) {
- if (!StringUtil.equalObjects(scope, getPropertyGetScope())) {
- setCustomized(PROPERTY_GET_SCOPE, scope);
- }
- }
-
- /**
- * Returns the generated property setter scope, one of {@link #PUBLIC_SCOPE}|{@link #PROTECTED_SCOPE}
- * |{@link #PRIVATE_SCOPE}.
- * This method never returns null (defaults to public).
- */
- public String getPropertySetScope() {
- String scope = customized(PROPERTY_SET_SCOPE);
- if (scope == null) {
- scope = PUBLIC_SCOPE;
- }
- return scope;
- }
-
- public void setPropertySetScope(String scope) {
- if (!StringUtil.equalObjects(scope, getPropertySetScope())) {
- setCustomized(PROPERTY_SET_SCOPE, scope);
- }
- }
-
- /**
- * Returns the generated field member scope, one of {@link #PUBLIC_SCOPE}|{@link #PROTECTED_SCOPE}
- * |{@link #PRIVATE_SCOPE}.
- * This method never returns null (defaults to private).
- */
- public String getFieldScope() {
- String scope = customized(FIELD_SCOPE);
- if (scope == null) {
- scope = PRIVATE_SCOPE;
- }
- return scope;
- }
-
- /**
- * Returns true if this column should be used in the
- * <code>equals</code> method implementation.
- */
- public boolean isUseInEquals() {
- return customizedBoolean(USE_IN_EQUALS) || isPrimaryKey();
- }
-
- public void setUseInEquals(boolean value) {
- setCustomizedBoolean(USE_IN_EQUALS, value, false);
- }
-
- /**
- * Returns true if this column should be used in the
- * <code>toString</code> method implementation.
- */
- public boolean isUseInToString() {
- return customizedBoolean(USE_IN_TO_STRING) || isPrimaryKey();
- }
-
- public void setUseInToString(boolean value) {
- setCustomizedBoolean(USE_IN_TO_STRING, value, false);
- }
-
- public boolean isUpdateable() {
- return !"false".equals(customized(UPDATEABLE)); //defaults to true //$NON-NLS-1$
- }
-
- public void setUpdateable(boolean value) {
- setCustomizedBoolean(UPDATEABLE, value, true);
- }
-
- public boolean isInsertable() {
- return !"false".equals(customized(INSERTABLE)); //defaults to true //$NON-NLS-1$
- }
-
- public void setInsertable(boolean value) {
- setCustomizedBoolean(INSERTABLE, value, true);
- }
-
- public boolean isGenerated() {
- return !"false".equals(customized(GENERATED)); //defaults to true //$NON-NLS-1$
- }
-
- public void setGenerated(boolean value) {
- setCustomizedBoolean(GENERATED, value, true);
- }
-
- @Override
- public String toString() {
- return "name=" + getName() + "; type=" + getPropertyType() ; //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- /*get/set and field scopes*/
- public static final String PUBLIC_SCOPE = "public"; //$NON-NLS-1$
- public static final String PROTECTED_SCOPE = "protected"; //$NON-NLS-1$
- public static final String PRIVATE_SCOPE = "private"; //$NON-NLS-1$
-
- /*customization properties*/
- private static final String PROPERTY_NAME = "propertyName"; //$NON-NLS-1$
- protected static final String PROPERTY_TYPE = "propertyType"; //$NON-NLS-1$
- protected static final String MAPPING_KIND = "mappingKind"; //$NON-NLS-1$
- private static final String PROPERTY_DESC = "propertyDesc"; //$NON-NLS-1$
- private static final String PROPERTY_GET_SCOPE = "propertyGetScope"; //$NON-NLS-1$
- private static final String PROPERTY_SET_SCOPE = "propertySetScope"; //$NON-NLS-1$
- private static final String FIELD_SCOPE = "fieldScope"; //$NON-NLS-1$
- private static final String USE_IN_EQUALS = "useInEquals"; //$NON-NLS-1$
- private static final String USE_IN_TO_STRING = "useInToString"; //$NON-NLS-1$
- private static final String UPDATEABLE = "updateable"; //$NON-NLS-1$
- private static final String INSERTABLE = "insertable"; //$NON-NLS-1$
- private static final String GENERATED = "genProperty"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenCustomizer.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenCustomizer.java
deleted file mode 100644
index 8770ca2b4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenCustomizer.java
+++ /dev/null
@@ -1,884 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.ObjectInputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.gen.internal.util.DTPUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.FileUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.ForeignKeyInfo;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-/**
- * Contains the information used to customize the database schema to ORM entity
- * generation.
- *
- * <p>The customization settings are mainly exposed in the form of
- * properties. There are no assumptions in this class about the meaning of the
- * property names. Properties can be associated to specific tables and table
- * columns, or globally for any table and/or column.
- *
- * <p>Subclass can implement the sets of abstract methods to provide ORM vendor
- * specific properties.
- *
- */
-public abstract class ORMGenCustomizer implements java.io.Serializable
-{
- private final static long serialVersionUID = 1;
-
- /**
- * A value passed for the table name argument to get/setProperty
- * indicating that the value applies to any table.
- */
- public static final String ANY_TABLE = "__anyTable__";
- public static final String GENERATE_DDL_ANNOTATION = "generateDDLAnnotations";
- /*the string used in the property name in mProps to indicate
- * a null table value.*/
- private static final String NULL_TABLE = "";
- /*the string used in the property name in mProps to indicate
- * a null column value.*/
- private static final String NULL_COLUMN = "";
-
- /*This version number is written in the header of the customization stream
- * and read at de-serialization time, if it is different then the file is invalidated.
- */
- private static final int FILE_VERSION = 2;
-
- private static final String UPDATE_CONFIG_FILE = "updateConfigFile";
-
- private transient Schema mSchema;
- private transient File mFile;
-
- private List<String> mTableNames;
- /*key: table name, value: ORMGenTable object.*/
- private transient Map<String , ORMGenTable> mTables;
- /*the <code>Association</code> objects sorted by their "from"
- * table name. Includes all association derived from foreign keys
- * in user selected tables. Since some of the foreign keys may point to table
- * user does not select, this list may be different from mValidAssociations
- */
- private List<Association> mAssociations;
- /*
- * List of valid associations within the user selected tables
- */
- private transient List<Association> mValidAssociations;
- private transient boolean mInvalidForeignAssociations;
-
- /*the property name is in the form $tableName.$columnName.$propertyName.
- * Where tableName could be NULL_TABLE or ANY_TABLE
- * and columnName could be NULL_COLUMN*/
- private Map<String, String> mProps = new java.util.HashMap<String, String>();
-
- private transient DatabaseAnnotationNameBuilder databaseAnnotationNameBuilder = DatabaseAnnotationNameBuilder.Default.INSTANCE;
-
- private boolean mUpdatePersistenceXml = true;
-
- //EclipseLink mapping file default name
- private static final String DEFAULT_XML_MAPPING_FILE = "META-INF/eclipselink-orm.xml";
- private static final String XML_MAPPING_FILE = "xmlMappingFileName";
-
-
- //-----------------------------------------
- //---- abstract methods
- //-----------------------------------------
- /**
- * Returns all the primary key generator schemes.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract List<String> getAllIdGenerators();
- /**
- * Returns the string representing the developer-assigned id generator.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getNoIdGenerator();
- /**
- * Returns the string representing the identity id generator.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getIdentityIdGenerator();
- /**
- * Returns the strings representing the sequence generators.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract Set<String> getSequenceIdGenerators();
- /**
- * Returns a property type from the given database column.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getPropertyTypeFromColumn(Column column) ;
- /**
- * Returns all the strings representing property types.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String[] getAllPropertyTypes();
- /**
- * Returns all the strings representing property mapping kinds.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String[] getAllMappingKinds();
- /**
- * Returns the basic (default) property mapping kind.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getBasicMappingKind();
- /**
- * Returns the id (primary key) property mapping kind.
- * This can return any strings as far as the Velocity template
- * processor understand them.
- */
- public abstract String getIdMappingKind();
- /**
- * Interacts with the user to edit the cascade of the given
- * role.
- * This method should also call <code>AssociationRole.setCascade</code>.
- *
- * @return false if the user interaction is cancelled.
- */
- public abstract boolean editCascade(AssociationRole role);
-
- //-----------------------------------------
- //-----------------------------------------
-
- /**
- * @param file The file that contains the customization settings.
- * The file is created if necessary when the <code>save</code>
- * method is called.
- */
- public void init( File file, Schema schema) {
- this.mSchema = schema;
- mFile = file;
-
- if (!file.exists()) {
- setProperty(ORMGenTable.DEFAULT_FETCH, ORMGenTable.DEFAULT_FETCH, ORMGenCustomizer.ANY_TABLE, null);
- return;
- }
- InputStream istream = null;
- ObjectInputStream ois = null;
- try
- {
- //read it in a file first to speedup deserialization
- byte[] bytes = FileUtil.readFile(file);
- istream = new ByteArrayInputStream(bytes);
- ois = new ObjectInputStream(istream);
-
- FileHeader header = (FileHeader)ois.readObject();
- if (header.mVersion == FILE_VERSION) {
- ORMGenCustomizer customizer = (ORMGenCustomizer)ois.readObject();
- restore(customizer);
- }
- } catch (Exception ex) {
- JptJpaGenPlugin.logException("***ORMGenCustomizer.load failed "+file, ex);
- }
- finally
- {
- if (ois != null)
- {
- try
- {
- ois.close();
- } catch (IOException e) {
- }
- }
-
- if (istream != null)
- {
- try
- {
- istream.close();
- } catch (IOException e) {
- }
- }
- }
- }
-
- public File getFile(){
- return this.mFile;
- }
-
- public void setSchema(Schema schema){
- this.mSchema = schema;
- }
-
- public Schema getSchema(){
- return mSchema;
- }
-
- /**
- * Empty constructor needed by the deserialization.
- */
- public ORMGenCustomizer() {
- super();
- }
-
- /**
- * Saves the customization file.
- * The file is created if necessary.
- */
- public void save() throws IOException {
- //System.out.println("---ORMGenCustomizer.save: " + mFile);
- if (!mFile.exists() && !mFile.createNewFile()) {
- return;
- }
- java.io.FileOutputStream fos = null;
- java.io.ObjectOutputStream oos = null;
- boolean deleteIt = true;
- try {
- fos = new java.io.FileOutputStream(mFile);
- oos = new java.io.ObjectOutputStream(fos);
- FileHeader header = new FileHeader();
- oos.writeObject(header);
- oos.writeObject(this);
- deleteIt = false;
- } catch (Exception ex) {
- //deleteIt is true, so the cache is not saved.
- CoreException ce = new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID,
- "Unable to save the ORMGenCustomizer file: "+mFile,ex));
- JptJpaGenPlugin.logException( ce );
- } finally {
- try {
- if (oos!=null) oos.close();
- if (fos!=null) fos.close();
- if (deleteIt) {
- mFile.delete();
- }
- } catch (java.io.IOException ex2) {}
- }
- }
-
- public DatabaseAnnotationNameBuilder getDatabaseAnnotationNameBuilder() {
- return this.databaseAnnotationNameBuilder;
- }
- public void setDatabaseAnnotationNameBuilder(DatabaseAnnotationNameBuilder databaseAnnotationNameBuilder) {
- if (databaseAnnotationNameBuilder == null) {
- throw new NullPointerException("database annotation name builder is required"); //$NON-NLS-1$
- }
- this.databaseAnnotationNameBuilder = databaseAnnotationNameBuilder;
- }
-
- /**
- * Returns {@link #GENERATE_DDL_ANNOTATION} indicating whether
- * the optional DDL parameters like length, nullable, unqiue, etc should be generated
- * in @Column annotation.
- * defaults to false.
- */
- public boolean isGenerateDDLAnnotations() {
- return "true".equals(getProperty(GENERATE_DDL_ANNOTATION, ANY_TABLE, null)); //defaults to false
- }
-
- /**
- * Returns a property value.
- */
- public String getProperty(String propertyName, String tableName, String colName) {
- String key = getPropKey(propertyName, tableName, colName);
- String value = mProps.get(key);
- /*if the key does not exist and it is a table property then
- * get the default table property.*/
- if (value == null && tableName != null && colName == null && !tableName.equals(ANY_TABLE)) {
- value = getProperty(propertyName, ANY_TABLE, colName);
- }
- return value;
- }
- /**
- * Changes a property value.
- *
- * @param value The new value, could be null.
- */
- public void setProperty(String propertyName, String value, String tableName, String colName) {
- String key = getPropKey(propertyName, tableName, colName);
- if (value != null) {
- mProps.put(key, value);
- } else {
- mProps.remove(key);
- }
- }
- /**
- * Same as {@link #getProperty(String, String, String)} but
- * converts the value to boolean.
- */
- public boolean getBooleanProperty(String propertyName, String tableName, String colName) {
- String value = getProperty(propertyName, tableName, colName);
- return "true".equals(value);
- }
- /**
- * Changes a table boolean property value.
- */
- public void setBooleanProperty(String propertyName, boolean value, String tableName, String colName) {
- setProperty(propertyName, value ? "true" : "false", tableName, colName);
- }
- /**
- * Returns the names of the tables to generate.
- */
- @SuppressWarnings("unchecked")
- public List<String> getTableNames() {
- return mTableNames != null ? mTableNames : java.util.Collections.EMPTY_LIST;
- }
-
- /**
- * Returns the fetch type annotation member value, or empty string
- * if none.
- * Empty string is returned instead of null because Velocity does not like null
- * when used in #set.
- */
- public String genFetch(ORMGenTable table) {
- return "";
- }
-
- public String genFetchXml(ORMGenTable table) {
- return "";
- }
-
- /**
- * XML Mapping File Path
- */
- public void setXmlMappingFile(String xmlMappingFile) {
- setProperty(XML_MAPPING_FILE, xmlMappingFile, null, null);
- }
-
- /**
- * XML Mapping File Path
- */
- public String getXmlMappingFile() {
- String xmlMappingFile = getProperty(XML_MAPPING_FILE, null, null);
- return xmlMappingFile == null ? DEFAULT_XML_MAPPING_FILE : xmlMappingFile; //$NON-NLS-1$
- }
-
-
- /**
- * Called when the table user selection is changed in the
- * generation wizard.
- */
- public void setTableNames(List<String> tableNames) {
- mTableNames = tableNames;
- mTables = null;
- mValidAssociations = null; //recompute
- mInvalidForeignAssociations = true; //make sure foreign associations from newly added tables are computed.
- }
- /**
- * Returns the table names to be generated.
- * This might be different from <code>getTableNames</code> if there
- * are many-to-many join tables and are not contributing
- * in any other associations.
- */
- public List<String> getGenTableNames() {
- List<String> names = getTableNames();
- List<String> result = new java.util.ArrayList<String>(names.size());
-
- /*filter out join tables*/
- List<Association> associations = getAssociations();
- for (Iterator<String> tableNamesIter = names.iterator(); tableNamesIter.hasNext(); ) {
- String tableName = tableNamesIter.next();
- boolean isValid = true;
-
- for (Iterator<Association> assocIter = associations.iterator(); assocIter.hasNext(); ) {
- Association association = assocIter.next();
- if (!association.isGenerated()) {
- continue;
- }
- if (tableName.equals(association.getReferrerTableName())
- || tableName.equals(association.getReferencedTableName())) {
- isValid = true;
- break;
- }
- if (tableName.equals(association.getJoinTableName())) {
- isValid = false;
- }
- }
- if (isValid) {
- result.add(tableName);
- }
- }
- return result;
- }
- /**
- * Returns an <code>ORMGenTable</code> object given its name, or
- * null if none.
- */
- public ORMGenTable getTable(String tableName) {
- if (mTables == null) {
- mTables = new java.util.HashMap<String, ORMGenTable>(mTableNames.size());
- }
-
- if(mTableNames!=null && mSchema!=null){
- for (Iterator<String> iter = mTableNames.iterator(); iter.hasNext(); ) {
- String name = iter.next();
- Table dbTable = mSchema.getTableNamed( name );
- if (dbTable != null) {
- mTables.put(name, createGenTable(dbTable));
- }
- }
- }
- return mTables.get(tableName);
- }
- /**
- * Returns the <code>Association</code> objects sorted by their "from"
- * table name.
- */
- public List<Association> getAssociations(){
- return getAssociations(true/*validOnly*/);
- }
- /**
- * Adds the given association.
- */
- public void addAssociation(Association association) {
- getAssociations(false/*validOnly*/).add(association);
- if (mValidAssociations != null) {
- mValidAssociations.add(association);
- }
-
- }
- /**
- * Deletes the given association.
- */
- public void deleteAssociation(Association association) {
- boolean removed = getAssociations(false/*validOnly*/).remove(association);
- assert(removed);
-
- if (mValidAssociations != null) {
- removed = mValidAssociations.remove(association);
- assert(removed);
- }
- }
- /**
- * Returns true if an association similar to the given association
- * already exists.
- * This is decided based only on the association tables and columns.
- */
- public boolean similarAssociationExists(Association association) {
- try {
- for (Iterator<Association> iter = getAssociations(false/*validOnly*/).iterator(); iter.hasNext(); ) {
- Association association2 = iter.next();
- if (!association.getReferrerTableName().equals(association2.getReferrerTableName())
- || !association.getReferencedTableName().equals(association2.getReferencedTableName())
- || !StringUtil.equalObjects(association.getJoinTableName(), association2.getJoinTableName())
- || !association.getReferrerColumnNames().equals(association2.getReferrerColumnNames())
- || !association.getReferencedColumnNames().equals(association2.getReferencedColumnNames())
- ) {
- continue;
- }
- /*the 2 association have the same referrer, referenced and join table*/
- if (association.getJoinTableName() == null) {
- return true;
- }
- if (association.getReferrerJoinColumnNames().equals(association2.getReferrerJoinColumnNames())
- && association.getReferencedJoinColumnNames().equals(association2.getReferencedJoinColumnNames())) {
- return true;
- }
- }
- } catch (Exception e) {
- return false;
- }
- return false;
- }
- /**
- * Creates the <code>ORMGenTable</code> instance.
- */
- public ORMGenTable createGenTable(Table dbTable) {
- return new ORMGenTable(dbTable, this);
- }
- /**
- * Creates the <code>ORMGenColumn</code> instance.
- */
- protected ORMGenColumn createGenColumn(Column dbCol) {
- return new ORMGenColumn(dbCol, this);
- }
- /**
- * Returns true of the underlying persistence specs require the "many" side
- * of an association to be the owner (like EJB3).
- */
- protected boolean manySideIsAssociationOwner() {
- return false;
- }
- public boolean isUpdateConfigFile() {
- return !"false".equals(getProperty(UPDATE_CONFIG_FILE, null, null)); //defaults to true
- }
- public void setUpdateConfigFile(boolean value) {
- if (value) { //default is true
- setProperty(UPDATE_CONFIG_FILE, null, null, null); //remove it
- } else {
- setBooleanProperty(UPDATE_CONFIG_FILE, value, null, null);
- }
- }
-
- //-----------------------------------------
- //---- Velocity templates methods
- //-----------------------------------------
- /**
- * Returns a getter method name given a property name.
- */
- public String propertyGetter(String propertyName) {
- return "get"+StringUtil.initUpper(propertyName);
- }
- /**
- * Returns a setter method name given a property name.
- */
- public String propertySetter(String propertyName) {
- return "set"+StringUtil.initUpper(propertyName);
- }
- public String quote(String s) {
- return StringUtil.quote(s, '"');
- }
- public String quote(boolean b) {
- return quote(String.valueOf(b));
- }
- public String quote(int i) {
- return quote(String.valueOf(i));
- }
- public String convertToJavaStringLiteral(String s) {
- return StringTools.convertToJavaStringLiteral(s);
- }
- public String convertToXmlStringLiteral(String s) {
- return StringTools.convertToXmlStringLiteral(s);
- }
- /**
- * Appends an annotation member name and value to an existing annotation.
- *
- * @param s The annotation members string.
- *
- * @param memberValue The member value, if null or empty strings then
- * nothing is appened.
- *
- * @param whether to double quote the member value.
- */
- public String appendAnnotation(String s, String memberName, String memberValue, boolean quote) {
- if (memberValue == null || memberValue.length() == 0) {
- return s;
- }
- StringBuffer buffer = new StringBuffer(s);
- if (buffer.length() != 0) {
- buffer.append(", ");
- }
- buffer.append(memberName);
- buffer.append('=');
- if (quote) {
- buffer.append('"');
- }
- buffer.append(memberValue);
- if (quote) {
- buffer.append('"');
- }
- return buffer.toString();
- }
-
- /**
- * Appends an attribute name and value to an existing element.
- *
- * @param s The attribute key string.
- *
- * @param memberValue The attribute value, if null or empty strings then
- * nothing is appened.
- *
- * @param whether to double quote the member value.
- */
- public String appendAttribute(String s, String memberName, String memberValue, boolean quote) {
- if (memberValue == null || memberValue.length() == 0) {
- return s;
- }
- StringBuffer buffer = new StringBuffer(s);
- if (buffer.length() != 0) {
- buffer.append(" ");
- }
- buffer.append(memberName);
- buffer.append('=');
- if (quote) {
- buffer.append('"');
- }
- buffer.append(memberValue);
- if (quote) {
- buffer.append('"');
- }
- return buffer.toString();
- }
-
- public boolean isJDK1_5() {
- return true;
- }
-
- //-----------------------------------------
- //---- private methods
- //-----------------------------------------
- /**
- * Restores the customization settings from the given
- * (persisted) customizer.
- */
- private void restore(ORMGenCustomizer customizer) {
- mTableNames = customizer.mTableNames;
- mAssociations = customizer.mAssociations;
- mProps = customizer.mProps;
- mUpdatePersistenceXml = customizer.mUpdatePersistenceXml;
- if( mSchema == null )
- return;
-
- /*remove invalid table names*/
- for (int i = mTableNames.size()-1; i >= 0; --i) {
- String tableName = mTableNames.get(i);
- if (mSchema.getTableNamed( tableName) == null) {
- mTableNames.remove(i);
- }
- }
- if( mAssociations!=null ){
- /*restore the associations*/
- for (Iterator<Association> iter = mAssociations.iterator(); iter.hasNext(); ) {
- Association association = iter.next();
- association.restore(this);
- }
- /*add the foreign keys associations just in case the tables changed since
- * the last time the state was persisted. Pass checkExisting true so that the
- * associations restored above are not overwritten.*/
- addForeignKeyAssociations(true/*checkExisting*/);
- // sort on restore
- sortAssociations( mAssociations );
- }
- }
- /**
- * Returns the key in mProps corresponding to the specified
- * propertyName, table and column.
- */
- private String getPropKey(String propertyName, String tableName, String colName) {
- if (tableName == null) {
- tableName = NULL_TABLE;
- }
- if (colName == null) {
- colName = NULL_COLUMN;
- }
- return tableName + '.' + colName + '.' + propertyName;
- }
- /**
- * Returns the associations that are valid for the
- * current tables.
- */
- private List<Association> getAssociations(boolean validOnly){
- if (mAssociations == null) {
- mAssociations = new java.util.ArrayList<Association>();
-
- addForeignKeyAssociations(false/*checkExisting*/);
- } else if (mInvalidForeignAssociations) {
- mInvalidForeignAssociations = false;
-
- addForeignKeyAssociations(true/*checkExisting*/);
- }
- List<Association> associations;
- if (validOnly) {
- if (mValidAssociations == null) {
- /*filter out the invalid associations*/
- mValidAssociations = new ArrayList<Association>(mAssociations.size());
- for (int i = 0, n = mAssociations.size(); i < n; ++i) {
- Association association = mAssociations.get(i);
- if (association.isValid()) {
- mValidAssociations.add(association);
- }
- }
- }
- associations = mValidAssociations;
- } else {
- associations = mAssociations;
- }
- return associations;
- }
- private void addForeignKeyAssociations(boolean checkExisting) {
- List<String> tableNames = getTableNames();
- for (Iterator<String> iter = tableNames.iterator(); iter.hasNext(); ) {
- ORMGenTable table = getTable(iter.next());
- addForeignKeyAssociations(table, checkExisting);
- }
- }
- private void addForeignKeyAssociations(ORMGenTable table, boolean checkExisting) {
- if(table==null)
- return;
-
-
- List<ForeignKeyInfo> fKeys = null;
-
- try{
- fKeys = DTPUtil.getForeignKeys(table.getDbTable());
- }catch(Exception ise){
- //workaround Dali bug for now
- return;
- }
-
- if( fKeys.size()==0 )
- return;
-
- List<Association> addedAssociations = new java.util.ArrayList<Association>();
- for (Iterator<ForeignKeyInfo> iter = fKeys.iterator(); iter.hasNext(); ) {
- ForeignKeyInfo fki = iter.next();
- ORMGenTable referencedTable = getTable(fki.getReferencedTableName());
- if (referencedTable == null) {
- continue;
- }
- Association association = new Association(this, table.getName(), fki.getReferrerColumnNames()
- , referencedTable.getName(), fki.getReferencedColumnNames());
- association.computeCardinality();
- //Defer the check of similarAssociationExists after computeManyToMany()
- //otherwise the MTM association will not computed correctly in some cases.
- //if (checkExisting && similarAssociationExists(association)) {
- // continue;
- //}
- addedAssociations.add(association);
- }
-
- Association m2m = computeManyToMany(table, addedAssociations);
- if (m2m != null) {
- /*do not generate the 2 many-to-one*/
- addedAssociations.clear();
- addedAssociations.add(0, m2m);
- }
- //remove the association if already existing
- Iterator<Association> it = addedAssociations.iterator();
- while( it.hasNext() ){
- Association newAssociation = it.next();
- for( Association association : mAssociations ){
- if( newAssociation.equals( association )){
- it.remove();
- break;
- }
- }
- }
- mAssociations.addAll(addedAssociations);
- }
- private Association computeManyToMany(ORMGenTable table, List<Association> addedAssociations) {
- /** many-to-many associations if:
- * - addedAssociations contains 2 many-to-one associations
- * - tables t1 and t2 does NOT have to be different( for self-MTM-self situation)
- * - <code>table</code> contains only the foreign key columns.
- *
- * Note: following restrictions have been removed:
- * -table has only two columns
- * -t1 and t2 must be different
- * -the primary key of <code>table</code> is the concatenation of its foreign
- * keys to t1 and t2.*/
-
- if (addedAssociations.size() != 2) {
- return null;
- }
-
- //MTM table should have two MTO relations to orginal tables
- Association assoc1 = addedAssociations.get(0);
- Association assoc2 = addedAssociations.get(1);
- if (assoc1.getCardinality() != Association.MANY_TO_ONE
- || assoc2.getCardinality() != Association.MANY_TO_ONE) {
- return null;
- }
-
- //MTM table should only include foreign key columns
- for( ORMGenColumn col : table.getColumns()){
- if( !col.isForeignKey())
- return null;
- }
-
-
- ORMGenTable t1 = assoc1.getReferencedTable();
- ORMGenTable t2 = assoc2.getReferencedTable();
-
- if( t1.getName().equals(table.getName()) || t2.getName().equals(table.getName()) ) {
- return null;
- }
-
- //Make a guess which table is the owning side of the MTM relation
- //See https://bugs.eclipse.org/bugs/show_bug.cgi?id=268445
- //Logic borrowed from DTPTableWrapper.getJoinTableOwningForeignKey()
- if( !table.getName().equals(t1.getName() + "_" + t2.getName() ) ) {
- //swap t1 and t2
- ORMGenTable t3 = t1;
- t1=t2;
- t2=t3;
- //swap assoc1 and assoc2
- Association assoc3=assoc1;
- assoc1=assoc2;
- assoc2=assoc3;
- }
-
-//Commented out because the assumption is too restrictive:
-//this check will prevent generating MTM mapping table not having
-//primary key defined
-// List pkNames = DTPUtil.getPrimaryKeyColumnNames(table.getDbTable());
-// if (pkNames.size() != table.getColumnNames().size()) {
-// return null;
-// }
-// List fkNames = new java.util.ArrayList(assoc1.getReferrerColumnNames()); //clone because we modify by addAll below
-// fkNames.addAll(assoc2.getReferrerColumnNames());
-// if (!CollectionUtil.equalsIgnoreOrder(pkNames, fkNames)) {
-// return null;
-// }
- Association m2m = new Association(this, t1.getName()/*referrerTableName*/, assoc1.getReferencedColumnNames()/*referrerColNames*/
- , t2.getName()/*referencedTableName*/, assoc2.getReferencedColumnNames()/*referencedColNames*/
- , table.getName(), assoc1.getReferrerColumnNames()/*referrerJoinColNames*/, assoc2.getReferrerColumnNames()/*referencedJoinColNames*/);
- m2m.setCustom(false);
- return m2m;
- }
-
- //---------------------------------------------------
- //---- FileHeader class -----------------------------
- //---------------------------------------------------
- /**
- * The header of the customization file.
- */
- private static class FileHeader implements java.io.Serializable
- {
- private static final long serialVersionUID = 1L;
- /**
- * Should be argument-less because it is used in
- * the de-serialization process.
- */
- public FileHeader() {
- mVersion = FILE_VERSION;
- }
- int mVersion;
- }
-
- private void sortAssociations( List< Association > list ) {
- Collections.sort( list, new Comparator< Association >() {
- public int compare( Association lhs, Association rhs ) {
- // sort by referrer table name first...
- int test = lhs.getReferrerTableName().compareTo( rhs.getReferrerTableName() );
- if( test != 0 )
- return test;
- // then by referenced table name...
- test = lhs.getReferencedTableName().compareTo( rhs.getReferencedTableName() );
- if( test != 0 )
- return test;
- // if referrer and referenced tables are the same, they should
- // appear next to each other
- return 0;
- }
- } );
- }
- public boolean updatePersistenceXml() {
- return mUpdatePersistenceXml;
- }
- public void setUpdatePersistenceXml(boolean updatePersistenceXml) {
- this.mUpdatePersistenceXml = updatePersistenceXml;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenTable.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenTable.java
deleted file mode 100644
index 76b2a9c5de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/ORMGenTable.java
+++ /dev/null
@@ -1,1037 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.common.utility.JavaType;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.gen.internal.util.DTPUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.EntityGenTools;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-
-/**
- * Represents the ORM generation properties for a database table.
- *
- * <p>
- * This is designed to be created/changed by the generation wizard, and
- * generated using Velocity templates. The modified properties (if any) are
- * persisted/retrieved using <code>ORMGenCustomizer</code>.
- *
- */
-public class ORMGenTable
-{
- private ORMGenCustomizer mCustomizer;
- private List<ORMGenColumn> mColumns;
- private Table mDbTable;
- private HashMap<String, String> columnTypesMap = null;
- /**
- * @param table
- * The database table or null if this table is used to get/set
- * the default table properties (properties that apply to all
- * tables unless overriden).
- */
- public ORMGenTable(Table table, ORMGenCustomizer customizer) {
- super();
- mDbTable = table;
- mCustomizer = customizer;
- }
-
- public ORMGenCustomizer getCustomizer() {
- return mCustomizer;
- }
-
- /**
- * Returns true if this table is is used to get/set the default table
- * properties.
- */
- public boolean isDefaultsTable() {
- return mDbTable == null;
- }
-
- protected String customized(String propName) {
- return getCustomizer().getProperty(propName, getTableName(), null);
- }
-
- protected boolean customizedBoolean(String propName) {
- return getCustomizer().getBooleanProperty(propName, getTableName(), null);
- }
-
- protected void setCustomized(String propName, String value) {
- if (value != null && value.length() == 0) {
- value = null;
- }
- getCustomizer().setProperty(propName, value, getTableName(), null);
- }
-
- protected void setCustomizedBoolean(String propName, boolean value, boolean defaultValue) {
- if (defaultValue == value) {
- setCustomized(propName, null); // remove the property
- }
- else {
- getCustomizer().setBooleanProperty(propName, value, getTableName(), null);
- }
- }
-
- public Table getDbTable() {
- return mDbTable;
- }
-
- /**
- * Returns the table name.
- */
- public String getTableName() {
- return mDbTable != null ? mDbTable.getName() : ORMGenCustomizer.ANY_TABLE;
- }
-
- public String getName() {
- if (mDbTable == null)
- return ORMGenCustomizer.ANY_TABLE;
- String tableName = getTableName();
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().buildTableAnnotationName(tableName, mDbTable);
- return annotationName != null ? annotationName : tableName;
- }
-
- public String getJoinTableAnnotationName() {
- if (mDbTable == null)
- return ORMGenCustomizer.ANY_TABLE;
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().buildJoinTableAnnotationName(mDbTable);
- return annotationName != null ? annotationName : mDbTable.getName();
- }
-
- /**
- * Returns the database schema containing the table.
- */
- public String getSchema() {
- if (DTPUtil.isDefaultSchema(mDbTable) || mDbTable.getSchema()==null)
- return ""; //$NON-NLS-1$
- String schemaName = mDbTable.getSchema().getName();
- return schemaName;
- }
-
- public void setSourceFolder(String srcFolder){
- setCustomized(SRC_FOLDER, srcFolder);
- }
-
- public String getSourceFolder(){
- String srcFolder = customized(SRC_FOLDER);
- return srcFolder == null ? "" : srcFolder;
- }
-
- public String getImportStatements(){
- buildColumnTypesMap();
- Collection<String> packages = columnTypesMap.keySet();
- StringBuilder ret = new StringBuilder();
- for ( String s : packages ) {
- ret.append( "import " + s + ";\n"); //$NON-NLS-1$
- }
-
- List<AssociationRole> associationRoles = getAssociationRoles();
- for ( AssociationRole role : associationRoles ) {
- if ( role.getCardinality().equals( Association.ONE_TO_MANY )
- || role.getCardinality().equals( Association.MANY_TO_MANY ) ) {
- ret.append( "import " + getDefaultCollectionType() + ";\n"); //$NON-NLS-1$
- break;
- }
- }
-
- return ret.toString();
- }
-
- /**
- * Construct import statements for types from javax.persistence package
- * @return
- */
- private String getJavaxPersistenceImportStatements() {
- StringBuilder ret = new StringBuilder();
- ret.append( "import javax.persistence.Entity;\n"); //$NON-NLS-1$
- //TODO: only if @Columns is needed
- ret.append( "import javax.persistence.Column;\n");//$NON-NLS-1$
- //TODO: only if there is @Id
- ret.append( "import javax.persistence.Id;\n");//$NON-NLS-1$
- if( !this.isDefaultname() )
- ret.append( "import javax.persistence.Table;\n");//$NON-NLS-1$
- if( this.isCompositeKey() )
- ret.append( "import javax.persistence.EmbeddedId;\n"); //$NON-NLS-1$
- // append javax.persistence package imports
- HashSet<String> jpaImports = new HashSet<String>();
- List<AssociationRole> associationRoles = getAssociationRoles();
- for( AssociationRole role : associationRoles ){
- if( role.getCardinality().equals( Association.ONE_TO_ONE ) ){
- jpaImports.add( "import javax.persistence.OneToOne;" );//$NON-NLS-1$
- }else{
- if( role.getCardinality().equals( Association.ONE_TO_MANY ) ){
- jpaImports.add( "import javax.persistence.OneToMany;\n" );//$NON-NLS-1$
- }else if( role.getCardinality().equals( Association.MANY_TO_ONE ) ){
- jpaImports.add( "import javax.persistence.ManyToOne;\n" );//$NON-NLS-1$
- jpaImports.add( "import javax.persistence.JoinColumn;\n" ); //$NON-NLS-1$
- }else if( role.getCardinality().equals( Association.MANY_TO_MANY ) ){
- jpaImports.add( "import javax.persistence.ManyToMany;\n" );//$NON-NLS-1$
- jpaImports.add( "import javax.persistence.JoinTable;\n" );//$NON-NLS-1$
- jpaImports.add( "import javax.persistence.JoinColumns;\n");//$NON-NLS-1$
- jpaImports.add( "import javax.persistence.JoinColumn;\n" );//$NON-NLS-1$
- }
- }
- }
- for( String s: jpaImports){
- ret.append(s);
- }
- return ret.toString();
- }
-
- public HashMap<String, String> buildColumnTypesMap(){
- if ( columnTypesMap != null) {
- return columnTypesMap;
- }
- columnTypesMap = new HashMap<String, String>();
- for ( ORMGenColumn col : this.getColumns() ) {
- String type = col.getPropertyType();
- if ( !col.isPartOfCompositePrimaryKey()
- && !col.isForeignKey()
- && !type.startsWith("java.lang") && type.indexOf('.')>0 ) {
- String simpleType= type.substring( type.lastIndexOf('.')+1 );
- columnTypesMap.put(type, simpleType);
- }
- }
- return columnTypesMap;
- }
-
- public String getSimplifiedColType(String fqtn) {
- HashMap<String, String> map = buildColumnTypesMap();
- String typeName = map.get(fqtn);
- if ( typeName != null ) {
- return typeName;
- }
- return fqtn;
- }
-
- /**
- * Sets the package for the generated class (empty string for the default
- * package)
- */
- public void setPackage(String pkg) {
- getCustomizer().setProperty(PACKAGE, pkg, getName(), null);
- // not calling setCustomized so that empty strings do not get nulled out.
- }
-
- /**
- * Returns the Java package (empty string for the default package).
- */
- public String getPackage() {
- String packageName = customized(PACKAGE);
- return packageName == null ? "" : packageName; //$NON-NLS-1$
- }
-
- /**
- * Returns the generated Java class name (not qualified).
- */
- public String getClassName() {
- String name = customized(CLASS_NAME);
- if (name == null) {
- // name = StringUtil.tableNameToVarName(getName());
- // name = StringUtil.initUpper(name);
- name = EntityGenTools.convertToUniqueJavaStyleClassName(getTableName(), new ArrayList<String>());
- name = StringUtil.singularise(name);
- }
- return name;
- }
-
- public void setClassName(String className) {
- /*
- * if the class name is the same as the (possibly computed) class name
- * then nothing to do
- */
- if (!StringUtil.equalObjects(className, getClassName())) {
- setCustomized(CLASS_NAME, className);
- }
- }
-
- /**
- * Returns a name suitable to be used as a variable or class name. This is
- * computed based on the table name.
- *
- * @param singular
- * Whether the name should be singular or plural.
- */
- public String getVarName(boolean singular) {
- String name = StringUtil.tableNameToVarName(getTableName());
- if (singular) {
- name = StringUtil.singularise(name);
- }
- else {
- name = StringUtil.pluralise(name);
- }
- return name;
- }
-
- /**
- * Returns the fully qualified generated Java class name.
- */
- public String getQualifiedClassName() {
- return qualify(getClassName());
- }
-
- /**
- * Returns the composite key Java class name (not qualified).
- */
- public String getCompositeKeyClassName() {
- String name = customized(COMPOSITE_KEY_CLASS_NAME);
- if (name == null) {
- name = getClassName() + "PK"; //$NON-NLS-1$
- }
- return name;
- }
-
- /**
- * Returns the fully qualified composite key Java class name.
- */
- public String getQualifiedCompositeKeyClassName() {
- return qualify(getCompositeKeyClassName());
- }
-
- /**
- * Returns the composite key property name.
- */
- public String getCompositeKeyPropertyName() {
- return "id"; //$NON-NLS-1$
- }
-
- /**
- * Returns the <code>ORMGenColumn</code> objects to be generated for this
- * table.
- */
- public List<ORMGenColumn> getColumns() {
- if (mColumns == null) {
- mColumns = new ArrayList<ORMGenColumn>();
- for (Column c : mDbTable.getColumns()) {
- ORMGenColumn genColumn = getCustomizer().createGenColumn(c);
- genColumn.setGenTable(this);
- mColumns.add(genColumn);
- }
- }
- return mColumns;
- }
-
- public List<String> getColumnNames() {
- List<String> ret = new ArrayList<String>();
- for (Column c : mDbTable.getColumns()) {
- ret.add(c.getName());
- }
- return ret;
- }
-
- /**
- * Returns the <code>ORMGenColumn</code> objects representing the table's
- * primary key.
- */
- public List<ORMGenColumn> getPrimaryKeyColumns() {
- List<ORMGenColumn> ret = new ArrayList<ORMGenColumn>();
- for (Column column : mDbTable.getPrimaryKeyColumns()) {
- ret.add(new ORMGenColumn(column, this.mCustomizer));
- }
- return ret;
- }
-
- /**
- * Returns the primary key column or null if there is no or many primary key
- * columns.
- */
- public ORMGenColumn getPrimaryKeyColumn() {
- ORMGenColumn pkCol = null;
- List<ORMGenColumn> pkColumns = getPrimaryKeyColumns();
- if (pkColumns.size() == 1) {
- // Column dbCol = (Column)pkColumns.get(0);
- pkCol = pkColumns.get(0); // (ORMGenColumn)
- // mCustomizer.createGenColumn(dbCol);
- }
- else {
- /*
- * if no pk column then look for the first column with id mapping
- * kind. This is so that the wizard can be used with tables not
- * having primary keys.
- */
- List<ORMGenColumn> columns = getColumns();
- for (int i = 0, n = columns.size(); i < n; ++i) {
- ORMGenColumn column = columns.get(i);
- if (column.getMappingKind().equals(mCustomizer.getIdMappingKind())) {
- pkCol = column;
- break;
- }
- }
- }
- return pkCol;
- }
-
- /**
- * Returns true if there is more than 1 pk column.
- */
- public boolean isCompositeKey() {
- return mDbTable.getPrimaryKeyColumnsSize() > 1;
- }
-
- /**
- * Returns the <code>ORMGenColumn</code> objects for the the columns that
- * are not part of any association.
- *
- * @param genOnly
- * Whether to include only the columns marked for generation.
- *
- * @param includePk
- * Whether to include the primary kley column(s).
- *
- * @param includeInherited
- * Whether to include the columns associated with Java properties
- * that exist in the super class (if any).
- */
- public List<ORMGenColumn> getSimpleColumns(boolean genOnly, boolean includePk, boolean includeInherited) {
- List<ORMGenColumn> result = new java.util.ArrayList<ORMGenColumn>();
- List<ORMGenColumn> columns = getColumns();
- List<AssociationRole> roles = getAssociationRoles();
- for (int i = 0, n = columns.size(); i < n; ++i) {
- ORMGenColumn column = columns.get(i);
- if (genOnly && !column.isGenerated()) {
- continue;
- }
- if (column.isPrimaryKey()) {
- if (!includePk || isCompositeKey()) {
- continue;
- } else {
- result.add(0, column);
- continue;
- }
- }
- else if (isColumnInAsscociation(column, roles)) {
- continue;
- }
- result.add(column);
- }
- return result;
- }
-
- public List<ORMGenColumn> getSimpleColumns() {
- return getSimpleColumns(true/* genOnly */, true/* includePk */, true/* includeInherited */);
- }
-
- /**
- * Returns false if the given column should be generated with false
- * updatable/insertable. This is the case when the column is mapped more
- * than once, this usually happen with columns in composite keys and
- * many-to-one associations.
- *
- * <br>
- * Note that for Hibernate the column param is null because the
- * insert/update attributes are specified for the many-to-one tag itself
- * instead of the nested column tags (bogus obviously).
- */
- public boolean isColumnUpdateInsert(AssociationRole role, ORMGenColumn column) {
- if (column == null) {
- for (Iterator<ORMGenColumn> iter = role.getReferrerColumns().iterator(); iter.hasNext();) {
- ORMGenColumn c = iter.next();
- if (!isColumnUpdateInsert(role, c)) {
- return false;
- }
- }
- return true;
- }
- if (column.isPrimaryKey()) {
- return false;
- }
- /*
- * should look if there are multiple associations using the same column
- * and return false, but this is probably an unusual case.
- */
- return true;
- }
-
- /**
- * Returns the <code>ORMGenColumn</code> objects corresponding to the given
- * column names.
- */
- public List<ORMGenColumn> getColumnsByNames(List<String> names) {
- List<ORMGenColumn> result = new java.util.ArrayList<ORMGenColumn>();
- for (String name : names) {
- ORMGenColumn column = getColumnByName(name);
- assert (column != null);
- if (column != null) {
- result.add(column);
- }
- }
- return result;
- }
-
- /**
- * Returns the columns having the given name, or null if none.
- */
- public ORMGenColumn getColumnByName(String name) {
- List<ORMGenColumn> columns = getColumns();
- for (int i = 0, n = columns.size(); i < n; ++i) {
- ORMGenColumn column = columns.get(i);
- if (column.getName().equals(name)) {
- return column;
- }
- }
- return null;
- }
-
- /**
- * Returns the <code>AssociationRole</code> objects for this table. Only the
- * association marked for generation are returned.
- */
- public List<AssociationRole> getAssociationRoles() {
- /*
- * this is not cached intentionally because invalidating the cache with
- * wizard changes is kinda tricky.
- */
- List<AssociationRole> associationRoles = new ArrayList<AssociationRole>();
- String name = getName();
- List<Association> associations = mCustomizer.getAssociations();
- for (Iterator<Association> iter = associations.iterator(); iter.hasNext();) {
- Association association = iter.next();
- if (!association.isGenerated()) {
- continue;
- }
- /*
- * check both referrerand referenced because an association could be
- * from-to the same table (employee/manager)
- */
- if (association.getReferrerTable().getName().equals(name)) {
- AssociationRole role = association.getReferrerRole();
- if (role != null) {
- associationRoles.add(role);
- }
- }
- if (association.getReferencedTable().getName().equals(name)) {
- AssociationRole role = association.getReferencedRole();
- if (role != null) {
- associationRoles.add(role);
- }
- }
- }
- return associationRoles;
- }
-
- public String getClassDescription() {
- return customized(CLASS_DESC);
- }
-
- /**
- * Returns the generated class scope, one of {@link #PUBLIC_SCOPE}|
- * {@link #PROTECTED_SCOPE} |{@link #PRIVATE_SCOPE}. This method never
- * returns null (defaults to public).
- */
- public String getClassScope() {
- String scope = customized(CLASS_SCOPE);
- if (scope == null) {
- scope = PUBLIC_SCOPE;
- }
- return scope;
- }
-
- public String getExtends() {
- return customized(EXTENDS);
- }
-
- public void setExtends(String baseClass) {
- setCustomized(EXTENDS, baseClass);
- }
-
- public List<String> getImplements() {
- String str = customized(IMPLEMENTS);
- List<String> result = StringUtil.strToList(str, ',', true/* trim */);
- if (result == null) {
- result = Collections.emptyList();
- }
- return result;
- }
-
- public void setImplements(List<String> interfaces) {
- setCustomized(IMPLEMENTS, StringUtil.listToStr(interfaces, ','));
- }
-
- /**
- * Returns the string that should be generated in the Java class for extends
- * and implements.
- */
- public String generateExtendsImplements() {
- StringBuffer buffer = new StringBuffer();
- String extendsClass = getExtends();
- if (extendsClass != null && !extendsClass.equals("java.lang.Object") && !extendsClass.equals("Object")) {
- buffer.append("extends " + simplifyClassName(extendsClass) + " "); //fix for bug 278626
- }
- buffer.append("implements Serializable"); // assuming that the Java
- // file template imports the
- // java.io.Serializable
- for (Iterator<String> iter = getImplements().iterator(); iter.hasNext();) {
- buffer.append(", " + simplifyClassName(iter.next()));
- }
- return buffer.toString();
- }
-
- private String simplifyClassName(String fullClassName) {
- final String JAVA_LANG = "java.lang.";
- if (fullClassName.startsWith(JAVA_LANG)) {
- return fullClassName.substring(JAVA_LANG.length());
- }
- String pkg = StringUtil.getPackageName(fullClassName);
- if (pkg != null && StringUtil.equalObjects(pkg, getPackage())) {
- return StringUtil.getClassName(fullClassName);
- }
- return fullClassName;
- }
-
- /**
- * Returns the id generator scheme (assigned, sequence, etc). Does not
- * return null, defaults to "assigned" or "identity" depending on whether
- * the table has an identity column.
- */
- public String getIdGenerator() {
- String generator = customized(ID_GENERATOR);
- String noneGenerator = getCustomizer().getNoIdGenerator();
- if (!isDefaultsTable()) {
- /*
- * This is done mainly because there might be cases where some
- * tables have autoinctement pk and others are assigned. In this
- * case this makes it so that it is possible to have a "none"
- * default value that is interpreted depending on the case.
- */
- if (generator == null || generator.equals(noneGenerator)) {
- ORMGenColumn pkColumn = getPrimaryKeyColumn();
- if (pkColumn != null && DTPUtil.isAutoIncrement(pkColumn.getDbColumn())) {
- generator = getCustomizer().getIdentityIdGenerator();
- }
- }
- }
- if (generator == null) {
- generator = noneGenerator;
- }
- return generator;
- }
-
- /**
- * Changes the id generator scheme (assigned, sequence, etc).
- */
- public void setIdGenerator(String scheme) {
- setCustomized(ID_GENERATOR, scheme);
- }
-
- /**
- * Returns the sequence name for the given table, or null if none (makes
- * sense only when the scheme is native, sequence, ..).
- */
- public String getSequence() {
- return customized(SEQUENCE);
- }
-
- public void setSequence(String name) {
- setCustomized(SEQUENCE, name);
- }
-
- /**
- * Returns the sequence name after replacing the ${table} and ${pk} by their
- * values, or null if none.
- */
- public String getFormattedSequence() {
- String sequence = getSequence();
- if (sequence != null) {
- /* resolve the ${table} and ${pk} patterns */
- sequence = StringUtil.strReplace(sequence, TABLE_SEQ_PATTERN, getName());
- if (sequence.indexOf(PK_SEQ_PATTERN) >= 0) {
- Iterator<Column> pkCols = getDbTable().getPrimaryKeyColumns().iterator();
- String pkName = pkCols.hasNext() ? pkCols.next().getName() : null;
- sequence = StringUtil.strReplace(sequence, PK_SEQ_PATTERN, pkName);
- }
- }
- return sequence != null ? sequence.toUpperCase() : "";
- }
-
- public boolean isImplementEquals() {
- return !"true".equals(customized(IMPLEMENT_EQUALS)); // defaults to
- // false
- }
-
- public void setImplementEquals(boolean value) {
- setCustomizedBoolean(IMPLEMENT_EQUALS, value, true);
- }
-
- /**
- * Returns true if there is any column participating in equals/hashcode.
- */
- public boolean hasColumnsInEquals() {
- List<ORMGenColumn> columns = getSimpleColumns();
- for (int i = 0, n = columns.size(); i < n; ++i) {
- ORMGenColumn column = columns.get(i);
- if (column.isUseInEquals()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns {@link #GENERATE_DDL_ANNOTATION} indicating whether the optional
- * DDL parameters like length, nullable, unqiue, etc should be generated in @Column
- * annotation. defaults to false.
- */
- public boolean isGenerateDDLAnnotations() {
- return "true".equals(customized(ORMGenCustomizer.GENERATE_DDL_ANNOTATION)); // defaults
- // to
- // false
- }
-
- public void setGenerateDDLAnnotations(boolean generate) {
- setCustomizedBoolean(ORMGenCustomizer.GENERATE_DDL_ANNOTATION, generate, false);
- }
-
- /**
- * Returns one of {@link #PROPERTY_ACCESS}|{@link #FIELD_ACCESS} indicating
- * how the entity properties are mapped. Does not return null (defaults to
- * {@link #FIELD_ACCESS}).
- */
- public String getAccess() {
- String name = customized(ACCESS);
- if (name == null) {
- name = FIELD_ACCESS;
- }
- return name;
- }
-
- public void setAccess(String access) {
- assert (access == null || access.equals(PROPERTY_ACCESS) || access.equals(FIELD_ACCESS));
- if (!StringUtil.equalObjects(access, getAccess())) {
- setCustomized(ACCESS, access);
- }
- }
-
- /**
- * Returns one of {@link #LAZY_FETCH}|{@link #EAGER_FETCH} indicating how
- * the table associations are feched. Returns null if the provider defaults
- * should be used.
- */
- public String getDefaultFetch() {
- return customized(DEFAULT_FETCH);
- }
-
- public void setDefaultFetch(String fetch) {
- assert (fetch == null || fetch.equals(LAZY_FETCH) || fetch.equals(EAGER_FETCH));
- setCustomized(DEFAULT_FETCH, fetch);
- }
-
- public String[] getSupportedCollectionTypes() {
- return new String[] {
- SET_COLLECTION_TYPE, LIST_COLLECTION_TYPE
- };
- }
-
- /**
- * Returns one of {@link #LIST_COLLECTION_TYPE}|{@link #SET_COLLECTION_TYPE}
- * indicating the Java type (full class name) used for properties of
- * collection types. This does not return null (defaults to list).
- */
- public String getDefaultCollectionType() {
- String cType = customized(DEFAULT_COLLECTION_TYPE);
- if (cType == null) {
- cType = LIST_COLLECTION_TYPE;
- }
- return cType;
- }
-
- public String getSimpleCollectionType(){
- String type = getDefaultCollectionType();
- return type.substring( type.lastIndexOf('.') +1 );
- }
-
- public void setDefaultCollectionType(String cType) {
- assert (cType.equals(LIST_COLLECTION_TYPE) || cType.equals(SET_COLLECTION_TYPE));
- setCustomized(DEFAULT_COLLECTION_TYPE, cType);
- }
-
- /**
- * Returns true if the primary key is compound and any of its columns should
- * be included in the <code>equals</code> method implementation.
- */
- public boolean isCompoundKeyUseInEquals() {
- if (isCompositeKey()) {
- for (Iterator<ORMGenColumn> iter = getPrimaryKeyColumns().iterator(); iter.hasNext();) {
- ORMGenColumn column = iter.next();
- if (column.isUseInEquals()) {
- return true;
- }
- }
- }
- return false;
- }
-
- public boolean isRoleUseInEquals(AssociationRole role) {
- for (Iterator<ORMGenColumn> iter = role.getReferrerColumns().iterator(); iter.hasNext();) {
- ORMGenColumn column = iter.next();
- if (column.isUseInEquals()) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Return true if the values of name element in the @Table is default so we
- * can skip generating the annotation
- *
- * @return true
- */
- public boolean isDefaultname() {
- String entityName = getClassName();
- String annotationName = this.mCustomizer.getDatabaseAnnotationNameBuilder().buildTableAnnotationName(entityName, mDbTable);
- return annotationName == null;
- }
-
- /**
- * Qualifies a class name if there is a package.
- */
- private String qualify(String className) {
- String pkg = getPackage();
- if (pkg != null && pkg.length() != 0) {
- className = pkg + '.' + className;
- }
- return className;
- }
-
- /**
- * Returns true if the given column is part of any association.
- */
- private boolean isColumnInAsscociation(ORMGenColumn column, List<AssociationRole> roles) {
- for (int i = 0, n = roles.size(); i < n; ++i) {
- AssociationRole role = roles.get(i);
- List<ORMGenColumn> cols = role.getReferrerColumns();
- for (ORMGenColumn col : cols) {
- if (col.getName().equals(column.getName())) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Print the clause to be used in the generated equals() method
- *
- * @return String
- */
- public String getPrimaryKeyEqualsClause() {
- StringBuilder buf = new StringBuilder();
- Iterator<ORMGenColumn> columns = this.getPrimaryKeyColumns().iterator();
- while (columns.hasNext()) {
- this.printPrimaryKeyEqualsClauseOn(columns.next(), buf);
- if (columns.hasNext()) {
- buf.append("\n");
- buf.append("\t\t\t");
- buf.append("&& ");
- }
- }
- buf.append(";");
- return buf.toString();
- }
-
- private void printPrimaryKeyEqualsClauseOn(ORMGenColumn column, StringBuilder buf) {
- String fieldName = column.getPropertyName();
- JavaType javaType = column.getDbColumn().getPrimaryKeyJavaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveEqualsClauseOn(fieldName, buf);
- }
- else {
- this.printReferenceEqualsClauseOn(fieldName, buf);
- }
- }
-
- private void printPrimitiveEqualsClauseOn(String fieldName, StringBuilder buf) {
- buf.append("(this.");
- buf.append(fieldName);
- buf.append(" == castOther.");
- buf.append(fieldName);
- buf.append(')');
- }
-
- private void printReferenceEqualsClauseOn(String fieldName, StringBuilder buf) {
- buf.append("this.");
- buf.append(fieldName);
- buf.append(".equals(castOther.");
- buf.append(fieldName);
- buf.append(')');
- }
-
- /**
- * Print the clause to be used in the generated hasCode() method
- *
- * @return String
- */
- public String getPrimaryKeyHashCodeClause() {
- StringBuilder buf = new StringBuilder();
- Iterator<ORMGenColumn> columns = this.getPrimaryKeyColumns().iterator();
- while (columns.hasNext()) {
- buf.append("hash = hash * prime + ");
- this.printPrimaryKeyHashCodeClauseOn(columns.next(), buf);
- buf.append(';');
- buf.append('\n');
- buf.append("\t\t");
- }
- return buf.toString();
- }
-
- private void printPrimaryKeyHashCodeClauseOn(ORMGenColumn column, StringBuilder buf) {
- String fieldName = column.getPropertyName();
- JavaType javaType = column.getDbColumn().getPrimaryKeyJavaType();
- if (javaType.isPrimitive()) {
- this.printPrimitiveHashCodeClauseOn(javaType.getElementTypeName(), fieldName, buf);
- }
- else {
- this.printReferenceHashCodeClauseOn(fieldName, buf);
- }
- }
-
- private void printPrimitiveHashCodeClauseOn(String primitiveName, String fieldName, StringBuilder buf) {
- if (primitiveName.equals("int")) {
- // this.value
- buf.append("this.");
- buf.append(fieldName);
- }
- else if (primitiveName.equals("short") || primitiveName.equals("byte") || primitiveName.equals("char")) { // explicit
- // cast
- // ((int) this.value)
- buf.append("((int) this.");
- buf.append(fieldName);
- buf.append(')');
- }
- else if (primitiveName.equals("long")) { // cribbed from Long#hashCode()
- // ((int) (this.value ^ (this.value >>> 32)))
- buf.append("((int) (this.");
- buf.append(fieldName);
- buf.append(" ^ (this.");
- buf.append(fieldName);
- buf.append(" >>> 32)))");
- }
- else if (primitiveName.equals("float")) { // cribbed from
- // Float#hashCode()
- // java.lang.Float.floatToIntBits(this.value)
- buf.append("java.lang.Float");
- buf.append(".floatToIntBits(this.");
- buf.append(fieldName);
- buf.append(')');
- }
- else if (primitiveName.equals("double")) { // cribbed from
- // Double#hashCode()
- // ((int) (java.lang.Double.doubleToLongBits(this.value) ^
- // (java.lang.Double.doubleToLongBits(this.value) >>> 32)))
- buf.append("((int) (");
- buf.append("java.lang.Double");
- buf.append(".doubleToLongBits(this.");
- buf.append(fieldName);
- buf.append(") ^ (");
- buf.append("java.lang.Double");
- buf.append(".doubleToLongBits(this.");
- buf.append(fieldName);
- buf.append(") >>> 32)))");
- }
- else if (primitiveName.equals("boolean")) {
- // (this.value ? 1 : 0)
- buf.append("(this.");
- buf.append(fieldName);
- buf.append(" ? 1 : 0)");
- }
- else {
- throw new IllegalArgumentException(primitiveName);
- }
- }
-
- private void printReferenceHashCodeClauseOn(String fieldName, StringBuilder buf) {
- buf.append("this.");
- buf.append(fieldName);
- buf.append(".hashCode()");
- }
-
- @Override
- public String toString() {
- return "name=" + this.getName() + "; columns=" + Arrays.toString(this.getColumnNames().toArray());
- }
-
- /* class scopes */
- public static final String PUBLIC_SCOPE = "public";
-
- public static final String PROTECTED_SCOPE = "protected";
-
- public static final String PRIVATE_SCOPE = "private";
-
- /* access constants. Note that these strings are used in the ui */
- public static final String PROPERTY_ACCESS = "property";
-
- public static final String FIELD_ACCESS = "field";
-
- /*
- * default fech constants. Note that these strings are used in the gen
- * velocity templates.
- */
- public static final String DEFAULT_FETCH = "defaultFetch";
-
- public static final String LAZY_FETCH = "lazy";
-
- public static final String EAGER_FETCH = "eager";
-
- /*
- * default collection type constants. Note that these strings are used in
- * the gen velocity templates.
- */
- public static final String LIST_COLLECTION_TYPE = "java.util.List";
-
- public static final String SET_COLLECTION_TYPE = "java.util.Set";
-
- /**
- * The pattern replaced by the table name in the id generator sequence name
- * param.
- */
- public static final String TABLE_SEQ_PATTERN = "$table";
-
- /**
- * The pattern replaced by the primary key in the id generator sequence name
- * param.
- */
- public static final String PK_SEQ_PATTERN = "$pk";
-
- /* customization properties */
- private static final String PACKAGE = "package";
-
- private static final String SRC_FOLDER = "srcFolder";
-
- private static final String CLASS_NAME = "className";
-
- private static final String CLASS_DESC = "classDesc";
-
- private static final String CLASS_SCOPE = "classScope";
-
- private static final String EXTENDS = "extends";
-
- private static final String IMPLEMENTS = "implements";
-
- private static final String ID_GENERATOR = "idGenerator";
-
- private static final String SEQUENCE = "sequence";
-
- private static final String COMPOSITE_KEY_CLASS_NAME = "compositeKeyClassName";
-
- private static final String IMPLEMENT_EQUALS = "implementEquals";
-
- private static final String ACCESS = "access";
-
- private static final String DEFAULT_COLLECTION_TYPE = "defaultCollectionType";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/OverwriteConfirmer.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/OverwriteConfirmer.java
deleted file mode 100644
index c4192eca1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/OverwriteConfirmer.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-public interface OverwriteConfirmer {
- /**
- * Return whether the entity generator should overwrite the specified
- * file.
- */
- boolean overwrite(String className);
-
-
- final class Always
- implements OverwriteConfirmer
- {
- public static final OverwriteConfirmer INSTANCE = new Always();
-
- public static OverwriteConfirmer instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private Always() {
- super();
- }
-
- // everything will be overwritten
- public boolean overwrite(String className) {
- return true;
- }
-
- @Override
- public String toString() {
- return StringTools.buildSingletonToString(this);
- }
- }
-
-
- 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 className) {
- return false;
- }
-
- @Override
- public String toString() {
- return StringTools.buildSingletonToString(this);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/PackageGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/PackageGenerator.java
deleted file mode 100644
index 832ad03d5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/PackageGenerator.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.gen.internal;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.StringWriter;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.velocity.VelocityContext;
-import org.apache.velocity.app.VelocityEngine;
-import org.apache.velocity.runtime.log.JdkLogChute;
-import org.eclipse.core.resources.IContainer;
-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.FileLocator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.gen.internal.util.CompilationUnitModifier;
-import org.eclipse.jpt.jpa.gen.internal.util.FileUtil;
-import org.eclipse.jpt.jpa.gen.internal.util.UrlUtil;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.Bundle;
-
-/**
- * This generator will generate a package of entities for a set of tables.
- */
-public class PackageGenerator {
-
- private static final String LOGGER_NAME = "org.eclipse.jpt.entities.gen.log"; //$NON-NLS-1$
- private final JpaProject jpaProject;
- private final ORMGenCustomizer customizer;
- private final OverwriteConfirmer overwriteConfirmer;
-
- public static void generate(JpaProject jpaProject, ORMGenCustomizer customizer, OverwriteConfirmer overwriteConfirmer, IProgressMonitor monitor, boolean generateXml) throws CoreException {
- SubMonitor sm = SubMonitor.convert(monitor, 20);
- PackageGenerator generator = new PackageGenerator(jpaProject, customizer, overwriteConfirmer);
- sm.worked(1);
- try {
- if (generateXml) {
- generator.doXmlGenerate(sm.newChild(19));
- }
- else {
- generator.doGenerate(sm.newChild(19));
- }
- } catch (Exception e) {
- throw new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID, JptGenMessages.Error_Generating_Entities, e));
- }
- }
-
- private PackageGenerator(JpaProject jpaProject, ORMGenCustomizer customizer, OverwriteConfirmer confirmer) {
- super();
- this.jpaProject = jpaProject;
- this.customizer = customizer;
- this.overwriteConfirmer = confirmer;
- }
-
- private Object getCustomizer() {
- return this.customizer;
- }
-
- private IJavaProject getJavaProject(){
- return this.jpaProject.getJavaProject();
- }
-
-
- protected void doGenerate(IProgressMonitor monitor) throws Exception {
- generateInternal(monitor);
- }
-
- protected void doXmlGenerate(IProgressMonitor monitor) throws Exception {
- generateXmlInternal(monitor);
- }
-
- protected void generateInternal(IProgressMonitor monitor) throws Exception {
- File templDir = prepareTemplatesFolder("templates/entities/"); //$NON-NLS-1$
-
- List<String> genClasses = new java.util.ArrayList<String>();
- List<String> tableNames = this.customizer.getGenTableNames();
-
- /* .java per table, persistence.xml, refresh package folder */
- SubMonitor sm = SubMonitor.convert(monitor, tableNames.size() + 2);
-
-
- for (Iterator<String> iter = tableNames.iterator(); iter.hasNext();) {
- if (sm.isCanceled()) {
- return;
- }
- String tableName = iter.next();
- ORMGenTable table = this.customizer.getTable(tableName);
-
- String className = table.getQualifiedClassName();
-
- generateClass(table, templDir.getAbsolutePath(), sm.newChild(1, SubMonitor.SUPPRESS_NONE));
-
- genClasses.add(className);
- /*
- * add the composite key class to persistence.xml because some
- * JPA provider(e.g. Kodo) requires it. Hibernate doesn't seem to care).
- */
- if (table.isCompositeKey()) {
- genClasses.add(table.getQualifiedCompositeKeyClassName());
- }
- }
- if (sm.isCanceled()) {
- return;
- }
-
- //update persistence.xml
- if (this.customizer.updatePersistenceXml()) {
- updatePersistenceXml(genClasses);
- }
- sm.worked(2);
- }
-
- private void updatePersistenceXml(final List<String> genClasses) {
- JpaXmlResource resource = this.jpaProject.getPersistenceXmlResource();
- if (resource == null) {
- //the resource would only be null if the persistence.xml file had an invalid content type,
- //do not attempt to update
- return;
- }
-
- Persistence persistence = this.jpaProject.getRootContextNode().getPersistenceXml().getPersistence();
- if (persistence == null) {
- // invalid content, do not attempt to update
- return;
- }
- PersistenceUnit persistenceUnit;
- // create a persistence unit if one doesn't already exist
- if (persistence.getPersistenceUnitsSize() == 0) {
- persistenceUnit = persistence.addPersistenceUnit();
- persistenceUnit.setName(PackageGenerator.this.jpaProject.getName());
- } else {
- // we only support one persistence unit - take the first one
- persistenceUnit = persistence.getPersistenceUnit(0);
- }
- for (String className : genClasses) {
- if (CollectionTools.isEmpty(persistenceUnit.getMappingFileRefsContaining(className)) && !persistenceUnit.specifiesPersistentType(className)) {
- persistenceUnit.addSpecifiedClassRef(className);
- }
- }
- resource.save();
- }
-
- protected void generateXmlInternal(IProgressMonitor monitor) throws Exception {
- File templDir = prepareTemplatesFolder("templates/xml_entities/"); //$NON-NLS-1$
-
- List<String> tableNames = this.customizer.getGenTableNames();
-
- //TODO Need to fix progress monitor
- SubMonitor sm = SubMonitor.convert(monitor, tableNames.size() + 2);
-
- generateXmlMappingFile(tableNames, templDir.getAbsolutePath(), sm.newChild(1, SubMonitor.SUPPRESS_NONE));
-
- if (sm.isCanceled()) {
- return;
- }
-
- updatePersistenceXmlForMappingFile(this.customizer.getXmlMappingFile());
-
- sm.worked(2);
- }
-
- private File prepareTemplatesFolder(String templatesPath) throws IOException, Exception,
- CoreException {
- //Prepare the Velocity template folder:
- //If the plug-in is packaged as a JAR, we need extract the template
- //folder into the plug-in state location. This is required by Velocity
- //since we use included templates.
- Bundle bundle = Platform.getBundle(JptJpaGenPlugin.PLUGIN_ID);
- Path path = new Path( templatesPath);
- URL url = FileLocator.find(bundle, path, null);
- if (url == null) {
- throw new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + " "+ JptJpaGenPlugin.PLUGIN_ID + "/" + templatesPath) );//$NON-NLS-1$
- }
- URL templUrl = FileLocator.resolve(url);
-
- //Have this check so that the code would work in both PDE and JARed plug-in at runtime
- File templDir = null;
- if (UrlUtil.isJarUrl(templUrl)) {
- templDir = FileUtil.extractFilesFromBundle( templUrl, bundle, templatesPath );
- } else {
- templDir = UrlUtil.getUrlFile(templUrl);
- }
-
-
- if (templDir == null || !templDir.exists()) {
- throw new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + " "+ JptJpaGenPlugin.PLUGIN_ID ) );//$NON-NLS-1$
- }
- return templDir;
- }
-
- private void updatePersistenceXmlForMappingFile(final String mappingFile) {
- JpaXmlResource resource = this.jpaProject.getPersistenceXmlResource();
- if (resource == null) {
- //the resource would only be null if the persistence.xml file had an invalid content type,
- //do not attempt to update
- return;
- }
-
- Persistence persistence = this.jpaProject.getRootContextNode().getPersistenceXml().getPersistence();
- if (persistence == null) {
- // invalid content, do not attempt to update
- return;
- }
-
- PersistenceUnit persistenceUnit;
- // create a persistence unit if one doesn't already exist
- if (persistence.getPersistenceUnitsSize() == 0) {
- persistenceUnit = persistence.addPersistenceUnit();
- persistenceUnit.setName(PackageGenerator.this.jpaProject.getName());
- } else {
- // we only support one persistence unit - take the first one
- persistenceUnit = persistence.getPersistenceUnit(0);
- }
- boolean addSpecifiedMappingFile = true;
- for (MappingFileRef mappingFileRef : persistenceUnit.getMappingFileRefs()) {
- if (mappingFileRef.getFileName().equals(mappingFile)){
- addSpecifiedMappingFile = false;
- }
- }
- if (addSpecifiedMappingFile){
- persistenceUnit.addSpecifiedMappingFileRef(mappingFile);
- resource.save();
- }
- }
-
- /**
- * Saves/Creates the .java file corresponding to a database table
- * with the given content.
- *
- * @param templDir The velocity template file directory. It is assumed
- * that this directory contains the 2 files <em>main.java.vm</em>
- * and <em>pk.java.vm</em>
- * @param progress
- */
- protected void generateClass(ORMGenTable table, String templateDirPath, IProgressMonitor monitor) throws Exception {
-
- String subTaskName = NLS.bind(JptGenMessages.EntityGenerator_taskName, table.getName());
- SubMonitor sm = SubMonitor.convert(monitor, subTaskName, 10);
-
- try {
- IFolder javaPackageFolder = getJavaPackageFolder(table, monitor);
- IFile javaFile = javaPackageFolder.getFile( table.getClassName() + ".java"); //$NON-NLS-1$
-
- if (javaFile.exists()) {
- if (this.overwriteConfirmer != null && !this.overwriteConfirmer.overwrite(javaFile.getName())) {
- return;
- }
- }
- //JdkLogChute in this version of Velocity not allow to set log level
- //Workaround by preset the log level before Velocity is initialized
- Logger logger = Logger.getLogger( LOGGER_NAME );
- logger.setLevel( Level.SEVERE );
-
- Properties vep = new Properties();
- vep.setProperty("file.resource.loader.path", templateDirPath); //$NON-NLS-1$
- vep.setProperty( JdkLogChute.RUNTIME_LOG_JDK_LOGGER, LOGGER_NAME );
- VelocityEngine ve = new VelocityEngine();
- ve.init(vep);
- sm.worked(2);
-
- generateJavaFile(table, javaFile, ve, "main.java.vm", true/*isDomainClass*/, sm.newChild(6)); //$NON-NLS-1$
-
- if (table.isCompositeKey()) {
- IFile compositeKeyFile = javaPackageFolder.getFile( table.getCompositeKeyClassName()+".java"); //$NON-NLS-1$
- generateJavaFile(table, compositeKeyFile, ve, "pk.java.vm", false/*isDomainClass*/, sm.newChild(1)); //$NON-NLS-1$
- }
- else {
- sm.setWorkRemaining(1);
- }
- javaFile.refreshLocal(1, sm.newChild(1));
-
- } catch (Throwable e) {
- CoreException ce = new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + "" + JptJpaGenPlugin.PLUGIN_ID , e) );//$NON-NLS-1$
- JptJpaGenPlugin.logException( ce );
- }
- }
-
- private void generateJavaFile(ORMGenTable table, IFile javaFile, VelocityEngine ve
- , String templateName, boolean isDomainClass, IProgressMonitor monitor) throws Exception {
- VelocityContext context = new VelocityContext();
- context.put("table", table); //$NON-NLS-1$
- context.put("customizer", getCustomizer()); //$NON-NLS-1$
-
- StringWriter w = new StringWriter();
- ve.mergeTemplate(templateName, context, w);
-
- String fileContent = w.toString();
- if (javaFile.exists()) {
- if (isDomainClass) {
- updateExistingDomainClass(table.getQualifiedClassName(), javaFile, fileContent);
- } else {
- byte[] content = fileContent.getBytes(javaFile.getCharset());
- javaFile.setContents(new ByteArrayInputStream(content), true, true, monitor);
- }
- } else {
- byte[] content = fileContent.getBytes(javaFile.getCharset());
- createFile(javaFile, new ByteArrayInputStream(content));
- }
- }
-
-
- /**
- * Updates the (existing) Java file corresponding to the given class.
- *
- * @param className The qualified class name.
- *
- * @param javaFile The existing Java file of the class to update.
- *
- * @param fileContent The new file content.
- */
- protected void updateExistingDomainClass(String className, IFile javaFile, String fileContent) throws Exception {
- /*use CompilationUnitModifier instead of calling WideEnv.getEnv().setFileContent
- * so that if the unit is up to date if it is used before file change
- * notifications are delivered (see EJB3ImportSchemaWizard.updateExistingDomainClass for example)*/
- CompilationUnitModifier modifier = new CompilationUnitModifier(this.getJavaProject(), className);
- modifier.setJavaSource(fileContent);
- modifier.save();
- }
-
- public void createFile(IFile file, java.io.InputStream contents) throws CoreException {
- file.create(contents, false, null/*monitor*/);
- }
-
- public IFolder getJavaPackageFolder(ORMGenTable table, IProgressMonitor monitor) throws CoreException {
- IPackageFragmentRoot root = getDefaultJavaSourceLocation(this.getJavaProject(), table.getSourceFolder());
- String packageName = table.getPackage();
- if (packageName == null) packageName = ""; //$NON-NLS-1$
- IPackageFragment packageFragment = root.getPackageFragment(packageName);
- if( !packageFragment.exists()){
- root.createPackageFragment(packageName, true, monitor);
- }
- return (IFolder) packageFragment.getResource();
- }
-
- private IPackageFragmentRoot getDefaultJavaSourceLocation(IJavaProject jproject, String sourceFolder){
- IPackageFragmentRoot defaultSrcPath = null;
- if (jproject != null && jproject.exists()) {
- try {
- IPackageFragmentRoot[] roots = jproject.getPackageFragmentRoots();
- for (int i = 0; i < roots.length; i++) {
- if (roots[i].getKind() == IPackageFragmentRoot.K_SOURCE ){
- if (defaultSrcPath == null) {
- defaultSrcPath = roots[i];
- }
- String path = roots[i].getPath().toString();
- if (path.equals('/' + sourceFolder)) {
- return roots[i] ;
- }
- }
- }
- } catch (JavaModelException e) {
- JptJpaGenPlugin.logException(e);
- }
- }
- return defaultSrcPath;
- }
-
- protected void generateXmlMappingFile(List<String> tableNames, String templateDirPath, IProgressMonitor monitor) throws Exception {
-
- try {
- String xmlMappingFileLocation = this.customizer.getXmlMappingFile();
- JpaXmlResource xmlResource = this.jpaProject.getMappingFileXmlResource(new Path(xmlMappingFileLocation));
- IFile xmlFile;
- if (xmlResource != null) {
- xmlFile = xmlResource.getFile();
- }
- else{
- //TODO This is a temp hack for M6 use default location if writing to a new mapping file
- IProject project = jpaProject.getProject();
- IContainer container = ((ProjectResourceLocator) project.getAdapter(ProjectResourceLocator.class)).getDefaultResourceLocation();
- xmlFile = container.getFile(new Path(xmlMappingFileLocation.substring(xmlMappingFileLocation.lastIndexOf("/")))); //$NON-NLS-1$
- }
-
- if (xmlFile.exists()) {
- if (this.overwriteConfirmer != null && !this.overwriteConfirmer.overwrite(xmlFile.getName())) {
- return;
- }
- }
- //JdkLogChute in this version of Velocity not allow to set log level
- //Workaround by preset the log level before Velocity is initialized
- Logger logger = Logger.getLogger( LOGGER_NAME );
- logger.setLevel( Level.SEVERE );
-
- Properties vep = new Properties();
- vep.setProperty("file.resource.loader.path", templateDirPath); //$NON-NLS-1$
- vep.setProperty( JdkLogChute.RUNTIME_LOG_JDK_LOGGER, LOGGER_NAME );
- VelocityEngine ve = new VelocityEngine();
- ve.init(vep);
-
- StringBuilder xmlFileContents = new StringBuilder();
- xmlFileContents.append(generateXmlHeaderFooter(ve, "header.vm")); //$NON-NLS-1$
- List<ORMGenTable> compositeKeyTables = new ArrayList<ORMGenTable>();
-
- for (Iterator<String> names = tableNames.iterator(); names.hasNext();) {
-
- ORMGenTable table = this.customizer.getTable(names.next());
- String subTaskName = NLS.bind(JptGenMessages.EntityGenerator_taskName, table.getName());
- SubMonitor sm = SubMonitor.convert(monitor, subTaskName, 10);
-
- if (sm.isCanceled()) {
- return;
- }
-
- xmlFileContents.append(generateXmlTypeMapping(table, ve, "main.xml.vm", sm.newChild(10))); //$NON-NLS-1$
-
- if (table.isCompositeKey()) {
- compositeKeyTables.add(table);
- }
- }
-
- //Embeddables need to come after entities in the XML
- for (ORMGenTable table : compositeKeyTables) {
- SubMonitor sm = SubMonitor.convert(monitor, NLS.bind(JptGenMessages.EntityGenerator_taskName, table.getName()), 1);
- if (table.isCompositeKey()) {
- xmlFileContents.append(generateXmlTypeMapping(table, ve, "embeddable.vm", sm.newChild(1))); //$NON-NLS-1$
- }
- }
-
- xmlFileContents.append(generateXmlHeaderFooter(ve, "footer.vm")); //$NON-NLS-1$
-
- if(xmlFile.exists()){
- byte[] content = xmlFileContents.toString().getBytes(xmlFile.getCharset());
- xmlFile.setContents(new ByteArrayInputStream(content), false, true, null);
- }
- else {
- byte[] content = xmlFileContents.toString().getBytes(xmlFile.getCharset());
- createFile(xmlFile, new ByteArrayInputStream(content));
- }
-
- xmlFile.refreshLocal(1, null);
-
- } catch (Throwable e) {
- CoreException ce = new CoreException(new Status(IStatus.ERROR, JptJpaGenPlugin.PLUGIN_ID, JptGenMessages.Templates_notFound + "" + JptJpaGenPlugin.PLUGIN_ID , e) );//$NON-NLS-1$
- JptJpaGenPlugin.logException( ce );
- }
- }
-
- private String generateXmlHeaderFooter(VelocityEngine ve, String templateName) throws Exception{
- StringWriter stringWriter = new StringWriter();
- VelocityContext context = new VelocityContext();
- ve.mergeTemplate(templateName, context, stringWriter);
- return stringWriter.toString();
- }
-
-
- private String generateXmlTypeMapping(ORMGenTable table, VelocityEngine ve
- , String templateName, IProgressMonitor monitor) throws Exception {
- VelocityContext context = new VelocityContext();
- context.put("table", table); //$NON-NLS-1$
- context.put("customizer", getCustomizer()); //$NON-NLS-1$
-
- StringWriter w = new StringWriter();
- ve.mergeTemplate(templateName, context, w);
-
- return w.toString();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/TagNames.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/TagNames.java
deleted file mode 100644
index daeecd6458..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/TagNames.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal;
-
-/**
- * TODO: merge with JPA class ?
- * The JPA mapping tag and attribute names.
- *
- */
-public class TagNames
-{
- public static final String BASIC_TAG = "basic";
- public static final String CASCADE_TAG = "cascade";
- public static final String COLUMN_TAG = "column";
- public static final String EMBEDDED_TAG = "embedded";
- public static final String EMBEDDED_ID_TAG = "embedded-id";
- public static final String GENERATED_VALUE_TAG = "generated-value";
- public static final String ID_TAG = "id";
- public static final String ID_CLASS_TAG = "id";
- public static final String JOIN_COLUMN_TAG = "join-column";
- public static final String INVERSE_JOIN_COLUMN_TAG = "inverse-join-column";
- public static final String LOB_TAG = "lob";
- public static final String MANY_TO_MANY_TAG = "many-to-many";
- public static final String MANY_TO_ONE_TAG = "many-to-one";
- public static final String MAPPED_BY_TAG = "mapped-by";
- public static final String ONE_TO_MANY_TAG = "one-to-many";
- public static final String ONE_TO_ONE_TAG = "one-to-one";
- public static final String PK_JOIN_COLUMN_TAG = "primary-key-join-column";
- public static final String TABLE_TAG = "table";
- public static final String VERSION_TAG = "version";
- public static final String JOIN_TABLE_TAG = "join-table";
-
- /*cascade tags*/
- public static final String ALL_CASCADE = "all";
- public static final String PERSIST_CASCADE = "persist";
- public static final String MERGE_CASCADE = "merge";
- public static final String REMOVE_CASCADE = "remove";
- public static final String REFRESH_CASCADE = "refresh";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/CompilationUnitModifier.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/CompilationUnitModifier.java
deleted file mode 100644
index 4ca46e1e5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/CompilationUnitModifier.java
+++ /dev/null
@@ -1,131 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.AST;
-import org.eclipse.jdt.core.dom.ASTParser;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jface.text.Document;
-import org.eclipse.text.edits.TextEdit;
-
-
-/**
- * Performs the grunt work needed for modifying a compilation
- * unit and performs the modified compilation unit save.
- *
- * The typical usage is as follows:
- * <ol><li>Create an instance.
- *
- * <li>Modify the compilation unit using AST operations performed
- * on the node returned by {@link #getCompilationUnitNode()}.
- * Alternatively you can call <code>setJavaSource</code> to change the entire source code.
- *
- * <li>Call the {@link #save()} method.
- *
- */
-public class CompilationUnitModifier
-{
- private IJavaProject mProject;
- private ICompilationUnit mCompilationUnit;
- private CompilationUnit mCompilationUnitNode;
- private Document mDocument;
-
- public CompilationUnitModifier(IJavaProject project, String className) throws Exception {
- super();
-
- mProject = project;
-
- IType type = project.findType(className);
- if (type == null) {
- throw new Exception("The class " + className + " does not exist.");
- }
- mCompilationUnit = type.getCompilationUnit();
- if (mCompilationUnit == null) {
- throw new Exception("The source code for " + className + " does not exist.");
- }
- }
- public CompilationUnitModifier(IJavaProject project, ICompilationUnit cu) throws Exception {
- super();
-
- mProject = project;
- mCompilationUnit = cu;
- }
- public CompilationUnitModifier(IJavaProject project, ICompilationUnit cu, CompilationUnit cuNode) throws Exception {
- super();
-
- mProject = project;
- mCompilationUnit = cu;
- mCompilationUnitNode = cuNode;
-
- getCompilationUnitNode(); //to create mDocument (the caller in this case does not have to call getCompilationUnitNode)
- }
- public ICompilationUnit getCompilationUnit() {
- return mCompilationUnit;
- }
- /**
- * Returns the compilation unit node that should be used for
- * tyhe modification AST operations.
- */
- public CompilationUnit getCompilationUnitNode() {
- if (mCompilationUnitNode == null) {
- ASTParser c = ASTParser.newParser(AST.JLS3);
- c.setSource(mCompilationUnit);
- c.setResolveBindings(true);
- mCompilationUnitNode = (CompilationUnit)c.createAST(null);
- }
- if (mDocument == null) {
- try {
- mDocument = new Document(mCompilationUnit.getBuffer().getContents());
- } catch (JavaModelException e) {
- e.printStackTrace();
- }
-
- mCompilationUnitNode.recordModifications();
- }
-
- return mCompilationUnitNode;
- }
- /**
- * Changes the entire Java source code of the compilation unit.
- */
- public void setJavaSource(String newSource) {
- try {
- mCompilationUnit.getBuffer().setContents(newSource);
- } catch (JavaModelException e) {
- e.printStackTrace();
- }
- }
- /**
- * Saves the compilation unit modifications.
- */
- public void save() throws Exception {
- if (mCompilationUnitNode != null) {
- assert(mDocument != null); //see getCompilationUnitNode
-
- //computation of the text edits
- TextEdit edits = mCompilationUnitNode.rewrite(mDocument, mProject.getOptions(true));
- //computation of the new source code
- edits.apply(mDocument);
- String newSource = mDocument.get();
- // update of the compilation unit
- mCompilationUnit.getBuffer().setContents(newSource);
- }
-
- if (mCompilationUnit.isWorkingCopy()) {
- mCompilationUnit.commitWorkingCopy(true/*force*/, null/*monitor*/);
- } else {
- mCompilationUnit.save(null/*monitor*/, true/*force*/);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/DTPUtil.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/DTPUtil.java
deleted file mode 100644
index ec2280ae21..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/DTPUtil.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.db.ForeignKey.ColumnPair;
-
-/**
- * Collection of utility methods to access DTP and other jpt.db APIs
- *
- */
-public class DTPUtil {
-
- public static boolean isAutoIncrement(Column c){
- //@ TODO
- //Blocked by DTP bug
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=250023
- //The Dali bug is
- //https://bugs.eclipse.org/bugs/show_bug.cgi?id=249658
- //
- return false;
- }
-
- /**
- * Return list of fk
- * @param dbTable
- * @return
- */
- public static List<ForeignKeyInfo> getForeignKeys(Table dbTable) {
- List<ForeignKeyInfo> ret = new ArrayList<ForeignKeyInfo>();
- if(dbTable!=null){
- for (ForeignKey fk : dbTable.getForeignKeys()) {
- Iterator<ColumnPair> columnPaires = fk.getColumnPairs().iterator();
- ForeignKeyInfo fkInfo = null;
- while( columnPaires.hasNext() ){
- ColumnPair columnPair = columnPaires.next();
- if( fkInfo == null){
- String tableName = dbTable.getName();
- String referencedTableName = "";
- Table referencedTable = fk.getReferencedTable();
- referencedTableName = referencedTable.getName();
- fkInfo = new ForeignKeyInfo(fk, tableName, referencedTableName );
- }
- String baseColName = columnPair.getBaseColumn().getName();
- String referencedColName = columnPair.getReferencedColumn().getName();
- fkInfo.addColumnMapping( baseColName, referencedColName );
- }
- if( fkInfo !=null )
- ret.add( fkInfo );
- }
- }
- return ret;
- }
-
- public static String getJavaType(Column dbColumn) {
- return dbColumn.isPartOfPrimaryKey() ?
- dbColumn.getPrimaryKeyJavaTypeDeclaration() :
- dbColumn.getJavaTypeDeclaration();
- }
-
- public static boolean isDefaultSchema(Table dbTable){
- String schemaName = dbTable.getSchema().getName();
- Schema defaultSchema = dbTable.getSchema().getDatabase().getDefaultSchema();
- return defaultSchema.getName() == schemaName;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/EntityGenTools.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/EntityGenTools.java
deleted file mode 100644
index faa48c38e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/EntityGenTools.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.utility.internal.NameTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-
-/**
- * Utility methods for entity generation.
- */
-public class EntityGenTools {
-
- /**
- * Convert the specified (database) identifier to a unique "Java style"
- * class name.
- * @see #convertToUniqueJavaStyleIdentifier(String, boolean, Collection)
- */
- public static String convertToUniqueJavaStyleClassName(String identifier, Collection<String> classNames) {
- return convertToUniqueJavaStyleIdentifier(identifier, true, classNames);
- }
-
- /**
- * Convert the specified (database) identifier to a unique "Java style"
- * attribute (field/property) name.
- * @see #convertToUniqueJavaStyleIdentifier(String, boolean, Collection)
- */
- public static String convertToUniqueJavaStyleAttributeName(String identifier, Collection<String> attributeNames) {
- return convertToUniqueJavaStyleIdentifier(identifier, false, attributeNames);
- }
-
- /**
- * Convert the specified (database) identifier to a unique "Java style"
- * identifier:
- * - if the identifier is all-caps, convert underscores to "camel case"
- * - if the identifier is not all-caps, leave it unchanged (except, possibly, for the first letter)
- * - convert to a legal Java identifier
- * - eliminate illegal characters
- * - if the result is a reserved word, modify it slightly
- * If the result is already one of the specified existing identifiers
- * (ignoring case so we don't have filename collisions on Windows),
- * modify it slightly again.
- * "FOO" => "Foo" or "foo"
- * "FOO_BAR" => "FooBar" or "fooBar"
- * "PACKAGE" => "Package" or "package_"
- */
- public static String convertToUniqueJavaStyleIdentifier(String identifier, boolean capitalizeFirstLetter, Collection<String> identifiers) {
- String result = identifier;
- if (StringTools.stringIsUppercase(result) || StringTools.stringIsLowercase(result)) {
- // leave mixed case identifiers alone?
- result = StringTools.convertUnderscoresToCamelCase(result, capitalizeFirstLetter);
- } else {
- result = capitalizeFirstLetter ? StringTools.capitalize(result) : StringTools.uncapitalize(result);
- }
- result = NameTools.convertToJavaIdentifier(result);
- // assume that converting to a unique name will not result in a Java reserved word
- // (since no Java reserved words end with a number)
- result = NameTools.uniqueNameForIgnoreCase(result, identifiers);
- return result;
- }
-
-
- // ********** constructor **********
-
- /**
- * Suppress default constructor, ensuring non-instantiability.
- */
- private EntityGenTools() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/FileUtil.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/FileUtil.java
deleted file mode 100644
index 8cab9042d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/FileUtil.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.jar.JarInputStream;
-import java.util.jar.Manifest;
-import java.util.zip.ZipEntry;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.jpt.jpa.gen.internal.JptGenMessages;
-
-import org.eclipse.osgi.service.datalocation.Location;
-import org.eclipse.osgi.util.NLS;
-import org.osgi.framework.Bundle;
-
-/**
- * Collections of utility methods handling files.
- *
- */
-public class FileUtil
-{
-
- public static void deleteFolder(File folder)
- throws IOException
- {
- File[] files = folder.listFiles();
- //empty the folder first (java.io.file.delete requires it empty)
- if (files != null) {
- for (int i = 0; i < files.length; ++i) {
- File f = files[i];
- if (f.isDirectory())
- deleteFolder(f);
- else
- deletePath(f);
- }
- }
- deletePath(folder);
- }
-
- public static void deletePath(File f)
- throws IOException
- {
- if (!f.delete()) {
- String msgId = f.isDirectory() ? JptGenMessages.Delete_Folder_Error : JptGenMessages.Delete_File_Error;
- throw new IOException( NLS.bind(msgId,f.getPath()));
- }
- }
-
- public static byte[] readFile(File src)
- throws IOException
- {
- java.io.FileInputStream fin = new java.io.FileInputStream(src);
- try {
- long fileLen = src.length();
- if (fileLen > Integer.MAX_VALUE)
- throw new IOException("file length too big to be read by FileUtil.readFile: " + fileLen);
-
- byte[] bytes = new byte[(int)fileLen];
- fin.read(bytes);
- return bytes;
- }
- finally {
- fin.close();
- }
- }
-
- public static void writeFile(File dest, byte[] bytes)
- throws IOException
- {
- if (dest.exists() && !dest.canWrite())
- throw new IOException( NLS.bind(JptGenMessages.File_Read_Only_Error, dest.getPath())); //throw with a clear error because otherwise FileOutputStream throws FileNotFoundException!
- java.io.FileOutputStream fout = new java.io.FileOutputStream(dest.getPath(), false/*append*/);
- try {
- fout.write(bytes);
- }
- finally {
- fout.flush();
- fout.close();
- }
- }
-
- /**
- * Returns the url for a file.
- * This basically the same as file.toUrl() but without the non-sense exception.
- */
- public static URL getFileUrl(File file) {
- try {
- return file.toURI().toURL();
- } catch (MalformedURLException e) {
- return null; //should not happen as file.toURL() does not really throw an exception
- }
- }
-
- public static void setFileContent(File file, java.io.InputStream contents) throws java.io.IOException {
- Path path = new Path(file.getAbsolutePath());
- try {
- IFile iFile = ResourcesPlugin.getWorkspace().getRoot().getFileForLocation(path);
- if (iFile == null) {
- throw new IOException("The path " + file + " does not seem to be a valid file path.");
- }
- iFile.setContents(contents, true/*force*/, true/*keepHistory*/, null/*monitor*/);
- } catch (CoreException ex) {
- throw new IOException(ex.getMessage());
- }
- }
-
- /**
- * Extract the contents of a Jar archive to the specified destination.
- */
- public static void unjar(InputStream in, File dest) throws IOException {
- if (!dest.exists()) {
- dest.mkdirs();
- }
- if (!dest.isDirectory()) {
- throw new IOException("Destination must be a directory.");//$NON-NLS-1$
- }
- JarInputStream jin = new JarInputStream(in);
- byte[] buffer = new byte[1024];
-
- ZipEntry entry = jin.getNextEntry();
- while (entry != null) {
- String fileName = entry.getName();
- if (fileName.charAt(fileName.length() - 1) == '/') {
- fileName = fileName.substring(0, fileName.length() - 1);
- }
- if (fileName.charAt(0) == '/') {
- fileName = fileName.substring(1);
- }
- if (File.separatorChar != '/') {
- fileName = fileName.replace('/', File.separatorChar);
- }
- File file = new File(dest, fileName);
- if (entry.isDirectory()) {
- // make sure the directory exists
- file.mkdirs();
- jin.closeEntry();
- } else {
- // make sure the directory exists
- File parent = file.getParentFile();
- if (parent != null && !parent.exists()) {
- parent.mkdirs();
- }
-
- // dump the file
- OutputStream out = new FileOutputStream(file);
- int len = 0;
- while ((len = jin.read(buffer, 0, buffer.length)) != -1) {
- out.write(buffer, 0, len);
- }
- out.flush();
- out.close();
- jin.closeEntry();
- file.setLastModified(entry.getTime());
- }
- entry = jin.getNextEntry();
- }
- /* Explicitly write out the META-INF/MANIFEST.MF so that any headers such
- as the Class-Path are seen for the unpackaged jar
- */
- Manifest mf = jin.getManifest();
- if (mf != null) {
- File file = new File(dest, "META-INF/MANIFEST.MF");//$NON-NLS-1$
- File parent = file.getParentFile();
- if (parent.exists() == false) {
- parent.mkdirs();
- }
- OutputStream out = new FileOutputStream(file);
- mf.write(out);
- out.flush();
- out.close();
- }
- jin.close();
- }
-
- //Used to Unzip the a specific folder packed inside a plug-in bundle to the plug-in state location
- public static File extractFilesFromBundle( URL url, Bundle bundle, String path ) throws Exception {
- URL jarUrl = UrlUtil.getJarFileUrl(url);
- File jarFile = new File(jarUrl.getFile() );
- Location configLocation = Platform.getConfigurationLocation();
- String pluginId = bundle.getSymbolicName();
- File configFolder = new File( configLocation.getURL().getFile(), pluginId);
- File templDir = new File( configFolder, path );
- if( !templDir.exists() ){
- FileUtil.unjar( new FileInputStream( jarFile ), configFolder );
- //Delete un-related files and folders
- File[] files = configFolder.listFiles();
- for( File f : files ){
- if( f.isFile() )
- f.delete();
- else if( templDir.getPath().indexOf( f.getPath() ) !=0 ){
- FileUtil.deleteFolder(f);
- }
- }
- }
- return templDir ;
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/ForeignKeyInfo.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/ForeignKeyInfo.java
deleted file mode 100644
index 70f5eb862f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/ForeignKeyInfo.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.util.List;
-
-import org.eclipse.jpt.jpa.db.ForeignKey;
-
-/**
- * Represents the metadata for a particular foreign key relationship
- * in a relational database schema.
- * <p/>
- * The referrer column is one which actually contains a foreign
- * key constraint, and is equivalent to the "foreign key" column.
- * <p/>
- * The referenced column is one which a referrer or foreign key
- * column references, and is equivalent to the "primary key" column.
- *
- */
-public class ForeignKeyInfo
-{
- private transient ForeignKey mForeignKey ;
- private String mName;
- private String mReferrerTableName;
- private String mReferencedTableName;
- private List<String> mReferrerColNames = new java.util.ArrayList<String>();
- private List<String> mReferencedColNames = new java.util.ArrayList<String>();
-
- /**
- * @param fk The name of the constraint backing
- * this foreign key metadata instance.
- */
- public ForeignKeyInfo(ForeignKey fk, String referrerTableName, String referencedTableName) {
- mForeignKey = fk;
- mName = fk.getName();
- mReferrerTableName = referrerTableName;
- mReferencedTableName = referencedTableName;
- }
- /**
- * Obtain the constraint name for this foreign key specification.
- * The name for a Foreign Key may, as per the JDBC specification,
- * be <code>null</code> where the constraint is not named.
- * In addition, it may be hardly recognizable to the user,
- * particularly for DB/2 constraints.
- *
- * @return The name of the constraint backing
- * this foreign key metadata instance.
- */
- public String getName()
- {
- return mName;
- }
-
- public ForeignKey getForeignKey(){
- return mForeignKey;
- }
- /**
- * Add another pair of foreign key mappings for this foreign key
- * definition.
- *
- * @param referrerColumn The referrer column name for this mapping.
- *
- * @param referencedColumn The referenced column name for this mapping.
- */
- public void addColumnMapping(String referrerColName, String referencedColName) {
- mReferrerColNames.add(referrerColName);
- mReferencedColNames.add(referencedColName);
- }
- /**
- * Returns the referrer table name of this foreign key
- * relationship.
- */
- public String getReferrerTableName() {
- return mReferrerTableName;
- }
- /**
- * Returns the referrer column names for this
- * foreign key.
- * The size of this list is always the same as the size of
- * the list retured from <code>getReferencedColumnNames</code>
- */
- public List<String> getReferrerColumnNames() {
- return mReferrerColNames;
- }
- /**
- * Returns the referenced table name of this foreign key
- * relationship.
- */
- public String getReferencedTableName() {
- return mReferencedTableName;
- }
- /**
- * Returns the referenced column names for this
- * foreign key.
- * The size of this list is always the same as the size of
- * the list retured from <code>getReferrerColumnNames</code>
- */
- public List<String> getReferencedColumnNames() {
- return mReferencedColNames;
- }
- /* (non-Javadoc)
- * @see java.lang.Object#toString()
- */
- public String toString() {
- return "name=" + mName
- + ", referrerTable=" + mReferrerTableName
- + ", referencedTable=" + mReferencedTableName
- + ", referrerColumns=" + mReferrerColNames
- + ", referencedColumns=" + mReferencedColNames
- ;
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/StringUtil.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/StringUtil.java
deleted file mode 100644
index 99f2291e26..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/StringUtil.java
+++ /dev/null
@@ -1,648 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.beans.Introspector;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-
-public class StringUtil
-{
- /**
- * Pads a string by adding a sequence of an arbitrary character at the beginning.
- * @param padChar The character to be used for padding.
- * @param len The desired length after padding.
- * @return The padded string. For example if <code>str</code> is "f4e" and <code>padChar</code> is '0'
- * and <code>len</code> is 6 then this method returns "000f4e"
- */
- public static String padLeft(String str, char padChar, int len) {
- if(str == null) {
- return null;
- }
- int strLen = str.length();
- if (strLen < len) {
- StringBuffer buffer = new StringBuffer(len);
- int count = len-strLen;
- for (int i = 0; i < count; ++i)
- buffer.append(padChar);
- buffer.append(str);
- str = buffer.toString();
- }
- return str;
- }
- /**
- * Inserts a given character at the beginning and at the end of the specified string.
- * For example if the string is <tt>extreme</tt> and the char is <tt>'</tt> then
- * the returned string is <tt>'exterme'</tt>.
- */
- public static String quote(String str, char c) {
- assert(str != null);
- StringBuffer buffer = new StringBuffer(str.length()+2);
- buffer.append(c);
- buffer.append(str);
- buffer.append(c);
- return buffer.toString();
- }
- public static String doubleQuote(String str) {
- return quote(str, '"');
- }
- /**
- * Removes the first and last single or double quotes (if they exist).
- */
- public static String unquote(String quoted) {
- if (quoted != null && quoted.length() >= 2){
- int len = quoted.length();
- char firstChar = quoted.charAt(0);
- char lastChar = quoted.charAt(len-1);
- if (firstChar == lastChar && (firstChar == '\'' || firstChar == '"')) {
- return quoted.substring(1, len-1);
- }
- }
- return quoted;
- }
- /**
- * Truncates a string and adds "..." in the result string.
- * If the string length is less or equal to the max len then
- * the original string is returned.
- */
- public static String truncate(String s, int maxLen) {
- if (s == null) {
- return null;
- }
- int len = s.length();
- if (len > maxLen) {
- int segmentLen = maxLen/2;
- s = s.substring(0, segmentLen) + "..." + s.substring(len-segmentLen);
- }
- return s;
- }
- /**
- * Returns a string containing the same character repeated.
- */
- public static String repeat(char c, int count) {
- StringBuffer buffer = new StringBuffer(count);
- for (int i = 0; i < count; ++i) {
- buffer.append(c);
- }
- return buffer.toString();
- }
- /**
- * Returns the given string unless it is emtpty where it returns null.
- */
- public static String nullIfEmpty(String s) {
- if (s != null && s.length() == 0) {
- s = null;
- }
- return s;
- }
- /**
- * Returns a string containing the same characters as the argument string
- * except that the control characters are replaced by the their hex code.
- * For example if the string is "ab\nc" the returned string is "ab{0xA}c".
- */
- public static String getVisibleString(String s) {
- if (s == null)
- return null;
- int len = s.length();
- StringBuffer buffer = new StringBuffer();
- for (int i = 0; i < len; ++i) {
- char c = s.charAt(i);
- if (c <= 0x1F || (c == 0x20 && (i == 0 || i == len-1))) {
- buffer.append("(0x" + Integer.toHexString((int)c).toUpperCase() + ")");
- }
- else buffer.append(c);
- }
- return buffer.toString();
- }
- /**
- * Replaces a portion of string.
- * @param str The original string.
- * @param offset The offset in the original string where the replace starts
- * @param len The replace length the original string
- * @param replaceStr The replacement string
- */
- public static String strReplace(String str, int offset, int len, String replaceStr) {
- StringBuffer buffer = new StringBuffer(str.length()-len+replaceStr.length());
- buffer.append(str.substring(0, offset));
- buffer.append(replaceStr);
- buffer.append(str.substring(offset+len));
-
- return buffer.toString();
- }
- public static String strReplace(String str, String pattern, String replaceStr)
- {
- if(str == null) {
- return null;
- }
- if(pattern == null || pattern.equals("")) {
- return str;
- }
- int index = str.indexOf(pattern);
- if (index < 0)
- return str;
-
- if (replaceStr == null)
- replaceStr = "";
- return str.substring(0, index) + replaceStr + str.substring(index + pattern.length());
- }
- public static String strReplaceAll(String str, String pattern, String replaceStr)
- {
- if(str == null) {
- return null;
- }
- if (replaceStr == null)
- replaceStr = "";
- if(pattern == null || pattern.equals("")) {
- return str;
- }
- int index = str.indexOf(pattern);
- while (index >= 0) {
- str = str.substring(0, index) + replaceStr + str.substring(index + pattern.length());
- index = str.indexOf(pattern, index+replaceStr.length());
- }
- return str;
- }
- public static String strInsert(String str, int index, String insertStr)
- {
- return str.substring(0, index)
- + insertStr
- + str.substring(index);
- }
- /**
- * Tokenize the specified string into a <code>List</code> of
- * words.
- * If the string specified is <code>null</code> or empty, this
- * method will return <code>null</code>.
- *
- * @param s The string to tokenize into a <code>List</code>.
- * @param sep The separator character to use to split
- * the string.
- * @param trim If <code>true</code>, run <code>trim</code> on
- * each element in the result <code>List</code>.
- *
- * @return A <code>List</code> containing all tokenized words
- * in the parameter string.
- * Each element is of type <code>String</code>.
- */
- public static List<String> strToList(String s, char sep, boolean trim)
- {
- //ex: if sep is ';' then s should be someting like "Red;Black"
- if (s == null || s.length() == 0)
- return null;
-
- ArrayList<String> result = new ArrayList<String>();
-
- char delimiters[] = {sep};
- java.util.StringTokenizer tokenizer = new java.util.StringTokenizer(s, new String(delimiters), true/*returnDelimiters*/);
- String lastTok=null;
- while (tokenizer.hasMoreTokens()) {
- String tok = tokenizer.nextToken();
- if (tok.length()==1 && tok.charAt(0)==sep){//delimiter
- if (tok.equals(lastTok)||lastTok==null/*first element is empty*/)
- result.add("");
- }
- else{
- if (trim)
- tok = tok.trim();
- result.add(tok);
- }
- lastTok=tok;
- }
- if(lastTok.length()==1 && lastTok.charAt(0)==sep)//last element is empty
- result.add("");
- result.trimToSize();
- return result;
- }
- public static List<String> strToList(String s, char sep)
- {
- return strToList(s, sep, false/*trim*/);
- }
-
- @SuppressWarnings("unchecked")
- public static String listToStr(Collection a, char sep)
- {
- return listToStr(a, String.valueOf(sep));
- }
-
- public static String listToStr(Collection<Object> a, String sep) {
- //reverse of strToList
- if (a == null)
- return null;
- int count = a.size();
- if (count == 0)
- return null;
-
- StringBuffer buffer = null;
- for (Iterator<Object> iter = a.iterator(); iter.hasNext(); )
- {
- Object obj = iter.next();
- if (obj == null)
- continue;
-
- if (buffer == null)
- buffer = new StringBuffer();
- else
- buffer.append(sep);
- if (obj instanceof String)
- buffer.append((String)obj);
- else
- buffer.append(obj);
- }
- return (buffer != null) ? buffer.toString() : null;
- }
- /**
- * Convert the text of a String into a Map of Strings, where each
- * key and value in the Map is of type String.
- *
- * @param s The string to be converted to a Map.
- * @param sep1 The separator between keys and their
- * values.
- * @param sep2 The separator between key-value pairs.
- *
- * @return The string converted to a Map.
- */
- public static java.util.Map<String, String> strToMap(String s, char sep1, char sep2)
- {
- return strToMap(s, sep1, sep2, false/*lowercaseKeys*/);
- }
- /**
- * Convert the text of a String into a Map of Strings, where each
- * key and value in the Map is of type String.
- * This form also allows you to specify that all keys will be
- * converted to lower-case before adding to the Map.
- *
- * @param s The string to be converted to a Map.
- * @param sep1 The separator between keys and their
- * values.
- * @param sep2 The separator between key-value pairs.
- * @param lowercaseKeys
- * Whether to convert keys to lower case
- * before adding to the Map.
- *
- * @return The string converted to a Map.
- */
- public static java.util.Map<String, String> strToMap(String s, char sep1, char sep2, boolean lowercaseKeys)
- {
- //ex: if sep1 is ':' and sep2 is ',' then s should be something like "color:Red,size:XL"
-
- if (s == null || s.length() == 0) {
- return Collections.emptyMap();
- }
-
- java.util.List<String> a = strToList(s, sep2);
- if (a == null) {
- return Collections.emptyMap();
- }
-
- java.util.HashMap<String, String> hm = new java.util.HashMap<String, String>();
- int count = a.size();
- for (int i = 0; i < count; ++i)
- {
- String s2 = (String)a.get(i); //ex: color:Red
- int pos = s2.indexOf(sep1);
- if (pos >= 0)
- {
- String name = s2.substring(0, pos);
- String val = s2.substring(pos+1);
- if (lowercaseKeys)
- name = name.toLowerCase();
- hm.put(name, val);
- }
- }
- return hm;
- }
-
- @SuppressWarnings("unchecked")
- public static String mapToStr(java.util.Map hm, char sep1, char sep2)
- //reverse of strToMap
- {
- if (hm == null || hm.isEmpty())
- return null;
-
- StringBuffer buffer = new StringBuffer();
- java.util.Iterator<java.util.Map.Entry> iter = hm.entrySet().iterator();
- while (iter.hasNext()) {
- java.util.Map.Entry entry = (java.util.Map.Entry)iter.next();
- buffer.append(entry.getKey());
- buffer.append(sep1);
- buffer.append(entry.getValue());
- if (iter.hasNext()) {
- buffer.append(sep2);
- }
- }
- return buffer.toString();
- }
- /**
- * Perform a <em>case insensitive</em> comparison between
- * the string representations of two objects.
- *
- * @param obj1 The first object to compare.
- * @param obj2 The second object to compare.
- *
- * @return <code>true</code> if both objects have the
- * same case-insensitive string representation.
- */
- public static boolean compareAsStrings(Object obj1, Object obj2)
- {
- if (obj1 == null || obj2 == null)
- return obj1 == obj2;
-
- String s1, s2;
- if (obj1 instanceof String) {
- s1 = (String)obj1;
- } else {
- s1 = obj1.toString();
- }
- if (obj2 instanceof String) {
- s2 = (String)obj2;
- }
- else {
- s2 = obj2.toString();
- }
-
- return s1.equalsIgnoreCase(s2);
- }
- /**
- * Tests whether a string starts with any of a list of strings.
- */
- public static boolean startsWithAny(String s, List<String> prefixes) {
- int count = prefixes.size();
- for (int i = 0; i < count; ++i) {
- if (s.startsWith((String)prefixes.get(i))) {
- return true;
- }
- }
- return false;
- }
- /**
- * Returns the argument string with the first char upper-case.
- */
- public static String initUpper(String str) {
- if (str == null || str.length() == 0) {
- return str;
- }
- return Character.toUpperCase(str.charAt(0)) + str.substring(1);
- }
- /**
- * Returns the argument string with the first char lower-case.
- */
- public static String initLower(String str) {
- if (str == null || str.length() == 0) {
- return str;
- }
- return Character.toLowerCase(str.charAt(0)) + str.substring(1);
- }
- /**
- * Tests whether all characters in the given string are upper
- * case.
- */
- public static boolean isUpperCase(String s) {
- return s.toUpperCase().equals(s);
- }
- /**
- * Returns the first non-white char index starting from the
- * specified index.
- */
- public static int skipWhiteSpaces(String str, int index) {
- int len = str.length();
- while (index < len) {
- if (!Character.isWhitespace(str.charAt(index))) {
- break;
- }
- ++index;
- }
- return index;
- }
- /**
- * Collapses consecutive white spaces into one space.
- */
- public static String collapseWhiteSpaces(String str){
- String result=null;
- if (str!=null){
- StringBuffer buffer=new StringBuffer();
- boolean isInWhiteSpace=false;
- for (int i=0;i<str.length();i++){
- char c=str.charAt(i);
- if (Character.isWhitespace(c)){
- isInWhiteSpace=true;
- }
- else {
- if (isInWhiteSpace)
- buffer.append(" ");
- isInWhiteSpace=false;
- buffer.append(c);
- }
- }
- result=buffer.toString();
- }
- return result;
- }
-
- /**
- * Utility methods used to convert DB object names to
- * appropriate Java type and field name
- */
- public static String pluralise(String name) {
- String result = name;
- if (name.length() == 1) {
- result += 's';
- } else if (!seemsPluralised(name)) {
- String lower = name.toLowerCase();
- if (!lower.endsWith("data")) { //orderData --> orderDatas is dumb
- char secondLast = lower.charAt(name.length() - 2);
- if (!isVowel(secondLast) && lower.endsWith("y")) {
- // city, body etc --> cities, bodies
- result = name.substring(0, name.length() - 1) + "ies";
- } else if (lower.endsWith("ch") || lower.endsWith("s")) {
- // switch --> switches or bus --> buses
- result = name + "es";
- } else {
- result = name + "s";
- }
- }
- }
- return result;
- }
-
- public static String singularise(String name) {
- String result = name;
- if (seemsPluralised(name)) {
- String lower = name.toLowerCase();
- if (lower.endsWith("ies")) {
- // cities --> city
- result = name.substring(0, name.length() - 3) + "y";
- } else if (lower.endsWith("ches") || lower.endsWith("ses")) {
- // switches --> switch or buses --> bus
- result = name.substring(0, name.length() - 2);
- } else if (lower.endsWith("s")) {
- // customers --> customer
- result = name.substring(0, name.length() - 1);
- }
- }
- return result;
- }
- private final static boolean isVowel(char c) {
- boolean vowel = false;
- vowel |= c == 'a';
- vowel |= c == 'e';
- vowel |= c == 'i';
- vowel |= c == 'o';
- vowel |= c == 'u';
- vowel |= c == 'y';
- return vowel;
- }
- private static boolean seemsPluralised(String name) {
- name = name.toLowerCase();
- boolean pluralised = false;
- pluralised |= name.endsWith("es");
- pluralised |= name.endsWith("s");
- pluralised &= !(name.endsWith("ss") || name.endsWith("us"));
- return pluralised;
- }
-
- /**
- * Returns the package name of a class name.
- * For example if given <code>oracle.util.ObjectUtil</code> it would return
- * <code>oracle.util</code>. If the class is not in a package then null is returned.
- */
- public static String getPackageName(String className) {
- if(className == null) {
- return null;
- }
- int lastDotIndex = className.lastIndexOf('.');
- if (lastDotIndex < 0)
- return null;
- return className.substring(0, lastDotIndex);
- }
- /**
- * Returns the class name given a full class name.
- * For example if given <code>oracle.util.ObjectUtil</code> it would return
- * <code>ObjectUtil</code>
- */
- public static String getClassName(String fullClassName) {
- if(fullClassName == null) {
- return null;
- }
- int lastDotIndex = fullClassName.lastIndexOf('.');
- if (lastDotIndex < 0)
- return fullClassName;
- return fullClassName.substring(lastDotIndex+1);
- }
-
-
- /**
- * Converts a database column name to a Java variable name (<em>first letter
- * not capitalized</em>).
- */
- public static String columnNameToVarName(String columnName) {
- return dbNameToVarName(columnName);
- }
- /**
- * Converts a database table name to a Java variable name (<em>first letter
- * not capitalized</em>).
- */
- public static String tableNameToVarName(String tableName) {
- return dbNameToVarName(tableName);
- }
- /**
- * Converts a database name (table or column) to a java name (<em>first letter
- * not capitalized</em>). employee_name or employee-name -> employeeName
- */
- private static String dbNameToVarName(String s) {
- if ("".equals(s)) {
- return s;
- }
- StringBuffer result = new StringBuffer();
-
- boolean capitalize = true;
- boolean lastCapital = false;
- boolean lastDecapitalized = false;
- String p = null;
- for (int i = 0; i < s.length(); i++) {
- String c = s.substring(i, i + 1);
- if ("_".equals(c) || " ".equals(c)) {
- capitalize = true;
- continue;
- }
-
- if (c.toUpperCase().equals(c)) {
- if (lastDecapitalized && !lastCapital) {
- capitalize = true;
- }
- lastCapital = true;
- } else {
- lastCapital = false;
- }
-
- if (capitalize) {
- if (p == null || !p.equals("_")) {
- result.append(c.toUpperCase());
- capitalize = false;
- p = c;
- } else {
- result.append(c.toLowerCase());
- capitalize = false;
- p = c;
- }
- } else {
- result.append(c.toLowerCase());
- lastDecapitalized = true;
- p = c;
- }
-
- }
- /*this was using StringUtil.initLower. Changed to Introspector.decapitalize so that
- * it returns the correct bean property name when called from columnNameToVarName.
- * This is necessary because otherwise URL would be uRL which would cause
- * an "The property uRL is undefined for the type xx" error because
- * Introspector.getBeanInfo (used by JavaTypeIntrospector) returns
- * the property name as URL.*/
- String resultStr = Introspector.decapitalize(result.toString());
- if (resultStr.equals("class")) {
- // "class" is illegal becauseOf Object.getClass() clash
- resultStr = "clazz";
- }
- return resultStr;
- }
-
- /**
- * Compare two objects. If both String, ignore case
- * @param o1
- * @param o2
- * @param ignoreCaseIfStr
- * @return
- */
- public static boolean equalObjects(Object o1, Object o2, boolean ignoreCaseIfStr)
- {
- if (o1 == o2) {
- return true;
- }
- boolean result;
- if (o1 == null || o2 == null) {
- return false; //we already checked o1 == o2 above
- }
- if (ignoreCaseIfStr && o1 instanceof String && o2 instanceof String)
- result = ((String)o1).equalsIgnoreCase((String)o2);
- else
- result = o1.equals(o2);
-
- return result;
- }
-
- public static boolean equalObjects(Object o1, Object o2)
- {
- return equalObjects(o1, o2, false/*ignoreCaseIfStr*/);
- }
-
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/UrlUtil.java b/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/UrlUtil.java
deleted file mode 100644
index db4f13b5ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/src/org/eclipse/jpt/jpa/gen/internal/util/UrlUtil.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.gen.internal.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.osgi.framework.Bundle;
-
-/**
- * Collections of utility methods handling URLs.
- *
- */
-public class UrlUtil
-{
- /**
- * The <code>file</code> string indicating a url file protocol.
- */
- public static final String FILE_PROTOCOL = "file";
- /**
- * The <code>file</code> string indicating a url http protocol.
- */
- public static final String HTTP_PROTOCOL = "http";
- /**
- * The <code>file</code> string indicating a url http protocol.
- */
- public static final String HTTPS_PROTOCOL = "https";
- /**
- * The <code>file</code> string indicating a url file protocol.
- */
- public static final String JAR_PROTOCOL = "jar";
-
-
- /**
- * Returns true if the specified url is to a file, i.e its protocol is <code>file</code>.
- */
- public static boolean isFileUrl(URL url) {
- return url != null && FILE_PROTOCOL.equals(url.getProtocol());
- }
- /**
- * Returns true if the specified url is to a jar, i.e its protocol is <code>jar</code>.
- * For example <code>jar:file:/C:/testapps/example/WEB-INF/lib/struts.jar!/META-INF/tlds/struts-bean.tld</code>.
- */
- public static boolean isJarUrl(URL url) {
- return url != null && JAR_PROTOCOL.equals(url.getProtocol());
- }
- /**
- * Returns true if the specified url protocol is http.
- */
- public static boolean isHttpUrl(URL url) {
- String protocol = url.getProtocol();
- return url != null && (HTTP_PROTOCOL.equals(protocol) || HTTPS_PROTOCOL.equals(protocol));
- }
- /**
- * Returns the <code>File</code> corresponding to a url, or null if the url
- * protocol is not file.
- */
- public static java.io.File getUrlFile(URL url) {
- if (isFileUrl(url) && !isJarUrl( url ) ){
- File ret = new java.io.File(url.getFile());
- return ret ;
- }
- return null;
- }
-
-
- /**
- * Returns the url to a jar file given a url to a file inside
- * the jar.
- * For example if given
- * <code>jar:file:/C:/testapps/example/WEB-INF/lib/struts.jar!/META-INF/tlds/struts-bean.tld</code>
- * this method returns <code>file:/C:/testapps/example/WEB-INF/lib/struts.jar</code>.
- *
- * <p>Returns null if the given url is not recognized as a url to a file
- * inside a jar.
- */
- public static URL getJarFileUrl(URL url) {
- if (!isJarUrl(url)) {
- return null;
- }
- String file = url.getFile(); //file:/C:/testapps/example/WEB-INF/lib/struts.jar!/META-INF/tlds/struts-bean.tld
- int index = file.indexOf('!');
- if (index < 0) {
- return null;
- }
- String jarFileUrlStr = file.substring(0, index);
- try {
- return new URL(jarFileUrlStr);
- } catch (MalformedURLException e) {
- return null;
- }
- }
-
- public static boolean isRemote(String url){
- return url.startsWith("http:")||url.startsWith("https:")||url.startsWith("www.");
- }
-
- public static File getTemplateFolder(String plugId , String strPath ){
- Bundle bundle = Platform.getBundle( plugId );
- Path path = new Path( strPath );
- URL url = FileLocator.find(bundle, path, null);
- try {
- URL templUrl;
- templUrl = FileLocator.resolve(url);
- File templDir = UrlUtil.getUrlFile(templUrl);
- return templDir ;
- } catch (IOException e) {
- e.printStackTrace();
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/column.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/column.vm
deleted file mode 100644
index f7d5bfafc8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/column.vm
+++ /dev/null
@@ -1,54 +0,0 @@
-##included template. Generates the @Column annotation.
-##Assumes that the context has a "column" and a "table" object
-##generate annotation only the parameters for the column NOT default
-##and the generateDLLAnnotation property is not set on the table
-###------------------------------------------------
-#macro( append $members $parameters )
-#if( $members == "")
-#set( $members = $parameters )
-#else
-#set( $members = "$members, $parameters" )
-#end
-#end
-###------------------------------------------------
-#if ( $column.dataTypeLOB)
- @Lob
-#end
-#if ( $column.needMapTemporalType)
- @Temporal(TemporalType.$column.temporalType)
-#end
-#set ($members = "")
-#if ( !$column.default || $customizer.generateDDLAnnotations )
-#if ( !${column.defaultname} )
-#append($members "name=$customizer.convertToJavaStringLiteral($column.name)" )
-#end
-#if (!$column.insertable)
-#append(${members} "insertable=false")
-#end
-#if (!$column.updateable)
-#append(${members} "updatable=false")
-#end
-#end
-#if( $customizer.generateDDLAnnotations )
-#if ($column.unique)
-#append($members "unique=true")
-#end
-#if (!$column.nullable)
-#append($members "nullable=false")
-#end
-#if ($column.size > 0)
-#if ($column.numeric)
-#append($members "precision=$column.size")
-#if ($column.decimalDigits != 0 && $column.decimalDigits != -1)
-#append($members "scale=$column.decimalDigits")
-#end
-#else
-#if ( !$column.dataTypeLOB)
-#append($members "length=$column.size")
-#end
-#end
-#end
-#end
-#if( $members !="" )
- @Column($members)
-#end
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/join.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/join.vm
deleted file mode 100644
index a98f87381f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/join.vm
+++ /dev/null
@@ -1,81 +0,0 @@
-##included template. Generates the @JoinTable, @JoinColumn or @JoinColumns annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-##macro joinColumn uses $column, $referencedColumn
-#macro (joinColumn $column $referencedColumn)
-#set ($members = "name=$customizer.convertToJavaStringLiteral($column.joinColumnName)")
-#if( !$referencedColumn.primaryKey || $referencedColumn.partOfCompositePrimaryKey )
-#set ($members = "$members, referencedColumnName=$customizer.convertToJavaStringLiteral($referencedColumn.name)")
-#end
-#if( $customizer.generateDDLAnnotations )
-#if ($column.unique && !$column.primaryKey)
-#set ($members = "$members, unique=true")
-#end
-#if (!$column.nullable)
-#set ($members = "$members, nullable=false")
-#end
-#end
-#if ($customizer.generateDDLAnnotations && !$role.association.joinTable && !$role.referrerTable.isColumnUpdateInsert($role, $column))
-#set ($members = "$members, insertable=false, updatable=false")
-#end
-@JoinColumn($members)#end
-##
-##
-##
-#if ($role.association.joinTable)
-#set ($joinTable = $role.association.joinTable)
- @JoinTable(
- name=$customizer.convertToJavaStringLiteral(${joinTable.joinTableAnnotationName})
- , joinColumns={
-#foreach ($column in $role.referrerColumns)
-#set ($referencedColumn = $role.getReferencedColumn(${column.name}))
-##$referencedColumn is the column in the join table
- #joinColumn($referencedColumn $column)
-#if ($velocityCount < $role.referrerColumns.size() )
-,
-#end
-#end
-
- }
- , inverseJoinColumns={
-#foreach ($column in $role.referencedColumns)
-#set ($referencedColumn = $role.getReferrerColumn(${column.name})
-)
-##$referencedColumn is the column in the join table
- #joinColumn($referencedColumn $column)
-#if ($velocityCount < $role.referencedColumns.size() )
-,
-#end
-#end
-
- }
- )
-#else
-#if ($role.referrerColumns.size() == 1)
-#set ($column = $role.referrerColumns.get(0))
-#set ($referencedColumn = $role.getReferencedColumn(${column.name}))
-#set ($referencedTableName = $customizer.convertToJavaStringLiteral($role.getReferencedTable().getName()) )
-#set( $referencedTablePkName = $customizer.convertToJavaStringLiteral($role.getReferencedTable().getPrimaryKeyColumn().name) )
-#set( $computedJoinColumnName = $customizer.convertToJavaStringLiteral("${role.propertyName}_${referencedTablePkName}") )
-#set( $isDefaultJoinColumnName = $column.isDefaultJoinColumnName( ${role.propertyName}) )
-#if( ! $isDefaultJoinColumnName )
- #joinColumn($column $referencedColumn)
-
-#elseif( $customizer.generateDDLAnnotations )
- #joinColumn($column $referencedColumn)
-
-#end
-#else
- @JoinColumns({
-#foreach ($column in $role.referrerColumns)
-#set ($referencedColumn = $role.getReferencedColumn(${column.name}))
- #joinColumn($column $referencedColumn)
-#if ($velocityCount < $role.referrerColumns.size() )
-,
-#else
-
-#end
-#end
- })
-#end
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/main.java.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/main.java.vm
deleted file mode 100644
index 31306f4969..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/main.java.vm
+++ /dev/null
@@ -1,134 +0,0 @@
-#if ($table.package != "")
-package ${table.package};
-#end
-
-import java.io.Serializable;
-import javax.persistence.*;
-${table.importStatements}
-
-/**
- * The persistent class for the ${table.name} database table.
- *
- */
-@Entity
-#if( !${table.defaultname} || $customizer.generateDDLAnnotations)
-@Table(name=$customizer.convertToJavaStringLiteral(${table.name}))
-#end
-public class ${table.className} ${table.generateExtendsImplements()} {
- private static final long serialVersionUID = 1L;
-#####
-##### fields
-#####
-#if ($table.compositeKey)
-#if ($table.access == "field")
-
- @EmbeddedId
-#end
- private ${table.compositeKeyClassName} ${table.compositeKeyPropertyName};
-#end
-#foreach ($column in $table.getSimpleColumns(true, true, false))
-#if ($table.access == "field")
-
-#parse("mappingKind.vm")
-#parse("column.vm")
-#end
- ${column.fieldScope} ${column.simplePropertyType} ${column.propertyName};
-#end
-#foreach ($role in $table.associationRoles)
-#####
-##### field annotations
-#####
-#if ($table.access == "field")
-
- //${role.description}
-#if ($role.cardinality == "many-to-one")
-#parse("manyToOne.vm")
-#elseif ($role.cardinality == "many-to-many")
-#parse("manyToMany.vm")
-#elseif ($role.cardinality == "one-to-many")
-#parse("oneToMany.vm")
-#elseif ($role.cardinality == "one-to-one")
-#parse("oneToOne.vm")
-#end
-#end
-#####
-##### field declaration
-#####
-#if ($role.cardinality == "many-to-one" || $role.cardinality == "one-to-one")
-#set ($propertyType = ${role.referencedTable.className})
-#elseif ($role.cardinality == "many-to-many" || $role.cardinality == "one-to-many")
-#set ($propertyType = "${role.referencedTable.simpleCollectionType}<${role.referencedTable.className}>")
-#end
- private $propertyType $role.propertyName;
-#end
-
- public ${table.className}() {
- }
-
-#####
-##### simple properties getters and setters
-#####
-#if ($table.compositeKey)
-#if ($table.access == "property")
-
- @EmbeddedId
-#end
- public $table.compositeKeyClassName $customizer.propertyGetter($table.compositeKeyPropertyName)() {
- return this.${table.compositeKeyPropertyName};
- }
-
- public void $customizer.propertySetter($table.compositeKeyPropertyName)($table.compositeKeyClassName $table.compositeKeyPropertyName) {
- this.${table.compositeKeyPropertyName} = ${table.compositeKeyPropertyName};
- }
-
-#end
-#foreach ($column in $table.getSimpleColumns(true, true, false))
-#if ($table.access == "property")
-
-#parse("mappingKind.vm")
-#parse("column.vm")
-#end
- $column.propertyGetScope $column.simplePropertyType $customizer.propertyGetter($column.propertyName)() {
- return this.${column.propertyName};
- }
-
- $column.propertySetScope void $customizer.propertySetter($column.propertyName)($column.simplePropertyType $column.propertyName) {
- this.${column.propertyName} = ${column.propertyName};
- }
-
-#end
-#####
-##### associations getters and setters
-#####
-#foreach ($role in $table.associationRoles)
-#if ($table.access == "property")
-
- //${role.description}
-#if ($role.cardinality == "many-to-one")
-#parse("manyToOne.vm")
-#elseif ($role.cardinality == "many-to-many")
-#parse("manyToMany.vm")
-#elseif ($role.cardinality == "one-to-many")
-#parse("oneToMany.vm")
-#elseif ($role.cardinality == "one-to-one")
-#parse("oneToOne.vm")
-#end
-#end
-##
-#if ($role.cardinality == "many-to-one" || $role.cardinality == "one-to-one")
-#set ($propertyType = $role.referencedTable.className)
-#elseif ($role.cardinality == "many-to-many" || $role.cardinality == "one-to-many")
-#set ($propertyType = "${role.referencedTable.simpleCollectionType}<${role.referencedTable.className}>")
-#end
- public $propertyType $customizer.propertyGetter($role.propertyName)() {
- return this.${role.propertyName};
- }
-
- public void ${customizer.propertySetter($role.propertyName)}($propertyType $role.propertyName) {
- this.${role.propertyName} = $role.propertyName;
- }
-
-##
-#end
-##
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToMany.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToMany.vm
deleted file mode 100644
index df0e0634ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToMany.vm
+++ /dev/null
@@ -1,26 +0,0 @@
-##included template. Generates the @ManyToMany annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-#if ($role.association.bidirectional && !$role.isReferrerRole())##the owning side (either side for many-to-many)
-#set ($members = $customizer.appendAnnotation("", "mappedBy", $role.oppositeRole.propertyName, true))
-#set ($members = $customizer.appendAnnotation($members, "cascade", $customizer.genCascades($role), false))
-#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.LAZY")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
-#if($members!="")
- @ManyToMany($members)
-#else
- @ManyToMany
-#end
-#else
-#set ($members = $customizer.appendAnnotation("", "cascade", $customizer.genCascades($role), false))
-#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.LAZY")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
-#if($members!="")
- @ManyToMany($members)
-#else
- @ManyToMany
-#end
-#parse("join.vm")
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToOne.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToOne.vm
deleted file mode 100644
index 1b43c1bd41..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/manyToOne.vm
+++ /dev/null
@@ -1,13 +0,0 @@
-##included template. Generates the @ManyToOne annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-#set ($members = $customizer.appendAnnotation("", "cascade", $customizer.genCascades($role), false))
-#if( $customizer.genFetch($role.referrerTable)!= "" && $customizer.genFetch($role.referrerTable)!= "FetchType.EAGER")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
-#if($members!="")
- @ManyToOne($members)
-#else
- @ManyToOne
-#end
-#parse("join.vm") \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/mappingKind.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/mappingKind.vm
deleted file mode 100644
index a7918cec1e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/mappingKind.vm
+++ /dev/null
@@ -1,34 +0,0 @@
-##included template. Generates the @Basic, @Id, @Version annotations.
-##Assumes that the context has a "column" object
-##
-#set ($mappingKind = $column.mappingKind)
-#if ($mappingKind == "id")
- @Id
-#set ($idGenerator = $table.idGenerator)
-#if ($idGenerator == "auto")
-#set ($generationType = "GenerationType.AUTO")
-#elseif ($idGenerator == "identity")
-#set ($generationType = "GenerationType.IDENTITY")
-#elseif ($idGenerator == "sequence")
-#set ($generationType = "GenerationType.SEQUENCE")
-#elseif ($idGenerator == "table")
-#set ($generationType = "GenerationType.TABLE")
-#else
-#set ($generationType = "")
-#end
-#if ($idGenerator == "sequence" )
-#set ($generatorName = "${table.name.toUpperCase()}_${column.propertyName.toUpperCase()}_GENERATOR")
-#if( $table.formattedSequence != "" )
- @SequenceGenerator(name="$generatorName", sequenceName="$table.formattedSequence")
-#else
- @SequenceGenerator(name="$generatorName" )
-#end
- @GeneratedValue(strategy=$generationType, generator="$generatorName")
-#elseif ($generationType != "")
- @GeneratedValue(strategy=$generationType)
-#end
-#elseif ($mappingKind == "version")
- @Version
-#else
-##DEFAULT is @Basic, no need to generate
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToMany.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToMany.vm
deleted file mode 100644
index 647bb3c10e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToMany.vm
+++ /dev/null
@@ -1,18 +0,0 @@
-##included template. Generates the @OneToMany annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-#if ($role.association.bidirectional)
-#set ($members = $customizer.appendAnnotation("", "mappedBy", $role.oppositeRole.propertyName, true))
-#set ($members = $customizer.appendAnnotation($members, "cascade", $customizer.genCascades($role), false))
-#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable) !="FetchType.LAZY")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
- @OneToMany($members)
-#else
-#set ($members = $customizer.appendAnnotation("", "cascade", $customizer.genCascades($role), false))
-#if($customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable) !="FetchType.LAZY")
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
- @OneToMany($members)
-#parse("join.vm")
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToOne.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToOne.vm
deleted file mode 100644
index 39849b4b7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/oneToOne.vm
+++ /dev/null
@@ -1,22 +0,0 @@
-##included template. Generates the @OneToOne annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-##
-#if ($role.association.bidirectional && !$role.isReferrerRole())##the owning side (either side for one-to-one)
-#set ($members = $customizer.appendAnnotation("", "mappedBy", $role.oppositeRole.propertyName, true))
-#set ($members = $customizer.appendAnnotation($members, "cascade", $customizer.genCascades($role), false))
-#if( $customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.EAGER" )
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
- @OneToOne($members)
-#else
-#set ($members = $customizer.appendAnnotation("", "cascade", $customizer.genCascades($role), false))
-#if( $customizer.genFetch($role.referrerTable)!="" && $customizer.genFetch($role.referrerTable)!="FetchType.EAGER" )
-#set ($members = $customizer.appendAnnotation($members, "fetch", $customizer.genFetch($role.referrerTable), false))
-#end
-#if($members!="")
- @OneToOne($members)
-#else
- @OneToOne
-#end
-#parse("join.vm")
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/pk.java.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/pk.java.vm
deleted file mode 100644
index f2bfac9388..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/entities/pk.java.vm
+++ /dev/null
@@ -1,65 +0,0 @@
-#if ($table.package != "")
-package ${table.package};
-#end
-
-import java.io.Serializable;
-import javax.persistence.*;
-
-/**
- * The primary key class for the ${table.name} database table.
- *
- */
-@Embeddable
-public class ${table.compositeKeyClassName} implements Serializable {
- //default serial version id, required for serializable classes.
- private static final long serialVersionUID = 1L;
-#####
-##### fields
-#####
-#foreach ($column in $table.primaryKeyColumns)
-#if ($table.access == "field")
-
-#parse("column.vm")
-#end
- ${column.fieldScope} ${column.propertyType} ${column.propertyName};
-#end
-
- public ${table.compositeKeyClassName}() {
- }
-#####
-##### simple properties getters and setters
-#####
-#foreach ($column in $table.primaryKeyColumns)
-#if ($table.access == "property")
-
-#parse("column.vm")
-#end
- $column.propertyGetScope $column.propertyType $customizer.propertyGetter($column.propertyName)() {
- return this.${column.propertyName};
- }
- $column.propertySetScope void $customizer.propertySetter($column.propertyName)($column.propertyType $column.propertyName) {
- this.${column.propertyName} = ${column.propertyName};
- }
-#end
-##
-## equals/hashCode
-
- public boolean equals(Object other) {
- if (this == other) {
- return true;
- }
- if (!(other instanceof ${table.compositeKeyClassName})) {
- return false;
- }
- ${table.compositeKeyClassName} castOther = (${table.compositeKeyClassName})other;
- return
- ${table.primaryKeyEqualsClause}
- }
-
- public int hashCode() {
- final int prime = 31;
- int hash = 17;
- ${table.primaryKeyHashCodeClause}
- return hash;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/basic.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/basic.vm
deleted file mode 100644
index 14af40a4df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/basic.vm
+++ /dev/null
@@ -1,3 +0,0 @@
- <basic name="${column.propertyName}" attribute-type="${column.propertyType}">
-#parse("column.vm")
- </basic>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/column.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/column.vm
deleted file mode 100644
index f2196b8324..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/column.vm
+++ /dev/null
@@ -1,29 +0,0 @@
-###------------------------------------------------
-#macro( append $members $parameters )
-#if ($members == "")
- #set( $members = $parameters )
-#else
- #set( $members = "$members $parameters" )
-#end
-#end
-###------------------------------------------------
-#set ($DQ = '"')
-#set ($members = "")
-#if (!$column.defaultname)
-#append($members "name=$customizer.convertToXmlStringLiteral($column.name)" )
-#end
-#if (!$column.insertable)
-#append(${members} "insertable=${DQ}false${DQ}")
-#end
-#if (!$column.updateable)
-#append(${members} "updatable=${DQ}false${DQ}")
-#end
-#if ($members !="")
- <column $members/>
-#end
-#if ($column.dataTypeLOB)
- <lob/>
-#end
-#if ($column.needMapTemporalType)
- <temporal>$column.temporalType</temporal>
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/embeddable.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/embeddable.vm
deleted file mode 100644
index cca15543d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/embeddable.vm
+++ /dev/null
@@ -1,9 +0,0 @@
-#### Embeddable ####
- <embeddable class="${table.qualifiedCompositeKeyClassName}" access="VIRTUAL">
-#### Mappings ####
- <attributes>
-#foreach ($column in $table.primaryKeyColumns)
-#parse("embeddedBasic.vm")
-#end
- </attributes>
- </embeddable>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/embeddedBasic.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/embeddedBasic.vm
deleted file mode 100644
index 14af40a4df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/embeddedBasic.vm
+++ /dev/null
@@ -1,3 +0,0 @@
- <basic name="${column.propertyName}" attribute-type="${column.propertyType}">
-#parse("column.vm")
- </basic>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/footer.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/footer.vm
deleted file mode 100644
index 702d9adf4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/footer.vm
+++ /dev/null
@@ -1,2 +0,0 @@
-#### Closing tags ####
-</entity-mappings> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/header.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/header.vm
deleted file mode 100644
index aed7d68406..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/header.vm
+++ /dev/null
@@ -1,4 +0,0 @@
-#### Top-level ####
-<?xml version="1.0" encoding="UTF-8"?>
-<entity-mappings version="2.4" xmlns="http://www.eclipse.org/eclipselink/xsds/persistence/orm" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.eclipse.org/eclipselink/xsds/persistence/orm http://www.eclipse.org/eclipselink/xsds/eclipselink_orm_2_4.xsd">
-## <package></package>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/id.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/id.vm
deleted file mode 100644
index ffbe4ad580..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/id.vm
+++ /dev/null
@@ -1,26 +0,0 @@
- <id name="${column.propertyName}" attribute-type="${column.propertyType}">
-#parse("column.vm")
-#set ($idGenerator = $table.idGenerator)
-#if ($idGenerator == "auto")
- #set ($generationType = "AUTO")
-#elseif ($idGenerator == "identity")
- #set ($generationType = "IDENTITY")
-#elseif ($idGenerator == "sequence")
- #set ($generationType = "SEQUENCE")
-#elseif ($idGenerator == "table")
- #set ($generationType = "TABLE")
-#else
- #set ($generationType = "")
-#end
-#if ($idGenerator == "sequence" )
- #set ($generatorName = "${table.name.toUpperCase()}_${column.propertyName.toUpperCase()}_GENERATOR")
- <generated-value strategy="$generationType" generator="$generatorName"/>
-#if ($table.formattedSequence != "")
- <sequence-generator name="$generatorName" sequence-name="$table.formattedSequence"/>
-#else
- <sequence-generator name="$generatorName"/>
-#end
-#elseif ($generationType != "")
- <generated-value strategy="$generationType"/>
-#end
- </id>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/join.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/join.vm
deleted file mode 100644
index 5bbd2c48e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/join.vm
+++ /dev/null
@@ -1,50 +0,0 @@
-##macro joinColumn
-#macro (joinColumn $column $referencedColumn)
- #set ($members = "name=$customizer.convertToJavaStringLiteral($column.joinColumnName)")
-#if (!$referencedColumn.primaryKey || $referencedColumn.partOfCompositePrimaryKey)
- #set ($members = "$members referenced-column-name=$customizer.convertToJavaStringLiteral($referencedColumn.name)")
-#end
- <join-column $members/>
-#end
-##macro inverseJoinColumn
-#macro (inverseJoinColumn $column $referencedColumn)
- #set ($members = "name=$customizer.convertToJavaStringLiteral($column.joinColumnName)")
-#if (!$referencedColumn.primaryKey || $referencedColumn.partOfCompositePrimaryKey)
- #set ($members = "$members referenced-column-name=$customizer.convertToJavaStringLiteral($referencedColumn.name)")
-#end
- <inverse-join-column $members/>
-#end
-##
-##
-#### JoinTables
-#if ($role.association.joinTable)
-#set ($joinTable = $role.association.joinTable)
- <join-table name=$customizer.convertToJavaStringLiteral(${joinTable.joinTableAnnotationName})>
-#foreach ($column in $role.referrerColumns)
- #set ($referencedColumn = $role.getReferencedColumn(${column.name}))
-##$referencedColumn is the column in the join table
- #joinColumn($referencedColumn $column)
-#end
-#foreach ($column in $role.referencedColumns)
- #set ($referencedColumn = $role.getReferrerColumn(${column.name}))
-##$referencedColumn is the column in the join table
- #inverseJoinColumn($referencedColumn $column)
-#end
- </join-table>
-#### JoinColumn
-#else
-#if ($role.referrerColumns.size() == 1)
- #set ($column = $role.referrerColumns.get(0))
- #set ($referencedColumn = $role.getReferencedColumn(${column.name}))
- #set( $isDefaultJoinColumnName = $column.isDefaultJoinColumnName( ${role.propertyName}))
-#if (! $isDefaultJoinColumnName)
-#joinColumn($column $referencedColumn)
-#end
-#### JoinColumns
-#else
-#foreach ($column in $role.referrerColumns)
- #set ($referencedColumn = $role.getReferencedColumn(${column.name}))
-#joinColumn($column $referencedColumn)
-#end
-#end
-#end
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/main.xml.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/main.xml.vm
deleted file mode 100644
index cb33c56ece..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/main.xml.vm
+++ /dev/null
@@ -1,38 +0,0 @@
-#### Entity ####
- <entity class="${table.qualifiedClassName}" access="VIRTUAL">
-#if (!$table.defaultname)
- <table name=$customizer.convertToXmlStringLiteral(${table.name})/>
-#end
-#### Mappings ####
- <attributes>
-##Check for embedded-id
-#if ($table.compositeKey)
- <embedded-id name="${table.compositeKeyPropertyName}" attribute-type="${table.qualifiedCompositeKeyClassName}"></embedded-id>
-#end
-#foreach ($column in $table.getSimpleColumns(true, true, false))
-#set ($mappingKind = $column.mappingKind)
-#if ($mappingKind == "id")
-#parse("id.vm")
-#elseif ($mappingKind == "basic")
-#parse("basic.vm")
-#elseif ($mappingKind == "version")
-#parse("version.vm")
-#end
-#end
-#foreach ($role in $table.associationRoles)
-#if ($role.cardinality == "many-to-one")
-#parse("manyToOne.vm")
-#end
-#end
-#foreach ($role in $table.associationRoles)
-#if ($role.cardinality == "one-to-many")
-#parse("oneToMany.vm")
-#end
-#end
-#foreach ($role in $table.associationRoles)
-#if ($role.cardinality == "many-to-many")
-#parse("manyToMany.vm")
-#end
-#end
- </attributes>
- </entity>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/manyToMany.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/manyToMany.vm
deleted file mode 100644
index 13adbd7b9c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/manyToMany.vm
+++ /dev/null
@@ -1,34 +0,0 @@
-##included template. Generates the @ManyToMany annotation.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-#set ($cascade=$customizer.genCascadesXml($role))
-#if ($role.association.bidirectional && !$role.isReferrerRole())##the owning side (either side for many-to-many)
- #set ($members = $customizer.appendAttribute("", "name", $role.propertyName, true))
- #set ($members = $customizer.appendAttribute($members, "mapped-by", $role.oppositeRole.propertyName, true))
- #set ($members = $customizer.appendAttribute($members, "target-entity", $role.referencedTable.qualifiedClassName, true))
- #set ($members = $customizer.appendAttribute($members, "attribute-type", $role.referencedTable.defaultCollectionType, true))
-#if ($customizer.genFetchXml($role.referrerTable)!="" && $customizer.genFetchXml($role.referrerTable)!="LAZY")
- #set ($members = $customizer.appendAttribute($members, "fetch", $customizer.genFetchXml($role.referrerTable), true))
-#end
- <many-to-many $members>
-#if ($cascade!="")
- <cascade>
- $cascade
- </cascade>
-#end
- </many-to-many>
-#else
- #set ($members = $customizer.appendAttribute("", "name", $role.propertyName, true))
- #set ($members = $customizer.appendAttribute($members, "target-entity", $role.referencedTable.qualifiedClassName, true))
- #set ($members = $customizer.appendAttribute($members, "attribute-type", $role.referencedTable.defaultCollectionType, true))
-#if ($customizer.genFetchXml($role.referrerTable)!="" && $customizer.genFetchXml($role.referrerTable)!="LAZY")
- #set ($members = $customizer.appendAttribute($members, "fetch", $customizer.genFetchXml($role.referrerTable), true))
-#end
- <many-to-many $members>
-#parse("join.vm")
-#if ($cascade!="")
- <cascade>
- $cascade
- </cascade>
-#end
- </many-to-many>
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/manyToOne.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/manyToOne.vm
deleted file mode 100644
index c220e0d25d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/manyToOne.vm
+++ /dev/null
@@ -1,16 +0,0 @@
-##included template. Generates the many-to-one element.
-##Assumes that the context has a "role" object representing the generated AssociationRole
-#set ($DQ = '"')
-#set ($members = "name=${DQ}$role.propertyName${DQ} target-entity=${DQ}$role.referencedTable.qualifiedClassName${DQ}")
-#if ($customizer.genFetchXml($role.referrerTable)!= "" && $customizer.genFetchXml($role.referrerTable)!= "EAGER")
- #set ($members = $customizer.appendAttribute($members, "fetch", $customizer.genFetchXml($role.referrerTable), true))
-#end
- <many-to-one $members>
-#parse("join.vm")
-#set ($cascade=$customizer.genCascadesXml($role))
-#if ($cascade!="")
- <cascade>
- $cascade
- </cascade>
-#end
- </many-to-one>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/oneToMany.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/oneToMany.vm
deleted file mode 100644
index 437d5532db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/oneToMany.vm
+++ /dev/null
@@ -1,32 +0,0 @@
-#set ($cascade=$customizer.genCascadesXml($role))
-#if ($role.association.bidirectional)
- #set ($members = $customizer.appendAttribute("", "name", $role.propertyName, true))
- #set ($members = $customizer.appendAttribute($members, "mapped-by", $role.oppositeRole.propertyName, true))
- #set ($members = $customizer.appendAttribute($members, "target-entity", $role.referencedTable.qualifiedClassName, true))
- #set ($members = $customizer.appendAttribute($members, "attribute-type", $role.referencedTable.defaultCollectionType, true))
-#if ($customizer.genFetchXml($role.referrerTable)!="" && $customizer.genFetchXml($role.referrerTable) !="LAZY")
- #set ($members = $customizer.appendAttribute($members, "fetch", $customizer.genFetchXml($role.referrerTable), true))
-#end
- <one-to-many $members>
-#if( $cascade!="")
- <cascade>
- $cascade
- </cascade>
-#end
- </one-to-many>
-#else
- #set ($members = $customizer.appendAttribute("", "name", $role.propertyName, true))
- #set ($members = $customizer.appendAttribute($members, "target-entity", $role.referencedTable.qualifiedClassName, true))
- #set ($members = $customizer.appendAttribute($members, "attribute-type", $role.referencedTable.defaultCollectionType, true))
-#if ($customizer.genFetchXml($role.referrerTable)!="" && $customizer.genFetchXml($role.referrerTable) !="LAZY")
- #set ($members = $customizer.appendAttribute($members, "fetch", $customizer.genFetchXml($role.referrerTable), true))
-#end
- <one-to-many $members>
-#parse("join.vm")
-#if ($cascade!="")
- <cascade>
- $cascade
- </cascade>
-#end
- </one-to-many>
-#end \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/version.vm b/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/version.vm
deleted file mode 100644
index f5347c33c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.gen/templates/xml_entities/version.vm
+++ /dev/null
@@ -1,3 +0,0 @@
- <version name="${column.propertyName}" attribute-type="${column.propertyType}">
-#parse("column.vm")
- </version>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/.classpath b/jpa/plugins/org.eclipse.jpt.jpa.ui/.classpath
deleted file mode 100644
index 934fb38085..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="src" path="property_files"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/.cvsignore b/jpa/plugins/org.eclipse.jpt.jpa.ui/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/.jetproperties b/jpa/plugins/org.eclipse.jpt.jpa.ui/.jetproperties
deleted file mode 100644
index 2907c83a43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/.jetproperties
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<jet-settings>
- <template-container>templates</template-container> <source-container>src</source-container>
-</jet-settings>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/.options b/jpa/plugins/org.eclipse.jpt.jpa.ui/.options
deleted file mode 100644
index c49913db89..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/.options
+++ /dev/null
@@ -1,14 +0,0 @@
-# Debugging options for org.eclipse.jpt.jpa.ui plug-in
-
-# Turn on debugging for the org.eclipse.jpt.jpa.ui plugin.
-org.eclipse.jpt.jpa.ui/debug=false
-
-# Turn on debugging for unit-tests
-org.eclipse.jpt.jpa.ui/debug/unit-tests=false
-
-# Turn on debugging for events occurring in the UI panes
-org.eclipse.jpt.jpa.ui/debug/ui/layout=false
-org.eclipse.jpt.jpa.ui/debug/ui/detailsView=false
-
-# Turn on debugging for events coming from ConnectionProfile
-org.eclipse.jpt.jpa.ui/debug/ui/db=false
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/.project b/jpa/plugins/org.eclipse.jpt.jpa.ui/.project
deleted file mode 100644
index 4c5101c089..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/.project
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.ui</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.emf.codegen.JETBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <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.emf.codegen.jet.IJETNature</nature>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/.settings/org.eclipse.jdt.core.prefs b/jpa/plugins/org.eclipse.jpt.jpa.ui/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 61775d0006..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:44 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF b/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF
deleted file mode 100644
index 3a2f3b7f58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,99 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.ui;singleton:=true
-Bundle-Version: 3.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.ui.JptJpaUiPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-ClassPath: .
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.expressions;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.draw2d;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.codegen;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)",
- org.eclipse.help;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.ui;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)",
- org.eclipse.jface;bundle-version="[3.7.0,4.0.0)",
- org.eclipse.jface.text;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.ui;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.db.ui;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.gen;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jst.common.annotations.controller;bundle-version="[1.1.100,2.0.0)",
- org.eclipse.jst.common.project.facet.core;bundle-version="[1.3.100,2.0.0)",
- org.eclipse.jst.common.project.facet.ui;bundle-version="[1.3.100,2.0.0)",
- org.eclipse.jst.j2ee;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.jst.j2ee.ui;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.persistence.jpa.jpql;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.ui.ide;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.views.properties.tabbed;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.ui.navigator;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.ui.navigator.resources;bundle-version="[3.3.100,4.0.0)",
- org.eclipse.ui.workbench.texteditor;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.frameworks.ui;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.ui;bundle-version="[1.3.0,2.0.0)",
- org.eclipse.wst.sse.core;bundle-version="[1.1.700,2.0.0)",
- org.eclipse.wst.sse.ui;bundle-version="[1.1.0,2.0.0)",
- org.eclipse.wst.validation;bundle-version="[1.2.0,2.0.0)",
- org.eclipse.wst.web.ui;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.xml.core;bundle-version="[1.1.700,2.0.0)",
- org.eclipse.wst.xml.ui;bundle-version="[1.1.300,2.0.0)"
-Export-Package: org.eclipse.jpt.jpa.ui,
- org.eclipse.jpt.jpa.ui.details,
- org.eclipse.jpt.jpa.ui.details.java,
- org.eclipse.jpt.jpa.ui.details.orm,
- org.eclipse.jpt.jpa.ui.internal;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.actions;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.commands;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.details;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.details.db;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.details.java;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.details.orm;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.dialogs;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.editors;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jface;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jpa2;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jpa2.details;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jpa2.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jpa2.platform.generic;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.jpql;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.listeners;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.menus;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.navigator;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.persistence.details;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.perspective;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.platform;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.platform.base;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.platform.generic;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.prefs;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.properties;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.selection;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.structure;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.views;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.wizards;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.wizards.entity;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.operation;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.wizards.gen;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.wizards.orm;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.wizards.proj;x-internal:=true,
- org.eclipse.jpt.jpa.ui.internal.wizards.proj.model;x-internal:=true,
- org.eclipse.jpt.jpa.ui.jpa2.details.java,
- org.eclipse.jpt.jpa.ui.jpa2.details.orm,
- org.eclipse.jpt.jpa.ui.selection
-Import-Package: com.ibm.icu.text;version="4.0.1"
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/about.html b/jpa/plugins/org.eclipse.jpt.jpa.ui/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/build.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/build.properties
deleted file mode 100644
index 16141b3e45..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/build.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/,\
- property_files/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- about.html,\
- icons/,\
- plugin.xml,\
- plugin.properties,\
- templates/,\
- images/
-jars.compile.order = .
-src.includes = templates/,\
- schema/
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/component.xml b/jpa/plugins/org.eclipse.jpt.jpa.ui/component.xml
deleted file mode 100644
index dd3e793443..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/component.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<component xmlns="http://eclipse.org/wtp/releng/tools/component-model" name="org.eclipse.jpt.jpa.ui"><description url=""></description><component-depends unrestricted="true"></component-depends><plugin id="org.eclipse.jpt.jpa.ui" fragment="false"/></component> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_entity_wiz.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_entity_wiz.gif
deleted file mode 100644
index 55f7cc932f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_entity_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpa_file_wiz.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpa_file_wiz.gif
deleted file mode 100644
index 610f6042d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpa_file_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpaproject_wiz.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpaproject_wiz.gif
deleted file mode 100644
index 633768f35d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/dtool16/new_jpaproject_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/jpa_facet.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/jpa_facet.gif
deleted file mode 100644
index c0ab917511..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/jpa_facet.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_entity_wiz.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_entity_wiz.gif
deleted file mode 100644
index 8533ca10fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_entity_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpa_file_wiz.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpa_file_wiz.gif
deleted file mode 100644
index 6e0042e98c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpa_file_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpaproject_wiz.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpaproject_wiz.gif
deleted file mode 100644
index 12da8074ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_jpaproject_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_details.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_details.gif
deleted file mode 100644
index 3280138b67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_details.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_perspective.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_perspective.gif
deleted file mode 100644
index c0ab917511..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_perspective.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_structure.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_structure.gif
deleted file mode 100644
index 682c90a589..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/eview16/jpa_structure.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/basic.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/basic.gif
deleted file mode 100644
index a547d743e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/basic.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/element-collection.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/element-collection.gif
deleted file mode 100644
index 64706d215f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/element-collection.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embeddable.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embeddable.gif
deleted file mode 100644
index 8856f78874..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embeddable.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded-id.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded-id.gif
deleted file mode 100644
index c1c8e210e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded-id.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded.gif
deleted file mode 100644
index c2ae66497a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/embedded.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity-mappings.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity-mappings.gif
deleted file mode 100644
index c349c962e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity-mappings.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity.gif
deleted file mode 100644
index d606f482e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/entity.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/id.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/id.gif
deleted file mode 100644
index a205ec38ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/id.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-content.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-content.gif
deleted file mode 100644
index c0ab917511..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-content.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-file.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-file.gif
deleted file mode 100644
index b4e9f4724b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-file.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-jar-file.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-jar-file.gif
deleted file mode 100644
index e92828d2d9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpa-jar-file.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.function.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.function.gif
deleted file mode 100644
index c94434c95e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.function.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.identifier.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.identifier.gif
deleted file mode 100644
index b6d82ff0dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.identifier.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.variable.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.variable.gif
deleted file mode 100644
index a5c6124de5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/jpql.variable.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-many.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-many.gif
deleted file mode 100644
index 48885b21fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-many.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-one.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-one.gif
deleted file mode 100644
index 2e1e2b9387..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/many-to-one.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/mapped-superclass.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/mapped-superclass.gif
deleted file mode 100644
index 8cc37645c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/mapped-superclass.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-attribute-mapping.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-attribute-mapping.gif
deleted file mode 100644
index 70a9c23541..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-attribute-mapping.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-type-mapping.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-type-mapping.gif
deleted file mode 100644
index 6279478c51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/null-type-mapping.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-many.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-many.gif
deleted file mode 100644
index 1e90027861..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-many.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-one.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-one.gif
deleted file mode 100644
index 578ec36aa3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/one-to-one.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence-unit.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence-unit.gif
deleted file mode 100644
index 9cc45f6945..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence-unit.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence.gif
deleted file mode 100644
index d1f616d64f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/persistence.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/transient.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/transient.gif
deleted file mode 100644
index cc5d83db20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/transient.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/version.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/version.gif
deleted file mode 100644
index 202a8104f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/version.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/warning.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/warning.gif
deleted file mode 100644
index 14009e9974..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/obj16/warning.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_entity_wizban.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_entity_wizban.gif
deleted file mode 100644
index b1d934cb87..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_entity_wizban.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_file_wizban.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_file_wizban.gif
deleted file mode 100644
index e84622322a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_file_wizban.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_prj_wiz.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_prj_wiz.gif
deleted file mode 100644
index 4f52bb65bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/icons/full/wizban/new_jpa_prj_wiz.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add-connection.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add-connection.gif
deleted file mode 100644
index 864034f74e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add-connection.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add.png
deleted file mode 100644
index 6bd3486b7a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/add.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse-mini.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse-mini.png
deleted file mode 100644
index 1f64f24965..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse-mini.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse.png
deleted file mode 100644
index 8081fd9293..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/browse.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/collapse-all.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/collapse-all.png
deleted file mode 100644
index 3582d18d5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/collapse-all.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/delete.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/delete.png
deleted file mode 100644
index afba8b4463..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/delete.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/deselect-all.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/deselect-all.png
deleted file mode 100644
index 49544f5703..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/deselect-all.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/dot.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/dot.gif
deleted file mode 100644
index 57a514d649..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/dot.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/edit.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/edit.png
deleted file mode 100644
index 306d6a1c5f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/edit.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/expand-all.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/expand-all.png
deleted file mode 100644
index db729a3990..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/expand-all.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/list-of-values.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/list-of-values.png
deleted file mode 100644
index 8081fd9293..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/list-of-values.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-down.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-down.png
deleted file mode 100644
index f6e5281b70..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-down.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-up.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-up.png
deleted file mode 100644
index 7c8b1ccf79..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/move-up.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/reconnect.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/reconnect.png
deleted file mode 100644
index df009468ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/reconnect.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/refresh.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/refresh.gif
deleted file mode 100644
index 3ca04d06ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/refresh.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/restore-defaults.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/restore-defaults.png
deleted file mode 100644
index 2d74ae4e01..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/restore-defaults.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/select-all.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/select-all.png
deleted file mode 100644
index 4eaff2beab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/select-all.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/warningstd.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/warningstd.png
deleted file mode 100644
index a7b471c2d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/buttons/warningstd.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img-hover.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img-hover.png
deleted file mode 100644
index 0751b3267c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img-hover.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img.png
deleted file mode 100644
index 5fb4dc2a2c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/export-as-img.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_left_bg.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_left_bg.png
deleted file mode 100644
index abfffe4bc7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_left_bg.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_mid_bg.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_mid_bg.png
deleted file mode 100644
index caa828d3c0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_mid_bg.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_right_bg.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_right_bg.png
deleted file mode 100644
index bd7414470c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/header_right_bg.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print-hover.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print-hover.png
deleted file mode 100644
index 468a09b5de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print-hover.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print.png
deleted file mode 100644
index ee15ba107e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/print.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-bottom.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-bottom.png
deleted file mode 100644
index d84b339401..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-bottom.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-left.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-left.png
deleted file mode 100644
index fa25df32e8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-left.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-right.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-right.png
deleted file mode 100644
index a58c953f1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-lower-right.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-side.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-side.png
deleted file mode 100644
index 585ed6a9e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-side.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-upper-right.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-upper-right.png
deleted file mode 100644
index ccabb96f5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/shadow-upper-right.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/toolbar_bg.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/toolbar_bg.png
deleted file mode 100644
index c483a49336..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/diagram/toolbar_bg.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/column.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/column.gif
deleted file mode 100644
index 5f1551ba96..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/column.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/columnKey.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/columnKey.gif
deleted file mode 100644
index 4f385155d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/columnKey.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/file.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/file.png
deleted file mode 100644
index f5c1810a63..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/file.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/folder.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/folder.png
deleted file mode 100644
index 9759da4e20..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/folder.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/forward.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/forward.gif
deleted file mode 100644
index 562bd70b5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/forward.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/moveRight.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/moveRight.gif
deleted file mode 100644
index 7a1511dd8e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/moveRight.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/package.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/package.png
deleted file mode 100644
index 471cc4367d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/package.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table.gif
deleted file mode 100644
index a99388a9af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table_obj.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table_obj.gif
deleted file mode 100644
index e2ccabb383..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/objects/table_obj.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/error.gif b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/error.gif
deleted file mode 100644
index 119dcccd5a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/error.gif
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/warning.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/warning.png
deleted file mode 100644
index 8c1e86c479..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/overlays/warning.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/save-image-16.png b/jpa/plugins/org.eclipse.jpt.jpa.ui/images/save-image-16.png
deleted file mode 100644
index eca4774fec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/images/save-image-16.png
+++ /dev/null
Binary files differ
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.properties
deleted file mode 100644
index bc640982c7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.properties
+++ /dev/null
@@ -1,78 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-pluginName= Dali Java Persistence Tools - JPA UI
-providerName=Eclipse Web Tools Platform
-
-JPA_PLATFORM_UI="JPA Platform UI"
-
-jpaNavigatorContent=JPA Content
-
-jpaWizardCategoryName = JPA
-newJpaProjectWizardName = JPA Project
-newJpaProjectWizardDesc = Create a JPA project
-newJpaEntityWizardName = JPA Entity
-newJpaEntityWizardDesc = Create a JPA Entity
-newJpaMappingFileWizardName = JPA ORM Mapping File
-newJpaMappingFileWizardDesc = Create a JPA ORM Mapping File
-newJpaEntityFromTableWizardName = JPA Entities from Tables
-newJpaEntityFromTableWizardDesc = Create JPA Entities from database tables
-
-upgradeToLatestVersion = Upgrade Document Version
-jpaStructureViewCommandCategory = JPA Structure View
-addPersistentClass = Add Class...
-removePersistentClass = Remove Class
-addPersistentAttributeToXml = Add Attribute to XML
-addPersistentAttributeToXmlAndMap = Add Attribute to XML and Map...
-removePersistentAttributeFromXml = Remove Attribute from XML
-mapAs=Map As
-mapAsMnemonic=M
-mapAsParameterName=mapping key
-mapAsSpecifiedMappingParameterName=specified mapping key
-mapAsDefaultMappingParameterName=default mapping key
-convertJavaProjectToJpaCommandName=Convert to JPA Project...
-
-jpaMenuName = JPA Tools
-generateEntities = Generate Entities from Tables...
-generateDDL = Generate Tables from Entities...
-moveToXml = Move to XML
-convertJavaQueries = Java Queries...
-convertJavaGenerators= Java Generators...
-jpaMetadataConversionCommandCategory=JPA Metadata Conversion
-synchronizeClasses = Synchronize Class List
-makePersistent = Make Persistent...
-persistenceEditor = Persistence XML Editor
-
-javaPersistenceNode = Java Persistence
-jpaNode = JPA
-jpaEntityGenNode = Entity Generation
-jpaProblemSeveritiesNode = Errors/Warnings
-
-jpaPerspective = JPA
-jpaPerspectiveDescription = This perspective is designed to support Java Persistence (JPA) development. It offers a Project Explorer, JPA Details, JPA Structure and a Data Source Explorer.
-jpaDetails = JPA Details
-jpaStructure = JPA Structure
-JpaProposalCategory = JPA Proposals
-
-JptCreationActionSet.label = Jpt Creation
-JptCreationActionSet.description = Jpt Creation Action Set
-
-NewEntityAction.label = New Entity \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml b/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml
deleted file mode 100644
index 265977c237..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/plugin.xml
+++ /dev/null
@@ -1,1228 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?>
-<!--
- Copyright (c) 2007, 2012 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <!-- ***** extension points ***** -->
-
- <extension-point
- id="jpaPlatformUis"
- name="%JPA_PLATFORM_UI"
- schema="schema/jpaPlatformUis.exsd"/>
-
-
- <!-- ***** expressions ***** -->
-
- <extension
- point="org.eclipse.core.expressions.definitions">
-
- <!--
- A test for determining whether our current context is within the
- JPA Structure View
- -->
- <definition
- id="org.eclipse.jpt.jpa.ui.reference.inJpaStructureView">
- <with
- variable="activePartId">
- <equals
- value="org.eclipse.jpt.ui.jpaStructureView"/>
- </with>
- </definition>
-
- </extension>
-
-
- <!-- ***** adapters ***** -->
-
- <extension
- point="org.eclipse.core.runtime.adapters">
-
- <!-- JpaPlatform -> JpaPlatformUi -->
- <factory
- adaptableType="org.eclipse.jpt.jpa.core.JpaPlatform"
- class="org.eclipse.jpt.jpa.ui.internal.JpaPlatformAdapterFactory">
- <adapter type="org.eclipse.jpt.jpa.ui.JpaPlatformUi"/>
- </factory>
-
- <!-- IWorkspace -> JpaProjectsModel -->
- <factory
- adaptableType="org.eclipse.core.resources.IWorkspace"
- class="org.eclipse.jpt.jpa.ui.internal.WorkspaceAdapterFactory">
- <adapter type="org.eclipse.jpt.jpa.ui.JpaProjectsModel"/>
- </factory>
-
- <!-- IProject
- -> JpaProjectModel
- -> JpaRootContextNodeModel
- -->
- <factory
- adaptableType="org.eclipse.core.resources.IProject"
- class="org.eclipse.jpt.jpa.ui.internal.ProjectAdapterFactory">
- <adapter type="org.eclipse.jpt.jpa.ui.JpaProjectModel"/>
- <adapter type="org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel"/>
- </factory>
-
- <!-- IFile -> JpaFileModel -->
- <factory
- adaptableType="org.eclipse.core.resources.IFile"
- class="org.eclipse.jpt.jpa.ui.internal.FileAdapterFactory">
- <adapter type="org.eclipse.jpt.jpa.ui.JpaFileModel"/>
- </factory>
-
- <!-- JpaStructureNode -> JpaDetailsPageManager.Factory -->
- <factory
- adaptableType="org.eclipse.jpt.jpa.core.JpaStructureNode"
- class="org.eclipse.jpt.jpa.ui.internal.JpaStructureNodeAdapterFactory">
- <adapter type="org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager$Factory"/>
- </factory>
-
- <!-- IWorkbench -> JpaSelectionManager -->
- <factory
- adaptableType="org.eclipse.ui.IWorkbench"
- class="org.eclipse.jpt.jpa.ui.internal.selection.WorkbenchAdapterFactory">
- <adapter type="org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager"/>
- </factory>
-
- <!-- IWorkbenchWindow -> JpaSelectionManager -->
- <factory
- adaptableType="org.eclipse.ui.IWorkbenchWindow"
- class="org.eclipse.jpt.jpa.ui.internal.selection.WorkbenchWindowAdapterFactory">
- <adapter type="org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager"/>
- </factory>
-
- <!-- ITextEditor -> JpaEditorManager -->
- <factory
- adaptableType="org.eclipse.ui.texteditor.ITextEditor"
- class="org.eclipse.jpt.jpa.ui.internal.selection.TextEditorAdapterFactory">
- <adapter type="org.eclipse.jpt.jpa.ui.selection.JpaEditorManager"/>
- </factory>
-
- <!-- IViewPart -> JpaViewManager.PageManager -->
- <factory
- adaptableType="org.eclipse.ui.IViewPart"
- class="org.eclipse.jpt.jpa.ui.internal.selection.ViewPartAdapterFactory">
- <adapter type="org.eclipse.jpt.jpa.ui.selection.JpaViewManager$PageManager"/>
- </factory>
-
- </extension>
-
-
- <!-- ***** Java/XML completion proposal computers ***** -->
-
- <extension
- point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
- id="jpaProposalCategory"
- name="%JpaProposalCategory">
-
- <proposalCategory
- icon="$nl$/icons/full/eview16/jpa_perspective.gif">
- <enablement>
- <with variable="project">
- <adapt
- type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa" forcePluginActivation="true"/>
- </adapt>
- </with>
- </enablement>
- </proposalCategory>
-
- </extension>
-
- <extension
- point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
- id="JpaCompletionProposalComputer">
-
- <javaCompletionProposalComputer
- class="org.eclipse.jpt.jpa.ui.internal.JpaJavaCompletionProposalComputer"
- categoryId="org.eclipse.jpt.jpa.ui.jpaProposalCategory">
- <partition type="__dftl_partition_content_type"/>
- <partition type="__java_string"/>
- </javaCompletionProposalComputer>
-
- </extension>
-
- <extension
- point="org.eclipse.jdt.ui.javaCompletionProposalComputer"
- id="JpaJpqlCompletionProposalComputer">
-
- <javaCompletionProposalComputer
- class="org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlJavaCompletionProposalComputer"
- activate="true"
- categoryId="org.eclipse.jpt.jpa.ui.jpaProposalCategory">
- <partition type="__dftl_partition_content_type"/>
- <partition type="__java_string"/>
- </javaCompletionProposalComputer>
-
- </extension>
-
- <extension
- point="org.eclipse.wst.sse.ui.completionProposal"
- id="org.eclipse.jpt.jpa.ui.xml.jpaCompletionProposal">
-
- <proposalCategory
- icon="$nl$/icons/full/eview16/jpa_perspective.gif"
- id="org.eclipse.jpt.jpa.ui.xml.jpaProposalCategory"
- name="%JpaProposalCategory">
- </proposalCategory>
-
- <proposalComputer
- activate="true"
- categoryId="org.eclipse.jpt.jpa.ui.xml.jpaProposalCategory"
- class="org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlSseCompletionProposalComputer"
- id="org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlSseCompletionProposalComputer">
- <contentType
- id="org.eclipse.core.runtime.xml">
- </contentType>
- </proposalComputer>
-
- <!-- Use xml instead of more specific mappingFile content type so JPA Proposals appears in the XMl preferences -->
- <proposalComputer
- activate="true"
- categoryId="org.eclipse.jpt.jpa.ui.xml.jpaProposalCategory"
- class="org.eclipse.jpt.jpa.ui.internal.JpaXmlCompletionProposalComputer"
- id="org.eclipse.jpt.jpa.ui.internal.JpaXmlCompletionProposalComputer">
- <contentType
- id="org.eclipse.core.runtime.xml">
- </contentType>
- </proposalComputer>
- </extension>
-
-
- <!-- ***** Dali extensions (eat our own dogfood) ***** -->
-
- <extension
- point="org.eclipse.jpt.jpa.ui.jpaPlatformUis">
-
- <jpaPlatformUi
- id="generic.ui"
- jpaPlatform="generic"
- factoryClass="org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUiFactory"/>
-
- <jpaPlatformUi
- id="generic2_0.ui"
- jpaPlatform="generic2_0"
- factoryClass="org.eclipse.jpt.jpa.ui.internal.jpa2.platform.generic.Generic2_0JpaPlatformUiFactory"/>
-
- </extension>
-
-
- <!-- ***** action sets ***** -->
-
- <extension
- point="org.eclipse.ui.actionSets">
-
- <actionSet
- description="%JptCreationActionSet.description"
- id="org.eclipse.jpt.jpa.ui.JptCreationActionSet"
- label="%JptCreationActionSet.label">
- <action
- class="org.eclipse.jpt.jpa.ui.internal.wizards.NewEntityDropDownAction"
- disabledIcon="icons/full/etool16/new_entity_wiz.gif"
- icon="icons/full/etool16/new_entity_wiz.gif"
- id="org.eclipse.jpt.jpa.ui.NewEntityAction"
- label="%NewEntityAction.label"
- style="pulldown"
- toolbarPath="Normal/JptWizards">
- </action>
- </actionSet>
-
- </extension>
-
-
- <!-- ***** commands ***** -->
-
- <extension
- point="org.eclipse.ui.commands">
-
- <command
- id="org.eclipse.jpt.jpa.ui.convertJavaProjectToJpa"
- name="%convertJavaProjectToJpaCommandName"
- categoryId="org.eclipse.ui.category.file"
- defaultHandler="org.eclipse.jpt.jpa.ui.internal.commands.ConvertJavaProjectToJpaCommandHandler"/>
-
- <command
- id="org.eclipse.jpt.jpa.ui.xmlFileUpgradeToLatestVersion"
- name="%upgradeToLatestVersion"/>
-
- <category
- id="org.eclipse.jpt.jpa.ui.jpaStructureViewCommands"
- name="%jpaStructureViewCommandCategory">
- </category>
-
- <command
- id="org.eclipse.jpt.jpa.ui.entityMappingsAddPersistentClass"
- name="%addPersistentClass"
- categoryId="org.eclipse.jpt.jpa.ui.jpaStructureViewCommands">
- </command>
-
- <command
- id="org.eclipse.jpt.jpa.ui.persistentAttributeAddToXml"
- name="%addPersistentAttributeToXml"
- categoryId="org.eclipse.jpt.jpa.ui.jpaStructureViewCommands">
- </command>
-
- <command
- id="org.eclipse.jpt.jpa.ui.persistentAttributeAddToXmlAndMap"
- name="%addPersistentAttributeToXmlAndMap"
- categoryId="org.eclipse.jpt.jpa.ui.jpaStructureViewCommands">
- </command>
-
- <command
- id="org.eclipse.jpt.jpa.ui.persistentTypeMapAs"
- name="%mapAs"
- categoryId="org.eclipse.jpt.jpa.ui.jpaStructureViewCommands">
- <commandParameter
- id="persistentTypeMappingKey"
- name="%mapAsParameterName"
- optional="false">
- </commandParameter>
- </command>
-
- <command
- id="org.eclipse.jpt.jpa.ui.persistentAttributeMapAs"
- name="%mapAs"
- categoryId="org.eclipse.jpt.jpa.ui.jpaStructureViewCommands">
- <commandParameter
- id="specifiedPersistentAttributeMappingKey"
- name="%mapAsSpecifiedMappingParameterName"
- optional="false">
- </commandParameter>
- <commandParameter
- id="defaultPersistentAttributeMappingKey"
- name="%mapAsDefaultMappingParameterName"
- optional="false">
- </commandParameter>
- </command>
-
- <category
- id="org.eclipse.jpt.jpa.ui.jpaMetadataConversionCommands"
- name="%jpaMetadataConversionCommandCategory">
- </category>
-
- <command
- id="org.eclipse.jpt.jpa.ui.convertJavaGenerators"
- name="%convertJavaGenerators"
- categoryId="org.eclipse.jpt.jpa.ui.jpaMetadataConversionCommands">
- </command>
-
- <command
- id="org.eclipse.jpt.jpa.ui.convertJavaQueries"
- name="%convertJavaQueries"
- categoryId="org.eclipse.jpt.jpa.ui.jpaMetadataConversionCommands">
- </command>
-
- </extension>
-
-
- <!-- ***** persitence.xml editor ***** -->
-
- <extension
- point="org.eclipse.ui.editors">
-
- <editor
- class="org.eclipse.jpt.jpa.ui.internal.editors.PersistenceEditor"
- contributorClass="org.eclipse.jpt.jpa.ui.internal.editors.PersistenceContributor"
- icon="$nl$/icons/full/obj16/jpa-file.gif"
- id="org.eclipse.jpt.jpa.ui.internal.editors.PersistenceEditor"
- name="%persistenceEditor">
- <contentTypeBinding
- contentTypeId="org.eclipse.jpt.jpa.core.content.persistence"/>
- </editor>
-
- </extension>
-
-
- <!-- ***** handlers ***** -->
-
- <extension
- point="org.eclipse.ui.handlers">
-
- <handler
- commandId="org.eclipse.jpt.jpa.ui.xmlFileUpgradeToLatestVersion"
- class="org.eclipse.jpt.jpa.ui.internal.commands.UpgradeXmlFileVersionHandler">
- <enabledWhen>
- <iterate>
- <or>
- <adapt type="org.eclipse.jpt.jpa.core.context.XmlFile">
- <test property="org.eclipse.jpt.jpa.core.isNotLatestSupportedVersion"/>
- </adapt>
- <adapt type="org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource">
- <test property="org.eclipse.jpt.jpa.core.isNotLatestSupportedVersion"/>
- </adapt>
- </or>
- </iterate>
- </enabledWhen>
- </handler>
-
- <handler
- commandId="org.eclipse.jpt.jpa.ui.entityMappingsAddPersistentClass"
- class="org.eclipse.jpt.jpa.ui.internal.commands.AddPersistentClassHandler">
- <activeWhen>
- <reference
- definitionId="org.eclipse.jpt.jpa.ui.reference.inJpaStructureView">
- </reference>
- </activeWhen>
- <enabledWhen>
- <and>
- <count value="1"/>
- <iterate>
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.EntityMappings"/>
- </iterate>
- </and>
- </enabledWhen>
- </handler>
-
- <handler
- commandId="org.eclipse.ui.edit.delete"
- class="org.eclipse.jpt.jpa.ui.internal.commands.RemovePersistentClassHandler">
- <activeWhen>
- <and>
- <with variable="activePartId">
- <equals value="org.eclipse.jpt.ui.jpaStructureView"/>
- </with>
- <iterate>
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType"/>
- </iterate>
- </and>
- </activeWhen>
- </handler>
-
- <handler
- commandId="org.eclipse.jpt.jpa.ui.persistentAttributeAddToXml"
- class="org.eclipse.jpt.jpa.ui.internal.commands.AddPersistentAttributeToXmlHandler">
- <activeWhen>
- <reference
- definitionId="org.eclipse.jpt.jpa.ui.reference.inJpaStructureView">
- </reference>
- </activeWhen>
- <enabledWhen>
- <iterate>
- <and>
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute"/>
- <test property="org.eclipse.jpt.jpa.core.isVirtual"/>
- <test property="org.eclipse.jpt.jpa.core.isMapped"/>
- </and>
- </iterate>
- </enabledWhen>
- </handler>
-
- <handler
- commandId="org.eclipse.jpt.jpa.ui.persistentAttributeAddToXmlAndMap"
- class="org.eclipse.jpt.jpa.ui.internal.commands.AddPersistentAttributeToXmlAndMapHandler">
- <activeWhen>
- <reference
- definitionId="org.eclipse.jpt.jpa.ui.reference.inJpaStructureView">
- </reference>
- </activeWhen>
- <enabledWhen>
- <iterate>
- <and>
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute"/>
- <test property="org.eclipse.jpt.jpa.core.isVirtual"/>
- </and>
- </iterate>
- </enabledWhen>
- </handler>
-
- <handler
- commandId="org.eclipse.ui.edit.delete"
- class="org.eclipse.jpt.jpa.ui.internal.commands.RemovePersistentAttributeFromXmlHandler">
- <activeWhen>
- <and>
- <with variable="activePartId">
- <equals value="org.eclipse.jpt.ui.jpaStructureView"/>
- </with>
- <iterate operator="and">
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute"/>
- <test property="org.eclipse.jpt.jpa.core.isNotVirtual"/>
- </iterate>
- </and>
- </activeWhen>
- </handler>
-
- <handler
- commandId="org.eclipse.jpt.jpa.ui.persistentTypeMapAs"
- class="org.eclipse.jpt.jpa.ui.internal.commands.PersistentTypeMapAsHandler">
- <activeWhen>
- <reference
- definitionId="org.eclipse.jpt.jpa.ui.reference.inJpaStructureView"/>
- </activeWhen>
- <enabledWhen>
- <iterate>
- <instanceof value="org.eclipse.jpt.jpa.core.context.PersistentType"/>
- </iterate>
- </enabledWhen>
- </handler>
-
- <handler
- commandId="org.eclipse.jpt.jpa.ui.persistentAttributeMapAs"
- class="org.eclipse.jpt.jpa.ui.internal.commands.PersistentAttributeMapAsHandler">
- <activeWhen>
- <reference
- definitionId="org.eclipse.jpt.jpa.ui.reference.inJpaStructureView"/>
- </activeWhen>
- <enabledWhen>
- <iterate>
- <and>
- <instanceof value="org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute"/>
- <test property="org.eclipse.jpt.jpa.core.isNotVirtual"/>
- </and>
- </iterate>
- </enabledWhen>
- </handler>
-
- <handler
- class="org.eclipse.jpt.jpa.ui.internal.commands.JavaGeneratorConversionHandler"
- commandId="org.eclipse.jpt.jpa.ui.convertJavaGenerators"/>
-
- <handler
- class="org.eclipse.jpt.jpa.ui.internal.commands.JavaQueryConversionHandler"
- commandId="org.eclipse.jpt.jpa.ui.convertJavaQueries"/>
-
- </extension>
-
-
- <!-- ***** menus ***** -->
-
- <extension
- point="org.eclipse.ui.menus">
-
- <!-- contributions for any popup -->
- <menuContribution
- locationURI="popup:org.eclipse.ui.popup.any">
-
- <!-- "JPA Tools" submenu for
- - anything that adapts to JpaXmlResource (IFile objects, mostly)
- - anything that adapts to IProject and has a JPA facet
- -->
- <menu
- id="org.eclipse.jpt.jpa.ui.menu.JpaTools"
- label="%jpaMenuName">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <or>
- <adapt type="org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource"/>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"/>
- </adapt>
- <and>
- <adapt type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"/>
- </adapt>
- <adapt type="org.eclipse.jdt.core.IJavaElement"/>
- </and>
- </or>
- </iterate>
- </with>
- </visibleWhen>
- </menu>
-
- <!-- commands for objects that don't need "JPA Tools" submenu -->
- <command
- commandId="org.eclipse.jpt.jpa.ui.xmlFileUpgradeToLatestVersion">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <adapt type="org.eclipse.jpt.jpa.core.context.XmlFile">
- <test property="org.eclipse.jpt.jpa.core.isNotLatestSupportedVersion"/>
- </adapt>
- </iterate>
- </with>
- </visibleWhen>
- </command>
-
- </menuContribution>
-
- <!-- contributions to the "JPA Tools" submenu -->
-
- <menuContribution
- locationURI="popup:org.eclipse.jpt.jpa.ui.menu.JpaTools">
-
- <command
- commandId="org.eclipse.jpt.jpa.ui.xmlFileUpgradeToLatestVersion">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <adapt type="org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource">
- <test property="org.eclipse.jpt.jpa.core.isNotLatestSupportedVersion"/>
- </adapt>
- </iterate>
- </with>
- </visibleWhen>
- </command>
-
- <!-- "Move to XML" submenu -->
- <menu
- id="org.eclipse.jpt.jpa.ui.menu.moveToXml"
- label="%moveToXml">
- <visibleWhen
- checkEnabled="false">
- <with
- variable="activeMenuSelection">
- <iterate
- ifEmpty="false">
- <adapt
- type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"/>
- </adapt>
- </iterate>
- <count
- value="1"/>
- </with>
- </visibleWhen>
- </menu>
-
- <separator
- name="generate"/>
-
- </menuContribution>
-
- <!-- contributions to "Move to XML" submenu -->
-
- <menuContribution
- locationURI="popup:org.eclipse.jpt.jpa.ui.menu.moveToXml">
-
- <command
- commandId="org.eclipse.jpt.jpa.ui.convertJavaQueries"
- label="%convertJavaQueries"
- style="push">
- </command>
-
- <command
- commandId="org.eclipse.jpt.jpa.ui.convertJavaGenerators"
- label="%convertJavaGenerators"
- style="push">
- </command>
-
- </menuContribution>
-
- <!-- contributions to the project configure menu -->
- <menuContribution locationURI="popup:org.eclipse.ui.projectConfigure?after=additions">
- <command commandId="org.eclipse.jpt.jpa.ui.convertJavaProjectToJpa" style="push">
- <visibleWhen checkEnabled="false">
- <and>
- <count value="1"/>
- <iterate ifEmpty="false" operator="and">
- <adapt type="org.eclipse.core.resources.IProject">
- <and>
- <test
- property="org.eclipse.core.resources.projectNature"
- value="org.eclipse.jdt.core.javanature"/>
- <not>
- <test
- property="org.eclipse.core.resources.projectNature"
- value="org.eclipse.wst.common.project.facet.core.nature"/>
- </not>
- </and>
- </adapt>
- </iterate>
- </and>
- </visibleWhen>
- </command>
- </menuContribution>
-
- <!-- contributions to objects in the JPA structure view -->
- <menuContribution
- locationURI="popup:org.eclipse.jpt.ui.jpaStructureView">
-
- <command
- commandId="org.eclipse.jpt.jpa.ui.entityMappingsAddPersistentClass">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.EntityMappings"/>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.ui.edit.delete"
- label="%removePersistentClass">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType"/>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.jpt.jpa.ui.persistentAttributeAddToXml">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute"/>
- <test property="org.eclipse.jpt.jpa.core.isVirtual"/>
- </and>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.jpt.jpa.ui.persistentAttributeAddToXmlAndMap">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute"/>
- <test property="org.eclipse.jpt.jpa.core.isVirtual"/>
- </and>
- </iterate>
- </with>
- </visibleWhen>
- </command>
- <command
- commandId="org.eclipse.ui.edit.delete"
- label="%removePersistentAttributeFromXml">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute"/>
- <test property="org.eclipse.jpt.jpa.core.isNotVirtual"/>
- </and>
- </iterate>
- </with>
- </visibleWhen>
- </command>
-
- <menu
- id="org.eclipse.jpt.jpa.ui.persistentTypeMapAs"
- label="%mapAs"
- mnemonic="%mapAsMnemonic"
- icon="$nl$/icons/full/eview16/jpa_perspective.gif">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <instanceof value="org.eclipse.jpt.jpa.core.context.PersistentType"/>
- </iterate>
- </with>
- </visibleWhen>
- <dynamic
- id="org.eclipse.jpt.jpa.ui.persistentTypeMapAs"
- class="org.eclipse.jpt.jpa.ui.internal.menus.PersistentTypeMapAsContribution">
- </dynamic>
- </menu>
-
- <menu
- id="org.eclipse.jpt.jpa.ui.persistentAttributeMapAs"
- label="%mapAs"
- mnemonic="%mapAsMnemonic"
- icon="$nl$/icons/full/eview16/jpa_perspective.gif">
- <visibleWhen>
- <with
- variable="selection">
- <iterate ifEmpty="false">
- <and>
- <instanceof value="org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute"/>
- <test property="org.eclipse.jpt.jpa.core.isNotVirtual"/>
- </and>
- </iterate>
- </with>
- </visibleWhen>
- <dynamic
- id="org.eclipse.jpt.jpa.ui.persistentAttributeMapAs"
- class="org.eclipse.jpt.jpa.ui.internal.menus.PersistentAttributeMapAsContribution">
- </dynamic>
- </menu>
-
- </menuContribution>
-
- </extension>
-
-
- <!-- ***** Project Explorer contribution ***** -->
-
- <extension
- point="org.eclipse.ui.navigator.viewer">
-
- <viewerContentBinding
- viewerId="org.eclipse.ui.navigator.ProjectExplorer">
- <includes>
- <contentExtension pattern="org.eclipse.jpt.jpa.ui.*"/>
- </includes>
- </viewerContentBinding>
-
- </extension>
-
-
- <!-- ***** navigator content ***** -->
-
- <extension
- point="org.eclipse.ui.navigator.navigatorContent">
-
- <navigatorContent
- id="org.eclipse.jpt.jpa.ui.jpaNavigatorContent"
- name="%jpaNavigatorContent"
- priority="higher"
- appearsBefore="org.eclipse.jst.servlet.ui.EnhancedJavaRendering"
- icon="icons/full/obj16/jpa-content.gif"
- activeByDefault="true"
- contentProvider="org.eclipse.jpt.jpa.ui.internal.navigator.JpaNavigatorContentProvider"
- labelProvider="org.eclipse.jpt.common.ui.internal.jface.NavigatorLabelProvider">
-
- <triggerPoints>
- <or>
- <instanceof value="org.eclipse.jpt.jpa.core.context.JpaContextNode"/>
- <instanceof value="org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel"/>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"
- forcePluginActivation="true"/>
- </adapt>
- </or>
- </triggerPoints>
-
- <possibleChildren>
- <instanceof value="org.eclipse.jpt.jpa.core.context.JpaContextNode"/>
- </possibleChildren>
-
- <actionProvider
- class="org.eclipse.jpt.jpa.ui.internal.navigator.JpaNavigatorActionProvider"
- id="org.eclipse.jpt.jpa.ui.jpaActionProvider">
- <enablement>
- <instanceof value="org.eclipse.jpt.jpa.core.context.JpaContextNode"/>
- </enablement>
- </actionProvider>
-
- <commonWizard
- menuGroupId="org.eclipse.jpt.jpa.ui"
- type="new"
- wizardId="org.eclipse.jpt.jpa.ui.wizard.newEntity">
- <enablement>
- <and>
- <or>
- <instanceof value="org.eclipse.core.resources.IProject"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragmentRoot"/>
- </or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"
- forcePluginActivation="true"/>
- </adapt>
- </and>
- </enablement>
- </commonWizard>
-
- <commonWizard
- menuGroupId="org.eclipse.jpt.jpa.ui"
- type="new"
- wizardId="org.eclipse.jpt.jpa.ui.wizard.newMappingFile">
- <enablement>
- <and>
- <or>
- <instanceof value="org.eclipse.core.resources.IProject"/>
- <instanceof value="org.eclipse.core.resources.IFolder"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragmentRoot"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
- </or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"
- forcePluginActivation="true"/>
- </adapt>
- </and>
- </enablement>
- </commonWizard>
-
- <commonWizard
- menuGroupId="org.eclipse.jpt.jpa.ui"
- type="new"
- wizardId="org.eclipse.jpt.jpa.ui.wizard.newEntitiesFromTables">
- <enablement>
- <and>
- <or>
- <instanceof value="org.eclipse.core.resources.IProject"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragment"/>
- <instanceof value="org.eclipse.jdt.core.IPackageFragmentRoot"/>
- </or>
- <adapt type="org.eclipse.core.resources.IResource">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"
- forcePluginActivation="true"/>
- </adapt>
- </and>
- </enablement>
- </commonWizard>
-
- </navigatorContent>
-
- </extension>
-
-
- <!-- ***** "New Dialog" wizards ***** -->
-
- <extension
- point="org.eclipse.ui.newWizards">
-
- <category
- id="org.eclipse.jpt.jpa"
- name="%jpaWizardCategoryName"/>
-
- <wizard
- id="org.eclipse.jpt.jpa.ui.wizard.newJpaProject"
- name="%newJpaProjectWizardName"
- icon="icons/full/etool16/new_jpaproject_wiz.gif"
- category="org.eclipse.jpt.jpa"
- project="true"
- finalPerspective="org.eclipse.jpt.ui.jpaPerspective">
- <description>%newJpaProjectWizardDesc</description>
- <class class="org.eclipse.jpt.jpa.ui.internal.wizards.proj.JpaProjectWizard">
- <parameter name="menuIndex" value="35"/>
- </class>
- </wizard>
-
- <wizard
- id="org.eclipse.jpt.jpa.ui.wizard.newEntity"
- name="%newJpaEntityWizardName"
- icon="icons/full/etool16/new_entity_wiz.gif"
- category="org.eclipse.jpt.jpa">
- <description>%newJpaEntityWizardDesc</description>
- <class class="org.eclipse.jpt.jpa.ui.internal.wizards.entity.EntityWizard">
- <parameter name="javaeeartifact" value="true"/>
- <parameter name="menuIndex" value="38" />
- <parameter name="jptartifact" value="true"/>
- </class>
- </wizard>
-
- <wizard
- category="org.eclipse.jpt.jpa"
- class="org.eclipse.jpt.jpa.ui.internal.wizards.gen.GenerateEntitiesFromSchemaWizard"
- icon="platform:/plugin/org.eclipse.jpt.jpa.ui/icons/full/etool16/new_entity_wiz.gif"
- id="org.eclipse.jpt.jpa.ui.wizard.newEntitiesFromTables"
- name="%newJpaEntityFromTableWizardName">
- <description>%newJpaEntityFromTableWizardDesc</description>
- <selection class="org.eclipse.core.resources.IResource"/>
- </wizard>
-
- <wizard
- id="org.eclipse.jpt.jpa.ui.wizard.newMappingFile"
- name="%newJpaMappingFileWizardName"
- icon="icons/full/etool16/new_jpa_file_wiz.gif"
- category="org.eclipse.jpt.jpa">
- <description>%newJpaMappingFileWizardDesc</description>
- <class class="org.eclipse.jpt.jpa.ui.internal.wizards.orm.MappingFileWizard">
- <parameter name="javaeeartifact" value="true"/>
- <parameter name="menuIndex" value="39" />
- <parameter name="jptartifact" value="true"/>
- </class>
- </wizard>
-
- </extension>
-
-
- <!-- ***** JPA Perspective ***** -->
-
- <extension
- point="org.eclipse.ui.perspectives">
-
- <perspective
- class="org.eclipse.jpt.jpa.ui.internal.perspective.JpaPerspectiveFactory"
- icon="icons/full/eview16/jpa_perspective.gif"
- id="org.eclipse.jpt.ui.jpaPerspective"
- name="%jpaPerspective">
- <description>%jpaPerspectiveDescription</description>
- </perspective>
-
- </extension>
-
-
- <extension
- point="org.eclipse.ui.perspectiveExtensions">
-
- <perspectiveExtension
- targetID="org.eclipse.jpt.ui.jpaPerspective">
-
- <newWizardShortcut id="org.eclipse.jpt.jpa.ui.wizard.newJpaProject"/>
- <newWizardShortcut id="org.eclipse.jpt.jpa.ui.wizard.newEntity"/>
- <newWizardShortcut id="org.eclipse.jpt.jpa.ui.wizard.newMappingFile"/>
- <newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewPackageCreationWizard"/>
- <newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewClassCreationWizard"/>
- <newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewInterfaceCreationWizard"/>
- <newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewEnumCreationWizard"/>
- <newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewAnnotationCreationWizard"/>
- <newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewSourceFolderCreationWizard"/>
- <newWizardShortcut id="org.eclipse.jdt.ui.wizards.NewJavaWorkingSetWizard"/>
- <newWizardShortcut id="org.eclipse.ui.wizards.new.file"/>
- <newWizardShortcut id="org.eclipse.ui.wizards.new.folder"/>
- <newWizardShortcut id="org.eclipse.ui.editors.wizards.UntitledTextFileWizard"/>
-
- <perspectiveShortcut id="org.eclipse.jdt.ui.JavaPerspective"/>
- <perspectiveShortcut id="org.eclipse.debug.ui.DebugPerspective"/>
- <perspectiveShortcut id="org.eclipse.jst.j2ee.J2EEPerspective"/>
- <perspectiveShortcut id="org.eclipse.jdt.ui.JavaBrowsingPerspective"/>
-
- <actionSet id="org.eclipse.debug.ui.launchActionSet"/>
- <actionSet id="org.eclipse.jdt.ui.JavaActionSet"/>
- <actionSet id="org.eclipse.jdt.ui.JavaElementCreationActionSet"/>
- <actionSet id="org.eclipse.ui.NavigateActionSet"/>
- <actionSet id="org.eclipse.jpt.jpa.ui.JptCreationActionSet"/>
-
- <viewShortcut id="org.eclipse.jdt.ui.PackageExplorer"/>
- <viewShortcut id="org.eclipse.jdt.ui.TypeHierarchy"/>
- <viewShortcut id="org.eclipse.jdt.ui.SourceView"/>
- <viewShortcut id="org.eclipse.jdt.ui.JavadocView"/>
- <viewShortcut id="org.eclipse.ui.navigator.ProjectExplorer"/>
- <viewShortcut id="org.eclipse.ui.views.ContentOutline"/>
- <viewShortcut id="org.eclipse.ui.views.ProblemView"/>
- <viewShortcut id="org.eclipse.ui.views.ResourceNavigator"/>
- <viewShortcut id="org.eclipse.jpt.ui.jpaStructureView"/>
- <viewShortcut id="org.eclipse.jpt.ui.jpaDetailsView"/>
- <viewShortcut id="org.eclipse.datatools.connectivity.DataSourceExplorerNavigator"/>
-
- </perspectiveExtension>
-
- <perspectiveExtension
- targetID="org.eclipse.jst.j2ee.J2EEPerspective">
- <newWizardShortcut id="org.eclipse.jpt.jpa.ui.wizard.newJpaProject"/>
- <perspectiveShortcut id="org.eclipse.jpt.ui.jpaPerspective"/>
- </perspectiveExtension>
-
- </extension>
-
-
- <!-- ***** pop-up menus ***** -->
-
- <extension
- point="org.eclipse.ui.popupMenus">
-
- <objectContribution
- id="org.eclipse.jpt.jpa.ui.project.JPATools"
- objectClass="org.eclipse.core.resources.IProject"
- adaptable="true">
-
- <!-- ignore the warning - see bug 247250 -->
- <enablement>
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"/>
- </enablement>
-
- <action
- id="org.eclipse.jpt.jpa.ui.generateEntities"
- label="%generateEntities"
- class="org.eclipse.jpt.jpa.ui.internal.actions.GenerateEntitiesAction"
- enablesFor="1"
- menubarPath="org.eclipse.jpt.jpa.ui.menu.JpaTools/generate"/>
-
- <action
- id="org.eclipse.jpt.jpa.ui.generateDDL"
- label="%generateDDL"
- class="org.eclipse.jpt.jpa.ui.internal.actions.GenerateDDLAction"
- enablesFor="1"
- menubarPath="org.eclipse.jpt.jpa.ui.menu.JpaTools/generate"/>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jpt.jpa.ui.MakePersistent"
- objectClass="org.eclipse.jdt.core.IJavaElement"
- adaptable="true">
-
- <action
- class="org.eclipse.jpt.jpa.ui.internal.actions.MakePersistentAction"
- enablesFor="*"
- id="org.eclipse.jpt.jpa.ui.generateEntities"
- label="%makePersistent"
- menubarPath="org.eclipse.jpt.jpa.ui.menu.JpaTools/content">
- <enablement>
- <or>
- <objectClass name="org.eclipse.jdt.core.ICompilationUnit"/>
- <objectClass name="org.eclipse.jdt.core.IType"/>
- <objectClass name="org.eclipse.jdt.core.IPackageFragment"/>
- <objectClass name="org.eclipse.jdt.core.IPackageFragmentRoot"/>
- </or>
- </enablement>
- </action>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jpt.jpa.ui.persistenceXmlFileActions"
- objectClass="org.eclipse.core.resources.IFile"
- nameFilter="persistence.xml">
-
- <action
- id="synchClassesAction"
- label="%synchronizeClasses"
- menubarPath="org.eclipse.jpt.jpa.ui.menu.JpaTools/content"
- class="org.eclipse.jpt.jpa.ui.internal.actions.SynchronizeClassesAction"
- enablesFor="1"/>
-
- </objectContribution>
-
- <objectContribution
- id="org.eclipse.jpt.jpa.ui.persistenceXmlActions"
- objectClass="org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml">
- <action
- id="synchClassesAction"
- label="%synchronizeClasses"
- menubarPath="content"
- class="org.eclipse.jpt.jpa.ui.internal.actions.SynchronizeClassesAction"
- enablesFor="1"/>
- </objectContribution>
-
- </extension>
-
-
- <!-- ***** preferences ***** -->
-
- <extension
- point="org.eclipse.ui.preferencePages">
-
- <page
- id="org.eclipse.jpt.jpa.ui.preferences"
- name="%javaPersistenceNode"
- class="org.eclipse.jpt.jpa.ui.internal.prefs.JptPreferencesPage"/>
-
- <page
- id="org.eclipse.jpt.jpa.ui.jpaPreferences"
- category="org.eclipse.jpt.jpa.ui.preferences"
- class="org.eclipse.jpt.jpa.ui.internal.prefs.JpaPreferencesPage"
- name="%jpaNode"/>
-
- <page
- id="org.eclipse.jpt.jpa.ui.jpaProblemSeveritiesPreferences"
- category="org.eclipse.jpt.jpa.ui.jpaPreferences"
- class="org.eclipse.jpt.jpa.ui.internal.prefs.JpaProblemSeveritiesPage"
- name="%jpaProblemSeveritiesNode">
- </page>
-
- </extension>
-
-
- <!-- ***** JPA project properties pages ***** -->
-
- <extension
- point="org.eclipse.ui.propertyPages">
-
- <page
- id="org.eclipse.jpt.jpa.ui.jpaProjectProperties"
- name="%jpaNode"
- class="org.eclipse.jpt.jpa.ui.internal.properties.JpaProjectPropertiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"
- forcePluginActivation="true"/>
- </adapt>
- </enabledWhen>
- </page>
-
- <page
- id="org.eclipse.jpt.jpa.ui.jpaEntityGenProjectProperties"
- name="%jpaEntityGenNode"
- category="org.eclipse.jpt.jpa.ui.jpaProjectProperties"
- class="org.eclipse.jpt.jpa.ui.internal.prefs.JpaEntityGenPreferencePage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- forcePluginActivation="true"
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"/>
- </adapt>
- </enabledWhen>
- </page>
-
- <page
- id="org.eclipse.jpt.jpa.ui.jpaProblemSeveritiesProperties"
- name="%jpaProblemSeveritiesNode"
- category="org.eclipse.jpt.jpa.ui.jpaProjectProperties"
- class="org.eclipse.jpt.jpa.ui.internal.prefs.JpaProblemSeveritiesPage">
- <enabledWhen>
- <adapt type="org.eclipse.core.resources.IProject">
- <test
- property="org.eclipse.wst.common.project.facet.core.projectFacet"
- value="jpt.jpa"
- forcePluginActivation="true"/>
- </adapt>
- </enabledWhen>
- </page>
-
- </extension>
-
-
- <!-- ***** views ***** -->
-
- <extension
- point="org.eclipse.ui.views">
-
- <category
- id="org.eclipse.jpt.jpa.ui"
- name="%jpaPerspective"/>
-
- <view
- id="org.eclipse.jpt.ui.jpaStructureView"
- category="org.eclipse.jpt.jpa.ui"
- class="org.eclipse.jpt.jpa.ui.internal.views.JpaStructureView"
- icon="icons/full/eview16/jpa_structure.gif"
- name="%jpaStructure"/>
-
- <view
- id="org.eclipse.jpt.ui.jpaDetailsView"
- category="org.eclipse.jpt.jpa.ui"
- class="org.eclipse.jpt.jpa.ui.internal.views.JpaDetailsView"
- icon="icons/full/eview16/jpa_details.gif"
- name="%jpaDetails"/>
-
- </extension>
-
-
- <!-- ***** WTP facet framework ***** -->
-
- <extension
- point="org.eclipse.wst.common.project.facet.ui.images">
-
- <image facet="jpt.jpa" path="icons/full/etool16/jpa_facet.gif"/>
-
- </extension>
-
-
- <extension
- point="org.eclipse.wst.common.project.facet.ui.wizardPages">
-
- <wizard-pages action="jpt.jpa.install">
- <page class="org.eclipse.jpt.jpa.ui.internal.wizards.JpaFacetInstallPage"/>
- </wizard-pages>
-
- <wizard-pages action="jpt.jpa.version-change">
- <page class="org.eclipse.jpt.jpa.ui.internal.wizards.JpaFacetVersionChangePage"/>
- </wizard-pages>
-
- </extension>
-
-</plugin>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui.properties
deleted file mode 100644
index 8959cb9991..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui.properties
+++ /dev/null
@@ -1,204 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# JptUiMessages
-
-AccessTypeComposite_access=Access:
-
-AddToEarComposite_earMemberShip=EAR membership
-AddToEarComposite_addToEarLabel=&Add project to an EAR
-AddToEarComposite_earProjectLabel=EAR pr&oject name:
-AddToEarComposite_newButtonLabel=New &Project ...
-
-AddPersistentAttributeDialog_title=Add Attribute
-AddPersistentAttributeDialog_attributeLabel=Attribute:
-AddPersistentAttributeDialog_mappingLabel=Map as:
-AddPersistentAttributeDialog_noMappingKeyError=You must specify a mapping type
-
-AddPersistentClassDialog_title=Add Class
-AddPersistentClassDialog_classLabel=Class:
-AddPersistentClassDialog_classDialog_title=Persistent Class Selection
-AddPersistentClassDialog_classDialog_message=Choose a class:
-AddPersistentClassDialog_mappingLabel=Map as:
-AddPersistentClassDialog_noClassError=You must specify a class
-AddPersistentClassDialog_duplicateClassWarning=File already contains that persistent class
-AddPersistentClassDialog_classNotFoundWarning=Cannot resolve class
-AddPersistentClassDialog_noMappingKeyError=You must specify a mapping type
-
-convertToJpa_convertingProject="Converting project to faceted form..."
-convertToJpa_detectingTechnologies="Detecting existing technologies..."
-
-DatabaseSchemaWizardPage_title=Database Schema
-DatabaseSchemaWizardPage_desc=Select a database schema
-DatabaseSchemaWizardPage_schemaSettings=Schema settings
-DatabaseSchemaWizardPage_addConnectionToProject=<a>Add a connection to JPA project...</a>
-DatabaseSchemaWizardPage_connectLink=<a>Connect</a>
-DatabaseSchemaWizardPage_schema=Schema:
-DatabaseSchemaWizardPage_connectionInfo=(Note: JPA project must have a connection and it must be active to select a schema)
-DatabaseSchemaWizardPage_schemaInfo=(Note: Must have active connection to select schema)
-
-OpenJpaResourceAction_open=Open
-OpenJpaResourceAction_error=Error Opening Editor
-
-General_browse=Br&owse...
-General_revert=Revert
-General_deselectAll=Deselect All
-General_selectAll=Select All
-General_refresh=Refresh Tables
-
-GenerateDDLWizard_title=Generate Tables from Entities
-
-GenerateEntitiesWizard_generateEntities=Generate Entities
-GenerateEntitiesWizardPage_chooseEntityTable=Choose tables to generate entities from.
-GenerateEntitiesWizardPage_generateEntities=Generate Entities from Tables
-GenerateEntitiesWizardPage_synchronizeClasses=Synchronize classes in persistence.xml
-GenerateEntitiesWizardPage_tables=Tables:
-GenerateEntitiesWizardPage_tableColumn=Table
-GenerateEntitiesWizardPage_entityNameColumn=Entity Name
-
-EntitiesGenerator_jobName=Generating Entities
-
-GenericPlatformUiDialog_notSupportedMessageTitle=Generate Tables from Entities
-GenericPlatformUiDialog_notSupportedMessageText=Generate Tables from Entities is not supported by the Generic Platform
-
-JpaContent_label=JPA Content
-
-JpaStructureView_structureNotAvailable=A JPA structure is not available.
-JpaStructureView_structureProviderNotAvailable=A JPA structure provider is not available: {0}:{1}
-JpaStructureView_linkWithEditorText=Link with Editor
-JpaStructureView_linkWithEditorDesc=Link with Active Editor
-JpaStructureView_linkWithEditorTooltip=Link with Editor
-JpaStructureView_numItemsSelected={0} items selected
-
-JpaDetailsView_viewNotAvailable=JPA details are not available for the current selection.
-
-JpaFacetWizardPage_title=JPA Facet
-JpaFacetWizardPage_description=Configure JPA settings.
-JpaFacetWizardPage_platformLabel=&Platform
-JpaFacetWizardPage_connectionLabel=&Connection
-JpaFacetWizardPage_connectionLink=<a>Add connection...</a>
-JpaFacetWizardPage_connectLink=<a>Connect</a>
-JpaFacetWizardPage_connectedText=<a>Connected</a>
-JpaFacetWizardPage_addDriverLibraryLabel=&Add driver library to build path
-JpaFacetWizardPage_driverLibraryLabel=&Driver:
-JpaFacetWizardPage_overrideDefaultCatalogLabel=&Override default catalog from connection
-JpaFacetWizardPage_defaultCatalogLabel=Catalo&g:
-JpaFacetWizardPage_overrideDefaultSchemaLabel=O&verride default schema from connection
-JpaFacetWizardPage_defaultSchemaLabel=&Schema:
-JpaFacetWizardPage_facetsPageLink=<a>Change JPA version...</a>
-JpaFacetWizardPage_jpaImplementationLabel=JPA implementation
-JpaFacetWizardPage_userServerLibLabel=Implementation provided by server runtime
-JpaFacetWizardPage_specifyLibLabel=Implementation library:
-JpaFacetWizardPage_jpaPrefsLink=<a>Configure default JPA implementation library...</a>
-JpaFacetWizardPage_userLibsLink=<a>Configure user libraries...</a>
-JpaFacetWizardPage_persistentClassManagementLabel=Persistent class management
-JpaFacetWizardPage_discoverClassesButton=Discover annotated classes a&utomatically
-JpaFacetWizardPage_listClassesButton=Annotated classes must be &listed in persistence.xml
-JpaFacetWizardPage_createOrmXmlButton=Create &mapping file (orm.xml)
-JpaFacetWizardPage_metamodelLabel=Canonical metamodel (JPA 2.0)
-JpaFacetWizardPage_metamodelSourceFolderLink=<a>Source fol&der:</a>
-JpaFacetWizardPage_none=<None>
-
-JpaLibraryProviderInstallPanel_includeLibraries=&Include libraries with this application
-
-JpaMakePersistentWizardPage_title=Make Persistent
-JpaMakePersistentWizardPage_message=Make the selected Java classes persistent by selecting Java annotations or mapping file
-JpaMakePersistentWizardPage_annotateInJavaRadioButton=Annotate in &Java
-JpaMakePersistentWizardPage_mappingFileRadioButton=Add to &XML mapping file
-JpaMakePersistentWizardPage_mappingFileLink=<a>&Mapping file:</a>
-JpaMakePersistentWizardPage_mappingFileBrowseButton=B&rowse...
-JpaMakePersistentWizardPage_typeTableColumn=Type
-JpaMakePersistentWizardPage_mappingTableColumn=Mapping
-JpaMakePersistentWizardPage_listInPersistenceXmlCheckBox=&List in persistence.xml
-JpaMakePersistentWizardPage_selectedTypesPersistentError=All selected types are already persistent
-JpaMakePersistentWizardPage_mappingFileDoesNotExistError=The XML mapping file does not exist
-JpaMakePersistentWizardPage_mappingFileNotListedInPersistenceXmlError=The XML mapping file is not listed in the persistence.xml
-
-JptPreferencesPage_DoNotShowDialogs=Dialogs
-JptPreferencesPage_DoNotShowText=Clear all 'do not show again' settings and show all hidden dialogs again.
-JptPreferencesPage_ClearButtonText=&Clear
-
-JpaPreferencesPage_description=General settings for JPA development:
-
-JpaPreferencesPage_entityGen=Entity generation from tables
-JpaPreferencesPage_entityGen_defaultPackageLabel=Default package:
-
-JpaPreferencesPage_jpqlEditor=JPQL Editing
-JpaPreferencesPage_jpqlEditor_description=Specify the case for JPQL identifiers used with content assist.
-JpaPreferencesPage_jpqlEditor_lowerCaseRadioButton=&Lowercase
-JpaPreferencesPage_jpqlEditor_matchFirstCharacterCaseRadioButton=&Match Case of First Character
-JpaPreferencesPage_jpqlEditor_upperCaseRadioButton=&Uppercase
-
-JpaProblemSeveritiesPage_Description=Select the severity level for the following optional Java Persistence validation problems:
-JpaProblemSeveritiesPage_Error=Error
-JpaProblemSeveritiesPage_Ignore=Ignore
-JpaProblemSeveritiesPage_Info=Info
-JpaProblemSeveritiesPage_Warning=Warning
-
-JpaEntityGenPreferencePage_Description=Configure entity generation preferences for the project
-JpaEntityGenPreferencePage_generalGroup_title=Entity generation from tables
-JpaEntityGenPreferencePage_defaultPackageLabel=Default package:
-
-JpqlContentProposalProvider_Description=Content Assist Available ({0})
-JpaJpqlJavaCompletionProposalComputer_Error=Can't retrieve JPQL proposals due to an internal error.
-JpaJpqlSseCompletionProposalComputer_Error=Can't retrieve JPQL proposals due to an internal error.
-
-MappingFileWizard_title=New Mapping File
-MappingFileWizardPage_newFile_title=Mapping file
-MappingFileWizardPage_newFile_desc=Specify mapping file name and location
-MappingFileWizardPage_options_title=Mapping file
-MappingFileWizardPage_options_desc=Specify mapping file options
-MappingFileWizardPage_projectLabel=&Project:
-MappingFileWizardPage_sourceFolderLabel=Source fol&der:
-MappingFileWizardPage_filePathLabel=File pat&h:
-MappingFileWizardPage_accessLabel=Default a&ccess:
-MappingFileWizardPage_addToPersistenceUnitButton=&Add to persistence unit
-MappingFileWizardPage_persistenceUnitLabel=Persistence &unit:
-MappingFileWizardPage_incorrectSourceFolderError=Selection must be a valid source folder
-MappingFileWizardPage_accessLabel_sourceFolderDialogTitle=Source Folder Selection
-MappingFileWizardPage_accessLabel_sourceFolderDialogDesc=Choose a source folder:
-
-JpaProjectWizard_title=New JPA Project
-NewJpaProjectWizard_firstPage_title=JPA Project
-NewJpaProjectWizard_firstPage_description=Configure JPA project settings.
-
-OrmItemLabelProviderFactory_entityMappingsLabel=Entity Mappings
-
-PersistenceItemLabelProviderFactory_persistenceLabel=Persistence
-
-OverwriteConfirmerDialog_title=Overwrite Existing File
-OverwriteConfirmerDialog_text=Overwrite the existing file ''{0}''?
-
-SelectMappingFileDialog_title=Mapping File
-SelectMappingFileDialog_message=Choose a mapping file
-SelectMappingFileDialog_newButton=New...
-SelectMappingFileDialog_newButtonToolTip=Create a new mapping file
-
-JavaMetadataConversion_warning=Warning: Malformed metadata will result in a non-functional mapping file.{0}Duplicated or overridden annotations will not be moved to the mapping file.
-JavaMetadataConversion_mappingFileDoesNotExist=The specified mapping file does not exist
-JavaMetadataConversion_mappingFileVersionIsInvalid=The mapping file''s version ''{0}'' does not match the JPA project''s version ''{1}''
-JavaMetadataConversion_mappingFileNotListedInPersistenceXml=The mapping file is not listed in the persistence.xml file
-JavaMetadataConversion_noGeneratorsToConvert=There are no Java generators to convert
-JavaMetadataConversion_noQueriesToConvert=There are no Java queries to convert
-JavaMetadataConversionWizard_title=JPA Global Metadata Conversion
-JavaMetadataConversionWizardPage_mappingFileBrowseButton=Browse...
-JavaMetadataConversionWizardPage_mappingFileBrowseButtonToolTip=Select a mapping file
-JavaMetadataConversionWizardPage_label=Create a new mapping file or select one:
-JavaMetadataConversionWizardPage_newMappingFileLink=<a>Mapping file:</a>
-JavaMetadataConversionWizardPage_newMappingFileLinkToolTip=Create a new mapping file
-JavaGeneratorConversionWizardPage_title=Java Generator Metadata Conversion
-JavaGeneratorConversionWizardPage_description=Move all the annotated JPA generators to XML as mapping file level metadata
-JavaQueryConversionWizardPage_title=Java Query Metadata Conversion
-JavaQueryConversionWizardPage_description=Move all the annotated JPA queries to XML as mapping file level metadata
-
-SelectJpaProjectWizardPage_title=JPA Project Selection
-SelectJpaProjectWizardPage_msg=Select a JPA project.
-
-SynchronizingClasses_TaskName=Synchronizing classes...
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details.properties
deleted file mode 100644
index dc0e17e50f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details.properties
+++ /dev/null
@@ -1,325 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-ProviderDefault=Default (<Provider-Specific>)
-NoNameSet=<No name set>
-
-MapAsComposite_changeMappingType=here
-MapAsComposite_default=Default
-MapAsComposite_dialogTitle=Mapping Type Selection
-MapAsComposite_labelText=&Enter mapping type or pattern (*, ?, or camel case):
-MapAsComposite_mappedAttributeText=Attribute ''{0}'' is mapped as {1}.
-MapAsComposite_mappedTypeText=Type ''{0}'' is mapped as {1}.
-MapAsComposite_unmappedAttributeText=Attribute ''{0}'' is not mapped, click here to change the mapping type.
-MapAsComposite_unmappedTypeText=Type ''{0}'' is not mapped, click here to change the mapping type.
-MapAsComposite_virtualAttributeText=Attribute ''{0}'' is not mapped.
-
-BasicSection_title=Basic
-EmbeddedSection_title=Embedded
-EmbeddedIdSection_title=Embedded ID
-EmbeddableSection_title=Embeddable
-EntitySection_title=Entity
-IdSection_title=ID
-ManyToManySection_title=Many to Many
-ManyToOneSection_title=Many to One
-MappedSuperclassSection_title=Mapped Superclass
-OneToManySection_title=One to Many
-OneToOneSection_title=One to One
-VersionSection_title=Version
-
-BasicMappingUiProvider_label=Basic
-EmbeddedMappingUiProvider_label=Embedded
-EmbeddedIdMappingUiProvider_label=Embedded ID
-IdMappingUiProvider_label=ID
-OneToManyMappingUiProvider_label=One to Many
-OneToOneMappingUiProvider_label=One to One
-ManyToManyMappingUiProvider_label=Many to Many
-ManyToOneMappingUiProvider_label=Many to One
-TransientMappingUiProvider_label=Transient
-VersionMappingUiProvider_label=Version
-BasicMappingUiProvider_linkLabel=basic
-EmbeddedMappingUiProvider_linkLabel=embedded
-EmbeddedIdMappingUiProvider_linkLabel=embedded ID
-IdMappingUiProvider_linkLabel=ID
-OneToManyMappingUiProvider_linkLabel=one to many
-OneToOneMappingUiProvider_linkLabel=one to one
-ManyToManyMappingUiProvider_linkLabel=many to many
-ManyToOneMappingUiProvider_linkLabel=many to one
-TransientMappingUiProvider_linkLabel=transient
-VersionMappingUiProvider_linkLabel=version
-
-DefaultBasicMappingUiProvider_label=Default (Basic)
-DefaultEmbeddedMappingUiProvider_label=Default (Embedded)
-DefaultBasicMappingUiProvider_linkLabel=default (basic)
-DefaultEmbeddedMappingUiProvider_linkLabel=default (embedded)
-
-EmbeddableUiProvider_label=Embeddable
-EntityUiProvider_label=Entity
-MappedSuperclassUiProvider_label=Mapped Superclass
-NullTypeMappingUiProvider_label=Unmapped
-
-EmbeddableUiProvider_linkLabel=embeddable
-EntityUiProvider_linkLabel=entity
-MappedSuperclassUiProvider_linkLabel=mapped superclass
-
-
-AddQueryDialog_title=Add Query
-AddQueryDialog_descriptionTitle=Create new query
-AddQueryDialog_namedQuery=Named Query
-AddQueryDialog_namedNativeQuery= Named Native Query
-AddQueryDialog_description=Create a new query setting both the 'name' and the 'type'
-AddQueryDialog_nameExists=The given name exists. This query may be overridden by or override the one(s) with the same name.
-QueryStateObject_nameMustBeSpecified=A name must be specified.
-QueryStateObject_typeMustBeSpecified=A query type must be specified
-AddQueryDialog_name=Name:
-AddQueryDialog_queryType=Type:
-NamedQueryComposite_nameTextLabel=Name:
-
-EntityComposite_inheritance=Inheritance
-EntityComposite_queries=Queries
-EntityComposite_tableDefault=Default ({0})
-EntityComposite_tableNoDefaultSpecified=Default ()
-
-MappedSuperclassComposite_queries=Queries
-
-EntityGeneralSection_name=Name:
-
-EntityNameComposite_name=Name:
-
-BasicGeneralSection_name=Name:
-BasicGeneralSection_nameDefault=Default ({0})
-BasicGeneralSection_fetchLabel=Fetch:
-BasicGeneralSection_optionalLabel=Optional
-BasicGeneralSection_optionalLabelDefault=Optional ({0})
-BasicGeneralSection_lobLabel=Lob
-BasicGeneralSection_temporalLabel=Temporal:
-BasicGeneralSection_enumeratedLabel=Enumerated:
-TypeSection_type=Type
-TypeSection_default=Default
-TypeSection_lob=Lob
-TypeSection_temporal=Temporal:
-TypeSection_enumerated=Enumerated:
-
-TableChooser_label=Name:
-CatalogChooser_label=Catalog:
-SchemaChooser_label=Schema:
-TableComposite_tableSection=Table
-
-TargetEntityChooser_label=Target entity:
-TargetEntityChooser_browse=Browse...
-TargetEntityChooser_selectTypeTitle=Select Type
-
-IdClassComposite_label=ID class:
-
-Joining_title=Joining Strategy
-Joining_mappedByLabel=Mapped by
-Joining_mappedByAttributeLabel=Attribute:
-Joining_joinColumnJoiningLabel=Join columns
-Joining_primaryKeyJoinColumnJoiningLabel=Primary key join columns
-Joining_joinTableJoiningLabel=Join table
-
-JoinTableComposite_inverseJoinColumn=Inverse join columns
-JoinTableComposite_joinColumn=Join columns
-JoinTableComposite_name=Name:
-JoinTableComposite_schema=Schema:
-JoinTableComposite_catalog=Catalog:
-JoinTableComposite_overrideDefaultJoinColumns=Override default
-JoinTableComposite_overrideDefaultInverseJoinColumns=Override default
-
-MultiRelationshipMappingComposite_general=General
-MultiRelationshipMappingComposite_joinTable=Join Table
-MultiRelationshipMappingComposite_targetEntity=Target entity:
-MultiRelationshipMappingComposite_cascadeType=Cascade type:
-MultiRelationshipMappingComposite_fetchType=Fetch type:
-MultiRelationshipMappingComposite_mappedBy=Mapped by:
-
-ColumnComposite_columnDefinition=Column definition:
-ColumnComposite_columnSection=Column
-ColumnComposite_details=Details
-ColumnComposite_insertable=Insertable
-ColumnComposite_insertableWithDefault=Insertable ({0})
-ColumnComposite_length=Length:
-ColumnComposite_name=Name:
-ColumnComposite_nullable=Nullable
-ColumnComposite_nullableWithDefault=Nullable ({0})
-ColumnComposite_precision=Precision:
-ColumnComposite_scale=Scale:
-ColumnComposite_table=Table:
-ColumnComposite_unique=Unique
-ColumnComposite_uniqueWithDefault=Unique ({0})
-ColumnComposite_updatable=Updatable
-ColumnComposite_updatableWithDefault=Updatable ({0})
-
-JoinColumnsComposite_edit=Edit...
-JoinColumnsComposite_mappingBetweenTwoParams={0} -> {1}
-JoinColumnsComposite_mappingBetweenTwoParamsDefault=Default ({0} -> {1})
-JoinColumnsComposite_mappingBetweenTwoParamsBothDefault=Default ({0}) -> Default ({1})
-JoinColumnsComposite_mappingBetweenTwoParamsFirstDefault=Default ({0}) -> {1}
-JoinColumnsComposite_mappingBetweenTwoParamsSecDefault={0} -> Default ({1})
-JoiningStrategyJoinColumnsComposite_overrideDefaultJoinColumns=Override default
-
-PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns=Override default
-PrimaryKeyJoinColumnsComposite_edit=Edit...
-PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn=Primary key join columns
-PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams={0} -> {1}
-PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault=Default ({0} -> {1})
-PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault=Default ({0}) -> Default ({1})
-PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault=Default ({0}) -> {1}
-PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault={0} -> Default ({1})
-
-JoinColumnDialog_addJoinColumnDescriptionTitle=Create New Join Column
-JoinColumnDialog_addJoinColumnTitle=Add Join Column
-JoinColumnDialog_description=Specify a mapped column for joining an entity association.
-JoinColumnDialog_editJoinColumnDescriptionTitle=Edit Join Column
-JoinColumnDialog_editJoinColumnTitle=Edit Join Column
-JoinColumnDialog_name=&Name:
-JoinColumnDialog_referencedColumnName=&Referenced column name:
-
-JoinColumnDialogPane_columnDefinition=&Column definition:
-JoinColumnDialogPane_insertable=&Insertable
-JoinColumnDialogPane_insertableWithDefault=&Insertable ({0})
-JoinColumnDialogPane_nullable=&Nullable
-JoinColumnDialogPane_nullableWithDefault=&Nullable ({0})
-JoinColumnDialogPane_table=&Table:
-JoinColumnDialogPane_unique=&Unique
-JoinColumnDialogPane_uniqueWithDefault=&Unique ({0})
-JoinColumnDialogPane_updatable=&Updatable
-JoinColumnDialogPane_updatableWithDefault=&Updatable ({0})
-
-InverseJoinColumnDialog_editInverseJoinColumnTitle=Edit Inverse Join Column
-
-PrimaryKeyJoinColumnInSecondaryTableDialog_addDescriptionTitle=Create New Primary Key Join Column
-PrimaryKeyJoinColumnInSecondaryTableDialog_addTitle=Add Primary Key Join Column
-PrimaryKeyJoinColumnInSecondaryTableDialog_editDescriptionTitle=Edit Primary Key Join Column
-PrimaryKeyJoinColumnInSecondaryTableDialog_editTitle=Edit Primary Key Join Column
-
-PrimaryKeyJoinColumnDialog_addDescriptionTitle=Create New Primary Key Join Column
-PrimaryKeyJoinColumnDialog_addTitle=Add Primary Key Join Column
-PrimaryKeyJoinColumnDialog_editDescriptionTitle=Edit Primary Key Join Column
-PrimaryKeyJoinColumnDialog_editTitle=Edit Primary Key Join Column
-
-OverridesComposite_attributeOverridesSection=Attribute Overrides
-OverridesComposite_attributeOverridesGroup=Attribute overrides
-OverridesComposite_overrideDefault=Override default
-
-OverridesComposite_association=Association Override
-OverridesComposite_attribute=Attribute Override
-OverridesComposite_noName=<Name not set>
-AssociationOverridesComposite_joinColumn=Join columns
-
-InheritanceComposite_detailsGroupBox=Details
-InheritanceComposite_discriminatorColumnGroupBox=Discriminator column
-InheritanceComposite_discriminatorValue=Discriminator value:
-AbstractInheritanceComposite_joined=Joined
-AbstractInheritanceComposite_single_table=Single Table
-InheritanceComposite_strategy=Strategy:
-AbstractInheritanceComposite_table_per_class=Table per Class
-
-DiscriminatorColumnComposite_discriminatorType=Type:
-DiscriminatorColumnComposite_name=Name:
-DiscriminatorColumnComposite_char=Character
-DiscriminatorColumnComposite_integer=Integer
-DiscriminatorColumnComposite_string=String
-
-GeneratorsComposite_sequenceGeneratorCheckBox=Sequence generator
-GeneratorsComposite_sequenceGeneratorSection=Sequence Generator
-GeneratorsComposite_tableGeneratorCheckBox=Table generator
-GeneratorsComposite_tableGeneratorSection=Table Generator
-
-IdMappingComposite_pk_generation=PK Generation
-IdMappingComposite_primaryKeyGenerationCheckBox=Primary key generation
-IdMappingComposite_primaryKeyGenerationSection=Primary Key Generation
-IdMappingComposite_tableGeneratorCheckBox=Table generator
-IdMappingComposite_tableGeneratorSection=Table Generator
-IdMappingComposite_sequenceGeneratorCheckBox=Sequence generator
-IdMappingComposite_sequenceGeneratorSection=Sequence Generator
-
-GeneratedValueComposite_generatedValue=Generated Value
-GeneratedValueComposite_generatorName=Generator name:
-GeneratedValueComposite_strategy=Strategy:
-GeneratedValueComposite_auto=Auto
-GeneratedValueComposite_identity=Identity
-GeneratedValueComposite_sequence=Sequence
-GeneratedValueComposite_table=Table
-
-SequenceGeneratorComposite_catalog=Catalog:
-SequenceGeneratorComposite_default=Default
-SequenceGeneratorComposite_name=Name:
-SequenceGeneratorComposite_schema=Schema:
-SequenceGeneratorComposite_sequence=Sequence:
-SequenceGeneratorComposite_sequenceGenerator=Sequence Generator
-
-TableGeneratorComposite_catalog=Catalog:
-TableGeneratorComposite_default=Default
-TableGeneratorComposite_name=Name:
-TableGeneratorComposite_pkColumn=Primary key column:
-TableGeneratorComposite_pkColumnValue=Primary key column value:
-TableGeneratorComposite_schema=Schema:
-TableGeneratorComposite_table=Table:
-TableGeneratorComposite_tableGenerator=Table Generator
-TableGeneratorComposite_valueColumn=Value column:
-
-GeneratorComposite_allocationSize=Allocation size:
-GeneratorComposite_initialValue=Initial value:
-
-OrderingComposite_orderingGroup=Ordering
-OrderingComposite_none=None
-OrderingComposite_primaryKey=Primary key
-OrderingComposite_custom=Custom
-
-SecondaryTablesComposite_secondaryTables=Secondary Tables
-SecondaryTablesComposite_edit=Edit...
-
-SecondaryTableDialog_addSecondaryTable=Add Secondary Table
-SecondaryTableDialog_editSecondaryTable=Edit Secondary Table
-SecondaryTableDialog_name=Name:
-SecondaryTableDialog_catalog=Catalog:
-SecondaryTableDialog_schema=Schema:
-SecondaryTableDialog_defaultSchema=Default ({0})
-SecondaryTableDialog_defaultCatalog=Default ({0})
-
-AccessTypeCombo_default=Default
-MetaDataCompleteCombo_Default=Default ({0})
-
-OptionalComposite_false=False
-OptionalComposite_true=True
-
-EnumTypeComposite_ordinal=Ordinal
-EnumTypeComposite_string=String
-
-FetchTypeComposite_eager=Eager
-FetchTypeComposite_lazy=Lazy
-
-TemporalTypeComposite_date=Date
-TemporalTypeComposite_time=Time
-TemporalTypeComposite_timestamp=Timestamp
-
-CascadeComposite_all=All
-CascadeComposite_cascadeTitle=Cascade
-CascadeComposite_merge=Merge
-CascadeComposite_persist=Persist
-CascadeComposite_refresh=Refresh
-CascadeComposite_remove=Remove
-
-QueriesComposite_displayString=<Name not set> {0}
-
-NamedNativeQueryPropertyComposite_query=Query:
-NamedNativeQueryPropertyComposite_queryHintsGroupBox=Query hints
-NamedNativeQueryPropertyComposite_resultClass=Result class:
-
-NamedQueryPropertyComposite_query=Query:
-NamedQueryPropertyComposite_queryHintsGroupBox=Query hints
-
-QueryHintsComposite_nameColumn=Name
-QueryHintsComposite_valueColumn=Value
-
-OrmSecondaryTablesComposite_defineInXml=Define in XML
-
-NullAttributeMappingUiProvider_label=Unmapped
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details2_0.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details2_0.properties
deleted file mode 100644
index 3b348e8c73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details2_0.properties
+++ /dev/null
@@ -1,58 +0,0 @@
-################################################################################
-# Copyright (c) 2009, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-CascadePane2_0_detach=Detach
-
-CollectionTable2_0Composite_title=Collection Table
-CollectionTable2_0Composite_joinColumn=Join columns
-CollectionTable2_0Composite_name=Name:
-CollectionTable2_0Composite_schema=Schema:
-CollectionTable2_0Composite_catalog=Catalog:
-CollectionTable2_0Composite_overrideDefaultJoinColumns=Override default
-
-DerivedIdentity_title=Derived Identity
-DerivedIdentity_nullDerivedIdentity=None
-DerivedIdentity_idDerivedIdentity=Id
-DerivedIdentity_mapsIdDerivedIdentity=Maps id:
-DerivedIdentity_mapsIdUnspecifiedValue=<undetermined value>
-
-ElementCollectionMapping2_0_label=Element Collection
-ElementCollectionMapping2_0_linkLabel=element collection
-ElementCollectionSection_title=Element Collection
-AbstractElementCollectionMapping2_0_Composite_valueSectionTitle=Value
-Entity_cacheableLabel=Cacheable
-Entity_cacheableWithDefaultLabel=Cacheable ({0})
-
-EmbeddedIdMapping2_0MappedByRelationshipPane_label=Embedded ID is mapped by a relationship.
-IdMapping2_0MappedByRelationshipPane_label=ID is mapped by a relationship.
-
-OrderingComposite_orderColumn=Order column
-
-OrphanRemoval2_0Composite_orphanRemovalLabel=Orphan removal
-OrphanRemoval2_0Composite_orphanRemovalLabelDefault=Orphan removal ({0})
-
-LockModeComposite_lockModeLabel = Lock mode:
-
-LockModeComposite_read = Read
-LockModeComposite_write = Write
-LockModeComposite_optimistic = Optimistic
-LockModeComposite_optimistic_force_increment = Optimistic Force Increment
-LockModeComposite_pessimistic_read = Pessimistic Read
-LockModeComposite_pessimistic_write = Pessimistic Write
-LockModeComposite_pessimistic_force_increment = Pessimistic Force Increment
-LockModeComposite_none = None
-
-TargetClassComposite_label=Target class:
-
-ArrayMapping2_3_label=Array
-ArrayMapping2_3_linkLabel=array
-
-StructureMapping2_3_label=Structure
-StructureMapping2_3_linkLabel=structure \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details_orm.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details_orm.properties
deleted file mode 100644
index 4351e6b597..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_details_orm.properties
+++ /dev/null
@@ -1,49 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-EntityMappingsSection_title=Entity Mappings
-EntityMappingsDetailsPage_catalog=Catalog:
-EntityMappingsDetailsPage_package=Package:
-EntityMappingsDetailsPage_schema=Schema:
-EntityMappingsPage_catalogDefault=Default ({0}
-EntityMappingsPage_catalogNoDefaultSpecified=Default
-EntityMappingsPage_schemaDefault=Default ({0})
-EntityMappingsPage_schemaNoDefaultSpecified=Default
-MetadataCompleteComposite_metadataComplete=Metadata complete
-MetadataCompleteComposite_metadataCompleteWithDefault=Metadata complete ({0})
-OrmGeneratorsComposite_displayString=<Name not set> {0}
-OrmGeneratorsComposite_groupBox=Generators
-OrmMappingNameChooser_name=Name:
-OrmJavaClassChooser_javaClass=Java class:
-OrmQueriesComposite_groupBox=Queries
-PersistenceUnitMetadataComposite_delimitedIdentifiersCheckBox=Delimited identifiers
-PersistenceUnitMetadataComposite_cascadePersistCheckBox=Cascade persist
-PersistenceUnitMetadataComposite_catalog=Catalog:
-PersistenceUnitMetadataComposite_persistenceUnitSection=Persistence Unit
-PersistenceUnitMetadataComposite_schema=Schema:
-PersistenceUnitMetadataComposite_xmlMappingMetadataCompleteCheckBox=XML mapping metadata complete
-PersistenceUnitMetadataSection_catalogDefault=Default ({0})
-PersistenceUnitMetadataSection_schemaDefault=Default ({0})
-
-AddGeneratorDialog_name=Name:
-AddGeneratorDialog_generatorType=Type:
-AddGeneratorDialog_title=Add Generator
-AddGeneratorDialog_descriptionTitle=Create new generator
-AddGeneratorDialog_description=Create a new generator setting both the 'name' and the 'type'
-AddGeneratorDialog_tableGenerator=Table Generator
-AddGeneratorDialog_sequenceGenerator=Sequence Generator
-GeneratorStateObject_nameExists=The given name already exists. This generator may override the existing one(s) with the same name.
-GeneratorStateObject_nameMustBeSpecified=A name must be specified.
-GeneratorStateObject_typeMustBeSpecified=A generator type must be specified.
-
-
-UnsupportedOrmMappingUiProvider_label=Unsupported
-
-UnsupportedOrmMappingUiProvider_linkLabel=unsupported \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_entity_gen.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_entity_gen.properties
deleted file mode 100644
index f657db2f0b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_entity_gen.properties
+++ /dev/null
@@ -1,115 +0,0 @@
-###############################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-###############################################################################
-
-cardinality=Car&dinality:
-property=P&roperty:
-cascade=&Cascade:
-connection=&Connection:
-schema=&Schema:
-schemaInfo=(Note: You must have an active connection to select schema.)
-addConnectionLink=Add connections...
-connectLink=Connect
-connectingToDatabase=Connecting to database
-manyToOne=&Many to one
-manyToMany=Man&y to many
-oneToMany=&One to many
-oneToOne=&One to one
-manyToOneDesc=Each %s has many %s.
-oneToOneDesc=There is one %s per %s.
-manyToManyDesc=Each %s has many %s, and each %s has many %s.
-
-add=&Add
-remove=&Remove
-
-GenerateEntitiesWizard_generateEntities=Generate Custom Entities
-
-GenerateEntitiesWizard_selectJPAProject=JPA Project Selection
-GenerateEntitiesWizard_selectJPAProject_msg=Select a JPA project.
-
-GenerateEntitiesWizard_tableSelectPage_selectTable=Select Tables
-GenerateEntitiesWizard_tableSelectPage_chooseEntityTable=Select tables to generate entities from.
-GenerateEntitiesWizard_tableSelectPage_updatePersistenceXml=Update class list in persistence.xml
-GenerateEntitiesWizard_tableSelectPage_tables=&Tables:
-GenerateEntitiesWizard_tableSelectPage_tableColumn=Table
-GenerateEntitiesWizard_tableSelectPage_Restore_Defaults=Restore Defaults
-
-GenerateEntitiesWizard_tableSelectPage_getTables_jobName=Getting Tables
-GenerateEntitiesWizard_tableSelectPage_getTables_taskName=Schema get tables
-GenerateEntitiesWizard_tableSelectPage_getTables_subTaskName=Retrieving tables from schema {0}...
-GenerateEntitiesWizard_tableSelectPage_statusUpdate_taskName=Updating
-
-GenerateEntitiesWizard_assocPage_title=Table Associations
-GenerateEntitiesWizard_assocPage_label=Table &associations
-GenerateEntitiesWizard_assocPage_desc=Edit a table association by selecting it and modifying the controls in the editing panel.
-GenerateEntitiesWizard_assocPage_newAssoc=New Association
-GenerateEntitiesWizard_assocPage_delAssoc=Delete Selected Association
-
-
-GenerateEntitiesWizard_defaultTablePage_title=Customize Defaults
-GenerateEntitiesWizard_defaultTablePage_tableMapping=Mapping defaults
-GenerateEntitiesWizard_defaultTablePage_domainJavaClass=Domain java class
-
-GenerateEntitiesWizard_defaultTablePage_desc=Optionally customize aspects of entities that will be generated by default from database tables. A Java package should be specified.
-GenerateEntitiesWizard_defaultTablePage_access=Entity &access:
-GenerateEntitiesWizard_defaultTablePage_fetch=Associations &fetch:
-GenerateEntitiesWizard_defaultTablePage_collType=Collection properties &type:
-GenerateEntitiesWizard_defaultTablePage_genOptionalAnnotations = Always generate optional JPA annotations and DDL parameters
-GenerateEntitiesWizard_defaultTablePage_genOptionalAnnotations_desc = Generate optional JPA annotations and DDL parameters like 'unique', 'nullable', 'length', 'precision' and 'scale', which are optional and only used by automatic table creation to specify table creation data.
-GenerateEntitiesWizard_defaultTablePage_keyGen=Key &generator:
-GenerateEntitiesWizard_defaultTablePage_sequence=Sequence &name:
-GenerateEntitiesWizard_defaultTablePage_sequenceNote=You can use the patterns %s and/or %s in the sequence name.\n\
- These patterns will be replaced by the table name and the primary key \n\
- column name when a table mapping is generated.
-
-
-GenerateEntitiesWizard_tablesAndColumnsPage_title=Customize Individual Entities
-GenerateEntitiesWizard_tablesAndColumnsPage_desc=Customize detail of individual entities by selecting the associated tables or columns and changing values in the editing panel.
-GenerateEntitiesWizard_tablesAndColumnsPage_labelTableAndColumns=&Tables and columns
-
-GenerateEntitiesWizard_tablePanel_className=&Class name:
-GenerateEntitiesWizard_colPanel_genProp=Generate this property
-GenerateEntitiesWizard_colPanel_colMapping=Column mapping
-GenerateEntitiesWizard_colPanel_propName=Property &name:
-GenerateEntitiesWizard_colPanel_propType=Mapping t&ype:
-GenerateEntitiesWizard_colPanel_mapKind=Mapping &kind:
-GenerateEntitiesWizard_colPanel_beanProp=Domain Java Class
-GenerateEntitiesWizard_colPanel_getterScope=Getter scope:
-GenerateEntitiesWizard_colPanel_setterScope=Setter scope:
-GenerateEntitiesWizard_colPanel_colUpdateable=Column is &updatable
-GenerateEntitiesWizard_colPanel_colInsertable=Column is &insertable
-
-GenerateEntitiesWizard_newAssoc_title=Create New Association
-
-GenerateEntitiesWizard_newAssoc_tablesPage_title=Association Tables
-GenerateEntitiesWizard_newAssoc_tablesPage_desc=Specify the association tables.
-GenerateEntitiesWizard_newAssoc_tablesPage_assocKind=Association kind
-GenerateEntitiesWizard_newAssoc_tablesPage_assocTables=Association &tables:
-GenerateEntitiesWizard_newAssoc_tablesPage_table1=Table &1:
-GenerateEntitiesWizard_newAssoc_tablesPage_table2=Table &2:
-GenerateEntitiesWizard_newAssoc_tablesPage_intermediateTable=Join table:
-GenerateEntitiesWizard_newAssoc_tablesPage_simpleAssoc=&Simple association
-GenerateEntitiesWizard_newAssoc_tablesPage_m2mAssoc=&Many to many association
-
-GenerateEntitiesWizard_newAssoc_cardinalityPage_title=Association Cardinality
-GenerateEntitiesWizard_newAssoc_cardinalityPage_desc=Specify the association cardinality.
-
-GenerateEntitiesWizard_newAssoc_colsPage_title=Join Columns
-GenerateEntitiesWizard_newAssoc_colsPage_desc=Specify the join columns.
-GenerateEntitiesWizard_newAssoc_colsPage_label=Specify the join columns between the %s and %s tables:
-
-GenerateEntitiesWizard_assocEditor_entityRef=Generate a reference to %s in %s
-GenerateEntitiesWizard_assocEditor_setRef=Generate a reference to a collection of %s in %s
-GenerateEntitiesWizard_assocEditor_tableJoin=Table &join:
-GenerateEntitiesWizard_assocEditor_joinedWhen=The table rows are joined when:\n%s
-GenerateEntitiesWizard_assocEditor_genAssoc=Generate &this association
-
-selectCascadeDlgTitle=Select Cascade
-selectTableDlgTitle=Table Selection
-selectTableDlgDesc=&Select a table:
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_entity_wizard.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_entity_wizard.properties
deleted file mode 100644
index 08298a2cf9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_entity_wizard.properties
+++ /dev/null
@@ -1,58 +0,0 @@
-################################################################################
-# Copyright (c) 2008, 2010 by SAP AG, Walldorf.
-# All rights reserved. This program and the accompanying materials
-# are made available under the terms of the Eclipse Public License v1.0
-# which accompanies this distribution, and is available at
-# http://www.eclipse.org/legal/epl-v10.html
-#
-# Contributors:
-# SAP AG - initial API and implementation
-# Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
-################################################################################
-
-ENTITY_WIZARD_TITLE=New JPA Entity
-ENTITY_WIZARD_PAGE_TITLE=Entity class
-ENTITY_WIZARD_PAGE_DESCRIPTION=Create a new JPA entity. Only JPA enabled projects may be selected.
-DEFAULT_PACKAGE_WARNING=The usage of the default package is not recommended.
-ENTITY_PROPERTIES_TITLE=Entity Properties
-ENTITY_PROPERTIES_DESCRIPTION=Set entity name, table name, fields, and access type.
-ENTITY=Entit&y
-MAPPED_AS_SUPERCLASS=Mapped super&class
-INHERITANCE_GROUP=Inheritance
-INHERITANCE_CHECK_BOX=&Inheritance:
-XML_STORAGE_GROUP=XML entity mappings
-XML_SUPPORT=Add to entity mappings in &XML
-CHOOSE_XML=M&apping file:
-MAPPING_XML_TITLE=Mapping File
-XML_NAME_TITLE=XML name:
-CHOOSE_MAPPING_XML_MESSAGE=Choose mapping XML
-INVALID_XML_NAME=The mapping file does not exist
-MAPPING_FILE_NOT_LISTED_ERROR=The selected mapping file has not been added to the persistence unit.
-TYPE_DIALOG_TITLE=Choose Type
-TYPE_DIALOG_DESCRIPTION=Choose the type of the entity field.
-ENTITY_NAME=Entity na&me:
-TABLE_NAME_GROUP=Table name
-TABLE_NAME=&Table name:
-USE_DEFAULT=&Use default
-ENTITY_FIELDS_GROUP=Entity field&s
-ENTITY_FIELDS_DIALOG_TITLE=Entity Fields
-KEY=Key
-NAME_COLUMN=Name
-TYPE_COLUMN=Type
-NAME_TEXT_FIELD=Na&me:
-TYPE_TEXT_FIELD=&Type:
-BROWSE_BUTTON_LABEL=B&rowse...
-ADD_BUTTON_LABEL=&Add...
-EDIT_BUTTON_LABEL=&Edit...
-REMOVE_BUTTON_LABEL=&Remove
-DUPLICATED_ENTITY_NAMES_MESSAGE=There are duplicate names on created entity fields. Please resolve the duplication.
-ACCESS_TYPE=Access type
-FIELD_BASED=Fiel&d
-PROPERTY_BASED=&Property
-NO_JPA_PROJECTS=No JPA projects in the workspace
-APPLY_CHANGES_TO_PERSISTENCE_XML=Apply changes to persistence XML
-ADD_MAPPED_SUPERCLASS_TO_XML=Add mapped superclass to XML
-ADD_ENTITY_TO_XML=Add entity to XML
-EntityDataModelProvider_typeNotInProjectClasspath=''{0}'' does not exist on the project classpath
-EntityDataModelProvider_invalidPKType=''{0}'' is not a valid simple primary key type
-EntityDataModelProvider_invalidArgument=Invalid argument ''{0}''
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_jpql_identifiers.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_jpql_identifiers.properties
deleted file mode 100644
index f68626267d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_jpql_identifiers.properties
+++ /dev/null
@@ -1,83 +0,0 @@
-################################################################################
-# Copyright (c) 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# JPA 1.0 identifiers
-ABS=The <b>ABS</b> function removes the minus sign from a specified numeric argument and returns the absolute value (integer, float, or double) of the same type as the argument to the function, which is always a positive number or zero.
-ALL=<ul><li>An <b>ALL</b> conditional expression is a predicate that is <code>true</code> if the comparison operation is <code>true</code> for all values in the result of the subquery or the result of the subquery is empty.</li><li>An <b>ALL</b> conditional expression is <code>false</code> if the result of the comparison is <code>false</code> for at least one row, and is unknown if neither <code>true</code> nor <code>false</code>.</ul><p><p>The comparison operators used with <b>ALL</b> conditional expressions are =, <, <=, >, >=, <>.<p><p>The result of the subquery must be like that of the other argument to the comparison operator in type.
-#AND
-ANY=<ul><li>An <b>ANY</b> conditional expression is a predicate that is <code>true</code> if the comparison operation is <code>true</code> for some value in the result of the subquery.</li><li>An <b>ANY</b> conditional expression is <code>false</code> if the result of the subquery is empty or if the comparison operation is <code>false</code> for every value in the result of the subquery,</li><li>and is unknown if neither <code>true</code> nor <code>false</code>.</li></ul><p><p>The comparison operators used with <b>ANY</b> conditional expressions are =, <, <=, >, >=, <>.<p><p>The result of the subquery must be like that of the other argument to the comparison operator in type.
-ASC=The keyword <b>ASC</b> specifies that ascending ordering be used for the associated order by item.
-AVG=One of the aggregate functions. The arguments must be numeric. <b>AVG</b> returns <code>Double</code>.<p><p><b>BNF:</b> <code>expression ::= AVG([DISTINCT] state_field_path_expression)</code>
-BETWEEN=Used in conditional expression to determine whether the result of an expression falls within an inclusive range of values. Numeric, string and date expression can be evaluated in this way.
-BOTH=Trim from both ends.
-CONCAT=The <b>CONCAT</b> function returns a string that is a concatenation of its arguments.
-COUNT=One of the aggregate functions. The return type of this function is a <code>Long</code>.
-CURRENT_DATE=This function returns the value of current date on the database server.
-CURRENT_TIME=This function returns the value of current time on the database server.
-CURRENT_TIMESTAMP=This function returns the value of current timestamp on the database
-DELETE_FROM=A delete statement provide bulk operations over sets of entities.
-DESC=The keyword <b>DESC</b> specifies that descending ordering be used. Ascending ordering is the default.
-DISTINCT=The <b>DISTINCT</b> keyword is used to specify that duplicate values must be eliminated from the query result. If <b>DISTINCT</b> is not specified, duplicate values are not eliminated.
-ESCAPE=The optional <code>escape character</code> is a single-character string literal or a character-valued input parameter (i.e., char or Character) and is used to escape the special meaning of the underscore and percent characters in <code>pattern value</code>.
-EXISTS=An <b>EXISTS</b> expression is a predicate that is <code>true</code> only if the result of the subquery consists of one or more values and that is <code>false</code> otherwise.
-FROM=The <b>FROM</b> clause of a query defines the domain of the query by declaring identification variables. An identification variable is an identifier declared in the <b>FROM</b> clause of a query. The domain of the query may be constrained by path expressions. Identification variables designate instances of a particular entity abstract schema type. The <b>FROM</b> clause can contain multiple identification variable declarations separated by a comma (,).
-GROUP_BY=The <b>GROUP BY</b> construct enables the aggregation of values according to the properties of an entity class.
-HAVING=The <b>HAVING</b> construct enables conditions to be specified that further restrict the query result as restrictions upon the groups.
-IN=An identification variable declared by a collection member declaration ranges over values of a collection obtained by navigation using a path expression. Such a path expression represents a navigation involving the association-fields of an entity abstract schema type. Because a path expression can be based on another path expression, the navigation can use the association-fields of related entities. An identification variable of a collection member declaration is declared using a special operator, the reserved identifier <b>IN</b>. The argument to the <b>IN</b> operator is a collection-valued path expression. The path expression evaluates to a collection type specified as a result of navigation to a collection-valued association-field of an entity abstract schema type.
-IS_EMPTY=An <b>EMPTY</b> expression tests whether or not the collection designated by the collection-valued path expression is empty (i.e, has no elements).
-IS_NULL=A null comparison tests whether or not the single-valued path expression or input parameter is a <b>NULL</b> value.
-JOIN=A <b>JOIN</b> enables the fetching of an association as a side effect of the execution of a query. A <b>JOIN</b> is specified over an entity and its related entities.
-JOIN_FETCH=A <b>JOIN FETCH</b> enables the fetching of an association as a side effect of the execution of a query. A <b>JOIN FETCH</b> is specified over an entity and its related entities.
-LEADING=Trim from leading end.
-LENGTH=The <b>LENGTH</b> function returns the length of the string in characters as an integer.
-LIKE=The <b>LIKE</b> condition is used to specify a search for a pattern.<p><p>The <code>string_expression</code> must have a string value. The <code>pattern_value</code> is a string literal or a string-valued input parameter in which an underscore (_) stands for any single character, a percent (%) character stands for any sequence of characters (including the empty sequence), and all other characters stand for themselves. The optional <code>escape_character</code> is a single-character string literal or a character-valued input parameter (i.e., char or Character) and is used to escape the special meaning of the underscore and percent characters in <code>pattern_value</code>.
-LOCATE=The <b>LOCATE</b> function returns the position of a given string within a string, starting the search at a specified position. It returns the first position at which the string was found as an integer. The first argument is the string to be located; the second argument is the string to be searched; the optional third argument is an integer that represents the string position at which the search is started (by default, the beginning of the string to be searched). The first position in a string is denoted by 1. If the string is not found, 0 is returned. The <b>LENGTH</b> function returns the length of the string in characters as an integer.
-LOWER=The <b>LOWER</b> function converts a string to lower case and it returns a string.
-MAX=One of the aggregate functions. The arguments must correspond to orderable state-field types (i.e., numeric types, string types, character types, or date types). The return type of this function is based on the state-field's type.
-MEMBER=This expression tests whether the designated value is a member of the collection specified by the collection-valued path expression. If the collection-valued path expression designates an empty collection, the value of the <b>MEMBER OF</b> expression is <b>FALSE</b> and the value of the <b>NOT MEMBER OF</b> expression is <b>TRUE</b>. Otherwise, if the value of the collection-valued path expression or single-valued association-field path expression in the collection member expression is <b>NULL</b> or unknown, the value of the collection member expression is unknown.
-MIN= One of the aggregate functions. The arguments must correspond to orderable state-field types (i.e., numeric types, string types, character types, or date types). The return type of this function is based on the state-field's type.
-MOD=The modulo operation finds the remainder of division of one number by another. It takes two integer arguments and returns an integer.
-NEW=In the <b>SELECT</b> clause a constructor may be used in the <b>SELECT</b> list to return one or more Java instances. The specified class is not required to be an entity or to be mapped to the database. The constructor name must be fully qualified.
-OBJECT=Stand-alone identification variables in the <b>SELECT</b> clause may optionally be qualified by the <b>OBJECT</b> operator. The <b>SELECT</b> clause must not use the <b>OBJECT</b> operator to qualify path expressions.
-#OR
-ORDER_BY=The <b>ORDER BY</b> clause allows the objects or values that are returned by the query to be ordered.
-SELECT=The <b>SELECT</b> clause determines the type of the objects or values to be selected.
-SIZE=The <b>SIZE</b> function returns an integer value, the number of elements of the collection. If the collection is empty, the <b>SIZE</b> function evaluates to zero.
-SOME=<ul><li>An <b>SOME</b> conditional expression is a predicate that is <code>true</code> if the comparison operation is <code>true</code> for some value in the result of the subquery.</li><li>A <b>SOME</b> conditional expression is <code>false</code> if the result of the subquery is empty or if the comparison operation is <code>false</code> for every value in the result of the subquery,</li><li>and is unknown if neither <code>true</code> nor <code>false</code>.</li></ul><p><p>The comparison operators used with <b>SOME</b> conditional expressions are =, <, <=, >, >=, <>.<p><p>The result of the subquery must be like that of the other argument to the comparison operator in type.
-SQRT=The <b>SQRT</b> function takes a numeric argument and returns a double.
-SUBSTRING=The second and third arguments of the <b>SUBSTRING</b> function denote the starting position and length of the substring to be returned. These arguments are integers. The first position of a string is denoted by 1. The <b>SUBSTRING</b> function returns a string.
-SUM= One of the aggregate functions. The arguments must be numeric. The <b>SUM</b> function returns <code>Long</code> when applied to state-fields of integral types (other than <code>BigInteger</code>); <code>Double</code> when applied to state-fields of floating point types; <code>BigInteger</code> when applied to state-fields of type <code>BigInteger</code>; and <code>BigDecimal</code> when applied to state-fields of type <code>BigDecimal</code>. If <b>SUM</b>, <b>AVG</b>, <b>MAX</b>, or <b>MIN</b> is used, and there are no values to which the aggregate function can be applied, the result of the aggregate function is <code>NULL</code>. If <code>COUNT</code> is used, and there are no values to which <b>COUNT</b> can be applied, the result of the aggregate function is 0.
-TRAILING=Trim from trailing end.
-TRIM=The <b>TRIM</b> function trims the specified character from a string. If the character to be trimmed is not specified, it is assumed to be space (or blank). The optional <code>trim_character</code> is a single-character string literal or a character-valued input parameter (i.e., char or Character). If a trim specification is not provided, <b>BOTH</b> is assumed. The <b>TRIM</b> function returns the trimmed string.
-UPDATE=An update statement provide bulk operations over sets of entities.
-UPPER=The <b>UPPER</b> function converts a string to upper case and it returns a string.
-WHERE=The <b>WHERE</b> clause of a query consists of a conditional expression used to select objects or values that satisfy the expression. The <b>WHERE</b> clause restricts the result of a select statement or the scope of an update or delete operation.
-
-# JPA 2.0 identifiers
-CASE=A <b>CASE</b> expression can include any number of any number of <b>WHEN/THEN</b> statement pairs and returns one of the values in the map or the default item, evaluating the map key expressions to decide which.
-COALESCE=A <b>COALESCE</b> expression returns <code>null</code> if all its arguments evaluate to <code>null</code>, and the value of the first non-<code>null</code> argument otherwise.<p><p>The return type is the type returned by the arguments if they are all of the same type, otherwise it is undetermined.
-ENTRY=Use <b>ENTRY</b> in the <b>FROM</b> clause of a <b>MAP</b>.
-INDEX=The <b>INDEX</b> function returns an integer value corresponding to the position of its argument in an ordered list. The <b>INDEX</b> function can only be applied to identification variables denoting types for which an order column has been specified.
-KEY=Use <b>KEY</b> in the <b>SELECT</b> clause or the <b>WHERE</b> clause of a <b>MAP</b>.
-NULLIF=<b>NULLIF</b> returns the first expression if the two expressions are not equal. If the expressions are equal, <b>NULLIF</b> returns a null value of the type of the first expression.<p><p><b>NULLIF</b> is equivalent to a searched <b>CASE</b> expression in which the two expressions are equal and the resulting expression is <b>NULL</b>.<p><p>Returns the same type as the first expression.
-TYPE=An entity type expression can be used to restrict query polymorphism. The <b>TYPE</b> operator returns the exact type of the argument.
-VALUE=Use <b>VALUE</b> in the <b>SELECT</b> clause or the <b>WHERE</b> clause of a <b>MAP</b>.
-
-# EclipseLink identifiers
-FUNC=Use <b>FUNC</b> for direct, native database functions.
-TREAT=<b>TREAT</b> downcasts child classes in inheritance hierarchy.
-
-# Reserved JPQL identifiers
-BIT_LENGTH=The identifier <b>BIT_LENGTH</b> is not currently used: it is reserved for future use.
-CHAR_LENGTH=The identifier <b>CHAR_LENGTH</b> is not currently used: it is reserved for future use.
-CHARACTER_LENGTH=The identifier <b>CHARACTER_LENGTH</b> is not currently used: it is reserved for future use.
-CLASS=The identifier <b>CLASS</b> is not currently used: it is reserved for future use.
-POSITION=The identifier <b>POSITION</b> is not currently used: it is reserved for future use.
-UNKNOWN=The identifier <b>UNKNOWN</b> is not currently used: it is reserved for future use.
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_persistence.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_persistence.properties
deleted file mode 100644
index f9cdc7ad3f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_persistence.properties
+++ /dev/null
@@ -1,56 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-ArchiveFileSelectionDialog_jarPathHelpLabel=The correct path to the JAR file selected will vary on your runtime environment. You may alter it here to correctly reflect your particular environment.
-ArchiveFileSelectionDialog_jarPathLabel=JAR file path:
-
-PersistenceEditor_page_help=Help
-PersistenceEditor_sourceTab=Source
-
-PersistenceUnitClassesComposite_description=Specify the list of classes to be managed in this persistence unit.
-PersistenceUnitClassesComposite_excludeUnlistedMappedClasses=Exclude unlisted classes
-PersistenceUnitClassesComposite_excludeUnlistedMappedClassesWithDefault=Exclude unlisted classes ({0})
-PersistenceUnitClassesComposite_mappedClassesNoName=<name not set>
-PersistenceUnitClassesComposite_open=Open
-
-PersistenceUnitConnectionGeneralComposite_default=Default(JTA)
-PersistenceUnitConnectionGeneralComposite_jta=JTA
-PersistenceUnitConnectionGeneralComposite_resource_local=Resource Local
-
-PersistenceUnitConnectionComposite_connection=Connection
-PersistenceUnitConnectionComposite_database=Database
-PersistenceUnitConnectionComposite_general=General
-
-PersistenceUnitConnectionDatabaseComposite_jtaDatasourceName=JTA data source name:
-PersistenceUnitConnectionDatabaseComposite_nonJtaDatasourceName=Non-JTA data source name:
-
-PersistenceUnitConnectionGeneralComposite_transactionType=Transaction type:
-
-PersistenceUnitGeneralComposite_general=General
-PersistenceUnitGeneralComposite_jarFiles=JAR Files
-PersistenceUnitGeneralComposite_jpaMappingDescriptors=XML Mapping Files
-PersistenceUnitGeneralComposite_jpaMappingDescriptors_description=Specify the XML mapping files for this persistence unit.
-PersistenceUnitGeneralComposite_mappedClasses=Managed Classes
-PersistenceUnitGeneralComposite_name=Name:
-PersistenceUnitGeneralComposite_persistenceProvider=Persistence provider:
-PersistenceUnitGeneralComposite_description=Description:
-
-PersistenceUnitJarFilesComposite_noFileName=<File name not set>
-PersistenceUnitMappingFilesComposite_jarFileDialog_title=JAR File Selection
-PersistenceUnitMappingFilesComposite_jarFileDialog_message=Choose a JAR file to be added to the persistence unit.
-
-PersistenceUnitMappingFilesComposite_mappingFileDialog_message=Choose the XML mapping files to be added to the persistence unit.
-PersistenceUnitMappingFilesComposite_mappingFileDialog_title=JPA XML Mapping File Selection
-PersistenceUnitMappingFilesComposite_ormNoName=<name not set>
-
-PersistenceUnitPropertiesComposite_nameColumn=Name
-PersistenceUnitPropertiesComposite_properties=Properties
-PersistenceUnitPropertiesComposite_properties_description=This table lists all properties that are defined for this persistence unit.
-PersistenceUnitPropertiesComposite_valueColumn=Value \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_persistence2_0.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_persistence2_0.properties
deleted file mode 100644
index 49a4408d61..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_persistence2_0.properties
+++ /dev/null
@@ -1,60 +0,0 @@
-################################################################################
-# Copyright (c) 2009, 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-ConnectionPropertiesComposite_Database_GroupBox = Database
-
-DataSourcePropertiesComposite_jtaDataSourceLabel = JTA data source:
-DataSourcePropertiesComposite_nonJtaDataSourceLabel = Non-JTA data source:
-
-GenericPersistenceUnit2_0ConnectionComposite_sectionTitle = Persistence Unit Connection
-GenericPersistenceUnit2_0ConnectionComposite_sectionDescription = Configure the data source or JDBC connection properties.
-
-JdbcConnectionPropertiesComposite_ConnectionDialog_Message = &Enter connection name or pattern (*, ?, or camel case):
-JdbcConnectionPropertiesComposite_ConnectionDialog_Title = Connection Selection
-GenericPersistenceUnit2_0ConnectionTab_title = Connection
-
-GenericPersistenceUnit2_0OptionsComposite_miscellaneousSectionTitle = Miscellaneous Options
-GenericPersistenceUnit2_0OptionsComposite_miscellaneousSectionDescription = Configure the miscellaneous options.
-GenericPersistenceUnit2_0OptionsTab_title = Options
-GenericPersistenceUnit2_0OptionsTab_noName = <name not set>
-
-JdbcConnectionPropertiesComposite_populateFromConnectionHyperLink = Populate from connection...
-JdbcConnectionPropertiesComposite_driverLabel = Driver:
-JdbcConnectionPropertiesComposite_urlLabel = URL:
-JdbcConnectionPropertiesComposite_userLabel = User:
-JdbcConnectionPropertiesComposite_passwordLabel = Password:
-
-JdbcPropertiesComposite_JdbcConnectionProperties_GroupBox = JDBC connection properties
-
-LockingConfigurationComposite_lockTimeoutLabel = Lock timeout:
-QueryConfigurationComposite_queryTimeoutLabel = Query timeout:
-
-TransactionTypeComposite_transactionTypeLabel = Transaction type:
-
-TransactionTypeComposite_jta = JTA
-TransactionTypeComposite_resource_local = Resource Local
-
-SharedCacheModeComposite_sharedCacheModeLabel = Shared cache mode:
-
-SharedCacheModeComposite_all = All
-SharedCacheModeComposite_none = None
-SharedCacheModeComposite_enable_selective = Enable Selective
-SharedCacheModeComposite_disable_selective = Disable Selective
-SharedCacheModeComposite_unspecified = Unspecified
-
-ValidationModeComposite_validationModeLabel = Validation mode:
-
-ValidationModeComposite_auto = Auto
-ValidationModeComposite_callback = Callback
-ValidationModeComposite_none = None
-
-ValidationConfigurationComposite_groupPrePersistLabel = Validate pre-persist group:
-ValidationConfigurationComposite_groupPreUpdateLabel = Validate pre-update group:
-ValidationConfigurationComposite_groupPreRemoveLabel = Validate pre-remove group:
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_validation_preferences.properties b/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_validation_preferences.properties
deleted file mode 100644
index de5ad21ba1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/property_files/jpt_ui_validation_preferences.properties
+++ /dev/null
@@ -1,297 +0,0 @@
-################################################################################
-# Copyright (c) 2009, 2012 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-#Content is organized based on the categories and
-#Entries in each categories are listed alphabetically.
-#If adding a new entry, please add it to the corresponding category at the right place.
-
-PROJECT_LEVEL_CATEGORY=Project
-
-NO_JPA_PROJECT=Project has JPA facet, but JPA project couldn't be created:
-PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS=Multiple persistence units defined:
-PERSISTENCE_NO_PERSISTENCE_UNIT=No persistence unit defined:
-PERSISTENCE_XML_INVALID_CONTENT=Invalid content (no root node):
-PERSISTENCE_XML_UNSUPPORTED_CONTENT=Persistence.xml file does not have supported content for JPA platform:
-PROJECT_NO_CONNECTION=No connection specified for project:
-PROJECT_INACTIVE_CONNECTION=Connection is not active:
-PROJECT_INVALID_CONNECTION=Connection does not exist:
-PROJECT_INVALID_LIBRARY_PROVIDER=Selected library provider is invalid:
-PROJECT_MULTIPLE_PERSISTENCE_XML=Multiple persistence.xml files in project:
-PROJECT_NO_PERSISTENCE_XML=No persistence.xml file found in project:
-XML_VERSION_NOT_LATEST=XML document version not most recent:
-
-PERSISTENCE_UNIT_LEVEL_CATEGORY=Persistence unit
-
-MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_METADATA=Extraneous persistence unit metadata found:
-PERSISTENT_TYPE_DUPLICATE_CLASS=Duplicate ORM class:
-PERSISTENCE_UNIT_DUPLICATE_CLASS=Duplicate Java class:
-PERSISTENCE_UNIT_DUPLICATE_JAR_FILE=Duplicate JAR file:
-PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE=Duplicate mapping file:
-PERSISTENCE_UNIT_INVALID_CLASS=Class is included in a persistence unit but is not mapped:
-PERSISTENCE_UNIT_INVALID_MAPPING_FILE=Mapping file does not have ORM content:
-PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING=The path to the JAR file will vary:
-PERSISTENCE_UNIT_NONEXISTENT_CLASS=Class cannot be resolved:
-PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE=JAR file cannot be resolved:
-PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE=Mapping file cannot be resolved:
-PERSISTENCE_UNIT_REDUNDANT_CLASS=Class is already specified in mapping file:
-PERSISTENCE_UNIT_UNSPECIFIED_CLASS=Unspecified class:
-PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE=Unspecified JAR file:
-PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE=Unspecified mapping file:
-PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT=Mapping file does not have supported content:
-
-TYPE_LEVEL_CATEGORY=Type
-ENTITY_NAME_DUPLICATED=Entity name must be unique:
-ENTITY_NAME_MISSING=Entity name is empty:
-ENTITY_NO_PK=Entity has no primary key:
-ENTITY_NON_ROOT_ID_ATTRIBUTE_SPECIFIED=Primary key attribute should only be defined on the root entity or a mapped superclass:
-ENTITY_NON_ROOT_ID_CLASS_SPECIFIED=ID class should only be defined on the root entity or a mapped superclass:
-PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT=Class is annotated, but is not in a persistence unit:
-PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT=Class is mapped, but is not in a persistence unit:
-PERSISTENT_TYPE_UNRESOLVED_CLASS=Class in orm.xml cannot be resolved to a java class:
-PERSISTENT_TYPE_UNSPECIFIED_CLASS=Class is unspecified in orm.xml:
-TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR=Mapped Java class has no no-arg constructor:
-TYPE_MAPPING_CLASS_PRIVATE_NO_ARG_CONSTRUCTOR=Mapped Java class has a private no-arg constructor:
-TYPE_MAPPING_FINAL_CLASS=Mapped Java class is final:
-TYPE_MAPPING_ID_AND_EMBEDDED_ID_BOTH_USED=ID and embedded ID are not allowed to be used together:
-TYPE_MAPPING_ID_CLASS_AND_EMBEDDED_ID_BOTH_USED=ID class and embedded ID mapping are not allowed to be used together:
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_DOES_NOT_EXIST=Primary key attribute does not have a matching ID class attribute:
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_DUPLICATE_MATCH=Primary key attribute is a duplicate match for ID class:
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_NO_MATCH=No ID class attribute matches primary key attribute:
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NO_MATCH=No primary key attribute matches ID class attribute:
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NOT_PRIMARY_KEY=Attribute matching ID class attribute is not mapped as a primary key:
-TYPE_MAPPING_ID_CLASS_ATTRIBUTE_TYPE_DOES_NOT_AGREE=Attribute matching ID class attribute does not have the correct type:
-TYPE_MAPPING_ID_CLASS_MISSING_EQUALS_METHOD=ID class does not have a valid equals() defined:
-TYPE_MAPPING_ID_CLASS_MISSING_HASHCODE_METHOD=ID class does not have a valid hashCode() defined:
-TYPE_MAPPING_ID_CLASS_MISSING_NO_ARG_CONSTRUCTOR=ID class has no no-arg constructor defined:
-TYPE_MAPPING_ID_CLASS_MISSING_PUBLIC_NO_ARG_CONSTRUCTOR=ID class must have a public no-arg constructor:
-TYPE_MAPPING_ID_CLASS_NAME_EMPTY=ID class has an empty name:
-TYPE_MAPPING_ID_CLASS_NOT_EXIST=ID class does not exist on the project classpath:
-TYPE_MAPPING_ID_CLASS_NOT_IMPLEMENT_SERIALIZABLE=ID class must implement \"java.io.Serializable\" interface:
-TYPE_MAPPING_ID_CLASS_NOT_PUBLIC=ID class must be public:
-TYPE_MAPPING_ID_CLASS_PROPERTY_METHOD_NOT_PUBLIC=The property method of ID class must be public:
-TYPE_MAPPING_ID_CLASS_REDEFINED=ID class has already been defined on an ancestor of a class:
-TYPE_MAPPING_ID_CLASS_REQUIRED=ID class must be used when multiple ID mappings defined:
-TYPE_MAPPING_ID_CLASS_WITH_MAPS_ID="Maps Id" is not allowed to use in conjunction with an ID class:
-TYPE_MAPPING_MAPS_ID_ATTRIBUTE_TYPE_DOES_NOT_AGREE=Type of "Maps ID" attribute does not agree with primary key class of target entity:
-TYPE_MAPPING_MEMBER_CLASS=Mapped Java class is a member class:
-TYPE_MAPPING_MULTIPLE_EMBEDDED_ID=Only one embedded ID mapping is allowed:
-TYPE_MAPPING_PK_REDEFINED_ID_ATTRIBUTE=No ID mapping allowed on a class when its ancestor already defines primary key:
-TYPE_MAPPING_PK_REDEFINED_ID_CLASS=No ID class allowed on a class when its ancestor already defines primary key:
-
-ATTRIBUTE_LEVEL_CATEGORY=Attribute
-
-ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST=Element collection target class does not exist on the project classpath:
-ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=Element collection target class is not embeddable or basic type:
-ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED=Element collection target class is not specified:
-ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING=Element collection mapping contains an embeddable which contains a prohibited element collection mapping:
-ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING=Element collection mapping contains an embeddable which contains a prohibited relationship mapping:
-EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC=Embedded ID classes should be public:
-EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE=Embedded ID classes should implement equals() and hashcode():
-EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR=Embedded ID classes should implement a zero argument constructor:
-EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE=Embedded ID classes should implement java.io.Serializable:
-EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS=Embedded ID classes should not contain relationship mappings:
-EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED=Embedded IDs that are mapped by a relationship should not specify any attribute overrides:
-ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED=IDs that are mapped by a relationship should not specify a column:
-MAPS_ID_VALUE_INVALID="Maps ID" attribute value invalid:
-MAPS_ID_VALUE_NOT_RESOLVED="Maps ID" attribute value not resolved:
-MAPS_ID_VALUE_NOT_SPECIFIED="Maps ID" attribute value not specified:
-MAPPING_INVALID_MAPPED_BY=Attribute has invalid mapping for this relationship:
-MAPPING_MAPPED_BY_ON_BOTH_SIDES=Relationship must have an owner:
-MAPPING_MAPPED_BY_WITH_JOIN_TABLE=Cannot specify join table if attribute is mapped by another attribute:
-MAPPING_UNRESOLVED_MAPPED_BY=Cannot resolve attribute name:
-ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED=OrderColumn and OrderBy annotations are both specified:
-PERSISTENT_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE=Element collection value type is invalid for a Temporal mapping:
-PERSISTENT_ATTRIBUTE_FINAL_FIELD=The java field for attribute is final:
-PERSISTENT_ATTRIBUTE_FINAL_GETTER=The java getter for attribute is final:
-PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED=In orm.xml referenced inherited attribute may not be supported:
-PERSISTENT_ATTRIBUTE_INVALID_MAPPING=Attribute has invalid mapping type:
-PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE=Persistence field/property type is invalid for a Temporal mapping:
-PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE=Persistence field/property map key type is invalid for a Temporal mapping:
-PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE=Persistence field/property type is invalid for a Version mapping:
-PERSISTENT_ATTRIBUTE_PUBLIC_FIELD=The java field for attribute is public:
-PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME=Attribute in orm.xml cannot be resolved in the java class:
-PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME=Attribute in orm.xml has unspecified name:
-TARGET_ENTITY_IS_NOT_AN_ENTITY=Target entity is not an Entity:
-TARGET_ENTITY_NOT_DEFINED=Target entity is not defined:
-TARGET_ENTITY_NOT_EXIST=Target entity does not exist on the project classpath:
-TARGET_NOT_AN_EMBEDDABLE=Target type of an embedded mapping is not an embeddable:
-MAP_KEY_CLASS_NOT_DEFINED=Map key class not defined:
-MAP_KEY_CLASS_NOT_EXIST=Map key class does not exist on the project classpath:
-MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE=Map key class is not entity, embeddable or basic type:
-ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE=Collection mapping attribute type must be java.util.Collection, java.util.Set, java.util.List or java.util.Map:
-
-VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST=Element collection target class does not exist on the project classpath:
-VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE=Element collection target class is not embeddable or basic type:
-VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED=Element collection target class is not specified:
-VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING=Element collection mapping contains an embeddable which contains a prohibited element collection mapping:
-VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING=Element collection mapping contains an embeddable which contains a prohibited relationship mapping:
-VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC=Embedded ID classes should be public:
-VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE=Embedded ID classes should implement equals() and hashcode():
-VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR=Embedded ID classes should implement a zero argument constructor:
-VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE=Embedded ID classes should implement java.io.Serializable:
-VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS=Embedded ID classes should not contain relationship mappings:
-VIRTUAL_ATTRIBUTE_EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED=Embedded IDs that are mapped by a relationship should not specify any attribute overrides:
-VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY=Target entity is not an Entity:
-VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED=Target entity is not defined:
-VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE=Target type of an embedded mapping is not an embeddable:
-VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED=Map key class not defined:
-VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE=Persistence field/property map key type is invalid for a Temporal mapping:
-VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE=Element collection value type is invalid for a Temporal mapping:
-VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE=Persistence field/property type is invalid for a Temporal mapping:
-VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE=Map key class is not entity, embeddable or basic type:
-VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE=Collection mapping attribute type must be java.util.Collection, java.util.Set, java.util.List or java.util.Map:
-
-DATABASE_CATEGORY=Database
-TABLE_CATEGORY=Table
-
-COLLECTION_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for collection table:
-COLLECTION_TABLE_UNRESOLVED_NAME=Collection table cannot be resolved:
-COLLECTION_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for collection table:
-JOIN_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for join table:
-JOIN_TABLE_UNRESOLVED_NAME=Join table cannot be resolved:
-JOIN_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for join table:
-SECONDARY_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for secondary table:
-SECONDARY_TABLE_UNRESOLVED_NAME=Secondary table cannot be resolved:
-SECONDARY_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for secondary table:
-TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for table:
-TABLE_UNRESOLVED_NAME=Table cannot be resolved:
-TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for table:
-
-VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for collection table:
-VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME=Collection table cannot be resolved:
-VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for collection table:
-VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG=Catalog cannot be resolved for join table:
-VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME=Join table cannot be resolved:
-VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA=Schema cannot be resolved for join table:
-
-COLUMN_CATEGORY=Column
-
-COLUMN_TABLE_NOT_VALID=Table for column not valid given the context:
-COLUMN_UNRESOLVED_NAME=Column cannot be resolved:
-COLUMN_UNRESOLVED_TABLE=Table for column cannot be resolved:
-INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Inverse join column name must be specified when there are multiples:
-INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Inverse join column referenced column name must be specified when there are multiples:
-INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=Table for inverse join column is not valid:
-INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=Inverse join column cannot be resolved:
-INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in inverse join column cannot be resolved:
-JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Join column name must be specified when there are multiples:
-JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Join column referenced column name must be specified when there are multiples:
-JOIN_COLUMN_TABLE_NOT_VALID=Table for join column is not valid:
-JOIN_COLUMN_UNRESOLVED_NAME=Join column cannot be resolved:
-JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in join column cannot be resolved:
-MAP_KEY_COLUMN_TABLE_NOT_VALID=Table for map key column is not valid:
-MAP_KEY_COLUMN_UNRESOLVED_NAME=Map key column cannot be resolved on table:
-ORDER_COLUMN_UNRESOLVED_NAME=Order column cannot be resolved:
-PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Primary key join column name must be specified when there are multiples:
-PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Primary key join column referenced column name must be specified when there are multiples:
-PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Primary key join column cannot be resolved:
-PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Primary key join column referenced column cannot be resolved:
-MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Map key join column name must be specified when there are multiples:
-MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID=Table for map key join column is not valid:
-MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Map key join column referenced column name must be specified when there are multiples:
-MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Map key join column cannot be resolved:
-MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in map key join column cannot be resolved:
-
-VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID=Table for column not valid:
-VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME=Column cannot be resolved:
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Inverse join column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Inverse join column referenced column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=Table for inverse join column is not valid:
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=Inverse join column cannot be resolved:
-VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in inverse join column cannot be resolved:
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Join column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Join column referenced column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID=Table for join column is not valid:
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME=Join column cannot be resolved:
-VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in join column cannot be resolved:
-VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID=Table for map key column is not valid:
-VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME=Map key attribute column cannot be resolved on table:
-VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME=Order column cannot be resolved:
-VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Secondary table primary key join column name must be specified when there are multiples:
-VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Secondary table primary key join column referenced column name must be specified when there are multiples:
-VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Secondary table primary key join column cannot be resolved:
-VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Secondary table primary key join column referenced column name cannot be resolved:
-VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Primary key join column name must be specified when there are multiples:
-VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Primary key join column referenced column name must be specified when there are multiples:
-VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Primary key join column cannot be resolved:
-VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Primary key join column referenced column name cannot be resolved:
-VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS=Map key join column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS=Map key join column referenced column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID=Table for map key join column is not valid:
-VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME=Map key join column cannot be resolved:
-VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Referenced column in map key join column cannot be resolved:
-
-OVERRIDES_CATEGORY=Attribute/association overrides
-IMPLIED_ATTRIBUTE_LEVEL_CATEGORY=Implied attributes
-
-ASSOCIATION_OVERRIDE_INVALID_NAME=Association override name cannot be resolved to an attribute
-ATTRIBUTE_OVERRIDE_INVALID_NAME=Attribute override name cannot be resolved to an attribute
-ATTRIBUTE_OVERRIDE_INVALID_TYPE=Attribute override type cannot be resolved to an attribute
-ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED=Attributes (or subattributes of an attribute) mapped by a relationship should not be overridden:
-VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME=Implied association override name cannot be resolved to an attribute
-VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS=Implied association override inverse join column name must be specified when there are multiples:
-VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS=Implied association override inverse join column referenced column name must be specified when there are multiples:
-VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=Implied association override table for inverse join column is not valid:
-VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=Implied association override inverse join column cannot be resolved:
-VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Implied association override referenced column in inverse join column cannot be resolved:
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Implied association override join column name must be specified when there are multiples:
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Implied association override join column referenced column name must be specified when there are multiples:
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID=Implied association override table for join column is not valid:
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=Implied association override join column cannot be resolved:
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME=Implied association override referenced column in join column cannot be resolved:
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_CATALOG=Implied association override catalog cannot be resolved for join table:
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_NAME=Implied association override join table cannot be resolved:
-VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_SCHEMA=Implied association override schema cannot be resolved for join table:
-VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Implied attribute override table for column not valid:
-VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=Implied attribute override column cannot be resolved:
-VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME=Implied attribute override name cannot be resolved to an attribute:
-VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Implied map key attribute override table for column is not valid:
-VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME=Implied map key attribute override name cannot be resolved to an attribute
-
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME=Association override name cannot be resolved to an attribute
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS=Association override inverse join column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=Association override inverse join column referenced column name cannot be resolved:
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS=Association override inverse join column referenced column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID=Association override table for inverse join column is not valid:
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME=Association override inverse join column cannot be resolved:
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Association override join column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS=Association override join column referenced column name must be specified when there are multiples:
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME=Association override join column referenced column name cannot be resolved:
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID=Association override table for join column is not valid:
-VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME=Association override join column cannot be resolved:
-VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Attribute override table for column not valid:
-VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=Attribute override column cannot be resolved:
-VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME=Attribute override name cannot be resolved to an attribute
-VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID=Map key attribute override table for column not valid:
-VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME=Map key attribute override cannot be resolved to an attribute:
-VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=Map key attribute override column cannot be resolved on table to an attribute:
-VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME=Column cannot be resolved on table to map key attribute override:
-
-INHERITANCE_CATEGORY=Inheritance
-
-DISCRIMINATOR_COLUMN_UNRESOLVED_NAME=Discriminator column cannot be resolved:
-ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED=No discriminator value should be defined for abstract entity:
-ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE=No table should be defined for abstract entity using table-per-concrete-class inheritance:
-ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED=No discriminator column should be defined for non-root entity:
-ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE=No table should be defined for non-root entity using single-table inheritance:
-ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED=No discriminator column should be defined for entity using table-per-concrete-class inheritance:
-ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED=No discriminator value should be defined for entity using table-per-concrete-class inheritance:
-ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM=Entity uses table-per-concrete-class inheritance which is not portable:
-ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM=Entity cannot use table-per-concrete-class inheritance:
-
-QUERIES_GENERATORS_CATEGORY=Queries and generators
-
-GENERATOR_DUPLICATE_NAME=Duplicate generator defined:
-GENERATOR_NAME_UNDEFINED=Generator is unnamed:
-ID_MAPPING_UNRESOLVED_GENERATOR_NAME=Generator is not defined in the persistence unit:
-JPQL_QUERY_VALIDATION=Invalid or incomplete JPQL queries:
-QUERY_DUPLICATE_NAME=Duplicate query defined:
-QUERY_NAME_UNDEFINED=Query is unnamed:
-QUERY_STATEMENT_UNDEFINED=Query has no query statement:
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/schema/jpaPlatformUis.exsd b/jpa/plugins/org.eclipse.jpt.jpa.ui/schema/jpaPlatformUis.exsd
deleted file mode 100644
index caf515c987..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/schema/jpaPlatformUis.exsd
+++ /dev/null
@@ -1,139 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.jpt.jpa.ui" xmlns="http://www.w3.org/2001/XMLSchema">
-<annotation>
- <appinfo>
- <meta.schema plugin="org.eclipse.jpt.jpa.ui" id="jpaPlatforms" name="JPA Platform UIs"/>
- </appinfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <annotation>
- <appinfo>
- <meta.element />
- </appinfo>
- </annotation>
- <complexType>
- <sequence>
- <element ref="jpaPlatformUi" 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="jpaPlatformUi">
- <annotation>
- <documentation>
- Extend this extension point and you must also extend the org.eclipse.jpt.jpa.core.jpaPlatforms extension point. The jpaPlatformId must match the id of a core.jpaPlatform extension. One jpaPlatform will be chosen per JpaProject. The possible jpaPlatforms will be displayed to the user as a project property.
- </documentation>
- </annotation>
- <complexType>
- <attribute name="id" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="jpaPlatform" type="string" use="required">
- <annotation>
- <documentation>
- The jpaPlatformId must match the corresponding org.eclipse.jpt.jpa.core.jpaPlatform extension id.
- </documentation>
- </annotation>
- </attribute>
- <attribute name="factoryClass" type="string" use="required">
- <annotation>
- <documentation>
- The class that implements &lt;samp&gt;org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory&lt;/samp&gt;.
- </documentation>
- <appinfo>
- <meta.attribute kind="java" basedOn=":org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory"/>
- </appinfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <annotation>
- <appinfo>
- <meta.section type="since"/>
- </appinfo>
- <documentation>
- 2.2
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="examples"/>
- </appinfo>
- <documentation>
- [Enter extension point usage example here.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="apiinfo"/>
- </appinfo>
- <documentation>
- Provisional API: This interface is part of an interim API that is still
-under development and expected to change significantly before reaching
-stability. It is available at this early stage to solicit feedback from
-pioneering adopters on the understanding that any code that uses this API
-will almost certainly be broken (repeatedly) as the API evolves.
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="implementation"/>
- </appinfo>
- <documentation>
- [Enter information about supplied implementation of this extension point.]
- </documentation>
- </annotation>
-
- <annotation>
- <appinfo>
- <meta.section type="copyright"/>
- </appinfo>
- <documentation>
- Copyright (c) 2006, 2009 Oracle. All rights reserved.
-This program and the accompanying materials are made available under the
-terms of the Eclipse Public License v1.0, which accompanies this distribution
-and is available at http://www.eclipse.org/legal/epl-v10.html.
-
-Contributors:
-Oracle - initial API and implementation
- </documentation>
- </annotation>
-
-</schema>
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaFileModel.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaFileModel.java
deleted file mode 100644
index 8ad990cb48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaFileModel.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-
-/**
- * Standard adapter for retrieving a {@link JpaFile JPA file} model
- * with change notification when the JPA file is created or destroyed
- * (or its JPA project is created or destroyed):
- * <pre>
- * IFile file = (IFile) ResourcesPlugin.getWorkspace().getRoot().findMember("Foo.java");
- * JpaFileModel jpaFileModel = (JpaFileModel) file.getAdapter(JpaFileModel.class);
- * JpaFile jpaFile = jpaFileModel.getValue();
- * </pre>
- * @see org.eclipse.jpt.jpa.ui.internal.FileAdapterFactory
- */
-public interface JpaFileModel
- extends PropertyValueModel<JpaFile>
-{
- /**
- * Return the file corresponding to the JPA file model.
- */
- IFile getFile();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUi.java
deleted file mode 100644
index 4cae15da39..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUi.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import java.util.Iterator;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This interface is to be implemented by a JPA vendor to provide extensions to
- * JPA UI functionality. This is intended to work in conjunction with a core
- * {@link JpaPlatform JPA platform} implementation with the same ID.
- * <p>
- * Any implementation's state should be <em>static</em>.
- * <p>
- * The "generic" extension supplies UI for the core platform extension with the same
- * ID.
- * <p>
- * See the extension point: <code>org.eclipse.jpt.jpa.ui.jpaPlatform</code>
- * <p>
- * To retrieve the JPA UI platform corresponding to a JPA platform:
- * <pre>
- * JpaProject jpaProject = ...;
- * JpaPlatform jpaPlatform = jpaProject.getJpaPlatform();
- * JpaPlatformUi jpaPlatformUi = (JpaPlatformUi) jpaPlatform.getAdapter(JpaPlatformUi.class);
- * </pre>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaPlatformUi {
- // ********** navigator provider **********
-
- /**
- * Return the platform's Navigator factory provider.
- * This is used by the Common Navigator to build and maintain the JPA
- * content and labels.
- */
- ItemTreeStateProviderFactoryProvider getNavigatorFactoryProvider();
-
-
- // ********** structure view factory providers **********
-
- /**
- * Return a structure provider for the specified JPA file.
- */
- ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider(JpaFile jpaFile);
-
-
- // ********** details providers **********
-
- JpaDetailsPageManager<? extends JpaStructureNode> buildJpaDetailsPageManager(
- Composite parent,
- JpaStructureNode structureNode,
- WidgetFactory widgetFactory);
-
-
- // ********** file ui definitions **********
-
- /**
- * Return a resource ui definition for the specified resource type.
- */
- ResourceUiDefinition getResourceUiDefinition(JptResourceType resourceType);
-
-
- // ********** type mappings **********
-
- JpaComposite buildTypeMappingComposite(
- JptResourceType resourceType,
- String mappingKey,
- Composite parent,
- PropertyValueModel<TypeMapping> mappingHolder,
- WidgetFactory widgetFactory);
-
- DefaultMappingUiDefinition<PersistentType, ? extends TypeMapping>
- getDefaultTypeMappingUiDefinition(JptResourceType resourceType);
-
- Iterator<MappingUiDefinition<PersistentType, ? extends TypeMapping>>
- typeMappingUiDefinitions(JptResourceType resourceType);
-
-
- // ********** attribute mappings **********
-
- JpaComposite buildAttributeMappingComposite(
- JptResourceType resourceType,
- String mappingKey,
- Composite parent,
- PropertyValueModel<AttributeMapping> mappingHolder,
- WidgetFactory widgetFactory);
-
- DefaultMappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>
- getDefaultAttributeMappingUiDefinition(JptResourceType resourceType, String mappingKey);
-
- Iterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>>
- attributeMappingUiDefinitions(JptResourceType resourceType);
-
- // ********** metadata conversion **********
-
- void convertJavaQueryMetadataToGlobal(JpaProject project);
-
- void convertJavaGeneratorMetadataToGlobal(JpaProject project);
-
- // ********** entity generation **********
-
- void generateEntities(JpaProject project, IStructuredSelection selection);
-
-
- // ********** DDL generation **********
-
- void generateDDL(JpaProject project, IStructuredSelection selection);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUiFactory.java
deleted file mode 100644
index 02efd79aae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUiFactory.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-/**
- * This interface is to be implemented by a JPA vendor to build a JpaPlatformUi.
- *
- * See the extension point: org.eclipse.jpt.jpa.ui.jpaPlatform
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaPlatformUiFactory
-{
- JpaPlatformUi buildJpaPlatformUi();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUiProvider.java
deleted file mode 100644
index a1a064d1b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-
-/**
- * This interface is to be implemented by a JPA vendor to provide extensions to
- * JPA UI functionality. This is intended to work in conjunction with a core
- * JPA platform ({@link JpaPlatform}) implementation with the same ID.
- * <p>
- * Any implementation should be <em>stateless</em> in nature.
- * <p>
- * The "generic" extension supplies UI for the core platform extension with the same
- * ID.
- *
- * See the extension point: org.eclipse.jpt.jpa.ui.jpaPlatformUis
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaPlatformUiProvider
-{
- /**
- * Return the details providers that apply to this platform.
- */
- ListIterator<JpaDetailsProvider> detailsProviders();
-
- /**
- * Return the resource ui definitions that apply to this platform.
- */
- ListIterator<ResourceUiDefinition> resourceUiDefinitions();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectModel.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectModel.java
deleted file mode 100644
index af63d17873..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectModel.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-
-/**
- * Standard adapter for retrieving a {@link JpaProject JPA project} model
- * with change notification when the JPA project is created or destroyed:
- * <pre>
- * IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("Foo Project");
- * JpaProjectModel jpaProjectModel = (JpaProjectModel) project.getAdapter(JpaProjectModel.class);
- * JpaProject jpaProject = jpaProjectModel.getValue();
- * </pre>
- * @see org.eclipse.jpt.jpa.ui.internal.ProjectAdapterFactory
- */
-public interface JpaProjectModel
- extends PropertyValueModel<JpaProject>
-{
- /**
- * Return the project corresponding to the JPA project model.
- */
- IProject getProject();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectsModel.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectsModel.java
deleted file mode 100644
index 33a8a50325..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaProjectsModel.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-
-/**
- * Standard adapter for retrieving a model of a workspace's
- * {@link JpaProject JPA project}s
- * with change notification when the model changes:
- * <pre>
- * IWorkspace workspace = ResourcesPlugin.getWorkspace();
- * JpaProjectsModel jpaProjectsModel = (JpaProjectsModel) workspace.getAdapter(JpaProjectsModel.class);
- * </pre>
- * @see org.eclipse.jpt.jpa.ui.internal.WorkspaceAdapterFactory
- */
-public interface JpaProjectsModel
- extends CollectionValueModel<JpaProject>
-{
- /**
- * Return the workspace corresponding to the JPA projects model.
- */
- IWorkspace getWorkspace();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaRootContextNodeModel.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaRootContextNodeModel.java
deleted file mode 100644
index e5553618b0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JpaRootContextNodeModel.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-
-/**
- * Standard adapter for retrieving a {@link JpaRootContextNode JPA root
- * context node} model with change notification when the JPA root context
- * node is created or destroyed:
- * <pre>
- * IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject("Foo Project");
- * JpaRootContextNodeModel jpaRootContextNodeModel = (JpaJpaRootContextNodeModel) project.getAdapter(JpaJpaRootContextNodeModel.class);
- * JpaRootContextNode jpaRootContextNode = jpaRootContextNodeModel.getValue();
- * </pre>
- * @see org.eclipse.jpt.jpa.ui.internal.ProjectAdapterFactory
- */
-public interface JpaRootContextNodeModel
- extends PropertyValueModel<JpaRootContextNode>
-{
- /**
- * Return the project corresponding to the JPA root context model.
- */
- IProject getProject();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JptJpaUiPlugin.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JptJpaUiPlugin.java
deleted file mode 100644
index e3d955da9f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/JptJpaUiPlugin.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jpt.common.utility.internal.AbstractBooleanReference;
-import org.eclipse.jpt.jpa.core.JpaProjectManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * Dali UI plug-in.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-@SuppressWarnings("nls")
-public class JptJpaUiPlugin
- extends AbstractUIPlugin
-{
- /**
- * @see #focusIn(Control)
- */
- private final AsyncEventListenerFlag asyncEventListenerFlag = new AsyncEventListenerFlag();
- private final Listener focusListener;
-
-
- // ********** constants **********
-
- /**
- * The plug-in identifier of JPA UI support (value {@value}).
- */
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.ui";
- public static final String PLUGIN_ID_ = PLUGIN_ID + '.';
-
- private static final String DALI_UI_KEY = PLUGIN_ID;
- private static final Object DALI_UI_DATA = new Object();
-
-
- // ********** Preference keys **********
- /**
- * The preference key used to retrieve the case used for JPQL identifiers.
- * @deprecated - Use JpaJpqlPreferencesManager instead
- */
- @Deprecated
- public static final String JPQL_IDENTIFIER_CASE_PREF_KEY = PLUGIN_ID + ".jpqlIdentifier.case";
- @Deprecated
- public static final String JPQL_IDENTIFIER_LOWERCASE_PREF_VALUE = "lowercase";
- @Deprecated
- public static final String JPQL_IDENTIFIER_UPPERCASE_PREF_VALUE = "uppercase";
- @Deprecated
- public static final String JPQL_IDENTIFIER_MATCH_FIRST_CHARACTER_CASE_PREF_KEY = PLUGIN_ID + ".jpqlIdentifier.matchFirstCharacterCase";
-
-
- // ********** singleton **********
-
- private static JptJpaUiPlugin INSTANCE;
-
- /**
- * Returns the singleton JPT UI plug-in.
- */
- public static JptJpaUiPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** logging **********
-
- /**
- * Log the specified message.
- */
- public static void log(String msg) {
- log(msg, null);
- }
-
- /**
- * Log the specified exception or error.
- */
- public static void log(Throwable throwable) {
- log(throwable.getLocalizedMessage(), throwable);
- }
-
- /**
- * Log the specified message and exception or error.
- */
- public static void log(String msg, Throwable throwable) {
- log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, msg, throwable));
- }
-
- /**
- * Log the specified status.
- */
- public static void log(IStatus status) {
- INSTANCE.getLog().log(status);
- }
-
-
- // ********** images **********
-
- /**
- * Return an image descriptor for the specified <code>.gif<code>
- * file in the icons folder.
- */
- public static ImageDescriptor getImageDescriptor(String key) {
- if ( ! key.startsWith("icons/")) {
- key = "icons/" + key;
- }
- if ( ! key.endsWith(".gif")) {
- key = key + ".gif";
- }
- return imageDescriptorFromPlugin(PLUGIN_ID, key);
- }
-
- /**
- * Return an image for the specified <code>.gif<code>
- * file in the icons folder.
- */
- //TODO we are using the ImageRegistry here and storing all our icons for the life of the plugin,
- //which means until the workspace is closed. This is better than before where we constantly
- //created new images. Bug 306437 is about cleaning this up and using Local Resource Managers
- //on our views so that closing the JPA perspective would mean our icons are disposed.
- public static Image getImage(String key) {
- ImageRegistry imageRegistry = instance().getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
-
- // ********** construction **********
-
- public JptJpaUiPlugin() {
- super();
- this.focusListener = this.buildFocusListener();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- INSTANCE = this;
- }
-
- /**
- * We are registered to receive only {@link SWT#FocusIn} events
- */
- private Listener buildFocusListener() {
- return new Listener() {
- public void handleEvent(Event event) {
- JptJpaUiPlugin.this.focusIn((Control) event.widget);
- }
- };
- }
-
-
- // ********** focus handling **********
-
- /**
- * This method is called whenever a {@link SWT#FocusIn} event is generated.
- * <p>
- * If the control gaining focus is part of one the Dali composites
- * (typically the JPA Details View), we deactivate the Dali Java change
- * listener so we ignore any changes to the Java source code that probably
- * originated from Dali. This means we will miss any changes to the Java
- * source code that is caused by non-UI activity; but, we hope, these
- * changes are unrelated to JPA annotations etc.
- * <p>
- * If the control gaining focus is <em>not</em> part of one of the Dali
- * composites, we start listening to the Java change events again. This
- * method is called whenever a non-Dali UI control gains the UI focus. When
- * this happens we activate the Dali Java change listener so that we begin
- * to keep the Dali model synchronized with the Java source code.
- */
- /* CU private */ void focusIn(Control control) {
- this.asyncEventListenerFlag.setValue(this.controlIsNonDali(control));
- }
-
- /**
- * Return whether the specified control is <em><b>neither</b></em>
- * a Dali UI component <em><b>nor</b></em> contained by a Dali UI component.
- */
- private boolean controlIsNonDali(Control control) {
- return ! this.controlIsDali(control);
- }
-
- /**
- * Return whether the specified control, or any of its ancestors, is a Dali
- * UI component.
- *
- * @see #controlAffectsJavaSource(Control)
- */
- private boolean controlIsDali(Control control) {
- while (control != null) {
- if (control.getData(DALI_UI_KEY) == DALI_UI_DATA) {
- return true;
- }
- control = control.getParent();
- }
- return false;
- }
-
- /**
- * Tag the specified control so that whenever it (or any of its descendants)
- * has the focus, the Dali model ignores any Java change events. This method
- * is to be called when the control is first constructed.
- *
- * @see #controlIsDali(Control)
- */
- public void controlAffectsJavaSource(Control control) {
- control.setData(DALI_UI_KEY, DALI_UI_DATA);
- }
-
-
- // ********** plug-in implementation **********
-
- /**
- * Register our SWT listener with the display so we receive notification
- * of every "focus in" event.
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- this.getJpaProjectManager().addAsyncEventListenerFlag(this.asyncEventListenerFlag);
- Display.getDefault().addFilter(SWT.FocusIn, this.focusListener);
- }
-
- private JpaProjectManager getJpaProjectManager() {
- return (JpaProjectManager) ResourcesPlugin.getWorkspace().getAdapter(JpaProjectManager.class);
- }
-
- /**
- * Unregister our SWT listener with the display.
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- try {
- Display.getDefault().removeFilter(SWT.FocusIn, this.focusListener);
- this.getJpaProjectManager().removeAsyncEventListenerFlag(this.asyncEventListenerFlag);
- } finally {
- super.stop(context);
- }
- }
-
-
- /**
- * This flag's value depends on the current thread. If the current thread is
- * the background Java Reconciler thread, the flag's value is determined by
- * the current UI focus (i.e. whether the focus is somewhere other than a
- * Dali view); otherwise the flag's value is <code>true</code>.
- * In other words, if a Dali view has the focus and a Java event is fired
- * on the Java Reconciler thread, the event is ignored; if the event is
- * fired on some other thread (typically synchronously on the Main thread),
- * the event is forwarded to the JPA projects.
- */
- /* CU private */ static class AsyncEventListenerFlag
- extends AbstractBooleanReference
- {
- private volatile boolean value = true;
-
- @SuppressWarnings("restriction")
- private static final String JAVA_RECONCILER_THREAD_NAME = org.eclipse.jdt.internal.ui.text.JavaReconciler.class.getName();
-
- AsyncEventListenerFlag() {
- super();
- }
-
- public boolean getValue() {
- if (Thread.currentThread().getName().equals(JAVA_RECONCILER_THREAD_NAME)) {
- return this.value;
- }
- return true;
- }
-
- public boolean setValue(boolean value) {
- boolean old = this.value;
- this.value = value;
- return old;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/MappingResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/MappingResourceUiDefinition.java
deleted file mode 100644
index 3f18490732..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/MappingResourceUiDefinition.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import java.util.Iterator;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface MappingResourceUiDefinition extends ResourceUiDefinition
-{
- /**
- *
- */
- JpaComposite buildAttributeMappingComposite(
- String key,
- PropertyValueModel<AttributeMapping> mappingHolder,
- Composite parent, WidgetFactory widgetFactory);
-
- /**
- * Return an iterator of attribute mapping ui definitions appropriate for this file type
- */
- Iterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>>
- attributeMappingUiDefinitions();
-
- /**
- * Return a default attribute mapping ui definition for the given key or null
- */
- DefaultMappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>
- getDefaultAttributeMappingUiDefinition(String key);
-
- /**
- *
- */
- JpaComposite buildTypeMappingComposite(
- String key,
- PropertyValueModel<TypeMapping> mappingHolder,
- Composite parent, WidgetFactory widgetFactory);
-
- /**
- *
- */
- Iterator<MappingUiDefinition<PersistentType, ? extends TypeMapping>>
- typeMappingUiDefinitions();
-
- /**
- * Return a default type mapping ui provider or null
- */
- DefaultMappingUiDefinition<PersistentType, ? extends TypeMapping>
- getDefaultTypeMappingUiDefinition();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/PersistenceXmlResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/PersistenceXmlResourceUiDefinition.java
deleted file mode 100644
index c1d4ab6225..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/PersistenceXmlResourceUiDefinition.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface PersistenceXmlResourceUiDefinition extends ResourceUiDefinition
-{
- ListIterator<JpaPageComposite> buildPersistenceUnitComposites(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/ResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/ResourceUiDefinition.java
deleted file mode 100644
index fb55b620d5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/ResourceUiDefinition.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-
-/**
- * Resource UI definition.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface ResourceUiDefinition {
- /**
- * Return whether the definition provides UI for resource of the specified
- * type.
- */
- boolean providesUi(JptResourceType resourceType);
-
- /**
- * Return the resource definition's JPA Structure View factory provider.
- * This is used by the view to build and maintain its tree's content and
- * labels.
- */
- ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/DefaultMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/DefaultMappingUiDefinition.java
deleted file mode 100644
index 1706c2a908..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/DefaultMappingUiDefinition.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DefaultMappingUiDefinition<M, T>
- extends MappingUiDefinition<M, T>
-{
- /**
- * Returns a unique string that corresponds to the key of the mapping in the
- * core. For a default mapping the method getKey() will return null since
- * that is for the specified mapping. This will return the default mapping key, not null
- */
- String getDefaultKey();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaComposite.java
deleted file mode 100644
index 45a34c1b6c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details;
-
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A {@link JpaComposite} defines the common behavior of the JPA related
- * widgets.
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaComposite {
-
- /**
- * Returns the actual <code>Composite</code>.
- *
- * @return This composite's actual widget
- */
- Control getControl();
-
- /**
- * Changes the enablement state of the widgets of this pane.
- *
- * @param enabled <code>true</code> to enable the widgets or <code>false</code>
- * to disable them
- */
- void enableWidgets(boolean enabled);
-
- /**
- * Notifies this composite it should dispose any resources.
- */
- void dispose();
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsPageManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsPageManager.java
deleted file mode 100644
index 131c54f36a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsPageManager.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * A details page manager is used to display the property page for a structure
- * node. The {@link JpaDetailsProvider} is responsible for creating the manager.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @param <T> the type of the details page manager's model
- *
- * @version 2.0
- * @since 2.0
- * @see JpaDetailsProvider
- */
-public interface JpaDetailsPageManager<T extends JpaStructureNode> {
- /**
- * Return the details page manager's page.
- */
- Control getPage();
-
- /**
- * Return the details page manager's subject.
- */
- T getSubject();
-
- /**
- * Set the details page manager's subject.
- * The subject must be of type <code>T</code>.
- */
- void setSubject(Object subject);
-
- /**
- * Dispose the details page manager and any resources it holds.
- */
- void dispose();
-
- interface Factory {
- <T extends JpaStructureNode> JpaDetailsPageManager<T> buildPageManager(Composite parent, WidgetFactory widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsProvider.java
deleted file mode 100644
index e9427862c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaDetailsProvider.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPageManager}
- * responsible for showing the information for a structure node ID.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- *
- * @version 3.0
- * @since 2.0
- *
- * @see JpaDetailsPageManager
- */
-public interface JpaDetailsProvider {
- /**
- * Return whether the provider can build a details page manager for the
- * specified JPA structure node.
- */
- boolean providesDetails(JpaStructureNode structureNode);
-
- /**
- * Build a new details page manager with the specified parent and widget
- * factory.
- */
- // TODO pass in JpaUiFactory so these pages can be built using the factory and overridden?
- JpaDetailsPageManager<? extends JpaStructureNode> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaPageComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaPageComposite.java
deleted file mode 100644
index 7a28e81d88..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/JpaPageComposite.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-
-/**
- * A {@link JpaPageComposite} defines the common behavior of the JPA
- * related widgets that is shown as a page within an editor.
- * <p>
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JpaPageComposite extends JpaComposite {
-
- /**
- * Returns the help ID. This ID will be used if the help button is invoked.
- *
- * @return Either the help ID of this page or <code>null</code> if no help
- * is required
- */
- String getHelpID();
-
- /**
- * The image of the tab showing this page.
- *
- * @return The page's image
- */
- ImageDescriptor getPageImageDescriptor();
-
- /**
- * The text of the tab showing this page.
- *
- * @return The page's text
- */
- String getPageText();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java
deleted file mode 100644
index 01d27f0444..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/MappingUiDefinition.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details;
-
-import org.eclipse.swt.graphics.Image;
-
-/**
- * A UI provider is responsible to provide the support for displaying the
- * information for a certain mapping type.
- *
- * T represents the type of the mapping the definition represents
- * M represents the type of the object being mapped
- *
- * @version 2.3
- * @since 2.0
- *
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface MappingUiDefinition<M, T>
-{
- /**
- * Returns a unique string that corresponds to the key of the mapping in the
- * core (JavaAttributeMappingDefinition and/or OrmAttributeMappingProvider).
- *
- * @return The key representing the mapping
- */
- String getKey();
-
- /**
- * Returns a human readable text of the mapping type.
- *
- * @return A display string for the mapping type
- */
- String getLabel();
-
- /**
- * Returns a human readable text of the mapping type to be used in the mapping change link label
- */
- String getLinkLabel();
-
- /**
- * Returns an image that represents the mapping type defined by this provider.
- *
- * @return An image representing a mapping or <code>null</code> if no image
- * is required
- */
- Image getImage();
-
- /**
- * Return whether the mapping type represented by this definition is enabled for the given
- * mappable object. This is almost always true.
- */
- // TODO bjv remove this; either
- // - delegate to whatever controls the list of UI definitions so it can be overridden by EclipseLink
- // or
- // - delegate to the model definitions (if we think there are more extends that need this...)
- boolean isEnabledFor(M mappableObject);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaAttributeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaAttributeMappingUiDefinition.java
deleted file mode 100644
index 98f781bea6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaAttributeMappingUiDefinition.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details.java;
-
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DefaultJavaAttributeMappingUiDefinition<T extends AttributeMapping>
- extends JavaAttributeMappingUiDefinition<T>, DefaultMappingUiDefinition<ReadOnlyPersistentAttribute, T>
-{
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaTypeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaTypeMappingUiDefinition.java
deleted file mode 100644
index 0336b9e18d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/DefaultJavaTypeMappingUiDefinition.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details.java;
-
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface DefaultJavaTypeMappingUiDefinition<T extends TypeMapping>
- extends JavaTypeMappingUiDefinition<T>, DefaultMappingUiDefinition<PersistentType, T>
-{
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaAttributeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaAttributeMappingUiDefinition.java
deleted file mode 100644
index eca73a692a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaAttributeMappingUiDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaAttributeMappingUiDefinition<T extends AttributeMapping>
- extends MappingUiDefinition<ReadOnlyPersistentAttribute, T>
-{
- /**
- * Creates <code>JpaComposite</code> that corresponds to this mapping type.
- * This will be displayed by the <code>PersistentAttributeDetailsPage</code>
- * when the mapping key matches the key given by this provider. The
- * composites will be stored in a Map with the mapping key as the key.
- *
- * @param factory The UI factory responsible to create the right composite
- * for any mapping type
- * @param subjectHolder The holder of the subject being displayed
- * @param parent The parent container
- * @param widgetFactory The factory used to create the various widgets
- * @return The composite displaying the information for a certain mapping
- */
- JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaTypeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaTypeMappingUiDefinition.java
deleted file mode 100644
index 9583a4809f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaTypeMappingUiDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface JavaTypeMappingUiDefinition<T extends TypeMapping>
- extends MappingUiDefinition<PersistentType, T>
-{
- /**
- * Creates <code>JpaComposite</code> that corresponds to this mapping type.
- * This will be displayed by the <code>PersistentTypeDetailsPage</code> when
- * the mapping key matches the key given by this provider. The composites
- * will be stored in a Map with the mapping key as the key.
- *
- * @param factory The UI factory responsible to create the right composite
- * for any mapping type
- * @param subjectHolder The holder of the subject being displayed
- * @param parent The parent container
- * @param widgetFactory The factory used to create the various widgets
- * @return The composite displaying the information for a certain mapping
- */
- JpaComposite buildTypeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaUiFactory.java
deleted file mode 100644
index f3f86666af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/java/JavaUiFactory.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Use {@link JavaUiFactory} to create any java JPA composites
- * <p>
- * Provisional API: This interface is part of an interim API that is still under
- * development and expected to change significantly before reaching stability.
- * It is available at this early stage to solicit feedback from pioneering
- * adopters on the understanding that any code that uses this API will almost
- * certainly be broken (repeatedly) as the API evolves.
- *
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaUiFactory
-{
-
- // **************** java type mapping composites ***************************
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaMappedSuperclass</code>.
- *
- * @param subjectHolder The holder of the mapped superclass
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>JavaEntity</code>.
- *
- * @param subjectHolder The holder of the java entity
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaEmbeddable</code>.
- *
- * @param subjectHolder The holder of the embeddable
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaEmbeddableComposite(
- PropertyValueModel<JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
-
- // **************** orm type mapping composites ****************************
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmMappedSuperclass</code>.
- *
- * @param subjectHolder The holder of the mapped superclass
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmEntity</code>.
- *
- * @param subjectHolder The holder of the orm entity
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmEmbeddable</code>.
- *
- * @param subjectHolder The holder of the embeddable
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmEmbeddableComposite(
- PropertyValueModel<OrmEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
-
- // **************** java attribute mapping composites **********************
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaIdMapping</code>.
- *
- * @param subjectHolder The holder of the ID mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaIdMappingComposite(
- PropertyValueModel<JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaEmbeddedIdMapping</code>.
- *
- * @param subjectHolder The holder of the embedded ID mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaEmbeddedIdMappingComposite(
- PropertyValueModel<JavaEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaBasicMapping</code>.
- *
- * @param subjectHolder The holder of the basic mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaBasicMappingComposite(
- PropertyValueModel<JavaBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaVersionMapping</code>.
- *
- * @param subjectHolder The holder of the version mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaVersionMappingComposite(
- PropertyValueModel<JavaVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaManyToOneMapping</code>.
- *
- * @param subjectHolder The holder of the many to one mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaManyToOneMappingComposite(
- PropertyValueModel<JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaOneToManyMapping</code>.
- *
- * @param subjectHolder The holder of the one to many mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaOneToManyMappingComposite(
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaOneToOneMapping</code>.
- *
- * @param subjectHolder The holder of the one to one mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaOneToOneMappingComposite(
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaManyToManyMapping</code>.
- *
- * @param subjectHolder The holder of the many to many mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaManyToManyMappingComposite(
- PropertyValueModel<JavaManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaEmbeddedMapping</code>.
- *
- * @param subjectHolder The holder of the embedded mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaEmbeddedMappingComposite(
- PropertyValueModel<JavaEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit a <code>JavaTransientMapping</code>.
- *
- * @param subjectHolder The holder of the transient mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createJavaTransientMappingComposite(
- PropertyValueModel<JavaTransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmAttributeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmAttributeMappingUiDefinition.java
deleted file mode 100644
index 2c5861fbe6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmAttributeMappingUiDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmAttributeMappingUiDefinition<T extends AttributeMapping>
- extends MappingUiDefinition<ReadOnlyPersistentAttribute, T>
-{
- /**
- * Creates <code>JpaComposite</code> that corresponds to this mapping type.
- * This will be displayed by the <code>PersistentAttributeDetailsPage</code>
- * when the mapping key matches the key given by this provider. The
- * composites will be stored in a Map with the mapping key as the key.
- *
- * @param factory The UI factory responsible to create the right composite
- * for any mapping type
- * @param subjectHolder The holder of the subject being displayed
- * @param parent The parent container
- * @param widgetFactory The factory used to create the various widgets
- * @return The composite displaying the information for a certain mapping
- */
- JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmTypeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmTypeMappingUiDefinition.java
deleted file mode 100644
index f9f918bb6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmTypeMappingUiDefinition.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Provisional API: This interface is part of an interim API that is still
- * under development and expected to change significantly before reaching
- * stability. It is available at this early stage to solicit feedback from
- * pioneering adopters on the understanding that any code that uses this API
- * will almost certainly be broken (repeatedly) as the API evolves.
- */
-public interface OrmTypeMappingUiDefinition<T extends TypeMapping>
- extends MappingUiDefinition<PersistentType, T>
-{
- /**
- * Creates <code>JpaComposite</code> that correponds to this mapping type.
- * This will be displayed by the <code>PersistentTypeDetailsPage</code> when
- * the mapping key matches the key given by this provider. The composites
- * will be stored in a Map with the mapping key as the key.
- *
- * @param factory The UI factory responsible to create the right composite
- * for any mapping type
- * @param subjectHolder The holder of the subject being displayed
- * @param parent The parent container
- * @param widgetFactory The factory used to create the various widgets
- * @return The composite displaying the information for a certain mapping
- */
- JpaComposite buildTypeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmXmlUiFactory.java
deleted file mode 100644
index 6c1eaf975e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/details/orm/OrmXmlUiFactory.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Use {@link OrmXmlUiFactory} to create any ORM JPA composites
- * <p>
- * Provisional API: This interface is part of an interim API that is still under
- * development and expected to change significantly before reaching stability.
- * It is available at this early stage to solicit 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.jpa.ui.internal.BaseJpaUiFactory
- *
- * @version 2.0
- * @since 1.0
- */
-public interface OrmXmlUiFactory
-{
-
- // **************** orm type mapping composites ****************************
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmMappedSuperclass</code>.
- *
- * @param subjectHolder The holder of the mapped superclass
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmEntity</code>.
- *
- * @param subjectHolder The holder of the orm entity
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmEmbeddable</code>.
- *
- * @param subjectHolder The holder of the embeddable
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmEmbeddableComposite(
- PropertyValueModel<OrmEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
-
- // **************** orm attribute mapping composites ***********************
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmIdMapping</code>.
- *
- * @param subjectHolder The holder of the ID mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmIdMappingComposite(
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmEmbeddedIdMapping</code>.
- *
- * @param subjectHolder The holder of the embedded ID mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmEmbeddedIdMappingComposite(
- PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmBasicMapping</code>.
- *
- * @param subjectHolder The holder of the basic mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmBasicMappingComposite(
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmVersionMapping</code>.
- *
- * @param subjectHolder The holder of the version mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmVersionMappingComposite(
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmManyToOneMapping</code>.
- *
- * @param subjectHolder The holder of the many to one mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmManyToOneMappingComposite(
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmOneToManyMapping</code>.
- *
- * @param subjectHolder The holder of the one to many mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmOneToManyMappingComposite(
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmOneToOneMapping</code>.
- *
- * @param subjectHolder The holder of the one to one mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmOneToOneMappingComposite(
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmManyToManyMapping</code>.
- *
- * @param subjectHolder The holder of the many to many mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmManyToManyMappingComposite(
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmEmbeddedMapping</code>.
- *
- * @param subjectHolder The holder of the embedded mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmEmbeddedMappingComposite(
- PropertyValueModel<OrmEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
- /**
- * Creates a new <code>JpaComposite</code> used to edit an <code>OrmTransientMapping</code>.
- *
- * @param subjectHolder The holder of the transient mapping
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- JpaComposite createOrmTransientMappingComposite(
- PropertyValueModel<OrmTransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractJpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractJpaPlatformUiProvider.java
deleted file mode 100644
index a2d20f16ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractJpaPlatformUiProvider.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayListIterator;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-
-/**
- * All the state in the JPA platform ui provider should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public abstract class AbstractJpaPlatformUiProvider implements JpaPlatformUiProvider
-{
- private JpaDetailsProvider[] detailsProviders;
-
- private ResourceUiDefinition[] resourceUiDefinitions;
-
- /**
- * zero-argument constructor
- */
- public AbstractJpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- public ListIterator<JpaDetailsProvider> detailsProviders() {
- return new ArrayListIterator<JpaDetailsProvider>(getDetailsProviders());
- }
-
- protected synchronized JpaDetailsProvider[] getDetailsProviders() {
- if (this.detailsProviders == null) {
- this.detailsProviders = this.buildDetailsProviders();
- }
- return this.detailsProviders;
- }
-
- protected JpaDetailsProvider[] buildDetailsProviders() {
- ArrayList<JpaDetailsProvider> providers = new ArrayList<JpaDetailsProvider>();
- this.addDetailsProvidersTo(providers);
- return providers.toArray(new JpaDetailsProvider[providers.size()]);
- }
-
- /**
- * Implement this to specify JPA details providers.
- */
- protected abstract void addDetailsProvidersTo(List<JpaDetailsProvider> providers);
-
-
-
- // ********** structure providers **********
-
- public ListIterator<ResourceUiDefinition> resourceUiDefinitions() {
- return new ArrayListIterator<ResourceUiDefinition>(getResourceUiDefinitions());
- }
-
- protected synchronized ResourceUiDefinition[] getResourceUiDefinitions() {
- if (this.resourceUiDefinitions == null) {
- this.resourceUiDefinitions = this.buildResourceUiDefinitions();
- }
- return this.resourceUiDefinitions;
- }
-
- protected ResourceUiDefinition[] buildResourceUiDefinitions() {
- ArrayList<ResourceUiDefinition> definitions = new ArrayList<ResourceUiDefinition>();
- this.addResourceUiDefinitionsTo(definitions);
- return definitions.toArray(new ResourceUiDefinition[definitions.size()]);
- }
-
- /**
- * Implement this to specify JPA mapping file ui definitions.
- */
- protected abstract void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions);
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractJpaXmlCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractJpaXmlCompletionProposalComputer.java
deleted file mode 100644
index a9d707f07e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/AbstractJpaXmlCompletionProposalComputer.java
+++ /dev/null
@@ -1,1097 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.jpa.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import java.util.Vector;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.StructuredModelManager;
-import org.eclipse.wst.sse.core.internal.provisional.IStructuredModel;
-import org.eclipse.wst.sse.core.internal.provisional.IndexedRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocument;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegionContainer;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
-import org.eclipse.wst.sse.ui.internal.contentassist.ContentAssistUtils;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMModel;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.core.internal.regions.DOMRegionContext;
-import org.eclipse.wst.xml.ui.internal.Logger;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * <p>Implements the framework for making proposals in XML type documents. Deals with
- * all the nastiness needed to figure out where in an XML type document the content
- * assist was invoked and then calls one of many abstract methods depending on the
- * area the content assist was invoked. In this way implementers only have to worry about
- * implementing what to do in each situation while not having to deal with figuring out
- * which situation the content assist was invoked in.</p>
- *
- * @base org.eclipse.wst.xml.ui.internal.contentassist.AbstractContentAssistProcessor
- * @see DefaultJpaXmlCompletionProposalComputer
- *
- * The code of this class was copied from AbstractXMLCompletionProposalComputer and modified according to
- * the needs of the XML content assist of Dali. This class can be removed after bug 371939 is addressed.
- */
-
-public abstract class AbstractJpaXmlCompletionProposalComputer implements ICompletionProposalComputer {
-
- private String fErrorMessage;
- private ITextViewer fTextViewer;
-
- public AbstractJpaXmlCompletionProposalComputer() {
- fErrorMessage = null;
- fTextViewer = null;
- }
-
- /**
- * <p>Return a list of proposed code completions based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text-editor control.</p>
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeCompletionProposals(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List<ICompletionProposal> computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- ITextViewer textViewer = context.getViewer();
- int documentPosition = context.getInvocationOffset();
-
- setErrorMessage(null);
-
- fTextViewer = textViewer;
-
- IndexedRegion treeNode = ContentAssistUtils.getNodeAt(textViewer, documentPosition);
-
- Node node = (Node) treeNode;
- while ((node != null) && (node.getNodeType() == Node.TEXT_NODE) && (node.getParentNode() != null)) {
- node = node.getParentNode();
- }
- IDOMNode xmlnode = (IDOMNode) node;
-
- ContentAssistRequest contentAssistRequest = null;
-
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- ITextRegion completionRegion = getCompletionRegion(documentPosition, node);
-
- String matchString = null;
- try {
- matchString = getMatchString(sdRegion, completionRegion, documentPosition);
- } catch (BadLocationException e) {
- e.printStackTrace();
- }
-
- // Handle empty Documents
- if (completionRegion == null) {
- if (((treeNode == null) || (((Node) treeNode).getNodeType() == Node.DOCUMENT_NODE)) && (completionRegion == null) &&
- ((xmlnode == null) || (xmlnode.getChildNodes() == null) || (xmlnode.getChildNodes().getLength() == 0))) {
-
- IStructuredModel sModel = null;
- try {
- if(textViewer.getDocument() instanceof IStructuredDocument) {
- sModel = StructuredModelManager.getModelManager().getModelForRead((IStructuredDocument)textViewer.getDocument());
- }
- if (sModel != null) {
- IDOMDocument docNode = ((IDOMModel) sModel).getDocument();
- contentAssistRequest = new ContentAssistRequest(docNode, docNode, sdRegion, completionRegion, documentPosition, 0, null);
- addEmptyDocumentProposals(contentAssistRequest, context);
- }
- }
- finally {
- if (sModel != null) {
- sModel.releaseFromRead();
- }
- }
- if (contentAssistRequest == null) {
- Logger.logException(new IllegalStateException("problem getting model")); //$NON-NLS-1$
- return new ArrayList<ICompletionProposal>(0);
- }
-
- ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
- return (props != null) ? Arrays.asList(props) : new ArrayList<ICompletionProposal>(0);
- }
- // MASSIVE ERROR CONDITION
- Logger.logException(new IllegalStateException("completion region was null")); //$NON-NLS-1$
- setErrorMessage(XMLUIMessages.SEVERE_internal_error_occu_UI_);
- contentAssistRequest = new ContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
- ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
- return (props != null) ? Arrays.asList(props) : new ArrayList<ICompletionProposal>(0);
- }
-
-
- // catch documents where no region can be determined
- if ((xmlnode.getNodeType() == Node.DOCUMENT_NODE) && ((completionRegion == null) ||
- (xmlnode.getChildNodes() == null) || (xmlnode.getChildNodes().getLength() == 0))) {
-
- contentAssistRequest = computeStartDocumentProposals(matchString, completionRegion,
- (IDOMNode) treeNode,xmlnode, context);
- ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
- return (props != null) ? Arrays.asList(props) : new ArrayList<ICompletionProposal>(0);
- }
-
- // compute normal proposals
- contentAssistRequest = computeCompletionProposals(matchString, completionRegion, (IDOMNode) treeNode, xmlnode, context);
- if (contentAssistRequest == null) {
- contentAssistRequest = new ContentAssistRequest((Node) treeNode, node.getParentNode(), sdRegion, completionRegion, documentPosition, 0, ""); //$NON-NLS-1$
- setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
- }
-
- /*
- * Only set this error message if nothing else was already set
- **/
- if (contentAssistRequest.getProposals().size() == 0 && getErrorMessage() == null) {
- setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
- }
-
- ICompletionProposal[] props = contentAssistRequest.getCompletionProposals();
- return (props != null) ? Arrays.asList(props) : new ArrayList<ICompletionProposal>(0);
- }
-
- /**
- * <p>Returns information about possible contexts based on the specified
- * location within the document that corresponds to the current cursor
- * position within the text viewer.</p>
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#computeContextInformation(org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext, org.eclipse.core.runtime.IProgressMonitor)
- */
- public List<ICompletionProposal> computeContextInformation(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- //no default context info
- return Collections.emptyList();
- }
-
- /**
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#getErrorMessage()
- */
- public String getErrorMessage() {
- return fErrorMessage;
- }
-
- /**
- * Add proposals for attribute names
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addAttributeNameProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add proposals for attribute values
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addAttributeValueProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add comment proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addCommentProposal(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add the proposals for a completely empty document
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addEmptyDocumentProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add the proposals for the name in an end tag
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addEndTagNameProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Prompt for end tags to a non-empty Node that hasn't ended Handles these
- * cases: <br>
- * <tagOpen>| <br>
- * <tagOpen>< |<br>
- * <tagOpen></ |
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addEndTagProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add entity proposals
- *
- * @param contentAssistRequest
- * @param completionRegion
- * @param treeNode
- * @param context
- */
- protected abstract void addEntityProposals(ContentAssistRequest contentAssistRequest,
- ITextRegion completionRegion, IDOMNode treeNode, CompletionProposalInvocationContext context);
-
- /**
- * add entity proposals
- *
- * @param proposals
- * @param map
- * @param key
- * @param nodeOffset
- * @param sdRegion
- * @param completionRegion
- * @param context
- */
- protected abstract void addEntityProposals(Vector<ICompletionProposal> proposals, Properties map, String key,
- int nodeOffset, IStructuredDocumentRegion sdRegion, ITextRegion completionRegion,
- CompletionProposalInvocationContext context);
-
- /**
- * Add PCData proposals
- *
- * @param nodeName
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addPCDATAProposal(String nodeName, ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add start document proposals
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addStartDocumentProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Close an unclosed start tag
- *
- * @param contentAssistRequest
- * @param context
- */
- protected abstract void addTagCloseProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context);
-
- /**
- * Add tag insertion proposals
- *
- * @param contentAssistRequest
- * @param childPosition
- * @param context
- */
- protected abstract void addTagInsertionProposals(ContentAssistRequest contentAssistRequest,
- int childPosition, CompletionProposalInvocationContext context);
-
- /**
- * Add tag name proposals
- *
- * @param contentAssistRequest
- * @param childPosition
- * @param context
- */
- protected abstract void addTagNameProposals(ContentAssistRequest contentAssistRequest,
- int childPosition, CompletionProposalInvocationContext context);
-
- /**
- * @param errorMessage the reason why computeProposals was not able to find any
- * completions.
- */
- protected void setErrorMessage(String errorMessage) {
- fErrorMessage = errorMessage;
- }
-
- /**
- * <p>This does all the magic of figuring out where in the XML type document
- * the content assist was invoked and then calling the corresponding method
- * to add the correct proposals</p>
- *
- * <p><b>NOTE: </b>if overriding be sure to make super call back to this method otherwise
- * you will loose all of the proposals generated by this method</p>
- *
- * @param matchString
- * @param completionRegion
- * @param treeNode
- * @param xmlnode
- * @param context
- *
- * @return {@link ContentAssistRequest} that now has all the proposals in it
- */
- protected ContentAssistRequest computeCompletionProposals(String matchString, ITextRegion completionRegion,
- IDOMNode treeNode, IDOMNode xmlnode, CompletionProposalInvocationContext context) {
- int documentPosition = context.getInvocationOffset();
-
- ContentAssistRequest contentAssistRequest = null;
- String regionType = completionRegion.getType();
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
- // Handle the most common and best supported cases
- if ((xmlnode.getNodeType() == Node.ELEMENT_NODE) || (xmlnode.getNodeType() == Node.DOCUMENT_NODE)) {
- if (regionType == DOMRegionContext.XML_TAG_OPEN) {
- contentAssistRequest = computeTagOpenProposals(matchString, completionRegion, treeNode, xmlnode, context);
- }
- else if (regionType == DOMRegionContext.XML_TAG_NAME) {
- contentAssistRequest = computeTagNameProposals(matchString, completionRegion,
- treeNode, xmlnode, context);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_NAME) {
- contentAssistRequest = computeAttributeProposals(matchString, completionRegion, treeNode, xmlnode, context);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) {
- contentAssistRequest = computeEqualsProposals(matchString, completionRegion,
- treeNode, xmlnode, context);
- }
- else if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) && (documentPosition == sdRegion.getTextEndOffset()) &&
- (sdRegion.getText(completionRegion).endsWith("\"") || sdRegion.getText(completionRegion).endsWith("\'"))) { //$NON-NLS-1$ //$NON-NLS-2$
- // this is for when the cursor is at the end of the closing quote for an attribute..
- IDOMNode actualNode = (IDOMNode) xmlnode.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagCloseProposals(contentAssistRequest, context);
- }
- else if (regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) {
- contentAssistRequest = computeAttributeValueProposals(matchString, completionRegion, treeNode, xmlnode, context);
- }
- else if ((regionType == DOMRegionContext.XML_TAG_CLOSE) || (regionType == DOMRegionContext.XML_EMPTY_TAG_CLOSE)) {
-
- contentAssistRequest = computeTagCloseProposals(matchString, completionRegion, treeNode, xmlnode, context);
- }
- else if (regionType == DOMRegionContext.XML_END_TAG_OPEN) {
- contentAssistRequest = computeEndTagOpenProposals(matchString, completionRegion,
- treeNode, xmlnode, context);
- }
- else if ((regionType == DOMRegionContext.XML_CONTENT) || (regionType == DOMRegionContext.XML_CHAR_REFERENCE) ||
- (regionType == DOMRegionContext.XML_ENTITY_REFERENCE) || (regionType == DOMRegionContext.XML_PE_REFERENCE)) {
-
- contentAssistRequest = computeContentProposals(matchString, completionRegion,
- treeNode, xmlnode, context);
- }
-
- // These ITextRegion types begin DOM Elements as well and although
- // internally harder to assist, text insertions directly before them can be made
- else if ((documentPosition == sdRegion.getStartOffset(completionRegion)) &&
- ((regionType == DOMRegionContext.XML_DECLARATION_OPEN) ||
- (regionType == DOMRegionContext.XML_PI_OPEN) ||
- (regionType == DOMRegionContext.XML_COMMENT_OPEN) ||
- (regionType == DOMRegionContext.XML_CDATA_OPEN))) {
-
- contentAssistRequest = new ContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPosition(treeNode), context);
- addStartDocumentProposals(contentAssistRequest, context);
- }
- }
- // Not a Document or Element
- else if (isCloseRegion(completionRegion)) {
- contentAssistRequest = new ContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion) + completionRegion.getLength(), 0, matchString);
- addStartDocumentProposals(contentAssistRequest, context);
- if (documentPosition >= sdRegion.getTextEndOffset(completionRegion)) {
- addTagInsertionProposals(contentAssistRequest, getElementPosition(treeNode) + 1, context);
- }
- }
- else if ((documentPosition == sdRegion.getStartOffset(completionRegion)) &&
- ((regionType == DOMRegionContext.XML_DECLARATION_OPEN) ||
- (regionType == DOMRegionContext.XML_PI_OPEN) ||
- (regionType == DOMRegionContext.XML_COMMENT_OPEN) ||
- (regionType == DOMRegionContext.XML_CDATA_OPEN))) {
-
- contentAssistRequest = new ContentAssistRequest(treeNode, xmlnode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPosition(treeNode), context);
- addStartDocumentProposals(contentAssistRequest, context);
- }
- return contentAssistRequest;
- }
-
- /**
- * <p>Similar to {@link #computeCompletionProposals(CompletionProposalInvocationContext, IProgressMonitor)} only specificly for
- * attribute proposals</p>
- *
- * <p>Implementers should not override this method, it is made available to implementers so that if they override
- * {@link #computeCompletionProposals(String, ITextRegion, IDOMNode, IDOMNode, CompletionProposalInvocationContext)}
- * they can call this method if needed</p>
- *
- * @param matchString
- * @param completionRegion
- * @param nodeAtOffset
- * @param node
- * @param context
- * @return
- */
- protected final ContentAssistRequest computeAttributeProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ITextViewer viewer = context.getViewer();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- // if the attribute name is selected, replace it instead of creating a new attribute
- if (documentPosition <= sdRegion.getStartOffset(completionRegion) && (viewer != null && viewer.getSelectedRange().y != (sdRegion.getEndOffset(completionRegion) - sdRegion.getStartOffset(completionRegion)))) {
- // setup to insert new attributes
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- // Setup to replace an existing attribute name
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- }
- addAttributeNameProposals(contentAssistRequest, context);
- contentAssistRequest.setReplacementBeginPosition(documentPosition);
- contentAssistRequest.setReplacementLength(0);
- if ((node.getFirstStructuredDocumentRegion() != null) && (!node.getFirstStructuredDocumentRegion().isEnded())) {
- addTagCloseProposals(contentAssistRequest, context);
- }
- return contentAssistRequest;
- }
-
- /**
- * <p>this is the position the cursor should be in after the proposal is
- * applied</p>
- *
- * @param proposedText
- * @return the position the cursor should be in after the proposal is
- * applied
- */
- protected static int getCursorPositionForProposedText(String proposedText) {
- int cursorAdjustment;
- cursorAdjustment = proposedText.indexOf("\"\"") + 1; //$NON-NLS-1$
- // otherwise, after the first tag
- if (cursorAdjustment == 0) {
- cursorAdjustment = proposedText.indexOf('>') + 1;
- }
- if (cursorAdjustment == 0) {
- cursorAdjustment = proposedText.length() + 1;
- }
-
- return cursorAdjustment;
- }
-
- /**
- * <p>helpful utility method for determining if one string starts with another one.
- * This is case insensitive. If either are null then result is <code>true</code></p>
- *
- * @param aString the string to check to see if it starts with the given prefix
- * @param prefix check that the given string starts with this prefix
- *
- * @return <code>true</code> if the given string starts with the given prefix,
- * <code>false</code> otherwise
- */
- protected static boolean beginsWith(String aString, String prefix) {
- if ((aString == null) || (prefix == null)) {
- return true;
- }
- return aString.toLowerCase().startsWith(prefix.toLowerCase());
- }
-
- private ContentAssistRequest computeAttributeValueProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
-
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- if ((documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) && (sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength() != sdRegion.getStartOffset(completionRegion) + completionRegion.getLength())) {
- // setup to add a new attribute at the documentPosition
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
- addAttributeNameProposals(contentAssistRequest, context);
- if ((actualNode.getFirstStructuredDocumentRegion() != null) && !actualNode.getFirstStructuredDocumentRegion().isEnded()) {
- addTagCloseProposals(contentAssistRequest, context);
- }
- }
- else {
- // setup to replace the existing value
- if (!nodeAtOffset.getFirstStructuredDocumentRegion().isEnded() && (documentPosition < sdRegion.getStartOffset(completionRegion))) {
- // if the IStructuredDocumentRegion isn't closed and the
- // cursor is in front of the value, add
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- addAttributeNameProposals(contentAssistRequest, context);
- }
- else {
- int replaceLength = completionRegion.getTextLength();
-
- //if container region, be sure replace length is only the attribute value region not the entire container
- if(completionRegion instanceof ITextRegionContainer){
- ITextRegion openRegion = ((ITextRegionContainer) completionRegion).getFirstRegion();
- ITextRegion closeRegion = ((ITextRegionContainer) completionRegion).getLastRegion();
-
- /*
- * check to see if the container is opened the same way its closed.
- * Such as:
- * <img src=' '
- * But not:
- * <img src='
- *
- * </body>
- * </html>
- * In the latter case we only want to replace the opening text of the container
- * Admittedly crude test, but effective.
- */
- if(openRegion.getType() != closeRegion.getType()) {
- replaceLength = openRegion.getTextLength();
- }
- }
-
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion,
- completionRegion, sdRegion.getStartOffset(completionRegion),
- replaceLength, matchString);
-
- addAttributeValueProposals(contentAssistRequest, context);
- }
- }
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeContentProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
-
- // setup to add children at the content node's position
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, getStructuredDocumentRegion(documentPosition), completionRegion, documentPosition, 0, matchString);
- if ((node != null) && (node.getNodeType() == Node.DOCUMENT_NODE) && (((Document) node).getDoctype() == null)) {
- addStartDocumentProposals(contentAssistRequest, context);
- }
- addTagInsertionProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- if (node.getNodeType() != Node.DOCUMENT_NODE) {
- addEndTagProposals(contentAssistRequest, context);
- }
- // entities?
- addEntityProposals(contentAssistRequest, completionRegion, node, context);
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeEndTagOpenProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- int completionRegionStart = sdRegion.getStartOffset(completionRegion);
- int completionRegionLength = completionRegion.getLength();
- IStructuredDocumentRegion sdRegionAtCompletionOffset = node.getStructuredDocument().getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
- ITextRegion regionAtEndOfCompletion = sdRegionAtCompletionOffset.getRegionAtCharacterOffset(completionRegionStart + completionRegionLength);
-
- if ((documentPosition != completionRegionStart) && (regionAtEndOfCompletion != null) && (regionAtEndOfCompletion.getType() == DOMRegionContext.XML_TAG_NAME)) {
- ITextRegion nameRegion = regionAtEndOfCompletion;
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(nameRegion), nameRegion.getTextLength(), matchString);
- }
- else {
- if (nodeAtOffset.getFirstStructuredDocumentRegion() == sdRegion) {
- // abnormal case, this unmatched end tag will be a sibling
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, nodeAtOffset.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- // normal case, this end tag is the parent
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, nodeAtOffset, sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- }
- // if (documentPosition >= sdRegion.getStartOffset(completionRegion) +
- // completionRegion.getTextLength())
- addEndTagProposals(contentAssistRequest, context);
- // else
- if (completionRegionStart == documentPosition) {
- // positioned at start of end tag
- addTagInsertionProposals(contentAssistRequest, node.getChildNodes().getLength(), context);
- }
- return contentAssistRequest;
- }
-
-
- private ContentAssistRequest computeEqualsProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- ITextRegion valueRegion = node.getStartStructuredDocumentRegion().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) + completionRegion.getLength());
- if ((valueRegion != null) && (valueRegion.getType() == DOMRegionContext.XML_TAG_ATTRIBUTE_VALUE) && (sdRegion.getStartOffset(valueRegion) <= documentPosition)) {
- // replace the adjacent attribute value
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, valueRegion, sdRegion.getStartOffset(valueRegion), valueRegion.getTextLength(), matchString);
- }
- else {
- // append an attribute value after the '='
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- addAttributeValueProposals(contentAssistRequest, context);
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeStartDocumentProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
- int documentPosition = context.getInvocationOffset();
-
- // setup for a non-empty document, but one that hasn't been formally started
- ContentAssistRequest contentAssistRequest = null;
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node,
- getStructuredDocumentRegion(documentPosition), completionRegion,
- documentPosition, 0, matchString);
- addStartDocumentProposals(contentAssistRequest, context);
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeTagCloseProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
- if ((node.getNodeType() == Node.DOCUMENT_NODE) || (documentPosition >= sdRegion.getEndOffset())) {
- // this is a content request as the documentPosition is
- // AFTER the end of the closing region
- if ((node == nodeAtOffset) && (node.getParentNode() != null)) {
- node = (IDOMNode) node.getParentNode();
- }
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- if ((node.getNodeType() != Node.DOCUMENT_NODE) && (node.getEndStructuredDocumentRegion() == null)) {
- addEndTagProposals(contentAssistRequest, context);
- }
- }
- else {
- // at the start of the tag's close or within it
- ITextRegion closeRegion = sdRegion.getLastRegion();
- boolean insideTag = !sdRegion.isEnded() || (documentPosition <= sdRegion.getStartOffset(closeRegion));
- if (insideTag) {
- // this is a request for completions within a tag
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion, documentPosition, 0, matchString);
- if ((node.getNodeType() != Node.DOCUMENT_NODE) && (node.getEndStructuredDocumentRegion() != null)) {
- addTagCloseProposals(contentAssistRequest, context);
- }
- if (sdRegion == nodeAtOffset.getFirstStructuredDocumentRegion()) {
- contentAssistRequest.setReplacementBeginPosition(documentPosition);
- contentAssistRequest.setReplacementLength(0);
- addAttributeNameProposals(contentAssistRequest, context);
- }
- }
- }
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeTagNameProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
-
- if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion()) {
- // completing the *first* tag in "<tagname1 |<tagname2"
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- if (actualNode != null) {
- if (actualNode.getFirstStructuredDocumentRegion() == sdRegion) {
- // start tag
- if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
- // it's attributes
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition - matchString.length(), matchString.length(), matchString);
- if (node.getStructuredDocument().getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getRegionAtCharacterOffset(sdRegion.getStartOffset(completionRegion) - 1).getType() == DOMRegionContext.XML_TAG_OPEN) {
- addAttributeNameProposals(contentAssistRequest, context);
- }
- addTagCloseProposals(contentAssistRequest, context);
- }
- else {
- // it's name
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, documentPosition - matchString.length(),
- matchString.length(), matchString);
- addTagNameProposals(contentAssistRequest, getElementPosition(actualNode),
- context);
- }
- }
- else {
- if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getLength()) {
- // insert name
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- // replace name
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion),
- completionRegion.getTextLength(), matchString);
- }
- addEndTagNameProposals(contentAssistRequest, context);
- }
- }
- }
- else {
- if (documentPosition > sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
- // unclosed tag with only a name;
- //should prompt for attributes and a close instead
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node, sdRegion, completionRegion,
- documentPosition - matchString.length(), matchString.length(), matchString);
- addAttributeNameProposals(contentAssistRequest, context);
- addTagCloseProposals(contentAssistRequest, context);
- }
- else {
- if (sdRegion.getRegions().get(0).getType() != DOMRegionContext.XML_END_TAG_OPEN) {
- int replaceLength = documentPosition - sdRegion.getStartOffset(completionRegion);
- contentAssistRequest = new ContentAssistRequest(node, node.getParentNode(), sdRegion,
- completionRegion, sdRegion.getStartOffset(completionRegion), replaceLength, matchString);
- addTagNameProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- }
- else {
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(documentPosition);
- if (actualNode != null) {
- if (documentPosition >= sdRegion.getStartOffset(completionRegion) + completionRegion.getTextLength()) {
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, documentPosition, 0, matchString);
- }
- else {
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(),
- sdRegion, completionRegion, sdRegion.getStartOffset(completionRegion),
- completionRegion.getTextLength(), matchString);
- }
- addEndTagNameProposals(contentAssistRequest, context);
- }
- }
- }
- }
- return contentAssistRequest;
- }
-
- private ContentAssistRequest computeTagOpenProposals(String matchString, ITextRegion completionRegion,
- IDOMNode nodeAtOffset, IDOMNode node, CompletionProposalInvocationContext context) {
-
- int documentPosition = context.getInvocationOffset();
- ContentAssistRequest contentAssistRequest = null;
- IStructuredDocumentRegion sdRegion = getStructuredDocumentRegion(documentPosition);
- if (sdRegion != nodeAtOffset.getFirstStructuredDocumentRegion() || sdRegion.getPrevious() != null && sdRegion.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN) {
- // completing the *first* XML_TAG_OPEN in "<<tagname"
- IDOMNode actualNode = (IDOMNode) node.getModel().getIndexedRegion(sdRegion.getStartOffset(completionRegion));
- if (actualNode != null) {
- if(sdRegion.getFirstRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN) {
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode, sdRegion, completionRegion, documentPosition, 0, matchString);
- if(actualNode.hasChildNodes())
- addTagNameProposals(contentAssistRequest,
- getElementPosition(actualNode.getLastChild()), context);
- else
- addTagNameProposals(contentAssistRequest, 0, context);
- }
- else {
- contentAssistRequest = new ContentAssistRequest(actualNode, actualNode.getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addTagNameProposals(contentAssistRequest, getElementPosition(actualNode), context);
- }
- addEndTagProposals(contentAssistRequest, context); // (pa) 220850
- }
- }
- else {
- if (documentPosition == sdRegion.getStartOffset(completionRegion)) {
- if (node.getNodeType() == Node.ELEMENT_NODE) {
- // at the start of an existing tag, right before the '<'
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion,
- completionRegion, documentPosition, 0, matchString);
- addTagInsertionProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- addEndTagProposals(contentAssistRequest, context);
- }
- else if (node.getNodeType() == Node.DOCUMENT_NODE) {
- // at the opening of the VERY first tag with a '<'
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, node.getParentNode(), sdRegion,
- completionRegion, sdRegion.getStartOffset(completionRegion), completionRegion.getTextLength(), matchString);
- addStartDocumentProposals(contentAssistRequest, context);
- }
- }
- else {
- // within the white space
- ITextRegion name = getNameRegion(node.getStartStructuredDocumentRegion());
- if ((name != null) &&
- ((sdRegion.getStartOffset(name) <= documentPosition) && (sdRegion.getEndOffset(name) >= documentPosition)) &&
- (sdRegion.getLastRegion().getType() == DOMRegionContext.XML_TAG_CLOSE || sdRegion.getLastRegion().getType() == DOMRegionContext.XML_EMPTY_TAG_CLOSE)){
-
- // replace the existing name
- contentAssistRequest = new ContentAssistRequest(node, node.getParentNode(), sdRegion, completionRegion, sdRegion.getStartOffset(name), name.getTextLength(), matchString);
- }
- else {
- // insert a valid new name, or possibly an end tag
- contentAssistRequest = new ContentAssistRequest(nodeAtOffset, ((Node) nodeAtOffset).getParentNode(), sdRegion, completionRegion, documentPosition, 0, matchString);
- addEndTagProposals(contentAssistRequest, context);
- contentAssistRequest.setReplacementBeginPosition(documentPosition);
- contentAssistRequest.setReplacementLength(0);
- }
- addTagNameProposals(contentAssistRequest, getElementPosition(nodeAtOffset), context);
- }
- }
- return contentAssistRequest;
- }
-
- private ITextRegion getCompletionRegion(int offset, IStructuredDocumentRegion sdRegion) {
- ITextRegion region = sdRegion.getRegionAtCharacterOffset(offset);
- if (region == null) {
- return null;
- }
-
- if (sdRegion.getStartOffset(region) == offset) {
- // The offset is at the beginning of the region
- if ((sdRegion.getStartOffset(region) == sdRegion.getStartOffset()) && (sdRegion.getPrevious() != null) && (!sdRegion.getPrevious().isEnded())) {
- // Is the region also the start of the node? If so, the
- // previous IStructuredDocumentRegion is
- // where to look for a useful region.
- region = sdRegion.getPrevious().getRegionAtCharacterOffset(offset - 1);
- }
- else {
- // Is there no separating whitespace from the previous region?
- // If not,
- // then that region is the important one
- ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(offset - 1);
- if ((previousRegion != null) && (previousRegion != region) && (previousRegion.getTextLength() == previousRegion.getLength())) {
- region = previousRegion;
- }
- }
- }
- else {
- // The offset is NOT at the beginning of the region
- if (offset > sdRegion.getStartOffset(region) + region.getTextLength()) {
- // Is the offset within the whitespace after the text in this
- // region?
- // If so, use the next region
- ITextRegion nextRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) + region.getLength());
- if (nextRegion != null) {
- region = nextRegion;
- }
- }
- else {
- // Is the offset within the important text for this region?
- // If so, then we've already got the right one.
- }
- }
-
- // valid WHITE_SPACE region handler (#179924)
- if ((region != null) && (region.getType() == DOMRegionContext.WHITE_SPACE)) {
- ITextRegion previousRegion = sdRegion.getRegionAtCharacterOffset(sdRegion.getStartOffset(region) - 1);
- if (previousRegion != null) {
- region = previousRegion;
- }
- }
-
- return region;
- }
-
- /**
- * Return the region whose content's require completion. This is something
- * of a misnomer as sometimes the user wants to be prompted for contents
- * of a non-existant ITextRegion, such as for enumerated attribute values
- * following an '=' sign.
- */
- private ITextRegion getCompletionRegion(int documentPosition, Node domnode) {
- if (domnode == null) {
- return null;
- }
-
- ITextRegion region = null;
- int offset = documentPosition;
- IStructuredDocumentRegion flatNode = null;
- IDOMNode node = (IDOMNode) domnode;
-
- if (node.getNodeType() == Node.DOCUMENT_NODE) {
- if (node.getStructuredDocument().getLength() == 0) {
- return null;
- }
- ITextRegion result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
- while (result == null) {
- offset--;
- result = node.getStructuredDocument().getRegionAtCharacterOffset(offset).getRegionAtCharacterOffset(offset);
- }
- return result;
- }
-
- IStructuredDocumentRegion startTag = node.getStartStructuredDocumentRegion();
- IStructuredDocumentRegion endTag = node.getEndStructuredDocumentRegion();
-
- // Determine if the offset is within the start
- // IStructuredDocumentRegion, end IStructuredDocumentRegion, or
- // somewhere within the Node's XML content.
- if ((startTag != null) && (startTag.getStartOffset() <= offset) && (offset < startTag.getStartOffset() + startTag.getLength())) {
- flatNode = startTag;
- }
- else if ((endTag != null) && (endTag.getStartOffset() <= offset) && (offset < endTag.getStartOffset() + endTag.getLength())) {
- flatNode = endTag;
- }
-
- if (flatNode != null) {
- // the offset is definitely within the start or end tag, continue
- // on and find the region
- region = getCompletionRegion(offset, flatNode);
- }
- else {
- // the docPosition is neither within the start nor the end, so it
- // must be content
- flatNode = node.getStructuredDocument().getRegionAtCharacterOffset(offset);
- // (pa) ITextRegion refactor
- // if (flatNode.contains(documentPosition)) {
- if ((flatNode.getStartOffset() <= documentPosition) && (flatNode.getEndOffset() >= documentPosition)) {
- // we're interesting in completing/extending the previous
- // IStructuredDocumentRegion if the current
- // IStructuredDocumentRegion isn't plain content or if it's
- // preceded by an orphan '<'
- if ((offset == flatNode.getStartOffset()) &&
- (flatNode.getPrevious() != null) &&
- (((flatNode.getRegionAtCharacterOffset(documentPosition) != null) &&
- (flatNode.getRegionAtCharacterOffset(documentPosition).getType() != DOMRegionContext.XML_CONTENT)) ||
- (flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_TAG_OPEN) ||
- (flatNode.getPrevious().getLastRegion().getType() == DOMRegionContext.XML_END_TAG_OPEN))) {
-
- // Is the region also the start of the node? If so, the
- // previous IStructuredDocumentRegion is
- // where to look for a useful region.
- region = flatNode.getPrevious().getLastRegion();
- }
- else if (flatNode.getEndOffset() == documentPosition) {
- region = flatNode.getLastRegion();
- }
- else {
- region = flatNode.getFirstRegion();
- }
- }
- else {
- // catch end of document positions where the docPosition isn't
- // in a IStructuredDocumentRegion
- region = flatNode.getLastRegion();
- }
- }
-
- return region;
- }
-
- private int getElementPosition(Node child) {
- Node parent = child.getParentNode();
- if (parent == null) {
- return 0;
- }
-
- NodeList children = parent.getChildNodes();
- if (children == null) {
- return 0;
- }
- int count = 0;
-
- for (int i = 0; i < children.getLength(); i++) {
- if (children.item(i) == child) {
- return count;
- }
- else {
- // if (children.item(i).getNodeType() == Node.ELEMENT_NODE)
- count++;
- }
- }
- return 0;
- }
-
- /**
- * the returned string will be used as the filter to show the proposed values
- * @throws BadLocationException
- */
- protected String getMatchString(IStructuredDocumentRegion parent, ITextRegion aRegion, int offset) throws BadLocationException {
- if ((aRegion == null) || isCloseRegion(aRegion)) {
- return ""; //$NON-NLS-1$
- }
- String matchString = null;
- String regionType = aRegion.getType();
- if ((regionType == DOMRegionContext.XML_TAG_ATTRIBUTE_EQUALS) || (regionType == DOMRegionContext.XML_TAG_OPEN) || (offset > parent.getStartOffset(aRegion) + aRegion.getTextLength())) {
- matchString = ""; //$NON-NLS-1$
- }
- else if (regionType == DOMRegionContext.XML_CONTENT || regionType == DOMRegionContext.XML_END_TAG_OPEN) {
- int begin = parent.getPrevious().getStartOffset();
- int length = offset-parent.getPrevious().getStart();
- matchString = parent.getParentDocument().get(begin, length);
-
- // parent.getParentDocument().get(begin, length) could return
- // something likes <schema> or <schema>a or <schema> a
- // get the substring as the match string
- if ((matchString.length() > 0) && (beginsWith(matchString, "<"))) {
- if (matchString.contains(">")) {
- matchString = parent.getParentDocument().get(begin + matchString.indexOf('>') + 1, length-matchString.indexOf('>')-1);
- } else {
- matchString ="";
- }
- }
-
- // chop off any leading whitespace(s) from the match string
- while ((matchString.length() > 0) && (Character.isWhitespace(matchString.charAt(0)))) {
- matchString = matchString.substring(1);
- }
- }
- else {
- if ((parent.getText(aRegion).length() > 0) && (parent.getStartOffset(aRegion) < offset)) {
- matchString = parent.getText(aRegion).substring(0, offset - parent.getStartOffset(aRegion));
- } else {
- matchString = "";
- }
- }
- return matchString;
- }
-
- @SuppressWarnings("rawtypes")
- private ITextRegion getNameRegion(IStructuredDocumentRegion flatNode) {
- if (flatNode == null) {
- return null;
- }
- Iterator regionList = flatNode.getRegions().iterator();
- while (regionList.hasNext()) {
- ITextRegion region = (ITextRegion) regionList.next();
- if (isNameRegion(region)) {
- return region;
- }
- }
- return null;
- }
-
- private boolean isCloseRegion(ITextRegion region) {
- String type = region.getType();
- return ((type == DOMRegionContext.XML_PI_CLOSE) ||
- (type == DOMRegionContext.XML_TAG_CLOSE) ||
- (type == DOMRegionContext.XML_EMPTY_TAG_CLOSE) ||
- (type == DOMRegionContext.XML_CDATA_CLOSE) ||
- (type == DOMRegionContext.XML_COMMENT_CLOSE) ||
- (type == DOMRegionContext.XML_ATTLIST_DECL_CLOSE) ||
- (type == DOMRegionContext.XML_ELEMENT_DECL_CLOSE) ||
- (type == DOMRegionContext.XML_DOCTYPE_DECLARATION_CLOSE) ||
- (type == DOMRegionContext.XML_DECLARATION_CLOSE));
- }
-
- private boolean isNameRegion(ITextRegion region) {
- String type = region.getType();
- return ((type == DOMRegionContext.XML_TAG_NAME) ||
- (type == DOMRegionContext.XML_ELEMENT_DECL_NAME) ||
- (type == DOMRegionContext.XML_DOCTYPE_NAME) ||
- (type == DOMRegionContext.XML_ATTLIST_DECL_NAME));
- }
-
- /**
- * StructuredTextViewer must be set before using this.
- */
- private IStructuredDocumentRegion getStructuredDocumentRegion(int pos) {
- return ContentAssistUtils.getStructuredDocumentRegion(fTextViewer, pos);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/DefaultJpaXmlCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/DefaultJpaXmlCompletionProposalComputer.java
deleted file mode 100644
index f447b203b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/DefaultJpaXmlCompletionProposalComputer.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 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.jpa.ui.internal;
-
-import java.util.Properties;
-import java.util.Vector;
-
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion;
-import org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-
-/**
- * <p>Default implementation of the {@link AbstractJpaXmlCompletionProposalComputer}, defaults are to do nothing</p>
- *
- * The code of this class was copied from DefaultXMLCompletionProposalComputer and modified according to
- * the needs of the XML content assist of Dali.
- *
- * The existence of this class is to isolate WTP code that will be removed after bug 371939 is addressed.
- * When it can be removed, we should try to eliminate the subclassing of this "default" implementation.
- */
-
-public class DefaultJpaXmlCompletionProposalComputer extends
- AbstractJpaXmlCompletionProposalComputer {
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionEnded()
- */
- public void sessionEnded() {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer#sessionStarted()
- */
- public void sessionStarted() {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addAttributeNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addAttributeNameProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addAttributeValueProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addAttributeValueProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addCommentProposal(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addCommentProposal(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addDocTypeProposal(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- protected void addDocTypeProposal(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEmptyDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addEmptyDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEndTagNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addEndTagNameProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEndTagProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addEndTagProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEntityProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addEntityProposals(
- ContentAssistRequest contentAssistRequest,
- ITextRegion completionRegion, IDOMNode treeNode,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addEntityProposals(java.util.Vector, java.util.Properties, java.lang.String, int, org.eclipse.wst.sse.core.internal.provisional.text.IStructuredDocumentRegion, org.eclipse.wst.sse.core.internal.provisional.text.ITextRegion, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addEntityProposals(Vector<ICompletionProposal> proposals, Properties map,
- String key, int nodeOffset, IStructuredDocumentRegion sdRegion,
- ITextRegion completionRegion,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addPCDATAProposal(java.lang.String, org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addPCDATAProposal(String nodeName,
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addStartDocumentProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addStartDocumentProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addTagCloseProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addTagCloseProposals(
- ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addTagInsertionProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addTagInsertionProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-
- /**
- * Default behavior is do to nothing.
- *
- * @see org.eclipse.wst.xml.ui.internal.contentassist.AbstractXMLCompletionProposalComputer#addTagNameProposals(org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest, int, org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext)
- */
- @Override
- protected void addTagNameProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
- //default behavior is to do nothing
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/FileAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/FileAdapterFactory.java
deleted file mode 100644
index 388e1ec0dc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/FileAdapterFactory.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.common.utility.internal.SimpleFilter;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ElementPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.ui.JpaFileModel;
-import org.eclipse.jpt.jpa.ui.JpaProjectModel;
-
-/**
- * Factory to build Dali adapters for an {@link IFile}
- * (The comments for the adapters produced by {@link ProjectAdapterFactory}
- * are applicable here also):<ul>
- * <li>{@link org.eclipse.jpt.jpa.ui.JpaFileModel JpaFileModel}
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- *
- * @see ProjectAdapterFactory
- */
-public class FileAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] {
- JpaFileModel.class,
- };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IFile) {
- return this.getAdapter((IFile) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IFile file, Class<?> adapterType) {
- if (adapterType == JpaFileModel.class) {
- return this.getJpaFileModel(file);
- }
- return null;
- }
-
- private JpaFileModel getJpaFileModel(IFile file) {
- return new JpaFileModelAdapter(this.buildJpaFilesModel(file.getProject()), file);
- }
-
- private CollectionValueModel<JpaFile> buildJpaFilesModel(IProject project) {
- return new JpaFilesModel(this.getJpaProjectModel(project));
- }
-
- private JpaProjectModel getJpaProjectModel(IProject project) {
- return (JpaProjectModel) project.getAdapter(JpaProjectModel.class);
- }
-
-
- // ********** JPA files model **********
-
- /**
- * Adapt a JPA project's JPA files collection to the collection value model
- * interface.
- */
- /* CU private */ static class JpaFilesModel
- extends CollectionAspectAdapter<JpaProject, JpaFile>
- {
- JpaFilesModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel, JpaProject.JPA_FILES_COLLECTION);
- }
-
- @Override
- protected Iterable<JpaFile> getIterable() {
- return this.subject.getJpaFiles();
- }
-
- @Override
- protected int size_() {
- return this.subject.getJpaFilesSize();
- }
- }
-
-
- // ********** JPA file model **********
-
- /**
- * Implement a property value model for the JPA file corresponding to a
- * {@link IFile file}. The model will fire change events when the
- * corresponding JPA file is added or removed from the JPA project
- * or when the JPA project is created or destroyed.
- * This is useful for UI code that does not want to wait to
- * retrieve a JPA file but wants to be notified when it is available.
- * <p>
- * Subclass {@link ElementPropertyValueModelAdapter} so we can
- * implement {@link org.eclipse.jpt.jpa.ui.JpaFileModel}.
- *
- * @see JpaProjectModel
- */
- /* CU private */ static class JpaFileModelAdapter
- extends ElementPropertyValueModelAdapter<JpaFile>
- implements JpaFileModel
- {
- JpaFileModelAdapter(CollectionValueModel<JpaFile> jpaFilesModel, IFile file) {
- super(jpaFilesModel, new Predicate(file));
- }
-
- public IFile getFile() {
- return ((Predicate) this.predicate).getCriterion();
- }
-
- /* class private */ static class Predicate
- extends SimpleFilter<JpaFile, IFile>
- {
- Predicate(IFile file) {
- super(file);
- }
- @Override
- public boolean accept(JpaFile jpaFile) {
- return jpaFile.getFile().equals(this.criterion);
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/GenericJpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/GenericJpaPlatformUiProvider.java
deleted file mode 100644
index 03077a3de2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/GenericJpaPlatformUiProvider.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.GenericJavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiDefinition;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class GenericJpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new GenericJpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private GenericJpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(GenericJavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(PersistenceXmlUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/ImageRepository.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/ImageRepository.java
deleted file mode 100644
index b93cd85284..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/ImageRepository.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-@SuppressWarnings("nls")
-public final class ImageRepository {
-
- // ***** overlays *****
- public static Image getErrorOverlayImage(ResourceManager resourceManager) {
- return getImage(resourceManager, ERROR_OVERLAY_DESCRIPTOR);
- }
- private static final ImageDescriptor ERROR_OVERLAY_DESCRIPTOR = buildImageDescriptor("overlays/error.gif");
-
- public static Image getWarningOverlayImage(ResourceManager resourceManager) {
- return getImage(resourceManager, WARNING_OVERLAY_DESCRIPTOR);
- }
- private static final ImageDescriptor WARNING_OVERLAY_DESCRIPTOR = buildImageDescriptor("overlays/warning.png");
-
- // ***** buttons *****
- public static Image getAddButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, ADD_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor ADD_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/add.png");
-
- public static Image getEditButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, EDIT_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor EDIT_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/edit.png");
-
- public static Image getDeleteButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, DELETE_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor DELETE_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/delete.png");
-
- public static Image getMoveUpButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, MOVE_UP_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor MOVE_UP_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/move-up.png");
-
- public static Image getMoveDownButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, MOVE_DOWN_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor MOVE_DOWN_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/move-down.png");
-
- public static Image getExpandAllButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, EXPAND_ALL_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor EXPAND_ALL_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/expand-all.png");
-
- public static Image getCollapseAllButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, COLLAPSE_ALL_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor COLLAPSE_ALL_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/collapse-all.png");
-
- public static Image getRestoreDefaultsButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, RESTORE_DEFAULTS_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor RESTORE_DEFAULTS_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/restore-defaults.png");
-
- public static Image getBrowseButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, BROWSE_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor BROWSE_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/browse.png");
-
- public static Image getMiniBrowseButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, MINI_BROWSE_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor MINI_BROWSE_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/browse-mini.png");
-
- public static Image getSelectAllButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, SELECT_ALL_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor SELECT_ALL_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/select-all.png");
-
- public static Image getDeselectAllButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, DESELECT_ALL_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor DESELECT_ALL_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/deselect-all.png");
-
- public static Image getRefreshButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, REFRESH_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor REFRESH_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/refresh.gif");
-
- public static Image getAddConnectionButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, ADD_CONNECTION_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor ADD_CONNECTION_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/add-connection.gif");
-
- public static Image getReconnectButtonImage(ResourceManager resourceManager) {
- return getImage(resourceManager, RECONNECT_BUTTON_DESCRIPTOR);
- }
- private static final ImageDescriptor RECONNECT_BUTTON_DESCRIPTOR = buildImageDescriptor("buttons/reconnect.png");
-
- // ***** objects *****
- public static Image getFileImage(ResourceManager resourceManager) {
- return getImage(resourceManager, FILE_DESCRIPTOR);
- }
- private static final ImageDescriptor FILE_DESCRIPTOR = buildImageDescriptor("objects/file.png");
-
- public static Image getFolderImage(ResourceManager resourceManager) {
- return getImage(resourceManager, FOLDER_DESCRIPTOR);
- }
- private static final ImageDescriptor FOLDER_DESCRIPTOR = buildImageDescriptor("objects/folder.png");
-
- public static Image getPackageImage(ResourceManager resourceManager) {
- return getImage(resourceManager, PACKAGE_DESCRIPTOR);
- }
- private static final ImageDescriptor PACKAGE_DESCRIPTOR = buildImageDescriptor("objects/package.png");
-
- public static Image getTableImage(ResourceManager resourceManager) {
- return getImage(resourceManager, TABLE_DESCRIPTOR);
- }
- private static final ImageDescriptor TABLE_DESCRIPTOR = buildImageDescriptor("objects/table.gif");
-
- public static Image getTableObjImage(ResourceManager resourceManager) {
- return getImage(resourceManager, TABLE_OBJ_DESCRIPTOR);
- }
- private static final ImageDescriptor TABLE_OBJ_DESCRIPTOR = buildImageDescriptor("objects/table_obj.gif");
-
- public static Image getColumnImage(ResourceManager resourceManager) {
- return getImage(resourceManager, COLUMN_DESCRIPTOR);
- }
- private static final ImageDescriptor COLUMN_DESCRIPTOR = buildImageDescriptor("objects/column.gif");
-
- public static Image getKeyColumnImage(ResourceManager resourceManager) {
- return getImage(resourceManager, KEY_COLUMN_DESCRIPTOR);
- }
- private static final ImageDescriptor KEY_COLUMN_DESCRIPTOR = buildImageDescriptor("objects/columnKey.gif");
-
-
- private static ImageDescriptor buildImageDescriptor(String fileName) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(JptJpaUiPlugin.PLUGIN_ID, "images/" + fileName);
- }
-
-
- private static Image getImage(ResourceManager resourceManager, ImageDescriptor descriptor) {
- return resourceManager.createImage(descriptor);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaHelpContextIds.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaHelpContextIds.java
deleted file mode 100644
index bd03323320..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaHelpContextIds.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-
-/**
- * Help context ids for the Dali JPA UI.
- * <p>
- * This interface contains constants only; it is not intended to be
- * implemented.
- * </p>
- */
-@SuppressWarnings("nls")
-public interface JpaHelpContextIds {
-
- //ContextID prefix
- public static final String PREFIX = JptJpaUiPlugin.PLUGIN_ID + ".";
-
- //Persistent Type composites
- public static final String ENTITY_ACCESS_TYPE = PREFIX + "entity_accessType";
- public static final String ENTITY_ATTRIBUTE_OVERRIDES = PREFIX + "entity_attributeOverrides";
- public static final String ENTITY_ATTRIBUTE_OVERRIDES_COLUMN = PREFIX + "entity_attributeOverridesColumn";
- public static final String ENTITY_CATALOG = PREFIX + "entity_catalog";
- public static final String ENTITY_INHERITANCE_STRATEGY = PREFIX + "entity_inheritanceStrategy";
- public static final String ENTITY_INHERITANCE_DISCRIMINATOR_TYPE = PREFIX + "entity_inheritanceDiscriminatorType";
- public static final String ENTITY_INHERITANCE_DISCRIMINATOR_COLUMN = PREFIX + "entity_inheritanceDiscriminatorColumn";
- public static final String ENTITY_INHERITANCE_DISCRIMINATOR_VALUE = PREFIX + "entity_inheritanceDiscriminatorValue";
- public static final String ENTITY_NAME = PREFIX + "entity_name";
- public static final String ENTITY_ORM_PACKAGE = PREFIX + "orm_package";
- public static final String ENTITY_ORM_SCHEMA = PREFIX + "orm_schema";
- public static final String ENTITY_ORM_CATALOG = PREFIX + "orm_catalog";
- public static final String ENTITY_ORM_DELIMITED_IDENTIFIERS = PREFIX + "orm_delimited_identifiers";
- public static final String ENTITY_ORM_CASCADE = PREFIX + "orm_cascade";
- public static final String ENTITY_ORM_XML = PREFIX + "orm_xml";
- public static final String ENTITY_SCHEMA = PREFIX + "entity_schema";
- public static final String ENTITY_TABLE = PREFIX + "entity_table";
- public static final String ENTITY_CACHEABLE = PREFIX + "entity_cacheable";
-
- //Persistent Attribute composites
- public static final String MAPPING_CASCADE_TYPE = PREFIX + "mapping_cascadeType";
- public static final String MAPPING_COLUMN = PREFIX + "mapping_column";
- public static final String MAPPING_COLUMN_INSERTABLE = PREFIX + "mapping_columnInsertable";
- public static final String MAPPING_COLUMN_LENGTH = PREFIX + "mapping_columnLength";
- public static final String MAPPING_COLUMN_NULLABLE = PREFIX + "mapping_columnNullable";
- public static final String MAPPING_COLUMN_PRECISION = PREFIX + "mapping_columnPrecision";
- public static final String MAPPING_COLUMN_SCALE = PREFIX + "mapping_columnScale";
- public static final String MAPPING_COLUMN_TABLE = PREFIX + "mapping_columnTable";
- public static final String MAPPING_COLUMN_UNIQUE = PREFIX + "mapping_columnUnique";
- public static final String MAPPING_COLUMN_UPDATABLE= PREFIX + "mapping_columnUpdatable";
- public static final String MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES = PREFIX + "mapping_embeddedAttributeOverrides";
- public static final String MAPPING_EMBEDDED_ATTRIBUTE_OVERRIDES_COLUMN = PREFIX + "mapping_embeddedAttributeOverridesColumn";
- public static final String MAPPING_ENUMERATED = PREFIX + "mapping_enumerated";
- public static final String MAPPING_FETCH_TYPE = PREFIX + "mapping_fetchType";
- public static final String MAPPING_GENERATED_VALUE_STRATEGY = PREFIX + "mapping_generatedValueStrategy";
- public static final String MAPPING_GENERATED_VALUE_GENERATOR_NAME = PREFIX + "mapping_generatedValueGeneratorName";
- public static final String MAPPING_JOIN_COLUMN_NAME = PREFIX + "mapping_joinColumnName";
- public static final String MAPPING_JOIN_REFERENCED_COLUMN = PREFIX + "mapping_joinReferencedColumn";
- public static final String MAPPING_JOIN_TABLE_NAME = PREFIX + "mapping_joinTableName";
- public static final String MAPPING_JOIN_TABLE_SCHEMA = PREFIX + "mapping_joinTableSchema";
- public static final String MAPPING_JOIN_TABLE_CATALOG = PREFIX + "mapping_joinTableCatalog";
- public static final String MAPPING_JOIN_TABLE_COLUMNS = PREFIX + "mapping_joinTableJoinColumns";
- public static final String MAPPING_JOIN_TABLE_INVERSE_JOIN_COLUMNS = PREFIX + "mapping_joinTableInverseJoinColumns";
- public static final String MAPPING_LOB = PREFIX + "mapping_lob";
- public static final String MAPPING_MAP_AS = PREFIX + "mapping_mapAs";
- public static final String MAPPING_MAPPED_BY = PREFIX + "mapping_mappedBy";
- public static final String MAPPING_NAMED_NATIVE_QUERIES = "named_native_queries";
- public static final String MAPPING_NAMED_QUERIES = PREFIX + "named_queries";
- public static final String MAPPING_OPTIONAL = PREFIX + "mapping_optional";
- public static final String MAPPING_ORDER_BY = PREFIX + "mapping_orderBy";
- public static final String MAPPING_ORDER_BY_NO_ORDERING = PREFIX + "mapping_orderByNoOrdering";
- public static final String MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING = PREFIX + "mapping_orderByPrimaryKeyOrdering";
- public static final String MAPPING_ORDER_BY_CUSTOM_ORDERING = PREFIX + "mapping_orderByCustomOrdering";
- public static final String MAPPING_ORDER_COLUMN_ORDERING = PREFIX + "mapping_orderColumnOrdering";
- public static final String MAPPING_ORDER_COLUMN_ORDERING_COLUMN = PREFIX + "mapping_orderColumnOrderingColumn";
- public static final String MAPPING_PRIMARY_KEY_GENERATION = PREFIX + "mapping_primaryKeyGeneration";
- public static final String MAPPING_SEQUENCE_GENERATOR = PREFIX + "mapping_sequenceGenerator";
- public static final String MAPPING_SEQUENCE_GENERATOR_NAME = PREFIX + "mapping_sequenceGeneratorName";
- public static final String MAPPING_SEQUENCE_GENERATOR_SEQUENCE = PREFIX + "mapping_sequenceGeneratorSequence";
- public static final String MAPPING_TABLE_GENERATOR = PREFIX + "mapping_tableGenerator";
- public static final String MAPPING_TABLE_GENERATOR_CATALOG = PREFIX + "mapping_tableGeneratorCatalog";
- public static final String MAPPING_TABLE_GENERATOR_NAME = PREFIX + "mapping_tableGeneratorName";
- public static final String MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN = PREFIX + "mapping_tableGeneratorPrimaryKeyColumn";
- public static final String MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN_VALUE = PREFIX + "mapping_tableGeneratorPrimaryKeyColumnValue";
- public static final String MAPPING_TABLE_GENERATOR_SCHEMA = PREFIX + "mapping_tableGeneratorSchema";
- public static final String MAPPING_TABLE_GENERATOR_TABLE= PREFIX + "mapping_tableGeneratorTable";
- public static final String MAPPING_TABLE_GENERATOR_VALUE_COLUMN = PREFIX + "mapping_tableGeneratorValueColumn";
- public static final String MAPPING_TARGET_ENTITY = PREFIX + "mapping_targetEntity";
- public static final String MAPPING_TEMPORAL = PREFIX + "mapping_temporal";
-
- //Project properties
- public static final String PROPERTIES_JAVA_PERSISTENCE = PREFIX + "properties_javaPersistence";
- public static final String PROPERTIES_JAVA_PERSISTENCE_CONNECTION = PREFIX + "properties_javaPersistenceConnection";
- public static final String PROPERTIES_JAVA_PERSISTENCE_SCHEMA = PREFIX + "properties_javaPersistenceSchema";
- public static final String PROPERTIES_JAVA_PERSISTENCE_METAMODEL = PREFIX + "properties_canonicalMetamodel";
-
- //Dialogs, Wizards
- public static final String DIALOG_CREATE_ORM = PREFIX + "dialog_createORM";
- public static final String DIALOG_EDIT_INVERSE_JOIN_COLUNN = PREFIX + "dialog_editInverseJoinColumn";
- public static final String DIALOG_GENERATE_ENTITIES = PREFIX + "dialog_generateEntities";
- public static final String DIALOG_GENERATE_ENTITIES_SOURCE = PREFIX + "dialog_generateEntities_source";
- public static final String DIALOG_GENERATE_ENTITIES_PACKAGE = PREFIX + "dialog_generateEntities_package";
- public static final String DIALOG_GENERATE_ENTITIES_TABLES = PREFIX + "dialog_generateEntities_tables";
- public static final String DIALOG_JPA_FACET = PREFIX + "dialog_JPAFacet";
- public static final String DIALOG_JPA_PLATFORM = PREFIX + "dialog_JPAPlatform";
-
- //New JPA Project wizard:
- public static final String NEW_JPA_PROJECT = PREFIX + "dialog_newJPAProject";
- public static final String NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH = PREFIX + "dialog_addJavaPersistence_classpath";
- public static final String NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE = PREFIX + "dialog_addJavaPersistence_database";
- public static final String NEW_JPA_PROJECT_CONTENT_PAGE_PACKAGING = PREFIX + "dialog_addJavaPersistence_packaging";
- public static final String NEW_JPA_PROJECT_CREATION_PAGE = PREFIX + "dialog_addJavaPersistence";
- public static final String NEW_JPA_PROJECT_JPA_FACET = PREFIX + "dialog_newJPAProjectFacet";
-
- //Other
- public static final String PERSISTENCE_OUTLINE = PREFIX + "persistenceOutline";
-
- //Persistence Xml Editor
- public static final String PERSISTENCE_XML_CONNECTION = PREFIX + "persistence_connection";
- public static final String PERSISTENCE_XML_GENERAL = PREFIX + "persistence_general";
- public static final String PERSISTENCE_XML_PROPERTIES = PREFIX + "persistence_properties";
- public static final String PERSISTENCE_XML_SOURCE = PREFIX + "persistence_source";
-
- //New JPA Entity wizard
- public static final String NEW_JPA_ENTITY_ENTITY_CLASS = PREFIX + "dialog_entityClassPage";
- public static final String NEW_JPA_ENTITY_ENTITY_PROPERTIES = PREFIX + "dialog_entityPropertiesPage";
-
- //Generate Entities Wizard
- public static final String GENERATE_ENTITIES_WIZARD_ASSOCIATION_CARDINALITY = PREFIX + "dialog_associationCardinalityPage";
- public static final String GENERATE_ENTITIES_WIZARD_ASSOCIATION_TABLES = PREFIX + "dialog_associationTablesPage";
- public static final String GENERATE_ENTITIES_WIZARD_CUSTOMIZE_DEFAULT_ENTITY_GENERATION = PREFIX + "dialog_customizeDefaultEntityGeneration";
- public static final String GENERATE_ENTITIES_WIZARD_CUSTOMIZE_INDIVIDUAL_ENTITIES = PREFIX + "dialog_customizeIndividualEntities";
- public static final String GENERATE_ENTITIES_WIZARD_JOIN_COLUMNS = PREFIX + "dialog_joinColumnsPage";
- public static final String GENERATE_ENTITIES_WIZARD_SELECT_CASCADE = PREFIX + "dialog_selectCascade";
- public static final String GENERATE_ENTITIES_WIZARD_SELECT_TABLES = PREFIX + "dialog_selectTablesPage";
- public static final String GENERATE_ENTITIES_WIZARD_TABLE_ASSOCIATIONS = PREFIX + "dialog_tableAssociationsPage";
-
- public static final String MAPPING_COLLECTION_TABLE_NAME = PREFIX + "mapping_collectionTableName";
- public static final String MAPPING_COLLECTION_TABLE_SCHEMA = PREFIX + "mapping_collectionTableSchema";
- public static final String MAPPING_COLLECTION_TABLE_CATALOG = PREFIX + "mapping_collectionTableCatalog";
-
- public static final String MAPPING_ELEMENT_COLLECTION_TARGET_CLASS = PREFIX + "mapping_elementCollectionTargetClass";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaJavaCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaJavaCompletionProposalComputer.java
deleted file mode 100644
index 64118423b7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaJavaCompletionProposalComputer.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.CompletionContext;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
-import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-
-/**
- * JPA Java code-completion proposal computer
- */
-public class JpaJavaCompletionProposalComputer
- implements IJavaCompletionProposalComputer
-{
- public JpaJavaCompletionProposalComputer() {
- super();
- }
-
- public void sessionStarted() {
- // do nothing
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public List computeCompletionProposals(ContentAssistInvocationContext context, IProgressMonitor monitor) {
- return (context instanceof JavaContentAssistInvocationContext) ?
- this.computeCompletionProposals((JavaContentAssistInvocationContext) context) :
- Collections.emptyList();
- }
-
- /**
- * We fail silently here because (it seems) <em>expected</em> exceptions occur
- * more frequently than intermittent <em>unexpected</em> exceptions that might
- * merit investigation (and a logged stacktrace might be the only hint as
- * to what happened).
- * <p>
- * We will get an <em>expected</em> exception (typically a {@link NullPointerException NPE})
- * here if the user:<ol>
- * <li>modifies the Java source file in a way that puts it drastically out
- * of sync with the Dali context model (e.g. deleting a field or
- * annotation)
- * <li>immediately invokes Content Assist (typically <code>Ctrl+Space</code>)
- * </ol>
- * The AST we build here will be based on the just-modified Java source; but,
- * since the user moved quickly and we will not have yet received any Java
- * change notification (since we only get a Java change notification when
- * the user has paused typing for at least 0.5 seconds), the context model
- * will still be based on the unmodified Java source. As the new AST is
- * passed down through the context model to the resource model all the code
- * expects to find the AST in sync with the model. When this is not the
- * case (e.g. a field in the resource model is no longer present in the AST
- * because the user has deleted it or modified the code in such a way that
- * the parser can no longer detect the field) the model will probably choke
- * when it cannot find the corresponding AST node.
- * <p>
- * It seems reasonable, in these situations, to simply return no completion
- * proposals. If the user simply waits a moment and tries again, we will be
- * able to successfully calculate some proposals.
- * <p>
- * ~bjv
- */
- private List<ICompletionProposal> computeCompletionProposals(JavaContentAssistInvocationContext context) {
- try {
- return this.computeCompletionProposals_(context);
- } catch (RuntimeException ex) {
- // JptJpaUiPlugin.log(ex); // don't log "expected" exceptions (?)
- return Collections.emptyList();
- }
- }
-
- private List<ICompletionProposal> computeCompletionProposals_(JavaContentAssistInvocationContext context) {
- ICompilationUnit cu = context.getCompilationUnit();
- if (cu == null) {
- return Collections.emptyList();
- }
-
- IFile file = this.getCorrespondingResource(cu);
- if (file == null) {
- return Collections.emptyList();
- }
-
- JpaFile jpaFile = this.getJpaFile(file);
- if (jpaFile == null) {
- return Collections.emptyList();
- }
-
- Collection<JpaStructureNode> rootStructureNodes = CollectionTools.collection(jpaFile.getRootStructureNodes());
- if (rootStructureNodes.isEmpty()) {
- return Collections.emptyList();
- }
-
- CompletionContext cc = context.getCoreContext();
-
- // the context's "token" is really a sort of "prefix" - it does NOT
- // correspond to the "start" and "end" we get below...
- char[] prefix = cc.getToken();
- Filter<String> filter = this.buildPrefixFilter(prefix);
- // the token "start" is the offset of the token's first character
- int tokenStart = cc.getTokenStart();
- // the token "end" is the offset of the token's last character (yuk)
- int tokenEnd = cc.getTokenEnd();
- if (tokenStart == -1) { // not sure why this happens - see bug 242286
- return Collections.emptyList();
- }
-
-// System.out.println("prefix: " + ((prefix == null) ? "[null]" : new String(prefix)));
-// System.out.println("token start: " + tokenStart);
-// System.out.println("token end: " + tokenEnd);
-// String source = cu.getSource();
-// String token = source.substring(Math.max(0, tokenStart), Math.min(source.length(), tokenEnd + 1));
-// System.out.println("token: =>" + token + "<=");
-// String snippet = source.substring(Math.max(0, tokenStart - 20), Math.min(source.length(), tokenEnd + 21));
-// System.out.println("surrounding snippet: =>" + snippet + "<=");
-
- // TODO move this parser call into the model...
- CompilationUnit astRoot = ASTTools.buildASTRoot(cu);
- List<ICompletionProposal> proposals = new ArrayList<ICompletionProposal>();
- for (JpaStructureNode structureNode : rootStructureNodes) {
- for (String s : ((JavaPersistentType) structureNode).getJavaCompletionProposals(context.getInvocationOffset(), filter, astRoot)) {
- proposals.add(new CompletionProposal(s, tokenStart, tokenEnd - tokenStart + 1, s.length()));
- }
- }
- return proposals;
- }
-
- private IFile getCorrespondingResource(ICompilationUnit cu) {
- try {
- return (IFile) cu.getCorrespondingResource();
- } catch (JavaModelException ex) {
- JptJpaUiPlugin.log(ex);
- return null;
- }
- }
-
- private JpaFile getJpaFile(IFile file) {
- return (JpaFile) file.getAdapter(JpaFile.class);
- }
-
- @SuppressWarnings({ "unchecked", "rawtypes" })
- public List computeContextInformation(ContentAssistInvocationContext context, IProgressMonitor monitor) {
- return Collections.emptyList();
- }
-
- public String getErrorMessage() {
- return null;
- }
-
- public void sessionEnded() {
- // do nothing
- }
-
- private Filter<String> buildPrefixFilter(char[] prefix) {
- return (prefix == null) ?
- Filter.Transparent.<String>instance() :
- new IgnoreCasePrefixFilter(prefix);
- }
-
- private static class IgnoreCasePrefixFilter
- implements Filter<String>
- {
- private final String prefix;
- IgnoreCasePrefixFilter(char[] prefix) {
- super();
- this.prefix = new String(prefix);
- }
- public boolean accept(String s) {
- return StringTools.stringStartsWithIgnoreCase(s, this.prefix);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaMappingImageHelper.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaMappingImageHelper.java
deleted file mode 100644
index 509a13eab8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaMappingImageHelper.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.swt.graphics.Image;
-
-public class JpaMappingImageHelper
-{
-
- public static Image imageForTypeMapping(String mappingKey) {
- return JptJpaUiPlugin.getImage(iconKeyForTypeMapping(mappingKey));
- }
-
- public static String iconKeyForTypeMapping(String mappingKey) {
- if (Tools.valuesAreEqual(mappingKey, MappingKeys.NULL_TYPE_MAPPING_KEY)) {
- return JptUiIcons.NULL_TYPE_MAPPING;
- }
- if (Tools.valuesAreEqual(mappingKey, MappingKeys.ENTITY_TYPE_MAPPING_KEY)) {
- return JptUiIcons.ENTITY;
- }
- if (Tools.valuesAreEqual(mappingKey, MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY)) {
- return JptUiIcons.EMBEDDABLE;
- }
- if (Tools.valuesAreEqual(mappingKey, MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY)) {
- return JptUiIcons.MAPPED_SUPERCLASS;
- }
- return null;
- }
-
- public static Image imageForAttributeMapping(String mappingKey) {
- return JptJpaUiPlugin.getImage(iconKeyForAttributeMapping(mappingKey));
- }
-
- public static String iconKeyForAttributeMapping(String mappingKey) {
- if (MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY == mappingKey) {
- return JptUiIcons.NULL_ATTRIBUTE_MAPPING;
- }
- else if (MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.BASIC;
- }
- else if (MappingKeys.ID_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.ID;
- }
- else if (MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.VERSION;
- }
- else if (MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.EMBEDDED_ID;
- }
- else if (MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.EMBEDDED;
- }
- else if (MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.ONE_TO_ONE;
- }
- else if (MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.ONE_TO_MANY;
- }
- else if (MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.MANY_TO_ONE;
- }
- else if (MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.MANY_TO_MANY;
- }
- else if (MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.ELEMENT_COLLECTION;
- }
- else if (MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY.equals(mappingKey)) {
- return JptUiIcons.TRANSIENT;
- }
- //return the JPA_CONTENT icon instead of null, might as well have an icon if one is not defined
- return JptUiIcons.JPA_CONTENT;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaPlatformAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaPlatformAdapterFactory.java
deleted file mode 100644
index bc1de165e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaPlatformAdapterFactory.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.internal.platform.JpaPlatformUiRegistry;
-
-/**
- * Factory to build adapters for a {@link JpaPlatform}:<ul>
- * <li>{@link JpaPlatformUi}
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- *
- * @see JpaPlatformUiRegistry
- */
-public class JpaPlatformAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JpaPlatformUi.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof JpaPlatform) {
- return this.getAdapter((JpaPlatform) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(JpaPlatform jpaPlatform, Class<?> adapterType) {
- if (adapterType == JpaPlatformUi.class) {
- return this.getJpaPlatformUi(jpaPlatform);
- }
- return null;
- }
-
- private JpaPlatformUi getJpaPlatformUi(JpaPlatform jpaPlatform) {
- return JpaPlatformUiRegistry.instance().getJpaPlatformUi(jpaPlatform.getId());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaStructureNodeAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaStructureNodeAdapterFactory.java
deleted file mode 100644
index 220c128fbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaStructureNodeAdapterFactory.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Factory to build adapters for a {@link JpaStructureNode}:<ul>
- * <li>{@link org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager.Factory}
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class JpaStructureNodeAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JpaDetailsPageManager.Factory.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof JpaStructureNode) {
- return this.getAdapter((JpaStructureNode) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(JpaStructureNode jpaStructureNode, Class<?> adapterType) {
- if (adapterType == JpaDetailsPageManager.Factory.class) {
- return this.getJpaDetailsPageManagerFactory(jpaStructureNode);
- }
- return null;
- }
-
- private JpaDetailsPageManager.Factory getJpaDetailsPageManagerFactory(JpaStructureNode jpaStructureNode) {
- return new JpaDetailsPageManagerFactory(jpaStructureNode);
- }
-
- /* CU private */ static class JpaDetailsPageManagerFactory
- implements JpaDetailsPageManager.Factory
- {
- private final JpaStructureNode jpaStructureNode;
-
- JpaDetailsPageManagerFactory(JpaStructureNode jpaStructureNode) {
- super();
- this.jpaStructureNode = jpaStructureNode;
- }
-
- @SuppressWarnings("unchecked")
- public <T extends JpaStructureNode> JpaDetailsPageManager<T> buildPageManager(Composite parent, WidgetFactory widgetFactory) {
- return (JpaDetailsPageManager<T>) this.getJpaPlatformUi().buildJpaDetailsPageManager(parent, this.jpaStructureNode, widgetFactory);
- }
-
- private JpaPlatformUi getJpaPlatformUi() {
- return (JpaPlatformUi) this.jpaStructureNode.getJpaPlatform().getAdapter(JpaPlatformUi.class);
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.jpaStructureNode);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaXmlCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaXmlCompletionProposalComputer.java
deleted file mode 100644
index e2c64319b9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JpaXmlCompletionProposalComputer.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-/**
- * This computer adds content assist support for a mapping file (ORM Configuration).
- *
- * @version 2.3
- * @since 2.3
- */
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.contentassist.CompletionProposal;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JpaXmlStructureNode;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.internal.contentassist.CustomCompletionProposal;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMDocument;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMElement;
-import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
-import org.eclipse.wst.xml.ui.internal.XMLUIMessages;
-import org.eclipse.wst.xml.ui.internal.contentassist.ContentAssistRequest;
-import org.eclipse.wst.xml.ui.internal.contentassist.XMLRelevanceConstants;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-
-public class JpaXmlCompletionProposalComputer extends DefaultJpaXmlCompletionProposalComputer {
-
- public JpaXmlCompletionProposalComputer() {
- }
-
- @Override
- public List<ICompletionProposal> computeCompletionProposals(
- CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
- try {
- return super.computeCompletionProposals(context, monitor);
- } catch (RuntimeException ex) {
- // When we run into any unexpected exception, we will log the exception
- // and then return an empty list to prevent code completion process from
- // crashing. We need to determine if runtime exceptions should be
- // expected. If so, we could remove the log(ex) in the future.
- JptJpaUiPlugin.log(ex);
- return Collections.emptyList();
- }
- }
-
- @Override
- protected void addAttributeValueProposals(ContentAssistRequest contentAssistRequest,
- CompletionProposalInvocationContext context) {
-
- List<String> proposedValues = getProposedValues(context);
-
- if (proposedValues.size() > 0 ) {
- String matchString = contentAssistRequest.getMatchString();
- if (matchString == null) {
- matchString = ""; //$NON-NLS-1$
- }
- if ((matchString.length() > 0) && (matchString.startsWith("\"") || matchString.startsWith("'"))) { //$NON-NLS-1$ //$NON-NLS-2$
- matchString = matchString.substring(1);
- }
- //create suggestions for this attribute value declaration
- int rOffset = contentAssistRequest.getReplacementBeginPosition();
- int rLength = contentAssistRequest.getReplacementLength();
- for (String possibleValue : proposedValues) {
- if ((matchString.length() == 0) || StringTools.stringStartsWithIgnoreCase(possibleValue, matchString)) {
- String rString = "\"" + possibleValue + "\""; //$NON-NLS-1$ //$NON-NLS-2$
- CompletionProposal proposal = new CompletionProposal(
- rString, rOffset, rLength, rString.length());
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- else {
- setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
- }
- }
-
- @SuppressWarnings("deprecation")
- @Override
- protected void addTagInsertionProposals(
- ContentAssistRequest contentAssistRequest, int childPosition,
- CompletionProposalInvocationContext context) {
-
- Node parent = contentAssistRequest.getParent();
-
- // This is only valid at the document element level
- // and only valid if it's a XML file
- if ((parent != null) && (parent.getNodeType() == Node.DOCUMENT_NODE) &&
- ((IDOMDocument) parent).isXMLType() && !isCursorAfterXMLPI(contentAssistRequest)) {
- return;
- }
- // only want completion proposals if cursor is after doctype...
- if (!isCursorAfterDoctype(contentAssistRequest)) {
- return;
- }
-
- if ((parent != null) && (parent instanceof IDOMNode) && isCommentNode((IDOMNode) parent)) {
- // loop and find non comment node?
- while ((parent != null) && isCommentNode((IDOMNode) parent)) {
- parent = parent.getParentNode();
- }
- }
-
- List<String> proposedValues = getProposedValues(context);
-
- if (proposedValues.size() > 0 ) {
- String matchString = contentAssistRequest.getMatchString();
- if (matchString == null) {
- matchString = ""; //$NON-NLS-1$
- }
-
- int begin = contentAssistRequest.getReplacementBeginPosition();
- int length = contentAssistRequest.getReplacementLength();
- if ((parent instanceof IDOMNode) && (parent.getNodeType() == Node.ELEMENT_NODE)) {
- if (((IDOMNode) parent).getLastStructuredDocumentRegion() != ((IDOMNode) parent).getFirstStructuredDocumentRegion()) {
- begin = ((IDOMNode) parent).getFirstStructuredDocumentRegion().getEndOffset();
- length = ((IDOMNode) parent).getLastStructuredDocumentRegion().getStartOffset() - begin;
- }
- }
-
- for (String possibleValue : proposedValues) {
- if ((matchString.length() == 0) || StringTools.stringStartsWithIgnoreCase(possibleValue, matchString)) {
- CustomCompletionProposal proposal = new CustomCompletionProposal(
- possibleValue, begin, length, possibleValue.length(),
- JptJpaUiPlugin.getImage(JptUiIcons.JPA_CONTENT),
- possibleValue, null, null, XMLRelevanceConstants.R_TAG_INSERTION);
- contentAssistRequest.addProposal(proposal);
- }
- }
- }
- else {
- setErrorMessage(XMLUIMessages.Content_Assist_not_availab_UI_);
- }
- }
-
- /**
- * Retrieves all of the possible valid values for this attribute/element declaration
- */
- private List<String> getProposedValues(CompletionProposalInvocationContext context) {
- List<String> list = new ArrayList<String>();
- int documentPosition = context.getInvocationOffset();
- if (documentPosition == -1) return Collections.emptyList();
-
- ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager();
- ITextFileBuffer buffer = manager.getTextFileBuffer(context.getDocument());
- if (buffer == null) return Collections.emptyList();
-
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile file = root.getFile(buffer.getLocation());
-
- JpaFile jpaFile = (JpaFile) file.getAdapter(JpaFile.class);
- if (jpaFile == null) return Collections.emptyList();
-
- Collection<JpaStructureNode> rootStructureNodes = CollectionTools.collection(jpaFile.getRootStructureNodes());
- if (rootStructureNodes.isEmpty()) {
- return Collections.emptyList();
- }
-
- for (JpaStructureNode node : rootStructureNodes) {
- Iterable<String> strings = ((JpaXmlStructureNode) node).getXmlCompletionProposals(documentPosition);
- if (strings != null) {
- CollectionTools.addAll(list, strings);
- } else {
- return Collections.emptyList();
- }
-
- }
- return list;
- }
-
- /**
- * This method can check if the cursor is after the XMLPI
- *
- * @param ContentAssistRequest car
- */
- protected boolean isCursorAfterXMLPI(ContentAssistRequest car) {
- Node aNode = car.getNode();
- boolean xmlpiFound = false;
- Document parent = aNode.getOwnerDocument();
- int xmlpiNodePosition = -1;
- boolean isAfterXMLPI = false;
-
- if (parent == null) {
- return true; // blank document case
- }
-
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- boolean xmlpi = ((child.getNodeType() == Node.PROCESSING_INSTRUCTION_NODE) && child.getNodeName().equals("xml")); //$NON-NLS-1$
- xmlpiFound = xmlpiFound || xmlpi;
- if (xmlpiFound) {
- if (child instanceof IDOMNode) {
- xmlpiNodePosition = ((IDOMNode) child).getEndOffset();
- isAfterXMLPI = (car.getReplacementBeginPosition() >= xmlpiNodePosition);
- }
- break;
- }
- }
- return isAfterXMLPI;
- }
-
- private boolean isCursorAfterDoctype(ContentAssistRequest car) {
- Node aNode = car.getNode();
- Document parent = aNode.getOwnerDocument();
- int xmldoctypeNodePosition = -1;
- boolean isAfterDoctype = true;
-
- if (parent == null) {
- return true; // blank document case
- }
-
- for (Node child = parent.getFirstChild(); child != null; child = child.getNextSibling()) {
- if (child instanceof IDOMNode) {
- if (child.getNodeType() == Node.DOCUMENT_TYPE_NODE) {
- xmldoctypeNodePosition = ((IDOMNode) child).getEndOffset();
- isAfterDoctype = (car.getReplacementBeginPosition() >= xmldoctypeNodePosition);
- break;
- }
- }
- }
- return isAfterDoctype;
- }
-
- /**
- * This is to determine if a tag is a special meta-info comment tag that
- * shows up as an ELEMENT
- *
- * @param node
- */
- private boolean isCommentNode(IDOMNode node) {
- return ((node != null) && (node instanceof IDOMElement) && ((IDOMElement) node).isCommentTag());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiIcons.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiIcons.java
deleted file mode 100644
index 843407c571..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiIcons.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.draw2d.ImageUtilities;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.ImageData;
-
-@SuppressWarnings("nls")
-public class JptUiIcons
-{
- /**
- * Creates and returns a new SWT image that is a grayed out version of the image
- * corresponding to the passed in key. Stores this gray image in the JptJpaUiPlugin
- * ImageRegistry with -gray appended to the key.
- * Clients of this method should not dispose of the image.
- *
- * @return a new grayed out image
- */
- public static Image ghost(String key) {
- Image existingImage = JptJpaUiPlugin.instance().getImageRegistry().get(key + "-gray");
- if (existingImage != null) {
- return existingImage;
- }
-
- Image grayImage = buildGhostImage(key);
- JptJpaUiPlugin.instance().getImageRegistry().put(key + "-gray", grayImage);
- return grayImage;
- }
-
- private static Image buildGhostImage(String key) {
- Image originalImage = JptJpaUiPlugin.getImage(key);
- Color lightGray = new Color(originalImage.getDevice(), 223, 223, 223);
- ImageData imageData = ImageUtilities.createShadedImage(originalImage, lightGray);
-
- Image shadedImage = new Image(originalImage.getDevice(), imageData);
- Image grayImage = new Image(originalImage.getDevice(), shadedImage, SWT.IMAGE_GRAY);
-
- lightGray.dispose();
- shadedImage.dispose();
- return grayImage;
- }
-
-
- // **************** General JPA icons **************************************
-
- public static final String JPA_CONTENT = "full/obj16/jpa-content";
-
- public static final String JPA_FILE = "full/obj16/jpa-file";
-
- public static final String JAR_FILE = "full/obj16/jpa-jar-file";
-
- public static final String WARNING = "full/obj16/warning";
-
-
- // **************** Wizard icons *******************************************
-
- public static final String JPA_WIZ_BANNER = "full/wizban/new_jpa_prj_wiz";
-
- public static final String ENTITY_WIZ_BANNER = "full/wizban/new_entity_wizban";
-
- public static final String JPA_FILE_WIZ_BANNER = "full/wizban/new_jpa_file_wizban";
-
-
- // **************** Persistence icons **************************************
-
- public static final String PERSISTENCE = "full/obj16/persistence";
-
- public static final String PERSISTENCE_UNIT = "full/obj16/persistence-unit";
-
- public static final String MAPPING_FILE_REF = "full/obj16/jpa-file";
-
- public static final String CLASS_REF = "full/obj16/null-type-mapping";
-
- public static final String JAR_FILE_REF = "full/obj16/jpa-jar-file";
-
-
- // **************** Orm icons **********************************************
-
- public static final String ENTITY_MAPPINGS = "full/obj16/entity-mappings";
-
-
- // **************** Orm/Java common icons **********************************
-
- public static final String ENTITY = "full/obj16/entity";
-
- public static final String EMBEDDABLE = "full/obj16/embeddable";
-
- public static final String MAPPED_SUPERCLASS = "full/obj16/mapped-superclass";
-
- public static final String NULL_TYPE_MAPPING = "full/obj16/null-type-mapping";
-
- public static final String ID = "full/obj16/id";
-
- public static final String EMBEDDED_ID = "full/obj16/embedded-id";
-
- public static final String BASIC = "full/obj16/basic";
-
- public static final String VERSION = "full/obj16/version";
-
- public static final String MANY_TO_ONE = "full/obj16/many-to-one";
-
- public static final String ONE_TO_MANY = "full/obj16/one-to-many";
-
- public static final String ONE_TO_ONE = "full/obj16/one-to-one";
-
- public static final String MANY_TO_MANY = "full/obj16/many-to-many";
-
- public static final String ELEMENT_COLLECTION = "full/obj16/element-collection";
-
- public static final String EMBEDDED = "full/obj16/embedded";
-
- public static final String TRANSIENT = "full/obj16/transient";
-
- public static final String NULL_ATTRIBUTE_MAPPING = "full/obj16/null-attribute-mapping";
-
-
- // **************** Content Assist icons **********************************
-
- public static final String JPQL_FUNCTION = "full/obj16/jpql.function";
-
- public static final String JPQL_IDENTIFIER = "full/obj16/jpql.identifier";
-
- public static final String JPQL_VARIABLE = "full/obj16/jpql.variable";
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiMessages.java
deleted file mode 100644
index de595118db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiMessages.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali UI.
- *
- * @version 3.0
- * @since 1.0
- */
-// TODO bjv rename...
-public class JptUiMessages {
- private static final String BUNDLE_NAME = "jpt_ui"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptUiMessages.class;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- public static String AccessTypeComposite_access;
- public static String AddToEarComposite_earMemberShip;
- public static String AddToEarComposite_addToEarLabel;
- public static String AddToEarComposite_earProjectLabel;
- public static String AddToEarComposite_newButtonLabel;
- public static String AddPersistentAttributeDialog_attributeLabel;
- public static String AddPersistentAttributeDialog_mappingLabel;
- public static String AddPersistentAttributeDialog_noMappingKeyError;
- public static String AddPersistentAttributeDialog_title;
- public static String AddPersistentClassDialog_classDialog_message;
- public static String AddPersistentClassDialog_classDialog_title;
- public static String AddPersistentClassDialog_classLabel;
- public static String AddPersistentClassDialog_classNotFoundWarning;
- public static String AddPersistentClassDialog_duplicateClassWarning;
- public static String AddPersistentClassDialog_mappingLabel;
- public static String AddPersistentClassDialog_noClassError;
- public static String AddPersistentClassDialog_noMappingKeyError;
- public static String AddPersistentClassDialog_title;
- public static String convertToJpa_convertingProject;
- public static String convertToJpa_detectingTechnologies;
- public static String DatabaseSchemaWizardPage_title;
- public static String DatabaseSchemaWizardPage_desc;
- public static String DatabaseSchemaWizardPage_schemaSettings;
- public static String DatabaseSchemaWizardPage_addConnectionToProject;
- public static String DatabaseSchemaWizardPage_connectLink;
- public static String DatabaseSchemaWizardPage_schema;
- public static String DatabaseSchemaWizardPage_connectionInfo;
- public static String DatabaseSchemaWizardPage_schemaInfo;
- public static String OpenJpaResourceAction_open;
- public static String OpenJpaResourceAction_error;
- public static String General_browse;
- public static String General_revert;
- public static String General_deselectAll;
- public static String General_selectAll;
- public static String General_refresh;
- public static String GenerateDDLWizard_title;
- public static String GenerateEntitiesWizard_generateEntities;
- public static String GenerateEntitiesWizardPage_chooseEntityTable;
- public static String GenerateEntitiesWizardPage_entityNameColumn;
- public static String GenerateEntitiesWizardPage_generateEntities;
- public static String GenerateEntitiesWizardPage_synchronizeClasses;
- public static String GenerateEntitiesWizardPage_tableColumn;
- public static String GenerateEntitiesWizardPage_tables;
- public static String GenericPlatformUiDialog_notSupportedMessageText;
- public static String GenericPlatformUiDialog_notSupportedMessageTitle;
- public static String JpaContent_label;
- public static String JpaDetailsView_viewNotAvailable;
- public static String JpaFacetWizardPage_addDriverLibraryLabel;
- public static String JpaFacetWizardPage_connectionLabel;
- public static String JpaFacetWizardPage_connectionLink;
- public static String JpaFacetWizardPage_connectLink;
- public static String JpaFacetWizardPage_connectedText;
- public static String JpaFacetWizardPage_createOrmXmlButton;
- public static String JpaFacetWizardPage_defaultCatalogLabel;
- public static String JpaFacetWizardPage_defaultSchemaLabel;
- public static String JpaFacetWizardPage_description;
- public static String JpaFacetWizardPage_discoverClassesButton;
- public static String JpaFacetWizardPage_driverLibraryLabel;
- public static String JpaFacetWizardPage_facetsPageLink;
- public static String JpaFacetWizardPage_metamodelSourceFolderLink;
- public static String JpaFacetWizardPage_jpaImplementationLabel;
- public static String JpaFacetWizardPage_jpaPrefsLink;
- public static String JpaFacetWizardPage_listClassesButton;
- public static String JpaFacetWizardPage_metamodelLabel;
- public static String JpaFacetWizardPage_none;
- public static String JpaFacetWizardPage_overrideDefaultCatalogLabel;
- public static String JpaFacetWizardPage_overrideDefaultSchemaLabel;
- public static String JpaFacetWizardPage_persistentClassManagementLabel;
- public static String JpaFacetWizardPage_platformLabel;
- public static String JpaFacetWizardPage_specifyLibLabel;
- public static String JpaFacetWizardPage_title;
- public static String JpaFacetWizardPage_userLibsLink;
- public static String JpaFacetWizardPage_userServerLibLabel;
- public static String JpaJpqlJavaCompletionProposalComputer_Error;
- public static String JpaJpqlSseCompletionProposalComputer_Error;
- public static String JpaLibraryProviderInstallPanel_includeLibraries;
- public static String JpaMakePersistentWizardPage_title;
- public static String JpaMakePersistentWizardPage_message;
- public static String JpaMakePersistentWizardPage_annotateInJavaRadioButton;
- public static String JpaMakePersistentWizardPage_mappingFileRadioButton;
- public static String JpaMakePersistentWizardPage_mappingFileLink;
- public static String JpaMakePersistentWizardPage_mappingFileBrowseButton;
- public static String JpaMakePersistentWizardPage_typeTableColumn;
- public static String JpaMakePersistentWizardPage_mappingTableColumn;
- public static String JpaMakePersistentWizardPage_listInPersistenceXmlCheckBox;
- public static String JpaMakePersistentWizardPage_selectedTypesPersistentError;
- public static String JpaMakePersistentWizardPage_mappingFileDoesNotExistError;
- public static String JpaMakePersistentWizardPage_mappingFileNotListedInPersistenceXmlError;
- public static String JpaStructureView_linkWithEditorDesc;
- public static String JpaStructureView_linkWithEditorText;
- public static String JpaStructureView_linkWithEditorTooltip;
- public static String JpaStructureView_structureNotAvailable;
- public static String JpaStructureView_structureProviderNotAvailable;
- public static String JpaStructureView_numItemsSelected;
- public static String JpqlContentProposalProvider_Description;
- public static String MappingFileWizard_title;
- public static String MappingFileWizardPage_newFile_title;
- public static String MappingFileWizardPage_newFile_desc;
- public static String MappingFileWizardPage_options_title;
- public static String MappingFileWizardPage_options_desc;
- public static String MappingFileWizardPage_projectLabel;
- public static String MappingFileWizardPage_sourceFolderLabel;
- public static String MappingFileWizardPage_filePathLabel;
- public static String MappingFileWizardPage_accessLabel;
- public static String MappingFileWizardPage_addToPersistenceUnitButton;
- public static String MappingFileWizardPage_persistenceUnitLabel;
- public static String MappingFileWizardPage_incorrectSourceFolderError;
- public static String MappingFileWizardPage_accessLabel_sourceFolderDialogTitle;
- public static String MappingFileWizardPage_accessLabel_sourceFolderDialogDesc;
- public static String JpaProjectWizard_title;
- public static String NewJpaProjectWizard_firstPage_description;
- public static String NewJpaProjectWizard_firstPage_title;
- public static String OrmItemLabelProviderFactory_entityMappingsLabel;
- public static String OverwriteConfirmerDialog_text;
- public static String OverwriteConfirmerDialog_title;
- public static String PersistenceItemLabelProviderFactory_persistenceLabel;
- public static String EntitiesGenerator_jobName;
- public static String JptPreferencesPage_DoNotShowDialogs;
- public static String JptPreferencesPage_DoNotShowText;
- public static String JptPreferencesPage_ClearButtonText;
- public static String JpaPreferencesPage_description;
- public static String JpaPreferencesPage_entityGen;
- public static String JpaPreferencesPage_entityGen_defaultPackageLabel;
- public static String JpaPreferencesPage_jpqlEditor;
- public static String JpaPreferencesPage_jpqlEditor_description;
- public static String JpaPreferencesPage_jpqlEditor_lowerCaseRadioButton;
- public static String JpaPreferencesPage_jpqlEditor_matchFirstCharacterCaseRadioButton;
- public static String JpaPreferencesPage_jpqlEditor_upperCaseRadioButton;
- public static String JpaProblemSeveritiesPage_Description;
- public static String JpaProblemSeveritiesPage_Error;
- public static String JpaProblemSeveritiesPage_Ignore;
- public static String JpaProblemSeveritiesPage_Info;
- public static String JpaProblemSeveritiesPage_Warning;
- public static String JpaEntityGenPreferencePage_Description;
- public static String JpaEntityGenPreferencePage_generalGroup_title;
- public static String JpaEntityGenPreferencePage_defaultPackageLabel;
-
- public static String SelectJpaProjectWizardPage_title;
- public static String SelectJpaProjectWizardPage_msg;
-
- public static String SelectMappingFileDialog_title;
- public static String SelectMappingFileDialog_message;
- public static String SelectMappingFileDialog_newButton;
- public static String SelectMappingFileDialog_newButtonToolTip;
-
- public static String SynchronizingClasses_TaskName;
-
- public static String JavaMetadataConversionWizard_title;
- public static String JavaMetadataConversion_warning;
- public static String JavaMetadataConversion_mappingFileDoesNotExist;
- public static String JavaMetadataConversion_mappingFileVersionIsInvalid;
- public static String JavaMetadataConversion_mappingFileNotListedInPersistenceXml;
- public static String JavaMetadataConversion_noGeneratorsToConvert;
- public static String JavaMetadataConversion_noQueriesToConvert;
- public static String JavaMetadataConversionWizardPage_mappingFileBrowseButton;
- public static String JavaMetadataConversionWizardPage_mappingFileBrowseButtonToolTip;
- public static String JavaMetadataConversionWizardPage_label;
- public static String JavaMetadataConversionWizardPage_newMappingFileLink;
- public static String JavaMetadataConversionWizardPage_newMappingFileLinkToolTip;
- public static String JavaGeneratorConversionWizardPage_title;
- public static String JavaGeneratorConversionWizardPage_description;
- public static String JavaQueryConversionWizardPage_title;
- public static String JavaQueryConversionWizardPage_description;
-
- private JptUiMessages() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiValidationPreferenceMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiValidationPreferenceMessages.java
deleted file mode 100644
index 70bd05765b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/JptUiValidationPreferenceMessages.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.osgi.util.NLS;
-
-//Content is organized based on the categories and entries in each categories are listed alphabetically.
-//If adding a new entry, please add it to the corresponding category at the right place.
-
-public class JptUiValidationPreferenceMessages {
-
- // Project Category
- public static String PROJECT_LEVEL_CATEGORY;
-
- public static String NO_JPA_PROJECT;
- public static String PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS;
- public static String PERSISTENCE_NO_PERSISTENCE_UNIT;
- public static String PERSISTENCE_XML_INVALID_CONTENT;
- public static String PERSISTENCE_XML_UNSUPPORTED_CONTENT; //3.0 M7
- public static String PROJECT_INACTIVE_CONNECTION;
- public static String PROJECT_INVALID_CONNECTION;
- public static String PROJECT_INVALID_LIBRARY_PROVIDER; // 3.0 M7
- public static String PROJECT_MULTIPLE_PERSISTENCE_XML;
- public static String PROJECT_NO_CONNECTION;
- public static String PROJECT_NO_PERSISTENCE_XML;
- public static String XML_VERSION_NOT_LATEST;
-
- // Persistence Unit Category
- public static String PERSISTENCE_UNIT_LEVEL_CATEGORY;
-
- public static String MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_METADATA;
- public static String PERSISTENT_TYPE_DUPLICATE_CLASS; //3.0 M7
- public static String PERSISTENCE_UNIT_DUPLICATE_CLASS;
- public static String PERSISTENCE_UNIT_DUPLICATE_JAR_FILE;
- public static String PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE;
- public static String PERSISTENCE_UNIT_INVALID_CLASS;
- public static String PERSISTENCE_UNIT_INVALID_MAPPING_FILE;
- public static String PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING;
- public static String PERSISTENCE_UNIT_NONEXISTENT_CLASS;
- public static String PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE;
- public static String PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE;
- public static String PERSISTENCE_UNIT_REDUNDANT_CLASS;
- public static String PERSISTENCE_UNIT_UNSPECIFIED_CLASS;
- public static String PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE;
- public static String PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE;
- public static String PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT;
-
- // Type Category
- public static String TYPE_LEVEL_CATEGORY;
-
- public static String ENTITY_NAME_DUPLICATED; //3.0 M7
- public static String ENTITY_NAME_MISSING; //3.0 M7
- public static String ENTITY_NO_PK;
- public static String ENTITY_NON_ROOT_ID_ATTRIBUTE_SPECIFIED; //3.0 M7
- public static String ENTITY_NON_ROOT_ID_CLASS_SPECIFIED; //3.0 M7
- public static String PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT;
- public static String PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT;
- public static String PERSISTENT_TYPE_UNRESOLVED_CLASS;
- public static String PERSISTENT_TYPE_UNSPECIFIED_CLASS;
- public static String TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR;
- public static String TYPE_MAPPING_CLASS_PRIVATE_NO_ARG_CONSTRUCTOR;
- public static String TYPE_MAPPING_FINAL_CLASS;
- public static String TYPE_MAPPING_ID_AND_EMBEDDED_ID_BOTH_USED;
- public static String TYPE_MAPPING_ID_CLASS_AND_EMBEDDED_ID_BOTH_USED; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_DOES_NOT_EXIST; //3.2
- public static String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_DUPLICATE_MATCH; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_NO_MATCH; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NO_MATCH; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NOT_PRIMARY_KEY; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_ATTRIBUTE_TYPE_DOES_NOT_AGREE; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_MISSING_EQUALS_METHOD; //3.2
- public static String TYPE_MAPPING_ID_CLASS_MISSING_HASHCODE_METHOD; //3.2
- public static String TYPE_MAPPING_ID_CLASS_MISSING_NO_ARG_CONSTRUCTOR; //3.2
- public static String TYPE_MAPPING_ID_CLASS_MISSING_PUBLIC_NO_ARG_CONSTRUCTOR; //3.2
- public static String TYPE_MAPPING_ID_CLASS_NAME_EMPTY; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_NOT_IMPLEMENT_SERIALIZABLE; //3.2
- public static String TYPE_MAPPING_ID_CLASS_NOT_PUBLIC; //3.2
- public static String TYPE_MAPPING_ID_CLASS_NOT_EXIST; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_PROPERTY_METHOD_NOT_PUBLIC; //3.2
- public static String TYPE_MAPPING_ID_CLASS_REDEFINED; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_REQUIRED; //3.0 M7
- public static String TYPE_MAPPING_ID_CLASS_WITH_MAPS_ID; //3.0 M7
- public static String TYPE_MAPPING_MAPS_ID_ATTRIBUTE_TYPE_DOES_NOT_AGREE; //3.0 M7
- public static String TYPE_MAPPING_MEMBER_CLASS;
- public static String TYPE_MAPPING_MULTIPLE_EMBEDDED_ID; //3.0 M7
- public static String TYPE_MAPPING_PK_REDEFINED_ID_ATTRIBUTE; //3.0 M7
- public static String TYPE_MAPPING_PK_REDEFINED_ID_CLASS; //3.0 M7
-
- // Attribute Category
- public static String ATTRIBUTE_LEVEL_CATEGORY;
-
- public static String ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST;// 3.0 M7
- public static String ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE;
- public static String ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED;
- public static String ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING;
- public static String ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING;
- public static String EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC;
- public static String EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE;
- public static String EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR;
- public static String EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE;
- public static String EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS;
- public static String EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED; //3.0 M7
- public static String ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED; //3.0 M7
- public static String MAPS_ID_VALUE_INVALID;
- public static String MAPS_ID_VALUE_NOT_RESOLVED;
- public static String MAPS_ID_VALUE_NOT_SPECIFIED;
- public static String MAPPING_INVALID_MAPPED_BY;
- public static String MAPPING_MAPPED_BY_ON_BOTH_SIDES;
- public static String MAPPING_MAPPED_BY_WITH_JOIN_TABLE;
- public static String MAPPING_UNRESOLVED_MAPPED_BY;
- public static String ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED;
- public static String PERSISTENT_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE; //3.0 M7
- public static String PERSISTENT_ATTRIBUTE_FINAL_FIELD;
- public static String PERSISTENT_ATTRIBUTE_FINAL_GETTER;
- public static String PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED;
- public static String PERSISTENT_ATTRIBUTE_INVALID_MAPPING;
- public static String PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE; //3.0 M7
- public static String PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE;
- public static String PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE; //3.0 M7
- public static String PERSISTENT_ATTRIBUTE_PUBLIC_FIELD;
- public static String PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME;
- public static String PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME;
- public static String TARGET_ENTITY_IS_NOT_AN_ENTITY;
- public static String TARGET_ENTITY_NOT_DEFINED;
- public static String TARGET_ENTITY_NOT_EXIST;
- public static String TARGET_NOT_AN_EMBEDDABLE; //3.0 M7
- public static String MAP_KEY_CLASS_NOT_DEFINED;
- public static String MAP_KEY_CLASS_NOT_EXIST;
- public static String MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE;
- public static String ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE;
-
- // ---------- Implied Attributes ------------
- public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST;
- public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE;
- public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED;
- public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING;
- public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING;
- public static String VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY;
- public static String VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED;
- public static String VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE;
- public static String VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE;
- public static String VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE;
- public static String VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE;
- public static String VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE;
- public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR;
- public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE;
- public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS;
- public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE;
- public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC;
- public static String VIRTUAL_ATTRIBUTE_EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED;
-
-
- // Database Category
- public static String DATABASE_CATEGORY;
- public static String IMPLIED_ATTRIBUTE_LEVEL_CATEGORY;
-
- // *********** Table Category ***********
- public static String TABLE_CATEGORY;
-
- public static String COLLECTION_TABLE_UNRESOLVED_CATALOG;
- public static String COLLECTION_TABLE_UNRESOLVED_NAME;
- public static String COLLECTION_TABLE_UNRESOLVED_SCHEMA;
- public static String JOIN_TABLE_UNRESOLVED_CATALOG;
- public static String JOIN_TABLE_UNRESOLVED_NAME;
- public static String JOIN_TABLE_UNRESOLVED_SCHEMA;
- public static String SECONDARY_TABLE_UNRESOLVED_CATALOG;
- public static String SECONDARY_TABLE_UNRESOLVED_NAME;
- public static String SECONDARY_TABLE_UNRESOLVED_SCHEMA;
- public static String TABLE_UNRESOLVED_CATALOG;
- public static String TABLE_UNRESOLVED_NAME;
- public static String TABLE_UNRESOLVED_SCHEMA;
- // ---------- Implied Attributes ------------
- public static String VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG;
- public static String VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA;
- public static String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG;
- public static String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA;
-
- // *********** Column Category ***********
- public static String COLUMN_CATEGORY;
-
- public static String COLUMN_TABLE_NOT_VALID;
- public static String COLUMN_UNRESOLVED_NAME;
- public static String COLUMN_UNRESOLVED_TABLE;
- public static String INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String INVERSE_JOIN_COLUMN_TABLE_NOT_VALID;
- public static String INVERSE_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- public static String JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String JOIN_COLUMN_TABLE_NOT_VALID;
- public static String JOIN_COLUMN_UNRESOLVED_NAME;
- public static String JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- public static String MAP_KEY_COLUMN_TABLE_NOT_VALID;
- public static String MAP_KEY_COLUMN_UNRESOLVED_NAME; //3.0 M7
- public static String ORDER_COLUMN_UNRESOLVED_NAME;
- public static String PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- public static String MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID;
- public static String MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- // ---------- Implied Attributes ------------
- public static String VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME; //3.0 M7
- public static String VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- public static String VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
-
- // *********** Overrides Category ***********
- public static String OVERRIDES_CATEGORY;
-
- public static String ASSOCIATION_OVERRIDE_INVALID_NAME;
- public static String ATTRIBUTE_OVERRIDE_INVALID_NAME;
- public static String ATTRIBUTE_OVERRIDE_INVALID_TYPE; //3.0 M7
- public static String ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED; //3.0 M7
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_CATALOG;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_NAME;
- public static String VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_SCHEMA;
- public static String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME;
- public static String VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME;
- // ---------- Implied Attributes ------------
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME;
- public static String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME;
- public static String VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME; //3.0 M7
- public static String VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME; //3.0 M7
-
- // Inheritance Category
- public static String INHERITANCE_CATEGORY;
-
- public static String DISCRIMINATOR_COLUMN_UNRESOLVED_NAME;
- public static String ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED;
- public static String ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE;
- public static String ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED;
- public static String ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE;
- public static String ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED;
- public static String ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED;
- public static String ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM;
- public static String ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM;
-
- // Queries and Generators Category
- public static String QUERIES_GENERATORS_CATEGORY;
-
- public static String GENERATOR_DUPLICATE_NAME;
- public static String GENERATOR_NAME_UNDEFINED; // 3.0 M7
- public static String ID_MAPPING_UNRESOLVED_GENERATOR_NAME;
- public static String JPQL_QUERY_VALIDATION; //3.0 M7
- public static String QUERY_DUPLICATE_NAME;
- public static String QUERY_NAME_UNDEFINED; // 3.0 M7
- public static String QUERY_STATEMENT_UNDEFINED; // 3.0 M7
-
- private static final String BUNDLE_NAME = "jpt_ui_validation_preferences"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptUiValidationPreferenceMessages.class;
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptUiValidationPreferenceMessages() {
- throw new UnsupportedOperationException();
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/ProjectAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/ProjectAdapterFactory.java
deleted file mode 100644
index 8f5ff00a3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/ProjectAdapterFactory.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.common.utility.internal.AbstractTransformer;
-import org.eclipse.jpt.common.utility.internal.SimpleFilter;
-import org.eclipse.jpt.common.utility.internal.model.value.ElementPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.ui.JpaProjectModel;
-import org.eclipse.jpt.jpa.ui.JpaProjectsModel;
-import org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel;
-
-/**
- * Factory to build Dali adapters for an {@link IProject}:<ul>
- * <li>{@link org.eclipse.jpt.jpa.ui.JpaProjectModel JpaProjectModel} -
- * This adapter will only return a JPA project if it is immediately
- * available; but it will also notify listeners if the JPA project is
- * ever created.
- * This adapter should be used by any process that can temporarily ignore
- * any uncreated JPA projects but should be notified if the JPA project
- * <em>is</em> ever created (e.g. UI views).
- * <li>{@link org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel JpaRootContextNodeModel} -
- * This adapter is much like the {@link org.eclipse.jpt.jpa.ui.JpaProjectModel JpaProjectModel}
- * adapter described above.
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class ProjectAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] {
- JpaProjectModel.class,
- JpaRootContextNodeModel.class
- };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IProject) {
- return this.getAdapter((IProject) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IProject project, Class<?> adapterType) {
- if (adapterType == JpaProjectModel.class) {
- return this.getJpaProjectModel(project);
- }
- if (adapterType == JpaRootContextNodeModel.class) {
- return this.getJpaRootContextNodeModel(project);
- }
- return null;
- }
-
- private JpaProjectModel getJpaProjectModel(IProject project) {
- return new JpaProjectModelAdapter(this.getJpaProjectsModel(project.getWorkspace()), project);
- }
-
- private JpaProjectsModel getJpaProjectsModel(IWorkspace workspace) {
- return (JpaProjectsModel) workspace.getAdapter(JpaProjectsModel.class);
- }
-
- private JpaRootContextNodeModel getJpaRootContextNodeModel(IProject project) {
- return new JpaRootContextNodeModelAdapter(this.getJpaProjectModel(project));
- }
-
-
- // ********** JPA project model **********
-
- /**
- * Implement a property value model for the JPA project corresponding to a
- * {@link IProject project}. The model will fire change events when the
- * corresponding JPA project is added or removed from the JPA project
- * manager. This is useful for UI code that does not want to wait to
- * retrieve a JPA project but wants to be notified when it is available.
- * <p>
- * Subclass {@link ElementPropertyValueModelAdapter} so we can
- * implement {@link org.eclipse.jpt.jpa.ui.JpaProjectModel}.
- * <p>
- * <strong>NB:</strong> This model operates outside of all the other
- * activity synchronized by the JPA project manager; but that should be OK
- * since it will be kept synchronized with the JPA manager's collection of
- * JPA projects in the end.
- */
- /* CU private */ static class JpaProjectModelAdapter
- extends ElementPropertyValueModelAdapter<JpaProject>
- implements JpaProjectModel
- {
- JpaProjectModelAdapter(CollectionValueModel<JpaProject> jpaProjectsModel, IProject project) {
- super(jpaProjectsModel, new Predicate(project));
- }
-
- public IProject getProject() {
- return ((Predicate) this.predicate).getCriterion();
- }
-
- /* class private */ static class Predicate
- extends SimpleFilter<JpaProject, IProject>
- {
- Predicate(IProject project) {
- super(project);
- }
- @Override
- public boolean accept(JpaProject jpaProject) {
- return jpaProject.getProject().equals(this.criterion);
- }
- }
- }
-
-
- // ********** JPA root context node model **********
-
- /**
- * Implement a property value model for the JPA root context node
- * corresponding to a {@link JpaProject JPA project}. The model will fire
- * change events when the corresponding JPA project is added or removed
- * from the JPA project manager. This is useful for UI code that does not
- * want to wait to retrieve a JPA root context node but wants to be notified
- * when it is available.
- * <p>
- * Subclass {@link TransformationPropertyValueModel} so we can
- * implement {@link org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel}.
- * <p>
- * <strong>NB:</strong> This model operates outside of all the other
- * activity synchronized by the JPA project manager; but that should be OK
- * since it will be kept synchronized with the JPA manager's collection of
- * JPA projects in the end.
- */
- /* CU private */ static class JpaRootContextNodeModelAdapter
- extends TransformationPropertyValueModel<JpaProject, JpaRootContextNode>
- implements JpaRootContextNodeModel
- {
- JpaRootContextNodeModelAdapter(JpaProjectModel jpaProjectsModel) {
- super(jpaProjectsModel, TRANSFORMER);
- }
-
- public IProject getProject() {
- return ((JpaProjectModel) this.valueModel).getProject();
- }
-
- private static final Transformer TRANSFORMER = new Transformer();
-
- /* class private */ static class Transformer
- extends AbstractTransformer<JpaProject, JpaRootContextNode>
- {
- @Override
- protected JpaRootContextNode transform_(JpaProject jpaProject) {
- return jpaProject.getRootContextNode();
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/WorkspaceAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/WorkspaceAdapterFactory.java
deleted file mode 100644
index 96254f916e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/WorkspaceAdapterFactory.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal;
-
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaProjectManager;
-import org.eclipse.jpt.jpa.ui.JpaProjectsModel;
-
-/**
- * Factory to build Dali adapters for an {@link IWorkspace}:<ul>
- * <li>{@link org.eclipse.jpt.jpa.ui.JpaProjectsModel JpaProjectsModel} -
- * This adapter will only return a JPA project if it is immediately
- * available; but it will also notify listeners if the JPA project is
- * ever created.
- * This adapter should be used by any process that can temporarily ignore
- * any uncreated JPA projects but should be notified if the JPA project
- * <em>is</em> ever created (e.g. UI views).
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class WorkspaceAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] {
- JpaProjectsModel.class
- };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IWorkspace) {
- return this.getAdapter((IWorkspace) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IWorkspace workspace, Class<?> adapterType) {
- if (adapterType == JpaProjectsModel.class) {
- return this.getJpaProjectsModel(workspace);
- }
- return null;
- }
-
- private JpaProjectsModel getJpaProjectsModel(IWorkspace workspace) {
- return new JpaProjectsModelAdapter(this.getJpaProjectManager(workspace));
- }
-
- private JpaProjectManager getJpaProjectManager(IWorkspace workspace) {
- return (JpaProjectManager) workspace.getAdapter(JpaProjectManager.class);
- }
-
-
- // ********** JPA projects model **********
-
- /**
- * Adapt the JPA project manager's JPA projects list to the collection value
- * model interface.
- */
- /* CU private */ static class JpaProjectsModelAdapter
- extends CollectionAspectAdapter<JpaProjectManager, JpaProject>
- implements JpaProjectsModel
- {
- JpaProjectsModelAdapter(JpaProjectManager jpaProjectManager) {
- super(JpaProjectManager.JPA_PROJECTS_COLLECTION, jpaProjectManager);
- }
-
- @Override
- protected Iterable<JpaProject> getIterable() {
- return this.subject.getJpaProjects();
- }
-
- @Override
- protected int size_() {
- return this.subject.getJpaProjectsSize();
- }
-
- public IWorkspace getWorkspace() {
- return this.subject.getWorkspace();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/GenerateDDLAction.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/GenerateDDLAction.java
deleted file mode 100644
index f6aca3be2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/GenerateDDLAction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.actions;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-
-/**
- * GenerateDDLAction
- */
-public class GenerateDDLAction extends ProjectAction {
-
- public GenerateDDLAction() {
- super();
- }
-
- @Override
- protected void execute(JpaProject project) {
- this.getJpaPlatformUi(project).generateDDL(project, this.getCurrentSelection());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/GenerateEntitiesAction.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/GenerateEntitiesAction.java
deleted file mode 100644
index 383633831a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/GenerateEntitiesAction.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2007, 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.actions;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-
-/**
- * GenerateEntitiesAction
- */
-public class GenerateEntitiesAction extends ProjectAction {
- public GenerateEntitiesAction() {
- super();
- }
-
- @Override
- protected void execute(JpaProject project) {
- this.getJpaPlatformUi(project).generateEntities(project, this.getCurrentSelection());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/MakePersistentAction.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/MakePersistentAction.java
deleted file mode 100644
index 50d2ce4e93..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/MakePersistentAction.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2010, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.wizards.JpaMakePersistentWizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-
-public class MakePersistentAction implements IObjectActionDelegate {
-
-
- private Map<IProject, List<IType>> selectedTypes;
-
- public MakePersistentAction() {
- super();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- // Action is contributed for IType, ICompilationUnit, IPackageFragment, and IPackageFragmentRoot that is a source folder
- this.selectedTypes = this.buildSelectedTypes((StructuredSelection) selection);
- }
-
- protected Map<IProject, List<IType>> buildSelectedTypes(StructuredSelection structuredSelection) {
- Map<IProject, List<IType>> types = new HashMap<IProject, List<IType>>();
-
- for (Object selection : structuredSelection.toList()) {
- switch (((IJavaElement) selection).getElementType()) {
- case IJavaElement.TYPE :
- addSelectedType((IType) selection, types);
- break;
- case IJavaElement.COMPILATION_UNIT :
- addSelectedType((ICompilationUnit) selection, types);
- break;
- case IJavaElement.PACKAGE_FRAGMENT :
- addSelectedType((IPackageFragment) selection, types);
- break;
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- addSelectedType((IPackageFragmentRoot) selection, types);
- break;
- default :
- break;
- }
- }
- return types;
- }
-
- private void addSelectedType(IPackageFragmentRoot packageFragmentRoot, Map<IProject, List<IType>> types) {
- for (IJavaElement pkgFragment : getPackageFragments(packageFragmentRoot)) {
- addSelectedType((IPackageFragment) pkgFragment, types);
- }
- }
-
- private void addSelectedType(IPackageFragment packageFragment, Map<IProject, List<IType>> types) {
- for (ICompilationUnit compUnit : getCompilationUnits(packageFragment)) {
- addSelectedType(compUnit, types);
- }
- }
-
- private void addSelectedType(ICompilationUnit compilationUnit, Map<IProject, List<IType>> types) {
- IType primaryType = this.getPrimaryType(compilationUnit);
- if (primaryType != null) {
- this.addSelectedType(primaryType, types);
- }
- }
-
- private void addSelectedType(IType primaryType, Map<IProject, List<IType>> typesMap) {
- IProject project = primaryType.getJavaProject().getProject();
- List<IType> types = typesMap.get(project);
- if (types == null) {
- types = new ArrayList<IType>();
- typesMap.put(project, types);
- }
- if (!types.contains(primaryType)) {
- types.add(primaryType);
- }
- }
-
- private ICompilationUnit[] getCompilationUnits(IPackageFragment packageFragment) {
- try {
- return packageFragment.getCompilationUnits();
- }
- catch (JavaModelException e) {
- JptJpaUiPlugin.log(e);
- }
- return new ICompilationUnit[0];
- }
-
- private IJavaElement[] getPackageFragments(IPackageFragmentRoot packageFragmentRoot) {
- try {
- return packageFragmentRoot.getChildren();
- }
- catch (JavaModelException e) {
- JptJpaUiPlugin.log(e);
- }
- return new IJavaElement[0];
- }
-
- private IType getPrimaryType(ICompilationUnit compilationUnit) {
- return compilationUnit.findPrimaryType();
- }
-
- public void run(IAction action) {
- for (List<IType> types : this.selectedTypes.values()) {
- IProject project = types.get(0).getResource().getProject();
- JpaProject jpaProject = (JpaProject) project.getAdapter(JpaProject.class);
- if (jpaProject != null) {
- //open the wizard once for each selected project
- JpaMakePersistentWizard wizard = new JpaMakePersistentWizard(jpaProject, types);
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- dialog.open();
- }
- }
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/OpenJpaResourceAction.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/OpenJpaResourceAction.java
deleted file mode 100644
index 32e6e73985..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/OpenJpaResourceAction.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.actions;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.IEditorDescriptor;
-import org.eclipse.ui.IEditorRegistry;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.BaseSelectionListenerAction;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.part.FileEditorInput;
-
-/**
- * The selection will be a JPA context node.
- * @see org.eclipse.jpt.jpa.ui.internal.navigator.JpaNavigatorActionProvider
- */
-public class OpenJpaResourceAction
- extends BaseSelectionListenerAction
-{
- private JpaContextNode selectedNode;
-
-
- public OpenJpaResourceAction() {
- super(JptUiMessages.OpenJpaResourceAction_open);
- }
-
- @Override
- public boolean updateSelection(IStructuredSelection s) {
- this.selectedNode = null;
- return super.updateSelection(s) && this.updateSelection_(s);
- }
-
- private boolean updateSelection_(IStructuredSelection s) {
- if (s.size() == 1) {
- this.selectedNode = (JpaContextNode) s.getFirstElement();
- return true;
- }
- return false;
- }
-
- @Override
- public void run() {
- if (this.isEnabled()) {
- this.run_();
- }
- }
-
- private void run_() {
- IResource resource = this.selectedNode.getResource();
- if ((resource != null) && resource.exists() && (resource.getType() == IResource.FILE)) {
- this.openEditor((IFile) resource);
- if (this.selectedNode instanceof JpaStructureNode) {
- JpaSelectionManager selectionManager = PlatformTools.getAdapter(PlatformUI.getWorkbench(), JpaSelectionManager.class);
- selectionManager.setSelection((JpaStructureNode) this.selectedNode);
- }
- }
- }
-
- protected void openEditor(IFile file) {
- IEditorRegistry registry = PlatformUI.getWorkbench().getEditorRegistry();
- IContentType contentType = IDE.getContentType(file);
- IEditorDescriptor editorDescriptor = registry.getDefaultEditor(file.getName(), contentType);
- if (editorDescriptor == null) {
- return; // no editor associated...
- }
-
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- try {
- page.openEditor(new FileEditorInput(file), editorDescriptor.getId());
- }
- catch (Exception e) {
- MessageDialog.openError(page.getWorkbenchWindow().getShell(), JptUiMessages.OpenJpaResourceAction_error, e.getMessage());
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/ProjectAction.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/ProjectAction.java
deleted file mode 100644
index 488b81e641..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/ProjectAction.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.actions;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.internal.platform.JpaPlatformUiRegistry;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * Override any of the #execute() methods.
- */
-public abstract class ProjectAction
- implements IObjectActionDelegate
-{
- private ISelection currentSelection;
-
-
- public ProjectAction() {
- super();
- }
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // do nothing
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- this.currentSelection = selection;
- }
-
- protected IStructuredSelection getCurrentSelection() {
- if (this.currentSelection instanceof IStructuredSelection) {
- return (IStructuredSelection) this.currentSelection;
- }
- return null;
- }
-
- public void run(IAction action) {
- if (this.currentSelection instanceof IStructuredSelection) {
- for (Object each : ((IStructuredSelection) this.currentSelection).toArray()) {
- this.execute(each);
- }
- }
- }
-
- protected void execute(Object selection) {
- IProject project = this.projectFromSelection(selection);
- if (project != null) {
- this.execute(project);
- }
- }
-
- protected IProject projectFromSelection(Object selection) {
- if (selection instanceof IProject) {
- return (IProject) selection;
- }
- if (selection instanceof IJavaProject) {
- return ((IJavaProject) selection).getProject();
- }
- return null;
- }
-
- protected JpaPlatformUi getJpaPlatformUi(JpaProject project) {
- return (JpaPlatformUi) project.getJpaPlatform().getAdapter(JpaPlatformUi.class);
- }
-
- protected void execute(IProject project) {
- JpaProject jpaProject = this.getJpaProject(project);
- if (jpaProject != null) {
- this.execute(jpaProject);
- }
- }
-
- protected JpaProject getJpaProject(IProject project) {
- return (JpaProject) project.getAdapter(JpaProject.class);
- }
-
- protected abstract void execute(JpaProject project);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/SynchronizeClassesAction.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/SynchronizeClassesAction.java
deleted file mode 100644
index 759f96733a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/actions/SynchronizeClassesAction.java
+++ /dev/null
@@ -1,242 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.actions;
-
-import java.lang.reflect.InvocationTargetException;
-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.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.common.ui.internal.utility.SynchronousUiCommandExecutor;
-import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaProjectManager;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.ui.IObjectActionDelegate;
-import org.eclipse.ui.IWorkbenchPart;
-
-/**
- * This action is contributed for:<ul>
- * <li>any {@link IFile} named <code>"persistence.xml"</code>
- * <li>any instance of {@link PersistenceXml}
- * </ul>
- */
-public class SynchronizeClassesAction
- implements IObjectActionDelegate
-{
- private IFile persistenceXmlFile;
-
-
- public void setActivePart(IAction action, IWorkbenchPart targetPart) {
- // no-op for now
- }
-
- /**
- * Determine whether we can calculate the <code>persistence.xml</code> file
- * from the current selection and save it for use in {@link #run(IAction)}.
- */
- public void selectionChanged(IAction action, ISelection selection) {
- // There is always only one element in the actual selection.
- Object sel = ((StructuredSelection) selection).getFirstElement();
- this.persistenceXmlFile = this.buildPersistenceXmlFile(sel);
- }
-
- private IFile buildPersistenceXmlFile(Object selection) {
- if (selection instanceof IFile) {
- return (IFile) selection;
- }
- if (selection instanceof PersistenceXml) {
- return (IFile) ((PersistenceXml) selection).getResource();
- }
- return null;
- }
-
- public void run(IAction action) {
- try {
- IRunnableWithProgress runnable = new SyncRunnable(this.persistenceXmlFile);
- this.buildProgressMonitorDialog().run(true, true, runnable); // true => fork; true => cancellable
- } catch (InvocationTargetException ex) {
- JptJpaUiPlugin.log(ex);
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt();
- JptJpaUiPlugin.log(ex);
- }
- }
-
- private ProgressMonitorDialog buildProgressMonitorDialog() {
- return new ProgressMonitorDialog(null);
- }
-
-
- // ********** sync runnable **********
-
- /**
- * This is dispatched to the progress monitor dialog.
- */
- /* CU private */ static class SyncRunnable
- implements IRunnableWithProgress
- {
- private IFile persistenceXmlFile;
-
- SyncRunnable(IFile persistenceXmlFile) {
- super();
- this.persistenceXmlFile = persistenceXmlFile;
- }
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- this.run_(monitor);
- } catch (CoreException ex) {
- throw new InvocationTargetException(ex);
- }
- }
-
- private void run_(IProgressMonitor monitor) throws CoreException {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- // lock the entire project, since we might modify the metamodel classes
- ISchedulingRule rule = workspace.getRuleFactory().modifyRule(this.persistenceXmlFile.getProject());
- workspace.run(
- new SyncWorkspaceRunnable(this.persistenceXmlFile),
- rule,
- IWorkspace.AVOID_UPDATE,
- monitor
- );
- }
- }
-
-
- // ********** sync workspace runnable **********
-
- /**
- * This is dispatched to the Eclipse workspace.
- */
- /* CU private */ static class SyncWorkspaceRunnable
- implements IWorkspaceRunnable
- {
- private IFile persistenceXmlFile;
-
- SyncWorkspaceRunnable(IFile persistenceXmlFile) {
- super();
- this.persistenceXmlFile = persistenceXmlFile;
- }
-
- public void run(IProgressMonitor monitor) throws CoreException {
- if (monitor.isCanceled()) {
- return;
- }
- SubMonitor sm = SubMonitor.convert(monitor, JptUiMessages.SynchronizingClasses_TaskName, 20);
-
- JpaProject jpaProject = this.getJpaProject();
- if (jpaProject == null) {
- return;
- }
-
- JpaXmlResource resource = jpaProject.getPersistenceXmlResource();
- if (resource == null) {
- // the resource can be null if the persistence.xml file has an invalid content type
- return;
- }
-
- if (sm.isCanceled()) {
- return;
- }
- sm.worked(1);
-
- PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
- if (persistenceXml == null) {
- return; // unlikely...
- }
-
- Persistence persistence = persistenceXml.getPersistence();
- if (persistence == null) {
- return; // unlikely...
- }
-
- PersistenceUnit persistenceUnit = (persistence.getPersistenceUnitsSize() == 0) ?
- persistence.addPersistenceUnit() :
- persistence.getPersistenceUnit(0);
- if (sm.isCanceled()) {
- return;
- }
- sm.worked(1);
-
- Command syncCommand = new SyncCommand(persistenceUnit, sm.newChild(17));
- try {
- this.getJpaProjectManager().execute(syncCommand, SynchronousUiCommandExecutor.instance());
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt(); // skip save?
- throw new RuntimeException(ex);
- }
-
- resource.save();
- sm.worked(1);
- }
-
- private JpaProjectManager getJpaProjectManager() {
- return (JpaProjectManager) this.getWorkspace().getAdapter(JpaProjectManager.class);
- }
-
- private IProject getProject() {
- return this.persistenceXmlFile.getProject();
- }
-
- private JpaProject getJpaProject() {
- return (JpaProject) this.getProject().getAdapter(JpaProject.class);
- }
-
- private IWorkspace getWorkspace() {
- return this.persistenceXmlFile.getWorkspace();
- }
- }
-
-
- // ********** sync command **********
-
- /**
- * This is dispatched to the JPA project manager.
- */
- /* CU private */ static class SyncCommand
- implements Command
- {
- private final PersistenceUnit persistenceUnit;
- private final IProgressMonitor monitor;
-
- SyncCommand(PersistenceUnit persistenceUnit, IProgressMonitor monitor) {
- super();
- this.persistenceUnit = persistenceUnit;
- this.monitor = monitor;
- }
-
- public void execute() {
- this.persistenceUnit.synchronizeClasses(this.monitor);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.persistenceUnit);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AbstractJavaMetadataConversionHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AbstractJavaMetadataConversionHandler.java
deleted file mode 100644
index 4fe1d873ae..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AbstractJavaMetadataConversionHandler.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-public abstract class AbstractJavaMetadataConversionHandler
- extends AbstractHandler
-{
- public AbstractJavaMetadataConversionHandler() {
- super();
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- this.execute_(event);
- return null;
- }
-
- protected void execute_(ExecutionEvent event) throws ExecutionException {
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
- JpaProject jpaProject = this.convertSelectionToJpaProject(selection.getFirstElement());
- if (jpaProject != null) {
- this.convertJavaMetadata(jpaProject);
- }
- }
-
- protected abstract void convertJavaMetadata(JpaProject jpaProject);
-
- protected JpaProject convertSelectionToJpaProject(Object sel) {
- try {
- return (sel == null) ? null : this.convertSelectionToJpaProject_(sel);
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt();
- return null;
- }
- }
-
- protected JpaProject convertSelectionToJpaProject_(Object sel) throws InterruptedException {
- // this will handle JpaProject and IProject (when the JpaProject is already present)
- JpaProject jpaProject = PlatformTools.getAdapter(sel, JpaProject.class);
- if (jpaProject != null) {
- return jpaProject;
- }
- IProject project = this.convertSelectionToProject(sel);
- if (project == null) {
- return null;
- }
- JpaProject.Reference ref = (JpaProject.Reference) project.getAdapter(JpaProject.Reference.class);
- // this will wait for the JpaProject if it is under construction
- return (ref == null) ? null : ref.getValue();
- }
-
- protected IProject convertSelectionToProject(Object sel) {
- // this will handle JpaProject and IProject
- IResource resource = PlatformTools.getAdapter(sel, IResource.class);
- if (resource != null) {
- return resource.getProject();
- }
-
- IJavaProject javaProject = this.convertSelectionToJavaProject(sel);
- return (javaProject == null) ? null : javaProject.getProject();
- }
-
- protected IJavaProject convertSelectionToJavaProject(Object sel) {
- IJavaElement javaElement = PlatformTools.getAdapter(sel, IJavaElement.class);
- return (javaElement == null) ? null : javaElement.getJavaProject();
- }
-
- /**
- * Convenience method.
- */
- protected JpaPlatformUi getJpaPlatformUi(JpaProject jpaProject) {
- return (JpaPlatformUi) jpaProject.getJpaPlatform().getAdapter(JpaPlatformUi.class);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentAttributeToXmlAndMapHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentAttributeToXmlAndMapHandler.java
deleted file mode 100644
index e45cd328f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentAttributeToXmlAndMapHandler.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import java.util.ArrayList;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.internal.dialogs.AddPersistentAttributeToXmlAndMapDialog;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Convert a list of <code>orm.xml</code> <em>virtual</em> attributes to
- * <em>specified</em> and <em>mapped</em>.
- * This handler is only active if <em>all</em> the selected nodes are
- * virtual attributes.
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class AddPersistentAttributeToXmlAndMapHandler
- extends AbstractHandler
-{
- public Object execute(ExecutionEvent event) throws ExecutionException {
- this.execute_(event);
- return null;
- }
-
- private void execute_(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- ArrayList<OrmReadOnlyPersistentAttribute> newAttributes = new ArrayList<OrmReadOnlyPersistentAttribute>();
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
- for (Object each : selection.toList()) {
- OrmReadOnlyPersistentAttribute attribute = (OrmReadOnlyPersistentAttribute) each;
- OrmReadOnlyPersistentAttribute newAttribute = this.addAndMap(attribute, window);
- if (newAttribute != null) {
- newAttributes.add(newAttribute);
- }
- }
-
- if (newAttributes.size() == 1) {
- JpaSelectionManager selectionManager = PlatformTools.getAdapter(window, JpaSelectionManager.class);
- selectionManager.setSelection(newAttributes.get(0));
- }
- }
-
- private OrmReadOnlyPersistentAttribute addAndMap(OrmReadOnlyPersistentAttribute attribute, IWorkbenchWindow window) {
- OrmPersistentType type = attribute.getOwningPersistentType();
- String attributeName = attribute.getName();
-
- AddPersistentAttributeToXmlAndMapDialog dialog = new AddPersistentAttributeToXmlAndMapDialog(window.getShell(), attribute);
- dialog.create();
- dialog.setBlockOnOpen(true);
- dialog.open();
-
- return type.getAttributeNamed(attributeName);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentAttributeToXmlHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentAttributeToXmlHandler.java
deleted file mode 100644
index 87333cc2e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentAttributeToXmlHandler.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import java.util.ArrayList;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Convert a list of <code>orm.xml</code> <em>virtual</em> attributes to
- * <em>specified</em>.
- * This handler is only active if <em>all</em> the selected nodes are
- * virtual attributes that have some sort of Java mapping (either specified
- * or default).
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class AddPersistentAttributeToXmlHandler
- extends AbstractHandler
-{
- public Object execute(ExecutionEvent event) throws ExecutionException {
- this.execute_(event);
- return null;
- }
-
- private void execute_(ExecutionEvent event) throws ExecutionException {
- ArrayList<OrmReadOnlyPersistentAttribute> specifiedAttributes = new ArrayList<OrmReadOnlyPersistentAttribute>();
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
- for (Object each : selection.toList()) {
- OrmReadOnlyPersistentAttribute attribute = (OrmReadOnlyPersistentAttribute) each;
- specifiedAttributes.add(attribute.addToXml());
- }
-
- if (specifiedAttributes.size() == 1) {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- JpaSelectionManager selectionManager = PlatformTools.getAdapter(window, JpaSelectionManager.class);
- selectionManager.setSelection(specifiedAttributes.get(0));
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentClassHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentClassHandler.java
deleted file mode 100644
index 3c070571f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/AddPersistentClassHandler.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.ui.internal.dialogs.AddPersistentClassDialog;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Add an <code>orm.xml</code> type to the selected entity mappings.
- * This handler is only active if <em>one</em> entity mappings is selected.
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class AddPersistentClassHandler
- extends AbstractHandler
-{
- public Object execute(ExecutionEvent event) throws ExecutionException {
- this.execute_(event);
- return null;
- }
-
- private void execute_(ExecutionEvent event) throws ExecutionException {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
- EntityMappings entityMappings = (EntityMappings) selection.getFirstElement();
-
- AddPersistentClassDialog dialog = new AddPersistentClassDialog(window.getShell(), entityMappings);
- dialog.create();
- dialog.setBlockOnOpen(true);
- OrmPersistentType type = dialog.openAndReturnType();
-
- if (type != null) {
- JpaSelectionManager selectionManager = PlatformTools.getAdapter(window, JpaSelectionManager.class);
- selectionManager.setSelection(type);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/ConvertJavaProjectToJpaCommandHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/ConvertJavaProjectToJpaCommandHandler.java
deleted file mode 100644
index 6f8a2d9022..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/ConvertJavaProjectToJpaCommandHandler.java
+++ /dev/null
@@ -1,165 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import static org.eclipse.wst.common.project.facet.core.util.internal.FileUtil.FILE_DOT_PROJECT;
-import static org.eclipse.wst.common.project.facet.core.util.internal.FileUtil.validateEdit;
-import java.lang.reflect.InvocationTargetException;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IProjectDescription;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.SubProgressMonitor;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.internal.FacetedProjectNature;
-import org.eclipse.wst.common.project.facet.ui.ModifyFacetedProjectWizard;
-
-/**
- * See org.eclipse.jpt.jpa.ui/plugin.xml
- */
-public class ConvertJavaProjectToJpaCommandHandler
- extends AbstractHandler
-{
-
- public Object execute(ExecutionEvent event)
- throws ExecutionException {
-
- IProject project = null;
- ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
-
- if (currentSelection instanceof IStructuredSelection) {
- Object element = ((IStructuredSelection) currentSelection).getFirstElement();
- project = PlatformTools.getAdapter(element, IProject.class);
- }
-
- if (project == null) {
- return null;
- }
-
- IWorkbenchWindow activeWorkbenchWindow = HandlerUtil.getActiveWorkbenchWindow(event);
-
- if (activeWorkbenchWindow != null) {
- Shell shell = activeWorkbenchWindow.getShell();
-
- ConvertJavaProjectToJpaRunnable.runInProgressDialog(shell, project);
- }
-
- return null;
- }
-
-
- private static class ConvertJavaProjectToJpaRunnable
- implements IRunnableWithProgress {
-
- private final IProject project;
- private IFacetedProjectWorkingCopy fprojwc;
-
- public static void runInProgressDialog(Shell shell, IProject project) {
- final ConvertJavaProjectToJpaRunnable runnable
- = new ConvertJavaProjectToJpaRunnable(project);
-
- try {
- new ProgressMonitorDialog(shell).run(true, true, runnable);
-
- ModifyFacetedProjectWizard wizard
- = new ModifyFacetedProjectWizard(runnable.getFacetedProjectWorkingCopy());
- WizardDialog dialog = new WizardDialog(shell, wizard);
-
- if (dialog.open() == Window.CANCEL) {
- throw new InterruptedException();
- }
- }
- catch (InvocationTargetException ex) {
- JptJpaUiPlugin.log(ex);
- }
- catch(InterruptedException ex) {
- Thread.currentThread().interrupt();
- JptJpaUiPlugin.log(ex);
- removeFacetNature(project);
- }
- }
-
-
- public static void removeFacetNature(IProject project) {
- try {
- IProjectDescription description = project.getDescription();
- String[] prevNatures = description.getNatureIds();
- String[] newNatures = ArrayTools.remove(prevNatures, FacetedProjectNature.NATURE_ID);
- description.setNatureIds( newNatures );
-
- validateEdit( project.getFile( FILE_DOT_PROJECT ) );
-
- project.setDescription(description, null);
- }
- catch (CoreException ce) {
- JptJpaUiPlugin.log(ce);
- }
- }
-
-
- public ConvertJavaProjectToJpaRunnable(IProject project) {
- this.project = project;
- }
-
- public void run(IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException {
-
- monitor.beginTask(JptUiMessages.convertToJpa_convertingProject, 1000);
-
- try {
- IProgressMonitor createProgressMonitor = new SubProgressMonitor(monitor, 100);
- IFacetedProject fproj = ProjectFacetsManager.create(this.project, true, createProgressMonitor);
-
- if (monitor.isCanceled()) {
- throw new InterruptedException();
- }
-
- monitor.setTaskName(JptUiMessages.convertToJpa_detectingTechnologies);
-
- IProgressMonitor detectProgressMonitor = new SubProgressMonitor(monitor, 800);
- this.fprojwc = fproj.createWorkingCopy();
- this.fprojwc.detect(detectProgressMonitor);
-
- if (! this.fprojwc.hasProjectFacet(JpaFacet.FACET)) {
- this.fprojwc.addProjectFacet(JpaFacet.FACET.getDefaultVersion());
- }
- }
- catch(CoreException e) {
- throw new InvocationTargetException(e);
- }
- finally {
- monitor.done();
- }
- }
-
- protected IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy() {
- return this.fprojwc;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/JavaGeneratorConversionHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/JavaGeneratorConversionHandler.java
deleted file mode 100644
index dadb127fbe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/JavaGeneratorConversionHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-
-public class JavaGeneratorConversionHandler
- extends AbstractJavaMetadataConversionHandler
-{
- public JavaGeneratorConversionHandler() {
- super();
- }
-
- @Override
- protected void convertJavaMetadata(JpaProject jpaProject) {
- this.getJpaPlatformUi(jpaProject).convertJavaGeneratorMetadataToGlobal(jpaProject);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/JavaQueryConversionHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/JavaQueryConversionHandler.java
deleted file mode 100644
index 8aa38f790b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/JavaQueryConversionHandler.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import org.eclipse.jpt.jpa.core.JpaProject;
-
-public class JavaQueryConversionHandler
- extends AbstractJavaMetadataConversionHandler
-{
- public JavaQueryConversionHandler() {
- super();
- }
-
- @Override
- protected void convertJavaMetadata(JpaProject jpaProject) {
- this.getJpaPlatformUi(jpaProject).convertJavaQueryMetadataToGlobal(jpaProject);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/PersistentAttributeMapAsHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/PersistentAttributeMapAsHandler.java
deleted file mode 100644
index 6362a224da..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/PersistentAttributeMapAsHandler.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import java.util.Map;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.IElementUpdater;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.menus.UIElement;
-import org.eclipse.ui.services.IEvaluationService;
-
-/**
- * This handler changes the mapping type of the selected
- * {@link PersistentAttribute}(s).
- * It will be invoked by the mapping action dynamically created by the
- * {@link org.eclipse.jpt.jpa.ui.internal.menus.PersistentAttributeMapAsContribution}.
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- *
- * @see org.eclipse.jpt.jpa.ui.internal.menus.PersistentAttributeMapAsContribution
- * @see PersistentAttribute
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class PersistentAttributeMapAsHandler
- extends AbstractHandler
- implements IElementUpdater
-{
- /**
- * The unique identifier of the "Map As" command used for
- * {@link PersistentAttribute}(s).
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
- public static final String COMMAND_ID = "org.eclipse.jpt.jpa.ui.persistentAttributeMapAs";
-
- /**
- * The unique identifier of the "Map As" command parameter used for
- * {@link PersistentAttribute}(s).
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
- public static final String SPECIFIED_MAPPING_COMMAND_PARAMETER_ID = "specifiedPersistentAttributeMappingKey";
-
- public static final String DEFAULT_MAPPING_COMMAND_PARAMETER_ID = "defaultPersistentAttributeMappingKey";
-
-
- /**
- * Default constructor.
- */
- public PersistentAttributeMapAsHandler() {
- super();
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
- String mappingKey = event.getParameter(SPECIFIED_MAPPING_COMMAND_PARAMETER_ID);
- final Object[] items = selection.toArray();
- for (Object item : items) {
- PersistentAttribute attribute = (PersistentAttribute) item;
- attribute.setMappingKey(mappingKey);
- }
- this.setJpaSelection(items);
- return null;
- }
-
- /**
- * When we are changing an attribute mapping in the <code>orm.xml</code>
- * file (by calling {@link PersistentAttribute#setMappingKey(String)},
- * the following happens synchronously during the call:<ul>
- * <li>The mapping (persistent attribute) is removed from the XML file.
- * <li>The cursor moves to the empty position where the mapping used to be,
- * between the remaining, surrounding mappings, effectively changing the
- * JPA selection to the persistent type that contained the selected
- * persistent attribute.
- * <li>The new mapping (persistent attribute) is added to the XML file in
- * the appropriate position, usually not at the same location as the old
- * mapping.
- * </ul>
- * At this point, the JPA selection is still the selected persistent
- * attribute; but a text editor event has been fired (with a half-second
- * delay - see
- * {@link org.eclipse.jface.text.TextViewer#queuePostSelectionChanged(boolean)})
- * that will change the JPA selection to the persistent type that contains
- * the selected persistent attribute (as calculated from the current cursor
- * position). We short-circuit this event by setting the JPA selection to
- * <code>null</code> and back to the selected persistent attribute. We set
- * the JPA selection to <code>null</code> and back because we
- * must <em>change</em> the JPA selection (as opposed to simply re-setting
- * it to the same persistent attribute) or no change event will be fired
- * (since nothing changed). This double change should be invisible to the
- * user....
- */
- private void setJpaSelection(Object[] items) {
- if (items.length == 1) {
- JpaSelectionManager mgr = this.getSelectionManager();
- mgr.setSelection(null);
- mgr.setSelection((PersistentAttribute) items[0]);
- }
- }
-
- private JpaSelectionManager getSelectionManager() {
- return PlatformTools.getAdapter(PlatformUI.getWorkbench(), JpaSelectionManager.class);
- }
-
- public void updateElement(UIElement element, @SuppressWarnings("rawtypes") Map parameters) {
- // Retrieve the selection for the UIElement
-
- // Due to Bug 226746, we have to use API workaround to retrieve current
- // selection
- IEvaluationService es
- = (IEvaluationService) element.getServiceLocator().getService(IEvaluationService.class);
- IViewPart part =
- (IViewPart) es.getCurrentState().getVariable(ISources.ACTIVE_PART_NAME);
- IStructuredSelection selection
- = (IStructuredSelection) part.getSite().getSelectionProvider().getSelection();
-
- element.setChecked(this.selectedElementsMappingKeysMatch(selection, parameters));
- }
-
- //Check all the selected persistent attribute and verify that they have the same mapping type.
- //They must all be either default mappings or specified mappings as well.
- protected boolean selectedElementsMappingKeysMatch(IStructuredSelection selection, @SuppressWarnings("rawtypes") Map parameters) {
- String handlerSpecifiedMappingKey = (String) parameters.get(SPECIFIED_MAPPING_COMMAND_PARAMETER_ID);
- String handlerDefaultMappingKey = (String) parameters.get(DEFAULT_MAPPING_COMMAND_PARAMETER_ID);
-
- String commonDefaultKey = null;
- String commonSpecifiedKey = null;
- for (Object obj : selection.toArray()) {
- if (! (obj instanceof PersistentAttribute)) {
- //oddly enough, you have to check instanceof here, seems like a bug in the framework
- return false;
- }
-
- PersistentAttribute persistentAttribute = (PersistentAttribute) obj;
- if (persistentAttribute.getMapping().isDefault()) {
- if (commonSpecifiedKey != null) {
- return false;
- }
- if (commonDefaultKey == null) {
- commonDefaultKey = persistentAttribute.getMappingKey();
- }
- else if (!commonDefaultKey.equals(persistentAttribute.getMappingKey())) {
- return false;
- }
- }
- else {
- if (commonDefaultKey != null) {
- return false;
- }
- if (commonSpecifiedKey == null) {
- commonSpecifiedKey = persistentAttribute.getMappingKey();
- }
- else if (!commonSpecifiedKey.equals(persistentAttribute.getMappingKey())) {
- return false;
- }
- }
- }
- if (handlerSpecifiedMappingKey != null) {
- return handlerSpecifiedMappingKey.equals(commonSpecifiedKey);
- }
- else if (handlerDefaultMappingKey != null) {
- return handlerDefaultMappingKey.equals(commonDefaultKey);
- }
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/PersistentTypeMapAsHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/PersistentTypeMapAsHandler.java
deleted file mode 100644
index 726461f01c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/PersistentTypeMapAsHandler.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.jpa.ui.internal.commands;
-
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.ui.internal.menus.PersistentTypeMapAsContribution;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.commands.IElementUpdater;
-import org.eclipse.ui.handlers.HandlerUtil;
-import org.eclipse.ui.menus.UIElement;
-import org.eclipse.ui.services.IEvaluationService;
-
-/**
- * This handler is responsible to change the mapping type of the selected
- * <code>PersistentType</code>.
- * <p>
- * This handler is defined in the JPT plugin.xml. It will be invoked by the
- * mapping action dynamically created by the <code>PersistentTypeMapAsContribution</code>.
- *
- * @see PersistentType
- * @see PersistentTypeMapAsContribution
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class PersistentTypeMapAsHandler extends AbstractHandler
- implements IElementUpdater
-{
- /**
- * The unique identifier of the Map As command used for {@link PersistentType}
- * defined in the <code>JptJpaUiPlugin</code> plugin.xml.
- */
- public static final String COMMAND_ID = "org.eclipse.jpt.jpa.ui.persistentTypeMapAs";
-
- /**
- * The unique identifier of the Map As command parameter used for {@link PersistentType}
- * defined in the <code>JptJpaUiPlugin</code> plugin.xml.
- */
- public static final String COMMAND_PARAMETER_ID = "persistentTypeMappingKey";
-
-
- /**
- * Creates a new <code>PersistentTypeMapAsHandler</code>.
- */
- public PersistentTypeMapAsHandler() {
- super();
- }
-
- public Object execute(ExecutionEvent event) throws ExecutionException {
-
- // Retrieve the selection from the ExecutionEvent
- IStructuredSelection selection = (IStructuredSelection)
- HandlerUtil.getCurrentSelectionChecked(event);
-
- // Retrieve the value of the unique parameter passed to the command
- String mappingKey = event.getParameter(COMMAND_PARAMETER_ID);
-
- // Change the mapping key for all the selected items
- for (Object item : selection.toArray()) {
- PersistentType type = (PersistentType) item;
- type.setMappingKey(mappingKey);
- }
-
- return null;
- }
-
- @SuppressWarnings("unchecked")
- public void updateElement(UIElement element, Map parameters) {
- // Retrieve the selection for the UIElement
-
- // Due to Bug 226746, we have to use API workaround to retrieve current
- // selection
- IEvaluationService es
- = (IEvaluationService) element.getServiceLocator().getService(IEvaluationService.class);
- IViewPart part =
- (IViewPart) es.getCurrentState().getVariable(ISources.ACTIVE_PART_NAME);
- IStructuredSelection selection
- = (IStructuredSelection) part.getSite().getSelectionProvider().getSelection();
-
- String commonMappingKey = commonMappingKey(selection);
-
- String handlerMappingKey = (String) parameters.get(COMMAND_PARAMETER_ID);
- if (handlerMappingKey != null) {
- element.setChecked(handlerMappingKey.equals(commonMappingKey));
- }
- }
-
- @SuppressWarnings("unchecked")
- protected String commonMappingKey(IStructuredSelection selection) {
- String commonKey = null;
- for (Iterator stream = selection.iterator(); stream.hasNext(); ) {
- Object obj = stream.next();
-
- if (! (obj instanceof PersistentType)) {
- return null;
- }
-
- PersistentType persistentType = (PersistentType) obj;
-
- if (commonKey == null) {
- commonKey = persistentType.getMappingKey();
- }
- else if (! commonKey.equals(persistentType.getMappingKey())) {
- return null;
- }
- }
- return commonKey;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/RemovePersistentAttributeFromXmlHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/RemovePersistentAttributeFromXmlHandler.java
deleted file mode 100644
index 32f17dd515..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/RemovePersistentAttributeFromXmlHandler.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import java.util.ArrayList;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * Convert a list of <code>orm.xml</code> <em>specified</em> attributes to
- * <em>virtual</em>.
- * This handler is only active if <em>all</em> the selected nodes are
- * specified attributes.
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class RemovePersistentAttributeFromXmlHandler
- extends AbstractHandler
-{
- public Object execute(ExecutionEvent event) throws ExecutionException {
- this.execute_(event);
- return null;
- }
-
- private void execute_(ExecutionEvent event) throws ExecutionException {
- ArrayList<OrmReadOnlyPersistentAttribute> virtualAttributes = new ArrayList<OrmReadOnlyPersistentAttribute>();
- IStructuredSelection selection = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
- for (Object each : selection.toList()) {
- OrmPersistentAttribute attribute = (OrmPersistentAttribute) each;
- OrmReadOnlyPersistentAttribute newAttribute = attribute.removeFromXml();
- if (newAttribute != null) {
- virtualAttributes.add(newAttribute);
- }
- }
-
- if (virtualAttributes.size() == 1) {
- IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindowChecked(event);
- JpaSelectionManager selectionManager = PlatformTools.getAdapter(window, JpaSelectionManager.class);
- selectionManager.setSelection(virtualAttributes.get(0));
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/RemovePersistentClassHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/RemovePersistentClassHandler.java
deleted file mode 100644
index 8aae6fa4e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/RemovePersistentClassHandler.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import java.util.Iterator;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-public class RemovePersistentClassHandler extends AbstractHandler
-{
- @SuppressWarnings("unchecked")
- public Object execute(ExecutionEvent executionEvent) throws ExecutionException {
- IStructuredSelection selection =
- (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(executionEvent);
-
- // only applies for multiply selected OrmPersistentType objects in a tree
- for (Iterator<OrmPersistentType> stream = selection.iterator(); stream.hasNext(); ) {
- OrmPersistentType persistentType = stream.next();
- ((EntityMappings) persistentType.getMappingFileRoot()).removePersistentType(persistentType);
- }
-
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/UpgradeXmlFileVersionHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/UpgradeXmlFileVersionHandler.java
deleted file mode 100644
index 75c2d39a7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/commands/UpgradeXmlFileVersionHandler.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.commands;
-
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.XmlFile;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaRootEObject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.ui.handlers.HandlerUtil;
-
-/**
- * See org.eclipse.jpt.jpa.ui/plugin.xml
- */
-public class UpgradeXmlFileVersionHandler
- extends AbstractHandler
-{
- public Object execute(ExecutionEvent event) throws ExecutionException {
- IStructuredSelection selection
- = (IStructuredSelection) HandlerUtil.getCurrentSelectionChecked(event);
-
- for (Object selectedObject : selection.toArray()) {
- upgradeXmlFileVersion(selectedObject);
- }
- return null;
- }
-
- protected void upgradeXmlFileVersion(Object selectedObject) {
- JpaXmlResource xmlResource = PlatformTools.getAdapter(selectedObject, JpaXmlResource.class);
- if (xmlResource == null) {
- XmlFile xmlFile = PlatformTools.getAdapter(selectedObject, XmlFile.class);
- if (xmlFile != null) {
- xmlResource = xmlFile.getXmlResource();
- }
- }
- if (xmlResource == null) {
- return;
- }
-
- JpaRootEObject root = xmlResource.getRootObject();
- IContentType contentType = xmlResource.getContentType();
- JpaProject jpaProject = this.getJpaProject(xmlResource.getFile().getProject());
- String newVersion = jpaProject.getJpaPlatform().getMostRecentSupportedResourceType(contentType).getVersion();
- root.setVersion(newVersion);
- xmlResource.save();
- }
-
- private JpaProject getJpaProject(IProject project) {
- return (JpaProject) project.getAdapter(JpaProject.class);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingComposite.java
deleted file mode 100644
index b3928aedde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingComposite.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.LobConverter;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EnumTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | LobComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see ColumnComposite
- * @see EnumTypeComposite
- * @see FetchTypeComposite
- * @see LobComposite
- * @see OptionalComposite
- * @see TemporalTypeComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public abstract class AbstractBasicMappingComposite<T extends BasicMapping>
- extends Pane<T>
- implements JpaComposite
-{
- /**
- * Creates a new <code>BasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IBasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractBasicMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeBasicCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- }
-
- protected void initializeBasicCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.BasicSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeBasicSection(container);
- }
-
- protected void initializeBasicSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, addSubPane(container, 4));
- }
-
- protected void initializeTypeCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.TypeSection_type
- );
- this.initializeTypeSection(container);
- }
-
- protected void initializeTypeSection(Composite container) {
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- // No converter
- Button noConverterButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_default,
- buildConverterBooleanHolder(null),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- // Lob
- Button lobButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_lob,
- buildConverterBooleanHolder(LobConverter.class),
- null);
- ((GridData) lobButton.getLayoutData()).horizontalSpan = 2;
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_temporal,
- buildConverterBooleanHolder(BaseTemporalConverter.class),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), container, getWidgetFactory()));
-
-
- // Enumerated
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_enumerated,
- buildConverterBooleanHolder(BaseEnumeratedConverter.class),
- null);
- registerSubPane(new EnumTypeComposite(buildEnumeratedConverterHolder(converterHolder), container, getWidgetFactory()));
- }
-
- protected PropertyValueModel<Column> buildColumnHolder() {
- return new TransformationPropertyValueModel<T, Column>(getSubjectHolder()) {
- @Override
- protected Column transform_(T value) {
- return value.getColumn();
- }
- };
- }
-
- protected PropertyValueModel<Converter> buildConverterHolder() {
- return new PropertyAspectAdapter<T, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Converter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- protected PropertyValueModel<BaseTemporalConverter> buildTemporalConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, BaseTemporalConverter>(converterHolder) {
- @Override
- protected BaseTemporalConverter transform_(Converter converter) {
- return converter.getType() == BaseTemporalConverter.class ? (BaseTemporalConverter) converter : null;
- }
- };
- }
-
- protected PropertyValueModel<BaseEnumeratedConverter> buildEnumeratedConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, BaseEnumeratedConverter>(converterHolder) {
- @Override
- protected BaseEnumeratedConverter transform_(Converter converter) {
- return converter.getType() == BaseEnumeratedConverter.class ? (BaseEnumeratedConverter) converter : null;
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildConverterBooleanHolder(final Class<? extends Converter> converterType) {
- return new PropertyAspectAdapter<BasicMapping, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getType() == converterType);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(converterType);
- }
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingUiDefinition.java
deleted file mode 100644
index f0ef46dffc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractBasicMappingUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractBasicMappingUiDefinition<M, T extends BasicMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractBasicMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.BasicMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.BasicMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableComposite.java
deleted file mode 100644
index cd59441aea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableComposite.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see JavaUiFactory - The factory creating this pane
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractEmbeddableComposite<T extends Embeddable>
- extends Pane<T>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractEmbeddableComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- }
-
- protected void initializeEmbeddableCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.EmbeddableSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeEmbeddableSection(container);
- }
-
- protected void initializeEmbeddableSection(Composite container) {
-
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableUiDefinition.java
deleted file mode 100644
index 985eb31d32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddableUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEmbeddableUiDefinition<M, T extends Embeddable>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEmbeddableUiDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY;
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.EmbeddableUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.EmbeddableUiProvider_linkLabel;
- }
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForTypeMapping(getKey());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingComposite.java
deleted file mode 100644
index 0fc0e5137b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingComposite.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractEmbeddedIdMappingComposite<T extends EmbeddedIdMapping>
- extends Pane<T>
- implements JpaComposite
-{
- protected AbstractEmbeddedIdMappingComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeEmbeddedIdCollapsibleSection(container);
- }
-
- protected void initializeEmbeddedIdCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.EmbeddedIdSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- this.initializeEmbeddedIdSection(container);
- }
-
- protected abstract void initializeEmbeddedIdSection(Composite container);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingUiDefinition.java
deleted file mode 100644
index 142fe12e4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedIdMappingUiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-
-public abstract class AbstractEmbeddedIdMappingUiDefinition<M, T extends EmbeddedIdMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEmbeddedIdMappingUiDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.EmbeddedIdMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.EmbeddedIdMappingUiProvider_linkLabel;
- }
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingComposite.java
deleted file mode 100644
index 8aedf8ec83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingComposite.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EmbeddedAttributeOverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- *
- * @version 2.3
- * @since 1.0
- */
-public abstract class AbstractEmbeddedMappingComposite<T extends EmbeddedMapping>
- extends Pane<T>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddedMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>EmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractEmbeddedMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeEmbeddedCollapsibleSection(container);
- }
-
- protected void initializeEmbeddedCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.EmbeddedSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeEmbeddedSection(container);
- }
-
- protected void initializeEmbeddedSection(Composite container) {
- new EmbeddedMappingOverridesComposite(
- this,
- container
- );
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingOverridesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingOverridesComposite.java
deleted file mode 100644
index 8311fd4897..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingOverridesComposite.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BaseEmbeddedMapping;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractEmbeddedMappingOverridesComposite<T extends BaseEmbeddedMapping>
- extends AbstractOverridesComposite<T>
-{
- protected AbstractEmbeddedMappingOverridesComposite(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected PropertyValueModel<AttributeOverrideContainer> buildAttributeOverrideContainerHolder() {
- return new PropertyAspectAdapter<T, AttributeOverrideContainer>(getSubjectHolder()) {
- @Override
- protected AttributeOverrideContainer buildValue_() {
- return this.subject.getAttributeOverrideContainer();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingUiDefinition.java
deleted file mode 100644
index f699c1a6e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEmbeddedMappingUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEmbeddedMappingUiDefinition<M, T extends EmbeddedMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEmbeddedMappingUiDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.EmbeddedMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.EmbeddedMappingUiProvider_linkLabel;
- }
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityComposite.java
deleted file mode 100644
index 56219a0784..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityComposite.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.IdClassReference;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EntityNameComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | IdClassComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Attribute Overrides ------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Secondary Tables ---------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | Pane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Inheritance --------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | InheritanceComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Queries ------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | QueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Generators ---------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | GeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see EntityNameComposite
- * @see InheritanceComposite
- * @see IdClassComposite
- * @see EntityOverridesComposite
- * @see TableComposite
- * @see GenerationComposite
- *
- * TODO talk to JavaEditor people about what we can do to hook in TabbedProperties for the JavaEditor
- *
- * @version 2.3
- * @since 1.0
- */
-public abstract class AbstractEntityComposite<T extends Entity>
- extends Pane<T>
- implements JpaComposite
-{
- /**
- * Creates a new <code>AbstractEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractEntityComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- protected abstract void initializeSecondaryTablesSection(Composite container);
-
- protected abstract void initializeInheritanceSection(Composite container);
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeInheritanceCollapsibleSection(container);
- this.initializeAttributeOverridesCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeSecondaryTablesCollapsibleSection(container);
- }
-
- protected void initializeEntityCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.EntitySection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeEntitySection(container);
- }
-
- protected void initializeEntitySection(Composite container) {
- new TableComposite(this, container);
- new EntityNameComposite(this, container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<IdClassReference> buildIdClassReferenceHolder() {
- return new PropertyAspectAdapter<Entity, IdClassReference>(getSubjectHolder()) {
- @Override
- protected IdClassReference buildValue_() {
- return this.subject.getIdClassReference();
- }
- };
- }
-
- protected void initializeQueriesCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.EntityComposite_queries);
- this.initializeQueriesSection(container, buildQueryContainerHolder());
- }
-
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new QueriesComposite(this, queryContainerHolder, container);
- }
-
- private PropertyValueModel<QueryContainer> buildQueryContainerHolder() {
- return new PropertyAspectAdapter<Entity, QueryContainer>(getSubjectHolder()) {
- @Override
- protected QueryContainer buildValue_() {
- return this.subject.getQueryContainer();
- }
- };
- }
-
- protected void initializeAttributeOverridesCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.OverridesComposite_attributeOverridesSection);
- initializeAttributeOverridesSection(container);
- }
-
- protected void initializeAttributeOverridesSection(Composite container) {
- new EntityOverridesComposite(this, container);
- }
-
- protected void initializeInheritanceCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.EntityComposite_inheritance);
- initializeInheritanceSection(container);
- }
-
- protected void initializeGeneratorsCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.IdMappingComposite_primaryKeyGenerationSection);
- initializeGeneratorsSection(container, buildGeneratorContainer());
- }
-
- protected void initializeGeneratorsSection(Composite container, PropertyValueModel<GeneratorContainer> generatorContainerHolder) {
- new GenerationComposite(this, generatorContainerHolder, container);
- }
-
- private PropertyValueModel<GeneratorContainer> buildGeneratorContainer() {
- return new PropertyAspectAdapter<Entity, GeneratorContainer>(getSubjectHolder()) {
- @Override
- protected GeneratorContainer buildValue_() {
- return this.subject.getGeneratorContainer();
- }
- };
- }
-
- protected void initializeSecondaryTablesCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.SecondaryTablesComposite_secondaryTables);
- initializeSecondaryTablesSection(container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityMappingsDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityMappingsDetailsProvider.java
deleted file mode 100644
index 1f281c3c81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityMappingsDetailsProvider.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-
-public abstract class AbstractEntityMappingsDetailsProvider
- implements JpaDetailsProvider
-{
- protected AbstractEntityMappingsDetailsProvider() {
- super();
- }
-
-
- public final boolean providesDetails(JpaStructureNode structureNode) {
- return Tools.valuesAreEqual(structureNode.getType(), EntityMappings.class)
- && providesDetails(structureNode.getResourceType());
- }
-
- protected abstract boolean providesDetails(JptResourceType resourceType);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityOverridesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityOverridesComposite.java
deleted file mode 100644
index 5bbc73260d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityOverridesComposite.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractEntityOverridesComposite
- extends AbstractOverridesComposite<Entity>
-{
- protected AbstractEntityOverridesComposite(
- Pane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected boolean supportsAssociationOverrides() {
- return true;
- }
-
- @Override
- protected PropertyValueModel<AttributeOverrideContainer> buildAttributeOverrideContainerHolder() {
- return new PropertyAspectAdapter<Entity, AttributeOverrideContainer>(getSubjectHolder()) {
- @Override
- protected AttributeOverrideContainer buildValue_() {
- return this.subject.getAttributeOverrideContainer();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<AssociationOverrideContainer> buildAssociationOverrideContainerHolder() {
- return new PropertyAspectAdapter<Entity, AssociationOverrideContainer>(getSubjectHolder()) {
- @Override
- protected AssociationOverrideContainer buildValue_() {
- return this.subject.getAssociationOverrideContainer();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityUiDefinition.java
deleted file mode 100644
index 1dae9012f0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractEntityUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractEntityUiDefinition<M, T extends Entity>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractEntityUiDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.EntityUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.EntityUiProvider_linkLabel;
- }
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForTypeMapping(getKey());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingComposite.java
deleted file mode 100644
index 8c2f8f527b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingComposite.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractIdMappingComposite<T extends IdMapping>
- extends Pane<T>
- implements JpaComposite
-{
- public AbstractIdMappingComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeIdCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- initializeGenerationCollapsibleSection(container);
- }
-
- protected void initializeIdCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.IdSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- this.initializeIdSection(container);
- }
-
- protected abstract void initializeIdSection(Composite container);
-
- protected void initializeTypeCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.TypeSection_type);
- this.initializeTypeSection(container);
- }
-
- protected void initializeTypeSection(Composite container) {
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- // No converter
- Button noConverterButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_default,
- buildConverterBooleanHolder(null),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_temporal,
- buildConverterBooleanHolder(BaseTemporalConverter.class),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), container, getWidgetFactory()));
- }
-
- protected void initializeGenerationCollapsibleSection(Composite container) {
- new IdMappingGenerationComposite(this, container);
- }
-
- protected PropertyValueModel<? extends Column> buildColumnHolder() {
- return new TransformationPropertyValueModel<T, Column>(getSubjectHolder()) {
- @Override
- protected Column transform_(T value) {
- return value.getColumn();
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildConverterBooleanHolder(final Class<? extends Converter> converterType) {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getType() == converterType);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(converterType);
- }
- }
- };
- }
-
- protected PropertyValueModel<Converter> buildConverterHolder() {
- return new PropertyAspectAdapter<T, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Converter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- protected PropertyValueModel<BaseTemporalConverter> buildTemporalConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, BaseTemporalConverter>(converterHolder) {
- @Override
- protected BaseTemporalConverter transform_(Converter converter) {
- return converter.getType() == BaseTemporalConverter.class ? (BaseTemporalConverter) converter : null;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingUiDefinition.java
deleted file mode 100644
index 32a63a31bb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractIdMappingUiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-
-public abstract class AbstractIdMappingUiDefinition<M, T extends IdMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractIdMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.IdMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.IdMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return MappingKeys.ID_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractInheritanceComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractInheritanceComposite.java
deleted file mode 100644
index b081309d0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractInheritanceComposite.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ---------------------------------------------------- |
- * | Strategy: | EnumComboViewer |v| |
- * | ---------------------------------------------------- |
- * | ---------------------------------------------------- |
- * | Value: | I |v| |
- * | ---------------------------------------------------- |
- * | |
- * | > Discriminator Column |
- * | |
- * | ---------------------------------------------------- |
- * | Name: | ColumnCombo |v| |
- * | ---------------------------------------------------- |
- * | ---------------------------------------------------- |
- * | Type: | EnumComboViewer |v| |
- * | ---------------------------------------------------- |
- * | ---------------------------------------------------- |
- * | Column Definition: | I | |
- * | ---------------------------------------------------- |
- * | ------------- |
- * | Length: | I |I| |
- * | ------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PrimaryKeyJoinColumnsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see AbstractEntityComposite - The parent container
- * @see ColumnCombo
- * @see EnumComboViewer
- * @see PrimaryKeyJoinColumnsComposite
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class AbstractInheritanceComposite<T extends Entity> extends Pane<T> {
-
-
- /**
- * Creates a new <code>InheritanceComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public AbstractInheritanceComposite(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = getGroupBoxMargin();
-
- Composite subPane = addSubPane(
- container, 0, groupBoxMargin, 0, groupBoxMargin
- );
-
- // Strategy widgets
- addLabeledComposite(
- subPane,
- JptUiDetailsMessages.InheritanceComposite_strategy,
- addStrategyCombo(subPane),
- JpaHelpContextIds.ENTITY_INHERITANCE_STRATEGY
- );
-
- // Discriminator Value widgets
- PropertyValueModel<Boolean> dvEnabled = this.buildDiscriminatorValueEnabledHolder();
- Combo discriminatorValueCombo = addEditableCombo(
- subPane,
- buildDiscriminatorValueListHolder(),
- buildDiscriminatorValueHolder(),
- StringConverter.Default.<String>instance(),
- dvEnabled
- );
- Label discriminatorValueLabel = addLabel(
- subPane,
- JptUiDetailsMessages.InheritanceComposite_discriminatorValue,
- dvEnabled
- );
- addLabeledComposite(
- subPane,
- discriminatorValueLabel,
- discriminatorValueCombo,
- null,
- JpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_VALUE
- );
-
- new DiscriminatorColumnComposite<Entity>(this, container);
-
- // Primary Key Join Columns widgets
- addPrimaryKeyJoinColumnsComposite(addSubPane(container, 5));
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildDiscriminatorValueEnabledHolder() {
- return new PropertyAspectAdapter<Entity, Boolean>(getSubjectHolder(), Entity.SPECIFIED_DISCRIMINATOR_VALUE_IS_ALLOWED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.specifiedDiscriminatorValueIsAllowed());
- }
- };
- }
-
- private ListValueModel<String> buildDefaultDiscriminatorListValueHolder() {
- return new PropertyListValueModelAdapter<String>(
- buildDefaultDiscriminatorValueHolder()
- );
- }
-
- private ModifiablePropertyValueModel<String> buildDefaultDiscriminatorValueHolder() {
- return new PropertyAspectAdapter<Entity, String>(getSubjectHolder(), Entity.DEFAULT_DISCRIMINATOR_VALUE_PROPERTY, Entity.DISCRIMINATOR_VALUE_IS_UNDEFINED_PROPERTY) {
- @Override
- protected String buildValue_() {
- return defaultValue(this.subject);
- }
- };
- }
-
- private String defaultValue(Entity subject) {
- String defaultValue = subject.getDefaultDiscriminatorValue();
-
- if (defaultValue == null && subject.discriminatorValueIsUndefined()) {
- return JptCommonUiMessages.NoneSelected;
- }
- if (defaultValue != null && defaultValue.length() > 0) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptUiDetailsMessages.ProviderDefault;
- }
-
-
- private ModifiablePropertyValueModel<String> buildDiscriminatorValueHolder() {
- return new PropertyAspectAdapter<Entity, String>(getSubjectHolder(), Entity.SPECIFIED_DISCRIMINATOR_VALUE_PROPERTY) {
- @Override
- protected String buildValue_() {
- String value = this.subject.getSpecifiedDiscriminatorValue();
- if (value == null) {
- return defaultValue(this.subject);
- }
- return value;
- }
-
- @Override
- protected void setValue_(String value) {
- if (defaultValue(this.subject).equals(value)) {
- value = null;
- }
- this.subject.setSpecifiedDiscriminatorValue(value);
- }
- };
- }
-
- private ListValueModel<String> buildDiscriminatorValueListHolder() {
- return buildDefaultDiscriminatorListValueHolder();
- }
-
- private EnumFormComboViewer<Entity, InheritanceType> addStrategyCombo(Composite container) {
-
- return new EnumFormComboViewer<Entity, InheritanceType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Entity.DEFAULT_INHERITANCE_STRATEGY_PROPERTY);
- propertyNames.add(Entity.SPECIFIED_INHERITANCE_STRATEGY_PROPERTY);
- }
-
- @Override
- protected InheritanceType[] getChoices() {
- return InheritanceType.values();
- }
-
- @Override
- protected InheritanceType getDefaultValue() {
- return getSubject().getDefaultInheritanceStrategy();
- }
-
- @Override
- protected String displayString(InheritanceType value) {
- switch (value) {
- case JOINED :
- return JptUiDetailsMessages.AbstractInheritanceComposite_joined;
- case SINGLE_TABLE :
- return JptUiDetailsMessages.AbstractInheritanceComposite_single_table;
- case TABLE_PER_CLASS :
- return JptUiDetailsMessages.AbstractInheritanceComposite_table_per_class;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected InheritanceType getValue() {
- return getSubject().getSpecifiedInheritanceStrategy();
- }
-
- @Override
- protected void setValue(InheritanceType value) {
- getSubject().setSpecifiedInheritanceStrategy(value);
- }
- };
- }
-
- protected abstract void addPrimaryKeyJoinColumnsComposite(Composite container);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJavaMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJavaMappedSuperclassComposite.java
deleted file mode 100644
index 9c0d7ad153..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJavaMappedSuperclassComposite.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | IdClassComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Queries ------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | QueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see MappedSuperclass
- * @see IdClassComposite
- * @see QueriesComposite
- *
- * @version 2.3
- * @since 2.3
- */
-
-public abstract class AbstractJavaMappedSuperclassComposite extends
- AbstractMappedSuperclassComposite<JavaMappedSuperclass> {
- /**
- * Creates a new <code>MappedSuperclassComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public AbstractJavaMappedSuperclassComposite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeMappedSuperclassCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- }
-
-
- protected void initializeQueriesCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.MappedSuperclassComposite_queries);
- this.initializeQueriesSection(container, buildQueryContainerHolder());
-
- }
-
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new QueriesComposite(this, queryContainerHolder, container);
- }
-
- private PropertyValueModel<QueryContainer> buildQueryContainerHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, QueryContainer>(getSubjectHolder()) {
- @Override
- protected QueryContainer buildValue_() {
- return this.subject.getQueryContainer();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJoiningStrategyPane.java
deleted file mode 100644
index 4aeddfbec6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJoiningStrategyPane.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationship;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationshipStrategy;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * Abstract superclass for joining strategy form panes
- *
- * Here is the basic layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | o <label> _______________________________________________________________ |
- * | | | |
- * | | (joining strategy details composite) | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see MappedByRelationship
- * @see MappedByRelationshipStrategy
- * @see OneToOneJoiningStrategyPane
- *
- * @version 2.3
- * @since 2.1
- */
-public abstract class AbstractJoiningStrategyPane
- <R extends ReadOnlyRelationship, S extends ReadOnlyRelationshipStrategy>
- extends Pane<R>
-{
- protected Composite strategyDetailsComposite;
-
-
- /**
- * Creates a new <code>AbstractJoiningStrategyPane</code>.
- *
- * @param parentPane The parent form pane
- * @param parent The parent container
- */
- protected AbstractJoiningStrategyPane(
- Pane<? extends R> parentPane,
- Composite parent) {
- super(parentPane, parent);
- }
-
- protected AbstractJoiningStrategyPane(Pane<?> parentPane,
- PropertyValueModel<? extends R> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- protected abstract ModifiablePropertyValueModel<Boolean> buildUsesStrategyHolder();
-
-
- @Override
- protected void initializeLayout(Composite container) {
- PageBook pageBook = new PageBook(container, SWT.NULL);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalIndent = 5;
- pageBook.setLayoutData(gd);
-
- this.strategyDetailsComposite = buildStrategyDetailsComposite(pageBook);
-
- new ControlSwitcher(this.buildUsesStrategyHolder(), buildPageBookTransformer(), pageBook);
- }
-
- protected abstract Composite buildStrategyDetailsComposite(Composite parent);
-
- protected Transformer<Boolean, Control> buildPageBookTransformer() {
- return new Transformer<Boolean, Control>() {
- public Control transform(Boolean usesStrategy) {
- return (usesStrategy.booleanValue()) ?
- AbstractJoiningStrategyPane.this.strategyDetailsComposite :
- null;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJpaDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJpaDetailsPage.java
deleted file mode 100644
index 73880de681..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractJpaDetailsPage.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.internal.platform.JpaPlatformUiRegistry;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-
-/**
- * The base class for the details view.
- *
- * @see JpaStructureNode
- *
- * @version 3.0
- * @since 1.0
- */
-public abstract class AbstractJpaDetailsPage<T extends JpaStructureNode>
- extends Pane<T>
- implements JpaDetailsPageManager<T>
-{
- protected AbstractJpaDetailsPage(Composite parent, WidgetFactory widgetFactory) {
- super(new SimplePropertyValueModel<T>(), parent, widgetFactory);
- }
-
- public Control getPage() {
- return this.getControl();
- }
-
- protected JpaPlatformUi getJpaPlatformUi() {
- return (JpaPlatformUi) getSubject().getJpaPlatform().getAdapter(JpaPlatformUi.class);
- }
-
- @SuppressWarnings("unchecked")
- public final void setSubject(Object subject) {
- ModifiablePropertyValueModel<T> subjectHolder = (ModifiablePropertyValueModel<T>) getSubjectHolder();
- subjectHolder.setValue((T) subject);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingComposite.java
deleted file mode 100644
index 60fff9a731..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingComposite.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToManyJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link CascadeComposite}
- * @see {@link OrderingComposite}
- *
- * @version 2.3
- * @since 1.0
- */
-public abstract class AbstractManyToManyMappingComposite<T extends ManyToManyMapping, R extends ManyToManyRelationship>
- extends Pane<T>
- implements JpaComposite
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractManyToManyMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeManyToManyCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- initializeOrderingCollapsibleSection(container);
- }
-
- protected void initializeManyToManyCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.ManyToManySection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeManyToManySection(container);
- }
-
- protected abstract void initializeManyToManySection(Composite container);
-
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new ManyToManyJoiningStrategyPane(this, buildJoiningHolder(), container);
- }
-
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new OrderingComposite(this, container);
- }
-
-
- protected PropertyValueModel<R> buildJoiningHolder() {
- return new TransformationPropertyValueModel<T, R>(
- getSubjectHolder()) {
- @SuppressWarnings("unchecked")
- @Override
- protected R transform_(T value) {
- return (R) value.getRelationship();
- }
- };
- }
-
- protected PropertyValueModel<Cascade> buildCascadeHolder() {
- return new TransformationPropertyValueModel<T, Cascade>(getSubjectHolder()) {
- @Override
- protected Cascade transform_(T value) {
- return value.getCascade();
- }
- };
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<T, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingUiDefinition.java
deleted file mode 100644
index 331af34391..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToManyMappingUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractManyToManyMappingUiDefinition<M, T extends ManyToManyMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractManyToManyMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.ManyToManyMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.ManyToManyMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingComposite.java
deleted file mode 100644
index c72c170e37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingComposite.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneRelationship;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractManyToOneMappingComposite<T extends ManyToOneMapping, R extends ManyToOneRelationship>
- extends Pane<T>
- implements JpaComposite
-{
- protected AbstractManyToOneMappingComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeManyToOneCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- }
-
- protected void initializeManyToOneCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.ManyToOneSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeManyToOneSection(container);
- }
-
- protected abstract void initializeManyToOneSection(Composite container);
-
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new ManyToOneJoiningStrategyPane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<Cascade> buildCascadeHolder() {
- return new TransformationPropertyValueModel<T, Cascade>(getSubjectHolder()) {
- @Override
- protected Cascade transform_(T value) {
- return value.getCascade();
- }
- };
- }
-
- protected PropertyValueModel<R> buildJoiningHolder() {
- return new TransformationPropertyValueModel<T, R>(
- getSubjectHolder()) {
- @SuppressWarnings("unchecked")
- @Override
- protected R transform_(T value) {
- return (R) value.getRelationship();
- }
- };
- }
-
- protected Composite addPane(Composite container, int groupBoxMargin) {
- return addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingUiDefinition.java
deleted file mode 100644
index 74635a0651..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractManyToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractManyToOneMappingUiDefinition<M, T extends ManyToOneMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractManyToOneMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.ManyToOneMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.ManyToOneMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassComposite.java
deleted file mode 100644
index c9b29c24d8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassComposite.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.IdClassReference;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-
-public abstract class AbstractMappedSuperclassComposite<T extends MappedSuperclass>
- extends Pane<T>
- implements JpaComposite
-{
- protected AbstractMappedSuperclassComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeMappedSuperclassCollapsibleSection(container);
- }
-
- protected void initializeMappedSuperclassCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.MappedSuperclassSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeMappedSuperclassSection(container);
- }
-
- protected void initializeMappedSuperclassSection(Composite container) {
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<IdClassReference> buildIdClassReferenceHolder() {
- return new PropertyAspectAdapter<T, IdClassReference>(getSubjectHolder()) {
- @Override
- protected IdClassReference buildValue_() {
- return this.subject.getIdClassReference();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassUiDefinition.java
deleted file mode 100644
index 2d76a0b67b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappedSuperclassUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractMappedSuperclassUiDefinition<M, T extends MappedSuperclass>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractMappedSuperclassUiDefinition() {
- super();
- }
-
-
- public String getKey() {
- return MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY;
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.MappedSuperclassUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.MappedSuperclassUiProvider_linkLabel;
- }
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForTypeMapping(getKey());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappingUiDefinition.java
deleted file mode 100644
index 54562e5693..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractMappingUiDefinition.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-
-public abstract class AbstractMappingUiDefinition<M, T>
- implements MappingUiDefinition<M, T>
-{
- protected AbstractMappingUiDefinition() {
- super();
- }
-
-
- public boolean isEnabledFor(M mappableObject) {
- return true;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingComposite.java
deleted file mode 100644
index f1511e6ef2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingComposite.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyRelationship;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToManyMapping
- * @see CascadeComposite
- * @see FetchTypeComposite
- * @see JoinTableComposite
- * @see OrderingComposite
- * @see TargetEntityComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public abstract class AbstractOneToManyMappingComposite<T extends OneToManyMapping, R extends OneToManyRelationship>
- extends Pane<T>
- implements JpaComposite
-{
- /**
- * Creates a new <code>OneToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractOneToManyMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeOneToManyCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- initializeOrderingCollapsibleSection(container);
- }
-
- protected void initializeOneToManyCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.OneToManySection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeOneToManySection(container);
- }
-
- protected abstract void initializeOneToManySection(Composite container);
-
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToManyJoiningStrategyPane(this, buildJoiningHolder(), container);
- }
-
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new OrderingComposite(this, container);
- }
-
- protected PropertyValueModel<R> buildJoiningHolder() {
- return new TransformationPropertyValueModel<T, R>(getSubjectHolder()) {
- @SuppressWarnings("unchecked")
- @Override
- protected R transform_(T value) {
- return (R) value.getRelationship();
- }
- };
- }
-
- protected PropertyValueModel<Cascade> buildCascadeHolder() {
- return new TransformationPropertyValueModel<T, Cascade>(getSubjectHolder()) {
- @Override
- protected Cascade transform_(T value) {
- return value.getCascade();
- }
- };
- }
-
- protected Composite addPane(Composite container, int groupBoxMargin) {
- return addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingUiDefinition.java
deleted file mode 100644
index 26680dbc0d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToManyMappingUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractOneToManyMappingUiDefinition<M, T extends OneToManyMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractOneToManyMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.OneToManyMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.OneToManyMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingComposite.java
deleted file mode 100644
index 0ed720721c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingComposite.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractOneToOneMappingComposite<T extends OneToOneMapping, R extends OneToOneRelationship>
- extends Pane<T>
- implements JpaComposite
-{
- protected AbstractOneToOneMappingComposite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeOneToOneCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- }
-
- protected void initializeOneToOneCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.OneToOneSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeOneToOneSection(container);
- }
-
- protected abstract void initializeOneToOneSection(Composite container);
-
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToOneJoiningStrategyPane(this, buildJoiningHolder(), container);
- }
-
- protected Composite addPane(Composite container, int groupBoxMargin) {
- return addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
- }
-
- protected PropertyValueModel<R> buildJoiningHolder() {
- return new TransformationPropertyValueModel<T, R>(
- getSubjectHolder()) {
- @SuppressWarnings("unchecked")
- @Override
- protected R transform_(T value) {
- return (R) value.getRelationship();
- }
- };
- }
-
- protected PropertyValueModel<Cascade> buildCascadeHolder() {
- return new TransformationPropertyValueModel<T, Cascade>(getSubjectHolder()) {
- @Override
- protected Cascade transform_(T value) {
- return value.getCascade();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingUiDefinition.java
deleted file mode 100644
index 133ad70daa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractOneToOneMappingUiDefinition<M, T extends OneToOneMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractOneToOneMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.OneToOneMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.OneToOneMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOrderingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOrderingComposite.java
deleted file mode 100644
index d64db156bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOrderingComposite.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.CollectionMapping;
-import org.eclipse.jpt.jpa.core.context.Orderable;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Ordering -------------------------------------------------------------- |
- * | | | |
- * | | o None | |
- * | | | |
- * | | o Primary Key | |
- * | | | |
- * | | o Custom | |
- * | | ------------------------------------------------------------------- | |
- * | | | I | | |
- * | | ------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see CollectionMapping
- * @see ManyToManyMappingComposite - A container of this pane
- * @see OneToManyMappingComposite - A container of this pane
- *
- * @version 3.0
- * @since 1.0
- */
-public abstract class AbstractOrderingComposite extends Pane<CollectionMapping>
-{
- /**
- * Creates a new <code>OrderingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- protected AbstractOrderingComposite(Pane<? extends CollectionMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>OrderingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IMultiRelationshipMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractOrderingComposite(PropertyValueModel<? extends CollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- protected PropertyValueModel<Orderable> buildOrderableHolder() {
- return new PropertyAspectAdapter<CollectionMapping, Orderable>(getSubjectHolder()) {
- @Override
- protected Orderable buildValue_() {
- return this.subject.getOrderable();
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildNoOrderingHolder(PropertyValueModel<Orderable> orderableHolder) {
- return new PropertyAspectAdapter<Orderable, Boolean>(orderableHolder, Orderable.NO_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isNoOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNoOrdering(value.booleanValue());
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildPrimaryKeyOrderingHolder(PropertyValueModel<Orderable> orderableHolder) {
- return new PropertyAspectAdapter<Orderable, Boolean>(orderableHolder, Orderable.PK_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isPkOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setPkOrdering(value.booleanValue());
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildCustomOrderingHolder(PropertyValueModel<Orderable> orderableHolder) {
- return new PropertyAspectAdapter<Orderable, Boolean>(orderableHolder, Orderable.CUSTOM_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isCustomOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setCustomOrdering(value.booleanValue());
- }
- };
- }
-
- protected ModifiablePropertyValueModel<String> buildSpecifiedOrderByHolder(PropertyValueModel<Orderable> orderableHolder) {
- return new PropertyAspectAdapter<Orderable, String>(orderableHolder, Orderable.SPECIFIED_ORDER_BY_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getSpecifiedOrderBy();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setSpecifiedOrderBy(value);
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOverridesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOverridesComposite.java
deleted file mode 100644
index ad09327019..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractOverridesComposite.java
+++ /dev/null
@@ -1,412 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.core.context.OverrideContainer;
-import org.eclipse.jpt.jpa.core.context.Override_;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualOverride;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-
-@SuppressWarnings("nls")
-public abstract class AbstractOverridesComposite<T extends JpaContextNode>
- extends Pane<T>
-{
- private Pane<ReadOnlyAttributeOverride> attributeOverridePane;
- private Pane<ReadOnlyAssociationOverride> associationOverridePane;
-
- private ModifiablePropertyValueModel<ReadOnlyOverride> selectedOverrideHolder;
- private ModifiablePropertyValueModel<Boolean> overrideVirtualOverrideHolder;
-
-
- protected AbstractOverridesComposite(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
-
- @Override
- protected void initialize() {
- super.initialize();
- this.selectedOverrideHolder = buildSelectedOverrideHolder();
- }
-
- private ModifiablePropertyValueModel<ReadOnlyOverride> buildSelectedOverrideHolder() {
- return new SimplePropertyValueModel<ReadOnlyOverride>();
- }
-
- protected abstract boolean supportsAssociationOverrides();
-
- @Override
- protected void initializeLayout(Composite container) {
- // Overrides group pane
- container = addTitledGroup(
- container,
- JptUiDetailsMessages.OverridesComposite_attributeOverridesGroup);
-
- // Overrides list pane
- initializeOverridesList(container);
-
- int groupBoxMargin = getGroupBoxMargin();
-
- // Override Default check box
- Button overrideCheckBox = addCheckBox(
- addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin),
- JptUiDetailsMessages.OverridesComposite_overrideDefault,
- getOverrideVirtualOverrideHolder(),
- null);
- SWTTools.controlVisibleState(buildSelectedOverrideBooleanHolder(), overrideCheckBox);
-
- // Property pane
- PageBook pageBook = addPageBook(container);
- initializeOverridePanes(pageBook);
- installOverrideControlSwitcher(this.selectedOverrideHolder, pageBook);
- }
-
- protected void initializeOverridePanes(PageBook pageBook) {
- initializeAttributeOverridePane(pageBook);
- if (supportsAssociationOverrides()) {
- initializeAssociationOverridePane(pageBook);
- }
- }
-
- private PropertyValueModel<Boolean> buildSelectedOverrideBooleanHolder() {
- return new TransformationPropertyValueModel<ReadOnlyOverride, Boolean>(this.selectedOverrideHolder) {
- @Override
- protected Boolean transform(ReadOnlyOverride value) {
- return Boolean.valueOf(value != null);
- }
- };
- }
-
- private void initializeOverridesList(Composite container) {
- new AddRemoveListPane<T>(
- this,
- addSubPane(container, 8),
- buildOverridesAdapter(),
- buildOverridesListModel(),
- this.selectedOverrideHolder,
- buildOverrideLabelProvider(),
- JpaHelpContextIds.ENTITY_ATTRIBUTE_OVERRIDES) {
-
- @Override
- protected void initializeButtonPane(Composite c, String helpId) {
- //no buttons: no way to add/remove/edit overrides, they are all defaulted in
- }
-
- @Override
- protected void updateButtons() {
- //no buttons: no way to add/remove/edit overrides, they are all defaulted in
- }
- };
- }
-
- protected void initializeAttributeOverridePane(PageBook pageBook) {
- PropertyValueModel<ReadOnlyAttributeOverride> attributeOverrideHolder = buildAttributeOverrideHolder();
- this.attributeOverridePane = buildAttributeOverridePane(pageBook, attributeOverrideHolder);
- installAttributeOverridePaneEnabler(this.attributeOverridePane, attributeOverrideHolder);
- }
-
- protected Pane<ReadOnlyAttributeOverride> buildAttributeOverridePane(PageBook pageBook, PropertyValueModel<ReadOnlyAttributeOverride> attributeOverrideHolder) {
- return new AttributeOverrideComposite(this, attributeOverrideHolder, pageBook);
- }
-
- private void installAttributeOverridePaneEnabler(Pane<ReadOnlyAttributeOverride> pane, PropertyValueModel<ReadOnlyAttributeOverride> overrideHolder) {
- new PaneEnabler(
- buildOverrideBooleanHolder(overrideHolder),
- pane);
- }
-
- private PropertyValueModel<Boolean> buildOverrideBooleanHolder(PropertyValueModel<? extends ReadOnlyOverride> overrideHolder) {
- return new TransformationPropertyValueModel<ReadOnlyOverride, Boolean>(overrideHolder) {
- @Override
- protected Boolean transform_(ReadOnlyOverride v) {
- return Boolean.valueOf( ! v.isVirtual());
- }
- };
- }
-
- protected void initializeAssociationOverridePane(PageBook pageBook) {
- PropertyValueModel<ReadOnlyAssociationOverride> associationOverrideHolder = buildAssociationOverrideHolder();
- this.associationOverridePane = buildAssociationOverridePane(pageBook, associationOverrideHolder);
- installAssociationOverridePaneEnabler(this.associationOverridePane, associationOverrideHolder);
- }
-
- protected Pane<ReadOnlyAssociationOverride> buildAssociationOverridePane(PageBook pageBook, PropertyValueModel<ReadOnlyAssociationOverride> associationOverrideHolder) {
- return new AssociationOverrideComposite(this, associationOverrideHolder, pageBook);
- }
-
- private void installAssociationOverridePaneEnabler(Pane<ReadOnlyAssociationOverride> pane, PropertyValueModel<ReadOnlyAssociationOverride> overrideHolder) {
- new PaneEnabler(
- buildOverrideBooleanHolder(overrideHolder),
- pane);
- }
-
- private void installOverrideControlSwitcher(
- PropertyValueModel<ReadOnlyOverride> overrideHolder,
- PageBook pageBook) {
-
- new ControlSwitcher(
- overrideHolder,
- buildPaneTransformer(),
- pageBook);
- }
-
- private ModifiablePropertyValueModel<ReadOnlyAssociationOverride> buildAssociationOverrideHolder() {
- return new TransformationWritablePropertyValueModel<ReadOnlyOverride, ReadOnlyAssociationOverride>(this.selectedOverrideHolder) {
- @Override
- protected ReadOnlyAssociationOverride transform_(ReadOnlyOverride v) {
- return (v instanceof ReadOnlyAssociationOverride) ? (ReadOnlyAssociationOverride) v : null;
- }
- };
- }
-
- private ModifiablePropertyValueModel<ReadOnlyAttributeOverride> buildAttributeOverrideHolder() {
- return new TransformationWritablePropertyValueModel<ReadOnlyOverride, ReadOnlyAttributeOverride>(this.selectedOverrideHolder) {
- @Override
- protected ReadOnlyAttributeOverride transform_(ReadOnlyOverride v) {
- return (v instanceof ReadOnlyAttributeOverride) ? (ReadOnlyAttributeOverride) v : null;
- }
- };
- }
-
- private ListValueModel<VirtualAssociationOverride> buildDefaultAssociationOverridesListHolder(PropertyValueModel<AssociationOverrideContainer> containerHolder) {
- return new ListAspectAdapter<AssociationOverrideContainer, VirtualAssociationOverride>(containerHolder, OverrideContainer.VIRTUAL_OVERRIDES_LIST) {
- @Override
- protected ListIterable<VirtualAssociationOverride> getListIterable() {
- return new SuperListIterableWrapper<VirtualAssociationOverride>(this.subject.getVirtualOverrides());
- }
-
- @Override
- protected int size_() {
- return this.subject.getVirtualOverridesSize();
- }
- };
- }
-
- private ListValueModel<VirtualAttributeOverride> buildDefaultAttributeOverridesListHolder(PropertyValueModel<AttributeOverrideContainer> containerHolder) {
- return new ListAspectAdapter<AttributeOverrideContainer, VirtualAttributeOverride>(containerHolder, OverrideContainer.VIRTUAL_OVERRIDES_LIST) {
- @Override
- protected ListIterable<VirtualAttributeOverride> getListIterable() {
- return new SuperListIterableWrapper<VirtualAttributeOverride>(this.subject.getVirtualOverrides());
- }
-
- @Override
- protected int size_() {
- return this.subject.getVirtualOverridesSize();
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> getOverrideVirtualOverrideHolder() {
- if (this.overrideVirtualOverrideHolder == null) {
- this.overrideVirtualOverrideHolder = buildOverrideVirtualOverrideHolder();
- }
- return this.overrideVirtualOverrideHolder;
- }
-
- private ModifiablePropertyValueModel<Boolean> buildOverrideVirtualOverrideHolder() {
- return new TransformationWritablePropertyValueModel<ReadOnlyOverride, Boolean>(this.selectedOverrideHolder) {
- @Override
- public void setValue(Boolean value) {
- updateOverride(value.booleanValue());
- }
-
- @Override
- protected Boolean transform_(ReadOnlyOverride v) {
- return Boolean.valueOf( ! v.isVirtual());
- }
- };
- }
-
- String buildOverrideDisplayString(ReadOnlyOverride override) {
- String overrideType;
-
- // Retrieve the type
- if (override instanceof ReadOnlyAssociationOverride) {
- overrideType = JptUiDetailsMessages.OverridesComposite_association;
- }
- else {
- overrideType = JptUiDetailsMessages.OverridesComposite_attribute;
- }
-
- // Format the name
- String name = override.getName();
-
- if (StringTools.stringIsEmpty(name)) {
- name = JptUiDetailsMessages.OverridesComposite_noName;
- }
-
- // Format: <name> (Attribute/Association Override)
- StringBuilder sb = new StringBuilder();
- sb.append(name);
- sb.append(" (");
- sb.append(overrideType);
- sb.append(") ");
- return sb.toString();
- }
-
- protected ILabelProvider buildOverrideLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return buildOverrideDisplayString((ReadOnlyOverride) element);
- }
- };
- }
-
- protected Adapter buildOverridesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- //no way to add/remove/edit overrides, they are all defaulted in
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- //no way to add/remove/edit overrides, they are all defaulted in
- }
- };
- }
-
- protected ListValueModel<ReadOnlyOverride> buildOverridesListHolder() {
- PropertyValueModel<AttributeOverrideContainer> attributeOverrideContainerHolder = buildAttributeOverrideContainerHolder();
- List<ListValueModel<? extends ReadOnlyOverride>> list = new ArrayList<ListValueModel<? extends ReadOnlyOverride>>();
-
- list.add(buildSpecifiedAttributeOverridesListHolder(attributeOverrideContainerHolder));
- list.add(buildDefaultAttributeOverridesListHolder(attributeOverrideContainerHolder));
-
- if (supportsAssociationOverrides()) {
- PropertyValueModel<AssociationOverrideContainer> associationOverrideContainerHolder = buildAssociationOverrideContainerHolder();
- list.add(buildSpecifiedAssociationOverridesListHolder(associationOverrideContainerHolder));
- list.add(buildDefaultAssociationOverridesListHolder(associationOverrideContainerHolder));
- }
-
- return new CompositeListValueModel<ListValueModel<? extends ReadOnlyOverride>, ReadOnlyOverride>(list);
- }
-
- protected abstract PropertyValueModel<AttributeOverrideContainer> buildAttributeOverrideContainerHolder();
-
- protected abstract PropertyValueModel<AssociationOverrideContainer> buildAssociationOverrideContainerHolder();
-
- private ListValueModel<ReadOnlyOverride> buildOverridesListModel() {
- return new ItemPropertyListValueModelAdapter<ReadOnlyOverride>(
- buildOverridesListHolder(),
- ReadOnlyOverride.NAME_PROPERTY);
- }
-
- private Transformer<ReadOnlyOverride, Control> buildPaneTransformer() {
- return new Transformer<ReadOnlyOverride, Control>() {
- public Control transform(ReadOnlyOverride override) {
- return AbstractOverridesComposite.this.transformSelectedOverride(override);
- }
- };
- }
-
- /**
- * Given the selected override, return the control that will be displayed
- */
- protected Control transformSelectedOverride(ReadOnlyOverride selectedOverride) {
- if (selectedOverride instanceof ReadOnlyAttributeOverride) {
- return AbstractOverridesComposite.this.attributeOverridePane.getControl();
- }
-
- if (selectedOverride instanceof ReadOnlyAssociationOverride) {
- return AbstractOverridesComposite.this.associationOverridePane.getControl();
- }
-
- return null;
- }
-
- private ListValueModel<AssociationOverride> buildSpecifiedAssociationOverridesListHolder(PropertyValueModel<AssociationOverrideContainer> containerHolder) {
- return new ListAspectAdapter<AssociationOverrideContainer, AssociationOverride>(containerHolder, OverrideContainer.SPECIFIED_OVERRIDES_LIST) {
- @Override
- protected ListIterable<AssociationOverride> getListIterable() {
- return new SuperListIterableWrapper<AssociationOverride>(this.subject.getSpecifiedOverrides());
- }
-
- @Override
- protected int size_() {
- return this.subject.getSpecifiedOverridesSize();
- }
- };
- }
-
- private ListValueModel<AttributeOverride> buildSpecifiedAttributeOverridesListHolder(PropertyValueModel<AttributeOverrideContainer> containerHolder) {
- return new ListAspectAdapter<AttributeOverrideContainer, AttributeOverride>(containerHolder, OverrideContainer.SPECIFIED_OVERRIDES_LIST) {
- @Override
- protected ListIterable<AttributeOverride> getListIterable() {
- return new SuperListIterableWrapper<AttributeOverride>(this.subject.getSpecifiedOverrides());
- }
-
- @Override
- protected int size_() {
- return this.subject.getSpecifiedOverridesSize();
- }
- };
- }
-
- void updateOverride(boolean convertToSpecified) {
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- ReadOnlyOverride override = this.selectedOverrideHolder.getValue();
-
- ReadOnlyOverride newOverride = convertToSpecified ?
- ((VirtualOverride) override).convertToSpecified() :
- ((Override_) override).convertToVirtual();
- this.selectedOverrideHolder.setValue(newOverride);
- }
- finally {
- setPopulating(false);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractPrimaryKeyJoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractPrimaryKeyJoinColumnsComposite.java
deleted file mode 100644
index 0363b90ede..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractPrimaryKeyJoinColumnsComposite.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.AbstractAdapter;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Join Columns ---------------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | AddRemoveListPane | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class AbstractPrimaryKeyJoinColumnsComposite<T extends Entity> extends Pane<T>
-{
- protected ModifiablePropertyValueModel<PrimaryKeyJoinColumn> joinColumnHolder;
-
- public AbstractPrimaryKeyJoinColumnsComposite(Pane<? extends T> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent, false);
- }
-
- void addJoinColumn(PrimaryKeyJoinColumnStateObject stateObject) {
- PrimaryKeyJoinColumn joinColumn = getSubject().addSpecifiedPrimaryKeyJoinColumn();
- stateObject.updateJoinColumn(joinColumn);
- }
-
- void addPrimaryKeyJoinColumn() {
-
- PrimaryKeyJoinColumnDialog dialog = new PrimaryKeyJoinColumnDialog(
- getShell(),
- getSubject(),
- null
- );
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- addJoinColumn(dialog.getSubject());
- }
- }
-
- protected abstract ListValueModel<? extends ReadOnlyPrimaryKeyJoinColumn> buildDefaultJoinColumnsListHolder();
-
- private ModifiablePropertyValueModel<PrimaryKeyJoinColumn> buildJoinColumnHolder() {
- return new SimplePropertyValueModel<PrimaryKeyJoinColumn>();
- }
-
- String buildJoinColumnLabel(ReadOnlyPrimaryKeyJoinColumn joinColumn) {
- if (joinColumn.isVirtual()) {
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- if (joinColumn.getSpecifiedName() == null) {
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- private Adapter buildJoinColumnsAdapter() {
- return new AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPrimaryKeyJoinColumn();
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_edit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- editPrimaryKeyJoinColumn(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
-
- int[] selectedIndices = listSelectionModel.selectedIndices();
- Entity entity = getSubject();
-
- for (int index = selectedIndices.length; --index >= 0; ) {
- entity.removeSpecifiedPrimaryKeyJoinColumn(selectedIndices[index]);
- }
- }
- };
- }
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- return buildJoinColumnLabel((ReadOnlyPrimaryKeyJoinColumn) element);
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildOverrideDefaultJoinColumnHolder() {
- return new OverrideDefaultJoinColumnHolder();
- }
-
- private ListValueModel<ReadOnlyPrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnsListHolder() {
- List<ListValueModel<? extends ReadOnlyPrimaryKeyJoinColumn>> list = new ArrayList<ListValueModel<? extends ReadOnlyPrimaryKeyJoinColumn>>();
- list.add(buildSpecifiedJoinColumnsListHolder());
- list.add(buildDefaultJoinColumnsListHolder());
- return new CompositeListValueModel<ListValueModel<? extends ReadOnlyPrimaryKeyJoinColumn>, ReadOnlyPrimaryKeyJoinColumn>(list);
- }
-
- private ListValueModel<ReadOnlyPrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnsListModel() {
- return new ItemPropertyListValueModelAdapter<ReadOnlyPrimaryKeyJoinColumn>(
- buildPrimaryKeyJoinColumnsListHolder(),
- ReadOnlyNamedColumn.SPECIFIED_NAME_PROPERTY,
- ReadOnlyNamedColumn.DEFAULT_NAME_PROPERTY,
- ReadOnlyBaseJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY,
- ReadOnlyBaseJoinColumn.DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY
- );
- }
-
- ListValueModel<PrimaryKeyJoinColumn> buildSpecifiedJoinColumnsListHolder() {
- return new ListAspectAdapter<Entity, PrimaryKeyJoinColumn>(getSubjectHolder(), Entity.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST) {
- @Override
- protected ListIterable<PrimaryKeyJoinColumn> getListIterable() {
- return new SuperListIterableWrapper<PrimaryKeyJoinColumn>(subject.getSpecifiedPrimaryKeyJoinColumns());
- }
-
- @Override
- protected int size_() {
- return subject.getSpecifiedPrimaryKeyJoinColumnsSize();
- }
- };
- }
-
- void editJoinColumn(PrimaryKeyJoinColumnStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- void editPrimaryKeyJoinColumn(ObjectListSelectionModel listSelectionModel) {
-
- PrimaryKeyJoinColumn joinColumn = (PrimaryKeyJoinColumn) listSelectionModel.selectedValue();
-
- PrimaryKeyJoinColumnDialog dialog = new PrimaryKeyJoinColumnDialog(
- getShell(),
- getSubject(),
- joinColumn
- );
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- editJoinColumn(dialog.getSubject());
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- joinColumnHolder = buildJoinColumnHolder();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Primary Key Join Columns group pane
- Group groupPane = addTitledGroup(
- container,
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn
- );
-
- // Override Default Join Columns check box
- addCheckBox(
- addSubPane(groupPane, 8),
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns,
- buildOverrideDefaultJoinColumnHolder(),
- null
- );
-
- // Primary Key Join Columns list pane
- AddRemoveListPane<Entity> joinColumnsListPane = new AddRemoveListPane<Entity>(
- this,
- groupPane,
- buildJoinColumnsAdapter(),
- buildPrimaryKeyJoinColumnsListModel(),
- joinColumnHolder,
- buildJoinColumnsListLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS
- );
-
- installJoinColumnsListPaneEnabler(joinColumnsListPane);
- }
-
- private void installJoinColumnsListPaneEnabler(AddRemoveListPane<Entity> pane) {
- new PaneEnabler(
- buildOverrideDefaultJoinColumnHolder(),
- pane
- );
- }
-
- void updateJoinColumns(boolean selected) {
-
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- // Add a join column by creating a specified one using the default
- // one if it exists
- if (selected) {
-
- switchDefaultToSpecified();
- }
- // Remove all the specified join columns
- else {
- for (int index = getSubject().getSpecifiedPrimaryKeyJoinColumnsSize(); --index >= 0; ) {
- getSubject().removeSpecifiedPrimaryKeyJoinColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- protected abstract void switchDefaultToSpecified();
-
- private class OverrideDefaultJoinColumnHolder extends ListPropertyValueModelAdapter<Boolean>
- implements ModifiablePropertyValueModel<Boolean> {
-
- public OverrideDefaultJoinColumnHolder() {
- super(buildSpecifiedJoinColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return listModel.size() > 0;
- }
-
- public void setValue(Boolean value) {
- updateJoinColumns(value.booleanValue());
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractSecondaryTablesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractSecondaryTablesComposite.java
deleted file mode 100644
index dc854abf0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractSecondaryTablesComposite.java
+++ /dev/null
@@ -1,178 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.ReadOnlySecondaryTable;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PrimaryKeyJoinColumnsInSecondaryTableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OrmEntity
- * @see OrmEntityComposite - The container of this pane
- * @see AddRemoveListPane
- * @see PrimaryKeyJoinColumnsInSecondaryTableComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public abstract class AbstractSecondaryTablesComposite<T extends Entity> extends Pane<T>
-{
- /**
- * Creates a new <code>SecondaryTablesComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public AbstractSecondaryTablesComposite(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- /**
- * Creates a new <code>SecondaryTablesComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public AbstractSecondaryTablesComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- protected void addSecondaryTableFromDialog(SecondaryTableDialog dialog, ObjectListSelectionModel listSelectionModel) {
- if (dialog.open() != Window.OK) {
- return;
- }
-
- SecondaryTable secondaryTable = this.getSubject().addSpecifiedSecondaryTable();
- secondaryTable.setSpecifiedName(dialog.getSelectedTable());
- secondaryTable.setSpecifiedCatalog(dialog.getSelectedCatalog());
- secondaryTable.setSpecifiedSchema(dialog.getSelectedSchema());
-
- listSelectionModel.setSelectedValue(secondaryTable);
- }
-
- protected ModifiablePropertyValueModel<SecondaryTable> buildSecondaryTableHolder() {
- return new SimplePropertyValueModel<SecondaryTable>();
- }
-
- protected ILabelProvider buildSecondaryTableLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- // TODO display a qualified name instead
- ReadOnlySecondaryTable secondaryTable = (ReadOnlySecondaryTable) element;
- if (secondaryTable.getName() != null) {
- return secondaryTable.getName();
- }
- return "";//TODO
- }
- };
- }
-
- protected SecondaryTableDialog buildSecondaryTableDialogForAdd() {
- return new SecondaryTableDialog(getShell(), getSubject().getJpaProject(), getSubject().getTable().getDefaultCatalog(), getSubject().getTable().getDefaultSchema());
- }
-
- protected AddRemoveListPane.Adapter buildSecondaryTablesAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- SecondaryTableDialog dialog = buildSecondaryTableDialogForAdd();
- addSecondaryTableFromDialog(dialog, listSelectionModel);
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiDetailsMessages.SecondaryTablesComposite_edit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- SecondaryTable secondaryTable = (SecondaryTable) listSelectionModel.selectedValue();
- SecondaryTableDialog dialog = new SecondaryTableDialog(getShell(), getSubject().getJpaProject(), secondaryTable);
- editSecondaryTableFromDialog(dialog, secondaryTable);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- Entity entity = getSubject();
- int[] selectedIndices = listSelectionModel.selectedIndices();
-
- for (int index = selectedIndices.length; --index >= 0; ) {
- entity.removeSpecifiedSecondaryTable(selectedIndices[index]);
- }
- }
-
- @Override
- public boolean enableOptionOnSelectionChange(ObjectListSelectionModel listSelectionModel) {
- if (listSelectionModel.selectedValuesSize() != 1) {
- return false;
- }
- SecondaryTable secondaryTable = (SecondaryTable) listSelectionModel.selectedValue();
- return !secondaryTable.isVirtual();
- }
-
- @Override
- public boolean enableRemoveOnSelectionChange(ObjectListSelectionModel listSelectionModel) {
- if (listSelectionModel.selectedValue() == null) {
- return false;
- }
- SecondaryTable secondaryTable = (SecondaryTable) listSelectionModel.selectedValue();
- return !secondaryTable.isVirtual();
- }
- };
- }
-
- protected void editSecondaryTableFromDialog(SecondaryTableDialog dialog, SecondaryTable secondaryTable) {
- if (dialog.open() != Window.OK) {
- return;
- }
-
- secondaryTable.setSpecifiedName(dialog.getSelectedTable());
- secondaryTable.setSpecifiedCatalog(dialog.getSelectedCatalog());
- secondaryTable.setSpecifiedSchema(dialog.getSelectedSchema());
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractTransientMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractTransientMappingUiDefinition.java
deleted file mode 100644
index 0453e01eb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractTransientMappingUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractTransientMappingUiDefinition<M, T extends TransientMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractTransientMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.TransientMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.TransientMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingComposite.java
deleted file mode 100644
index 87c879c7c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingComposite.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see VersionMapping
- * @see ColumnComposite
- * @see TemporalTypeComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public abstract class AbstractVersionMappingComposite<T extends VersionMapping>
- extends Pane<T>
- implements JpaComposite
-{
- /**
- * Creates a new <code>VersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IVersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractVersionMappingComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeVersionCollapsibleSection(container);
- initializeTypeCollapsibleSection(container);
- }
-
- protected void initializeVersionCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.VersionSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeVersionSection(container);
- }
-
- protected abstract void initializeVersionSection(Composite container);
-
- protected void initializeTypeCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.TypeSection_type
- );
- this.initializeTypeSection(container);
- }
-
- protected void initializeTypeSection(Composite container) {
- ((GridLayout) container.getLayout()).numColumns = 2;
-
- // No converter
- Button noConverterButton = addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_default,
- buildConverterBooleanHolder(null),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- container,
- JptUiDetailsMessages.TypeSection_temporal,
- buildConverterBooleanHolder(BaseTemporalConverter.class),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), container, getWidgetFactory()));
- }
-
- protected PropertyValueModel<Column> buildColumnHolder() {
- return new TransformationPropertyValueModel<T, Column>(getSubjectHolder()) {
- @Override
- protected Column transform_(T value) {
- return value.getColumn();
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildConverterBooleanHolder(final Class<? extends Converter> converterType) {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getType() == converterType);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(converterType);
- }
- }
- };
- }
-
- private PropertyValueModel<Converter> buildConverterHolder() {
- return new PropertyAspectAdapter<VersionMapping, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Converter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- private PropertyValueModel<BaseTemporalConverter> buildTemporalConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, BaseTemporalConverter>(converterHolder) {
- @Override
- protected BaseTemporalConverter transform_(Converter converter) {
- return converter.getType() == BaseTemporalConverter.class ? (BaseTemporalConverter) converter : null;
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingUiDefinition.java
deleted file mode 100644
index 829f66bc5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AbstractVersionMappingUiDefinition.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractVersionMappingUiDefinition<M, T extends VersionMapping>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractVersionMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.VersionMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages.VersionMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AccessTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AccessTypeComposite.java
deleted file mode 100644
index 4807fc03d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AccessTypeComposite.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see AccessHolder
- * @see OrmEntityComposite - A container of this pane
- * @see OrmEmbeddableComposite - A container of this pane
- * @see OrmMappedSuperclassComposite - A container of this pane
- *
- * @version 2.2
- * @since 1.0
- */
-public class AccessTypeComposite extends Pane<AccessHolder> {
-
- /**
- * Creates a new <code>AccessTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public AccessTypeComposite(Pane<?> parentPane,
- PropertyValueModel<? extends AccessHolder> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- public AccessTypeComposite(Pane<?> parentPane,
- PropertyValueModel<? extends AccessHolder> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- EnumFormComboViewer<AccessHolder, AccessType> comboViewer =
- addAccessTypeComboViewer(container);
-
- addLabeledComposite(
- container,
- JptUiMessages.AccessTypeComposite_access,
- comboViewer.getControl()
- );
- }
-
- private EnumFormComboViewer<AccessHolder, AccessType> addAccessTypeComboViewer(Composite container) {
-
- return new EnumFormComboViewer<AccessHolder, AccessType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(AccessHolder.DEFAULT_ACCESS_PROPERTY);
- propertyNames.add(AccessHolder.SPECIFIED_ACCESS_PROPERTY);
- }
-
- @Override
- protected AccessType[] getChoices() {
- if (getSubject() == null) {
- return new AccessType[]{};
- }
- return getJpaPlatformVariation().getSupportedAccessTypes(getSubject().getResourceType());
- }
-
- JpaPlatformVariation getJpaPlatformVariation() {
- return getSubject().getJpaProject().getJpaPlatform().getJpaVariation();
- }
-
- @Override
- protected AccessType getDefaultValue() {
- return getSubject().getDefaultAccess();
- }
-
- @Override
- protected String displayString(AccessType value) {
- return value.getDisplayString();
- }
-
- @Override
- protected AccessType getValue() {
- return getSubject().getSpecifiedAccess();
- }
-
- @Override
- protected void setValue(AccessType value) {
- getSubject().setSpecifiedAccess(value);
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AddQueryDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AddQueryDialog.java
deleted file mode 100644
index f4a193483f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AddQueryDialog.java
+++ /dev/null
@@ -1,195 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Clients can use this dialog to prompt the user for SecondaryTable settings.
- * Use the following once the dialog is closed:
- * @see #getSelectedTable()
- * @see #getSelectedCatalog()
- * @see #getSelectedSchema()
- * @version 2.1
- * @since 2.1
- */
-public class AddQueryDialog extends ValidatingDialog<AddQueryStateObject> {
- public static final String NAMED_QUERY = "namedQuery"; //$NON-NLS-1$
- public static final String NAMED_NATIVE_QUERY = "namedNativeQuery"; //$NON-NLS-1$
-
- /**
- * The associated persistence unit
- */
- private PersistenceUnit pUnit;
-
- // ********** constructors **********
-
- /**
- * Use this constructor to edit an existing conversion value
- * @param pUnit
- */
- public AddQueryDialog(Shell parent, PersistenceUnit pUnit) {
- super(parent);
- this.pUnit = pUnit;
- }
-
- @Override
- protected AddQueryStateObject buildStateObject() {
- return new AddQueryStateObject(this.pUnit);
- }
-
- // ********** open **********
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(this.getTitle());
- }
-
- @Override
- protected String getTitle() {
- return JptUiDetailsMessages.AddQueryDialog_title;
- }
-
- @Override
- protected String getDescriptionTitle() {
- return JptUiDetailsMessages.AddQueryDialog_descriptionTitle;
- }
-
- @Override
- protected String getDescription() {
- return JptUiDetailsMessages.AddQueryDialog_description;
- }
-
- @Override
- protected DialogPane<AddQueryStateObject> buildLayout(Composite container) {
- return new QueryDialogPane(container);
- }
-
- @Override
- public void create() {
- super.create();
-
- QueryDialogPane pane = (QueryDialogPane) getPane();
- pane.selectAll();
-
- getButton(OK).setEnabled(false);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the data value set in the text widget.
- */
- public String getName() {
- return getSubject().getName();
- }
-
- /**
- * Return the object value set in the text widget.
- */
- public String getQueryType() {
- return getSubject().getQueryType();
- }
-
- private class QueryDialogPane extends DialogPane<AddQueryStateObject> {
-
- private Text nameText;
-
- QueryDialogPane(Composite parent) {
- super(AddQueryDialog.this.getSubjectHolder(), parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.nameText = addLabeledText(
- container,
- JptUiDetailsMessages.AddQueryDialog_name,
- buildNameHolder()
- );
-
- addLabeledCombo(
- container,
- JptUiDetailsMessages.AddQueryDialog_queryType,
- buildQueryTypeListHolder(),
- buildQueryTypeHolder(),
- buildStringConverter(),
- null);
- }
-
- protected ListValueModel<String> buildQueryTypeListHolder() {
- List<String> queryTypes = new ArrayList<String>();
- queryTypes.add(NAMED_QUERY);
- queryTypes.add(NAMED_NATIVE_QUERY);
-
- return new StaticListValueModel<String>(queryTypes);
- }
-
- private StringConverter<String> buildStringConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- if (value == NAMED_QUERY) {
- return JptUiDetailsMessages.AddQueryDialog_namedQuery;
- }
- if (value == NAMED_NATIVE_QUERY) {
- return JptUiDetailsMessages.AddQueryDialog_namedNativeQuery;
- }
- return value;
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildNameHolder() {
- return new PropertyAspectAdapter<AddQueryStateObject, String>(getSubjectHolder(), AddQueryStateObject.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildQueryTypeHolder() {
- return new PropertyAspectAdapter<AddQueryStateObject, String>(getSubjectHolder(), AddQueryStateObject.QUERY_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getQueryType();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setQueryType(value);
- }
- };
- }
-
- void selectAll() {
- this.nameText.selectAll();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AddQueryStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AddQueryStateObject.java
deleted file mode 100644
index 0fea66a9f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AddQueryStateObject.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.common.utility.internal.node.Problem;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-
-/**
- * This is the state object used by the <code>AddQueryDialog</code>, which stores
- * the current name and validates it when it is modified.
- *
- * @see AddQueryDialog
- *
- * @version 2.1
- * @since 2.1
- */
-final class AddQueryStateObject extends AbstractNode
-{
- /**
- * The initial name or <code>null</code>
- */
- private String name;
-
- /**
- * The initial queryType or <code>null</code>
- */
- private String queryType;
-
- /**
- * The <code>Validator</code> used to validate this state object.
- */
- private Validator validator;
-
- /**
- * The associated persistence unit
- */
- private PersistenceUnit pUnit;
-
- /**
- * Notifies a change in the data value property.
- */
- static final String NAME_PROPERTY = "nameProperty"; //$NON-NLS-1$
-
- /**
- * Notifies a change in the query type property.
- */
- static final String QUERY_TYPE_PROPERTY = "queryTypeProperty"; //$NON-NLS-1$
-
- /**
- * Creates a new <code>NewNameStateObject</code>.
- *
- * @param name The initial input or <code>null</code> if no initial value can
- * be specified
- * @param names The collection of names that can't be used or an empty
- * collection if none are available
- */
- AddQueryStateObject(PersistenceUnit pUnit) {
- super(null);
- this.pUnit = pUnit;
- }
-
- private void addNameProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.name)) {
- currentProblems.add(buildProblem(JptUiDetailsMessages.QueryStateObject_nameMustBeSpecified, IMessageProvider.ERROR));
- }
- else if (names().contains(this.name)){
- currentProblems.add(buildProblem(JptUiDetailsMessages.AddQueryDialog_nameExists, IMessageProvider.WARNING));
- }
- }
-
- private void addQueryTypeProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.queryType)) {
- currentProblems.add(buildProblem(JptUiDetailsMessages.QueryStateObject_typeMustBeSpecified, IMessageProvider.ERROR));
- }
- }
-
- @Override
- protected void addProblemsTo(List<Problem> currentProblems) {
- super.addProblemsTo(currentProblems);
- addNameProblemsTo(currentProblems);
- addQueryTypeProblemsTo(currentProblems);
- }
-
- private List<String> names(){
- List<String> names = new ArrayList<String>();
- for (Query query : this.pUnit.getQueries()){
- String name = query.getName();
- names.add(name);
- }
- return names;
- }
-
- @Override
- protected void checkParent(Node parentNode) {
- //no parent
- }
-
- public String displayString() {
- return null;
- }
-
- String getName() {
- return this.name;
- }
-
- String getQueryType() {
- return this.queryType;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public void setQueryType(String newQueryType) {
- String old = this.queryType;
- this.queryType = newQueryType;
- firePropertyChanged(QUERY_TYPE_PROPERTY, old, newQueryType);
- }
-
- @Override
- public void setValidator(Validator validator) {
- this.validator = validator;
- }
-
- @Override
- public Validator getValidator() {
- return this.validator;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AssociationOverrideComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AssociationOverrideComposite.java
deleted file mode 100644
index 664a6e29e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AssociationOverrideComposite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | JoinColumnsComposite |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see AssociationOverride
- * @see EntityOverridesComposite - The parent container
- * @see JoinColumnJoiningStrategyPane
- *
- * @version 2.2
- * @since 1.0
- */
-public class AssociationOverrideComposite
- extends Pane<ReadOnlyAssociationOverride>
-{
- /**
- * Creates a new <code>AssociationOverrideComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>AssociationOverride</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public AssociationOverrideComposite(Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyAssociationOverride> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addTitledGroup(
- container,
- JptUiDetailsMessages.Joining_title);
-
- addJoinColumnJoiningStrategyPane(composite);
-
- addSubPane(composite, 5);
- }
-
- protected void addJoinColumnJoiningStrategyPane(Composite container) {
- JoinColumnJoiningStrategyPane.
- buildJoinColumnJoiningStrategyPaneWithoutIncludeOverrideCheckBox(
- this,
- buildRelationshipModel(),
- container);
- }
-
- private PropertyValueModel<ReadOnlyJoinColumnRelationship> buildRelationshipModel() {
- return new TransformationPropertyValueModel<ReadOnlyAssociationOverride, ReadOnlyJoinColumnRelationship>(getSubjectHolder()) {
- @Override
- protected ReadOnlyJoinColumnRelationship transform_(ReadOnlyAssociationOverride value) {
- // with virtual overrides: m:m mappings do not support join columns, so we need to check
- ReadOnlyRelationship relationship = value.getRelationship();
- return (relationship instanceof ReadOnlyJoinColumnRelationship) ?
- (ReadOnlyJoinColumnRelationship) relationship : null;
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AttributeOverrideComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AttributeOverrideComposite.java
deleted file mode 100644
index e7a24c5c58..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/AttributeOverrideComposite.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | ColumnComposite |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see AttributeOverride
- * @see EntityOverridesComposite - The parent container
- * @see ColumnComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class AttributeOverrideComposite extends Pane<ReadOnlyAttributeOverride>
-{
-
- /**
- * Creates a new <code>AttributeOverrideComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>AttributeOverride</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public AttributeOverrideComposite(Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyAttributeOverride> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new ColumnComposite(
- this,
- buildColumnHolder(),
- container
- );
- }
-
- private PropertyValueModel<ReadOnlyColumn> buildColumnHolder() {
- return new TransformationPropertyValueModel<ReadOnlyAttributeOverride, ReadOnlyColumn>(getSubjectHolder()) {
- @Override
- protected ReadOnlyColumn transform_(ReadOnlyAttributeOverride value) {
- return value.getColumn();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialog.java
deleted file mode 100644
index 25ca0bd349..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialog.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseJoinColumn;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The abstract definition the dialog showing the information for a join column
- * to edit or to create.
- *
- * @see BaseJoinColumnStateObject
- *
- * @version 2.0
- * @since 1.0
- */
-public abstract class BaseJoinColumnDialog<T extends BaseJoinColumnStateObject>
- extends ValidatingDialog<T>
-{
-
- /**
- * Either the join column to edit or <code>null</code> if this state object
- * is used to create a new one.
- */
- private ReadOnlyBaseJoinColumn joinColumn;
-
- /**
- * The owner of the join column to create or where it is located.
- */
- private Object owner;
-
- /**
- * Creates a new <code>BaseJoinColumnDialog</code>.
- *
- * @param parent The parent shell
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public BaseJoinColumnDialog(Shell parent,
- Object owner,
- ReadOnlyBaseJoinColumn joinColumn) {
-
- super(parent);
-
- this.owner = owner;
- this.joinColumn = joinColumn;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getDescription() {
- return JptUiDetailsMessages.JoinColumnDialog_description;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getDescriptionTitle() {
-
- if (joinColumn == null) {
- return JptUiDetailsMessages.JoinColumnDialog_addJoinColumnDescriptionTitle;
- }
-
- return JptUiDetailsMessages.JoinColumnDialog_editJoinColumnDescriptionTitle;
- }
-
- /**
- * Returns the join column used by this state object for editing or
- * <code>null</code> if this state object is used to create a new one.
- *
- * @return Either the edited join column or <code>null</code>
- */
- public ReadOnlyBaseJoinColumn getJoinColumn() {
- return joinColumn;
- }
-
- /**
- * Returns the owner where the join column is located or where a new one can
- * be added.
- *
- * @return The parent of the join column
- */
- protected Object getOwner() {
- return owner;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getTitle() {
-
- if (joinColumn == null) {
- return JptUiDetailsMessages.JoinColumnDialog_addJoinColumnTitle;
- }
-
- return JptUiDetailsMessages.JoinColumnDialog_editJoinColumnTitle;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialogPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialogPane.java
deleted file mode 100644
index ab0493a55e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnDialogPane.java
+++ /dev/null
@@ -1,442 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------- |
- * | Name: | I |v| |
- * | ------------------------------------------------- |
- * | ------------------------------------------------- |
- * | Referenced Column Name: | I |v| |
- * | ------------------------------------------------- |
- * | ------------------------------------------------- |
- * | Table: | I |v| |
- * | ------------------------------------------------- |
- * | ------------------------------------------------- |
- * | Column Definition: | I | |
- * | ------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BaseJoinColumnStateObject
- * @see InverseJoinColumnInJoinTableDialog - A container of this pane
- * @see JoinColumnInReferenceTableDialog - A container of this pane
- * @see PrimaryKeyJoinColumnDialog - A container of this pane
- * @see PrimaryKeyJoinColumnInSecondaryTableDialog - A container of this pane
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class BaseJoinColumnDialogPane<T extends BaseJoinColumnStateObject> extends DialogPane<T>
-{
- /**
- * A key used to represent the default value, this is required to convert
- * the selected item from a combo to <code>null</code>. This key is most
- * likely never typed the user and it will help to convert the value to
- * <code>null</code> when it's time to set the new selected value into the
- * model.
- */
- protected static String DEFAULT_KEY = "?!#!?#?#?default?#?!#?!#?";
-
- /**
- * Creates a new <code>BaseJoinColumnDialogPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public BaseJoinColumnDialogPane(PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent);
- }
-
- private ModifiablePropertyValueModel<String> buildColumnDefinitionHolder() {
- return new PropertyAspectAdapter<BaseJoinColumnStateObject, String>(getSubjectHolder(), BaseJoinColumnStateObject.COLUMN_DEFINITION_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getColumnDefinition();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setColumnDefinition(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Composite addContainer(Composite parent) {
- return addSubPane(parent, 0, 7, 0, 5);
- }
-
- private PropertyValueModel<String> buildDefaultNameHolder() {
- return new TransformationPropertyValueModel<BaseJoinColumnStateObject, String>(getSubjectHolder()) {
- @Override
- protected String transform_(BaseJoinColumnStateObject value) {
- String name = value.getDefaultName();
-
- if (name == null) {
- name = DEFAULT_KEY;
- }
- else {
- name = DEFAULT_KEY + name;
- }
-
- return name;
- }
- };
- }
-
- private ListValueModel<String> buildDefaultNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- buildDefaultNameHolder()
- );
- }
-
- private PropertyValueModel<String> buildDefaultReferencedColumnNameHolder() {
- return new TransformationPropertyValueModel<BaseJoinColumnStateObject, String>(getSubjectHolder()) {
- @Override
- protected String transform_(BaseJoinColumnStateObject value) {
- String name = value.getDefaultReferencedColumnName();
-
- if (name == null) {
- name = DEFAULT_KEY;
- }
- else {
- name = DEFAULT_KEY + name;
- }
-
- return name;
- }
- };
- }
-
- private ListValueModel<String> buildDefaultReferencedColumnNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- buildDefaultReferencedColumnNameHolder()
- );
- }
-
- private PropertyValueModel<String> buildDefaultTableHolder() {
- return new TransformationPropertyValueModel<BaseJoinColumnStateObject, String>(getSubjectHolder()) {
- @Override
- protected String transform_(BaseJoinColumnStateObject value) {
- String name = value.getDefaultTable();
-
- if (name == null) {
- name = DEFAULT_KEY;
- }
- else {
- name = DEFAULT_KEY + name;
- }
-
- return name;
- }
- };
- }
-
- private ListValueModel<String> buildDefaultTableListHolder() {
- return new PropertyListValueModelAdapter<String>(
- buildDefaultTableHolder()
- );
- }
-
- private StringConverter<String> buildDisplayableStringConverter(final DefaultValueHandler handler) {
- return new StringConverter<String>() {
- public String convertToString(String value) {
-
- if (getSubject() == null) {
- return null;
- }
-
- if (value == null) {
- value = handler.getDefaultValue();
-
- if (value != null) {
- value = DEFAULT_KEY + value;
- }
- else {
- value = DEFAULT_KEY;
- }
- }
-
- if (value.startsWith(DEFAULT_KEY)) {
- String defaultName = value.substring(DEFAULT_KEY.length());
-
- if (defaultName.length() > 0) {
- value = NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultName
- );
- }
- else {
- value = JptCommonUiMessages.DefaultEmpty;
- }
- }
-
- return value;
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildNameHolder() {
- return new PropertyAspectAdapter<BaseJoinColumnStateObject, String>(getSubjectHolder(), BaseJoinColumnStateObject.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
-
- // Convert the default value or an empty string to null
- if ((value != null) &&
- ((value.length() == 0) || value.startsWith(DEFAULT_KEY))) {
-
- value = null;
- }
-
- subject.setName(value);
- }
- };
- }
-
- private ListValueModel<String> buildNameListHolder() {
- return new ListAspectAdapter<BaseJoinColumnStateObject, String>(getSubjectHolder(), BaseJoinColumnStateObject.NAMES_LIST) {
- @Override
- protected ListIterator<String> listIterator_() {
- return subject.names();
- }
- @Override
- protected int size_() {
- return subject.columnsSize();
- }
- };
- }
-
- private ListValueModel<String> buildNamesListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(buildDefaultNameListHolder());
- holders.add(buildNameListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private StringConverter<String> buildNameStringConverter() {
- return buildDisplayableStringConverter(new DefaultValueHandler() {
- public String getDefaultValue() {
- return getSubject().getDefaultName();
- }
- });
- }
-
- private ModifiablePropertyValueModel<String> buildReferencedColumnNameHolder() {
- return new PropertyAspectAdapter<BaseJoinColumnStateObject, String>(getSubjectHolder(), BaseJoinColumnStateObject.REFERENCED_COLUMN_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getReferencedColumnName();
- }
-
- @Override
- protected void setValue_(String value) {
-
- // Convert the default value or an empty string to null
- if ((value != null) &&
- ((value.length() == 0) || value.startsWith(DEFAULT_KEY))) {
-
- value = null;
- }
-
- subject.setReferencedColumnName(value);
- }
- };
- }
-
- private ListValueModel<String> buildReferencedColumnNameListHolder() {
- return new ListAspectAdapter<BaseJoinColumnStateObject, String>(getSubjectHolder(), BaseJoinColumnStateObject.REFERENCE_COLUMN_NAMES_LIST) {
- @Override
- protected ListIterator<String> listIterator_() {
- return subject.referenceColumnNames();
- }
- @Override
- protected int size_() {
- return subject.referenceColumnsSize();
- }
- };
- }
-
- private ListValueModel<String> buildReferencedColumnNamesListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(buildDefaultReferencedColumnNameListHolder());
- holders.add(buildReferencedColumnNameListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private StringConverter<String> buildReferencedColumnNameStringConverter() {
- return buildDisplayableStringConverter(new DefaultValueHandler() {
- public String getDefaultValue() {
- return getSubject().getDefaultReferencedColumnName();
- }
- });
- }
-
- private ModifiablePropertyValueModel<String> buildTableHolder() {
- return new PropertyAspectAdapter<BaseJoinColumnStateObject, String>(getSubjectHolder(), BaseJoinColumnStateObject.TABLE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getTable();
- }
-
- @Override
- protected void setValue_(String value) {
-
- // Convert the default value or an empty string to null
- if ((value != null) &&
- ((value.length() == 0) || value.startsWith(DEFAULT_KEY))) {
-
- value = null;
- }
-
- subject.setTable(value);
- }
- };
- }
-
- private ListValueModel<String> buildTableListHolder() {
- return new ListAspectAdapter<BaseJoinColumnStateObject, String>(getSubjectHolder(), "") {
- @Override
- protected ListIterator<String> listIterator_() {
- return subject.tables();
- }
- };
- }
-
- private ListValueModel<String> buildTablesListHolder() {
- ArrayList<ListValueModel<String>> holders = new ArrayList<ListValueModel<String>>(2);
- holders.add(buildDefaultTableListHolder());
- holders.add(buildTableListHolder());
- return new CompositeListValueModel<ListValueModel<String>, String>(holders);
- }
-
- private StringConverter<String> buildTableStringConverter() {
- return buildDisplayableStringConverter(new DefaultValueHandler() {
- public String getDefaultValue() {
- return getSubject().getDefaultTable();
- }
- });
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- Combo nameCombo = addLabeledEditableCombo(
- container,
- JptUiDetailsMessages.JoinColumnDialog_name,
- buildNamesListHolder(),
- buildNameHolder(),
- buildNameStringConverter(),
- JpaHelpContextIds.MAPPING_JOIN_COLUMN_NAME
- );
-
- SWTUtil.attachDefaultValueHandler(nameCombo);
-
- // Referenced Column Name widgets
- Combo referencedColumnNameCombo = addLabeledEditableCombo(
- container,
- JptUiDetailsMessages.JoinColumnDialog_referencedColumnName,
- buildReferencedColumnNamesListHolder(),
- buildReferencedColumnNameHolder(),
- buildReferencedColumnNameStringConverter(),
- JpaHelpContextIds.MAPPING_JOIN_REFERENCED_COLUMN
- );
-
- SWTUtil.attachDefaultValueHandler(referencedColumnNameCombo);
-
- // Table widgets
- if (isTableEditable()) {
-
- Combo tableCombo = addLabeledEditableCombo(
- container,
- JptUiDetailsMessages.JoinColumnDialogPane_table,
- buildTablesListHolder(),
- buildTableHolder(),
- buildTableStringConverter(),
- JpaHelpContextIds.MAPPING_JOIN_REFERENCED_COLUMN
- );
-
- SWTUtil.attachDefaultValueHandler(tableCombo);
- }
- else {
- Combo tableCombo = addLabeledCombo(
- container,
- JptUiDetailsMessages.JoinColumnDialogPane_table,
- buildTablesListHolder(),
- buildTableHolder(),
- buildTableStringConverter(),
- JpaHelpContextIds.MAPPING_JOIN_REFERENCED_COLUMN
- );
-
- tableCombo.setEnabled(false);
- }
-
- // Column Definition widgets
- addLabeledText(
- container,
- JptUiDetailsMessages.JoinColumnDialogPane_columnDefinition,
- buildColumnDefinitionHolder()
- );
- }
-
- /**
- * Determines whether the table combo should be editable or not. The default
- * is to keep the combo read-only.
- *
- * @return <code>true</code> to support the editing of the selected table;
- * <code>false</code> otherwise
- */
- protected boolean isTableEditable() {
- return false;
- }
-
- protected static interface DefaultValueHandler {
- String getDefaultValue();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnStateObject.java
deleted file mode 100644
index 044e5398bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BaseJoinColumnStateObject.java
+++ /dev/null
@@ -1,389 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.common.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.jpa.core.context.BaseJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseJoinColumn;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * The abstract definition of a state object used to edit or create a new
- * join column.
- *
- * @see AbstractJoinColumn
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class BaseJoinColumnStateObject
- extends AbstractNode
-{
- /**
- * The SQL fragment that is used when generating the DDL for the column.
- */
- private String columnDefinition;
-
- /**
- * Either the join column is being edited or <code>null</code> the state
- * object is being created.
- */
- private ReadOnlyBaseJoinColumn joinColumn;
-
- /**
- * The join column's name or <code>null</code> if not defined.
- */
- private String name;
-
- /**
- * The owner of the join column to create or where it is located.
- */
- private Object owner;
-
- /**
- * The referenced column name or <code>null</code> if not defined.
- */
- private String referencedColumnName;
-
- /**
- * The table
- */
- private String table;
-
- /**
- * Keeps track of the <code>Validator</code> since this is the root object.
- */
- private Validator validator;
-
- /**
- * Identifies a change in the column definition property.
- */
- public static final String COLUMN_DEFINITION_PROPERTY = "columnDefinition";
-
- /**
- * Identifies a change in the name property.
- */
- public static final String NAME_PROPERTY = "name";
-
- /**
- * Identifies a change in the list of names.
- */
- public static final String NAMES_LIST = "names";
-
- /**
- * Identifies a change in the list of reference column names.
- */
- public static final String REFERENCE_COLUMN_NAMES_LIST = "referenceColumnNames";
-
- /**
- * Identifies a change in the referenced column name property.
- */
- public static final String REFERENCED_COLUMN_NAME_PROPERTY = "referencedColumnName";
-
- /**
- * Identifies a change in the table property.
- */
- public static final String TABLE_PROPERTY = "table";
-
- /**
- * Creates a new <code>AbstractJoinColumnStateObject</code>.
- *
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public BaseJoinColumnStateObject(Object owner, ReadOnlyBaseJoinColumn joinColumn) {
- super(null);
- initialize(owner, joinColumn);
- }
-
- @Override
- protected final void checkParent(Node parentNode) {
- // This is the root of the Join Column state object
- }
-
- private static ListIterator<String> columnNames(Table table) {
- if (table == null) {
- return EmptyListIterator.instance();
- }
- return CollectionTools.list(table.getSortedColumnIdentifiers()).listIterator();
- }
-
- private static int columnsSize(Table table) {
- if (table == null) {
- return 0;
- }
- return table.getColumnsSize();
- }
-
- public final String displayString() {
- return "";
- }
-
- /**
- * Returns the SQL fragment that is used when generating the DDL for the
- * column.
- *
- * @return The edited column name or <code>null</code> if not used
- */
- public String getColumnDefinition() {
- return columnDefinition;
- }
-
- /**
- * Returns the default name if the join column is being edited otherwise
- * <code>null</code> is returned.
- *
- * @return Either the default name defined by the join column or <code>null</code>
- */
- public String getDefaultName() {
- return (this.joinColumn == null) ? null : this.joinColumn.getDefaultName();
- }
-
- /**
- * Returns the default referenced column name if the join column is being
- * edited otherwise <code>null</code> is returned.
- *
- * @return Either the default referenced column name defined by the join
- * column or <code>null</code>
- */
- public String getDefaultReferencedColumnName() {
- if (this.joinColumn == null) {
- return null;
- }
-
- return this.joinColumn.getDefaultReferencedColumnName();
- }
-
- /**
- * Returns
- *
- * @return
- */
- public abstract String getDefaultTable();
-
- /**
- * Returns the edited join column or <code>null</code> if this state object
- * is used to create a new one.
- *
- * @return The edited join column or <code>null</code>
- */
- public ReadOnlyBaseJoinColumn getJoinColumn() {
- return this.joinColumn;
- }
-
- /**
- * Returns the name of the join column.
- *
- * @return Either join column's name or <code>null</code> to use the default
- * name
- */
- public String getName() {
- return this.name;
- }
-
- /**
- * Returns the database table if one can be found.
- *
- * @return The database table
- */
- public abstract Table getNameTable();
-
- /**
- * Returns the owner where the join column is located or where a new one can
- * be added.
- *
- * @return The parent of the join column
- */
- public Object getOwner() {
- return owner;
- }
-
- /**
- * Returns the referenced column name of the join column.
- *
- * @return Either join column's referenced column name or <code>null</code>
- * to use the default name
- */
- public String getReferencedColumnName() {
- return this.referencedColumnName;
- }
-
- /**
- * Returns
- *
- * @return
- */
- public abstract Table getReferencedNameTable();
-
- /**
- * Returns
- *
- * @return
- */
- public String getTable() {
- return table;
- }
-
- @Override
- public final Validator getValidator() {
- return this.validator;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- validator = NULL_VALIDATOR;
- }
-
- /**
- * Initializes this state object.
- *
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- protected void initialize(Object o, ReadOnlyBaseJoinColumn jc) {
-
- this.owner = o;
- this.joinColumn = jc;
- this.table = this.getInitialTable();
-
- if (jc != null) {
- this.name = jc.getSpecifiedName();
- this.columnDefinition = jc.getColumnDefinition();
- this.referencedColumnName = jc.getSpecifiedReferencedColumnName();
- }
- }
-
- /**
- * Returns
- */
- protected abstract String getInitialTable();
-
- /**
- * Returns the column names if the database table can be resolved.
- *
- * @return The names of the table's columns or an empty iterator if the table
- * can't be resolved
- */
- public ListIterator<String> names() {
- return columnNames(getNameTable());
- }
-
- public int columnsSize() {
- return columnsSize(getNameTable());
- }
-
- /**
- * Returns the reference column names if the database table can be resolved.
- *
- * @return The names of the table's columns or an empty iterator if the table
- * can't be resolved
- */
- public ListIterator<String> referenceColumnNames() {
- return columnNames(getReferencedNameTable());
- }
-
- public int referenceColumnsSize() {
- return columnsSize(getReferencedNameTable());
- }
-
- /**
- * Sets the SQL fragment that is used when generating the DDL for the column.
- *
- * @param columnDefinition The new join column's column definition or
- * <code>null</code> to clear the value
- */
- public void setColumnDefinition(String columnDefinition) {
- String oldColumnDefinition = this.columnDefinition;
- this.columnDefinition = columnDefinition;
- firePropertyChanged(COLUMN_DEFINITION_PROPERTY, oldColumnDefinition, columnDefinition);
- }
-
- /**
- * Sets the name of the join column.
- *
- * @param name The new join column's name or <code>null</code> to use the
- * default name
- */
- public void setName(String name) {
- String oldName = this.name;
- this.name = name;
- firePropertyChanged(NAME_PROPERTY, oldName, name);
- }
-
- /**
- * Sets the referenced column name of the join column.
- *
- * @param referencedColumnName The new join column's referenced column name
- * or <code>null</code> to use the default referenced column name
- */
- public void setReferencedColumnName(String referencedColumnName) {
- String oldReferencedColumnName = this.referencedColumnName;
- this.referencedColumnName = referencedColumnName;
- firePropertyChanged(REFERENCED_COLUMN_NAME_PROPERTY, oldReferencedColumnName, referencedColumnName);
- }
-
- public void setTable(String table) {
- ArrayList<String> oldNames = CollectionTools.list(this.names());
- ArrayList<String> oldRefColNames = CollectionTools.list(this.referenceColumnNames());
- String oldTable = this.table;
- this.table = table;
- this.firePropertyChanged(TABLE_PROPERTY, oldTable, table);
- this.synchronizeList(this.names(), oldNames, NAMES_LIST);
- this.synchronizeList(this.referenceColumnNames(), oldRefColNames, REFERENCE_COLUMN_NAMES_LIST);
- }
-
- @Override
- public final void setValidator(Validator validator) {
- this.validator = validator;
- }
-
- /**
- * Retrieves the list of all the table names contains in the associated
- * schema. The default returns an empty iterator.
- *
- * @return The names of the tables
- */
- public ListIterator<String> tables() {
- return EmptyListIterator.instance();
- }
-
- /**
- * Updates the given join column with the values contained in this state
- * object.
- *
- * @param joinColumn The join column to update
- */
- public void updateJoinColumn(BaseJoinColumn jc) {
-
- // Name
- if (valuesAreDifferent(name, jc.getSpecifiedName())) {
- jc.setSpecifiedName(name);
- }
-
- // Referenced Column Name
- if (valuesAreDifferent(referencedColumnName, jc.getSpecifiedReferencedColumnName())) {
- jc.setSpecifiedReferencedColumnName(referencedColumnName);
- }
-
- // Column Definition
- if (valuesAreDifferent(columnDefinition, jc.getColumnDefinition())) {
- jc.setColumnDefinition(columnDefinition);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BasicMappingComposite.java
deleted file mode 100644
index 0070d5a8ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/BasicMappingComposite.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EnumTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | LobComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see ColumnComposite
- * @see EnumTypeComposite
- * @see FetchTypeComposite
- * @see LobComposite
- * @see OptionalComposite
- * @see TemporalTypeComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class BasicMappingComposite extends AbstractBasicMappingComposite<BasicMapping>
-{
- /**
- * Creates a new <code>BasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IBasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public BasicMappingComposite(PropertyValueModel<? extends BasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/CascadeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/CascadeComposite.java
deleted file mode 100644
index 41cbb44d5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/CascadeComposite.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Cascade --------------------------------------------------------------- |
- * | | | |
- * | | x All x Persist x Merge x Remove x Refresh | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Cascade
- * @see RelationshipMapping
- * @see ManyToManyMappingComposite - A container of this pane
- * @see ManyToOneMappingComposite - A container of this pane
- * @see OneToManyMappingComposite - A container of this pane
- * @see OneToOneMappingComposite - A container of this pane
- *
- * @version 2.0
- * @since 1.0
- */
-public class CascadeComposite<T extends Cascade> extends Pane<T>
-{
- /**
- * Creates a new <code>CascadeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject <code>ICascade</code>
- * @param parent The parent container
- */
- public CascadeComposite(
- Pane<? extends RelationshipMapping> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- /**
- * Creates a new <code>ColumnComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ICascade</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public CascadeComposite(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- // Cascade group
- Group cascadeGroup = addCascadeGroup(container);
-
- // Container of the check boxes
- container = addSubPane(cascadeGroup, 5, 8, 0, 0, 0);
-
- addAllCheckBox(container);
- addPersistCheckBox(container);
- addMergeCheckBox(container);
- addRemoveCheckBox(container);
- addRefreshCheckBox(container);
- }
-
- protected void addAllCheckBox(Composite container) {
- // All check box
- addCheckBox(
- container,
- JptUiDetailsMessages.CascadeComposite_all,
- buildCascadeTypeAllHolder(),
- null);
- }
-
- protected void addPersistCheckBox(Composite container) {
- // Persist check box
- addCheckBox(
- container,
- JptUiDetailsMessages.CascadeComposite_persist,
- buildCascadeTypePersistHolder(),
- null);
- }
-
- protected void addMergeCheckBox(Composite container) {
- // Merge check box
- addCheckBox(
- container,
- JptUiDetailsMessages.CascadeComposite_merge,
- buildCascadeTypeMergeHolder(),
- null);
- }
-
- protected void addRemoveCheckBox(Composite container) {
- // Remove check box
- addCheckBox(
- container,
- JptUiDetailsMessages.CascadeComposite_remove,
- buildCascadeTypeRemoveHolder(),
- null);
- }
-
- protected void addRefreshCheckBox(Composite container) {
- // Refresh check box
- addCheckBox(
- container,
- JptUiDetailsMessages.CascadeComposite_refresh,
- buildCascadeTypeRefreshHolder(),
- null);
- }
-
- protected Group addCascadeGroup(Composite container) {
- return addTitledGroup(
- container,
- JptUiDetailsMessages.CascadeComposite_cascadeTitle);
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildCascadeTypeAllHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.ALL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isAll();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setAll(value);
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildCascadeTypeMergeHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.MERGE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isMerge();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setMerge(value);
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildCascadeTypePersistHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.PERSIST_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isPersist();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setPersist(value);
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildCascadeTypeRefreshHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.REFRESH_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isRefresh();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setRefresh(value);
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildCascadeTypeRemoveHolder() {
- return new PropertyAspectAdapter<Cascade, Boolean>(getSubjectHolder(), Cascade.REMOVE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isRemove();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setRemove(value);
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ColumnComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ColumnComposite.java
deleted file mode 100644
index ce7b3a5eee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ColumnComposite.java
+++ /dev/null
@@ -1,554 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.db.ColumnCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.DatabaseObjectCombo;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-public class ColumnComposite
- extends Pane<ReadOnlyColumn>
-{
- public ColumnComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyColumn> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
-
- private ColumnCombo<ReadOnlyColumn> addColumnCombo(Composite container) {
-
- return new ColumnCombo<ReadOnlyColumn>(this, container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyNamedColumn.DEFAULT_NAME_PROPERTY);
- propertyNames.add(ReadOnlyNamedColumn.SPECIFIED_NAME_PROPERTY);
- propertyNames.add(ReadOnlyBaseColumn.DEFAULT_TABLE_PROPERTY);
- propertyNames.add(ReadOnlyBaseColumn.SPECIFIED_TABLE_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- if (propertyName == ReadOnlyBaseColumn.DEFAULT_TABLE_PROPERTY ||
- propertyName == ReadOnlyBaseColumn.SPECIFIED_TABLE_PROPERTY) {
- this.doPopulate();
- } else {
- super.propertyChanged(propertyName);
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- ((Column) this.getSubject()).setSpecifiedName(value);
- }
-
- @Override
- protected Table getDbTable_() {
- ReadOnlyColumn column = this.getSubject();
- return (column == null) ? null : column.getDbTable();
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedName();
- }
-
- @Override
- protected String buildNullDefaultValueEntry() {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- JptCommonUiMessages.NoneSelected);
- }
-
- @Override
- public String toString() {
- return "ColumnComposite.columnCombo"; //$NON-NLS-1$
- }
- };
- }
-
- ModifiablePropertyValueModel<String> buildColumnDefinitionHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, String>(getSubjectHolder(), ReadOnlyNamedColumn.COLUMN_DEFINITION_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getColumnDefinition();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- ((Column) this.subject).setColumnDefinition(value);
- }
- };
- }
-
- ModifiablePropertyValueModel<Boolean> buildInsertableHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Boolean>(getSubjectHolder(), ReadOnlyBaseColumn.SPECIFIED_INSERTABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedInsertable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- ((Column) this.subject).setSpecifiedInsertable(value);
- }
- };
- }
-
- PropertyValueModel<String> buildInsertableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultInsertableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.ColumnComposite_insertableWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.ColumnComposite_insertable;
- }
- };
- }
-
- PropertyValueModel<Boolean> buildDefaultInsertableHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Boolean>(
- getSubjectHolder(),
- ReadOnlyBaseColumn.SPECIFIED_INSERTABLE_PROPERTY,
- ReadOnlyBaseColumn.DEFAULT_INSERTABLE_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedInsertable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultInsertable());
- }
- };
- }
-
- ModifiablePropertyValueModel<Boolean> buildNullableHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Boolean>(
- getSubjectHolder(),
- ReadOnlyBaseColumn.SPECIFIED_NULLABLE_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedNullable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- ((Column) this.subject).setSpecifiedNullable(value);
- }
- };
- }
-
- PropertyValueModel<String> buildNullableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultNullableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.ColumnComposite_nullableWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.ColumnComposite_nullable;
- }
- };
- }
-
- PropertyValueModel<Boolean> buildDefaultNullableHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Boolean>(
- getSubjectHolder(),
- ReadOnlyBaseColumn.SPECIFIED_NULLABLE_PROPERTY,
- ReadOnlyBaseColumn.DEFAULT_NULLABLE_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedNullable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultNullable());
- }
- };
- }
-
- private Pane<ReadOnlyColumn> addTableCombo(Composite container) {
-
- return new DatabaseObjectCombo<ReadOnlyColumn>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyBaseColumn.DEFAULT_TABLE_PROPERTY);
- propertyNames.add(ReadOnlyBaseColumn.SPECIFIED_TABLE_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return this.getSubject().getDefaultTable();
- }
-
- @Override
- protected void setValue(String value) {
- ((Column) this.getSubject()).setSpecifiedTable(value);
- }
-
- @Override
- protected String getValue() {
- return this.getSubject().getSpecifiedTable();
- }
-
- // TODO we need to listen for this list to change...
- @Override
- protected Iterable<String> getValues_() {
- ReadOnlyColumn column = this.getSubject();
- return (column != null) ? column.getCandidateTableNames() : EmptyIterable.<String> instance();
- }
-
- @Override
- protected String buildNullDefaultValueEntry() {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- JptCommonUiMessages.NoneSelected);
- }
-
- @Override
- public String toString() {
- return "ColumnComposite.tableCombo"; //$NON-NLS-1$
- }
- };
- }
-
- ModifiablePropertyValueModel<Boolean> buildUniqueHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Boolean>(
- getSubjectHolder(),
- ReadOnlyBaseColumn.SPECIFIED_UNIQUE_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedUnique();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- ((Column) this.subject).setSpecifiedUnique(value);
- }
- };
- }
-
- PropertyValueModel<String> buildUniqueStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultUniqueHolder()) {
-
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.ColumnComposite_uniqueWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.ColumnComposite_unique;
- }
- };
- }
-
- PropertyValueModel<Boolean> buildDefaultUniqueHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Boolean>(
- getSubjectHolder(),
- ReadOnlyBaseColumn.SPECIFIED_UNIQUE_PROPERTY,
- ReadOnlyBaseColumn.DEFAULT_UNIQUE_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedUnique() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultUnique());
- }
- };
- }
-
- ModifiablePropertyValueModel<Boolean> buildUpdatableHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Boolean>(
- getSubjectHolder(),
- ReadOnlyBaseColumn.DEFAULT_UPDATABLE_PROPERTY,
- ReadOnlyBaseColumn.SPECIFIED_UPDATABLE_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedUpdatable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- ((Column) this.subject).setSpecifiedUpdatable(value);
- }
- };
- }
-
- PropertyValueModel<String> buildUpdatableStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultUpdatableHolder()) {
-
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.ColumnComposite_updatableWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.ColumnComposite_updatable;
- }
- };
- }
-
- PropertyValueModel<Boolean> buildDefaultUpdatableHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Boolean>(
- getSubjectHolder(),
- ReadOnlyBaseColumn.SPECIFIED_UPDATABLE_PROPERTY,
- ReadOnlyBaseColumn.DEFAULT_UPDATABLE_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedUpdatable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultUpdatable());
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Column group pane
- container = addTitledGroup(
- container,
- JptUiDetailsMessages.ColumnComposite_columnSection);
-
- // Column widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.ColumnComposite_name,
- addColumnCombo(container),
- JpaHelpContextIds.MAPPING_COLUMN);
-
- // Table widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.ColumnComposite_table,
- addTableCombo(container),
- JpaHelpContextIds.MAPPING_COLUMN_TABLE);
-
- // Details sub-pane
- container = addCollapsibleSubSection(
- container,
- JptUiDetailsMessages.ColumnComposite_details,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE));
-
- new DetailsComposite(this, getSubjectHolder(), addSubPane(container, 0, 16));
- }
-
- protected class DetailsComposite extends Pane<ReadOnlyColumn> {
-
- public DetailsComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyColumn> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Insertable tri-state check box
- addTriStateCheckBoxWithDefault(
- addSubPane(container, 4),
- JptUiDetailsMessages.ColumnComposite_insertable,
- buildInsertableHolder(),
- buildInsertableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_INSERTABLE);
-
- // Updatable tri-state check box
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages.ColumnComposite_updatable,
- buildUpdatableHolder(),
- buildUpdatableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_UPDATABLE);
-
- // Unique tri-state check box
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages.ColumnComposite_unique,
- buildUniqueHolder(),
- buildUniqueStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_UNIQUE);
-
- // Nullable tri-state check box
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages.ColumnComposite_nullable,
- buildNullableHolder(),
- buildNullableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_NULLABLE);
-
- addLengthCombo(container);
- addPrecisionCombo(container);
- addScaleCombo(container);
-
- // Column Definition widgets
- addLabeledText(
- container,
- JptUiDetailsMessages.ColumnComposite_columnDefinition,
- buildColumnDefinitionHolder());
- }
-
- private void addLengthCombo(Composite container) {
- new IntegerCombo<ReadOnlyColumn>(this, container) {
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.ColumnComposite_length;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.MAPPING_COLUMN_LENGTH;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Integer>(getSubjectHolder(), ReadOnlyColumn.DEFAULT_LENGTH_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultLength());
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Integer>(getSubjectHolder(), ReadOnlyColumn.SPECIFIED_LENGTH_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedLength();
- }
-
- @Override
- protected void setValue_(Integer value) {
- ((Column) this.subject).setSpecifiedLength(value);
- }
- };
- }
- };
- }
-
- private void addPrecisionCombo(Composite container) {
- new IntegerCombo<ReadOnlyColumn>(this, container) {
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.ColumnComposite_precision;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.MAPPING_COLUMN_PRECISION;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Integer>(getSubjectHolder(), ReadOnlyColumn.DEFAULT_PRECISION_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultPrecision());
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Integer>(getSubjectHolder(), ReadOnlyColumn.SPECIFIED_PRECISION_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedPrecision();
- }
-
- @Override
- protected void setValue_(Integer value) {
- ((Column) this.subject).setSpecifiedPrecision(value);
- }
- };
- }
- };
- }
-
- private void addScaleCombo(Composite container) {
- new IntegerCombo<ReadOnlyColumn>(this, container) {
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.ColumnComposite_scale;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.MAPPING_COLUMN_SCALE;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Integer>(getSubjectHolder(), ReadOnlyColumn.DEFAULT_SCALE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultScale());
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<ReadOnlyColumn, Integer>(getSubjectHolder(), ReadOnlyColumn.SPECIFIED_SCALE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedScale();
- }
-
- @Override
- protected void setValue_(Integer value) {
- ((Column) this.subject).setSpecifiedScale(value);
- }
- };
- }
- };
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/DiscriminatorColumnComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/DiscriminatorColumnComposite.java
deleted file mode 100644
index d9fbcec63d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/DiscriminatorColumnComposite.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.NamedColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.db.ColumnCombo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | > Discriminator Column |
- * | |
- * | ---------------------------------------------------- |
- * | Name: | ColumnCombo |v| |
- * | ---------------------------------------------------- |
- * | ---------------------------------------------------- |
- * | Type: | EnumComboViewer |v| |
- * | ---------------------------------------------------- |
- * | > Details |
- * | |
- * | ---------------------------------------------------- |
- * | Column Definition: | I | |
- * | ---------------------------------------------------- |
- * | ------------- |
- * | Length: | I |I| |
- * | ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see AbstractEntityComposite - The parent container
- * @see ColumnCombo
- * @see EnumComboViewer
- * @see PrimaryKeyJoinColumnsComposite
- *
- * @version 2.0
- * @since 2.0
- */
-public class DiscriminatorColumnComposite<T extends Entity> extends Pane<T> {
-
- /**
- * Creates a new <code>InheritanceComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public DiscriminatorColumnComposite(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Discriminator Column sub-pane
- Composite discriminatorColumnContainer = addTitledGroup(
- addSubPane(container, 10),
- JptUiDetailsMessages.InheritanceComposite_discriminatorColumnGroupBox
- );
-
- PropertyValueModel<DiscriminatorColumn> discriminatorColumnHolder =
- buildDiscriminatorColumnHolder();
-
- // Name widgets
- addLabeledComposite(
- discriminatorColumnContainer,
- JptUiDetailsMessages.DiscriminatorColumnComposite_name,
- addDiscriminatorColumnCombo(container, discriminatorColumnHolder),
- JpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_COLUMN
- );
-
- // Discriminator Type widgets
- addLabeledComposite(
- discriminatorColumnContainer,
- JptUiDetailsMessages.DiscriminatorColumnComposite_discriminatorType,
- addDiscriminatorTypeCombo(container, discriminatorColumnHolder),
- JpaHelpContextIds.ENTITY_INHERITANCE_DISCRIMINATOR_TYPE
- );
-
- container = addCollapsibleSubSection(
- discriminatorColumnContainer,
- JptUiDetailsMessages.InheritanceComposite_detailsGroupBox,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
-
- new DetailsComposite(this, discriminatorColumnHolder, addSubPane(container, 0, 16));
-
- new PaneEnabler(buildDiscriminatorColumnEnabledHolder(), this);
- }
-
- private ColumnCombo<DiscriminatorColumn> addDiscriminatorColumnCombo(
- Composite container,
- PropertyValueModel<DiscriminatorColumn> discriminatorColumnHolder) {
-
- return new ColumnCombo<DiscriminatorColumn>(
- this,
- discriminatorColumnHolder,
- container)
- {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyNamedColumn.SPECIFIED_NAME_PROPERTY);
- propertyNames.add(ReadOnlyNamedColumn.DEFAULT_NAME_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- getSubject().setSpecifiedName(value);
- }
-
- @Override
- protected Table getDbTable_() {
- return getSubject().getDbTable();
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedName();
- }
-
- @Override
- protected String buildNullDefaultValueEntry() {
- return JptCommonUiMessages.NoneSelected;
- }
- };
- }
-
- private PropertyValueModel<DiscriminatorColumn> buildDiscriminatorColumnHolder() {
- return new PropertyAspectAdapter<Entity, DiscriminatorColumn>(getSubjectHolder()) {
- @Override
- protected DiscriminatorColumn buildValue_() {
- return this.subject.getDiscriminatorColumn();
- }
- };
- }
-
- private EnumFormComboViewer<DiscriminatorColumn, DiscriminatorType> addDiscriminatorTypeCombo(
- Composite container,
- PropertyValueModel<DiscriminatorColumn> discriminatorColumnHolder) {
-
- return new EnumFormComboViewer<DiscriminatorColumn, DiscriminatorType>(
- this,
- discriminatorColumnHolder,
- container)
- {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE_PROPERTY);
- propertyNames.add(DiscriminatorColumn.SPECIFIED_DISCRIMINATOR_TYPE_PROPERTY);
- }
-
- @Override
- protected DiscriminatorType[] getChoices() {
- return DiscriminatorType.values();
- }
-
- @Override
- protected DiscriminatorType getDefaultValue() {
- return getSubject().getDefaultDiscriminatorType();
- }
-
- @Override
- protected String displayString(DiscriminatorType value) {
- switch (value) {
- case CHAR :
- return JptUiDetailsMessages.DiscriminatorColumnComposite_char;
- case INTEGER :
- return JptUiDetailsMessages.DiscriminatorColumnComposite_integer;
- case STRING :
- return JptUiDetailsMessages.DiscriminatorColumnComposite_string;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected String nullDisplayString() {
- return JptCommonUiMessages.NoneSelected;
- }
-
- @Override
- protected DiscriminatorType getValue() {
- return getSubject().getSpecifiedDiscriminatorType();
- }
-
- @Override
- protected void setValue(DiscriminatorType value) {
- getSubject().setSpecifiedDiscriminatorType(value);
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildDiscriminatorColumnEnabledHolder() {
- return new PropertyAspectAdapter<Entity, Boolean>(getSubjectHolder(), Entity.SPECIFIED_DISCRIMINATOR_COLUMN_IS_ALLOWED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.specifiedDiscriminatorColumnIsAllowed());
- }
- };
- }
-
- protected class DetailsComposite extends Pane<DiscriminatorColumn> {
- public DetailsComposite(Pane<?> parentPane,
- PropertyValueModel<? extends DiscriminatorColumn> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Length widgets
- addLengthCombo(container);
-
- // Column Definition widgets
- addLabeledText(
- container,
- JptUiDetailsMessages.ColumnComposite_columnDefinition,
- buildColumnDefinitionHolder(getSubjectHolder())
- );
- }
-
- private void addLengthCombo(Composite container) {
- new IntegerCombo<DiscriminatorColumn>(this, container) {
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.ColumnComposite_length;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.MAPPING_COLUMN_LENGTH;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<DiscriminatorColumn, Integer>(getSubjectHolder(), DiscriminatorColumn.DEFAULT_LENGTH_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultLength());
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<DiscriminatorColumn, Integer>(getSubjectHolder(), DiscriminatorColumn.SPECIFIED_LENGTH_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedLength();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setSpecifiedLength(value);
- }
- };
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildColumnDefinitionHolder(PropertyValueModel<DiscriminatorColumn> discriminatorColumnHolder) {
-
- return new PropertyAspectAdapter<DiscriminatorColumn, String>(discriminatorColumnHolder, NamedColumn.COLUMN_DEFINITION_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getColumnDefinition();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setColumnDefinition(value);
- }
- };
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingComposite.java
deleted file mode 100644
index 6a118d24ba..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedIdMappingComposite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.swt.widgets.Composite;
-
-public class EmbeddedIdMappingComposite
- extends AbstractEmbeddedIdMappingComposite<EmbeddedIdMapping>
-{
- public EmbeddedIdMappingComposite(
- PropertyValueModel<? extends EmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeEmbeddedIdSection(Composite container) {
- new EmbeddedMappingOverridesComposite(
- this,
- container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedMappingComposite.java
deleted file mode 100644
index 8b6b16e292..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedMappingComposite.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EmbeddedAttributeOverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- *
- * @version 2.3
- * @since 1.0
- */
-public class EmbeddedMappingComposite extends AbstractEmbeddedMappingComposite<EmbeddedMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddedMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>EmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EmbeddedMappingComposite(PropertyValueModel<? extends EmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedMappingOverridesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedMappingOverridesComposite.java
deleted file mode 100644
index 8b0ec1b4fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EmbeddedMappingOverridesComposite.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BaseEmbeddedMapping;
-import org.eclipse.swt.widgets.Composite;
-
-public class EmbeddedMappingOverridesComposite
- extends AbstractEmbeddedMappingOverridesComposite<BaseEmbeddedMapping>
-{
- public EmbeddedMappingOverridesComposite(
- Pane<? extends BaseEmbeddedMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected boolean supportsAssociationOverrides() {
- return false;
- }
-
- @Override
- protected PropertyValueModel<AttributeOverrideContainer> buildAttributeOverrideContainerHolder() {
- return new PropertyAspectAdapter<BaseEmbeddedMapping, AttributeOverrideContainer>(getSubjectHolder()) {
- @Override
- protected AttributeOverrideContainer buildValue_() {
- return this.subject.getAttributeOverrideContainer();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<AssociationOverrideContainer> buildAssociationOverrideContainerHolder() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EntityNameComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EntityNameComposite.java
deleted file mode 100644
index cc3cfff9e7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EntityNameComposite.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0, which accompanies this distribution and is available at
- * http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------ |
- * | Entity Name: | I |v| |
- * | ------------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see AbstractEntityComposite - The parent container
- *
- * @version 2.3
- * @since 1.0
- */
-public class EntityNameComposite
- extends Pane<Entity>
-{
- /**
- * Creates a new <code>EntityNameComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EntityNameComposite(
- Pane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Combo combo = addLabeledEditableCombo(
- container,
- JptUiDetailsMessages.EntityNameComposite_name,
- buildDefaultEntityNameListHolder(),
- buildEntityNameHolder(),
- JpaHelpContextIds.ENTITY_NAME);
-
- SWTUtil.attachDefaultValueHandler(combo);
- }
-
- private ListValueModel<String> buildDefaultEntityNameListHolder() {
- return new PropertyListValueModelAdapter<String>(
- buildDefaultEntityNameHolder()
- );
- }
-
- private PropertyValueModel<String> buildDefaultEntityNameHolder() {
- return new PropertyAspectAdapter<Entity, String>(getSubjectHolder(), Entity.DEFAULT_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return defaultValue(this.subject);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildEntityNameHolder() {
- return new PropertyAspectAdapter<Entity, String>(getSubjectHolder(), Entity.SPECIFIED_NAME_PROPERTY, Entity.DEFAULT_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = this.subject.getSpecifiedName();
-
- if (name == null) {
- name = defaultValue(this.subject);
- }
-
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (defaultValue(this.subject).equals(value)) {
- value = null;
- }
-
- this.subject.setSpecifiedName(value);
- }
- };
- }
-
- private String defaultValue(Entity subject) {
- String defaultValue = subject.getDefaultName();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EntityOverridesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EntityOverridesComposite.java
deleted file mode 100644
index 4087cd2f4d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EntityOverridesComposite.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.swt.widgets.Composite;
-
-public class EntityOverridesComposite
- extends AbstractEntityOverridesComposite
-{
- public EntityOverridesComposite(
- Pane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EnumTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EnumTypeComposite.java
deleted file mode 100644
index cd10382ada..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/EnumTypeComposite.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Enum Type: | |v| |
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see BasicMappingComposite - A container of this widget
- *
- * @version 2.0
- * @since 1.0
- */
-public class EnumTypeComposite extends Pane<BaseEnumeratedConverter>
-{
- /**
- * Creates a new <code>EnumTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EnumTypeComposite(PropertyValueModel<? extends BaseEnumeratedConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private EnumFormComboViewer<BaseEnumeratedConverter, EnumType> addEnumTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<BaseEnumeratedConverter, EnumType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(BaseEnumeratedConverter.SPECIFIED_ENUM_TYPE_PROPERTY);
- }
-
- @Override
- protected EnumType[] getChoices() {
- return EnumType.values();
- }
-
- @Override
- protected EnumType getDefaultValue() {
- return getSubject().getDefaultEnumType();
- }
-
- @Override
- protected String displayString(EnumType value) {
- switch (value) {
- case ORDINAL :
- return JptUiDetailsMessages.EnumTypeComposite_ordinal;
- case STRING :
- return JptUiDetailsMessages.EnumTypeComposite_string;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected EnumType getValue() {
- return getSubject().getSpecifiedEnumType();
- }
-
- @Override
- protected void setValue(EnumType value) {
- getSubject().setSpecifiedEnumType(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- //JpaHelpContextIds.MAPPING_ENUMERATED
- addEnumTypeCombo(container);
-
- new PaneEnabler(buildBooleanHolder(), this);
- }
-
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<BaseEnumeratedConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(BaseEnumeratedConverter value) {
- if (getSubject() != null && getSubject().getParent().getPersistentAttribute().isVirtual()) {
- return Boolean.FALSE;
- }
- return Boolean.valueOf(value != null);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/FetchTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/FetchTypeComposite.java
deleted file mode 100644
index 3428e5a4ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/FetchTypeComposite.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.FetchableMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------ |
- * | Fetch: | |v| |
- * | ------------------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see FetchableMapping
- * @see BasicMappingComposite - A container of this widget
- * @see ManyToManyMappingComposite - A container of this widget
- * @see ManyToOneMappingComposite - A container of this widget
- * @see OneToManyMappingComposite - A container of this widget
- * @see OneToOneMappingComposite - A container of this widget
- *
- * @version 2.0
- * @since 1.0
- */
-public class FetchTypeComposite extends Pane<FetchableMapping> {
-
- /**
- * Creates a new <code>FetchTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public FetchTypeComposite(Pane<? extends FetchableMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private EnumFormComboViewer<FetchableMapping, FetchType> addFetchTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<FetchableMapping, FetchType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(FetchableMapping.DEFAULT_FETCH_PROPERTY);
- propertyNames.add(FetchableMapping.SPECIFIED_FETCH_PROPERTY);
- }
-
- @Override
- protected FetchType[] getChoices() {
- return FetchType.values();
- }
-
- @Override
- protected FetchType getDefaultValue() {
- return getSubject().getDefaultFetch();
- }
-
- @Override
- protected String displayString(FetchType value) {
- switch (value) {
- case EAGER :
- return JptUiDetailsMessages.FetchTypeComposite_eager;
- case LAZY :
- return JptUiDetailsMessages.FetchTypeComposite_lazy;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected FetchType getValue() {
- return getSubject().getSpecifiedFetch();
- }
-
- @Override
- protected void setValue(FetchType value) {
- getSubject().setSpecifiedFetch(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledComposite(
- container,
- JptUiDetailsMessages.BasicGeneralSection_fetchLabel,
- addFetchTypeCombo(container),
- JpaHelpContextIds.MAPPING_FETCH_TYPE
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GeneratedValueComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GeneratedValueComposite.java
deleted file mode 100644
index 499e8cda22..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GeneratedValueComposite.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.NonEmptyStringFilter;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.FilteringCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SetCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationListValueModel;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.GeneratedValue;
-import org.eclipse.jpt.jpa.core.context.GenerationType;
-import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | --------------------------------------------------------- |
- * | Strategy: | I |v| |
- * | --------------------------------------------------------- |
- * | --------------------------------------------------------- |
- * | Generator Name: | I |v| |
- * | --------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see IdMapping
- * @see GeneratedValue
- * @see IdMappingGenerationComposite - The parent container
- *
- * @version 2.3
- * @since 1.0
- */
-public class GeneratedValueComposite extends Pane<IdMapping>
-{
-
- /**
- * Creates a new <code>GeneratedValueComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public GeneratedValueComposite(Pane<? extends IdMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Strategy widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.GeneratedValueComposite_strategy,
- addStrategyComboViewer(container),
- JpaHelpContextIds.MAPPING_GENERATED_VALUE_STRATEGY
- );
-
- addLabeledEditableCombo(
- container,
- JptUiDetailsMessages.GeneratedValueComposite_generatorName,
- buildSortedGeneraterNamesModel(),
- buildGeneratorNameHolder(),
- JpaHelpContextIds.MAPPING_GENERATED_VALUE_GENERATOR_NAME
- );
- }
-
- private EnumFormComboViewer<GeneratedValue, GenerationType> addStrategyComboViewer(Composite parent) {
-
- return new EnumFormComboViewer<GeneratedValue, GenerationType>(this, buildGeneratedValueHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(GeneratedValue.DEFAULT_STRATEGY_PROPERTY);
- propertyNames.add(GeneratedValue.SPECIFIED_STRATEGY_PROPERTY);
- }
-
- @Override
- protected GenerationType[] getChoices() {
- return GenerationType.values();
- }
-
- @Override
- protected GenerationType getDefaultValue() {
- return getSubject().getDefaultStrategy();
- }
-
- @Override
- protected String displayString(GenerationType value) {
- switch (value) {
- case AUTO :
- return JptUiDetailsMessages.GeneratedValueComposite_auto;
- case IDENTITY :
- return JptUiDetailsMessages.GeneratedValueComposite_identity;
- case SEQUENCE :
- return JptUiDetailsMessages.GeneratedValueComposite_sequence;
- case TABLE :
- return JptUiDetailsMessages.GeneratedValueComposite_table;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected GenerationType getValue() {
- return getSubject().getSpecifiedStrategy();
- }
-
- @Override
- protected void setValue(GenerationType value) {
- getGeneratedValueForUpdate().setSpecifiedStrategy(value);
- }
- };
- }
-
- private PropertyValueModel<GeneratedValue> buildGeneratedValueHolder() {
- return new PropertyAspectAdapter<IdMapping, GeneratedValue>(getSubjectHolder(), IdMapping.GENERATED_VALUE_PROPERTY) {
- @Override
- protected GeneratedValue buildValue_() {
- return getSubject().getGeneratedValue();
- }
- };
- }
-
- protected final ModifiablePropertyValueModel<String> buildGeneratorNameHolder() {
- return new PropertyAspectAdapter<GeneratedValue, String>(buildGeneratedValueHolder(), GeneratedValue.SPECIFIED_GENERATOR_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getSpecifiedGenerator();
- }
-
- @Override
- public void setValue(String value) {
- if (this.subject != null) {
- setValue_(value);
- return;
- }
- if (value.length() == 0) {
- return;
- }
- getGeneratedValueForUpdate().setSpecifiedGenerator(value);
- }
-
- @Override
- protected void setValue_(String value) {
- if (value !=null && value.length() == 0) {
- value = null;
- }
- this.subject.setSpecifiedGenerator(value);
- }
- };
- }
-
- protected ListValueModel<String> buildSortedGeneraterNamesModel() {
- return new SortedListValueModelAdapter<String>(this.buildUniqueGeneratorNamesModel());
- }
-
- protected CollectionValueModel<String> buildUniqueGeneratorNamesModel() {
- return new SetCollectionValueModel<String>(this.buildGeneratorNamesModel());
- }
-
- protected CollectionValueModel<String> buildGeneratorNamesModel() {
- return new FilteringCollectionValueModel<String>(this.buildGeneratorNamesModel_(), NonEmptyStringFilter.instance());
- }
-
- protected ListValueModel<String> buildGeneratorNamesModel_() {
- return new TransformationListValueModel<Generator, String>(this.buildGeneratorsModel()) {
- @Override
- protected String transformItem_(Generator generator) {
- return generator.getName();
- }
- };
- }
-
- protected ListValueModel<Generator> buildGeneratorsModel() {
- return new ItemPropertyListValueModelAdapter<Generator>(this.buildGeneratorsModel_(), JpaNamedContextNode.NAME_PROPERTY);
- }
-
- protected CollectionValueModel<Generator> buildGeneratorsModel_() {
- return new CollectionAspectAdapter<PersistenceUnit, Generator>(this.buildPersistenceUnitModel(), PersistenceUnit.GENERATORS_COLLECTION) {
- @Override
- protected Iterable<Generator> getIterable() {
- return this.subject.getGenerators();
- }
- @Override
- protected int size_() {
- return this.subject.getGeneratorsSize();
- }
- };
- }
-
- protected PropertyValueModel<PersistenceUnit> buildPersistenceUnitModel() {
- return new PropertyAspectAdapter<IdMapping, PersistenceUnit>(getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
- }
-
- /* CU private */ GeneratedValue getGeneratedValueForUpdate() {
- GeneratedValue generatedValue = getSubject().getGeneratedValue();
-
- if (generatedValue == null) {
- generatedValue = getSubject().addGeneratedValue();
- }
- return generatedValue;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GenerationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GenerationComposite.java
deleted file mode 100644
index eff424d0fa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GenerationComposite.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite.GeneratorBuilder;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | v Table Generator |
- * | |
- * | x Table Generator |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | TableGeneratorComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * | |
- * | v Sequence Generator |
- * | |
- * | x Sequence Generator |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | SequenceGeneratorComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see GeneratorContainer
- * @see TableGeneratorComposite
- * @see SequenceGeneratorComposite
- * @see AbstractEntityComposite - The parent container
- *
- * @version 2.2
- * @since 2.0
- */
-public class GenerationComposite extends Pane<GeneratorContainer>
-{
-
- //These are built to stand alone because we do not want the panels to collapse just
- //because the generator is removed either in the source or using the check box in the UI.
- //We don't want these to be built on the model generator properties.
- private ModifiablePropertyValueModel<Boolean> sequenceGeneratorExpansionStateHolder;
- private ModifiablePropertyValueModel<Boolean> tableGeneratorExpansionStateHolder;
-
-
- public GenerationComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends GeneratorContainer> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.sequenceGeneratorExpansionStateHolder = new SimplePropertyValueModel<Boolean>(Boolean.FALSE);
- this.tableGeneratorExpansionStateHolder = new SimplePropertyValueModel<Boolean>(Boolean.FALSE);
- }
-
- @Override
- protected void doPopulate() {
- super.doPopulate();
- this.sequenceGeneratorExpansionStateHolder.setValue(Boolean.valueOf(getSubject() != null && getSubject().getSequenceGenerator() != null));
- this.tableGeneratorExpansionStateHolder .setValue(Boolean.valueOf(getSubject() != null && getSubject().getTableGenerator() != null));
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.initializeTableGeneratorPane(container);
- this.initializeSequenceGeneratorPane(container);
- }
-
- private void initializeSequenceGeneratorPane(Composite container) {
-
- // Sequence Generator sub-section
- container = this.addCollapsibleSubSection(
- this.addSubPane(container, 10),
- JptUiDetailsMessages.GeneratorsComposite_sequenceGeneratorSection,
- this.sequenceGeneratorExpansionStateHolder
- );
-
- // Sequence Generator check box
- Button sequenceGeneratorCheckBox = addCheckBox(
- this.addSubPane(container, 5),
- JptUiDetailsMessages.GeneratorsComposite_sequenceGeneratorCheckBox,
- this.buildSequenceGeneratorBooleanHolder(),
- JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR
- );
-
- // Sequence Generator pane
- this.addSequenceGeneratorComposite(container, 0, sequenceGeneratorCheckBox.getBorderWidth() + 16);
- }
-
- protected void addSequenceGeneratorComposite(Composite container, int topMargin, int leftMargin) {
- new SequenceGeneratorComposite(
- this,
- this.buildSequenceGeneratorHolder(),
- this.addSubPane(container, topMargin, leftMargin),
- this.buildSequenceGeneratorBuilder()
- );
- }
-
- protected PropertyValueModel<SequenceGenerator> buildSequenceGeneratorHolder() {
- return new PropertyAspectAdapter<GeneratorContainer, SequenceGenerator>(getSubjectHolder(), GeneratorContainer.SEQUENCE_GENERATOR_PROPERTY) {
- @Override
- protected SequenceGenerator buildValue_() {
- return this.subject.getSequenceGenerator();
- }
- };
- }
-
- protected GeneratorBuilder<SequenceGenerator> buildSequenceGeneratorBuilder() {
- return new GeneratorBuilder<SequenceGenerator>() {
- public SequenceGenerator addGenerator() {
- return getSubject().addSequenceGenerator();
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildSequenceGeneratorBooleanHolder() {
- return new PropertyAspectAdapter<GeneratorContainer, Boolean>(getSubjectHolder(), GeneratorContainer.SEQUENCE_GENERATOR_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getSequenceGenerator() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
-
- if (value.booleanValue() && (this.subject.getSequenceGenerator() == null)) {
- this.subject.addSequenceGenerator();
- }
- else if (!value.booleanValue() && (this.subject.getSequenceGenerator() != null)) {
- this.subject.removeSequenceGenerator();
- }
- }
- };
- }
-
- private void initializeTableGeneratorPane(Composite container) {
-
- // Table Generator sub-section
- container = addCollapsibleSubSection(
- container,
- JptUiDetailsMessages.GeneratorsComposite_tableGeneratorSection,
- this.tableGeneratorExpansionStateHolder
- );
-
- Button tableGeneratorCheckBox = addCheckBox(
- this.addSubPane(container, 5),
- JptUiDetailsMessages.GeneratorsComposite_tableGeneratorCheckBox,
- this.buildTableGeneratorBooleanHolder(),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR
- );
-
-
- // Table Generator pane
- new TableGeneratorComposite(
- this,
- this.buildTableGeneratorHolder(),
- this.addSubPane(container, 0, tableGeneratorCheckBox.getBorderWidth() + 16),
- this.buildTableGeneratorBuilder()
- );
- }
-
- private PropertyValueModel<TableGenerator> buildTableGeneratorHolder() {
- return new PropertyAspectAdapter<GeneratorContainer, TableGenerator>(getSubjectHolder(), GeneratorContainer.TABLE_GENERATOR_PROPERTY) {
- @Override
- protected TableGenerator buildValue_() {
- return this.subject.getTableGenerator();
- }
- };
- }
-
- private GeneratorBuilder<TableGenerator> buildTableGeneratorBuilder() {
- return new GeneratorBuilder<TableGenerator>() {
- public TableGenerator addGenerator() {
- return getSubject().addTableGenerator();
- }
- };
- }
-
- protected PropertyValueModel<Boolean> buildTableGeneratorExpanstionStateHolder() {
- return new PropertyAspectAdapter<GeneratorContainer, Boolean>(getSubjectHolder(), GeneratorContainer.TABLE_GENERATOR_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getTableGenerator() != null);
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildTableGeneratorBooleanHolder() {
- return new PropertyAspectAdapter<GeneratorContainer, Boolean>(getSubjectHolder(), GeneratorContainer.TABLE_GENERATOR_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getTableGenerator() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
-
- if (value.booleanValue() && (this.subject.getTableGenerator() == null)) {
- this.subject.addTableGenerator();
- }
- else if (!value.booleanValue() && (this.subject.getTableGenerator() != null)) {
- this.subject.removeTableGenerator();
- }
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GeneratorComposite.java
deleted file mode 100644
index e1110134f8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/GeneratorComposite.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This is the generic pane for a generator.
- *
- * @see IdMapping
- * @see Generator
- * @see SequenceGeneratorComposite - A sub-pane
- * @see TalbeGeneratorComposite - A sub-pane
- *
- * @version 2.2
- * @since 1.0
- */
-public abstract class GeneratorComposite<T extends Generator> extends Pane<T>
-{
-
- protected GeneratorBuilder<T> generatorBuilder;
-
- protected GeneratorComposite(Pane<?> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- GeneratorBuilder<T> generatorBuilder) {
-
- super(parentPane, subjectHolder, parent, false);
- this.generatorBuilder = generatorBuilder;
- }
-
- /**
- * Creates a new Generator. This makes it possible for the user
- * to set values on a Generator before the model object has been created.
- * Allows them not to first have to check the check box to enable the panel.
- */
- protected final T buildGenerator() {
- return this.generatorBuilder.addGenerator();
- }
-
- /**
- * Retrieves the <code>Generator</code> and if it is <code>null</code>, then
- * create it.
- *
- * @param subject The subject used to retrieve the generator
- * @return The <code>Generator</code> which should never be <code>null</code>
- */
- protected final T retrieveGenerator() {
- T generator = getSubject();
-
- if (generator == null) {
- generator = this.buildGenerator();
- }
-
- return generator;
- }
-
- protected final ModifiablePropertyValueModel<String> buildGeneratorNameHolder() {
- return new PropertyAspectAdapter<Generator, String>(getSubjectHolder(), Generator.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- public void setValue(String value) {
- if (this.subject != null) {
- setValue_(value);
- return;
- }
- if (value.length() == 0) {
- return;
- }
- retrieveGenerator().setName(value);
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
- protected void addAllocationSizeCombo(Composite container) {
- new IntegerCombo<Generator>(this, getSubjectHolder(), container) {
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.GeneratorComposite_allocationSize;
- }
-
- @Override
- protected String getHelpId() {
- return null;//JpaHelpContextIds.MAPPING_COLUMN_LENGTH;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Generator, Integer>(getSubjectHolder(), Generator.DEFAULT_ALLOCATION_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultAllocationSize());
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Generator, Integer>(getSubjectHolder(), Generator.SPECIFIED_ALLOCATION_SIZE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedAllocationSize();
- }
-
- @Override
- public void setValue(Integer value) {
- retrieveGenerator().setSpecifiedAllocationSize(value);
- }
- };
- }
- };
- }
-
- protected void addInitialValueCombo(Composite container) {
- new IntegerCombo<Generator>(this, getSubjectHolder(), container) {
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.GeneratorComposite_initialValue;
- }
-
- @Override
- protected String getHelpId() {
- return null;//JpaHelpContextIds.MAPPING_COLUMN_LENGTH;
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<Generator, Integer>(getSubjectHolder(), Generator.DEFAULT_INITIAL_VALUE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return Integer.valueOf(this.subject.getDefaultInitialValue());
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<Generator, Integer>(getSubjectHolder(), Generator.SPECIFIED_INITIAL_VALUE_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getSpecifiedInitialValue();
- }
-
- @Override
- public void setValue(Integer value) {
- retrieveGenerator().setSpecifiedInitialValue(value);
- }
- };
- }
- };
- }
-
- /**
- * Retrieves the JPA project.
- *
- * @return The JPA project or <code>null</code> if the subject is <code>null</code>
- */
- protected final JpaProject getJpaProject() {
- return this.getSubject() == null ? null : this.getSubject().getJpaProject();
- }
-
- /**
- * Returns the property name used to listen to the ID mapping when the
- * generator changes.
- *
- * @return The property name associated with the generator
- */
- protected abstract String getPropertyName();
-
-
- public interface GeneratorBuilder<T> {
- /**
- * Add a generator to the model and return it
- */
- T addGenerator();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdClassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdClassComposite.java
deleted file mode 100644
index 5ceecb123b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdClassComposite.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.IdClassReference;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Id class hyperlink label, combo, and browse button
- *
- */
-public class IdClassComposite
- extends Pane<IdClassReference>
-{
- /**
- * Creates a new <code>IdClassComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public IdClassComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends IdClassReference> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- public IdClassComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends IdClassReference> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- new IdClassChooserComboPane(this, container);
- }
-
-
- private class IdClassChooserComboPane
- extends ClassChooserComboPane<IdClassReference>
- {
- public IdClassChooserComboPane(Pane<IdClassReference> parentPane, Composite parent) {
- super(parentPane, parent);
- }
-
-
- @Override
- protected String getClassName() {
- return getSubject().getIdClassName();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setSpecifiedIdClassName(className);
- }
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.IdClassComposite_label;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getIdClassEnclosingTypeSeparator();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedIdClassName();
- }
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<IdClassReference, String>(
- getSubjectHolder(),
- IdClassReference.SPECIFIED_ID_CLASS_NAME_PROPERTY,
- IdClassReference.DEFAULT_ID_CLASS_NAME_PROPERTY) {
-
- @Override
- protected String buildValue_() {
- String value = this.subject.getSpecifiedIdClassName();
- return (value == null) ? defaultText(this.subject) : value;
- }
-
- @Override
- protected void setValue_(String value) {
- if (value == null
- || value.length() == 0
- || value.equals(defaultText(this.subject))) {
- value = null;
- }
- this.subject.setSpecifiedIdClassName(value);
- }
- };
- }
-
- protected String defaultText(IdClassReference idClassReference) {
- String defaultClassName = idClassReference.getDefaultIdClassName();
- return (defaultClassName == null) ?
- JptCommonUiMessages.NoneSelected
- : NLS.bind(JptCommonUiMessages.DefaultWithOneParam, defaultClassName);
- }
-
- @Override
- protected ListValueModel<String> buildClassListHolder() {
- return new PropertyListValueModelAdapter<String>(
- new PropertyAspectAdapter<IdClassReference, String>(
- getSubjectHolder(), IdClassReference.DEFAULT_ID_CLASS_NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return defaultText(this.subject);
- }
- });
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdMappingComposite.java
deleted file mode 100644
index 617adaadf1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdMappingComposite.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.swt.widgets.Composite;
-
-public class IdMappingComposite
- extends AbstractIdMappingComposite<IdMapping>
-{
- public IdMappingComposite(
- PropertyValueModel<? extends IdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdMappingGenerationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdMappingGenerationComposite.java
deleted file mode 100644
index 886c5a5d51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/IdMappingGenerationComposite.java
+++ /dev/null
@@ -1,348 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.GeneratedValue;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite.GeneratorBuilder;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This panel is partially a copy of the GenerationComposite panel. The difference
- * is that this panel includes the Generated Value composite. When a table
- * or sequence generator is added, we set the "name" to be the same as the
- * generated value "generator" if it already exists
- *
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | v Primary Key Generation |
- * | |
- * | x Primary Key Generation |
- * | --------------------------------------------------------------------- |
- * | | | |
- * | | GeneratedValueComposite | |
- * | | | |
- * | --------------------------------------------------------------------- |
- * | |
- * | v Table Generator |
- * | |
- * | x Table Generator |
- * | --------------------------------------------------------------------- |
- * | | | |
- * | | TableGeneratorComposite | |
- * | | | |
- * | --------------------------------------------------------------------- |
- * | |
- * | v Sequence Generator |
- * | |
- * | x Sequence Generator |
- * | --------------------------------------------------------------------- |
- * | | | |
- * | | SequenceGeneratorComposite | |
- * | | | |
- * | --------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see IdMapping
- * @see GeneratedValueComposite
- * @see TableGeneratorComposite
- * @see SequenceGeneratorComposite
- * @see IdMappingComposite - The parent container
- *
- * @version 2.2
- * @since 1.0
- */
-public class IdMappingGenerationComposite extends Pane<IdMapping>
-{
-
- //These are built to stand alone because we do not want the panels to collapse just
- //because the generator is removed either in the source or using the check box in the UI.
- //We don't want these to be built on the model generator properties.
- private ModifiablePropertyValueModel<Boolean> sequenceGeneratorExpansionStateHolder;
- private ModifiablePropertyValueModel<Boolean> tableGeneratorExpansionStateHolder;
-
-
- /**
- * Creates a new <code>GenerationComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public IdMappingGenerationComposite(Pane<? extends IdMapping> parentPane,
- Composite parent)
- {
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.sequenceGeneratorExpansionStateHolder = new SimplePropertyValueModel<Boolean>(Boolean.FALSE);
- this.tableGeneratorExpansionStateHolder = new SimplePropertyValueModel<Boolean>(Boolean.FALSE);
- }
-
- @Override
- protected void doPopulate() {
- super.doPopulate();
- this.sequenceGeneratorExpansionStateHolder.setValue(Boolean.valueOf(getSubject() != null && getSubject().getGeneratorContainer().getSequenceGenerator() != null));
- this.tableGeneratorExpansionStateHolder .setValue(Boolean.valueOf(getSubject() != null && getSubject().getGeneratorContainer().getTableGenerator() != null));
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Primary Key Generation section
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.IdMappingComposite_primaryKeyGenerationSection,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- // Primary Key Generation check box
- Button primaryKeyGenerationCheckBox = addCheckBox(
- container,
- JptUiDetailsMessages.IdMappingComposite_primaryKeyGenerationCheckBox,
- buildPrimaryKeyGenerationHolder(),
- JpaHelpContextIds.MAPPING_PRIMARY_KEY_GENERATION
- );
-
- // Generated Value widgets
- GeneratedValueComposite generatedValueComposite = new GeneratedValueComposite(
- this,
- container
- );
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalIndent = primaryKeyGenerationCheckBox.getBorderWidth() + 16;
-
- generatedValueComposite.getControl().setLayoutData(gridData);
-
- PropertyValueModel<GeneratorContainer> generatorHolder = buildGeneratorContainer();
- // Table Generator pane
- initializeTableGeneratorPane(addSubPane(container, 10), generatorHolder);
-
- // Sequence Generator pane
- initializeSequenceGeneratorPane(addSubPane(container, 10), generatorHolder);
- }
-
- private ModifiablePropertyValueModel<Boolean> buildPrimaryKeyGenerationHolder() {
- return new PropertyAspectAdapter<IdMapping, Boolean>(getSubjectHolder(), IdMapping.GENERATED_VALUE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getGeneratedValue() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
-
- if (value.booleanValue() && (this.subject.getGeneratedValue() == null)) {
- this.subject.addGeneratedValue();
- }
- else if (!value.booleanValue() && (this.subject.getGeneratedValue() != null)) {
- this.subject.removeGeneratedValue();
- }
- }
- };
- }
-
- private PropertyValueModel<GeneratorContainer> buildGeneratorContainer() {
- return new PropertyAspectAdapter<IdMapping, GeneratorContainer>(getSubjectHolder()) {
- @Override
- protected GeneratorContainer buildValue_() {
- return this.subject.getGeneratorContainer();
- }
- };
- }
-
- private void initializeSequenceGeneratorPane(Composite container, PropertyValueModel<GeneratorContainer> generatorHolder) {
-
- // Sequence Generator sub-section
- container = addCollapsibleSubSection(
- container,
- JptUiDetailsMessages.IdMappingComposite_sequenceGeneratorSection,
- this.sequenceGeneratorExpansionStateHolder
- );
-
- // Sequence Generator check box
- Button sequenceGeneratorCheckBox = addCheckBox(
- container,
- JptUiDetailsMessages.IdMappingComposite_sequenceGeneratorCheckBox,
- buildSequenceGeneratorBooleanHolder(generatorHolder),
- JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR
- );
-
- // Sequence Generator pane
- this.buildSequenceGeneratorComposite(
- container,
- buildSequenceGeneratorHolder(generatorHolder),
- buildSequenceGeneratorBuilder(generatorHolder),
- 0,
- sequenceGeneratorCheckBox.getBorderWidth() + 16);
- }
-
- private ModifiablePropertyValueModel<Boolean> buildSequenceGeneratorBooleanHolder(PropertyValueModel<GeneratorContainer> generatorHolder) {
- return new PropertyAspectAdapter<GeneratorContainer, Boolean>(generatorHolder, GeneratorContainer.SEQUENCE_GENERATOR_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getSequenceGenerator() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
-
- if (value.booleanValue() && (this.subject.getSequenceGenerator() == null)) {
-
- SequenceGenerator sequenceGenerator = this.subject.addSequenceGenerator();
- GeneratedValue generatedValue = getSubject().getGeneratedValue();
-
- if ((generatedValue != null) &&
- (generatedValue.getGenerator() != null))
- {
- sequenceGenerator.setName(generatedValue.getGenerator());
- }
- }
- else if (!value.booleanValue() && (this.subject.getSequenceGenerator() != null)) {
- this.subject.removeSequenceGenerator();
- }
- }
- };
- }
-
- protected SequenceGeneratorComposite buildSequenceGeneratorComposite(
- Composite container,
- PropertyValueModel<SequenceGenerator> sequenceGeneratorHolder,
- GeneratorBuilder<SequenceGenerator> generatorBuilder,
- int topMargin,
- int leftMargin) {
-
- return new SequenceGeneratorComposite(
- this,
- sequenceGeneratorHolder,
- this.addSubPane(container, topMargin, leftMargin),
- generatorBuilder
- );
- }
-
- private PropertyValueModel<SequenceGenerator> buildSequenceGeneratorHolder(PropertyValueModel<GeneratorContainer> generatorHolder) {
- return new PropertyAspectAdapter<GeneratorContainer, SequenceGenerator>(generatorHolder, GeneratorContainer.SEQUENCE_GENERATOR_PROPERTY) {
- @Override
- protected SequenceGenerator buildValue_() {
- return this.subject.getSequenceGenerator();
- }
- };
- }
- private GeneratorBuilder<SequenceGenerator> buildSequenceGeneratorBuilder(final PropertyValueModel<GeneratorContainer> generatorHolder) {
- return new GeneratorBuilder<SequenceGenerator>() {
- public SequenceGenerator addGenerator() {
- return generatorHolder.getValue().addSequenceGenerator();
- }
- };
- }
-
- private void initializeTableGeneratorPane(Composite container, PropertyValueModel<GeneratorContainer> generatorHolder) {
-
- // Table Generator sub-section
- container = addCollapsibleSubSection(
- container,
- JptUiDetailsMessages.IdMappingComposite_tableGeneratorSection,
- this.tableGeneratorExpansionStateHolder
- );
-
- Button tableGeneratorCheckBox = addCheckBox(
- container,
- JptUiDetailsMessages.IdMappingComposite_tableGeneratorCheckBox,
- buildTableGeneratorBooleanHolder(generatorHolder),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR
- );
-
- // Sequence Generator pane
- this.buildTableGeneratorComposite(
- container,
- buildTableGeneratorHolder(generatorHolder),
- buildTableGeneratorBuilder(generatorHolder),
- 0,
- tableGeneratorCheckBox.getBorderWidth() + 16);
- }
-
- protected TableGeneratorComposite buildTableGeneratorComposite(
- Composite container,
- PropertyValueModel<TableGenerator> tableGeneratorHolder,
- GeneratorBuilder<TableGenerator> generatorBuilder,
- int topMargin,
- int leftMargin) {
-
- return new TableGeneratorComposite(
- this,
- tableGeneratorHolder,
- this.addSubPane(container, topMargin, leftMargin),
- generatorBuilder
- );
- }
-
- private PropertyValueModel<TableGenerator> buildTableGeneratorHolder(PropertyValueModel<GeneratorContainer> generatorHolder) {
- return new PropertyAspectAdapter<GeneratorContainer, TableGenerator>(generatorHolder, GeneratorContainer.TABLE_GENERATOR_PROPERTY) {
- @Override
- protected TableGenerator buildValue_() {
- return this.subject.getTableGenerator();
- }
- };
- }
-
- private GeneratorBuilder<TableGenerator> buildTableGeneratorBuilder(final PropertyValueModel<GeneratorContainer> generatorHolder) {
- return new GeneratorBuilder<TableGenerator>() {
- public TableGenerator addGenerator() {
- return generatorHolder.getValue().addTableGenerator();
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildTableGeneratorBooleanHolder(PropertyValueModel<GeneratorContainer> generatorHolder) {
- return new PropertyAspectAdapter<GeneratorContainer, Boolean>(generatorHolder, GeneratorContainer.TABLE_GENERATOR_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getTableGenerator() != null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
-
- if (value.booleanValue() && (this.subject.getTableGenerator() == null)) {
-
- TableGenerator tableGenerator = this.subject.addTableGenerator();
- GeneratedValue generatedValue = getSubject().getGeneratedValue();
-
- if ((generatedValue != null) &&
- (generatedValue.getGenerator() != null))
- {
- tableGenerator.setName(generatedValue.getGenerator());
- }
- }
- else if (!value.booleanValue() && (this.subject.getTableGenerator() != null)) {
- this.subject.removeTableGenerator();
- }
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableDialog.java
deleted file mode 100644
index 025924321f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableDialog.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTable;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- *
- * @see InverseJoinColumnInJoinTableStateObject
- * @see BaseJoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class InverseJoinColumnInJoinTableDialog extends BaseJoinColumnDialog<InverseJoinColumnInJoinTableStateObject> {
-
- /**
- * Creates a new <code>JoinColumnInJoinTableDialog</code>.
- *
- * @param parent The parent shell
- * @param joinTable The owner of the join column to create or where it is
- * located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public InverseJoinColumnInJoinTableDialog(Shell parent,
- ReadOnlyJoinTable joinTable,
- ReadOnlyJoinColumn joinColumn) {
-
- super(parent, joinTable, joinColumn);
- }
-
- @Override
- protected DialogPane<InverseJoinColumnInJoinTableStateObject> buildLayout(Composite container) {
- return new JoinColumnDialogPane<InverseJoinColumnInJoinTableStateObject>(
- getSubjectHolder(),
- container
- )
-
- {
- @Override
- protected boolean isTableEditable() {
- return false;
- }
- };
- }
-
- @Override
- protected InverseJoinColumnInJoinTableStateObject buildStateObject() {
- return new InverseJoinColumnInJoinTableStateObject(
- getOwner(),
- getJoinColumn()
- );
- }
-
- @Override
- public JoinColumn getJoinColumn() {
- return (JoinColumn) super.getJoinColumn();
- }
-
- @Override
- protected JoinTable getOwner() {
- return (JoinTable) super.getOwner();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableStateObject.java
deleted file mode 100644
index 0b8d288e83..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/InverseJoinColumnInJoinTableStateObject.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * The state object used to create or edit a primary key join column on a join
- * table.
- *
- * @see JoinColumn
- * @see JoinTable
- * @see InverseJoinColumnInJoinTableDialog
- *
- * @version 2.3
- * @since 2.0
- */
-public class InverseJoinColumnInJoinTableStateObject
- extends JoinColumnStateObject
-{
- /**
- * Creates a new <code>JoinColumnInJoinTableStateObject</code>.
- *
- * @param joinTable
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public InverseJoinColumnInJoinTableStateObject(
- JoinTable joinTable,
- JoinColumn joinColumn) {
- super(joinTable, joinColumn);
- }
-
-
- @Override
- public JoinTable getOwner() {
- return (JoinTable) super.getOwner();
- }
-
- private RelationshipMapping getRelationshipMapping() {
- return getOwner().getRelationshipMapping();
- }
-
- @Override
- public String getDefaultTable() {
- return null;
- }
-
- @Override
- public Table getNameTable() {
- return getOwner().getDbTable();
- }
-
- @Override
- public Table getReferencedNameTable() {
- RelationshipMapping relationshipMapping = getRelationshipMapping();
- if (relationshipMapping == null) {
- return null;
- }
- Entity targetEntity = relationshipMapping.getResolvedTargetEntity();
- if (targetEntity == null) {
- return null;
- }
- return targetEntity.getPrimaryDbTable();
- }
-
- @Override
- protected String getInitialTable() {
- return getOwner().getName();
- }
-
- @Override
- protected boolean isTableEditable() {
- return false;
- }
-
- @Override
- public ListIterator<String> tables() {
- return new SingleElementListIterator<String>(getInitialTable());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialog.java
deleted file mode 100644
index 57109bf588..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialog.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * The abstract definition of the dialog used to edit an <code>IJoinColumn</code>.
- *
- * @see JoinColumn
- * @see JoinColumnStateObject
- * @see JoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class JoinColumnDialog<T extends JoinColumnStateObject>
- extends BaseJoinColumnDialog<T>
-{
-
- /**
- * Creates a new <code>AbstractJoinColumnDialog</code>.
- *
- * @param parent The parent shell
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public JoinColumnDialog(Shell parent, Object owner, ReadOnlyJoinColumn joinColumn) {
- super(parent, owner, joinColumn);
- }
-
- @Override
- protected DialogPane<?> buildLayout(Composite container) {
- return new JoinColumnDialogPane<T>(getSubjectHolder(), container);
- }
-
- @Override
- public ReadOnlyJoinColumn getJoinColumn() {
- return (ReadOnlyJoinColumn) super.getJoinColumn();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialogPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialogPane.java
deleted file mode 100644
index cc3f5a3432..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnDialogPane.java
+++ /dev/null
@@ -1,286 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | BaseJoinColumnDialogPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | x Insertable |
- * | |
- * | x Nullable |
- * | |
- * | x Unique |
- * | |
- * | x Updatable |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see JoinColumnStateObject
- * @see JoinColumnDialog - The parent container
- *
- * @version 2.0
- * @since 1.0
- */
-public class JoinColumnDialogPane<T extends JoinColumnStateObject> extends BaseJoinColumnDialogPane<T>
-{
- /**
- * Creates a new <code>JoinColumnDialogPane</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public JoinColumnDialogPane(PropertyValueModel<? extends T> subjectHolder,
- Composite parent)
- {
- super(subjectHolder, parent);
- }
-
- private ModifiablePropertyValueModel<Boolean> buildInsertableHolder() {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), JoinColumnStateObject.INSERTABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getInsertable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setInsertable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildInsertableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultInsertableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.JoinColumnDialogPane_insertableWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.JoinColumnDialogPane_insertable;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultInsertableHolder() {
- return new PropertyAspectAdapter<T, Boolean>(
- getSubjectHolder(),
- JoinColumnStateObject.INSERTABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getInsertable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultInsertable());
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildNullableHolder() {
- return new PropertyAspectAdapter<T, Boolean>(
- getSubjectHolder(),
- JoinColumnStateObject.NULLABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getNullable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setNullable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildNullableStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultNullableHolder()) {
-
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.JoinColumnDialogPane_nullableWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.JoinColumnDialogPane_nullable;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultNullableHolder() {
- return new PropertyAspectAdapter<T, Boolean>(
- getSubjectHolder(),
- JoinColumnStateObject.NULLABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getNullable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultNullable());
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildUniqueHolder() {
- return new PropertyAspectAdapter<T, Boolean>(
- getSubjectHolder(),
- JoinColumnStateObject.UNIQUE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getUnique();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setUnique(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildUniqueStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultUniqueHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.JoinColumnDialogPane_uniqueWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.JoinColumnDialogPane_unique;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultUniqueHolder() {
- return new PropertyAspectAdapter<T, Boolean>(
- getSubjectHolder(),
- JoinColumnStateObject.UNIQUE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getUnique() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultUnique());
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildUpdatableHolder() {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), JoinColumnStateObject.UPDATABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getUpdatable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setUpdatable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildUpdatableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultUpdatableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.JoinColumnDialogPane_updatableWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.JoinColumnDialogPane_updatable;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultUpdatableHolder() {
- return new PropertyAspectAdapter<T, Boolean>(
- getSubjectHolder(),
- JoinColumnStateObject.UPDATABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getUpdatable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultUpdatable());
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- super.initializeLayout(container);
-
- // Insertable tri-state check box
- addTriStateCheckBoxWithDefault(
- addSubPane(container, 4),
- JptUiDetailsMessages.JoinColumnDialogPane_insertable,
- buildInsertableHolder(),
- buildInsertableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_INSERTABLE
- );
-
- // Updatable tri-state check box
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages.JoinColumnDialogPane_updatable,
- buildUpdatableHolder(),
- buildUpdatableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_UPDATABLE
- );
-
- // Unique tri-state check box
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages.ColumnComposite_unique,
- buildUniqueHolder(),
- buildUniqueStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_UNIQUE
- );
-
- // Nullable tri-state check box
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages.ColumnComposite_nullable,
- buildNullableHolder(),
- buildNullableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_NULLABLE
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected boolean isTableEditable() {
- return true;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInJoiningStrategyDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInJoiningStrategyDialog.java
deleted file mode 100644
index 24d6fd8e78..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInJoiningStrategyDialog.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationshipStrategy;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is used to either create or edit a joing column that is located
- * on a relational mapping.
- *
- * @see JoinColumn
- * @see JoinColumnRelationshipStrategy
- * @see JoinColumnInJoiningStrategyStateObject
- * @see JoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class JoinColumnInJoiningStrategyDialog
- extends JoinColumnDialog<JoinColumnInJoiningStrategyStateObject>
-{
- /**
- * Creates a new <code>AbstractJoinColumnDialog</code>.
- *
- * @param parent The parent shell
- * @param relationshipMapping The owner of the join column to edit or to
- * create
- * @param joinColumn The join column to edit or <code>null</code> if this is
- * used to create a new one
- */
- JoinColumnInJoiningStrategyDialog(
- Shell parent,
- ReadOnlyJoinColumnRelationshipStrategy joinColumnOwner,
- ReadOnlyJoinColumn joinColumn) {
-
- super(parent, joinColumnOwner, joinColumn);
- }
-
- @Override
- protected JoinColumnInJoiningStrategyStateObject buildStateObject() {
- return new JoinColumnInJoiningStrategyStateObject(
- getOwner(),
- getJoinColumn()
- );
- }
-
- @Override
- protected JoinColumnRelationshipStrategy getOwner() {
- return (JoinColumnRelationshipStrategy) super.getOwner();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInJoiningStrategyStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInJoiningStrategyStateObject.java
deleted file mode 100644
index 2ff745f0f3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInJoiningStrategyStateObject.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * The state object used to create or edit a primary key join column on a
- * relationship mapping.
- *
- * @see JoinColumn
- * @see JoinColumnRelationshipStrategy
- * @see JoinColumnInJoiningStrategyDialog
- *
- * @version 2.3
- * @since 2.0
- */
-public class JoinColumnInJoiningStrategyStateObject
- extends JoinColumnStateObject
-{
- /**
- * Creates a new <code>JoinColumnInJoiningStrategyStateObject</code>.
- *
- * @param joiningStrategy The owner of the join column to create
- * @param joinColumn The join column to edit or <code>null</code> if this is
- * used to create a new one
- */
- public JoinColumnInJoiningStrategyStateObject(
- ReadOnlyJoinColumnRelationshipStrategy joiningStrategy,
- ReadOnlyJoinColumn joinColumn) {
- super(joiningStrategy, joinColumn);
- }
-
-
- @Override
- public JoinColumnRelationshipStrategy getOwner() {
- return (JoinColumnRelationshipStrategy) super.getOwner();
- }
-
- @Override
- public ListIterator<String> tables() {
- Schema schema = getDbSchema();
- return schema == null ? super.tables() : CollectionTools.list(schema.getSortedTableIdentifiers()).listIterator();
- }
-
- protected Schema getDbSchema() {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? null : typeMapping.getDbSchema();
- }
-
- protected TypeMapping getRelationshipSource() {
- return getOwner().getRelationshipSource();
- }
-
- protected TypeMapping getRelationshipTarget() {
- return getOwner().getRelationshipTarget();
- }
-
- @Override
- public String getDefaultTable() {
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn != null) {
- return joinColumn.getDefaultTable();
- }
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? null : typeMapping.getPrimaryTableName();
- }
-
- @Override
- public Table getNameTable() {
- TypeMapping typeMapping = getRelationshipSource();
- return typeMapping == null ? null : typeMapping.getPrimaryDbTable();
- }
-
- @Override
- public Table getReferencedNameTable() {
- TypeMapping relationshipTarget = getRelationshipTarget();
- return relationshipTarget == null ? null : relationshipTarget.getPrimaryDbTable();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableDialog.java
deleted file mode 100644
index 291b5d8a92..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableDialog.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyReferenceTable;
-import org.eclipse.jpt.jpa.core.context.ReferenceTable;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is used to either create or edit a join column that is located
- * on a join table.
- *
- * @see JoinColumn
- * @see JoinTable
- * @see JoinColumnInReferenceTableStateObject
- * @see BaseJoinColumnDialogPane
- *
- * @version 2.0
- * @since 1.0
- */
-public class JoinColumnInReferenceTableDialog extends BaseJoinColumnDialog<JoinColumnInReferenceTableStateObject> {
-
- /**
- * Creates a new <code>JoinColumnInReferenceTableDialog</code>.
- *
- * @param parent The parent shell
- * @param joinTable The parent of the join column to edit or to create
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public JoinColumnInReferenceTableDialog(Shell parent,
- ReadOnlyReferenceTable referenceTable,
- ReadOnlyJoinColumn joinColumn) {
-
- super(parent, referenceTable, joinColumn);
- }
-
- @Override
- protected DialogPane<JoinColumnInReferenceTableStateObject> buildLayout(Composite container) {
- return new JoinColumnDialogPane<JoinColumnInReferenceTableStateObject>(
- getSubjectHolder(),
- container
- ) {
- @Override
- protected boolean isTableEditable() {
- return false;
- }
- };
- }
-
- @Override
- protected JoinColumnInReferenceTableStateObject buildStateObject() {
- return new JoinColumnInReferenceTableStateObject(
- getOwner(),
- getJoinColumn()
- );
- }
-
- @Override
- public JoinColumn getJoinColumn() {
- return (JoinColumn) super.getJoinColumn();
- }
-
- @Override
- protected ReferenceTable getOwner() {
- return (ReferenceTable) super.getOwner();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableStateObject.java
deleted file mode 100644
index a3bdb624a8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnInReferenceTableStateObject.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ReferenceTable;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * The state object used to create or edit a primary key join column on a
- * joint table.
- *
- * @see JoinColumn
- * @see JoinTable
- * @see InverseJoinColumnDialog
- * @see InverseJoinColumnDialogPane
- * @see JoinColumnInReferenceTableDialog
- *
- * @version 2.0
- * @since 2.0
- */
-public class JoinColumnInReferenceTableStateObject
- extends JoinColumnStateObject
-{
- /**
- * Creates a new <code>JoinColumnInJoinTableStateObject</code>.
- *
- * @param joinTable The owner of the join column to create or to edit
- * @param joinColumn The join column to edit
- */
- public JoinColumnInReferenceTableStateObject(
- ReferenceTable referenceTable,
- JoinColumn joinColumn) {
- super(referenceTable, joinColumn);
- }
-
-
- @Override
- public ReferenceTable getOwner() {
- return (ReferenceTable) super.getOwner();
- }
-
- private TypeMapping getTypeMapping() {
- return getOwner().getPersistentAttribute().getOwningTypeMapping();
- }
-
- @Override
- public String getDefaultTable() {
- return null;
- }
-
- @Override
- public Table getNameTable() {
- return getOwner().getDbTable();
- }
-
- @Override
- public Table getReferencedNameTable() {
- return getTypeMapping().getPrimaryDbTable();
- }
-
- @Override
- protected String getInitialTable() {
- return getOwner().getName();
- }
-
- @Override
- protected boolean isTableEditable() {
- return false;
- }
-
- @Override
- public ListIterator<String> tables() {
- return new SingleElementListIterator<String>(getInitialTable());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java
deleted file mode 100644
index 31a731c03a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnJoiningStrategyPane.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | o Join columns __________________________________________________________ |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | JoiningStrategyJoinColumnsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see JoinColumnRelationship
- * @see ReadOnlyJoinColumnRelationshipStrategy
- * @see OneToOneJoiningStrategyPane
- * @see ManyToOneJoiningStrategyPane
- *
- * @version 2.3
- * @since 2.1
- */
-public class JoinColumnJoiningStrategyPane
- extends AbstractJoiningStrategyPane
- <ReadOnlyJoinColumnRelationship, ReadOnlyJoinColumnRelationshipStrategy>
-{
- private final boolean includeOverrideCheckBox;
-
-
- public static JoinColumnJoiningStrategyPane buildJoinColumnJoiningStrategyPaneWithIncludeOverrideCheckBox(
- Pane<? extends ReadOnlyJoinColumnRelationship> parentPane,
- Composite parent) {
- return new JoinColumnJoiningStrategyPane(parentPane, parent, true);
- }
-
- public static JoinColumnJoiningStrategyPane buildJoinColumnJoiningStrategyPaneWithoutIncludeOverrideCheckBox(
- Pane<? extends ReadOnlyJoinColumnRelationship> parentPane,
- Composite parent) {
- return new JoinColumnJoiningStrategyPane(parentPane, parent, false);
- }
-
- public static JoinColumnJoiningStrategyPane buildJoinColumnJoiningStrategyPaneWithIncludeOverrideCheckBox(
- Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyJoinColumnRelationship> subjectHolder,
- Composite parent) {
- return new JoinColumnJoiningStrategyPane(parentPane, subjectHolder, parent, true);
- }
-
- public static JoinColumnJoiningStrategyPane buildJoinColumnJoiningStrategyPaneWithoutIncludeOverrideCheckBox(
- Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyJoinColumnRelationship> subjectHolder,
- Composite parent) {
- return new JoinColumnJoiningStrategyPane(parentPane, subjectHolder, parent, false);
- }
-
-
- private JoinColumnJoiningStrategyPane(
- Pane<? extends ReadOnlyJoinColumnRelationship> parentPane,
- Composite parent,
- boolean includeOverrideCheckBox) {
- super(parentPane, parent);
- this.includeOverrideCheckBox = includeOverrideCheckBox;
- initializeLayout2(getControl());
- }
-
- private JoinColumnJoiningStrategyPane(Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyJoinColumnRelationship> subjectHolder,
- Composite parent,
- boolean includeOverrideCheckBox) {
-
- super(parentPane, subjectHolder, parent);
- this.includeOverrideCheckBox = includeOverrideCheckBox;
- initializeLayout2(getControl());
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- //see initializeLayout2
- }
-
- protected void initializeLayout2(Composite container) {
- super.initializeLayout(container);
- //just call super, we are delaying the initializeLayout because of the includeOverrideCheckBox boolean
- }
-
- @Override
- protected Composite buildStrategyDetailsComposite(Composite parent) {
- PropertyValueModel<ReadOnlyJoinColumnRelationshipStrategy> joiningStrategyHolder = this.buildJoinColumnJoiningStrategyHolder();
-
- return this.includeOverrideCheckBox ?
- new JoiningStrategyJoinColumnsWithOverrideOptionComposite(this, joiningStrategyHolder, parent).getControl() :
- new JoiningStrategyJoinColumnsComposite(this, joiningStrategyHolder, parent).getControl();
- }
-
- @Override
- protected ModifiablePropertyValueModel<Boolean> buildUsesStrategyHolder() {
- return buildUsesJoinColumnJoiningStrategyHolder(getSubjectHolder());
- }
-
- protected PropertyValueModel<ReadOnlyJoinColumnRelationshipStrategy> buildJoinColumnJoiningStrategyHolder() {
- return new PropertyAspectAdapter
- <ReadOnlyJoinColumnRelationship, ReadOnlyJoinColumnRelationshipStrategy>(
- getSubjectHolder()) {
- @Override
- protected ReadOnlyJoinColumnRelationshipStrategy buildValue_() {
- return this.subject.getJoinColumnStrategy();
- }
- };
- }
-
- public static ModifiablePropertyValueModel<Boolean> buildUsesJoinColumnJoiningStrategyHolder(PropertyValueModel<? extends ReadOnlyJoinColumnRelationship> subjectHolder) {
- return new PropertyAspectAdapter<ReadOnlyJoinColumnRelationship, Boolean>(
- subjectHolder, ReadOnlyRelationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.buildBooleanValue());
- }
-
- protected boolean buildBooleanValue() {
- return (this.subject != null) && this.subject.strategyIsJoinColumn();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- ((JoinColumnRelationship) this.subject).setStrategyToJoinColumn();
- }
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnStateObject.java
deleted file mode 100644
index 0627a4072b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnStateObject.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.EmptyListIterator;
-import org.eclipse.jpt.jpa.core.context.BaseJoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-
-/**
- * The state object used to edit a <code>JoinColumn</code>.
- *
- * @see JoinColumn
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class JoinColumnStateObject
- extends BaseJoinColumnStateObject
-{
- private Boolean insertable;
- private Boolean nullable;
- private Boolean unique;
- private Boolean updatable;
-
- public static final String INSERTABLE_PROPERTY = "insertable";
- public static final String NULLABLE_PROPERTY = "nullable";
- public static final String UNIQUE_PROPERTY = "unique";
- public static final String UPDATABLE_PROPERTY = "updatable";
-
- /**
- * Creates a new <code>JoinColumnStateObject</code>.
- *
- * @param owner The owner of the join column to create or where it is located
- * @param joinColumn The join column to edit
- */
- public JoinColumnStateObject(Object owner, ReadOnlyJoinColumn joinColumn) {
- super(owner, joinColumn);
- }
-
- public boolean isDefaultInsertable() {
-
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn != null) {
- return joinColumn.isDefaultInsertable();
- }
-
- return ReadOnlyBaseColumn.DEFAULT_INSERTABLE;
- }
-
- public boolean isDefaultNullable() {
-
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn != null) {
- return joinColumn.isDefaultNullable();
- }
-
- return ReadOnlyBaseColumn.DEFAULT_NULLABLE;
- }
-
- public boolean isDefaultUnique() {
-
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn != null) {
- return joinColumn.isDefaultUnique();
- }
-
- return ReadOnlyBaseColumn.DEFAULT_UNIQUE;
- }
-
- public boolean isDefaultUpdatable() {
-
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn != null) {
- return joinColumn.isDefaultUpdatable();
- }
-
- return ReadOnlyBaseColumn.DEFAULT_UPDATABLE;
- }
-
- public Boolean getInsertable() {
- return this.insertable;
- }
-
- @Override
- public JoinColumn getJoinColumn() {
- return (JoinColumn) super.getJoinColumn();
- }
-
- public Boolean getNullable() {
- return this.nullable;
- }
-
- public Boolean getUnique() {
- return this.unique;
- }
-
- public Boolean getUpdatable() {
- return this.updatable;
- }
-
- @Override
- protected void initialize(Object owner, ReadOnlyBaseJoinColumn baseJoinColumn) {
-
- super.initialize(owner, baseJoinColumn);
-
- if (baseJoinColumn != null) {
- ReadOnlyJoinColumn joinColumn = (ReadOnlyJoinColumn) baseJoinColumn;
-
- this.insertable = joinColumn.getSpecifiedInsertable();
- this.nullable = joinColumn.getSpecifiedNullable();
- this.unique = joinColumn.getSpecifiedUnique();
- this.updatable = joinColumn.getSpecifiedUpdatable();
- }
- }
-
- @Override
- protected String getInitialTable() {
- JoinColumn joinColumn = getJoinColumn();
-
- if (joinColumn == null) {
- return null;
- }
-
- return joinColumn.getSpecifiedTable();
- }
-
- protected boolean isTableEditable() {
- return true;
- }
-
- public void setInsertable(Boolean insertable) {
- Boolean oldInsertable = this.insertable;
- this.insertable = insertable;
- firePropertyChanged(INSERTABLE_PROPERTY, oldInsertable, insertable);
- }
-
- public void setNullable(Boolean nullable) {
- Boolean oldNullable = this.nullable;
- this.nullable = nullable;
- firePropertyChanged(NULLABLE_PROPERTY, oldNullable, nullable);
- }
-
- public void setUnique(Boolean unique) {
- Boolean oldUnique = this.unique;
- this.unique = unique;
- firePropertyChanged(UNIQUE_PROPERTY, oldUnique, unique);
- }
-
- public void setUpdatable(Boolean updatable) {
- Boolean oldUpdatable = this.updatable;
- this.updatable = updatable;
- firePropertyChanged(UPDATABLE_PROPERTY, oldUpdatable, updatable);
- }
-
- @Override
- public ListIterator<String> tables() {
- return EmptyListIterator.instance();
- }
-
- @Override
- public void updateJoinColumn(BaseJoinColumn abstractJoinColumn) {
-
- super.updateJoinColumn(abstractJoinColumn);
-
- JoinColumn joinColumn = (JoinColumn) abstractJoinColumn;
-
- // Table
- if (isTableEditable()) {
- String table = getTable();
-
- if (valuesAreDifferent(table, joinColumn.getSpecifiedTable())) {
- joinColumn.setSpecifiedTable(table);
- }
- }
-
- // Insertable
- if (joinColumn.getSpecifiedInsertable() != this.insertable){
- joinColumn.setSpecifiedInsertable(this.insertable);
- }
-
- // Updatable
- if (joinColumn.getSpecifiedUpdatable() != this.updatable){
- joinColumn.setSpecifiedUpdatable(this.updatable);
- }
-
- // Unique
- if (joinColumn.getSpecifiedUnique() != this.unique){
- joinColumn.setSpecifiedUnique(this.unique);
- }
-
- // Nullable
- if (joinColumn.getSpecifiedNullable() != this.nullable){
- joinColumn.setSpecifiedNullable(this.nullable);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnsComposite.java
deleted file mode 100644
index 5ea2b43d35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinColumnsComposite.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ArrayList;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.AbstractAdapter;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see JoiningStrategyJoinColumnsComposite - A container of this pane
- * @see JoinTableComposite - A container of this pane
- * @see EntityOverridesComposite - A container of this pane
- *
- * @version 3.0
- * @since 2.0
- */
-public class JoinColumnsComposite<T extends JpaNode> extends Pane<T>
-{
- /**
- * The editor used to perform the common behaviors defined in the list pane.
- */
- JoinColumnsEditor<T> joinColumnsEditor;
-
- private AddRemoveListPane<T> listPane;
-
- /**
- * Creates a new <code>JoinColumnsComposite</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- * @param joinColumnsEditor The editor used to perform the common behaviors
- * defined in the list pane
- */
- public JoinColumnsComposite(Pane<? extends T> parentPane,
- Composite parent,
- JoinColumnsEditor<T> joinColumnsEditor) {
-
- super(parentPane, parent);
- this.joinColumnsEditor = joinColumnsEditor;
- initializeLayout2();
- }
-
- /**
- * Creates a new <code>JoinColumnsComposite</code>.
- *
- * @param parentPane The parent controller of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param joinColumnsEditor The editor used to perform the common behaviors
- * defined in the list pane
- */
- public JoinColumnsComposite(Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- JoinColumnsEditor<T> joinColumnsEditor,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- this.joinColumnsEditor = joinColumnsEditor;
- initializeLayout2();
- }
-
- /**
- * Creates a new <code>JoinColumnsComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JoinColumnsComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory,
- JoinColumnsEditor<T> joinColumnsEditor) {
-
- super(subjectHolder, parent, widgetFactory);
- this.joinColumnsEditor = joinColumnsEditor;
- initializeLayout2();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- //see intiailizeLayout2()
- }
-
- private void initializeLayout2() {
- this.listPane = new AddRemoveListPane<T>(
- this,
- getControl(),
- buildJoinColumnsAdapter(),
- buildJoinColumnsListModel(),
- buildSelectedJoinColumnHolder(),
- buildJoinColumnsListLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS,
- false
- );
- }
-
- private ModifiablePropertyValueModel<JoinColumn> buildSelectedJoinColumnHolder() {
- return new SimplePropertyValueModel<JoinColumn>();
- }
-
- String buildJoinColumnLabel(ReadOnlyJoinColumn joinColumn) {
-
- if (joinColumn.isVirtual()) {
- return NLS.bind(
- JptUiDetailsMessages.JoinColumnsComposite_mappingBetweenTwoParamsDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
- if (joinColumn.getSpecifiedName() == null) {
-
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(
- JptUiDetailsMessages.JoinColumnsComposite_mappingBetweenTwoParamsBothDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- return NLS.bind(
- JptUiDetailsMessages.JoinColumnsComposite_mappingBetweenTwoParamsFirstDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(
- JptUiDetailsMessages.JoinColumnsComposite_mappingBetweenTwoParamsSecDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- return NLS.bind(
- JptUiDetailsMessages.JoinColumnsComposite_mappingBetweenTwoParams,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- private Adapter buildJoinColumnsAdapter() {
- return new AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- JoinColumnsComposite.this.joinColumnsEditor.addJoinColumn(getSubject());
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiDetailsMessages.JoinColumnsComposite_edit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- JoinColumn joinColumn = (JoinColumn) listSelectionModel.selectedValue();
- JoinColumnsComposite.this.joinColumnsEditor.editJoinColumn(getSubject(), joinColumn);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- JoinColumnsComposite.this.joinColumnsEditor.removeJoinColumns(getSubject(), listSelectionModel.selectedIndices());
- }
- };
- }
-
- private ListValueModel<ReadOnlyJoinColumn> buildJoinColumnsListModel() {
- return new ItemPropertyListValueModelAdapter<ReadOnlyJoinColumn>(buildJoinColumnsListHolder(),
- ReadOnlyNamedColumn.SPECIFIED_NAME_PROPERTY,
- ReadOnlyNamedColumn.DEFAULT_NAME_PROPERTY,
- ReadOnlyBaseJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY,
- ReadOnlyBaseJoinColumn.DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY);
- }
-
- private ListValueModel<ReadOnlyJoinColumn> buildJoinColumnsListHolder() {
- java.util.List<ListValueModel<ReadOnlyJoinColumn>> list = new ArrayList<ListValueModel<ReadOnlyJoinColumn>>();
- list.add(buildDefaultJoinColumnListHolder());
- list.add(buildSpecifiedJoinColumnsListHolder());
- return new CompositeListValueModel<ListValueModel<ReadOnlyJoinColumn>, ReadOnlyJoinColumn>(list);
- }
-
- private ListValueModel<ReadOnlyJoinColumn> buildSpecifiedJoinColumnsListHolder() {
- return new ListAspectAdapter<T, ReadOnlyJoinColumn>(getSubjectHolder(), this.joinColumnsEditor.getSpecifiedJoinColumnsListPropertyName()) {
- @Override
- protected ListIterable<ReadOnlyJoinColumn> getListIterable() {
- return JoinColumnsComposite.this.joinColumnsEditor.getSpecifiedJoinColumns(this.subject);
- }
-
- @Override
- protected int size_() {
- return JoinColumnsComposite.this.joinColumnsEditor.getSpecifiedJoinColumnsSize(this.subject);
- }
- };
- }
-
-
- private ListValueModel<ReadOnlyJoinColumn> buildDefaultJoinColumnListHolder() {
- return new PropertyListValueModelAdapter<ReadOnlyJoinColumn>(buildDefaultJoinColumnHolder());
-
- }
-
- private PropertyValueModel<ReadOnlyJoinColumn> buildDefaultJoinColumnHolder() {
- return new PropertyAspectAdapter<T, ReadOnlyJoinColumn>(getSubjectHolder(), this.joinColumnsEditor.getDefaultPropertyName()) {
- @Override
- protected ReadOnlyJoinColumn buildValue_() {
- return JoinColumnsComposite.this.joinColumnsEditor.getDefaultJoinColumn(this.subject);
- }
- };
- }
-
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- ReadOnlyJoinColumn joinColumn = (ReadOnlyJoinColumn) element;
-
- return buildJoinColumnLabel(joinColumn);
- }
- };
- }
-
- public void installJoinColumnsPaneEnabler(PropertyValueModel<Boolean> joinColumnsPaneEnablerHolder) {
- new PaneEnabler(joinColumnsPaneEnablerHolder, this.listPane);
- }
-
- public void setSelectedJoinColumn(JoinColumn joinColumn) {
- this.listPane.setSelectedItem(joinColumn);
- }
-
- /**
- * The editor is used to complete the behavior of this pane.
- */
- public static interface JoinColumnsEditor<T> {
-
- /**
- * Add a join column to the given subject and return it
- */
- void addJoinColumn(T subject);
-
- /**
- * Edit the given join column, the Edit button was pressed
- * while this join column was selected.
- */
- void editJoinColumn(T subject, ReadOnlyJoinColumn joinColumn);
-
- /**
- * Return whether the subject has specified join columns
- */
- boolean hasSpecifiedJoinColumns(T subject);
-
- /**
- * Return the spcified join columns from the given subject
- */
- ListIterable<ReadOnlyJoinColumn> getSpecifiedJoinColumns(T subject);
-
- /**
- * Return the number of specified join columns on the given subject
- */
- int getSpecifiedJoinColumnsSize(T subject);
-
- /**
- * Return the default join column from the given subject or null.
- */
- ReadOnlyJoinColumn getDefaultJoinColumn(T subject);
-
- /**
- * Return the property name of the specified join columns list
- */
- String getSpecifiedJoinColumnsListPropertyName();
-
- /**
- * Return the property name of the specified join columns list
- */
- String getDefaultPropertyName();
-
- /**
- * Remove the join columns at the specified indices from the subject
- */
- void removeJoinColumns(T subject, int[] selectedIndices);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableComposite.java
deleted file mode 100644
index 2ac4975d16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableComposite.java
+++ /dev/null
@@ -1,404 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ReadOnlyWritablePropertyValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ValueListAdapter;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTable;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinColumnsComposite.JoinColumnsEditor;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.TableCombo;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | --------------------------------------------------------------- |
- * | Name: | |v| |
- * | --------------------------------------------------------------- |
- * | |
- * | - Join Columns ---------------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | JoinColumnsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - Inverse Join Columns -------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | JoinColumnsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see JoinTable
- * @see JoinTableJoiningStrategyPane
- * @see JoinColumnsComposite
- *
- * @version 2.1
- * @since 1.0
- */
-public class JoinTableComposite
- extends ReferenceTableComposite<ReadOnlyJoinTable>
-{
- private Button overrideDefaultInverseJoinColumnsCheckBox;
-
- private JoinColumnsComposite<ReadOnlyJoinTable> inverseJoinColumnsComposite;
- /**
- * Creates a new <code>JoinTableComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public JoinTableComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyJoinTable> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>JoinTableComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IJoinTable</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JoinTableComposite(PropertyValueModel<? extends ReadOnlyJoinTable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected boolean tableIsVirtual(ReadOnlyJoinTable joinTable) {
- return joinTable.getParent().getRelationship().isVirtual();
- }
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = getGroupBoxMargin();
-
- // Name widgets
- TableCombo<ReadOnlyJoinTable> tableCombo = addTableCombo(container);
- Composite tablePane = addPane(container, groupBoxMargin);
- addLabeledComposite(
- tablePane,
- JptUiDetailsMessages.JoinTableComposite_name,
- tableCombo.getControl(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_NAME
- );
-
- // schema widgets
- SchemaCombo<ReadOnlyJoinTable> schemaCombo = addSchemaCombo(container);
-
- addLabeledComposite(
- tablePane,
- JptUiDetailsMessages.JoinTableComposite_schema,
- schemaCombo.getControl(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_SCHEMA
- );
-
- // catalog widgets
- CatalogCombo<ReadOnlyJoinTable> catalogCombo = addCatalogCombo(container);
-
- addLabeledComposite(
- tablePane,
- JptUiDetailsMessages.JoinTableComposite_catalog,
- catalogCombo.getControl(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_CATALOG
- );
-
- // Join Columns group pane
- Group joinColumnGroupPane = addTitledGroup(
- container,
- JptUiDetailsMessages.JoinTableComposite_joinColumn
- );
-
- // Override Default Join Columns check box
- this.overrideDefaultJoinColumnsCheckBox = addCheckBox(
- addSubPane(joinColumnGroupPane, 8),
- JptUiDetailsMessages.JoinTableComposite_overrideDefaultJoinColumns,
- buildOverrideDefaultJoinColumnHolder(),
- null
- );
-
- this.joinColumnsComposite = new JoinColumnsComposite<ReadOnlyJoinTable>(
- this,
- joinColumnGroupPane,
- buildJoinColumnsEditor()
- );
-
- installJoinColumnsPaneEnabler(this.joinColumnsComposite);
-
- // Inverse Join Columns group pane
- Group inverseJoinColumnGroupPane = addTitledGroup(
- container,
- JptUiDetailsMessages.JoinTableComposite_inverseJoinColumn
- );
-
- // Override Default Inverse Join Columns check box
- this.overrideDefaultInverseJoinColumnsCheckBox = addCheckBox(
- addSubPane(inverseJoinColumnGroupPane, 8),
- JptUiDetailsMessages.JoinTableComposite_overrideDefaultInverseJoinColumns,
- buildOverrideDefaultInverseJoinColumnHolder(),
- null
- );
-
- this.inverseJoinColumnsComposite = new JoinColumnsComposite<ReadOnlyJoinTable>(
- this,
- inverseJoinColumnGroupPane,
- buildInverseJoinColumnsEditor()
- );
-
- installInverseJoinColumnsPaneEnabler(this.inverseJoinColumnsComposite);
- }
-
- private void installInverseJoinColumnsPaneEnabler(JoinColumnsComposite<ReadOnlyJoinTable> pane) {
- pane.installJoinColumnsPaneEnabler(new InverseJoinColumnPaneEnablerHolder());
- }
-
- void addInverseJoinColumn(ReadOnlyJoinTable joinTable) {
-
- InverseJoinColumnInJoinTableDialog dialog =
- new InverseJoinColumnInJoinTableDialog(getShell(), joinTable, null);
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- addInverseJoinColumnFromDialog(dialog.getSubject());
- }
- }
-
- void addInverseJoinColumnFromDialog(InverseJoinColumnInJoinTableStateObject stateObject) {
-
- JoinTable subject = (JoinTable) getSubject();
- int index = subject.getSpecifiedInverseJoinColumnsSize();
-
- JoinColumn joinColumn = subject.addSpecifiedInverseJoinColumn(index);
- stateObject.updateJoinColumn(joinColumn);
- this.setSelectedInverseJoinColumn(joinColumn);
- }
-
- private void setSelectedInverseJoinColumn(JoinColumn joinColumn) {
- this.inverseJoinColumnsComposite.setSelectedJoinColumn(joinColumn);
- }
-
- private InverseJoinColumnsProvider buildInverseJoinColumnsEditor() {
- return new InverseJoinColumnsProvider();
- }
-
- private ModifiablePropertyValueModel<Boolean> buildOverrideDefaultInverseJoinColumnHolder() {
- return new OverrideDefaultInverseJoinColumnHolder();
- }
-
- ListValueModel<ReadOnlyJoinColumn> buildSpecifiedInverseJoinColumnsListHolder() {
- return new ListAspectAdapter<ReadOnlyJoinTable, ReadOnlyJoinColumn>(getSubjectHolder(), ReadOnlyJoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST) {
- @Override
- protected ListIterable<ReadOnlyJoinColumn> getListIterable() {
- return new SuperListIterableWrapper<ReadOnlyJoinColumn>(this.subject.getSpecifiedInverseJoinColumns());
- }
-
- @Override
- protected int size_() {
- return this.subject.getSpecifiedInverseJoinColumnsSize();
- }
- };
- }
-
-
- void editInverseJoinColumn(InverseJoinColumnInJoinTableStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- void editInverseJoinColumn(ReadOnlyJoinColumn joinColumn) {
-
- InverseJoinColumnInJoinTableDialog dialog =
- new InverseJoinColumnInJoinTableDialog(getShell(), getSubject(), joinColumn);
-
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- editInverseJoinColumn(dialog.getSubject());
- }
- }
-
- void updateInverseJoinColumns() {
- if (this.isPopulating()) {
- return;
- }
-
- JoinTable joinTable = (JoinTable) this.getSubject();
- if (joinTable == null) {
- return;
- }
-
- boolean selected = this.overrideDefaultInverseJoinColumnsCheckBox.getSelection();
- this.setPopulating(true);
-
- try {
- if (selected) {
- joinTable.convertDefaultInverseJoinColumnToSpecified();
- setSelectedInverseJoinColumn(joinTable.getSpecifiedInverseJoinColumn(0));
- } else {
- joinTable.clearSpecifiedInverseJoinColumns();
- }
- } finally {
- this.setPopulating(false);
- }
- }
-
-
-
- class InverseJoinColumnsProvider implements JoinColumnsEditor<ReadOnlyJoinTable> {
-
- public void addJoinColumn(ReadOnlyJoinTable subject) {
- JoinTableComposite.this.addInverseJoinColumn(subject);
- }
-
- public ReadOnlyJoinColumn getDefaultJoinColumn(ReadOnlyJoinTable subject) {
- return subject.getDefaultInverseJoinColumn();
- }
-
- public String getDefaultPropertyName() {
- return ReadOnlyJoinTable.DEFAULT_INVERSE_JOIN_COLUMN;
- }
-
- public void editJoinColumn(ReadOnlyJoinTable subject, ReadOnlyJoinColumn joinColumn) {
- JoinTableComposite.this.editInverseJoinColumn(joinColumn);
- }
-
- public boolean hasSpecifiedJoinColumns(ReadOnlyJoinTable subject) {
- return subject.hasSpecifiedInverseJoinColumns();
- }
-
- public void removeJoinColumns(ReadOnlyJoinTable subject, int[] selectedIndices) {
- for (int index = selectedIndices.length; index-- > 0; ) {
- ((JoinTable) subject).removeSpecifiedInverseJoinColumn(selectedIndices[index]);
- }
- }
-
- public ListIterable<ReadOnlyJoinColumn> getSpecifiedJoinColumns(ReadOnlyJoinTable subject) {
- return new SuperListIterableWrapper<ReadOnlyJoinColumn>(subject.getSpecifiedInverseJoinColumns());
- }
-
- public int getSpecifiedJoinColumnsSize(ReadOnlyJoinTable subject) {
- return subject.getSpecifiedInverseJoinColumnsSize();
- }
-
- public String getSpecifiedJoinColumnsListPropertyName() {
- return ReadOnlyJoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST;
- }
- }
-
- private class OverrideDefaultInverseJoinColumnHolder extends ListPropertyValueModelAdapter<Boolean>
- implements ModifiablePropertyValueModel<Boolean> {
-
- public OverrideDefaultInverseJoinColumnHolder() {
- super(buildSpecifiedInverseJoinColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.listModel.size() > 0);
- }
-
- public void setValue(Boolean value) {
- updateInverseJoinColumns();
- }
- }
-
-
- private class InverseJoinColumnPaneEnablerHolder
- extends TransformationPropertyValueModel<ReadOnlyJoinTable, Boolean>
- {
- private StateChangeListener stateListener;
-
-
- public InverseJoinColumnPaneEnablerHolder() {
- super(
- new ValueListAdapter<ReadOnlyJoinTable>(
- new ReadOnlyWritablePropertyValueModelWrapper<ReadOnlyJoinTable>(getSubjectHolder()),
- ReadOnlyJoinTable.SPECIFIED_INVERSE_JOIN_COLUMNS_LIST));
- this.stateListener = new StateListener();
- }
-
- class StateListener
- extends StateChangeAdapter
- {
- @Override
- public void stateChanged(StateChangeEvent event) {
- wrappedValueStateChanged();
- }
- }
-
- void wrappedValueStateChanged() {
- Object old = this.value;
- this.firePropertyChanged(VALUE, old, this.value = this.transform(this.valueModel.getValue()));
- }
-
- @Override
- protected Boolean transform(ReadOnlyJoinTable table) {
- return (table == null) ? Boolean.FALSE : super.transform(table);
- }
-
- @Override
- protected Boolean transform_(ReadOnlyJoinTable table) {
- boolean virtual = JoinTableComposite.this.tableIsVirtual(table);
- return Boolean.valueOf(! virtual && table.getSpecifiedInverseJoinColumnsSize() > 0);
- }
-
- @Override
- protected void engageModel() {
- super.engageModel();
- this.valueModel.addStateChangeListener(this.stateListener);
- }
-
- @Override
- protected void disengageModel() {
- this.valueModel.removeStateChangeListener(this.stateListener);
- super.disengageModel();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableJoiningStrategyPane.java
deleted file mode 100644
index 0a2b98332c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoinTableJoiningStrategyPane.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationship;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTableRelationship;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | o Join table ____________________________________________________________ |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | JoinTableComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link JoinTableRelationship}
- * @see {@link JoinTableRelationshipStrategy}
- * @see {@link ManyToOneJoiningStrategyPane}
- * @see {@link ManyToManyJoiningStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class JoinTableJoiningStrategyPane
- extends AbstractJoiningStrategyPane
- <ReadOnlyJoinTableRelationship, ReadOnlyJoinTableRelationshipStrategy>
-{
- public JoinTableJoiningStrategyPane(
- Pane<? extends ReadOnlyJoinTableRelationship> parentPane,
- Composite parent) {
- super(parentPane, parent);
- }
-
- public JoinTableJoiningStrategyPane(Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyJoinTableRelationship> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected Composite buildStrategyDetailsComposite(Composite parent) {
- return new JoinTableComposite(this, buildJoinTableHolder(), parent).getControl();
- }
-
- @Override
- protected ModifiablePropertyValueModel<Boolean> buildUsesStrategyHolder() {
- return buildUsesJoinTableJoiningStrategyHolder(getSubjectHolder());
- }
-
- protected PropertyValueModel<ReadOnlyJoinTableRelationshipStrategy> buildJoinTableJoiningStrategyHolder() {
- return new PropertyAspectAdapter
- <ReadOnlyJoinTableRelationship, ReadOnlyJoinTableRelationshipStrategy>(
- getSubjectHolder()) {
- @Override
- protected ReadOnlyJoinTableRelationshipStrategy buildValue_() {
- return this.subject.getJoinTableStrategy();
- }
- };
- }
-
- protected PropertyValueModel<ReadOnlyJoinTable> buildJoinTableHolder() {
- return new PropertyAspectAdapter<ReadOnlyJoinTableRelationshipStrategy, ReadOnlyJoinTable>(
- this.buildJoinTableJoiningStrategyHolder(), ReadOnlyJoinTableRelationshipStrategy.JOIN_TABLE_PROPERTY) {
- @Override
- protected ReadOnlyJoinTable buildValue_() {
- return this.subject.getJoinTable();
- }
- };
- }
-
- public static ModifiablePropertyValueModel<Boolean> buildUsesJoinTableJoiningStrategyHolder(PropertyValueModel<? extends ReadOnlyJoinTableRelationship> subjectHolder) {
- return new PropertyAspectAdapter<ReadOnlyJoinTableRelationship, Boolean>(
- subjectHolder, ReadOnlyRelationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.buildBooleanValue());
- }
-
- protected boolean buildBooleanValue() {
- return (this.subject != null) && this.subject.strategyIsJoinTable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- ((JoinTableRelationship) this.subject).setStrategyToJoinTable();
- }
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsComposite.java
deleted file mode 100644
index d1a758dc6b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsComposite.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.ReadOnlyWritablePropertyValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ValueListAdapter;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinColumnsComposite.JoinColumnsEditor;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * ---------------------------------------------------------------------
- * | |
- * | JoinColumnsComposite |
- * | |
- * ---------------------------------------------------------------------
- * -------------------------------------------------------------------------</pre>
- *
- * @see JoinColumnRelationship
- * @see JoinColumnRelationshipStrategy
- * @see JoinColumnJoiningStrategyPane
- * @see JoinColumnInJoiningStrategyDialog
- *
- * @version 3.0
- * @since 2.0
- */
-public class JoiningStrategyJoinColumnsComposite
- extends Pane<ReadOnlyJoinColumnRelationshipStrategy>
-{
-
- private JoinColumnsComposite<ReadOnlyJoinColumnRelationshipStrategy> joinColumnsComposite;
-
- public JoiningStrategyJoinColumnsComposite(
- Pane<?> parentPane,
- PropertyValueModel<ReadOnlyJoinColumnRelationshipStrategy> subjectHolder,
- Composite parent) {
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.joinColumnsComposite = new JoinColumnsComposite<ReadOnlyJoinColumnRelationshipStrategy>(this, container, buildJoinColumnsProvider());
- this.joinColumnsComposite.installJoinColumnsPaneEnabler(new JoinColumnPaneEnablerHolder());
- }
-
- private JoinColumnsEditor<ReadOnlyJoinColumnRelationshipStrategy> buildJoinColumnsProvider() {
- return new JoinColumnsEditor<ReadOnlyJoinColumnRelationshipStrategy>() {
-
- public void addJoinColumn(ReadOnlyJoinColumnRelationshipStrategy subject) {
- JoiningStrategyJoinColumnsComposite.this.addJoinColumn(subject);
- }
-
- public boolean hasSpecifiedJoinColumns(ReadOnlyJoinColumnRelationshipStrategy subject) {
- return subject.hasSpecifiedJoinColumns();
- }
-
- public void editJoinColumn(ReadOnlyJoinColumnRelationshipStrategy subject, ReadOnlyJoinColumn joinColumn) {
- JoiningStrategyJoinColumnsComposite.this.editJoinColumn(subject, joinColumn);
- }
-
- public ReadOnlyJoinColumn getDefaultJoinColumn(ReadOnlyJoinColumnRelationshipStrategy subject) {
- return subject.getDefaultJoinColumn();
- }
-
- public String getDefaultPropertyName() {
- return ReadOnlyJoinColumnRelationshipStrategy.DEFAULT_JOIN_COLUMN_PROPERTY;
- }
-
- public String getSpecifiedJoinColumnsListPropertyName() {
- return ReadOnlyJoinColumnRelationshipStrategy.SPECIFIED_JOIN_COLUMNS_LIST;
- }
-
- public void removeJoinColumns(ReadOnlyJoinColumnRelationshipStrategy subject, int[] selectedIndices) {
- for (int index = selectedIndices.length; --index >= 0; ) {
- ((JoinColumnRelationshipStrategy) subject).removeSpecifiedJoinColumn(selectedIndices[index]);
- }
- }
-
- public ListIterable<ReadOnlyJoinColumn> getSpecifiedJoinColumns(ReadOnlyJoinColumnRelationshipStrategy subject) {
- return new SuperListIterableWrapper<ReadOnlyJoinColumn>(subject.getSpecifiedJoinColumns());
- }
-
- public int getSpecifiedJoinColumnsSize(ReadOnlyJoinColumnRelationshipStrategy subject) {
- return subject.getSpecifiedJoinColumnsSize();
- }
- };
- }
-
- void addJoinColumn(ReadOnlyJoinColumnRelationshipStrategy joiningStrategy) {
- JoinColumnInJoiningStrategyDialog dialog =
- new JoinColumnInJoiningStrategyDialog(getShell(), joiningStrategy, null);
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- addJoinColumn(dialog.getSubject());
- }
- }
-
- void addJoinColumn(JoinColumnInJoiningStrategyStateObject stateObject) {
- JoinColumnRelationshipStrategy subject = (JoinColumnRelationshipStrategy) getSubject();
- JoinColumn joinColumn = subject.addSpecifiedJoinColumn();
- stateObject.updateJoinColumn(joinColumn);
- this.setSelectedJoinColumn(joinColumn);
- }
-
- public void setSelectedJoinColumn(JoinColumn joinColumn) {
- this.joinColumnsComposite.setSelectedJoinColumn(joinColumn);
- }
-
- void editJoinColumn(ReadOnlyJoinColumnRelationshipStrategy joiningStrategy, ReadOnlyJoinColumn joinColumn) {
- JoinColumnInJoiningStrategyDialog dialog =
- new JoinColumnInJoiningStrategyDialog(getShell(), joiningStrategy, joinColumn);
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- updateJoinColumn(dialog.getSubject());
- }
- }
-
- void updateJoinColumn(JoinColumnInJoiningStrategyStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- /* CU private */ class JoinColumnPaneEnablerHolder
- extends TransformationPropertyValueModel<ReadOnlyJoinColumnRelationshipStrategy, Boolean>
- {
- private StateChangeListener stateChangeListener;
-
- JoinColumnPaneEnablerHolder() {
- super(
- new ValueListAdapter<ReadOnlyJoinColumnRelationshipStrategy>(
- new ReadOnlyWritablePropertyValueModelWrapper<ReadOnlyJoinColumnRelationshipStrategy>(getSubjectHolder()),
- ReadOnlyJoinColumnRelationshipStrategy.SPECIFIED_JOIN_COLUMNS_LIST
- )
- );
- this.stateChangeListener = this.buildStateChangeListener();
- }
-
-
- private StateChangeListener buildStateChangeListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- JoinColumnPaneEnablerHolder.this.valueStateChanged();
- }
- };
- }
-
- void valueStateChanged() {
- Object old = this.value;
- this.value = this.transform(this.valueModel.getValue());
- this.firePropertyChanged(VALUE, old, this.value);
- }
-
- @Override
- protected Boolean transform(ReadOnlyJoinColumnRelationshipStrategy v) {
- return (v == null) ? Boolean.FALSE : super.transform(v);
- }
-
- @Override
- protected Boolean transform_(ReadOnlyJoinColumnRelationshipStrategy v) {
- boolean virtual = v.getRelationship().isVirtual();
- return Boolean.valueOf(! virtual && v.getSpecifiedJoinColumnsSize() > 0);
- }
-
- @Override
- protected void engageModel() {
- super.engageModel();
- this.valueModel.addStateChangeListener(this.stateChangeListener);
- }
-
- @Override
- protected void disengageModel() {
- this.valueModel.removeStateChangeListener(this.stateChangeListener);
- super.disengageModel();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsWithOverrideOptionComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsWithOverrideOptionComposite.java
deleted file mode 100644
index 78be6ca6b3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JoiningStrategyJoinColumnsWithOverrideOptionComposite.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationshipStrategy;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -------------------------------------------------------------------------
- * x Override Default
- * ---------------------------------------------------------------------
- * | |
- * | JoiningStrategyJoinColumnsComposite |
- * | |
- * ---------------------------------------------------------------------
- * -------------------------------------------------------------------------</pre>
- *
- * @see JoinColumnRelationship
- * @see JoinColumnRelationshipStrategy
- * @see JoinColumnJoiningStrategyPane
- * @see JoinColumnInJoiningStrategyDialog
- *
- * @version 3.0
- * @since 2.0
- */
-public class JoiningStrategyJoinColumnsWithOverrideOptionComposite
- extends Pane<ReadOnlyJoinColumnRelationshipStrategy>
-{
-
- private JoiningStrategyJoinColumnsComposite joiningStrategyComposite;
-
- public JoiningStrategyJoinColumnsWithOverrideOptionComposite(
- Pane<?> parentPane,
- PropertyValueModel<ReadOnlyJoinColumnRelationshipStrategy> subjectHolder,
- Composite parent) {
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- // Override Default Join Columns check box
- addCheckBox(
- addSubPane(container, 8),
- JptUiDetailsMessages.JoiningStrategyJoinColumnsComposite_overrideDefaultJoinColumns,
- buildOverrideDefaultJoinColumnHolder(),
- null
- );
-
- this.joiningStrategyComposite = new JoiningStrategyJoinColumnsComposite(this, getSubjectHolder(), container);
- }
-
- void setSelectedJoinColumn(JoinColumn joinColumn) {
- this.joiningStrategyComposite.setSelectedJoinColumn(joinColumn);
- }
-
- private ModifiablePropertyValueModel<Boolean> buildOverrideDefaultJoinColumnHolder() {
- return new OverrideDefaultJoinColumnHolder();
- }
-
- ListValueModel<ReadOnlyJoinColumn> buildSpecifiedJoinColumnsListHolder() {
- return new ListAspectAdapter<ReadOnlyJoinColumnRelationshipStrategy, ReadOnlyJoinColumn>(
- getSubjectHolder(), ReadOnlyJoinColumnRelationshipStrategy.SPECIFIED_JOIN_COLUMNS_LIST) {
- @Override
- protected ListIterable<ReadOnlyJoinColumn> getListIterable() {
- return new SuperListIterableWrapper<ReadOnlyJoinColumn>(this.subject.getSpecifiedJoinColumns());
- }
-
- @Override
- protected int size_() {
- return this.subject.getSpecifiedJoinColumnsSize();
- }
- };
- }
-
- private class OverrideDefaultJoinColumnHolder
- extends ListPropertyValueModelAdapter<Boolean>
- implements ModifiablePropertyValueModel<Boolean>
- {
- public OverrideDefaultJoinColumnHolder() {
- super(buildSpecifiedJoinColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.listModel.size() > 0);
- }
-
- public void setValue(Boolean value) {
- updateJoinColumns(value.booleanValue());
- }
-
- private void updateJoinColumns(boolean selected) {
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- JoinColumnRelationshipStrategy subject = (JoinColumnRelationshipStrategy) getSubject();
-
- // Add a join column by creating a specified one using the default
- // one if it exists
- if (selected) {
- ReadOnlyJoinColumn defaultJoinColumn = subject.getDefaultJoinColumn();//TODO could be null, disable override default check box?
-
- if (defaultJoinColumn != null) {
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- JoinColumn joinColumn = subject.addSpecifiedJoinColumn();
- joinColumn.setSpecifiedName(columnName);
- joinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
-
- JoiningStrategyJoinColumnsWithOverrideOptionComposite.this.setSelectedJoinColumn(joinColumn);
- }
- }
- // Remove all the specified join columns
- else {
- for (int index = subject.getSpecifiedJoinColumnsSize(); --index >= 0; ) {
- subject.removeSpecifiedJoinColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JptUiDetailsMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JptUiDetailsMessages.java
deleted file mode 100644
index 2cdce44f95..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/JptUiDetailsMessages.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali mapping panes.
- *
- * @version 2.3
- * @since 1.0
- */
-public class JptUiDetailsMessages {
-
- public static String AccessTypeCombo_default;
- public static String AddQueryDialog_name;
- public static String AddQueryDialog_queryType;
- public static String AddQueryDialog_title;
- public static String AddQueryDialog_descriptionTitle;
- public static String AddQueryDialog_description;
- public static String AddQueryDialog_nameExists;
- public static String AddQueryDialog_namedQuery;
- public static String AddQueryDialog_namedNativeQuery;
- public static String QueryStateObject_nameMustBeSpecified;
- public static String QueryStateObject_typeMustBeSpecified;
- public static String NamedQueryComposite_nameTextLabel;
-
- public static String OverridesComposite_attributeOverridesGroup;
- public static String OverridesComposite_attributeOverridesSection;
- public static String OverridesComposite_overrideDefault;
-
- public static String BasicSection_title;
- public static String EmbeddableSection_title;
- public static String EmbeddedSection_title;
- public static String EmbeddedIdSection_title;
- public static String EntitySection_title;
- public static String IdSection_title;
- public static String ManyToManySection_title;
- public static String ManyToOneSection_title;
- public static String MappedSuperclassSection_title;
- public static String OneToManySection_title;
- public static String OneToOneSection_title;
- public static String VersionSection_title;
-
- public static String BasicGeneralSection_enumeratedLabel;
- public static String BasicGeneralSection_fetchLabel;
- public static String BasicGeneralSection_lobLabel;
- public static String BasicGeneralSection_name;
- public static String BasicGeneralSection_nameDefault;
- public static String BasicGeneralSection_optionalLabel;
- public static String BasicGeneralSection_optionalLabelDefault;
- public static String BasicGeneralSection_temporalLabel;
- public static String TypeSection_type;
- public static String TypeSection_default;
- public static String TypeSection_lob;
- public static String TypeSection_temporal;
- public static String TypeSection_enumerated;
- public static String CascadeComposite_all;
- public static String CascadeComposite_cascadeTitle;
- public static String CascadeComposite_merge;
- public static String CascadeComposite_persist;
- public static String CascadeComposite_refresh;
- public static String CascadeComposite_remove;
- public static String CatalogChooser_label;
- public static String ColumnComposite_columnDefinition;
- public static String ColumnComposite_columnSection;
- public static String ColumnComposite_details;
- public static String ColumnComposite_insertable;
- public static String ColumnComposite_insertableWithDefault;
- public static String ColumnComposite_length;
- public static String ColumnComposite_name;
- public static String ColumnComposite_nullable;
- public static String ColumnComposite_nullableWithDefault;
- public static String ColumnComposite_precision;
- public static String ColumnComposite_scale;
- public static String ColumnComposite_table;
- public static String ColumnComposite_unique;
- public static String ColumnComposite_uniqueWithDefault;
- public static String ColumnComposite_updatable;
- public static String ColumnComposite_updatableWithDefault;
- public static String ProviderDefault;
- public static String DiscriminatorColumnComposite_discriminatorType;
- public static String DiscriminatorColumnComposite_name;
- public static String DiscriminatorColumnComposite_char;
- public static String DiscriminatorColumnComposite_integer;
- public static String DiscriminatorColumnComposite_string;
- public static String EntityComposite_inheritance;
- public static String EntityComposite_queries;
- public static String EntityComposite_tableDefault;
- public static String EntityComposite_tableNoDefaultSpecified;
- public static String EntityGeneralSection_name;
- public static String EntityNameComposite_name;
- public static String EnumTypeComposite_ordinal;
- public static String EnumTypeComposite_string;
- public static String FetchTypeComposite_eager;
- public static String FetchTypeComposite_lazy;
- public static String GeneratedValueComposite_auto;
- public static String GeneratedValueComposite_generatedValue;
- public static String GeneratedValueComposite_generatorName;
- public static String GeneratedValueComposite_identity;
- public static String GeneratedValueComposite_sequence;
- public static String GeneratedValueComposite_strategy;
- public static String GeneratedValueComposite_table;
- public static String GeneratorComposite_allocationSize;
- public static String GeneratorComposite_initialValue;
- public static String GeneratorsComposite_sequenceGeneratorCheckBox;
- public static String GeneratorsComposite_sequenceGeneratorSection;
- public static String GeneratorsComposite_tableGeneratorCheckBox;
- public static String GeneratorsComposite_tableGeneratorSection;
- public static String IdClassComposite_label;
- public static String IdMappingComposite_pk_generation;
- public static String IdMappingComposite_primaryKeyGenerationCheckBox;
- public static String IdMappingComposite_primaryKeyGenerationSection;
- public static String IdMappingComposite_sequenceGeneratorCheckBox;
- public static String IdMappingComposite_sequenceGeneratorSection;
- public static String IdMappingComposite_tableGeneratorCheckBox;
- public static String IdMappingComposite_tableGeneratorSection;
- public static String InheritanceComposite_detailsGroupBox;
- public static String InheritanceComposite_discriminatorColumnGroupBox;
- public static String InheritanceComposite_discriminatorValue;
- public static String AbstractInheritanceComposite_joined;
- public static String AbstractInheritanceComposite_single_table;
- public static String InheritanceComposite_strategy;
- public static String AbstractInheritanceComposite_table_per_class;
- public static String InverseJoinColumnDialog_editInverseJoinColumnTitle;
- public static String Joining_title;
- public static String Joining_mappedByLabel;
- public static String Joining_mappedByAttributeLabel;
- public static String Joining_joinColumnJoiningLabel;
- public static String Joining_primaryKeyJoinColumnJoiningLabel;
- public static String Joining_joinTableJoiningLabel;
- public static String JoinColumnsComposite_edit;
- public static String JoinColumnsComposite_mappingBetweenTwoParams;
- public static String JoinColumnsComposite_mappingBetweenTwoParamsBothDefault;
- public static String JoinColumnsComposite_mappingBetweenTwoParamsDefault;
- public static String JoinColumnsComposite_mappingBetweenTwoParamsFirstDefault;
- public static String JoinColumnsComposite_mappingBetweenTwoParamsSecDefault;
- public static String JoiningStrategyJoinColumnsComposite_overrideDefaultJoinColumns;
- public static String JoinColumnDialog_addJoinColumnDescriptionTitle;
- public static String JoinColumnDialog_addJoinColumnTitle;
- public static String JoinColumnDialog_description;
- public static String JoinColumnDialog_editJoinColumnDescriptionTitle;
- public static String JoinColumnDialog_editJoinColumnTitle;
- public static String JoinColumnDialog_name;
- public static String JoinColumnDialog_referencedColumnName;
- public static String JoinColumnDialogPane_columnDefinition;
- public static String JoinColumnDialogPane_insertable;
- public static String JoinColumnDialogPane_insertableWithDefault;
- public static String JoinColumnDialogPane_nullable;
- public static String JoinColumnDialogPane_nullableWithDefault;
- public static String JoinColumnDialogPane_table;
- public static String JoinColumnDialogPane_unique;
- public static String JoinColumnDialogPane_uniqueWithDefault;
- public static String JoinColumnDialogPane_updatable;
- public static String JoinColumnDialogPane_updatableWithDefault;
- public static String JoinTableComposite_inverseJoinColumn;
- public static String JoinTableComposite_joinColumn;
- public static String JoinTableComposite_name;
- public static String JoinTableComposite_schema;
- public static String JoinTableComposite_catalog;
- public static String JoinTableComposite_overrideDefaultInverseJoinColumns;
- public static String JoinTableComposite_overrideDefaultJoinColumns;
- public static String MappedSuperclassComposite_queries;
-
- public static String DefaultBasicMappingUiProvider_label;
- public static String DefaultEmbeddedMappingUiProvider_label;
- public static String BasicMappingUiProvider_label;
- public static String EmbeddedIdMappingUiProvider_label;
- public static String EmbeddedMappingUiProvider_label;
- public static String IdMappingUiProvider_label;
- public static String ManyToManyMappingUiProvider_label;
- public static String ManyToOneMappingUiProvider_label;
- public static String OneToManyMappingUiProvider_label;
- public static String OneToOneMappingUiProvider_label;
- public static String TransientMappingUiProvider_label;
- public static String VersionMappingUiProvider_label;
- public static String DefaultBasicMappingUiProvider_linkLabel;
- public static String DefaultEmbeddedMappingUiProvider_linkLabel;
- public static String BasicMappingUiProvider_linkLabel;
- public static String EmbeddedIdMappingUiProvider_linkLabel;
- public static String EmbeddedMappingUiProvider_linkLabel;
- public static String IdMappingUiProvider_linkLabel;
- public static String ManyToManyMappingUiProvider_linkLabel;
- public static String ManyToOneMappingUiProvider_linkLabel;
- public static String OneToManyMappingUiProvider_linkLabel;
- public static String OneToOneMappingUiProvider_linkLabel;
- public static String TransientMappingUiProvider_linkLabel;
- public static String VersionMappingUiProvider_linkLabel;
-
- public static String MapAsComposite_changeMappingType;
- public static String MapAsComposite_default;
- public static String MapAsComposite_dialogTitle;
- public static String MapAsComposite_labelText;
- public static String MapAsComposite_mappedAttributeText;
- public static String MapAsComposite_mappedTypeText;
- public static String MapAsComposite_unmappedAttributeText;
- public static String MapAsComposite_unmappedTypeText;
- public static String MapAsComposite_virtualAttributeText;
-
- public static String EmbeddableUiProvider_label;
- public static String EntityUiProvider_label;
- public static String MappedSuperclassUiProvider_label;
- public static String EmbeddableUiProvider_linkLabel;
- public static String EntityUiProvider_linkLabel;
- public static String MappedSuperclassUiProvider_linkLabel;
-
- public static String NullTypeMappingUiProvider_label;
-
- public static String MetaDataCompleteCombo_Default;
- public static String MultiRelationshipMappingComposite_cascadeType;
- public static String MultiRelationshipMappingComposite_fetchType;
- public static String MultiRelationshipMappingComposite_general;
- public static String MultiRelationshipMappingComposite_joinTable;
- public static String MultiRelationshipMappingComposite_mappedBy;
- public static String MultiRelationshipMappingComposite_targetEntity;
- public static String NamedNativeQueryPropertyComposite_query;
- public static String NamedNativeQueryPropertyComposite_queryHintsGroupBox;
- public static String NamedNativeQueryPropertyComposite_resultClass;
- public static String NamedQueryPropertyComposite_query;
- public static String NamedQueryPropertyComposite_queryHintsGroupBox;
- public static String NoNameSet;
- public static String NullAttributeMappingUiProvider_label;
- public static String OptionalComposite_false;
- public static String OptionalComposite_true;
- public static String OrderingComposite_custom;
- public static String OrderingComposite_none;
- public static String OrderingComposite_orderingGroup;
- public static String OrderingComposite_primaryKey;
- public static String OrmSecondaryTablesComposite_defineInXml;
- public static String OverridesComposite_association;
- public static String OverridesComposite_attribute;
- public static String AssociationOverridesComposite_joinColumn;
- public static String OverridesComposite_noName;
- public static String PrimaryKeyJoinColumnDialog_addDescriptionTitle;
- public static String PrimaryKeyJoinColumnDialog_addTitle;
- public static String PrimaryKeyJoinColumnDialog_editDescriptionTitle;
- public static String PrimaryKeyJoinColumnDialog_editTitle;
- public static String PrimaryKeyJoinColumnInSecondaryTableDialog_addDescriptionTitle;
- public static String PrimaryKeyJoinColumnInSecondaryTableDialog_addTitle;
- public static String PrimaryKeyJoinColumnInSecondaryTableDialog_editDescriptionTitle;
- public static String PrimaryKeyJoinColumnInSecondaryTableDialog_editTitle;
- public static String PrimaryKeyJoinColumnsComposite_edit;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault;
- public static String PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault;
- public static String PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns;
- public static String PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn;
- public static String QueriesComposite_displayString;
- public static String QueryHintsComposite_nameColumn;
- public static String QueryHintsComposite_valueColumn;
- public static String SchemaChooser_label;
- public static String SecondaryTableDialog_addSecondaryTable;
- public static String SecondaryTableDialog_catalog;
- public static String SecondaryTableDialog_defaultCatalog;
- public static String SecondaryTableDialog_defaultSchema;
- public static String SecondaryTableDialog_editSecondaryTable;
- public static String SecondaryTableDialog_name;
- public static String SecondaryTableDialog_schema;
- public static String SecondaryTablesComposite_edit;
- public static String SecondaryTablesComposite_secondaryTables;
- public static String SequenceGeneratorComposite_catalog;
- public static String SequenceGeneratorComposite_default;
- public static String SequenceGeneratorComposite_name;
- public static String SequenceGeneratorComposite_schema;
- public static String SequenceGeneratorComposite_sequence;
- public static String SequenceGeneratorComposite_sequenceGenerator;
- public static String TableChooser_label;
- public static String TableComposite_tableSection;
- public static String TableGeneratorComposite_catalog;
- public static String TableGeneratorComposite_default;
- public static String TableGeneratorComposite_name;
- public static String TableGeneratorComposite_pkColumn;
- public static String TableGeneratorComposite_pkColumnValue;
- public static String TableGeneratorComposite_schema;
- public static String TableGeneratorComposite_table;
- public static String TableGeneratorComposite_tableGenerator;
- public static String TableGeneratorComposite_valueColumn;
- public static String TargetEntityChooser_browse;
- public static String TargetEntityChooser_label;
- public static String TargetEntityChooser_selectTypeTitle;
- public static String TemporalTypeComposite_date;
- public static String TemporalTypeComposite_time;
- public static String TemporalTypeComposite_timestamp;
-
- private static final String BUNDLE_NAME = "jpt_ui_details"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptUiDetailsMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptUiDetailsMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyJoiningStrategyPane.java
deleted file mode 100644
index 2375cd2a32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyJoiningStrategyPane.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationship;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationship;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Joining Strategy ------------------------------------------------------ |
- * | | | |
- * | | o MappedByJoiningStrategyPane _______________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | o JoinTableStrategyPane _____________________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link ManyToManyRelationship}
- * @see {@link ManyToManyMappingComposite}
- * @see {@link MappedByStrategyPane}
- * @see {@link JoinTableStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class ManyToManyJoiningStrategyPane
- extends Pane<ManyToManyRelationship>
-{
- public ManyToManyJoiningStrategyPane(
- Pane<?> parentPane,
- PropertyValueModel<? extends ManyToManyRelationship> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages.Joining_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_mappedByLabel,
- MappedByJoiningStrategyPane.buildUsesMappedByJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new MappedByJoiningStrategyPane(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinTableJoiningLabel,
- JoinTableJoiningStrategyPane.buildUsesJoinTableJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new JoinTableJoiningStrategyPane(this, composite);
-
- addSubPane(composite, 5);
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildUsesMappedByStrategyHolder() {
- return new PropertyAspectAdapter<MappedByRelationship, Boolean>(
- this.getSubjectHolder(), ReadOnlyRelationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE :
- Boolean.valueOf(this.subject.strategyIsMappedBy());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setStrategyToMappedBy();
- }
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildUsesJoinTableStrategyHolder() {
- return new PropertyAspectAdapter<JoinTableRelationship, Boolean>(
- this.getSubjectHolder(), ReadOnlyRelationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE :
- Boolean.valueOf(this.subject.strategyIsJoinTable());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setStrategyToJoinTable();
- }
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyMappingComposite.java
deleted file mode 100644
index a2ffd3aa2f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToManyMappingComposite.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToManyJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link CascadeComposite}
- * @see {@link OrderingComposite}
- *
- * @version 2.3
- * @since 1.0
- */
-public class ManyToManyMappingComposite
- extends AbstractManyToManyMappingComposite<ManyToManyMapping, ManyToManyRelationship>
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public ManyToManyMappingComposite(PropertyValueModel<? extends ManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToOneJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToOneJoiningStrategyPane.java
deleted file mode 100644
index dfc728863f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToOneJoiningStrategyPane.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToOneRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Joining Strategy ------------------------------------------------------ |
- * | | | |
- * | | o JoinColumnStrategyPane ____________________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link ManyToOneRelationship}
- * @see {@link ManyToOneMappingComposite}
- * @see {@link JoinColumnStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class ManyToOneJoiningStrategyPane extends Pane<ManyToOneRelationship>
-{
- public ManyToOneJoiningStrategyPane(
- Pane<?> parentPane,
- PropertyValueModel<? extends ManyToOneRelationship> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages.Joining_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinColumnJoiningLabel,
- JoinColumnJoiningStrategyPane.buildUsesJoinColumnJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- JoinColumnJoiningStrategyPane.
- buildJoinColumnJoiningStrategyPaneWithIncludeOverrideCheckBox(this, composite);
-
- addSubPane(composite, 5);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToOneMappingComposite.java
deleted file mode 100644
index 903149fe3d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ManyToOneMappingComposite.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToOneJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link OptionalComposite}
- * @see {@link CascadeComposite}
- *
- * @version 2.3
- * @since 1.0
- */
-public class ManyToOneMappingComposite
- extends AbstractManyToOneMappingComposite<ManyToOneMapping, ManyToOneRelationship>
-{
- /**
- * Creates a new <code>ManyToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public ManyToOneMappingComposite(PropertyValueModel<? extends ManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MapAsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MapAsComposite.java
deleted file mode 100644
index 86fc2fad6d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MapAsComposite.java
+++ /dev/null
@@ -1,626 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Comparator;
-import java.util.Iterator;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.resource.JFaceColors;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.platform.JpaPlatformUiRegistry;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyleRange;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.events.MouseListener;
-import org.eclipse.swt.events.MouseMoveListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Cursor;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
-import com.ibm.icu.text.Collator;
-
-/**
- * This map as composite simply shows a styled text where the name of the
- * mapping and its type are displayed. The mapping type can be clicked on to
- * invoke a dialog in order to change the type.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | Attribute 'name' is mapped as one to one. |
- * | ¯¯¯¯¯¯¯¯¯¯ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class MapAsComposite<T extends JpaNode> extends Pane<T> {
-
- protected boolean dragEvent;
- protected boolean enabled;
- protected Cursor handCursor;
- protected MappingChangeHandler<T> mappingChangeHandler;
- protected int mappingTypeLength;
- protected int mappingTypeStart;
- protected boolean mouseDown;
- protected int nameLength;
- protected int nameStart;
- protected StyledText styledText;
-
- /**
- * The constant ID used to retrieve the dialog settings.
- */
- private static final String DIALOG_SETTINGS = "org.eclipse.jpt.jpa.ui.dialogs.MapAsDialog";
-
- /**
- * Creates a new <code>MapAsComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public MapAsComposite(Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Returns the JPT platform responsble to manage the user interface part of
- * the JPT plug-in.
- *
- * @return The UI platform of the JPT plug-in
- */
- protected JpaPlatformUi getJpaPlatformUi() {
- return (JpaPlatformUi) getSubject().getJpaProject().getJpaPlatform().getAdapter(JpaPlatformUi.class);
- }
-
- /**
- * Creates the default provider responsible for clearing the mapping type.
- * Return null if there is not a default provider
- * @return A provider that acts as a default mapping provider
- */
- protected abstract DefaultMappingUiDefinition getDefaultDefinition();
-
- protected abstract DefaultMappingUiDefinition getDefaultDefinition(String mappingKey);
-
- protected MappingUiDefinition getMappingUiDefinition(String mappingKey) {
- for (MappingUiDefinition<T, ?> provider : CollectionTools.iterable(this.mappingChangeHandler.mappingUiDefinitions())) {
- if (provider.getKey() == mappingKey) {
- return provider;
- }
- }
- return null;
- }
-
- /**
- * Creates the handler responsible to give the information required for
- * completing the behavior of this pane.
- *
- * @return A new <code>MappingChangeHandler</code>
- */
- protected abstract MappingChangeHandler buildMappingChangeHandler();
-
- private MouseListener buildMouseListener() {
- return new MouseListener() {
- public void mouseDoubleClick(MouseEvent e) {
- }
-
- public void mouseDown(MouseEvent e) {
- if (e.button == 1) {
- mouseDown = true;
- }
- }
-
- public void mouseUp(MouseEvent e) {
- mouseDown = false;
- StyledText text = (StyledText) e.widget;
- int offset = text.getCaretOffset();
-
- if (dragEvent) {
- dragEvent = false;
-
- if (isOverLink(offset)) {
- text.setCursor(handCursor);
- }
- }
- else if (isOverLink(offset)) {
- text.setCursor(handCursor);
- openMappingSelectionDialog();
- text.setCursor(null);
- }
- }
- };
- }
-
- private MouseMoveListener buildMouseMoveListener() {
- return new MouseMoveListener() {
- public void mouseMove(MouseEvent e) {
- StyledText text = (StyledText) e.widget;
-
- if (mouseDown) {
- if (!dragEvent) {
- text.setCursor(null);
- }
-
- dragEvent = true;
- return;
- }
-
- int offset = -1;
-
- try {
- offset = text.getOffsetAtLocation(new Point(e.x, e.y));
- }
- catch (IllegalArgumentException ex) {
- }
-
- if (isOverLink(offset)) {
- text.setCursor(handCursor);
- }
- else {
- text.setCursor(null);
- }
- }
- };
- }
-
- /**
- * Creates the full localized string by formatting the label text returned
- * by the <code>MappingChangeHandler</code> with the mapping name and the
- * mapping type.
- *
- * @param name The display string of the mapping being edited
- * @param mappingType The localized message describing the mapping type
- * @return The localized string describing the mapping
- */
- protected String buildText(String name, String mappingType) {
- return NLS.bind(
- mappingChangeHandler.getLabelText(),
- name,
- mappingType
- );
- }
-
- /**
- * Removes any style applied to the styled text.
- */
- protected void clearStyleRange() {
- styledText.setStyleRange(null);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void doPopulate() {
- super.doPopulate();
- updateDescription();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void enableWidgets(boolean enabled) {
- this.enabled = enabled;
- super.enableWidgets(enabled);
-
- if (!styledText.isDisposed()) {
- styledText.setEnabled(enabled);
-
- if (enabled) {
- updateLinkRange();
- }
- else {
- clearStyleRange();
- }
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
-
- super.initialize();
-
- this.enabled = true;
- this.mappingChangeHandler = buildMappingChangeHandler();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- handCursor = getShell().getDisplay().getSystemCursor(SWT.CURSOR_HAND);
-
- styledText = new StyledText(container, SWT.WRAP | SWT.READ_ONLY);
- styledText.addMouseListener(buildMouseListener());
- styledText.addMouseMoveListener(buildMouseMoveListener());
- styledText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- }
-
- /**
- * Retreive the <code>MappingUiDefinition</code> that provides the UI for the
- * current mapping.
- *
- * @return The <code>MappingUiProvider</code> representing the type of the
- * mapping being edited
- */
- protected MappingUiDefinition initialSelection() {
-
- for (Iterator<? extends MappingUiDefinition> iter = this.mappingChangeHandler.mappingUiDefinitions(); iter.hasNext(); ) {
- MappingUiDefinition definition = iter.next();
-
- if (getMappingKey() == definition.getKey()) {
- return definition;
- }
- }
-
- return null;
- }
-
- /**
- * Determines whether the given location is within the mapping type range.
- *
- * @param location The mouse location in character coordinate
- * @return <code>true</code> if the mouse is over the mapping type text;
- * <code>false</code> otherwise
- */
- protected boolean isOverLink(int location) {
-
- return (location >= mappingTypeStart &&
- location <= mappingTypeStart + mappingTypeLength);
- }
-
- /**
- * Returns the mapping key representing the current mapping object.
- *
- * @return A non-<code>null</code> unique identifier representing the type
- * of the mapping being edited
- */
- protected abstract String getMappingKey();
-
- /**
- * Aks the <code>MappingChangeHandler</code> to change the mapping type using
- * the given <code>MappingUiDefinition</code>.
- *
- * @param provider The provider used to determine the mapping type used for
- * morphing the mapping being edited
- */
- protected void morphMapping(MappingUiDefinition definition) {
- mappingChangeHandler.morphMapping(definition);
- }
-
- /**
- * Opens the dialog that shows the registered mapping types in order for the
- * user to select a provider in order to change the mapping type of the
- * mapping being edited.
- */
- protected void openMappingSelectionDialog() {
-
- MappingSelectionDialog dialog = new MappingSelectionDialog();
- dialog.setBlockOnOpen(true);
- if (dialog.open() == IDialogConstants.OK_ID) {
- MappingUiDefinition<?,?> definition = (MappingUiDefinition<?,?>) dialog.getFirstResult();
- morphMapping(definition);
- }
- }
-
- /**
- * Updates the description by recreating the label.
- */
- protected void updateDescription() {
- if (getSubject() == null) {
- return;
- }
-
- clearStyleRange();
- updateText();
-
- if (enabled) {
- updateLinkRange();
- }
- }
-
- /**
- * Updates the colors of the text: (1) the name is shown in bold and (2) the
- * mapping type is shown in bold and in hyperlink color.
- */
- protected void updateLinkRange() {
-
- Color linkColor = JFaceColors.getHyperlinkText(getShell().getDisplay());
-
- // Make the name bold
- StyleRange styleRange = new StyleRange(
- nameStart, nameLength,
- null, null,
- SWT.BOLD
- );
- styledText.setStyleRange(styleRange);
-
- // Make the mapping type shown as a hyperlink
- if (mappingTypeStart > -1) {
- styleRange = new StyleRange(
- mappingTypeStart, mappingTypeLength,
- linkColor, null
- );
-
- styleRange.underline = true;
- styleRange.underlineColor = linkColor;
- styleRange.underlineStyle = SWT.UNDERLINE_SINGLE;
- styledText.setStyleRange(styleRange);
- }
- }
-
- /**
- * Updates the styles text's input.
- */
- protected void updateText() {
-
- String name = mappingChangeHandler.getName();
-
- if (name == null) {
- name = JptUiDetailsMessages.NoNameSet;
- }
-
- String mappingType = mappingChangeHandler.getMappingText();
- String text = buildText(name, mappingType);
-
- mappingTypeStart = text.lastIndexOf(mappingType);
- mappingTypeLength = mappingType.length();
-
- nameStart = text.indexOf(name);
- nameLength = name.length();
-
- styledText.setText(text);
- }
-
- @Override
- public void dispose() {
- this.styledText.dispose();
- super.dispose();
- }
-
- /**
- * This handler is responsible to give the text information and to open the
- * mapping dialog if the user clicked on the mapping type.
- */
- protected interface MappingChangeHandler<T> {
-
- /**
- * Returns the entire text describing the mapping (entity or mapping) and
- * its type.
- *
- * @return A localized text with two arguments where the first one should
- * be replaced by the name and the second be replaced by the mapping type
- */
- String getLabelText();
-
- /**
- * Returns the displayable text representing the mapping type.
- *
- * @return A human readable text describing the mapping type
- */
- String getMappingText();
-
- /**
- * Morphes the current mapping into a new type by using the given provider.
- *
- * @param provider The definition that was selected for changing the mapping
- */
- void morphMapping(MappingUiDefinition<T, ?> definition);
-
- /**
- * Returns the name of the current mapping.
- *
- * @return The displayable name of the mapping
- */
- String getName();
-
- /**
- * Returns the list of mapping UI definitions that are registered with the JPT plugin.
- *
- * @return The supported types of mapping
- */
- Iterator<MappingUiDefinition<T, ?>> mappingUiDefinitions();
- }
-
- /**
- * This dialog shows the list of possible mapping types and lets the user
- * the option to filter them using a search field.
- */
- protected class MappingSelectionDialog extends FilteredItemsSelectionDialog
- {
- private MappingUiDefinition<?,?> defaultDefinition;
-
- /**
- * Creates a new <code>MappingSelectionDialog</code>.
- */
- private MappingSelectionDialog() {
- super(MapAsComposite.this.getShell(), false);
- setMessage(JptUiDetailsMessages.MapAsComposite_labelText);
- setTitle(JptUiDetailsMessages.MapAsComposite_dialogTitle);
- setListLabelProvider(buildLabelProvider());
- setDetailsLabelProvider(buildLabelProvider());
- }
-
- private ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
-
- @Override
- public Image getImage(Object element) {
-
- if (element == null) {
- return null;
- }
-
- MappingUiDefinition<?,?> definition = (MappingUiDefinition<?,?>) element;
- return definition.getImage();
- }
-
- @Override
- public String getText(Object element) {
- if (element == null) {
- return "";
- }
-
- MappingUiDefinition<?,?> definition = (MappingUiDefinition<?,?>) element;
- return definition.getLabel();
- }
- };
- }
-
- @Override
- protected Control createExtendedContentArea(Composite parent) {
- return null;
- }
-
- @Override
- protected ItemsFilter createFilter() {
- return new MappingTypeItemsFilter();
- }
-
- @Override
- protected void fillContentProvider(
- AbstractContentProvider provider,
- ItemsFilter itemsFilter,
- IProgressMonitor monitor) throws CoreException {
-
- monitor.beginTask(null, -1);
-
- try {
- // Add the default provider
- defaultDefinition = getDefaultDefinition();
-
- if (defaultDefinition != null) {
- provider.add(defaultDefinition, itemsFilter);
- }
-
- // Add the registered mapping providers to the dialog
- for (Iterator<MappingUiDefinition<T, ?>> iter = mappingChangeHandler.mappingUiDefinitions(); iter.hasNext(); ) {
- MappingUiDefinition mappingDefinition = iter.next();
- if (mappingDefinition.isEnabledFor(getSubject())) {
- provider.add(mappingDefinition, itemsFilter);
- }
- }
- }
- finally {
- monitor.done();
- }
- }
-
- @Override
- protected IDialogSettings getDialogSettings() {
-
- IDialogSettings dialogSettings = JptJpaUiPlugin.instance().getDialogSettings();
- IDialogSettings settings = dialogSettings.getSection(DIALOG_SETTINGS);
-
- if (settings == null) {
- settings = dialogSettings.addNewSection(DIALOG_SETTINGS);
- }
-
- return settings;
- }
-
- @Override
- public String getElementName(Object object) {
- MappingUiDefinition definition = (MappingUiDefinition) object;
- return definition.getLabel();
- }
-
- @Override
- protected Comparator<MappingUiDefinition> getItemsComparator() {
- return new Comparator<MappingUiDefinition>() {
- public int compare(MappingUiDefinition item1, MappingUiDefinition item2) {
-
- if (item1 == defaultDefinition) {
- return -1;
- }
-
- if (item2 == defaultDefinition) {
- return 1;
- }
-
- String displayString1 = item1.getLabel();
- String displayString2 = item2.getLabel();
- return Collator.getInstance().compare(displayString1, displayString2);
- }
- };
- }
-
- @Override
- protected IStatus validateItem(Object item) {
-
- if (item == null) {
- return new Status(IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID, IStatus.ERROR, "", null);
- }
-
- return Status.OK_STATUS;
- }
-
- /**
- * Create the filter responsible to remove any mapping type based on the
- * pattern entered in the text field.
- */
- private class MappingTypeItemsFilter extends ItemsFilter {
-
- /**
- * Creates a new <code>MappingTypeItemsFilter</code>.
- */
- MappingTypeItemsFilter() {
-
- super();
-
- // Make sure that if the pattern is empty, we specify * in order
- // to show all the mapping types
- if (StringTools.stringIsEmpty(getPattern())) {
- patternMatcher.setPattern("*");
- }
- }
-
- @Override
- public boolean isConsistentItem(Object item) {
- return true;
- }
-
- @Override
- public boolean matchItem(Object item) {
- MappingUiDefinition definition = (MappingUiDefinition) item;
- return matches(definition.getLabel());
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByJoiningStrategyPane.java
deleted file mode 100644
index f7eafb7020..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByJoiningStrategyPane.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationship;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | o Mapped by _____________________________________________________________ |
- * | | --------------------------------------------- ---------- | |
- * | | Attribute: | | |Browse..| | |
- * | | --------------------------------------------- ---------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link MappedByRelationship}
- * @see {@link MappedByRelationshipStrategy}
- * @see {@link OneToOneJoiningStrategyPane}
- * @see {@link OneToManyJoiningStrategyPane}
- * @see {@link ManyToManyJoiningStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class MappedByJoiningStrategyPane
- extends AbstractJoiningStrategyPane<MappedByRelationship, MappedByRelationshipStrategy>
-{
- /**
- * Creates a new <code>MappedByJoiningStrategyPane</code>.
- *
- * @param parentPane The parent form pane
- * @param parent The parent container
- */
- public MappedByJoiningStrategyPane(
- Pane<? extends MappedByRelationship> parentPane,
- Composite parent) {
- super(parentPane, parent);
- }
-
- @Override
- protected Composite buildStrategyDetailsComposite(Composite parent) {
- return new MappedByPane(this, this.buildMappedByJoiningStrategyHolder(), parent).getControl();
- }
-
- @Override
- protected ModifiablePropertyValueModel<Boolean> buildUsesStrategyHolder() {
- return buildUsesMappedByJoiningStrategyHolder(getSubjectHolder());
- }
-
- protected PropertyValueModel<MappedByRelationshipStrategy> buildMappedByJoiningStrategyHolder() {
- return new PropertyAspectAdapter<MappedByRelationship, MappedByRelationshipStrategy>(
- getSubjectHolder()) {
- @Override
- protected MappedByRelationshipStrategy buildValue_() {
- return this.subject.getMappedByStrategy();
- }
- };
- }
-
- public static ModifiablePropertyValueModel<Boolean> buildUsesMappedByJoiningStrategyHolder(PropertyValueModel<? extends MappedByRelationship> subjectHolder) {
- return new PropertyAspectAdapter<MappedByRelationship, Boolean>(
- subjectHolder, ReadOnlyRelationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE :
- Boolean.valueOf(this.subject.strategyIsMappedBy());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setStrategyToMappedBy();
- }
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByPane.java
deleted file mode 100644
index 0ca99971ea..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/MappedByPane.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.core.internal.utility.ICUStringCollator;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Mapped By: | |v| |
- * | -------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see ManyToManyMappingComposite - A container of this pane
- * @see OneToManyMappingComposite - A container of this pane
- * @see OneToOneMappingComposite - A container of this pane
- *
- * @version 2.0
- * @since 1.0
- */
-public class MappedByPane
- extends Pane<MappedByRelationshipStrategy>
-{
- /**
- * Creates a new <code>MappedByPane</code>.
- *
- * @param parentPane The parent form pane
- * @param subjectHolder The PVM for the {@link MappedByRelationshipStrategy}
- * @param parent The parent container
- */
- public MappedByPane(
- Pane<?> parentPane,
- PropertyValueModel<MappedByRelationshipStrategy> subjectHolder,
- Composite parent) {
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- addLabeledEditableCombo(
- container,
- JptUiDetailsMessages.Joining_mappedByAttributeLabel,
- buildCandidateAttributesListValueModel(),
- buildAttributePropertyValueModel(),
- JpaHelpContextIds.MAPPING_MAPPED_BY);
- }
-
- protected ListValueModel<String> buildCandidateAttributesListValueModel() {
- return new SortedListValueModelAdapter<String>(
- new CollectionAspectAdapter<MappedByRelationshipStrategy, String>(
- getSubjectHolder()) {
- @Override
- protected Iterable<String> getIterable() {
- return this.subject.getCandidateMappedByAttributeNames();
- }
- },
- new ICUStringCollator()
- );
- }
-
- protected ModifiablePropertyValueModel<String> buildAttributePropertyValueModel() {
- return new PropertyAspectAdapter<MappedByRelationshipStrategy, String>(
- getSubjectHolder(), MappedByRelationshipStrategy.MAPPED_BY_ATTRIBUTE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getMappedByAttribute();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setMappedByAttribute(value);
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/NamedNativeQueryPropertyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/NamedNativeQueryPropertyComposite.java
deleted file mode 100644
index 6730b90537..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/NamedNativeQueryPropertyComposite.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.NamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | --------------------------------------------- ------------- |
- * | Result Class: | I | | Browse... | |
- * | --------------------------------------------- ------------- |
- * | --------------------------------------------- |
- * | Query: | I | |
- * | | | |
- * | | | |
- * | | | |
- * | --------------------------------------------- |
- * | |
- * | - Query Hints ----------------------------------------------------------- |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | QueryHintsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see NamedNativeQuery
- * @see NamedNativeQueriesComposite - The parent container
- * @see ClassChooserPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class NamedNativeQueryPropertyComposite extends Pane<NamedNativeQuery>
-{
- private ClassChooserPane<NamedNativeQuery> resultClassChooserPane;
-
- /**
- * Creates a new <code>NamedNativeQueryPropertyComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public NamedNativeQueryPropertyComposite(Pane<?> parentPane,
- PropertyValueModel<? extends NamedNativeQuery> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- private ClassChooserPane<NamedNativeQuery> addClassChooser(Composite container) {
-
- return new ClassChooserPane<NamedNativeQuery>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<NamedNativeQuery, String>(getSubjectHolder(), NamedNativeQuery.RESULT_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getResultClass();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setResultClass(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getResultClass();
- }
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.NamedNativeQueryPropertyComposite_resultClass;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setResultClass(className);
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getResultClassEnclosingTypeSeparator();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedResultClass();
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildQueryHolder() {
- return new PropertyAspectAdapter<NamedNativeQuery, String>(getSubjectHolder(), Query.QUERY_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getQuery();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setQuery(value);
- }
- };
- }
-
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
- this.resultClassChooserPane.enableWidgets(enabled);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabeledText(
- container,
- JptUiDetailsMessages.NamedQueryComposite_nameTextLabel,
- buildNameTextHolder());
-
- // Result class chooser
- this.resultClassChooserPane = addClassChooser(container);
-
- // Query text area
- addLabeledMultiLineText(
- container,
- JptUiDetailsMessages.NamedNativeQueryPropertyComposite_query,
- buildQueryHolder(),
- 4,
- null
- );
-
- // Query Hints pane
- container = addTitledGroup(
- addSubPane(container, 5),
- JptUiDetailsMessages.NamedNativeQueryPropertyComposite_queryHintsGroupBox
- );
-
- new QueryHintsComposite(this, container);
- }
-
- protected ModifiablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<NamedNativeQuery, String>(
- getSubjectHolder(), Query.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/NamedQueryPropertyComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/NamedQueryPropertyComposite.java
deleted file mode 100644
index e4ce0e52e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/NamedQueryPropertyComposite.java
+++ /dev/null
@@ -1,140 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlContentProposalProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here's the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------ |
- * | Query: | I | |
- * | | | |
- * | | | |
- * | ------------------------------------------------------------------ |
- * | |
- * | - Query Hints ----------------------------------------------------------- |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | QueryHintsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see NamedQuery
- * @see NamedQueriesComposite - The parent container
- * @see QueryHintsComposite
- *
- * @version 2.3
- * @since 2.3
- */
-public class NamedQueryPropertyComposite<T extends NamedQuery> extends Pane<T> {
-
- /**
- * Creates a new <code>NamedQueryPropertyComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public NamedQueryPropertyComposite(Pane<?> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- protected ModifiablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<NamedQuery, String>(
- getSubjectHolder(), Query.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
- protected ModifiablePropertyValueModel<String> buildQueryHolder() {
- return new PropertyAspectAdapter<NamedQuery, String>(getSubjectHolder(), Query.QUERY_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getQuery();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setQuery(value);
- }
- };
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- addLabeledText(
- container,
- JptUiDetailsMessages.NamedQueryComposite_nameTextLabel,
- buildNameTextHolder());
-
- JpaJpqlContentProposalProvider provider = new JpaJpqlContentProposalProvider(
- container,
- getSubjectHolder(),
- buildQueryHolder()
- );
-
- // Query text area
- Composite queryWidgets = this.addLabeledComposite(
- container,
- JptUiDetailsMessages.NamedQueryPropertyComposite_query,
- provider.getStyledText()
- );
-
- // Install the content assist icon at the top left of the StyledText.
- // Note: For some reason, this needs to be done after the StyledText
- // is added to the labeled composite
- provider.installControlDecoration();
-
- adjustMultiLineTextLayout(
- queryWidgets,
- 4,
- provider.getStyledText(),
- provider.getStyledText().getLineHeight()
- );
-
- // Query Hints pane
- container = this.addTitledGroup(
- addSubPane(container, 5),
- JptUiDetailsMessages.NamedQueryPropertyComposite_queryHintsGroupBox
- );
-
- new QueryHintsComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToManyJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToManyJoiningStrategyPane.java
deleted file mode 100644
index c5b3641989..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToManyJoiningStrategyPane.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToManyRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Joining Strategy ------------------------------------------------------ |
- * | | | |
- * | | o MappedByJoiningStrategyPane _______________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | o JoinTableStrategyPane _____________________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link OneToManyMapping}
- * @see {@link OneToManyRelationship}
- * @see {@link OneToManyMappingComposite}
- * @see {@link MappedByStrategyPane}
- * @see {@link JoinTableStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class OneToManyJoiningStrategyPane
- extends Pane<OneToManyRelationship>
-{
- public OneToManyJoiningStrategyPane(
- Pane<?> parentPane,
- PropertyValueModel<? extends OneToManyRelationship> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages.Joining_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_mappedByLabel,
- MappedByJoiningStrategyPane.buildUsesMappedByJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new MappedByJoiningStrategyPane(this, composite);
-
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinTableJoiningLabel,
- JoinTableJoiningStrategyPane.buildUsesJoinTableJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new JoinTableJoiningStrategyPane(this, composite);
-
- addSubPane(composite, 5);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToManyMappingComposite.java
deleted file mode 100644
index de42ebc0b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToManyMappingComposite.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToManyMapping
- * @see CascadeComposite
- * @see FetchTypeComposite
- * @see JoinTableComposite
- * @see OrderingComposite
- * @see TargetEntityComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public class OneToManyMappingComposite
- extends AbstractOneToManyMappingComposite<OneToManyMapping, OneToManyRelationship>
-{
- /**
- * Creates a new <code>OneToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OneToManyMappingComposite(PropertyValueModel<? extends OneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToOneJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToOneJoiningStrategyPane.java
deleted file mode 100644
index f18f0971cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToOneJoiningStrategyPane.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Joining Strategy ------------------------------------------------------ |
- * | | | |
- * | | o MappedByJoiningStrategyPane _______________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | o JoinColumnStrategyPane ____________________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | o PrimaryKeyJoinColumnStrategyPane __________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link OneToOneMapping}
- * @see {@link OneToOneRelationship}
- * @see {@link OneToOneMappingComposite}
- * @see {@link MappedByStrategyPane}
- * @see {@link JoinColumnStrategyPane}
- * @see {@link PrimaryKeyJoinColumnStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class OneToOneJoiningStrategyPane
- extends Pane<OneToOneRelationship>
-{
- public OneToOneJoiningStrategyPane(
- Pane<?> parentPane,
- PropertyValueModel<? extends OneToOneRelationship> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages.Joining_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_mappedByLabel,
- MappedByJoiningStrategyPane.buildUsesMappedByJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new MappedByJoiningStrategyPane(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_primaryKeyJoinColumnJoiningLabel,
- PrimaryKeyJoinColumnJoiningStrategyPane.buildUsesPrimaryKeyJoinColumnJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new PrimaryKeyJoinColumnJoiningStrategyPane(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinColumnJoiningLabel,
- JoinColumnJoiningStrategyPane.buildUsesJoinColumnJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- JoinColumnJoiningStrategyPane.
- buildJoinColumnJoiningStrategyPaneWithIncludeOverrideCheckBox(this, composite);
-
- addSubPane(composite, 5);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToOneMappingComposite.java
deleted file mode 100644
index 128da9596e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OneToOneMappingComposite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToOneMapping
- * @see TargetEntityComposite
- * @see JoiningStrategyComposite
- * @see FetchTypeComposite
- * @see OptionalComposite
- * @see CascadeComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public class OneToOneMappingComposite
- extends AbstractOneToOneMappingComposite<OneToOneMapping, OneToOneRelationship>
-{
- /**
- * Creates a new <code>OneToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OneToOneMappingComposite(PropertyValueModel<? extends OneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OptionalComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OptionalComposite.java
deleted file mode 100644
index ad0d276e37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OptionalComposite.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OptionalMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This composite simply shows a tri-state check box for the Optional option.
- *
- * @see BasicMapping
- * @see BasicMappingComposite - A container of this pane
- * @see ManyToOneMappingComposite - A container of this pane
- * @see OneToOneMappingComposite - A container of this pane
- *
- * @version 1.0
- * @since 2.0
- */
-public class OptionalComposite extends Pane<OptionalMapping>
-{
- /**
- * Creates a new <code>OptionalComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OptionalComposite(Pane<? extends OptionalMapping> parentPane,
- Composite parent)
- {
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addTriStateCheckBoxWithDefault(
- addSubPane(container, 4),
- JptUiDetailsMessages.BasicGeneralSection_optionalLabel,
- buildOptionalHolder(),
- buildOptionalStringHolder(),
- JpaHelpContextIds.MAPPING_OPTIONAL
- );
- }
- private ModifiablePropertyValueModel<Boolean> buildOptionalHolder() {
- return new PropertyAspectAdapter<OptionalMapping, Boolean>(getSubjectHolder(), OptionalMapping.SPECIFIED_OPTIONAL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedOptional();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedOptional(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildOptionalStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultOptionalHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.BasicGeneralSection_optionalLabelDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.BasicGeneralSection_optionalLabel;
- }
- };
- }
-
-
- private PropertyValueModel<Boolean> buildDefaultOptionalHolder() {
- return new PropertyAspectAdapter<OptionalMapping, Boolean>(
- getSubjectHolder(),
- OptionalMapping.SPECIFIED_OPTIONAL_PROPERTY,
- OptionalMapping.DEFAULT_OPTIONAL_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedOptional() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultOptional());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OrderingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OrderingComposite.java
deleted file mode 100644
index 661e8c2ce0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/OrderingComposite.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.CollectionMapping;
-import org.eclipse.jpt.jpa.core.context.Orderable;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Ordering -------------------------------------------------------------- |
- * | | | |
- * | | o None | |
- * | | | |
- * | | o Primary Key | |
- * | | | |
- * | | o Custom | |
- * | | ------------------------------------------------------------------- | |
- * | | | I | | |
- * | | ------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see CollectionMapping
- * @see ManyToManyMappingComposite - A container of this pane
- * @see OneToManyMappingComposite - A container of this pane
- *
- * @version 3.0
- * @since 1.0
- */
-public class OrderingComposite extends AbstractOrderingComposite
-{
- /**
- * Creates a new <code>OrderingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrderingComposite(Pane<? extends CollectionMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>OrderingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IMultiRelationshipMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrderingComposite(PropertyValueModel<? extends CollectionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- PropertyValueModel<Orderable> orderableHolder = buildOrderableHolder();
-
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.OrderingComposite_orderingGroup
- );
-
- // No Ordering radio button
- addRadioButton(
- container,
- JptUiDetailsMessages.OrderingComposite_none,
- buildNoOrderingHolder(orderableHolder),
- JpaHelpContextIds.MAPPING_ORDER_BY_NO_ORDERING
- );
-
- // Order by Primary Key radio button
- addRadioButton(
- container,
- JptUiDetailsMessages.OrderingComposite_primaryKey,
- buildPrimaryKeyOrderingHolder(orderableHolder),
- JpaHelpContextIds.MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING
- );
-
- // Custom Ordering radio button
- addRadioButton(
- container,
- JptUiDetailsMessages.OrderingComposite_custom,
- buildCustomOrderingHolder(orderableHolder),
- JpaHelpContextIds.MAPPING_ORDER_BY_CUSTOM_ORDERING
- );
-
- // Custom Ordering text field
- addText(
- addSubPane(container, 0, 16),
- buildSpecifiedOrderByHolder(orderableHolder),
- JpaHelpContextIds.MAPPING_ORDER_BY,
- buildCustomOrderingHolder(orderableHolder)
- );
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPage.java
deleted file mode 100644
index bd2e3cdefc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeDetailsPage.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.Tracing;
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.model.value.FilteringPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * The abstract definition of the details page responsible to show the
- * information for an persistent attribute.
- *
- * @see PersistentAttribute
- *
- * @version 2.2
- * @since 1.0
- */
-public abstract class PersistentAttributeDetailsPage<A extends ReadOnlyPersistentAttribute>
- extends AbstractJpaDetailsPage<A>
-{
- private Map<String, JpaComposite> mappingComposites;
- private PageBook mappingPageBook;
-
- private PropertyValueModel<AttributeMapping> mappingHolder;
-
- /**
- * Creates a new <code>PersistentAttributeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected PersistentAttributeDetailsPage(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
-
- @Override
- protected void initialize() {
- super.initialize();
- this.mappingComposites = new HashMap<String, JpaComposite>();
- }
-
- protected PageBook buildMappingPageBook(Composite parent) {
- this.mappingPageBook = new PageBook(parent, SWT.NONE);
- this.mappingPageBook.showPage(this.addLabel(this.mappingPageBook, "")); //$NON-NLS-1$
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.TOP;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
-
- this.mappingPageBook.setLayoutData(gridData);
-
- this.mappingHolder = this.buildMappingHolder();
- new ControlSwitcher(this.mappingHolder, this.buildPaneTransformer(), this.mappingPageBook);
-
- return this.mappingPageBook;
- }
-
- private Transformer<AttributeMapping, Control> buildPaneTransformer() {
- return new Transformer<AttributeMapping, Control>() {
- public Control transform(AttributeMapping attributeMapping) {
- if (attributeMapping == null) {
- return null;
- }
- return getMappingComposite(attributeMapping.getKey()).getControl();
- }
- };
- }
-
- protected JpaComposite getMappingComposite(String key) {
- JpaComposite composite = this.mappingComposites.get(key);
- if (composite != null) {
- return composite;
- }
-
- composite = buildMappingComposite(this.mappingPageBook, key);
-
- if (composite != null) {
- this.mappingComposites.put(key, composite);
- }
-
- return composite;
- }
-
- protected JpaComposite buildMappingComposite(PageBook pageBook, String key) {
- return getJpaPlatformUi().buildAttributeMappingComposite(
- getSubject().getResourceType(),
- key,
- pageBook,
- buildMappingHolder(key),
- getWidgetFactory());
- }
-
- private PropertyValueModel<AttributeMapping> buildMappingHolder(final String key) {
- return new FilteringPropertyValueModel<AttributeMapping>(
- this.mappingHolder,
- buildMappingFilter(key)
- );
- }
-
- private Filter<AttributeMapping> buildMappingFilter(String mappingKey) {
- return new MappingFilter(mappingKey);
- }
-
-
- private ModifiablePropertyValueModel<AttributeMapping> buildMappingHolder() {
- return new PropertyAspectAdapter<A, AttributeMapping>(
- getSubjectHolder(),
- PersistentAttribute.DEFAULT_MAPPING_KEY_PROPERTY,
- PersistentAttribute.MAPPING_PROPERTY)
- {
- @Override
- protected AttributeMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- @Override
- public void dispose() {
- log(Tracing.UI_DETAILS_VIEW, "PersistentAttributeDetailsPage.dispose()"); //$NON-NLS-1$
-
- for (JpaComposite mappingComposite : this.mappingComposites.values()) {
- mappingComposite.dispose();
- }
- this.mappingComposites.clear();
- super.dispose();
- }
-
- @Override
- protected void log(String flag, String message) {
- super.log(flag, message);
-
- if (Tracing.UI_DETAILS_VIEW.equals(flag) &&
- Tracing.booleanDebugOption(Tracing.UI_DETAILS_VIEW))
- {
- Tracing.log(message);
- }
- }
-
- private class MappingFilter implements Filter<AttributeMapping> {
- private String mappingKey;
-
- MappingFilter(String mappingKey) {
- super();
- this.mappingKey = mappingKey;
- }
-
- public boolean accept(AttributeMapping mapping) {
- return (mapping == null || this.mappingKey == null) || this.mappingKey.equals(mapping.getKey());
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeMapAsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeMapAsComposite.java
deleted file mode 100644
index 67ae271ad7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentAttributeMapAsComposite.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.UnsupportedOrmMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This "Map As" composite is responsible for showing the mapping name and
- * mapping type for an attribute.
- *
- * @see JavaPersistentAttributeMapAsComposite
- * @see OrmPersistentAttributeMapAsComposite
- */
-public class PersistentAttributeMapAsComposite
- extends MapAsComposite<ReadOnlyPersistentAttribute>
-{
- /**
- * Creates a new <code>PersistentAttributeMapAsComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public PersistentAttributeMapAsComposite(
- Pane<? extends ReadOnlyPersistentAttribute> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected String getMappingKey() {
- return getSubject().getMappingKey();
- }
-
- @Override
- protected MappingChangeHandler buildMappingChangeHandler() {
- return new MappingChangeHandler() {
-
- public String getLabelText() {
- String mappingKey = getMappingKey();
-
- if (mappingKey != MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY) {
- return JptUiDetailsMessages.MapAsComposite_mappedAttributeText;
- }
- if (getSubject().isVirtual()) {
- return JptUiDetailsMessages.MapAsComposite_virtualAttributeText;
- }
-
- return JptUiDetailsMessages.MapAsComposite_unmappedAttributeText;
- }
-
- public String getMappingText() {
- AttributeMapping mapping = getSubject().getMapping();
- String mappingKey = mapping.getKey();
-
- if (mappingKey == null) {
- return JptUiDetailsMessages.MapAsComposite_changeMappingType;
- }
-
- return mapping.isDefault() ?
- getDefaultDefinition(mappingKey).getLinkLabel() :
- getMappingUiDefinition(mappingKey).getLinkLabel();
- }
-
- public void morphMapping(MappingUiDefinition definition) {
- ((PersistentAttribute) getSubject()).setMappingKey(definition.getKey());
- }
-
- public String getName() {
- return getSubject().getName();
- }
-
- public Iterator<? extends MappingUiDefinition<? extends ReadOnlyPersistentAttribute, ?>> mappingUiDefinitions() {
- return attributeMappingUiDefinitions();
- }
- };
- }
-
- protected Iterator<? extends MappingUiDefinition<? extends ReadOnlyPersistentAttribute, ?>> attributeMappingUiDefinitions() {
- return getJpaPlatformUi().attributeMappingUiDefinitions(getSubject().getResourceType());
- }
-
- @Override
- protected DefaultMappingUiDefinition getDefaultDefinition() {
- return getDefaultDefinition(getSubject().getDefaultMappingKey());
- }
-
- @Override
- protected DefaultMappingUiDefinition getDefaultDefinition(String mappingKey) {
- return getJpaPlatformUi().getDefaultAttributeMappingUiDefinition(getSubject().getMapping().getResourceType(), mappingKey);
- }
-
- @Override
- protected MappingUiDefinition getMappingUiDefinition(String mappingKey) {
- MappingUiDefinition definition = super.getMappingUiDefinition(mappingKey);
- return (definition != null) ? definition : UnsupportedOrmMappingUiDefinition.instance();
- }
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyPersistentAttribute.DEFAULT_MAPPING_KEY_PROPERTY);
- propertyNames.add(ReadOnlyPersistentAttribute.MAPPING_PROPERTY);
- propertyNames.add(ReadOnlyPersistentAttribute.NAME_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == ReadOnlyPersistentAttribute.MAPPING_PROPERTY ||
- propertyName == ReadOnlyPersistentAttribute.DEFAULT_MAPPING_KEY_PROPERTY ||
- propertyName == ReadOnlyPersistentAttribute.NAME_PROPERTY) {
-
- updateDescription();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPage.java
deleted file mode 100644
index e9402d8a6a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeDetailsPage.java
+++ /dev/null
@@ -1,169 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.Tracing;
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.utility.Filter;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.model.value.FilteringPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * The abstract definition of the details page responsible to show the
- * information for an persistent type.
- *
- * @see PersistentType
- *
- * @version 2.2
- * @since 1.0
- */
-@SuppressWarnings("nls")
-public class PersistentTypeDetailsPage extends AbstractJpaDetailsPage<PersistentType>
-{
- private Map<String, JpaComposite> mappingComposites;
- private PageBook mappingPageBook;
- private PropertyValueModel<TypeMapping> mappingHolder;
-
- /**
- * Creates a new <code>PersistentTypeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public PersistentTypeDetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.mappingComposites = new HashMap<String, JpaComposite>();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Map As composite
- new PersistentTypeMapAsComposite(
- this,
- addSubPane(container, 0, 0, 5, 0)
- );
-
- // Type properties page
- buildMappingPageBook(container);
- }
-
- protected PageBook buildMappingPageBook(Composite parent) {
-
- this.mappingPageBook = new PageBook(parent, SWT.NONE);
- this.mappingPageBook.showPage(this.addLabel(this.mappingPageBook, ""));
-
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.TOP;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
-
- this.mappingPageBook.setLayoutData(gridData);
-
- this.mappingHolder = this.buildMappingHolder();
- new ControlSwitcher(this.mappingHolder, this.buildPaneTransformer(), this.mappingPageBook);
-
- return this.mappingPageBook;
- }
-
- private Transformer<TypeMapping, Control> buildPaneTransformer() {
- return new Transformer<TypeMapping, Control>() {
- public Control transform(TypeMapping typeMapping) {
- if (typeMapping == null) {
- return null;
- }
- return getMappingComposite(typeMapping.getKey()).getControl();
- }
- };
- }
-
- protected PropertyValueModel<TypeMapping> buildMappingHolder(String key) {
- return new FilteringPropertyValueModel<TypeMapping>(
- this.mappingHolder,
- buildMappingFilter(key)
- );
- }
-
- private PropertyAspectAdapter<PersistentType, TypeMapping> buildMappingHolder() {
- return new PropertyAspectAdapter<PersistentType, TypeMapping>(getSubjectHolder(), PersistentType.MAPPING_PROPERTY) {
- @Override
- protected TypeMapping buildValue_() {
- return this.subject.getMapping();
- }
- };
- }
-
- private Filter<TypeMapping> buildMappingFilter(final String key) {
- return new Filter<TypeMapping>() {
- public boolean accept(TypeMapping mapping) {
- return (mapping == null || key == null) || key.equals(mapping.getKey());
- }
- };
- }
-
-
- private JpaComposite getMappingComposite(String key) {
- JpaComposite mappingComposite = this.mappingComposites.get(key);
- if (mappingComposite != null) {
- return mappingComposite;
- }
-
- mappingComposite = buildMappingComposite(this.mappingPageBook, key);
-
- if (mappingComposite != null) {
- this.mappingComposites.put(key, mappingComposite);
- }
-
- return mappingComposite;
- }
-
- protected JpaComposite buildMappingComposite(PageBook pageBook, String key) {
- return getJpaPlatformUi().
- buildTypeMappingComposite(
- getSubject().getResourceType(),
- key,
- pageBook,
- buildMappingHolder(key),
- getWidgetFactory());
- }
-
- @Override
- public void dispose() {
- log(Tracing.UI_DETAILS_VIEW, "PersistentTypeDetailsPage.dispose()");
-
- for (JpaComposite mappingComposite : this.mappingComposites.values()) {
- mappingComposite.dispose();
- }
- this.mappingComposites.clear();
- super.dispose();
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeMapAsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeMapAsComposite.java
deleted file mode 100644
index c1a29c5066..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PersistentTypeMapAsComposite.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-import java.util.Iterator;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This "Map As" composite is responsible for showing the mapping name and
- * mapping type for a type.
- *
- * @see JavaPersistentTypeMapAsComposite
- * @see OrmPersistentTypeMapAsComposite
- *
- * @version 2.2
- * @since 2.0
- */
-public class PersistentTypeMapAsComposite
- extends MapAsComposite<PersistentType>
-{
- /**
- * Creates a new <code>PersistentTypeMapAsComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public PersistentTypeMapAsComposite(
- Pane<? extends PersistentType> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected String getMappingKey() {
- return getSubject().getMappingKey();
- }
-
- @Override
- protected MappingChangeHandler buildMappingChangeHandler() {
- return new MappingChangeHandler() {
-
- public String getLabelText() {
- String mappingKey = getMappingKey();
-
- if (mappingKey != null) {
- return JptUiDetailsMessages.MapAsComposite_mappedTypeText;
- }
-
- return JptUiDetailsMessages.MapAsComposite_unmappedTypeText;
- }
-
- public String getMappingText() {
- String mappingKey = getMappingKey();
-
- if (mappingKey == null) {
- return JptUiDetailsMessages.MapAsComposite_changeMappingType;
- }
-
- return getMappingUiDefinition(mappingKey).getLinkLabel();
- }
-
- public void morphMapping(MappingUiDefinition definition) {
- getSubject().setMappingKey(definition.getKey());
- }
-
- public String getName() {
- return getSubject().getSimpleName();
- }
-
- public Iterator<? extends MappingUiDefinition<? extends PersistentType, ?>> mappingUiDefinitions() {
- return typeMappingUiDefinitions();
- }
- };
- }
-
- /**
- * Retrieves the list of definitions that are registered with the JPT plugin.
- *
- * @return The supported types of mapping
- */
- protected Iterator<? extends MappingUiDefinition<? extends PersistentType, ?>> typeMappingUiDefinitions() {
- return getJpaPlatformUi().typeMappingUiDefinitions(getSubject().getResourceType());
- }
-
- @Override
- protected DefaultMappingUiDefinition getDefaultDefinition() {
- return getJpaPlatformUi().getDefaultTypeMappingUiDefinition(getSubject().getResourceType());
- }
-
- @Override
- protected DefaultMappingUiDefinition getDefaultDefinition(String mappingKey) {
- return getDefaultDefinition();
- }
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistentType.MAPPING_PROPERTY);
- propertyNames.add(PersistentType.NAME_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
-
- if (propertyName == PersistentType.MAPPING_PROPERTY ||
- propertyName == PersistentType.NAME_PROPERTY) {
-
- updateDescription();
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnDialog.java
deleted file mode 100644
index 960b9843fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnDialog.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is used to either create or edit a primary key join column that
- * is located on an entity.
- *
- * @see PrimaryKeyJoinColumn
- * @see Entity
- * @see PrimaryKeyJoinColumnStateObject
- * @see BaseJoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnDialog extends BaseJoinColumnDialog<PrimaryKeyJoinColumnStateObject> {
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnDialog</code>.
- *
- * @param parent The parent shell
- * @param entity The owner of the join column to create or where it is
- * located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public PrimaryKeyJoinColumnDialog(Shell parent,
- Entity entity,
- PrimaryKeyJoinColumn joinColumn) {
-
- super(parent, entity, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected DialogPane<PrimaryKeyJoinColumnStateObject> buildLayout(Composite container) {
- return new BaseJoinColumnDialogPane<PrimaryKeyJoinColumnStateObject>(
- getSubjectHolder(),
- container
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected PrimaryKeyJoinColumnStateObject buildStateObject() {
- return new PrimaryKeyJoinColumnStateObject(getOwner(), getJoinColumn());
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getDescriptionTitle() {
-
- if (getJoinColumn() == null) {
- return JptUiDetailsMessages.PrimaryKeyJoinColumnDialog_addDescriptionTitle;
- }
-
- return JptUiDetailsMessages.PrimaryKeyJoinColumnDialog_editDescriptionTitle;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public PrimaryKeyJoinColumn getJoinColumn() {
- return (PrimaryKeyJoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Entity getOwner() {
- return (Entity) super.getOwner();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getTitle() {
-
- if (getJoinColumn() == null) {
- return JptUiDetailsMessages.PrimaryKeyJoinColumnDialog_addTitle;
- }
-
- return JptUiDetailsMessages.PrimaryKeyJoinColumnDialog_editTitle;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java
deleted file mode 100644
index 257bc5f1ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableDialog.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * This dialog is used to either create or edit a primary key joing column that
- * is within a secondary table.
- *
- * @see PrimaryKeyJoinColumn
- * @see SecondaryTable
- * @see BaseJoinColumnDialogPane
- * @see PrimaryKeyJoinColumnInSecondaryTableStateObject
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnInSecondaryTableDialog extends BaseJoinColumnDialog<PrimaryKeyJoinColumnInSecondaryTableStateObject> {
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnInSecondaryTableDialog</code>.
- *
- * @param parent The parent shell
- * @param secondaryTable The owner of the join column to create or where it
- * is located
- * @param joinColumn Either the join column to edit or <code>null</code> if
- * this state object is used to create a new one
- */
- public PrimaryKeyJoinColumnInSecondaryTableDialog(Shell parent,
- SecondaryTable secondaryTable,
- PrimaryKeyJoinColumn joinColumn) {
-
- super(parent, secondaryTable, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected DialogPane<PrimaryKeyJoinColumnInSecondaryTableStateObject> buildLayout(Composite container) {
- return new BaseJoinColumnDialogPane<PrimaryKeyJoinColumnInSecondaryTableStateObject>(
- getSubjectHolder(),
- container
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected PrimaryKeyJoinColumnInSecondaryTableStateObject buildStateObject() {
- return new PrimaryKeyJoinColumnInSecondaryTableStateObject(
- getOwner(),
- getJoinColumn()
- );
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getDescriptionTitle() {
-
- if (getJoinColumn() == null) {
- return JptUiDetailsMessages.PrimaryKeyJoinColumnInSecondaryTableDialog_addDescriptionTitle;
- }
-
- return JptUiDetailsMessages.PrimaryKeyJoinColumnInSecondaryTableDialog_editDescriptionTitle;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public PrimaryKeyJoinColumn getJoinColumn() {
- return (PrimaryKeyJoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected SecondaryTable getOwner() {
- return (SecondaryTable) super.getOwner();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getTitle() {
-
- if (getJoinColumn() == null) {
- return JptUiDetailsMessages.PrimaryKeyJoinColumnInSecondaryTableDialog_addTitle;
- }
-
- return JptUiDetailsMessages.PrimaryKeyJoinColumnInSecondaryTableDialog_editTitle;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableStateObject.java
deleted file mode 100644
index 21d1b0a915..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnInSecondaryTableStateObject.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * The state object used to create or edit a primary key join column on an
- * secondary table.
- *
- * @see PrimaryKeyJoinColumn
- * @see SecondaryTable
- * @see PrimaryKeyJoinColumnInSecondaryTableDialog
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnInSecondaryTableStateObject extends BaseJoinColumnStateObject
-{
- /**
- * Creates a new <code>PrimaryKeyJoinColumnInSecondaryTableStateObject</code>.
- *
- * @param secondaryTable The owner of the join column to create or where it
- * is located
- * @param joinColumn The join column to edit or <code>null</code> if it is to
- * create a new one
- */
- public PrimaryKeyJoinColumnInSecondaryTableStateObject(SecondaryTable secondaryTable,
- PrimaryKeyJoinColumn joinColumn) {
-
- super(secondaryTable, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String getDefaultTable() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public PrimaryKeyJoinColumn getJoinColumn() {
- return (PrimaryKeyJoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getNameTable() {
- return getOwner().getDbTable();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public SecondaryTable getOwner() {
- return (SecondaryTable) super.getOwner();
- }
-
- /* (non-Javadoc)
- */
- @Override
- public Table getReferencedNameTable() {
- return getOwner().getParent().getPrimaryDbTable();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getInitialTable() {
- return getOwner().getName();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public ListIterator<String> tables() {
- return new SingleElementListIterator<String>(getInitialTable());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java
deleted file mode 100644
index 9f07cef659..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnJoiningStrategyPane.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyRelationship;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | o Primary key join columns ______________________________________________ |
- * | | (no actual content) | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link PrimaryKeyJoinColumnRelationship}
- * @see {@link PrimaryKeyJoinColumnRelationshipStrategy}
- * @see {@link OneToOneJoiningStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class PrimaryKeyJoinColumnJoiningStrategyPane
- extends AbstractJoiningStrategyPane
- <PrimaryKeyJoinColumnRelationship, PrimaryKeyJoinColumnRelationshipStrategy>
-{
- public PrimaryKeyJoinColumnJoiningStrategyPane(
- Pane<? extends PrimaryKeyJoinColumnRelationship> parentPane,
- Composite parent) {
- super(parentPane, parent);
- }
-
- @Override
- protected ModifiablePropertyValueModel<Boolean> buildUsesStrategyHolder() {
- return buildUsesPrimaryKeyJoinColumnJoiningStrategyHolder(getSubjectHolder());
- }
-
- protected PropertyValueModel<PrimaryKeyJoinColumnRelationshipStrategy> buildPrimaryKeyJoinColumnJoiningStrategyHolder() {
- return new PropertyAspectAdapter
- <PrimaryKeyJoinColumnRelationship, PrimaryKeyJoinColumnRelationshipStrategy>(
- getSubjectHolder()) {
- @Override
- protected PrimaryKeyJoinColumnRelationshipStrategy buildValue_() {
- return this.subject.getPrimaryKeyJoinColumnStrategy();
- }
- };
- }
-
- @Override
- protected Composite buildStrategyDetailsComposite(Composite parent) {
- return null;
- }
-
- public static ModifiablePropertyValueModel<Boolean> buildUsesPrimaryKeyJoinColumnJoiningStrategyHolder(PropertyValueModel<? extends PrimaryKeyJoinColumnRelationship> subjectHolder) {
- return new PropertyAspectAdapter<PrimaryKeyJoinColumnRelationship, Boolean>(
- subjectHolder, ReadOnlyRelationship.STRATEGY_PROPERTY) {
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE :
- Boolean.valueOf(this.subject.strategyIsPrimaryKeyJoinColumn());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value == Boolean.TRUE) {
- this.subject.setStrategyToPrimaryKeyJoinColumn();
- }
- //value == FALSE - selection of another radio button causes this strategy to get unset
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnStateObject.java
deleted file mode 100644
index 4f1e8f9b8a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnStateObject.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.SingleElementListIterator;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * The state object used to create or edit a primary key join column on an
- * entity.
- *
- * @see PrimaryKeyJoinColumn
- * @see Entity
- * @see PrimaryKeyJoinColumnDialog
- * @see PrimaryKeyJoinColumnDialogPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class PrimaryKeyJoinColumnStateObject extends BaseJoinColumnStateObject
-{
- /**
- * Creates a new <code>PrimaryKeyJoinColumnStateObject</code>.
- *
- * @param entity The owner of the join column to create or where it is
- * located
- * @param joinColumn The join column to edit or <code>null</code> if this is
- * used to create a new one
- */
- public PrimaryKeyJoinColumnStateObject(Entity entity,
- PrimaryKeyJoinColumn joinColumn) {
- super(entity, joinColumn);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public String getDefaultTable() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public PrimaryKeyJoinColumn getJoinColumn() {
- return (PrimaryKeyJoinColumn) super.getJoinColumn();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getNameTable() {
- return getOwner().getPrimaryDbTable();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Entity getOwner() {
- return (Entity) super.getOwner();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public Table getReferencedNameTable() {
- Entity parentEntity = getOwner().getParentEntity();
- return (parentEntity == null) ? getOwner().getPrimaryDbTable() : parentEntity.getPrimaryDbTable();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected String getInitialTable() {
- return getOwner().getPrimaryTableName();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public ListIterator<String> tables() {
- return new SingleElementListIterator<String>(getInitialTable());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java
deleted file mode 100644
index b969acf880..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/PrimaryKeyJoinColumnsInSecondaryTableComposite.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyNamedColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlySecondaryTable;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Join Columns ---------------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | AddRemoveListPane | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see SecondaryTable
- * @see AddRemoveListPane
- *
- * @version 2.0
- * @since 1.0
- */
-public class PrimaryKeyJoinColumnsInSecondaryTableComposite extends Pane<ReadOnlySecondaryTable>
-{
- private ModifiablePropertyValueModel<ReadOnlyPrimaryKeyJoinColumn> joinColumnHolder;
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnsInSecondaryTableComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public PrimaryKeyJoinColumnsInSecondaryTableComposite(Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlySecondaryTable> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>PrimaryKeyJoinColumnsInSecondaryTableComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ISecondaryTable</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public PrimaryKeyJoinColumnsInSecondaryTableComposite(PropertyValueModel<? extends ReadOnlySecondaryTable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- void addJoinColumn(PrimaryKeyJoinColumnInSecondaryTableStateObject stateObject) {
-
- SecondaryTable secondaryTable = stateObject.getOwner();
- int index = secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize();
-
- PrimaryKeyJoinColumn joinColumn = secondaryTable.addSpecifiedPrimaryKeyJoinColumn(index);
- stateObject.updateJoinColumn(joinColumn);
- }
-
- void addPrimaryKeyJoinColumn() {
-
- PrimaryKeyJoinColumnInSecondaryTableDialog dialog =
- new PrimaryKeyJoinColumnInSecondaryTableDialog(getShell(), (SecondaryTable) getSubject(), null);
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- addJoinColumn(dialog.getSubject());
- }
- }
-
- private PropertyValueModel<Boolean> buildControlBooleanHolder() {
- return new TransformationPropertyValueModel<ReadOnlySecondaryTable, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(ReadOnlySecondaryTable value) {
- if (value == null) {
- return Boolean.FALSE;
- }
- return Boolean.valueOf(!value.isVirtual());
- }
- };
- }
-
- private PropertyValueModel<ReadOnlyPrimaryKeyJoinColumn> buildDefaultJoinColumnHolder() {
- return new PropertyAspectAdapter<ReadOnlySecondaryTable, ReadOnlyPrimaryKeyJoinColumn>(getSubjectHolder(), ReadOnlySecondaryTable.DEFAULT_PRIMARY_KEY_JOIN_COLUMN) {
- @Override
- protected ReadOnlyPrimaryKeyJoinColumn buildValue_() {
- return this.subject.getDefaultPrimaryKeyJoinColumn();
- }
- };
- }
-
- private ListValueModel<ReadOnlyPrimaryKeyJoinColumn> buildDefaultJoinColumnListHolder() {
- return new PropertyListValueModelAdapter<ReadOnlyPrimaryKeyJoinColumn>(
- buildDefaultJoinColumnHolder()
- );
- }
-
- String buildJoinColumnLabel(ReadOnlyPrimaryKeyJoinColumn joinColumn) {
-
- if (joinColumn.isVirtual()) {
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- if (joinColumn.getSpecifiedName() == null) {
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsBothDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsFirstDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- if (joinColumn.getSpecifiedReferencedColumnName() == null) {
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParamsSecDefault,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- return NLS.bind(
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_mappingBetweenTwoParams,
- joinColumn.getName(),
- joinColumn.getReferencedColumnName()
- );
- }
-
- private ILabelProvider buildJoinColumnsListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- ReadOnlyPrimaryKeyJoinColumn joinColumn = (ReadOnlyPrimaryKeyJoinColumn) element;
- return buildJoinColumnLabel(joinColumn);
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildOverrideDefaultJoinColumnHolder() {
- return new OverrideDefaultJoinColumnHolder();
- }
-
- private AddRemovePane.Adapter buildPrimaryKeyJoinColumnAdapter() {
- return new AddRemovePane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPrimaryKeyJoinColumn();
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_edit;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- editPrimaryKeyJoinColumn(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- removePrimaryKeyJoinColumn(listSelectionModel);
- }
- };
- }
-
- private ModifiablePropertyValueModel<ReadOnlyPrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnHolder() {
- return new SimplePropertyValueModel<ReadOnlyPrimaryKeyJoinColumn>();
- }
-
- private ListValueModel<ReadOnlyPrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnsListHolder() {
- List<ListValueModel<ReadOnlyPrimaryKeyJoinColumn>> list = new ArrayList<ListValueModel<ReadOnlyPrimaryKeyJoinColumn>>();
- list.add(buildSpecifiedJoinColumnsListHolder());
- list.add(buildDefaultJoinColumnListHolder());
- return new CompositeListValueModel<ListValueModel<ReadOnlyPrimaryKeyJoinColumn>, ReadOnlyPrimaryKeyJoinColumn>(list);
- }
-
- private ListValueModel<ReadOnlyPrimaryKeyJoinColumn> buildPrimaryKeyJoinColumnsListModel() {
- return new ItemPropertyListValueModelAdapter<ReadOnlyPrimaryKeyJoinColumn>(
- buildPrimaryKeyJoinColumnsListHolder(),
- ReadOnlyNamedColumn.SPECIFIED_NAME_PROPERTY,
- ReadOnlyNamedColumn.DEFAULT_NAME_PROPERTY,
- ReadOnlyBaseJoinColumn.SPECIFIED_REFERENCED_COLUMN_NAME_PROPERTY,
- ReadOnlyBaseJoinColumn.DEFAULT_REFERENCED_COLUMN_NAME_PROPERTY
- );
- }
-
- ListValueModel<ReadOnlyPrimaryKeyJoinColumn> buildSpecifiedJoinColumnsListHolder() {
- return new ListAspectAdapter<ReadOnlySecondaryTable, ReadOnlyPrimaryKeyJoinColumn>(getSubjectHolder(), ReadOnlySecondaryTable.SPECIFIED_PRIMARY_KEY_JOIN_COLUMNS_LIST) {
- @Override
- protected ListIterable<ReadOnlyPrimaryKeyJoinColumn> getListIterable() {
- return new SuperListIterableWrapper<ReadOnlyPrimaryKeyJoinColumn>(subject.getSpecifiedPrimaryKeyJoinColumns());
- }
-
- @Override
- protected int size_() {
- return subject.getSpecifiedPrimaryKeyJoinColumnsSize();
- }
- };
- }
-
- void editPrimaryKeyJoinColumn(ObjectListSelectionModel listSelectionModel) {
-
- PrimaryKeyJoinColumn joinColumn = (PrimaryKeyJoinColumn) listSelectionModel.selectedValue();
-
- PrimaryKeyJoinColumnInSecondaryTableDialog dialog =
- new PrimaryKeyJoinColumnInSecondaryTableDialog(
- getShell(),
- (SecondaryTable) getSubject(),
- joinColumn
- );
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- editPrimaryKeyJoinColumn(dialog.getSubject());
- }
- }
-
- void editPrimaryKeyJoinColumn(PrimaryKeyJoinColumnInSecondaryTableStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- joinColumnHolder = buildPrimaryKeyJoinColumnHolder();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Primary Key Join Columns group pane
- Group groupPane = addTitledGroup(
- container,
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_primaryKeyJoinColumn
- );
-
- // Override Default check box
- addCheckBox(
- addSubPane(groupPane, 8),
- JptUiDetailsMessages.PrimaryKeyJoinColumnsComposite_overrideDefaultPrimaryKeyJoinColumns,
- buildOverrideDefaultJoinColumnHolder(),
- null,
- buildControlBooleanHolder()
- );
-
- // Primary Key Join Columns list pane
- AddRemoveListPane<ReadOnlySecondaryTable> joinColumnsPane = new AddRemoveListPane<ReadOnlySecondaryTable>(
- this,
- groupPane,
- buildPrimaryKeyJoinColumnAdapter(),
- buildPrimaryKeyJoinColumnsListModel(),
- joinColumnHolder,
- buildJoinColumnsListLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS
- );
-
- installPrimaryKeyJoinColumnListPaneEnabler(joinColumnsPane);
- }
-
- private void installPrimaryKeyJoinColumnListPaneEnabler(AddRemoveListPane<ReadOnlySecondaryTable> pkJoinColumnListPane) {
-
- new PaneEnabler(
- buildOverrideDefaultJoinColumnHolder(),
- pkJoinColumnListPane
- );
- }
-
- void removePrimaryKeyJoinColumn(ObjectListSelectionModel listSelectionModel) {
- int[] selectedIndices = listSelectionModel.selectedIndices();
-
- for (int index = selectedIndices.length; --index >= 0; ) {
- ((SecondaryTable) getSubject()).removeSpecifiedPrimaryKeyJoinColumn(selectedIndices[index]);
- }
- }
-
- void updateJoinColumns(boolean selected) {
-
- if (isPopulating()) {
- return;
- }
-
- setPopulating(true);
-
- try {
- SecondaryTable secondaryTable = (SecondaryTable) getSubject();
-
- // Add a join column by creating a specified one using the default
- // one if it exists
- if (selected) {
-
- PrimaryKeyJoinColumn defaultJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
-
- if (defaultJoinColumn != null) {
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- PrimaryKeyJoinColumn pkJoinColumn = secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- pkJoinColumn.setSpecifiedName(columnName);
- pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
-
- joinColumnHolder.setValue(pkJoinColumn);
- }
- }
- else {
- for (int index = secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize(); --index >= 0; ) {
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(index);
- }
- }
- }
- finally {
- setPopulating(false);
- }
- }
-
- private class OverrideDefaultJoinColumnHolder extends ListPropertyValueModelAdapter<Boolean>
- implements ModifiablePropertyValueModel<Boolean> {
-
- public OverrideDefaultJoinColumnHolder() {
- super(buildSpecifiedJoinColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.buildValue_());
- }
-
- protected boolean buildValue_() {
- ReadOnlySecondaryTable table = getSubject();
- return (table != null) && ! table.isVirtual() && listModel.size() > 0;
- }
-
- public void setValue(Boolean value) {
- updateJoinColumns(value.booleanValue());
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java
deleted file mode 100644
index aff96222b2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueriesComposite.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.NamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * This pane shows the list of named queries and named native queries.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | NamedQueryPropertyComposite or NamedNativeQueryPropertyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see Query
- * @see NamedNativeQuery
- * @see NamedQuery
- * @see AbstractEntityComposite - The parent container
- * @see NamedNativeQueryPropertyComposite
- * @see NamedQueryPropertyComposite
- *
- * @version 2.0
- * @since 2.0
- */
-public class QueriesComposite extends Pane<QueryContainer>
-{
- private AddRemoveListPane<QueryContainer> listPane;
- NamedNativeQueryPropertyComposite namedNativeQueryPane;
- Pane<? extends NamedQuery> namedQueryPane;
- private ModifiablePropertyValueModel<Query> queryHolder;
-
-
- public QueriesComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends QueryContainer> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- void addQuery() {
- addQueryFromDialog(buildAddQueryDialog());
- }
-
- protected AddQueryDialog buildAddQueryDialog() {
- return new AddQueryDialog(getShell(), this.getSubject().getPersistenceUnit());
- }
-
- protected void addQueryFromDialog(AddQueryDialog dialog) {
- if (dialog.open() != Window.OK) {
- return;
- }
- String queryType = dialog.getQueryType();
- Query query;
- if (queryType == AddQueryDialog.NAMED_QUERY) {
- query = this.getSubject().addNamedQuery();
- }
- else if (queryType == AddQueryDialog.NAMED_NATIVE_QUERY) {
- query = this.getSubject().addNamedNativeQuery();
- }
- else {
- throw new IllegalArgumentException();
- }
- query.setName(dialog.getName());
- this.getQueryHolder().setValue(query);//so that it gets selected in the List for the user to edit
- }
-
- private ListValueModel<Query> buildDisplayableQueriesListHolder() {
- return new ItemPropertyListValueModelAdapter<Query>(
- buildQueriesListHolder(),
- Query.NAME_PROPERTY
- );
- }
-
- private AddRemoveListPane<QueryContainer> addListPane(Composite container) {
-
- return new AddRemoveListPane<QueryContainer>(
- this,
- container,
- buildQueriesAdapter(),
- buildDisplayableQueriesListHolder(),
- this.getQueryHolder(),
- buildQueriesListLabelProvider(),
- JpaHelpContextIds.MAPPING_NAMED_QUERIES
- );
- }
-
- private ListValueModel<NamedNativeQuery> buildNamedNativeQueriesListHolder() {
- return new ListAspectAdapter<QueryContainer, NamedNativeQuery>(
- getSubjectHolder(),
- QueryContainer.NAMED_NATIVE_QUERIES_LIST)
- {
- @Override
- protected ListIterable<NamedNativeQuery> getListIterable() {
- return new SuperListIterableWrapper<NamedNativeQuery>(this.subject.getNamedNativeQueries());
- }
-
- @Override
- protected int size_() {
- return this.subject.getNamedNativeQueriesSize();
- }
- };
- }
-
- private PropertyValueModel<NamedNativeQuery> buildNamedNativeQueryHolder() {
- return new TransformationPropertyValueModel<Query, NamedNativeQuery>(this.getQueryHolder()) {
- @Override
- protected NamedNativeQuery transform_(Query value) {
- return (value instanceof NamedNativeQuery) ? (NamedNativeQuery) value : null;
- }
- };
- }
-
- private ListValueModel<NamedQuery> buildNamedQueriesListHolder() {
- return new ListAspectAdapter<QueryContainer, NamedQuery>(
- getSubjectHolder(),
- QueryContainer.NAMED_QUERIES_LIST)
- {
- @Override
- protected ListIterable<NamedQuery> getListIterable() {
- return new SuperListIterableWrapper<NamedQuery>(this.subject.getNamedQueries());
- }
-
- @Override
- protected int size_() {
- return this.subject.getNamedQueriesSize();
- }
- };
- }
-
- private PropertyValueModel<NamedQuery> buildNamedQueryHolder() {
- return new TransformationPropertyValueModel<Query, NamedQuery>(this.getQueryHolder()) {
- @Override
- protected NamedQuery transform_(Query value) {
- return (value instanceof NamedQuery) ? (NamedQuery) value : null;
- }
- };
- }
-
- private Transformer<Query, Control> buildPaneTransformer() {
- return new Transformer<Query, Control>() {
- public Control transform(Query query) {
-
- if (query == null) {
- return null;
- }
-
- if (query instanceof NamedNativeQuery) {
- return QueriesComposite.this.namedNativeQueryPane.getControl();
- }
-
- return QueriesComposite.this.namedQueryPane.getControl();
- }
- };
- }
-
- private Adapter buildQueriesAdapter() {
-
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addQuery();
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- if (item instanceof NamedQuery) {
- getSubject().removeNamedQuery((NamedQuery) item);
- }
- else {
- getSubject().removeNamedNativeQuery((NamedNativeQuery) item);
- }
- }
- }
- };
- }
-
- private ListValueModel<Query> buildQueriesListHolder() {
- List<ListValueModel<? extends Query>> list = new ArrayList<ListValueModel<? extends Query>>();
- list.add(buildNamedQueriesListHolder());
- list.add(buildNamedNativeQueriesListHolder());
- return new CompositeListValueModel<ListValueModel<? extends Query>, Query>(list);
- }
-
- private ILabelProvider buildQueriesListLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- Query query = (Query) element;
- String name = query.getName();
-
- if (name == null) {
- int index = -1;
-
- if (query instanceof NamedQuery) {
- index = CollectionTools.indexOf(getSubject().getNamedQueries(), query);
- }
- else {
- index = CollectionTools.indexOf(getSubject().getNamedNativeQueries(), query);
- }
-
- name = NLS.bind(JptUiDetailsMessages.QueriesComposite_displayString, Integer.valueOf(index));
- }
-
- return name;
- }
- };
- }
-
- private ModifiablePropertyValueModel<Query> buildQueryHolder() {
- return new SimplePropertyValueModel<Query>();
- }
-
- @Override
- public void enableWidgets(boolean enabled) {
- super.enableWidgets(enabled);
- this.listPane.enableWidgets(enabled);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.queryHolder = buildQueryHolder();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // List pane
- this.listPane = this.addListPane(container);
-
- // Property pane
- PageBook pageBook = new PageBook(container, SWT.NULL);
- pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Named Query property pane
- this.namedQueryPane = this.buildNamedQueryPropertyComposite(pageBook);
-
- // Named Native Query property pane
- this.namedNativeQueryPane = new NamedNativeQueryPropertyComposite(
- this,
- this.buildNamedNativeQueryHolder(),
- pageBook
- );
-
- installPaneSwitcher(pageBook);
- }
-
- protected Pane<? extends NamedQuery> buildNamedQueryPropertyComposite(PageBook pageBook) {
- return new NamedQueryPropertyComposite<NamedQuery>(
- this,
- this.buildNamedQueryHolder(),
- pageBook
- );
- }
-
- private void installPaneSwitcher(PageBook pageBook) {
- new ControlSwitcher(this.getQueryHolder(), this.buildPaneTransformer(), pageBook);
- }
-
- protected ModifiablePropertyValueModel<Query> getQueryHolder() {
- return queryHolder;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueryHintsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueryHintsComposite.java
deleted file mode 100644
index b3bf9a35ee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/QueryHintsComposite.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jpt.common.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveTablePane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.QueryHint;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | AddRemoveTablePane |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Query
- * @see QueryHint
- * @see AddRemoveTablePane
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class QueryHintsComposite extends Pane<Query>
-{
- private ModifiablePropertyValueModel<QueryHint> queryHintHolder;
-
- /**
- * Creates a new <code>QueryHintsComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public QueryHintsComposite(Pane<? extends Query> parentPane,
- Composite container) {
-
- super(parentPane, container);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnableHolder() {
- return new TransformationPropertyValueModel<Query, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(Query query) {
- return (query != null);
- }
- };
- }
-
- private Adapter buildQueryHintAdapter() {
- return new AddRemoveTablePane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- QueryHint queryHint = getSubject().addHint(getSubject().getHintsSize());
- queryHintHolder.setValue(queryHint);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeHint((QueryHint) item);
- }
- }
- };
- }
-
- private ModifiablePropertyValueModel<QueryHint> buildQueryHintHolder() {
- return new SimplePropertyValueModel<QueryHint>();
- };
-
- private ITableLabelProvider buildQueryHintLabelProvider() {
- return new TableLabelProvider();
- }
-
- private ListValueModel<QueryHint> buildQueryHintListHolder() {
- return new ListAspectAdapter<Query, QueryHint>(getSubjectHolder(), NamedQuery.HINTS_LIST) {
- @Override
- protected ListIterable<QueryHint> getListIterable() {
- return new SuperListIterableWrapper<QueryHint>(this.subject.getHints());
- }
-
- @Override
- protected int size_() {
- return subject.getHintsSize();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initialize() {
- super.initialize();
- queryHintHolder = buildQueryHintHolder();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- TablePane tablePane = new TablePane(container);
- installPaneEnabler(tablePane);
- }
-
- private PaneEnabler installPaneEnabler(TablePane tablePane) {
- return new PaneEnabler(buildPaneEnableHolder(), tablePane);
- }
-
- private static class QueryHintColumnAdapter implements ColumnAdapter<QueryHint> {
-
- static final int COLUMN_COUNT = 2;
- static final int NAME_COLUMN_INDEX = 0;
- static final int VALUE_COLUMN_INDEX = 1;
-
- private ModifiablePropertyValueModel<String> buildNameHolder(QueryHint subject) {
- return new PropertyAspectAdapter<QueryHint, String>(QueryHint.NAME_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setName(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<?> buildValueHolder(QueryHint subject) {
- return new PropertyAspectAdapter<QueryHint, String>(QueryHint.VALUE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getValue();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setValue(value);
- }
- };
- }
-
- public ModifiablePropertyValueModel<?>[] cellModels(QueryHint subject) {
- ModifiablePropertyValueModel<?>[] models = new ModifiablePropertyValueModel<?>[COLUMN_COUNT];
- models[NAME_COLUMN_INDEX] = buildNameHolder(subject);
- models[VALUE_COLUMN_INDEX] = buildValueHolder(subject);
- return models;
- }
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int columnIndex) {
-
- switch (columnIndex) {
- case QueryHintColumnAdapter.NAME_COLUMN_INDEX: {
- return JptUiDetailsMessages.QueryHintsComposite_nameColumn;
- }
-
- case QueryHintColumnAdapter.VALUE_COLUMN_INDEX: {
- return JptUiDetailsMessages.QueryHintsComposite_valueColumn;
- }
-
- default: {
- return null;
- }
- }
- }
- }
-
- private class TableLabelProvider extends LabelProvider
- implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
-
- QueryHint queryHint = (QueryHint) element;
- String value = "";
-
- switch (columnIndex) {
- case QueryHintColumnAdapter.NAME_COLUMN_INDEX: {
- value = queryHint.getName();
- break;
- }
-
- case QueryHintColumnAdapter.VALUE_COLUMN_INDEX: {
- value = queryHint.getValue();
- break;
- }
- }
-
- if (value == null) {
- value = "";
- }
-
- return value;
- }
- }
-
- private class TablePane extends AddRemoveTablePane<Query> {
-
- private TablePane(Composite parent) {
- super(QueryHintsComposite.this,
- parent,
- buildQueryHintAdapter(),
- buildQueryHintListHolder(),
- queryHintHolder,
- buildQueryHintLabelProvider());
- }
-
- private CellEditor[] buildCellEditors(Table table) {
- return new CellEditor[] {
- new TextCellEditor(table),
- new TextCellEditor(table)
- };
- }
-
- private ICellModifier buildCellModifier() {
- return new ICellModifier() {
-
- public boolean canModify(Object element, String property) {
- return true;
- }
-
- public Object getValue(Object element, String property) {
- QueryHint queryHint = (QueryHint) element;
- String value = "";
-
- if (property == QueryHint.NAME_PROPERTY) {
- value = queryHint.getName();
- }
- else if (property == QueryHint.VALUE_PROPERTY) {
- value = queryHint.getValue();
- }
-
- if (value == null) {
- value = "";
- }
-
- return value;
- }
-
- public void modify(Object element, String property, Object value) {
- QueryHint queryHint;
-
- if (element instanceof TableItem) {
- TableItem tableItem = (TableItem) element;
- queryHint = (QueryHint) tableItem.getData();
- }
- else {
- queryHint = (QueryHint) element;
- }
-
- if (property == QueryHint.NAME_PROPERTY) {
- queryHint.setName(value.toString());
- }
- else if (property == QueryHint.VALUE_PROPERTY) {
- queryHint.setValue(value.toString());
- }
- }
- };
- }
-
- @Override
- protected ColumnAdapter<?> buildColumnAdapter() {
- return new QueryHintColumnAdapter();
- }
-
- private String[] buildColumnProperties() {
- return new String[] {
- QueryHint.NAME_PROPERTY,
- QueryHint.VALUE_PROPERTY
- };
- }
-
- @Override
- protected void initializeMainComposite(Composite container,
- Adapter adapter,
- ListValueModel<?> listHolder,
- ModifiablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider,
- String helpId) {
-
- super.initializeMainComposite(
- container,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId
- );
-
- Table table = getMainControl();
-
- TableViewer tableViewer = new TableViewer(table);
- tableViewer.setCellEditors(buildCellEditors(table));
- tableViewer.setCellModifier(buildCellModifier());
- tableViewer.setColumnProperties(buildColumnProperties());
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java
deleted file mode 100644
index d523ae932b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/ReferenceTableComposite.java
+++ /dev/null
@@ -1,421 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ReadOnlyWritablePropertyValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ValueListAdapter;
-import org.eclipse.jpt.common.utility.model.event.StateChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.StateChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyReferenceTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyTable;
-import org.eclipse.jpt.jpa.core.context.ReferenceTable;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinColumnsComposite.JoinColumnsEditor;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.TableCombo;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-
-public abstract class ReferenceTableComposite<T extends ReadOnlyReferenceTable>
- extends Pane<T>
-{
- protected Button overrideDefaultJoinColumnsCheckBox;
-
- protected JoinColumnsComposite<T> joinColumnsComposite;
-
- /**
- * Creates a new <code>ReferenceTableComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- protected ReferenceTableComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- /**
- * Creates a new <code>ReferenceTableComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>CollectionTable2_0</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected ReferenceTableComposite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- protected void installJoinColumnsPaneEnabler(JoinColumnsComposite<T> pane) {
- pane.installJoinColumnsPaneEnabler(new JoinColumnPaneEnablerHolder());
- }
-
- void addJoinColumn(T referenceTable) {
-
- JoinColumnInReferenceTableDialog dialog =
- new JoinColumnInReferenceTableDialog(getShell(), referenceTable, null);
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- addJoinColumnFromDialog(dialog.getSubject());
- }
- }
-
- void addJoinColumnFromDialog(JoinColumnInReferenceTableStateObject stateObject) {
- JoinColumn joinColumn = ((ReferenceTable) getSubject()).addSpecifiedJoinColumn();
- stateObject.updateJoinColumn(joinColumn);
- this.setSelectedJoinColumn(joinColumn);
- }
-
- private void setSelectedJoinColumn(JoinColumn joinColumn) {
- this.joinColumnsComposite.setSelectedJoinColumn(joinColumn);
- }
-
- protected JoinColumnsProvider buildJoinColumnsEditor() {
- return new JoinColumnsProvider();
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildOverrideDefaultJoinColumnHolder() {
- return new OverrideDefaultJoinColumnHolder();
- }
-
- ListValueModel<ReadOnlyJoinColumn> buildSpecifiedJoinColumnsListHolder() {
- return new ListAspectAdapter<T, ReadOnlyJoinColumn>(getSubjectHolder(), ReadOnlyReferenceTable.SPECIFIED_JOIN_COLUMNS_LIST) {
- @Override
- protected ListIterable<ReadOnlyJoinColumn> getListIterable() {
- return new SuperListIterableWrapper<ReadOnlyJoinColumn>(this.subject.getSpecifiedJoinColumns());
- }
-
- @Override
- protected int size_() {
- return this.subject.getSpecifiedJoinColumnsSize();
- }
- };
- }
-
- protected Composite addPane(Composite container, int groupBoxMargin) {
- return addSubPane(container, 0, groupBoxMargin, 10, groupBoxMargin);
- }
-
- protected TableCombo<T> addTableCombo(Composite container) {
-
- return new TableCombo<T>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyTable.DEFAULT_NAME_PROPERTY);
- propertyNames.add(ReadOnlyTable.SPECIFIED_NAME_PROPERTY);
- propertyNames.add(ReadOnlyTable.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(ReadOnlyTable.SPECIFIED_SCHEMA_PROPERTY);
- propertyNames.add(ReadOnlyTable.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(ReadOnlyTable.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
- if (propertyName == ReadOnlyTable.DEFAULT_SCHEMA_PROPERTY
- || propertyName == ReadOnlyTable.SPECIFIED_SCHEMA_PROPERTY
- || propertyName == ReadOnlyTable.DEFAULT_CATALOG_PROPERTY
- || propertyName == ReadOnlyTable.SPECIFIED_CATALOG_PROPERTY ) {
- repopulate();
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return this.getSubject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- ((ReferenceTable) this.getSubject()).setSpecifiedName(value);
- }
-
- @Override
- protected String getValue() {
- return this.getSubject().getSpecifiedName();
- }
-
- @Override
- protected Schema getDbSchema_() {
- ReferenceTable table = this.getTable();
- return (table == null) ? null : table.getDbSchema();
- }
-
- protected ReferenceTable getTable() {
- ReadOnlyReferenceTable table = this.getSubject();
- return (table instanceof ReferenceTable) ? (ReferenceTable) table : null;
- }
- };
- }
-
- protected SchemaCombo<T> addSchemaCombo(Composite container) {
-
- return new SchemaCombo<T>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyTable.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(ReadOnlyTable.SPECIFIED_SCHEMA_PROPERTY);
- propertyNames.add(ReadOnlyTable.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(ReadOnlyTable.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
- if (propertyName == ReadOnlyTable.DEFAULT_CATALOG_PROPERTY
- || propertyName == ReadOnlyTable.SPECIFIED_CATALOG_PROPERTY ) {
- repopulate();
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return this.getSubject().getDefaultSchema();
- }
-
- @Override
- protected void setValue(String value) {
- ((ReferenceTable) this.getSubject()).setSpecifiedSchema(value);
- }
-
- @Override
- protected String getValue() {
- return this.getSubject().getSpecifiedSchema();
- }
-
- @Override
- protected SchemaContainer getDbSchemaContainer_() {
- ReferenceTable table = this.getTable();
- return (table == null) ? null : table.getDbSchemaContainer();
- }
-
- protected ReferenceTable getTable() {
- ReadOnlyReferenceTable table = this.getSubject();
- return (table instanceof ReferenceTable) ? (ReferenceTable) table : null;
- }
- };
- }
-
- protected CatalogCombo<T> addCatalogCombo(Composite container) {
-
- return new CatalogCombo<T>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(ReadOnlyTable.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(ReadOnlyTable.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return this.getSubject().getDefaultCatalog();
- }
-
- @Override
- protected void setValue(String value) {
- ((ReferenceTable) this.getSubject()).setSpecifiedCatalog(value);
- }
-
- @Override
- protected String getValue() {
- return this.getSubject().getSpecifiedCatalog();
- }
- };
- }
-
- void editJoinColumn(ReadOnlyJoinColumn joinColumn) {
-
- JoinColumnInReferenceTableDialog dialog =
- new JoinColumnInReferenceTableDialog(getShell(), getSubject(), joinColumn);
-
- dialog.setBlockOnOpen(true);
- dialog.open();
- if (dialog.wasConfirmed()) {
- editJoinColumn(dialog.getSubject());
- }
- }
-
- void editJoinColumn(JoinColumnInReferenceTableStateObject stateObject) {
- stateObject.updateJoinColumn(stateObject.getJoinColumn());
- }
-
- void updateJoinColumns() {
- if (this.isPopulating()) {
- return;
- }
-
- ReferenceTable referenceTable = (ReferenceTable) this.getSubject();
- if (referenceTable == null) {
- return;
- }
-
- boolean selected = this.overrideDefaultJoinColumnsCheckBox.getSelection();
- this.setPopulating(true);
-
- try {
- if (selected) {
- referenceTable.convertDefaultJoinColumnToSpecified();
- setSelectedJoinColumn(referenceTable.getSpecifiedJoinColumn(0));
- } else {
- for (int index = referenceTable.getSpecifiedJoinColumnsSize(); --index >= 0; ) {
- referenceTable.removeSpecifiedJoinColumn(index);
- }
- }
- } finally {
- this.setPopulating(false);
- }
- }
-
- class JoinColumnsProvider implements JoinColumnsEditor<T> {
-
- public void addJoinColumn(T subject) {
- ReferenceTableComposite.this.addJoinColumn(subject);
- }
-
- public ReadOnlyJoinColumn getDefaultJoinColumn(T subject) {
- return subject.getDefaultJoinColumn();
- }
-
- public String getDefaultPropertyName() {
- return ReadOnlyReferenceTable.DEFAULT_JOIN_COLUMN_PROPERTY;
- }
-
- public void editJoinColumn(T subject, ReadOnlyJoinColumn joinColumn) {
- ReferenceTableComposite.this.editJoinColumn(joinColumn);
- }
-
- public boolean hasSpecifiedJoinColumns(T subject) {
- return subject.hasSpecifiedJoinColumns();
- }
-
- public void removeJoinColumns(T subject, int[] selectedIndices) {
- for (int index = selectedIndices.length; index-- > 0; ) {
- ((ReferenceTable) subject).removeSpecifiedJoinColumn(selectedIndices[index]);
- }
- }
-
- public ListIterable<ReadOnlyJoinColumn> getSpecifiedJoinColumns(T subject) {
- return new SuperListIterableWrapper<ReadOnlyJoinColumn>(subject.getSpecifiedJoinColumns());
- }
-
- public int getSpecifiedJoinColumnsSize(T subject) {
- return subject.getSpecifiedJoinColumnsSize();
- }
-
- public String getSpecifiedJoinColumnsListPropertyName() {
- return ReadOnlyReferenceTable.SPECIFIED_JOIN_COLUMNS_LIST;
- }
- }
-
-
- private class OverrideDefaultJoinColumnHolder extends ListPropertyValueModelAdapter<Boolean>
- implements ModifiablePropertyValueModel<Boolean> {
-
- public OverrideDefaultJoinColumnHolder() {
- super(buildSpecifiedJoinColumnsListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- return Boolean.valueOf(this.listModel.size() > 0);
- }
-
- public void setValue(Boolean value) {
- updateJoinColumns();
- }
- }
-
-
- /* CU private */ class JoinColumnPaneEnablerHolder
- extends TransformationPropertyValueModel<T, Boolean>
- {
- private StateChangeListener stateChangeListener;
-
-
- JoinColumnPaneEnablerHolder() {
- super(
- new ValueListAdapter<T>(
- new ReadOnlyWritablePropertyValueModelWrapper<T>(getSubjectHolder()),
- ReadOnlyReferenceTable.SPECIFIED_JOIN_COLUMNS_LIST
- )
- );
- this.stateChangeListener = buildStateChangeListener();
- }
-
-
- private StateChangeListener buildStateChangeListener() {
- return new StateChangeListener() {
- public void stateChanged(StateChangeEvent event) {
- JoinColumnPaneEnablerHolder.this.valueStateChanged();
- }
- };
- }
-
- void valueStateChanged() {
- Object old = this.value;
- this.firePropertyChanged(VALUE, old, this.value = this.transform(this.valueModel.getValue()));
- }
-
- @Override
- protected Boolean transform(T v) {
- return (v == null) ? Boolean.FALSE : super.transform(v);
- }
-
- @Override
- protected Boolean transform_(T v) {
- boolean virtual = ReferenceTableComposite.this.tableIsVirtual(v);
- return Boolean.valueOf(! virtual && v.getSpecifiedJoinColumnsSize() > 0);
- }
-
- @Override
- protected void engageModel() {
- super.engageModel();
- this.valueModel.addStateChangeListener(this.stateChangeListener);
- }
-
- @Override
- protected void disengageModel() {
- this.valueModel.removeStateChangeListener(this.stateChangeListener);
- super.disengageModel();
- }
- }
-
- protected abstract boolean tableIsVirtual(T referenceTable);
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/SecondaryTableDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/SecondaryTableDialog.java
deleted file mode 100644
index 6bbf03d4a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/SecondaryTableDialog.java
+++ /dev/null
@@ -1,450 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * Clients can use this dialog to prompt the user for SecondaryTable settings.
- * Use the following once the dialog is closed:
- * @see #getSelectedTable()
- * @see #getSelectedCatalog()
- * @see #getSelectedSchema()
- */
-public class SecondaryTableDialog extends Dialog {
-
- private final JpaProject jpaProject;
-
- /**
- * when creating a new SecondaryTable, 'secondaryTable' will be null
- */
- private final SecondaryTable secondaryTable;
- private final String defaultCatalog;
- private final String defaultSchema;
-
- protected Combo tableCombo;
- protected Combo catalogCombo;
- protected Combo schemaCombo;
-
- // these values are set upon close
- private String selectedTable;
- private String selectedSchema;
- private String selectedCatalog;
-
-
- // ********** constructors **********
-
- /**
- * Use this constructor to create a new secondary table
- */
- public SecondaryTableDialog(Shell parent, JpaProject jpaProject, String defaultCatalog, String defaultSchema) {
- this(parent, jpaProject, null, defaultCatalog, defaultSchema);
- }
-
- /**
- * Use this constructor to edit an existing secondary table
- */
- public SecondaryTableDialog(Shell parent, JpaProject jpaProject, SecondaryTable secondaryTable) {
- this(parent, jpaProject, secondaryTable, secondaryTable.getDefaultCatalog(), secondaryTable.getDefaultSchema());
- }
-
- /**
- * internal constructor
- */
- protected SecondaryTableDialog(Shell parent, JpaProject jpaProject, SecondaryTable secondaryTable, String defaultCatalog, String defaultSchema) {
- super(parent);
- this.jpaProject = jpaProject;
- this.secondaryTable = secondaryTable;
- this.defaultCatalog = defaultCatalog;
- this.defaultSchema = defaultSchema;
- }
-
-
- // ********** open **********
-
- @Override
- protected Point getInitialSize() {
- Point size = super.getInitialSize();
- size.x = this.convertWidthInCharsToPixels(50); // ???
- return size;
- }
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(this.getTitle());
- }
-
- protected String getTitle() {
- return (this.secondaryTable == null) ?
- JptUiDetailsMessages.SecondaryTableDialog_addSecondaryTable
- :
- JptUiDetailsMessages.SecondaryTableDialog_editSecondaryTable;
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- GridLayout gridLayout = (GridLayout) composite.getLayout();
- gridLayout.numColumns = 2;
-
- // table
- Label tableLabel = new Label(composite, SWT.LEFT);
- tableLabel.setText(JptUiDetailsMessages.SecondaryTableDialog_name);
- GridData gridData = new GridData();
- tableLabel.setLayoutData(gridData);
-
- this.tableCombo = new Combo(composite, SWT.LEFT);
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.tableCombo.setLayoutData(gridData);
-
- // catalog
- Label catalogLabel = new Label(composite, SWT.LEFT);
- catalogLabel.setText(JptUiDetailsMessages.SecondaryTableDialog_catalog);
- gridData = new GridData();
- catalogLabel.setLayoutData(gridData);
-
- this.catalogCombo = new Combo(composite, SWT.LEFT);
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.catalogCombo.setLayoutData(gridData);
-
- // schema
- Label schemaLabel = new Label(composite, SWT.LEFT);
- schemaLabel.setText(JptUiDetailsMessages.SecondaryTableDialog_schema);
- gridData = new GridData();
- schemaLabel.setLayoutData(gridData);
-
- this.schemaCombo = new Combo(composite, SWT.LEFT);
- gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.schemaCombo.setLayoutData(gridData);
-
- this.initializeCatalogCombo();
- this.initializeSchemaCombo();
- this.initializeTableCombo();
-
- return composite;
- }
-
- @Override
- protected Control createContents(Composite parent) {
- Composite composite = (Composite) super.createContents(parent);
-
- this.tableCombo.addModifyListener(buildTableModifyListener());
- this.catalogCombo.addSelectionListener(this.buildCatalogSelectionListener());
- this.schemaCombo.addSelectionListener(this.buildSchemaSelectionListener());
- this.refreshButtons();
- return composite;
- }
-
- protected void initializeCatalogCombo() {
- this.populateCatalogCombo();
-
- if (this.isAddDialog()) {
- this.catalogCombo.select(0); // out-of-bounds index is ignored
- } else {
- String specifiedCatalog = this.secondaryTable.getSpecifiedCatalog();
- if (specifiedCatalog == null) {
- this.catalogCombo.select(0); // out-of-bounds index is ignored
- } else {
- this.catalogCombo.setText(specifiedCatalog);
- }
- }
- }
-
- protected void populateCatalogCombo() {
- Database database = this.getDatabase();
- if ((database != null) && ! database.supportsCatalogs()) {
- this.catalogCombo.setEnabled(false);
- return;
- }
-
- // add the default catalog first
- if (this.defaultCatalog != null) {
- this.catalogCombo.add(NLS.bind(JptUiDetailsMessages.SecondaryTableDialog_defaultCatalog, this.defaultCatalog));
- }
-
- if (database != null) {
- for (String identifier : database.getSortedCatalogIdentifiers()) {
- this.catalogCombo.add(identifier);
- }
- }
- }
-
- protected void initializeSchemaCombo() {
- this.populateSchemaCombo();
-
- if (this.isAddDialog()) {
- this.schemaCombo.select(0); // out-of-bounds index is ignored
- } else {
- String specifiedSchema = this.secondaryTable.getSpecifiedSchema();
- if (specifiedSchema == null) {
- this.schemaCombo.select(0); // out-of-bounds index is ignored
- } else {
- this.schemaCombo.setText(specifiedSchema);
- }
- }
- }
-
- // assume the catalog combo has been populated by now
- protected void populateSchemaCombo() {
- // add the default schema first
- if (this.defaultSchema != null) {
- this.schemaCombo.add(NLS.bind(JptUiDetailsMessages.SecondaryTableDialog_defaultSchema, this.defaultSchema));
- }
-
- SchemaContainer sc = this.getCurrentDbSchemaContainer();
- if (sc != null) {
- for (String identifier : sc.getSortedSchemaIdentifiers()) {
- this.schemaCombo.add(identifier);
- }
- }
- }
-
- protected void initializeTableCombo() {
- this.populateTableCombo();
-
- if (this.isEditDialog()) {
- String specifiedName = this.secondaryTable.getSpecifiedName();
- if (specifiedName != null) {
- this.tableCombo.setText(specifiedName);
- }
- }
- }
-
- // assume the schema combo has been populated by now
- protected void populateTableCombo() {
- // we don't need to add a "default" to the table combo
- Schema dbSchema = this.getCurrentDbSchema();
- if (dbSchema != null) {
- for (String identifier : dbSchema.getSortedTableIdentifiers()) {
- this.tableCombo.add(identifier);
- }
- }
- }
-
-
- // ********** listeners **********
-
- protected SelectionListener buildCatalogSelectionListener() {
- return new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- SecondaryTableDialog.this.selectedCatalogChanged();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- SecondaryTableDialog.this.selectedCatalogChanged();
- }
- @Override
- public String toString() {
- return "catalog selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- protected void selectedCatalogChanged() {
- this.refreshSchemaCombo();
- this.refreshTableCombo();
- }
-
- protected void refreshSchemaCombo() {
- String schema = this.schemaCombo.getText();
- this.schemaCombo.removeAll();
- this.populateSchemaCombo();
- this.schemaCombo.setText(schema);
- }
-
- protected SelectionListener buildSchemaSelectionListener() {
- return new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- SecondaryTableDialog.this.selectedSchemaChanged();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- SecondaryTableDialog.this.selectedSchemaChanged();
- }
- @Override
- public String toString() {
- return "schema selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- protected void selectedSchemaChanged() {
- this.refreshTableCombo();
- }
-
- protected void refreshTableCombo() {
- String table = this.tableCombo.getText();
- this.tableCombo.removeAll();
- this.populateTableCombo();
- this.tableCombo.setText(table);
- }
-
- protected ModifyListener buildTableModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent event) {
- SecondaryTableDialog.this.tableChanged();
- }
- @Override
- public String toString() {
- return "table modify listener"; //$NON-NLS-1$
- }
- };
- }
-
- protected void tableChanged() {
- this.refreshButtons();
- }
-
- // ********** convenience methods **********
-
- protected boolean isAddDialog() {
- return this.secondaryTable == null;
- }
-
- protected boolean isEditDialog() {
- return ! this.isAddDialog();
- }
-
- protected Database getDatabase() {
- return this.jpaProject.getDataSource().getDatabase();
- }
-
- protected SchemaContainer getCurrentDbSchemaContainer() {
- Database database = this.getDatabase();
- if (database == null) {
- return null;
- }
- if ( ! database.supportsCatalogs()) {
- return database;
- }
- String catalog = this.getCurrentCatalog();
- return (catalog == null) ? null : database.getCatalogForIdentifier(catalog);
- }
-
- protected String getCurrentCatalog() {
- if ((this.defaultCatalog != null) && (this.catalogCombo.getSelectionIndex() == 0)) {
- return this.defaultCatalog;
- }
- return convertText(this.catalogCombo);
- }
-
- protected Schema getCurrentDbSchema() {
- String schema = this.getCurrentSchema();
- if (schema == null) {
- return null;
- }
- SchemaContainer sc = this.getCurrentDbSchemaContainer();
- return (sc == null) ? null : sc.getSchemaForIdentifier(schema);
- }
-
- protected String getCurrentSchema() {
- if ((this.defaultSchema != null) && (this.schemaCombo.getSelectionIndex() == 0)) {
- return this.defaultSchema;
- }
- return convertText(this.schemaCombo);
- }
-
- protected void refreshButtons() {
- this.getButton(IDialogConstants.OK_ID).setEnabled(this.validateEntryValues());
- }
-
- protected boolean validateEntryValues() {
- return ! StringTools.stringIsEmpty(this.tableCombo.getText());
- }
-
-
- // ********** close **********
-
- /**
- * set all the various values queried by clients once the dialog is closed
- */
- @Override
- public boolean close() {
- this.selectedTable = this.tableCombo.getText();
- this.selectedCatalog = convertText(this.catalogCombo, this.defaultCatalog);
- this.selectedSchema = convertText(this.schemaCombo, this.defaultSchema);
- return super.close();
- }
-
- /**
- * return null if:
- * - the default value is selected
- * - the combo's text is empty
- */
- protected static String convertText(Combo combo, String defaultText) {
- // if the default text is present, then it will be the combo's first selection
- if ((defaultText != null) && (combo.getSelectionIndex() == 0)) {
- return null;
- }
- return convertText(combo);
- }
-
- /**
- * return null if the combo's text is empty
- */
- protected static String convertText(Combo combo) {
- String text = combo.getText();
- return (text.length() == 0) ? null : text;
- }
-
-
- // ********** public API **********
-
- /**
- * Return the selected table. Return an empty string if nothing
- * is selected (since there is no default).
- */
- public String getSelectedTable() {
- return this.selectedTable;
- }
-
- /**
- * Return the selected catalog. Return null if either nothing or
- * the default catalog is selected.
- */
- public String getSelectedCatalog() {
- return this.selectedCatalog;
- }
-
- /**
- * Return the selected schema. Return null if either nothing or
- * the default schema is selected.
- */
- public String getSelectedSchema() {
- return this.selectedSchema;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/SequenceGeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/SequenceGeneratorComposite.java
deleted file mode 100644
index 585a418f98..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/SequenceGeneratorComposite.java
+++ /dev/null
@@ -1,136 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SequenceCombo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ----------------------------------------------------- |
- * | Name: | I | |
- * | ----------------------------------------------------- |
- * | ----------------------------------------------------- |
- * | Sequence Generator: | SequenceCombo | |
- * | ----------------------------------------------------- |
- * | ------------- |
- * | Allocation Size: | I |I| |
- * | ------------- |
- * | ------------- |
- * | Initial Value: | |I| |
- * | ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see IdMapping
- * @see SequenceGenerator
- * @see IdMappingGenerationComposite - The parent container
- * @see SequenceCombo
- *
- * @version 2.2
- * @since 1.0
- */
-public class SequenceGeneratorComposite extends GeneratorComposite<SequenceGenerator>
-{
-
- public SequenceGeneratorComposite(Pane<?> parentPane,
- PropertyValueModel<SequenceGenerator> subjectHolder,
- Composite parent,
- GeneratorBuilder<SequenceGenerator> builder) {
-
- super(parentPane, subjectHolder, parent, builder);
- }
-
- @Override
- protected String getPropertyName() {
- return GeneratorContainer.SEQUENCE_GENERATOR_PROPERTY;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- addLabeledText(
- container,
- JptUiDetailsMessages.SequenceGeneratorComposite_name,
- buildGeneratorNameHolder(),
- JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_NAME
- );
-
- // Sequence Generator widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.SequenceGeneratorComposite_sequence,
- buildSequenceNameCombo(container),
- JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_SEQUENCE
- );
-
- addAllocationSizeCombo(container);
- addInitialValueCombo(container);
- }
-
- protected SequenceCombo<SequenceGenerator> buildSequenceNameCombo(Composite parent) {
-
- return new SequenceCombo<SequenceGenerator>(this, getSubjectHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(SequenceGenerator.DEFAULT_SEQUENCE_NAME_PROPERTY);
- propertyNames.add(SequenceGenerator.SPECIFIED_SEQUENCE_NAME_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return this.getSubject().getDefaultSequenceName();
- }
-
- @Override
- protected void setValue(String value) {
- retrieveGenerator().setSpecifiedSequenceName(value);
- }
-
- @Override
- protected String getValue() {
- return (getSubject() == null) ? null : getSubject().getSpecifiedSequenceName();
- }
-
- @Override
- protected boolean nullSubjectIsAllowed() {
- return true;
- }
-
- /**
- * subject may be null, so delegate to the composite
- */
- @Override
- protected JpaProject getJpaProject() {
- return SequenceGeneratorComposite.this.getJpaProject();
- }
-
- @Override
- protected Schema getDbSchema_() {
- return this.getSubject().getDbSchema();
- }
-
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableComposite.java
deleted file mode 100644
index e9d50f1c02..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableComposite.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.TableCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | - Table ----------------------------------------------------------------- |
- * | | ------------------------------------------------------------ | |
- * | | Table: | TableCombo | | |
- * | | ------------------------------------------------------------ | |
- * | | ------------------------------------------------------------ | |
- * | | Catalog: | CatalogCombo | | |
- * | | ------------------------------------------------------------ | |
- * | | ------------------------------------------------------------ | |
- * | | Schema: | SchemaCombo | | |
- * | | ------------------------------------------------------------ | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Table
- * @see EntityComposite - The parent container
- * @see TableCombo
- * @see CatalogCombo
- * @see SchemaCombo
- *
- * @TODO repopulate this panel based on the Entity table changing
- *
- * @version 2.0
- * @since 1.0
- */
-public class TableComposite extends Pane<Entity>
-{
- /**
- * Creates a new <code>TableComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject
- * @param parent The parent container
- */
- public TableComposite(Pane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Table group pane
- Group tableGroupPane = addTitledGroup(
- container,
- JptUiDetailsMessages.TableComposite_tableSection
- );
-
- PropertyValueModel<Table> subjectHolder = buildTableHolder();
- // Table widgets
- addLabeledComposite(
- tableGroupPane,
- JptUiDetailsMessages.TableChooser_label,
- addTableCombo(subjectHolder, tableGroupPane),
- JpaHelpContextIds.ENTITY_TABLE
- );
-
- // Catalog widgets
- addLabeledComposite(
- tableGroupPane,
- JptUiDetailsMessages.CatalogChooser_label,
- addCatalogCombo(subjectHolder, tableGroupPane),
- JpaHelpContextIds.ENTITY_CATALOG
- );
-
- // Schema widgets
- addLabeledComposite(
- tableGroupPane,
- JptUiDetailsMessages.SchemaChooser_label,
- addSchemaCombo(subjectHolder, tableGroupPane),
- JpaHelpContextIds.ENTITY_SCHEMA
- );
-
- new PaneEnabler(buildTableEnabledHolder(), this);
- }
-
- protected ModifiablePropertyValueModel<Table> buildTableHolder() {
-
- return new PropertyAspectAdapter<Entity, Table>(getSubjectHolder(), Entity.TABLE_IS_UNDEFINED_PROPERTY) {
- @Override
- protected Table buildValue_() {
- return this.subject.tableIsUndefined() ? null : this.subject.getTable();
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildTableEnabledHolder() {
- return new PropertyAspectAdapter<Entity, Boolean>(getSubjectHolder(), Entity.SPECIFIED_TABLE_IS_ALLOWED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.specifiedTableIsAllowed());
- }
- };
- }
-
- private CatalogCombo<Table> addCatalogCombo(PropertyValueModel<Table> tableHolder, Composite container) {
-
- return new CatalogCombo<Table>(this, tableHolder, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(Table.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultCatalog();
- }
-
- @Override
- protected void setValue(String value) {
- getSubject().setSpecifiedCatalog(value);
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedCatalog();
- }
- };
- }
-
- private SchemaCombo<Table> addSchemaCombo(PropertyValueModel<Table> subjectHolder, Composite container) {
-
- return new SchemaCombo<Table>(this, subjectHolder, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(Table.SPECIFIED_SCHEMA_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultSchema();
- }
-
- @Override
- protected void setValue(String value) {
- getSubject().setSpecifiedSchema(value);
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedSchema();
- }
-
- @Override
- protected SchemaContainer getDbSchemaContainer_() {
- return this.getSubject().getDbSchemaContainer();
- }
- };
- }
-
- private TableCombo<Table> addTableCombo(PropertyValueModel<Table> subjectHolder, Composite container) {
-
- return new TableCombo<Table>(this, subjectHolder, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(Table.DEFAULT_NAME_PROPERTY);
- propertyNames.add(Table.SPECIFIED_NAME_PROPERTY);
- propertyNames.add(Table.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(Table.SPECIFIED_SCHEMA_PROPERTY);
- propertyNames.add(Table.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(Table.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- super.propertyChanged(propertyName);
- if (propertyName == Table.DEFAULT_SCHEMA_PROPERTY
- || propertyName == Table.SPECIFIED_SCHEMA_PROPERTY
- || propertyName == Table.DEFAULT_CATALOG_PROPERTY
- || propertyName == Table.SPECIFIED_CATALOG_PROPERTY ) {
- repopulate();
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return this.getSubject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- this.getSubject().setSpecifiedName(value);
- }
-
- @Override
- protected String getValue() {
- return this.getSubject().getSpecifiedName();
- }
-
- @Override
- protected Schema getDbSchema_() {
- return this.getSubject().getDbSchema();
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableGeneratorComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableGeneratorComposite.java
deleted file mode 100644
index 3cc2853ef4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TableGeneratorComposite.java
+++ /dev/null
@@ -1,499 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.ColumnCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.TableCombo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ----------------------------------------------- |
- * | Name: | I | |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Table: | TableCombo | |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Catalog: | CatalogCombo | |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Schema: | SchemaCombo | |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Primary Key Column: | ColumnCombo | |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Value Column: | ColumnCombo | |
- * | ----------------------------------------------- |
- * | ----------------------------------------------- |
- * | Primary Key Column Value: | ColumnCombo | |
- * | ----------------------------------------------- |
- * | ------------- |
- * | Allocation Size: | I |I| Default (XX) |
- * | ------------- |
- * | ------------- |
- * | Initial Value: | I |I| Default (XX) |
- * | ------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see IdMapping
- * @see TableGenerator
- * @see IdMappingGenerationComposite - The parent container
- * @see CatalogCombo
- * @see ColumnCombo
- * @see SchemaCombo
- * @see TableCombo
- *
- * @version 2.2
- * @since 1.0
- */
-public class TableGeneratorComposite extends GeneratorComposite<TableGenerator>
-{
-
-
- public TableGeneratorComposite(Pane<?> parentPane,
- PropertyValueModel<TableGenerator> subjectHolder,
- Composite parent,
- GeneratorBuilder<TableGenerator> builder) {
-
- super(parentPane, subjectHolder, parent, builder);
- }
-
- @Override
- protected String getPropertyName() {
- return GeneratorContainer.TABLE_GENERATOR_PROPERTY;
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- addLabeledText(
- container,
- JptUiDetailsMessages.TableGeneratorComposite_name,
- buildGeneratorNameHolder(),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_NAME
- );
-
- // Table widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.TableGeneratorComposite_table,
- addTableNameCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_TABLE
- );
-
- // Schema widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.TableGeneratorComposite_schema,
- addSchemaCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_SCHEMA
- );
-
- // Catalog widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.TableGeneratorComposite_catalog,
- addCatalogCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_CATALOG
- );
-
- // Primary Key Column widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.TableGeneratorComposite_pkColumn,
- addPkColumnNameCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN
- );
-
- // Value Column widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.TableGeneratorComposite_valueColumn,
- addValueColumnCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_VALUE_COLUMN
- );
-
- // Primary Key Column Value widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.TableGeneratorComposite_pkColumnValue,
- addPkColumnValueCombo(container),
- JpaHelpContextIds.MAPPING_TABLE_GENERATOR_PRIMARY_KEY_COLUMN_VALUE
- );
-
- addAllocationSizeCombo(container);
- addInitialValueCombo(container);
- }
-
- private CatalogCombo<TableGenerator> addCatalogCombo(Composite container) {
-
- return new CatalogCombo<TableGenerator>(this, getSubjectHolder(), container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultCatalog();
- }
-
- @Override
- protected boolean nullSubjectIsAllowed() {
- return true;
- }
-
- /**
- * subject may be null, so delegate to the composite
- */
- @Override
- protected JpaProject getJpaProject() {
- return TableGeneratorComposite.this.getJpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- retrieveGenerator().setSpecifiedCatalog(value);
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedCatalog();
- }
- };
- }
-
- private ColumnCombo<TableGenerator> addPkColumnNameCombo(Composite parent) {
-
- return new ColumnCombo<TableGenerator>(this, getSubjectHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_PK_COLUMN_NAME_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_PK_COLUMN_NAME_PROPERTY);
- propertyNames.add(TableGenerator.DEFAULT_TABLE_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_TABLE_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- if (propertyName == TableGenerator.DEFAULT_TABLE_PROPERTY ||
- propertyName == TableGenerator.SPECIFIED_TABLE_PROPERTY) {
- this.repopulateComboBox();
- } else {
- super.propertyChanged(propertyName);
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultPkColumnName();
- }
-
- @Override
- protected boolean nullSubjectIsAllowed() {
- return true;
- }
-
- /**
- * subject may be null, so delegate to the composite
- */
- @Override
- protected JpaProject getJpaProject() {
- return TableGeneratorComposite.this.getJpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- retrieveGenerator().setSpecifiedPkColumnName(value);
- }
-
- @Override
- protected Table getDbTable_() {
- return getSubject().getDbTable();
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedPkColumnName();
- }
- };
- }
-
- private ColumnCombo<TableGenerator> addPkColumnValueCombo(Composite parent) {
-
- return new ColumnCombo<TableGenerator>(this, getSubjectHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_PK_COLUMN_VALUE_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_PK_COLUMN_VALUE_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultPkColumnValue();
- }
-
- @Override
- protected boolean nullSubjectIsAllowed() {
- return true;
- }
-
- /**
- * subject may be null, so delegate to the composite
- */
- @Override
- protected JpaProject getJpaProject() {
- return TableGeneratorComposite.this.getJpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- retrieveGenerator().setSpecifiedPkColumnValue(value);
- }
-
- @Override
- protected Table getDbTable_() {
- return getSubject().getDbTable();
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedPkColumnValue();
- }
- };
- }
-
- private SchemaCombo<TableGenerator> addSchemaCombo(Composite container) {
-
- return new SchemaCombo<TableGenerator>(this, getSubjectHolder(), container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_SCHEMA_PROPERTY);
- propertyNames.add(TableGenerator.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- if (propertyName == TableGenerator.DEFAULT_CATALOG_PROPERTY
- || propertyName == TableGenerator.SPECIFIED_CATALOG_PROPERTY ) {
- repopulateComboBox();
- }
- else {
- super.propertyChanged(propertyName);
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultSchema();
- }
-
- @Override
- protected boolean nullSubjectIsAllowed() {
- return true;
- }
-
- /**
- * subject may be null, so delegate to the composite
- */
- @Override
- protected JpaProject getJpaProject() {
- return TableGeneratorComposite.this.getJpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- retrieveGenerator().setSpecifiedSchema(value);
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedSchema();
- }
-
- @Override
- protected SchemaContainer getDbSchemaContainer() {
- TableGenerator tg = this.getSubject();
- if (tg != null) {
- return tg.getDbSchemaContainer();
- }
- return TableGeneratorComposite.this.getSubject().getContextDefaultDbSchemaContainer();
- }
-
- @Override
- protected SchemaContainer getDbSchemaContainer_() {
- // we overrode #getDbSchemaContainer() instead
- throw new UnsupportedOperationException();
- }
- };
- }
-
- private TableCombo<TableGenerator> addTableNameCombo(Composite parent) {
-
- return new TableCombo<TableGenerator>(this, getSubjectHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_TABLE_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_TABLE_PROPERTY);
- propertyNames.add(TableGenerator.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_SCHEMA_PROPERTY);
- propertyNames.add(TableGenerator.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- if (propertyName == TableGenerator.DEFAULT_SCHEMA_PROPERTY
- || propertyName == TableGenerator.SPECIFIED_SCHEMA_PROPERTY
- || propertyName == TableGenerator.DEFAULT_CATALOG_PROPERTY
- || propertyName == TableGenerator.SPECIFIED_CATALOG_PROPERTY ) {
- repopulateComboBox();
- }
- else {
- super.propertyChanged(propertyName);
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return this.getSubject().getDefaultTable();
- }
-
- @Override
- protected boolean nullSubjectIsAllowed() {
- return true;
- }
-
- /**
- * subject may be null, so delegate to the composite
- */
- @Override
- protected JpaProject getJpaProject() {
- return TableGeneratorComposite.this.getJpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- retrieveGenerator().setSpecifiedTable(value);
- }
-
- @Override
- protected String getValue() {
- return this.getSubject().getSpecifiedTable();
- }
-
- @Override
- protected Schema getDbSchema() {
- TableGenerator tg = this.getSubject();
- if (tg != null) {
- return tg.getDbSchema();
- }
- return TableGeneratorComposite.this.getSubject().getContextDefaultDbSchema();
- }
-
- @Override
- protected Schema getDbSchema_() {
- // we overrode #getDbSchema() instead
- throw new UnsupportedOperationException();
- }
-
- };
- }
-
- private ColumnCombo<TableGenerator> addValueColumnCombo(Composite parent) {
-
- return new ColumnCombo<TableGenerator>(this, getSubjectHolder(), parent) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(TableGenerator.DEFAULT_VALUE_COLUMN_NAME_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_VALUE_COLUMN_NAME_PROPERTY);
- propertyNames.add(TableGenerator.DEFAULT_TABLE_PROPERTY);
- propertyNames.add(TableGenerator.SPECIFIED_TABLE_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- if (propertyName == TableGenerator.DEFAULT_TABLE_PROPERTY ||
- propertyName == TableGenerator.SPECIFIED_TABLE_PROPERTY) {
- this.repopulateComboBox();
- } else {
- super.propertyChanged(propertyName);
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultValueColumnName();
- }
-
- @Override
- protected boolean nullSubjectIsAllowed() {
- return true;
- }
-
- /**
- * subject may be null, so delegate to the composite
- */
- @Override
- protected JpaProject getJpaProject() {
- return TableGeneratorComposite.this.getJpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- retrieveGenerator().setSpecifiedValueColumnName(value);
- }
-
- @Override
- protected Table getDbTable_() {
- return getSubject().getDbTable();
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedValueColumnName();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TargetEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TargetEntityComposite.java
deleted file mode 100644
index ca0924c49a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TargetEntityComposite.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2006, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * target entity hyperlink label, combo and browse button
- */
-public class TargetEntityComposite
- extends ClassChooserComboPane<RelationshipMapping>
-{
- /**
- * Creates a new <code>TargetEntityComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TargetEntityComposite(
- Pane<? extends RelationshipMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected String getClassName() {
- return getSubject().getTargetEntity();
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setSpecifiedTargetEntity(className);
- }
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages.TargetEntityChooser_label;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.MAPPING_TARGET_ENTITY;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getTargetEntityEnclosingTypeSeparator();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedTargetEntity();
- }
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<RelationshipMapping, String>(
- this.getSubjectHolder(),
- RelationshipMapping.SPECIFIED_TARGET_ENTITY_PROPERTY,
- RelationshipMapping.DEFAULT_TARGET_ENTITY_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = this.subject.getSpecifiedTargetEntity();
- if (name == null) {
- name = TargetEntityComposite.this.getDefaultValue(this.subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(this.subject).equals(value)) {
- value = null;
- }
- this.subject.setSpecifiedTargetEntity(value);
- }
- };
- }
-
- @Override
- protected ListValueModel<String> buildClassListHolder() {
- return this.buildDefaultProfilerListHolder();
- }
-
- private ListValueModel<String> buildDefaultProfilerListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultProfilerHolder()
- );
- }
-
- private PropertyValueModel<String> buildDefaultProfilerHolder() {
- return new PropertyAspectAdapter<RelationshipMapping, String>(this.getSubjectHolder(), RelationshipMapping.DEFAULT_TARGET_ENTITY_PROPERTY) {
- @Override
- protected String buildValue_() {
- return TargetEntityComposite.this.getDefaultValue(this.subject);
- }
- };
- }
-
- private String getDefaultValue(RelationshipMapping subject) {
- String defaultValue = subject.getDefaultTargetEntity();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeComposite.java
deleted file mode 100644
index b0efc9abd4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TemporalTypeComposite.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import java.util.Comparator;
-import java.util.List;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimpleListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.swt.widgets.Composite;
-
-import com.ibm.icu.text.Collator;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | --------------------------------------------------------------- |
- * | Temporal: | |v| |
- * | --------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see ColumnMapping
- * @see TemporalType
- * @see BasicMappingComposite - A container of this pane
- * @see IdMappingComposite - A container of this pane
- * @see VersionMappingComposite - A container of this pane
- *
- * @version 2.0
- * @since 1.0
- */
-public class TemporalTypeComposite extends Pane<BaseTemporalConverter> {
-
- /**
- * Creates a new <code>TemporalTypeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TemporalTypeComposite(PropertyValueModel<? extends BaseTemporalConverter> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addCombo(
- container,
- buildTemporalTypeListHolder(),
- buildTemporalTypeHolder(),
- buildTemporalTypeConverter(),
- buildBooleanHolder()
- );
- }
-
- private ModifiablePropertyValueModel<TemporalType> buildTemporalTypeHolder() {
- return new PropertyAspectAdapter<BaseTemporalConverter, TemporalType>(getSubjectHolder(), BaseTemporalConverter.TEMPORAL_TYPE_PROPERTY) {
- @Override
- protected TemporalType buildValue_() {
- return this.subject.getTemporalType();
- }
-
- @Override
- protected void setValue_(TemporalType value) {
- this.subject.setTemporalType(value);
- }
- };
- }
-
- private ListValueModel<TemporalType> buildTemporalTypeListHolder() {
- return new SimpleListValueModel<TemporalType>(
- buildSortedTemporalTypeList()
- );
- }
-
- private List<TemporalType> buildSortedTemporalTypeList() {
- return CollectionTools.sort(CollectionTools.list(TemporalType.values()), this.buildTemporalTypeComparator());
- }
-
- private Comparator<TemporalType> buildTemporalTypeComparator() {
- return new Comparator<TemporalType>() {
- public int compare(TemporalType type1, TemporalType type2) {
- String displayString1 = displayString(type1);
- String displayString2 = displayString(type2);
- return Collator.getInstance().compare(displayString1, displayString2);
- }
- };
- }
-
- private StringConverter<TemporalType> buildTemporalTypeConverter() {
- return new StringConverter<TemporalType>() {
- public String convertToString(TemporalType value) {
- return (value == null) ? null : displayString(value);
- }
- };
- }
-
- String displayString(TemporalType temporalType) {
- switch (temporalType) {
- case DATE :
- return JptUiDetailsMessages.TemporalTypeComposite_date;
- case TIME :
- return JptUiDetailsMessages.TemporalTypeComposite_time;
- case TIMESTAMP :
- return JptUiDetailsMessages.TemporalTypeComposite_timestamp;
- default :
- throw new IllegalStateException();
- }
- }
-
- protected PropertyValueModel<Boolean> buildBooleanHolder() {
- return new TransformationPropertyValueModel<BaseTemporalConverter, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(BaseTemporalConverter value) {
- if (getSubject() != null && getSubject().getParent().getPersistentAttribute().isVirtual()) {
- return Boolean.FALSE;
- }
- return Boolean.valueOf(value != null);
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TransientMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TransientMappingComposite.java
deleted file mode 100644
index f6768f3d1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/TransientMappingComposite.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see TransientMapping
- *
- * @version 2.0
- * @since 1.0
- */
-public class TransientMappingComposite extends Pane<TransientMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>TransientMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>ITransientMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public TransientMappingComposite(PropertyValueModel<? extends TransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/VersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/VersionMappingComposite.java
deleted file mode 100644
index 1d5c4a60b4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/VersionMappingComposite.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see VersionMapping
- * @see ColumnComposite
- * @see TemporalTypeComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public class VersionMappingComposite
- extends AbstractVersionMappingComposite<VersionMapping>
-{
- /**
- * Creates a new <code>VersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IVersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public VersionMappingComposite(PropertyValueModel<? extends VersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeVersionSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/CatalogCombo.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/CatalogCombo.java
deleted file mode 100644
index dff170cb8f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/CatalogCombo.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.db;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This combo-box displays the database's catalogs.
- */
-public abstract class CatalogCombo<T extends JpaNode>
- extends DatabaseObjectCombo<T>
-{
- public CatalogCombo(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- public CatalogCombo(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected Iterable<String> getValues_() {
- return this.getDatabase().getSortedCatalogIdentifiers();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/ColumnCombo.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/ColumnCombo.java
deleted file mode 100644
index 99243ac41a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/ColumnCombo.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.db;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This combo-box displays a table's columns.
- */
-public abstract class ColumnCombo<T extends JpaNode>
- extends DatabaseObjectCombo<T>
-{
- public ColumnCombo(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- public ColumnCombo(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected Iterable<String> getValues_() {
- Table dbTable = this.getDbTable();
- return (dbTable != null) ? dbTable.getSortedColumnIdentifiers() : EmptyIterable.<String>instance();
- }
-
- protected Table getDbTable() {
- return (this.getSubject() == null) ? null : this.getDbTable_();
- }
-
- /**
- * Assume the subject is not null.
- */
- protected abstract Table getDbTable_();
-
- @Override
- protected void tableChanged_(Table table) {
- super.tableChanged_(table);
- if (this.getDbTable() == table) {
- this.doPopulate();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/DatabaseObjectCombo.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/DatabaseObjectCombo.java
deleted file mode 100644
index 1a670e1ee3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/DatabaseObjectCombo.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.db;
-
-import org.eclipse.jpt.common.ui.internal.Tracing;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.ui.internal.widgets.ComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaDataSource;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ConnectionListener;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.ui.internal.listeners.SWTConnectionListenerWrapper;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This abstract pane keeps a combo in sync with the database objects
- * when a connection is active.
- *
- * @see CatalogCombo
- * @see ColumnCombo
- * @see SchemaCombo
- * @see SequenceCombo
- * @see TableCombo
- */
-@SuppressWarnings("nls")
-public abstract class DatabaseObjectCombo<T extends JpaNode>
- extends ComboPane<T>
-{
- /**
- * The listener added to the <code>ConnectionProfile</code>.
- * It keeps the combo in sync with the database metadata.
- */
- private ConnectionListener connectionListener;
-
- private PropertyChangeListener connectionProfileListener;
-
-
- // ********** constructors **********
-
- protected DatabaseObjectCombo(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- protected DatabaseObjectCombo(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- // ********** initialization **********
-
- @Override
- protected void initialize() {
- super.initialize();
- this.connectionListener = this.buildConnectionListener();
- this.connectionProfileListener = this.buildConnectionProfileListener();
- }
-
- protected ConnectionListener buildConnectionListener() {
- return new SWTConnectionListenerWrapper(this.buildConnectionListener_());
- }
-
- protected ConnectionListener buildConnectionListener_() {
- return new LocalConnectionListener();
- }
-
- protected PropertyChangeListener buildConnectionProfileListener() {
- return new SWTPropertyChangeListenerWrapper(this.buildConnectionProfileListener_());
- }
-
- protected PropertyChangeListener buildConnectionProfileListener_() {
- return new PropertyChangeListener(){
-
- public void propertyChanged(PropertyChangeEvent event) {
- connectionProfileChanged(event);
- }
- };
- }
-
- protected void connectionProfileChanged(PropertyChangeEvent event) {
- if (event.getOldValue() != null) {
- ((ConnectionProfile) event.getOldValue()).removeConnectionListener(this.connectionListener);
- }
- if (event.getNewValue() != null) {
- ((ConnectionProfile) event.getNewValue()).addConnectionListener(this.connectionListener);
- }
- this.repopulateComboBox();
- }
-
-
- // ********** overrides **********
-
- @Override
- protected void engageListeners_(T subject) {
- super.engageListeners_(subject);
-
- subject.getJpaProject().getDataSource().addPropertyChangeListener(JpaDataSource.CONNECTION_PROFILE_PROPERTY, this.connectionProfileListener);
- ConnectionProfile cp = subject.getJpaProject().getConnectionProfile();
- if (cp != null) {
- cp.addConnectionListener(this.connectionListener);
- }
- }
-
- @Override
- protected void disengageListeners_(T subject) {
- ConnectionProfile cp = subject.getJpaProject().getConnectionProfile();
- if (cp != null) {
- cp.removeConnectionListener(this.connectionListener);
- }
- subject.getJpaProject().getDataSource().removePropertyChangeListener(JpaDataSource.CONNECTION_PROFILE_PROPERTY, this.connectionProfileListener);
-
- super.disengageListeners_(subject);
- }
-
- @Override
- protected final Iterable<String> getValues() {
- return this.connectionProfileIsActive() ? this.getValues_() : EmptyIterable.<String>instance();
- }
-
- /**
- * Called only when connection profile is active
- */
- protected abstract Iterable<String> getValues_();
-
-
- // ********** convenience methods **********
-
- /**
- * Return the subject's JPA project.
- * Allow subclasses to override this method, so we can still get the JPA
- * project even when the subject is null.
- */
- protected JpaProject getJpaProject() {
- T subject = this.getSubject();
- return (subject == null) ? null : subject.getJpaProject();
- }
-
- /**
- * Return the subject's connection profile.
- */
- protected final ConnectionProfile getConnectionProfile() {
- JpaProject jpaProject = this.getJpaProject();
- return (jpaProject == null) ? null : jpaProject.getConnectionProfile();
- }
-
- /**
- * Return whether the subject's connection profile is active.
- */
- protected final boolean connectionProfileIsActive() {
- ConnectionProfile cp = this.getConnectionProfile();
- return (cp != null) && cp.isActive();
- }
-
- /**
- * Returns the subject's database.
- */
- protected final Database getDatabase() {
- ConnectionProfile cp = this.getConnectionProfile();
- return (cp == null) ? null : cp.getDatabase();
- }
-
-
- // ********** connection listener callbacks **********
-
- protected final void databaseChanged(Database database) {
- if ( ! this.comboBox.isDisposed()) {
- this.databaseChanged_(database);
- }
- }
-
- protected void databaseChanged_(@SuppressWarnings("unused") Database database) {
- // do nothing by default
- }
-
- protected final void catalogChanged(Catalog catalog) {
- if ( ! this.comboBox.isDisposed()) {
- this.catalogChanged_(catalog);
- }
- }
-
- protected void catalogChanged_(@SuppressWarnings("unused") Catalog catalog) {
- // do nothing by default
- }
-
- protected final void schemaChanged(Schema schema) {
- if ( ! this.comboBox.isDisposed()) {
- this.schemaChanged_(schema);
- }
- }
-
- protected void schemaChanged_(@SuppressWarnings("unused") Schema schema) {
- // do nothing by default
- }
-
- protected final void sequenceChanged(Sequence sequence) {
- if ( ! this.comboBox.isDisposed()) {
- this.sequenceChanged_(sequence);
- }
- }
-
- protected void sequenceChanged_(@SuppressWarnings("unused") Sequence sequence) {
- // do nothing by default
- }
-
- protected final void tableChanged(Table table) {
- if ( ! this.comboBox.isDisposed()) {
- this.tableChanged_(table);
- }
- }
-
- protected void tableChanged_(@SuppressWarnings("unused") Table table) {
- // do nothing by default
- }
-
- protected final void columnChanged(Column column) {
- if ( ! this.comboBox.isDisposed()) {
- this.columnChanged_(column);
- }
- }
-
- protected void columnChanged_(@SuppressWarnings("unused") Column column) {
- // do nothing by default
- }
-
- protected final void foreignKeyChanged(ForeignKey foreignKey) {
- if ( ! this.comboBox.isDisposed()) {
- this.foreignKeyChanged_(foreignKey);
- }
- }
-
- protected void foreignKeyChanged_(@SuppressWarnings("unused") ForeignKey foreignKey) {
- // do nothing by default
- }
-
- @Override
- protected void log(String flag, String message) {
- if (flag.equals(Tracing.UI_DB) && Tracing.booleanDebugOption(Tracing.UI_DB)) {
- this.log(message);
- } else {
- super.log(flag, message);
- }
- }
-
- // broaden accessibility a bit
- @Override
- protected void repopulateComboBox() {
- super.repopulateComboBox();
- }
-
-
- // ********** connection listener **********
-
- protected class LocalConnectionListener
- implements ConnectionListener
- {
- protected LocalConnectionListener() {
- super();
- }
-
- public void opened(ConnectionProfile profile) {
- this.log("opened: " + profile.getName());
- DatabaseObjectCombo.this.repopulateComboBox();
- }
-
- public void modified(ConnectionProfile profile) {
- this.log("modified: " + profile.getName());
- DatabaseObjectCombo.this.repopulateComboBox();
- }
-
- public boolean okToClose(ConnectionProfile profile) {
- this.log("OK to close: " + profile.getName());
- return true;
- }
-
- public void aboutToClose(ConnectionProfile profile) {
- this.log("about to close: " + profile.getName());
- }
-
- public void closed(ConnectionProfile profile) {
- this.log("closed: " + profile.getName());
- DatabaseObjectCombo.this.repopulateComboBox();
- }
-
- public void databaseChanged(ConnectionProfile profile, Database database) {
- this.log("database changed: " + database.getName());
- DatabaseObjectCombo.this.databaseChanged(database);
- }
-
- public void catalogChanged(ConnectionProfile profile, Catalog catalog) {
- this.log("catalog changed: " + catalog.getName());
- DatabaseObjectCombo.this.catalogChanged(catalog);
- }
-
- public void schemaChanged(ConnectionProfile profile, Schema schema) {
- this.log("schema changed: " + schema.getName());
- DatabaseObjectCombo.this.schemaChanged(schema);
- }
-
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence) {
- this.log("sequence changed: " + sequence.getName());
- DatabaseObjectCombo.this.sequenceChanged(sequence);
- }
-
- public void tableChanged(ConnectionProfile profile, Table table) {
- this.log("table changed: " + table.getName());
- DatabaseObjectCombo.this.tableChanged(table);
- }
-
- public void columnChanged(ConnectionProfile profile, Column column) {
- this.log("column changed: " + column.getName());
- DatabaseObjectCombo.this.columnChanged(column);
- }
-
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey) {
- this.log("foreign key changed: " + foreignKey.getName());
- DatabaseObjectCombo.this.foreignKeyChanged(foreignKey);
- }
-
- protected void log(String message) {
- DatabaseObjectCombo.this.log(Tracing.UI_DB, message);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/SchemaCombo.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/SchemaCombo.java
deleted file mode 100644
index cf3605efe6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/SchemaCombo.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.db;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This combo-box displays a schema container's schemata.
- */
-public abstract class SchemaCombo<T extends JpaNode>
- extends DatabaseObjectCombo<T>
-{
- public SchemaCombo(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- public SchemaCombo(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected Iterable<String> getValues_() {
- SchemaContainer sc = this.getDbSchemaContainer();
- return (sc != null) ? sc.getSortedSchemaIdentifiers() : EmptyIterable.<String>instance();
- }
-
- protected SchemaContainer getDbSchemaContainer() {
- return (this.getSubject() == null) ? null : this.getDbSchemaContainer_();
- }
-
- /**
- * Assume the subject is not null.
- */
- protected abstract SchemaContainer getDbSchemaContainer_();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/SequenceCombo.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/SequenceCombo.java
deleted file mode 100644
index c54ec57d03..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/SequenceCombo.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.db;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This combo-box displays a schema's sequences.
- */
-public abstract class SequenceCombo<T extends JpaNode>
- extends DatabaseObjectCombo<T>
-{
- public SequenceCombo(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected Iterable<String> getValues_() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema != null) ? dbSchema.getSortedSequenceIdentifiers() : EmptyIterable.<String>instance();
- }
-
- protected Schema getDbSchema() {
- return (this.getSubject() == null) ? null : this.getDbSchema_();
- }
-
- /**
- * Assume the subject is not null.
- */
- protected abstract Schema getDbSchema_();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/TableCombo.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/TableCombo.java
deleted file mode 100644
index c347b77c82..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/db/TableCombo.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.db;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This combo-box displays a schema's tables.
- */
-public abstract class TableCombo<T extends JpaNode>
- extends DatabaseObjectCombo<T>
-{
- public TableCombo(
- Pane<? extends T> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- public TableCombo(
- Pane<?> parentPane,
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected Iterable<String> getValues_() {
- Schema dbSchema = this.getDbSchema();
- return (dbSchema != null) ? dbSchema.getSortedTableIdentifiers() : EmptyIterable.<String>instance();
- }
-
- protected Schema getDbSchema() {
- return (this.getSubject() == null) ? null : this.getDbSchema_();
- }
-
- /**
- * Assume the subject is not null.
- */
- protected abstract Schema getDbSchema_();
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java
deleted file mode 100644
index 7fc8e2dc81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/AbstractJavaResourceUiDefinition.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayListIterator;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.MappingResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.structure.JavaStructureItemContentProviderFactory;
-import org.eclipse.jpt.jpa.ui.internal.structure.JavaStructureItemLabelProviderFactory;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * All the state in the definition should be "static" (i.e. unchanging once it is initialized).
- */
-public abstract class AbstractJavaResourceUiDefinition
- implements MappingResourceUiDefinition
-{
- private JavaTypeMappingUiDefinition<? extends TypeMapping>[] specifiedTypeMappingUiDefinitions;
-
- private JavaAttributeMappingUiDefinition<? extends AttributeMapping>[] specifiedAttributeMappingUiDefinitions;
-
- private DefaultJavaAttributeMappingUiDefinition<?>[] defaultAttributeMappingUiDefinitions;
-
- private final JavaUiFactory factory;
-
-
- /**
- * zero-argument constructor
- */
- protected AbstractJavaResourceUiDefinition() {
- super();
- this.factory = buildJavaUiFactory();
- }
-
-
- protected abstract JavaUiFactory buildJavaUiFactory();
-
- public JavaUiFactory getFactory() {
- return this.factory;
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- public static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
- new SimpleItemTreeStateProviderFactoryProvider(
- JavaStructureItemContentProviderFactory.instance(),
- JavaStructureItemLabelProviderFactory.instance()
- );
-
-
-
- // ********** type mapping ui definitions **********
-
- public JpaComposite buildTypeMappingComposite(
- String key,
- PropertyValueModel<TypeMapping> mappingHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- JavaTypeMappingUiDefinition<TypeMapping> mappingUiDefinition = getJavaTypeMappingUiDefinition(mappingHolder.getValue());
- return mappingUiDefinition.buildTypeMappingComposite(
- getFactory(),
- mappingHolder,
- parent,
- widgetFactory);
- }
-
- @SuppressWarnings("unchecked")
- protected JavaTypeMappingUiDefinition<TypeMapping> getJavaTypeMappingUiDefinition(TypeMapping typeMapping) {
- if (typeMapping == null || typeMapping.getKey() == null) {
- return (JavaTypeMappingUiDefinition<TypeMapping>) getDefaultTypeMappingUiDefinition();
- }
- return (JavaTypeMappingUiDefinition<TypeMapping>) getSpecifiedJavaTypeMappingUiDefinition(typeMapping.getKey());
- }
-
- protected JavaTypeMappingUiDefinition<? extends TypeMapping> getSpecifiedJavaTypeMappingUiDefinition(String mappingKey) {
- for (JavaTypeMappingUiDefinition<? extends TypeMapping> definition : getSpecifiedTypeMappingUiDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal type mapping key: " + mappingKey); //$NON-NLS-1$
- }
-
- public Iterator<MappingUiDefinition<PersistentType, ? extends TypeMapping>> typeMappingUiDefinitions() {
- return new ArrayIterator<MappingUiDefinition<PersistentType, ? extends TypeMapping>>(
- getSpecifiedTypeMappingUiDefinitions());
- }
-
- protected synchronized JavaTypeMappingUiDefinition<? extends TypeMapping>[] getSpecifiedTypeMappingUiDefinitions() {
- if (this.specifiedTypeMappingUiDefinitions == null) {
- this.specifiedTypeMappingUiDefinitions = buildSpecifiedTypeMappingUiDefinitions();
- }
- return this.specifiedTypeMappingUiDefinitions;
- }
-
- /**
- * Return an array of mapping definitions to use for types in mapping files of this type.
- * The order is unimportant.
- */
- protected JavaTypeMappingUiDefinition<? extends TypeMapping>[] buildSpecifiedTypeMappingUiDefinitions() {
- ArrayList<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions =
- new ArrayList<JavaTypeMappingUiDefinition<? extends TypeMapping>>();
- addSpecifiedTypeMappingUiDefinitionsTo(definitions);
- @SuppressWarnings("unchecked")
- JavaTypeMappingUiDefinition<? extends TypeMapping>[] definitionArray =
- definitions.toArray(new JavaTypeMappingUiDefinition[definitions.size()]);
- return definitionArray;
- }
-
- protected abstract void addSpecifiedTypeMappingUiDefinitionsTo(
- List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions);
-
- public DefaultJavaTypeMappingUiDefinition<? extends TypeMapping> getDefaultTypeMappingUiDefinition() {
- return NullJavaTypeMappingUiDefinition.instance();
- }
-
-
- // ********** attributes mapping UI definitions **********
-
- public JpaComposite buildAttributeMappingComposite(
- String key,
- PropertyValueModel<AttributeMapping> mappingHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- JavaAttributeMappingUiDefinition<AttributeMapping> mappingUiDefinition =
- getAttributeMappingUiDefinition(mappingHolder.getValue());
- return mappingUiDefinition.buildAttributeMappingComposite(
- getFactory(),
- mappingHolder,
- parent,
- widgetFactory);
- }
-
- @SuppressWarnings("unchecked")
- protected JavaAttributeMappingUiDefinition<AttributeMapping> getAttributeMappingUiDefinition(AttributeMapping attributeMapping) {
- String key = attributeMapping == null ? null : attributeMapping.getKey();
- if (attributeMapping == null || attributeMapping.isDefault()) {
- return (JavaAttributeMappingUiDefinition<AttributeMapping>) getDefaultAttributeMappingUiDefinition(key);
- }
- return (JavaAttributeMappingUiDefinition<AttributeMapping>) getSpecifiedAttributeMappingUiDefinition(key);
- }
-
- protected JavaAttributeMappingUiDefinition<? extends AttributeMapping> getSpecifiedAttributeMappingUiDefinition(String mappingKey) {
- for (JavaAttributeMappingUiDefinition<? extends AttributeMapping> definition : getSpecifiedAttributeMappingUiDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal attribute mapping key: " + mappingKey); //$NON-NLS-1$
- }
-
- public ListIterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>>
- attributeMappingUiDefinitions() {
-
- return new ArrayListIterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>>(
- getSpecifiedAttributeMappingUiDefinitions());
- }
-
- protected synchronized JavaAttributeMappingUiDefinition<? extends AttributeMapping>[] getSpecifiedAttributeMappingUiDefinitions() {
- if (this.specifiedAttributeMappingUiDefinitions == null) {
- this.specifiedAttributeMappingUiDefinitions = buildSpecifiedAttributeMappingUiDefinitions();
- }
- return this.specifiedAttributeMappingUiDefinitions;
- }
-
- /**
- * Return an array of mapping definitions to use for attributes in mapping files of this type.
- * The order is unimportant.
- */
- protected JavaAttributeMappingUiDefinition<? extends AttributeMapping>[] buildSpecifiedAttributeMappingUiDefinitions() {
- ArrayList<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions =
- new ArrayList<JavaAttributeMappingUiDefinition<? extends AttributeMapping>>();
- addSpecifiedAttributeMappingUiDefinitionsTo(definitions);
- @SuppressWarnings("unchecked")
- JavaAttributeMappingUiDefinition<? extends AttributeMapping>[] definitionArray =
- definitions.toArray(new JavaAttributeMappingUiDefinition[definitions.size()]);
- return definitionArray;
- }
-
- protected abstract void addSpecifiedAttributeMappingUiDefinitionsTo(
- List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions);
-
-
- // ********** default Java attribute mapping UI providers **********
-
- public DefaultJavaAttributeMappingUiDefinition<? extends AttributeMapping> getDefaultAttributeMappingUiDefinition(String key) {
- for (DefaultJavaAttributeMappingUiDefinition<? extends AttributeMapping> definition : getDefaultAttributeMappingUiDefinitions()) {
- if (Tools.valuesAreEqual(definition.getDefaultKey(), key)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal attribute mapping key: " + key); //$NON-NLS-1$
- }
-
- protected synchronized DefaultJavaAttributeMappingUiDefinition<? extends AttributeMapping>[] getDefaultAttributeMappingUiDefinitions() {
- if (this.defaultAttributeMappingUiDefinitions == null) {
- this.defaultAttributeMappingUiDefinitions = this.buildDefaultAttributeMappingUiDefinitions();
- }
- return this.defaultAttributeMappingUiDefinitions;
- }
-
- protected DefaultJavaAttributeMappingUiDefinition<?>[] buildDefaultAttributeMappingUiDefinitions() {
- ArrayList<DefaultJavaAttributeMappingUiDefinition<?>> definitions =
- new ArrayList<DefaultJavaAttributeMappingUiDefinition<?>>();
- addDefaultAttributeMappingUiDefinitionsTo(definitions);
- DefaultJavaAttributeMappingUiDefinition<?>[] definitionArray =
- definitions.toArray(new DefaultJavaAttributeMappingUiDefinition[definitions.size()]);
- return definitionArray;
- }
-
- protected abstract void addDefaultAttributeMappingUiDefinitionsTo(
- List<DefaultJavaAttributeMappingUiDefinition<?>> definitions);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/BaseJavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/BaseJavaUiFactory.java
deleted file mode 100644
index df7051717d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/BaseJavaUiFactory.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.BasicMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedIdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OneToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OneToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TransientMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.VersionMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.java.JavaEmbeddedMapping2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The default implementation of the UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- */
-public abstract class BaseJavaUiFactory implements JavaUiFactory
-{
-
- // **************** java type mapping composites ***************************
-
- public JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEntityComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEmbeddableComposite(
- PropertyValueModel<JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** orm type mapping composites ****************************
-
- public JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEntityComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmEmbeddableComposite(
- PropertyValueModel<OrmEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** java attribute mapping composites **********************
-
- public JpaComposite createJavaIdMappingComposite(
- PropertyValueModel<JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new IdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEmbeddedIdMappingComposite(
- PropertyValueModel<JavaEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EmbeddedIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaBasicMappingComposite(
- PropertyValueModel<JavaBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new BasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaVersionMappingComposite(
- PropertyValueModel<JavaVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new VersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaManyToOneMappingComposite(
- PropertyValueModel<JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new ManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaOneToManyMappingComposite(
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaOneToOneMappingComposite(
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaManyToManyMappingComposite(
- PropertyValueModel<JavaManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new ManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaEmbeddedMappingComposite(
- PropertyValueModel<JavaEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEmbeddedMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaTransientMappingComposite(
- PropertyValueModel<JavaTransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new TransientMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultBasicMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultBasicMappingUiDefinition.java
deleted file mode 100644
index fbed33d2a0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultBasicMappingUiDefinition.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class DefaultBasicMappingUiDefinition
- extends AbstractBasicMappingUiDefinition<ReadOnlyPersistentAttribute, JavaBasicMapping>
- implements DefaultJavaAttributeMappingUiDefinition<JavaBasicMapping>
-{
- // singleton
- private static final DefaultBasicMappingUiDefinition INSTANCE =
- new DefaultBasicMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingUiDefinition<JavaBasicMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private DefaultBasicMappingUiDefinition() {
- super();
- }
-
-
- @Override
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public String getLabel() {
- return JptUiDetailsMessages.DefaultBasicMappingUiProvider_label;
- }
-
- @Override
- public String getLinkLabel() {
- return JptUiDetailsMessages.DefaultBasicMappingUiProvider_linkLabel;
- }
-
- @Override
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getDefaultKey());
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultEmbeddedMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultEmbeddedMappingUiDefinition.java
deleted file mode 100644
index 6fed137b00..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/DefaultEmbeddedMappingUiDefinition.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class DefaultEmbeddedMappingUiDefinition
- extends AbstractEmbeddedMappingUiDefinition<ReadOnlyPersistentAttribute, JavaEmbeddedMapping>
- implements DefaultJavaAttributeMappingUiDefinition<JavaEmbeddedMapping>
-{
- // singleton
- private static final DefaultEmbeddedMappingUiDefinition INSTANCE =
- new DefaultEmbeddedMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingUiDefinition<JavaEmbeddedMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private DefaultEmbeddedMappingUiDefinition() {
- super();
- }
-
-
- @Override
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- public String getLabel() {
- return JptUiDetailsMessages.DefaultEmbeddedMappingUiProvider_label;
- }
-
- @Override
- public String getLinkLabel() {
- return JptUiDetailsMessages.DefaultEmbeddedMappingUiProvider_linkLabel;
- }
-
- @Override
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getDefaultKey());
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaEmbeddedMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/GenericJavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/GenericJavaResourceUiDefinition.java
deleted file mode 100644
index 48cbee1fb8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/GenericJavaResourceUiDefinition.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-
-public class GenericJavaResourceUiDefinition extends AbstractJavaResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new GenericJavaResourceUiDefinition();
-
- /**
- * Return the singleton.
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * zero-argument constructor
- */
- protected GenericJavaResourceUiDefinition() {
- super();
- }
-
- @Override
- protected JavaUiFactory buildJavaUiFactory() {
- return new GenericJavaUiFactory();
- }
-
- @Override
- protected void addSpecifiedAttributeMappingUiDefinitionsTo(
- List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(JavaIdMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedIdMappingUDefinition.instance());
- definitions.add(JavaBasicMappingUiDefinition.instance());
- definitions.add(JavaVersionMappingUiDefinition.instance());
- definitions.add(JavaManyToOneMappingUiDefinition.instance());
- definitions.add(JavaOneToManyMappingUiDefinition.instance());
- definitions.add(JavaOneToOneMappingUiDefinition.instance());
- definitions.add(JavaManyToManyMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedMappingUiDefinition.instance());
- definitions.add(JavaTransientMappingUiDefinition.instance());
- }
-
- @Override
- protected void addDefaultAttributeMappingUiDefinitionsTo(List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) {
- definitions.add(DefaultBasicMappingUiDefinition.instance());
- definitions.add(DefaultEmbeddedMappingUiDefinition.instance());
- definitions.add(NullJavaAttributeMappingUiDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedTypeMappingUiDefinitionsTo(List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
- definitions.add(JavaEntityUiDefinition.instance());
- definitions.add(JavaMappedSuperclassUiDefinition.instance());
- definitions.add(JavaEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/GenericJavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/GenericJavaUiFactory.java
deleted file mode 100644
index 7de34d3485..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/GenericJavaUiFactory.java
+++ /dev/null
@@ -1,23 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-/**
- * The default implementation of the Java UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- *
- * @see JavaUiFactory
- *
- * @version 3.0
- * @since 3.0
- */
-public class GenericJavaUiFactory extends BaseJavaUiFactory
-{
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaBasicMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaBasicMappingUiDefinition.java
deleted file mode 100644
index 466f197087..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaBasicMappingUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractBasicMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaBasicMappingUiDefinition
- extends AbstractBasicMappingUiDefinition<ReadOnlyPersistentAttribute, JavaBasicMapping>
- implements JavaAttributeMappingUiDefinition<JavaBasicMapping>
-{
- // singleton
- private static final JavaBasicMappingUiDefinition INSTANCE =
- new JavaBasicMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaBasicMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaBasicMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableComposite.java
deleted file mode 100644
index 18e1e4e806..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddableComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.0
- */
-public class JavaEmbeddableComposite extends AbstractEmbeddableComposite<Embeddable>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEmbeddableComposite(PropertyValueModel<? extends Embeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableUiDefinition.java
deleted file mode 100644
index 1c08a85eed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddableUiDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddableUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEmbeddableUiDefinition
- extends AbstractEmbeddableUiDefinition<PersistentType, JavaEmbeddable>
- implements JavaTypeMappingUiDefinition<JavaEmbeddable>
-{
- // singleton
- private static final JavaEmbeddableUiDefinition INSTANCE = new JavaEmbeddableUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingUiDefinition<JavaEmbeddable> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEmbeddableUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildTypeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaEmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedIdMappingUDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedIdMappingUDefinition.java
deleted file mode 100644
index 4dc119c813..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedIdMappingUDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedIdMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEmbeddedIdMappingUDefinition
- extends AbstractEmbeddedIdMappingUiDefinition<ReadOnlyPersistentAttribute, JavaEmbeddedIdMapping>
- implements JavaAttributeMappingUiDefinition<JavaEmbeddedIdMapping>
-{
- // singleton
- private static final JavaEmbeddedIdMappingUDefinition INSTANCE =
- new JavaEmbeddedIdMappingUDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaEmbeddedIdMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEmbeddedIdMappingUDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaEmbeddedIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedMappingUiDefinition.java
deleted file mode 100644
index ca1c784d1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEmbeddedMappingUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEmbeddedMappingUiDefinition
- extends AbstractEmbeddedMappingUiDefinition<ReadOnlyPersistentAttribute, JavaEmbeddedMapping>
- implements JavaAttributeMappingUiDefinition<JavaEmbeddedMapping>
-{
- // singleton
- private static final JavaEmbeddedMappingUiDefinition INSTANCE =
- new JavaEmbeddedMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaEmbeddedMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEmbeddedMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaEmbeddedMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityComposite.java
deleted file mode 100644
index 92c7659fc3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityComposite.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for a Java entity.
- *
- * @see JavaEntity
- * @see JavaUiFactory - The factory creating this pane
- * @see JavaSecondaryTablesComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public class JavaEntityComposite extends AbstractEntityComposite<JavaEntity>
-{
- /**
- * Creates a new <code>JavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEntityComposite(PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeSecondaryTablesSection(Composite container) {
- new JavaSecondaryTablesComposite(this, container);
- }
-
- @Override
- protected void initializeInheritanceSection(Composite container) {
- new JavaInheritanceComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityUiDefinition.java
deleted file mode 100644
index 2ec685800a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaEntityUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaEntityUiDefinition
- extends AbstractEntityUiDefinition<PersistentType, JavaEntity>
- implements JavaTypeMappingUiDefinition<JavaEntity>
-{
- // singleton
- private static final JavaEntityUiDefinition INSTANCE =
- new JavaEntityUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingUiDefinition<JavaEntity> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaEntityUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildTypeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaEntityComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaIdMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaIdMappingUiDefinition.java
deleted file mode 100644
index 929c049a43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaIdMappingUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractIdMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaIdMappingUiDefinition
- extends AbstractIdMappingUiDefinition<ReadOnlyPersistentAttribute, JavaIdMapping>
- implements JavaAttributeMappingUiDefinition<JavaIdMapping>
-{
- // singleton
- private static final JavaIdMappingUiDefinition INSTANCE =
- new JavaIdMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaIdMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- protected JavaIdMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaInheritanceComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaInheritanceComposite.java
deleted file mode 100644
index d029097866..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaInheritanceComposite.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractInheritanceComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for java inheritance.
- *
- * @see JavaEntity
- * @see JavaPrimaryKeyJoinColumnsComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class JavaInheritanceComposite extends AbstractInheritanceComposite<JavaEntity> {
-
- /**
- * Creates a new <code>JavaInheritanceComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public JavaInheritanceComposite(Pane<? extends JavaEntity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void addPrimaryKeyJoinColumnsComposite(Composite container) {
- new JavaPrimaryKeyJoinColumnsComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToManyMappingUiDefinition.java
deleted file mode 100644
index 900ce26972..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToManyMappingUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToManyMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaManyToManyMappingUiDefinition
- extends AbstractManyToManyMappingUiDefinition<ReadOnlyPersistentAttribute, JavaManyToManyMapping>
- implements JavaAttributeMappingUiDefinition<JavaManyToManyMapping>
-{
- // singleton
- private static final JavaManyToManyMappingUiDefinition INSTANCE =
- new JavaManyToManyMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaManyToManyMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaManyToManyMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToOneMappingUiDefinition.java
deleted file mode 100644
index 23e70b258b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaManyToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToOneMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaManyToOneMappingUiDefinition
- extends AbstractManyToOneMappingUiDefinition<ReadOnlyPersistentAttribute, JavaManyToOneMapping>
- implements JavaAttributeMappingUiDefinition<JavaManyToOneMapping>
-{
- // singleton
- private static final JavaManyToOneMappingUiDefinition INSTANCE =
- new JavaManyToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaManyToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaManyToOneMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassComposite.java
deleted file mode 100644
index 58fa35564f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassComposite.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractJavaMappedSuperclassComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | IdClassComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Queries ------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | QueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see MappedSuperclass
- * @see BaseJavaUiFactory - The factory creating this pane
- * @see IdClassComposite
- *
- * @version 2.3
- * @since 2.0
- */
-
-public class JavaMappedSuperclassComposite
- extends AbstractJavaMappedSuperclassComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaMappedSuperclassComposite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassUiDefinition.java
deleted file mode 100644
index 14d0c967d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaMappedSuperclassUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappedSuperclassUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaMappedSuperclassUiDefinition
- extends AbstractMappedSuperclassUiDefinition<PersistentType, JavaMappedSuperclass>
- implements JavaTypeMappingUiDefinition<JavaMappedSuperclass>
-{
- // singleton
- private static final JavaMappedSuperclassUiDefinition INSTANCE =
- new JavaMappedSuperclassUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaTypeMappingUiDefinition<JavaMappedSuperclass> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaMappedSuperclassUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildTypeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToManyMappingUiDefinition.java
deleted file mode 100644
index ca30448137..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToManyMappingUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToManyMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaOneToManyMappingUiDefinition
- extends AbstractOneToManyMappingUiDefinition<ReadOnlyPersistentAttribute, JavaOneToManyMapping>
- implements JavaAttributeMappingUiDefinition<JavaOneToManyMapping>
-{
- // singleton
- private static final JavaOneToManyMappingUiDefinition INSTANCE =
- new JavaOneToManyMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaOneToManyMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaOneToManyMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToOneMappingUiDefinition.java
deleted file mode 100644
index d96ee6166f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToOneMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaOneToOneMappingUiDefinition
- extends AbstractOneToOneMappingUiDefinition<ReadOnlyPersistentAttribute, JavaOneToOneMapping>
- implements JavaAttributeMappingUiDefinition<JavaOneToOneMapping>
-{
- // singleton
- private static final JavaOneToOneMappingUiDefinition INSTANCE =
- new JavaOneToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaOneToOneMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsPage.java
deleted file mode 100644
index 80046d9cbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsPage.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.internal.details.PersistentAttributeDetailsPage;
-import org.eclipse.jpt.jpa.ui.internal.details.PersistentAttributeMapAsComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The default implementation of the details page used for the Java persistent
- * attribute.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JavaPersistentAttributeMapAsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | Type mapping pane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see JavaPersistentAttribute
- * @see JavaPersistentTypeMapAsComposite
- *
- * @version 2.2
- * @since 2.0
- */
-public class JavaPersistentAttributeDetailsPage
- extends PersistentAttributeDetailsPage<JavaPersistentAttribute>
-{
- /**
- * Creates a new <code>JavaPersistentAttributeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaPersistentAttributeDetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Map as composite
- new PersistentAttributeMapAsComposite(
- this,
- addSubPane(container, 0, 0, 5, 0)
- );
-
- buildMappingPageBook(container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsProvider.java
deleted file mode 100644
index 1e009461ec..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentAttributeDetailsProvider.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the <code>JpaDetailsPage</code>
- * when the information comes from the Java source file.
- */
-public class JavaPersistentAttributeDetailsProvider
- implements JpaDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new JavaPersistentAttributeDetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaPersistentAttributeDetailsProvider() {
- super();
- }
-
-
- public boolean providesDetails(JpaStructureNode structureNode) {
- return Tools.valuesAreEqual(structureNode.getType(), JavaPersistentAttribute.class)
- && structureNode.getResourceType().getContentType().equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE);
- }
-
- public JpaDetailsPageManager<JavaPersistentAttribute> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new JavaPersistentAttributeDetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentTypeDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentTypeDetailsProvider.java
deleted file mode 100644
index ff85ccc133..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPersistentTypeDetailsProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.PersistentTypeDetailsPage;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the <code>JpaDetailsPage</code>
- * when the information comes from the Java source file.
- */
-public class JavaPersistentTypeDetailsProvider
- implements JpaDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new JavaPersistentTypeDetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaPersistentTypeDetailsProvider() {
- super();
- }
-
-
- public boolean providesDetails(JpaStructureNode structureNode) {
- return Tools.valuesAreEqual(structureNode.getType(), JavaPersistentType.class)
- && structureNode.getResourceType().getContentType().equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE);
- }
-
- public JpaDetailsPageManager<PersistentType> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new PersistentTypeDetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPrimaryKeyJoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPrimaryKeyJoinColumnsComposite.java
deleted file mode 100644
index 6e5f06c6cb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaPrimaryKeyJoinColumnsComposite.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractPrimaryKeyJoinColumnsComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @see JavaEntity
- * @see JavaInheritanceComposite - The container of this pane
- *
- * @version 2.0
- * @since 2.0
- */
-public class JavaPrimaryKeyJoinColumnsComposite extends AbstractPrimaryKeyJoinColumnsComposite<JavaEntity>
-{
- public JavaPrimaryKeyJoinColumnsComposite(Pane<? extends JavaEntity> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent);
- }
-
- @Override
- protected ListValueModel<PrimaryKeyJoinColumn> buildDefaultJoinColumnsListHolder() {
- return new PropertyListValueModelAdapter<PrimaryKeyJoinColumn>(buildDefaultJoinColumnHolder());
- }
-
- private PropertyValueModel<PrimaryKeyJoinColumn> buildDefaultJoinColumnHolder() {
- return new PropertyAspectAdapter<JavaEntity, PrimaryKeyJoinColumn>(getSubjectHolder(), JavaEntity.DEFAULT_PRIMARY_KEY_JOIN_COLUMN_PROPERTY) {
- @Override
- protected PrimaryKeyJoinColumn buildValue_() {
- return subject.getDefaultPrimaryKeyJoinColumn();
- }
- };
- }
-
- @Override
- protected void switchDefaultToSpecified() {
- PrimaryKeyJoinColumn defaultJoinColumn = getSubject().getDefaultPrimaryKeyJoinColumn();
-
- if (defaultJoinColumn != null) {
- String columnName = defaultJoinColumn.getDefaultName();
- String referencedColumnName = defaultJoinColumn.getDefaultReferencedColumnName();
-
- PrimaryKeyJoinColumn pkJoinColumn = getSubject().addSpecifiedPrimaryKeyJoinColumn();
- pkJoinColumn.setSpecifiedName(columnName);
- pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
-
- this.joinColumnHolder.setValue(pkJoinColumn);
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaSecondaryTablesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaSecondaryTablesComposite.java
deleted file mode 100644
index adc35aa679..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaSecondaryTablesComposite.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyTable;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractSecondaryTablesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.PrimaryKeyJoinColumnsInSecondaryTableComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PrimaryKeyJoinColumnsInSecondaryTableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Entity
- * @see AddRemoveListPane
- * @see PrimaryKeyJoinColumnsInSecondaryTableComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class JavaSecondaryTablesComposite extends AbstractSecondaryTablesComposite<JavaEntity>
-{
- /**
- * Creates a new <code>SecondaryTablesComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public JavaSecondaryTablesComposite(Pane<? extends JavaEntity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>SecondaryTablesComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaSecondaryTablesComposite(PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private ListValueModel<JavaSecondaryTable> buildSecondaryTablesListModel() {
- return new ItemPropertyListValueModelAdapter<JavaSecondaryTable>(buildSecondaryTablesListHolder(),
- ReadOnlyTable.SPECIFIED_NAME_PROPERTY);
- }
-
- private ListValueModel<JavaSecondaryTable> buildSecondaryTablesListHolder() {
- return new ListAspectAdapter<JavaEntity, JavaSecondaryTable>(getSubjectHolder(), Entity.SPECIFIED_SECONDARY_TABLES_LIST) {
- @Override
- protected ListIterable<JavaSecondaryTable> getListIterable() {
- return this.subject.getSpecifiedSecondaryTables();
- }
- @Override
- protected int size_() {
- return this.subject.getSpecifiedSecondaryTablesSize();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = getGroupBoxMargin();
-
- ModifiablePropertyValueModel<SecondaryTable> secondaryTableHolder =
- buildSecondaryTableHolder();
-
- // Secondary Tables add/remove list pane
- new AddRemoveListPane<Entity>(
- this,
- addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin),
- buildSecondaryTablesAdapter(),
- buildSecondaryTablesListModel(),
- secondaryTableHolder,
- buildSecondaryTableLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS//TODO need a help context id for this
- );
-
- // Primary Key Join Columns pane
- new PrimaryKeyJoinColumnsInSecondaryTableComposite(
- this,
- secondaryTableHolder,
- container
- );
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaTransientMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaTransientMappingUiDefinition.java
deleted file mode 100644
index 657e43234f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaTransientMappingUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaTransientMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractTransientMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaTransientMappingUiDefinition
- extends AbstractTransientMappingUiDefinition<ReadOnlyPersistentAttribute, JavaTransientMapping>
- implements JavaAttributeMappingUiDefinition<JavaTransientMapping>
-{
- // singleton
- private static final JavaTransientMappingUiDefinition INSTANCE =
- new JavaTransientMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaTransientMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaTransientMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaTransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaTransientMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaVersionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaVersionMappingUiDefinition.java
deleted file mode 100644
index d4f9bd94bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/JavaVersionMappingUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractVersionMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaVersionMappingUiDefinition
- extends AbstractVersionMappingUiDefinition<ReadOnlyPersistentAttribute, JavaVersionMapping>
- implements JavaAttributeMappingUiDefinition<JavaVersionMapping>
-{
- // singleton
- private static final JavaVersionMappingUiDefinition INSTANCE =
- new JavaVersionMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaVersionMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaVersionMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createJavaVersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaAttributeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaAttributeMappingUiDefinition.java
deleted file mode 100644
index 8e2e64812b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaAttributeMappingUiDefinition.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class NullJavaAttributeMappingUiDefinition
- extends AbstractMappingUiDefinition<ReadOnlyPersistentAttribute, JavaAttributeMapping>
- implements DefaultJavaAttributeMappingUiDefinition<JavaAttributeMapping>
-{
- // singleton
- private static final NullJavaAttributeMappingUiDefinition INSTANCE =
- new NullJavaAttributeMappingUiDefinition();
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaAttributeMappingUiDefinition<JavaAttributeMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private NullJavaAttributeMappingUiDefinition() {
- super();
- }
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.NullAttributeMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return null;
- }
-
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY;
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaAttributeMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new NullComposite(subjectHolder, parent, widgetFactory);
- }
-
-
- public static class NullComposite extends Pane<JavaAttributeMapping>
- implements JpaComposite
- {
- NullComposite(
- PropertyValueModel<JavaAttributeMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {}
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaTypeMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaTypeMappingUiDefinition.java
deleted file mode 100644
index bd70844d8a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/java/NullJavaTypeMappingUiDefinition.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class NullJavaTypeMappingUiDefinition
- extends AbstractMappingUiDefinition<PersistentType, JavaTypeMapping>
- implements DefaultJavaTypeMappingUiDefinition<JavaTypeMapping>
-{
- // singleton
- private static final NullJavaTypeMappingUiDefinition INSTANCE = new NullJavaTypeMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static DefaultJavaTypeMappingUiDefinition<JavaTypeMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private NullJavaTypeMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForTypeMapping(null);
- }
-
- public String getLabel() {
- return JptUiDetailsMessages.NullTypeMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return null;
- }
-
- public String getKey() {
- return null;
- }
-
- public String getDefaultKey() {
- return null;
- }
-
- public JpaComposite buildTypeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaTypeMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new NullComposite(subjectHolder, parent, widgetFactory);
- }
-
- public static class NullComposite
- extends Pane<JavaTypeMapping>
- implements JpaComposite
- {
- NullComposite(
- PropertyValueModel<JavaTypeMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {}
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPage.java
deleted file mode 100644
index 60258a1239..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractEntityMappingsDetailsPage.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractJpaDetailsPage;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmGeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmQueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see AbstractEntityMappingsDetailsPage - The parent container
- * @see CatalogCombo
- * @see EnumFormComboViewer
- * @see EntityMappingsGeneratorsComposite
- * @see OrmPackageChooser
- * @see OrmQueriesComposite
- * @see PersistenceUnitMetadataComposite
- * @see SchemaCombo
- *
- * @version 2.3
- * @since 2.0
- */
-public abstract class AbstractEntityMappingsDetailsPage extends AbstractJpaDetailsPage<EntityMappings>
-{
- /**
- * Creates a new <code>EntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractEntityMappingsDetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityMappingsCollapsibleSection(container);
- this.initializePersistenceUnitMetadataCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- }
-
- protected void initializeEntityMappingsCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsOrmMessages.EntityMappingsSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeEntityMappingsSection(container);
- }
-
- protected void initializeEntityMappingsSection(Composite container) {
- // Package widgets
- new OrmPackageChooser(this, container);
-
- // Schema widgets
- addLabeledComposite(
- container,
- JptUiDetailsOrmMessages.EntityMappingsDetailsPage_schema,
- addSchemaCombo(container),
- JpaHelpContextIds.ENTITY_ORM_SCHEMA
- );
-
- // Catalog widgets
- addLabeledComposite(
- container,
- JptUiDetailsOrmMessages.EntityMappingsDetailsPage_catalog,
- addCatalogCombo(container),
- JpaHelpContextIds.ENTITY_ORM_CATALOG
- );
-
- new AccessTypeComposite(this, getSubjectHolder(), container);
- }
-
- protected void initializePersistenceUnitMetadataCollapsibleSection(Composite container) {
- new PersistenceUnitMetadataComposite(
- this,
- buildPersistentUnitMetadataHolder(),
- addSubPane(container, 5)
- );
- }
-
- protected CatalogCombo<EntityMappings> addCatalogCombo(Composite container) {
-
- return new CatalogCombo<EntityMappings>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EntityMappings.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(EntityMappings.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultCatalog();
- }
-
- @Override
- protected void setValue(String value) {
- getSubject().setSpecifiedCatalog(value);
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedCatalog();
- }
- };
- }
-
- protected PropertyValueModel<OrmPersistenceUnitMetadata> buildPersistentUnitMetadataHolder() {
- return new TransformationPropertyValueModel<EntityMappings, OrmPersistenceUnitMetadata>(getSubjectHolder()) {
- @Override
- protected OrmPersistenceUnitMetadata transform_(EntityMappings value) {
- return value.getPersistenceUnitMetadata();
- }
- };
- }
-
- protected SchemaCombo<EntityMappings> addSchemaCombo(Composite container) {
-
- return new SchemaCombo<EntityMappings>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(EntityMappings.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(EntityMappings.SPECIFIED_SCHEMA_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultSchema();
- }
-
- @Override
- protected void setValue(String value) {
- getSubject().setSpecifiedSchema(value);
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedSchema();
- }
-
- @Override
- protected SchemaContainer getDbSchemaContainer_() {
- return this.getSubject().getDbSchemaContainer();
- }
-
- };
- }
-
- protected void initializeGeneratorsCollapsibleSection(Composite container) {
- new EntityMappingsGeneratorsComposite(
- this,
- container
- );
- }
-
- protected void initializeQueriesCollapsibleSection(Composite container) {
- new OrmQueriesComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmEntityComposite.java
deleted file mode 100644
index 97d8424fe4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmEntityComposite.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EntityNameComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an ORM entity.
- *
- * @see OrmEntity
- * @see BaseJavaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 1.0
- */
-public abstract class AbstractOrmEntityComposite extends AbstractEntityComposite<OrmEntity>
-{
- /**
- * Creates a new <code>OrmEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>OrmEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractOrmEntityComposite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEntityCollapsibleSection(container);
- this.initializeQueriesCollapsibleSection(container);
- this.initializeInheritanceCollapsibleSection(container);
- this.initializeAttributeOverridesCollapsibleSection(container);
- this.initializeGeneratorsCollapsibleSection(container);
- this.initializeSecondaryTablesCollapsibleSection(container);
- }
-
- @Override
- protected void initializeEntitySection(Composite container) {
- new OrmJavaClassChooser(this, getSubjectHolder(), container, false);
- new TableComposite(this, container);
- new EntityNameComposite(this, container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- new MetadataCompleteComposite(this, getSubjectHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<OrmEntity, AccessHolder>(getSubjectHolder()){
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
- @Override
- protected void initializeSecondaryTablesSection(Composite container) {
- new OrmSecondaryTablesComposite(this, container);
- }
-
- @Override
- protected void initializeInheritanceSection(Composite container) {
- new OrmInheritanceComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmXmlResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmXmlResourceUiDefinition.java
deleted file mode 100644
index db11562274..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AbstractOrmXmlResourceUiDefinition.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayListIterator;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.MappingResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * All the state in the definition should be "static" (i.e. unchanging once it is initialized).
- */
-public abstract class AbstractOrmXmlResourceUiDefinition
- implements MappingResourceUiDefinition
-{
-
- private OrmTypeMappingUiDefinition<? extends TypeMapping>[] ormTypeMappingUiDefinitions;
-
- private OrmAttributeMappingUiDefinition<? extends AttributeMapping>[] ormAttributeMappingUiDefinitions;
-
- private final OrmXmlUiFactory factory;
-
-
- /**
- * zero-argument constructor
- */
- protected AbstractOrmXmlResourceUiDefinition() {
- super();
- this.factory = buildOrmXmlUiFactory();
- }
-
-
- protected abstract OrmXmlUiFactory buildOrmXmlUiFactory();
-
- public OrmXmlUiFactory getFactory() {
- return this.factory;
- }
-
-
- // ********** ORM type mappings **********
-
- public JpaComposite buildTypeMappingComposite(String key, PropertyValueModel<TypeMapping> mappingHolder, Composite parent, WidgetFactory widgetFactory) {
- OrmTypeMappingUiDefinition<TypeMapping> mappingUiDefinition =
- (OrmTypeMappingUiDefinition<TypeMapping>) getOrmTypeMappingUiDefinition(key);
- return mappingUiDefinition.buildTypeMappingComposite(
- getFactory(),
- mappingHolder,
- parent,
- widgetFactory
- );
- }
-
- protected OrmTypeMappingUiDefinition<? extends TypeMapping> getOrmTypeMappingUiDefinition(String mappingKey) {
- for (OrmTypeMappingUiDefinition<? extends TypeMapping> definition : getOrmTypeMappingUiDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- throw new IllegalArgumentException("Illegal type mapping key: " + mappingKey); //$NON-NLS-1$
- }
-
- public Iterator<MappingUiDefinition<PersistentType, ? extends TypeMapping>>
- typeMappingUiDefinitions() {
-
- return new ArrayIterator<MappingUiDefinition<PersistentType, ? extends TypeMapping>>(
- getOrmTypeMappingUiDefinitions());
- }
-
- protected synchronized OrmTypeMappingUiDefinition<? extends TypeMapping>[] getOrmTypeMappingUiDefinitions() {
- if (this.ormTypeMappingUiDefinitions == null) {
- this.ormTypeMappingUiDefinitions = this.buildOrmTypeMappingUiDefinitions();
- }
- return this.ormTypeMappingUiDefinitions;
- }
-
-
- /**
- * Return an array of mapping definitions to use for types in mapping files of this type.
- * The order is unimportant.
- */
- protected OrmTypeMappingUiDefinition<? extends TypeMapping>[] buildOrmTypeMappingUiDefinitions() {
- ArrayList<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions = new ArrayList<OrmTypeMappingUiDefinition<? extends TypeMapping>>();
- this.addOrmTypeMappingUiDefinitionsTo(definitions);
- @SuppressWarnings("unchecked")
- OrmTypeMappingUiDefinition<? extends TypeMapping>[] definitionArray = definitions.toArray(new OrmTypeMappingUiDefinition[definitions.size()]);
- return definitionArray;
- }
-
- protected abstract void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions);
-
- public DefaultMappingUiDefinition<PersistentType, ? extends TypeMapping> getDefaultTypeMappingUiDefinition() {
- //there is no way to choose an type in the orm.xml that doesn't have a specified mapping so we can return null here
- return null;
- }
-
- // ********** ORM attribute mappings **********
-
- public JpaComposite buildAttributeMappingComposite(String key, PropertyValueModel<AttributeMapping> mappingHolder, Composite parent, WidgetFactory widgetFactory) {
-
- OrmAttributeMappingUiDefinition<AttributeMapping> mappingUiDefinition =
- (OrmAttributeMappingUiDefinition<AttributeMapping>) getOrmAttributeMappingUiDefinition(key);
- return mappingUiDefinition.buildAttributeMappingComposite(
- getFactory(),
- mappingHolder,
- parent,
- widgetFactory
- );
- }
-
- protected OrmAttributeMappingUiDefinition<? extends AttributeMapping> getOrmAttributeMappingUiDefinition(String mappingKey) {
- for (OrmAttributeMappingUiDefinition<? extends AttributeMapping> definition : getOrmAttributeMappingUiDefinitions()) {
- if (Tools.valuesAreEqual(definition.getKey(), mappingKey)) {
- return definition;
- }
- }
- return UnsupportedOrmMappingUiDefinition.instance();
- }
-
- public ListIterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>> attributeMappingUiDefinitions() {
- return new ArrayListIterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>>(
- getOrmAttributeMappingUiDefinitions());
- }
-
- protected synchronized OrmAttributeMappingUiDefinition<? extends AttributeMapping>[] getOrmAttributeMappingUiDefinitions() {
- if (this.ormAttributeMappingUiDefinitions == null) {
- this.ormAttributeMappingUiDefinitions = this.buildOrmAttributeMappingUiDefinitions();
- }
- return this.ormAttributeMappingUiDefinitions;
- }
-
- /**
- * Return an array of mapping definitions to use for attributes in mapping files of this type.
- * The order is unimportant.
- */
- protected OrmAttributeMappingUiDefinition<? extends AttributeMapping>[] buildOrmAttributeMappingUiDefinitions() {
- ArrayList<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions = new ArrayList<OrmAttributeMappingUiDefinition<? extends AttributeMapping>>();
- this.addOrmAttributeMappingUiDefinitionsTo(definitions);
- @SuppressWarnings("unchecked")
- OrmAttributeMappingUiDefinition<? extends AttributeMapping>[] definitionArray = definitions.toArray(new OrmAttributeMappingUiDefinition[definitions.size()]);
- return definitionArray;
- }
-
- protected abstract void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions);
-
- public DefaultMappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping> getDefaultAttributeMappingUiDefinition(String key) {
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorDialog.java
deleted file mode 100644
index ac31236854..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorDialog.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jpt.common.ui.internal.widgets.DialogPane;
-import org.eclipse.jpt.common.ui.internal.widgets.ValidatingDialog;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Clients can use this dialog to prompt the user for SecondaryTable settings.
- * Use the following once the dialog is closed:
- * @see #getSelectedTable()
- * @see #getSelectedCatalog()
- * @see #getSelectedSchema()
- * @version 2.1
- * @since 2.1
- */
-public class AddGeneratorDialog extends ValidatingDialog<AddGeneratorStateObject> {
- public static final String SEQUENCE_GENERATOR = "sequenceGenerator"; //$NON-NLS-1$
- public static final String TABLE_GENERATOR = "tableGenerator"; //$NON-NLS-1$
-
- /**
- * The associated persistence unit
- */
- private PersistenceUnit pUnit;
-
- // ********** constructors **********
-
- /**
- * Use this constructor to edit an existing conversion value
- */
- public AddGeneratorDialog(Shell parent, PersistenceUnit pUnit) {
- super(parent);
- this.pUnit = pUnit;
- }
-
- @Override
- protected AddGeneratorStateObject buildStateObject() {
- return new AddGeneratorStateObject(this.pUnit);
- }
-
- // ********** open **********
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setText(this.getTitle());
- }
-
- @Override
- protected String getTitle() {
- return JptUiDetailsOrmMessages.AddGeneratorDialog_title;
- }
-
- @Override
- protected String getDescriptionTitle() {
- return JptUiDetailsOrmMessages.AddGeneratorDialog_descriptionTitle;
- }
-
- @Override
- protected String getDescription() {
- return JptUiDetailsOrmMessages.AddGeneratorDialog_description;
- }
-
- @Override
- protected DialogPane<AddGeneratorStateObject> buildLayout(Composite container) {
- return new GeneratorDialogPane(container);
- }
-
- @Override
- public void create() {
- super.create();
-
- GeneratorDialogPane pane = (GeneratorDialogPane) getPane();
- pane.selectAll();
-
- getButton(OK).setEnabled(false);
- }
-
-
- // ********** public API **********
-
- /**
- * Return the data value set in the text widget.
- */
- public String getName() {
- return getSubject().getName();
- }
-
- /**
- * Return the object value set in the text widget.
- */
- public String getGeneratorType() {
- return getSubject().getGeneratorType();
- }
-
- private class GeneratorDialogPane extends DialogPane<AddGeneratorStateObject> {
-
- private Text nameText;
-
- GeneratorDialogPane(Composite parent) {
- super(AddGeneratorDialog.this.getSubjectHolder(), parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.nameText = addLabeledText(
- container,
- JptUiDetailsOrmMessages.AddGeneratorDialog_name,
- buildNameHolder()
- );
-
- addLabeledCombo(
- container,
- JptUiDetailsOrmMessages.AddGeneratorDialog_generatorType,
- buildGeneratorTypeListHolder(),
- buildGeneratorTypeHolder(),
- buildStringConverter(),
- null);
- }
-
- protected ListValueModel<String> buildGeneratorTypeListHolder() {
- List<String> generatorTypes = new ArrayList<String>();
- generatorTypes.add(TABLE_GENERATOR);
- generatorTypes.add(SEQUENCE_GENERATOR);
-
- return new StaticListValueModel<String>(generatorTypes);
- }
-
- private StringConverter<String> buildStringConverter() {
- return new StringConverter<String>() {
- public String convertToString(String value) {
- if (value == TABLE_GENERATOR) {
- return JptUiDetailsOrmMessages.AddGeneratorDialog_tableGenerator;
- }
- if (value == SEQUENCE_GENERATOR) {
- return JptUiDetailsOrmMessages.AddGeneratorDialog_sequenceGenerator;
- }
- return value;
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildNameHolder() {
- return new PropertyAspectAdapter<AddGeneratorStateObject, String>(getSubjectHolder(), AddGeneratorStateObject.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setName(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildGeneratorTypeHolder() {
- return new PropertyAspectAdapter<AddGeneratorStateObject, String>(getSubjectHolder(), AddGeneratorStateObject.GENERATOR_TYPE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getGeneratorType();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setGeneratorType(value);
- }
- };
- }
-
- void selectAll() {
- this.nameText.selectAll();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorStateObject.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorStateObject.java
deleted file mode 100644
index 7847c2f1f6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/AddGeneratorStateObject.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.node.AbstractNode;
-import org.eclipse.jpt.common.utility.internal.node.Node;
-import org.eclipse.jpt.common.utility.internal.node.Problem;
-import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-
-/**
- * This is the state object used by the <code>AddGeneratorDialog</code>, which stores
- * the current name and validates it when it is modified.
- *
- * @see AddGeneratorDialog
- *
- * @version 2.1
- * @since 2.1
- */
-final class AddGeneratorStateObject extends AbstractNode
-{
- /**
- * The initial name or <code>null</code>
- */
- private String name;
-
- /**
- * The initial generatorType or <code>null</code>
- */
- private String generatorType;
-
- /**
- * The <code>Validator</code> used to validate this state object.
- */
- private Validator validator;
-
- /**
- * The associated persistence unit
- */
- private PersistenceUnit pUnit;
-
- /**
- * Notifies a change in the data value property.
- */
- static final String NAME_PROPERTY = "nameProperty"; //$NON-NLS-1$
-
- /**
- * Notifies a change in the generator type property.
- */
- static final String GENERATOR_TYPE_PROPERTY = "generatorTypeProperty"; //$NON-NLS-1$
-
- /**
- * Creates a new <code>NewNameStateObject</code>.
- *
- * @param name The initial input or <code>null</code> if no initial value can
- * be specified
- * @param names The collection of names that can't be used or an empty
- * collection if none are available
- */
- AddGeneratorStateObject(PersistenceUnit pUnit) {
- super(null);
- this.pUnit = pUnit;
- }
-
- private void addNameProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.name)) {
- currentProblems.add(buildProblem(JptUiDetailsOrmMessages.GeneratorStateObject_nameMustBeSpecified, IMessageProvider.ERROR));
- }
- else if (names().contains(this.name)){
- currentProblems.add(buildProblem(JptUiDetailsOrmMessages.GeneratorStateObject_nameExists, IMessageProvider.WARNING));
- }
- }
-
- private void addGeneratorTypeProblemsTo(List<Problem> currentProblems) {
- if (StringTools.stringIsEmpty(this.generatorType)) {
- currentProblems.add(buildProblem(JptUiDetailsOrmMessages.GeneratorStateObject_typeMustBeSpecified, IMessageProvider.ERROR));
- }
- }
-
- @Override
- protected void addProblemsTo(List<Problem> currentProblems) {
- super.addProblemsTo(currentProblems);
- addNameProblemsTo(currentProblems);
- addGeneratorTypeProblemsTo(currentProblems);
- }
-
- private List<String> names() {
- List<String> names = new ArrayList<String>();
- for (Generator generator : this.pUnit.getGenerators()){
- String name = generator.getName();
- names.add(name);
- }
- return names;
- }
-
- @Override
- protected void checkParent(Node parentNode) {
- //no parent
- }
-
- public String displayString() {
- return null;
- }
-
- String getName() {
- return this.name;
- }
-
- String getGeneratorType() {
- return this.generatorType;
- }
-
- public void setName(String newName) {
- String oldName = this.name;
- this.name = newName;
- firePropertyChanged(NAME_PROPERTY, oldName, newName);
- }
-
- public void setGeneratorType(String newGeneratorType) {
- String old = this.generatorType;
- this.generatorType = newGeneratorType;
- firePropertyChanged(GENERATOR_TYPE_PROPERTY, old, newGeneratorType);
- }
-
- @Override
- public void setValidator(Validator validator) {
- this.validator = validator;
- }
-
- @Override
- public Validator getValidator() {
- return this.validator;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/BaseOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/BaseOrmXmlUiFactory.java
deleted file mode 100644
index d44d8d6e49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/BaseOrmXmlUiFactory.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.TransientMappingComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The default implementation of the Orm Xml UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- */
-public abstract class BaseOrmXmlUiFactory implements OrmXmlUiFactory
-{
-
- // **************** orm type mapping composites ****************************
-
- public JpaComposite createOrmMappedSuperclassComposite(
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEntityComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmEmbeddableComposite(
- PropertyValueModel<OrmEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** orm attribute mapping composites ***********************
-
- public JpaComposite createOrmIdMappingComposite(
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmEmbeddedIdMappingComposite(
- PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEmbeddedIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmBasicMappingComposite(
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmVersionMappingComposite(
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmVersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmManyToOneMappingComposite(
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmOneToManyMappingComposite(
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmOneToOneMappingComposite(
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmManyToManyMappingComposite(
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmEmbeddedMappingComposite(
- PropertyValueModel<OrmEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEmbeddedMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmTransientMappingComposite(
- PropertyValueModel<OrmTransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new TransientMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsPage.java
deleted file mode 100644
index 0c9ec4c6df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsPage.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | XmlPackageChooser | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMetadataComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmGeneratorsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmQueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see EntityMappingsDetailsPage - The parent container
- * @see CatalogCombo
- * @see EnumFormComboViewer
- * @see EntityMappingsGeneratorsComposite
- * @see OrmPackageChooser
- * @see OrmQueriesComposite
- * @see PersistenceUnitMetadataComposite
- * @see SchemaCombo
- *
- * @version 2.2
- * @since 2.0
- */
-public class EntityMappingsDetailsPage extends AbstractEntityMappingsDetailsPage
-{
- /**
- * Creates a new <code>EntityMappingsDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EntityMappingsDetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsProvider.java
deleted file mode 100644
index c6fe8e4a0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsDetailsProvider.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityMappingsDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPageManager}
- * when the information comes from the XML file (either from the persistence
- * configuration or from the Mappings Descriptor).
- */
-public class EntityMappingsDetailsProvider
- extends AbstractEntityMappingsDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new EntityMappingsDetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EntityMappingsDetailsProvider() {
- super();
- }
-
-
- @Override
- protected boolean providesDetails(JptResourceType resourceType) {
- return resourceType.equals(JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE);
- }
-
- public JpaDetailsPageManager<EntityMappings> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EntityMappingsDetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java
deleted file mode 100644
index 2593068bf2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/EntityMappingsGeneratorsComposite.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.SequenceGeneratorComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TableGeneratorComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite.GeneratorBuilder;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * This pane shows the list of named queries and named native queries.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmSequenceGeneratorComposite or OrmTableGeneratorComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see OrmGenerator
- * @see OrmSequenceGenerator
- * @see OrmTableGenerator
- * @see EntityComposite - The parent container
- * @see OrmSequenceGeneratorComposite
- * @see OrmTableGeneratorComposite
- *
- * @version 2.2
- * @since 2.0
- */
-public class EntityMappingsGeneratorsComposite extends Pane<EntityMappings>
-{
- private ModifiablePropertyValueModel<OrmGenerator> generatorHolder;
- GeneratorComposite<SequenceGenerator> sequenceGeneratorPane;
- TableGeneratorComposite tableGeneratorPane;
- private AddRemoveListPane<EntityMappings> listPane;
-
- /**
- * Creates a new <code>EntityMappingsGeneratorsComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EntityMappingsGeneratorsComposite(
- Pane<? extends EntityMappings> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- void addGenerator(ObjectListSelectionModel listSelectionModel) {
- addGeneratorFromDialog(listSelectionModel, buildAddGeneratorDialog());
- }
-
- protected AddGeneratorDialog buildAddGeneratorDialog() {
- return new AddGeneratorDialog(getShell(), this.getSubject().getPersistenceUnit());
- }
-
- protected void addGeneratorFromDialog(ObjectListSelectionModel listSelectionModel, AddGeneratorDialog dialog) {
- if (dialog.open() != Window.OK) {
- return;
- }
- String generatorType = dialog.getGeneratorType();
- OrmGenerator generator;
- if (generatorType == AddGeneratorDialog.TABLE_GENERATOR) {
- generator = this.getSubject().addTableGenerator();
- }
- else if (generatorType == AddGeneratorDialog.SEQUENCE_GENERATOR) {
- generator = this.getSubject().addSequenceGenerator();
- }
- else {
- throw new IllegalArgumentException();
- }
- generator.setName(dialog.getName());
- this.generatorHolder.setValue(generator);//so that it gets selected in the List for the user to edit
- listSelectionModel.setSelectedValue(generator);
- }
-
- private ListValueModel<OrmGenerator> buildDisplayableGeneratorListHolder() {
- return new ItemPropertyListValueModelAdapter<OrmGenerator>(
- buildGeneratorsListHolder(),
- JpaNamedContextNode.NAME_PROPERTY
- );
- }
-
- private Adapter buildGeneratorAdapter() {
-
- return new AddRemoveListPane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addGenerator(listSelectionModel);
- }
-
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- if (item instanceof OrmSequenceGenerator) {
- getSubject().removeSequenceGenerator((OrmSequenceGenerator) item);
- }
- else {
- getSubject().removeTableGenerator((OrmTableGenerator) item);
- }
- }
- }
- };
- }
-
- private ModifiablePropertyValueModel<OrmGenerator> buildGeneratorHolder() {
- return new SimplePropertyValueModel<OrmGenerator>();
- }
-
- private ILabelProvider buildGeneratorLabelProvider() {
- return new LabelProvider() {
- @Override
- public String getText(Object element) {
- OrmGenerator generator = (OrmGenerator) element;
- String name = generator.getName();
-
- if (name == null) {
- int index = -1;
-
- if (generator instanceof OrmSequenceGenerator) {
- index = CollectionTools.indexOf(getSubject().getSequenceGenerators(), generator);
- }
- else {
- index = CollectionTools.indexOf(getSubject().getTableGenerators(), generator);
- }
-
- name = NLS.bind(JptUiDetailsOrmMessages.OrmGeneratorsComposite_displayString, Integer.valueOf(index));
- }
-
- return name;
- }
- };
- }
-
- private ListValueModel<OrmGenerator> buildGeneratorsListHolder() {
- List<ListValueModel<? extends OrmGenerator>> list = new ArrayList<ListValueModel<? extends OrmGenerator>>();
- list.add(buildSequenceGeneratorListHolder());
- list.add(buildTableGeneratorListHolder());
- return new CompositeListValueModel<ListValueModel<? extends OrmGenerator>, OrmGenerator>(list);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<EntityMappings, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EntityMappings value) {
- return Boolean.valueOf(value != null);
- }
- };
- }
-
- private Transformer<OrmGenerator, Control> buildPaneTransformer() {
- return new Transformer<OrmGenerator, Control>() {
- public Control transform(OrmGenerator generator) {
-
- if (generator == null) {
- return null;
- }
-
- if (generator instanceof OrmSequenceGenerator) {
- return EntityMappingsGeneratorsComposite.this.sequenceGeneratorPane.getControl();
- }
-
- return EntityMappingsGeneratorsComposite.this.tableGeneratorPane.getControl();
- }
- };
- }
-
- private PropertyValueModel<SequenceGenerator> buildSequenceGeneratorHolder() {
- return new TransformationPropertyValueModel<OrmGenerator, SequenceGenerator>(this.generatorHolder) {
- @Override
- protected SequenceGenerator transform_(OrmGenerator value) {
- return (value instanceof SequenceGenerator) ? (SequenceGenerator) value : null;
- }
- };
- }
-
- private ListValueModel<OrmSequenceGenerator> buildSequenceGeneratorListHolder() {
- return new ListAspectAdapter<EntityMappings, OrmSequenceGenerator>(
- getSubjectHolder(),
- EntityMappings.SEQUENCE_GENERATORS_LIST)
- {
- @Override
- protected ListIterable<OrmSequenceGenerator> getListIterable() {
- return this.subject.getSequenceGenerators();
- }
- @Override
- protected int size_() {
- return this.subject.getSequenceGeneratorsSize();
- }
- };
- }
-
- private PropertyValueModel<TableGenerator> buildTableGeneratorHolder() {
- return new TransformationPropertyValueModel<OrmGenerator, TableGenerator>(this.generatorHolder) {
- @Override
- protected TableGenerator transform_(OrmGenerator value) {
- return (value instanceof TableGenerator) ? (TableGenerator) value : null;
- }
- };
- }
-
- private ListValueModel<OrmTableGenerator> buildTableGeneratorListHolder() {
- return new ListAspectAdapter<EntityMappings, OrmTableGenerator>(
- getSubjectHolder(),
- EntityMappings.TABLE_GENERATORS_LIST)
- {
- @Override
- protected ListIterable<OrmTableGenerator> getListIterable() {
- return this.subject.getTableGenerators();
- }
- @Override
- protected int size_() {
- return this.subject.getTableGeneratorsSize();
- }
- };
- }
-
-
- @Override
- protected void initialize() {
- super.initialize();
- this.generatorHolder = buildGeneratorHolder();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = addCollapsibleSection(
- container,
- JptUiDetailsOrmMessages.OrmGeneratorsComposite_groupBox
- );
-
- // List pane
- this.listPane = addListPane(container);
- this.installPaneEnabler();
-
- // Property pane
- PropertyValueModel<SequenceGenerator> sequenceGeneratorHolder =
- this.buildSequenceGeneratorHolder();
- PropertyValueModel<TableGenerator> tableGeneratorHolder =
- this.buildTableGeneratorHolder();
-
- PageBook pageBook = new PageBook(container, SWT.NULL);
- pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Sequence Generator property pane
- this.sequenceGeneratorPane = this.buildSequenceGeneratorComposite(
- pageBook,
- sequenceGeneratorHolder,
- this.buildSequenceGeneratorBuilder()
- );
-
- // Table Generator property pane
- this.tableGeneratorPane = new TableGeneratorComposite(
- this,
- tableGeneratorHolder,
- pageBook,
- this.buildTableGeneratorBuilder()
- );
-
- this.addAlignRight(this.sequenceGeneratorPane);
- this.addAlignRight(this.tableGeneratorPane);
- this.installPaneSwitcher(pageBook);
- }
-
- protected GeneratorComposite<SequenceGenerator> buildSequenceGeneratorComposite(
- Composite parent,
- PropertyValueModel<SequenceGenerator> sequenceGeneratorHolder,
- GeneratorBuilder<SequenceGenerator> generatorBuilder) {
-
- return new SequenceGeneratorComposite(
- this,
- sequenceGeneratorHolder,
- parent,
- generatorBuilder
- );
- }
-
- private AddRemoveListPane<EntityMappings> addListPane(Composite container) {
-
- return new AddRemoveListPane<EntityMappings>(
- this,
- container,
- this.buildGeneratorAdapter(),
- this.buildDisplayableGeneratorListHolder(),
- this.generatorHolder,
- this.buildGeneratorLabelProvider()
- );
- }
-
- private void installPaneEnabler() {
- new PaneEnabler(
- this.buildPaneEnablerHolder(),
- this.listPane
- );
- }
-
- private void installPaneSwitcher(PageBook pageBook) {
- new ControlSwitcher(this.generatorHolder, this.buildPaneTransformer(), pageBook);
- }
-
- private GeneratorBuilder<SequenceGenerator> buildSequenceGeneratorBuilder() {
- return new GeneratorBuilder<SequenceGenerator>() {
- public SequenceGenerator addGenerator() {
- throw new UnsupportedOperationException("The sequence generator will never be null so we do not need to implement this"); //$NON-NLS-1$
- }
- };
- }
-
- private GeneratorBuilder<TableGenerator> buildTableGeneratorBuilder() {
- return new GeneratorBuilder<TableGenerator>() {
- public TableGenerator addGenerator() {
- throw new UnsupportedOperationException("The table generator will never be null so we do not need to implement this"); //$NON-NLS-1$
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/GenericOrmXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/GenericOrmXmlUiFactory.java
deleted file mode 100644
index 5ea741c22d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/GenericOrmXmlUiFactory.java
+++ /dev/null
@@ -1,15 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-public class GenericOrmXmlUiFactory extends BaseOrmXmlUiFactory
-{
- //nothing
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/JptUiDetailsOrmMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/JptUiDetailsOrmMessages.java
deleted file mode 100644
index a6980d74c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/JptUiDetailsOrmMessages.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali ORM widgets.
- *
- * @version 3.2
- * @since 1.0
- */
-public class JptUiDetailsOrmMessages {
-
- public static String EntityMappingsSection_title;
- public static String EntityMappingsDetailsPage_catalog;
- public static String EntityMappingsDetailsPage_package;
- public static String EntityMappingsDetailsPage_schema;
- public static String EntityMappingsPage_catalogDefault;
- public static String EntityMappingsPage_catalogNoDefaultSpecified;
- public static String EntityMappingsPage_schemaDefault;
- public static String EntityMappingsPage_schemaNoDefaultSpecified;
- public static String MetadataCompleteComposite_metadataComplete;
- public static String MetadataCompleteComposite_metadataCompleteWithDefault;
- public static String OrmGeneratorsComposite_displayString;
- public static String OrmGeneratorsComposite_groupBox;
- public static String OrmMappingNameChooser_name;
- public static String OrmJavaClassChooser_javaClass;
- public static String OrmQueriesComposite_groupBox;
- public static String PersistenceUnitMetadataComposite_delimitedIdentifiersCheckBox;
- public static String PersistenceUnitMetadataComposite_cascadePersistCheckBox;
- public static String PersistenceUnitMetadataComposite_catalog;
- public static String PersistenceUnitMetadataComposite_persistenceUnitSection;
- public static String PersistenceUnitMetadataComposite_schema;
- public static String PersistenceUnitMetadataComposite_xmlMappingMetadataCompleteCheckBox;
- public static String PersistenceUnitMetadataSection_catalogDefault;
- public static String PersistenceUnitMetadataSection_schemaDefault;
-
- public static String AddGeneratorDialog_name;
- public static String AddGeneratorDialog_generatorType;
- public static String AddGeneratorDialog_title;
- public static String AddGeneratorDialog_descriptionTitle;
- public static String AddGeneratorDialog_description;
- public static String AddGeneratorDialog_tableGenerator;
- public static String AddGeneratorDialog_sequenceGenerator;
- public static String GeneratorStateObject_nameExists;
- public static String GeneratorStateObject_nameMustBeSpecified;
- public static String GeneratorStateObject_typeMustBeSpecified;
-
- public static String UnsupportedOrmMappingUiProvider_label;
- public static String UnsupportedOrmMappingUiProvider_linkLabel;
-
- private static final String BUNDLE_NAME = "jpt_ui_details_orm"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptUiDetailsOrmMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptUiDetailsOrmMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/MetadataCompleteComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/MetadataCompleteComposite.java
deleted file mode 100644
index 5b05a7b27d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/MetadataCompleteComposite.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-public class MetadataCompleteComposite extends Pane<OrmTypeMapping> {
-
- public MetadataCompleteComposite(Pane<?> parentPane,
- PropertyValueModel<? extends OrmTypeMapping> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // TODO not sure the is the right thing to do; since metadata complete
- // has an "override" (from the persistence unit), not a default...
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsOrmMessages.MetadataCompleteComposite_metadataComplete,
- buildMetadataCompleteHolder(),
- buildMetadataCompleteStringHolder(),
- null
- );
- }
-
- private ModifiablePropertyValueModel<Boolean> buildMetadataCompleteHolder() {
- return new PropertyAspectAdapter<OrmTypeMapping, Boolean>(
- getSubjectHolder(),
- OrmTypeMapping.SPECIFIED_METADATA_COMPLETE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedMetadataComplete();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedMetadataComplete(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildMetadataCompleteStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildOverrideMetadataCompleteHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsOrmMessages.MetadataCompleteComposite_metadataCompleteWithDefault, defaultStringValue);
- }
- return JptUiDetailsOrmMessages.MetadataCompleteComposite_metadataComplete;
- }
- };
- }
- private PropertyValueModel<Boolean> buildOverrideMetadataCompleteHolder() {
- return new PropertyAspectAdapter<OrmTypeMapping, Boolean>(
- getSubjectHolder(),
- OrmTypeMapping.SPECIFIED_METADATA_COMPLETE_PROPERTY,
- OrmTypeMapping.OVERRIDE_METADATA_COMPLETE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedMetadataComplete() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isOverrideMetadataComplete());
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingComposite.java
deleted file mode 100644
index 60f453b983..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingComposite.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractBasicMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmBasicMappingComposite extends AbstractBasicMappingComposite<BasicMapping>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmBasicMappingComposite(PropertyValueModel<? extends BasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeBasicSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, addSubPane(container, 4));
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingUiDefinition.java
deleted file mode 100644
index febf82f355..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmBasicMappingUiDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractBasicMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmBasicMappingUiDefinition
- extends AbstractBasicMappingUiDefinition<ReadOnlyPersistentAttribute, OrmBasicMapping>
- implements OrmAttributeMappingUiDefinition<OrmBasicMapping>
-{
- // singleton
- private static final OrmBasicMappingUiDefinition INSTANCE =
- new OrmBasicMappingUiDefinition();
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmBasicMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmBasicMappingUiDefinition() {
- super();
- }
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmBasicMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableComposite.java
deleted file mode 100644
index 6717dbe577..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableComposite.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEmbeddableComposite extends AbstractEmbeddableComposite<OrmEmbeddable> implements JpaComposite
-{
- public OrmEmbeddableComposite(PropertyValueModel<? extends OrmEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEmbeddableCollapsibleSection(container);
- }
-
- @Override
- protected void initializeEmbeddableSection(Composite container) {
- new OrmJavaClassChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new MetadataCompleteComposite(this, getSubjectHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<OrmEmbeddable, AccessHolder>(
- getSubjectHolder())
- {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableUiDefinition.java
deleted file mode 100644
index 9d611ac30e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddableUiDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddableUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEmbeddableUiDefinition
- extends AbstractEmbeddableUiDefinition<PersistentType, OrmEmbeddable>
- implements OrmTypeMappingUiDefinition<OrmEmbeddable>
-{
- // singleton
- private static final OrmEmbeddableUiDefinition INSTANCE = new OrmEmbeddableUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmTypeMappingUiDefinition<OrmEmbeddable> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEmbeddableUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildTypeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmEmbeddableComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingComposite.java
deleted file mode 100644
index 939321c5d3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingComposite.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedIdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEmbeddedIdMappingComposite
- extends AbstractEmbeddedIdMappingComposite<EmbeddedIdMapping>
-{
- public OrmEmbeddedIdMappingComposite(
- PropertyValueModel<? extends EmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeEmbeddedIdSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
-
- new EmbeddedMappingOverridesComposite(
- this,
- container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingUiDefinition.java
deleted file mode 100644
index 9d8a08c1ff..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedIdMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedIdMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEmbeddedIdMappingUiDefinition
- extends AbstractEmbeddedIdMappingUiDefinition<ReadOnlyPersistentAttribute, OrmEmbeddedIdMapping>
- implements OrmAttributeMappingUiDefinition<OrmEmbeddedIdMapping>
-{
- // singleton
- private static final OrmEmbeddedIdMappingUiDefinition INSTANCE =
- new OrmEmbeddedIdMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmEmbeddedIdMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEmbeddedIdMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmEmbeddedIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingComposite.java
deleted file mode 100644
index 44a45c4e49..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingComposite.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EmbeddedAttributeOverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- * @see BaseJavaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEmbeddedMappingComposite
- extends AbstractEmbeddedMappingComposite<EmbeddedMapping>
-{
- /**
- * Creates a new <code>EmbeddedMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>EmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEmbeddedMappingComposite(PropertyValueModel<? extends EmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEmbeddedSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
-
- new EmbeddedMappingOverridesComposite(
- this,
- container
- );
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingUiDefinition.java
deleted file mode 100644
index 532f197eb0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEmbeddedMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEmbeddedMappingUiDefinition
- extends AbstractEmbeddedMappingUiDefinition<ReadOnlyPersistentAttribute, OrmEmbeddedMapping>
- implements OrmAttributeMappingUiDefinition<OrmEmbeddedMapping>
-{
- // singleton
- private static final OrmEmbeddedMappingUiDefinition INSTANCE =
- new OrmEmbeddedMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmEmbeddedMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEmbeddedMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmEmbeddedMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityComposite.java
deleted file mode 100644
index ebbbcdbcfd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityComposite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an ORM entity.
- *
- * @see OrmEntity
- * @see BaseJavaUiFactory - The factory creating this pane
- * @see OrmSecondaryTablesComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class OrmEntityComposite extends AbstractOrmEntityComposite
-{
- /**
- * Creates a new <code>OrmEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>OrmEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEntityComposite(PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityUiDefinition.java
deleted file mode 100644
index 28ec546536..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmEntityUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEntityUiDefinition
- extends AbstractEntityUiDefinition<PersistentType, OrmEntity>
- implements OrmTypeMappingUiDefinition<OrmEntity>
-{
- // singleton
- private static final OrmEntityUiDefinition INSTANCE =
- new OrmEntityUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmTypeMappingUiDefinition<OrmEntity> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmEntityUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildTypeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmEntityComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingComposite.java
deleted file mode 100644
index 83fb1c9850..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingComposite.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractIdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmIdMappingComposite
- extends AbstractIdMappingComposite<IdMapping>
-{
- public OrmIdMappingComposite(
- PropertyValueModel<? extends IdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingUiDefinition.java
deleted file mode 100644
index a66e67eba2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmIdMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractIdMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmIdMappingUiDefinition
- extends AbstractIdMappingUiDefinition<ReadOnlyPersistentAttribute, OrmIdMapping>
- implements OrmAttributeMappingUiDefinition<OrmIdMapping>
-{
- // singleton
- private static final OrmIdMappingUiDefinition INSTANCE =
- new OrmIdMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmIdMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmIdMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmIdMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmInheritanceComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmInheritanceComposite.java
deleted file mode 100644
index cbeadd2cd5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmInheritanceComposite.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractInheritanceComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for java inheritance.
- *
- * @see OrmEntity
- * @see OrmPrimaryKeyJoinColumnsComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class OrmInheritanceComposite extends AbstractInheritanceComposite<OrmEntity> {
-
- /**
- * Creates a new <code>OrmInheritanceComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrmInheritanceComposite(Pane<? extends OrmEntity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void addPrimaryKeyJoinColumnsComposite(Composite container) {
- new OrmPrimaryKeyJoinColumnsComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmJavaClassChooser.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmJavaClassChooser.java
deleted file mode 100644
index 84bdc29914..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmJavaClassChooser.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | ClassChooserPane |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * TODO possibly help the user and if they have chosen a package at the
- * entity-mappings level only insert the class name in the xml file if they
- * choose a class from the package.
- * Not sure if this should be driven by the UI or by ui api in the model
- *
- * @see OrmTypeMapping
- * @see OrmPersistentTypeDetailsPage - The parent container
- * @see ClassChooserPane
- *
- * @version 2.0
- * @since 1.0
- */
-public class OrmJavaClassChooser extends Pane<OrmTypeMapping> {
-
- /**
- * Creates a new <code>XmlJavaClassChooser</code>.
- *
- * @param parentPane The parent controller of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public OrmJavaClassChooser(Pane<?> parentPane,
- PropertyValueModel<? extends OrmTypeMapping> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- public OrmJavaClassChooser(Pane<?> parentPane,
- PropertyValueModel<? extends OrmTypeMapping> subjectHolder,
- Composite parent,
- boolean automaticallyAlignWidgets) {
-
- super(parentPane, subjectHolder, parent, automaticallyAlignWidgets);
- }
-
-
- private ClassChooserPane<OrmTypeMapping> addClassChooser(Composite container) {
-
- return new ClassChooserPane<OrmTypeMapping>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<OrmTypeMapping, String>(getSubjectHolder(), OrmTypeMapping.CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getClass_();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setClass(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getClass_();
- }
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsOrmMessages.OrmJavaClassChooser_javaClass;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- getSubject().setClass(className);
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getPersistentType().getName();
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addClassChooser(container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingComposite.java
deleted file mode 100644
index 21a0743a69..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingComposite.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToManyJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToManyMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToManyJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link CascadeComposite}
- * @see {@link OrderingComposite}
- *
- * @version 2.3
- * @since 1.0
- */
-public class OrmManyToManyMappingComposite
- extends AbstractManyToManyMappingComposite<ManyToManyMapping, ManyToManyRelationship>
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmManyToManyMappingComposite(PropertyValueModel<? extends ManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingUiDefinition.java
deleted file mode 100644
index ee2e44615a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToManyMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToManyMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmManyToManyMappingUiDefinition
- extends AbstractManyToManyMappingUiDefinition<ReadOnlyPersistentAttribute, OrmManyToManyMapping>
- implements OrmAttributeMappingUiDefinition<OrmManyToManyMapping>
-{
- // singleton
- private static final OrmManyToManyMappingUiDefinition INSTANCE =
- new OrmManyToManyMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmManyToManyMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmManyToManyMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmManyToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingComposite.java
deleted file mode 100644
index 8cb0a652c8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingComposite.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneRelationship;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ManyToOneJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link TargetEntityComposite}
- * @see {@link ManyToOneJoiningStrategyPane}
- * @see {@link FetchTypeComposite}
- * @see {@link OptionalComposite}
- * @see {@link CascadeComposite}
- *
- * @version 2.3
- * @since 1.0
- */
-public class OrmManyToOneMappingComposite
- extends AbstractManyToOneMappingComposite<OrmManyToOneMapping, OrmManyToOneRelationship>
-{
- /**
- * Creates a new <code>ManyToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmManyToOneMappingComposite(PropertyValueModel<? extends OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingUiDefinition.java
deleted file mode 100644
index 2738762508..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmManyToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToOneMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmManyToOneMappingUiDefinition
- extends AbstractManyToOneMappingUiDefinition<ReadOnlyPersistentAttribute, OrmManyToOneMapping>
- implements OrmAttributeMappingUiDefinition<OrmManyToOneMapping>
-{
- // singleton
- private static final OrmManyToOneMappingUiDefinition INSTANCE =
- new OrmManyToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmManyToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmManyToOneMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmManyToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassComposite.java
deleted file mode 100644
index b26ea5dd75..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassComposite.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappedSuperclassComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmMappedSuperclassComposite
- extends AbstractMappedSuperclassComposite<OrmMappedSuperclass>
- implements JpaComposite
-{
- public OrmMappedSuperclassComposite(
- PropertyValueModel<? extends OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeMappedSuperclassSection(Composite container) {
- new OrmJavaClassChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- new MetadataCompleteComposite(this, getSubjectHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<OrmMappedSuperclass, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassUiDefinition.java
deleted file mode 100644
index 3b919460e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappedSuperclassUiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappedSuperclassUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmMappedSuperclassUiDefinition
- extends AbstractMappedSuperclassUiDefinition<PersistentType, OrmMappedSuperclass>
- implements OrmTypeMappingUiDefinition<OrmMappedSuperclass>
-{
- // singleton
- private static final OrmMappedSuperclassUiDefinition INSTANCE =
- new OrmMappedSuperclassUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmTypeMappingUiDefinition<OrmMappedSuperclass> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmMappedSuperclassUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildTypeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmMappedSuperclassComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappingNameChooser.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappingNameChooser.java
deleted file mode 100644
index 1bd995b4c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmMappingNameChooser.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeMapping;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @see OrmPersistentAttributeDetailsPage - The parent container
- *
- * @version 2.3
- * @since 1.0
- */
-public class OrmMappingNameChooser
- extends Pane<AttributeMapping>
-{
- /**
- * Creates a new <code>XmlJavaAttributeChooser</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public OrmMappingNameChooser(Pane<?> parentPane,
- PropertyValueModel<? extends AttributeMapping> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.addLabeledText(
- container,
- JptUiDetailsOrmMessages.OrmMappingNameChooser_name,
- buildNameHolder()
- );
- }
- private ModifiablePropertyValueModel<String> buildNameHolder() {
- return new PropertyAspectAdapter<AttributeMapping, String>(getSubjectHolder(), OrmAttributeMapping.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (this.subject.getPersistentAttribute().isVirtual()) {
- return;
- }
- if (value.length() == 0) {
- value = null;
- }
- // we can safely cast to an orm.xml mapping since it is not virtual
- ((OrmAttributeMapping) this.subject).setName(value);
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingComposite.java
deleted file mode 100644
index da0df67b48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingComposite.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyRelationship;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinTableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OrderingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrderingComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToManyMapping
- * @see CascadeComposite
- * @see FetchTypeComposite
- * @see JoinTableComposite
- * @see OrderingComposite
- * @see TargetEntityComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public class OrmOneToManyMappingComposite
- extends AbstractOneToManyMappingComposite<OneToManyMapping, OneToManyRelationship>
-{
- /**
- * Creates a new <code>OneToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmOneToManyMappingComposite(PropertyValueModel<? extends OneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingUiDefinition.java
deleted file mode 100644
index f899ac6b7c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToManyMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToManyMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmOneToManyMappingUiDefinition
- extends AbstractOneToManyMappingUiDefinition<ReadOnlyPersistentAttribute, OrmOneToManyMapping>
- implements OrmAttributeMappingUiDefinition<OrmOneToManyMapping>
-{
- // singleton
- private static final OrmOneToManyMappingUiDefinition INSTANCE =
- new OrmOneToManyMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmOneToManyMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmOneToManyMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmOneToManyMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingComposite.java
deleted file mode 100644
index e072ae3c81..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingComposite.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetEntityComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | JoiningStrategyComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CascadeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OneToOneMapping
- * @see TargetEntityComposite
- * @see JoiningStrategyComposite
- * @see FetchTypeComposite
- * @see OptionalComposite
- * @see CascadeComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public class OrmOneToOneMappingComposite
- extends AbstractOneToOneMappingComposite<OneToOneMapping, OneToOneRelationship>
-{
- /**
- * Creates a new <code>OneToOneMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IOneToOneMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmOneToOneMappingComposite(PropertyValueModel<? extends OneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, container);
- new CascadeComposite(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingUiDefinition.java
deleted file mode 100644
index c37fa42c50..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmOneToOneMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToOneMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmOneToOneMappingUiDefinition
- extends AbstractOneToOneMappingUiDefinition<ReadOnlyPersistentAttribute, OrmOneToOneMapping>
- implements OrmAttributeMappingUiDefinition<OrmOneToOneMapping>
-{
- // singleton
- private static final OrmOneToOneMappingUiDefinition INSTANCE =
- new OrmOneToOneMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmOneToOneMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmOneToOneMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmOneToOneMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPackageChooser.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPackageChooser.java
deleted file mode 100644
index c58e9f031a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPackageChooser.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.widgets.PackageChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | PackageChooserPane |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see EntityMappingsDetailsPage - The parent container
- * @see PackageChooserPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class OrmPackageChooser extends Pane<EntityMappings>
-{
- /**
- * Creates a new <code>XmlPackageChooser</code>.
- *
- * @param parentPane The parent controller of this one
- * @param parent The parent container
- */
- public OrmPackageChooser(Pane<? extends EntityMappings> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- addPackageChooserPane(container);
- }
-
- private void addPackageChooserPane(Composite container) {
-
- new PackageChooserPane<EntityMappings>(this, container) {
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<EntityMappings, String>(getSubjectHolder(), EntityMappings.PACKAGE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getPackage();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setPackage(value == "" ? null : value); //$NON-NLS-1$
- }
- };
- }
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsOrmMessages.EntityMappingsDetailsPage_package;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected String getPackageName() {
- return getSubject().getPackage();
- }
-
- @Override
- protected void setPackageName(String packageName) {
- getSubject().setPackage(packageName);
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsPage.java
deleted file mode 100644
index 144e10cde1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsPage.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.PersistentAttributeDetailsPage;
-import org.eclipse.jpt.jpa.ui.internal.details.PersistentAttributeMapAsComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The default implementation of the details page used for the XML persistent
- * attribute.
- * <p>
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OrmPersistentAttributeMapAsComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | Attribute mapping pane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OrmPersistentAttribute
- * @see OrmPersistentAttributeMapAsComposite
- *
- * @version 2.3
- * @since 2.0
- */
-public class OrmPersistentAttributeDetailsPage
- extends PersistentAttributeDetailsPage<OrmReadOnlyPersistentAttribute>
-{
- /**
- * Creates a new <code>OrmPersistentAttributeDetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmPersistentAttributeDetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- ArrayList<Pane<?>> panes = new ArrayList<Pane<?>>(2);
-
- // Map As composite
- Pane<?> mapAsPane = buildMapAsPane(addSubPane(container, 0, 0, 5, 0));
- panes.add(mapAsPane);
-
- buildMappingPageBook(container);
-
- installPaneEnabler(panes);
- }
-
- protected Pane<ReadOnlyPersistentAttribute> buildMapAsPane(Composite parent) {
- return new PersistentAttributeMapAsComposite(this, parent);
- }
-
- private void installPaneEnabler(ArrayList<Pane<?>> panes) {
- new PaneEnabler(buildPaneEnablerHolder(), panes);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<OrmReadOnlyPersistentAttribute, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform_(OrmReadOnlyPersistentAttribute value) {
- return Boolean.valueOf(!value.isVirtual());
- }
- };
- }
-
-
- //TODO this probably needs to change and use a PaneEnabler instead.
- @Override
- protected JpaComposite getMappingComposite(String key) {
- JpaComposite mappingComposite = super.getMappingComposite(key);
- if (mappingComposite == null) {
- return null;
- }
- boolean enabled = false;
-
- if (getSubject() != null && getSubject().getParent() != null) {
- enabled = !getSubject().isVirtual();
- }
-
- mappingComposite.enableWidgets(enabled);
- return mappingComposite;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsProvider.java
deleted file mode 100644
index b4411fcaf4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentAttributeDetailsProvider.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPageManager}
- * when the information comes from the XML file (either from the persistence
- * configuration or from the Mappings Descriptor).
- */
-public class OrmPersistentAttributeDetailsProvider
- implements JpaDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new OrmPersistentAttributeDetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmPersistentAttributeDetailsProvider() {
- super();
- }
-
-
- public boolean providesDetails(JpaStructureNode structureNode) {
- return Tools.valuesAreEqual(structureNode.getType(), OrmPersistentAttribute.class)
- && structureNode.getResourceType().getContentType().isKindOf(JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE);
- }
-
- public JpaDetailsPageManager<OrmReadOnlyPersistentAttribute> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new OrmPersistentAttributeDetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentTypeDetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentTypeDetailsProvider.java
deleted file mode 100644
index c9e82513d4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPersistentTypeDetailsProvider.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.PersistentTypeDetailsPage;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This provider is responsible for creating the {@link JpaDetailsPageManager}
- * when the information comes from the XML file (either from the persistence
- * configuration or from the Mappings Descriptor).
- */
-public class OrmPersistentTypeDetailsProvider
- implements JpaDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new OrmPersistentTypeDetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmPersistentTypeDetailsProvider() {
- super();
- }
-
-
- public boolean providesDetails(JpaStructureNode structureNode) {
- return Tools.valuesAreEqual(structureNode.getType(), OrmPersistentType.class)
- && structureNode.getResourceType().getContentType().isKindOf(JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE);
- }
-
- public JpaDetailsPageManager<PersistentType> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new PersistentTypeDetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPrimaryKeyJoinColumnsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPrimaryKeyJoinColumnsComposite.java
deleted file mode 100644
index df9fc2d4ad..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmPrimaryKeyJoinColumnsComposite.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractPrimaryKeyJoinColumnsComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @see OrmEntity
- * @see OrmInheritanceComposite - The container of this pane
- *
- * @version 2.0
- * @since 2.0
- */
-public class OrmPrimaryKeyJoinColumnsComposite extends AbstractPrimaryKeyJoinColumnsComposite<OrmEntity>
-{
- public OrmPrimaryKeyJoinColumnsComposite(Pane<? extends OrmEntity> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent);
- }
-
- @Override
- protected ListValueModel<ReadOnlyPrimaryKeyJoinColumn> buildDefaultJoinColumnsListHolder() {
- return new ListAspectAdapter<OrmEntity, ReadOnlyPrimaryKeyJoinColumn>(
- getSubjectHolder(),
- OrmEntity.DEFAULT_PRIMARY_KEY_JOIN_COLUMNS_LIST)
- {
- @Override
- protected ListIterable<ReadOnlyPrimaryKeyJoinColumn> getListIterable() {
- return subject.getDefaultPrimaryKeyJoinColumns();
- }
- @Override
- protected int size_() {
- return subject.getDefaultPrimaryKeyJoinColumnsSize();
- }
- };
- }
-
- @Override
- protected void switchDefaultToSpecified() {
- for (ReadOnlyPrimaryKeyJoinColumn defaultJoinColumn : getSubject().getDefaultPrimaryKeyJoinColumns()) {
- String columnName = defaultJoinColumn.getName();
- String referencedColumnName = defaultJoinColumn.getReferencedColumnName();
-
- PrimaryKeyJoinColumn pkJoinColumn = getSubject().addSpecifiedPrimaryKeyJoinColumn();
- pkJoinColumn.setSpecifiedName(columnName);
- pkJoinColumn.setSpecifiedReferencedColumnName(referencedColumnName);
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmQueriesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmQueriesComposite.java
deleted file mode 100644
index 98d6dbb72a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmQueriesComposite.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.internal.details.QueriesComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | QueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EntityMappings
- * @see EntityMappingsDetailsPage - The parent container
- * @see QueriesComposite
- *
- * @version 2.0
- * @since 2.0
- */
-public class OrmQueriesComposite extends Pane<EntityMappings> {
-
- /**
- * Creates a new <code>OrmQueriesComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrmQueriesComposite(Pane<? extends EntityMappings> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<EntityMappings, Boolean>(getSubjectHolder()) {
- @Override
- protected Boolean transform(EntityMappings value) {
- return (value != null);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = this.addCollapsibleSection(
- container,
- JptUiDetailsOrmMessages.OrmQueriesComposite_groupBox
- );
-
- QueriesComposite queriesComposite = this.buildQueriesComposite(container, this.buildQueryContainerHolder());
-
- this.installPaneEnabler(queriesComposite);
- }
-
- protected QueriesComposite buildQueriesComposite(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- return new QueriesComposite(this, queryContainerHolder, container);
- }
-
- private PropertyValueModel<QueryContainer> buildQueryContainerHolder() {
- return new PropertyAspectAdapter<EntityMappings, QueryContainer>(getSubjectHolder()) {
- @Override
- protected QueryContainer buildValue_() {
- return this.subject.getQueryContainer();
- }
- };
- }
- private void installPaneEnabler(QueriesComposite queriesComposite) {
- new PaneEnabler(
- buildPaneEnablerHolder(),
- queriesComposite
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmSecondaryTablesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmSecondaryTablesComposite.java
deleted file mode 100644
index 513705fe13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmSecondaryTablesComposite.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.ReadOnlySecondaryTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyTable;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualSecondaryTable;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractSecondaryTablesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.PrimaryKeyJoinColumnsInSecondaryTableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.SecondaryTableDialog;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PrimaryKeyJoinColumnsInSecondaryTableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see OrmEntity
- * @see OrmEntityComposite - The container of this pane
- * @see AddRemoveListPane
- * @see PrimaryKeyJoinColumnsInSecondaryTableComposite
- *
- * @version 2.0
- * @since 1.0
- */
-public class OrmSecondaryTablesComposite extends AbstractSecondaryTablesComposite<OrmEntity>
-{
- /**
- * Creates a new <code>OrmSecondaryTablesComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrmSecondaryTablesComposite(Pane<? extends OrmEntity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- /**
- * Creates a new <code>SecondaryTablesComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmSecondaryTablesComposite(PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- private ModifiablePropertyValueModel<Boolean> buildDefineInXmlHolder() {
- return new DefineInXmlHolder();
- }
-
- private ListValueModel<ReadOnlySecondaryTable> buildSecondaryTablesListHolder() {
- List<ListValueModel<? extends ReadOnlySecondaryTable>> list = new ArrayList<ListValueModel<? extends ReadOnlySecondaryTable>>();
- list.add(buildSpecifiedSecondaryTablesListHolder());
- list.add(buildVirtualSecondaryTablesListHolder());
- return new CompositeListValueModel<ListValueModel<? extends ReadOnlySecondaryTable>, ReadOnlySecondaryTable>(list);
- }
-
- private ListValueModel<ReadOnlySecondaryTable> buildSecondaryTablesListModel() {
- return new ItemPropertyListValueModelAdapter<ReadOnlySecondaryTable>(buildSecondaryTablesListHolder(),
- ReadOnlyTable.SPECIFIED_NAME_PROPERTY);
- }
-
- private ListValueModel<OrmSecondaryTable> buildSpecifiedSecondaryTablesListHolder() {
- return new ListAspectAdapter<OrmEntity, OrmSecondaryTable>(getSubjectHolder(), Entity.SPECIFIED_SECONDARY_TABLES_LIST) {
- @Override
- protected ListIterable<OrmSecondaryTable> getListIterable() {
- return this.subject.getSpecifiedSecondaryTables();
- }
-
- @Override
- protected int size_() {
- return this.subject.getSpecifiedSecondaryTablesSize();
- }
- };
- }
-
- ListValueModel<OrmVirtualSecondaryTable> buildVirtualSecondaryTablesListHolder() {
- return new ListAspectAdapter<OrmEntity, OrmVirtualSecondaryTable>(getSubjectHolder(), OrmEntity.VIRTUAL_SECONDARY_TABLES_LIST) {
- @Override
- protected ListIterable<OrmVirtualSecondaryTable> getListIterable() {
- return this.subject.getVirtualSecondaryTables();
- }
-
- @Override
- protected int size_() {
- return this.subject.getVirtualSecondaryTablesSize();
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = getGroupBoxMargin();
-
- ModifiablePropertyValueModel<SecondaryTable> secondaryTableHolder =
- buildSecondaryTableHolder();
-
- ModifiablePropertyValueModel<Boolean> defineInXmlHolder =
- buildDefineInXmlHolder();
-
- // Override Define In XML check box
- addCheckBox(
- addSubPane(container, 0, groupBoxMargin),
- JptUiDetailsMessages.OrmSecondaryTablesComposite_defineInXml,
- defineInXmlHolder,
- null
- );
-
- // Secondary Tables add/remove list pane
- AddRemoveListPane<Entity> listPane = new AddRemoveListPane<Entity>(
- this,
- addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin),
- buildSecondaryTablesAdapter(),
- buildSecondaryTablesListModel(),
- secondaryTableHolder,
- buildSecondaryTableLabelProvider(),
- JpaHelpContextIds.MAPPING_JOIN_TABLE_COLUMNS//TODO need a help context id for this
- );
-
- installListPaneEnabler(defineInXmlHolder, listPane);
-
- // Primary Key Join Columns pane
- new PrimaryKeyJoinColumnsInSecondaryTableComposite(
- this,
- secondaryTableHolder,
- container
- );
- }
-
- private void installListPaneEnabler(ModifiablePropertyValueModel<Boolean> defineInXmlHolder,
- AddRemoveListPane<Entity> listPane) {
-
- new PaneEnabler(defineInXmlHolder, listPane);
- }
-
- @Override
- protected SecondaryTableDialog buildSecondaryTableDialogForAdd() {
- // defaultSchema and defaultCatalog should not be taken from the Table in this case.
- // The table default schema could be what is the specified schema on the java table.
- return new SecondaryTableDialog(
- getShell(), getSubject().getJpaProject(),
- getSubject().getMappingFileRoot().getCatalog(),
- getSubject().getMappingFileRoot().getSchema());
- }
-
- private class DefineInXmlHolder extends ListPropertyValueModelAdapter<Boolean>
- implements ModifiablePropertyValueModel<Boolean> {
-
- public DefineInXmlHolder() {
- super(buildVirtualSecondaryTablesListHolder());
- }
-
- @Override
- protected Boolean buildValue() {
- if (getSubject() == null) {
- return Boolean.FALSE;
- }
- return Boolean.valueOf(getSubject().secondaryTablesAreDefinedInXml());
- }
-
- public void setValue(Boolean value) {
- getSubject().setSecondaryTablesAreDefinedInXml(value.booleanValue());
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmTransientMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmTransientMappingUiDefinition.java
deleted file mode 100644
index de38367117..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmTransientMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractTransientMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmTransientMappingUiDefinition
- extends AbstractTransientMappingUiDefinition<ReadOnlyPersistentAttribute, OrmTransientMapping>
- implements OrmAttributeMappingUiDefinition<OrmTransientMapping>
-{
- // singleton
- private static final OrmTransientMappingUiDefinition INSTANCE =
- new OrmTransientMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmTransientMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmTransientMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmTransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmTransientMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingComposite.java
deleted file mode 100644
index af5bb381d1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingComposite.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractVersionMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmVersionMappingComposite
- extends AbstractVersionMappingComposite<VersionMapping>
-{
- /**
- * Creates a new <code>EclipseLinkOrmVersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>VersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmVersionMappingComposite(PropertyValueModel<? extends VersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeVersionSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingUiDefinition.java
deleted file mode 100644
index de8d9b3207..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmVersionMappingUiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractVersionMappingUiDefinition;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmVersionMappingUiDefinition
- extends AbstractVersionMappingUiDefinition<ReadOnlyPersistentAttribute, OrmVersionMapping>
- implements OrmAttributeMappingUiDefinition<OrmVersionMapping>
-{
- // singleton
- private static final OrmVersionMappingUiDefinition INSTANCE =
- new OrmVersionMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmVersionMapping> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmVersionMappingUiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return factory.createOrmVersionMappingComposite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java
deleted file mode 100644
index 19af51e450..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/OrmXmlUiDefinition.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.structure.OrmStructureItemContentProviderFactory;
-import org.eclipse.jpt.jpa.ui.internal.structure.OrmStructureItemLabelProviderFactory;
-
-public class OrmXmlUiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new OrmXmlUiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmXmlUiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new GenericOrmXmlUiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- public static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
- new SimpleItemTreeStateProviderFactoryProvider(
- OrmStructureItemContentProviderFactory.instance(),
- OrmStructureItemLabelProviderFactory.instance()
- );
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(
- List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
-
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(
- List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
-
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java
deleted file mode 100644
index 775d37f073..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/PersistenceUnitMetadataComposite.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmPersistenceUnitDefaults2_0;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.Jpa2_0XmlFlagModel;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | - Persistence Unit ------------------------------------------------------ |
- * | |
- * | x XML Mapping Metadata Complete |
- * | |
- * | x Cascade Persist |
- * | |
- * | ------------------------------------------------------------ |
- * | Schema: | SchemaCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | CatalogCombo | |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Access Type: | |v| |
- * | ------------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnitMetadata
- * @see OrmPersistenceUnitDefaults
- * @see EntityMappingsDetailsPage - The parent container
- * @see CatalogCombo
- * @see SchemaCombo
- * @see EnumFormComboViewer
- *
- * @version 2.0
- * @since 2.0
- */
-public class PersistenceUnitMetadataComposite extends Pane<OrmPersistenceUnitMetadata>
-{
- PropertyValueModel<OrmPersistenceUnitDefaults> persistenceUnitDefaultsHolder;
-
- /**
- * Creates a new <code>PersistenceUnitMetadataComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public PersistenceUnitMetadataComposite(Pane<?> parentPane,
- PropertyValueModel<? extends OrmPersistenceUnitMetadata> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.persistenceUnitDefaultsHolder = this.buildPersistenceUnitDefaultsHolder();
- }
-
- protected PropertyValueModel<OrmPersistenceUnitDefaults> getPersistenceUnitDefaultsHolder() {
- return this.persistenceUnitDefaultsHolder;
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildCascadePersistHolder() {
- return new PropertyAspectAdapter<OrmPersistenceUnitDefaults, Boolean>(getPersistenceUnitDefaultsHolder(), OrmPersistenceUnitDefaults.CASCADE_PERSIST_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isCascadePersist());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setCascadePersist(value.booleanValue());
- }
- };
- }
-
- protected CatalogCombo<OrmPersistenceUnitDefaults> addCatalogCombo(Composite container) {
-
- return new CatalogCombo<OrmPersistenceUnitDefaults>(this, getPersistenceUnitDefaultsHolder(), container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(OrmPersistenceUnitDefaults.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(OrmPersistenceUnitDefaults.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultCatalog();
- }
-
- @Override
- protected void setValue(String value) {
- getSubject().setSpecifiedCatalog(value);
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedCatalog();
- }
- };
- }
-
- private PropertyValueModel<OrmPersistenceUnitDefaults> buildPersistenceUnitDefaultsHolder() {
- return new TransformationPropertyValueModel<OrmPersistenceUnitMetadata, OrmPersistenceUnitDefaults>(getSubjectHolder()) {
- @Override
- protected OrmPersistenceUnitDefaults transform_(OrmPersistenceUnitMetadata value) {
- return value.getPersistenceUnitDefaults();
- }
- };
- }
-
- protected SchemaCombo<OrmPersistenceUnitDefaults> addSchemaCombo(Composite container) {
-
- return new SchemaCombo<OrmPersistenceUnitDefaults>(this, getPersistenceUnitDefaultsHolder(), container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(OrmPersistenceUnitDefaults.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(OrmPersistenceUnitDefaults.SPECIFIED_SCHEMA_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultSchema();
- }
-
- @Override
- protected void setValue(String value) {
- getSubject().setSpecifiedSchema(value);
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedSchema();
- }
-
- @Override
- protected SchemaContainer getDbSchemaContainer_() {
- return this.getSubject().getDbSchemaContainer();
- }
-
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildXmlMappingMetadataCompleteHolder() {
- return new PropertyAspectAdapter<OrmPersistenceUnitMetadata, Boolean>(getSubjectHolder(), OrmPersistenceUnitMetadata.XML_MAPPING_METADATA_COMPLETE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isXmlMappingMetadataComplete());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setXmlMappingMetadataComplete(value.booleanValue());
- }
- };
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildDelimitedIdentifiersHolder() {
- return new PropertyAspectAdapter<OrmPersistenceUnitDefaults, Boolean>(getPersistenceUnitDefaultsHolder(), OrmPersistenceUnitDefaults2_0.DELIMITED_IDENTIFIERS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.buildBooleanValue_());
- }
-
- protected boolean buildBooleanValue_() {
- return JptJpaCorePlugin.nodeIsJpa2_0Compatible(this.subject) &&
- ((OrmPersistenceUnitDefaults2_0) this.subject).isDelimitedIdentifiers();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (JptJpaCorePlugin.nodeIsJpa2_0Compatible(this.subject)) {
- ((OrmPersistenceUnitDefaults2_0) this.subject).setDelimitedIdentifiers(value.booleanValue());
- }
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Section
- container = addCollapsibleSection(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_persistenceUnitSection
- );
-
- // XML mapping metadata complete check box
- addCheckBox(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_xmlMappingMetadataCompleteCheckBox,
- buildXmlMappingMetadataCompleteHolder(),
- JpaHelpContextIds.ENTITY_ORM_XML
- );
-
- // Cascade Persist check-box
- addCheckBox(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_cascadePersistCheckBox,
- buildCascadePersistHolder(),
- JpaHelpContextIds.ENTITY_ORM_CASCADE
- );
-
- // Schema widgets
- addLabeledComposite(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_schema,
- addSchemaCombo(container),
- JpaHelpContextIds.ENTITY_ORM_SCHEMA
- );
-
- // Catalog widgets
- addLabeledComposite(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_catalog,
- addCatalogCombo(container),
- JpaHelpContextIds.ENTITY_ORM_CATALOG
- );
-
- new AccessTypeComposite(this, this.getPersistenceUnitDefaultsHolder(), container);
-
- // Delimited Identifiers check-box
- Button diCheckBox = this.addCheckBox(
- container,
- JptUiDetailsOrmMessages.PersistenceUnitMetadataComposite_delimitedIdentifiersCheckBox,
- this.buildDelimitedIdentifiersHolder(),
- JpaHelpContextIds.ENTITY_ORM_DELIMITED_IDENTIFIERS
- );
-
- SWTTools.controlVisibleState(new Jpa2_0XmlFlagModel<OrmPersistenceUnitMetadata>(this.getSubjectHolder()), diCheckBox);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/UnsupportedOrmMappingUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/UnsupportedOrmMappingUiDefinition.java
deleted file mode 100644
index d4a0f788e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/details/orm/UnsupportedOrmMappingUiDefinition.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-
-public class UnsupportedOrmMappingUiDefinition
- extends AbstractMappingUiDefinition
- implements OrmAttributeMappingUiDefinition
-{
- // singleton
- private static final UnsupportedOrmMappingUiDefinition INSTANCE =
- new UnsupportedOrmMappingUiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private UnsupportedOrmMappingUiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsOrmMessages.UnsupportedOrmMappingUiProvider_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsOrmMessages.UnsupportedOrmMappingUiProvider_linkLabel;
- }
-
- public String getKey() {
- return null;
- }
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new NullComposite(subjectHolder, parent, widgetFactory);
- }
-
- public static class NullComposite extends Pane<JavaAttributeMapping>
- implements JpaComposite
- {
- NullComposite(
- PropertyValueModel<JavaAttributeMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {}
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java
deleted file mode 100644
index bc71dfa1ca..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/dialogs/AddPersistentAttributeToXmlAndMapDialog.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.dialogs;
-
-import java.util.Comparator;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import com.ibm.icu.text.Collator;
-
-public class AddPersistentAttributeToXmlAndMapDialog extends StatusDialog
-{
- private OrmReadOnlyPersistentAttribute unmappedPersistentAttribute;
- private Text attributeText;
- private ComboViewer mappingCombo;
-
- public AddPersistentAttributeToXmlAndMapDialog(Shell parentShell, OrmReadOnlyPersistentAttribute unmappedPersistentAttribute) {
- super(parentShell);
- this.unmappedPersistentAttribute = unmappedPersistentAttribute;
- setTitle(JptUiMessages.AddPersistentAttributeDialog_title);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
-
- Composite composite = new Composite(dialogArea, SWT.NULL);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setLayout(new GridLayout(2, false));
-
- createLabel(composite, 1, JptUiMessages.AddPersistentAttributeDialog_attributeLabel);
-
- attributeText = createText(composite, 1);
-// attributeText.addModifyListener(
-// new ModifyListener() {
-// public void modifyText(ModifyEvent e) {
-// validate();
-// }
-// }
-// );
- attributeText.setText(unmappedPersistentAttribute.getName());
- attributeText.setEditable(false);
-
- createLabel(composite, 1, JptUiMessages.AddPersistentClassDialog_mappingLabel);
-
- mappingCombo = new ComboViewer(createCombo(composite, 1));
- mappingCombo.getCombo().setFocus();
- mappingCombo.setContentProvider(
- new IStructuredContentProvider() {
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return ArrayTools.array(
- CollectionTools.sort(
- new FilteringIterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ?>>(
- ((JpaPlatformUi) inputElement).attributeMappingUiDefinitions(unmappedPersistentAttribute.getResourceType())) {
- @Override
- protected boolean accept(MappingUiDefinition<ReadOnlyPersistentAttribute, ?> o) {
- return o.isEnabledFor(AddPersistentAttributeToXmlAndMapDialog.this.unmappedPersistentAttribute);
- }
- },
- getProvidersComparator()));
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- });
- mappingCombo.setLabelProvider(
- new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((MappingUiDefinition) element).getLabel();
- }
- });
- mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- validate();
- }
- });
- JpaPlatformUi jpaPlatformUi = (JpaPlatformUi) this.unmappedPersistentAttribute.getJpaPlatform().getAdapter(JpaPlatformUi.class);
- mappingCombo.setInput(jpaPlatformUi);
- mappingCombo.getCombo().select(0); // select Basic to begin
-
- // TODO - F1 Help
- // PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IDaliHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE);
-
- //getButton(IDialogConstants.OK_ID).setEnabled(false); // disabled to start
- applyDialogFont(dialogArea);
-
- validate();
-
- return dialogArea;
- }
-
- protected Comparator<MappingUiDefinition> getProvidersComparator() {
- return new Comparator<MappingUiDefinition>() {
- public int compare(MappingUiDefinition item1, MappingUiDefinition item2) {
- String displayString1 = item1.getLabel();
- String displayString2 = item2.getLabel();
- return Collator.getInstance().compare(displayString1, displayString2);
- }
- };
- }
-
- private Label createLabel(Composite container, int span, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- private Text createText(Composite container, int span) {
- Text text = new Text(container, SWT.BORDER | SWT.SINGLE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- gd.widthHint = 250;
- text.setLayoutData(gd);
- return text;
- }
-
- private Combo createCombo(Composite container, int span) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- combo.setLayoutData(gd);
- return combo;
- }
-
- public String getAttributeName() {
- return attributeText.getText();
- }
-
- public String getMappingKey() {
- StructuredSelection selection = (StructuredSelection) mappingCombo.getSelection();
- return (selection.isEmpty()) ? null : ((MappingUiDefinition) selection.getFirstElement()).getKey();
- }
-
- private void validate() {
-// if (entityMappings.containsPersistentType(type)) {
-// updateStatus(
-// new Status(
-// IStatus.WARNING, JptJpaUiPlugin.PLUGIN_ID,
-// JptUiMessages.AddPersistentClassDialog_duplicateClassWarning));
-// return;
-// }
-//
- String mappingKey = getMappingKey();
- if (mappingKey == null) {
- updateStatus(
- new Status(
- IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentAttributeDialog_noMappingKeyError));
- return;
- }
-
- updateStatus(Status.OK_STATUS);
- }
-
- @Override
- protected void okPressed() {
- this.unmappedPersistentAttribute.addToXml(getMappingKey());
- super.okPressed();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/dialogs/AddPersistentClassDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/dialogs/AddPersistentClassDialog.java
deleted file mode 100644
index 392d44c5df..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/dialogs/AddPersistentClassDialog.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.dialogs;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.ControlContentAssistHelper;
-import org.eclipse.jdt.internal.ui.refactoring.contentassist.JavaTypeCompletionProcessor;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.StatusDialog;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.viewers.ComboViewer;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-public class AddPersistentClassDialog extends StatusDialog
-{
- private EntityMappings entityMappings;
-
- private Text classText;
-
- private Button classBrowseButton;
-
- private ComboViewer mappingCombo;
-
- private OrmPersistentType addedType;
-
-
- public AddPersistentClassDialog(Shell parentShell, EntityMappings entityMappings) {
- super(parentShell);
- this.entityMappings = entityMappings;
- setTitle(JptUiMessages.AddPersistentClassDialog_title);
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite dialogArea = (Composite) super.createDialogArea(parent);
-
- Composite composite = new Composite(dialogArea, SWT.NULL);
- composite.setLayoutData(new GridData(GridData.FILL_BOTH));
- composite.setLayout(new GridLayout(3, false));
-
- createLabel(composite, JptUiMessages.AddPersistentClassDialog_classLabel);
-
- this.classText = createText(composite);
- this.classText.addModifyListener(
- new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validate();
- }
- }
- );
-
- this.classBrowseButton = createButton(composite, JptUiMessages.General_browse);
- this.classBrowseButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- IType type = chooseType();
- if (type != null) {
- classText.setText(type.getFullyQualifiedName('$'));
- }
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
-
- createLabel(composite, JptUiMessages.AddPersistentClassDialog_mappingLabel);
-
- this.mappingCombo = new ComboViewer(createCombo(composite, 2));
- this.mappingCombo.setContentProvider(
- new IStructuredContentProvider() {
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return new Object[] {
- OrmMappedSuperclassUiDefinition.instance(),
- OrmEntityUiDefinition.instance(),
- OrmEmbeddableUiDefinition.instance()
- };
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- });
- this.mappingCombo.setLabelProvider(
- new LabelProvider() {
- @Override
- public String getText(Object element) {
- return ((MappingUiDefinition) element).getLabel();
- }
- });
- this.mappingCombo.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- validate();
- }
- });
- this.mappingCombo.setInput("FOO");
- this.mappingCombo.getCombo().select(1); // select Entity to begin
-
- // TODO - F1 Help
- // PlatformUI.getWorkbench().getHelpSystem().setHelp(group, IDaliHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE);
-
- //getButton(IDialogConstants.OK_ID).setEnabled(false); // disabled to start
- applyDialogFont(dialogArea);
-
- validate();
-
- return dialogArea;
- }
-
- private Label createLabel(Composite container, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- return label;
- }
-
- private Text createText(Composite container) {
- // TODO bug 156185 - when this is fixed there should be api for this
- JavaTypeCompletionProcessor javaTypeCompletionProcessor = new JavaTypeCompletionProcessor(false, false);
- IPackageFragmentRoot pfr = getPackageFragmentRoot();
- if (pfr != null) {
- javaTypeCompletionProcessor.setPackageFragment(pfr.getPackageFragment(""));
- }
-
- Text text = new Text(container, SWT.BORDER | SWT.SINGLE);
-
- ControlContentAssistHelper.createTextContentAssistant(
- text,
- javaTypeCompletionProcessor
- );
-
- text.setLayoutData(getFieldGridData());
- return text;
- }
-
- protected GridData getFieldGridData() {
- int margin = FieldDecorationRegistry.getDefault()
- .getMaximumDecorationWidth();
- GridData data = new GridData();
- data.horizontalAlignment = SWT.FILL;
- data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH + margin;
- data.horizontalIndent = margin;
- data.grabExcessHorizontalSpace = true;
- return data;
- }
-
- protected IPackageFragmentRoot getPackageFragmentRoot() {
- try {
- return this.getJpaProject().getJavaProject().getPackageFragmentRoots()[0];
- } catch (JavaModelException ex) {
- JptJpaUiPlugin.log(ex);
- return null;
- }
- }
-
-
- private Button createButton(Composite container, String text) {
- Button button = new Button(container, SWT.NONE);
- button.setText(text);
- return button;
- }
-
- private Combo createCombo(Composite container, int span) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- GridData gd = getFieldGridData();
- gd.horizontalSpan = span;
- combo.setLayoutData(gd);
- return combo;
- }
-
- private JpaProject getJpaProject() {
- return this.entityMappings.getJpaProject();
- }
-
- public String getClassName() {
- return this.classText.getText();
- }
-
- public String getMappingKey() {
- StructuredSelection selection = (StructuredSelection) this.mappingCombo.getSelection();
- return (selection.isEmpty()) ? null : ((MappingUiDefinition) selection.getFirstElement()).getKey();
- }
-
- protected IType chooseType() {
- IJavaElement[] elements= new IJavaElement[] { getJpaProject().getJavaProject() };
- IJavaSearchScope scope= SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
-
- SelectionDialog typeSelectionDialog;
- try {
- typeSelectionDialog =
- JavaUI.createTypeDialog(
- getShell(), service, scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false, getClassName());
- }
- catch (JavaModelException e) {
- JptJpaUiPlugin.log(e);
- throw new RuntimeException(e);
- }
- typeSelectionDialog.setTitle(JptUiMessages.AddPersistentClassDialog_classDialog_title);
- typeSelectionDialog.setMessage(JptUiMessages.AddPersistentClassDialog_classDialog_message);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
- return null;
- }
-
- private void validate() {
- String className = getClassName();
-
- if (StringTools.stringIsEmpty(className)) {
- updateStatus(
- new Status(
- IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentClassDialog_noClassError));
- return;
- }
- className = className.replace('$', '.');
-
- IType type;
- try {
- type = getJpaProject().getJavaProject().findType(className);
- }
- catch (JavaModelException jme) {
- type = null;
- }
-
- if (type == null) {
- updateStatus(
- new Status(
- IStatus.WARNING, JptJpaUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentClassDialog_classNotFoundWarning));
- return;
- }
-
- if (this.entityMappings.containsPersistentType(className)) {
- updateStatus(
- new Status(
- IStatus.WARNING, JptJpaUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentClassDialog_duplicateClassWarning));
- return;
- }
-
- String mappingKey = getMappingKey();
- if (mappingKey == null) {
- updateStatus(
- new Status(
- IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID,
- JptUiMessages.AddPersistentClassDialog_noMappingKeyError));
- return;
- }
-
- updateStatus(Status.OK_STATUS);
- }
-
- @Override
- protected void okPressed() {
- this.addedType = this.entityMappings.addPersistentType(getMappingKey(), getClassName());
- super.okPressed();
- }
-
- public OrmPersistentType openAndReturnType() {
- super.open();
- return addedType;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/editors/PersistenceContributor.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/editors/PersistenceContributor.java
deleted file mode 100644
index 4b2661a898..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/editors/PersistenceContributor.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.jpa.ui.internal.editors;
-
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.ide.IDEActionFactory;
-import org.eclipse.ui.part.MultiPageEditorActionBarContributor;
-import org.eclipse.ui.texteditor.ITextEditor;
-import org.eclipse.ui.texteditor.ITextEditorActionConstants;
-
-/**
- *
- * @version 2.0
- * @since 2.0
- */
-public class PersistenceContributor extends MultiPageEditorActionBarContributor {
-
- private IEditorPart activeEditorPart;
-
- /**
- * Creates a new <code>PersistenceContributor</code>.
- */
- public PersistenceContributor() {
- super();
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void contributeToMenu(IMenuManager manager) {
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void contributeToToolBar(IToolBarManager manager) {
- }
-
- /**
- * Returns the action registed with the given text editor.
- * @return IAction or null if editor is null.
- */
- protected IAction getAction(ITextEditor editor, String actionID) {
- return (editor == null ? null : editor.getAction(actionID));
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public void setActivePage(IEditorPart part) {
-
- if (activeEditorPart == part)
- return;
-
- activeEditorPart = part;
-
- IActionBars actionBars = getActionBars();
- if (actionBars != null) {
-
- ITextEditor editor = (part instanceof ITextEditor) ? (ITextEditor) part : null;
-
- actionBars.setGlobalActionHandler(
- ActionFactory.DELETE.getId(),
- getAction(editor, ITextEditorActionConstants.DELETE));
- actionBars.setGlobalActionHandler(
- ActionFactory.UNDO.getId(),
- getAction(editor, ITextEditorActionConstants.UNDO));
- actionBars.setGlobalActionHandler(
- ActionFactory.REDO.getId(),
- getAction(editor, ITextEditorActionConstants.REDO));
- actionBars.setGlobalActionHandler(
- ActionFactory.CUT.getId(),
- getAction(editor, ITextEditorActionConstants.CUT));
- actionBars.setGlobalActionHandler(
- ActionFactory.COPY.getId(),
- getAction(editor, ITextEditorActionConstants.COPY));
- actionBars.setGlobalActionHandler(
- ActionFactory.PASTE.getId(),
- getAction(editor, ITextEditorActionConstants.PASTE));
- actionBars.setGlobalActionHandler(
- ActionFactory.SELECT_ALL.getId(),
- getAction(editor, ITextEditorActionConstants.SELECT_ALL));
- actionBars.setGlobalActionHandler(
- ActionFactory.FIND.getId(),
- getAction(editor, ITextEditorActionConstants.FIND));
- actionBars.setGlobalActionHandler(
- IDEActionFactory.BOOKMARK.getId(),
- getAction(editor, IDEActionFactory.BOOKMARK.getId()));
- actionBars.updateActionBars();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/editors/PersistenceEditor.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/editors/PersistenceEditor.java
deleted file mode 100644
index b84da02f30..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/editors/PersistenceEditor.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.editors;
-
-import java.util.ListIterator;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.resource.LocalResourceManager;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.FormWidgetFactory;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.PersistenceXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.swt.custom.BusyIndicator;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.IManagedForm;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.editor.FormPage;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.forms.widgets.TableWrapData;
-import org.eclipse.ui.forms.widgets.TableWrapLayout;
-import org.eclipse.ui.views.properties.tabbed.TabbedPropertySheetWidgetFactory;
-import org.eclipse.wst.sse.ui.StructuredTextEditor;
-
-/**
- * This is the editor for the JPA Persistence Configuration (persistence.xml).
- * The pages shown before the XML source editor are retrieved from the
- * <code>JpaUiFactory</code>.
- *
- * @version 2.3
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class PersistenceEditor
- extends FormEditor
-{
- /**
- * The XML text editor.
- */
- private StructuredTextEditor editor;
-
- /**
- * The root of the holders used to retrieve the persistence unit and be
- * notified when it changes.
- */
- private ModifiablePropertyValueModel<IFileEditorInput> editorInputHolder;
-
- /**
- * The factory used to create the various widgets.
- */
- private WidgetFactory widgetFactory;
-
- final ResourceManager resourceManager;
-
- /**
- * Creates a new <code>PersistenceEditor</code>.
- */
- public PersistenceEditor() {
- super();
- this.resourceManager = new LocalResourceManager(JFaceResources.getResources());
- initialize();
- }
-
- /**
- * Delegate to the {@link #editor} if necessary.
- */
- @Override
- public Object getAdapter(@SuppressWarnings("rawtypes") Class adapterClass) {
- Object adapter = super.getAdapter(adapterClass);
- return (adapter != null) ? adapter : this.editor.getAdapter(adapterClass);
- }
-
- @Override
- protected void addPages() {
- addPersistenceUnitPages();
- addXMLEditorPage();
- }
-
- /**
- * Adds the pages that show the properties of the persistence configuration
- * or its persistence units.
- */
- private void addPersistenceUnitPages() {
-
- JpaProject jpaProject = getJpaProject();
-
- // The project doesn't have JPA
- if (jpaProject == null) {
- return;
- }
-
- PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
- if (persistenceXml == null) {
- return;
- }
- JptResourceType resourceType = persistenceXml.getResourceType();
- if (resourceType == null) {
- return; // might not ever get here... (if we have a p.xml, it probably has a resource type...)
- }
- JpaPlatformUi jpaPlatformUI = (JpaPlatformUi) jpaProject.getJpaPlatform().getAdapter(JpaPlatformUi.class);
- PersistenceXmlResourceUiDefinition definition =
- (PersistenceXmlResourceUiDefinition) jpaPlatformUI.getResourceUiDefinition(resourceType);
-
- ListIterator<JpaPageComposite> puPages = definition.buildPersistenceUnitComposites(
- buildPersistenceUnitHolder(),
- getContainer(),
- this.widgetFactory
- );
-
- while (puPages.hasNext()) {
- JpaPageComposite page = puPages.next();
-
- try {
- FormPage formPage = new Page(page);
- addPage(formPage);
- }
- catch (PartInitException e) {
- // TODO
- }
- }
- }
-
- /**
- * Adds the page containing the XML editor.
- */
- private void addXMLEditorPage() {
- try {
- editor = new StructuredTextEditor();
- editor.setEditorPart(this);
- int index = addPage(editor, getEditorInput());
- setPageText(index, JptUiPersistenceMessages.PersistenceEditor_sourceTab);
- }
- catch (PartInitException e) {
- // TODO
- }
- }
-
- private ModifiablePropertyValueModel<IFileEditorInput> buildEditorInputHolder() {
- return new SimplePropertyValueModel<IFileEditorInput>();
- }
-
- private PropertyValueModel<JpaProject> buildJpaProjectHolder() {
- return new TransformationPropertyValueModel<IFileEditorInput, JpaProject>(this.editorInputHolder) {
- @Override
- protected JpaProject transform_(IFileEditorInput fileEditorInput) {
- return PersistenceEditor.this.getJpaProject(fileEditorInput.getFile().getProject());
- }
- };
- }
-
- private PropertyValueModel<Persistence> buildPersistenceHolder() {
- return new PropertyAspectAdapter<PersistenceXml, Persistence>(buildPersistenceXmlHolder(), PersistenceXml.PERSISTENCE_PROPERTY) {
- @Override
- protected Persistence buildValue_() {
- return subject.getPersistence();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new ListPropertyValueModelAdapter<PersistenceUnit>(buildPersistenceUnitListHolder()) {
- @Override
- protected PersistenceUnit buildValue() {
- return listModel.size() > 0 ? (PersistenceUnit) listModel.get(0) : null;
- }
- };
- }
-
- private ListValueModel<PersistenceUnit> buildPersistenceUnitListHolder() {
- return new ListAspectAdapter<Persistence, PersistenceUnit>(buildPersistenceHolder(), Persistence.PERSISTENCE_UNITS_LIST) {
- @Override
- protected ListIterable<PersistenceUnit> getListIterable() {
- return subject.getPersistenceUnits();
- }
-
- @Override
- protected int size_() {
- return subject.getPersistenceUnitsSize();
- }
- };
- }
-
- private PropertyValueModel<PersistenceXml> buildPersistenceXmlHolder() {
- return new PropertyAspectAdapter<JpaRootContextNode, PersistenceXml>(buildRootContextNodeHolder(), JpaRootContextNode.PERSISTENCE_XML_PROPERTY) {
- @Override
- protected PersistenceXml buildValue_() {
- return subject.getPersistenceXml();
- }
- };
- }
-
- private PropertyValueModel<JpaRootContextNode> buildRootContextNodeHolder() {
- return new TransformationPropertyValueModel<JpaProject, JpaRootContextNode>(buildJpaProjectHolder()) {
- @Override
- protected JpaRootContextNode transform_(JpaProject jpaProject) {
- return jpaProject.getRootContextNode();
- }
- };
- }
-
- private WidgetFactory buildWidgetFactory() {
- return new FormWidgetFactory(
- new TabbedPropertySheetWidgetFactory()
- );
- }
-
- @Override
- public void dispose() {
- this.editorInputHolder.setValue(null);
- this.resourceManager.dispose();
- super.dispose();
- }
-
- @Override
- public void doSave(IProgressMonitor monitor) {
- getEditor(getPageCount() - 1).doSave(monitor);
- }
-
- @Override
- public void doSaveAs() {
- // do nothing
- }
-
- @Override
- public IFileEditorInput getEditorInput() {
- return (IFileEditorInput) super.getEditorInput();
- }
-
- @Override
- public void init(IEditorSite site, IEditorInput editorInput) throws PartInitException {
- Assert.isLegal(editorInput instanceof IFileEditorInput, "Invalid Input: Must be IFileEditorInput");
- super.init(site, editorInput);
-
- setPartName(editorInput.getName());
- editorInputHolder.setValue(getEditorInput());
- }
-
- /**
- * Initializes this multi-page editor.
- */
- private void initialize() {
-
- widgetFactory = buildWidgetFactory();
- editorInputHolder = buildEditorInputHolder();
- }
-
- @Override
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- /**
- * Retrieves the JPA project associated with the project owning the editor
- * intput file.
- *
- * @return The JPA project
- */
- protected JpaProject getJpaProject() {
- return this.getJpaProject(getEditorInput().getFile().getProject());
- }
-
- protected JpaProject getJpaProject(IProject project) {
- return (JpaProject) project.getAdapter(JpaProject.class);
- }
-
- /**
- * This extension over <code>FormPage</code> simply complete the layout by
- * using the <code>JpaPageComposite</code>'s control as its form content.
- */
- class Page
- extends FormPage
- {
- /**
- * The wrapped page that actually contains the widgets to show with this
- * form page.
- */
- private final JpaPageComposite page;
-
- private ImageDescriptor imageDescriptor;
-
- /**
- * Creates a new <code>Page</code>.
- *
- * @param page The wrapped <code>JpaPageComposite</code>
- */
- Page(JpaPageComposite page) {
-
- super(PersistenceEditor.this,
- page.getClass().getName(),
- page.getPageText());
-
- this.page = page;
- }
-
- @Override
- protected void createFormContent(IManagedForm managedForm) {
-
- ScrolledForm form = managedForm.getForm();
- managedForm.getToolkit().decorateFormHeading(form.getForm());
-
- // Update the text and image
- updateForm(form);
-
- // Update the layout
- updateBody(form);
-
- // This will finish the initialization of the buttons
- updateHelpButton();
- form.updateToolBar();
- }
-
- @Override
- public void dispose() {
- this.page.dispose();
- if (this.imageDescriptor != null) {
- PersistenceEditor.this.resourceManager.destroyImage(this.imageDescriptor);
- }
- super.dispose();
- }
-
- @Override
- public void setFocus() {
- this.page.getControl().setFocus();
- }
-
- /**
- * Adds the page's control to this page.
- *
- * @param form The form containing the composite with which the page's
- * control is parented
- */
- private void updateBody(ScrolledForm form) {
-
- Composite body = form.getBody();
-
- body.setLayout(new TableWrapLayout());
-
- TableWrapData wrapData = new TableWrapData(
- TableWrapData.FILL_GRAB,
- TableWrapData.FILL_GRAB
- );
-
- this.page.getControl().setLayoutData(wrapData);
- this.page.getControl().setParent(body);
- }
-
- /**
- * Updates the text and image of the form.
- *
- * @param form The form to have its title bar updated by setting the text
- * and image, the image can be <code>null</code>
- */
- private void updateForm(ScrolledForm form) {
- form.setText(this.page.getPageText());
-
- this.imageDescriptor = this.page.getPageImageDescriptor();
- if (this.imageDescriptor != null) {
- form.setImage(PersistenceEditor.this.resourceManager.createImage(this.imageDescriptor));
- }
- }
-
- /**
- * Adds a help button to the page's toolbar if a help ID exists.
- */
- private void updateHelpButton() {
-
- String helpID = this.page.getHelpID();
-
- if (helpID != null) {
- Action helpAction = new HelpAction(helpID);
-
- ScrolledForm form = getManagedForm().getForm();
- IToolBarManager manager = form.getToolBarManager();
- manager.add(helpAction);
- }
- }
-
- private class HelpAction
- extends Action
- {
- final String helpID;
-
- HelpAction(String helpID) {
- super(JptUiPersistenceMessages.PersistenceEditor_page_help,
- JFaceResources.getImageRegistry().getDescriptor(Dialog.DLG_IMG_HELP));
-
- this.helpID = helpID;
- }
-
- @Override
- public void run() {
- BusyIndicator.showWhile(getManagedForm().getForm().getDisplay(), new Runnable() {
- public void run() {
- PlatformUI.getWorkbench().getHelpSystem().displayHelp(helpID);
- }
- });
- }
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jface/XmlMappingFileViewerFilter.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jface/XmlMappingFileViewerFilter.java
deleted file mode 100644
index 18bf64e481..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jface/XmlMappingFileViewerFilter.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jface;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-
-/**
- * This filter will deny showing any file that are not XML mapping files or folders
- * that don't contain any XML mapping files in its sub-hierarchy. An XML mapping
- * file is one that has a corresponding JpaFile in the project with a mapping file
- * content type.
- * @see JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE
- */
-public class XmlMappingFileViewerFilter
- extends ViewerFilter {
-
- private final JpaProject jpaProject;
- private IContentType contentType;
-
-
- public XmlMappingFileViewerFilter(JpaProject jpaProject, IContentType contentType) {
- super();
- this.jpaProject = jpaProject;
- this.contentType = contentType;
- }
-
-
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
-
- if (element instanceof IFile) {
- return isMappingFile((IFile) element);
- }
- else if (element instanceof IContainer) {
- IContainer container = (IContainer) element;
- IProject project = this.jpaProject.getProject();
- ProjectResourceLocator locator = (ProjectResourceLocator) project.getAdapter(ProjectResourceLocator.class);
- if (locator.resourceLocationIsValid(container)) {
- try {
- for (IResource resource : container.members()) {
- if (select(viewer, container, resource)) {
- return true;
- }
- }
- }
- catch (CoreException ce) {
- // fall through
- JptJpaUiPlugin.log(ce);
- }
- }
- }
- return false;
- }
-
- /**
- * Determines whether the given file (an XML file) is a JPA mapping
- * descriptor file.
- */
- private boolean isMappingFile(IFile file) {
- JpaFile jpaFile = this.jpaProject.getJpaFile(file);
- return jpaFile != null ? jpaFile.getContentType().isKindOf(contentType): false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Generic2_0JpaPlatformUiProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Generic2_0JpaPlatformUiProvider.java
deleted file mode 100644
index 49c0736364..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Generic2_0JpaPlatformUiProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.AbstractJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentAttributeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmPersistentTypeDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.java.Generic2_0JavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.EntityMappings2_0DetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.PersistenceXml2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiDefinition;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-public class Generic2_0JpaPlatformUiProvider extends AbstractJpaPlatformUiProvider
-{
-
- // singleton
- private static final JpaPlatformUiProvider INSTANCE = new Generic2_0JpaPlatformUiProvider();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiProvider instance() {
- return INSTANCE;
- }
-
- /**
- * Ensure single instance.
- */
- private Generic2_0JpaPlatformUiProvider() {
- super();
- }
-
-
- // ********** details providers **********
-
- @Override
- protected void addDetailsProvidersTo(List<JpaDetailsProvider> providers) {
- providers.add(JavaPersistentTypeDetailsProvider.instance());
- providers.add(JavaPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappingsDetailsProvider.instance());
- providers.add(OrmPersistentTypeDetailsProvider.instance());
- providers.add(OrmPersistentAttributeDetailsProvider.instance());
- providers.add(EntityMappings2_0DetailsProvider.instance());
- }
-
-
- // ********** resource ui definitions **********
-
- @Override
- protected void addResourceUiDefinitionsTo(List<ResourceUiDefinition> definitions) {
- definitions.add(Generic2_0JavaResourceUiDefinition.instance());
- definitions.add(OrmXmlUiDefinition.instance());
- definitions.add(OrmXml2_0UiDefinition.instance());
- definitions.add(PersistenceXmlUiDefinition.instance());
- definitions.add(PersistenceXml2_0UiDefinition.instance());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/GenericOrmXml2_0UiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/GenericOrmXml2_0UiFactory.java
deleted file mode 100644
index 91409a7de4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/GenericOrmXml2_0UiFactory.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TransientMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.BaseOrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmBasicMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmElementCollectionMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmEmbeddedIdMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmEmbeddedMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmEntity2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmIdMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmManyToManyMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmManyToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmOneToManyMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmOneToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm.OrmVersionMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.jpa2.details.orm.OrmXmlUiFactory2_0;
-import org.eclipse.swt.widgets.Composite;
-
-public class GenericOrmXml2_0UiFactory
- extends BaseOrmXmlUiFactory
- implements OrmXmlUiFactory2_0
-{
- // **************** orm type mapping composites ****************************
-
- @Override
- public JpaComposite createOrmEntityComposite(
- PropertyValueModel<OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEntity2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** orm attribute mapping composites ***********************
-
- @Override
- public JpaComposite createOrmIdMappingComposite(
- PropertyValueModel<OrmIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedIdMappingComposite(
- PropertyValueModel<OrmEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEmbeddedIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmBasicMappingComposite(
- PropertyValueModel<OrmBasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmBasicMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmVersionMappingComposite(
- PropertyValueModel<OrmVersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmVersionMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToOneMappingComposite(
- PropertyValueModel<OrmManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmManyToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmOneToManyMappingComposite(
- PropertyValueModel<OrmOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmOneToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmOneToOneMappingComposite(
- PropertyValueModel<OrmOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmOneToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmManyToManyMappingComposite(
- PropertyValueModel<OrmManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmManyToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmEmbeddedMappingComposite(
- PropertyValueModel<OrmEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmEmbeddedMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createOrmTransientMappingComposite(
- PropertyValueModel<OrmTransientMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new TransientMappingComposite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createOrmElementCollectionMapping2_0Composite(
- PropertyValueModel<OrmElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new OrmElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Jpa2_0FlagTransformer.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Jpa2_0FlagTransformer.java
deleted file mode 100644
index 3e71baf8ef..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Jpa2_0FlagTransformer.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2;
-
-import java.io.Serializable;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.AbstractTransformer;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-
-/**
- * Transform a JPA node into a
- * flag indicating whether the node supports JPA 2.0.
- * The flag is <code>null</code> if the JPA node is <code>null</code>.
- */
-public final class Jpa2_0FlagTransformer<T extends JpaNode>
- extends AbstractTransformer<T, Boolean>
- implements Serializable
-{
- /**
- * Convert the specified JPA node model into a boolean model that returns
- * whether the JPA node supports JPA 2.0.
- * The flag is <code>null</code> if the JPA node is <code>null</code>.
- */
- public static <T extends JpaNode> PropertyValueModel<Boolean> convertToFlagModel(PropertyValueModel<T> jpaNodeModel) {
- return new TransformationPropertyValueModel<T, Boolean>(jpaNodeModel, Jpa2_0FlagTransformer.<T>instance());
- }
-
- @SuppressWarnings("rawtypes")
- private static final Transformer INSTANCE = new Jpa2_0FlagTransformer();
-
- @SuppressWarnings("unchecked")
- public static <T extends JpaNode> Transformer<T, Boolean> instance() {
- return INSTANCE;
- }
-
- // ensure single instance
- private Jpa2_0FlagTransformer() {
- super();
- }
-
- @Override
- protected Boolean transform_(T jpaNode) {
- return Boolean.valueOf(JptJpaCorePlugin.nodeIsJpa2_0Compatible(jpaNode));
- }
-
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Jpa2_0XmlFlagModel.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Jpa2_0XmlFlagModel.java
deleted file mode 100644
index 6be27abd7b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/Jpa2_0XmlFlagModel.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2;
-
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.XmlContextNode;
-
-public class Jpa2_0XmlFlagModel<T extends XmlContextNode> extends
- TransformationPropertyValueModel<T, Boolean> {
-
- public Jpa2_0XmlFlagModel(PropertyValueModel<T> valueModel) {
- super(valueModel);
- }
-
- @Override
- protected Boolean transform_(T value) {
- return Boolean.valueOf(JptJpaCorePlugin.nodeIsXml2_0Compatible(value));
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java
deleted file mode 100644
index 0d9d228d3b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0Composite.java
+++ /dev/null
@@ -1,381 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Converter;
-import org.eclipse.jpt.jpa.core.context.ConvertibleMapping;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.LobConverter;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EnumTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TemporalTypeComposite;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TemporalTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EnumTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | LobComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see OrderColumnComposite
- * @see EnumTypeComposite
- * @see FetchTypeComposite
- * @see LobComposite
- * @see OptionalComposite
- * @see TemporalTypeComposite
- *
- * @version 2.3
- * @since 2.3
- */
-public abstract class AbstractElementCollectionMapping2_0Composite<T extends ElementCollectionMapping2_0>
- extends Pane<T>
- implements JpaComposite
-{
-
- private Composite basicValueComposite;
-
- private Composite embeddableValueComposite;
-
- /**
- * Creates a new <code>BasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IBasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- protected AbstractElementCollectionMapping2_0Composite(PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
- @Override
- protected void initializeLayout(Composite container) {
- initializeElementCollectionCollapsibleSection(container);
- initializeValueCollapsibleSection(container);
- initializeKeyCollapsibleSection(container);
- initializeOrderingCollapsibleSection(container);
- }
-
- protected void initializeElementCollectionCollapsibleSection(Composite container) {
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages2_0.ElementCollectionSection_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE)
- );
-
- this.initializeElementCollectionSection(container);
- }
-
- protected void initializeElementCollectionSection(Composite container) {
- new TargetClassComposite(this, container);
- new FetchTypeComposite(this, container);
- new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container);
- }
-
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-
- protected void initializeValueCollapsibleSection(Composite container) {
- Composite valueSection = addCollapsibleSection(
- container,
- JptUiDetailsMessages2_0.AbstractElementCollectionMapping2_0_Composite_valueSectionTitle
- );
- initializeValueSection(valueSection);
- }
-
- protected void initializeKeyCollapsibleSection(Composite container) {
-
- }
-
- protected void initializeValueSection(Composite container) {
- PageBook pageBook = new PageBook(container, SWT.NULL);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalIndent = 5;
- pageBook.setLayoutData(gd);
-
- this.initializeBasicValueSection(pageBook);
- this.initializeEmbeddableValueSection(pageBook);
-
- installValueControlSwitcher(pageBook);
- }
-
- protected void initializeBasicValueSection(Composite container) {
- this.basicValueComposite = addSubPane(container);
-
- new ColumnComposite(this, buildValueColumnHolder(), this.basicValueComposite);
- // type section
- Composite converterSection = addCollapsibleSubSection(
- this.basicValueComposite,
- JptUiDetailsMessages.TypeSection_type,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
- ((GridLayout) converterSection.getLayout()).numColumns = 2;
-
- this.initializeBasicValueTypeSection(converterSection);
- }
-
- protected void initializeBasicValueTypeSection(Composite typeSection) {
- // No converter
- Button noConverterButton = addRadioButton(
- typeSection,
- JptUiDetailsMessages.TypeSection_default,
- buildNoConverterHolder(),
- null);
- ((GridData) noConverterButton.getLayoutData()).horizontalSpan = 2;
-
- // Lob
- Button lobButton = addRadioButton(
- typeSection,
- JptUiDetailsMessages.TypeSection_lob,
- buildLobConverterHolder(),
- null);
- ((GridData) lobButton.getLayoutData()).horizontalSpan = 2;
-
-
- PropertyValueModel<Converter> converterHolder = buildConverterHolder();
- // Temporal
- addRadioButton(
- typeSection,
- JptUiDetailsMessages.TypeSection_temporal,
- buildTemporalBooleanHolder(),
- null);
- registerSubPane(new TemporalTypeComposite(buildTemporalConverterHolder(converterHolder), typeSection, getWidgetFactory()));
-
-
- // Enumerated
- addRadioButton(
- typeSection,
- JptUiDetailsMessages.TypeSection_enumerated,
- buildEnumeratedBooleanHolder(),
- null);
- registerSubPane(new EnumTypeComposite(buildEnumeratedConverterHolder(converterHolder), typeSection, getWidgetFactory()));
- }
-
- protected void initializeEmbeddableValueSection(Composite container) {
- this.embeddableValueComposite = new ElementCollectionValueOverridesComposite(this, container).getControl();
- }
-
- private void installValueControlSwitcher(PageBook pageBook) {
-
- new ControlSwitcher(
- buildValueHolder(),
- buildPaneTransformer(),
- pageBook
- );
- }
-
- protected PropertyValueModel<ElementCollectionMapping2_0.Type> buildValueHolder() {
- return new PropertyAspectAdapter<T, ElementCollectionMapping2_0.Type>(
- this.getSubjectHolder(), ElementCollectionMapping2_0.VALUE_TYPE_PROPERTY) {
- @Override
- protected ElementCollectionMapping2_0.Type buildValue_() {
- return this.subject.getValueType();
- }
- };
- }
-
- private Transformer<ElementCollectionMapping2_0.Type, Control> buildPaneTransformer() {
- return new Transformer<ElementCollectionMapping2_0.Type, Control>() {
- public Control transform(ElementCollectionMapping2_0.Type type) {
- return AbstractElementCollectionMapping2_0Composite.this.transformValueType(type);
- }
- };
- }
-
- /**
- * Given the selected override, return the control that will be displayed
- */
- protected Control transformValueType(ElementCollectionMapping2_0.Type type) {
- if (type == null) {
- return null;
- }
- switch (type) {
- case BASIC_TYPE :
- return this.basicValueComposite;
- case EMBEDDABLE_TYPE :
- return this.embeddableValueComposite;
- default :
- return null;
- }
- }
-
- protected PropertyValueModel<CollectionTable2_0> buildCollectionTableHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, CollectionTable2_0>(getSubjectHolder()) {
- @Override
- protected CollectionTable2_0 buildValue_() {
- return this.subject.getCollectionTable();
- }
- };
- }
-
- protected PropertyValueModel<Column> buildValueColumnHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, Column>(getSubjectHolder()) {
- @Override
- protected Column buildValue_() {
- return this.subject.getValueColumn();
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildNoConverterHolder() {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.getConverter().getType() == null);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(null);
- }
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildLobConverterHolder() {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getType() == LobConverter.class);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(LobConverter.class);
- }
- }
- };
- }
-
- private PropertyValueModel<Converter> buildConverterHolder() {
- return new PropertyAspectAdapter<T, Converter>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Converter buildValue_() {
- return this.subject.getConverter();
- }
- };
- }
-
- private PropertyValueModel<BaseTemporalConverter> buildTemporalConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, BaseTemporalConverter>(converterHolder) {
- @Override
- protected BaseTemporalConverter transform_(Converter converter) {
- return converter.getType() == BaseTemporalConverter.class ? (BaseTemporalConverter) converter : null;
- }
- };
- }
-
- private PropertyValueModel<BaseEnumeratedConverter> buildEnumeratedConverterHolder(PropertyValueModel<Converter> converterHolder) {
- return new TransformationPropertyValueModel<Converter, BaseEnumeratedConverter>(converterHolder) {
- @Override
- protected BaseEnumeratedConverter transform_(Converter converter) {
- return converter.getType() == BaseEnumeratedConverter.class ? (BaseEnumeratedConverter) converter : null;
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildTemporalBooleanHolder() {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getType() == BaseTemporalConverter.class);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(BaseTemporalConverter.class);
- }
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildEnumeratedBooleanHolder() {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), ConvertibleMapping.CONVERTER_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- Converter converter = this.subject.getConverter();
- return Boolean.valueOf(converter.getType() == BaseEnumeratedConverter.class);
- }
-
- @Override
- protected void setValue_(Boolean value) {
- if (value.booleanValue()) {
- this.subject.setConverter(BaseEnumeratedConverter.class);
- }
- }
- };
- }
- protected Composite addPane(Composite container, int groupBoxMargin) {
- return addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0UiDefinition.java
deleted file mode 100644
index d7f1921540..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractElementCollectionMapping2_0UiDefinition.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractMappingUiDefinition;
-import org.eclipse.swt.graphics.Image;
-
-public abstract class AbstractElementCollectionMapping2_0UiDefinition<M, T extends ElementCollectionMapping2_0>
- extends AbstractMappingUiDefinition<M, T>
-{
- protected AbstractElementCollectionMapping2_0UiDefinition() {
- super();
- }
-
-
- public Image getImage() {
- return JpaMappingImageHelper.imageForAttributeMapping(getKey());
- }
-
- public String getLabel() {
- return JptUiDetailsMessages2_0.ElementCollectionMapping2_0_label;
- }
-
- public String getLinkLabel() {
- return JptUiDetailsMessages2_0.ElementCollectionMapping2_0_linkLabel;
- }
-
- public String getKey() {
- return MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractManyToOneMapping2_0Composite.java
deleted file mode 100644
index c20c27a8e6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractManyToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.DerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToOneMappingComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractManyToOneMapping2_0Composite<T extends ManyToOneMapping, R extends ManyToOneRelationship2_0>
- extends AbstractManyToOneMappingComposite<T, R>
-{
- protected AbstractManyToOneMapping2_0Composite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeManyToOneCollapsibleSection(container);
- initializeDerivedIdentityCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- }
-
- protected void initializeDerivedIdentityCollapsibleSection(Composite container) {
- new DerivedIdentity2_0Pane(this, buildDerivedIdentityHolder(), container);
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new ManyToOneJoiningStrategy2_0Pane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<DerivedIdentity2_0> buildDerivedIdentityHolder() {
- return new PropertyAspectAdapter<T, DerivedIdentity2_0>(getSubjectHolder()) {
- @Override
- protected DerivedIdentity2_0 buildValue_() {
- return ((ManyToOneMapping2_0) this.subject).getDerivedIdentity();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractOneToOneMapping2_0Composite.java
deleted file mode 100644
index 3b158caadb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AbstractOneToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.DerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToOneMappingComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public abstract class AbstractOneToOneMapping2_0Composite<T extends OneToOneMapping, R extends OneToOneRelationship2_0>
- extends AbstractOneToOneMappingComposite<T, R>
-{
- protected AbstractOneToOneMapping2_0Composite(
- PropertyValueModel<? extends T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- initializeOneToOneCollapsibleSection(container);
- initializeDerivedIdentityCollapsibleSection(container);
- initializeJoiningStrategyCollapsibleSection(container);
- }
-
- protected void initializeDerivedIdentityCollapsibleSection(Composite container) {
- new DerivedIdentity2_0Pane(this, buildDerivedIdentityHolder(), container);
- }
-
-
- protected PropertyValueModel<DerivedIdentity2_0> buildDerivedIdentityHolder() {
- return new PropertyAspectAdapter<T, DerivedIdentity2_0>(getSubjectHolder()) {
- @Override
- protected DerivedIdentity2_0 buildValue_() {
- return ((OneToOneMapping2_0) this.subject).getDerivedIdentity();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AssociationOverride2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AssociationOverride2_0Composite.java
deleted file mode 100644
index e21bd86741..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/AssociationOverride2_0Composite.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTableRelationship;
-import org.eclipse.jpt.jpa.ui.internal.details.AssociationOverrideComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EntityOverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinColumnsComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinTableJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | JoinColumnJoiningStrategyPane |
- * | JoinTableJoiningStrategyPane |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see AssociationOverride
- * @see EntityOverridesComposite - The parent container
- * @see JoinColumnsComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public class AssociationOverride2_0Composite
- extends AssociationOverrideComposite
-{
- /**
- * Creates a new <code>AssociationOverrideComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>AssociationOverride</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public AssociationOverride2_0Composite(Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyAssociationOverride> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addTitledGroup(
- container,
- JptUiDetailsMessages.Joining_title);
-
- addJoinColumnJoiningStrategyPane(composite);
-
- addJoinTableJoiningStrategyPane(composite);
-
- addSubPane(composite, 5);
- }
-
- protected void addJoinTableJoiningStrategyPane(Composite container) {
- new JoinTableJoiningStrategyPane(this, buildRelationshipModel(), container);
- }
-
- private PropertyValueModel<ReadOnlyJoinTableRelationship> buildRelationshipModel() {
- return new TransformationPropertyValueModel<ReadOnlyAssociationOverride, ReadOnlyJoinTableRelationship>(getSubjectHolder()) {
- @Override
- protected ReadOnlyJoinTableRelationship transform_(ReadOnlyAssociationOverride value) {
- // all specified and virtual (mappings) overrides support join tables
- return (ReadOnlyJoinTableRelationship) value.getRelationship();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Cacheable2_0Pane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Cacheable2_0Pane.java
deleted file mode 100644
index 307e026709..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Cacheable2_0Pane.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | [X] Cacheable (true/false)
- * -----------------------------------------------------------------------------</pre>
- *
- * @see Cacheable2_0
- * @see JavaEntity2_0Composite - A container of this widget
- * @see OrmEntity2_0Composite - A container of this widget
- */
-public class Cacheable2_0Pane
- extends Pane<Cacheable2_0>
-{
- public Cacheable2_0Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends Cacheable2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages2_0.Entity_cacheableLabel,
- buildCacheableBooleanHolder(),
- buildCacheableStringHolder(),
- JpaHelpContextIds.ENTITY_CACHEABLE
- );
- }
-
-
- private ModifiablePropertyValueModel<Boolean> buildCacheableBooleanHolder() {
- return new PropertyAspectAdapter<Cacheable2_0, Boolean>(
- getSubjectHolder(),
- Cacheable2_0.DEFAULT_CACHEABLE_PROPERTY,
- Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedCacheable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedCacheable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildCacheableStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultCacheableHolder()) {
-
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages2_0.Entity_cacheableWithDefaultLabel, defaultStringValue);
- }
- return JptUiDetailsMessages2_0.Entity_cacheableLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultCacheableHolder() {
- return new PropertyAspectAdapter<Cacheable2_0, Boolean>(
- getSubjectHolder(),
- Cacheable2_0.SPECIFIED_CACHEABLE_PROPERTY,
- Cacheable2_0.DEFAULT_CACHEABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedCacheable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultCacheable());
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CascadePane2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CascadePane2_0.java
deleted file mode 100644
index fc82a6f681..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CascadePane2_0.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.CascadeComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-public class CascadePane2_0<T extends Cascade2_0>
- extends CascadeComposite<T>
-{
- public CascadePane2_0(
- Pane<? extends RelationshipMapping> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- public CascadePane2_0(
- PropertyValueModel<T> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- // Cascade group
- Group cascadeGroup = addCascadeGroup(container);
-
- // Container of the check boxes
- container = addSubPane(cascadeGroup, 6, 8, 0, 0, 0);
-
- addAllCheckBox(container);
- addPersistCheckBox(container);
- addMergeCheckBox(container);
- addRemoveCheckBox(container);
- addRefreshCheckBox(container);
- addDetachCheckBox(container);
- }
-
- protected void addDetachCheckBox(Composite container) {
- addCheckBox(
- container,
- JptUiDetailsMessages2_0.CascadePane2_0_detach,
- buildCascadeTypeDetachHolder(),
- null);
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildCascadeTypeDetachHolder() {
- return new PropertyAspectAdapter<Cascade2_0, Boolean>(getSubjectHolder(), Cascade2_0.DETACH_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return subject.isDetach();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- subject.setDetach(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CollectionTable2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CollectionTable2_0Composite.java
deleted file mode 100644
index c2b7dfb0c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/CollectionTable2_0Composite.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyReferenceTable;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinColumnsComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ReferenceTableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.TableCombo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-
-/**
- * The layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------ |
- * | Name: | |v| |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Schema: | |v| |
- * | ------------------------------------------------------------ |
- * | ------------------------------------------------------------ |
- * | Catalog: | |v| |
- * | ------------------------------------------------------------ |
- * | |
- * | - Join Columns ---------------------------------------------------------- |
- * | | | |
- * | | x Override Default | |
- * | | | |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | JoinColumnsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link CollectionTable2_0}
- * @see {@link JoinColumnsComposite
- *
- * @version 3.0
- * @since 3.0
- */
-public class CollectionTable2_0Composite
- extends ReferenceTableComposite<ReadOnlyReferenceTable>
-{
- /**
- * Creates a new <code>CollectionTable2_0Composite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public CollectionTable2_0Composite(
- Pane<?> parentPane,
- PropertyValueModel<? extends ReadOnlyReferenceTable> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- /**
- * Creates a new <code>CollectionTable2_0Composite</code>.
- *
- * @param subjectHolder The holder of the subject <code>CollectionTable2_0</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public CollectionTable2_0Composite(PropertyValueModel<? extends CollectionTable2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // collection table group pane
- container = addTitledGroup(
- container,
- JptUiDetailsMessages2_0.CollectionTable2_0Composite_title
- );
-
- int groupBoxMargin = getGroupBoxMargin();
-
- // Name widgets
- TableCombo<ReadOnlyReferenceTable> tableCombo = addTableCombo(container);
- Composite tablePane = addPane(container, groupBoxMargin);
- addLabeledComposite(
- tablePane,
- JptUiDetailsMessages2_0.CollectionTable2_0Composite_name,
- tableCombo.getControl(),
- JpaHelpContextIds.MAPPING_COLLECTION_TABLE_NAME
- );
-
- // schema widgets
- SchemaCombo<ReadOnlyReferenceTable> schemaCombo = addSchemaCombo(container);
-
- addLabeledComposite(
- tablePane,
- JptUiDetailsMessages2_0.CollectionTable2_0Composite_schema,
- schemaCombo.getControl(),
- JpaHelpContextIds.MAPPING_COLLECTION_TABLE_SCHEMA
- );
-
- // catalog widgets
- CatalogCombo<ReadOnlyReferenceTable> catalogCombo = addCatalogCombo(container);
-
- addLabeledComposite(
- tablePane,
- JptUiDetailsMessages2_0.CollectionTable2_0Composite_catalog,
- catalogCombo.getControl(),
- JpaHelpContextIds.MAPPING_COLLECTION_TABLE_CATALOG
- );
-
- // Join Columns group pane
- Group joinColumnGroupPane = addTitledGroup(
- container,
- JptUiDetailsMessages2_0.CollectionTable2_0Composite_joinColumn
- );
-
- // Override Default Join Columns check box
- this.overrideDefaultJoinColumnsCheckBox = addCheckBox(
- addSubPane(joinColumnGroupPane, 8),
- JptUiDetailsMessages2_0.CollectionTable2_0Composite_overrideDefaultJoinColumns,
- buildOverrideDefaultJoinColumnHolder(),
- null
- );
-
- this.joinColumnsComposite = new JoinColumnsComposite<ReadOnlyReferenceTable>(
- this,
- joinColumnGroupPane,
- buildJoinColumnsEditor()
- );
-
- installJoinColumnsPaneEnabler(this.joinColumnsComposite);
- }
-
- @Override
- protected boolean tableIsVirtual(ReadOnlyReferenceTable collectionTable) {
- return collectionTable.getPersistentAttribute().isVirtual();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java
deleted file mode 100644
index b18b418d8b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/DerivedIdentity2_0Pane.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.ComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.DerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.MapsIdDerivedIdentityStrategy2_0;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-
-public class DerivedIdentity2_0Pane
- extends Pane<DerivedIdentity2_0>
-{
- public DerivedIdentity2_0Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends DerivedIdentity2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages2_0.DerivedIdentity_title);
- ((GridLayout) composite.getLayout()).numColumns = 2;
-
- addNullDerivedIdentityPane(composite);
- addIdDerivedIdentityPane(composite);
- addMapsIdDerivedIdentityPane(composite);
- }
-
- protected void addNullDerivedIdentityPane(Composite parent) {
- Button button = addRadioButton(
- parent,
- JptUiDetailsMessages2_0.DerivedIdentity_nullDerivedIdentity,
- buildUsesNullDerivedIdentityStrategyHolder(),
- null);
- ((GridData) button.getLayoutData()).horizontalSpan = 2;
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildUsesNullDerivedIdentityStrategyHolder() {
- return new PropertyAspectAdapter<DerivedIdentity2_0, Boolean>(
- getSubjectHolder(), DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- return this.subject.usesNullDerivedIdentityStrategy();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- // radio button - should only have true values here
- if (value) {
- this.subject.setNullDerivedIdentityStrategy();
- }
- }
- };
- }
-
- protected void addIdDerivedIdentityPane(Composite parent) {
- Button button = addRadioButton(
- parent,
- JptUiDetailsMessages2_0.DerivedIdentity_idDerivedIdentity,
- buildUsesIdDerivedIdentityStrategyHolder(),
- null);
- ((GridData) button.getLayoutData()).horizontalSpan = 2;
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildUsesIdDerivedIdentityStrategyHolder() {
- return new PropertyAspectAdapter<DerivedIdentity2_0, Boolean>(
- getSubjectHolder(), DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY) {
-
- @Override
- protected Boolean buildValue_() {
- return this.subject.usesIdDerivedIdentityStrategy();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- // radio button - should only have true values here
- if (value) {
- this.subject.setIdDerivedIdentityStrategy();
- }
- }
- };
- }
-
- protected void addMapsIdDerivedIdentityPane(Composite parent) {
- ModifiablePropertyValueModel<Boolean> usesMapsIdModel = buildUsesMapsIdDerivedIdentityStrategyHolder();
- addRadioButton(
- parent,
- JptUiDetailsMessages2_0.DerivedIdentity_mapsIdDerivedIdentity,
- usesMapsIdModel,
- null);
-
- buildMapsIdValueComboPane(parent, usesMapsIdModel);
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildUsesMapsIdDerivedIdentityStrategyHolder() {
- return new PropertyAspectAdapter<DerivedIdentity2_0, Boolean>(
- getSubjectHolder(), DerivedIdentity2_0.PREDOMINANT_DERIVED_IDENTITY_STRATEGY_PROPERTY) {
-
- @Override
- protected Boolean buildValue() {
- return (this.subject == null) ? Boolean.FALSE : this.subject.usesMapsIdDerivedIdentityStrategy();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- // radio button - should only have true values here
- if (value) {
- this.subject.setMapsIdDerivedIdentityStrategy();
- }
- }
- };
- }
-
- protected ComboPane buildMapsIdValueComboPane(Composite parent, PropertyValueModel<Boolean> usesMapsIdModel) {
- return new MapsIdValueComboPane(this, buildMapsIdStrategyHolder(), parent, usesMapsIdModel);
- }
-
- protected PropertyValueModel<MapsIdDerivedIdentityStrategy2_0> buildMapsIdStrategyHolder() {
- return new PropertyAspectAdapter<DerivedIdentity2_0, MapsIdDerivedIdentityStrategy2_0>(getSubjectHolder()) {
- @Override
- protected MapsIdDerivedIdentityStrategy2_0 buildValue_() {
- return this.subject.getMapsIdDerivedIdentityStrategy();
- }
- };
- }
-
-
- private class MapsIdValueComboPane
- extends ComboPane<MapsIdDerivedIdentityStrategy2_0>
- {
- public MapsIdValueComboPane(
- Pane<?> parentPane,
- PropertyValueModel<? extends MapsIdDerivedIdentityStrategy2_0> subjectHolder,
- Composite parent,
- PropertyValueModel<Boolean> enabledModel) {
-
- super(parentPane, subjectHolder, parent, enabledModel);
- }
-
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(MapsIdDerivedIdentityStrategy2_0.DEFAULT_ID_ATTRIBUTE_NAME_PROPERTY);
- propertyNames.add(MapsIdDerivedIdentityStrategy2_0.SPECIFIED_ID_ATTRIBUTE_NAME_PROPERTY);
- }
-
- @Override
- protected String getValue() {
- return (getSubject() == null) ? null : getSubject().getSpecifiedIdAttributeName();
- }
-
- @Override
- protected void setValue(String value) {
- if (getSubject() != null) getSubject().setSpecifiedIdAttributeName(value);
- }
-
- @Override
- protected boolean usesDefaultValue() {
- return (getSubject() != null) && getSubject().defaultIdAttributeNameIsPossible();
- }
-
- @Override
- protected String getDefaultValue() {
- return (getSubject() == null) ? null : getSubject().getDefaultIdAttributeName();
- }
-
- @Override
- protected Iterable<String> getValues() {
- return (getSubject() == null) ? EmptyIterable.<String>instance() : getSubject().getSortedCandidateIdAttributeNames();
- }
-
- @Override
- protected String buildNullDefaultValueEntry() {
- return buildNonNullDefaultValueEntry(JptUiDetailsMessages2_0.DerivedIdentity_mapsIdUnspecifiedValue);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java
deleted file mode 100644
index a6af316ea0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ElementCollectionMapping2_0Composite.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | TargetClassComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | FetchTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | CollectionTableComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | OptionalComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | LobComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see BasicMapping
- * @see OrderColumnComposite
- * @see EnumTypeComposite
- * @see FetchTypeComposite
- * @see LobComposite
- * @see OptionalComposite
- * @see TemporalTypeComposite
- *
- * @version 2.3
- * @since 2.3
- */
-public class ElementCollectionMapping2_0Composite extends AbstractElementCollectionMapping2_0Composite<ElementCollectionMapping2_0>
-{
- /**
- * Creates a new <code>BasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IBasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public ElementCollectionMapping2_0Composite(PropertyValueModel<? extends ElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ElementCollectionValueOverridesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ElementCollectionValueOverridesComposite.java
deleted file mode 100644
index d956e31ec9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ElementCollectionValueOverridesComposite.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AssociationOverrideComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-
-public final class ElementCollectionValueOverridesComposite
- extends AbstractOverridesComposite<ElementCollectionMapping2_0>
-{
- public ElementCollectionValueOverridesComposite(
- Pane<? extends ElementCollectionMapping2_0> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected boolean supportsAssociationOverrides() {
- return true;
- }
-
- @Override
- protected Pane<ReadOnlyAssociationOverride> buildAssociationOverridePane(PageBook pageBook, PropertyValueModel<ReadOnlyAssociationOverride> associationOverrideHolder) {
- return new AssociationOverrideComposite(this, associationOverrideHolder, pageBook);
- }
-
- @Override
- protected PropertyValueModel<AttributeOverrideContainer> buildAttributeOverrideContainerHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, AttributeOverrideContainer>(getSubjectHolder()) {
- @Override
- protected AttributeOverrideContainer buildValue_() {
- return this.subject.getValueAttributeOverrideContainer();
- }
- };
- }
-
- @Override
- protected PropertyValueModel<AssociationOverrideContainer> buildAssociationOverrideContainerHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, AssociationOverrideContainer>(getSubjectHolder()) {
- @Override
- protected AssociationOverrideContainer buildValue_() {
- return this.subject.getValueAssociationOverrideContainer();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedIdMapping2_0Composite.java
deleted file mode 100644
index 9af3e40be9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedIdMapping2_0Composite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedIdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class EmbeddedIdMapping2_0Composite
- extends AbstractEmbeddedIdMappingComposite<EmbeddedIdMapping>
-{
- public EmbeddedIdMapping2_0Composite(
- PropertyValueModel<? extends EmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeEmbeddedIdSection(Composite container) {
- new EmbeddedIdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new EmbeddedMappingOverridesComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedIdMapping2_0MappedByRelationshipPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedIdMapping2_0MappedByRelationshipPane.java
deleted file mode 100644
index af5798b73e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedIdMapping2_0MappedByRelationshipPane.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.EmbeddedIdMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.DerivableIdMapping2_0;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-
-public class EmbeddedIdMapping2_0MappedByRelationshipPane<T extends EmbeddedIdMapping2_0>
- extends Pane<T>
-{
- Label mappedByRelationshipLabel;
-
- public EmbeddedIdMapping2_0MappedByRelationshipPane(
- Pane<?> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- PageBook pageBook = new PageBook(container, SWT.NULL);
- pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- this.mappedByRelationshipLabel = addLabel(pageBook, JptUiDetailsMessages2_0.EmbeddedIdMapping2_0MappedByRelationshipPane_label);
-
- new ControlSwitcher(buildDerivedModel(), buildPaneTransformer(), pageBook);
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildDerivedModel() {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), DerivableIdMapping2_0.DERIVED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isDerived());
- }
- };
- }
-
- private Transformer<Boolean, Control> buildPaneTransformer() {
- return new Transformer<Boolean, Control>() {
- public Control transform(Boolean converter) {
- if (converter == null || converter == Boolean.FALSE) {
- return null;
- }
- return EmbeddedIdMapping2_0MappedByRelationshipPane.this.mappedByRelationshipLabel;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedMapping2_0OverridesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedMapping2_0OverridesComposite.java
deleted file mode 100644
index 7fa55fae3e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/EmbeddedMapping2_0OverridesComposite.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.EmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingOverridesComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-
-public class EmbeddedMapping2_0OverridesComposite
- extends AbstractEmbeddedMappingOverridesComposite<EmbeddedMapping>
-{
- public EmbeddedMapping2_0OverridesComposite(
- Pane<? extends EmbeddedMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected boolean supportsAssociationOverrides() {
- return true;
- }
-
- @Override
- protected PropertyValueModel<AttributeOverrideContainer> buildAttributeOverrideContainerHolder() {
- return new PropertyAspectAdapter<EmbeddedMapping, AttributeOverrideContainer>(getSubjectHolder()) {
- @Override
- protected AttributeOverrideContainer buildValue_() {
- return this.subject.getAttributeOverrideContainer();
- }
- };
- }
-
- @Override
- protected Pane<ReadOnlyAssociationOverride> buildAssociationOverridePane(PageBook pageBook, PropertyValueModel<ReadOnlyAssociationOverride> associationOverrideHolder) {
- return new AssociationOverride2_0Composite(this, associationOverrideHolder, pageBook);
- }
-
- @Override
- protected PropertyValueModel<AssociationOverrideContainer> buildAssociationOverrideContainerHolder() {
- return new PropertyAspectAdapter<EmbeddedMapping, AssociationOverrideContainer>(getSubjectHolder()) {
- @Override
- protected AssociationOverrideContainer buildValue_() {
- return ((EmbeddedMapping2_0) this.subject).getAssociationOverrideContainer();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Entity2_0OverridesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Entity2_0OverridesComposite.java
deleted file mode 100644
index b554a7dacf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Entity2_0OverridesComposite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityOverridesComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-
-public class Entity2_0OverridesComposite
- extends AbstractEntityOverridesComposite
-{
- public Entity2_0OverridesComposite(
- Pane<? extends Entity> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected Pane<ReadOnlyAssociationOverride> buildAssociationOverridePane(PageBook pageBook, PropertyValueModel<ReadOnlyAssociationOverride> associationOverrideHolder) {
- return new AssociationOverride2_0Composite(this, associationOverrideHolder, pageBook);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Generation2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Generation2_0Composite.java
deleted file mode 100644
index 94d06795ab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Generation2_0Composite.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.ui.internal.details.GenerationComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Generation2_0Composite
- */
-public class Generation2_0Composite extends GenerationComposite
-{
-
- public Generation2_0Composite(
- Pane<?> parentPane,
- PropertyValueModel<? extends GeneratorContainer> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void addSequenceGeneratorComposite(Composite container, int topMargin, int leftMargin) {
- new SequenceGenerator2_0Composite(
- this,
- this.buildSequenceGeneratorHolder(),
- this.addSubPane(container, topMargin, leftMargin),
- this.buildSequenceGeneratorBuilder()
- );
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/IdMapping2_0MappedByRelationshipPane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/IdMapping2_0MappedByRelationshipPane.java
deleted file mode 100644
index b15aa0c4e9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/IdMapping2_0MappedByRelationshipPane.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.util.ControlSwitcher;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.IdMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.DerivableIdMapping2_0;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.part.PageBook;
-
-
-public class IdMapping2_0MappedByRelationshipPane<T extends IdMapping2_0>
- extends Pane<T>
-{
-
- Label mappedByRelationshipLabel;
-
- public IdMapping2_0MappedByRelationshipPane(
- Pane<?> parentPane,
- PropertyValueModel<T> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- PageBook pageBook = new PageBook(container, SWT.NULL);
- pageBook.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- this.mappedByRelationshipLabel = addLabel(pageBook, JptUiDetailsMessages2_0.IdMapping2_0MappedByRelationshipPane_label);
-
- new ControlSwitcher(buildDerivedModel(), buildPaneTransformer(), pageBook);
- }
-
- protected ModifiablePropertyValueModel<Boolean> buildDerivedModel() {
- return new PropertyAspectAdapter<T, Boolean>(getSubjectHolder(), DerivableIdMapping2_0.DERIVED_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.isDerived());
- }
- };
- }
-
- private Transformer<Boolean, Control> buildPaneTransformer() {
- return new Transformer<Boolean, Control>() {
- public Control transform(Boolean converter) {
- if (converter == null || converter == Boolean.FALSE) {
- return null;
- }
- return IdMapping2_0MappedByRelationshipPane.this.mappedByRelationshipLabel;
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/IdMappingGeneration2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/IdMappingGeneration2_0Composite.java
deleted file mode 100644
index c850727e35..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/IdMappingGeneration2_0Composite.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.ui.internal.details.IdMappingGenerationComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.SequenceGeneratorComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite.GeneratorBuilder;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * IdMappingGeneration2_0Composite
- */
-public class IdMappingGeneration2_0Composite extends IdMappingGenerationComposite
-{
-
- public IdMappingGeneration2_0Composite(Pane<? extends IdMapping> parentPane, Composite parent) {
- super(parentPane, parent);
- }
-
- @Override
- protected SequenceGeneratorComposite buildSequenceGeneratorComposite(
- Composite container,
- PropertyValueModel<SequenceGenerator> sequenceGeneratorHolder,
- GeneratorBuilder<SequenceGenerator> sequenceGeneratorBuilder,
- int topMargin,
- int leftMargin) {
-
- return new SequenceGenerator2_0Composite(
- this,
- sequenceGeneratorHolder,
- this.addSubPane(container, topMargin, leftMargin),
- sequenceGeneratorBuilder
- );
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java
deleted file mode 100644
index 43f4e6b33e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/JptUiDetailsMessages2_0.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali mapping panes.
- *
- * @version 3.2
- * @since 2.3
- */
-public class JptUiDetailsMessages2_0
-{
- public static String CascadePane2_0_detach;
-
- public static String CollectionTable2_0Composite_title;
- public static String CollectionTable2_0Composite_joinColumn;
- public static String CollectionTable2_0Composite_name;
- public static String CollectionTable2_0Composite_schema;
- public static String CollectionTable2_0Composite_catalog;
- public static String CollectionTable2_0Composite_overrideDefaultJoinColumns;
-
- public static String DerivedIdentity_title;
- public static String DerivedIdentity_nullDerivedIdentity;
- public static String DerivedIdentity_idDerivedIdentity;
- public static String DerivedIdentity_mapsIdDerivedIdentity;
- public static String DerivedIdentity_mapsIdUnspecifiedValue;
-
- public static String ElementCollectionMapping2_0_label;
- public static String ElementCollectionMapping2_0_linkLabel;
-
- public static String ElementCollectionSection_title;
- public static String AbstractElementCollectionMapping2_0_Composite_valueSectionTitle;
-
- public static String Entity_cacheableLabel;
- public static String Entity_cacheableWithDefaultLabel;
-
- public static String EmbeddedIdMapping2_0MappedByRelationshipPane_label;
-
- public static String IdMapping2_0MappedByRelationshipPane_label;
-
- public static String OrderingComposite_orderColumn;
-
- public static String OrphanRemoval2_0Composite_orphanRemovalLabel;
- public static String OrphanRemoval2_0Composite_orphanRemovalLabelDefault;
-
- public static String LockModeComposite_lockModeLabel;
-
- public static String LockModeComposite_read;
- public static String LockModeComposite_write;
- public static String LockModeComposite_optimistic;
- public static String LockModeComposite_optimistic_force_increment;
- public static String LockModeComposite_pessimistic_read;
- public static String LockModeComposite_pessimistic_write;
- public static String LockModeComposite_pessimistic_force_increment;
- public static String LockModeComposite_none;
-
- public static String TargetClassComposite_label;
-
- public static String ArrayMapping2_3_label;
- public static String ArrayMapping2_3_linkLabel;
-
- public static String StructureMapping2_3_label;
- public static String StructureMapping2_3_linkLabel;
-
- private static final String BUNDLE_NAME = "jpt_ui_details2_0"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptUiDetailsMessages2_0.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptUiDetailsMessages2_0() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/LockModeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/LockModeComposite.java
deleted file mode 100644
index 77112d089d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/LockModeComposite.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.jpa2.context.LockModeType2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.NamedQuery2_0;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * LockModeComposite
- */
-public class LockModeComposite extends Pane<NamedQuery2_0>
-{
- /**
- * Creates a new <code>LockModeComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public LockModeComposite(Pane<? extends NamedQuery2_0> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addLabeledComposite(
- container,
- JptUiDetailsMessages2_0.LockModeComposite_lockModeLabel,
- this.addLockModeTypeCombo(container),
- null // TODO
- );
- }
-
- private EnumFormComboViewer<NamedQuery2_0, LockModeType2_0> addLockModeTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<NamedQuery2_0, LockModeType2_0>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(NamedQuery2_0.DEFAULT_LOCK_MODE_PROPERTY);
- propertyNames.add(NamedQuery2_0.SPECIFIED_LOCK_MODE_PROPERTY);
- }
-
- @Override
- protected LockModeType2_0[] getChoices() {
- return LockModeType2_0.values();
- }
-
- @Override
- protected LockModeType2_0 getDefaultValue() {
- return this.getSubject().getDefaultLockMode();
- }
-
- @Override
- protected String displayString(LockModeType2_0 value) {
- switch (value) {
- case NONE :
- return JptUiDetailsMessages2_0.LockModeComposite_none;
- case OPTIMISTIC :
- return JptUiDetailsMessages2_0.LockModeComposite_optimistic;
- case OPTIMISTIC_FORCE_INCREMENT :
- return JptUiDetailsMessages2_0.LockModeComposite_optimistic_force_increment;
- case PESSIMISTIC_FORCE_INCREMENT :
- return JptUiDetailsMessages2_0.LockModeComposite_pessimistic_force_increment;
- case PESSIMISTIC_READ :
- return JptUiDetailsMessages2_0.LockModeComposite_pessimistic_read;
- case PESSIMISTIC_WRITE :
- return JptUiDetailsMessages2_0.LockModeComposite_pessimistic_write;
- case READ :
- return JptUiDetailsMessages2_0.LockModeComposite_read;
- case WRITE :
- return JptUiDetailsMessages2_0.LockModeComposite_write;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected LockModeType2_0 getValue() {
- return this.getSubject().getSpecifiedLockMode();
- }
-
- @Override
- protected void setValue(LockModeType2_0 value) {
- this.getSubject().setSpecifiedLockMode(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ManyToOneJoiningStrategy2_0Pane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ManyToOneJoiningStrategy2_0Pane.java
deleted file mode 100644
index 8e01f1ef5b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/ManyToOneJoiningStrategy2_0Pane.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToOneRelationship;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinColumnJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinTableJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Joining Strategy ------------------------------------------------------ |
- * | | | |
- * | | o JoinColumnStrategyPane ____________________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | o JoinTableJoiningStrategyPane_______________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link ManyToOneMapping}
- * @see {@link ManyToOneRelationship}
- * @see {@link OrmManyToOneMappingComposite}
- * @see {@link JoinColumnStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class ManyToOneJoiningStrategy2_0Pane extends Pane<ManyToOneRelationship2_0>
-{
- public ManyToOneJoiningStrategy2_0Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends ManyToOneRelationship2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages.Joining_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinColumnJoiningLabel,
- JoinColumnJoiningStrategyPane.buildUsesJoinColumnJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- JoinColumnJoiningStrategyPane.
- buildJoinColumnJoiningStrategyPaneWithIncludeOverrideCheckBox(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinTableJoiningLabel,
- JoinTableJoiningStrategyPane.buildUsesJoinTableJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new JoinTableJoiningStrategyPane(this, composite);
-
- addSubPane(composite, 5);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/NamedQueryProperty2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/NamedQueryProperty2_0Composite.java
deleted file mode 100644
index c4ac5d589b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/NamedQueryProperty2_0Composite.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.jpa2.context.NamedQuery2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.QueryHintsComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpql.JpaJpqlContentProposalProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here's the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | -------------------------------------------------------------- |
- * | Query: | I | |
- * | | | |
- * | | | |
- * | -------------------------------------------------------------- |
- * | -------------------------------------------------------------- |
- * | Lock Mode: | |v| |
- * | -------------------------------------------------------------- |
- * | |
- * | - Query Hints ----------------------------------------------------------- |
- * | | --------------------------------------------------------------------- | |
- * | | | | | |
- * | | | QueryHintsComposite | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- *
- * @see NamedQuery2_0
- * @see NamedQueriesComposite - The parent container
- * @see QueryHintsComposite
- *
- * @version 2.0
- * @since 2.0
- */
-public class NamedQueryProperty2_0Composite extends Pane<NamedQuery2_0> {
-
- /**
- * Creates a new <code>NamedQueryProperty2_0Composite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- */
- public NamedQueryProperty2_0Composite(Pane<?> parentPane,
- PropertyValueModel<NamedQuery2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- protected ModifiablePropertyValueModel<String> buildNameTextHolder() {
- return new PropertyAspectAdapter<NamedQuery2_0, String>(getSubjectHolder(), Query.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setName(value);
- }
- };
- }
-
- protected ModifiablePropertyValueModel<String> buildQueryHolder() {
- return new PropertyAspectAdapter<NamedQuery2_0, String>(getSubjectHolder(), Query.QUERY_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getQuery();
- }
-
- @Override
- protected void setValue_(String value) {
- this.subject.setQuery(value);
- }
- };
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- this.addLabeledText(
- container,
- JptUiDetailsMessages.NamedQueryComposite_nameTextLabel,
- this.buildNameTextHolder());
-
- JpaJpqlContentProposalProvider provider = new JpaJpqlContentProposalProvider(
- container,
- getSubjectHolder(),
- buildQueryHolder()
- );
-
- // Query text area
- Composite queryWidgets = this.addLabeledComposite(
- container,
- JptUiDetailsMessages.NamedQueryPropertyComposite_query,
- provider.getStyledText()
- );
-
- // Install the content assist icon at the top left of the StyledText.
- // Note: For some reason, this needs to be done after the StyledText
- // is added to the labeled composite
- provider.installControlDecoration();
-
- adjustMultiLineTextLayout(
- queryWidgets,
- 4,
- provider.getStyledText(),
- provider.getStyledText().getLineHeight()
- );
-
- // Lock Mode type
- new LockModeComposite(this, container);
-
- // Query Hints pane
- container = this.addTitledGroup(
- this.addSubPane(container, 5),
- JptUiDetailsMessages.NamedQueryPropertyComposite_queryHintsGroupBox
- );
-
- new QueryHintsComposite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OneToManyJoiningStrategy2_0Pane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OneToManyJoiningStrategy2_0Pane.java
deleted file mode 100644
index 6ce3c6ce17..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OneToManyJoiningStrategy2_0Pane.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToManyRelationship;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinColumnJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinTableJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.MappedByJoiningStrategyPane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Joining Strategy ------------------------------------------------------ |
- * | | | |
- * | | o MappedByJoiningStrategyPane _______________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | o JoinTableStrategyPane _____________________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link OneToManyMapping}
- * @see {@link OneToManyRelationship}
- * @see {@link OrmOneToManyMappingComposite}
- * @see {@link MappedByStrategyPane}
- * @see {@link JoinTableStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class OneToManyJoiningStrategy2_0Pane
- extends Pane<OneToManyRelationship2_0>
-{
- public OneToManyJoiningStrategy2_0Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends OneToManyRelationship2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages.Joining_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_mappedByLabel,
- MappedByJoiningStrategyPane.buildUsesMappedByJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new MappedByJoiningStrategyPane(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinColumnJoiningLabel,
- JoinColumnJoiningStrategyPane.buildUsesJoinColumnJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- JoinColumnJoiningStrategyPane.
- buildJoinColumnJoiningStrategyPaneWithIncludeOverrideCheckBox(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinTableJoiningLabel,
- JoinTableJoiningStrategyPane.buildUsesJoinTableJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new JoinTableJoiningStrategyPane(this, composite);
-
- addSubPane(composite, 5);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OneToOneJoiningStrategy2_0Pane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OneToOneJoiningStrategy2_0Pane.java
deleted file mode 100644
index 79f70503af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OneToOneJoiningStrategy2_0Pane.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinColumnJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.JoinTableJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.MappedByJoiningStrategyPane;
-import org.eclipse.jpt.jpa.ui.internal.details.OneToOneMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.PrimaryKeyJoinColumnJoiningStrategyPane;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here is the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Joining Strategy ------------------------------------------------------ |
- * | | | |
- * | | o MappedByJoiningStrategyPane _______________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | o JoinColumnStrategyPane ____________________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | o JoinTableJoiningStrategyPane_______________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | | o PrimaryKeyJoinColumnStrategyPane __________________________________ | |
- * | | | | | |
- * | | | | | |
- * | | --------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link OneToOneMapping}
- * @see {@link OneToOneRelationship}
- * @see {@link OneToOneMappingComposite}
- * @see {@link MappedByStrategyPane}
- * @see {@link JoinColumnStrategyPane}
- * @see {@link PrimaryKeyJoinColumnStrategyPane}
- *
- * @version 2.3
- * @since 2.1
- */
-public class OneToOneJoiningStrategy2_0Pane
- extends Pane<OneToOneRelationship2_0>
-{
- public OneToOneJoiningStrategy2_0Pane(
- Pane<?> parentPane,
- PropertyValueModel<? extends OneToOneRelationship2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- Composite composite = addCollapsibleSection(
- container,
- JptUiDetailsMessages.Joining_title,
- new SimplePropertyValueModel<Boolean>(Boolean.TRUE));
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_mappedByLabel,
- MappedByJoiningStrategyPane.buildUsesMappedByJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new MappedByJoiningStrategyPane(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_primaryKeyJoinColumnJoiningLabel,
- PrimaryKeyJoinColumnJoiningStrategyPane.buildUsesPrimaryKeyJoinColumnJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new PrimaryKeyJoinColumnJoiningStrategyPane(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinColumnJoiningLabel,
- JoinColumnJoiningStrategyPane.buildUsesJoinColumnJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- JoinColumnJoiningStrategyPane.
- buildJoinColumnJoiningStrategyPaneWithIncludeOverrideCheckBox(this, composite);
-
- addRadioButton(
- composite,
- JptUiDetailsMessages.Joining_joinTableJoiningLabel,
- JoinTableJoiningStrategyPane.buildUsesJoinTableJoiningStrategyHolder(getSubjectHolder()),
- null);
-
- new JoinTableJoiningStrategyPane(this, composite);
-
- addSubPane(composite, 5);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OrderColumnComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OrderColumnComposite.java
deleted file mode 100644
index fb69cf8bab..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OrderColumnComposite.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.BaseColumn;
-import org.eclipse.jpt.jpa.core.context.NamedColumn;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.db.ColumnCombo;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | ColumnCombo | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | > Details |
- * | |
- * | x Insertable |
- * | |
- * | x Updatable |
- * | |
- * | x Nullable |
- * | |
- * | ---------------------------------------------------- |
- * | Column Definition: | I | |
- * | ---------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- * *
- * @version 3.0
- * @since 3.0
- */
-public class OrderColumnComposite extends Pane<OrderColumn2_0> {
-
- /**
- * Creates a new <code>ColumnComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param subjectHolder The holder of the subject <code>IColumn</code>
- * @param parent The parent container
- */
- public OrderColumnComposite(Pane<?> parentPane,
- PropertyValueModel<? extends OrderColumn2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
-
- private ColumnCombo<OrderColumn2_0> addColumnCombo(Composite container) {
-
- return new ColumnCombo<OrderColumn2_0>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(NamedColumn.DEFAULT_NAME_PROPERTY);
- propertyNames.add(NamedColumn.SPECIFIED_NAME_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return getSubject().getDefaultName();
- }
-
- @Override
- protected void setValue(String value) {
- getSubject().setSpecifiedName(value);
- }
-
- @Override
- protected Table getDbTable_() {
- return getSubject().getDbTable();
- }
-
- @Override
- protected String getValue() {
- return getSubject().getSpecifiedName();
- }
- @Override
- public String toString() {
- return "OrderColumnComposite.columnCombo"; //$NON-NLS-1$
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildColumnDefinitionHolder() {
- return new PropertyAspectAdapter<OrderColumn2_0, String>(getSubjectHolder(), NamedColumn.COLUMN_DEFINITION_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getColumnDefinition();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setColumnDefinition(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildInsertableHolder() {
- return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(getSubjectHolder(), BaseColumn.SPECIFIED_INSERTABLE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedInsertable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedInsertable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildInsertableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultInsertableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.ColumnComposite_insertableWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.ColumnComposite_insertable;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultInsertableHolder() {
- return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
- getSubjectHolder(),
- BaseColumn.SPECIFIED_INSERTABLE_PROPERTY,
- BaseColumn.DEFAULT_INSERTABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedInsertable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultInsertable());
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildNullableHolder() {
- return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
- getSubjectHolder(),
- BaseColumn.SPECIFIED_NULLABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedNullable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedNullable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildNullableStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultNullableHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.ColumnComposite_nullableWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.ColumnComposite_nullable;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultNullableHolder() {
- return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
- getSubjectHolder(),
- BaseColumn.SPECIFIED_NULLABLE_PROPERTY,
- BaseColumn.DEFAULT_NULLABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedNullable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultNullable());
- }
- };
- }
-
-
- private ModifiablePropertyValueModel<Boolean> buildUpdatableHolder() {
- return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
- getSubjectHolder(),
- BaseColumn.DEFAULT_UPDATABLE_PROPERTY,
- BaseColumn.SPECIFIED_UPDATABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedUpdatable();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedUpdatable(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildUpdatableStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultUpdatableHolder()) {
-
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages.ColumnComposite_updatableWithDefault, defaultStringValue);
- }
- return JptUiDetailsMessages.ColumnComposite_updatable;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultUpdatableHolder() {
- return new PropertyAspectAdapter<OrderColumn2_0, Boolean>(
- getSubjectHolder(),
- BaseColumn.SPECIFIED_UPDATABLE_PROPERTY,
- BaseColumn.DEFAULT_UPDATABLE_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedUpdatable() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultUpdatable());
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- // Column widgets
- addLabeledComposite(
- container,
- JptUiDetailsMessages.ColumnComposite_name,
- addColumnCombo(container),
- JpaHelpContextIds.MAPPING_ORDER_COLUMN_ORDERING_COLUMN
- );
-
- // Details sub-pane
- container = addCollapsibleSubSection(
- container,
- JptUiDetailsMessages.ColumnComposite_details,
- new SimplePropertyValueModel<Boolean>(Boolean.FALSE)
- );
-
- new DetailsComposite(this, getSubjectHolder(), addSubPane(container, 0, 16));
- }
-
- protected class DetailsComposite extends Pane<OrderColumn2_0> {
-
- public DetailsComposite(Pane<?> parentPane,
- PropertyValueModel<? extends OrderColumn2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Insertable tri-state check box
- addTriStateCheckBoxWithDefault(
- addSubPane(container, 4),
- JptUiDetailsMessages.ColumnComposite_insertable,
- buildInsertableHolder(),
- buildInsertableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_INSERTABLE
- );
-
- // Updatable tri-state check box
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages.ColumnComposite_updatable,
- buildUpdatableHolder(),
- buildUpdatableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_UPDATABLE
- );
-
- // Nullable tri-state check box
- addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages.ColumnComposite_nullable,
- buildNullableHolder(),
- buildNullableStringHolder(),
- JpaHelpContextIds.MAPPING_COLUMN_NULLABLE
- );
-
- // Column Definition widgets
- addLabeledText(
- container,
- JptUiDetailsMessages.ColumnComposite_columnDefinition,
- buildColumnDefinitionHolder()
- );
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Ordering2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Ordering2_0Composite.java
deleted file mode 100644
index 79f04d6a3c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Ordering2_0Composite.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.CollectionMapping;
-import org.eclipse.jpt.jpa.core.context.Orderable;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOrderingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Ordering -------------------------------------------------------------- |
- * | | | |
- * | | o None | |
- * | | | |
- * | | o Primary Key | |
- * | | | |
- * | | o Custom | |
- * | | ------------------------------------------------------------------- | |
- * | | | I | | |
- * | | ------------------------------------------------------------------- | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see CollectionMapping
- * @see OrmManyToManyMappingComposite - A container of this pane
- * @see OrmOneToManyMappingComposite - A container of this pane
- *
- * @version 2.3
- * @since 1.0
- */
-public class Ordering2_0Composite extends AbstractOrderingComposite
-{
- /**
- * Creates a new <code>OrderingComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public Ordering2_0Composite(Pane<? extends CollectionMapping> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
-
- @Override
- protected void initializeLayout(Composite container) {
- PropertyValueModel<Orderable> orderableHolder = buildOrderableHolder();
-
- container = addCollapsibleSection(
- container,
- JptUiDetailsMessages.OrderingComposite_orderingGroup
- );
-
- // No Ordering radio button
- addRadioButton(
- container,
- JptUiDetailsMessages.OrderingComposite_none,
- buildNoOrderingHolder(orderableHolder),
- JpaHelpContextIds.MAPPING_ORDER_BY_NO_ORDERING
- );
-
- // Order by Primary Key radio button
- addRadioButton(
- container,
- JptUiDetailsMessages.OrderingComposite_primaryKey,
- buildPrimaryKeyOrderingHolder(orderableHolder),
- JpaHelpContextIds.MAPPING_ORDER_BY_PRIMARY_KEY_ORDERING
- );
-
- // Custom Ordering radio button
- addRadioButton(
- container,
- JptUiDetailsMessages.OrderingComposite_custom,
- buildCustomOrderingHolder(orderableHolder),
- JpaHelpContextIds.MAPPING_ORDER_BY_CUSTOM_ORDERING
- );
-
- // Custom Ordering text field
- addText(
- addSubPane(container, 0, 16),
- buildSpecifiedOrderByHolder(orderableHolder),
- JpaHelpContextIds.MAPPING_ORDER_BY,
- buildCustomOrderingHolder(orderableHolder)
- );
-
-
- // Order Column Ordering radio button
- addRadioButton(
- container,
- JptUiDetailsMessages2_0.OrderingComposite_orderColumn,
- buildOrderColumnOrderingHolder(orderableHolder),
- JpaHelpContextIds.MAPPING_ORDER_COLUMN_ORDERING
- );
-
- OrderColumnComposite orderColumnComposite = new OrderColumnComposite(
- this,
- buildOrderColumnHolder(orderableHolder),
- addSubPane(container, 0, 16));
-
- installOrderColumnCompositeEnabler(orderableHolder, orderColumnComposite);
- }
-
- protected void installOrderColumnCompositeEnabler(PropertyValueModel<Orderable> orderableHolder, OrderColumnComposite pane) {
- new PaneEnabler(buildPaneEnablerHolder(orderableHolder), pane);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder(PropertyValueModel<Orderable> orderableHolder) {
- return buildOrderColumnOrderingHolder(orderableHolder);
- }
-
-
- protected ModifiablePropertyValueModel<Boolean> buildOrderColumnOrderingHolder(PropertyValueModel<Orderable> orderableHolder) {
- return new PropertyAspectAdapter<Orderable, Boolean>(orderableHolder, Orderable2_0.ORDER_COLUMN_ORDERING_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(((Orderable2_0) this.subject).isOrderColumnOrdering());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- ((Orderable2_0) this.subject).setOrderColumnOrdering(value.booleanValue());
- }
- };
- }
-
- protected PropertyValueModel<OrderColumn2_0> buildOrderColumnHolder(PropertyValueModel<Orderable> orderableHolder) {
- return new PropertyAspectAdapter<Orderable, OrderColumn2_0>(orderableHolder) {
- @Override
- protected OrderColumn2_0 buildValue_() {
- return ((Orderable2_0) this.subject).getOrderColumn();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java
deleted file mode 100644
index f280300f4c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/OrphanRemoval2_0Composite.java
+++ /dev/null
@@ -1,111 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.RelationshipMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | [X] Orphan removal (true/false) | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see {@link OrphanRemovable2_0}
- * @see {@link JavaOneToOneMapping2_0Composite} - A container of this widget
- * @see {@link OrmOneToOneMapping2_0Composite} - A container of this widget
- */
-public class OrphanRemoval2_0Composite extends Pane<OrphanRemovable2_0>
-{
- /**
- * Creates a new <code>OrphanRemoval2_0Composite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrphanRemoval2_0Composite(
- Pane<? extends RelationshipMapping> parentPane,
- PropertyValueModel<? extends OrphanRemovable2_0> subjectHolder,
- Composite parent) {
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- this.addTriStateCheckBoxWithDefault(
- container,
- JptUiDetailsMessages2_0.OrphanRemoval2_0Composite_orphanRemovalLabel,
- this.buildOrphanRemovalHolder(),
- this.buildOrphanRemovalStringHolder(),
- null // TODO
- );
- }
- private ModifiablePropertyValueModel<Boolean> buildOrphanRemovalHolder() {
- return new PropertyAspectAdapter<OrphanRemovable2_0, Boolean>(
- this.getSubjectHolder(),
- OrphanRemovable2_0.DEFAULT_ORPHAN_REMOVAL_PROPERTY,
- OrphanRemovable2_0.SPECIFIED_ORPHAN_REMOVAL_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedOrphanRemoval();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedOrphanRemoval(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildOrphanRemovalStringHolder() {
-
- return new TransformationPropertyValueModel<Boolean, String>(this.buildDefaultOrphanRemovalHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiDetailsMessages2_0.OrphanRemoval2_0Composite_orphanRemovalLabelDefault, defaultStringValue);
- }
- return JptUiDetailsMessages2_0.OrphanRemoval2_0Composite_orphanRemovalLabel;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultOrphanRemovalHolder() {
- return new PropertyAspectAdapter<OrphanRemovable2_0, Boolean>(
- this.getSubjectHolder(),
- OrphanRemovable2_0.SPECIFIED_ORPHAN_REMOVAL_PROPERTY,
- OrphanRemovable2_0.DEFAULT_ORPHAN_REMOVAL_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedOrphanRemoval() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.isDefaultOrphanRemoval());
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Queries2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Queries2_0Composite.java
deleted file mode 100644
index 17ead05d7d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/Queries2_0Composite.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.jpa2.context.NamedQuery2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.QueriesComposite;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.part.PageBook;
-
-/**
- * Queries2_0Composite
- */
-public class Queries2_0Composite
- extends QueriesComposite
-{
- public Queries2_0Composite(
- Pane<?> parentPane,
- PropertyValueModel<? extends QueryContainer> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected Pane<NamedQuery2_0> buildNamedQueryPropertyComposite(PageBook pageBook) {
- return new NamedQueryProperty2_0Composite(
- this,
- this.buildNamedQuery2_0Holder(),
- pageBook);
- }
-
- protected PropertyValueModel<NamedQuery2_0> buildNamedQuery2_0Holder() {
- return new TransformationPropertyValueModel<Query, NamedQuery2_0>(this.getQueryHolder()) {
- @Override
- protected NamedQuery2_0 transform_(Query value) {
- return (value instanceof NamedQuery2_0) ? (NamedQuery2_0) value : null;
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/SequenceGenerator2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/SequenceGenerator2_0Composite.java
deleted file mode 100644
index 22a92db8fb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/SequenceGenerator2_0Composite.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.jpa2.context.SequenceGenerator2_0;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.JptUiDetailsMessages;
-import org.eclipse.jpt.jpa.ui.internal.details.SequenceGeneratorComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.db.CatalogCombo;
-import org.eclipse.jpt.jpa.ui.internal.details.db.SchemaCombo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JavaSequenceGenerator2_0Composite
- */
-public class SequenceGenerator2_0Composite extends SequenceGeneratorComposite
-{
-
- public SequenceGenerator2_0Composite(Pane<?> parentPane,
- PropertyValueModel<SequenceGenerator> subjectHolder,
- Composite parent,
- GeneratorBuilder<SequenceGenerator> builder) {
-
- super(parentPane, subjectHolder, parent, builder);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Name widgets
- this.addLabeledText(
- container,
- JptUiDetailsMessages.SequenceGeneratorComposite_name,
- this.buildGeneratorNameHolder(),
- JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_NAME
- );
-
- // Sequence Generator widgets
- this.addLabeledComposite(
- container,
- JptUiDetailsMessages.SequenceGeneratorComposite_sequence,
- this.buildSequenceNameCombo(container),
- JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_SEQUENCE
- );
-
- // Schema widgets
- this.addLabeledComposite(
- container,
- JptUiDetailsMessages.SequenceGeneratorComposite_schema,
- this.addSchemaCombo(container),
- null // JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_SCHEMA
- );
-
- // Catalog widgets
- this.addLabeledComposite(
- container,
- JptUiDetailsMessages.SequenceGeneratorComposite_catalog,
- this.addCatalogCombo(container),
- null // JpaHelpContextIds.MAPPING_SEQUENCE_GENERATOR_CATALOG
- );
-
- this.addAllocationSizeCombo(container);
- this.addInitialValueCombo(container);
- }
-
- private SchemaCombo<SequenceGenerator> addSchemaCombo(Composite container) {
-
- return new SchemaCombo<SequenceGenerator>(this, getSubjectHolder(), container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(SequenceGenerator2_0.DEFAULT_SCHEMA_PROPERTY);
- propertyNames.add(SequenceGenerator2_0.SPECIFIED_SCHEMA_PROPERTY);
- propertyNames.add(SequenceGenerator2_0.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(SequenceGenerator2_0.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected void propertyChanged(String propertyName) {
- if (propertyName == SequenceGenerator2_0.DEFAULT_CATALOG_PROPERTY
- || propertyName == SequenceGenerator2_0.SPECIFIED_CATALOG_PROPERTY ) {
- repopulateComboBox();
- }
- else {
- super.propertyChanged(propertyName);
- }
- }
-
- @Override
- protected String getDefaultValue() {
- return ((SequenceGenerator2_0) getSubject()).getDefaultSchema();
- }
-
- @Override
- protected boolean nullSubjectIsAllowed() {
- return true;
- }
-
- /**
- * subject may be null, so delegate to the composite
- */
- @Override
- protected JpaProject getJpaProject() {
- return SequenceGenerator2_0Composite.this.getJpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- ((SequenceGenerator2_0) SequenceGenerator2_0Composite.this.retrieveGenerator()).setSpecifiedSchema(value);
- }
-
- @Override
- protected String getValue() {
- return ((SequenceGenerator2_0) getSubject()).getSpecifiedSchema();
- }
-
- @Override
- protected SchemaContainer getDbSchemaContainer() {
- SequenceGenerator2_0 tg = (SequenceGenerator2_0) this.getSubject();
- if (tg != null) {
- return tg.getDbSchemaContainer();
- }
- return SequenceGenerator2_0Composite.this.getSubject().getContextDefaultDbSchemaContainer();
- }
-
- @Override
- protected SchemaContainer getDbSchemaContainer_() {
- // we overrode #getDbSchemaContainer() instead
- throw new UnsupportedOperationException();
- }
- };
- }
-
- private CatalogCombo<SequenceGenerator> addCatalogCombo(Composite container) {
-
- return new CatalogCombo<SequenceGenerator>(this, getSubjectHolder(), container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(SequenceGenerator2_0.DEFAULT_CATALOG_PROPERTY);
- propertyNames.add(SequenceGenerator2_0.SPECIFIED_CATALOG_PROPERTY);
- }
-
- @Override
- protected String getDefaultValue() {
- return ((SequenceGenerator2_0) getSubject()).getDefaultCatalog();
- }
-
- @Override
- protected boolean nullSubjectIsAllowed() {
- return true;
- }
-
- /**
- * subject may be null, so delegate to the composite
- */
- @Override
- protected JpaProject getJpaProject() {
- return SequenceGenerator2_0Composite.this.getJpaProject();
- }
-
- @Override
- protected void setValue(String value) {
- ((SequenceGenerator2_0) SequenceGenerator2_0Composite.this.retrieveGenerator()).setSpecifiedCatalog(value);
- }
-
- @Override
- protected String getValue() {
- return ((SequenceGenerator2_0) getSubject()).getSpecifiedCatalog();
- }
- };
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/TargetClassComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/TargetClassComposite.java
deleted file mode 100644
index 1819d2d7ce..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/TargetClassComposite.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserComboPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * target entity hyperlink label, combo and browse button
- */
-public class TargetClassComposite extends ClassChooserComboPane<ElementCollectionMapping2_0>
-{
-
- /**
- * Creates a new <code>TargetEntityComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public TargetClassComposite(
- Pane<? extends ElementCollectionMapping2_0> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected String getClassName() {
- return getSubject().getTargetClass();
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setSpecifiedTargetClass(className);
- }
-
- @Override
- protected char getEnclosingTypeSeparator() {
- return getSubject().getTargetClassEnclosingTypeSeparator();
- }
-
- @Override
- protected String getLabelText() {
- return JptUiDetailsMessages2_0.TargetClassComposite_label;
- }
-
- @Override
- protected String getHelpId() {
- return JpaHelpContextIds.MAPPING_ELEMENT_COLLECTION_TARGET_CLASS;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected String getFullyQualifiedClassName() {
- return getSubject().getFullyQualifiedTargetClass();
- }
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, String>(
- this.getSubjectHolder(),
- ElementCollectionMapping2_0.SPECIFIED_TARGET_CLASS_PROPERTY,
- ElementCollectionMapping2_0.DEFAULT_TARGET_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
-
- String name = this.subject.getSpecifiedTargetClass();
- if (name == null) {
- name = TargetClassComposite.this.getDefaultValue(this.subject);
- }
- return name;
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (getDefaultValue(this.subject).equals(value)) {
- value = null;
- }
- this.subject.setSpecifiedTargetClass(value);
- }
- };
- }
-
- @Override
- protected ListValueModel<String> buildClassListHolder() {
- return this.buildDefaultProfilerListHolder();
- }
-
- private ListValueModel<String> buildDefaultProfilerListHolder() {
- return new PropertyListValueModelAdapter<String>(
- this.buildDefaultProfilerHolder()
- );
- }
-
- private PropertyValueModel<String> buildDefaultProfilerHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, String>(this.getSubjectHolder(), ElementCollectionMapping2_0.DEFAULT_TARGET_CLASS_PROPERTY) {
- @Override
- protected String buildValue_() {
- return TargetClassComposite.this.getDefaultValue(this.subject);
- }
- };
- }
-
- private String getDefaultValue(ElementCollectionMapping2_0 subject) {
- String defaultValue = subject.getDefaultTargetClass();
-
- if (defaultValue != null) {
- return NLS.bind(
- JptCommonUiMessages.DefaultWithOneParam,
- defaultValue
- );
- }
- return JptCommonUiMessages.DefaultEmpty;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/Generic2_0JavaResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/Generic2_0JavaResourceUiDefinition.java
deleted file mode 100644
index f4964985db..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/Generic2_0JavaResourceUiDefinition.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import java.util.List;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.DefaultJavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.java.AbstractJavaResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.DefaultEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedIdMappingUDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.java.NullJavaAttributeMappingUiDefinition;
-
-public class Generic2_0JavaResourceUiDefinition extends AbstractJavaResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new Generic2_0JavaResourceUiDefinition();
-
- /**
- * Return the singleton.
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * zero-argument constructor
- */
- protected Generic2_0JavaResourceUiDefinition() {
- super();
- }
-
- @Override
- protected JavaUiFactory buildJavaUiFactory() {
- return new Generic2_0JavaUiFactory();
- }
-
- @Override
- protected void addSpecifiedAttributeMappingUiDefinitionsTo(List<JavaAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
- definitions.add(JavaElementCollectionMapping2_0UiDefinition.instance());
- definitions.add(JavaIdMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedIdMappingUDefinition.instance());
- definitions.add(JavaBasicMappingUiDefinition.instance());
- definitions.add(JavaVersionMappingUiDefinition.instance());
- definitions.add(JavaManyToOneMappingUiDefinition.instance());
- definitions.add(JavaOneToManyMappingUiDefinition.instance());
- definitions.add(JavaOneToOneMappingUiDefinition.instance());
- definitions.add(JavaManyToManyMappingUiDefinition.instance());
- definitions.add(JavaEmbeddedMappingUiDefinition.instance());
- definitions.add(JavaTransientMappingUiDefinition.instance());
- }
-
- @Override
- protected void addDefaultAttributeMappingUiDefinitionsTo(List<DefaultJavaAttributeMappingUiDefinition<?>> definitions) {
- definitions.add(DefaultBasicMappingUiDefinition.instance());
- definitions.add(DefaultEmbeddedMappingUiDefinition.instance());
- definitions.add(NullJavaAttributeMappingUiDefinition.instance());
- }
-
- @Override
- protected void addSpecifiedTypeMappingUiDefinitionsTo(List<JavaTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
- definitions.add(JavaEntityUiDefinition.instance());
- definitions.add(JavaMappedSuperclassUiDefinition.instance());
- definitions.add(JavaEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java
deleted file mode 100644
index 451c37f8e2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/Generic2_0JavaUiFactory.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.ElementCollectionMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.EmbeddedIdMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.GenericPersistenceXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.jpa2.details.java.JavaUiFactory2_0;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The default implementation of the UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- *
- * @see GenericPersistenceXmlUiFactory
- *
- * @version 1.0
- * @since 1.0
- */
-public class Generic2_0JavaUiFactory
- extends BaseJavaUiFactory
- implements JavaUiFactory2_0
-{
- // **************** java type mapping composites ***************************
-
- @Override
- public JpaComposite createJavaMappedSuperclassComposite(
- PropertyValueModel<JavaMappedSuperclass> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaMappedSuperclass2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEntityComposite(
- PropertyValueModel<JavaEntity> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEntity2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEmbeddableComposite(
- PropertyValueModel<JavaEmbeddable> subjectHolder,
- Composite parent, WidgetFactory widgetFactory) {
- return new JavaEmbeddable2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
-
- // **************** java attribute mapping composites **********************
-
- @Override
- public JpaComposite createJavaIdMappingComposite(
- PropertyValueModel<JavaIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEmbeddedIdMappingComposite(
- PropertyValueModel<JavaEmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new EmbeddedIdMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaEmbeddedMappingComposite(
- PropertyValueModel<JavaEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaEmbeddedMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToManyMappingComposite(
- PropertyValueModel<JavaManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaManyToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaManyToOneMappingComposite(
- PropertyValueModel<JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaManyToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToManyMappingComposite(
- PropertyValueModel<JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaOneToManyMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- public JpaComposite createJavaOneToOneMappingComposite(
- PropertyValueModel<JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new JavaOneToOneMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-
- public JpaComposite createJavaElementCollectionMapping2_0Composite(
- PropertyValueModel<JavaElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
- return new ElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaElementCollectionMapping2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaElementCollectionMapping2_0UiDefinition.java
deleted file mode 100644
index 42f5a7e56a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaElementCollectionMapping2_0UiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.jpa2.details.java.JavaUiFactory2_0;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaElementCollectionMapping2_0UiDefinition
- extends AbstractElementCollectionMapping2_0UiDefinition<ReadOnlyPersistentAttribute, JavaElementCollectionMapping2_0>
- implements JavaAttributeMappingUiDefinition<JavaElementCollectionMapping2_0>
-{
- // singleton
- private static final JavaElementCollectionMapping2_0UiDefinition INSTANCE =
- new JavaElementCollectionMapping2_0UiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingUiDefinition<JavaElementCollectionMapping2_0> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private JavaElementCollectionMapping2_0UiDefinition() {
- super();
- }
-
-
- public JpaComposite buildAttributeMappingComposite(
- JavaUiFactory factory,
- PropertyValueModel<JavaElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return ((JavaUiFactory2_0) factory).createJavaElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddable2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddable2_0Composite.java
deleted file mode 100644
index a1fae294dd..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddable2_0Composite.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddable;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * This pane does not have any widgets.
- *
- * @see Embeddable
- * @see EmbeddableUiProvider
- *
- * @version 2.3
- * @since 2.0
- */
-public class JavaEmbeddable2_0Composite extends AbstractEmbeddableComposite<JavaEmbeddable>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddableComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEmbeddable2_0Composite(PropertyValueModel<? extends JavaEmbeddable> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeEmbeddableCollapsibleSection(container);
- }
-
- @Override
- protected void initializeEmbeddableSection(Composite container) {
- new AccessTypeComposite(this, buildAccessHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaEmbeddable, AccessHolder>(
- getSubjectHolder())
- {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddedMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddedMapping2_0Composite.java
deleted file mode 100644
index 8713cc0415..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEmbeddedMapping2_0Composite.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.EmbeddedMapping2_0OverridesComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EmbeddedAttributeOverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- *
- * @version 2.3
- * @since 1.0
- */
-public class JavaEmbeddedMapping2_0Composite extends AbstractEmbeddedMappingComposite<JavaEmbeddedMapping>
- implements JpaComposite
-{
- /**
- * Creates a new <code>EmbeddedMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>EmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEmbeddedMapping2_0Composite(PropertyValueModel<? extends JavaEmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEmbeddedSection(Composite container) {
- new EmbeddedMapping2_0OverridesComposite(
- this,
- container
- );
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEntity2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEntity2_0Composite.java
deleted file mode 100644
index cc12ebd7f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaEntity2_0Composite.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EntityNameComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaInheritanceComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.JavaSecondaryTablesComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Cacheable2_0Pane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Entity2_0OverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Queries2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for a Java entity.
- *
- * @see JavaEntity
- * @see JavaSecondaryTablesComposite
- *
- * @version 2.3
- * @since 1.0
- */
-public class JavaEntity2_0Composite
- extends AbstractEntityComposite<JavaEntity>
-{
- /**
- * Creates a new <code>JavaEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>JavaEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaEntity2_0Composite(
- PropertyValueModel<? extends JavaEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEntitySection(Composite container) {
- new TableComposite(this, container);
- new EntityNameComposite(this, container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- new Cacheable2_0Pane(this, buildCacheableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaEntity, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-
- protected PropertyValueModel<Cacheable2_0> buildCacheableHolder() {
- return new PropertyAspectAdapter<JavaEntity, Cacheable2_0>(getSubjectHolder()) {
- @Override
- protected Cacheable2_0 buildValue_() {
- return ((CacheableHolder2_0) this.subject).getCacheable();
- }
- };
- }
-
- @Override
- protected void initializeSecondaryTablesSection(Composite container) {
- new JavaSecondaryTablesComposite(this, container);
- }
-
- @Override
- protected void initializeInheritanceSection(Composite container) {
- new JavaInheritanceComposite(this, container);
- }
-
- @Override
- protected void initializeAttributeOverridesSection(Composite container) {
- new Entity2_0OverridesComposite(this, container);
- }
-
- @Override
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new Queries2_0Composite(this, queryContainerHolder, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaIdMapping2_0Composite.java
deleted file mode 100644
index 6ab367fabe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaIdMapping2_0Composite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractIdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.IdMapping2_0MappedByRelationshipPane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.IdMappingGeneration2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaIdMapping2_0Composite
- extends AbstractIdMappingComposite<IdMapping>
-{
- public JavaIdMapping2_0Composite(
- PropertyValueModel<? extends IdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new IdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new ColumnComposite(this, buildColumnHolder(), container);
- }
-
- @Override
- protected void initializeGenerationCollapsibleSection(Composite container) {
- new IdMappingGeneration2_0Composite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java
deleted file mode 100644
index 55822090d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyRelationship;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaManyToManyMapping2_0Composite
- extends AbstractManyToManyMappingComposite<JavaManyToManyMapping, JavaManyToManyRelationship>
-{
- public JavaManyToManyMapping2_0Composite(
- PropertyValueModel<? extends JavaManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Composite.java
deleted file mode 100644
index dba1e697f4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractManyToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaManyToOneMapping2_0Composite
- extends AbstractManyToOneMapping2_0Composite<JavaManyToOneMapping, JavaManyToOneRelationship2_0>
-{
- public JavaManyToOneMapping2_0Composite(
- PropertyValueModel<? extends JavaManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Pane.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Pane.java
deleted file mode 100644
index 6ac5eb9eee..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaManyToOneMapping2_0Pane.java
+++ /dev/null
@@ -1,14 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-public class JavaManyToOneMapping2_0Pane
-{}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaMappedSuperclass2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaMappedSuperclass2_0Composite.java
deleted file mode 100644
index 836202ac08..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaMappedSuperclass2_0Composite.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractJavaMappedSuperclassComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AccessTypeComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- *
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | IdClassComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - v Queries ------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | QueriesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see MappedSuperclass
- * @see Generic2_0JavaUiFactory - The factory creating this pane
- * @see AccessTypeComposite
- * @see IdClassComposite
- *
- * @version 2.3
- * @since 2.0
- */
-
-public class JavaMappedSuperclass2_0Composite
- extends AbstractJavaMappedSuperclassComposite
- implements JpaComposite
-{
- /**
- * Creates a new <code>MappedSuperclassComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public JavaMappedSuperclass2_0Composite(
- PropertyValueModel<? extends JavaMappedSuperclass> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeMappedSuperclassSection(Composite container) {
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolder() {
- return new PropertyAspectAdapter<JavaMappedSuperclass, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentType();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java
deleted file mode 100644
index 1c946851a7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OneToManyJoiningStrategy2_0Pane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaOneToManyMapping2_0Composite
- extends AbstractOneToManyMappingComposite<JavaOneToManyMapping, JavaOneToManyRelationship2_0>
-{
- public JavaOneToManyMapping2_0Composite(
- PropertyValueModel<? extends JavaOneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToManyJoiningStrategy2_0Pane(this, this.buildJoiningHolder(), container);
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<JavaOneToManyMapping, OrphanRemovable2_0>(this.getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToOneMapping2_0Composite.java
deleted file mode 100644
index 9cc8974a57..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/java/JavaOneToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractOneToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OneToOneJoiningStrategy2_0Pane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class JavaOneToOneMapping2_0Composite
- extends AbstractOneToOneMapping2_0Composite<JavaOneToOneMapping, JavaOneToOneRelationship2_0>
-{
- public JavaOneToOneMapping2_0Composite(
- PropertyValueModel<? extends JavaOneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, container);
- new OrphanRemoval2_0Composite(this, buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToOneJoiningStrategy2_0Pane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<JavaOneToOneMapping, OrphanRemovable2_0>(getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsPage.java
deleted file mode 100644
index 57bec22097..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsPage.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractEntityMappingsDetailsPage;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EntityMappings2_0DetailsPage
- */
-public class EntityMappings2_0DetailsPage extends AbstractEntityMappingsDetailsPage
-{
- /**
- * Creates a new <code>EntityMappings2_0DetailsPage</code>.
- *
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public EntityMappings2_0DetailsPage(Composite parent,
- WidgetFactory widgetFactory) {
-
- super(parent, widgetFactory);
- }
-
- @Override
- protected void initializeGeneratorsCollapsibleSection(Composite container) {
- new EntityMappingsGenerators2_0Composite(this, container);
- }
-
- @Override
- protected void initializeQueriesCollapsibleSection(Composite container) {
- new OrmQueries2_0Composite(this, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsProvider.java
deleted file mode 100644
index cda365b761..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappings2_0DetailsProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEntityMappingsDetailsProvider;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EntityMappings2_0DetailsProvider
- */
-public class EntityMappings2_0DetailsProvider
- extends AbstractEntityMappingsDetailsProvider
-{
- // singleton
- private static final JpaDetailsProvider INSTANCE = new EntityMappings2_0DetailsProvider();
-
-
- /**
- * Return the singleton
- */
- public static JpaDetailsProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private EntityMappings2_0DetailsProvider() {
- super();
- }
-
-
- @Override
- protected boolean providesDetails(JptResourceType resourceType) {
- return resourceType.equals(JptJpaCorePlugin.ORM_XML_2_0_RESOURCE_TYPE);
- }
-
- public JpaDetailsPageManager<EntityMappings> buildDetailsPageManager(
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return new EntityMappings2_0DetailsPage(parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappingsGenerators2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappingsGenerators2_0Composite.java
deleted file mode 100644
index 293019a85d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/EntityMappingsGenerators2_0Composite.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.GeneratorComposite.GeneratorBuilder;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.EntityMappingsGeneratorsComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.SequenceGenerator2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * EntityMappingsGenerators2_0Composite
- */
-public class EntityMappingsGenerators2_0Composite extends EntityMappingsGeneratorsComposite
-{
- /**
- * Creates a new <code>EntityMappingsGenerators2_0Composite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public EntityMappingsGenerators2_0Composite(
- Pane<? extends EntityMappings> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected GeneratorComposite<SequenceGenerator> buildSequenceGeneratorComposite(
- Composite parent,
- PropertyValueModel<SequenceGenerator> sequenceGeneratorHolder,
- GeneratorBuilder<SequenceGenerator> generatorBuilder) {
-
- return new SequenceGenerator2_0Composite(
- this,
- sequenceGeneratorHolder,
- parent,
- generatorBuilder
- );
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmBasicMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmBasicMapping2_0Composite.java
deleted file mode 100644
index 46a70b9cdc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmBasicMapping2_0Composite.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractBasicMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmBasicMapping2_0Composite extends AbstractBasicMappingComposite<BasicMapping>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmBasicMapping2_0Composite(PropertyValueModel<? extends BasicMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeBasicSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, addSubPane(container, 4));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<BasicMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0Composite.java
deleted file mode 100644
index fcba7bd016..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0Composite.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CollectionTable2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.TargetClassComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmElementCollectionMapping2_0Composite
- extends AbstractElementCollectionMapping2_0Composite<ElementCollectionMapping2_0>
-{
- /**
- * Creates a new <code>EclipseLink1_1OrmBasicMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>BasicMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmElementCollectionMapping2_0Composite(PropertyValueModel<? extends ElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeElementCollectionSection(Composite container) {
- new TargetClassComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new CollectionTable2_0Composite(this, buildCollectionTableHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ElementCollectionMapping2_0, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0UiDefinition.java
deleted file mode 100644
index 7f7722056e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmElementCollectionMapping2_0UiDefinition.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractElementCollectionMapping2_0UiDefinition;
-import org.eclipse.jpt.jpa.ui.jpa2.details.orm.OrmXmlUiFactory2_0;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmElementCollectionMapping2_0UiDefinition
- extends AbstractElementCollectionMapping2_0UiDefinition<ReadOnlyPersistentAttribute, OrmElementCollectionMapping2_0>
- implements OrmAttributeMappingUiDefinition<OrmElementCollectionMapping2_0>
-{
- // singleton
- private static final OrmElementCollectionMapping2_0UiDefinition INSTANCE =
- new OrmElementCollectionMapping2_0UiDefinition();
-
-
- /**
- * Return the singleton.
- */
- public static OrmAttributeMappingUiDefinition<OrmElementCollectionMapping2_0> instance() {
- return INSTANCE;
- }
-
-
- /**
- * Ensure single instance.
- */
- private OrmElementCollectionMapping2_0UiDefinition() {
- super();
- }
-
- public JpaComposite buildAttributeMappingComposite(
- OrmXmlUiFactory factory,
- PropertyValueModel<OrmElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- return ((OrmXmlUiFactory2_0) factory).createOrmElementCollectionMapping2_0Composite(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedIdMapping2_0Composite.java
deleted file mode 100644
index d1ae124f01..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedIdMapping2_0Composite.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedIdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EmbeddedMappingOverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.EmbeddedIdMapping2_0MappedByRelationshipPane;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmEmbeddedIdMapping2_0Composite
- extends AbstractEmbeddedIdMappingComposite<EmbeddedIdMapping>
-{
- public OrmEmbeddedIdMapping2_0Composite(
- PropertyValueModel<? extends EmbeddedIdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeEmbeddedIdSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
-
- new EmbeddedIdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new EmbeddedMappingOverridesComposite(this, container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EmbeddedIdMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedMapping2_0Composite.java
deleted file mode 100644
index 0913d9ec2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEmbeddedMapping2_0Composite.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractEmbeddedMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.EmbeddedMapping2_0OverridesComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | EmbeddedAttributeOverridesComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see EmbeddedMapping
- * @see BaseJavaUiFactory - The factory creating this pane
- *
- * @version 2.3
- * @since 2.2
- */
-public class OrmEmbeddedMapping2_0Composite
- extends AbstractEmbeddedMappingComposite<EmbeddedMapping>
-{
- /**
- * Creates a new <code>EmbeddedMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>EmbeddedMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEmbeddedMapping2_0Composite(PropertyValueModel<? extends EmbeddedMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEmbeddedSection(Composite container) {
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
-
- new EmbeddedMapping2_0OverridesComposite(
- this,
- container
- );
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<EmbeddedMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEntity2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEntity2_0Composite.java
deleted file mode 100644
index a018170014..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmEntity2_0Composite.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.GeneratorContainer;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.EntityNameComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.IdClassComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TableComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.MetadataCompleteComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmJavaClassChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Cacheable2_0Pane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Entity2_0OverridesComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Generation2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Queries2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The pane used for an ORM entity 2.0.
- *
- * @see OrmEntity
- * @see Entity2_0OverridesComposite
- */
-public class OrmEntity2_0Composite
- extends AbstractOrmEntityComposite
-{
- /**
- * Creates a new <code>OrmEntityComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>OrmEntity</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmEntity2_0Composite(
- PropertyValueModel<? extends OrmEntity> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeEntitySection(Composite container) {
- new OrmJavaClassChooser(this, getSubjectHolder(), container, false);
- new TableComposite(this, container);
- new EntityNameComposite(this, container);
- new AccessTypeComposite(this, buildAccessHolder(), container);
- new IdClassComposite(this, buildIdClassReferenceHolder(), container);
- new Cacheable2_0Pane(this, buildCacheableHolder(), container);
- new MetadataCompleteComposite(this, getSubjectHolder(), container);
- }
-
- protected PropertyValueModel<Cacheable2_0> buildCacheableHolder() {
- return new PropertyAspectAdapter<OrmEntity, Cacheable2_0>(getSubjectHolder()) {
- @Override
- protected Cacheable2_0 buildValue_() {
- return ((CacheableHolder2_0) this.subject).getCacheable();
- }
- };
- }
-
- @Override
- protected void initializeAttributeOverridesSection(Composite container) {
- new Entity2_0OverridesComposite(this, container);
- }
-
- @Override
- protected void initializeGeneratorsSection(Composite container, PropertyValueModel<GeneratorContainer> generatorContainerHolder) {
- new Generation2_0Composite(this, generatorContainerHolder, container);
- }
-
- @Override
- protected void initializeQueriesSection(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- new Queries2_0Composite(this, queryContainerHolder, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmIdMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmIdMapping2_0Composite.java
deleted file mode 100644
index 3717d093e0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmIdMapping2_0Composite.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractIdMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.IdMapping2_0MappedByRelationshipPane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.IdMappingGeneration2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmIdMapping2_0Composite
- extends AbstractIdMappingComposite<IdMapping>
-{
- public OrmIdMapping2_0Composite(
- PropertyValueModel<? extends IdMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeIdSection(Composite container) {
- new IdMapping2_0MappedByRelationshipPane(this, getSubjectHolder(), container);
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- }
-
- @Override
- protected void initializeGenerationCollapsibleSection(Composite container) {
- new IdMappingGeneration2_0Composite(this, container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<IdMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java
deleted file mode 100644
index 136fbb7fd4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractManyToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmManyToManyMapping2_0Composite
- extends AbstractManyToManyMappingComposite<ManyToManyMapping, ManyToManyRelationship>
-{
- /**
- * Creates a new <code>ManyToManyMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>IManyToManyMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmManyToManyMapping2_0Composite(
- PropertyValueModel<? extends ManyToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeManyToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToOneMapping2_0Composite.java
deleted file mode 100644
index 15ca95d75c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmManyToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractManyToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmManyToOneMapping2_0Composite
- extends AbstractManyToOneMapping2_0Composite<ManyToOneMapping, ManyToOneRelationship2_0>
-{
- public OrmManyToOneMapping2_0Composite(
- PropertyValueModel<? extends ManyToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeManyToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<ManyToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java
deleted file mode 100644
index 352f358926..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToManyMapping2_0Composite.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractOneToManyMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OneToManyJoiningStrategy2_0Pane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Ordering2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmOneToManyMapping2_0Composite
- extends AbstractOneToManyMappingComposite<OneToManyMapping, OneToManyRelationship2_0>
-{
- public OrmOneToManyMapping2_0Composite(
- PropertyValueModel<? extends OneToManyMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeOneToManySection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, this.buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new OrphanRemoval2_0Composite(this, this.buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, this.buildCascadeHolder(), this.addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToManyJoiningStrategy2_0Pane(this, this.buildJoiningHolder(), container);
- }
-
- @Override
- protected void initializeOrderingCollapsibleSection(Composite container) {
- new Ordering2_0Composite(this, container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToManyMapping, AccessHolder>(this.getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<OneToManyMapping, OrphanRemovable2_0>(this.getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToOneMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToOneMapping2_0Composite.java
deleted file mode 100644
index a9cd556c85..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmOneToOneMapping2_0Composite.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.FetchTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.OptionalComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.TargetEntityComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.AbstractOneToOneMapping2_0Composite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.CascadePane2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OneToOneJoiningStrategy2_0Pane;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.OrphanRemoval2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmOneToOneMapping2_0Composite
- extends AbstractOneToOneMapping2_0Composite<OneToOneMapping, OneToOneRelationship2_0>
-{
- public OrmOneToOneMapping2_0Composite(
- PropertyValueModel<? extends OneToOneMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
-
- @Override
- protected void initializeOneToOneSection(Composite container) {
- new TargetEntityComposite(this, container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- new FetchTypeComposite(this, container);
- new OptionalComposite(this, container);
- new OrphanRemoval2_0Composite(this, buildOrphanRemovableHolder(), container);
- new CascadePane2_0(this, buildCascadeHolder(), addSubPane(container, 5));
- }
-
- @Override
- protected void initializeJoiningStrategyCollapsibleSection(Composite container) {
- new OneToOneJoiningStrategy2_0Pane(this, buildJoiningHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-
- protected PropertyValueModel<OrphanRemovable2_0> buildOrphanRemovableHolder() {
- return new PropertyAspectAdapter<OneToOneMapping, OrphanRemovable2_0>(getSubjectHolder()) {
- @Override
- protected OrphanRemovable2_0 buildValue_() {
- return ((OrphanRemovalHolder2_0) this.subject).getOrphanRemoval();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmQueries2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmQueries2_0Composite.java
deleted file mode 100644
index e60271eb8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmQueries2_0Composite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.QueryContainer;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.internal.details.QueriesComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmQueriesComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.details.Queries2_0Composite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * OrmQueries2_0Composite
- */
-public class OrmQueries2_0Composite extends OrmQueriesComposite {
-
- /**
- * Creates a new <code>OrmQueries2_0Composite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public OrmQueries2_0Composite(Pane<? extends EntityMappings> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected QueriesComposite buildQueriesComposite(Composite container, PropertyValueModel<QueryContainer> queryContainerHolder) {
- return new Queries2_0Composite(this, queryContainerHolder, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmVersionMapping2_0Composite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmVersionMapping2_0Composite.java
deleted file mode 100644
index 416aadd306..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmVersionMapping2_0Composite.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.AccessHolder;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.ui.internal.details.AbstractVersionMappingComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.AccessTypeComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.ColumnComposite;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappingNameChooser;
-import org.eclipse.swt.widgets.Composite;
-
-public class OrmVersionMapping2_0Composite
- extends AbstractVersionMappingComposite<VersionMapping>
-{
- /**
- * Creates a new <code>EclipseLinkOrmVersionMappingComposite</code>.
- *
- * @param subjectHolder The holder of the subject <code>VersionMapping</code>
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public OrmVersionMapping2_0Composite(PropertyValueModel<? extends VersionMapping> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeVersionSection(Composite container) {
- new ColumnComposite(this, buildColumnHolder(), container);
- new OrmMappingNameChooser(this, getSubjectHolder(), container);
- new AccessTypeComposite(this, buildAccessHolderHolder(), container);
- }
-
- protected PropertyValueModel<AccessHolder> buildAccessHolderHolder() {
- return new PropertyAspectAdapter<VersionMapping, AccessHolder>(getSubjectHolder()) {
- @Override
- protected AccessHolder buildValue_() {
- return this.subject.getPersistentAttribute();
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmXml2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmXml2_0UiDefinition.java
deleted file mode 100644
index c3b0db29e3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/details/orm/OrmXml2_0UiDefinition.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.details.orm;
-
-import java.util.List;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmAttributeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmTypeMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.AbstractOrmXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmBasicMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddableUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEmbeddedMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmEntityUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmIdMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmManyToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmMappedSuperclassUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToManyMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmOneToOneMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmTransientMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmVersionMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.details.orm.OrmXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.GenericOrmXml2_0UiFactory;
-
-public class OrmXml2_0UiDefinition
- extends AbstractOrmXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new OrmXml2_0UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private OrmXml2_0UiDefinition() {
- super();
- }
-
-
- @Override
- protected OrmXmlUiFactory buildOrmXmlUiFactory() {
- return new GenericOrmXml2_0UiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaCorePlugin.ORM_XML_2_0_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return OrmXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- @Override
- protected void addOrmAttributeMappingUiDefinitionsTo(List<OrmAttributeMappingUiDefinition<? extends AttributeMapping>> definitions) {
- definitions.add(OrmIdMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedIdMappingUiDefinition.instance());
- definitions.add(OrmBasicMappingUiDefinition.instance());
- definitions.add(OrmVersionMappingUiDefinition.instance());
- definitions.add(OrmManyToOneMappingUiDefinition.instance());
- definitions.add(OrmOneToManyMappingUiDefinition.instance());
- definitions.add(OrmOneToOneMappingUiDefinition.instance());
- definitions.add(OrmManyToManyMappingUiDefinition.instance());
- definitions.add(OrmEmbeddedMappingUiDefinition.instance());
- definitions.add(OrmTransientMappingUiDefinition.instance());
-
- definitions.add(OrmElementCollectionMapping2_0UiDefinition.instance());
- }
-
- @Override
- protected void addOrmTypeMappingUiDefinitionsTo(List<OrmTypeMappingUiDefinition<? extends TypeMapping>> definitions) {
- definitions.add(OrmEntityUiDefinition.instance());
- definitions.add(OrmMappedSuperclassUiDefinition.instance());
- definitions.add(OrmEmbeddableUiDefinition.instance());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/Generic2_0PersistenceXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/Generic2_0PersistenceXmlUiFactory.java
deleted file mode 100644
index a25815dedb..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/Generic2_0PersistenceXmlUiFactory.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection.GenericPersistenceUnit2_0ConnectionTab;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options.GenericPersistenceUnit2_0OptionsTab;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.GenericPersistenceUnitGeneralComposite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceUnitPropertiesComposite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * The default implementation of the UI factory required to show the information
- * related to a JPA mapping (type or attribute).
- *
- * @see GenericPersistenceXmlUiFactory
- *
- * @version 1.0
- * @since 1.0
- */
-public class Generic2_0PersistenceXmlUiFactory implements PersistenceXmlUiFactory
-{
-
- // **************** persistence unit composites ****************************
- public ListIterator<JpaPageComposite> createPersistenceUnitComposites(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- ArrayList<JpaPageComposite> pages = new ArrayList<JpaPageComposite>(4);
-
- PropertyValueModel<JpaConnection2_0> connection2_0Holder =
- this.buildJpaConnection2_0Holder(subjectHolder);
- PropertyValueModel<JpaOptions2_0> options2_0Holder =
- this.buildJpaOptions2_0Holder(subjectHolder);
-
- pages.add(new GenericPersistenceUnitGeneralComposite(subjectHolder, parent, widgetFactory));
- pages.add(new GenericPersistenceUnit2_0ConnectionTab(connection2_0Holder, parent, widgetFactory));
- pages.add(new GenericPersistenceUnit2_0OptionsTab(options2_0Holder, parent, widgetFactory));
- pages.add(new PersistenceUnitPropertiesComposite(subjectHolder, parent, widgetFactory));
-
- return pages.listIterator();
- }
-
- // ********** private methods **********
-
- private PropertyValueModel<JpaConnection2_0> buildJpaConnection2_0Holder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, JpaConnection2_0>(subjectHolder) {
- @Override
- protected JpaConnection2_0 transform_(PersistenceUnit value) {
- return (JpaConnection2_0) ((PersistenceUnit2_0) value).getConnection();
- }
- };
- }
-
- private PropertyValueModel<JpaOptions2_0> buildJpaOptions2_0Holder(
- PropertyValueModel<PersistenceUnit> subjectHolder) {
- return new TransformationPropertyValueModel<PersistenceUnit, JpaOptions2_0>(subjectHolder) {
- @Override
- protected JpaOptions2_0 transform_(PersistenceUnit value) {
- return (JpaOptions2_0) ((PersistenceUnit2_0) value).getOptions();
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/JptUiPersistence2_0Messages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/JptUiPersistence2_0Messages.java
deleted file mode 100644
index 634139d2bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/JptUiPersistence2_0Messages.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * JptUiPersistence2_0Messages
- */
-public class JptUiPersistence2_0Messages
-{
- // Connection
- public static String ConnectionPropertiesComposite_Database_GroupBox;
-
- public static String DataSourcePropertiesComposite_jtaDataSourceLabel;
- public static String DataSourcePropertiesComposite_nonJtaDataSourceLabel;
-
- public static String GenericPersistenceUnit2_0ConnectionComposite_sectionTitle;
- public static String GenericPersistenceUnit2_0ConnectionComposite_sectionDescription;
- public static String GenericPersistenceUnit2_0ConnectionTab_title;
-
- public static String GenericPersistenceUnit2_0OptionsComposite_miscellaneousSectionTitle;
- public static String GenericPersistenceUnit2_0OptionsComposite_miscellaneousSectionDescription;
- public static String GenericPersistenceUnit2_0OptionsTab_title;
- public static String GenericPersistenceUnit2_0OptionsTab_noName;
-
- public static String JdbcConnectionPropertiesComposite_ConnectionDialog_Message;
- public static String JdbcConnectionPropertiesComposite_ConnectionDialog_Title;
-
- public static String JdbcConnectionPropertiesComposite_populateFromConnectionHyperLink;
- public static String JdbcConnectionPropertiesComposite_driverLabel;
- public static String JdbcConnectionPropertiesComposite_urlLabel;
- public static String JdbcConnectionPropertiesComposite_userLabel;
- public static String JdbcConnectionPropertiesComposite_passwordLabel;
-
- public static String JdbcPropertiesComposite_JdbcConnectionProperties_GroupBox;
-
- public static String LockingConfigurationComposite_lockTimeoutLabel;
- public static String QueryConfigurationComposite_queryTimeoutLabel;
-
- public static String TransactionTypeComposite_transactionTypeLabel;
-
- public static String TransactionTypeComposite_jta;
- public static String TransactionTypeComposite_resource_local;
-
- public static String SharedCacheModeComposite_sharedCacheModeLabel;
-
- public static String SharedCacheModeComposite_all;
- public static String SharedCacheModeComposite_none;
- public static String SharedCacheModeComposite_enable_selective;
- public static String SharedCacheModeComposite_disable_selective;
- public static String SharedCacheModeComposite_unspecified;
-
- public static String ValidationModeComposite_validationModeLabel;
-
- public static String ValidationModeComposite_auto;
- public static String ValidationModeComposite_callback;
- public static String ValidationModeComposite_none;
-
- public static String ValidationConfigurationComposite_groupPrePersistLabel;
- public static String ValidationConfigurationComposite_groupPreUpdateLabel;
- public static String ValidationConfigurationComposite_groupPreRemoveLabel;
-
-
- private static final String BUNDLE_NAME = "jpt_ui_persistence2_0"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptUiPersistence2_0Messages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptUiPersistence2_0Messages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceXml2_0UiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceXml2_0UiDefinition.java
deleted file mode 100644
index d40763d589..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/PersistenceXml2_0UiDefinition.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.AbstractPersistenceXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.persistence.details.PersistenceXmlUiFactory;
-
-public class PersistenceXml2_0UiDefinition
- extends AbstractPersistenceXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new PersistenceXml2_0UiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private PersistenceXml2_0UiDefinition() {
- super();
- }
-
-
- @Override
- protected PersistenceXmlUiFactory buildPersistenceXmlUiFactory() {
- return new Generic2_0PersistenceXmlUiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaCorePlugin.PERSISTENCE_XML_2_0_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return PersistenceXmlUiDefinition.STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/ConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/ConnectionPropertiesComposite.java
deleted file mode 100644
index 4e37630532..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/ConnectionPropertiesComposite.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ConnectionPropertiesComposite
- */
-public class ConnectionPropertiesComposite extends Pane<JpaConnection2_0>
-{
- public ConnectionPropertiesComposite(Pane<JpaConnection2_0> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = addTitledGroup(
- container,
- JptUiPersistence2_0Messages.ConnectionPropertiesComposite_Database_GroupBox
- );
-
- new DataSourcePropertiesComposite(this, container);
- new JdbcPropertiesComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/DataSourcePropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/DataSourcePropertiesComposite.java
deleted file mode 100644
index 7f1e38433a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/DataSourcePropertiesComposite.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * DataSourcePropertiesComposite
- */
-public class DataSourcePropertiesComposite extends Pane<JpaConnection2_0>
-{
- /**
- * Creates a new <code>DataSourcePropertiesComposite</code>.
- *
- * @param parentPane The parent container of this one
- * @param parent The parent container
- */
- public DataSourcePropertiesComposite(Pane<JpaConnection2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private ModifiablePropertyValueModel<String> buildJtaDataSourceHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(this.buildPersistenceUnitHolder(), PersistenceUnit.JTA_DATA_SOURCE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getJtaDataSource();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setJtaDataSource(value);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildJTADataSourceHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return Boolean.valueOf(this.transform2(value));
- }
- private boolean transform2(PersistenceUnitTransactionType value) {
- return value == null || value == PersistenceUnitTransactionType.JTA;
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildNonJtaDataSourceHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(buildPersistenceUnitHolder(), PersistenceUnit.NON_JTA_DATA_SOURCE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getNonJtaDataSource();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setNonJtaDataSource(value);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildNonJTADataSourceHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return Boolean.valueOf(value == PersistenceUnitTransactionType.RESOURCE_LOCAL);
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitTransactionType> buildTransactionTypeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, PersistenceUnitTransactionType>(
- buildPersistenceUnitHolder(),
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY,
- PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY) {
- @Override
- protected PersistenceUnitTransactionType buildValue_() {
- return this.subject.getTransactionType();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<JpaConnection2_0, PersistenceUnit>(getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = this.getGroupBoxMargin();
-
- container = this.addSubPane(container, 0, groupBoxMargin, 0, groupBoxMargin);
-
- // JTA Data Source
- PropertyValueModel<Boolean> jtaEnabled = this.buildJTADataSourceHolder();
- Label jtaLabel = this.addLabel(container, JptUiPersistence2_0Messages.DataSourcePropertiesComposite_jtaDataSourceLabel, jtaEnabled);
- Text jtaText = this.addText(container, this.buildJtaDataSourceHolder(), this.getHelpID(), jtaEnabled);
- this.addLabeledComposite(container, jtaLabel, jtaText, this.getHelpID());
-
- // Non-JTA Data Source
- PropertyValueModel<Boolean> nonJTAEnabled = this.buildNonJTADataSourceHolder();
- Label nonJtaLabel = this.addLabel(container, JptUiPersistence2_0Messages.DataSourcePropertiesComposite_nonJtaDataSourceLabel, nonJTAEnabled);
- Text nonJtaText = this.addText(container, this.buildNonJtaDataSourceHolder(), this.getHelpID(), nonJTAEnabled);
- this.addLabeledComposite(container, nonJtaLabel, nonJtaText, this.getHelpID());
- }
-
- public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION; // TODO - Review for JPA 2.0
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/GenericPersistenceUnit2_0ConnectionComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/GenericPersistenceUnit2_0ConnectionComposite.java
deleted file mode 100644
index 52ee14de9d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/GenericPersistenceUnit2_0ConnectionComposite.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * GenericPersistenceUnit2_0ConnectionComposite
- */
-public class GenericPersistenceUnit2_0ConnectionComposite extends Pane<JpaConnection2_0>
-{
- public GenericPersistenceUnit2_0ConnectionComposite(
- Pane<JpaConnection2_0> subjectHolder,
- Composite container) {
- super(subjectHolder, container, false);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- int groupBoxMargin = this.getGroupBoxMargin() * 2;
-
- container = this.addSection(
- container,
- JptUiPersistence2_0Messages.GenericPersistenceUnit2_0ConnectionComposite_sectionTitle,
- JptUiPersistence2_0Messages.GenericPersistenceUnit2_0ConnectionComposite_sectionDescription
- );
-
- Composite subPane = this.addSubPane(
- container,
- 0, groupBoxMargin, 10, groupBoxMargin
- );
-
- new TransactionTypeComposite(this, subPane);
-
- new ConnectionPropertiesComposite(this, container);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/GenericPersistenceUnit2_0ConnectionTab.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/GenericPersistenceUnit2_0ConnectionTab.java
deleted file mode 100644
index a90d91c496..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/GenericPersistenceUnit2_0ConnectionTab.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * GenericPersistenceUnit2_0ConnectionTab
- */
-public class GenericPersistenceUnit2_0ConnectionTab extends Pane<JpaConnection2_0>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- /**
- * Creates a new <code>GenericPersistenceUnit2_0ConnectionTab</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public GenericPersistenceUnit2_0ConnectionTab(
- PropertyValueModel<JpaConnection2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- new GenericPersistenceUnit2_0ConnectionComposite(this, container);
- }
-
- // ********** Layout **********
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
- Composite container = this.addPane(parent, layout);
- updateGridData(container);
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION; // TODO - Review for JPA 2.0
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return JptUiPersistence2_0Messages.GenericPersistenceUnit2_0ConnectionTab_title;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcConnectionPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcConnectionPropertiesComposite.java
deleted file mode 100644
index eadafc75d0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcConnectionPropertiesComposite.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;
-
-import java.util.Comparator;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.ConnectionProfileFactory;
-import org.eclipse.jpt.jpa.db.JptJpaDbPlugin;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.FilteredItemsSelectionDialog;
-
-/**
- * JdbcConnectionPropertiesComposite
- */
-@SuppressWarnings("nls")
-public class JdbcConnectionPropertiesComposite extends Pane<JpaConnection2_0>
-{
- /**
- * The constant ID used to retrieve the dialog settings.
- */
- private static final String DIALOG_SETTINGS = "org.eclipse.jpt.jpa.ui.internal.jpa2.dialogs.ConnectionDialog";
-
- public JdbcConnectionPropertiesComposite(Pane<JpaConnection2_0> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private ModifiablePropertyValueModel<String> buildPasswordHolder() {
- return new PropertyAspectAdapter<JpaConnection2_0, String>(this.getSubjectHolder(), JpaConnection2_0.PASSWORD_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getPassword();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setPassword(value);
- }
- };
- }
-
- private Runnable buildPopulateFromConnectionAction() {
- return new Runnable() {
- public void run() {
- promptConnection();
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildUrlHolder() {
- return new PropertyAspectAdapter<JpaConnection2_0, String>(this.getSubjectHolder(), JpaConnection2_0.URL_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getUrl();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setUrl(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildUserHolder() {
- return new PropertyAspectAdapter<JpaConnection2_0, String>(this.getSubjectHolder(), JpaConnection2_0.USER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getUser();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setUser(value);
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- // Populate from Connection hyperlink
- this.addHyperlink(
- container,
- JptUiPersistence2_0Messages.JdbcConnectionPropertiesComposite_populateFromConnectionHyperLink,
- this.buildPopulateFromConnectionAction()
- );
-
- // Driver
- new JdbcDriverComposite(this, container);
-
- // Url
- this.addLabeledText(
- container,
- JptUiPersistence2_0Messages.JdbcConnectionPropertiesComposite_urlLabel,
- this.buildUrlHolder()
- );
-
- // User
- this.addLabeledText(
- container,
- JptUiPersistence2_0Messages.JdbcConnectionPropertiesComposite_userLabel,
- this.buildUserHolder()
- );
-
- // Password
- this.addLabeledPasswordText(
- container,
- JptUiPersistence2_0Messages.JdbcConnectionPropertiesComposite_passwordLabel,
- this.buildPasswordHolder()
- );
- }
-
- void promptConnection() {
-
- ConnectionSelectionDialog dialog = new ConnectionSelectionDialog();
-
- if (dialog.open() != IDialogConstants.OK_ID) {
- return;
- }
-
- String name = (String) dialog.getResult()[0];
- ConnectionProfile cp = this.getConnectionProfileFactory().buildConnectionProfile(name);
-
- JpaConnection2_0 connection = getSubject();
- connection.setUrl((cp == null) ? "" : cp.getURL());
- connection.setUser((cp == null) ? "" : cp.getUserName());
- connection.setPassword((cp == null) ? "" : cp.getUserPassword());
- connection.setDriver((cp == null) ? "" : cp.getDriverClassName());
- }
-
- ConnectionProfileFactory getConnectionProfileFactory() {
- // we allow the user to select any connection profile and simply
- // take the settings from it (user, password, etc.) and give them
- // to the persistence connection, so we go
- // to the db plug-in directly to get the factory
- return JptJpaDbPlugin.getConnectionProfileFactory();
- }
-
- // broaden access a bit
- Shell getShell_() {
- return this.getShell();
- }
-
- /**
- * This dialog shows the list of possible connection names and lets the user
- * the option to filter them using a search field.
- */
- protected class ConnectionSelectionDialog extends FilteredItemsSelectionDialog {
-
- /**
- * Creates a new <code>MappingSelectionDialog</code>.
- */
- protected ConnectionSelectionDialog() {
- super(JdbcConnectionPropertiesComposite.this.getShell_(), false);
- this.setMessage(JptUiPersistence2_0Messages.JdbcConnectionPropertiesComposite_ConnectionDialog_Message);
- this.setTitle(JptUiPersistence2_0Messages.JdbcConnectionPropertiesComposite_ConnectionDialog_Title);
- this.setListLabelProvider(this.buildLabelProvider());
- this.setDetailsLabelProvider(this.buildLabelProvider());
- }
-
- protected ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public Image getImage(Object element) {
- return null;
- }
-
- @Override
- public String getText(Object element) {
- return (element == null) ? "" : element.toString();
- }
- };
- }
-
- @Override
- protected Control createExtendedContentArea(Composite parent) {
- return null;
- }
-
- @Override
- protected ItemsFilter createFilter() {
- return new ConnectionItemsFilter();
- }
-
- @Override
- protected void fillContentProvider(AbstractContentProvider provider,
- ItemsFilter itemsFilter,
- IProgressMonitor monitor) throws CoreException {
-
- monitor.beginTask(null, -1);
-
- try {
- // Add the connection names to the dialog
- for (String name : this.getConnectionProfileNames()) {
- provider.add(name, itemsFilter);
- }
- }
- finally {
- monitor.done();
- }
- }
-
- private Iterable<String> getConnectionProfileNames() {
- return JdbcConnectionPropertiesComposite.this.getConnectionProfileFactory().getConnectionProfileNames();
- }
-
- @Override
- protected IDialogSettings getDialogSettings() {
-
- IDialogSettings dialogSettings = JptJpaUiPlugin.instance().getDialogSettings();
- IDialogSettings settings = dialogSettings.getSection(DIALOG_SETTINGS);
-
- if (settings == null) {
- settings = dialogSettings.addNewSection(DIALOG_SETTINGS);
- }
- return settings;
- }
-
- @Override
- public String getElementName(Object object) {
- return object.toString();
- }
-
- @Override
- protected Comparator<String> getItemsComparator() {
- return new Comparator<String>() {
- public int compare(String item1, String item2) {
- return item1.compareTo(item2);
- }
- };
- }
-
- @Override
- protected IStatus validateItem(Object item) {
-
- if (item == null) {
- return new Status(IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID, IStatus.ERROR, "", null);
- }
- return Status.OK_STATUS;
- }
-
- /**
- * Create the filter responsible to remove any connection name based on
- * the pattern entered in the text field.
- */
- private class ConnectionItemsFilter extends ItemsFilter {
-
- /**
- * Creates a new <code>ConnectionItemsFilter</code>.
- */
- ConnectionItemsFilter() {
-
- super();
-
- // Make sure that if the pattern is empty, we specify * in order
- // to show all the mapping types
- if (StringTools.stringIsEmpty(getPattern())) {
- patternMatcher.setPattern("*");
- }
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public boolean isConsistentItem(Object item) {
- return true;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- public boolean matchItem(Object item) {
- return matches(item.toString());
- }
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcDriverComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcDriverComposite.java
deleted file mode 100644
index 6297c73ed0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcDriverComposite.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jpt.common.ui.internal.widgets.ClassChooserPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcDriverComposite
- */
-public class JdbcDriverComposite extends Pane<JpaConnection2_0>
-{
- /**
- * Creates a new <code>JdbcDriverComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public JdbcDriverComposite(Pane<? extends JpaConnection2_0> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private ClassChooserPane<JpaConnection2_0> initializeClassChooser(Composite container) {
-
- return new ClassChooserPane<JpaConnection2_0>(this, container) {
-
- @Override
- protected ModifiablePropertyValueModel<String> buildTextHolder() {
- return new PropertyAspectAdapter<JpaConnection2_0, String>(
- this.getSubjectHolder(), JpaConnection2_0.DRIVER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return this.subject.getDriver();
- }
-
- @Override
- protected void setValue_(String value) {
-
- if (value.length() == 0) {
- value = null;
- }
- this.subject.setDriver(value);
- }
- };
- }
-
- @Override
- protected String getClassName() {
- return this.getSubject().getDriver();
- }
-
- @Override
- protected String getLabelText() {
- return JptUiPersistence2_0Messages.JdbcConnectionPropertiesComposite_driverLabel;
- }
-
- @Override
- protected IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-
- @Override
- protected void setClassName(String className) {
- this.getSubject().setDriver(className);
- }
-
- @Override
- protected boolean allowTypeCreation() {
- //Does not make sense to allow the user to create a new Driver class
- return false;
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- this.initializeClassChooser(container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcPropertiesComposite.java
deleted file mode 100644
index 2ab54d50b5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/JdbcPropertiesComposite.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;
-
-import org.eclipse.jpt.common.ui.internal.util.PaneEnabler;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * JdbcPropertiesComposite
- */
-public class JdbcPropertiesComposite extends Pane<JpaConnection2_0>
-{
- public JdbcPropertiesComposite(Pane<JpaConnection2_0> parentComposite, Composite parent) {
-
- super(parentComposite, parent);
- }
-
- private PropertyValueModel<Boolean> buildPaneEnablerHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform(PersistenceUnitTransactionType value) {
- return value == PersistenceUnitTransactionType.RESOURCE_LOCAL;
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitTransactionType> buildTransactionTypeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, PersistenceUnitTransactionType>(
- buildPersistenceUnitHolder(),
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY,
- PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY) {
- @Override
- protected PersistenceUnitTransactionType buildValue_() {
- return this.subject.getTransactionType();
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<JpaConnection2_0, PersistenceUnit>(getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- container = addTitledGroup(
- addSubPane(container, 10),
- JptUiPersistence2_0Messages.JdbcPropertiesComposite_JdbcConnectionProperties_GroupBox
- );
-
- new JdbcConnectionPropertiesComposite(this, container);
-
- this.installPaneEnabler();
- }
-
- private void installPaneEnabler() {
- new PaneEnabler(buildPaneEnablerHolder(), this);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/TransactionTypeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/TransactionTypeComposite.java
deleted file mode 100644
index 0a9b15b267..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/connection/TransactionTypeComposite.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.connection;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * TransactionTypeComposite
- */
-public class TransactionTypeComposite extends Pane<JpaConnection2_0>
-{
- /**
- * Creates a new <code>TransactionTypeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public TransactionTypeComposite(
- Pane<? extends JpaConnection2_0> parentComposite,
- Composite parent) {
-
- super( parentComposite, parent);
- }
-
- private EnumFormComboViewer<PersistenceUnit, PersistenceUnitTransactionType> buildTransactionTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<PersistenceUnit, PersistenceUnitTransactionType>(this,
- this.buildPersistenceUnitHolder(),
- container) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY);
- propertyNames.add(PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY);
- }
-
- @Override
- protected PersistenceUnitTransactionType[] getChoices() {
- return PersistenceUnitTransactionType.values();
- }
-
- @Override
- protected PersistenceUnitTransactionType getDefaultValue() {
- return this.getSubject().getDefaultTransactionType();
- }
-
- @Override
- protected String displayString(PersistenceUnitTransactionType value) {
- switch (value) {
- case JTA :
- return JptUiPersistence2_0Messages.TransactionTypeComposite_jta;
- case RESOURCE_LOCAL :
- return JptUiPersistence2_0Messages.TransactionTypeComposite_resource_local;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected PersistenceUnitTransactionType getValue() {
- return this.getSubject().getSpecifiedTransactionType();
- }
-
- @Override
- protected void setValue(PersistenceUnitTransactionType value) {
- this.getSubject().setSpecifiedTransactionType(value);
-
- if (value == PersistenceUnitTransactionType.RESOURCE_LOCAL) {
- clearJTAProperties();
- }
- else {
- clearResourceLocalProperties();
- }
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnit> buildPersistenceUnitHolder() {
- return new PropertyAspectAdapter<JpaConnection2_0, PersistenceUnit>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit buildValue_() {
- return this.subject.getPersistenceUnit();
- }
- };
- }
-
- private void clearJTAProperties() {
- this.getSubject().getPersistenceUnit().setJtaDataSource(null);
- }
-
- private void clearResourceLocalProperties() {
- JpaConnection2_0 connection = this.getSubject();
- connection.getPersistenceUnit().setNonJtaDataSource(null);
- connection.setDriver(null);
- connection.setUrl(null);
- connection.setUser(null);
- connection.setPassword(null);
- }
-
- @Override
- protected void initializeLayout( Composite container) {
-
- this.addLabeledComposite(
- container,
- JptUiPersistence2_0Messages.TransactionTypeComposite_transactionTypeLabel,
- this.buildTransactionTypeCombo( container),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION // TODO - Review for JPA 2.0
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/GenericPersistenceUnit2_0OptionsComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/GenericPersistenceUnit2_0OptionsComposite.java
deleted file mode 100644
index dc2b64a91d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/GenericPersistenceUnit2_0OptionsComposite.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * GenericPersistenceUnit2_0OptionsComposite
- */
-public class GenericPersistenceUnit2_0OptionsComposite extends Pane<JpaOptions2_0>
-{
- public GenericPersistenceUnit2_0OptionsComposite(
- Pane<JpaOptions2_0> subjectHolder,
- Composite parent) {
-
- super(subjectHolder, parent, false);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.initializeMiscellaneousPane(parent);
- }
-
- private void initializeMiscellaneousPane(Composite container) {
-
- this.updateGridData(container);
- this.updateGridData(container.getParent());
-
- Composite composite = this.addSection(container,
- JptUiPersistence2_0Messages.GenericPersistenceUnit2_0OptionsComposite_miscellaneousSectionTitle,
- JptUiPersistence2_0Messages.GenericPersistenceUnit2_0OptionsComposite_miscellaneousSectionDescription);
-
- this.updateGridData(composite);
- this.updateGridData(composite.getParent());
-
- new LockingConfigurationComposite(this, composite);
- new QueryConfigurationComposite(this, composite);
- new ValidationConfigurationComposite(this, composite);
-
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/GenericPersistenceUnit2_0OptionsTab.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/GenericPersistenceUnit2_0OptionsTab.java
deleted file mode 100644
index 955837017c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/GenericPersistenceUnit2_0OptionsTab.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * GenericPersistenceUnit2_0OptionsTab
- */
-public class GenericPersistenceUnit2_0OptionsTab extends Pane<JpaOptions2_0>
- implements JpaPageComposite
-{
- // ********** constructors/initialization **********
- /**
- * Creates a new <code>GenericPersistenceUnit2_0OptionsTab</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public GenericPersistenceUnit2_0OptionsTab(
- PropertyValueModel<JpaOptions2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, parent, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- new GenericPersistenceUnit2_0OptionsComposite(this, parent);
-
- }
-
- // ********** Layout **********
- @Override
- protected Composite addContainer(Composite parent) {
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
- Composite container = this.addPane(parent, layout);
- updateGridData(container);
- return container;
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-
- // ********** JpaPageComposite implementation **********
-
- public String getHelpID() {
- return null; // TODO - Review for JPA 2.0
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return JptUiPersistence2_0Messages.GenericPersistenceUnit2_0OptionsTab_title;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/LockingConfigurationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/LockingConfigurationComposite.java
deleted file mode 100644
index 80007d4cf7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/LockingConfigurationComposite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * LockingConfigurationComposite
- */
-public class LockingConfigurationComposite extends Pane<JpaOptions2_0>
-{
- /**
- * Creates a new <code>LockingConfigurationComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public LockingConfigurationComposite(
- Pane<? extends JpaOptions2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.addLockTimeoutCombo(parent);
- }
-
- private void addLockTimeoutCombo(Composite parent) {
- new IntegerCombo<JpaOptions2_0>(this, parent) {
-
- @Override
- protected String getLabelText() {
- return JptUiPersistence2_0Messages.LockingConfigurationComposite_lockTimeoutLabel;
- }
-
- @Override
- protected String getHelpId() {
- return null; // TODO
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<JpaOptions2_0, Integer>(this.getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultLockTimeout();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<JpaOptions2_0, Integer>(this.getSubjectHolder(), JpaOptions2_0.LOCK_TIMEOUT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getLockTimeout();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setLockTimeout(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/QueryConfigurationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/QueryConfigurationComposite.java
deleted file mode 100644
index 35cbe35395..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/QueryConfigurationComposite.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;
-
-import org.eclipse.jpt.common.ui.internal.widgets.IntegerCombo;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * QueryConfigurationComposite
- */
-public class QueryConfigurationComposite extends Pane<JpaOptions2_0>
-{
- /**
- * Creates a new <code>QueryConfigurationComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public QueryConfigurationComposite(
- Pane<? extends JpaOptions2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
- this.addQueryTimeoutCombo(parent);
- }
-
- private void addQueryTimeoutCombo(Composite parent) {
- new IntegerCombo<JpaOptions2_0>(this, parent) {
-
- @Override
- protected String getLabelText() {
- return JptUiPersistence2_0Messages.QueryConfigurationComposite_queryTimeoutLabel;
- }
-
- @Override
- protected String getHelpId() {
- return null; // TODO
- }
-
- @Override
- protected PropertyValueModel<Integer> buildDefaultHolder() {
- return new PropertyAspectAdapter<JpaOptions2_0, Integer>(this.getSubjectHolder()) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getDefaultQueryTimeout();
- }
- };
- }
-
- @Override
- protected ModifiablePropertyValueModel<Integer> buildSelectedItemHolder() {
- return new PropertyAspectAdapter<JpaOptions2_0, Integer>(this.getSubjectHolder(), JpaOptions2_0.QUERY_TIMEOUT_PROPERTY) {
- @Override
- protected Integer buildValue_() {
- return this.subject.getQueryTimeout();
- }
-
- @Override
- protected void setValue_(Integer value) {
- this.subject.setQueryTimeout(value);
- }
- };
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/SharedCacheModeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/SharedCacheModeComposite.java
deleted file mode 100644
index 23a2314cf8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/SharedCacheModeComposite.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * SharedCacheModeComposite
- */
-public class SharedCacheModeComposite extends Pane<PersistenceUnit2_0>
-{
- /**
- * Creates a new <code>SharedCacheModeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public SharedCacheModeComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends PersistenceUnit2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- this.addLabeledComposite(
- parent,
- JptUiPersistence2_0Messages.SharedCacheModeComposite_sharedCacheModeLabel,
- this.addSharedCacheModeCombo(parent),
- null // TODO
- );
- }
-
- private EnumFormComboViewer<PersistenceUnit2_0, SharedCacheMode> addSharedCacheModeCombo(Composite parent) {
-
- return new EnumFormComboViewer<PersistenceUnit2_0, SharedCacheMode>(this, this.getSubjectHolder(), parent) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnit2_0.SPECIFIED_SHARED_CACHE_MODE_PROPERTY);
- }
-
- @Override
- protected SharedCacheMode[] getChoices() {
- return SharedCacheMode.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected SharedCacheMode getDefaultValue() {
- return this.getSubject().getDefaultSharedCacheMode();
- }
-
- @Override
- protected String displayString(SharedCacheMode value) {
- switch (value) {
- case ALL :
- return JptUiPersistence2_0Messages.SharedCacheModeComposite_all;
- case DISABLE_SELECTIVE :
- return JptUiPersistence2_0Messages.SharedCacheModeComposite_disable_selective;
- case ENABLE_SELECTIVE :
- return JptUiPersistence2_0Messages.SharedCacheModeComposite_enable_selective;
- case NONE :
- return JptUiPersistence2_0Messages.SharedCacheModeComposite_none;
- case UNSPECIFIED :
- return JptUiPersistence2_0Messages.SharedCacheModeComposite_unspecified;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected SharedCacheMode getValue() {
- return this.getSubject().getSpecifiedSharedCacheMode();
- }
-
- @Override
- protected void setValue(SharedCacheMode value) {
- this.getSubject().setSpecifiedSharedCacheMode(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/ValidationConfigurationComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/ValidationConfigurationComposite.java
deleted file mode 100644
index 34f198a778..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/ValidationConfigurationComposite.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * ValidationConfigurationComposite
- */
-public class ValidationConfigurationComposite extends Pane<JpaOptions2_0>
-{
- /**
- * Creates a new <code>ValidationGroupComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidationConfigurationComposite(
- Pane<? extends JpaOptions2_0> parentComposite,
- Composite parent) {
-
- super(parentComposite, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- // SharedCacheMode
- new SharedCacheModeComposite(this, this.buildPersistenceUnit2_0Holder(), parent);
-
- // ValidationMode
- new ValidationModeComposite(this, this.buildPersistenceUnit2_0Holder(), parent);
-
- // ValidationGroupPrePersist
- this.addGroupPrePersistListPane(parent);
-
- // ValidationGroupPreUpdate
- this.addGroupPreUpdateListPane(parent);
-
- // ValidationGroupPreRemove
- this.addGroupPreRemoveListPane(parent);
- }
-
- // ********** ValidationGroupPrePersists **********
-
- private void addGroupPrePersistListPane(Composite parent) {
-
- this.addLabeledComposite(parent,
- JptUiPersistence2_0Messages.ValidationConfigurationComposite_groupPrePersistLabel,
- this.addPrePersistListPane(parent),
- null // TODO Help
- );
- }
-
- private AddRemoveListPane<JpaOptions2_0> addPrePersistListPane(Composite parent) {
-
- // List pane
- AddRemoveListPane<JpaOptions2_0> listPane = new AddRemoveListPane<JpaOptions2_0>(
- this,
- parent,
- this.buildPrePersistAdapter(),
- this.buildPrePersistListHolder(),
- this.buildSelectedItemHolder(),
- this.buildLabelProvider()
- )
- {
- @Override
- protected void initializeTable(Table table) {
- super.initializeTable(table);
-
- Composite container = table.getParent();
- GridData gridData = (GridData) container.getLayoutData();
- gridData.heightHint = 75;
- }
- };
- return listPane;
- }
-
- private Adapter buildPrePersistAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPrePersistClass(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeValidationGroupPrePersist((String) item);
- }
- }
- };
- }
-
- private ListValueModel<String> buildPrePersistListHolder() {
- return new ListAspectAdapter<JpaOptions2_0, String>(getSubjectHolder(), JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_LIST) {
- @Override
- protected ListIterable<String> getListIterable() {
- return subject.getValidationGroupPrePersists();
- }
-
- @Override
- protected int size_() {
- return subject.getValidationGroupPrePersistsSize();
- }
- };
- }
-
- private void addPrePersistClass(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName('$');
- if( ! this.getSubject().validationGroupPrePersistExists(className)) {
-
- String classRef = this.getSubject().addValidationGroupPrePersist(className);
- listSelectionModel.setSelectedValue(classRef);
- }
- }
- }
-
- // ********** ValidationGroupPreUpdates **********
-
- private void addGroupPreUpdateListPane(Composite parent) {
-
- this.addLabeledComposite(parent,
- JptUiPersistence2_0Messages.ValidationConfigurationComposite_groupPreUpdateLabel,
- this.addPreUpdateListPane(parent),
- null // TODO Help
- );
- }
-
- private AddRemoveListPane<JpaOptions2_0> addPreUpdateListPane(Composite parent) {
-
- // List pane
- AddRemoveListPane<JpaOptions2_0> listPane = new AddRemoveListPane<JpaOptions2_0>(
- this,
- parent,
- this.buildPreUpdateAdapter(),
- this.buildPreUpdateListHolder(),
- this.buildSelectedItemHolder(),
- this.buildLabelProvider()
- )
- {
- @Override
- protected void initializeTable(Table table) {
- super.initializeTable(table);
-
- Composite container = table.getParent();
- GridData gridData = (GridData) container.getLayoutData();
- gridData.heightHint = 75;
- }
- };
- return listPane;
- }
-
- private Adapter buildPreUpdateAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPreUpdateClass(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeValidationGroupPreUpdate((String) item);
- }
- }
- };
- }
-
- private ListValueModel<String> buildPreUpdateListHolder() {
- return new ListAspectAdapter<JpaOptions2_0, String>(getSubjectHolder(), JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_LIST) {
- @Override
- protected ListIterable<String> getListIterable() {
- return subject.getValidationGroupPreUpdates();
- }
-
- @Override
- protected int size_() {
- return subject.getValidationGroupPreUpdatesSize();
- }
- };
- }
-
- private void addPreUpdateClass(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName('$');
- if( ! this.getSubject().validationGroupPreUpdateExists(className)) {
-
- String classRef = this.getSubject().addValidationGroupPreUpdate(className);
- listSelectionModel.setSelectedValue(classRef);
- }
- }
- }
-
- // ********** ValidationGroupPreRemoves **********
-
- private void addGroupPreRemoveListPane(Composite parent) {
-
- this.addLabeledComposite(parent,
- JptUiPersistence2_0Messages.ValidationConfigurationComposite_groupPreRemoveLabel,
- this.addPreRemoveListPane(parent),
- null // TODO Help
- );
- }
-
- private AddRemoveListPane<JpaOptions2_0> addPreRemoveListPane(Composite parent) {
-
- // List pane
- AddRemoveListPane<JpaOptions2_0> listPane = new AddRemoveListPane<JpaOptions2_0>(
- this,
- parent,
- this.buildPreRemoveAdapter(),
- this.buildPreRemoveListHolder(),
- this.buildSelectedItemHolder(),
- this.buildLabelProvider()
- )
- {
- @Override
- protected void initializeTable(Table table) {
- super.initializeTable(table);
-
- Composite container = table.getParent();
- GridData gridData = (GridData) container.getLayoutData();
- gridData.heightHint = 75;
- }
- };
- return listPane;
- }
-
- private Adapter buildPreRemoveAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addPreRemoveClass(listSelectionModel);
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeValidationGroupPreRemove((String) item);
- }
- }
- };
- }
-
- private ListValueModel<String> buildPreRemoveListHolder() {
- return new ListAspectAdapter<JpaOptions2_0, String>(getSubjectHolder(), JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_LIST) {
- @Override
- protected ListIterable<String> getListIterable() {
- return subject.getValidationGroupPreRemoves();
- }
-
- @Override
- protected int size_() {
- return subject.getValidationGroupPreRemovesSize();
- }
- };
- }
-
- private void addPreRemoveClass(ObjectListSelectionModel listSelectionModel) {
-
- IType type = this.chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName('$');
- if( ! this.getSubject().validationGroupPreRemoveExists(className)) {
-
- String classRef = this.getSubject().addValidationGroupPreRemove(className);
- listSelectionModel.setSelectedValue(classRef);
- }
- }
- }
-
-
- // ********** Private methods **********
-
- private PropertyValueModel<PersistenceUnit2_0> buildPersistenceUnit2_0Holder() {
- return new PropertyAspectAdapter<JpaOptions2_0, PersistenceUnit2_0>(this.getSubjectHolder()) {
- @Override
- protected PersistenceUnit2_0 buildValue_() {
- return (PersistenceUnit2_0) this.subject.getPersistenceUnit();
- }
- };
- }
-
- private ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
-
- @Override
- public String getText(Object element) {
- String name = (String) element;
-
- if (name == null) {
- name = JptUiPersistence2_0Messages.GenericPersistenceUnit2_0OptionsTab_noName;
- }
- return name;
- }
- };
- }
-
- /**
- * Prompts the user the Open Type dialog.
- *
- * @return Either the selected type or <code>null</code> if the user
- * canceled the dialog
- */
- private IType chooseType() {
- IJavaProject javaProject = this.getSubject().getJpaProject().getJavaProject();
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- ""
- );
- }
- catch (JavaModelException e) {
- JptJpaUiPlugin.log(e);
- return null;
- }
-
- typeSelectionDialog.setTitle(JptCommonUiMessages.ClassChooserPane_dialogTitle);
- typeSelectionDialog.setMessage(JptCommonUiMessages.ClassChooserPane_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
-
- return null;
- }
-
- private ModifiablePropertyValueModel<String> buildSelectedItemHolder() {
- return new SimplePropertyValueModel<String>();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/ValidationModeComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/ValidationModeComposite.java
deleted file mode 100644
index 3215d4448e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/persistence/options/ValidationModeComposite.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.options;
-
-import java.util.Collection;
-
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.ValidationMode;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.persistence.JptUiPersistence2_0Messages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * ValidationModeComposite
- */
-public class ValidationModeComposite extends Pane<PersistenceUnit2_0>
-{
- /**
- * Creates a new <code>ValidationModeComposite</code>.
- *
- * @param parentController
- * The parent container of this one
- * @param parent
- * The parent container
- */
- public ValidationModeComposite(
- Pane<?> parentPane,
- PropertyValueModel<? extends PersistenceUnit2_0> subjectHolder,
- Composite parent) {
-
- super(parentPane, subjectHolder, parent);
- }
-
- @Override
- protected void initializeLayout(Composite parent) {
-
- this.addLabeledComposite(
- parent,
- JptUiPersistence2_0Messages.ValidationModeComposite_validationModeLabel,
- this.addValidationModeCombo(parent),
- null // TODO
- );
- }
-
- private EnumFormComboViewer<PersistenceUnit2_0, ValidationMode> addValidationModeCombo(Composite parent) {
-
- return new EnumFormComboViewer<PersistenceUnit2_0, ValidationMode>(this, this.getSubjectHolder(), parent) {
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnit2_0.SPECIFIED_VALIDATION_MODE_PROPERTY);
- }
-
- @Override
- protected ValidationMode[] getChoices() {
- return ValidationMode.values();
- }
-
- @Override
- protected boolean sortChoices() {
- return false;
- }
-
- @Override
- protected ValidationMode getDefaultValue() {
- return this.getSubject().getDefaultValidationMode();
- }
-
- @Override
- protected String displayString(ValidationMode value) {
- switch (value) {
- case AUTO :
- return JptUiPersistence2_0Messages.ValidationModeComposite_auto;
- case CALLBACK :
- return JptUiPersistence2_0Messages.ValidationModeComposite_callback;
- case NONE :
- return JptUiPersistence2_0Messages.ValidationModeComposite_none;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected ValidationMode getValue() {
- return this.getSubject().getSpecifiedValidationMode();
- }
-
- @Override
- protected void setValue(ValidationMode value) {
- this.getSubject().setSpecifiedValidationMode(value);
- }
- };
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/platform/generic/Generic2_0JpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/platform/generic/Generic2_0JpaPlatformUiFactory.java
deleted file mode 100644
index 5351f6a3e1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpa2/platform/generic/Generic2_0JpaPlatformUiFactory.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpa2.platform.generic;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.Generic2_0JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUiFactory;
-
-public class Generic2_0JpaPlatformUiFactory
- implements JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public Generic2_0JpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new GenericJpaPlatformUi(
- GenericJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
- Generic2_0JpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlContentProposalProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlContentProposalProvider.java
deleted file mode 100644
index 447c2d8fa0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlContentProposalProvider.java
+++ /dev/null
@@ -1,700 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpql;
-
-import java.text.MessageFormat;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.List;
-import java.util.Locale;
-import java.util.ResourceBundle;
-import org.eclipse.core.commands.AbstractHandler;
-import org.eclipse.core.commands.ExecutionEvent;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.commands.IHandler;
-import org.eclipse.core.commands.ParameterizedCommand;
-import org.eclipse.core.expressions.EvaluationResult;
-import org.eclipse.core.expressions.Expression;
-import org.eclipse.core.expressions.ExpressionInfo;
-import org.eclipse.core.expressions.IEvaluationContext;
-import org.eclipse.jface.bindings.Binding;
-import org.eclipse.jface.bindings.Trigger;
-import org.eclipse.jface.bindings.keys.KeyStroke;
-import org.eclipse.jface.bindings.keys.SWTKeySupport;
-import org.eclipse.jface.fieldassist.ControlDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
-import org.eclipse.jface.internal.text.html.HTMLTextPresenter;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.DefaultInformationControl;
-import org.eclipse.jface.text.DefaultTextHover;
-import org.eclipse.jface.text.Document;
-import org.eclipse.jface.text.DocumentEvent;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IDocumentListener;
-import org.eclipse.jface.text.IInformationControl;
-import org.eclipse.jface.text.IInformationControlCreator;
-import org.eclipse.jface.text.ITextHover;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Position;
-import org.eclipse.jface.text.contentassist.ContentAssistant;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContentAssistProcessor;
-import org.eclipse.jface.text.contentassist.IContentAssistant;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jface.text.contentassist.IContextInformationValidator;
-import org.eclipse.jface.text.source.Annotation;
-import org.eclipse.jface.text.source.AnnotationModel;
-import org.eclipse.jface.text.source.DefaultAnnotationHover;
-import org.eclipse.jface.text.source.IAnnotationHover;
-import org.eclipse.jface.text.source.ISourceViewer;
-import org.eclipse.jface.text.source.SourceViewer;
-import org.eclipse.jface.text.source.SourceViewerConfiguration;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.persistence.jpa.jpql.JPQLQueryProblem;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.DisposeEvent;
-import org.eclipse.swt.events.DisposeListener;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.actions.ActionFactory;
-import org.eclipse.ui.editors.text.EditorsUI;
-import org.eclipse.ui.handlers.IHandlerActivation;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.internal.editors.text.EditorsPlugin;
-import org.eclipse.ui.keys.IBindingService;
-import org.eclipse.ui.swt.IFocusService;
-import org.eclipse.ui.texteditor.AnnotationPreference;
-import org.eclipse.ui.texteditor.DefaultMarkerAnnotationAccess;
-import org.eclipse.ui.texteditor.ITextEditorActionDefinitionIds;
-import org.eclipse.ui.texteditor.SourceViewerDecorationSupport;
-
-/**
- * This provider installs content assist support on a {@link StyledText} widget in order to give
- * choices at any given position within a JPQL query.
- * <p>
- * TODO. Add syntax highlight for the JPQL identifiers.
- *
- * @version 3.2
- * @since 3.0
- * @author Pascal Filion
- */
-@SuppressWarnings({"nls", "restriction"})
-public final class JpaJpqlContentProposalProvider extends JpqlCompletionProposalComputer<ICompletionProposal> {
-
- /**
- * This model holds onto the {@link Annotation annotations} that have been created for each
- * {@link JPQLQueryProblem}
- */
- private AnnotationModel annotationModel;
-
- /**
- * The decoration support required to paint the {@link Annotation annotations}, which are the
- * JPQL problems.
- */
- private SourceViewerDecorationSupport decorationSupport;
-
- /**
- * This handler will trigger an event that will be used to notify the {@link SourceViewer} to
- * invoke the content assist.
- */
- private IHandlerActivation handlerActivation;
-
- /**
- * The position within the JPQL query.
- */
- private int position;
-
- /**
- * The holder of the named query.
- */
- private PropertyValueModel<? extends NamedQuery> queryHolder;
-
- /**
- * The {@link ResourceBundle} that contains the JPQL problems.
- */
- private ResourceBundle resourceBundle;
-
- /**
- * This viewer is used to install various functionality over the {@link StyledText}.
- */
- private SourceViewer sourceViewer;
-
- /**
- * The configuration object used to configure the {@link SourceViewer}.
- */
- private JpqlSourceViewerConfiguration sourceViewerConfiguration;
-
- /**
- * The widget used to display the JPQL query.
- */
- private StyledText styledText;
-
- /**
- * This listener is used to dispose the {@link org.eclipse.persistence.jpa.jpql.JPQLQueryHelper
- * JPQLQueryHelper} when the subject changes and to reset the undo manager in order to prevent
- * the query from being entirely deleted with an undo.
- */
- private PropertyChangeListener subjectChangeListener;
-
- /**
- * The holder of the JPQL query.
- */
- private ModifiablePropertyValueModel<String> textHolder;
-
- /**
- * Listens to the JPQL query and keep the {@link Document} in sync.
- */
- private PropertyChangeListener textListener;
-
- /**
- * The unique identifier - appended by hashCode() - used to register the widget with the focus
- * handler.
- */
- private static final String CONTROL_ID = "jpql.focus.control";
-
- /**
- * The unique identifier used to mark an {@link Annotation} as a JPQL problem.
- */
- private static final String ERROR_TYPE = "org.eclipse.jdt.ui.error";
-
- /**
- * Creates a new <code>JpaJpqlContentProposalProvider</code>.
- *
- * @param parent The parent {@link Composite} where to add the JPQL query editor
- * @param queryHolder The holder of the named query
- * @param textHolder The holder of the JPQL query
- */
- public JpaJpqlContentProposalProvider(Composite parent,
- PropertyValueModel<? extends NamedQuery> queryHolder,
- ModifiablePropertyValueModel<String> textHolder) {
-
- super();
- initialize(parent, queryHolder, textHolder);
- }
-
- private void activateHandler() {
-
- IWorkbench workbench = PlatformUI.getWorkbench();
- IFocusService focusService = (IFocusService) workbench.getService(IFocusService.class);
- IHandlerService handlerService = (IHandlerService) workbench.getService(IHandlerService.class);
-
- if ((focusService != null) && (handlerService != null)) {
-
- focusService.addFocusTracker(styledText, CONTROL_ID + hashCode());
-
- Expression expression = buildExpression();
- IHandler handler = buildHandler();
-
- handlerActivation = handlerService.activateHandler(
- ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS,
- handler,
- expression
- );
-
- handlerActivation = handlerService.activateHandler(
- ActionFactory.UNDO.getCommandId(),
- handler,
- expression
- );
-
- handlerActivation = handlerService.activateHandler(
- ActionFactory.REDO.getCommandId(),
- handler,
- expression
- );
- }
- }
-
- @SuppressWarnings("unchecked")
- private List<AnnotationPreference> annotationPreferences() {
- return EditorsPlugin.getDefault().getMarkerAnnotationPreferences().getAnnotationPreferences();
- }
-
- private DisposeListener buildDisposeListener() {
- return new DisposeListener() {
- public void widgetDisposed(DisposeEvent e) {
- dispose();
- }
- };
- }
-
- private IDocumentListener buildDocumentListener() {
- return new IDocumentListener() {
- public void documentAboutToBeChanged(DocumentEvent event) {
- }
- public void documentChanged(DocumentEvent event) {
- try {
- IDocument document = event.getDocument();
- String text = document.get(0, document.getLength());
- textHolder.setValue(text);
- validate();
- }
- catch (BadLocationException e) {
- // Simply ignore, should never happen
- }
- }
- };
- }
-
- private Expression buildExpression() {
- return new Expression() {
- @Override
- public void collectExpressionInfo(ExpressionInfo info) {
- info.addVariableNameAccess(ISources.ACTIVE_FOCUS_CONTROL_NAME);
- }
- @Override
- public EvaluationResult evaluate(IEvaluationContext context) {
- Object variable = context.getVariable(ISources.ACTIVE_FOCUS_CONTROL_NAME);
- return (variable == styledText) ? EvaluationResult.TRUE : EvaluationResult.FALSE;
- }
- };
- }
-
- private IHandler buildHandler() {
- return new AbstractHandler() {
- public Object execute(ExecutionEvent event) throws ExecutionException {
- String commandId = event.getCommand().getId();
-
- // Content Assist
- if (ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS.equals(commandId)) {
- sourceViewer.doOperation(ISourceViewer.CONTENTASSIST_PROPOSALS);
- }
- // Undo
- else if (ActionFactory.UNDO.getCommandId().equals(commandId)) {
- if (sourceViewer.getUndoManager().undoable()) {
- sourceViewer.getUndoManager().undo();
- validate();
- }
- }
- // Redo
- else if (ActionFactory.REDO.getCommandId().equals(commandId)) {
- if (sourceViewer.getUndoManager().redoable()) {
- sourceViewer.getUndoManager().redo();
- validate();
- }
- }
-
- return null;
- }
- };
- }
-
- private String buildMessage(JPQLQueryProblem problem) {
- String message = resourceBundle().getString(problem.getMessageKey());
- message = MessageFormat.format(message, (Object[]) problem.getMessageArguments());
- return message;
- }
-
- private ModifyListener buildModifyListener() {
- return new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- validate();
- }
- };
- }
-
- private Comparator<JPQLQueryProblem> buildProblemComparator() {
- return new Comparator<JPQLQueryProblem>() {
- public int compare(JPQLQueryProblem problem1, JPQLQueryProblem problem2) {
- int result = problem1.getStartPosition() - problem2.getStartPosition();
- if (result == 0) {
- result = problem1.getEndPosition() - problem2.getEndPosition();
- }
- return result;
- }
- };
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- ICompletionProposal buildProposal(String proposal,
- String displayString,
- String additionalInfo,
- Image image,
- int cursorOffset) {
-
- return new JpqlCompletionProposal(
- contentAssistProposals,
- proposal,
- displayString,
- additionalInfo,
- image,
- namedQuery,
- actualQuery,
- jpqlQuery,
- offset,
- position,
- cursorOffset,
- false
- );
- }
-
- private PropertyChangeListener buildSubjectChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- subjectChanged(e);
- }
- };
- }
-
- private PropertyChangeListener buildTextListener() {
- return new SWTPropertyChangeListenerWrapper(new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- String text = (String) event.getNewValue();
- if (text == null) {
- text = StringTools.EMPTY_STRING;
- }
- if (!styledText.getText().equals(text)) {
- sourceViewer.getDocument().set(text);
- }
- }
- });
- }
-
- private Image contentAssistImage() {
- FieldDecorationRegistry registry = FieldDecorationRegistry.getDefault();
- return registry.getFieldDecoration(FieldDecorationRegistry.DEC_CONTENT_PROPOSAL).getImage();
- }
-
- /**
- * Makes sure the {@link Color} used to paint the underlying problem is disposed when the
- * {@link StyledText} widget is disposed.
- */
- private void dispose() {
-
- sessionEnded();
-
- decorationSupport.dispose();
- textHolder.removePropertyChangeListener(PropertyValueModel.VALUE, textListener);
- queryHolder.removePropertyChangeListener(PropertyValueModel.VALUE, subjectChangeListener);
-
- IWorkbench workbench = PlatformUI.getWorkbench();
- IHandlerService handlerService = (IHandlerService) workbench.getService(IHandlerService.class);
- handlerService.deactivateHandler(handlerActivation);
- }
-
- private KeyStroke findContentAssistTrigger() {
-
- IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
-
- // Dig through the list of available bindings to find the one for content assist
- for (Binding binding : bindingService.getBindings()) {
- if (isContentAssistBinding(binding)) {
- Trigger[] triggers = binding.getTriggerSequence().getTriggers();
- if ((triggers != null) && (triggers.length > 0)) {
- return (KeyStroke) triggers[0];
- }
- }
- }
-
- // The default trigger was not found, use the default
- return KeyStroke.getInstance(SWT.CTRL, ' ');
- }
-
- /**
- * Returns the widget used to display the JPQL query.
- *
- * @return The main widget
- */
- public StyledText getStyledText() {
- return styledText;
- }
-
- private void initialize(Composite parent,
- PropertyValueModel<? extends NamedQuery> queryHolder,
- ModifiablePropertyValueModel<String> textHolder) {
-
- this.queryHolder = queryHolder;
- this.annotationModel = new AnnotationModel();
- this.textHolder = textHolder;
-
- // Make sure the StyledText is kept in sync with the text holder
- textListener = buildTextListener();
- textHolder.addPropertyChangeListener(PropertyValueModel.VALUE, textListener);
-
- // Make sure the user can't delete the entire query when doing undo
- subjectChangeListener = buildSubjectChangeListener();
- queryHolder.addPropertyChangeListener(PropertyValueModel.VALUE, subjectChangeListener);
-
- // Create the SourceViewer, which is responsible for everything: content assist, tool tip
- // hovering over the annotation (problems), etc
- sourceViewer = new SourceViewer(parent, null, SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL | SWT.H_SCROLL | SWT.FLAT);
- sourceViewerConfiguration = new JpqlSourceViewerConfiguration();
- sourceViewer.configure(sourceViewerConfiguration);
- sourceViewer.setDocument(new Document(), annotationModel);
- sourceViewer.getDocument().addDocumentListener(buildDocumentListener());
-
- styledText = sourceViewer.getTextWidget();
- styledText.addModifyListener(buildModifyListener());
- styledText.addDisposeListener(buildDisposeListener());
-
- // Add the support for painting the annotations (JPQL problems) in the source viewer
- installDecorationSupport();
-
- // Bind the content assist key trigger with the handler service
- activateHandler();
-
- // Install a custom context menu to the widget
- TextTransferHandler.installContextMenu(styledText, sourceViewer.getUndoManager());
- }
-
- /**
- * Installs the content assist icon at the top left of the {@link StyledText}.
- */
- public void installControlDecoration() {
-
- // Retrieve the content assist trigger
- KeyStroke contentAssistTrigger = findContentAssistTrigger();
- String key = SWTKeySupport.getKeyFormatterForPlatform().format(contentAssistTrigger);
-
- // Add the context assist icon at the top left corner of the StyledText
- ControlDecoration decoration = new ControlDecoration(styledText, SWT.LEFT | SWT.TOP);
- decoration.setDescriptionText(NLS.bind(JptUiMessages.JpqlContentProposalProvider_Description, key));
- decoration.setImage(contentAssistImage());
- decoration.setShowOnlyOnFocus(true);
- }
-
- private void installDecorationSupport() {
-
- decorationSupport = new SourceViewerDecorationSupport(
- sourceViewer,
- null,
- new DefaultMarkerAnnotationAccess(),
- EditorsPlugin.getDefault().getSharedTextColors()
- );
-
- for (AnnotationPreference preference : annotationPreferences()) {
- decorationSupport.setAnnotationPreference(preference);
- }
-
- decorationSupport.install(EditorsPlugin.getDefault().getPreferenceStore());
- }
-
- private boolean isContentAssistBinding(Binding binding) {
-
- ParameterizedCommand command = binding.getParameterizedCommand();
-
- return command != null &&
- command.getCommand() != null &&
- command.getCommand().getId().equals(ITextEditorActionDefinitionIds.CONTENT_ASSIST_PROPOSALS);
- }
-
- private NamedQuery query() {
- return queryHolder.getValue();
- }
-
- private ResourceBundle resourceBundle() {
- if (resourceBundle == null) {
- resourceBundle = ResourceBundle.getBundle(
- "jpa_jpql_validation",
- Locale.getDefault(),
- JptJpaCorePlugin.class.getClassLoader()
- );
- }
- return resourceBundle;
- }
-
- private List<JPQLQueryProblem> sortProblems(List<JPQLQueryProblem> problems) {
- Collections.sort(problems, buildProblemComparator());
- return problems;
- }
-
- private void subjectChanged(PropertyChangeEvent e) {
-
- namedQuery = (NamedQuery) e.getNewValue();
-
- if (namedQuery != null) {
-
- // Prevent undoing the actual query that was set
- sourceViewer.getUndoManager().reset();
-
- // Make sure the new query is validated
- validate();
- }
- else {
- queryHelper = null;
- annotationModel.removeAllAnnotations();
- }
- }
-
- /**
- * Validates the given JPQL query and add highlights where problems have been found.
- */
- private void validate() {
-
- // First clear any existing problems
- annotationModel.removeAllAnnotations();
-
- // Nothing to validate
- if ((query() == null) ||
- styledText.isDisposed() ||
- StringTools.stringIsEmpty(styledText.getText())) {
-
- return;
- }
-
- try {
- // The information was disposed but the content might be updated outside of the pane,
- // like in the editor itself, make sure NamedQuery and the helper are initialized
- if (queryHelper == null) {
- namedQuery = query();
- queryHelper = namedQuery.getPersistenceUnit().createJpqlQueryHelper();
- }
-
- String jpqlQuery = styledText.getText();
- queryHelper.setQuery(query(), jpqlQuery);
- String parsedJpqlQuery = queryHelper.getParsedJPQLQuery();
-
- for (JPQLQueryProblem problem : sortProblems(queryHelper.validate())) {
-
- // Create the range
- int[] positions = queryHelper.buildPositions(problem, parsedJpqlQuery, jpqlQuery);
-
- // Add the problem to the tool tip
- Annotation annotation = new Annotation(ERROR_TYPE, true, buildMessage(problem));
- annotationModel.addAnnotation(annotation, new Position(positions[0], positions[1] - positions[0]));
- }
- }
- finally {
- queryHelper.dispose();
- }
- }
-
- /**
- * This processor is responsible to create the list of {@link ICompletionProposal proposals}
- * based on the position of the cursor within the query.
- */
- private class ContentAssistProcessor implements IContentAssistProcessor {
-
- /**
- * {@inheritDoc}
- */
- public ICompletionProposal[] computeCompletionProposals(ITextViewer viewer, int offset) {
-
- JpaJpqlContentProposalProvider.this.position = offset;
-
- String jpqlQuery = viewer.getDocument().get();
- List<ICompletionProposal> proposals = buildProposals(query(), jpqlQuery, 0, position);
- return proposals.toArray(new ICompletionProposal[proposals.size()]);
- }
-
- /**
- * {@inheritDoc}
- */
- public IContextInformation[] computeContextInformation(ITextViewer viewer, int offset) {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public char[] getCompletionProposalAutoActivationCharacters() {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public char[] getContextInformationAutoActivationCharacters() {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public IContextInformationValidator getContextInformationValidator() {
- return null;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getErrorMessage() {
- return null;
- }
- }
-
- private class JpqlSourceViewerConfiguration extends SourceViewerConfiguration {
-
- /**
- * Keeps track of the content assist since we need to know when the popup is opened or not.
- */
- ContentAssistant contentAssistant;
-
- private IInformationControlCreator buildInformationControlCreator() {
- return new IInformationControlCreator() {
- public IInformationControl createInformationControl(Shell parent) {
- return new DefaultInformationControl(
- parent,
- EditorsUI.getTooltipAffordanceString(),
- new HTMLTextPresenter(true)
- );
- }
- };
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IAnnotationHover getAnnotationHover(ISourceViewer sourceViewer) {
- return new DefaultAnnotationHover();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public IContentAssistant getContentAssistant(ISourceViewer sourceViewer) {
- contentAssistant = new ContentAssistant();
- contentAssistant.setContentAssistProcessor(new ContentAssistProcessor(), IDocument.DEFAULT_CONTENT_TYPE);
- contentAssistant.setInformationControlCreator(buildInformationControlCreator());
- return contentAssistant;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType) {
- return new DefaultTextHover(sourceViewer);
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public ITextHover getTextHover(ISourceViewer sourceViewer, String contentType, int stateMask) {
- return new DefaultTextHover(sourceViewer);
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlJavaCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlJavaCompletionProposalComputer.java
deleted file mode 100644
index cf10b337bf..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlJavaCompletionProposalComputer.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpql;
-
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.CompletionContext;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.dom.ASTNode;
-import org.eclipse.jdt.core.dom.AbstractTypeDeclaration;
-import org.eclipse.jdt.core.dom.Annotation;
-import org.eclipse.jdt.core.dom.ArrayInitializer;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jdt.core.dom.Expression;
-import org.eclipse.jdt.core.dom.IExtendedModifier;
-import org.eclipse.jdt.core.dom.MemberValuePair;
-import org.eclipse.jdt.core.dom.NormalAnnotation;
-import org.eclipse.jdt.core.dom.SingleMemberAnnotation;
-import org.eclipse.jdt.core.dom.StringLiteral;
-import org.eclipse.jdt.ui.text.java.ContentAssistInvocationContext;
-import org.eclipse.jdt.ui.text.java.IJavaCompletionProposalComputer;
-import org.eclipse.jdt.ui.text.java.JavaContentAssistInvocationContext;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jpt.common.core.internal.utility.jdt.ASTTools;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.persistence.jpa.jpql.ExpressionTools;
-import org.eclipse.swt.graphics.Image;
-
-/**
- * This computer adds content assist support when it is invoked inside the query element of {@link
- * javax.persistence.NamedQuery &#64;NamedQuery}.
- *
- * @version 3.2
- * @since 3.0
- * @author Pascal Filion
- */
-@SuppressWarnings("restriction")
-public final class JpaJpqlJavaCompletionProposalComputer extends JpqlCompletionProposalComputer<ICompletionProposal>
- implements IJavaCompletionProposalComputer {
-
- /**
- * Creates a new <code>JpaJpqlJavaCompletionProposalComputer</code>.
- */
- public JpaJpqlJavaCompletionProposalComputer() {
- super();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- ICompletionProposal buildProposal(String proposal,
- String displayString,
- String additionalInfo,
- Image image,
- int cursorOffset) {
-
- return new JpqlCompletionProposal(
- contentAssistProposals,
- proposal,
- displayString,
- additionalInfo,
- image,
- namedQuery,
- actualQuery,
- jpqlQuery,
- offset + 1, // +1 is to skip the opening "
- position,
- cursorOffset,
- true
- );
- }
-
- /**
- * {@inheritDoc}
- */
- public List<ICompletionProposal> computeCompletionProposals(ContentAssistInvocationContext context,
- IProgressMonitor monitor) {
-
- if (context instanceof JavaContentAssistInvocationContext) {
- monitor.beginTask(null, 100);
- try {
- return computeCompletionProposals((JavaContentAssistInvocationContext) context, monitor);
- }
- catch (Exception e) {
- JptJpaUiPlugin.log(JptUiMessages.JpaJpqlJavaCompletionProposalComputer_Error, e);
- }
- finally {
- monitor.done();
- }
- }
-
- return Collections.emptyList();
- }
-
- private List<ICompletionProposal> computeCompletionProposals(JavaContentAssistInvocationContext context,
- IProgressMonitor monitor) throws Exception {
-
- CompletionContext completionContext = context.getCoreContext();
- if (completionContext == null) return Collections.emptyList();
-
- // The token "start" is the offset of the token's first character within the document.
- // A token start of -1 can means:
- // - It is inside the string representation of a unicode character, \\u0|0E9 where | is the
- // cursor, then -1 is returned;
- // - The string is not valid (it has some invalid characters)
- int tokenStart = completionContext.getTokenStart();
- if (tokenStart == -1) return Collections.emptyList();
-
- int[] position = { completionContext.getOffset() - tokenStart - 1 };
- if (position[0] < 0) return Collections.emptyList();
-
- ICompilationUnit compilationUnit = context.getCompilationUnit();
- if (compilationUnit == null) return Collections.emptyList();
- CompilationUnit astRoot = ASTTools.buildASTRoot(compilationUnit);
-
- IFile file = getCorrespondingResource(compilationUnit);
- if (file == null) return Collections.emptyList();
-
- JpaFile jpaFile = (JpaFile) file.getAdapter(JpaFile.class);
- if (jpaFile == null) return Collections.emptyList();
-
- monitor.worked(80);
- checkCanceled(monitor);
-
- // Retrieve the JPA's model object
- NamedQuery namedQuery = namedQuery(jpaFile, tokenStart);
- if (namedQuery == null) return Collections.emptyList();
-
- // Retrieve the actual value of the element "query" since the content assist can be
- // invoked before the model received the new content
- String jpqlQuery = jpqlQuery(astRoot, tokenStart, completionContext.getTokenEnd(), position);
-
- // Now create the proposals
- return buildProposals(namedQuery, jpqlQuery, tokenStart, position[0]);
- }
-
- /**
- * {@inheritDoc}
- */
- public List<IContextInformation> computeContextInformation(ContentAssistInvocationContext context,
- IProgressMonitor monitor) {
-
- return Collections.emptyList();
- }
-
- private NamedQuery findNamedQuery(JpaStructureNode structureNode,
- int tokenStart) {
-
- if (structureNode instanceof JavaPersistentType) {
- JavaPersistentType persistentType = (JavaPersistentType) structureNode;
- JavaTypeMapping typeMapping = persistentType.getMapping();
-
- for (Query query : typeMapping.getQueries()){
- if (query.getType().equals(NamedQuery.class)){
- JavaNamedQuery namedQuery = (JavaNamedQuery)query;
- TextRange textRange = namedQuery.getQueryAnnotation().getQueryTextRange();
- if ((textRange != null) && textRange.includes(tokenStart)) {
- return namedQuery;
- }
- }
- }
- }
-
- return null;
- }
-
- private IFile getCorrespondingResource(ICompilationUnit compilationUnit) {
- try {
- return (IFile) compilationUnit.getCorrespondingResource();
- }
- catch (JavaModelException ex) {
- JptJpaCorePlugin.log(ex);
- return null;
- }
- }
-
- private boolean isInsideNode(ASTNode node, int tokenStart, int tokenEnd) {
- int startPosition = node.getStartPosition();
- return startPosition <= tokenStart &&
- startPosition + node.getLength() >= tokenEnd;
- }
-
- private String jpqlQuery(CompilationUnit astRoot, int tokenStart, int tokenEnd, int[] position) {
-
- String jpqlQuery = retrieveQuery(astRoot, tokenStart, tokenEnd);
-
- if (jpqlQuery == null) {
- jpqlQuery = StringTools.EMPTY_STRING;
- }
- else if (StringTools.stringIsQuoted(jpqlQuery)) {
- jpqlQuery = jpqlQuery.substring(1, jpqlQuery.length() - 1);
- }
-
- return jpqlQuery;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- String modifyJpqlQuery(String jpqlQuery, int[] position) {
- return ExpressionTools.unescape(jpqlQuery, position);
- }
-
- private NamedQuery namedQuery(JpaFile jpaFile, int tokenStart) {
-
- for (JpaStructureNode node : jpaFile.getRootStructureNodes()) {
- NamedQuery namedQuery = findNamedQuery(node, tokenStart);
- if (namedQuery != null) {
- return namedQuery;
- }
- }
-
- return null;
- }
-
- /**
- * This twisted code is meant to retrieve the real string value that is not escaped and to also
- * retrieve the position within the non-escaped string. The query could have escape characters,
- * such as \r, \n etc being written as \\r, \\n, the position is based on that escaped string,
- * the conversion will convert them into \r and \r and adjust the position accordingly.
- *
- * @param astRoot The parsed tree representation of the Java source file
- * @param tokenStart The beginning of the query expression of the {@link javax.persistence.NamedQuery
- * &#64;NamedQuery}'s query member within the source file
- * @param tokenEnd The end of the query member within the source file
- * @param position The position of the cursor within the query expression
- * @return The actual value retrieved from the query element
- */
- @SuppressWarnings("unchecked")
- private String retrieveQuery(CompilationUnit astRoot, int tokenStart, int tokenEnd) {
-
- // Dig into the TypeDeclarations
- for (AbstractTypeDeclaration type : (List<AbstractTypeDeclaration>) astRoot.types()) {
-
- if (isInsideNode(type, tokenStart, tokenEnd)) {
-
- // Dig inside its modifiers and annotations
- for (IExtendedModifier modifier : (List<IExtendedModifier>) type.modifiers()) {
-
- if (!modifier.isAnnotation()) {
- continue;
- }
-
- Annotation annotation = (Annotation) modifier;
-
- // Dig inside the annotation
- if (isInsideNode(annotation, tokenStart, tokenEnd)) {
-
- // @NamedQueries({...})
- if (annotation.isSingleMemberAnnotation()) {
- SingleMemberAnnotation singleMemberAnnotation = (SingleMemberAnnotation) annotation;
- Expression value = singleMemberAnnotation.getValue();
-
- if (value.getNodeType() == ASTNode.ARRAY_INITIALIZER) {
- ArrayInitializer array = (ArrayInitializer) value;
-
- for (Expression expression : (List<Expression>) array.expressions()) {
- if (isInsideNode(expression, tokenStart, tokenEnd)) {
- return retrieveQuery((NormalAnnotation) expression, tokenStart, tokenEnd);
- }
- }
- }
- else {
- NormalAnnotation childAnnotation = (NormalAnnotation) value;
-
- if (isInsideNode(childAnnotation, tokenStart, tokenEnd)) {
- return retrieveQuery(childAnnotation, tokenStart, tokenEnd);
- }
- }
- }
- // @NamedQuery()
- else if (annotation.isNormalAnnotation()) {
- return retrieveQuery((NormalAnnotation) annotation, tokenStart, tokenEnd);
- }
- }
- }
- }
- }
-
- return null;
- }
-
- @SuppressWarnings("unchecked")
- private String retrieveQuery(NormalAnnotation annotation, int tokenStart, int tokenEnd) {
-
- for (MemberValuePair pair : (List<MemberValuePair>) annotation.values()) {
- org.eclipse.jdt.core.dom.Expression expression = pair.getValue();
-
- if (isInsideNode(expression, tokenStart, tokenEnd)) {
- StringLiteral literal = (StringLiteral) pair.getValue();
- return literal.getEscapedValue();
- }
- }
-
- return null;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlSseCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlSseCompletionProposalComputer.java
deleted file mode 100644
index fb36549fe1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpaJpqlSseCompletionProposalComputer.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpql;
-
-import java.util.Collections;
-import java.util.List;
-import org.eclipse.core.filebuffers.FileBuffers;
-import org.eclipse.core.filebuffers.ITextFileBuffer;
-import org.eclipse.core.filebuffers.ITextFileBufferManager;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryContainer;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.persistence.jpa.jpql.ExpressionTools;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.wst.sse.ui.contentassist.CompletionProposalInvocationContext;
-import org.eclipse.wst.sse.ui.contentassist.ICompletionProposalComputer;
-
-/**
- * This computer adds content assist support when it is invoked inside the &lt;query&gt; element
- * defined in a mapping file (ORM Configuration).
- *
- * @version 3.2
- * @since 3.0
- * @author Pascal Filion
- */
-public final class JpaJpqlSseCompletionProposalComputer extends JpqlCompletionProposalComputer<ICompletionProposal>
- implements ICompletionProposalComputer {
-
- /**
- * Creates a new <code>JpaJpqlSseCompletionProposalComputer</code>.
- */
- public JpaJpqlSseCompletionProposalComputer() {
- super();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- ICompletionProposal buildProposal(String proposal,
- String displayString,
- String additionalInfo,
- Image image,
- int cursorOffset) {
-
- return new JpqlCompletionProposal(
- contentAssistProposals,
- proposal,
- displayString,
- additionalInfo,
- image,
- namedQuery,
- actualQuery,
- jpqlQuery,
- offset,
- position,
- cursorOffset,
- false
- );
- }
-
- /**
- * {@inheritDoc}
- */
- public List<ICompletionProposal> computeCompletionProposals(CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- monitor.beginTask(null, 100);
-
- try {
- int offset = context.getInvocationOffset();
- if (offset == -1) return Collections.emptyList();
-
- ITextFileBufferManager manager = FileBuffers.getTextFileBufferManager();
- ITextFileBuffer buffer = manager.getTextFileBuffer(context.getDocument());
- if (buffer == null) return Collections.emptyList();
-
- IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
- IFile file = root.getFile(buffer.getLocation());
-
- JpaFile jpaFile = (JpaFile) file.getAdapter(JpaFile.class);
- if (jpaFile == null) return Collections.emptyList();
-
- monitor.worked(80);
- checkCanceled(monitor);
-
- // Retrieve the JPA's model object
- int[] position = new int[1];
- OrmNamedQuery namedQuery = namedQuery(jpaFile, offset, position);
- if (namedQuery == null) return Collections.emptyList();
-
- // Keep track of the beginning of the text since the entire string is always replaced
- int tokenStart = offset - position[0];
-
- // Now create the proposals
- String jpqlQuery = jpqlQuery(namedQuery, context.getDocument());
- return buildProposals(namedQuery, jpqlQuery, tokenStart, position[0]);
- }
- catch (Exception e) {
- JptJpaUiPlugin.log(JptUiMessages.JpaJpqlSseCompletionProposalComputer_Error, e);
- }
- finally {
- monitor.done();
- }
-
- return Collections.emptyList();
- }
-
- /**
- * {@inheritDoc}
- */
- public List<IContextInformation> computeContextInformation(CompletionProposalInvocationContext context,
- IProgressMonitor monitor) {
-
- return Collections.emptyList();
- }
-
- private OrmNamedQuery findNamedQuery(JpaStructureNode structureNode, int offset, int[] position) {
-
- if (structureNode instanceof EntityMappings) {
- EntityMappings entityMappings = (EntityMappings) structureNode;
-
- // First look into the global queries
- OrmNamedQuery query = findNamedQuery(entityMappings.getQueryContainer(), offset, position);
-
- // Now traverse each entity
- if (query != null) {
- return query;
- }
-
- for (PersistentType persistentType : entityMappings.getPersistentTypes()) {
- TypeMapping typeMapping = persistentType.getMapping();
-
- if (typeMapping instanceof OrmEntity) {
- query = findNamedQuery(((OrmEntity) typeMapping).getQueryContainer(), offset, position);
-
- if (query != null) {
- return query;
- }
- }
- }
- }
-
- return null;
- }
-
- private OrmNamedQuery findNamedQuery(OrmQueryContainer container, int offset, int[] position) {
-
- for (OrmNamedQuery namedQuery : container.getNamedQueries()) {
- TextRange textRange = namedQuery.getQueryTextRange();
-
- if (textRange.touches(offset)) {
- position[0] = offset - textRange.getOffset();
- return namedQuery;
- }
- }
-
- return null;
- }
-
- private String jpqlQuery(OrmNamedQuery namedQuery, IDocument document) {
- try {
- TextRange range = namedQuery.getQueryTextRange();
- return document.get(range.getOffset(), range.getLength());
- }
- catch (BadLocationException e) {
- return StringTools.EMPTY_STRING;
- }
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- String modifyJpqlQuery(String jpqlQuery, int[] position) {
- return ExpressionTools.unescape(jpqlQuery, position);
- }
-
- private OrmNamedQuery namedQuery(JpaFile jpaFile, int offset, int[] position) {
-
- for (JpaStructureNode node : jpaFile.getRootStructureNodes()) {
- OrmNamedQuery namedQuery = findNamedQuery(node, offset, position);
- if (namedQuery != null) {
- return namedQuery;
- }
- }
-
- return null;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlCompletionProposal.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlCompletionProposal.java
deleted file mode 100644
index aefd14b501..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlCompletionProposal.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpql;
-
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.ui.PreferenceConstants;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.contentassist.ICompletionProposal;
-import org.eclipse.jface.text.contentassist.IContextInformation;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.persistence.jpa.jpql.ContentAssistProposals;
-import org.eclipse.persistence.jpa.jpql.ResultQuery;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-
-/**
- * The concrete implementation of a {@link org.eclipse.jface.text.contentassist.ICompletionProposal
- * ICompletionProposal} that adds relevance and toggling the completion insertion property behavior.
- *
- * @version 3.0
- * @since 3.0
- * @author Pascal Filion
- */
-final class JpqlCompletionProposal implements ICompletionProposal {
-
- private String actualQuery;
- private String additionalInfo;
- private ContentAssistProposals proposals;
- private int cursorOffset;
- private String displayString;
- private boolean escapeCharacters;
- private Image image;
- private String jpqlQuery;
- private NamedQuery namedQuery;
- private int offset;
- private int position;
- private String proposal;
- private ResultQuery result;
- private boolean toggleCompletion;
-
- JpqlCompletionProposal(ContentAssistProposals proposals,
- String proposal,
- String displayString,
- String additionalInfo,
- Image image,
- NamedQuery namedQuery,
- String actualQuery,
- String jpqlQuery,
- int offset,
- int position,
- int cursorOffset,
- boolean escapeCharacters) {
-
- super();
-
- this.image = image;
- this.offset = offset;
- this.position = position;
- this.proposal = proposal;
- this.jpqlQuery = jpqlQuery;
- this.proposals = proposals;
- this.namedQuery = namedQuery;
- this.actualQuery = actualQuery;
- this.cursorOffset = cursorOffset;
- this.displayString = displayString;
- this.additionalInfo = additionalInfo;
- this.escapeCharacters = escapeCharacters;
- }
-
- /**
- * {@inheritDoc}
- */
- public void apply(IDocument document) {
- try {
- ResultQuery result = buildResult();
- document.replace(offset, actualQuery.length(), result.getQuery());
- }
- catch (BadLocationException e) {
- // Ignore
- }
- }
-
- private ResultQuery buildResult() {
- if (result == null) {
- if (escapeCharacters) {
- result = proposals.buildEscapedQuery(
- jpqlQuery,
- proposal,
- position,
- isCompletionInserts() ^ toggleCompletion
- );
- }
- else {
- result = proposals.buildQuery(
- jpqlQuery,
- proposal,
- position,
- isCompletionInserts() ^ toggleCompletion
- );
- }
- }
- return result;
- }
-
- /**
- * {@inheritDoc}
- */
- public String getAdditionalProposalInfo() {
- return additionalInfo;
- }
-
- /**
- * {@inheritDoc}
- */
- public IContextInformation getContextInformation() {
- return null; // Not needed, this is legacy API
- }
-
- /**
- * {@inheritDoc}
- */
- public String getDisplayString() {
- return displayString;
- }
-
- /**
- * {@inheritDoc}
- */
- public Image getImage() {
- return image;
- }
-
- /**
- * {@inheritDoc}
- */
- public Point getSelection(IDocument document) {
- ResultQuery result = buildResult();
- return new Point(offset + result.getPosition() + cursorOffset, 0);
- }
-
- private boolean isCompletionInserts() {
- IJavaProject javaProject = namedQuery.getJpaProject().getJavaProject();
- String value = PreferenceConstants.getPreference(PreferenceConstants.CODEASSIST_INSERT_COMPLETION, javaProject);
- return Boolean.valueOf(value);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlCompletionProposalComputer.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlCompletionProposalComputer.java
deleted file mode 100644
index b9f18eb9c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlCompletionProposalComputer.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpql;
-
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.List;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.ImageRegistry;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.core.jpql.JpaJpqlQueryHelper;
-import org.eclipse.jpt.jpa.core.prefs.JpaJpqlPreferencesManager;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.persistence.jpa.jpql.ContentAssistProposals;
-import org.eclipse.persistence.jpa.jpql.WordParser;
-import org.eclipse.persistence.jpa.jpql.parser.Expression;
-import org.eclipse.persistence.jpa.jpql.parser.IdentifierRole;
-import org.eclipse.persistence.jpa.jpql.spi.IEntity;
-import org.eclipse.persistence.jpa.jpql.spi.IMapping;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Display;
-
-import static org.eclipse.persistence.jpa.jpql.spi.IMappingType.*;
-
-/**
- * The abstract definition of JPQL content assist support.
- *
- * @version 3.2
- * @since 3.0
- * @author Pascal Filion
- */
-@SuppressWarnings("nls")
-abstract class JpqlCompletionProposalComputer<T> {
-
- /**
- * The current value of the query element.
- */
- String actualQuery;
-
- /**
- * The provider of content assist items based on the position of the cursor within the JPQL query.
- */
- ContentAssistProposals contentAssistProposals;
-
- /**
- * The local registry containing the images used to display the possible proposals. The registry is
- * disposed when the session ended.
- */
- private ImageRegistry imageRegistry;
-
- /**
- * The same value as {@link #actualQuery} or the modified query that was used by the Hermes parser.
- */
- String jpqlQuery;
-
- /**
- * The JPA model object that is used to access the Java project.
- */
- NamedQuery namedQuery;
-
- /**
- * The start position of the query within the document.
- */
- int offset;
-
- /**
- * The word before the position of the cursor.
- */
- private String partialWord;
-
- /**
- * The position of the cursor within {@link #actualQuery}.
- */
- int position;
-
- /**
- * This helper contains all the information necessary for retrieving the possible proposals
- * required by content assist and to validate JPQL queries.
- */
- JpaJpqlQueryHelper queryHelper;
-
- /**
- * Creates a new <code>JpqlCompletionProposalComputer</code>.
- */
- public JpqlCompletionProposalComputer() {
- super();
- }
-
- /**
- * Adds completion proposals for the abstract schema names that are possible proposals.
- *
- * @param proposals The list used to store the new completion proposals
- */
- private void addAbstractSchemaNames(List<T> proposals) {
- for (IEntity abstractSchemaType : sortByNames(contentAssistProposals.abstractSchemaTypes())) {
- proposals.add(buildAbstractSchemaNameProposal(abstractSchemaType));
- }
- }
-
- /**
- * Adds completion proposals for the identification variables that are possible proposals.
- *
- * @param proposals The list used to store the new completion proposals
- */
- private void addIdentificationVariables(List<T> proposals) {
- for (String variable : sort(contentAssistProposals.identificationVariables())) {
- proposals.add(buildIdentificationVariableProposal(variable));
- }
- }
-
- /**
- * Adds completion proposals for the JPQL identifiers that are possible proposals.
- *
- * @param proposals The list used to store the new completion proposals
- */
- private void addIdentifiers(List<T> proposals) {
- for (String identifier : sort(contentAssistProposals.identifiers())) {
- proposals.add(buildIdentifierProposal(identifier));
- }
- }
-
- private String additionalInfo(String proposal) {
- return JpqlIdentifierMessages.localizedMessage(proposal);
- }
-
- /**
- * Adds completion proposals for the state fields and association fields that are possible proposals.
- *
- * @param proposals The list used to store the new completion proposals
- */
- private void addMappings(List<T> proposals) {
- for (IMapping mapping : sort(contentAssistProposals.mappings())) {
- proposals.add(buildMappingProposal(mapping));
- }
- }
-
- private T buildAbstractSchemaNameProposal(IEntity abstractSchemaType) {
- String proposal = abstractSchemaType.getName();
- return buildProposal(proposal, proposal, entityImage());
- }
-
- private Comparator<IEntity> buildEntityNameComparator() {
- return new Comparator<IEntity>() {
- public int compare(IEntity entity1, IEntity entity2) {
- return entity1.getName().compareTo(entity2.getName());
- }
- };
- }
-
- private String buildIdentificationVariableDisplayString(String identificationVariable) {
-
- IEntity abstractSchemaType = contentAssistProposals.getAbstractSchemaType(identificationVariable);
-
- if (abstractSchemaType != null) {
- StringBuilder sb = new StringBuilder();
- sb.append(identificationVariable);
- sb.append(" : ");
- sb.append(abstractSchemaType.getName());
- identificationVariable = sb.toString();
- }
-
- return identificationVariable;
- }
-
- private T buildIdentificationVariableProposal(String proposal) {
- return buildProposal(
- proposal,
- buildIdentificationVariableDisplayString(proposal),
- identificationVariableImage()
- );
- }
-
- private T buildIdentifierProposal(String proposal) {
-
- String additionalInfo = additionalInfo(proposal);
- IdentifierRole role = queryHelper.getQueryContext().getExpressionRegistry().getIdentifierRole(proposal);
- boolean realFunction = (role == IdentifierRole.FUNCTION) && isRealFunction(proposal);
- int cursorOffset = 0;
-
- // There is at least one letter before the cursor, if the setting "Match First Letter Case"
- // is true, then match the case of the JPQL identifier with the first character
- if ((partialWord.length() > 0) && shouldMatchFirstCharacterCase()) {
- if (Character.isLowerCase(partialWord.charAt(0))) {
- proposal = proposal.toLowerCase();
- }
- }
- // Convert the case of the JPQL identifier based on the setting
- else if (shouldUseLowercaseIdentifiers()) {
- proposal = proposal.toLowerCase();
- }
-
- // For JPQL function, we add () to the display string, example: AVG()
- // But for TRUE, FALSE, etc, we don't add ()
- if (realFunction) {
- proposal += "()";
- cursorOffset--;
- }
-
- return buildProposal(
- proposal,
- proposal,
- additionalInfo,
- identifierImage(realFunction),
- cursorOffset
- );
- }
-
- private T buildMappingProposal(IMapping mapping) {
- String proposal = mapping.getName();
- return buildProposal(proposal, proposal, mappingImage(mapping));
- }
-
- private T buildProposal(String proposal, String displayString, Image image) {
- return buildProposal(proposal, displayString, null, image, 0);
- }
-
- /**
- * Creates a new completion proposal for the given proposal.
- *
- * @param proposal A valid proposal that can be inserted into the query
- * @param displayString The human readable string of the proposal
- * @param additionalInfo Optional additional information about the proposal. The additional
- * information will be presented to assist the user in deciding if the selected proposal is the
- * desired choice
- * @param image The image that represents the proposal
- * @param cursorOffset An offset that moves the cursor backward or forward after it is adjusted
- * based on the given proposal
- * @return The completion proposal
- */
- abstract T buildProposal(String proposal,
- String displayString,
- String additionalInfo,
- Image image,
- int cursorOffset);
-
- /**
- * Creates the list of completion proposals based on the current content of the JPQL query and at
- * the specified position.
- *
- * @param namedQuery The model object used to access the application metadata information
- * @param actualQuery The model object may sometimes be out of sync with the actual content, the
- * actual query is required for proper content assist
- * @param offset The beginning of the string within the document
- * @param position The position of the cursor within the query, which starts at the beginning of
- * that query and not the document
- * @return The list of completion proposals
- */
- final List<T> buildProposals(NamedQuery namedQuery, String actualQuery, int offset, int position) {
-
- try {
- this.offset = offset;
- this.actualQuery = actualQuery;
- this.namedQuery = namedQuery;
-
- // It's possible the string has literal representation of the escape characters, if required,
- // convert them into actual escape characters and adjust the position accordingly
- int[] positions = { position };
- this.jpqlQuery = modifyJpqlQuery(actualQuery, positions);
- this.position = positions[0];
- this.partialWord = partialWord();
-
- // Create the query helper, initialize it and then retrieve the content assist proposals
- if (this.queryHelper == null) {
- this.queryHelper = namedQuery.getPersistenceUnit().createJpqlQueryHelper();
- }
-
- this.queryHelper.setQuery(namedQuery, jpqlQuery);
- this.contentAssistProposals = queryHelper.buildContentAssistProposals(positions[0]);
-
- // Create the proposals for those proposals
- List<T> proposals = new ArrayList<T>();
- addAbstractSchemaNames (proposals);
- addIdentificationVariables(proposals);
- addIdentifiers (proposals);
- addMappings (proposals);
-
- return proposals;
- }
- finally {
- clearInformation();
- }
- }
-
- final void checkCanceled(IProgressMonitor monitor) throws InterruptedException {
- if (monitor.isCanceled()) {
- throw new InterruptedException();
- }
- }
-
- /**
- * Clears the cached information.
- */
- final void clearInformation() {
- namedQuery = null;
- offset = -1;
- position = -1;
- actualQuery = null;
- namedQuery = null;
- partialWord = null;
- contentAssistProposals = null;
- }
-
- private Image entityImage() {
- return getImage(JptUiIcons.ENTITY);
- }
-
- /**
- * Returns the reason why this computer was unable to produce any completion proposals or
- * context information.
- *
- * @return An error message or <code>null</code> if no error occurred
- */
- public String getErrorMessage() {
- return null;
- }
-
- private Image getImage(String key) {
- ImageRegistry imageRegistry = getImageRegistry();
- Image image = imageRegistry.get(key);
- if (image == null) {
- imageRegistry.put(key, getImageDescriptor(key));
- image = imageRegistry.get(key);
- }
- return image;
- }
-
- private ImageDescriptor getImageDescriptor(String key) {
- return JptJpaUiPlugin.getImageDescriptor(key);
- }
-
- private ImageRegistry getImageRegistry() {
- if (imageRegistry == null) {
- imageRegistry = new ImageRegistry(Display.getCurrent());
- }
- return imageRegistry;
- }
-
- private Image identificationVariableImage() {
- return getImage(JptUiIcons.JPQL_VARIABLE);
- }
-
- private Image identifierImage(boolean function) {
-
- if (function) {
- return getImage(JptUiIcons.JPQL_FUNCTION);
- }
-
- return getImage(JptUiIcons.JPQL_IDENTIFIER);
- }
-
- private boolean isRealFunction(String identifier) {
- return identifier != Expression.TRUE &&
- identifier != Expression.FALSE &&
- identifier != Expression.NULL &&
- identifier != Expression.CURRENT_DATE &&
- identifier != Expression.CURRENT_TIME &&
- identifier != Expression.CURRENT_TIMESTAMP;
- }
-
- private Image mappingImage(IMapping mapping) {
- switch (mapping.getMappingType()) {
- case BASIC: return getImage(JptUiIcons.BASIC);
-// case BASIC_COLLECTION: return getImage(JptUiIcons.ELEMENT_COLLECTION);
-// case BASIC_MAP: return getImage(JptUiIcons.ELEMENT_COLLECTION);
- case ELEMENT_COLLECTION: return getImage(JptUiIcons.ELEMENT_COLLECTION);
- case EMBEDDED: return getImage(JptUiIcons.EMBEDDED);
- case EMBEDDED_ID: return getImage(JptUiIcons.EMBEDDED_ID);
- case ID: return getImage(JptUiIcons.ID);
- case MANY_TO_MANY: return getImage(JptUiIcons.MANY_TO_MANY);
- case MANY_TO_ONE: return getImage(JptUiIcons.MANY_TO_ONE);
- case ONE_TO_MANY: return getImage(JptUiIcons.ONE_TO_MANY);
- case ONE_TO_ONE: return getImage(JptUiIcons.ONE_TO_ONE);
-// case TRANSFORMATION: return getImage(JptUiIcons.BASIC); // TODO
-// case VARIABLE_ONE_TO_ONE: return getImage(JptUiIcons.ONE_TO_ONE); // TODO
- case VERSION: return getImage(JptUiIcons.VERSION);
- default: return getImage(JptUiIcons.TRANSIENT);
- }
- }
-
- /**
- * In some context, the given JPQL query needs to be modified before it is parsed.
- *
- * @param jpqlQuery The JPQL query to keep unchanged or to modify before parsing it
- * @param position The position of the cursor within the JPQL query, which needs to be updated if
- * the query is modified
- * @return The given JPQL query or a modified version that will be parsed
- */
- String modifyJpqlQuery(String jpqlQuery, int[] position) {
- return jpqlQuery;
- }
-
- private String partialWord() {
- WordParser wordParser = new WordParser(jpqlQuery);
- wordParser.setPosition(position);
- return wordParser.partialWord();
- }
-
- /**
- * Informs the computer that a content assist session has ended.
- */
- public void sessionEnded() {
-
- queryHelper = null;
- clearInformation();
-
- if (imageRegistry != null) {
- imageRegistry.dispose();
- }
- }
-
- /**
- * Informs the computer that a content assist session has started.
- */
- public void sessionStarted() {
- // Nothing to do
- }
-
- private boolean shouldMatchFirstCharacterCase() {
- return JpaJpqlPreferencesManager.getMatchFirstCharacterCaseWorkspacePreference();
- }
-
- private boolean shouldUseLowercaseIdentifiers() {
- String value = JpaJpqlPreferencesManager.getIdentifiersCaseWorkspacePreference();
- return JpaJpqlPreferencesManager.JPQL_IDENTIFIER_LOWERCASE_PREF_VALUE.equals(value);
- }
-
- private <I extends Comparable<? super I>> Iterable<I> sort(Iterable<I> iterator) {
- return CollectionTools.sort(iterator);
- }
-
- private Iterable<IEntity> sortByNames(Iterable<IEntity> abstractSchemaTypes) {
- return CollectionTools.sort(abstractSchemaTypes, buildEntityNameComparator());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlIdentifierMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlIdentifierMessages.java
deleted file mode 100644
index a8e66038c3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/JpqlIdentifierMessages.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpql;
-
-import java.lang.reflect.Field;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.persistence.jpa.jpql.parser.Expression;
-
-/**
- * The localized messages describing the JPQL identifiers.
- *
- * @version 3.1
- * @since 3.0
- * @author Pascal Filion
- */
-@SuppressWarnings("nls")
-final class JpqlIdentifierMessages extends NLS {
-
- // JPA 1.0 identifiers
- public static String ABS;
- public static String ALL;
- public static String ANY;
- public static String ASC;
- public static String AVG;
- public static String BETWEEN;
- public static String BOTH;
- public static String CONCAT;
- public static String COUNT;
- public static String CURRENT_DATE;
- public static String CURRENT_TIME;
- public static String CURRENT_TIMESTAMP;
- public static String DELETE_FROM;
- public static String DESC;
- public static String DISTINCT;
- public static String ESCAPE;
- public static String EXISTS;
- public static String FROM;
- public static String GROUP_BY;
- public static String HAVING;
- public static String IN;
- public static String IS_EMPTY;
- public static String IS_NULL;
- public static String JOIN;
- public static String JOIN_FETCH;
- public static String LEADING;
- public static String LENGTH;
- public static String LIKE;
- public static String LOCATE;
- public static String LOWER;
- public static String MAX;
- public static String MEMBER;
- public static String MIN;
- public static String MOD;
- public static String NEW;
- public static String OBJECT;
- public static String ORDER_BY;
- public static String SELECT;
- public static String SIZE;
- public static String SOME;
- public static String SQRT;
- public static String SUBSTRING;
- public static String SUM;
- public static String TRAILING;
- public static String TRIM;
- public static String UPDATE;
- public static String UPPER;
- public static String WHERE;
-
- // JPA 2.0 identifiers
- public static String CASE;
- public static String COALESCE;
- public static String ENTRY;
- public static String INDEX;
- public static String KEY;
- public static String NULLIF;
- public static String TYPE;
- public static String VALUE;
-
- // EclipseLink identifiers
- public static String FUNC;
- public static String TREAT;
-
- // Reserved JPQL identifiers
- public static String BIT_LENGTH;
- public static String CHAR_LENGTH;
- public static String CHARACTER_LENGTH;
- public static String CLASS;
- public static String POSITION;
- public static String UNKNOWN;
-
- static {
- NLS.initializeMessages("jpt_ui_jpql_identifiers", JpqlIdentifierMessages.class);
- }
-
- JpqlIdentifierMessages() {
- super();
- throw new UnsupportedOperationException();
- }
-
- private static Map<String, String> registeredIdentifers;
-
- private static Map<String, String> buildRegisteredIdentifers() {
-
- Map<String, String> identifiers = new HashMap<String, String>();
-
- identifiers.put(Expression.IS_NOT_EMPTY, Expression.IS_EMPTY);
- identifiers.put(Expression.IS_NOT_NULL, Expression.IS_NULL);
- identifiers.put(Expression.MEMBER_OF, Expression.MEMBER);
- identifiers.put(Expression.NOT_IN, Expression.IN);
- identifiers.put(Expression.NOT_BETWEEN, Expression.BETWEEN);
- identifiers.put(Expression.NOT_MEMBER, Expression.MEMBER);
- identifiers.put(Expression.NOT_MEMBER_OF, Expression.MEMBER);
-
- identifiers.put(Expression.INNER_JOIN, Expression.JOIN);
- identifiers.put(Expression.LEFT_JOIN, Expression.JOIN);
- identifiers.put(Expression.LEFT_OUTER_JOIN, Expression.JOIN);
-
- identifiers.put(Expression.INNER_JOIN_FETCH, Expression.JOIN_FETCH);
- identifiers.put(Expression.LEFT_JOIN_FETCH, Expression.JOIN_FETCH);
- identifiers.put(Expression.LEFT_OUTER_JOIN_FETCH, Expression.JOIN_FETCH);
-
- return identifiers;
- }
-
- /**
- * Converts the given JPQL identifier to the shortest form that is used to map the localized
- * message. If the identifier is <b>NOT MEMBER</b> for instance, then it needs to be converted
- * to <b>MEMBER</b> since that's the identifier used to map the localize message.
- *
- * @param identifier The JPQL identifier to convert, if needed
- * @return Either the given JPQL identifier or its counterpart that is used to map the localized
- * message
- */
- private static String convertIdentifier(String identifier) {
- identifier = registeredIdentifer(identifier);
- identifier = identifier.replace(" ", "_");
- return identifier;
- }
-
- /**
- * Retrieves the localized message for the given string value, if it's a JPQL identifier.
- *
- * @param identifier The JPQL identifier for which its localized description is needed
- * @return The localized message describing the given JPQL identifier or <code>null</code> if the
- * given choice is not an identifier
- */
- static String localizedMessage(String identifier) {
- try {
- identifier = convertIdentifier(identifier);
- Field constant = JpqlIdentifierMessages.class.getField(identifier);
- return (String) constant.get(null);
- }
- catch (Exception e) {
- // The choice is not a JPQL identifier
- return null;
- }
- }
-
- private static String registeredIdentifer(String identifier) {
- String another = registeredIdentifers().get(identifier);
- if (another != null) {
- return another;
- }
- return identifier;
- }
-
- private static Map<String, String> registeredIdentifers() {
- if (registeredIdentifers == null) {
- registeredIdentifers = buildRegisteredIdentifers();
- }
- return registeredIdentifers;
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/TextTransferHandler.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/TextTransferHandler.java
deleted file mode 100644
index febb9a1dd2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/jpql/TextTransferHandler.java
+++ /dev/null
@@ -1,228 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0 and Eclipse Distribution License v. 1.0
- * which accompanies this distribution.
- * The Eclipse Public License is available at http://www.eclipse.org/legal/epl-v10.html
- * and the Eclipse Distribution License is available at
- * http://www.eclipse.org/org/documents/edl-v10.php.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.jpql;
-
-import org.eclipse.jface.text.IUndoManager;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.dnd.Clipboard;
-import org.eclipse.swt.dnd.TextTransfer;
-import org.eclipse.swt.dnd.TransferData;
-import org.eclipse.swt.events.MenuEvent;
-import org.eclipse.swt.events.MenuListener;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
-import org.eclipse.ui.internal.WorkbenchMessages;
-
-/**
- * This handler adds a context menu onto a {@link StyledText} which have the default actions dealing
- * with text editing: Undo | Cut, Copy, Paste, Delete | Select All.
- *
- * @version 3.0
- * @since 3.0
- * @author Pascal Filion
- */
-@SuppressWarnings("restriction")
-public final class TextTransferHandler {
-
- private MenuItem copyMenuItem;
- private MenuItem cutMenuItem;
- private MenuItem deleteMenuItem;
- private MenuItem pasteMenuItem;
- private Menu popup;
- private MenuItem selectAllMenuItem;
- private StyledText styledText;
- private IUndoManager undoManager;
- private MenuItem undoMenuItem;
-
- private TextTransferHandler(StyledText styledText, IUndoManager undoManager) {
- super();
- this.styledText = styledText;
- this.undoManager = undoManager;
- }
-
- /**
- * Installs a context menu onto the given {@link StyledText} which have the default actions
- * dealing with text editing: Undo | Cut, Copy, Paste, Delete | Select All.
- *
- * @param styledText The widget for which a context menu will be added
- * @param undoManager The manager to undo keystrokes
- */
- public static void installContextMenu(StyledText styledText, IUndoManager undoManager) {
- TextTransferHandler handler = new TextTransferHandler(styledText, undoManager);
- handler.installPopup();
- }
-
- private SelectionAdapter buildCopySelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- styledText.copy();
- }
- };
- }
-
- private SelectionListener buildCutSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- styledText.cut();
- }
- };
- }
-
- private SelectionListener buildDeleteSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- Point selection = styledText.getSelection();
- styledText.replaceTextRange(selection.x, selection.y - selection.x, StringTools.EMPTY_STRING);
- }
- };
- }
-
- private MenuListener buildMenuListener() {
- return new MenuListener() {
- public void menuHidden(MenuEvent e) {
- }
- public void menuShown(MenuEvent e) {
- update();
- }
- };
- }
-
- private SelectionListener buildPasteSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- styledText.paste();
- }
- };
- }
-
- private SelectionListener buildSelectAllSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- styledText.selectAll();
- }
- };
- }
-
- private SelectionListener buildUndoSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- undoManager.undo();
- }
- };
- }
-
- private boolean canCopy() {
- Point selection = styledText.getSelection();
- return selection.x != selection.y;
- }
-
- private boolean canCut() {
- Point selection = styledText.getSelection();
- return selection.x != selection.y;
- }
-
- private boolean canDelete() {
- Point selection = styledText.getSelection();
- return selection.x != selection.y;
- }
-
- private boolean canPaste() {
-
- Clipboard clipboard = new Clipboard(styledText.getDisplay());
- boolean canPaste = false;
-
- for (TransferData data : clipboard.getAvailableTypes()) {
- if (TextTransfer.getInstance().isSupportedType(data)) {
- canPaste = true;
- break;
- }
- }
-
- clipboard.dispose();
- return canPaste;
- }
-
- private boolean canSelectAll() {
- Point selection = styledText.getSelection();
- String text = styledText.getText();
- return (selection.y - selection.x) != text.length();
- }
-
- private void installPopup() {
-
- popup = new Menu(styledText.getShell(), SWT.POP_UP);
- popup.addMenuListener(buildMenuListener());
- styledText.setMenu(popup);
-
- populatePopup();
- }
-
- private void populatePopup() {
-
- // Undo
- undoMenuItem = new MenuItem(popup, SWT.PUSH);
- undoMenuItem.setText(WorkbenchMessages.Workbench_undo);
- undoMenuItem.addSelectionListener(buildUndoSelectionListener());
-
- new MenuItem(popup, SWT.SEPARATOR);
-
- // Cut
- cutMenuItem = new MenuItem(popup, SWT.PUSH);
- cutMenuItem.setText(WorkbenchMessages.Workbench_cut);
- cutMenuItem.addSelectionListener(buildCutSelectionListener());
-
- // Copy
- copyMenuItem = new MenuItem(popup, SWT.PUSH);
- copyMenuItem.setText(WorkbenchMessages.Workbench_copy);
- copyMenuItem.addSelectionListener(buildCopySelectionListener());
-
- // Paste
- pasteMenuItem = new MenuItem(popup, SWT.PUSH);
- pasteMenuItem.setText(WorkbenchMessages.Workbench_paste);
- pasteMenuItem.addSelectionListener(buildPasteSelectionListener());
-
- // Delete
- deleteMenuItem = new MenuItem(popup, SWT.PUSH);
- deleteMenuItem.setText(WorkbenchMessages.Workbench_delete);
- deleteMenuItem.addSelectionListener(buildDeleteSelectionListener());
-
- new MenuItem(popup, SWT.SEPARATOR);
-
- // Select All
- selectAllMenuItem = new MenuItem(popup, SWT.PUSH);
- selectAllMenuItem.setText(WorkbenchMessages.Workbench_selectAll);
- selectAllMenuItem.addSelectionListener(buildSelectAllSelectionListener());
- }
-
- private void update() {
- deleteMenuItem .setEnabled(canDelete());
- copyMenuItem .setEnabled(canCopy());
- cutMenuItem .setEnabled(canCut());
- pasteMenuItem .setEnabled(canPaste());
- selectAllMenuItem.setEnabled(canSelectAll());
- undoMenuItem .setEnabled(undoManager.undoable());
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/listeners/SWTConnectionListenerWrapper.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/listeners/SWTConnectionListenerWrapper.java
deleted file mode 100644
index 4c5a5e2ade..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/listeners/SWTConnectionListenerWrapper.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.listeners;
-
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.RunnableAdapter;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ConnectionListener;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * Wrap another connection listener and forward events to it on the SWT
- * UI thread, asynchronously if necessary.
- */
-public class SWTConnectionListenerWrapper
- implements ConnectionListener
-{
-
- private final ConnectionListener listener;
-
- public SWTConnectionListenerWrapper(ConnectionListener listener) {
- super();
- if (listener == null) {
- throw new NullPointerException();
- }
- this.listener = listener;
- }
-
- public void opened(ConnectionProfile profile) {
- this.execute(new OpenedRunnable(profile));
- }
-
- /* CU private */ class OpenedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- OpenedRunnable(ConnectionProfile profile) {
- super();
- this.profile = profile;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.opened_(this.profile);
- }
- }
-
- void opened_(ConnectionProfile profile) {
- this.listener.opened(profile);
- }
-
- public void modified(ConnectionProfile profile) {
- this.execute(new ModifiedRunnable(profile));
- }
-
- /* CU private */ class ModifiedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- ModifiedRunnable(ConnectionProfile profile) {
- super();
- this.profile = profile;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.modified_(this.profile);
- }
- }
-
- void modified_(ConnectionProfile profile) {
- this.listener.modified(profile);
- }
-
- public boolean okToClose(ConnectionProfile profile) {
- OkToCloseRunnable r = new OkToCloseRunnable(profile);
- this.execute(r);
- return r.result; // result is unpredictable...
- }
-
- /* CU private */ class OkToCloseRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- volatile boolean result = true;
- OkToCloseRunnable(ConnectionProfile profile) {
- super();
- this.profile = profile;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.okToClose_(this.profile);
- }
- }
-
- boolean okToClose_(ConnectionProfile profile) {
- return this.listener.okToClose(profile);
- }
-
- public void aboutToClose(ConnectionProfile profile) {
- this.execute(new AboutToCloseRunnable(profile));
- }
-
- /* CU private */ class AboutToCloseRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- AboutToCloseRunnable(ConnectionProfile profile) {
- super();
- this.profile = profile;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.aboutToClose_(this.profile);
- }
- }
-
- void aboutToClose_(ConnectionProfile profile) {
- this.listener.aboutToClose(profile);
- }
-
- public void closed(ConnectionProfile profile) {
- this.execute(new ClosedRunnable(profile));
- }
-
- /* CU private */ class ClosedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- ClosedRunnable(ConnectionProfile profile) {
- super();
- this.profile = profile;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.closed_(this.profile);
- }
- }
-
- void closed_(ConnectionProfile profile) {
- this.listener.closed(profile);
- }
-
- public void databaseChanged(ConnectionProfile profile, Database database) {
- this.execute(new DatabaseChangedRunnable(profile, database));
- }
-
- /* CU private */ class DatabaseChangedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- private final Database database;
- DatabaseChangedRunnable(ConnectionProfile profile, Database database) {
- super();
- this.profile = profile;
- this.database = database;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.databaseChanged_(this.profile, this.database);
- }
- }
-
- void databaseChanged_(ConnectionProfile profile, Database database) {
- this.listener.databaseChanged(profile, database);
- }
-
- public void catalogChanged(ConnectionProfile profile, Catalog catalog) {
- this.execute(new CatalogChangedRunnable(profile, catalog));
- }
-
- /* CU private */ class CatalogChangedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- private final Catalog catalog;
- CatalogChangedRunnable(ConnectionProfile profile, Catalog catalog) {
- super();
- this.profile = profile;
- this.catalog = catalog;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.catalogChanged_(this.profile, this.catalog);
- }
- }
-
- void catalogChanged_(ConnectionProfile profile, Catalog catalog) {
- this.listener.catalogChanged(profile, catalog);
- }
-
- public void schemaChanged(ConnectionProfile profile, Schema schema) {
- this.execute(new SchemaChangedRunnable(profile, schema));
- }
-
- /* CU private */ class SchemaChangedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- private final Schema schema;
- SchemaChangedRunnable(ConnectionProfile profile, Schema schema) {
- super();
- this.profile = profile;
- this.schema = schema;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.schemaChanged_(this.profile, this.schema);
- }
- }
-
- void schemaChanged_(ConnectionProfile profile, Schema schema) {
- this.listener.schemaChanged(profile, schema);
- }
-
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence) {
- this.execute(new SequenceChangedRunnable(profile, sequence));
- }
-
- /* CU private */ class SequenceChangedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- private final Sequence sequence;
- SequenceChangedRunnable(ConnectionProfile profile, Sequence sequence) {
- super();
- this.profile = profile;
- this.sequence = sequence;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.sequenceChanged_(this.profile, this.sequence);
- }
- }
-
- void sequenceChanged_(ConnectionProfile profile, Sequence sequence) {
- this.listener.sequenceChanged(profile, sequence);
- }
-
- public void tableChanged(ConnectionProfile profile, Table table) {
- this.execute(new TableChangedRunnable(profile, table));
- }
-
- /* CU private */ class TableChangedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- private final Table table;
- TableChangedRunnable(ConnectionProfile profile, Table table) {
- super();
- this.profile = profile;
- this.table = table;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.tableChanged_(this.profile, this.table);
- }
- }
-
- void tableChanged_(ConnectionProfile profile, Table table) {
- this.listener.tableChanged(profile, table);
- }
-
- public void columnChanged(ConnectionProfile profile, Column column) {
- this.execute(new ColumnChangedRunnable(profile, column));
- }
-
- /* CU private */ class ColumnChangedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- private final Column column;
- ColumnChangedRunnable(ConnectionProfile profile, Column column) {
- super();
- this.profile = profile;
- this.column = column;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.columnChanged_(this.profile, this.column);
- }
- }
-
- void columnChanged_(ConnectionProfile profile, Column column) {
- this.listener.columnChanged(profile, column);
- }
-
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey) {
- this.execute(new ForeignKeyChangedRunnable(profile, foreignKey));
- }
-
- /* CU private */ class ForeignKeyChangedRunnable
- extends RunnableAdapter
- {
- private final ConnectionProfile profile;
- private final ForeignKey foreignKey;
- ForeignKeyChangedRunnable(ConnectionProfile profile, ForeignKey foreignKey) {
- super();
- this.profile = profile;
- this.foreignKey = foreignKey;
- }
- @Override
- public void run() {
- SWTConnectionListenerWrapper.this.foreignKeyChanged_(this.profile, this.foreignKey);
- }
- }
-
- void foreignKeyChanged_(ConnectionProfile profile, ForeignKey foreignKey) {
- this.listener.foreignKeyChanged(profile, foreignKey);
- }
-
- /**
- * {@link SWTUtil#execute(Runnable)} seems to work OK;
- * but using {@link SWTUtil#syncExec(Runnable)} can somtimes make things
- * more predictable when debugging, at the risk of deadlocks.
- */
- private void execute(Runnable r) {
- SWTUtil.execute(r);
-// SWTUtil.syncExec(r);
- }
-
- @Override
- public String toString() {
- return "SWT(" + this.listener + ')'; //$NON-NLS-1$
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/MapAsContribution.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/MapAsContribution.java
deleted file mode 100644
index a77968e76a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/MapAsContribution.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.menus;
-
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.internal.jface.ImageImageDescriptor;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.FilteringIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.ui.ISources;
-import org.eclipse.ui.actions.CompoundContributionItem;
-import org.eclipse.ui.handlers.IHandlerService;
-import org.eclipse.ui.menus.CommandContributionItem;
-import org.eclipse.ui.menus.CommandContributionItemParameter;
-import org.eclipse.ui.menus.IWorkbenchContribution;
-import org.eclipse.ui.services.IServiceLocator;
-import com.ibm.icu.text.Collator;
-
-/**
- * This menu contribution is responsible to populate the Map As menu with the
- * registered mapping types defined in the <code>JptPlatformUi</code>.
- *
- * @see JpaPlatform
- * @see JpaPlatformUi
- *
- * @version 2.0
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public abstract class MapAsContribution<T extends JpaStructureNode>
- extends CompoundContributionItem
- implements IWorkbenchContribution
-{
- /**
- * Keeps track of the <code>IServiceLocator</code> which is used to retrieve
- * various services required for invoking the <code>PersistentAttributeMapAsHandler</code>.
- */
- private IServiceLocator serviceLocator;
-
-
- /**
- * Creates a new <code>PersistentAttributeMapAsContribution</code>.
- */
- public MapAsContribution() {
- super();
- }
-
-
- public void initialize(IServiceLocator serviceLocator) {
- this.serviceLocator = serviceLocator;
- }
-
- @Override
- protected IContributionItem[] getContributionItems() {
- // Retrieve the selection from the handler service
- // which should be an IStructuredSelection of JpaStructureNodes
- IHandlerService handlerService =
- (IHandlerService) this.serviceLocator.getService(IHandlerService.class);
- IStructuredSelection currentSelection =
- (IStructuredSelection) handlerService.getCurrentState().getVariable(ISources.ACTIVE_CURRENT_SELECTION_NAME);
-
- // Assume that all nodes are in the same project (which is very safe)
- // and retrieve the mapping UI providers just from the first item
- T node = (T) currentSelection.getFirstElement();
-
- return
- ArrayTools.array(
- new TransformationIterator<MappingUiDefinition<T, ?>, IContributionItem>(mappingUiDefinitions(node)) {
- @Override
- protected IContributionItem transform(MappingUiDefinition<T, ?> next) {
- return createContributionItem(next);
- }
- },
- EMPTY_CONTRIBUTION_ITEM_ARRAY);
- }
- protected static final IContributionItem[] EMPTY_CONTRIBUTION_ITEM_ARRAY = new IContributionItem[0];
-
-
- protected Comparator<MappingUiDefinition<T, ?>> getDefinitionsComparator() {
- return new Comparator<MappingUiDefinition<T, ?>>() {
- public int compare(MappingUiDefinition<T, ?> item1, MappingUiDefinition<T, ?> item2) {
- String displayString1 = item1.getLabel();
- String displayString2 = item2.getLabel();
- return Collator.getInstance().compare(displayString1, displayString2);
- }
- };
- }
-
- /**
- * Retrieves the registered {@link MappingUiDefinition}s from the given node,
- * using its {@link JpaPlatformUi}.
- *
- * @param node A test node to determine the {@link JpaPlatformUi} and type
- * of providers to return
- * @return The list of registered {@link MappingUiDefinition}s
- */
- protected <U extends T> Iterator<? extends MappingUiDefinition<T, ?>> mappingUiDefinitions(final T node) {
- JpaPlatformUi jpaPlatformUi = (JpaPlatformUi) node.getJpaPlatform().getAdapter(JpaPlatformUi.class);
-
- Iterator<? extends MappingUiDefinition<T, ?>> sortedMappingUiDefinitions =
- CollectionTools.sort(
- new FilteringIterator<MappingUiDefinition<T, ?>>(
- mappingUiDefinitions(jpaPlatformUi, node.getResourceType())) {
- @Override
- protected boolean accept(MappingUiDefinition<T, ?> o) {
- return o.isEnabledFor(node);
- }
- },
- getDefinitionsComparator());
-
- DefaultMappingUiDefinition<T, ?> defaultDefinition = getDefaultMappingUiDefinition(jpaPlatformUi, node);
- if (defaultDefinition != null) {
- return new CompositeIterator<MappingUiDefinition<T, ?>>(defaultDefinition, sortedMappingUiDefinitions);
- }
- return sortedMappingUiDefinitions;
- }
-
- /**
- * Retrieves the registered {@link MappingUiDefinition}s from the given
- * {@link JpaPlatformUi} and {@link JpaStructureNode} (to determine type of
- * mapping providers to retrieve).
- *
- * @param jpaPlatformUi The active {@link JpaPlatformUi} from where the
- * provider can be retrieved
- * @param node A test node to determine type of providers to return
- * @return The list of registered {@link MappingUiDefinition}s
- */
- protected abstract Iterator<? extends MappingUiDefinition<T, ?>>
- mappingUiDefinitions(JpaPlatformUi platformUi, JptResourceType resourceType);
-
- /**
- * Creates the default provider responsible for clearing the mapping type.
- * If not default provider, then return null
- *
- * @return A provider that acts as a default mapping provider
- */
- protected abstract DefaultMappingUiDefinition<T, ?> getDefaultMappingUiDefinition(JpaPlatformUi platformUi, T node);
-
- protected IContributionItem createContributionItem(MappingUiDefinition<T, ?> mappingUiProvider) {
- return new CommandContributionItem(createParameter(mappingUiProvider));
- }
-
- protected CommandContributionItemParameter createParameter(MappingUiDefinition<T, ?> mappingUiDefinition) {
- CommandContributionItemParameter parameter =
- new CommandContributionItemParameter(
- this.serviceLocator,
- createCommandContributionItemId(mappingUiDefinition),
- getCommandId(),
- CommandContributionItem.STYLE_CHECK);
- parameter.label = mappingUiDefinition.getLabel();
- Map<String, String> parameters = new HashMap<String, String>();
- parameters.put(getCommandParameterId(), mappingUiDefinition.getKey());
- parameter.parameters = parameters;
- parameter.icon = new ImageImageDescriptor(mappingUiDefinition.getImage());
- parameter.visibleEnabled = true;
- return parameter;
- }
-
- /**
- * Retrieves the unique identifier of the command that will be invoked for
- * changing the mapping type of the selected nodes.
- *
- * @return The unique identifier of the "map as" command
- */
- protected abstract String getCommandId();
-
- /**
- * Retrieves the unique identifier of the mapping key command parameter that
- * will be used for the new mapping type of the selected nodes.
- *
- * @return The unique identifier of the "map as" command parameter
- */
- protected abstract String getCommandParameterId();
-
- /**
- * Returns an id for a {@link CommandContributionItem} in the form of
- * "<commandId>.<mappingKey>"
- * (for example "org.eclipse.jpt.jpa.core.ui.persistentTypeMapAs.entity")
- */
- protected String createCommandContributionItemId(MappingUiDefinition<T, ?> mappingUiDefinition) {
- return getCommandId() + "." + mappingUiDefinition.getKey();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentAttributeMapAsContribution.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentAttributeMapAsContribution.java
deleted file mode 100644
index 45e1c6393b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentAttributeMapAsContribution.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.menus;
-
-import java.util.Iterator;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.commands.PersistentAttributeMapAsHandler;
-import org.eclipse.ui.menus.CommandContributionItemParameter;
-
-/**
- * This menu contribution is responsible to populate the Map As menu with the
- * registered attribute mapping types defined in the <code>JptPlatformUi</code>
- * for <code>PersistentAttribute</code> objects.
- *
- * @see PersistentAttributeMapAsHandler
- * @see PersistentAttribute
- *
- * @version 2.2
- * @since 2.0
- */
-public class PersistentAttributeMapAsContribution
- extends MapAsContribution<ReadOnlyPersistentAttribute>
-{
- /**
- * Creates a new <code>PersistentAttributeMapAsContribution</code>.
- */
- public PersistentAttributeMapAsContribution() {
- super();
- }
-
- @Override
- protected String getCommandId() {
- return PersistentAttributeMapAsHandler.COMMAND_ID;
- }
-
- @Override
- protected String getCommandParameterId() {
- return PersistentAttributeMapAsHandler.SPECIFIED_MAPPING_COMMAND_PARAMETER_ID;
- }
-
- @Override
- protected CommandContributionItemParameter createParameter(MappingUiDefinition<ReadOnlyPersistentAttribute, ?> mappingUiProvider) {
- CommandContributionItemParameter parameter = super.createParameter(mappingUiProvider);
- String defaultKey = null;
- if (mappingUiProvider instanceof DefaultMappingUiDefinition<?, ?>) {
- defaultKey = ((DefaultMappingUiDefinition<? extends PersistentAttribute, ?>) mappingUiProvider).getDefaultKey();
- }
- parameter.parameters.put(PersistentAttributeMapAsHandler.DEFAULT_MAPPING_COMMAND_PARAMETER_ID, defaultKey);
- return parameter;
- }
-
- @Override
- protected Iterator<? extends MappingUiDefinition<ReadOnlyPersistentAttribute, ?>> mappingUiDefinitions(
- JpaPlatformUi jpaPlatformUi, JptResourceType resourceType) {
-
- return jpaPlatformUi.attributeMappingUiDefinitions(resourceType);
- }
-
- @Override
- protected DefaultMappingUiDefinition<ReadOnlyPersistentAttribute, ?> getDefaultMappingUiDefinition(
- JpaPlatformUi jpaPlatformUi, ReadOnlyPersistentAttribute node) {
-
- return getDefaultMappingUiDefinition(
- jpaPlatformUi,
- ((PersistentAttribute) node).getDefaultMappingKey(),
- node.getResourceType());
- }
-
- protected DefaultMappingUiDefinition<ReadOnlyPersistentAttribute, ?> getDefaultMappingUiDefinition(
- JpaPlatformUi jpaPlatformUi, String defaultMappingKey, JptResourceType resourceType) {
-
- return jpaPlatformUi.getDefaultAttributeMappingUiDefinition(resourceType, defaultMappingKey);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentTypeMapAsContribution.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentTypeMapAsContribution.java
deleted file mode 100644
index ac878eb934..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/menus/PersistentTypeMapAsContribution.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.menus;
-
-import java.util.Iterator;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.commands.PersistentTypeMapAsHandler;
-
-/**
- * This menu contribution is responsible to populate the Map As menu with the
- * registered mapping types defined in the <code>JptPlatformUi</code> for
- * <code>PersistentType</code> objects.
- *
- * @see JpaPlatform
- * @see JpaPlatformUi
- * @see PersistentType
- */
-public class PersistentTypeMapAsContribution
- extends MapAsContribution<PersistentType>
-{
- /**
- * Creates a new <code>PersistentTypeMapAsContribution</code>.
- */
- public PersistentTypeMapAsContribution() {
- super();
- }
-
-
- @Override
- protected String getCommandId() {
- return PersistentTypeMapAsHandler.COMMAND_ID;
- }
-
- @Override
- protected String getCommandParameterId() {
- return PersistentTypeMapAsHandler.COMMAND_PARAMETER_ID;
- }
-
- @Override
- protected Iterator<? extends MappingUiDefinition<PersistentType, ?>> mappingUiDefinitions(
- JpaPlatformUi jpaPlatformUi, JptResourceType resourceType) {
-
- return jpaPlatformUi.typeMappingUiDefinitions(resourceType);
- }
-
- @Override
- protected DefaultMappingUiDefinition<PersistentType, ?> getDefaultMappingUiDefinition(
- JpaPlatformUi jpaPlatformUi, PersistentType node) {
-
- return jpaPlatformUi.getDefaultTypeMappingUiDefinition(node.getResourceType());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorActionProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorActionProvider.java
deleted file mode 100644
index 1e9d741aa2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorActionProvider.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.navigator;
-
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jpa.ui.internal.actions.OpenJpaResourceAction;
-import org.eclipse.ui.IActionBars;
-import org.eclipse.ui.actions.ActionContext;
-import org.eclipse.ui.navigator.CommonActionProvider;
-import org.eclipse.ui.navigator.ICommonActionConstants;
-import org.eclipse.ui.navigator.ICommonActionExtensionSite;
-import org.eclipse.ui.navigator.ICommonMenuConstants;
-
-/**
- * The selection will be a JPA context node.
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class JpaNavigatorActionProvider
- extends CommonActionProvider
-{
- private OpenJpaResourceAction openAction;
-
-
- public JpaNavigatorActionProvider() {
- super();
- }
-
- @Override
- public void init(ICommonActionExtensionSite config) {
- this.openAction = new OpenJpaResourceAction();
- }
-
- @Override
- public void setContext(ActionContext context) {
- if ((context != null) && (context.getSelection() instanceof IStructuredSelection)) {
- IStructuredSelection selection = (IStructuredSelection) context.getSelection();
- this.openAction.selectionChanged(selection);
- }
- super.setContext(context);
- }
-
- @Override
- public void fillActionBars(IActionBars actionBars) {
- if (this.openAction.isEnabled()) {
- actionBars.setGlobalActionHandler(ICommonActionConstants.OPEN, this.openAction);
- }
- }
-
- @Override
- public void fillContextMenu(IMenuManager menuManager) {
- ActionContext context = this.getContext();
- if ((context == null) || context.getSelection().isEmpty()) {
- return;
- }
-
- if (this.openAction.isEnabled()) {
- menuManager.insertAfter(ICommonMenuConstants.GROUP_OPEN, this.openAction);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorContentProvider.java
deleted file mode 100644
index 3c6cf5ef0b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorContentProvider.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.navigator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.ui.internal.jface.NavigatorContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel;
-
-/**
- * This provider is invoked for:<ul>
- * <li>Eclipse projects with a JPA facet
- * <li>JPA root context node models
- * <li>JPA context nodes
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class JpaNavigatorContentProvider
- extends NavigatorContentProvider
-{
- public JpaNavigatorContentProvider() {
- super();
- }
-
- @Override
- protected ItemTreeContentProviderFactory buildItemContentProviderFactory() {
- return new JpaNavigatorItemContentProviderFactory();
- }
-
- @Override
- protected ItemExtendedLabelProviderFactory buildItemLabelProviderFactory() {
- return new JpaNavigatorItemLabelProviderFactory();
- }
-
- @Override
- protected boolean hasChildren_(Object element) {
- return this.getRootContextNodeModel(element) != null;
- }
-
- /**
- * We handle the children for an {@link IProject} here and delegate
- * all others.
- */
- @Override
- protected Object[] getChildren_(Object element) {
- JpaRootContextNodeModel child = this.getRootContextNodeModel(element);
- return (child == null) ? null : new Object[] {child};
- }
-
- /**
- * This provider should only be invoked for projects that have the
- * JPA facet; so we return a JPA root context node model for any
- * project passed in.
- * <p>
- * <strong>NB:</strong> There is no way to refresh the navigator when the
- * JPA facet is added to a project. The view must be explicitly refreshed,
- * forcing it to re-examine the provider trigger points.
- */
- private JpaRootContextNodeModel getRootContextNodeModel(Object element) {
- return (element instanceof IProject) ?
- (JpaRootContextNodeModel) ((IProject) element).getAdapter(JpaRootContextNodeModel.class) :
- null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorItemContentProviderFactory.java
deleted file mode 100644
index fd67193daa..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorItemContentProviderFactory.java
+++ /dev/null
@@ -1,85 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.navigator;
-
-import java.util.HashMap;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel;
-
-/**
- * This factory can be used by a item tree content provider that must provide
- * content for a tree that can contain items from multiple JPA platforms (e.g.
- * the Project Explorer). This factory will delegate to the factory appropriate
- * to the item's JPA platform. The cache of JPA platform-specific factories is
- * populated as needed and is never purged. Theoretically, this could be a
- * singleton....
- */
-public class JpaNavigatorItemContentProviderFactory
- implements ItemTreeContentProviderFactory
-{
- /**
- * Delegate factories, keyed by JPA platform.
- */
- private HashMap<JpaPlatform, ItemTreeContentProviderFactory> delegates = new HashMap<JpaPlatform, ItemTreeContentProviderFactory>();
-
-
- public JpaNavigatorItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof JpaRootContextNodeModel) {
- return this.buildRootContextNodeModelProvider((JpaRootContextNodeModel) item, manager);
- }
- ItemTreeContentProviderFactory delegate = this.getDelegate(item);
- return (delegate == null) ? null : delegate.buildProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildRootContextNodeModelProvider(JpaRootContextNodeModel item, Manager manager) {
- return new RootContextNodeModelItemContentProvider(item, manager);
- }
-
- private ItemTreeContentProviderFactory getDelegate(Object element) {
- return (element instanceof JpaContextNode) ? this.getDelegate((JpaContextNode) element) : null;
- }
-
- private synchronized ItemTreeContentProviderFactory getDelegate(JpaContextNode contextNode) {
- JpaPlatform jpaPlatform = contextNode.getJpaProject().getJpaPlatform();
- ItemTreeContentProviderFactory delegate = this.delegates.get(jpaPlatform);
- if (delegate == null) {
- if ( ! this.delegates.containsKey(jpaPlatform)) { // null is an allowed value
- delegate = this.buildDelegate(jpaPlatform);
- this.delegates.put(jpaPlatform, delegate);
- }
- }
- return delegate;
- }
-
- private ItemTreeContentProviderFactory buildDelegate(JpaPlatform jpaPlatform) {
- JpaPlatformUi platformUI = (JpaPlatformUi) jpaPlatform.getAdapter(JpaPlatformUi.class);
- if (platformUI == null) {
- return null;
- }
- ItemTreeStateProviderFactoryProvider factoryProvider = platformUI.getNavigatorFactoryProvider();
- return (factoryProvider == null) ? null : factoryProvider.getItemContentProviderFactory();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorItemLabelProviderFactory.java
deleted file mode 100644
index 2cb8203aa9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/JpaNavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.navigator;
-
-import java.util.HashMap;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel;
-
-/**
- * @see JpaNavigatorItemContentProviderFactory
- */
-public class JpaNavigatorItemLabelProviderFactory
- implements ItemExtendedLabelProviderFactory
-{
- /**
- * Delegate factories, keyed by JPA platform.
- */
- private final HashMap<JpaPlatform, ItemExtendedLabelProviderFactory> delegates = new HashMap<JpaPlatform, ItemExtendedLabelProviderFactory>();
-
-
- public JpaNavigatorItemLabelProviderFactory() {
- super();
- }
-
- public ItemExtendedLabelProvider buildProvider(Object item, ItemExtendedLabelProvider.Manager manager) {
- if (item instanceof JpaRootContextNodeModel) {
- return this.buildRootContextNodeModelProvider((JpaRootContextNodeModel) item, manager);
- }
- ItemExtendedLabelProviderFactory delegate = this.getDelegate(item);
- return (delegate == null) ? null : delegate.buildProvider(item, manager);
- }
-
- protected ItemExtendedLabelProvider buildRootContextNodeModelProvider(JpaRootContextNodeModel item, ItemExtendedLabelProvider.Manager manager) {
- return new RootContextNodeModelItemLabelProvider(item, manager);
- }
-
- private ItemExtendedLabelProviderFactory getDelegate(Object item) {
- return (item instanceof JpaContextNode) ? this.getDelegate((JpaContextNode) item) : null;
- }
-
- private synchronized ItemExtendedLabelProviderFactory getDelegate(JpaContextNode item) {
- JpaPlatform jpaPlatform = item.getJpaProject().getJpaPlatform();
- ItemExtendedLabelProviderFactory delegate = this.delegates.get(jpaPlatform);
- if (delegate == null) {
- if ( ! this.delegates.containsKey(jpaPlatform)) { // null is an allowed value
- delegate = this.buildDelegate(jpaPlatform);
- this.delegates.put(jpaPlatform, delegate);
- }
- }
- return delegate;
- }
-
- private ItemExtendedLabelProviderFactory buildDelegate(JpaPlatform jpaPlatform) {
- JpaPlatformUi platformUI = (JpaPlatformUi) jpaPlatform.getAdapter(JpaPlatformUi.class);
- if (platformUI == null) {
- return null;
- }
- ItemTreeStateProviderFactoryProvider factoryProvider = platformUI.getNavigatorFactoryProvider();
- return (factoryProvider == null) ? null : factoryProvider.getItemLabelProviderFactory();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/RootContextNodeModelItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/RootContextNodeModelItemContentProvider.java
deleted file mode 100644
index 72737540fe..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/RootContextNodeModelItemContentProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.navigator;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel;
-
-public class RootContextNodeModelItemContentProvider
- extends AbstractItemTreeContentProvider<JpaRootContextNodeModel, PersistenceXml>
-{
- public RootContextNodeModelItemContentProvider(JpaRootContextNodeModel rootContextModel, Manager manager) {
- super(rootContextModel, manager);
- }
-
- public IProject getParent() {
- return this.item.getProject();
- }
-
- @Override
- protected CollectionValueModel<PersistenceXml> buildChildrenModel() {
- return new PropertyCollectionValueModelAdapter<PersistenceXml>(this.buildPersistenceXmlModel());
- }
-
- protected PropertyValueModel<PersistenceXml> buildPersistenceXmlModel() {
- return new PersistenceXmlModel(this.item);
- }
-
- public static class PersistenceXmlModel
- extends PropertyAspectAdapter<JpaRootContextNode, PersistenceXml>
- {
- public PersistenceXmlModel(PropertyValueModel<JpaRootContextNode> rootContextNodeModel) {
- super(rootContextNodeModel, JpaRootContextNode.PERSISTENCE_XML_PROPERTY);
- }
- @Override
- protected PersistenceXml buildValue_() {
- return this.subject.getPersistenceXml();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/RootContextNodeModelItemLabelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/RootContextNodeModelItemLabelProvider.java
deleted file mode 100644
index a46fe977c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/navigator/RootContextNodeModelItemLabelProvider.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.navigator;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.TransformerAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.ui.JpaRootContextNodeModel;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.graphics.Image;
-
-public class RootContextNodeModelItemLabelProvider
- extends AbstractItemExtendedLabelProvider<JpaRootContextNodeModel>
-{
- public RootContextNodeModelItemLabelProvider(JpaRootContextNodeModel rootContextNodeModel, ItemLabelProvider.Manager manager) {
- super(rootContextNodeModel, manager);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new TransformationPropertyValueModel<JpaRootContextNode, Image>(this.item, IMAGE_TRANSFORMER);
- }
-
- protected static final Transformer<JpaRootContextNode, Image> IMAGE_TRANSFORMER = new ImageTransformer();
-
- protected static class ImageTransformer
- extends TransformerAdapter<JpaRootContextNode, Image>
- {
- @Override
- public Image transform(JpaRootContextNode root) {
- return (root != null) ?
- JptJpaUiPlugin.getImage(JptUiIcons.JPA_CONTENT) :
- JptUiIcons.ghost(JptUiIcons.JPA_CONTENT);
- }
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new TransformationPropertyValueModel<JpaRootContextNode, String>(this.item, TEXT_TRANSFORMER);
- }
-
- protected static final Transformer<JpaRootContextNode, String> TEXT_TRANSFORMER = new TextTransformer();
-
- protected static class TextTransformer
- extends TransformerAdapter<JpaRootContextNode, String>
- {
- @Override
- public String transform(JpaRootContextNode root) {
- String text = JptUiMessages.JpaContent_label;
- return (root != null) ? text : "[" + text + "]"; //$NON-NLS-1$ //$NON-NLS-2$
- }
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return new TransformationPropertyValueModel<JpaRootContextNode, String>(this.item, DESCRIPTION_TRANSFORMER);
- }
-
- protected static final Transformer<JpaRootContextNode, String> DESCRIPTION_TRANSFORMER = new DescriptionTransformer();
-
- protected static class DescriptionTransformer
- extends TransformerAdapter<JpaRootContextNode, String>
- {
- @Override
- public String transform(JpaRootContextNode root) {
- if (root == null) {
- return null;
- }
-
- StringBuilder sb = new StringBuilder();
- sb.append(JptUiMessages.JpaContent_label);
- sb.append(" - "); //$NON-NLS-1$
- sb.append(root.getResource().getFullPath().makeRelative());
- return sb.toString();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/JptUiPersistenceMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/JptUiPersistenceMessages.java
deleted file mode 100644
index fa852649bc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/JptUiPersistenceMessages.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali persistence editor.
- *
- * @version 2.0
- * @since 2.0
- */
-public class JptUiPersistenceMessages {
-
- public static String ArchiveFileSelectionDialog_jarPathHelpLabel;
- public static String ArchiveFileSelectionDialog_jarPathLabel;
-
- public static String PersistenceEditor_page_help;
- public static String PersistenceEditor_sourceTab;
-
- public static String PersistenceUnitClassesComposite_description;
- public static String PersistenceUnitClassesComposite_excludeUnlistedMappedClasses;
- public static String PersistenceUnitClassesComposite_excludeUnlistedMappedClassesWithDefault;
- public static String PersistenceUnitClassesComposite_mappedClassesNoName;
- public static String PersistenceUnitClassesComposite_open;
-
- public static String PersistenceUnitConnectionComposite_connection;
- public static String PersistenceUnitConnectionComposite_database;
- public static String PersistenceUnitConnectionComposite_general;
-
- public static String PersistenceUnitConnectionDatabaseComposite_jtaDatasourceName;
- public static String PersistenceUnitConnectionDatabaseComposite_nonJtaDatasourceName;
-
- public static String PersistenceUnitConnectionGeneralComposite_default;
- public static String PersistenceUnitConnectionGeneralComposite_jta;
- public static String PersistenceUnitConnectionGeneralComposite_resource_local;
- public static String PersistenceUnitConnectionGeneralComposite_transactionType;
-
- public static String PersistenceUnitGeneralComposite_general;
- public static String PersistenceUnitGeneralComposite_jarFiles;
- public static String PersistenceUnitGeneralComposite_jpaMappingDescriptors;
- public static String PersistenceUnitGeneralComposite_jpaMappingDescriptors_description;
- public static String PersistenceUnitGeneralComposite_mappedClasses;
- public static String PersistenceUnitGeneralComposite_name;
- public static String PersistenceUnitGeneralComposite_persistenceProvider;
- public static String PersistenceUnitGeneralComposite_description;
-
- public static String PersistenceUnitJarFilesComposite_noFileName;
- public static String PersistenceUnitMappingFilesComposite_jarFileDialog_title;
- public static String PersistenceUnitMappingFilesComposite_jarFileDialog_message;
-
- public static String PersistenceUnitMappingFilesComposite_mappingFileDialog_message;
- public static String PersistenceUnitMappingFilesComposite_mappingFileDialog_title;
- public static String PersistenceUnitMappingFilesComposite_ormNoName;
-
- public static String PersistenceUnitPropertiesComposite_nameColumn;
- public static String PersistenceUnitPropertiesComposite_properties;
- public static String PersistenceUnitPropertiesComposite_properties_description;
- public static String PersistenceUnitPropertiesComposite_valueColumn;
-
- private static final String BUNDLE_NAME = "jpt_ui_persistence"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptUiPersistenceMessages.class;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptUiPersistenceMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/AbstractPersistenceXmlResourceUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/AbstractPersistenceXmlResourceUiDefinition.java
deleted file mode 100644
index 19ff3fffbc..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/AbstractPersistenceXmlResourceUiDefinition.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.PersistenceXmlResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * All the state in the definition should be "static" (i.e. unchanging once it is initialized).
- */
-public abstract class AbstractPersistenceXmlResourceUiDefinition
- implements ResourceUiDefinition, PersistenceXmlResourceUiDefinition
-{
-
-
- private final PersistenceXmlUiFactory factory;
-
-
- /**
- * zero-argument constructor
- */
- protected AbstractPersistenceXmlResourceUiDefinition() {
- super();
- this.factory = buildPersistenceXmlUiFactory();
- }
-
-
- protected abstract PersistenceXmlUiFactory buildPersistenceXmlUiFactory();
-
- public PersistenceXmlUiFactory getFactory() {
- return this.factory;
- }
-
- public ListIterator<JpaPageComposite> buildPersistenceUnitComposites(PropertyValueModel<PersistenceUnit> subjectHolder, Composite parent, WidgetFactory widgetFactory) {
- return this.factory.createPersistenceUnitComposites(subjectHolder, parent, widgetFactory);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/ArchiveFileSelectionDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/ArchiveFileSelectionDialog.java
deleted file mode 100644
index c24be8ae51..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/ArchiveFileSelectionDialog.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import java.util.Collections;
-
-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.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jpt.common.ui.internal.jface.ArchiveFileViewerFilter;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
-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 ArchiveFileSelectionDialog
- extends ElementTreeSelectionDialog
-{
- private final ModifiablePropertyValueModel<String> jarPathModel;
-
- private DeploymentPathCalculator pathCalculator;
-
-
- public ArchiveFileSelectionDialog(Shell parent) {
- this(parent, new SimpleDeploymentPathCalculator());
- }
-
- public ArchiveFileSelectionDialog(Shell parent, DeploymentPathCalculator pathCalculator) {
- super(parent, new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- this.pathCalculator = pathCalculator;
- setComparator(new ResourceComparator(ResourceComparator.NAME));
- addFilter(new ArchiveFileViewerFilter());
- setValidator(new ArchiveFileSelectionValidator());
- this.jarPathModel = new SimplePropertyValueModel<String>();
- }
-
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
-
- Label helpLabel = new Label(composite, SWT.WRAP);
- helpLabel.setText(JptUiPersistenceMessages.ArchiveFileSelectionDialog_jarPathHelpLabel);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 400;
- helpLabel.setLayoutData(gd);
-
- Composite subComposite = new Composite(composite, SWT.NONE);
- subComposite.setLayout(new GridLayout(2, false));
- subComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Label jarPathLabel = new Label(subComposite, SWT.NONE);
- jarPathLabel.setFont(composite.getFont());
- jarPathLabel.setText(JptUiPersistenceMessages.ArchiveFileSelectionDialog_jarPathLabel);
-
- Text jarPathText = new Text(subComposite, SWT.BORDER);
- jarPathText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- SWTTools.bind(jarPathModel, jarPathText);
-
- return composite;
- }
-
- @Override
- protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
- TreeViewer treeViewer = super.doCreateTreeViewer(parent, style);
-
- treeViewer.addSelectionChangedListener(
- new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- updateJarPathModel(event.getSelection());
- }
- });
-
- return treeViewer;
- }
-
- protected void updateJarPathModel(ISelection selection) {
- Object selectedObj = ((IStructuredSelection) selection).getFirstElement();
- if (selectedObj instanceof IFile) {
- this.jarPathModel.setValue(calculateDeployPath((IFile) selectedObj));
- }
- else {
- this.jarPathModel.setValue("");
- }
- }
-
- protected String calculateDeployPath(IFile archiveFile) {
- return this.pathCalculator.calculateDeploymentPath(archiveFile);
- }
-
- @Override
- protected void computeResult() {
- setResult(Collections.singletonList(this.jarPathModel.getValue()));
- }
-
-
- private static class ArchiveFileSelectionValidator
- implements ISelectionStatusValidator
- {
- public ArchiveFileSelectionValidator() {
- super();
- }
-
-
- public IStatus validate(Object[] selection) {
- int nSelected= selection.length;
- if (nSelected == 0 || (nSelected > 1)) {
- return new Status(IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID, ""); //$NON-NLS-1$
- }
- for (int i= 0; i < selection.length; i++) {
- Object curr= selection[i];
- if (curr instanceof IFile) {
- return new Status(IStatus.OK, JptJpaUiPlugin.PLUGIN_ID, ""); //$NON-NLS-1$
- }
- }
- return new Status(IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID, ""); //$NON-NLS-1$
- }
- }
-
-
- public static interface DeploymentPathCalculator
- {
- String calculateDeploymentPath(IFile file);
- }
-
-
- public static class SimpleDeploymentPathCalculator
- implements DeploymentPathCalculator
- {
- public String calculateDeploymentPath(IFile file) {
- return file.getName();
- }
- }
-
-
- public static class ModuleDeploymentPathCalculator
- extends SimpleDeploymentPathCalculator
- {
- @Override
- public String calculateDeploymentPath(IFile file) {
- // first look for virtual component that matches this file, returning
- // the path to that virtual component
- IVirtualComponent vComponent = ComponentCore.createComponent(file.getProject());
- if (vComponent != null) {
- IVirtualFolder vFolder = vComponent.getRootFolder();
- IVirtualFile vFile = findVirtualFile(vFolder, file);
- if (vFile != null) {
- return calculatePersistenceRootRelativePath(vFile);
- }
- }
-
- // then default to simple behavior
- return super.calculateDeploymentPath(file);
- }
-
- protected IVirtualFile findVirtualFile(IVirtualContainer vContainer, IFile realFile) {
- try {
- for (IVirtualResource vResource : vContainer.members()) {
- if (vResource.getType() == IVirtualResource.FILE) {
- IVirtualFile vFile = (IVirtualFile) vResource;
- if (realFile.equals(vFile.getUnderlyingFile())) {
- return vFile;
- }
- }
- else {
- IVirtualFile vFile = findVirtualFile((IVirtualContainer) vResource, realFile);
- if (vFile != null) {
- return vFile;
- }
- }
- }
- }
- catch (CoreException ce) {
- JptJpaUiPlugin.log(ce);
- }
-
- return null;
- }
-
- protected String calculatePersistenceRootRelativePath(IVirtualFile vFile) {
- IProject project = vFile.getProject();
- IPath puRootPath = JptJpaCorePlugin.getJarRuntimeRootPath(project);
-
- IPath path = vFile.getRuntimePath().makeRelativeTo(puRootPath);
-
- return path.toString();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitGeneralComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitGeneralComposite.java
deleted file mode 100644
index 5c25dab4de..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitGeneralComposite.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | - General --------------------------------------------------------------- |
- * | ------------------------------------------------- |
- * | Name: | I | |
- * | ------------------------------------------------- |
- * | ------------------------------------------------- |
- * | Persistence Provider: | |v| |
- * | ------------------------------------------------- |
- * | |
- * | |
- * | - Mapped Classes -------------------------------------------------------- |
- * | |
- * | Description |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMappedClassesComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * | |
- * | |
- * | - XML Mapping Files ----------------------------------------------------- |
- * | |
- * | Description |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMappingFilesComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitJarFilesComposite
- * @see PersistenceUnitMappedClassesComposite
- * @see PersistenceUnitMappingFilesComposite
- *
- * @version 2.0
- * @since 2.0
- */
-public class GenericPersistenceUnitGeneralComposite extends PersistenceUnitGeneralComposite
- implements JpaPageComposite
-{
- /**
- * Creates a new <code>PersistenceUnitGeneralComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public GenericPersistenceUnitGeneralComposite(PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite container,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, container, widgetFactory);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- initializeGeneralPane(container);
- initializeMappedClassesPane(container);
- initializeJPAMappingDescriptorsPane(container);
- initializeJarFilesPane(container);
- }
-
-
- protected void initializeJPAMappingDescriptorsPane(Composite container) {
-
- container = addCollapsibleSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_jpaMappingDescriptors,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_jpaMappingDescriptors_description
- );
-
- updateGridData(container);
- updateGridData(container.getParent());
-
- new GenericPersistenceUnitMappingFilesComposite(this, container);
- }
-
- protected void initializeJarFilesPane(Composite container) {
-
- container = addCollapsibleSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_jarFiles
- );
-
- updateGridData(container);
- updateGridData(container.getParent());
-
- new GenericPersistenceUnitJarFilesComposite(this, container);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitJarFilesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitJarFilesComposite.java
deleted file mode 100644
index 7fde0e2c0f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitJarFilesComposite.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.swt.widgets.Composite;
-
-public class GenericPersistenceUnitJarFilesComposite
- extends PersistenceUnitJarFilesComposite
-{
- public GenericPersistenceUnitJarFilesComposite(
- Pane<? extends PersistenceUnit> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitMappingFilesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitMappingFilesComposite.java
deleted file mode 100644
index c99cbb4d4b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceUnitMappingFilesComposite.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.jpa.ui.internal.persistence.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitGeneralComposite - The parent container
- * @see AddRemoveListPane
- *
- * @version 2.0
- * @since 2.0
- */
-public class GenericPersistenceUnitMappingFilesComposite extends PersistenceUnitMappingFilesComposite
-{
- /**
- * Creates a new <code>PersistenceUnitMappingFilesComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public GenericPersistenceUnitMappingFilesComposite(Pane<? extends PersistenceUnit> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- addMappingFilesList(container);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceXmlUiFactory.java
deleted file mode 100644
index 5a98afe62e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/GenericPersistenceXmlUiFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import java.util.ArrayList;
-import java.util.ListIterator;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public class GenericPersistenceXmlUiFactory implements PersistenceXmlUiFactory
-{
- // **************** persistence unit composites ****************************
-
- public ListIterator<JpaPageComposite> createPersistenceUnitComposites(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory) {
-
- ArrayList<JpaPageComposite> pages = new ArrayList<JpaPageComposite>(3);
-
- pages.add(new GenericPersistenceUnitGeneralComposite(subjectHolder, parent, widgetFactory));
- pages.add(new PersistenceUnitConnectionComposite(subjectHolder, parent, widgetFactory));
- pages.add(new PersistenceUnitPropertiesComposite(subjectHolder, parent, widgetFactory));
-
- return pages.listIterator();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitClassesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitClassesComposite.java
deleted file mode 100644
index d695344662..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitClassesComposite.java
+++ /dev/null
@@ -1,375 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.search.SearchEngine;
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.JptCommonUiMessages;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.ui.progress.IProgressService;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | Description |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | x Exclude Unlisted Mapped Classes |
- * | |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitGeneralComposite - The parent container
- * @see AddRemoveListPane
- *
- * @version 2.3
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class PersistenceUnitClassesComposite extends Pane<PersistenceUnit>
-{
- /**
- * Creates a new <code>PersistenceUnitMappedClassesComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public PersistenceUnitClassesComposite(Pane<? extends PersistenceUnit> parentPane,
- Composite parent) {
-
- super(parentPane, parent);
- }
-
- private void addMappedClass(ObjectListSelectionModel listSelectionModel) {
-
- IType type = chooseType();
-
- if (type != null) {
- String className = type.getFullyQualifiedName('$');
- if(classRefExists(className)) {
- return;
- }
- ClassRef classRef = getSubject().addSpecifiedClassRef(className);
- listSelectionModel.setSelectedValue(classRef);
- }
- }
-
- private boolean classRefExists(String className) {
- for (ClassRef classRef : getSubject().getSpecifiedClassRefs()) {
- if( classRef.getClassName().equals(className)) {
- return true;
- }
- }
- return false;
- }
-
- private Adapter buildAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addMappedClass(listSelectionModel);
- }
-
- @Override
- public boolean enableOptionOnSelectionChange(ObjectListSelectionModel listSelectionModel) {
- if (!super.enableOptionOnSelectionChange(listSelectionModel)) {
- return false;
- }
-
- return findType((ClassRef) listSelectionModel.selectedValue()) != null;
- }
-
- @Override
- public boolean hasOptionalButton() {
- return true;
- }
-
- @Override
- public String optionalButtonText() {
- return JptUiPersistenceMessages.PersistenceUnitClassesComposite_open;
- }
-
- @Override
- public void optionOnSelection(ObjectListSelectionModel listSelectionModel) {
- openMappedClass((ClassRef) listSelectionModel.selectedValue());
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeSpecifiedClassRef((ClassRef) item);
- }
- }
- };
- }
-
- private ModifiablePropertyValueModel<Boolean> buildExcludeUnlistedMappedClassesHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, Boolean>(
- getSubjectHolder(),
- PersistenceUnit.SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSpecifiedExcludeUnlistedClasses();
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setSpecifiedExcludeUnlistedClasses(value);
- }
- };
- }
-
- private PropertyValueModel<String> buildExcludeUnlistedMappedClassesStringHolder() {
- return new TransformationPropertyValueModel<Boolean, String>(buildDefaultExcludeUnlistedMappedClassesHolder()) {
- @Override
- protected String transform(Boolean value) {
- if (value != null) {
- String defaultStringValue = value.booleanValue() ? JptCommonUiMessages.Boolean_True : JptCommonUiMessages.Boolean_False;
- return NLS.bind(JptUiPersistenceMessages.PersistenceUnitClassesComposite_excludeUnlistedMappedClassesWithDefault, defaultStringValue);
- }
- return JptUiPersistenceMessages.PersistenceUnitClassesComposite_excludeUnlistedMappedClasses;
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildDefaultExcludeUnlistedMappedClassesHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, Boolean>(
- getSubjectHolder(),
- PersistenceUnit.SPECIFIED_EXCLUDE_UNLISTED_CLASSES_PROPERTY,
- PersistenceUnit.DEFAULT_EXCLUDE_UNLISTED_CLASSES_PROPERTY)
- {
- @Override
- protected Boolean buildValue_() {
- if (this.subject.getSpecifiedExcludeUnlistedClasses() != null) {
- return null;
- }
- return Boolean.valueOf(this.subject.getDefaultExcludeUnlistedClasses());
- }
- };
- }
- private ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public Image getImage(Object element) {
- ClassRef classRef = (ClassRef) element;
- JavaPersistentType persistentType = classRef.getJavaPersistentType();
- Image image = null;
-
- if (persistentType != null) {
- image = JpaMappingImageHelper.imageForTypeMapping(persistentType.getMappingKey());
- }
-
- if (image != null) {
- return image;
- }
-
- return JptJpaUiPlugin.getImage(JptUiIcons.WARNING);
- }
-
- @Override
- public String getText(Object element) {
- ClassRef classRef = (ClassRef) element;
- String name = classRef.getClassName();
-
- if (name == null) {
- name = JptUiPersistenceMessages.PersistenceUnitClassesComposite_mappedClassesNoName;
- }
-
- return name;
- }
- };
- }
-
- private ListValueModel<ClassRef> buildItemListHolder() {
- return new ItemPropertyListValueModelAdapter<ClassRef>(
- buildListHolder(),
- ClassRef.JAVA_PERSISTENT_TYPE_PROPERTY,
- ClassRef.CLASS_NAME_PROPERTY
- );
- }
-
- private ListValueModel<ClassRef> buildListHolder() {
- return new ListAspectAdapter<PersistenceUnit, ClassRef>(getSubjectHolder(), PersistenceUnit.SPECIFIED_CLASS_REFS_LIST) {
- @Override
- protected ListIterable<ClassRef> getListIterable() {
- return subject.getSpecifiedClassRefs();
- }
-
- @Override
- protected int size_() {
- return subject.getSpecifiedClassRefsSize();
- }
- };
- }
-
- private ModifiablePropertyValueModel<ClassRef> buildSelectedItemHolder() {
- return new SimplePropertyValueModel<ClassRef>();
- }
-
- /**
- * Prompts the user the Open Type dialog.
- *
- * @return Either the selected type or <code>null</code> if the user
- * canceled the dialog
- */
- private IType chooseType() {
- IJavaProject javaProject = getJavaProject();
- IJavaElement[] elements = new IJavaElement[] { javaProject };
- IJavaSearchScope scope = SearchEngine.createJavaSearchScope(elements);
- IProgressService service = PlatformUI.getWorkbench().getProgressService();
- SelectionDialog typeSelectionDialog;
-
- try {
- typeSelectionDialog = JavaUI.createTypeDialog(
- getShell(),
- service,
- scope,
- IJavaElementSearchConstants.CONSIDER_CLASSES,
- false,
- ""
- );
- }
- catch (JavaModelException e) {
- JptJpaUiPlugin.log(e);
- return null;
- }
-
- typeSelectionDialog.setTitle(JptCommonUiMessages.ClassChooserPane_dialogTitle);
- typeSelectionDialog.setMessage(JptCommonUiMessages.ClassChooserPane_dialogMessage);
-
- if (typeSelectionDialog.open() == Window.OK) {
- return (IType) typeSelectionDialog.getResult()[0];
- }
-
- return null;
- }
-
- private IType findType(ClassRef classRef) {
- String className = classRef.getClassName();
-
- if (className != null) {
- try {
- return getSubject().getJpaProject().getJavaProject().findType(className.replace('$', '.'));
- }
- catch (JavaModelException e) {
- JptJpaUiPlugin.log(e);
- }
- }
-
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Description
- addMultiLineLabel(
- container,
- JptUiPersistenceMessages.PersistenceUnitClassesComposite_description
- );
-
- // List pane
- new AddRemoveListPane<PersistenceUnit>(
- this,
- container,
- this.buildAdapter(),
- this.buildItemListHolder(),
- this.buildSelectedItemHolder(),
- this.buildLabelProvider(),
- JpaHelpContextIds.PERSISTENCE_XML_GENERAL
- )
- {
- @Override
- protected void initializeTable(Table table) {
- super.initializeTable(table);
-
- Composite container = table.getParent();
- GridData gridData = (GridData) container.getLayoutData();
- gridData.heightHint = 75;
- }
- };
-
- this.addTriStateCheckBoxWithDefault(
- container,
- JptUiPersistenceMessages.PersistenceUnitClassesComposite_excludeUnlistedMappedClasses,
- buildExcludeUnlistedMappedClassesHolder(),
- buildExcludeUnlistedMappedClassesStringHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_GENERAL
- );
- }
-
- private void openMappedClass(ClassRef classRef) {
-
- IType type = findType(classRef);
-
- if (type != null) {
- try {
- IJavaElement javaElement = type.getParent();
- JavaUI.openInEditor(javaElement, true, true);
- }
- catch (PartInitException e) {
- JptJpaUiPlugin.log(e);
- }
- catch (JavaModelException e) {
- JptJpaUiPlugin.log(e);
- }
- }
- }
-
- private IJavaProject getJavaProject() {
- return getSubject().getJpaProject().getJavaProject();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionComposite.java
deleted file mode 100644
index 6214cb00ed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionComposite.java
+++ /dev/null
@@ -1,144 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | - General --------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitConnectionGeneralComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * | |
- * | - Database -------------------------------------------------------------- |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitConnectionDatabaseComposite | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitConnectionGeneralComposite
- * @see PersistenceUnitConnectionDatabaseComposite
- *
- * @version 2.0
- * @since 2.0
- */
-public class PersistenceUnitConnectionComposite extends Pane<PersistenceUnit>
- implements JpaPageComposite
-{
- /**
- * Creates a new <code>PersistenceUnitConnectionComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public PersistenceUnitConnectionComposite(PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite container,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, container, widgetFactory);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Composite addContainer(Composite parent) {
-
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
- layout.verticalSpacing = 15;
-
- Composite container = addPane(parent, layout);
- updateGridData(container);
-
- return container;
- }
-
- /*
- * (non-Javadoc)
- */
- public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_XML_CONNECTION;
- }
-
- private void initializeDatabasePane(Composite container) {
-
- container = addSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitConnectionComposite_database
- );
-
- new PersistenceUnitConnectionDatabaseComposite(this, container);
- }
-
- private void initializeGeneralPane(Composite container) {
-
- container = addSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitConnectionComposite_general
- );
-
- new PersistenceUnitConnectionGeneralComposite(this, container);
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- initializeGeneralPane(container);
- initializeDatabasePane(container);
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return JptUiPersistenceMessages.PersistenceUnitConnectionComposite_connection;
- }
-
- private void updateGridData(Composite container) {
-
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionDatabaseComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionDatabaseComposite.java
deleted file mode 100644
index 6ea81cfaed..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionDatabaseComposite.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------ |
- * | JTA Datasource Name: | I | |
- * | ------------------------------------------------ |
- * | ------------------------------------------------ |
- * | Non-JTA Datasource Name: | I | |
- * | ------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitConnectionComposite - The parent container
- *
- * @version 2.0
- * @since 2.0
- */
-public class PersistenceUnitConnectionDatabaseComposite extends Pane<PersistenceUnit>
-{
- /**
- * Creates a new <code>PersistenceUnitConnectionDatabaseComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public PersistenceUnitConnectionDatabaseComposite(Pane<PersistenceUnit> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- private PropertyValueModel<Boolean> buildJTADatasourceNameBooleanHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform_(PersistenceUnitTransactionType value) {
- return Boolean.valueOf(value == PersistenceUnitTransactionType.JTA);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildJTADatasourceNameHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(getSubjectHolder(), PersistenceUnit.JTA_DATA_SOURCE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getJtaDataSource();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setJtaDataSource(value);
- }
- };
- }
-
- private PropertyValueModel<Boolean> buildNonJTADatasourceNameBooleanHolder() {
- return new TransformationPropertyValueModel<PersistenceUnitTransactionType, Boolean>(buildTransactionTypeHolder()) {
- @Override
- protected Boolean transform_(PersistenceUnitTransactionType value) {
- return Boolean.valueOf(value == PersistenceUnitTransactionType.RESOURCE_LOCAL);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildNonJTADatasourceNameHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(getSubjectHolder(), PersistenceUnit.NON_JTA_DATA_SOURCE_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getNonJtaDataSource();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setNonJtaDataSource(value);
- }
- };
- }
-
- private PropertyValueModel<PersistenceUnitTransactionType> buildTransactionTypeHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, PersistenceUnitTransactionType>(
- getSubjectHolder(),
- PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY,
- PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY)
- {
- @Override
- protected PersistenceUnitTransactionType buildValue_() {
- return subject.getTransactionType();
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // JTA Datasource Name widgets
- PropertyValueModel<Boolean> enabled = this.buildJTADatasourceNameBooleanHolder();
- Label label = addLabel(
- container,
- JptUiPersistenceMessages.PersistenceUnitConnectionDatabaseComposite_jtaDatasourceName,
- enabled
- );
- Text text = addText(
- container,
- buildJTADatasourceNameHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION,
- enabled
- );
- addLabeledComposite(container, label, text, JpaHelpContextIds.PERSISTENCE_XML_CONNECTION);
-
-
- // Non-JTA Datasource Name widgets
- enabled = this.buildNonJTADatasourceNameBooleanHolder();
- label = addLabel(
- container,
- JptUiPersistenceMessages.PersistenceUnitConnectionDatabaseComposite_nonJtaDatasourceName,
- enabled
- );
- text = addText(
- container,
- buildNonJTADatasourceNameHolder(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION,
- enabled
- );
- addLabeledComposite(container, label, text, JpaHelpContextIds.PERSISTENCE_XML_CONNECTION);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionGeneralComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionGeneralComposite.java
deleted file mode 100644
index 7f22bd8e13..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitConnectionGeneralComposite.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import java.util.Collection;
-import org.eclipse.jpt.common.ui.internal.widgets.EnumFormComboViewer;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | ------------------------------------------------------ |
- * | Transaction Type: | |v| |
- * | ------------------------------------------------------ |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitConnectionComposite - The parent container
- *
- * @version 2.0
- * @since 2.0
- */
-public class PersistenceUnitConnectionGeneralComposite extends Pane<PersistenceUnit>
-{
- /**
- * Creates a new <code>PersistenceUnitConnectionGeneralComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public PersistenceUnitConnectionGeneralComposite(Pane<PersistenceUnit> subjectHolder,
- Composite container) {
-
- super(subjectHolder, container);
- }
-
- private EnumFormComboViewer<PersistenceUnit, PersistenceUnitTransactionType> buildTransactionTypeCombo(Composite container) {
-
- return new EnumFormComboViewer<PersistenceUnit, PersistenceUnitTransactionType>(this, container) {
-
- @Override
- protected void addPropertyNames(Collection<String> propertyNames) {
- super.addPropertyNames(propertyNames);
- propertyNames.add(PersistenceUnit.SPECIFIED_TRANSACTION_TYPE_PROPERTY);
- propertyNames.add(PersistenceUnit.DEFAULT_TRANSACTION_TYPE_PROPERTY);
- }
-
- @Override
- protected PersistenceUnitTransactionType[] getChoices() {
- return PersistenceUnitTransactionType.values();
- }
-
- @Override
- protected PersistenceUnitTransactionType getDefaultValue() {
- return getSubject().getDefaultTransactionType();
- }
-
- @Override
- protected String displayString(PersistenceUnitTransactionType value) {
- switch (value) {
- case JTA :
- return JptUiPersistenceMessages.PersistenceUnitConnectionGeneralComposite_jta;
- case RESOURCE_LOCAL :
- return JptUiPersistenceMessages.PersistenceUnitConnectionGeneralComposite_resource_local;
- default :
- throw new IllegalStateException();
- }
- }
-
- @Override
- protected PersistenceUnitTransactionType getValue() {
- return getSubject().getSpecifiedTransactionType();
- }
-
- @Override
- protected void setValue(PersistenceUnitTransactionType value) {
- getSubject().setSpecifiedTransactionType(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected void initializeLayout(Composite container) {
-
- // Transaction Type widgets
- addLabeledComposite(
- container,
- JptUiPersistenceMessages.PersistenceUnitConnectionGeneralComposite_transactionType,
- buildTransactionTypeCombo(container).getControl(),
- JpaHelpContextIds.PERSISTENCE_XML_CONNECTION
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitGeneralComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitGeneralComposite.java
deleted file mode 100644
index ef345cbd55..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitGeneralComposite.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | - General --------------------------------------------------------------- |
- * | ------------------------------------------------- |
- * | Name: | I | |
- * | ------------------------------------------------- |
- * | ------------------------------------------------- |
- * | Persistence Provider: | |v| |
- * | ------------------------------------------------- |
- * | |
- * | |
- * | - Mapped Classes -------------------------------------------------------- |
- * | |
- * | Description |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMappedClassesComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * | |
- * | |
- * | - XML Mapping Files ----------------------------------------------------- |
- * | |
- * | Description |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitMappingFilesComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * | |
- * | |
- * | - JAR Files ------------------------------------------------------------- |
- * | |
- * | Description |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | PersistenceUnitJarFilesComposite | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitMappedClassesComposite
- * @see PersistenceUnitMappingFilesComposite
- * @see PersistenceUnitJarFilesComposite
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class PersistenceUnitGeneralComposite extends Pane<PersistenceUnit>
- implements JpaPageComposite
-{
- /**
- * Creates a new <code>PersistenceUnitGeneralComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public PersistenceUnitGeneralComposite(PropertyValueModel<? extends PersistenceUnit> subjectHolder,
- Composite container,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, container, widgetFactory);
- }
-
-
- /*
- * (non-Javadoc)
- */
- @Override
- protected Composite addContainer(Composite parent) {
- Composite container = addSubPane(parent);
- updateGridData(container);
-
- return container;
- }
-
- private ModifiablePropertyValueModel<String> buildPersistenceProviderHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(getSubjectHolder(), PersistenceUnit.PROVIDER_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getProvider();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setProvider(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildPersistenceUnitNameHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(getSubjectHolder(), PersistenceUnit.NAME_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setName(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildPersistenceUnitDescriptionHolder() {
- return new PropertyAspectAdapter<PersistenceUnit, String>(getSubjectHolder(), PersistenceUnit.DESCRIPTION_PROPERTY) {
- @Override
- protected String buildValue_() {
- return subject.getDescription();
- }
-
- @Override
- protected void setValue_(String value) {
- if (value.length() == 0) {
- value = null;
- }
- subject.setDescription(value);
- }
- };
- }
-
- /*
- * (non-Javadoc)
- */
- public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_XML_GENERAL;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- /*
- * (non-Javadoc)
- */
- public String getPageText() {
- return JptUiPersistenceMessages.PersistenceUnitGeneralComposite_general;
- }
-
- protected void initializeGeneralPane(Composite container) {
-
- container = this.addSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_general
- );
-
- // Name widgets
- this.addLabeledText(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_name,
- this.buildPersistenceUnitNameHolder(),
- this.getHelpID()
- );
-
- // Persistence Provider widgets
- this.addLabeledText(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_persistenceProvider,
- this.buildPersistenceProviderHolder(),
- this.getHelpID()
- );
-
- // Description widgets
- this.addLabeledText(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_description,
- this.buildPersistenceUnitDescriptionHolder(),
- this.getHelpID()
- );
- }
-
- protected void initializeMappedClassesPane(Composite container) {
-
- container = addCollapsibleSection(
- container,
- JptUiPersistenceMessages.PersistenceUnitGeneralComposite_mappedClasses
- );
-
- updateGridData(container);
- updateGridData(container.getParent());
-
- new PersistenceUnitClassesComposite(this, container);
- }
-
- protected void updateGridData(Composite container) {
-
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitJarFilesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitJarFilesComposite.java
deleted file mode 100644
index 2bd7a40ee1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitJarFilesComposite.java
+++ /dev/null
@@ -1,224 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | |
- * | Description |
- * | |
- * | ------------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveListPane | |
- * | | | |
- * | ------------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see PersistenceUnitGeneralComposite - The parent container
- * @see AddRemoveListPane
- *
- * @version 2.0
- * @since 2.0
- */
-public abstract class PersistenceUnitJarFilesComposite
- extends Pane<PersistenceUnit>
-{
- private ModifiablePropertyValueModel<JarFileRef> selectedItemHolder;
-
- /**
- * Creates a new <code>PersistenceUnitJPAMappingDescriptorsComposite</code>.
- *
- * @param parentPane The parent pane of this one
- * @param parent The parent container
- */
- public PersistenceUnitJarFilesComposite(
- Pane<? extends PersistenceUnit> parentPane,
- Composite parent) {
-
- super(parentPane, parent, false);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.selectedItemHolder = buildSelectedItemHolder();
- }
-
-
-
- @Override
- protected void initializeLayout(Composite container) {
- addJarFilesList(container);
- }
-
- protected void addJarFilesList(Composite container) {
- // List pane
- new AddRemoveListPane<PersistenceUnit>(
- this,
- container,
- this.buildAdapter(),
- this.buildItemListHolder(),
- this.selectedItemHolder,
- this.buildLabelProvider(),
- JpaHelpContextIds.PERSISTENCE_XML_GENERAL
- ) {
- @Override
- protected Composite addContainer(Composite parent) {
- parent = super.addContainer(parent);
- updateGridData(parent);
- return parent;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- super.initializeLayout(container);
- updateGridData(getContainer());
- }
- };
- }
-
- private void updateGridData(Composite container) {
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-
- private Adapter buildAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addJarFileRef();
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeJarFileRef((JarFileRef) item);
- }
- }
- };
- }
-
- private ListValueModel<JarFileRef> buildItemListHolder() {
- return new ItemPropertyListValueModelAdapter<JarFileRef>(
- buildListHolder(),
- JarFileRef.FILE_NAME_PROPERTY
- );
- }
-
- private ListValueModel<JarFileRef> buildListHolder() {
- return new ListAspectAdapter<PersistenceUnit, JarFileRef>(getSubjectHolder(), PersistenceUnit.JAR_FILE_REFS_LIST) {
- @Override
- protected ListIterable<JarFileRef> getListIterable() {
- return this.subject.getJarFileRefs();
- }
-
- @Override
- protected int size_() {
- return this.subject.getJarFileRefsSize();
- }
- };
- }
-
- private ModifiablePropertyValueModel<JarFileRef> buildSelectedItemHolder() {
- return new SimplePropertyValueModel<JarFileRef>();
- }
-
- private ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public Image getImage(Object element) {
- return JptJpaUiPlugin.getImage(JptUiIcons.JAR_FILE_REF);
- }
-
- @Override
- public String getText(Object element) {
- JarFileRef jarFileRef = (JarFileRef) element;
- String name = jarFileRef.getFileName();
-
- if (name == null) {
- name = JptUiPersistenceMessages.PersistenceUnitJarFilesComposite_noFileName;
- }
-
- return name;
- }
- };
- }
-
- private void addJarFileRef() {
- IProject project = getSubject().getJpaProject().getProject();
-
- ElementTreeSelectionDialog dialog = new ArchiveFileSelectionDialog(
- getShell(), buildJarFileDeploymentPathCalculator());
-
- dialog.setHelpAvailable(false);
- dialog.setTitle(JptUiPersistenceMessages.PersistenceUnitMappingFilesComposite_jarFileDialog_title);
- dialog.setMessage(JptUiPersistenceMessages.PersistenceUnitMappingFilesComposite_jarFileDialog_message);
- dialog.setInput(project);
-
-
- dialog.setBlockOnOpen(true);
-
- if (dialog.open() == Window.OK) {
- for (Object result : dialog.getResult()) {
- String filePath = (String) result;
- if (jarFileRefExists(filePath)) {
- continue;
- }
- JarFileRef jarFileRef = getSubject().addJarFileRef(filePath);
-
- this.selectedItemHolder.setValue(jarFileRef);
- }
- }
- }
-
- protected ArchiveFileSelectionDialog.DeploymentPathCalculator buildJarFileDeploymentPathCalculator() {
- return new ArchiveFileSelectionDialog.ModuleDeploymentPathCalculator();
- }
-
- private boolean jarFileRefExists(String fileName) {
- for (JarFileRef each : getSubject().getJarFileRefs()) {
- if (each.getFileName().equals(fileName)) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitMappingFilesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitMappingFilesComposite.java
deleted file mode 100644
index d9e11eb985..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitMappingFilesComposite.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveListPane;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemovePane.Adapter;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.jface.XmlMappingFileViewerFilter;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-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.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.views.navigator.ResourceComparator;
-
-@SuppressWarnings("nls")
-public abstract class PersistenceUnitMappingFilesComposite
- extends Pane<PersistenceUnit> {
-
- private ModifiablePropertyValueModel<MappingFileRef> selectedItemHolder;
-
- public PersistenceUnitMappingFilesComposite(
- Pane<? extends PersistenceUnit> parentPane, Composite parent) {
-
- super(parentPane, parent);
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- this.selectedItemHolder = buildSelectedItemHolder();
- }
-
-
- protected void addMappingFilesList(Composite container) {
- // List pane
- new AddRemoveListPane<PersistenceUnit>(
- this,
- container,
- buildAdapter(),
- buildItemListHolder(),
- this.selectedItemHolder,
- buildLabelProvider(),
- JpaHelpContextIds.PERSISTENCE_XML_GENERAL) {
-
- @Override
- protected Composite addContainer(Composite parent) {
- parent = super.addContainer(parent);
- updateGridData(parent);
- return parent;
- }
-
- @Override
- protected void initializeLayout(Composite container) {
- super.initializeLayout(container);
- updateGridData(getContainer());
- }
- };
- }
-
- /**
- * Prompts a dialog showing a tree structure of the source paths where the
- * only files shown are JPA mapping descriptors file. The XML file has to be
- * an XML file with the root tag: {@code <entity-mappings>}.
- *
- * @param listSelectionModel The selection model used to select the new files
- */
- private void addJPAMappingDescriptor() {
-
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(
- getShell(),
- new WorkbenchLabelProvider(),
- new WorkbenchContentProvider());
-
- dialog.setHelpAvailable(false);
- dialog.setValidator(buildValidator());
- dialog.setTitle(JptUiPersistenceMessages.PersistenceUnitMappingFilesComposite_mappingFileDialog_title);
- dialog.setMessage(JptUiPersistenceMessages.PersistenceUnitMappingFilesComposite_mappingFileDialog_message);
- dialog.addFilter(new XmlMappingFileViewerFilter(getSubject().getJpaProject(), JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE));
- dialog.setInput(getSubject().getJpaProject().getProject());
- dialog.setComparator(new ResourceComparator(ResourceComparator.NAME));
-
- dialog.setBlockOnOpen(true);
- if (dialog.open() == Window.OK) {
- for (Object result : dialog.getResult()) {
- IFile file = (IFile) result;
- IProject project = file.getProject();
- ProjectResourceLocator locator = (ProjectResourceLocator) project.getAdapter(ProjectResourceLocator.class);
- IPath runtimePath = locator.getRuntimePath(file.getFullPath());
- String fileName = runtimePath.toPortableString();
- if (mappingFileRefExists(fileName)) {
- continue;
- }
- MappingFileRef mappingFileRef = getSubject().addSpecifiedMappingFileRef(fileName);
- this.selectedItemHolder.setValue(mappingFileRef);
- }
- }
- }
-
- private Adapter buildAdapter() {
- return new AddRemoveListPane.AbstractAdapter() {
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
- addJPAMappingDescriptor();
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeSpecifiedMappingFileRef((MappingFileRef) item);
- }
- }
- };
- }
-
- @Override
- protected Composite addContainer(Composite parent) {
-
- GridLayout layout = new GridLayout(1, true);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- layout.marginTop = 0;
- layout.marginLeft = 0;
- layout.marginBottom = 0;
- layout.marginRight = 0;
-
- Composite container = addPane(parent, layout);
- updateGridData(container);
-
- return container;
- }
-
- private ListValueModel<MappingFileRef> buildItemListHolder() {
- return new ItemPropertyListValueModelAdapter<MappingFileRef>(
- buildListHolder(),
- MappingFileRef.FILE_NAME_PROPERTY);
- }
-
- private ILabelProvider buildLabelProvider() {
- return new LabelProvider() {
- @Override
- public Image getImage(Object element) {
- return JptJpaUiPlugin.getImage(JptUiIcons.MAPPING_FILE_REF);
- }
-
- @Override
- public String getText(Object element) {
- MappingFileRef mappingFileRef = (MappingFileRef) element;
- String name = mappingFileRef.getFileName();
-
- if (name == null) {
- name = JptUiPersistenceMessages.PersistenceUnitMappingFilesComposite_ormNoName;
- }
-
- return name;
- }
- };
- }
-
- private ListValueModel<MappingFileRef> buildListHolder() {
- return new ListAspectAdapter<PersistenceUnit, MappingFileRef>(
- getSubjectHolder(), PersistenceUnit.SPECIFIED_MAPPING_FILE_REFS_LIST) {
-
- @Override
- protected ListIterable<MappingFileRef> getListIterable() {
- return this.subject.getSpecifiedMappingFileRefs();
- }
-
- @Override
- protected int size_() {
- return this.subject.getSpecifiedMappingFileRefsSize();
- }
- };
- }
-
- private ModifiablePropertyValueModel<MappingFileRef> buildSelectedItemHolder() {
- return new SimplePropertyValueModel<MappingFileRef>();
- }
-
- private boolean mappingFileRefExists(String fileName) {
- for (MappingFileRef mappingFileRef : getSubject().getSpecifiedMappingFileRefs()) {
- if( mappingFileRef.getFileName().equals(fileName)) {
- return true;
- }
- }
- return false;
- }
-
- private ISelectionStatusValidator buildValidator() {
- return new ISelectionStatusValidator() {
- public IStatus validate(Object[] selection) {
-
- if (selection.length == 0) {
- return new Status(IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID, "");
- }
-
- for (Object item : selection) {
- if (item instanceof IFolder) {
- return new Status(IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID, "");
- }
- }
-
- return new Status(IStatus.OK, JptJpaUiPlugin.PLUGIN_ID, "");
- }
- };
- }
-
- private void updateGridData(Composite container) {
-
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- gridData.verticalAlignment = SWT.FILL;
- container.setLayoutData(gridData);
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitPropertiesComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitPropertiesComposite.java
deleted file mode 100644
index b67aa09d65..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceUnitPropertiesComposite.java
+++ /dev/null
@@ -1,418 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.swt.ColumnAdapter;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.widgets.AddRemoveTablePane;
-import org.eclipse.jpt.common.ui.internal.widgets.Pane;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.swing.ObjectListSelectionModel;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.details.java.BaseJavaUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.persistence.JptUiPersistenceMessages;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * Here the layout of this pane:
- * <pre>
- * -----------------------------------------------------------------------------
- * | - Properties ------------------------------------------------------------ |
- * | |
- * | Description |
- * | |
- * | ----------------------------------------------------------------------- |
- * | | | |
- * | | AddRemoveTablePane | |
- * | | | |
- * | ----------------------------------------------------------------------- |
- * -----------------------------------------------------------------------------</pre>
- *
- * @see PersistenceUnit
- * @see BaseJavaUiFactory - The invoker
- * @see AddRemoveTablePane
- *
- * @version 2.3
- * @since 2.0
- */
-@SuppressWarnings("nls")
-public class PersistenceUnitPropertiesComposite extends Pane<PersistenceUnit>
- implements JpaPageComposite
-{
- private ModifiablePropertyValueModel<PersistenceUnit.Property> propertyHolder;
- private TablePane tablePane;
-
- /**
- * Creates a new <code>PersistenceUnitPropertiesComposite</code>.
- *
- * @param subjectHolder The holder of this pane's subject
- * @param parent The parent container
- * @param widgetFactory The factory used to create various common widgets
- */
- public PersistenceUnitPropertiesComposite(PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite container,
- WidgetFactory widgetFactory) {
-
- super(subjectHolder, container, widgetFactory);
- }
-
- private ListValueModel<PersistenceUnit.Property> buildPropertiesListHolder() {
- return new ListAspectAdapter<PersistenceUnit, PersistenceUnit.Property>(getSubjectHolder(), PersistenceUnit.PROPERTIES_LIST) {
- @Override
- protected ListIterable<PersistenceUnit.Property> getListIterable() {
- return subject.getProperties();
- }
-
- @Override
- protected int size_() {
- return subject.getPropertiesSize();
- }
- };
- }
-
- private ITableLabelProvider buildPropertyLabelProvider() {
- return new TableLabelProvider();
- }
-
- private AddRemoveTablePane.Adapter buildTableAdapter() {
- return new AddRemoveTablePane.AbstractAdapter() {
-
- public void addNewItem(ObjectListSelectionModel listSelectionModel) {
-
- PersistenceUnit.Property property = getSubject().addProperty();
- propertyHolder.setValue(property);
-
- tablePane.getTableViewer().editElement(
- property,
- PropertyColumnAdapter.NAME_COLUMN
- );
- }
-
- public void removeSelectedItems(ObjectListSelectionModel listSelectionModel) {
- for (Object item : listSelectionModel.selectedValues()) {
- getSubject().removeProperty((PersistenceUnit.Property) item);
- }
- }
- };
- }
-
- public String getHelpID() {
- return JpaHelpContextIds.PERSISTENCE_XML_PROPERTIES;
- }
-
- public ImageDescriptor getPageImageDescriptor() {
- return null;
- }
-
- public String getPageText() {
- return JptUiPersistenceMessages.PersistenceUnitPropertiesComposite_properties;
- }
-
- @Override
- protected void initialize() {
- super.initialize();
- propertyHolder = new SimplePropertyValueModel<PersistenceUnit.Property>();
- }
-
- @Override
- protected void initializeLayout(Composite container) {
-
- addLabel(
- container,
- JptUiPersistenceMessages.PersistenceUnitPropertiesComposite_properties_description
- );
-
- tablePane = new TablePane(container);
- container.setLayoutData(new GridData(GridData.FILL_BOTH));
- }
-
- private static class PropertyColumnAdapter implements ColumnAdapter<PersistenceUnit.Property> {
-
- public static final int COLUMN_COUNT = 3;
- public static final int NAME_COLUMN = 1;
- public static final int SELECTION_COLUMN = 0;
- public static final int VALUE_COLUMN = 2;
-
- private ModifiablePropertyValueModel<String> buildNameHolder(PersistenceUnit.Property subject) {
- return new PropertyAspectAdapter<PersistenceUnit.Property, String>(PersistenceUnit.Property.NAME_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getName();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setName(value);
- }
- };
- }
-
- private ModifiablePropertyValueModel<String> buildValueHolder(PersistenceUnit.Property subject) {
- return new PropertyAspectAdapter<PersistenceUnit.Property, String>(PersistenceUnit.Property.VALUE_PROPERTY, subject) {
- @Override
- protected String buildValue_() {
- return subject.getValue();
- }
-
- @Override
- protected void setValue_(String value) {
- subject.setValue(value);
- }
- };
- }
-
- public ModifiablePropertyValueModel<?>[] cellModels(PersistenceUnit.Property subject) {
- ModifiablePropertyValueModel<?>[] holders = new ModifiablePropertyValueModel<?>[COLUMN_COUNT];
- holders[SELECTION_COLUMN] = new SimplePropertyValueModel<Object>();
- holders[NAME_COLUMN] = buildNameHolder(subject);
- holders[VALUE_COLUMN] = buildValueHolder(subject);
- return holders;
- }
-
- public int columnCount() {
- return COLUMN_COUNT;
- }
-
- public String columnName(int columnIndex) {
-
- switch (columnIndex) {
- case PropertyColumnAdapter.NAME_COLUMN: {
- return JptUiPersistenceMessages.PersistenceUnitPropertiesComposite_nameColumn;
- }
-
- case PropertyColumnAdapter.VALUE_COLUMN: {
- return JptUiPersistenceMessages.PersistenceUnitPropertiesComposite_valueColumn;
- }
-
- default: {
- return null;
- }
- }
- }
- }
-
- private class TableLabelProvider extends LabelProvider
- implements ITableLabelProvider {
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
-
- PersistenceUnit.Property property = (PersistenceUnit.Property) element;
- String value = null;
-
- switch (columnIndex) {
- case PropertyColumnAdapter.NAME_COLUMN: {
- value = property.getName();
- break;
- }
-
- case PropertyColumnAdapter.VALUE_COLUMN: {
- value = property.getValue();
- break;
- }
- }
-
- if (value == null) {
- value = "";
- }
-
- return value;
- }
- }
-
- private class TablePane extends AddRemoveTablePane<PersistenceUnit> {
-
- private final String SELECTION_COLUMN = "selection";
-
- private TableViewer tableViewer;
-
- private TablePane(Composite parent) {
- super(PersistenceUnitPropertiesComposite.this,
- parent,
- buildTableAdapter(),
- buildPropertiesListHolder(),
- propertyHolder,
- buildPropertyLabelProvider());
- }
-
- @Override
- protected Composite addContainer(Composite parent) {
- Composite container = super.addContainer(parent);
- container.setLayoutData(new GridData(GridData.FILL_BOTH));
- return container;
- }
-
- private CellEditor[] buildCellEditors(Table table) {
- return new CellEditor[] {
- null,
- new TextCellEditor(table),
- new TextCellEditor(table)
- };
- }
-
- private ICellModifier buildCellModifier() {
- return new ICellModifier() {
-
- public boolean canModify(Object element, String property) {
- return !SELECTION_COLUMN.equals(property);
- }
-
- public Object getValue(Object element, String property) {
- PersistenceUnit.Property propertyModel = (PersistenceUnit.Property) element;
- String value = null;
-
- if (property == PersistenceUnit.Property.NAME_PROPERTY) {
- value = propertyModel.getName();
- }
- else if (property == PersistenceUnit.Property.VALUE_PROPERTY) {
- value = propertyModel.getValue();
- }
-
- if (value == null) {
- value = "";
- }
-
- return value;
- }
-
- public void modify(Object element, String property, Object value) {
- PersistenceUnit.Property propertyModel;
-
- if (element instanceof TableItem) {
- TableItem tableItem = (TableItem) element;
- propertyModel = (PersistenceUnit.Property) tableItem.getData();
- }
- else {
- propertyModel = (PersistenceUnit.Property) element;
- }
-
- if (property == PersistenceUnit.Property.NAME_PROPERTY) {
- propertyModel.setName(value.toString());
- }
- else if (property == PersistenceUnit.Property.VALUE_PROPERTY) {
- propertyModel.setValue(value.toString());
- }
- }
- };
- }
-
- @Override
- protected ColumnAdapter<?> buildColumnAdapter() {
- return new PropertyColumnAdapter();
- }
-
- private String[] buildColumnProperties() {
- return new String[] {
- SELECTION_COLUMN,
- PersistenceUnit.Property.NAME_PROPERTY,
- PersistenceUnit.Property.VALUE_PROPERTY
- };
- }
-
- TableViewer getTableViewer() {
- return tableViewer;
- }
-
- @Override
- protected void initializeMainComposite(Composite container,
- Adapter adapter,
- ListValueModel<?> listHolder,
- ModifiablePropertyValueModel<?> selectedItemHolder,
- IBaseLabelProvider labelProvider,
- String helpId) {
-
- super.initializeMainComposite(
- container,
- adapter,
- listHolder,
- selectedItemHolder,
- labelProvider,
- helpId
- );
-
- Table table = getMainControl();
- table.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- // Make the selection column non-resizable since it's only used to
- // ease the selection of rows
- TableColumn selectionColumn = table.getColumn(PropertyColumnAdapter.SELECTION_COLUMN);
- selectionColumn.setResizable(false);
- selectionColumn.setWidth(20);
-
- // Install the editors
- tableViewer = new TableViewer(table);
- tableViewer.setCellEditors(buildCellEditors(table));
- tableViewer.setCellModifier(buildCellModifier());
- tableViewer.setColumnProperties(buildColumnProperties());
- }
-
- @Override
- protected void itemsAdded(ListAddEvent e) {
- super.itemsAdded(e);
- revalidateLayout();
- }
-
- @Override
- protected void itemsRemoved(ListRemoveEvent e) {
- super.itemsRemoved(e);
- revalidateLayout();
- }
-
- @Override
- protected void listChanged(ListChangeEvent e) {
- super.listChanged(e);
- revalidateLayout();
- }
-
- /**
- * Revalidates the table layout after the list of items has changed. The
- * layout has to be done in a new UI thread because our listener might be
- * notified before the table has been updated (table column added or removed).
- */
- private void revalidateLayout() {
- SWTUtil.asyncExec(new Runnable() { public void run() {
- Table table = getMainControl();
- if (!table.isDisposed()) {
- // We have to do a total relayout of the tab otherwise the
- // table might become cut off at the bottom
- SWTUtil.reflow(table);
- }
- }});
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceXmlUiDefinition.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceXmlUiDefinition.java
deleted file mode 100644
index 7b69456b2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceXmlUiDefinition.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceStructureItemContentProviderFactory;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceStructureItemLabelProviderFactory;
-
-public class PersistenceXmlUiDefinition
- extends AbstractPersistenceXmlResourceUiDefinition
-{
- // singleton
- private static final ResourceUiDefinition INSTANCE = new PersistenceXmlUiDefinition();
-
-
- /**
- * Return the singleton
- */
- public static ResourceUiDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private PersistenceXmlUiDefinition() {
- super();
- }
-
-
- @Override
- protected PersistenceXmlUiFactory buildPersistenceXmlUiFactory() {
- return new GenericPersistenceXmlUiFactory();
- }
-
- public boolean providesUi(JptResourceType resourceType) {
- return resourceType.equals(JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE);
- }
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider() {
- return STRUCTURE_VIEW_FACTORY_PROVIDER;
- }
-
- public static final ItemTreeStateProviderFactoryProvider STRUCTURE_VIEW_FACTORY_PROVIDER =
- new SimpleItemTreeStateProviderFactoryProvider(
- PersistenceStructureItemContentProviderFactory.instance(),
- PersistenceStructureItemLabelProviderFactory.instance()
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceXmlUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceXmlUiFactory.java
deleted file mode 100644
index 6f546cd681..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/persistence/details/PersistenceXmlUiFactory.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.persistence.details;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.details.JpaPageComposite;
-import org.eclipse.swt.widgets.Composite;
-
-public interface PersistenceXmlUiFactory
-{
- // **************** persistence unit composites ****************************
-
- /**
- * Creates the list of <code>JpaComposite</code>s used to edit a
- * <code>PersistenceUnit</code>. The properties can be regrouped into
- * sections that will be shown in the editor as pages.
- *
- * @param subjectHolder The holder of the pertistence unit
- * @param parent The parent container
- * @param widgetFactory The factory used to create the widgets
- * @return A new <code>JpaComposite</code>
- */
- ListIterator<JpaPageComposite> createPersistenceUnitComposites(
- PropertyValueModel<PersistenceUnit> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/perspective/JpaPerspectiveFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/perspective/JpaPerspectiveFactory.java
deleted file mode 100644
index 6402201b1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/perspective/JpaPerspectiveFactory.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.jpa.ui.internal.perspective;
-
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.ui.IFolderLayout;
-import org.eclipse.ui.IPageLayout;
-import org.eclipse.ui.IPerspectiveFactory;
-import org.eclipse.ui.navigator.resources.ProjectExplorer;
-import org.eclipse.ui.progress.IProgressConstants;
-
-public class JpaPerspectiveFactory implements IPerspectiveFactory {
-
- public void createInitialLayout(IPageLayout layout) {
- String editorArea = layout.getEditorArea();
-
- //Package area
- IFolderLayout folder = layout.createFolder(
- "left", IPageLayout.LEFT, (float) 0.25, editorArea); //$NON-NLS-1$
- folder.addView(ProjectExplorer.VIEW_ID);
- folder.addPlaceholder(JavaUI.ID_TYPE_HIERARCHY);
- folder.addPlaceholder(IPageLayout.ID_RES_NAV);
-
- //Database Explorer area
- layout.addView("org.eclipse.datatools.connectivity.DataSourceExplorerNavigator", //$NON-NLS-1$
- IPageLayout.BOTTOM, (float) 0.60, ProjectExplorer.VIEW_ID);
-
- //Problems/Console area
- IFolderLayout outputFolder = layout.createFolder(
- "bottom", IPageLayout.BOTTOM, (float) 0.60, editorArea); //$NON-NLS-1$
- outputFolder.addView(IPageLayout.ID_PROBLEM_VIEW);
- outputFolder.addPlaceholder(IPageLayout.ID_BOOKMARKS);
- outputFolder.addPlaceholder(IProgressConstants.PROGRESS_VIEW_ID);
-
- //JPA Details (Split with Problems/Console area)
- layout.addView("org.eclipse.jpt.ui.jpaDetailsView", //$NON-NLS-1$
- IPageLayout.RIGHT, (float) .60, "bottom"); //$NON-NLS-1$
-
- //JPA Structure area
- IFolderLayout outlineFolder = layout.createFolder(
- "right", IPageLayout.RIGHT, (float) 0.75, editorArea); //$NON-NLS-1$
- outlineFolder.addView("org.eclipse.jpt.ui.jpaStructureView"); //$NON-NLS-1$
- outlineFolder.addView(IPageLayout.ID_OUTLINE);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/JpaPlatformUiRegistry.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/JpaPlatformUiRegistry.java
deleted file mode 100644
index 5d617afb1f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/JpaPlatformUiRegistry.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.CompositeIterator;
-import org.eclipse.jpt.common.utility.internal.iterators.TransformationIterator;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-
-public class JpaPlatformUiRegistry
-{
- // singleton
- private static final JpaPlatformUiRegistry INSTANCE = new JpaPlatformUiRegistry();
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformUiRegistry instance() {
- return INSTANCE;
- }
-
- private static final String EXTENSION_ID =
- "jpaPlatformUis"; //$NON-NLS-1$
-
- private static final String EL_PLATFORM_UI =
- "jpaPlatformUi"; //$NON-NLS-1$
-
- private static final String AT_ID =
- "id"; //$NON-NLS-1$
-
- private static final String AT_JPA_PLATFORM =
- "jpaPlatform"; //$NON-NLS-1$
-
- private static final String AT_FACTORY_CLASS =
- "factoryClass"; //$NON-NLS-1$
-
- // key: String id value: IConfigurationElement class descriptor
- private Map<String, IConfigurationElement> jpaPlatformUiConfigElements;
-
- //cache the jpaPlatformUis when they are built
- //key: jpa platform id value: JpaPlaformUi
- private Map<String, JpaPlatformUi> jpaPlatformUis;
-
- /* (non Java doc)
- * restrict access
- */
- private JpaPlatformUiRegistry() {
- buildJpaPlatformUiConfigElements();
- this.jpaPlatformUis = new HashMap<String, JpaPlatformUi>();
- }
-
-
- private void buildJpaPlatformUiConfigElements() {
- this.jpaPlatformUiConfigElements = new HashMap<String, IConfigurationElement>();
-
- for (Iterator<IConfigurationElement> stream = allConfigElements(); stream.hasNext(); ) {
- buildJpaPlatformUi(stream.next());
- }
- }
-
- private void buildJpaPlatformUi(IConfigurationElement configElement) {
- if (! configElement.getName().equals(EL_PLATFORM_UI)) {
- return;
- }
-
- String platformUiId = configElement.getAttribute(AT_ID);
- String platform = configElement.getAttribute(AT_JPA_PLATFORM);
- String platformUiFactoryClass = configElement.getAttribute(AT_FACTORY_CLASS);
-
- if ((platformUiId == null) || (platformUiFactoryClass == null)) {
- if (platformUiId == null) {
- reportMissingAttribute(configElement, AT_ID);
- }
- if (platform == null) {
- reportMissingAttribute(configElement, AT_JPA_PLATFORM);
- }
- if (platformUiFactoryClass == null) {
- reportMissingAttribute(configElement, AT_FACTORY_CLASS);
- }
- return;
- }
-
- if (this.jpaPlatformUiConfigElements.containsKey(platformUiId)) {
- IConfigurationElement otherConfigElement = this.jpaPlatformUiConfigElements.get(platform);
- reportDuplicatePlatformUi(configElement, otherConfigElement);
- }
-
- this.jpaPlatformUiConfigElements.put(platformUiId, configElement);
- }
-
- public JpaPlatformUi getJpaPlatformUi(String platformId) {
- if (this.jpaPlatformUis.containsKey(platformId)) {
- return this.jpaPlatformUis.get(platformId);
- }
- IConfigurationElement registeredConfigElement = null;
- for (IConfigurationElement configurationElement : this.jpaPlatformUiConfigElements.values()) {
- if (configurationElement.getAttribute(AT_JPA_PLATFORM).equals(platformId)) {
- registeredConfigElement = configurationElement;
- break;
- }
- }
-
- if (registeredConfigElement == null) {
- return null;
- }
- JpaPlatformUiFactory jpaPlatformUiFactory;
- try {
- jpaPlatformUiFactory = (JpaPlatformUiFactory) registeredConfigElement.createExecutableExtension(AT_FACTORY_CLASS);
- }
- catch (CoreException ce) {
- reportFailedInstantiation(registeredConfigElement);
- throw new IllegalArgumentException(platformId);
- }
- JpaPlatformUi platformUi = jpaPlatformUiFactory.buildJpaPlatformUi();
- this.jpaPlatformUis.put(platformId, platformUi);
- return platformUi;
- }
-
- private Iterator<IConfigurationElement> allConfigElements() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint =
- registry.getExtensionPoint(JptJpaUiPlugin.PLUGIN_ID, EXTENSION_ID);
- IExtension[] extensions = extensionPoint.getExtensions();
-
- return new CompositeIterator<IConfigurationElement>(
- new TransformationIterator<IExtension, Iterator<IConfigurationElement>>(CollectionTools.iterator(extensions)) {
- @Override
- protected Iterator<IConfigurationElement> transform(IExtension extension) {
- return CollectionTools.iterator(extension.getConfigurationElements());
- }
- }
- );
- }
-
- // TODO externalize strings
- private void reportMissingAttribute(IConfigurationElement configElement, String attributeName) {
- String message =
- "An extension element \""
- + configElement.getName()
- + "\" in plugin \""
- + configElement.getContributor().getName()
- + "\" is missing a required attribute \""
- + attributeName
- + "\".";
- JptJpaUiPlugin.log(message);
- }
-
- // TODO externalize strings
- private void reportDuplicatePlatformUi(
- IConfigurationElement oneConfigElement, IConfigurationElement otherConfigElement) {
- String message =
- "The plugins \""
- + oneConfigElement.getContributor().getName()
- + "\" and \""
- + otherConfigElement.getContributor().getName()
- + "\" have registered a duplicate attribute \"id\" "
- + "for the extension element \"jpaPlatformUi\".";
- JptJpaUiPlugin.log(message);
- }
-
- // TODO externalize strings
- private void reportFailedInstantiation(IConfigurationElement configElement) {
- String message =
- "Could not instantiate the class \""
- + configElement.getAttribute(AT_FACTORY_CLASS)
- + "\" for the extension element \""
- + configElement.getName()
- + "\" in the plugin \""
- + configElement.getContributor().getName()
- + "\".";
- JptJpaUiPlugin.log(message);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractJpaPlatformUi.java
deleted file mode 100644
index 7942c16b0c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/AbstractJpaPlatformUi.java
+++ /dev/null
@@ -1,233 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.base;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.wizard.IWizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.MappingResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.ResourceUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.DefaultMappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsProvider;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java.JavaMetadataConversionWizard;
-import org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java.JavaMetadataConversionWizardPage;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-
-public abstract class AbstractJpaPlatformUi
- implements JpaPlatformUi
-{
- private final ItemTreeStateProviderFactoryProvider navigatorFactoryProvider;
-
- private final JpaPlatformUiProvider platformUiProvider;
-
-
- protected AbstractJpaPlatformUi(
- ItemTreeStateProviderFactoryProvider navigatorFactoryProvider,
- JpaPlatformUiProvider platformUiProvider
- ) {
- super();
- if ((navigatorFactoryProvider == null) || (platformUiProvider == null)) {
- throw new NullPointerException();
- }
- this.navigatorFactoryProvider = navigatorFactoryProvider;
- this.platformUiProvider = platformUiProvider;
- }
-
-
- // ********** navigator provider **********
-
- public ItemTreeStateProviderFactoryProvider getNavigatorFactoryProvider() {
- return this.navigatorFactoryProvider;
- }
-
-
- // ********** structure view factory providers **********
-
- public ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider(JpaFile jpaFile) {
- JptResourceType resourceType = jpaFile.getResourceModel().getResourceType();
- return (resourceType == null) ? null : this.getStructureViewFactoryProvider(resourceType);
- }
-
- protected ItemTreeStateProviderFactoryProvider getStructureViewFactoryProvider(JptResourceType resourceType) {
- try {
- return this.getResourceUiDefinition(resourceType).getStructureViewFactoryProvider();
- } catch (IllegalArgumentException iae) {
- JptJpaUiPlugin.log(iae);
- return null;
- }
- }
-
-
- // ********** details providers **********
-
- public JpaDetailsPageManager<? extends JpaStructureNode> buildJpaDetailsPageManager(
- Composite parent, JpaStructureNode structureNode, WidgetFactory widgetFactory) {
-
- JpaDetailsProvider jpaDetailsProvider = getDetailsProvider(structureNode);
- return jpaDetailsProvider == null ? null : jpaDetailsProvider.buildDetailsPageManager(parent, widgetFactory);
- }
-
- protected JpaDetailsProvider getDetailsProvider(JpaStructureNode structureNode) {
- for (JpaDetailsProvider provider : CollectionTools.iterable(this.detailsProviders())) {
- if (provider.providesDetails(structureNode)) {
- return provider;
- }
- }
- return null;//return null, some structure nodes do not have a details page
- }
-
- protected ListIterator<JpaDetailsProvider> detailsProviders() {
- return this.platformUiProvider.detailsProviders();
- }
-
-
- // ********** mapping ui definitions **********
-
- public JpaComposite buildTypeMappingComposite(
- JptResourceType resourceType,
- String mappingKey,
- Composite parent,
- PropertyValueModel<TypeMapping> mappingHolder,
- WidgetFactory widgetFactory) {
-
- return getMappingResourceUiDefinition(resourceType).buildTypeMappingComposite(
- mappingKey, mappingHolder, parent, widgetFactory);
- }
-
- public JpaComposite buildAttributeMappingComposite(
- JptResourceType resourceType,
- String mappingKey,
- Composite parent,
- PropertyValueModel<AttributeMapping> mappingHolder,
- WidgetFactory widgetFactory) {
-
- return getMappingResourceUiDefinition(resourceType).buildAttributeMappingComposite(
- mappingKey, mappingHolder, parent, widgetFactory);
- }
-
- public DefaultMappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping> getDefaultAttributeMappingUiDefinition(JptResourceType resourceType, String mappingKey) {
- return getMappingResourceUiDefinition(resourceType).getDefaultAttributeMappingUiDefinition(mappingKey);
- }
-
- public Iterator<MappingUiDefinition<ReadOnlyPersistentAttribute, ? extends AttributeMapping>> attributeMappingUiDefinitions(JptResourceType resourceType) {
- return getMappingResourceUiDefinition(resourceType).attributeMappingUiDefinitions();
- }
-
- public DefaultMappingUiDefinition<PersistentType, ? extends TypeMapping> getDefaultTypeMappingUiDefinition(JptResourceType resourceType) {
- return getMappingResourceUiDefinition(resourceType).getDefaultTypeMappingUiDefinition();
- }
-
- public Iterator<MappingUiDefinition<PersistentType, ? extends TypeMapping>> typeMappingUiDefinitions(JptResourceType resourceType) {
- return getMappingResourceUiDefinition(resourceType).typeMappingUiDefinitions();
- }
-
-
- // ********** resource ui definitions **********
-
- protected ListIterator<ResourceUiDefinition> resourceUiDefinitions() {
- return this.platformUiProvider.resourceUiDefinitions();
- }
-
- public ResourceUiDefinition getResourceUiDefinition(JptResourceType resourceType) {
- for (ResourceUiDefinition definition : CollectionTools.iterable(this.resourceUiDefinitions())) {
- if (definition.providesUi(resourceType)) {
- return definition;
- }
- }
- // TODO (bug 313632) - return a null resource ui definition?
- throw new IllegalArgumentException("No resource UI definition for the resource type: " + resourceType); //$NON-NLS-1$
- }
-
- public MappingResourceUiDefinition getMappingResourceUiDefinition(JptResourceType resourceType) {
- ResourceUiDefinition def = this.getResourceUiDefinition(resourceType);
- try {
- return (MappingResourceUiDefinition) def;
- } catch (ClassCastException cce) {
- // TODO (bug 313632) - return a null resource ui definition?
- throw new IllegalArgumentException("No mapping resource UI definition for the resource type: " + resourceType, cce); //$NON-NLS-1$
- }
- }
-
-
- // ********** entity generation **********
-
- public void generateEntities(JpaProject project, IStructuredSelection selection) {
- EntitiesGenerator.generate(project, selection);
- }
-
-
- // ********** convenience methods **********
-
- protected void displayMessage(String title, String message) {
- MessageDialog.openInformation(SWTUtil.getShell(), title, message);
- }
-
- protected void openInDialog(JavaMetadataConversionWizardPage wizardPage) {
- openInDialog(new JavaMetadataConversionWizard(wizardPage));
- }
-
- protected void openInDialog(IWizard wizard) {
- new SizedWizardDialog(wizard).open();
- }
-
-
- // ********** wizard dialog **********
-
- public class SizedWizardDialog
- extends WizardDialog
- {
- private final int width;
- private final int height;
-
- public SizedWizardDialog(IWizard wizard) {
- this(wizard, 520, 460);
- }
-
- public SizedWizardDialog(IWizard wizard, int width, int height) {
- this(SWTUtil.getShell(), wizard, width, height);
- }
-
- public SizedWizardDialog(Shell shell, IWizard wizard, int width, int height) {
- super(shell, wizard);
- this.width = width;
- this.height = height;
- }
-
- @Override
- protected void configureShell(Shell shell) {
- super.configureShell(shell);
- shell.setSize(this.width, this.height);
- SWTUtil.center(shell, this.getParentShell());
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/EntitiesGenerator.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/EntitiesGenerator.java
deleted file mode 100644
index 76591440ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/base/EntitiesGenerator.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.base;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.ui.internal.wizards.gen.GenerateEntitiesFromSchemaWizard;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-
-/**
- * EntitiesGenerator
- */
-public class EntitiesGenerator {
- private JpaProject project;
- private IStructuredSelection selection;
-
- public static void generate(JpaProject project, IStructuredSelection selection) {
- new EntitiesGenerator(project, selection).generate();
- }
-
- private EntitiesGenerator(JpaProject project, IStructuredSelection selection) {
- super();
- if (project == null) {
- throw new NullPointerException();
- }
- this.project = project;
- this.selection = selection;
- }
-
-
- // ********** generate **********
-
- /**
- * prompt the user with a wizard;
- * schedule a job to generate the entities;
- * optionally schedule a job to synchronize persistence.xml to
- * run afterwards
- */
- protected void generate() {
- GenerateEntitiesFromSchemaWizard wizard = new GenerateEntitiesFromSchemaWizard(this.project, this.selection);
- WizardDialog dialog = new WizardDialog(this.getCurrentShell(), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if (returnCode != Window.OK) {
- return;
- }
- //Entities generation happens in the GenerateEntitiesFromSchemaWizard.performFinish()
- //method
- }
-
- private Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/ClassRefItemLabelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/ClassRefItemLabelProvider.java
deleted file mode 100644
index e13eaa0ab1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/ClassRefItemLabelProvider.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-public class ClassRefItemLabelProvider
- extends AbstractItemExtendedLabelProvider<ClassRef>
-{
- protected final Image image;
-
- public ClassRefItemLabelProvider(ClassRef classRef, ItemLabelProvider.Manager manager) {
- super(classRef, manager);
- this.image = this.buildImage();
- }
-
- @Override
- public Image getImage() {
- return this.image;
- }
-
- protected Image buildImage() {
- return this.item.isVirtual() ?
- JptUiIcons.ghost(JptUiIcons.CLASS_REF) :
- JptJpaUiPlugin.getImage(JptUiIcons.CLASS_REF);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new TextModel(this.item);
- }
-
- protected static class TextModel
- extends PropertyAspectAdapter<ClassRef, String>
- {
- public TextModel(ClassRef subject) {
- super(ClassRef.CLASS_NAME_PROPERTY, subject);
- }
- @Override
- protected String buildValue_() {
- return this.subject.getClassName();
- }
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return PersistenceUnitItemLabelProvider.buildQuotedComponentDescriptionModel(
- this.item,
- this.textModel
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericJpaPlatformUi.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericJpaPlatformUi.java
deleted file mode 100644
index 32e3e4743e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericJpaPlatformUi.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.platform.base.AbstractJpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java.GenericJavaGeneratorConversionWizardPage;
-import org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java.GenericJavaQueryConversionWizardPage;
-
-public class GenericJpaPlatformUi
- extends AbstractJpaPlatformUi
-{
- public GenericJpaPlatformUi(
- ItemTreeStateProviderFactoryProvider navigatorFactoryProvider,
- JpaPlatformUiProvider platformUiProvider
- ) {
- super(navigatorFactoryProvider, platformUiProvider);
- }
-
- // ********** DDL generation **********
-
- public void generateDDL(JpaProject project, IStructuredSelection selection) {
- this.displayMessage(JptUiMessages.GenericPlatformUiDialog_notSupportedMessageTitle, JptUiMessages.GenericPlatformUiDialog_notSupportedMessageText);
- }
-
- // ********** metadata conversion **********
-
- public void convertJavaQueryMetadataToGlobal(JpaProject jpaProject) {
- this.openInDialog(new GenericJavaQueryConversionWizardPage(jpaProject));
- }
-
- public void convertJavaGeneratorMetadataToGlobal(JpaProject jpaProject) {
- this.openInDialog(new GenericJavaGeneratorConversionWizardPage(jpaProject));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericJpaPlatformUiFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericJpaPlatformUiFactory.java
deleted file mode 100644
index f6a32b83ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericJpaPlatformUiFactory.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.SimpleItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.GenericJpaPlatformUiProvider;
-
-public class GenericJpaPlatformUiFactory
- implements JpaPlatformUiFactory
-{
-
- /**
- * Zero arg constructor for extension point
- */
- public GenericJpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new GenericJpaPlatformUi(
- NAVIGATOR_FACTORY_PROVIDER,
- GenericJpaPlatformUiProvider.instance()
- );
- }
-
- public static final ItemTreeStateProviderFactoryProvider NAVIGATOR_FACTORY_PROVIDER =
- new SimpleItemTreeStateProviderFactoryProvider(
- GenericNavigatorItemContentProviderFactory.instance(),
- GenericNavigatorItemLabelProviderFactory.instance()
- );
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericNavigatorItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericNavigatorItemContentProviderFactory.java
deleted file mode 100644
index d14343d11a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericNavigatorItemContentProviderFactory.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-
-/**
- * This factory builds item content providers for the JPA content in the
- * Common Navigator.
- */
-public class GenericNavigatorItemContentProviderFactory
- implements ItemTreeContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new GenericNavigatorItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected GenericNavigatorItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof PersistenceXml) {
- return this.buildPersistenceXmlProvider((PersistenceXml) item, manager);
- }
- if (item instanceof PersistenceUnit) {
- return this.buildPersistenceUnitProvider((PersistenceUnit) item, manager);
- }
- if (item instanceof OrmXml) {
- return this.buildOrmXmlProvider((OrmXml) item, manager);
- }
- if (item instanceof OrmPersistentType) {
- return this.buildOrmPersistentTypeProvider((OrmPersistentType) item, manager);
- }
- if (item instanceof JavaPersistentType) {
- return this.buildJavaPersistentTypeProvider((JavaPersistentType) item, manager);
- }
- if (item instanceof PersistentAttribute) {
- return this.buildPersistentAttributeProvider((PersistentAttribute) item, manager);
- }
- return null;
- }
-
- protected ItemTreeContentProvider buildPersistenceXmlProvider(PersistenceXml item, Manager manager) {
- return new PersistenceXmlItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildPersistenceUnitProvider(PersistenceUnit item, Manager manager) {
- return new PersistenceUnitItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildOrmXmlProvider(OrmXml item, Manager manager) {
- return new OrmXmlItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildOrmPersistentTypeProvider(OrmPersistentType item, Manager manager) {
- return new OrmPersistentTypeItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildJavaPersistentTypeProvider(JavaPersistentType item, Manager manager) {
- return new JavaPersistentTypeItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildPersistentAttributeProvider(PersistentAttribute item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getParent());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericNavigatorItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericNavigatorItemLabelProviderFactory.java
deleted file mode 100644
index 49676a4336..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/GenericNavigatorItemLabelProviderFactory.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JarFile;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-
-/**
- * This factory builds item label providers for the JPA content in the
- * Common Navigator.
- */
-public class GenericNavigatorItemLabelProviderFactory
- implements ItemExtendedLabelProviderFactory
-{
- // singleton
- private static final ItemExtendedLabelProviderFactory INSTANCE = new GenericNavigatorItemLabelProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemExtendedLabelProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected GenericNavigatorItemLabelProviderFactory() {
- super();
- }
-
- public ItemExtendedLabelProvider buildProvider(Object item, ItemExtendedLabelProvider.Manager manager) {
- if (item instanceof PersistenceXml) {
- return this.buildPersistenceXmlProvider((PersistenceXml) item, manager);
- }
- if (item instanceof PersistenceUnit) {
- return this.buildPersistenceUnitProvider((PersistenceUnit) item, manager);
- }
- if (item instanceof OrmXml) {
- return this.buildOrmXmlProvider((OrmXml) item, manager);
- }
- if (item instanceof PersistentType) {
- return this.buildPersistentTypeProvider((PersistentType) item, manager);
- }
- if (item instanceof ReadOnlyPersistentAttribute) {
- return this.buildPersistentAttributeProvider((ReadOnlyPersistentAttribute) item, manager);
- }
- if (item instanceof JarFile) {
- return this.buildJarFileProvider((JarFile) item, manager);
- }
- return null;
- }
-
- protected ItemExtendedLabelProvider buildPersistenceXmlProvider(PersistenceXml item, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
- return this.buildResourceItemLabelProvider(item);
- }
-
- protected ItemExtendedLabelProvider buildPersistenceUnitProvider(PersistenceUnit item, ItemExtendedLabelProvider.Manager manager) {
- return new PersistenceUnitItemLabelProvider(item, manager);
- }
-
- protected ItemExtendedLabelProvider buildOrmXmlProvider(OrmXml item, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
- return this.buildResourceItemLabelProvider(item);
- }
-
- protected ItemExtendedLabelProvider buildPersistentTypeProvider(PersistentType item, ItemExtendedLabelProvider.Manager manager) {
- return new PersistentTypeItemLabelProvider(item, manager);
- }
-
- protected ItemExtendedLabelProvider buildPersistentAttributeProvider(ReadOnlyPersistentAttribute item, ItemExtendedLabelProvider.Manager manager) {
- return new PersistentAttributeItemLabelProvider(item, manager);
- }
-
- protected ItemExtendedLabelProvider buildJarFileProvider(JarFile item, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
- return this.buildResourceItemLabelProvider(item, JptUiIcons.JAR_FILE);
- }
-
- protected ItemExtendedLabelProvider buildResourceItemLabelProvider(JpaNode node) {
- return this.buildResourceItemLabelProvider(node.getResource());
- }
-
- protected ItemExtendedLabelProvider buildResourceItemLabelProvider(JpaNode node, String imageKey) {
- return this.buildResourceItemLabelProvider(node.getResource(), imageKey);
- }
-
- protected ItemExtendedLabelProvider buildResourceItemLabelProvider(IResource resource) {
- return this.buildResourceItemLabelProvider(resource, JptUiIcons.JPA_FILE);
- }
-
- protected ItemExtendedLabelProvider buildResourceItemLabelProvider(IResource resource, String imageKey) {
- return new StaticItemExtendedLabelProvider(
- JptJpaUiPlugin.getImage(imageKey),
- resource.getName(),
- this.buildResourceDescription(resource)
- );
- }
-
- protected String buildResourceDescription(IResource resource) {
- StringBuilder sb = new StringBuilder();
- sb.append(resource.getName());
- sb.append(" - "); //$NON-NLS-1$
- sb.append(resource.getParent().getFullPath().makeRelative());
- return sb.toString();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JarFileRefItemLabelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JarFileRefItemLabelProvider.java
deleted file mode 100644
index ed19a519c4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JarFileRefItemLabelProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-public class JarFileRefItemLabelProvider
- extends AbstractItemExtendedLabelProvider<JarFileRef>
-{
- protected final Image image;
-
- public JarFileRefItemLabelProvider(JarFileRef jarFileRef, ItemLabelProvider.Manager manager) {
- super(jarFileRef, manager);
- this.image = this.buildImage();
- }
-
- @Override
- public Image getImage() {
- return this.image;
- }
-
- protected Image buildImage() {
- return JptJpaUiPlugin.getImage(JptUiIcons.JAR_FILE_REF);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new TextModel(this.item);
- }
-
- protected static class TextModel
- extends PropertyAspectAdapter<JarFileRef, String>
- {
- public TextModel(JarFileRef subject) {
- super(JarFileRef.FILE_NAME_PROPERTY, subject);
- }
- @Override
- protected String buildValue_() {
- return this.subject.getFileName();
- }
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return PersistenceUnitItemLabelProvider.buildQuotedComponentDescriptionModel(
- this.item,
- this.textModel
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JavaPersistentTypeItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JavaPersistentTypeItemContentProvider.java
deleted file mode 100644
index 1441c40530..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/JavaPersistentTypeItemContentProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-
-public class JavaPersistentTypeItemContentProvider
- extends AbstractItemTreeContentProvider<JavaPersistentType, JavaPersistentAttribute>
-{
- public JavaPersistentTypeItemContentProvider(JavaPersistentType persistentType, Manager manager) {
- super(persistentType, manager);
- }
-
- public Object getParent() {
- return this.item.getParent();
- }
-
- @Override
- protected CollectionValueModel<JavaPersistentAttribute> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<JavaPersistentAttribute>(new ChildrenModel(this.item));
- }
-
- protected static class ChildrenModel
- extends ListAspectAdapter<JavaPersistentType, JavaPersistentAttribute>
- {
- ChildrenModel(JavaPersistentType javaPersistentType) {
- super(JavaPersistentType.ATTRIBUTES_LIST, javaPersistentType);
- }
-
- @Override
- protected ListIterable<JavaPersistentAttribute> getListIterable() {
- return this.subject.getAttributes();
- }
-
- @Override
- public int size_() {
- return this.subject.getAttributesSize();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/MappingFileRefItemLabelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/MappingFileRefItemLabelProvider.java
deleted file mode 100644
index 1a16a48ba6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/MappingFileRefItemLabelProvider.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-public class MappingFileRefItemLabelProvider
- extends AbstractItemExtendedLabelProvider<MappingFileRef>
-{
- protected final Image image;
-
- public MappingFileRefItemLabelProvider(MappingFileRef mappingFileRef, ItemLabelProvider.Manager manager) {
- super(mappingFileRef, manager);
- this.image = this.buildImage();
- }
-
- @Override
- public Image getImage() {
- return this.image;
- }
-
- protected Image buildImage() {
- return this.item.isImplied() ?
- JptUiIcons.ghost(JptUiIcons.MAPPING_FILE_REF) :
- JptJpaUiPlugin.getImage(JptUiIcons.MAPPING_FILE_REF);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new TextModel(this.item);
- }
-
- protected static class TextModel
- extends PropertyAspectAdapter<MappingFileRef, String>
- {
- public TextModel(MappingFileRef subject) {
- super(MappingFileRef.FILE_NAME_PROPERTY, subject);
- }
- @Override
- protected String buildValue_() {
- return this.subject.getFileName();
- }
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return PersistenceUnitItemLabelProvider.buildQuotedComponentDescriptionModel(
- this.item,
- this.textModel
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmPersistentTypeItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmPersistentTypeItemContentProvider.java
deleted file mode 100644
index 9f62040c8d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmPersistentTypeItemContentProvider.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import java.util.ArrayList;
-import java.util.List;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.SuperListIterableWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-
-public class OrmPersistentTypeItemContentProvider
- extends AbstractItemTreeContentProvider<OrmPersistentType, OrmReadOnlyPersistentAttribute>
-{
- public OrmPersistentTypeItemContentProvider(OrmPersistentType persistentType, Manager manager) {
- super(persistentType, manager);
- }
-
- public Object getParent() {
- return this.item.getParent();
- }
-
- @Override
- protected CollectionValueModel<OrmReadOnlyPersistentAttribute> buildChildrenModel() {
- List<CollectionValueModel<OrmReadOnlyPersistentAttribute>> list = new ArrayList<CollectionValueModel<OrmReadOnlyPersistentAttribute>>(2);
- list.add(this.buildSpecifiedPersistentAttributesModel());
- list.add(this.buildDefaultPersistentAttributesModel());
- return new CompositeCollectionValueModel<CollectionValueModel<OrmReadOnlyPersistentAttribute>, OrmReadOnlyPersistentAttribute>(list);
- }
-
- protected CollectionValueModel<OrmReadOnlyPersistentAttribute> buildSpecifiedPersistentAttributesModel() {
- return new ListCollectionValueModelAdapter<OrmReadOnlyPersistentAttribute>(new SpecifiedPersistentAttributesModel(this.item));
- }
-
- protected static class SpecifiedPersistentAttributesModel
- extends ListAspectAdapter<OrmPersistentType, OrmReadOnlyPersistentAttribute>
- {
- SpecifiedPersistentAttributesModel(OrmPersistentType ormPersistentType) {
- super(OrmPersistentType.SPECIFIED_ATTRIBUTES_LIST, ormPersistentType);
- }
-
- @Override
- protected ListIterable<OrmReadOnlyPersistentAttribute> getListIterable() {
- return new SuperListIterableWrapper<OrmReadOnlyPersistentAttribute>(this.getSpecifiedAttributes());
- }
-
- protected ListIterable<OrmPersistentAttribute> getSpecifiedAttributes() {
- return this.subject.getSpecifiedAttributes();
- }
-
- @Override
- public int size_() {
- return this.subject.getSpecifiedAttributesSize();
- }
- }
-
- protected CollectionValueModel<OrmReadOnlyPersistentAttribute> buildDefaultPersistentAttributesModel() {
- return new ListCollectionValueModelAdapter<OrmReadOnlyPersistentAttribute>(new DefaultPersistentAttributesModel(this.item));
- }
-
- protected static class DefaultPersistentAttributesModel
- extends ListAspectAdapter<OrmPersistentType, OrmReadOnlyPersistentAttribute>
- {
- DefaultPersistentAttributesModel(OrmPersistentType ormPersistentType) {
- super(OrmPersistentType.DEFAULT_ATTRIBUTES_LIST, ormPersistentType);
- }
-
- @Override
- protected ListIterable<OrmReadOnlyPersistentAttribute> getListIterable() {
- return this.subject.getDefaultAttributes();
- }
-
- @Override
- public int size_() {
- return this.subject.getDefaultAttributesSize();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmXmlItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmXmlItemContentProvider.java
deleted file mode 100644
index 2153137241..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/OrmXmlItemContentProvider.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-
-public class OrmXmlItemContentProvider
- extends AbstractItemTreeContentProvider<OrmXml, OrmPersistentType>
-{
- public OrmXmlItemContentProvider(OrmXml ormXml, Manager manager) {
- super(ormXml, manager);
- }
-
- public PersistenceUnit getParent() {
- return this.item.getPersistenceUnit();
- }
-
- @Override
- protected CollectionValueModel<OrmPersistentType> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<OrmPersistentType>(new ChildrenModel(this.item));
- }
-
- protected static class ChildrenModel
- extends ListAspectAdapter<EntityMappings, OrmPersistentType>
- {
- ChildrenModel(OrmXml ormXml) {
- super(new EntityMappingsModel(ormXml), EntityMappings.PERSISTENT_TYPES_LIST);
- }
-
- @Override
- protected ListIterable<OrmPersistentType> getListIterable() {
- return subject.getPersistentTypes();
- }
-
- @Override
- protected int size_() {
- return subject.getPersistentTypesSize();
- }
- }
-
- protected static class EntityMappingsModel
- extends PropertyAspectAdapter<OrmXml, EntityMappings>
- {
- public EntityMappingsModel(OrmXml subject) {
- super(OrmXml.ROOT_PROPERTY, subject);
- }
- @Override
- protected EntityMappings buildValue_() {
- return this.subject.getRoot();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemContentProvider.java
deleted file mode 100644
index e14aae60b8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemContentProvider.java
+++ /dev/null
@@ -1,198 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.NotNullFilter;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.FilteringCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationListValueModel;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.core.context.MappingFile;
-import org.eclipse.jpt.jpa.core.context.java.JarFile;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.ImpliedClassRefsModel;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.ImpliedMappingFileRefModel;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.JarFileRefsModel;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.SpecifiedClassRefsModel;
-import org.eclipse.jpt.jpa.ui.internal.structure.PersistenceUnitItemContentProvider.SpecifiedMappingFileRefsModel;
-
-/**
- * Item content provider for project explorer.
- */
-public class PersistenceUnitItemContentProvider
- extends AbstractItemTreeContentProvider<PersistenceUnit, JpaContextNode>
-{
- public PersistenceUnitItemContentProvider(PersistenceUnit persistenceUnit, Manager manager) {
- super(persistenceUnit, manager);
- }
-
- public PersistenceXml getParent() {
- // skip the root 'persistence' element and return the persistence.xml file
- return this.item.getParent().getParent();
- }
-
- @Override
- protected CollectionValueModel<JpaContextNode> buildChildrenModel() {
- ArrayList<CollectionValueModel<? extends JpaContextNode>> list = new ArrayList<CollectionValueModel<? extends JpaContextNode>>(4);
- this.addChildrenModelsTo(list);
- return new CompositeCollectionValueModel<CollectionValueModel<? extends JpaContextNode>, JpaContextNode>(list);
- }
-
- protected void addChildrenModelsTo(ArrayList<CollectionValueModel<? extends JpaContextNode>> list) {
- list.add(this.buildNotNullSpecifiedMappingFilesModel());
- list.add(this.buildImpliedMappingFilesModel());
- list.add(this.buildNotNullPersistentTypesModel());
- list.add(this.buildNotNullJarFilesModel());
- }
-
-
- // ********** specified mapping files **********
-
- protected CollectionValueModel<MappingFile> buildNotNullSpecifiedMappingFilesModel() {
- return new FilteringCollectionValueModel<MappingFile>(
- this.buildSpecifiedMappingFilesModel(),
- NotNullFilter.<MappingFile>instance()
- );
- }
-
- protected ListValueModel<MappingFile> buildSpecifiedMappingFilesModel() {
- return new TransformationListValueModel<MappingFileRef, MappingFile>(
- this.buildSpecifiedMappingFileRefsModel(),
- MappingFileRef.MAPPING_FILE_TRANSFORMER
- );
- }
-
- protected ListValueModel<MappingFileRef> buildSpecifiedMappingFileRefsModel() {
- return new ItemPropertyListValueModelAdapter<MappingFileRef>(
- this.buildSpecifiedMappingFileRefsModel_(),
- MappingFileRef.MAPPING_FILE_PROPERTY
- );
- }
-
- protected ListValueModel<MappingFileRef> buildSpecifiedMappingFileRefsModel_() {
- return new SpecifiedMappingFileRefsModel(this.item);
- }
-
-
- // ********** implied mapping file **********
-
- /**
- * No need to filter this list model as it will be empty if the wrapped
- * property model is <code>null</code>.
- */
- protected CollectionValueModel<MappingFile> buildImpliedMappingFilesModel() {
- return new PropertyCollectionValueModelAdapter<MappingFile>(this.buildImpliedMappingFileModel());
- }
-
- protected PropertyValueModel<MappingFile> buildImpliedMappingFileModel() {
- return new ImpliedMappingFileModel(this.buildImpliedMappingFileRefModel());
- }
-
- public static class ImpliedMappingFileModel
- extends PropertyAspectAdapter<MappingFileRef, MappingFile>
- {
- public ImpliedMappingFileModel(PropertyValueModel<MappingFileRef> refModel) {
- super(refModel, MappingFileRef.MAPPING_FILE_PROPERTY);
- }
- @Override
- protected MappingFile buildValue_() {
- return this.subject.getMappingFile();
- }
- }
-
- protected PropertyValueModel<MappingFileRef> buildImpliedMappingFileRefModel() {
- return new ImpliedMappingFileRefModel(this.item);
- }
-
-
- // ********** persistent types **********
-
- protected CollectionValueModel<JavaPersistentType> buildNotNullPersistentTypesModel() {
- return new FilteringCollectionValueModel<JavaPersistentType>(
- this.buildPersistentTypesModel(),
- NotNullFilter.<JavaPersistentType>instance()
- );
- }
-
- protected ListValueModel<JavaPersistentType> buildPersistentTypesModel() {
- return new TransformationListValueModel<ClassRef, JavaPersistentType>(
- this.buildClassRefsModel(),
- ClassRef.JAVA_PERSISTENT_TYPE_TRANSFORMER
- );
- }
-
- protected ListValueModel<ClassRef> buildClassRefsModel() {
- return new ItemPropertyListValueModelAdapter<ClassRef>(
- this.buildClassRefsModel_(),
- ClassRef.JAVA_PERSISTENT_TYPE_PROPERTY
- );
- }
-
- protected CollectionValueModel<ClassRef> buildClassRefsModel_() {
- ArrayList<CollectionValueModel<ClassRef>> list = new ArrayList<CollectionValueModel<ClassRef>>(2);
- list.add(this.buildSpecifiedClassRefsModel());
- list.add(this.buildImpliedClassRefsModel());
- return new CompositeCollectionValueModel<CollectionValueModel<ClassRef>, ClassRef>(list);
- }
-
- protected CollectionValueModel<ClassRef> buildSpecifiedClassRefsModel() {
- return new ListCollectionValueModelAdapter<ClassRef>(this.buildSpecifiedClassRefsModel_());
- }
-
- protected ListValueModel<ClassRef> buildSpecifiedClassRefsModel_() {
- return new SpecifiedClassRefsModel(this.item);
- }
-
- protected CollectionValueModel<ClassRef> buildImpliedClassRefsModel() {
- return new ImpliedClassRefsModel(this.item);
- }
-
-
- // ********** jar files **********
-
- protected CollectionValueModel<JarFile> buildNotNullJarFilesModel() {
- return new FilteringCollectionValueModel<JarFile>(
- this.buildJarFilesModel(),
- NotNullFilter.<JarFile>instance()
- );
- }
-
- protected ListValueModel<JarFile> buildJarFilesModel() {
- return new TransformationListValueModel<JarFileRef, JarFile>(
- this.buildJarFileRefsModel(),
- JarFileRef.JAR_FILE_TRANSFORMER
- );
- }
-
- protected ListValueModel<JarFileRef> buildJarFileRefsModel() {
- return new ItemPropertyListValueModelAdapter<JarFileRef>(
- this.buildJarFileRefsModel_(),
- JarFileRef.JAR_FILE_PROPERTY
- );
- }
-
- protected ListValueModel<JarFileRef> buildJarFileRefsModel_() {
- return new JarFileRefsModel(this.item);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemLabelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemLabelProvider.java
deleted file mode 100644
index 56a2990a1a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceUnitItemLabelProvider.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-public class PersistenceUnitItemLabelProvider
- extends AbstractItemExtendedLabelProvider<PersistenceUnit>
-{
- protected final Image image;
-
- public PersistenceUnitItemLabelProvider(PersistenceUnit persistenceUnit, ItemLabelProvider.Manager manager) {
- super(persistenceUnit, manager);
- this.image = this.buildImage();
- }
-
- @Override
- public Image getImage() {
- return this.image;
- }
-
- protected Image buildImage() {
- return JptJpaUiPlugin.getImage(JptUiIcons.PERSISTENCE_UNIT);
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new TextModel(this.item);
- }
-
- protected static class TextModel
- extends PropertyAspectAdapter<PersistenceUnit, String>
- {
- public TextModel(PersistenceUnit subject) {
- super(PersistenceUnit.NAME_PROPERTY, subject);
- }
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- }
-
- @Override
- protected PropertyValueModel<String> buildDescriptionModel() {
- return new DescriptionModel(this.item);
- }
-
- protected static class DescriptionModel
- extends TextModel
- {
- public DescriptionModel(PersistenceUnit subject) {
- super(subject);
- }
- @Override
- protected String buildValue_() {
- StringBuilder sb = new StringBuilder();
- sb.append(super.buildValue_());
- sb.append(" - "); //$NON-NLS-1$
- sb.append(this.subject.getResource().getFullPath().makeRelative());
- return sb.toString();
- }
- }
-
-
- // ********** component description model **********
-
- @SuppressWarnings("unchecked")
- public static PropertyValueModel<String> buildQuotedComponentDescriptionModel(JpaContextNode node, PropertyValueModel<String> nodeTextModel) {
- return buildComponentDescriptionModel(node, true, nodeTextModel);
- }
-
- public static PropertyValueModel<String> buildNonQuotedComponentDescriptionModel(JpaContextNode node, PropertyValueModel<String>... nodeTextModels) {
- return buildComponentDescriptionModel(node, false, nodeTextModels);
- }
-
- protected static PropertyValueModel<String> buildComponentDescriptionModel(JpaContextNode node, boolean quote, PropertyValueModel<String>... nodeTextModel) {
- return new ComponentDescriptionModel(
- nodeTextModel,
- new TextModel(node.getPersistenceUnit()),
- node.getResource().getFullPath().makeRelative().toString(),
- quote
- );
- }
-
- public static class ComponentDescriptionModel
- extends CompositePropertyValueModel<String, Object>
- {
- protected final PropertyValueModel<String>[] nodeTextModels;
- protected final PropertyValueModel<String> persistenceUnitNameModel;
- protected final String path;
- protected final boolean quote;
-
- @SuppressWarnings("unchecked")
- ComponentDescriptionModel(
- PropertyValueModel<String> nodeTextModel,
- PropertyValueModel<String> persistenceUnitNameModel,
- String path,
- boolean quote
- ) {
- this(
- new PropertyValueModel[] {nodeTextModel},
- persistenceUnitNameModel,
- path,
- quote
- );
- }
-
- ComponentDescriptionModel(
- PropertyValueModel<String>[] nodeTextModels,
- PropertyValueModel<String> persistenceUnitNameModel,
- String path,
- boolean quote
- ) {
- super(ArrayTools.add(nodeTextModels, persistenceUnitNameModel));
- if (nodeTextModels.length < 1) {
- throw new IllegalArgumentException();
- }
- this.nodeTextModels = nodeTextModels;
- this.persistenceUnitNameModel = persistenceUnitNameModel;
- this.path = path;
- this.quote = quote;
- }
-
- @Override
- protected String buildValue() {
- StringBuilder sb = new StringBuilder();
- sb.append(this.persistenceUnitNameModel.getValue());
- sb.append('/');
- if (this.quote) {
- sb.append('\"');
- }
- sb.append(this.nodeTextModels[0].getValue());
- for (int i = 1; i < this.nodeTextModels.length; i++) {
- sb.append('/');
- sb.append(this.nodeTextModels[i].getValue());
- }
- if (this.quote) {
- sb.append('\"');
- }
- sb.append(" - "); //$NON-NLS-1$
- sb.append(this.path);
- return sb.toString();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceXmlItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceXmlItemContentProvider.java
deleted file mode 100644
index a84ff17038..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistenceXmlItemContentProvider.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-
-public class PersistenceXmlItemContentProvider
- extends AbstractItemTreeContentProvider<PersistenceXml, PersistenceUnit>
-{
- public PersistenceXmlItemContentProvider(PersistenceXml persistenceXml, Manager manager) {
- super(persistenceXml, manager);
- }
-
- public JpaRootContextNode getParent() {
- return (JpaRootContextNode) this.item.getParent();
- }
-
- @Override
- protected CollectionValueModel<PersistenceUnit> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<PersistenceUnit>(new ChildrenModel(this.item));
- }
-
- protected static class ChildrenModel
- extends ListAspectAdapter<Persistence, PersistenceUnit>
- {
- ChildrenModel(PersistenceXml subject) {
- super(new PersistenceModel(subject), Persistence.PERSISTENCE_UNITS_LIST);
- }
-
- @Override
- protected ListIterable<PersistenceUnit> getListIterable() {
- return subject.getPersistenceUnits();
- }
-
- @Override
- protected int size_() {
- return subject.getPersistenceUnitsSize();
- }
- }
-
- protected static class PersistenceModel
- extends PropertyAspectAdapter<PersistenceXml, Persistence>
- {
- public PersistenceModel(PersistenceXml subject) {
- super(PersistenceXml.PERSISTENCE_PROPERTY, subject);
- }
- @Override
- protected Persistence buildValue_() {
- return this.subject.getPersistence();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentAttributeItemLabelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentAttributeItemLabelProvider.java
deleted file mode 100644
index cffa203c34..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentAttributeItemLabelProvider.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.swt.graphics.Image;
-
-public class PersistentAttributeItemLabelProvider
- extends AbstractItemExtendedLabelProvider<ReadOnlyPersistentAttribute>
-{
- public PersistentAttributeItemLabelProvider(ReadOnlyPersistentAttribute persistentAttribute, ItemLabelProvider.Manager manager) {
- super(persistentAttribute, manager);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new ImageModel(this.item);
- }
-
- protected static class ImageModel
- extends PropertyAspectAdapter<ReadOnlyPersistentAttribute, Image>
- {
- public ImageModel(ReadOnlyPersistentAttribute subject) {
- super(ReadOnlyPersistentAttribute.MAPPING_PROPERTY, subject);
- }
- @Override
- protected Image buildValue_() {
- String mappingKey = this.subject.getMappingKey();
- return this.subject.isVirtual() ?
- JptUiIcons.ghost(JpaMappingImageHelper.iconKeyForAttributeMapping(mappingKey)) :
- JpaMappingImageHelper.imageForAttributeMapping(mappingKey);
- }
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new TextModel(this.item);
- }
-
- protected static class TextModel
- extends PropertyAspectAdapter<ReadOnlyPersistentAttribute, String>
- {
- public TextModel(ReadOnlyPersistentAttribute subject) {
- super(ReadOnlyPersistentAttribute.NAME_PROPERTY, subject);
- }
- @Override
- protected String buildValue_() {
- return this.subject.getName();
- }
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected PropertyValueModel<String> buildDescriptionModel() {
- return PersistenceUnitItemLabelProvider.buildNonQuotedComponentDescriptionModel(
- this.item,
- this.buildTypeTextModel(),
- this.textModel
- );
- }
-
- protected PropertyValueModel<String> buildTypeTextModel() {
- return new PersistentTypeItemLabelProvider.TextModel(this.item.getOwningPersistentType());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentTypeItemLabelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentTypeItemLabelProvider.java
deleted file mode 100644
index f1742adf2b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/platform/generic/PersistentTypeItemLabelProvider.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.platform.generic;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemLabelProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.ui.internal.JpaMappingImageHelper;
-import org.eclipse.swt.graphics.Image;
-
-public class PersistentTypeItemLabelProvider
- extends AbstractItemExtendedLabelProvider<PersistentType>
-{
- public PersistentTypeItemLabelProvider(PersistentType persistentType, ItemLabelProvider.Manager manager) {
- super(persistentType, manager);
- }
-
- @Override
- protected PropertyValueModel<Image> buildImageModel() {
- return new ImageModel(this.item);
- }
-
- protected static class ImageModel
- extends PropertyAspectAdapter<PersistentType, Image>
- {
- public ImageModel(PersistentType subject) {
- super(PersistentType.MAPPING_PROPERTY, subject);
- }
- @Override
- protected Image buildValue_() {
- return JpaMappingImageHelper.imageForTypeMapping(this.subject.getMappingKey());
- }
- }
-
- @Override
- protected PropertyValueModel<String> buildTextModel() {
- return new TextModel(this.item);
- }
-
- protected static class TextModel
- extends PropertyAspectAdapter<PersistentType, String>
- {
- public TextModel(PersistentType subject) {
- super(PersistentType.NAME_PROPERTY, subject);
- }
- @Override
- protected String buildValue_() {
- return this.subject.getSimpleName();
- }
- }
-
- @Override
- @SuppressWarnings("unchecked")
- protected PropertyValueModel<String> buildDescriptionModel() {
- return PersistenceUnitItemLabelProvider.buildNonQuotedComponentDescriptionModel(
- this.item,
- this.textModel
- );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaEntityGenPreferencePage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaEntityGenPreferencePage.java
deleted file mode 100644
index 9f1dcd0dd9..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaEntityGenPreferencePage.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.prefs;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.prefs.JpaEntityGenPreferencesManager;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.PropertyPage;
-
-public class JpaEntityGenPreferencePage extends PropertyPage {
-
- private JpaEntityGenPreferencesManager prefsManager;
- private EntityGenComposite entityGenComposite;
-
- // ********** constructors **********
-
- public JpaEntityGenPreferencePage() {
- super();
- this.setDescription(JptUiMessages.JpaEntityGenPreferencePage_Description);
- }
-
- // ********** overrides **********
-
- @Override
- public boolean performOk() {
- super.performOk();
-
- this.updateProjectEntityGenPreferences();
-
- return true;
- }
-
- @Override
- protected Control createContents(Composite parent) {
- this.prefsManager = new JpaEntityGenPreferencesManager(this.getProject());
-
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- this.entityGenComposite = new EntityGenComposite(composite);
-
- return composite;
- }
-
- // ********** preferences **********
-
- private void updateProjectEntityGenPreferences() {
-
- if(StringTools.stringIsEmpty(this.getDefaultPackage())) {
- this.prefsManager.removeDefaultPackagePreference();
- }
- else {
- this.prefsManager.setDefaultPackagePreference(this.getDefaultPackage());
- }
- }
-
- // ********** internal methods **********
-
- private IProject getProject() {
- IAdaptable adaptable= this.getElement();
- return adaptable == null ? null : (IProject)adaptable.getAdapter(IProject.class);
- }
-
- // ********** getters *********
-
- private String getDefaultPackage() {
- return this.entityGenComposite.getDefaultPackage();
- }
-
- // ********** queries *********
-
- private String getDefaultPackagePreference() {
- return this.prefsManager.getDefaultPackagePreference();
- }
-
- // ********** EntityGenComposite **********
-
- class EntityGenComposite {
- private final Text defaultPackageText;
-
- // ********** constructor **********
-
- private EntityGenComposite(Composite parent) {
- super();
- // Entity Gen group box
- Group group = new Group(parent, SWT.NONE);
- group.setText(JptUiMessages.JpaEntityGenPreferencePage_generalGroup_title);
- group.setLayout(new GridLayout(2, false));
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // default package
- this.buildLabel(group, 1, JptUiMessages.JpaEntityGenPreferencePage_defaultPackageLabel);
- this.defaultPackageText = this.buildText(group, 1);
-
- this.initializeFromPreferences();
- }
-
- // ********** UI controls **********
-
- private void initializeFromPreferences() {
- // source
- this.defaultPackageText.setText(getDefaultPackagePreference());
- }
-
- private Text buildText(Composite parent, int horizontalSpan) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- gridData.horizontalSpan = horizontalSpan;
- text.setLayoutData(gridData);
- return text;
- }
-
- private Label buildLabel(Composite parent, int span, String text) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(text);
- GridData gridData = new GridData();
- gridData.horizontalSpan = span;
- label.setLayoutData(gridData);
- return label;
- }
-
- // ********** getters *********
-
- private String getDefaultPackage() {
- return this.defaultPackageText.getText();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaPreferencesPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaPreferencesPage.java
deleted file mode 100644
index d441aa41c6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaPreferencesPage.java
+++ /dev/null
@@ -1,301 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.prefs;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.preference.IPreferenceStore;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.prefs.JpaEntityGenPreferencesManager;
-import org.eclipse.jpt.jpa.core.prefs.JpaJpqlPreferencesManager;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * This is the root of the JPA preferences hierarchy in the IDE
- * preferences dialog.
- * <p>
- * Structure:
- * <p>
- * JPA<br>
- * |- Errors/Warnings
- *
- * @version 3.0
- * @since 3.0
- */
-public class JpaPreferencesPage extends PreferencePage
- implements IWorkbenchPreferencePage {
-
- private boolean lowercase;
- private Button lowerCaseRadioButton;
- private boolean matchFirstCharacterCase;
- private Button matchFirstCharacterCaseCheckBox;
- private Button upperCaseRadioButton;
- private Text defaultPackageText;
-
- // ********** constructors **********
-
- public JpaPreferencesPage() {
- super();
- }
-
- // ********** overrides **********
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected Control createContents(Composite parent) {
- this.initializeDialogUnits(parent);
-
- parent = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout(1, false);
- layout.marginWidth = 0;
- layout.marginHeight = 0;
- layout.verticalSpacing = this.convertVerticalDLUsToPixels(10);
- layout.horizontalSpacing = this.convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- parent.setLayout(layout);
-
- Label description = new Label(parent, SWT.NONE);
- description.setText(JptUiMessages.JpaPreferencesPage_description);
-
- this.addEntityGenGroup(parent);
- this.addJpqlEditorGroup(parent);
-
- Dialog.applyDialogFont(parent);
- return parent;
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- protected void performDefaults() {
- // entitygen prefs
- String defaultPackage = JpaEntityGenPreferencesManager.getDefaultDefaultPackage();
- this.setDefaultPackage(defaultPackage);
- JpaEntityGenPreferencesManager.setDefaultPackageWorkspacePreference(defaultPackage);
-
- // jpql identifier prefs
- this.lowercase = this.isDefaultJpqlIdentifierLowercase();
- this.matchFirstCharacterCase = this.shouldDefaultMatchFirstCharacterCase();
-
- this.lowerCaseRadioButton.setSelection(this.lowercase);
- this.upperCaseRadioButton.setSelection( ! this.lowercase);
- this.matchFirstCharacterCaseCheckBox.setSelection(this.matchFirstCharacterCase);
-
- super.performDefaults();
- }
-
- /**
- * {@inheritDoc}
- */
- @Override
- public boolean performOk() {
- // entitygen prefs
- JpaEntityGenPreferencesManager.setDefaultPackageWorkspacePreference(this.getDefaultPackage());
-
- // jpql identifier prefs
- JpaJpqlPreferencesManager.setIdentifiersCaseWorkspacePreference(this.jpqlIdentifierPreferenceValue());
- JpaJpqlPreferencesManager.setMatchFirstCharacterCaseWorkspacePreference(this.matchFirstCharacterCase);
-
- return super.performOk();
- }
-
-
- /**
- * {@inheritDoc}
- */
- public void init(IWorkbench workbench) {
- this.migrateLegacyJpqlWorkspacePreferences();
-
- this.lowercase = this.shouldUseLowercaseIdentifiers();
- this.matchFirstCharacterCase = this.shouldMatchFirstCharacterCase();
- }
-
- // ********** internal methods **********
-
- private void addEntityGenGroup(Composite parent) {
-
- // Entity Gen group box
- Group group = new Group(parent, SWT.NONE);
- group.setText(JptUiMessages.JpaPreferencesPage_entityGen);
- group.setLayout(new GridLayout(2, false));
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // default package
- this.buildLabel(group, 1, JptUiMessages.JpaPreferencesPage_entityGen_defaultPackageLabel);
- this.defaultPackageText = this.buildText(group, 1);
- this.defaultPackageText.setText(
- JpaEntityGenPreferencesManager.getDefaultPackageWorkspacePreference());
- }
-
- private void addJpqlEditorGroup(Composite parent) {
-
- // JPQL Editing group box
- Group group = new Group(parent, SWT.NONE);
- group.setText(JptUiMessages.JpaPreferencesPage_jpqlEditor);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- // Top description
- Label description = new Label(group, SWT.NONE);
- description.setText(JptUiMessages.JpaPreferencesPage_jpqlEditor_description);
-
- // Uppercase radio button
- this.lowerCaseRadioButton = new Button(group, SWT.RADIO);
- this.lowerCaseRadioButton.setText(JptUiMessages.JpaPreferencesPage_jpqlEditor_lowerCaseRadioButton);
- this.lowerCaseRadioButton.addSelectionListener(this.buildLowercaseSelectionListener());
- this.lowerCaseRadioButton.setSelection(this.lowercase);
-
- // Uppercase radio button
- this.upperCaseRadioButton = new Button(group, SWT.RADIO);
- this.upperCaseRadioButton.setText(JptUiMessages.JpaPreferencesPage_jpqlEditor_upperCaseRadioButton);
- this.upperCaseRadioButton.addSelectionListener(this.buildUppercaseSelectionListener());
- this.upperCaseRadioButton.setSelection( ! this.lowercase);
-
- new Label(group, SWT.NONE);
-
- // Match Case of First Letter check box
- this.matchFirstCharacterCaseCheckBox = new Button(group, SWT.CHECK);
- this.matchFirstCharacterCaseCheckBox.setText(JptUiMessages.JpaPreferencesPage_jpqlEditor_matchFirstCharacterCaseRadioButton);
- this.matchFirstCharacterCaseCheckBox.addSelectionListener(buildMatchFirstCharacterCaseSelectionListener());
- this.matchFirstCharacterCaseCheckBox.setSelection(this.matchFirstCharacterCase);
- }
-
- private SelectionListener buildLowercaseSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- Button button = (Button) e.widget;
- lowercase = button.getSelection();
- }
- };
- }
-
- private SelectionListener buildMatchFirstCharacterCaseSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- Button button = (Button) e.widget;
- matchFirstCharacterCase = button.getSelection();
- }
- };
- }
-
- private SelectionListener buildUppercaseSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- Button button = (Button) e.widget;
- lowercase = !button.getSelection();
- }
- };
- }
-
- private boolean isDefaultJpqlIdentifierLowercase() {
- String value = JpaJpqlPreferencesManager.getDefaultIdentifiersCase();
- return JpaJpqlPreferencesManager.JPQL_IDENTIFIER_LOWERCASE_PREF_VALUE.equals(value);
- }
-
- private String jpqlIdentifierPreferenceValue() {
- return this.lowercase ?
- JpaJpqlPreferencesManager.JPQL_IDENTIFIER_LOWERCASE_PREF_VALUE :
- JpaJpqlPreferencesManager.JPQL_IDENTIFIER_UPPERCASE_PREF_VALUE;
- }
-
- private boolean shouldDefaultMatchFirstCharacterCase() {
- return JpaJpqlPreferencesManager.getDefaultMatchFirstCharacterCase();
- }
-
- private boolean shouldMatchFirstCharacterCase() {
- return JpaJpqlPreferencesManager.getMatchFirstCharacterCaseWorkspacePreference();
- }
-
- private boolean shouldUseLowercaseIdentifiers() {
- String value = JpaJpqlPreferencesManager.getIdentifiersCaseWorkspacePreference();
- return JpaJpqlPreferencesManager.JPQL_IDENTIFIER_LOWERCASE_PREF_VALUE.equals(value);
- }
-
- private String getDefaultPackage() {
- if(this.defaultPackageText == null) {
- return null;
- }
- return (StringTools.stringIsEmpty(this.defaultPackageText.getText())) ?
- null :
- this.defaultPackageText.getText();
- }
-
- private void setDefaultPackage(String defaultPackage) {
- if(this.defaultPackageText == null) {
- return;
- }
- this.defaultPackageText.setText(defaultPackage);
- }
-
- private void migrateLegacyJpqlWorkspacePreferences() {
-
- IPreferenceStore preferences = JptJpaUiPlugin.instance().getPreferenceStore();
-
- String legacyCase = preferences.getString(JptJpaUiPlugin.JPQL_IDENTIFIER_CASE_PREF_KEY);
- boolean legacyMatchFirstCharacterCase = preferences.getBoolean(JptJpaUiPlugin.JPQL_IDENTIFIER_MATCH_FIRST_CHARACTER_CASE_PREF_KEY);
-
- if( ! StringTools.stringIsEmpty(legacyCase)) { // value is not empty when legacy preference exist
- JpaJpqlPreferencesManager.setIdentifiersCaseWorkspacePreference(legacyCase);
- }
- if(legacyMatchFirstCharacterCase) { // value is true when legacy preference exist
- JpaJpqlPreferencesManager.setMatchFirstCharacterCaseWorkspacePreference(legacyMatchFirstCharacterCase);
- }
-
- this.removeLegacyJpqlPreferences();
- }
-
- private void removeLegacyJpqlPreferences() {
- IPreferenceStore preferences = JptJpaUiPlugin.instance().getPreferenceStore();
-
- preferences.setToDefault(JptJpaUiPlugin.JPQL_IDENTIFIER_CASE_PREF_KEY);
- preferences.setToDefault(JptJpaUiPlugin.JPQL_IDENTIFIER_MATCH_FIRST_CHARACTER_CASE_PREF_KEY);
- }
-
- // ********** UI controls **********
-
- private Text buildText(Composite parent, int horizontalSpan) {
- Text text = new Text(parent, SWT.SINGLE | SWT.BORDER);
- GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- gridData.horizontalSpan = horizontalSpan;
- text.setLayoutData(gridData);
- return text;
- }
-
- private Label buildLabel(Composite parent, int span, String text) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(text);
- GridData gridData = new GridData();
- gridData.horizontalSpan = span;
- label.setLayoutData(gridData);
- return label;
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaProblemSeveritiesPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaProblemSeveritiesPage.java
deleted file mode 100644
index f8f8b044b6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JpaProblemSeveritiesPage.java
+++ /dev/null
@@ -1,936 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.prefs;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.IncrementalProjectBuilder;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.internal.ui.JavaPlugin;
-import org.eclipse.jdt.internal.ui.preferences.PropertyAndPreferencePage;
-import org.eclipse.jdt.internal.ui.preferences.ScrolledPageContent;
-import org.eclipse.jface.dialogs.IDialogSettings;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.layout.PixelConverter;
-import org.eclipse.jface.operation.IRunnableContext;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jpt.jpa.core.prefs.JpaValidationPreferencesManager;
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.JptUiValidationPreferenceMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.forms.events.ExpansionAdapter;
-import org.eclipse.ui.forms.events.ExpansionEvent;
-import org.eclipse.ui.forms.widgets.ExpandableComposite;
-
-/**
- * This page shows the Java Persistence validation options. It supports
- * workspace and project levels severities.
- *
- * @version 2.3
- * @since 2.2
- */
-@SuppressWarnings("restriction")
-public class JpaProblemSeveritiesPage extends PropertyAndPreferencePage {
-
- /**
- * Severity level state is stored in this Map and is either committed or discarded
- * based on user action.
- * <br> key is the preferenceKey which is also the validation message key @see JpaValidationMessages.
- * <br> value is a severity level - @see JpaValidationPreferences#ERROR WARNING INFO IGNORE
- */
- Map<String, String> severityLevels;
-
- /**
- * Default severity levels are stored here, ERROR is the default default so only need
- * to include WARNING, INFO, IGNORE in this Map. These will be displayed if neither the project
- * or workspace preference applies.
- * <br> key is the preferenceKey which is also the validation message key @see JpaValidationMessages.
- * <br> value is a severity level - @see JpaValidationPreferences#ERROR WARNING INFO IGNORE
- */
- private Map<String, String> defaultSeverities;
-
- /**
- * The list of <code>Combo</code>s is cached in order to perform a revert of
- * the properties.
- */
- private List<Combo> combos;
-
- /**
- * The list of <code>ExpandableComposite</code> is cached in order to save
- * and restore the expansion state.
- */
- private List<ExpandableComposite> expandablePanes;
-
- /**
- * The position of the "Error" choice in the combo's model.
- */
- private static final int ERROR_INDEX = 0;
-
- /**
- * The position of the "Warning" choice in the combo's model.
- */
- private static final int WARNING_INDEX = 1;
-
- /**
- * The position of the "Info" choice in the combo's model.
- */
- private static final int INFO_INDEX = 2;
-
- /**
- * The position of the "Ignore" choice in the combo's model.
- */
- private static final int IGNORE_INDEX = 3;
-
- /**
- * The unique identifier for this page when it is shown in the IDE
- * preferences dialog.
- */
- private static final String JPT_PREFERENCES_PROBLEM_SEVERITIES_ID = "org.eclipse.jpt.jpa.ui.jpaProblemSeveritiesPreferences"; //$NON-NLS-1$
-
- /**
- * The unique identifier for this page when it is shown in the project
- * preferences dialog.
- */
- private static final String JPT_PROPERTY_PAGES_PROBLEM_SEVERITIES_ID = "org.eclipse.jpt.jpa.ui.jpaProblemSeveritiesProperties"; //$NON-NLS-1$
-
- /**
- * A constant used to store and retrieve the preference key (message ID) from
- * the combo.
- */
- private static final String PREFERENCE_KEY = "preferenceKey"; //$NON-NLS-1$
-
- /**
- * The scrollable pane used to show the content of this page.
- */
- private ScrolledPageContent scrollable;
-
- /**
- * The possible choices which describes the severity of a single problem.
- */
- private String[] severityDisplayStrings;
-
- /**
- * Constant used to store the expansion state of each expandable pane.
- */
- public static final String SETTINGS_EXPANDED = "expanded"; //$NON-NLS-1$
-
- /**
- * The preference key used to retrieve the dialog settings where the expansion
- * states have been stored.
- */
- public static final String SETTINGS_SECTION_NAME = "JpaProblemSeveritiesPage"; //$NON-NLS-1$
-
-
- private JpaValidationPreferencesManager preferencesManager;
-
- private Boolean hasProjectSpecificPreferences = null;
-
- /**
- * Creates a new <code>JpaProblemSeveritiesPage</code>.
- */
- public JpaProblemSeveritiesPage() {
- super();
- this.initialize();
- }
-
- @Override
- public void init(IWorkbench workbench) {
- this.setPreferenceStore(JptJpaUiPlugin.instance().getPreferenceStore());
- this.setDescription(JptUiMessages.JpaProblemSeveritiesPage_Description);
- }
-
- @Override
- protected Control createContents(Composite parent) {
- if(this.isProjectPreferencePage()) {
- this.preferencesManager = new JpaValidationPreferencesManager(this.getProject());
- }
- return super.createContents(parent);
- }
-
- protected void initialize() {
- this.combos = new ArrayList<Combo>();
- this.expandablePanes = new ArrayList<ExpandableComposite>();
- this.severityDisplayStrings = this.buildSeverityDisplayStrings();
- this.severityLevels = new HashMap<String, String>();
- this.defaultSeverities = this.buildDefaultSeverities();
- }
-
- //since most of our problems have a default severity of ERROR, we are just defining the WARNING, INFO, IGNORE cases
- protected Map<String, String> buildDefaultSeverities() {
- Map<String, String> result = new HashMap<String, String>();
-
- result.put(JpaValidationMessages.PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.PROJECT_NO_CONNECTION, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.PROJECT_INVALID_CONNECTION, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.PROJECT_INACTIVE_CONNECTION, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_METADATA, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.PERSISTENT_TYPE_DUPLICATE_CLASS, JpaValidationPreferencesManager.WARNING); //3.0 M7
- result.put(JpaValidationMessages.PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE, JpaValidationPreferencesManager.WARNING); //3.0 M7
- result.put(JpaValidationMessages.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED, JpaValidationPreferencesManager.WARNING);
- result.put(JpaValidationMessages.ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM, JpaValidationPreferencesManager.WARNING);
-
- result.put(JpaValidationMessages.XML_VERSION_NOT_LATEST, JpaValidationPreferencesManager.INFO);
- result.put(JpaValidationMessages.PERSISTENCE_UNIT_REDUNDANT_CLASS, JpaValidationPreferencesManager.INFO);
- return result;
- }
-
- @Override
- protected Control createPreferenceContent(Composite parent) {
-
- PixelConverter pixelConverter = new PixelConverter(parent);
-
- // Create a container because the caller will set the GridData and we need
- // to change the heightHint of the first child and we also need to set the
- // font otherwise the layout won't be calculated correctly
- Composite container = new Composite(parent, SWT.NONE);
- container.setFont(parent.getFont());
- GridLayout layout = new GridLayout(1, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
- container.setLayout(layout);
-
- // Create the main composite of this page
- this.scrollable = new ScrolledPageContent(container);
-
- GridData gridData = new GridData(GridData.FILL, GridData.FILL, true, true);
- gridData.heightHint = pixelConverter.convertHeightInCharsToPixels(20);
- this.scrollable.setLayoutData(gridData);
-
- // Update the layout of the ScrolledPageContent's body
- layout = new GridLayout(1, false);
- layout.marginHeight = 0;
- layout.marginWidth = 0;
-
- parent = this.scrollable.getBody();
- parent.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, true));
- parent.setLayout(layout);
-
- // Add each expandable category
- addProjectLevelCategory(parent);
- addPersistenceUnitLevelCategory(parent);
- addTypeLevelCategory(parent);
- addAttributeLevelCategory(parent);
- addDatabaseCategory(parent);
- addInheritanceStrategyCategory(parent);
- addQueriesGeneratorsCategory(parent);
-
- // Restore the expansion states
- restoreSectionExpansionStates(getDialogPreferences());
-
- return container;
- }
-
- protected void restoreSectionExpansionStates(IDialogSettings settings) {
- for (int index = this.expandablePanes.size(); --index >= 0; ) {
- ExpandableComposite expandablePane = this.expandablePanes.get(index);
-
- if (settings == null) {
- // Only expand the first node by default
- expandablePane.setExpanded(index == 0);
- }
- else {
- expandablePane.setExpanded(settings.getBoolean(SETTINGS_EXPANDED + index));
- }
- }
- }
-
- @Override
- public Point computeSize() {
- return this.doComputeSize();
- }
-
- //In each category below, entries are listed alphabetically.
- //If adding a new entry, please add it to the corresponding category at the right place.
-
- private void addProjectLevelCategory(Composite parent) {
-
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.PROJECT_LEVEL_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.NO_JPA_PROJECT, JpaValidationMessages.NO_JPA_PROJECT);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS, JpaValidationMessages.PERSISTENCE_MULTIPLE_PERSISTENCE_UNITS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_NO_PERSISTENCE_UNIT, JpaValidationMessages.PERSISTENCE_NO_PERSISTENCE_UNIT);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_XML_INVALID_CONTENT, JpaValidationMessages.PERSISTENCE_XML_INVALID_CONTENT);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_XML_UNSUPPORTED_CONTENT, JpaValidationMessages.PERSISTENCE_XML_UNSUPPORTED_CONTENT); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PROJECT_MULTIPLE_PERSISTENCE_XML, JpaValidationMessages.PROJECT_MULTIPLE_PERSISTENCE_XML);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PROJECT_INACTIVE_CONNECTION, JpaValidationMessages.PROJECT_INACTIVE_CONNECTION);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PROJECT_INVALID_CONNECTION, JpaValidationMessages.PROJECT_INVALID_CONNECTION);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PROJECT_INVALID_LIBRARY_PROVIDER, JpaValidationMessages.PROJECT_INVALID_LIBRARY_PROVIDER); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PROJECT_NO_CONNECTION, JpaValidationMessages.PROJECT_NO_CONNECTION);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PROJECT_NO_PERSISTENCE_XML, JpaValidationMessages.PROJECT_NO_PERSISTENCE_XML);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.XML_VERSION_NOT_LATEST, JpaValidationMessages.XML_VERSION_NOT_LATEST);
- }
-
- private void addPersistenceUnitLevelCategory(Composite parent) {
-
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_LEVEL_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_METADATA, JpaValidationMessages.MAPPING_FILE_EXTRANEOUS_PERSISTENCE_UNIT_METADATA);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_TYPE_DUPLICATE_CLASS, JpaValidationMessages.PERSISTENT_TYPE_DUPLICATE_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_DUPLICATE_CLASS, JpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_DUPLICATE_JAR_FILE, JpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_JAR_FILE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE, JpaValidationMessages.PERSISTENCE_UNIT_DUPLICATE_MAPPING_FILE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_INVALID_CLASS, JpaValidationMessages.PERSISTENCE_UNIT_INVALID_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_INVALID_MAPPING_FILE, JpaValidationMessages.PERSISTENCE_UNIT_INVALID_MAPPING_FILE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING, JpaValidationMessages.PERSISTENCE_UNIT_JAR_FILE_DEPLOYMENT_PATH_WARNING);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_NONEXISTENT_CLASS, JpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE, JpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_JAR_FILE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE, JpaValidationMessages.PERSISTENCE_UNIT_NONEXISTENT_MAPPING_FILE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_REDUNDANT_CLASS, JpaValidationMessages.PERSISTENCE_UNIT_REDUNDANT_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_UNSPECIFIED_CLASS, JpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE, JpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_JAR_FILE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE, JpaValidationMessages.PERSISTENCE_UNIT_UNSPECIFIED_MAPPING_FILE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT, JpaValidationMessages.PERSISTENCE_UNIT_UNSUPPORTED_MAPPING_FILE_CONTENT);
- }
-
- private void addTypeLevelCategory(Composite parent) {
-
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.TYPE_LEVEL_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_NAME_DUPLICATED, JpaValidationMessages.ENTITY_NAME_DUPLICATED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_NAME_MISSING, JpaValidationMessages.ENTITY_NAME_MISSING); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_NO_PK, JpaValidationMessages.ENTITY_NO_PK);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_NON_ROOT_ID_ATTRIBUTE_SPECIFIED, JpaValidationMessages.ENTITY_NON_ROOT_ID_ATTRIBUTE_SPECIFIED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_NON_ROOT_ID_CLASS_SPECIFIED, JpaValidationMessages.ENTITY_NON_ROOT_ID_CLASS_SPECIFIED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT, JpaValidationMessages.PERSISTENT_TYPE_ANNOTATED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT, JpaValidationMessages.PERSISTENT_TYPE_MAPPED_BUT_NOT_INCLUDED_IN_PERSISTENCE_UNIT);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_TYPE_UNRESOLVED_CLASS, JpaValidationMessages.PERSISTENT_TYPE_UNRESOLVED_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_TYPE_UNSPECIFIED_CLASS, JpaValidationMessages.PERSISTENT_TYPE_UNSPECIFIED_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR, JpaValidationMessages.TYPE_MAPPING_CLASS_MISSING_NO_ARG_CONSTRUCTOR);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_CLASS_PRIVATE_NO_ARG_CONSTRUCTOR, JpaValidationMessages.TYPE_MAPPING_CLASS_PRIVATE_NO_ARG_CONSTRUCTOR);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_FINAL_CLASS, JpaValidationMessages.TYPE_MAPPING_FINAL_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_AND_EMBEDDED_ID_BOTH_USED, JpaValidationMessages.TYPE_MAPPING_ID_AND_EMBEDDED_ID_BOTH_USED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_AND_EMBEDDED_ID_BOTH_USED, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_AND_EMBEDDED_ID_BOTH_USED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_DOES_NOT_EXIST, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_DOES_NOT_EXIST); //3.2
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_DUPLICATE_MATCH, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_DUPLICATE_MATCH); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_NO_MATCH, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_MAPPING_NO_MATCH); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NO_MATCH, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NO_MATCH); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NOT_PRIMARY_KEY, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_NOT_PRIMARY_KEY); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_TYPE_DOES_NOT_AGREE, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_ATTRIBUTE_TYPE_DOES_NOT_AGREE); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_MISSING_EQUALS_METHOD, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_MISSING_EQUALS_METHOD); //3.2
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_MISSING_HASHCODE_METHOD, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_MISSING_HASHCODE_METHOD); //3.2
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_MISSING_NO_ARG_CONSTRUCTOR, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_MISSING_NO_ARG_CONSTRUCTOR); //3.2
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_MISSING_PUBLIC_NO_ARG_CONSTRUCTOR, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_MISSING_PUBLIC_NO_ARG_CONSTRUCTOR); //3.2
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_NAME_EMPTY, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_NAME_EMPTY); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_NOT_EXIST, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_NOT_EXIST); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_NOT_IMPLEMENT_SERIALIZABLE, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_NOT_IMPLEMENT_SERIALIZABLE); //3.2
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_NOT_PUBLIC, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_NOT_PUBLIC); //3.2
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_PROPERTY_METHOD_NOT_PUBLIC, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_PROPERTY_METHOD_NOT_PUBLIC); //3.2
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_REDEFINED, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_REDEFINED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_REQUIRED, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_REQUIRED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_ID_CLASS_WITH_MAPS_ID, JpaValidationMessages.TYPE_MAPPING_ID_CLASS_WITH_MAPS_ID); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_MAPS_ID_ATTRIBUTE_TYPE_DOES_NOT_AGREE, JpaValidationMessages.TYPE_MAPPING_MAPS_ID_ATTRIBUTE_TYPE_DOES_NOT_AGREE); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_MEMBER_CLASS, JpaValidationMessages.TYPE_MAPPING_MEMBER_CLASS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_MULTIPLE_EMBEDDED_ID, JpaValidationMessages.TYPE_MAPPING_MULTIPLE_EMBEDDED_ID); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_PK_REDEFINED_ID_ATTRIBUTE, JpaValidationMessages.TYPE_MAPPING_PK_REDEFINED_ID_ATTRIBUTE); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TYPE_MAPPING_PK_REDEFINED_ID_CLASS, JpaValidationMessages.TYPE_MAPPING_PK_REDEFINED_ID_CLASS); //3.0 M7
- }
-
- private void addAttributeLevelCategory(Composite parent) {
-
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.ATTRIBUTE_LEVEL_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE, JpaValidationMessages.ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST, JpaValidationMessages.ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED, JpaValidationMessages.ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING, JpaValidationMessages.ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING, JpaValidationMessages.ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC, JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE, JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR, JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE, JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS, JpaValidationMessages.EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED, JpaValidationMessages.EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED, JpaValidationMessages.ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_COLUMN_SPECIFIED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAPS_ID_VALUE_INVALID, JpaValidationMessages.MAPS_ID_VALUE_INVALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAPS_ID_VALUE_NOT_RESOLVED, JpaValidationMessages.MAPS_ID_VALUE_NOT_RESOLVED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAPS_ID_VALUE_NOT_SPECIFIED, JpaValidationMessages.MAPS_ID_VALUE_NOT_SPECIFIED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAPPING_INVALID_MAPPED_BY, JpaValidationMessages.MAPPING_INVALID_MAPPED_BY);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES, JpaValidationMessages.MAPPING_MAPPED_BY_ON_BOTH_SIDES);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAPPING_UNRESOLVED_MAPPED_BY, JpaValidationMessages.MAPPING_UNRESOLVED_MAPPED_BY);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED, JpaValidationMessages.ORDER_COLUMN_AND_ORDER_BY_BOTH_SPECIFIED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE, JpaValidationMessages.PERSISTENT_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD, JpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_FIELD);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_FINAL_GETTER, JpaValidationMessages.PERSISTENT_ATTRIBUTE_FINAL_GETTER);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED, JpaValidationMessages.PERSISTENT_ATTRIBUTE_INHERITED_ATTRIBUTES_NOT_SUPPORTED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_INVALID_MAPPING, JpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_MAPPING);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE, JpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE, JpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE, JpaValidationMessages.PERSISTENT_ATTRIBUTE_INVALID_VERSION_MAPPING_TYPE); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD, JpaValidationMessages.PERSISTENT_ATTRIBUTE_PUBLIC_FIELD);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME, JpaValidationMessages.PERSISTENT_ATTRIBUTE_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME, JpaValidationMessages.PERSISTENT_ATTRIBUTE_UNSPECIFIED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TARGET_ENTITY_IS_NOT_AN_ENTITY, JpaValidationMessages.TARGET_ENTITY_IS_NOT_AN_ENTITY);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TARGET_ENTITY_NOT_DEFINED, JpaValidationMessages.TARGET_ENTITY_NOT_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TARGET_ENTITY_NOT_EXIST, JpaValidationMessages.TARGET_ENTITY_NOT_EXIST);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TARGET_NOT_AN_EMBEDDABLE, JpaValidationMessages.TARGET_NOT_AN_EMBEDDABLE); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_CLASS_NOT_DEFINED, JpaValidationMessages.MAP_KEY_CLASS_NOT_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_CLASS_NOT_EXIST, JpaValidationMessages.MAP_KEY_CLASS_NOT_EXIST);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, JpaValidationMessages.MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, JpaValidationMessages.ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE);
-
- parent = addSubExpandableSection(parent, JptUiValidationPreferenceMessages.IMPLIED_ATTRIBUTE_LEVEL_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_DOES_NOT_EXIST);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_MUST_BE_EMBEDDABLE_OR_BASIC_TYPE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_TARGET_CLASS_NOT_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_ELEMENT_COLLECTION_MAPPING);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_CONTAINS_EMBEDDABLE_WITH_PROHIBITED_RELATIONSHIP_MAPPING);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC, JpaValidationMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_BE_PUBLIC);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_EQUALS_HASHCODE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR, JpaValidationMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_NO_ARG_CONSTRUCTOR);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_IMPLEMENT_SERIALIZABLE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_CLASS_SHOULD_NOT_CONTAIN_RELATIONSHIP_MAPPINGS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED, JpaValidationMessages.VIRTUAL_ATTRIBUTE_EMBEDDED_ID_MAPPING_MAPPED_BY_RELATIONSHIP_AND_ATTRIBUTE_OVERRIDES_SPECIFIED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY, JpaValidationMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_IS_NOT_AN_ENTITY);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED, JpaValidationMessages.VIRTUAL_ATTRIBUTE_TARGET_ENTITY_NOT_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_TARGET_NOT_AN_EMBEDDABLE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_NOT_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_CLASS_MUST_BE_ENTITY_EMBEDDABLE_OR_BASIC_TYPE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAP_KEY_TYPE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ELEMENT_COLLECTION_INVALID_VALUE_TYPE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVALID_TEMPORAL_MAPPING_TYPE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_TYPE_IS_NOT_SUPPORTED_COLLECTION_TYPE);
- }
-
- private void addDatabaseCategory(Composite parent) {
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.DATABASE_CATEGORY);
- parent.setLayout(new GridLayout(1, false));
-
- addTableCategory(parent);
- addColumnCategory(parent);
- addOverridesCategory(parent);
- }
-
- private void addTableCategory(Composite parent) {
-
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.TABLE_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.COLLECTION_TABLE_UNRESOLVED_CATALOG, JpaValidationMessages.COLLECTION_TABLE_UNRESOLVED_CATALOG);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.COLLECTION_TABLE_UNRESOLVED_NAME, JpaValidationMessages.COLLECTION_TABLE_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.COLLECTION_TABLE_UNRESOLVED_SCHEMA, JpaValidationMessages.COLLECTION_TABLE_UNRESOLVED_SCHEMA);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.JOIN_TABLE_UNRESOLVED_CATALOG, JpaValidationMessages.JOIN_TABLE_UNRESOLVED_CATALOG);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.JOIN_TABLE_UNRESOLVED_NAME, JpaValidationMessages.JOIN_TABLE_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.JOIN_TABLE_UNRESOLVED_SCHEMA, JpaValidationMessages.JOIN_TABLE_UNRESOLVED_SCHEMA);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.SECONDARY_TABLE_UNRESOLVED_CATALOG, JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_CATALOG);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.SECONDARY_TABLE_UNRESOLVED_NAME, JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.SECONDARY_TABLE_UNRESOLVED_SCHEMA, JpaValidationMessages.SECONDARY_TABLE_UNRESOLVED_SCHEMA);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TABLE_UNRESOLVED_CATALOG, JpaValidationMessages.TABLE_UNRESOLVED_CATALOG);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TABLE_UNRESOLVED_NAME, JpaValidationMessages.TABLE_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.TABLE_UNRESOLVED_SCHEMA, JpaValidationMessages.TABLE_UNRESOLVED_SCHEMA);
-
- parent = addSubExpandableSection(parent, JptUiValidationPreferenceMessages.IMPLIED_ATTRIBUTE_LEVEL_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG, JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_CATALOG);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA, JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLLECTION_TABLE_UNRESOLVED_SCHEMA);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG, JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_CATALOG);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA, JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_TABLE_UNRESOLVED_SCHEMA);
- }
-
- private void addColumnCategory(Composite parent) {
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.COLUMN_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.COLUMN_TABLE_NOT_VALID, JpaValidationMessages.COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.COLUMN_UNRESOLVED_NAME, JpaValidationMessages.COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.COLUMN_UNRESOLVED_TABLE, JpaValidationMessages.COLUMN_UNRESOLVED_TABLE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.INVERSE_JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.INVERSE_JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.INVERSE_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.INVERSE_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.MAP_KEY_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.MAP_KEY_COLUMN_UNRESOLVED_NAME); // 3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ORDER_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.ORDER_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
-
- parent = addSubExpandableSection(parent, JptUiValidationPreferenceMessages.IMPLIED_ATTRIBUTE_LEVEL_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_COLUMN_UNRESOLVED_NAME); // 3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ORDER_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.VIRTUAL_SECONDARY_TABLE_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.VIRTUAL_PRIMARY_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_MAP_KEY_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- }
-
- private void addOverridesCategory(Composite parent) {
-
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.OVERRIDES_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ASSOCIATION_OVERRIDE_INVALID_NAME, JpaValidationMessages.ASSOCIATION_OVERRIDE_INVALID_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.ATTRIBUTE_OVERRIDE_INVALID_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ATTRIBUTE_OVERRIDE_INVALID_TYPE, JpaValidationMessages.ATTRIBUTE_OVERRIDE_INVALID_TYPE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ATTRIBUTE_OVERRIDE_MAPPED_BY_RELATIONSHIP_AND_SPECIFIED, JpaValidationMessages.ATTRIBUTE_OVERRIDE_DERIVED_AND_SPECIFIED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVALID_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS,JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_REFERENCED_COLUMN_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_CATALOG, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_CATALOG);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_SCHEMA, JpaValidationMessages.VIRTUAL_ASSOCIATION_OVERRIDE_JOIN_TABLE_UNRESOLVED_SCHEMA);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_OVERRIDE_INVALID_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME);
-
-
- parent = addSubExpandableSection(parent, JptUiValidationPreferenceMessages.IMPLIED_ATTRIBUTE_LEVEL_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVALID_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_INVERSE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_INVERSE_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_NAME_MUST_BE_SPECIFIED_MULTIPLE_JOIN_COLUMNS);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_REFERENCED_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ASSOCIATION_OVERRIDE_JOIN_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_ATTRIBUTE_OVERRIDE_INVALID_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_TABLE_NOT_VALID);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_INVALID_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_ATTRIBUTE_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.VIRTUAL_MAP_KEY_ATTRIBUTE_OVERRIDE_COLUMN_UNRESOLVED_NAME); //3.0 M7
- }
-
- private void addInheritanceStrategyCategory(Composite parent) {
-
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.INHERITANCE_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.DISCRIMINATOR_COLUMN_UNRESOLVED_NAME, JpaValidationMessages.DISCRIMINATOR_COLUMN_UNRESOLVED_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED, JpaValidationMessages.ENTITY_ABSTRACT_DISCRIMINATOR_VALUE_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE, JpaValidationMessages.ENTITY_ABSTRACT_TABLE_PER_CLASS_DEFINES_TABLE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED, JpaValidationMessages.ENTITY_NON_ROOT_DISCRIMINATOR_COLUMN_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE, JpaValidationMessages.ENTITY_SINGLE_TABLE_DESCENDANT_DEFINES_TABLE);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED, JpaValidationMessages.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_COLUMN_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED, JpaValidationMessages.ENTITY_TABLE_PER_CLASS_DISCRIMINATOR_VALUE_DEFINED);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM, JpaValidationMessages.ENTITY_TABLE_PER_CLASS_NOT_PORTABLE_ON_PLATFORM);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM, JpaValidationMessages.ENTITY_TABLE_PER_CLASS_NOT_SUPPORTED_ON_PLATFORM);
- }
-
- private void addQueriesGeneratorsCategory(Composite parent) {
-
- parent = addExpandableSection(parent, JptUiValidationPreferenceMessages.QUERIES_GENERATORS_CATEGORY);
-
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.GENERATOR_DUPLICATE_NAME, JpaValidationMessages.GENERATOR_DUPLICATE_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.GENERATOR_NAME_UNDEFINED, JpaValidationMessages.GENERATOR_NAME_UNDEFINED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.ID_MAPPING_UNRESOLVED_GENERATOR_NAME, JpaValidationMessages.ID_MAPPING_UNRESOLVED_GENERATOR_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.JPQL_QUERY_VALIDATION, JpaValidationMessages.JPQL_QUERY_VALIDATION);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.QUERY_DUPLICATE_NAME, JpaValidationMessages.QUERY_DUPLICATE_NAME);
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.QUERY_NAME_UNDEFINED, JpaValidationMessages.QUERY_NAME_UNDEFINED); //3.0 M7
- addLabeledCombo(parent, JptUiValidationPreferenceMessages.QUERY_STATEMENT_UNDEFINED, JpaValidationMessages.QUERY_STATEMENT_UNDEFINED); //3.0 M7
- }
-
- private Composite addExpandableSection(Composite parent, String text) {
- return addExpandableSection(parent, text, new GridData(GridData.FILL, GridData.FILL, true, false));
- }
-
- private Composite addSubExpandableSection(Composite parent, String text) {
- return addExpandableSection(parent, text, new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
- }
-
- /**
- * Creates and adds to the given <code>Composite</code> an expandable pane
- * where its content can be shown or hidden depending on the expansion state.
- *
- * @param parent The parent container
- * @param text The title of the expandable section
- * @return The container to which widgets can be added, which is a child of
- * the expandable pane
- */
- private Composite addExpandableSection(Composite parent, String text, GridData gridData) {
- ExpandableComposite expandablePane = new ExpandableComposite(
- parent,
- SWT.NONE,
- ExpandableComposite.TWISTIE | ExpandableComposite.CLIENT_INDENT
- );
-
- expandablePane.setText(text);
- expandablePane.setExpanded(false);
- expandablePane.setFont(JFaceResources.getFontRegistry().getBold(JFaceResources.DIALOG_FONT));
- expandablePane.setLayoutData(gridData);
- expandablePane.addExpansionListener(buildExpansionListener());
-
- this.scrollable.adaptChild(expandablePane);
- this.expandablePanes.add(expandablePane);
-
- parent = new Composite(expandablePane, SWT.NONE);
- parent.setLayout(new GridLayout(2, false));
- expandablePane.setClient(parent);
-
- return parent;
- }
-
- /**
- * Creates and adds to the given parent a labeled combo where the possible
- * choices are "Ignore", "Error" and "Warning".
- *
- * @param parent The parent to which the widgets are added
- * @param labelText The text labelling the combo
- * @param preferenceKey The key used to retrieve and to store the value
- * associated with the validation problem
- */
- private void addLabeledCombo(Composite parent, String labelText, String preferenceKey) {
- Label label = new Label(parent, SWT.NONE);
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- label.setText(labelText);
-
- Combo combo = new Combo(parent, SWT.READ_ONLY);
- combo.setItems(this.severityDisplayStrings);
- combo.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
- combo.setData(PREFERENCE_KEY, preferenceKey);
- combo.select(convertPreferenceKeyToComboIndex(preferenceKey));
- combo.addSelectionListener(buildComboSelectionListener());
-
- this.scrollable.adaptChild(combo);
- this.combos.add(combo);
- }
-
- private SelectionListener buildComboSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- Combo combo = (Combo) e.widget;
- String preferenceKey = (String) combo.getData(PREFERENCE_KEY);
- String value = convertToPreferenceValue(combo.getSelectionIndex());
- JpaProblemSeveritiesPage.this.severityLevels.put(preferenceKey, value);
- }
- };
- }
-
- private ExpansionAdapter buildExpansionListener() {
- return new ExpansionAdapter() {
- @Override
- public void expansionStateChanged(ExpansionEvent e) {
- JpaProblemSeveritiesPage.this.expansionStateChanged();
- }
- };
- }
-
- protected String[] buildSeverityDisplayStrings() {
- String[] severities = new String[4];
- severities[ERROR_INDEX] = JptUiMessages.JpaProblemSeveritiesPage_Error;
- severities[WARNING_INDEX] = JptUiMessages.JpaProblemSeveritiesPage_Warning;
- severities[INFO_INDEX] = JptUiMessages.JpaProblemSeveritiesPage_Info;
- severities[IGNORE_INDEX] = JptUiMessages.JpaProblemSeveritiesPage_Ignore;
- return severities;
- }
-
- protected int convertPreferenceKeyToComboIndex(String preferenceKey) {
- return convertPreferenceValueToComboIndex(getPreferenceValue(preferenceKey));
- }
-
- protected String getPreferenceValue(String preferenceKey) {
- String preference = null;
- if (this.isProjectPreferencePage() && this.hasProjectSpecificOptions(this.getProject())) { //useProjectSettings() won't work since the page is being built
- preference = this.preferencesManager.getProjectLevelProblemPreference(preferenceKey);
- }
- else {
- //don't get the workspace preference when the project has overridden workspace preferences
- preference = JpaValidationPreferencesManager.getWorkspaceLevelProblemPreference(preferenceKey);
- }
- if (preference == null) {
- preference = getDefaultPreferenceValue(preferenceKey);
- }
- return preference;
- }
-
- /**
- * Return the default severity or ERROR if no default exists.
- */
- protected String getDefaultPreferenceValue(String preferenceKey) {
- String preference = this.defaultSeverities.get(preferenceKey);
- return preference == null ? JpaValidationPreferencesManager.ERROR : preference;
- }
-
- protected int convertPreferenceValueToComboIndex(String preferenceValue) {
- if (JpaValidationPreferencesManager.ERROR.equals(preferenceValue)) {
- return ERROR_INDEX;
- }
- if (JpaValidationPreferencesManager.WARNING.equals(preferenceValue)) {
- return WARNING_INDEX;
- }
- if (JpaValidationPreferencesManager.INFO.equals(preferenceValue)) {
- return INFO_INDEX;
- }
- if (JpaValidationPreferencesManager.IGNORE.equals(preferenceValue)) {
- return IGNORE_INDEX;
- }
- throw new IllegalStateException();
- }
-
- protected String convertToPreferenceValue(int selectionIndex) {
- switch (selectionIndex) {
- case ERROR_INDEX: return JpaValidationPreferencesManager.ERROR;
- case WARNING_INDEX: return JpaValidationPreferencesManager.WARNING;
- case INFO_INDEX: return JpaValidationPreferencesManager.INFO;
- case IGNORE_INDEX: return JpaValidationPreferencesManager.IGNORE;
- default: return null;
- }
- }
-
- /**
- * Revalidates the layout in order to show or hide the vertical scroll bar
- * after a section was either expanded or collapsed. This unfortunately does
- * not happen automatically.
- */
- protected void expansionStateChanged() {
- this.scrollable.reflow(true);
- }
-
- @Override
- protected String getPreferencePageID() {
- return JPT_PREFERENCES_PROBLEM_SEVERITIES_ID;
- }
-
- @Override
- protected String getPropertyPageID() {
- return JPT_PROPERTY_PAGES_PROBLEM_SEVERITIES_ID;
- }
-
- @Override
- protected boolean hasProjectSpecificOptions(IProject project) {
- return this.preferencesManager.projectHasSpecificOptions();
- }
-
- @Override
- protected void performDefaults() {
- super.performDefaults();
- //this call would be redundant on project preference page - bug in the JDT superclass
- if (!isProjectPreferencePage()) {
- revertToDefault();
- }
- }
-
- @Override
- protected void enableProjectSpecificSettings(boolean useProjectSpecificSettings) {
- super.enableProjectSpecificSettings(useProjectSpecificSettings);
- if (getDefaultsButton() == null) {
- //@Hack("If the defaults button is null the control is currently being built," +
- // "otherwise the 'enable project specific settings' checkbox is being pressed")
- return;
- }
-
- this.hasProjectSpecificPreferences = Boolean.valueOf(useProjectSpecificSettings);
-
- //set all specified workspace preferences in the project preferences
- if (useProjectSpecificSettings){
- this.overrideWorkspacePreferences();
- }
- else {//remove any project specific settings if set to false
- this.revertToDefault();
- }
- }
-
- @Override
- protected void noDefaultAndApplyButton() {
- throw new IllegalStateException("Don't call this, see enableProjectSpecificSettings for the hack that looks for the defaultsButton being null"); //$NON-NLS-1$
- }
-
- protected void revertToDefault() {
- for (Combo combo : this.combos) {
- String preferenceKey = (String) combo.getData(PREFERENCE_KEY);
- combo.select(convertPreferenceValueToComboIndex(getDefaultPreferenceValue(preferenceKey)));
- //UI will show the defaults from the workspace, but set all preferences
- //to null so they will be deleted from project preferences
- this.severityLevels.put(preferenceKey, null);
- }
- }
-
- protected void overrideWorkspacePreferences() {
- for (Combo combo : this.combos) {
- String preferenceKey = (String) combo.getData(PREFERENCE_KEY);
- String workspacePreference = JpaValidationPreferencesManager.getWorkspaceLevelProblemPreference(preferenceKey);
- String defaultPreference = getDefaultPreferenceValue(preferenceKey);
- if (workspacePreference != null && !workspacePreference.equals(defaultPreference)) {
- combo.select(convertPreferenceValueToComboIndex(workspacePreference));
- //silly combo doesn't fire a selection event, so we can't expect our listener to set this
- this.severityLevels.put(preferenceKey, workspacePreference);
- }
- else {
- combo.select(convertPreferenceValueToComboIndex(defaultPreference));
- }
- }
- }
-
- // ********** OK/Revert/Apply behavior **********
-
- @Override
- public boolean performOk() {
- super.performOk();
- if (this.hasProjectSpecificPreferences != null) {
- this.preferencesManager.setProjectHasSpecificOptions(this.hasProjectSpecificPreferences.booleanValue());
- }
- for (String validationPreferenceKey : this.severityLevels.keySet()) {
- this.updatePreference(validationPreferenceKey, this.severityLevels.get(validationPreferenceKey));
- }
- try {
- // true=fork; false=uncancellable
- this.buildOkProgressMonitorDialog().run(true, false, this.buildOkRunnableWithProgress());
- }
- catch (InterruptedException ex) {
- // should *not* happen...
- Thread.currentThread().interrupt();
- return false;
- }
- catch (InvocationTargetException ex) {
- throw new RuntimeException(ex.getTargetException());
- }
-
- return true;
- }
-
- protected void updatePreference(String preferenceKey, String value) {
- if (this.isProjectPreferencePage()) {
- this.preferencesManager.setProjectLevelProblemPreference(preferenceKey, value);
- }
- else {
- JpaValidationPreferencesManager.setWorkspaceLevelProblemPreference(preferenceKey, value);
- }
- }
-
- private IRunnableContext buildOkProgressMonitorDialog() {
- return new ProgressMonitorDialog(this.getShell());
- }
-
- private IRunnableWithProgress buildOkRunnableWithProgress() {
- return new IRunnableWithProgress() {
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- try {
- // the build we execute in #performOk_() locks the workspace root,
- // so we need to use the workspace root as our scheduling rule here
- ws.run(
- JpaProblemSeveritiesPage.this.buildOkWorkspaceRunnable(),
- ws.getRoot(),
- IWorkspace.AVOID_UPDATE,
- monitor
- );
- }
- catch (CoreException ex) {
- throw new InvocationTargetException(ex);
- }
- }
- };
- }
-
- IWorkspaceRunnable buildOkWorkspaceRunnable() {
- return new IWorkspaceRunnable() {
- public void run(IProgressMonitor monitor) throws CoreException {
- JpaProblemSeveritiesPage.this.performOk_(monitor);
- }
- };
- }
-
- void performOk_(IProgressMonitor monitor) throws CoreException {
- //if project is null this is a workspace preference page
- if (this.getProject()==null) {
- JavaPlugin.getWorkspace().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- }
- else this.getProject().build(IncrementalProjectBuilder.FULL_BUILD, monitor);
- }
-
- @Override
- public void dispose() {
- storeSectionExpansionStates(getDialogPreferences());
- super.dispose();
- }
-
- protected IDialogSettings getDialogPreferences() {
- IDialogSettings rootSettings = JptJpaUiPlugin.instance().getDialogSettings();
- IDialogSettings settings = rootSettings.getSection(SETTINGS_SECTION_NAME);
- if (settings == null) {
- settings = rootSettings.addNewSection(SETTINGS_SECTION_NAME);
- }
- return settings;
- }
-
- protected void storeSectionExpansionStates(IDialogSettings settings) {
- for (int index = this.expandablePanes.size(); --index >= 0; ) {
- ExpandableComposite expandablePane = this.expandablePanes.get(index);
- settings.put(SETTINGS_EXPANDED + index, expandablePane.isExpanded());
- }
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JptPreferencesPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JptPreferencesPage.java
deleted file mode 100644
index 98bcd62638..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/prefs/JptPreferencesPage.java
+++ /dev/null
@@ -1,81 +0,0 @@
-package org.eclipse.jpt.jpa.ui.internal.prefs;
-
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.preference.PreferencePage;
-import org.eclipse.jpt.common.ui.internal.dialogs.OptionalMessageDialog;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPreferencePage;
-
-/**
- * This is the root of the Java Persistence preferences hierarchy in the IDE
- * preferences dialog.
- * <p>
- * Structure:
- * <p>
- * Java Persistence<br>
- *
- * @version 2.2
- * @since 2.2
- */
-public class JptPreferencesPage extends PreferencePage implements IWorkbenchPreferencePage {
-
- @Override
- protected Control createContents(Composite parent) {
-
- Composite container= new Composite(parent, SWT.NONE);
- GridLayout layout= new GridLayout();
- layout.marginHeight= convertVerticalDLUsToPixels(IDialogConstants.VERTICAL_MARGIN);
- layout.marginWidth= 0;
- layout.verticalSpacing= convertVerticalDLUsToPixels(10);
- layout.horizontalSpacing= convertHorizontalDLUsToPixels(IDialogConstants.HORIZONTAL_SPACING);
- container.setLayout(layout);
-
- layout = new GridLayout();
- layout.numColumns= 2;
-
- Group dontAskGroup = new Group(container, SWT.NONE);
- dontAskGroup.setLayout(layout);
- dontAskGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- dontAskGroup.setText(JptUiMessages.JptPreferencesPage_DoNotShowDialogs);
-
- Label label = new Label(dontAskGroup, SWT.WRAP);
- label.setText(JptUiMessages.JptPreferencesPage_DoNotShowText);
- GridData data= new GridData(GridData.FILL, GridData.CENTER, true, false);
- data.widthHint= convertVerticalDLUsToPixels(50);
- label.setLayoutData(data);
-
- Button button = new Button(dontAskGroup, SWT.PUSH);
- button.setText(JptUiMessages.JptPreferencesPage_ClearButtonText);
- button.setLayoutData(new GridData(GridData.FILL, GridData.BEGINNING, false, false));
- button.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- unhideAllDialogs();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- unhideAllDialogs();
- }
- });
-
- return container;
- }
-
- public void init(IWorkbench workbench) {
- setPreferenceStore(JptJpaUiPlugin.instance().getPreferenceStore());
- }
-
- private final void unhideAllDialogs() {
- OptionalMessageDialog.clearAllRememberedStates();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/properties/DataModelPropertyPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/properties/DataModelPropertyPage.java
deleted file mode 100644
index 0786ddb62a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/properties/DataModelPropertyPage.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.properties;
-
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Listener;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PropertyPage;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
-import org.eclipse.wst.common.frameworks.internal.ui.ValidationStatus;
-
-public abstract class DataModelPropertyPage
- extends PropertyPage
- implements Listener, IDataModelListener
-{
- protected IDataModel model;
-
- private ValidationStatus status = new ValidationStatus();
- private Map validationMap;
- private String[] validationPropertyNames;
- private boolean isValidating = false;
-
- protected DataModelSynchHelper synchHelper;
-
- private String infopopID;
-
-
- protected DataModelPropertyPage(IDataModel model) {
- super();
- this.model = model;
- model.addListener(this);
- synchHelper = initializeSynchHelper(model);
- }
-
-
- /**
- * @return
- */
- public DataModelSynchHelper initializeSynchHelper(IDataModel dm) {
- return new DataModelSynchHelper(dm);
- }
-
-
- @Override
- protected Control createContents(Composite parent) {
- Composite top = createTopLevelComposite(parent);
- setupInfopop(top);
- setDefaults();
- addListeners();
- initializeValidationProperties();
- return top;
- }
-
- private void initializeValidationProperties() {
- validationPropertyNames = getValidationPropertyNames();
- if (validationPropertyNames == null || validationPropertyNames.length == 0)
- validationMap = Collections.EMPTY_MAP;
- else {
- validationMap = new HashMap(validationPropertyNames.length);
- for (int i = 0; i < validationPropertyNames.length; i++)
- validationMap.put(validationPropertyNames[i], new Integer(i));
- }
- }
-
- /**
- * Subclass should return the model property names that need to be validated on this page in the
- * order that they should present their messages.
- *
- * @return
- */
- protected abstract String[] getValidationPropertyNames();
-
- /**
- * Return the top level Composite for this page.
- */
- protected abstract Composite createTopLevelComposite(Composite parent);
-
- /**
- * Set up info pop hooks if set.
- */
- protected void setupInfopop(Control parent) {
- if (getInfopopID() != null)
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, getInfopopID());
- }
-
- /**
- * Setup the default values for this page. Subclasses should override to provide appropriate
- * defaults.
- */
- protected void setDefaults() {
- restoreDefaultSettings();
- }
-
- /**
- * Subclasses should implement this method if they have default settings that have been stored
- * and need to be restored.
- *
- * @see storeDefaultSettings()
- */
- protected void restoreDefaultSettings() {
- }
-
- /**
- * Add Listeners to controls at this point to avoid unnecessary events. Subclasses should
- * override to add listeners to its controls.
- */
- protected void addListeners() {
- }
-
- /**
- * Exiting the page. Subclasses may extend.
- */
- protected void exit() {
- }
-
- protected boolean getStatus(Integer key) {
- return status.hasError(key);
- }
-
- /**
- * Sent when an event that the receiver has registered for occurs. If a subclass overrides this
- * method, it must call super.
- *
- * @param event
- * the event which occurred
- */
- public void handleEvent(org.eclipse.swt.widgets.Event event) {
- }
-
- /**
- * Set the error message for this page based on the last error in the ValidationStatus.
- */
- protected void setErrorMessage() {
- String error = status.getLastErrMsg();
- if (error == null) {
- if (getErrorMessage() != null)
- setErrorMessage((String) null);
- String warning = status.getLastWarningMsg();
- if (warning == null) {
- if (getMessage() != null && getMessageType() == IMessageProvider.WARNING)
- setMessage(null, IMessageProvider.WARNING);
- else {
- String info = status.getLastInfoMsg();
- if (info == null) {
- if (getMessage() != null && getMessageType() == IMessageProvider.INFORMATION)
- setMessage(null, IMessageProvider.INFORMATION);
- } else if (!info.equals(getMessage())) {
- setMessage(info, IMessageProvider.INFORMATION);
- }
- }
- } else if (!warning.equals(getMessage()))
- setMessage(warning, IMessageProvider.WARNING);
- } else if (!error.equals(getErrorMessage()))
- setErrorMessage(error);
- }
-
- protected void setErrorStatus(Integer key, String errorMessage) {
- status.setErrorStatus(key, errorMessage);
- }
-
- protected void setWarningStatus(Integer key, String warningMessage) {
- status.setWarningStatus(key, warningMessage);
- }
-
- protected void setInfoStatus(Integer key, String infoMessage) {
- status.setInfoStatus(key, infoMessage);
- }
-
- protected void setOKStatus(Integer key) {
- status.setOKStatus(key);
- }
-
- /**
- * This should be called by the Wizard just prior to running the performFinish operation.
- * Subclasses should override to store their default settings.
- */
- public void storeDefaultSettings() {
- }
-
- /**
- * The page is now being validated. At this time, each control is validated and then the
- * controls are updated based on the results in the ValidationStatus which was updated during
- * <code>validateControls()</code>. Finally, it will display the last error message and it
- * will set the page complete. Subclasses will not typically override this method.
- */
- protected void validatePage() {
- if (!isValidating) {
- isValidating = true;
- try {
- validateControlsBase();
- updateControls();
- setErrorMessage();
- setValid(status.getLastErrMsg() == null);
- }
- finally {
- isValidating = false;
- }
- }
- }
-
- /**
- * Validate individual controls. Use validation keys to keep track of errors.
- *
- * @see setOKStatus(Integer) and setErrorMessage(Integer, String)
- */
- protected final String validateControlsBase() {
- if (!validationMap.isEmpty()) {
- String propName;
- for (int i = 0; i < validationPropertyNames.length; i++) {
- propName = validationPropertyNames[i];
- Integer valKey = (Integer) validationMap.get(propName);
- if (valKey != null)
- validateProperty(propName, valKey);
- if (!getStatus(valKey))
- return propName;
- }
- }
- return null;
- }
-
- /**
- * @param propertyName
- * @param validationkey
- */
- private void validateProperty(String propertyName, Integer validationKey) {
- setOKStatus(validationKey);
- IStatus status1 = model.validateProperty(propertyName);
- if (!status1.isOK()) {
- String message = status1.isMultiStatus() ? status1.getChildren()[0].getMessage() : status1.getMessage();
- switch (status1.getSeverity()) {
- case IStatus.ERROR :
- setErrorStatus(validationKey, message);
- break;
- case IStatus.WARNING :
- setWarningStatus(validationKey, message);
- break;
- case IStatus.INFO :
- setInfoStatus(validationKey, message);
- break;
- }
- }
- }
-
- /**
- * Update the enablement of controls after validation. Sublcasses should check the status of
- * validation keys to determine enablement.
- */
- protected void updateControls() {
- }
-
-
- /*
- * If a property changes that we want to validate, force validation on this page.
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModelListener#propertyChanged(java.lang.String,
- * java.lang.Object, java.lang.Object)
- */
- public void propertyChanged(DataModelEvent event) {
- String propertyName = event.getPropertyName();
- if (validationPropertyNames != null && (event.getFlag() == DataModelEvent.VALUE_CHG || (!isValid() && event.getFlag() == DataModelEvent.VALID_VALUES_CHG))) {
- for (int i = 0; i < validationPropertyNames.length; i++) {
- if (validationPropertyNames[i].equals(propertyName)) {
- validatePage();
- break;
- }
- }
- }
- }
-
- /**
- * @return Returns the model.
- */
- protected IDataModel getDataModel() {
- return model;
- }
-
- public void dispose() {
- super.dispose();
- if (synchHelper != null) {
- synchHelper.dispose();
- synchHelper = null;
- }
- }
-
- protected String getInfopopID() {
- return infopopID;
- }
-
- public void setInfopopID(String infopopID) {
- this.infopopID = infopopID;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/properties/JpaProjectPropertiesPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/properties/JpaProjectPropertiesPage.java
deleted file mode 100644
index a45803935d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/properties/JpaProjectPropertiesPage.java
+++ /dev/null
@@ -1,1726 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.properties;
-
-import static org.eclipse.jst.common.project.facet.ui.libprov.LibraryProviderFrameworkUi.createInstallLibraryPanel;
-import java.util.ArrayList;
-import java.util.Comparator;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-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.IJavaProject;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.internal.utility.ICUStringCollator;
-import org.eclipse.jpt.common.ui.internal.listeners.SWTPropertyChangeListenerWrapper;
-import org.eclipse.jpt.common.ui.internal.properties.JptProjectPropertiesPage;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.FilterAdapter;
-import org.eclipse.jpt.common.utility.internal.NotBooleanTransformer;
-import org.eclipse.jpt.common.utility.internal.StringConverter;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.AbstractTransformer;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.AbstractCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.BufferedWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.DoublePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ExtendedListValueModelWrapper;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SetCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SortedListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.StaticCollectionValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationWritablePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.Model;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaDataSource;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.JptCoreMessages;
-import org.eclipse.jpt.jpa.core.jpa2.JpaProject2_0;
-import org.eclipse.jpt.jpa.core.libprov.JpaLibraryProviderInstallOperationConfig;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformGroupDescription;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.ConnectionAdapter;
-import org.eclipse.jpt.jpa.db.ConnectionListener;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.ConnectionProfileFactory;
-import org.eclipse.jpt.jpa.db.ConnectionProfileListener;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.JptJpaDbPlugin;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.db.ui.internal.DTPUiTools;
-import org.eclipse.jpt.jpa.ui.JpaProjectModel;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.jpa2.Jpa2_0FlagTransformer;
-import org.eclipse.jst.common.project.facet.core.libprov.ILibraryProvider;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryProviderOperationConfig;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.preferences.IWorkbenchPreferenceContainer;
-import org.eclipse.wst.common.project.facet.core.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-
-/**
- * Way more complicated UI than you would think....
- */
-public class JpaProjectPropertiesPage
- extends JptProjectPropertiesPage
-{
- public static final String PROP_ID = "org.eclipse.jpt.jpa.ui.jpaProjectProperties"; //$NON-NLS-1$
-
- private PropertyValueModel<JpaProject> jpaProjectModel;
- private PropertyValueModel<Boolean> jpaProjectNotNullFlagModel;
-
- private BufferedWritablePropertyValueModel<String> platformIdModel;
- private PropertyChangeListener platformIdListener;
-
- private BufferedWritablePropertyValueModel<String> connectionModel;
- private PropertyValueModel<ConnectionProfile> connectionProfileModel;
- private PropertyValueModel<Boolean> disconnectedModel;
- private PropertyChangeListener disconnectedModelListener;
- private Link connectLink;
-
- private BufferedWritablePropertyValueModel<Boolean> userOverrideDefaultCatalogFlagModel;
- private BufferedWritablePropertyValueModel<String> userOverrideDefaultCatalogModel;
- private ModifiablePropertyValueModel<String> defaultCatalogModel;
- private ListValueModel<String> catalogChoicesModel;
-
- private BufferedWritablePropertyValueModel<Boolean> userOverrideDefaultSchemaFlagModel;
- private BufferedWritablePropertyValueModel<String> userOverrideDefaultSchemaModel;
- private ModifiablePropertyValueModel<String> defaultSchemaModel;
- private ListValueModel<String> schemaChoicesModel;
-
- private BufferedWritablePropertyValueModel<Boolean> discoverAnnotatedClassesModel;
- private ModifiablePropertyValueModel<Boolean> listAnnotatedClassesModel;
-
- private PropertyValueModel<Boolean> jpa2_0ProjectFlagModel;
-
- private BufferedWritablePropertyValueModel<String> metamodelSourceFolderModel;
- private ListValueModel<String> javaSourceFolderChoicesModel;
-
- private static final String BUILD_PATHS_PROPERTY_PAGE_ID = "org.eclipse.jdt.ui.propertyPages.BuildPathsPropertyPage"; //$NON-NLS-1$
-
- /* private */ static final Comparator<String> STRING_COMPARATOR = new ICUStringCollator();
-
- // ************ construction ************
-
- public JpaProjectPropertiesPage() {
- super();
- }
-
- @Override
- protected void buildModels() {
- this.jpaProjectModel = this.buildJpaProjectModel();
- this.jpaProjectNotNullFlagModel = this.buildJpaProjectNotNullFlagModel();
-
- this.platformIdModel = this.buildPlatformIdModel();
- this.platformIdListener = this.buildPlatformIdListener();
-
- this.connectionModel = this.buildConnectionModel();
- this.connectionProfileModel = this.buildConnectionProfileModel();
- this.disconnectedModel = this.buildDisconnectedModel();
- this.disconnectedModelListener = this.buildDisconnectedModelListener();
-
- this.userOverrideDefaultCatalogFlagModel = this.buildUserOverrideDefaultCatalogFlagModel();
- this.userOverrideDefaultCatalogModel = this.buildUserOverrideDefaultCatalogModel();
- this.defaultCatalogModel = this.buildDefaultCatalogModel();
- this.catalogChoicesModel = this.buildCatalogChoicesModel();
-
- this.userOverrideDefaultSchemaFlagModel = this.buildUserOverrideDefaultSchemaFlagModel();
- this.userOverrideDefaultSchemaModel = this.buildUserOverrideDefaultSchemaModel();
- this.defaultSchemaModel = this.buildDefaultSchemaModel();
- this.schemaChoicesModel = this.buildSchemaChoicesModel();
-
- this.discoverAnnotatedClassesModel = this.buildDiscoverAnnotatedClassesModel();
- this.listAnnotatedClassesModel = this.buildListAnnotatedClassesModel();
-
- this.jpa2_0ProjectFlagModel = this.buildJpa2_0ProjectFlagModel();
-
- this.metamodelSourceFolderModel = this.buildMetamodelSourceFolderModel();
- this.javaSourceFolderChoicesModel = this.buildJavaSourceFolderChoicesModel();
- }
-
- // ***** JPA project model
- private PropertyValueModel<JpaProject> buildJpaProjectModel() {
- return new DoublePropertyValueModel<JpaProject>(this.buildJpaProjectModelModel());
- }
-
- private PropertyValueModel<PropertyValueModel<JpaProject>> buildJpaProjectModelModel() {
- return new TransformationPropertyValueModel<IProject, PropertyValueModel<JpaProject>>(this.projectModel, JPA_PROJECT_MODEL_TRANSFORMER);
- }
-
- private static final Transformer<IProject, PropertyValueModel<JpaProject>> JPA_PROJECT_MODEL_TRANSFORMER = new JpaProjectModelTransformer();
-
- /* CU private */ static class JpaProjectModelTransformer
- extends AbstractTransformer<IProject, PropertyValueModel<JpaProject>>
- {
- @Override
- protected PropertyValueModel<JpaProject> transform_(IProject project) {
- return (JpaProjectModel) project.getAdapter(JpaProjectModel.class);
- }
- }
-
- // ***** JPA project not null model
- private PropertyValueModel<Boolean> buildJpaProjectNotNullFlagModel() {
- return new TransformationPropertyValueModel<JpaProject, Boolean>(this.jpaProjectModel, JPA_PROJECT_NOT_NULL_TRANSFORMER);
- }
-
- private static final Transformer<JpaProject, Boolean> JPA_PROJECT_NOT_NULL_TRANSFORMER = new JpaProjectNotNullTransformer();
-
- /* CU private */ static class JpaProjectNotNullTransformer
- extends AbstractTransformer<JpaProject, Boolean>
- {
- @Override
- protected Boolean transform_(JpaProject jpaProject) {
- return Boolean.TRUE; // if we get here, the JPA project is not null
- }
- }
-
- // ***** platform ID model
- private BufferedWritablePropertyValueModel<String> buildPlatformIdModel() {
- return new BufferedWritablePropertyValueModel<String>(new PlatformIdModel(this.jpaProjectModel), this.trigger);
- }
-
- private PropertyChangeListener buildPlatformIdListener(){
- return new PlatformIdListener();
- }
-
- /* CU private */ class PlatformIdListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- JpaProjectPropertiesPage.this.platformIdChanged();
- }
- }
-
- void platformIdChanged() {
- if ( ! this.getControl().isDisposed()) {
- // handle null, in the case the jpa facet is changed via the facets page,
- // the library install delegate is temporarily null
- this.adjustLibraryProviders();
- }
- }
-
- // ***** connection models
- private BufferedWritablePropertyValueModel<String> buildConnectionModel() {
- return new BufferedWritablePropertyValueModel<String>(new ConnectionModel(this.jpaProjectModel), this.trigger);
- }
-
- private PropertyValueModel<ConnectionProfile> buildConnectionProfileModel() {
- return new ConnectionProfileModel(this.connectionModel);
- }
-
- private PropertyValueModel<Boolean> buildDisconnectedModel() {
- return new DisconnectedModel(this.connectionProfileModel);
- }
-
- // ***** catalog models
- private BufferedWritablePropertyValueModel<Boolean> buildUserOverrideDefaultCatalogFlagModel() {
- return new BufferedWritablePropertyValueModel<Boolean>(new UserOverrideDefaultCatalogFlagModel(this.jpaProjectModel), this.trigger);
- }
-
- private BufferedWritablePropertyValueModel<String> buildUserOverrideDefaultCatalogModel() {
- return new BufferedWritablePropertyValueModel<String>(new UserOverrideDefaultCatalogModel(this.jpaProjectModel), this.trigger);
- }
-
- private ModifiablePropertyValueModel<String> buildDefaultCatalogModel() {
- return new DefaultModel(
- this.userOverrideDefaultCatalogFlagModel,
- this.userOverrideDefaultCatalogModel,
- this.buildDatabaseDefaultCatalogModel()
- );
- }
-
- private PropertyValueModel<String> buildDatabaseDefaultCatalogModel() {
- return new DatabaseDefaultCatalogModel(this.connectionProfileModel);
- }
-
- /**
- * Add the default catalog if it is not on the list from the database
- */
- private ListValueModel<String> buildCatalogChoicesModel() {
- return new SortedListValueModelAdapter<String>(this.buildUnsortedCatalogChoicesModel(), STRING_COMPARATOR);
- }
-
- /**
- * Add the default catalog if it is not on the list from the database
- */
- @SuppressWarnings("unchecked")
- private CollectionValueModel<String> buildUnsortedCatalogChoicesModel() {
- return new SetCollectionValueModel<String>(
- new CompositeCollectionValueModel<CollectionValueModel<String>, String>(
- new PropertyCollectionValueModelAdapter<String>(this.defaultCatalogModel),
- this.buildDatabaseCatalogChoicesModel()
- )
- );
- }
-
- private CollectionValueModel<String> buildDatabaseCatalogChoicesModel() {
- return new DatabaseCatalogChoicesModel(this.connectionProfileModel);
- }
-
- // ***** schema models
- private BufferedWritablePropertyValueModel<Boolean> buildUserOverrideDefaultSchemaFlagModel() {
- return new BufferedWritablePropertyValueModel<Boolean>(new UserOverrideDefaultSchemaFlagModel(this.jpaProjectModel), this.trigger);
- }
-
- private BufferedWritablePropertyValueModel<String> buildUserOverrideDefaultSchemaModel() {
- return new BufferedWritablePropertyValueModel<String>(new UserOverrideDefaultSchemaModel(this.jpaProjectModel), this.trigger);
- }
-
- private ModifiablePropertyValueModel<String> buildDefaultSchemaModel() {
- return new DefaultModel(
- this.userOverrideDefaultSchemaFlagModel,
- this.userOverrideDefaultSchemaModel,
- this.buildDatabaseDefaultSchemaModel()
- );
- }
-
- private PropertyValueModel<String> buildDatabaseDefaultSchemaModel() {
- return new DatabaseDefaultSchemaModel(this.connectionProfileModel, this.defaultCatalogModel);
- }
-
- /**
- * Add the default catalog if it is not on the list from the database
- */
- private ListValueModel<String> buildSchemaChoicesModel() {
- return new SortedListValueModelAdapter<String>(this.buildUnsortedSchemaChoicesModel(), STRING_COMPARATOR);
- }
-
- @SuppressWarnings("unchecked")
- private CollectionValueModel<String> buildUnsortedSchemaChoicesModel() {
- return new SetCollectionValueModel<String>(
- new CompositeCollectionValueModel<CollectionValueModel<String>, String>(
- new PropertyCollectionValueModelAdapter<String>(this.defaultSchemaModel),
- this.buildDatabaseSchemaChoicesModel()
- )
- );
- }
-
- private CollectionValueModel<String> buildDatabaseSchemaChoicesModel() {
- return new DatabaseSchemaChoicesModel(this.connectionProfileModel, this.defaultCatalogModel);
- }
-
- // ***** discover/list annotated classes models
- private BufferedWritablePropertyValueModel<Boolean> buildDiscoverAnnotatedClassesModel() {
- return new BufferedWritablePropertyValueModel<Boolean>(new DiscoverAnnotatedClassesModel(this.jpaProjectModel), this.trigger);
- }
-
- /**
- * The opposite of the "discover annotated classes" flag.
- */
- private ModifiablePropertyValueModel<Boolean> buildListAnnotatedClassesModel() {
- return new TransformationWritablePropertyValueModel<Boolean, Boolean>(this.discoverAnnotatedClassesModel, NotBooleanTransformer.instance(), NotBooleanTransformer.instance());
- }
-
- // ***** JPA 2.0 project flag
- private PropertyValueModel<Boolean> buildJpa2_0ProjectFlagModel() {
- return Jpa2_0FlagTransformer.convertToFlagModel(this.jpaProjectModel);
- }
-
- // ***** metamodel models
- private BufferedWritablePropertyValueModel<String> buildMetamodelSourceFolderModel() {
- return new BufferedWritablePropertyValueModel<String>(new MetamodelSourceFolderModel(this.jpaProjectModel), this.trigger);
- }
-
- private ListValueModel<String> buildJavaSourceFolderChoicesModel() {
- // by default, ExtendedListValueModelWrapper puts a null at the top of the list
- return new ExtendedListValueModelWrapper<String>(
- new SortedListValueModelAdapter<String>(
- new JavaSourceFolderChoicesModel(this.jpaProjectModel),
- STRING_COMPARATOR
- )
- );
- }
-
-
- // ********** convenience methods **********
-
- private String getConnectionName() {
- return this.connectionModel.getValue();
- }
-
- private ConnectionProfile getConnectionProfile() {
- return this.connectionProfileModel.getValue();
- }
-
- private boolean userOverrideDefaultCatalogFlagIsSet() {
- return flagIsSet(this.userOverrideDefaultCatalogFlagModel);
- }
-
- private String getUserOverrideDefaultCatalog() {
- return this.userOverrideDefaultCatalogModel.getValue();
- }
-
- private boolean userOverrideDefaultSchemaFlagIsSet() {
- return flagIsSet(this.userOverrideDefaultSchemaFlagModel);
- }
-
- private String getUserOverrideDefaultSchema() {
- return this.userOverrideDefaultSchemaModel.getValue();
- }
-
- private IWorkbenchPreferenceContainer getWorkbenchPreferenceContainer() {
- IWorkbenchPreferenceContainer container= (IWorkbenchPreferenceContainer) this.getContainer();
- return container;
- }
-
- // ********** LibraryFacetPropertyPage implementation **********
-
- @Override
- public IProjectFacetVersion getProjectFacetVersion() {
- return this.getFacetedProject().getInstalledVersion(JpaFacet.FACET);
- }
-
- @Override
- protected LibraryInstallDelegate createLibraryInstallDelegate(IFacetedProject project, IProjectFacetVersion fv) {
- Map<String, Object> enablementVariables = new HashMap<String, Object>();
-
- //TODO Ask Paul about these empty enablement variables - trying to reproduce Helios functionality
- enablementVariables.put(JpaLibraryProviderInstallOperationConfig.JPA_PLATFORM_ENABLEMENT_EXP, ""); //$NON-NLS-1$
- enablementVariables.put(JpaLibraryProviderInstallOperationConfig.JPA_PLATFORM_DESCRIPTION_ENABLEMENT_EXP, new EmptyJpaPlatformDescription());
-
- LibraryInstallDelegate lid = new LibraryInstallDelegate(project, fv, enablementVariables);
- lid.addListener(this.buildLibraryProviderListener());
- return lid;
- }
-
- /* CU private */ class EmptyJpaPlatformDescription
- implements JpaPlatformDescription
- {
- public boolean supportsJpaFacetVersion(IProjectFacetVersion jpaFacetVersion) {
- return false;
- }
-
- public boolean isDefault() {
- return false;
- }
-
- public String getPluginId() {
- return null;
- }
-
- public String getLabel() {
- return null;
- }
-
- public String getId() {
- return null;
- }
-
- public JpaPlatformGroupDescription getGroup() {
- return null;
- }
-
- public String getFactoryClassName() {
- return null;
- }
- }
-
- @Override
- protected void adjustLibraryProviders() {
- LibraryInstallDelegate lid = this.getLibraryInstallDelegate();
-
- if (lid != null) {
- JpaPlatformDescription jpaPlatform =
- JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(this.platformIdModel.getValue());
- String jpaPlatformId = (jpaPlatform == null) ? "" : jpaPlatform.getId(); //$NON-NLS-1$
-
- lid.setEnablementContextVariable(
- JpaLibraryProviderInstallOperationConfig.JPA_PLATFORM_ENABLEMENT_EXP, jpaPlatformId);
- lid.setEnablementContextVariable(
- JpaLibraryProviderInstallOperationConfig.JPA_PLATFORM_DESCRIPTION_ENABLEMENT_EXP, jpaPlatform);
-
- List<JpaLibraryProviderInstallOperationConfig> jpaConfigs
- = new ArrayList<JpaLibraryProviderInstallOperationConfig>();
- // add the currently selected one first
- JpaLibraryProviderInstallOperationConfig currentJpaConfig = null;
- LibraryProviderOperationConfig config = lid.getLibraryProviderOperationConfig();
- if (config instanceof JpaLibraryProviderInstallOperationConfig) {
- currentJpaConfig = (JpaLibraryProviderInstallOperationConfig) config;
- jpaConfigs.add(currentJpaConfig);
- }
- for (ILibraryProvider lp : lid.getLibraryProviders()) {
- config = lid.getLibraryProviderOperationConfig(lp);
- if ((config instanceof JpaLibraryProviderInstallOperationConfig)
- && ! config.equals(currentJpaConfig)) {
- jpaConfigs.add((JpaLibraryProviderInstallOperationConfig) config);
- }
- }
- for (JpaLibraryProviderInstallOperationConfig jpaConfig : jpaConfigs) {
- jpaConfig.setJpaPlatform(jpaPlatform);
- }
- }
- }
-
-
- // ********** page **********
-
- @Override
- protected void createWidgets(Composite parent) {
- this.buildPlatformGroup(parent);
-
- Control libraryProviderComposite = createInstallLibraryPanel(
- parent,
- this.getLibraryInstallDelegate(),
- JptUiMessages.JpaFacetWizardPage_jpaImplementationLabel);
-
- libraryProviderComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- SWTTools.controlEnabledState(this.jpaProjectNotNullFlagModel, libraryProviderComposite);
-
- this.buildConnectionGroup(parent);
- this.buildPersistentClassManagementGroup(parent);
- this.buildMetamodelGroup(parent);
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, JpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE);
- }
-
- @Override
- protected void engageListeners() {
- super.engageListeners();
- this.platformIdModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.platformIdListener);
- this.disconnectedModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.disconnectedModelListener);
- }
-
- @Override
- protected void disengageListeners() {
- this.platformIdModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.platformIdListener);
- this.disconnectedModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.disconnectedModelListener);
- super.disengageListeners();
- }
-
-
- // ********** platform group **********
-
- private void buildPlatformGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_platformLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Combo platformDropDown = this.buildDropDown(group);
- SWTTools.bind(
- this.buildPlatformChoicesModel(),
- this.platformIdModel,
- platformDropDown,
- JPA_PLATFORM_LABEL_CONVERTER);
-
- Link facetsPageLink = this.buildFacetsPageLink(group, JptUiMessages.JpaFacetWizardPage_facetsPageLink);
-
- SWTTools.controlEnabledState(this.jpaProjectNotNullFlagModel, group, platformDropDown, facetsPageLink);
- }
-
- /**
- * Add the project's JPA platform if it is not on the list of valid
- * platforms.
- * <p>
- * This is probably only useful if the project is corrupted
- * and has a platform that exists in the registry but is not on the
- * list of valid platforms for the project's JPA facet version.
- * Because, if the project's JPA platform is completely invalid, there
- * would be no JPA project!
- */
- @SuppressWarnings("unchecked")
- private ListValueModel<String> buildPlatformChoicesModel() {
- return new SortedListValueModelAdapter<String>(
- new SetCollectionValueModel<String>(
- new CompositeCollectionValueModel<CollectionValueModel<String>, String>(
- new PropertyCollectionValueModelAdapter<String>(this.platformIdModel),
- this.buildRegistryPlatformsModel()
- )
- ),
- JPA_PLATFORM_COMPARATOR
- );
- }
-
- private CollectionValueModel<String> buildRegistryPlatformsModel() {
- Iterable<String> enabledPlatformIds =
- new TransformationIterable<JpaPlatformDescription, String>(
- new FilteringIterable<JpaPlatformDescription>(
- JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatforms(),
- new JpaPlatformDescriptionFilter()
- ),
- JPA_PLATFORM_DESCRIPTION_ID_TRANSFORMER
- );
- return new StaticCollectionValueModel<String>(enabledPlatformIds);
- }
-
- /* CU private */ class JpaPlatformDescriptionFilter
- extends FilterAdapter<JpaPlatformDescription>
- {
- @Override
- public boolean accept(JpaPlatformDescription o) {
- return o.supportsJpaFacetVersion(JpaProjectPropertiesPage.this.getProjectFacetVersion());
- }
- }
-
- private static final Transformer<JpaPlatformDescription, String> JPA_PLATFORM_DESCRIPTION_ID_TRANSFORMER = new JpaPlatformDescriptionIdTransformer();
-
- /* CU private */ static class JpaPlatformDescriptionIdTransformer
- extends AbstractTransformer<JpaPlatformDescription, String>
- {
- @Override
- public String transform_(JpaPlatformDescription o) {
- return o.getId();
- }
- }
-
- private static final Comparator<String> JPA_PLATFORM_COMPARATOR =
- new Comparator<String>() {
- public int compare(String id1, String id2) {
- String label1 = getJpaPlatformLabel(id1);
- String label2 = getJpaPlatformLabel(id2);
- return STRING_COMPARATOR.compare(label1, label2);
- }
- };
-
- private static final StringConverter<String> JPA_PLATFORM_LABEL_CONVERTER =
- new StringConverter<String>() {
- public String convertToString(String id) {
- return getJpaPlatformLabel(id);
- }
- };
-
- /* private */ static String getJpaPlatformLabel(String id) {
- return JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(id).getLabel();
- }
-
-
- // ********** connection group **********
-
- private void buildConnectionGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_connectionLabel);
- group.setLayout(new GridLayout(3, false));
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE_CONNECTION);
-
- Combo connectionDropDown = this.buildDropDown(group, 3);
- SWTTools.bind(
- CONNECTION_CHOICES_MODEL,
- this.connectionModel,
- connectionDropDown,
- SIMPLE_STRING_CONVERTER
- );
-
- Link addConnectionLink = this.buildLink(group, JptUiMessages.JpaFacetWizardPage_connectionLink);
- addConnectionLink.addSelectionListener(new AddConnectionLinkListener()); // the link will be GCed
-
- this.connectLink = this.buildLink(group, this.buildConnectLinkText());
- SWTTools.controlEnabledState(this.disconnectedModel, this.connectLink);
- this.connectLink.addSelectionListener(new ConnectLinkListener()); // the link will be GCed
-
- // override default catalog
- Button overrideDefaultCatalogCheckBox = this.buildCheckBox(group, 3, JptUiMessages.JpaFacetWizardPage_overrideDefaultCatalogLabel);
- SWTTools.bind(this.userOverrideDefaultCatalogFlagModel, overrideDefaultCatalogCheckBox);
-
- Label defaultCatalogLabel = this.buildLabel(group, JptUiMessages.JpaFacetWizardPage_defaultCatalogLabel);
- Combo defaultCatalogDropDown = this.buildDropDown(group);
- SWTTools.bind(this.catalogChoicesModel, this.defaultCatalogModel, defaultCatalogDropDown);
-
- SWTTools.controlEnabledState(this.userOverrideDefaultCatalogFlagModel, defaultCatalogLabel, defaultCatalogDropDown);
-
- // override default schema
- Button overrideDefaultSchemaButton = this.buildCheckBox(group, 3, JptUiMessages.JpaFacetWizardPage_overrideDefaultSchemaLabel);
- SWTTools.bind(this.userOverrideDefaultSchemaFlagModel, overrideDefaultSchemaButton);
-
- Label defaultSchemaLabel = this.buildLabel(group, JptUiMessages.JpaFacetWizardPage_defaultSchemaLabel);
- Combo defaultSchemaDropDown = this.buildDropDown(group);
- SWTTools.bind(this.schemaChoicesModel, this.defaultSchemaModel, defaultSchemaDropDown);
-
- SWTTools.controlEnabledState(this.userOverrideDefaultSchemaFlagModel, defaultSchemaLabel, defaultSchemaDropDown);
-
- SWTTools.controlEnabledState(this.jpaProjectNotNullFlagModel, group, connectionDropDown, addConnectionLink, overrideDefaultCatalogCheckBox, overrideDefaultSchemaButton);
- }
-
- private static final StringConverter<String> SIMPLE_STRING_CONVERTER =
- new StringConverter<String>() {
- public String convertToString(String string) {
- return (string != null) ? string : JptUiMessages.JpaFacetWizardPage_none;
- }
- };
-
- private PropertyChangeListener buildDisconnectedModelListener() {
- return new SWTPropertyChangeListenerWrapper(new DisconnectedModelListener());
- }
-
- /* CU private */ class DisconnectedModelListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- JpaProjectPropertiesPage.this.updateConnectLinkText();
- }
- }
-
- /* CU private */ void updateConnectLinkText() {
- this.updateConnectLinkText(this.buildConnectLinkText());
- }
-
- private String buildConnectLinkText() {
- ConnectionProfile connectionProfile = this.getConnectionProfile();
- return ((connectionProfile != null) && connectionProfile.isConnected()) ?
- JptUiMessages.JpaFacetWizardPage_connectedText :
- JptUiMessages.JpaFacetWizardPage_connectLink;
- }
-
- private void updateConnectLinkText(String text) {
- this.connectLink.setText(text);
- SWTUtil.reflow(this.connectLink.getParent());
- }
-
- /* CU private */ class AddConnectionLinkListener
- extends SelectionAdapter
- {
- @Override
- public void widgetSelected(SelectionEvent e) {
- JpaProjectPropertiesPage.this.openNewConnectionWizard();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- void openNewConnectionWizard() {
- String connectionName = DTPUiTools.createNewConnectionProfile();
- if (connectionName != null) {
- this.connectionModel.setValue(connectionName);
- }
- }
-
- /* CU private */ class ConnectLinkListener
- extends SelectionAdapter
- {
- @Override
- public void widgetSelected(SelectionEvent e) {
- JpaProjectPropertiesPage.this.openConnectionProfile();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- void openConnectionProfile() {
- ConnectionProfile cp = this.getConnectionProfile();
- if (cp != null) {
- cp.connect();
- }
- }
-
-
- // ********** persistent class management group **********
-
- private void buildPersistentClassManagementGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_persistentClassManagementLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Button discoverClassesRadioButton = this.buildRadioButton(group, 1, JptUiMessages.JpaFacetWizardPage_discoverClassesButton);
- SWTTools.bind(this.discoverAnnotatedClassesModel, discoverClassesRadioButton);
-
- Button listClassesRadioButton = this.buildRadioButton(group, 1, JptUiMessages.JpaFacetWizardPage_listClassesButton);
- SWTTools.bind(this.listAnnotatedClassesModel, listClassesRadioButton);
-
- SWTTools.controlEnabledState(this.jpaProjectNotNullFlagModel, group, discoverClassesRadioButton, listClassesRadioButton);
- }
-
-
- // ********** metamodel group **********
-
- private void buildMetamodelGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_metamodelLabel);
- group.setLayout(new GridLayout(3, false));
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- Link metamodelSourceFolderLink = this.buildLink(group, JptUiMessages.JpaFacetWizardPage_metamodelSourceFolderLink);
- metamodelSourceFolderLink.addSelectionListener(new MetamodelSourceFolderLinkListener()); // the link will be GCed
- Combo metamodelSourceFolderDropDown = this.buildDropDown(group);
- SWTTools.bind(
- this.javaSourceFolderChoicesModel,
- this.metamodelSourceFolderModel,
- metamodelSourceFolderDropDown,
- SIMPLE_STRING_CONVERTER
- );
-
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE_METAMODEL);
-
- SWTTools.controlVisibleState(this.jpa2_0ProjectFlagModel, group, metamodelSourceFolderLink, metamodelSourceFolderDropDown);
- }
-
- /* CU private */ class MetamodelSourceFolderLinkListener
- extends SelectionAdapter
- {
- @Override
- public void widgetSelected(SelectionEvent e) {
- JpaProjectPropertiesPage.this.openJavaBuildPathPage();
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- void openJavaBuildPathPage() {
- IWorkbenchPreferenceContainer container = this.getWorkbenchPreferenceContainer();
- container.openPage(BUILD_PATHS_PROPERTY_PAGE_ID, null);
- }
-
- // ********** OK/Revert/Apply behavior **********
-
- @Override
- protected boolean projectRebuildRequired() {
- return this.platformIdModel.isBuffering();
- }
-
- @Override
- protected void rebuildProject() throws CoreException {
- // if the JPA platform is changed, we need to completely rebuild the JPA project
- try {
- this.rebuildProject_();
- } catch (InterruptedException ex) {
- throw new CoreException(new Status(IStatus.CANCEL, JptJpaUiPlugin.PLUGIN_ID, null, ex));
- }
- }
-
- private void rebuildProject_() throws InterruptedException {
- this.getJpaProjectReference().rebuild();
- }
-
- private JpaProject.Reference getJpaProjectReference() {
- return ((JpaProject.Reference) this.getProject().getAdapter(JpaProject.Reference.class));
- }
-
- @Override
- protected BufferedWritablePropertyValueModel<?>[] buildBufferedModels() {
- return new BufferedWritablePropertyValueModel[] {
- this.platformIdModel,
- this.connectionModel,
- this.userOverrideDefaultCatalogFlagModel,
- this.userOverrideDefaultCatalogModel,
- this.userOverrideDefaultSchemaFlagModel,
- this.userOverrideDefaultSchemaModel,
- this.discoverAnnotatedClassesModel,
- this.metamodelSourceFolderModel
- };
- }
-
-
- // ********** validation **********
-
- @Override
- protected Model[] buildValidationModels() {
- return new Model[] {
- this.platformIdModel,
- this.connectionModel,
- this.userOverrideDefaultCatalogFlagModel,
- this.defaultCatalogModel,
- this.userOverrideDefaultSchemaFlagModel,
- this.defaultSchemaModel,
- this.discoverAnnotatedClassesModel
- };
- }
-
- @Override
- protected void performValidation(Map<Integer, ArrayList<IStatus>> statuses) {
- JpaProject jpaProject = this.jpaProjectModel.getValue();
- if (jpaProject == null) {
- return;
- }
- /* platform */
- // user is unable to unset the platform, so no validation necessary
-
- /* library provider */
- this.validateLibraryProvider(statuses);
-
- /* connection */
- ConnectionProfile connectionProfile = this.getConnectionProfile();
- String connectionName = this.getConnectionName();
- if ( ! StringTools.stringIsEmpty(connectionName)) {
- if (connectionProfile == null) {
- statuses.get(ERROR_STATUS).add(this.buildErrorStatus(NLS.bind(
- JptCoreMessages.VALIDATE_CONNECTION_INVALID,
- connectionName)));
- }
- else if ( ! connectionProfile.isActive()) {
- statuses.get(INFO_STATUS).add(this.buildInfoStatus(JptCoreMessages.VALIDATE_CONNECTION_NOT_CONNECTED));
- }
- }
-
- /* default catalog */
- if (this.userOverrideDefaultCatalogFlagIsSet()) {
- String defaultCatalog = this.getUserOverrideDefaultCatalog();
- if (StringTools.stringIsEmpty(defaultCatalog)) {
- statuses.get(ERROR_STATUS).add(this.buildErrorStatus(JptCoreMessages.VALIDATE_DEFAULT_CATALOG_NOT_SPECIFIED));
- }
- else if ((connectionProfile != null)
- && connectionProfile.isConnected()
- && ! CollectionTools.contains(this.catalogChoicesModel.iterator(), defaultCatalog)) {
- statuses.get(WARNING_STATUS).add(this.buildWarningStatus(NLS.bind(
- JptCoreMessages.VALIDATE_CONNECTION_DOESNT_CONTAIN_CATALOG,
- defaultCatalog
- )));
- }
- }
-
- /* default schema */
- if (this.userOverrideDefaultSchemaFlagIsSet()) {
- String defaultSchema = this.getUserOverrideDefaultSchema();
- if (StringTools.stringIsEmpty(defaultSchema)) {
- statuses.get(ERROR_STATUS).add(this.buildErrorStatus(JptCoreMessages.VALIDATE_DEFAULT_SCHEMA_NOT_SPECIFIED));
- }
- else if ((connectionProfile != null)
- && connectionProfile.isConnected()
- && ! CollectionTools.contains(this.schemaChoicesModel.iterator(), defaultSchema)) {
- statuses.get(WARNING_STATUS).add(this.buildWarningStatus(NLS.bind(
- JptCoreMessages.VALIDATE_CONNECTION_DOESNT_CONTAIN_SCHEMA,
- defaultSchema
- )));
- }
- }
- }
-
- private void validateLibraryProvider(Map<Integer, ArrayList<IStatus>> statuses) {
- LibraryInstallDelegate libInstallDelegate = this.getLibraryInstallDelegate();
- if (libInstallDelegate == null) {
- return;
- }
-
- Map<String, Object> enablementVariables = new HashMap<String, Object>();
- enablementVariables.put(JpaLibraryProviderInstallOperationConfig.JPA_PLATFORM_ENABLEMENT_EXP, this.platformIdModel.getValue());
- enablementVariables.put(JpaLibraryProviderInstallOperationConfig.JPA_PLATFORM_DESCRIPTION_ENABLEMENT_EXP, this.jpaProjectModel.getValue().getJpaPlatform().getDescription());
-
- if ( ! libInstallDelegate.getLibraryProvider().isEnabledFor(
- this.getFacetedProject(), this.getProjectFacetVersion(), enablementVariables)) {
- this.addStatus(this.buildErrorStatus(JptCoreMessages.VALIDATE_LIBRARY_PROVIDER_INVALID), statuses);
- }
- }
-
-
- // ********** UI model adapters **********
-
- /**
- * The JPA project's data source is an auxiliary object that never changes;
- * so if we have a JPA project, we have a JPA data source also.
- */
- static class DataSourceModel
- extends TransformationPropertyValueModel<JpaProject, JpaDataSource>
- {
- DataSourceModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel);
- }
-
- @Override
- protected JpaDataSource transform_(JpaProject v) {
- return v.getDataSource();
- }
- }
-
-
- /**
- * The DTP connection profile name is an aspect of the JPA project's
- * data source
- */
- static class ConnectionModel
- extends PropertyAspectAdapter<JpaDataSource, String>
- {
- ConnectionModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(new DataSourceModel(jpaProjectModel), JpaDataSource.CONNECTION_PROFILE_NAME_PROPERTY);
- }
-
- @Override
- protected String buildValue_() {
- return this.subject.getConnectionProfileName();
- }
-
- @Override
- public void setValue_(String connection) {
- this.subject.setConnectionProfileName(connection);
- }
- }
-
-
- /**
- * Convert the selected connection profile name to a connection profile
- */
- static class ConnectionProfileModel
- extends TransformationPropertyValueModel<String, ConnectionProfile>
- {
- ConnectionProfileModel(PropertyValueModel<String> connectionModel) {
- super(connectionModel);
- }
-
- @Override
- protected ConnectionProfile transform_(String connectionName) {
- return JptJpaDbPlugin.getConnectionProfileFactory().buildConnectionProfile(connectionName);
- }
- }
-
-
- /**
- * Treat the JPA platform ID as an "aspect" of the JPA project.
- * The platform ID is stored in the project preferences.
- * The platform ID does not change for a JPA project - if the user wants a
- * different platform, we build an entirely new JPA project.
- */
- static class PlatformIdModel
- extends AspectPropertyValueModelAdapter<JpaProject, String>
- {
- PlatformIdModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel);
- }
-
- @Override
- protected String buildValue_() {
- return JptJpaCorePlugin.getJpaPlatformId(this.subject.getProject());
- }
-
- @Override
- public void setValue_(String newPlatformId) {
- JptJpaCorePlugin.setJpaPlatformId(this.subject.getProject(), newPlatformId);
- }
-
- @Override
- protected void engageSubject_() {
- // the platform ID does not change
- }
-
- @Override
- protected void disengageSubject_() {
- // the platform ID does not change
- }
- }
-
-
- /**
- * The connections are held by a singleton, so the model can be a singleton
- * also.
- */
- // by default, ExtendedListValueModelWrapper puts a null at the top of the list
- private static final ListValueModel<String> CONNECTION_CHOICES_MODEL =
- new ExtendedListValueModelWrapper<String>(
- new SortedListValueModelAdapter<String>(
- new ConnectionChoicesModel(),
- STRING_COMPARATOR
- )
- );
-
-
- /**
- * Wrap the connection profile names held by the connection profile
- * factory singleton.
- */
- static class ConnectionChoicesModel
- extends AbstractCollectionValueModel
- implements CollectionValueModel<String>
- {
- private final ConnectionProfileListener connectionProfileListener;
-
- ConnectionChoicesModel() {
- super();
- this.connectionProfileListener = new LocalConnectionProfileListener();
- }
-
- /* class private */ class LocalConnectionProfileListener
- implements ConnectionProfileListener
- {
- public void connectionProfileAdded(String name) {
- ConnectionChoicesModel.this.collectionChanged();
- }
- public void connectionProfileRemoved(String name) {
- ConnectionChoicesModel.this.collectionChanged();
- }
- public void connectionProfileRenamed(String oldName, String newName) {
- // Ignore this event for now. Connecting a profile actually
- // throws a connection renamed event, which messes up the
- // list selection. There shouldn't be a connection renamed
- // within the scope of this dialog anyhow.
- // ConnectionChoicesModel.this.collectionChanged();
- }
- }
-
- void collectionChanged() {
- this.fireCollectionChanged(CollectionValueModel.VALUES, CollectionTools.collection(this.iterator()));
- }
-
- public Iterator<String> iterator() {
- return this.getConnectionProfileFactory().getConnectionProfileNames().iterator();
- }
-
- public int size() {
- return CollectionTools.size(this.iterator());
- }
-
- @Override
- protected void engageModel() {
- this.getConnectionProfileFactory().addConnectionProfileListener(this.connectionProfileListener);
- }
-
- @Override
- protected void disengageModel() {
- this.getConnectionProfileFactory().removeConnectionProfileListener(this.connectionProfileListener);
- }
-
- private ConnectionProfileFactory getConnectionProfileFactory() {
- return JptJpaDbPlugin.getConnectionProfileFactory();
- }
- }
-
-
- /**
- * Adapt whether the JPA project has a user override specified
- * (either catalog or schema);
- */
- abstract static class UserOverrideDefaultFlagModel
- extends PropertyAspectAdapter<JpaProject, Boolean>
- {
- UserOverrideDefaultFlagModel(PropertyValueModel<JpaProject> jpaProjectModel, String propertyName) {
- super(jpaProjectModel, propertyName);
- }
-
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.specifiesUserOverrideDefault());
- }
-
- boolean specifiesUserOverrideDefault() {
- return ! StringTools.stringIsEmpty(this.getUserOverrideDefault());
- }
-
- abstract String getUserOverrideDefault();
-
- @Override
- protected void setValue_(Boolean value) {
- // ignore
- }
- }
-
-
- /**
- * Whether the JPA project has a user override default catalog specified.
- */
- static class UserOverrideDefaultCatalogFlagModel
- extends UserOverrideDefaultFlagModel
- {
- UserOverrideDefaultCatalogFlagModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel, JpaProject.USER_OVERRIDE_DEFAULT_CATALOG_PROPERTY);
- }
- @Override
- public String getUserOverrideDefault() {
- return this.subject.getUserOverrideDefaultCatalog();
- }
- }
-
-
- /**
- * Whether the JPA project has a user override default schema specified.
- */
- static class UserOverrideDefaultSchemaFlagModel
- extends UserOverrideDefaultFlagModel
- {
- UserOverrideDefaultSchemaFlagModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel, JpaProject.USER_OVERRIDE_DEFAULT_SCHEMA_PROPERTY);
- }
- @Override
- public String getUserOverrideDefault() {
- return this.subject.getUserOverrideDefaultSchema();
- }
- }
-
-
- /**
- * The JPA project's user override default catalog
- */
- static class UserOverrideDefaultCatalogModel
- extends PropertyAspectAdapter<JpaProject, String>
- {
- UserOverrideDefaultCatalogModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel, JpaProject.USER_OVERRIDE_DEFAULT_CATALOG_PROPERTY);
- }
-
- @Override
- protected String buildValue_() {
- return this.subject.getUserOverrideDefaultCatalog();
- }
-
- @Override
- public void setValue_(String catalog) {
- this.subject.setUserOverrideDefaultCatalog(catalog);
- }
- }
-
-
- /**
- * The JPA project's user override default catalog
- */
- static class UserOverrideDefaultSchemaModel
- extends PropertyAspectAdapter<JpaProject, String>
- {
- UserOverrideDefaultSchemaModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel, JpaProject.USER_OVERRIDE_DEFAULT_SCHEMA_PROPERTY);
- }
-
- @Override
- protected String buildValue_() {
- return this.subject.getUserOverrideDefaultSchema();
- }
-
- @Override
- public void setValue_(String schema) {
- this.subject.setUserOverrideDefaultSchema(schema);
- }
- }
-
-
- /**
- * Flag on the JPA project indicating whether it should discover annotated
- * classes
- */
- static class DiscoverAnnotatedClassesModel
- extends PropertyAspectAdapter<JpaProject, Boolean>
- {
- DiscoverAnnotatedClassesModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel, JpaProject.DISCOVERS_ANNOTATED_CLASSES_PROPERTY);
- }
-
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(this.subject.discoversAnnotatedClasses());
- }
-
- @Override
- protected void setValue_(Boolean value) {
- this.subject.setDiscoversAnnotatedClasses(value.booleanValue());
- }
- }
-
-
- /**
- * The folder where the source for the generated Canonical Metamodel
- * is written.
- */
- static class MetamodelSourceFolderModel
- extends PropertyAspectAdapter<JpaProject, String>
- {
- MetamodelSourceFolderModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel, JpaProject2_0.METAMODEL_SOURCE_FOLDER_NAME_PROPERTY);
- }
-
- @Override
- protected String buildValue_() {
- return this.jpaProjectIsJpa2_0() ? ((JpaProject2_0) this.subject).getMetamodelSourceFolderName() : null;
- }
-
- @Override
- protected void setValue_(String value) {
- if (this.jpaProjectIsJpa2_0()) {
- ((JpaProject2_0) this.subject).setMetamodelSourceFolderName(value);
- }
- }
-
- private boolean jpaProjectIsJpa2_0() {
- return JptJpaCorePlugin.nodeIsJpa2_0Compatible(this.subject);
- }
- }
-
-
- /**
- * Java project source folders.
- * We keep the metamodel source folder in sync with the Java source folders
- * (i.e. if a Java source folder is deleted or removed from the build path,
- * we remove the metamodel source folder); therefore the list of folder
- * choices does not need to be augmented with the current folder (as we do
- * when the current folder is not in the list of choices).
- */
- static class JavaSourceFolderChoicesModel
- extends AspectCollectionValueModelAdapter<JpaProject, String>
- {
- private final IElementChangedListener javaElementChangedListener;
-
- JavaSourceFolderChoicesModel(PropertyValueModel<JpaProject> jpaProjectModel) {
- super(jpaProjectModel);
- this.javaElementChangedListener = new JavaElementChangedListener();
- }
-
- /* class private */ class JavaElementChangedListener
- implements IElementChangedListener
- {
- public void elementChanged(ElementChangedEvent event) {
- JavaSourceFolderChoicesModel.this.processJavaDelta(event.getDelta());
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- void processJavaDelta(IJavaElementDelta delta) {
- switch (delta.getElement().getElementType()) {
- case IJavaElement.JAVA_MODEL :
- this.processJavaDeltaChildren(delta);
- break;
- case IJavaElement.JAVA_PROJECT :
- this.processJavaProjectDelta(delta);
- break;
- default :
- break; // ignore everything else
- }
- }
-
- private void processJavaDeltaChildren(IJavaElementDelta delta) {
- for (IJavaElementDelta child : delta.getAffectedChildren()) {
- this.processJavaDelta(child); // recurse
- }
- }
-
- private void processJavaProjectDelta(IJavaElementDelta delta) {
- IJavaProject javaProject = (IJavaProject) delta.getElement();
- if (javaProject.equals(this.subject.getJavaProject()) && this.classpathHasChanged(delta)) {
- this.fireCollectionChanged(CollectionValueModel.VALUES, CollectionTools.collection(this.iterator()));
- }
- }
-
- private boolean classpathHasChanged(IJavaElementDelta delta) {
- return this.deltaFlagIsSet(delta, IJavaElementDelta.F_RESOLVED_CLASSPATH_CHANGED);
- }
-
- private boolean deltaFlagIsSet(IJavaElementDelta delta, int flag) {
- return (delta.getKind() == IJavaElementDelta.CHANGED) &&
- BitTools.flagIsSet(delta.getFlags(), flag);
- }
-
- @Override
- protected Iterable<String> getIterable() {
- return this.jpaProjectIsJpa2_0() ?
- ((JpaProject2_0) this.subject).getJavaSourceFolderNames() :
- EmptyIterable.<String>instance();
- }
-
- private boolean jpaProjectIsJpa2_0() {
- return JptJpaCorePlugin.nodeIsJpa2_0Compatible(this.subject);
- }
-
- @Override
- protected void engageSubject_() {
- JavaCore.addElementChangedListener(this.javaElementChangedListener);
- }
-
- @Override
- protected void disengageSubject_() {
- JavaCore.removeElementChangedListener(this.javaElementChangedListener);
- }
- }
-
-
- /**
- * Abstract property aspect adapter for DTP connection profile connection/database
- */
- abstract static class ConnectionProfilePropertyAspectAdapter<V>
- extends AspectPropertyValueModelAdapter<ConnectionProfile, V>
- {
- private final ConnectionListener connectionListener;
-
- ConnectionProfilePropertyAspectAdapter(PropertyValueModel<ConnectionProfile> connectionProfileModel) {
- super(connectionProfileModel);
- this.connectionListener = this.buildConnectionListener();
- }
-
- // the connection opening is probably the only thing that will happen...
- private ConnectionListener buildConnectionListener() {
- return new LocalConnectionListener();
- }
-
- class LocalConnectionListener
- extends ConnectionAdapter
- {
- @Override
- public void opened(ConnectionProfile profile) {
- ConnectionProfilePropertyAspectAdapter.this.connectionOpened(profile);
- }
- }
-
- void connectionOpened(ConnectionProfile profile) {
- if (profile.equals(this.subject)) {
- this.aspectChanged();
- }
- }
-
- @Override
- protected void engageSubject_() {
- this.subject.addConnectionListener(this.connectionListener);
- }
-
- @Override
- protected void disengageSubject_() {
- this.subject.removeConnectionListener(this.connectionListener);
- }
- }
-
-
- /**
- * Monitor the connection profile's connection to the database
- * (used to enable the "Connect" link)
- */
- static class DisconnectedModel
- extends ConnectionProfilePropertyAspectAdapter<Boolean>
- {
- DisconnectedModel(PropertyValueModel<ConnectionProfile> connectionProfileModel) {
- super(connectionProfileModel);
- }
-
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf((this.subject != null) && this.subject.isDisconnected());
- }
- }
-
-
- /**
- * Database-determined default catalog
- */
- static class DatabaseDefaultCatalogModel
- extends ConnectionProfilePropertyAspectAdapter<String>
- {
- DatabaseDefaultCatalogModel(PropertyValueModel<ConnectionProfile> connectionProfileModel) {
- super(connectionProfileModel);
- }
-
- @Override
- protected String buildValue_() {
- Database db = this.subject.getDatabase();
- return (db == null) ? null : db.getDefaultCatalogIdentifier();
- }
- }
-
-
- /**
- * The default schema is not derived purely from the database; it is also dependent
- * on the current value of the default catalog (which may be overridden
- * by the user).
- */
- static class DatabaseDefaultSchemaModel
- extends ConnectionProfilePropertyAspectAdapter<String>
- {
- private final PropertyValueModel<String> defaultCatalogModel;
- private final PropertyChangeListener catalogListener;
-
- DatabaseDefaultSchemaModel(
- PropertyValueModel<ConnectionProfile> connectionProfileModel,
- PropertyValueModel<String> defaultCatalogModel
- ) {
- super(connectionProfileModel);
- this.defaultCatalogModel = defaultCatalogModel;
- this.catalogListener = new CatalogListener();
- }
-
- /* class private */ class CatalogListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- DatabaseDefaultSchemaModel.this.catalogChanged();
- }
- }
-
- void catalogChanged() {
- this.aspectChanged();
- }
-
- @Override
- protected void engageSubject_() {
- super.engageSubject_();
- this.defaultCatalogModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.catalogListener);
- }
-
- @Override
- protected void disengageSubject_() {
- this.defaultCatalogModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.catalogListener);
- super.disengageSubject_();
- }
-
- @Override
- protected String buildValue_() {
- SchemaContainer sc = this.getSchemaContainer();
- return (sc == null) ? null : sc.getDefaultSchemaIdentifier();
- }
-
- private SchemaContainer getSchemaContainer() {
- return this.databaseSupportsCatalogs() ? this.getCatalog() : this.getDatabase();
- }
-
- private boolean databaseSupportsCatalogs() {
- Database db = this.getDatabase();
- return (db != null) && db.supportsCatalogs();
- }
-
- private Catalog getCatalog() {
- String name = this.defaultCatalogModel.getValue();
- // if we get here we know the database is not null
- return (name == null) ? null : this.getDatabase().getCatalogForIdentifier(name);
- }
-
- private Database getDatabase() {
- return this.subject.getDatabase();
- }
- }
-
-
- /**
- * Abstract collection aspect adapter for DTP connection profile connection/database
- */
- abstract static class ConnectionProfileCollectionAspectAdapter<E>
- extends AspectCollectionValueModelAdapter<ConnectionProfile, E>
- {
- private final ConnectionListener connectionListener;
-
- ConnectionProfileCollectionAspectAdapter(PropertyValueModel<ConnectionProfile> connectionProfileModel) {
- super(connectionProfileModel);
- this.connectionListener = this.buildConnectionListener();
- }
-
- // the connection opening is probably the only thing that will happen...
- private ConnectionListener buildConnectionListener() {
- return new LocalConnectionListener();
- }
-
- class LocalConnectionListener
- extends ConnectionAdapter
- {
- @Override
- public void opened(ConnectionProfile profile) {
- ConnectionProfileCollectionAspectAdapter.this.connectionOpened(profile);
- }
- }
-
- void connectionOpened(ConnectionProfile profile) {
- if (profile.equals(this.subject)) {
- this.aspectChanged();
- }
- }
-
- @Override
- protected void engageSubject_() {
- this.subject.addConnectionListener(this.connectionListener);
- }
-
- @Override
- protected void disengageSubject_() {
- this.subject.removeConnectionListener(this.connectionListener);
- }
- }
-
-
- /**
- * Catalogs on the database.
- */
- static class DatabaseCatalogChoicesModel
- extends ConnectionProfileCollectionAspectAdapter<String>
- {
- DatabaseCatalogChoicesModel(PropertyValueModel<ConnectionProfile> connectionProfileModel) {
- super(connectionProfileModel);
- }
-
- @Override
- protected Iterable<String> getIterable() {
- Database db = this.subject.getDatabase();
- // use catalog *identifiers* since the string ends up being the "default" for various text entries
- return (db != null) ? db.getSortedCatalogIdentifiers() : EmptyIterable.<String>instance();
- }
- }
-
-
- /**
- * Schemas on the database or catalog.
- * This list is not derived purely from the database; it is also dependent
- * on the current value of the default catalog (which may be overridden
- * by the user).
- */
- static class DatabaseSchemaChoicesModel
- extends ConnectionProfileCollectionAspectAdapter<String>
- {
- private final PropertyValueModel<String> defaultCatalogModel;
- private final PropertyChangeListener catalogListener;
-
- DatabaseSchemaChoicesModel(
- PropertyValueModel<ConnectionProfile> connectionProfileModel,
- PropertyValueModel<String> defaultCatalogModel
- ) {
- super(connectionProfileModel);
- this.defaultCatalogModel = defaultCatalogModel;
- this.catalogListener = new CatalogListener();
- }
-
- /* class private */ class CatalogListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- DatabaseSchemaChoicesModel.this.catalogChanged();
- }
- }
-
- void catalogChanged() {
- this.aspectChanged();
- }
-
- @Override
- protected void engageSubject_() {
- super.engageSubject_();
- this.defaultCatalogModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.catalogListener);
- }
-
- @Override
- protected void disengageSubject_() {
- this.defaultCatalogModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.catalogListener);
- super.disengageSubject_();
- }
-
- @Override
- protected Iterable<String> getIterable() {
- SchemaContainer sc = this.getSchemaContainer();
- // use schema *identifiers* since the string ends up being the "default" for various text entries
- return (sc != null) ? sc.getSortedSchemaIdentifiers() : EmptyIterable.<String>instance();
- }
-
- private SchemaContainer getSchemaContainer() {
- return this.databaseSupportsCatalogs() ? this.getCatalog() : this.getDatabase();
- }
-
- private boolean databaseSupportsCatalogs() {
- Database db = this.getDatabase();
- return (db != null) && db.supportsCatalogs();
- }
-
- private Catalog getCatalog() {
- String name = this.defaultCatalogModel.getValue();
- // if we get here we know the database is not null
- return (name == null) ? null : this.getDatabase().getCatalogForIdentifier(name);
- }
-
- private Database getDatabase() {
- return this.subject.getDatabase();
- }
- }
-
-
- /**
- * Combine various models to determine the default catalog or schema.
- * If the user has checked the "Override Default" check-box, the default
- * is the JPA project's user override default, otherwise the default is
- * determined by the database.
- */
- static class DefaultModel
- extends CompositePropertyValueModel<String, Object>
- implements ModifiablePropertyValueModel<String>
- {
- private final PropertyValueModel<Boolean> userOverrideDefaultFlagModel;
- private final ModifiablePropertyValueModel<String> userOverrideDefaultModel;
- private final PropertyValueModel<String> databaseDefaultModel;
-
- @SuppressWarnings("unchecked")
- DefaultModel(
- PropertyValueModel<Boolean> userOverrideDefaultFlagModel,
- ModifiablePropertyValueModel<String> userOverrideDefaultModel,
- PropertyValueModel<String> databaseDefaultModel
- ) {
- super(userOverrideDefaultFlagModel, userOverrideDefaultModel, databaseDefaultModel);
- this.userOverrideDefaultFlagModel = userOverrideDefaultFlagModel;
- this.userOverrideDefaultModel = userOverrideDefaultModel;
- this.databaseDefaultModel = databaseDefaultModel;
- }
-
- /**
- * If the checkbox has been unchecked, we need to clear out the JPA
- * project's user override.
- */
- @Override
- protected void componentChanged(PropertyChangeEvent event) {
- super.componentChanged(event);
- if (event.getSource() == this.userOverrideDefaultFlagModel) {
- if ( ! this.userOverrideDefaultFlagIsSet()) {
- this.userOverrideDefaultModel.setValue(null);
- }
- }
- }
-
- /**
- * If the checkbox is checked, return the user override from the JPA project;
- * otherwise return the default from the database
- */
- @Override
- protected String buildValue() {
- return this.userOverrideDefaultFlagIsSet() ?
- this.userOverrideDefaultModel.getValue() :
- this.databaseDefaultModel.getValue();
- }
-
- /**
- * This will be called when the user makes a selection from the
- * drop-down; which is only possible when the checkbox is checked
- * (and the drop-down is enabled).
- */
- public void setValue(String value) {
- this.userOverrideDefaultModel.setValue(value);
- this.propertyChanged();
- }
-
- private boolean userOverrideDefaultFlagIsSet() {
- return flagIsSet(this.userOverrideDefaultFlagModel);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaPageManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaPageManager.java
deleted file mode 100644
index 920910ba33..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaPageManager.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.selection;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import org.eclipse.jpt.common.ui.internal.utility.PartAdapter2;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.AbstractTransformer;
-import org.eclipse.jpt.common.utility.internal.model.value.DoubleModifiablePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.DoublePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.selection.JpaEditorManager;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.jpt.jpa.ui.selection.JpaViewManager;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IPartListener2;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchPartReference;
-
-/**
- * Maintain:<ul>
- * <li>a collection of {@link JpaEditorManager JPA editor managers}
- * for the page's {@link IEditorPart editors}: The page manager creates
- * and disposes the editor managers. The editor manager is the <em>master</em>
- * part manager and holds the JPA file and JPA selection models that can be
- * used by the {@link #viewManagers view managers} and/or the page manager.
- * <li>a collection of {@link JpaViewManager JPA view managers}
- * for the page's JPA {@link IViewPart views}: The JPA views themselves create
- * and dispose the {@link #viewManagers view managers}.
- * </ul>
- * Forward the JPA selection to the active editor manager's JPA selection model,
- * which should notify the appropriate view managers etc.
- */
-class JpaPageManager
- implements JpaSelectionManager, JpaViewManager.PageManager
-{
- /**
- * The manager's parent window manager.
- */
- private final JpaWindowManager windowManager;
-
- /**
- * The manager's page.
- */
- private final IWorkbenchPage page;
-
- /**
- * Editor managers keyed by corresponding editor.
- * Lazily populated as managers are requested by
- * {@link #viewManagers view managers}.
- */
- private final HashMap<IEditorPart, JpaEditorManager> editorManagers = new HashMap<IEditorPart, JpaEditorManager>();
-
- /**
- * Model that holds the editor manager corresponding to the active editor.
- */
- private final SimplePropertyValueModel<JpaEditorManager> editorManagerModel = new SimplePropertyValueModel<JpaEditorManager>();
-
- /**
- * The page's current JPA file. This wraps the current editor manager's
- * JPA file model. It can be modified only by the editor manager.
- */
- private final PropertyValueModel<JpaFile> jpaFileModel;
-
- /**
- * The page's current JPA selection. This wraps the current editor manager's
- * JPA selection model. It can be modified by either the editor manager or
- * any view manager.
- */
- private final ModifiablePropertyValueModel<JpaStructureNode> jpaSelectionModel;
-
- /**
- * Listen to {@link #page} to maintain {@link #editorManagers}.
- */
- private final IPartListener2 partListener = new PartListener();
-
- /**
- * List of view managers for the page's JPA views.
- * This is maintained by the JPA views themselves.
- * It should be empty only immediately after construction
- * and immediately before disposal.
- */
- private final HashSet<JpaViewManager> viewManagers = new HashSet<JpaViewManager>();
-
- private volatile boolean disposed = false;
-
-
- JpaPageManager(JpaWindowManager windowManager, IWorkbenchPage page) {
- super();
- if (page == null) {
- throw new NullPointerException();
- }
- this.windowManager = windowManager;
- this.page = page;
- this.jpaFileModel = this.buildJpaFileModel();
- this.jpaSelectionModel = this.buildJpaSelectionModel();
- this.page.addPartListener(this.partListener);
- this.updateEditorManagerModel();
- }
-
-
- // ********** JPA file model **********
-
- public PropertyValueModel<JpaFile> getJpaFileModel() {
- return this.jpaFileModel;
- }
-
- private PropertyValueModel<JpaFile> buildJpaFileModel() {
- return new DoublePropertyValueModel<JpaFile>(this.buildEditorManagerJpaFileModel());
- }
-
- private PropertyValueModel<PropertyValueModel<JpaFile>> buildEditorManagerJpaFileModel() {
- return new TransformationPropertyValueModel<JpaEditorManager, PropertyValueModel<JpaFile>>(this.editorManagerModel, JPA_FILE_MODEL_TRANSFORMER);
- }
-
- private static final Transformer<JpaEditorManager, PropertyValueModel<JpaFile>> JPA_FILE_MODEL_TRANSFORMER = new JpaFileModelTransformer();
-
- /* CU private */ static class JpaFileModelTransformer
- extends AbstractTransformer<JpaEditorManager, PropertyValueModel<JpaFile>>
- {
- @Override
- public PropertyValueModel<JpaFile> transform_(JpaEditorManager editorManager) {
- return editorManager.getJpaFileModel();
- }
- }
-
-
- // ********** JPA selection model **********
-
- public ModifiablePropertyValueModel<JpaStructureNode> getJpaSelectionModel() {
- return this.jpaSelectionModel;
- }
-
- private ModifiablePropertyValueModel<JpaStructureNode> buildJpaSelectionModel() {
- return new DoubleModifiablePropertyValueModel<JpaStructureNode>(this.buildEditorManagerJpaSelectionModel());
- }
-
- private PropertyValueModel<ModifiablePropertyValueModel<JpaStructureNode>> buildEditorManagerJpaSelectionModel() {
- return new TransformationPropertyValueModel<JpaEditorManager, ModifiablePropertyValueModel<JpaStructureNode>>(this.editorManagerModel, JPA_SELECTION_MODEL_TRANSFORMER);
- }
-
- private static final Transformer<JpaEditorManager, ModifiablePropertyValueModel<JpaStructureNode>> JPA_SELECTION_MODEL_TRANSFORMER = new JpaSelectionModelTransformer();
-
- /* CU private */ static class JpaSelectionModelTransformer
- extends AbstractTransformer<JpaEditorManager, ModifiablePropertyValueModel<JpaStructureNode>>
- {
- @Override
- public ModifiablePropertyValueModel<JpaStructureNode> transform_(JpaEditorManager editorManager) {
- return editorManager.getJpaSelectionModel();
- }
- }
-
-
- // ********** selection **********
-
- /**
- * This should only be called from the
- * {@link #windowManager window manager}.
- */
- public void setSelection(JpaStructureNode selection) {
- this.jpaSelectionModel.setValue(selection);
- }
-
-
- // ********** editor managers **********
-
- public JpaEditorManager getEditorManager(IEditorPart editor) {
- return (editor == null) ? null : this.getEditorManager_(editor);
- }
-
- private synchronized JpaEditorManager getEditorManager_(IEditorPart editor) {
- JpaEditorManager editorManager = this.editorManagers.get(editor);
- if (editorManager == null) {
- editorManager = this.buildEditorManager(editor);
- if (editorManager != null) {
- JpaWorkbenchManager.debug("add editor manager:", editor); //$NON-NLS-1$
- this.editorManagers.put(editor, editorManager);
- }
- }
- return editorManager;
- }
-
- /**
- * <strong>NB:</strong> The editor manager is built once (when first
- * requested by a view manager) and not disposed until all the view
- * managers are removed from the page manager. As a result, the editor
- * manager is most likely driven by the class of the editor, as opposed
- * to the editor's content....
- */
- private JpaEditorManager buildEditorManager(IEditorPart editor) {
- return (JpaEditorManager) editor.getAdapter(JpaEditorManager.class);
- }
-
-
- // ********** view managers **********
-
- public synchronized void addViewManager(JpaViewManager viewManager) {
- JpaWorkbenchManager.debug("add view manager:", viewManager); //$NON-NLS-1$
- if (this.disposed) {
- // This can happen if the page manager's last view manager is removed
- // after a page manager was returned to a new view manager but before that
- // view manager adds itself to the page manager....
- throw new IllegalStateException("page manager is disposed: " + this); //$NON-NLS-1$
- }
- if ( ! this.viewManagers.add(viewManager)) {
- throw new IllegalArgumentException("duplicate view manager: " + viewManager); //$NON-NLS-1$
- }
- }
-
- public synchronized void removeViewManager(JpaViewManager viewManager) {
- JpaWorkbenchManager.debug("remove view manager:", viewManager); //$NON-NLS-1$
- if ( ! this.viewManagers.remove(viewManager)) {
- throw new IllegalArgumentException("missing view manager: " + viewManager); //$NON-NLS-1$
- }
- if (this.viewManagers.isEmpty()) {
- this.dispose();
- }
- }
-
-
- // ********** misc **********
-
- /**
- * When all the view managers are gone we get rid of the page manager.
- */
- private void dispose() {
- this.disposed = true;
- this.page.removePartListener(this.partListener);
- for (JpaEditorManager editorManager : this.editorManagers.values()) {
- editorManager.dispose();
- }
- this.windowManager.removePageManager(this.page);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.page);
- }
-
-
- // ********** part listener **********
-
- /**
- * Remove the corresponding editor manager whenever an editor is closed.
- */
- /* CU private */ class PartListener
- extends PartAdapter2
- {
- @Override
- public void partActivated(IWorkbenchPartReference partRef) {
- JpaPageManager.this.updateEditorManagerModel();
- }
-
- @Override
- public void partBroughtToTop(IWorkbenchPartReference partRef) {
- JpaPageManager.this.updateEditorManagerModel();
- }
-
- @Override
- public void partClosed(IWorkbenchPartReference partRef) {
- IWorkbenchPart part = partRef.getPart(false);
- if (part != null) {
- JpaPageManager.this.partClosed(part);
- }
- }
- }
-
- /* CU private */ synchronized void partClosed(IWorkbenchPart part) {
- JpaEditorManager editorManager = this.editorManagers.remove(part);
- if (editorManager != null) {
- JpaWorkbenchManager.debug("removed editor manager:", part); //$NON-NLS-1$
- editorManager.dispose();
- }
- this.updateEditorManagerModel();
- }
-
- /* CU private */ void updateEditorManagerModel() {
- this.editorManagerModel.setValue(this.getEditorManager(this.page.getActiveEditor()));
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaTextEditorManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaTextEditorManager.java
deleted file mode 100644
index 8f84711118..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaTextEditorManager.java
+++ /dev/null
@@ -1,336 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.selection;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jface.text.ITextSelection;
-import org.eclipse.jface.viewers.IPostSelectionProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jpt.common.core.utility.TextRange;
-import org.eclipse.jpt.common.ui.internal.jface.SelectionChangedAdapter;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.utility.PropertyAdapter;
-import org.eclipse.jpt.common.utility.internal.AbstractTransformer;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Transformer;
-import org.eclipse.jpt.common.utility.internal.model.value.DoublePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.TransformationPropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.JpaFileModel;
-import org.eclipse.jpt.jpa.ui.selection.JpaEditorManager;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IFileEditorInput;
-import org.eclipse.ui.IPropertyListener;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * JPA editor manager for a {@link ITextEditor text editor}.
- * <p>
- * If the JPA selection model changes, set the text editor's selection
- * accordingly. If the {@link #textEditor text editor}'s selection changes,
- * forward the corresponding JPA selection to the {@link #jpaSelectionModel
- * JPA selection model}.
- */
-class JpaTextEditorManager
- implements JpaEditorManager
-{
- /**
- * The manager's text editor
- */
- private final ITextEditor textEditor;
-
- /**
- * Listen for the {@link #textEditor text editor}'s input to change.
- * This can happen if the text editor is re-usable.
- */
- private final IPropertyListener textEditorInputListener = new TextEditorInputListener();
-
- /**
- * Listen for the {@link #textEditor text editor}'s selection to change.
- */
- private final ISelectionChangedListener textEditorSelectionListener = new TextEditorSelectionListener();
-
- private final ModifiablePropertyValueModel<IFile> fileModel = new SimplePropertyValueModel<IFile>();
-
- /**
- * We use the JPA file to calculate the JPA selection.
- * We update the JPA file model's file model whenever the text editor's
- * file changes.
- */
- private final PropertyValueModel<JpaFile> jpaFileModel;
-
- /**
- * Listen for the model or ourselves (via the file model) to change the
- * JPA file.
- */
- private final PropertyChangeListener jpaFileListener = new JpaFileListener();
-
- /**
- * We update the JPA selection model whenever the text editor's selection
- * changes.
- */
- private final ModifiablePropertyValueModel<JpaStructureNode> jpaSelectionModel = new SimplePropertyValueModel<JpaStructureNode>();
-
- /**
- * Listen for other views to change the JPA selection.
- */
- private final PropertyChangeListener jpaSelectionListener = new JpaSelectionListener();
-
-
- // ********** constructor **********
-
- /* CU private */ JpaTextEditorManager(ITextEditor textEditor) {
- super();
- this.textEditor = textEditor;
- this.textEditor.addPropertyListener(this.textEditorInputListener);
- this.getTextEditorSelectionProvider().addPostSelectionChangedListener(this.textEditorSelectionListener);
-
- this.jpaFileModel = this.buildJpaFileModel();
- this.jpaFileModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.jpaFileListener);
-
- this.jpaSelectionModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.jpaSelectionListener);
-
- // this will trigger a new JPA file
- // which will trigger us to set the JPA selection
- this.setFileModel();
- }
-
- /**
- * The <em>public</em> JPA selection model will not allow clients to set the
- * JPA selection to <code>null</code>. Only the editor manager can set the
- * selection to <code>null</code>. A client may set the JPA selection to
- * <code>null</code> when it does not have appropriate input. It is OK
- * for the <em>client's</em> JPA selection be <code>null</code>; but the
- * editor manager's JPA selection is the <em>master</em> JPA selection for
- * the workbench page/window and drives the JPA selection for potentially
- * multiple clients. As a result, clients can only modify the editor
- * manager's JPA selection to be some non-<code>null</code> value.
- */
-
- // ********** JPA file **********
-
- public PropertyValueModel<JpaFile> getJpaFileModel() {
- return this.jpaFileModel;
- }
-
- private PropertyValueModel<JpaFile> buildJpaFileModel() {
- return new DoublePropertyValueModel<JpaFile>(this.buildJpaFileModelModel());
- }
-
- private PropertyValueModel<PropertyValueModel<JpaFile>> buildJpaFileModelModel() {
- return new TransformationPropertyValueModel<IFile, PropertyValueModel<JpaFile>>(this.fileModel, JPA_FILE_MODEL_TRANSFORMER);
- }
-
- private static final Transformer<IFile, PropertyValueModel<JpaFile>> JPA_FILE_MODEL_TRANSFORMER = new JpaFileModelTransformer();
-
- /* CU private */ static class JpaFileModelTransformer
- extends AbstractTransformer<IFile, PropertyValueModel<JpaFile>>
- {
- @Override
- protected PropertyValueModel<JpaFile> transform_(IFile file) {
- return (JpaFileModel) file.getAdapter(JpaFileModel.class);
- }
- }
-
- /* CU private */ class JpaFileListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- JpaTextEditorManager.this.jpaFileChanged();
- }
- }
-
- /**
- * Dispatch to the UI thread.
- */
- /* CU private */ void jpaFileChanged() {
- this.execute(new JpaFileChangedRunnable());
- }
-
- /* CU private */ class JpaFileChangedRunnable
- implements Runnable
- {
- public void run() {
- JpaTextEditorManager.this.jpaFileChanged_();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- /**
- * Pre-condition: executing on the UI thread.
- */
- /* CU private */ void jpaFileChanged_() {
- this.jpaSelectionModel.setValue(this.getTextEditorJpaSelection());
- }
-
-
- // ********** JPA selection **********
-
- public ModifiablePropertyValueModel<JpaStructureNode> getJpaSelectionModel() {
- return this.jpaSelectionModel;
- }
-
- /* CU private */ class JpaSelectionListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- JpaTextEditorManager.this.setTextEditorJpaSelection((JpaStructureNode) event.getNewValue());
- }
- }
-
- /* CU private */ void setJpaSelection(ISelection selection) {
- this.jpaSelectionModel.setValue(this.getTextEditorJpaSelection(selection));
- }
-
-
- // ********** text editor selection **********
-
- /* CU private */ class TextEditorSelectionListener
- extends SelectionChangedAdapter
- {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- JpaTextEditorManager.this.setJpaSelection(event.getSelection());
- }
- }
-
- /**
- * Dispatch to the UI thread.
- */
- /* CU private */ void setTextEditorJpaSelection(JpaStructureNode selection) {
- this.execute(new SetTextEditorSelectionRunnable(selection));
- }
-
- /* CU private */ class SetTextEditorSelectionRunnable
- implements Runnable
- {
- private final JpaStructureNode selection;
-
- SetTextEditorSelectionRunnable(JpaStructureNode selection) {
- super();
- this.selection = selection;
- }
-
- public void run() {
- JpaTextEditorManager.this.setTextEditorJpaSelection_(this.selection);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.selection);
- }
- }
-
- /**
- * Pre-condition: executing on the UI thread.
- * If the new JPA selection is not <code>null</code> and it is different
- * from the text editor's current JPA selection, modify the text editor's
- * selection.
- */
- /* CU private */ void setTextEditorJpaSelection_(JpaStructureNode selection) {
- if ((selection != null) && (selection != this.getTextEditorJpaSelection())) {
- this.setTextEditorSelection(selection.getSelectionTextRange());
- }
- }
-
- private void setTextEditorSelection(TextRange textRange) {
- if (textRange != null) {
- // no need for a disposed check...
- this.textEditor.selectAndReveal(textRange.getOffset(), textRange.getLength());
- }
- }
-
- /**
- * Return the JPA selection corresponding to the text editor's current
- * selection.
- * Pre-condition: executing on the UI thread.
- */
- private JpaStructureNode getTextEditorJpaSelection() {
- // the selection provider can be null if the text editor was disposed
- // before we get a chance to [asynchronously] handle the event
- IPostSelectionProvider selProvider = this.getTextEditorSelectionProvider();
- return (selProvider == null) ? null : this.getTextEditorJpaSelection(selProvider.getSelection());
- }
-
- private JpaStructureNode getTextEditorJpaSelection(ISelection selection) {
- return (selection instanceof ITextSelection) ? this.getTextEditorJpaSelection((ITextSelection) selection) : null;
- }
-
- private JpaStructureNode getTextEditorJpaSelection(ITextSelection selection) {
- JpaFile jpaFile = this.jpaFileModel.getValue();
- return (jpaFile == null) ? null : jpaFile.getStructureNode(selection.getOffset());
- }
-
-
- // ********** text editor input **********
-
- /* CU private */ class TextEditorInputListener
- extends PropertyAdapter
- {
- @Override
- public void propertyChanged(Object source, int propertyID) {
- if (propertyID == IEditorPart.PROP_INPUT) {
- JpaTextEditorManager.this.setFileModel();
- }
- }
- }
-
-
- // ********** misc **********
-
- public IEditorPart getEditor() {
- return this.textEditor;
- }
-
- /* CU private */ void setFileModel() {
- this.fileModel.setValue(this.getTextEditorFile());
- }
-
- private IFile getTextEditorFile() {
- IEditorInput input = this.textEditor.getEditorInput();
- return (input instanceof IFileEditorInput) ? ((IFileEditorInput) input).getFile() : null;
- }
-
- private IPostSelectionProvider getTextEditorSelectionProvider() {
- return (IPostSelectionProvider) this.textEditor.getSelectionProvider();
- }
-
- private void execute(Runnable runnable) {
- SWTUtil.execute(this.textEditor.getSite().getShell().getDisplay(), runnable);
- }
-
- public void dispose() {
- this.jpaFileModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.jpaFileListener);
- this.jpaSelectionModel.removePropertyChangeListener(PropertyValueModel.VALUE, this.jpaSelectionListener);
- this.getTextEditorSelectionProvider().removePostSelectionChangedListener(this.textEditorSelectionListener);
- this.textEditor.removePropertyListener(this.textEditorInputListener);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.textEditor);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaWindowManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaWindowManager.java
deleted file mode 100644
index 813eb87f43..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaWindowManager.java
+++ /dev/null
@@ -1,126 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.selection;
-
-import java.util.Hashtable;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Maintain a collection of
- * {@link JpaSelectionManager JPA selection managers}
- * keyed by {@link IWorkbenchPage workbench page}.
- * Forward the selection to the manager for the active page.
- */
-class JpaWindowManager
- implements JpaSelectionManager
-{
- /**
- * The manager's parent workbench manager.
- */
- private final JpaWorkbenchManager workbenchManager;
-
- /**
- * The manager's window.
- */
- private final IWorkbenchWindow window;
-
- /**
- * Map workbench pages to JPA workbench page selection managers.
- * This is lazily populated and cleaned up by
- * the page managers themselves.
- */
- private final Hashtable<IWorkbenchPage, JpaPageManager> pageManagers = new Hashtable<IWorkbenchPage, JpaPageManager>();
-
-
- JpaWindowManager(JpaWorkbenchManager workbenchManager, IWorkbenchWindow window) {
- super();
- if (window == null) {
- throw new NullPointerException();
- }
- this.workbenchManager = workbenchManager;
- this.window = window;
- }
-
-
- // ********** selection **********
-
- /**
- * Forward to the manager for the window's active page.
- */
- public void setSelection(JpaStructureNode selection) {
- this.getPageManager(this.window.getActivePage()).setSelection(selection);
- }
-
-
- // ********** page managers **********
-
- /**
- * Return the JPA selection manager for the specified
- * workbench page.
- */
- private JpaSelectionManager getPageManager(IWorkbenchPage page) {
- return (page == null) ?
- JpaSelectionManager.Null.instance() :
- this.getPageManager_(page);
- }
-
- private JpaSelectionManager getPageManager_(IWorkbenchPage page) {
- JpaPageManager manager = this.pageManagers.get(page);
- return (manager == null) ?
- JpaSelectionManager.Null.instance() :
- manager;
- }
-
- /**
- * <strong>NB:</strong> May trigger construction of page manager.
- */
- JpaPageManager getPageManager(IViewPart view) {
- IWorkbenchPage page = view.getSite().getPage();
- synchronized (this.pageManagers) {
- JpaPageManager manager = this.pageManagers.get(page);
- if (manager == null) {
- JpaWorkbenchManager.debug("add page manager:", page); //$NON-NLS-1$
- manager = new JpaPageManager(this, page);
- this.pageManagers.put(page, manager);
- }
- return manager;
- }
- }
-
- /**
- * @see JpaPageManager#dispose()
- */
- void removePageManager(IWorkbenchPage page) {
- synchronized (this.pageManagers) {
- JpaWorkbenchManager.debug("remove page manager:", page); //$NON-NLS-1$
- this.pageManagers.remove(page);
- if (this.pageManagers.isEmpty()) {
- this.dispose();
- }
- }
- }
-
-
- // ********** misc **********
-
- private void dispose() {
- this.workbenchManager.removeWindowManager(this.window);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.window);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaWorkbenchManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaWorkbenchManager.java
deleted file mode 100644
index 804ccadb6e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/JpaWorkbenchManager.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.selection;
-
-import java.text.DateFormat;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.Hashtable;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.jpt.jpa.ui.selection.JpaViewManager;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Maintain a collection of
- * {@link JpaSelectionManager JPA selection managers}
- * keyed by {@link IWorkbenchWindow workbench window}.
- * Forward the selection to the manager for the active window.
- *
- * @see WorkbenchWindowAdapterFactory
- */
-class JpaWorkbenchManager
- implements JpaSelectionManager
-{
- /**
- * The manager's workbench.
- */
- private final IWorkbench workbench;
-
- /**
- * Map workbench windows to JPA managers.
- * This is lazily populated and cleaned up as necessary.
- */
- private final Hashtable<IWorkbenchWindow, JpaWindowManager> windowManagers = new Hashtable<IWorkbenchWindow, JpaWindowManager>();
-
-
- /**
- * @see #forWorkbench(IWorkbench)
- * @see #getPageManager(IViewPart)
- */
- private JpaWorkbenchManager(IWorkbench workbench) {
- super();
- this.workbench = workbench;
- }
-
-
- // ********** selection **********
-
- /**
- * Forward to the manager for the workbench's active window.
- */
- public void setSelection(JpaStructureNode selection) {
- this.getWindowManager(this.workbench.getActiveWorkbenchWindow()).setSelection(selection);
- }
-
-
- // ********** window managers **********
-
- /**
- * Return the JPA selection manager for the specified
- * workbench window. Return a "null" manager if the specified window
- * is <code>null</code> or contains no JPA views.
- *
- * @see #getPageManager_(IViewPart)
- */
- private JpaSelectionManager getWindowManager(IWorkbenchWindow window) {
- return (window == null) ?
- JpaSelectionManager.Null.instance() :
- this.getWindowManager_(window);
- }
-
- private JpaSelectionManager getWindowManager_(IWorkbenchWindow window) {
- JpaWindowManager manager = this.windowManagers.get(window);
- return (manager != null) ? manager : JpaSelectionManager.Null.instance();
- }
-
- /**
- * Return the page manager for the specified view.
- * Construct a new manager for the view's window and page if necessary.
- *
- * @see #getWindowManager(IWorkbenchWindow)
- */
- private JpaViewManager.PageManager getPageManager_(IViewPart view) {
- return this.getWindowManager(view).getPageManager(view);
- }
-
- /**
- * <strong>NB:</strong> May trigger construction of window manager.
- */
- private JpaWindowManager getWindowManager(IViewPart view) {
- IWorkbenchWindow window = view.getSite().getWorkbenchWindow();
- synchronized (this.windowManagers) {
- JpaWindowManager manager = this.windowManagers.get(window);
- if (manager == null) {
- debug("add window manager:", window); //$NON-NLS-1$
- manager = new JpaWindowManager(this, window);
- this.windowManagers.put(window, manager);
- }
- return manager;
- }
- }
-
- /**
- * @see JpaWindowManager#dispose()
- */
- void removeWindowManager(IWorkbenchWindow window) {
- synchronized (this.windowManagers) {
- debug("remove window manager:", window); //$NON-NLS-1$
- this.windowManagers.remove(window);
- if (this.windowManagers.isEmpty()) {
- this.dispose();
- }
- }
- }
-
-
- // ********** misc **********
-
- private void dispose() {
- debug("remove workbench manager:", this.workbench); //$NON-NLS-1$
- WORKBENCH_MANAGERS.remove(this.workbench);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.workbench);
- }
-
-
- // ********** static cache **********
-
- /**
- * Probably only a single manager in this cache....
- */
- private static final Hashtable<IWorkbench, JpaWorkbenchManager> WORKBENCH_MANAGERS = new Hashtable<IWorkbench, JpaWorkbenchManager>();
-
- /**
- * Return a <em>null</em> manager if a manager does not exist.
- * @see WorkbenchAdapterFactory
- */
- static JpaSelectionManager forWorkbench(IWorkbench workbench) {
- return (workbench == null) ?
- JpaSelectionManager.Null.instance() :
- forWorkbench_(workbench);
- }
-
- private static JpaSelectionManager forWorkbench_(IWorkbench workbench) {
- JpaWorkbenchManager manager = WORKBENCH_MANAGERS.get(workbench);
- return (manager != null) ? manager : JpaSelectionManager.Null.instance();
- }
-
- /**
- * Return a <em>null</em> manager if a manager does not exist.
- * @see WorkbenchWindowAdapterFactory
- */
- static JpaSelectionManager forWindow(IWorkbenchWindow window) {
- return (window == null) ?
- JpaSelectionManager.Null.instance() :
- forWindow_(window);
- }
-
- private static JpaSelectionManager forWindow_(IWorkbenchWindow window) {
- JpaWorkbenchManager manager = WORKBENCH_MANAGERS.get(window.getWorkbench());
- return (manager == null) ?
- JpaSelectionManager.Null.instance() :
- manager.getWindowManager_(window);
- }
-
- /**
- * Construct a new manager if a manager does not exist.
- * @see ViewPartAdapterFactory
- */
- static JpaViewManager.PageManager getPageManager(IViewPart view) {
- if (view == null) {
- throw new NullPointerException();
- }
- return getWorkbenchManager(view).getPageManager_(view);
- }
-
- /**
- * <strong>NB:</strong> May trigger construction of workbench manager.
- */
- private static JpaWorkbenchManager getWorkbenchManager(IViewPart view) {
- IWorkbench workbench = view.getSite().getWorkbenchWindow().getWorkbench();
- synchronized (WORKBENCH_MANAGERS) {
- JpaWorkbenchManager manager = WORKBENCH_MANAGERS.get(workbench);
- if (manager == null) {
- debug("add workbench manager:", workbench); //$NON-NLS-1$
- manager = new JpaWorkbenchManager(workbench);
- WORKBENCH_MANAGERS.put(workbench, manager);
- }
- return manager;
- }
- }
-
-
- // ********** DEBUG **********
-
- private static final boolean DEBUG = false;
-
- static void debug(String message) {
- debug(message, null);
- }
-
- static void debug(String message, Object object) {
- debug(message, object, null);
- }
-
- static void debug(String message, Object object, Object additionalInfo) {
- if (DEBUG) {
- // lock System.out so the strings are printed out contiguously
- synchronized (System.out) {
- debug_(message, object, additionalInfo);
- }
- }
- }
-
- private static void debug_(String message, Object object, Object additionalInfo) {
- System.out.print(buildTimestamp());
- System.out.print(" "); //$NON-NLS-1$
- System.out.print(Thread.currentThread().getName());
- System.out.print(": "); //$NON-NLS-1$
- System.out.print(message);
- if (object != null) {
- System.out.print(" "); //$NON-NLS-1$
- System.out.print(object);
- if (additionalInfo != null) {
- System.out.print(" ("); //$NON-NLS-1$
- System.out.print(additionalInfo);
- System.out.print(")"); //$NON-NLS-1$
- }
- }
- System.out.println();
- }
-
- private static synchronized String buildTimestamp() {
- return DATE_FORMAT.format(new Date());
- }
- private static final String DATE_FORMAT_PATTERN = "yyyy.MM.dd HH:mm:ss.SSS"; //$NON-NLS-1$
- private static final DateFormat DATE_FORMAT = new SimpleDateFormat(DATE_FORMAT_PATTERN);
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/TextEditorAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/TextEditorAdapterFactory.java
deleted file mode 100644
index 789308a2c5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/TextEditorAdapterFactory.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.selection;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.jpa.ui.selection.JpaEditorManager;
-import org.eclipse.ui.texteditor.ITextEditor;
-
-/**
- * Factory to build JPA selection adapters for a {@link ITextEditor}:<ul>
- * <li>{@link org.eclipse.jpt.jpa.ui.selection.JpaEditorManager}
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class TextEditorAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JpaEditorManager.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof ITextEditor) {
- return this.getAdapter((ITextEditor) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(ITextEditor editor, Class<?> adapterType) {
- if (adapterType == JpaEditorManager.class) {
- return this.buildJpaTextEditorManager(editor);
- }
- return null;
- }
-
- private JpaEditorManager buildJpaTextEditorManager(ITextEditor editor) {
- return new JpaTextEditorManager(editor);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/ViewPartAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/ViewPartAdapterFactory.java
deleted file mode 100644
index 4901832937..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/ViewPartAdapterFactory.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.selection;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.jpa.ui.selection.JpaViewManager;
-import org.eclipse.ui.IViewPart;
-
-/**
- * Factory to build JPA selection adapters for a {@link IViewPart}:<ul>
- * <li>{@link org.eclipse.jpt.jpa.ui.selection.JpaViewManager.PageManager}
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class ViewPartAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JpaViewManager.PageManager.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IViewPart) {
- return this.getAdapter((IViewPart) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IViewPart view, Class<?> adapterType) {
- if (adapterType == JpaViewManager.PageManager.class) {
- return this.getPageManager(view);
- }
- return null;
- }
-
- /**
- * This will trigger the creation of the appropriate page manager if it does
- * not already exist.
- */
- private JpaViewManager.PageManager getPageManager(IViewPart view) {
- return JpaWorkbenchManager.getPageManager(view);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/WorkbenchAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/WorkbenchAdapterFactory.java
deleted file mode 100644
index 66cbca6d5c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/WorkbenchAdapterFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.selection;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.IWorkbench;
-
-/**
- * Factory to build JPA selection adapters for a {@link IWorkbench}:<ul>
- * <li>{@link JpaSelectionManager}
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- *
- * @see JpaWorkbenchManager
- */
-public class WorkbenchAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JpaSelectionManager.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IWorkbench) {
- return this.getAdapter((IWorkbench) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IWorkbench workbench, Class<?> adapterType) {
- if (adapterType == JpaSelectionManager.class) {
- return this.getJpaSelectionManager(workbench);
- }
- return null;
- }
-
- /**
- * Never return <code>null</code>.
- */
- private JpaSelectionManager getJpaSelectionManager(IWorkbench workbench) {
- return JpaWorkbenchManager.forWorkbench(workbench);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/WorkbenchWindowAdapterFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/WorkbenchWindowAdapterFactory.java
deleted file mode 100644
index 9a7f125703..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/selection/WorkbenchWindowAdapterFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.selection;
-
-import org.eclipse.core.runtime.IAdapterFactory;
-import org.eclipse.jpt.jpa.ui.selection.JpaSelectionManager;
-import org.eclipse.ui.IWorkbenchWindow;
-
-/**
- * Factory to build JPA selection adapters for a {@link IWorkbenchWindow}:<ul>
- * <li>{@link JpaSelectionManager}
- * </ul>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- *
- * @see JpaWorkbenchManager
- */
-public class WorkbenchWindowAdapterFactory
- implements IAdapterFactory
-{
- private static final Class<?>[] ADAPTER_LIST = new Class[] { JpaSelectionManager.class };
-
- public Class<?>[] getAdapterList() {
- return ADAPTER_LIST;
- }
-
- public Object getAdapter(Object adaptableObject, @SuppressWarnings("rawtypes") Class adapterType) {
- if (adaptableObject instanceof IWorkbenchWindow) {
- return this.getAdapter((IWorkbenchWindow) adaptableObject, adapterType);
- }
- return null;
- }
-
- private Object getAdapter(IWorkbenchWindow workbenchWindow, Class<?> adapterType) {
- if (adapterType == JpaSelectionManager.class) {
- return this.getJpaSelectionManager(workbenchWindow);
- }
- return null;
- }
-
- /**
- * Never return <code>null</code>.
- */
- private JpaSelectionManager getJpaSelectionManager(IWorkbenchWindow workbenchWindow) {
- return JpaWorkbenchManager.forWindow(workbenchWindow);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/EntityMappingsItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/EntityMappingsItemContentProvider.java
deleted file mode 100644
index 13d494741d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/EntityMappingsItemContentProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-
-public class EntityMappingsItemContentProvider
- extends AbstractItemTreeContentProvider<EntityMappings, OrmPersistentType>
-{
- public EntityMappingsItemContentProvider(EntityMappings entityMappings, Manager manager) {
- super(entityMappings, manager);
- }
-
- public Object getParent() {
- // I'd like to return the resource model here, but that involves a hefty
- // API change - we'll see what happens with this code first
- return null;
- }
-
- @Override
- protected CollectionValueModel<OrmPersistentType> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<OrmPersistentType>(new ChildrenModel(this.item));
- }
-
- protected static class ChildrenModel
- extends ListAspectAdapter<EntityMappings, OrmPersistentType>
- {
- ChildrenModel(EntityMappings entityMappings) {
- super(EntityMappings.PERSISTENT_TYPES_LIST, entityMappings);
- }
-
- @Override
- protected ListIterable<OrmPersistentType> getListIterable() {
- return this.subject.getPersistentTypes();
- }
-
- @Override
- public int size_() {
- return this.subject.getPersistentTypesSize();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemContentProviderFactory.java
deleted file mode 100644
index 69a03e3888..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemContentProviderFactory.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.JavaPersistentTypeItemContentProvider;
-
-/**
- * This factory builds item content providers for a Java source file
- * JPA Structure View.
- */
-public class JavaStructureItemContentProviderFactory
- implements ItemTreeContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new JavaStructureItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected JavaStructureItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof JpaFile) {
- return this.buildJpaFileProvider((JpaFile) item, manager);
- }
- if (item instanceof JavaPersistentType) {
- return this.buildJavaPersistentTypeProvider((JavaPersistentType) item, manager);
- }
- if (item instanceof JavaPersistentAttribute) {
- return this.buildJavaPersistentAttributeProvider((JavaPersistentAttribute) item, manager);
- }
- return null;
- }
-
- protected ItemTreeContentProvider buildJpaFileProvider(JpaFile item, Manager manager) {
- return new JpaFileItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildJavaPersistentTypeProvider(JavaPersistentType item, Manager manager) {
- return new JavaPersistentTypeItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildJavaPersistentAttributeProvider(JavaPersistentAttribute item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getParent());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemLabelProviderFactory.java
deleted file mode 100644
index afd851dd07..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JavaStructureItemLabelProviderFactory.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-
-/**
- * This factory builds item label providers for a Java source file
- * JPA Structure View.
- */
-public class JavaStructureItemLabelProviderFactory
- extends MappingStructureItemLabelProviderFactory
-{
- // singleton
- private static final ItemExtendedLabelProviderFactory INSTANCE = new JavaStructureItemLabelProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemExtendedLabelProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected JavaStructureItemLabelProviderFactory() {
- super();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaFileItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaFileItemContentProvider.java
deleted file mode 100644
index 52947eca67..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/JpaFileItemContentProvider.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-
-public class JpaFileItemContentProvider
- extends AbstractItemTreeContentProvider<JpaFile, JpaStructureNode>
-{
- public JpaFileItemContentProvider(JpaFile jpaFile, Manager manager) {
- super(jpaFile, manager);
- }
-
- public Object getParent() {
- return null;
- }
-
- @Override
- protected CollectionValueModel<JpaStructureNode> buildChildrenModel() {
- return new ChildrenModel(this.item);
- }
-
- public static class ChildrenModel
- extends CollectionAspectAdapter<JpaFile, JpaStructureNode>
- {
- public ChildrenModel(JpaFile jpaFile) {
- super(JpaFile.ROOT_STRUCTURE_NODES_COLLECTION, jpaFile);
- }
-
- @Override
- protected Iterable<JpaStructureNode> getIterable() {
- return this.subject.getRootStructureNodes();
- }
-
- @Override
- public int size_() {
- return this.subject.getRootStructureNodesSize();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/MappingStructureItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/MappingStructureItemLabelProviderFactory.java
deleted file mode 100644
index 856807d598..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/MappingStructureItemLabelProviderFactory.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.PersistentAttributeItemLabelProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.PersistentTypeItemLabelProvider;
-
-/**
- * This factory builds item label providers for the persistent types and
- * attributes in a JPA Structure View.
- */
-public abstract class MappingStructureItemLabelProviderFactory
- implements ItemExtendedLabelProviderFactory
-{
- protected MappingStructureItemLabelProviderFactory() {
- super();
- }
-
- public ItemExtendedLabelProvider buildProvider(Object item, ItemExtendedLabelProvider.Manager manager) {
- if (item instanceof PersistentType) {
- return this.buildPersistentTypeProvider((PersistentType) item, manager);
- }
- if (item instanceof ReadOnlyPersistentAttribute) {
- return this.buildPersistentAttributeProvider((ReadOnlyPersistentAttribute) item, manager);
- }
- return null;
- }
-
- protected ItemExtendedLabelProvider buildPersistentTypeProvider(PersistentType item, ItemExtendedLabelProvider.Manager manager) {
- return new PersistentTypeItemLabelProvider(item, manager);
- }
-
- protected ItemExtendedLabelProvider buildPersistentAttributeProvider(ReadOnlyPersistentAttribute item, ItemExtendedLabelProvider.Manager manager) {
- return new PersistentAttributeItemLabelProvider(item, manager);
- }
-
- @Override
- public String toString() {
- return StringTools.buildSingletonToString(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemContentProviderFactory.java
deleted file mode 100644
index ca79e13441..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemContentProviderFactory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.OrmPersistentTypeItemContentProvider;
-
-/**
- * This factory builds item content providers for an <code>orm.xml</code> file
- * JPA Structure View.
- */
-public class OrmStructureItemContentProviderFactory
- implements ItemTreeContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new OrmStructureItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected OrmStructureItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof JpaFile) {
- return this.buildJpaFileProvider((JpaFile) item, manager);
- }
- if (item instanceof EntityMappings) {
- return this.buildEntityMappingsProvider((EntityMappings) item, manager);
- }
- if (item instanceof OrmPersistentType) {
- return this.buildOrmPersistentTypeProvider((OrmPersistentType) item, manager);
- }
- if (item instanceof OrmPersistentAttribute) {
- return this.buildOrmPersistentAttributeProvider((OrmPersistentAttribute) item, manager);
- }
- return null;
- }
-
- protected ItemTreeContentProvider buildJpaFileProvider(JpaFile item, Manager manager) {
- return new JpaFileItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildEntityMappingsProvider(EntityMappings item, Manager manager) {
- return new EntityMappingsItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildOrmPersistentTypeProvider(OrmPersistentType item, Manager manager) {
- return new OrmPersistentTypeItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildOrmPersistentAttributeProvider(OrmPersistentAttribute item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getParent());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemLabelProviderFactory.java
deleted file mode 100644
index 4b22ce324a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/OrmStructureItemLabelProviderFactory.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-
-/**
- * This factory builds item label providers for an <code>orm.xml</code> file
- * JPA Structure View.
- */
-public class OrmStructureItemLabelProviderFactory
- extends MappingStructureItemLabelProviderFactory
-{
- // singleton
- private static final ItemExtendedLabelProviderFactory INSTANCE = new OrmStructureItemLabelProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemExtendedLabelProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected OrmStructureItemLabelProviderFactory() {
- super();
- }
-
- @Override
- public ItemExtendedLabelProvider buildProvider(Object item, ItemExtendedLabelProvider.Manager manager) {
- if (item instanceof EntityMappings) {
- return this.buildEntityMappingsProvider((EntityMappings) item, manager);
- }
- return super.buildProvider(item, manager);
- }
-
- protected ItemExtendedLabelProvider buildEntityMappingsProvider(EntityMappings entityMappings, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
- return new StaticItemExtendedLabelProvider(
- JptJpaUiPlugin.getImage(JptUiIcons.ENTITY_MAPPINGS),
- JptUiMessages.OrmItemLabelProviderFactory_entityMappingsLabel,
- this.buildEntityMappingsDescription(entityMappings)
- );
- }
-
- protected String buildEntityMappingsDescription(EntityMappings entityMappings) {
- StringBuilder sb = new StringBuilder();
- sb.append(JptUiMessages.OrmItemLabelProviderFactory_entityMappingsLabel);
- sb.append(" - "); //$NON-NLS-1$
- sb.append(entityMappings.getResource().getFullPath().makeRelative());
- return sb.toString();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceItemContentProvider.java
deleted file mode 100644
index 3aff0fd408..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceItemContentProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-
-public class PersistenceItemContentProvider
- extends AbstractItemTreeContentProvider<Persistence, PersistenceUnit>
-{
- public PersistenceItemContentProvider(Persistence persistence, Manager manager) {
- super(persistence, manager);
- }
-
- public Object getParent() {
- // I'd like to return the resource model here, but that involves a hefty
- // API change - we'll see what happens with this code first
- return null;
- }
-
- @Override
- protected CollectionValueModel<PersistenceUnit> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<PersistenceUnit>(new ChildrenModel(this.item));
- }
-
- protected static class ChildrenModel
- extends ListAspectAdapter<Persistence, PersistenceUnit>
- {
- ChildrenModel(Persistence persistence) {
- super(Persistence.PERSISTENCE_UNITS_LIST, persistence);
- }
-
- @Override
- protected ListIterable<PersistenceUnit> getListIterable() {
- return this.subject.getPersistenceUnits();
- }
-
- @Override
- public int size_() {
- return this.subject.getPersistenceUnitsSize();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemContentProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemContentProviderFactory.java
deleted file mode 100644
index 1a35f06fa5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemContentProviderFactory.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProvider.Manager;
-import org.eclipse.jpt.common.ui.jface.ItemTreeContentProviderFactory;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.PersistenceUnitItemContentProvider;
-
-/**
- * This factory builds item content providers for a <code>persistence.xml</code>
- * file JPA Structure View.
- */
-public class PersistenceStructureItemContentProviderFactory
- implements ItemTreeContentProviderFactory
-{
- // singleton
- private static final ItemTreeContentProviderFactory INSTANCE = new PersistenceStructureItemContentProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemTreeContentProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected PersistenceStructureItemContentProviderFactory() {
- super();
- }
-
- public ItemTreeContentProvider buildProvider(Object item, ItemTreeContentProvider.Manager manager) {
- if (item instanceof JpaFile) {
- return this.buildJpaFileProvider((JpaFile) item, manager);
- }
- if (item instanceof Persistence) {
- return this.buildPersistenceProvider((Persistence) item, manager);
- }
- if (item instanceof PersistenceUnit) {
- return this.buildPersistenceUnitProvider((PersistenceUnit) item, manager);
- }
- if (item instanceof MappingFileRef) {
- return this.buildMappingFileRefProvider((MappingFileRef) item, manager);
- }
- if (item instanceof ClassRef) {
- return this.buildClassRefProvider((ClassRef) item, manager);
- }
- if (item instanceof JarFileRef) {
- return this.buildJarFileRefProvider((JarFileRef) item, manager);
- }
- return null;
- }
-
- protected ItemTreeContentProvider buildJpaFileProvider(JpaFile item, Manager manager) {
- return new JpaFileItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildPersistenceProvider(Persistence item, Manager manager) {
- return new PersistenceItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildPersistenceUnitProvider(PersistenceUnit item, Manager manager) {
- return new PersistenceUnitItemContentProvider(item, manager);
- }
-
- protected ItemTreeContentProvider buildMappingFileRefProvider(MappingFileRef item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getPersistenceUnit());
- }
-
- protected ItemTreeContentProvider buildClassRefProvider(ClassRef item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getPersistenceUnit());
- }
-
- protected ItemTreeContentProvider buildJarFileRefProvider(JarFileRef item, @SuppressWarnings("unused") Manager manager) {
- return new StaticItemTreeContentProvider(item.getPersistenceUnit());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemLabelProviderFactory.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemLabelProviderFactory.java
deleted file mode 100644
index 3200f1e098..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceStructureItemLabelProviderFactory.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import org.eclipse.jpt.common.ui.internal.jface.StaticItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProvider;
-import org.eclipse.jpt.common.ui.jface.ItemExtendedLabelProviderFactory;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.ClassRefItemLabelProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.JarFileRefItemLabelProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.MappingFileRefItemLabelProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.PersistenceUnitItemLabelProvider;
-
-/**
- * This factory builds item label providers for a <code>persistence.xml</code> file
- * JPA Structure View.
- */
-public class PersistenceStructureItemLabelProviderFactory
- implements ItemExtendedLabelProviderFactory
-{
- // singleton
- private static final ItemExtendedLabelProviderFactory INSTANCE = new PersistenceStructureItemLabelProviderFactory();
-
- /**
- * Return the singleton
- */
- public static ItemExtendedLabelProviderFactory instance() {
- return INSTANCE;
- }
-
-
- protected PersistenceStructureItemLabelProviderFactory() {
- super();
- }
-
- public ItemExtendedLabelProvider buildProvider(Object item, ItemExtendedLabelProvider.Manager manager) {
- if (item instanceof Persistence) {
- return this.buildPersistenceProvider((Persistence) item, manager);
- }
- if (item instanceof PersistenceUnit) {
- return this.buildPersistenceUnitProvider((PersistenceUnit) item, manager);
- }
- if (item instanceof MappingFileRef) {
- return this.buildMappingFileRefProvider((MappingFileRef) item, manager);
- }
- if (item instanceof ClassRef) {
- return this.buildClassRefProvider((ClassRef) item, manager);
- }
- if (item instanceof JarFileRef) {
- return this.buildJarFileRefProvider((JarFileRef) item, manager);
- }
- return null;
- }
-
- protected ItemExtendedLabelProvider buildPersistenceProvider(Persistence item, @SuppressWarnings("unused") ItemExtendedLabelProvider.Manager manager) {
- return new StaticItemExtendedLabelProvider(
- JptJpaUiPlugin.getImage(JptUiIcons.PERSISTENCE),
- JptUiMessages.PersistenceItemLabelProviderFactory_persistenceLabel,
- this.buildPersistenceDescription(item)
- );
- }
-
- protected String buildPersistenceDescription(Persistence item) {
- StringBuilder sb = new StringBuilder();
- sb.append(JptUiMessages.PersistenceItemLabelProviderFactory_persistenceLabel);
- sb.append(" - "); //$NON-NLS-1$
- sb.append(item.getResource().getFullPath().makeRelative());
- return sb.toString();
- }
-
- protected ItemExtendedLabelProvider buildPersistenceUnitProvider(PersistenceUnit item, ItemExtendedLabelProvider.Manager manager) {
- return new PersistenceUnitItemLabelProvider(item, manager);
- }
-
- protected ItemExtendedLabelProvider buildMappingFileRefProvider(MappingFileRef item, ItemExtendedLabelProvider.Manager manager) {
- return new MappingFileRefItemLabelProvider(item, manager);
- }
-
- protected ItemExtendedLabelProvider buildClassRefProvider(ClassRef item, ItemExtendedLabelProvider.Manager manager) {
- return new ClassRefItemLabelProvider(item, manager);
- }
-
- protected ItemExtendedLabelProvider buildJarFileRefProvider(JarFileRef item, ItemExtendedLabelProvider.Manager manager) {
- return new JarFileRefItemLabelProvider(item, manager);
- }
-
- @Override
- public String toString() {
- return StringTools.buildSingletonToString(this);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceUnitItemContentProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceUnitItemContentProvider.java
deleted file mode 100644
index 1a9121a10f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/structure/PersistenceUnitItemContentProvider.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.structure;
-
-import java.util.ArrayList;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractItemTreeContentProvider;
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.CollectionListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.CompositeListValueModel;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListCollectionValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.model.value.CollectionValueModel;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.JarFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-
-/**
- * Item content provider for structure view.
- */
-public class PersistenceUnitItemContentProvider
- extends AbstractItemTreeContentProvider<PersistenceUnit, JpaStructureNode>
-{
- public PersistenceUnitItemContentProvider(PersistenceUnit persistenceUnit, Manager manager) {
- super(persistenceUnit, manager);
- }
-
- public Persistence getParent() {
- return this.item.getParent();
- }
-
- @Override
- protected CollectionValueModel<JpaStructureNode> buildChildrenModel() {
- return new ListCollectionValueModelAdapter<JpaStructureNode>(this.buildChildrenModel_());
- }
-
- protected ListValueModel<JpaStructureNode> buildChildrenModel_() {
- ArrayList<ListValueModel<? extends JpaStructureNode>> list = new ArrayList<ListValueModel<? extends JpaStructureNode>>();
- this.addChildrenModelsTo(list);
- return new CompositeListValueModel<ListValueModel<? extends JpaStructureNode>, JpaStructureNode>(list);
- }
-
- protected void addChildrenModelsTo(ArrayList<ListValueModel<? extends JpaStructureNode>> list) {
- list.add(this.buildSpecifiedMappingFileRefsModel());
- list.add(this.buildImpliedMappingFileRefsModel());
- list.add(this.buildSpecifiedClassRefsModel());
- list.add(this.buildImpliedClassRefsModel());
- list.add(this.buildJarFileRefsModel());
- }
-
- protected ListValueModel<MappingFileRef> buildSpecifiedMappingFileRefsModel() {
- return new SpecifiedMappingFileRefsModel(this.item);
- }
-
- public static class SpecifiedMappingFileRefsModel
- extends ListAspectAdapter<PersistenceUnit, MappingFileRef>
- {
- public SpecifiedMappingFileRefsModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.SPECIFIED_MAPPING_FILE_REFS_LIST, persistenceUnit);
- }
-
- @Override
- protected ListIterable<MappingFileRef> getListIterable() {
- return this.subject.getSpecifiedMappingFileRefs();
- }
-
- @Override
- public int size_() {
- return this.subject.getSpecifiedMappingFileRefsSize();
- }
- }
-
- protected ListValueModel<MappingFileRef> buildImpliedMappingFileRefsModel() {
- return new PropertyListValueModelAdapter<MappingFileRef>(this.buildImpliedMappingFileRefModel());
- }
-
- protected PropertyValueModel<MappingFileRef> buildImpliedMappingFileRefModel() {
- return new ImpliedMappingFileRefModel(this.item);
- }
-
- public static class ImpliedMappingFileRefModel
- extends PropertyAspectAdapter<PersistenceUnit, MappingFileRef>
- {
- public ImpliedMappingFileRefModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.IMPLIED_MAPPING_FILE_REF_PROPERTY, persistenceUnit);
- }
- @Override
- protected MappingFileRef buildValue_() {
- return this.subject.getImpliedMappingFileRef();
- }
- }
-
- protected ListValueModel<ClassRef> buildSpecifiedClassRefsModel() {
- return new SpecifiedClassRefsModel(this.item);
- }
-
- public static class SpecifiedClassRefsModel
- extends ListAspectAdapter<PersistenceUnit, ClassRef>
- {
- public SpecifiedClassRefsModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.SPECIFIED_CLASS_REFS_LIST, persistenceUnit);
- }
-
- @Override
- protected ListIterable<ClassRef> getListIterable() {
- return this.subject.getSpecifiedClassRefs();
- }
-
- @Override
- public int size_() {
- return this.subject.getSpecifiedClassRefsSize();
- }
- }
-
- protected ListValueModel<ClassRef> buildImpliedClassRefsModel() {
- return new CollectionListValueModelAdapter<ClassRef>(this.buildImpliedClassRefsModel_());
- }
-
- protected CollectionValueModel<ClassRef> buildImpliedClassRefsModel_() {
- return new ImpliedClassRefsModel(this.item);
- }
-
- public static class ImpliedClassRefsModel
- extends CollectionAspectAdapter<PersistenceUnit, ClassRef>
- {
- public ImpliedClassRefsModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.IMPLIED_CLASS_REFS_COLLECTION, persistenceUnit);
- }
-
- @Override
- protected Iterable<ClassRef> getIterable() {
- return this.subject.getImpliedClassRefs();
- }
-
- @Override
- public int size_() {
- return this.subject.getImpliedClassRefsSize();
- }
- }
-
- protected ListValueModel<JarFileRef> buildJarFileRefsModel() {
- return new JarFileRefsModel(this.item);
- }
-
- public static class JarFileRefsModel
- extends ListAspectAdapter<PersistenceUnit, JarFileRef>
- {
- public JarFileRefsModel(PersistenceUnit persistenceUnit) {
- super(PersistenceUnit.JAR_FILE_REFS_LIST, persistenceUnit);
- }
-
- @Override
- protected ListIterable<JarFileRef> getListIterable() {
- return this.subject.getJarFileRefs();
- }
-
- @Override
- public int size_() {
- return this.subject.getJarFileRefsSize();
- }
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaDetailsView.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaDetailsView.java
deleted file mode 100644
index 4a08523268..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaDetailsView.java
+++ /dev/null
@@ -1,318 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.views;
-
-import java.util.HashMap;
-import org.eclipse.jpt.common.ui.internal.widgets.PropertySheetWidgetFactory;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.details.JpaDetailsPageManager;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.selection.JpaViewManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.forms.widgets.ScrolledForm;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.ViewPart;
-
-/**
- * The JPA details view has a page book that displays the JPA details page
- * corresponding to the current JPA selection. The JPA details only listens to
- * the JPA selection; it will never change the JPA selection.
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- *
- * @version 3.0
- * @since 1.0
- */
-public class JpaDetailsView
- extends ViewPart
-{
- /**
- * The factory used by the details view and its page managers
- * to create the their widgets.
- */
- private final PropertySheetWidgetFactory widgetFactory = new PropertySheetWidgetFactory();
-
- /**
- * The scrolled form that holds the {@link #pageBook page book}.
- * We need to force it to reflow whenever we change the page book's
- * current page.
- */
- private volatile ScrolledForm scrolledForm;
-
- /**
- * The container of all the details pages.
- */
- private volatile PageBook pageBook;
-
- /**
- * The page displayed by the {@link #pageBook page book}
- * when nothing can be shown.
- */
- private volatile Control defaultPage;
-
- /**
- * The current JPA details page manager that was built based on the
- * current JPA selection.
- */
- private volatile JpaDetailsPageManager<? extends JpaStructureNode> currentPageManager;
-
- /**
- * The manager is created when the view's control is
- * {@link #createPartControl(Composite) created}
- * and disposed, if necessary, when the view is
- * {@link #dispose() disposed}.
- */
- private volatile Manager manager;
-
- /**
- * Listen for changes to the JPA selection.
- */
- private final PropertyChangeListener jpaSelectionListener = new JpaSelectionListener();
-
- /**
- * Cache of JPA details page managers
- * keyed by JPA structure node context type.
- */
- private final HashMap<JpaStructureNode.ContextType, JpaDetailsPageManager<? extends JpaStructureNode>> pageManagers =
- new HashMap<JpaStructureNode.ContextType, JpaDetailsPageManager<? extends JpaStructureNode>>();
-
-
- public JpaDetailsView() {
- super();
- }
-
- @Override
- public void createPartControl(Composite parent) {
- this.scrolledForm = this.widgetFactory.getWidgetFactory().createScrolledForm(parent);
- JptJpaUiPlugin.instance().controlAffectsJavaSource(this.scrolledForm);
- this.scrolledForm.getBody().setLayout(new GridLayout());
-
- this.pageBook = new PageBook(this.scrolledForm.getBody(), SWT.NONE);
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true;
- gridData.horizontalAlignment = SWT.FILL;
- this.pageBook.setLayoutData(gridData);
-
- this.defaultPage = this.buildDefaultPage();
- this.pageBook.showPage(this.defaultPage);
-
- this.manager = this.buildManager();
- this.manager.getJpaSelectionModel().addPropertyChangeListener(PropertyValueModel.VALUE, this.jpaSelectionListener);
- this.setJpaSelection(this.manager.getJpaSelectionModel().getValue());
- }
-
- private Control buildDefaultPage() {
- Composite composite = this.widgetFactory.createComposite(this.pageBook);
- composite.setLayout(new FillLayout(SWT.VERTICAL));
- this.widgetFactory.createLabel(composite, JptUiMessages.JpaDetailsView_viewNotAvailable);
- return composite;
- }
-
- private Manager buildManager() {
- return new Manager(this.getPageManager());
- }
-
- /**
- * Go to the singleton in the sky.
- * <p>
- * <strong>NB:</strong> This will trigger the creation of the appropriate
- * page manager if it does not already exist.
- */
- private JpaViewManager.PageManager getPageManager() {
- return (JpaViewManager.PageManager) this.getAdapter(JpaViewManager.PageManager.class);
- }
-
-
- // ********** JPA selection **********
-
- /* CU private */ class JpaSelectionListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- JpaDetailsView.this.setJpaSelection((JpaStructureNode) event.getNewValue());
- }
- }
-
- /* CU private */ void setJpaSelection(JpaStructureNode node) {
- boolean pageChange = false;
- if (node == null) {
- if (this.currentPageManager == null) { // null => null
- // do nothing
- } else { // node => null
- try {
- this.currentPageManager.setSubject(null);
- } catch (RuntimeException ex) {
- JptJpaUiPlugin.log(ex);
- }
- this.currentPageManager = null;
- pageChange = true;
- }
- } else {
- if (this.currentPageManager == null) { // null => node
- this.currentPageManager = this.getPageManager(node);
- if (this.currentPageManager != null) {
- try {
- this.currentPageManager.setSubject(node);
- pageChange = true;
- } catch (RuntimeException ex) {
- JptJpaUiPlugin.log(ex);
- this.currentPageManager = null; // leave default page
- }
- }
- } else { // node => node
- JpaDetailsPageManager<? extends JpaStructureNode> pageManager = this.getPageManager(node);
- if (pageManager != this.currentPageManager) {
- try {
- this.currentPageManager.setSubject(null);
- } catch (RuntimeException ex) {
- JptJpaUiPlugin.log(ex);
- }
- this.currentPageManager = pageManager;
- pageChange = true;
- }
- if (this.currentPageManager != null) {
- try {
- this.currentPageManager.setSubject(node);
- } catch (RuntimeException ex) {
- JptJpaUiPlugin.log(ex);
- this.currentPageManager = null; // show default page
- pageChange = true;
- }
- }
- }
- }
-
- if (pageChange) {
- this.pageBook.showPage(this.getCurrentPage());
- this.scrolledForm.reflow(true); // true => flush cache
- }
- }
-
- private Control getCurrentPage() {
- return (this.currentPageManager != null) ? this.currentPageManager.getPage() : this.defaultPage;
- }
-
-
- // ********** page managers **********
-
- /**
- * @see org.eclipse.jpt.jpa.core.JpaStructureNode.ContextType
- */
- private JpaDetailsPageManager<? extends JpaStructureNode> getPageManager(JpaStructureNode node) {
- JpaStructureNode.ContextType nodeType = node.getContextType();
- JpaDetailsPageManager<? extends JpaStructureNode> pageManager = this.pageManagers.get(nodeType);
- if (pageManager == null) {
- pageManager = this.buildPageManager(node);
- if (pageManager != null) {
- this.pageManagers.put(nodeType, pageManager);
- }
- }
- return pageManager;
- }
-
- private JpaDetailsPageManager<? extends JpaStructureNode> buildPageManager(JpaStructureNode node) {
- return this.getJpaDetailsPageManagerFactory(node).buildPageManager(this.pageBook, this.widgetFactory);
- }
-
- private JpaDetailsPageManager.Factory getJpaDetailsPageManagerFactory(JpaStructureNode node) {
- return (JpaDetailsPageManager.Factory) node.getAdapter(JpaDetailsPageManager.Factory.class);
- }
-
-
- // ********** misc **********
-
- @Override
- public void setFocus() {
- this.pageBook.setFocus();
- }
-
- @Override
- public void dispose() {
- if (this.manager != null) {
- this.dispose_();
- }
- super.dispose();
- }
-
- private void dispose_() {
- this.manager.getJpaSelectionModel().removePropertyChangeListener(PropertyValueModel.VALUE, this.jpaSelectionListener);
- this.manager.dispose();
-
- if (this.currentPageManager != null) {
- this.currentPageManager.setSubject(null);
- this.currentPageManager = null;
- }
- for (JpaDetailsPageManager<? extends JpaStructureNode> detailsPage : this.pageManagers.values()) {
- detailsPage.dispose();
- }
- this.pageManagers.clear();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-
- // ********** JPA view manager **********
-
- /**
- * Adapter to the view's page manager.
- */
- /* CU private */ class Manager
- implements JpaViewManager
- {
- /**
- * The manager for the structure view's workbench page.
- */
- private final JpaViewManager.PageManager pageManager;
-
-
- Manager(JpaViewManager.PageManager pageManager) {
- super();
- if (pageManager == null) {
- throw new NullPointerException(); // shouldn't happen...
- }
- this.pageManager = pageManager;
- this.pageManager.addViewManager(this);
- }
-
- public IViewPart getView() {
- return JpaDetailsView.this;
- }
-
- ModifiablePropertyValueModel<JpaStructureNode> getJpaSelectionModel() {
- return this.pageManager.getJpaSelectionModel();
- }
-
- void dispose() {
- this.pageManager.removeViewManager(this);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructurePage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructurePage.java
deleted file mode 100644
index b3e8bf9de2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructurePage.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.views;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IStatusLineManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.internal.jface.AbstractSelectionProvider;
-import org.eclipse.jpt.common.ui.internal.jface.ItemTreeStateProviderManager;
-import org.eclipse.jpt.common.ui.internal.jface.SelectionChangedAdapter;
-import org.eclipse.jpt.common.ui.internal.jface.SimpleMessageTreeContent;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.jface.ItemTreeStateProviderFactoryProvider;
-import org.eclipse.jpt.common.ui.jface.TreeStateProvider;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.selection.JpaEditorManager;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.navigator.IDescriptionProvider;
-import org.eclipse.ui.part.IPageSite;
-import org.eclipse.ui.part.Page;
-
-/**
- * The {@link JpaStructureView JPA structure view} is a page book view that
- * maintains a JPA structure page per editor.
- */
-public class JpaStructurePage
- extends Page
-{
- /**
- * The structure page's parent page book.
- * Never <code>null</code>.
- */
- private final JpaStructureView structureView;
-
- /**
- * The manager corresponding to the editor
- * the structure page is associated with.
- * Never <code>null</code>.
- */
- private final JpaEditorManager editorManager;
-
- /**
- * Listen for the model or the editor manager to change the
- * JPA file.
- */
- private final PropertyChangeListener jpaFileListener = new JpaFileListener();
-
- /**
- * Listen for others to change the JPA selection.
- */
- private final PropertyChangeListener jpaSelectionListener = new JpaSelectionListener();
-
- /**
- * Adapt the tree selection provider to the page's selection provider,
- * which is adapted to the (page book) view's selection provider.
- */
- private final SelectionProvider selectionProvider = new SelectionProvider();
-
- /**
- * The page's main control.
- */
- private /* virtually final */ Composite control;
-
- /**
- * The page's tree viewer.
- */
- private /* virtually final */ TreeViewer treeViewer;
-
- /**
- * Listen for changes to the tree's selection.
- */
- private final ISelectionChangedListener treePostSelectionListener = new TreePostSelectionChangedListener();
-
-
- public JpaStructurePage(JpaStructureView structureView, JpaEditorManager editorManager) {
- super();
- this.structureView = structureView;
- this.editorManager = editorManager;
- }
-
- @Override
- public void init(IPageSite pageSite) {
- super.init(pageSite);
- pageSite.setSelectionProvider(this.selectionProvider);
- }
-
- // TODO use problem decorator
- @Override
- public void createControl(Composite parent) {
- this.control = new Composite(parent, SWT.NULL);
- this.control.setLayout(new FillLayout());
- this.treeViewer = new TreeViewer(this.control, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
- this.treeViewer.setAutoExpandLevel(2);
- this.setTreeViewerJpaFile(this.getEditorJpaFile());
- this.engageListeners();
- this.initializeContextMenu();
- }
-
- private void engageListeners() {
- this.getEditorJpaFileModel().addPropertyChangeListener(PropertyValueModel.VALUE, this.jpaFileListener);
- this.getEditorJpaSelectionModel().addPropertyChangeListener(PropertyValueModel.VALUE, this.jpaSelectionListener);
- this.treeViewer.addSelectionChangedListener(this.selectionProvider);
- this.treeViewer.addPostSelectionChangedListener(this.treePostSelectionListener);
- }
-
- @Override
- public void dispose() {
- this.disengageListeners();
- super.dispose();
- }
-
- private void disengageListeners() {
- this.treeViewer.removePostSelectionChangedListener(this.treePostSelectionListener);
- this.treeViewer.removeSelectionChangedListener(this.selectionProvider);
- this.getEditorJpaSelectionModel().removePropertyChangeListener(PropertyValueModel.VALUE, this.jpaSelectionListener);
- this.getEditorJpaFileModel().removePropertyChangeListener(PropertyValueModel.VALUE, this.jpaFileListener);
- }
-
-
- // ********** context menu **********
-
- /**
- * A dynamic menu manager is required to support action contributions.
- */
- private void initializeContextMenu() {
- MenuManager menuManager = new MenuManager();
- menuManager.setRemoveAllWhenShown(true);
- menuManager.addMenuListener(new MenuListener()); // no need to remove listener(?)
- Tree tree = this.treeViewer.getTree();
- tree.setMenu(menuManager.createContextMenu(tree));
- this.structureView.getSite().registerContextMenu(menuManager, this.treeViewer);
- }
-
- /* CU private */ class MenuListener
- implements IMenuListener
- {
- public void menuAboutToShow(IMenuManager menuManager) {
- // Delegates to the action group using the viewer's selection as the action context.
- menuManager.add(new Separator(IWorkbenchActionConstants.MB_ADDITIONS));
- }
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** editor JPA file **********
-
- private JpaFile getEditorJpaFile() {
- return this.getEditorJpaFileModel().getValue();
- }
-
- private PropertyValueModel<JpaFile> getEditorJpaFileModel() {
- return this.editorManager.getJpaFileModel();
- }
-
- /* CU private */ class JpaFileListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- JpaStructurePage.this.setTreeViewerInput((JpaFile) event.getNewValue());
- }
- }
-
-
- // ********** tree input **********
-
- /* CU private */ void setTreeViewerInput(JpaFile jpaFile) {
- this.execute(new SetTreeViewerInputRunnable(jpaFile));
- }
-
- /* CU private */ class SetTreeViewerInputRunnable
- implements Runnable
- {
- private final JpaFile jpaFile;
-
- SetTreeViewerInputRunnable(JpaFile jpaFile) {
- super();
- this.jpaFile = jpaFile;
- }
-
- public void run() {
- JpaStructurePage.this.setTreeViewerInput_(this.jpaFile);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.jpaFile);
- }
- }
-
- /**
- * Pre-condition: executing on the UI thread.
- */
- /* CU private */ void setTreeViewerInput_(JpaFile jpaFile) {
- // not sure why TreeViewer.setInput(...) requires a dispose check,
- // while TreeViewer.setSelection(...) does not...
- if (this.treeViewer.getControl().isDisposed()) {
- return;
- }
-
- // clear the tree before we change the providers
- this.treeViewer.setInput(null);
- this.setTreeViewerJpaFile(jpaFile);
- }
-
- private void setTreeViewerJpaFile(JpaFile jpaFile) {
- if (jpaFile == null || jpaFile.getResourceModel().getResourceType() == null) {
- this.setTreeViewerMessage(JptUiMessages.JpaStructureView_structureNotAvailable);
- } else {
- ItemTreeStateProviderFactoryProvider factoryProvider = this.getFactoryProvider(jpaFile);
- if (factoryProvider == null) {
- this.setTreeViewerMessage(this.buildMissingStructureProviderMessage(jpaFile));
- } else {
- this.setTreeViewerJpaFile(jpaFile, factoryProvider);
- this.setTreeViewerJpaSelection_(this.getEditorJpaSelection());
- }
- }
- }
-
- private ItemTreeStateProviderFactoryProvider getFactoryProvider(JpaFile jpaFile) {
- return this.getPlatformUi(jpaFile).getStructureViewFactoryProvider(jpaFile);
- }
-
- private JpaPlatformUi getPlatformUi(JpaFile jpaFile) {
- return (JpaPlatformUi) jpaFile.getJpaProject().getJpaPlatform().getAdapter(JpaPlatformUi.class);
- }
-
- private String buildMissingStructureProviderMessage(JpaFile jpaFile) {
- JptResourceType resourceType = jpaFile.getResourceModel().getResourceType();
- String contentType = resourceType.getContentType().getName();
- String version = resourceType.getVersion();
- return NLS.bind(JptUiMessages.JpaStructureView_structureProviderNotAvailable, contentType, version);
- }
-
- private void setTreeViewerJpaFile(JpaFile jpaFile, ItemTreeStateProviderFactoryProvider factoryProvider) {
- TreeStateProvider provider = this.buildStateProvider(factoryProvider);
- this.treeViewer.setContentProvider(provider);
- this.treeViewer.setLabelProvider(provider);
- this.treeViewer.setInput(jpaFile);
- }
-
- private TreeStateProvider buildStateProvider(ItemTreeStateProviderFactoryProvider factoryProvider) {
- return new ItemTreeStateProviderManager(
- factoryProvider.getItemContentProviderFactory(),
- factoryProvider.getItemLabelProviderFactory()
- );
- }
-
- private void setTreeViewerMessage(String message) {
- this.treeViewer.setContentProvider(SimpleMessageTreeContent.contentProvider());
- this.treeViewer.setLabelProvider(SimpleMessageTreeContent.labelProvider());
- this.treeViewer.setInput(new SimpleMessageTreeContent(message));
- }
-
-
- // ********** editor JPA selection **********
-
- private JpaStructureNode getEditorJpaSelection() {
- return this.getEditorJpaSelectionModel().getValue();
- }
-
- private void setEditorJpaSelection(JpaStructureNode selection) {
- this.getEditorJpaSelectionModel().setValue(selection);
- }
-
- private ModifiablePropertyValueModel<JpaStructureNode> getEditorJpaSelectionModel() {
- return this.editorManager.getJpaSelectionModel();
- }
-
- /* CU private */ class JpaSelectionListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- JpaStructurePage.this.setTreeViewerJpaSelection((JpaStructureNode) event.getNewValue());
- }
- }
-
-
- // ********** tree selection **********
-
- /**
- * If the new JPA selection is different
- * from the tree's current JPA selection, modify the tree's selection.
- */
- /* CU private */ void setTreeViewerJpaSelection(JpaStructureNode selection) {
- this.execute(new SetTreeViewerSelectionRunnable(selection));
- }
-
- /* CU private */ class SetTreeViewerSelectionRunnable
- implements Runnable
- {
- private final JpaStructureNode selection;
-
- SetTreeViewerSelectionRunnable(JpaStructureNode selection) {
- super();
- this.selection = selection;
- }
-
- public void run() {
- JpaStructurePage.this.setTreeViewerJpaSelection_(this.selection);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.selection);
- }
- }
-
- /**
- * Pre-condition: executing on the UI thread.
- */
- /* CU private */ void setTreeViewerJpaSelection_(JpaStructureNode selection) {
- if (selection != this.getTreeViewerJpaSelection()) {
- this.setTreeViewerSelection((selection == null) ? null : new StructuredSelection(selection));
- }
- }
-
- /* CU private */ void setTreeViewerSelection(ISelection selection) {
- if (this.treeViewer != null) {
- this.treeViewer.setSelection(selection, true); // true => reveal
- }
- }
-
- private JpaStructureNode getTreeViewerJpaSelection() {
- return this.convertToJpaSelection_(this.getTreeViewerSelection());
- }
-
- /**
- * Return a tree selection that is either empty or contains a single
- * {@link JpaStructureNode JPA structure node}.
- */
- /* CU private */ IStructuredSelection getTreeViewerSelection() {
- return (this.treeViewer == null) ?
- TreeSelection.EMPTY :
- this.filterSelection((ITreeSelection) this.treeViewer.getSelection());
- }
-
- /* CU private */ IStructuredSelection filterSelection(IStructuredSelection selection) {
- // the selection could be a message
- return ((selection.size() == 1) && (selection.getFirstElement() instanceof JpaStructureNode)) ?
- selection :
- StructuredSelection.EMPTY;
- }
-
- private JpaStructureNode convertToJpaSelection(IStructuredSelection selection) {
- return this.convertToJpaSelection_(this.filterSelection(selection));
- }
-
- private JpaStructureNode convertToJpaSelection_(IStructuredSelection filterSelection) {
- return filterSelection.isEmpty() ? null : (JpaStructureNode) filterSelection.getFirstElement();
- }
-
-
- // ********** tree post selection **********
-
- /**
- * "Post" listeners are notified with a bit of a delay when the selection
- * is modified via the keyboard (as opposed to the mouse).
- */
- /* CU private */ class TreePostSelectionChangedListener
- extends SelectionChangedAdapter
- {
- @Override
- public void selectionChanged(SelectionChangedEvent event) {
- JpaStructurePage.this.treePostSelectionChanged(event.getSelection());
- }
- }
-
- /**
- * <ul>
- * <li>Forward the new selection to the editor manager
- * (and on to other JPA views).
- * <li>Update the status bar.
- * </ul>
- */
- /* CU private */ void treePostSelectionChanged(ISelection selection) {
- this.setEditorJpaSelection(this.convertToJpaSelection(selection));
- this.updateStatusLine(selection);
- }
-
- private JpaStructureNode convertToJpaSelection(ISelection selection) {
- return (selection instanceof IStructuredSelection) ?
- this.convertToJpaSelection((IStructuredSelection) selection) :
- null;
- }
-
-
- // ********** status line **********
-
- private void updateStatusLine(ISelection selection) {
- if (selection instanceof IStructuredSelection) {
- this.updateStatusLine((IStructuredSelection) selection);
- } else {
- this.getStatusLineManager().setMessage(""); //$NON-NLS-1$
- }
- }
-
- private void updateStatusLine(IStructuredSelection selection) {
- if (selection.isEmpty()) {
- this.getStatusLineManager().setMessage(""); //$NON-NLS-1$
- } else {
- if (selection.size() > 1) {
- Integer size = Integer.valueOf(selection.size());
- String msg = NLS.bind(JptUiMessages.JpaStructureView_numItemsSelected, size);
- this.getStatusLineManager().setMessage(msg);
- } else {
- Object first = selection.getFirstElement();
- ILabelProvider labelProvider = (ILabelProvider) this.treeViewer.getLabelProvider();
- Image image = labelProvider.getImage(first);
- String msg = labelProvider.getText(first);
- if (first instanceof JpaStructureNode) {
- msg = ((IDescriptionProvider) labelProvider).getDescription(first);
- }
- this.getStatusLineManager().setMessage(image, msg);
- }
- }
- }
-
- private IStatusLineManager getStatusLineManager() {
- return this.getSite().getActionBars().getStatusLineManager();
- }
-
-
- // ********** selection provider **********
-
- /**
- * Selection provider - adapt the structure page's
- * {@link #treeViewer tree viewer} for the page book view.
- * The selection is {@link JpaStructurePage#filterSelection(IStructuredSelection) filtered}.
- */
- /* CU private */ class SelectionProvider
- extends AbstractSelectionProvider
- implements ISelectionChangedListener
- {
- public ISelection getSelection() {
- return JpaStructurePage.this.getTreeViewerSelection();
- }
-
- public void setSelection(ISelection selection) {
- JpaStructurePage.this.setTreeViewerSelection(selection);
- }
-
- public void selectionChanged(SelectionChangedEvent event) {
- this.fireSelectionChanged(this.filterSelection(event.getSelection()));
- }
-
- private ISelection filterSelection(ISelection selection) {
- return (selection instanceof IStructuredSelection) ?
- JpaStructurePage.this.filterSelection((IStructuredSelection) selection) :
- TreeSelection.EMPTY;
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public Control getControl() {
- return this.control;
- }
-
- @Override
- public void setFocus() {
- this.control.setFocus();
- }
-
- private void execute(Runnable runnable) {
- SWTUtil.execute(this.getSite().getShell().getDisplay(), runnable);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.getEditorJpaFile());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructureView.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructureView.java
deleted file mode 100644
index e4594034c1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/views/JpaStructureView.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.views;
-
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.selection.JpaEditorManager;
-import org.eclipse.jpt.jpa.ui.selection.JpaViewManager;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.part.IPage;
-import org.eclipse.ui.part.Page;
-import org.eclipse.ui.part.PageBook;
-import org.eclipse.ui.part.PageBookView;
-
-/**
- * The JPA structure view is a page book view that maintains a
- * {@link JpaStructurePage JPA structure page}
- * per editor and a default page when the editor does not contain JPA
- * content.
- * <p>
- * See <code>org.eclipse.jpt.jpa.ui/plugin.xml</code>.
- */
-public class JpaStructureView
- extends PageBookView
-{
- /**
- * The manager is created when the view's control is
- * {@link #createPartControl(Composite) created}
- * and disposed, if necessary, when the view is
- * {@link #dispose() disposed}.
- */
- private volatile Manager manager;
-
-
- public JpaStructureView() {
- super();
- }
-
- @Override
- public void createPartControl(Composite parent) {
- this.manager = this.buildManager();
- super.createPartControl(parent);
- }
-
- private Manager buildManager() {
- return new Manager(this.getPageManager());
- }
-
- /**
- * Go to the singleton in the sky.
- * <p>
- * <strong>NB:</strong> This will trigger the creation of the appropriate
- * page manager if it does not already exist.
- */
- private JpaViewManager.PageManager getPageManager() {
- return (JpaViewManager.PageManager) this.getAdapter(JpaViewManager.PageManager.class);
- }
-
- @Override
- protected IPage createDefaultPage(PageBook book) {
- DefaultPage page = new DefaultPage();
- this.initPage(page);
- page.createControl(book);
- return page;
- }
-
- /**
- * Start with the currently active editor.
- */
- @Override
- protected IWorkbenchPart getBootstrapPart() {
- IWorkbenchPage page = this.getSite().getPage();
- return (page == null) ? null : page.getActiveEditor();
- }
-
- /**
- * Behave the same way as {@link #partActivated(IWorkbenchPart)};
- * i.e. {@link #isImportant(IWorkbenchPart) check whether the specified
- * part is an editor} and display the appropriate page if it is.
- */
- @Override
- public void partBroughtToTop(IWorkbenchPart part) {
- super.partBroughtToTop(part);
- this.partActivated(part);
- }
-
- /**
- * Display the appropriate page if an editor is
- * {@link #partActivated(IWorkbenchPart) activated}
- * or {@link #partBroughtToTop(IWorkbenchPart) brought to the top}.
- */
- @Override
- protected boolean isImportant(IWorkbenchPart part) {
- return part instanceof IEditorPart;
- }
-
- /**
- * The specified part is an editor (see {@link #isImportant(IWorkbenchPart)}.
- */
- @Override
- protected PageRec doCreatePage(IWorkbenchPart part) {
- IEditorPart editor = (IEditorPart) part;
- JpaEditorManager editorManager = this.manager.getEditorManager(editor);
- if (editorManager == null) {
- // if there is no editor manager corresponding to the current
- // editor return null so the default page is displayed
- return null;
- }
- JpaStructurePage page = new JpaStructurePage(this, editorManager);
- this.initPage(page);
- page.createControl(this.getPageBook());
- return new PageRec(editor, page);
- }
-
- @Override
- protected void doDestroyPage(IWorkbenchPart part, PageRec pageRecord) {
- JpaStructurePage page = (JpaStructurePage) pageRecord.page;
- page.dispose();
- pageRecord.dispose();
- }
-
- @Override
- public void dispose() {
- super.dispose();
- if (this.manager != null) {
- this.manager.dispose();
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
-
- // ********** JPA view manager **********
-
- /**
- * Adapter to the view's page manager.
- */
- /* CU private */ class Manager
- implements JpaViewManager
- {
- /**
- * The manager for the structure view's workbench page.
- */
- private final JpaViewManager.PageManager pageManager;
-
-
- Manager(JpaViewManager.PageManager pageManager) {
- super();
- if (pageManager == null) {
- throw new NullPointerException(); // shouldn't happen...
- }
- this.pageManager = pageManager;
- this.pageManager.addViewManager(this);
- }
-
- public IViewPart getView() {
- return JpaStructureView.this;
- }
-
- JpaEditorManager getEditorManager(IEditorPart editor) {
- return this.pageManager.getEditorManager(editor);
- }
-
- void dispose() {
- this.pageManager.removeViewManager(this);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
-
- // ********** default page **********
-
- /**
- * Simply display a message stating the JPA structure is not available.
- * @see org.eclipse.ui.part.MessagePage
- */
- /* CU private */ static class DefaultPage
- extends Page
- {
- private /* virtually final */ Composite composite;
-
- DefaultPage() {
- super();
- }
-
- @Override
- public void createControl(Composite parent) {
- // a composite will put some margins around the label
- this.composite = new Composite(parent, SWT.NULL);
- this.composite.setLayout(new FillLayout());
- Label label = new Label(this.composite, SWT.LEFT | SWT.TOP | SWT.WRAP);
- label.setText(JptUiMessages.JpaStructureView_structureNotAvailable);
- }
-
- @Override
- public Control getControl() {
- return this.composite;
- }
-
- @Override
- public void setFocus() {
- this.composite.setFocus();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/DatabaseSchemaWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/DatabaseSchemaWizardPage.java
deleted file mode 100644
index 87a4e07b16..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/DatabaseSchemaWizardPage.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards;
-
-import java.util.EventListener;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.preference.PreferenceDialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.ListenerList;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.db.ConnectionAdapter;
-import org.eclipse.jpt.jpa.db.ConnectionListener;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.properties.JpaProjectPropertiesPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.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.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.PreferencesUtil;
-
-/**
- * Most of the behavior is in DatabaseGroup....
- *
- * We open the wizard page with the JPA project's connection profile and
- * default schema selected (if possible), but then the selections are driven
- * by the user. If the user re-selects the JPA project's connection profile,
- * we will pre-select the project's default schema if possible.
- */
-public class DatabaseSchemaWizardPage extends WizardPage {
-
- final JpaProject jpaProject;
-
- private final ListenerList<Listener> listenerList = new ListenerList<Listener>(Listener.class);
-
- private DatabaseGroup databaseGroup;
-
-
- public DatabaseSchemaWizardPage(JpaProject jpaProject) {
- super("Database Schema"); //$NON-NLS-1$
- if (jpaProject == null) {
- throw new NullPointerException();
- }
- this.jpaProject = jpaProject;
- this.setTitle(JptUiMessages.DatabaseSchemaWizardPage_title);
- this.setMessage(JptUiMessages.DatabaseSchemaWizardPage_desc);
- }
-
- public void createControl(Composite parent) {
- this.setPageComplete(false);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- private Control buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- this.databaseGroup = new DatabaseGroup(composite);
- Dialog.applyDialogFont(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, JpaHelpContextIds.PROPERTIES_JAVA_PERSISTENCE_CONNECTION);
- return composite;
- }
-
- public ConnectionProfile getJpaProjectConnectionProfile() {
- return this.jpaProject.getConnectionProfile();
- }
-
- public Schema getSelectedSchema() {
- return this.databaseGroup.getSelectedSchema();
- }
-
- @Override
- public void dispose() {
- this.databaseGroup.dispose();
- super.dispose();
- }
-
-
- // ********** listeners **********
-
- public void addListener(Listener listener) {
- this.listenerList.add(listener);
- }
-
- public void removeListener(Listener listener) {
- this.listenerList.remove(listener);
- }
-
- void fireSchemaChanged(Schema schema) {
- this.setPageComplete(schema != null);
- for (Listener listener : this.listenerList.getListeners()) {
- listener.selectedSchemaChanged(schema);
- }
- }
-
-
- // ********** listener interface **********
-
- /**
- * Allows clients to listen for changes to the selected connection profile
- * and schema.
- */
- public interface Listener extends EventListener {
- void selectedSchemaChanged(Schema schema);
- }
-
-
- // ********** database group **********
-
- /**
- * schema combo-box
- * add project connection link
- * reconnect link
- */
- class DatabaseGroup {
-
- // these are kept in sync with the selection
- private Schema selectedSchema;
-
- private final Combo schemaComboBox;
-
- private final Link reconnectLink;
-
- private Link addJpaProjectConnectionLink;
-
- private final ConnectionListener connectionListener;
-
-
- // ********** construction **********
-
- DatabaseGroup(Composite composite) {
- super();
-
- Group group = new Group(composite, SWT.NONE);
- group.setLayout(new GridLayout(2, false)); // false = do not make columns equal width
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- group.setText(JptUiMessages.DatabaseSchemaWizardPage_schemaSettings);
- // TODO PlatformUI.getWorkbench().getHelpSystem().setHelp(this.group, JpaHelpContextIds.XXX);
-
- // schema combo-box
- this.buildLabel(group, 1, JptUiMessages.DatabaseSchemaWizardPage_schema);
- this.schemaComboBox = this.buildComboBox(group, this.buildSchemaComboBoxSelectionListener());
-
- String message = (this.projectHasAConnection()) ?
- JptUiMessages.DatabaseSchemaWizardPage_schemaInfo :
- JptUiMessages.DatabaseSchemaWizardPage_connectionInfo;
-
- this.buildLabel(group, 2, message);
-
- // add project's connection link
- if( ! this.projectHasAConnection()) {
- this.addJpaProjectConnectionLink = this.buildLink(group,
- JptUiMessages.DatabaseSchemaWizardPage_addConnectionToProject,
- this.buildAddJpaProjectConnectionLinkListener());
- }
-
- // reconnect link
- this.reconnectLink = this.buildLink(group, JptUiMessages.DatabaseSchemaWizardPage_connectLink, this.buildReconnectLinkSelectionListener());
- this.reconnectLink.setEnabled(true);
-
- this.selectedSchema = this.getDefaultSchema();
-
- if (this.selectedSchema != null) {
- DatabaseSchemaWizardPage.this.fireSchemaChanged(this.selectedSchema);
- }
-
- this.connectionListener = this.buildConnectionListener();
- this.addJpaProjectConnectionProfileListener(this.connectionListener);
-
- this.updateSchemaComboBox();
- this.updateReconnectLink();
- }
-
-
- // ********** intra-wizard methods **********
-
- Schema getSelectedSchema() {
- return this.selectedSchema;
- }
-
- void dispose() {
- if(this.projectHasAConnection()) {
- this.getJpaProjectConnectionProfile().removeConnectionListener(this.connectionListener);
- }
- }
-
-
- // ********** internal methods **********
-
- void addJpaProjectConnectionListener() {
- this.addJpaProjectConnectionProfileListener(this.connectionListener);
- }
-
-
- private void addJpaProjectConnectionProfileListener(ConnectionListener listener) {
- if(this.projectHasAConnection()) {
- this.getJpaProjectConnectionProfile().addConnectionListener(listener);
- }
- }
-
- private boolean projectHasAConnection() {
- return this.getJpaProjectConnectionProfile() != null;
- }
-
- /**
- * this can return null;
- * called at start-up and when the selected connection profile changes
- */
- private ConnectionProfile getJpaProjectConnectionProfile() {
- return DatabaseSchemaWizardPage.this.jpaProject.getConnectionProfile();
- }
-
- /**
- * this can return null;
- * called at start-up and when the selected connection profile changes
- */
- private Schema getDefaultSchema() {
- return DatabaseSchemaWizardPage.this.jpaProject.getDefaultDbSchema();
- }
-
- private SchemaContainer getDefaultSchemaContainer() {
- return DatabaseSchemaWizardPage.this.jpaProject.getDefaultDbSchemaContainer();
- }
-
- /**
- * called at start-up and when the selected connection profile changes
- */
- private void updateReconnectLink() {
- this.reconnectLink.setEnabled(this.reconnectLinkCanBeEnabled());
- }
-
- void updateAddJpaProjectConnectionLink() {
- this.addJpaProjectConnectionLink.setEnabled(this.addJpaProjectConnectionLinkCanBeEnabled());
- }
-
- private boolean reconnectLinkCanBeEnabled() {
- if(this.projectHasAConnection()) {
- return this.getJpaProjectConnectionProfile().isInactive();
- }
- return false;
- }
-
- private boolean addJpaProjectConnectionLinkCanBeEnabled() {
- return ! this.projectHasAConnection();
- }
-
- /**
- * the schema combo-box is updated at start-up and
- * when the selected connection profile changes
- */
- private void updateSchemaComboBox() {
- this.schemaComboBox.removeAll();
- for (String name : this.getSchemaNames()) {
- this.schemaComboBox.add(name);
- }
- // the current schema *should* be in the current connection profile
- if (this.selectedSchema != null) {
- this.schemaComboBox.select(this.schemaComboBox.indexOf(this.selectedSchema.getName()));
- }
- }
-
- private Iterable<String> getSchemaNames() {
- SchemaContainer sc = this.getDefaultSchemaContainer();
- // use schema *names* since the combo-box is read-only
- return (sc != null) ? sc.getSortedSchemaNames() : EmptyIterable.<String>instance();
- }
-
- // ********** listener callbacks **********
-
- void selectedSchemaChanged() {
- Schema old = this.selectedSchema;
- this.selectedSchema = this.getDefaultSchemaContainer().getSchemaNamed(this.schemaComboBox.getText());
- if (this.selectedSchema != old) {
- DatabaseSchemaWizardPage.this.fireSchemaChanged(this.selectedSchema);
- }
- }
-
- void reconnect() {
- this.getJpaProjectConnectionProfile().connect();
- // everything should be synchronized when we get the resulting open event
- }
-
- /**
- * called when
- * - a connection is set to the Jpa project
- * - the connection was opened
- * - the connection was closed (never happens?)
- * we need to update the schema stuff and the reconnect link
- */
- void connectionChanged() {
- Schema old = this.selectedSchema;
- this.selectedSchema = this.getDefaultSchema();
- if (this.selectedSchema != old) {
- DatabaseSchemaWizardPage.this.fireSchemaChanged(this.selectedSchema);
- }
- this.updateSchemaComboBox();
- this.updateReconnectLink();
- }
-
-
- // ********** listeners **********
-
- private SelectionListener buildSchemaComboBoxSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // nothing special for "default" (double-click?)
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- DatabaseGroup.this.selectedSchemaChanged();
- }
- @Override
- public String toString() {
- return "DatabaseSchemaWizardPage schema combo-box selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- private SelectionListener buildReconnectLinkSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- DatabaseGroup.this.reconnect();
- }
- @Override
- public String toString() {
- return "DatabaseSchemaWizardPage reconnect link selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- private ConnectionListener buildConnectionListener() {
- return new LocalConnectionListener();
- }
-
- class LocalConnectionListener
- extends ConnectionAdapter
- {
- @Override
- public void opened(ConnectionProfile cp) {
- this.connectionChanged();
- }
- @Override // this probably won't ever get called...
- public void closed(ConnectionProfile cp) {
- this.connectionChanged();
- }
- private void connectionChanged() {
- SWTUtil.asyncExec(
- new Runnable() {
- public void run() {
- DatabaseGroup.this.connectionChanged();
- }
- }
- );
- }
- }
-
- private SelectionListener buildAddJpaProjectConnectionLinkListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- DatabaseGroup.this.promptToConfigJpaProjectConnection();
-
- DatabaseGroup.this.addJpaProjectConnectionListener();
- DatabaseGroup.this.updateAddJpaProjectConnectionLink();
- DatabaseGroup.this.connectionChanged();
- }
- @Override
- public String toString() {
- return "DatabaseSchemaWizardPage AddProjectConnection link selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- void promptToConfigJpaProjectConnection() {
- PreferenceDialog dialog =
- PreferencesUtil.createPropertyDialogOn(
- getShell(), DatabaseSchemaWizardPage.this.jpaProject.getProject(),
- JpaProjectPropertiesPage.PROP_ID,
- null,
- null);
- dialog.open();
- }
-
- // ********** UI components **********
-
- /**
- * build and return a label
- */
- private Label buildLabel(Composite parent, int span, String text) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- /**
- * build and return a combo-box
- */
- private Combo buildComboBox(Composite parent, SelectionListener listener) {
- Combo combo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- combo.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- combo.addSelectionListener(listener);
- return combo;
- }
-
- /**
- * build and return a link
- */
- private Link buildLink(Composite parent, String text, SelectionListener listener) {
- Link link = new Link(parent, SWT.NONE);
- GridData data = new GridData(GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- link.setLayoutData(data);
- link.setText(text);
- link.addSelectionListener(listener);
- return link;
- }
-
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetActionPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetActionPage.java
deleted file mode 100644
index e2576706d6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetActionPage.java
+++ /dev/null
@@ -1,214 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jst.common.project.facet.core.libprov.LibraryInstallDelegate;
-import org.eclipse.jst.common.project.facet.ui.libprov.LibraryProviderFrameworkUi;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectEvent;
-import org.eclipse.wst.common.project.facet.core.events.IFacetedProjectListener;
-import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetInstallPage;
-
-public abstract class JpaFacetActionPage
- extends DataModelFacetInstallPage
- implements JpaFacetDataModelProperties
-{
- private IFacetedProjectListener listener;
-
- protected JpaFacetActionPage(String pageName) {
- super(pageName);
- setTitle(JptUiMessages.JpaFacetWizardPage_title);
- setDescription(JptUiMessages.JpaFacetWizardPage_description);
- setImageDescriptor(JptJpaUiPlugin.getImageDescriptor(JptUiIcons.JPA_WIZ_BANNER));
- }
-
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- composite.setLayout(layout);
-
- addSubComposites(composite);
-
- setUpRuntimeListener();
-
- Dialog.applyDialogFont(parent);
- PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, JpaHelpContextIds.DIALOG_JPA_FACET);
-
- return composite;
- }
-
- protected abstract void addSubComposites(Composite composite);
-
- private void setUpRuntimeListener() {
- final IFacetedProjectWorkingCopy wc = this.getFacetedProjectWorkingCopy();
- // must do it manually the first time
- model.setProperty(RUNTIME, wc.getPrimaryRuntime());
- this.listener = new IFacetedProjectListener() {
- public void handleEvent( final IFacetedProjectEvent event ) {
- model.setProperty(RUNTIME, wc.getPrimaryRuntime());
- }
- };
-
- wc.addListener(this.listener, IFacetedProjectEvent.Type.PRIMARY_RUNTIME_CHANGED);
- }
-
- protected IFacetedProjectWorkingCopy getFacetedProjectWorkingCopy() {
- return (IFacetedProjectWorkingCopy) getDataModel().getProperty(IFacetDataModelProperties.FACETED_PROJECT_WORKING_COPY);
- }
-
- protected Button createButton(Composite container, int span, String text, int style) {
- Button button = new Button(container, SWT.NONE | style);
- button.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- button.setLayoutData(gd);
- return button;
- }
-
- protected Combo createCombo(Composite container, int span, boolean fillHorizontal) {
- Combo combo = new Combo(container, SWT.BORDER | SWT.SINGLE | SWT.READ_ONLY);
- GridData gd;
- if (fillHorizontal) {
- gd = new GridData(GridData.FILL_HORIZONTAL);
- }
- else {
- gd = new GridData();
- }
- gd.horizontalSpan = span;
- combo.setLayoutData(gd);
- return combo;
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[] {
- PLATFORM,
- CONNECTION,
- USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG,
- USER_OVERRIDE_DEFAULT_CATALOG,
- USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA,
- USER_OVERRIDE_DEFAULT_SCHEMA,
- DISCOVER_ANNOTATED_CLASSES,
- LIBRARY_PROVIDER_DELEGATE
- };
- }
-
- @Override
- public boolean isPageComplete() {
- if (! super.isPageComplete()) {
- return false;
- }
- else {
- IStatus status = model.validate();
- if (status.getSeverity() == IStatus.ERROR) {
- setErrorMessage(status.getMessage());
- return false;
- };
- setErrorMessage(null);
- return true;
- }
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- setErrorMessage();
- }
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
- @Override
- public void dispose() {
- this.getFacetedProjectWorkingCopy().removeListener(this.listener);
- super.dispose();
- }
-
-
- protected final class PlatformGroup
- {
- private final Combo platformCombo;
-
-
- public PlatformGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_platformLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.DIALOG_JPA_PLATFORM);
-
- platformCombo = createCombo(group, 1, true);
- synchHelper.synchCombo(platformCombo, PLATFORM, null);
- }
- }
-
-
- protected final class ClasspathConfigGroup
- {
- public ClasspathConfigGroup(Composite composite) {
-
- final LibraryInstallDelegate librariesInstallDelegate
- = (LibraryInstallDelegate) getDataModel().getProperty(LIBRARY_PROVIDER_DELEGATE);
-
- final Composite librariesComposite
- = (Composite) LibraryProviderFrameworkUi.createInstallLibraryPanel(
- composite, librariesInstallDelegate,
- JptUiMessages.JpaFacetWizardPage_jpaImplementationLabel );
- librariesComposite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(librariesComposite, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH);
- }
- }
-
-
- protected final class PersistentClassManagementGroup
- {
- private final Button discoverClassesButton;
-
- private final Button listClassesButton;
-
-
- public PersistentClassManagementGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_persistentClassManagementLabel);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_CLASSPATH);
-
- discoverClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_discoverClassesButton, SWT.RADIO);
- synchHelper.synchRadio(discoverClassesButton, DISCOVER_ANNOTATED_CLASSES, null);
-
- listClassesButton = createButton(group, 1, JptUiMessages.JpaFacetWizardPage_listClassesButton, SWT.RADIO);
- synchHelper.synchRadio(listClassesButton, LIST_ANNOTATED_CLASSES, null);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetInstallPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetInstallPage.java
deleted file mode 100644
index e6f4b843ac..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetInstallPage.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards;
-
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.JptJpaDbPlugin;
-import org.eclipse.jpt.jpa.db.ui.internal.DTPUiTools;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.ui.PlatformUI;
-
-public class JpaFacetInstallPage
- extends JpaFacetActionPage
- implements JpaFacetInstallDataModelProperties
-{
- public JpaFacetInstallPage() {
- super("jpt.jpa.facet.install.page"); //$NON-NLS-1$
- }
-
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = super.createTopLevelComposite(parent);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.NEW_JPA_PROJECT_JPA_FACET);
- return composite;
- }
-
- @Override
- protected void addSubComposites(Composite composite) {
- new PlatformGroup(composite);
- new ClasspathConfigGroup(composite);
- new ConnectionGroup(composite);
- new PersistentClassManagementGroup(composite);
- new OrmXmlGroup(composite);
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- String[] validationPropertyNames = super.getValidationPropertyNames();
- return ArrayTools.addAll(
- validationPropertyNames,
- USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH,
- DB_DRIVER_NAME);
- }
-
-
- protected final class ConnectionGroup
- {
- private final Combo connectionCombo;
-
- private Link connectionLink;
-
- private Link connectLink;
-
- private final Button addDriverLibraryButton;
-
- private final Label driverLibraryLabel;
-
- private final Combo driverLibraryCombo;
-
- private final Button overrideDefaultCatalogButton;
-
- private final Label defaultCatalogLabel;
-
- private final Combo defaultCatalogCombo;
-
- private final Button overrideDefaultSchemaButton;
-
- private final Label defaultSchemaLabel;
-
- private final Combo defaultSchemaCombo;
-
-
- public ConnectionGroup(Composite composite) {
- Group group = new Group(composite, SWT.NONE);
- group.setText(JptUiMessages.JpaFacetWizardPage_connectionLabel);
- group.setLayout(new GridLayout(3, false));
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.NEW_JPA_PROJECT_CONTENT_PAGE_DATABASE);
-
- connectionCombo = createCombo(group, 3, true);
- synchHelper.synchCombo(connectionCombo, CONNECTION, null);
- connectionCombo.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- updateConnectionStatus();
- }
- });
-
- connectionLink = new Link(group, SWT.NONE);
- GridData data = new GridData(GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- connectionLink.setLayoutData(data);
- connectionLink.setText(JptUiMessages.JpaFacetWizardPage_connectionLink);
- connectionLink.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- openNewConnectionWizard();
- }
- }
- );
-
- connectLink = new Link(group, SWT.NONE);
- data = new GridData(GridData.END, GridData.CENTER, false, false);
- data.horizontalSpan = 2;
- connectLink.setLayoutData(data);
- connectLink.setText(JptUiMessages.JpaFacetWizardPage_connectLink);
- connectLink.setEnabled(false);
- connectLink.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- openConnectionProfile();
- }
- });
-
- addDriverLibraryButton = createButton(group, 3, JptUiMessages.JpaFacetWizardPage_addDriverLibraryLabel, SWT.CHECK);
- addDriverLibraryButton.setSelection(false);
- synchHelper.synchCheckbox(addDriverLibraryButton, USER_WANTS_TO_ADD_DB_DRIVER_JARS_TO_CLASSPATH, null);
-
- driverLibraryLabel = new Label(group, SWT.LEFT);
- driverLibraryLabel.setText(JptUiMessages.JpaFacetWizardPage_driverLibraryLabel);
- GridData gd = new GridData();
- gd.horizontalSpan = 1;
- driverLibraryLabel.setLayoutData(gd);
-
- driverLibraryCombo = createCombo(group, 1, true);
- synchHelper.synchCombo(
- driverLibraryCombo, DB_DRIVER_NAME,
- new Control[] {driverLibraryLabel});
-
- overrideDefaultCatalogButton = createButton(group, 3, JptUiMessages.JpaFacetWizardPage_overrideDefaultCatalogLabel, SWT.CHECK);
- overrideDefaultCatalogButton.setSelection(false);
- synchHelper.synchCheckbox(overrideDefaultCatalogButton, USER_WANTS_TO_OVERRIDE_DEFAULT_CATALOG, null);
-
- defaultCatalogLabel = new Label(group, SWT.LEFT);
- defaultCatalogLabel.setText(JptUiMessages.JpaFacetWizardPage_defaultCatalogLabel);
- gd = new GridData();
- gd.horizontalSpan = 1;
- defaultCatalogLabel.setLayoutData(gd);
-
- defaultCatalogCombo = createCombo(group, 1, true);
- synchHelper.synchCombo(
- defaultCatalogCombo, USER_OVERRIDE_DEFAULT_CATALOG,
- new Control[] {defaultCatalogLabel});
-
- overrideDefaultSchemaButton = createButton(group, 3, JptUiMessages.JpaFacetWizardPage_overrideDefaultSchemaLabel, SWT.CHECK);
- overrideDefaultSchemaButton.setSelection(false);
- synchHelper.synchCheckbox(overrideDefaultSchemaButton, USER_WANTS_TO_OVERRIDE_DEFAULT_SCHEMA, null);
-
- defaultSchemaLabel = new Label(group, SWT.LEFT);
- defaultSchemaLabel.setText(JptUiMessages.JpaFacetWizardPage_defaultSchemaLabel);
- gd = new GridData();
- gd.horizontalSpan = 1;
- defaultSchemaLabel.setLayoutData(gd);
-
- defaultSchemaCombo = createCombo(group, 1, true);
- synchHelper.synchCombo(
- defaultSchemaCombo, USER_OVERRIDE_DEFAULT_SCHEMA,
- new Control[] {defaultSchemaLabel});
- }
-
- private void openNewConnectionWizard() {
- String connectionName = DTPUiTools.createNewConnectionProfile();
- if (connectionName != null) {
- model.setProperty(CONNECTION, connectionName);
- updateConnectionStatus();
- }
- }
-
- private void openConnectionProfile() {
- ConnectionProfile cp = getConnectionProfile();
- if (cp != null) {
- cp.connect();
- model.setBooleanProperty(CONNECTION_ACTIVE, cp.isActive());
- updateConnectionStatus();
- }
- }
-
- private void updateConnectionStatus() {
- ConnectionProfile cp = this.getConnectionProfile();
- updateConnectLink(cp);
- addDriverLibraryButton.setEnabled(cp != null);
- }
-
- private ConnectionProfile getConnectionProfile() {
- // we just use the connection profile to log in, so go to the the db plug-in
- return JptJpaDbPlugin.getConnectionProfileFactory().buildConnectionProfile(model.getStringProperty(CONNECTION));
- }
-
- private void updateConnectLink(ConnectionProfile cp) {
- connectLink.setEnabled((cp != null) && cp.isDisconnected());
- if (cp != null && cp.isConnected()) {
- updateConnectLinkText(JptUiMessages.JpaFacetWizardPage_connectedText);
- }
- else {
- updateConnectLinkText(JptUiMessages.JpaFacetWizardPage_connectLink);
- }
- }
-
- private void updateConnectLinkText(String text) {
- connectLink.setText(text);
- SWTUtil.reflow(connectLink.getParent());
- }
- }
-
-
- protected final class OrmXmlGroup
- {
- private final Button createOrmXmlButton;
-
-
- public OrmXmlGroup(Composite composite) {
- Composite group = new Composite(composite, SWT.NONE);
- group.setLayout(new GridLayout());
- group.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- PlatformUI.getWorkbench().getHelpSystem().setHelp(group, JpaHelpContextIds.DIALOG_CREATE_ORM);
-
- createOrmXmlButton = new Button(group, SWT.CHECK);
- createOrmXmlButton.setText(JptUiMessages.JpaFacetWizardPage_createOrmXmlButton);
- synchHelper.synchCheckbox(createOrmXmlButton, CREATE_ORM_XML, null);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetVersionChangePage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetVersionChangePage.java
deleted file mode 100644
index e0c5e8d14a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaFacetVersionChangePage.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards;
-
-import org.eclipse.swt.widgets.Composite;
-
-public class JpaFacetVersionChangePage
- extends JpaFacetActionPage
-{
- public JpaFacetVersionChangePage() {
- super("jpt.jpa.facet.version-change.page"); //$NON-NLS-1$
- }
-
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = super.createTopLevelComposite(parent);
- // TODO
- //this.getHelpSystem().setHelp(composite, JpaHelpContextIds.NEW_JPA_PROJECT_JPA_FACET);
- return composite;
- }
-
- @Override
- protected void addSubComposites(Composite composite) {
- new PlatformGroup(composite);
- new ClasspathConfigGroup(composite);
- //new ConnectionGroup(composite);
- //new PersistentClassManagementGroup(composite);
- }
-
- @Override
- protected String[] getValidationPropertyNames() {
- // nothing new here *just* yet
- return super.getValidationPropertyNames();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizard.java
deleted file mode 100644
index 52028ef967..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizard.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.resource.LocalResourceManager;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-
-public class JpaMakePersistentWizard extends Wizard {
-
- public static final String HELP_CONTEXT_ID = JptJpaUiPlugin.PLUGIN_ID + ".GenerateEntitiesFromSchemaWizard"; //$NON-NLS-1$
-
- final JpaProject jpaProject;
-
- final List<IType> selectedTypes;
-
- private JpaMakePersistentWizardPage makePersistentWizardPage;
-
- protected final ResourceManager resourceManager;
-
- public JpaMakePersistentWizard(JpaProject jpaProject, List<IType> selectedTypes) {
- super();
- this.jpaProject = jpaProject;
- this.selectedTypes = selectedTypes;
- this.resourceManager = new LocalResourceManager(JFaceResources.getResources());
- this.setWindowTitle(JptUiMessages.JpaMakePersistentWizardPage_title);
- this.setDefaultPageImageDescriptor(JptJpaUiPlugin.getImageDescriptor(JptUiIcons.ENTITY_WIZ_BANNER));
- }
-
- @Override
- public void addPages() {
- setForcePreviousAndNextButtons(true);
- this.makePersistentWizardPage = new JpaMakePersistentWizardPage(this.jpaProject, this.selectedTypes, HELP_CONTEXT_ID);
- this.addPage(this.makePersistentWizardPage);
- return;
- }
-
- @Override
- public boolean performFinish() {
- try {
- this.makePersistentWizardPage.performFinish();
- } catch (InvocationTargetException e) {
- JptJpaUiPlugin.log(e);
- }
- return true;
- }
-
- protected PersistenceUnit getPersistenceUnit(JpaProject jpaProject) {
- PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
- if (persistenceXml != null) {
- Persistence persistence = persistenceXml.getPersistence();
- if (persistence != null && persistence.getPersistenceUnitsSize() > 0) {
- return persistence.getPersistenceUnits().iterator().next();
- }
- }
- return null;
- }
-
- @Override
- public void dispose() {
- this.resourceManager.dispose();
- super.dispose();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizardPage.java
deleted file mode 100644
index e14988c1f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/JpaMakePersistentWizardPage.java
+++ /dev/null
@@ -1,906 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards;
-
-import java.io.File;
-import java.lang.reflect.InvocationTargetException;
-import java.util.List;
-import java.util.ListIterator;
-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.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.ui.JavaElementComparator;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnLabelProvider;
-import org.eclipse.jface.viewers.ComboBoxViewerCellEditor;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TableViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerComparator;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.ui.internal.utility.SynchronousUiCommandExecutor;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterables.FilteringIterable;
-import org.eclipse.jpt.common.utility.internal.iterables.TransformationIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.AspectPropertyValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaProjectManager;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.core.internal.context.orm.AbstractEntityMappings;
-import org.eclipse.jpt.jpa.core.internal.context.persistence.AbstractPersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.details.MappingUiDefinition;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.jface.XmlMappingFileViewerFilter;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.EntityWizardMsg;
-import org.eclipse.jpt.jpa.ui.internal.wizards.orm.EmbeddedMappingFileWizard;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-public class JpaMakePersistentWizardPage extends WizardPage {
-
- // sizing constants
- private final static int TABLE_HEIGHT = 250;
- private final static int TABLE_WIDTH = 300;
-
- private static String MAKE_PERSISTENT_PAGE_NAME = "MakePersistent"; //$NON-NLS-1$
- private TableViewer classTableViewer;
- private final String helpContextId;
-
- private final Type[] selectedTypes;
-
- private final JpaProject jpaProject;
- private JptResourceType jptResourceType;
-
- private final ModifiablePropertyValueModel<Boolean> annotateInJavaModel;
-
- private boolean isFirstCheck = true;
- private final ModifiablePropertyValueModel<String> mappingFileModel;
-
- private final ModifiablePropertyValueModel<Boolean> listInPersistenceXmlModel;
-
- protected JpaMakePersistentWizardPage(final JpaProject jpaProject, final List<IType> selectedTypes, final String helpContextId) {
- super(MAKE_PERSISTENT_PAGE_NAME);
- this.jpaProject = jpaProject;
-
- this.selectedTypes = this.buildTypes(selectedTypes);
- this.jptResourceType = JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- this.helpContextId = helpContextId;
- this.annotateInJavaModel = new SimplePropertyValueModel<Boolean>(Boolean.TRUE);
- this.mappingFileModel = new SimplePropertyValueModel<String>();
- this.listInPersistenceXmlModel = new SimplePropertyValueModel<Boolean>(Boolean.valueOf(!this.jpaProject.discoversAnnotatedClasses()));
- this.setTitle(JptUiMessages.JpaMakePersistentWizardPage_title);
- this.setMessage(JptUiMessages.JpaMakePersistentWizardPage_message);
- }
-
- protected Type[] buildTypes(final List<IType> selectedTypes) {
- return CollectionTools.list(
- new TransformationIterable<IType, Type>(nonPersistentTypes(selectedTypes)) {
- @Override
- protected Type transform(IType jdtType) {
- return new Type(jdtType);
- }
- }).toArray(new Type[] {});
- }
-
- /**
- * Return all ITypes that are not already persistent.
- * Any root structure nodes means the type is already annotated,
- * listed in persistence.xml, or listed in a mapping file
- */
- protected Iterable<IType> nonPersistentTypes(final List<IType> selectedTypes) {
- return new FilteringIterable<IType>(selectedTypes) {
- @Override
- protected boolean accept(IType jdtType) {
- return getJpaProject().getJpaFile((IFile) jdtType.getResource()).getRootStructureNodesSize() == 0;
- }
- };
- }
-
- protected JpaProject getJpaProject() {
- return this.jpaProject;
- }
-
- protected JpaPlatformUi getJpaPlatformUi() {
- return (JpaPlatformUi) this.getJpaProject().getJpaPlatform().getAdapter(JpaPlatformUi.class);
- }
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- int nColumns= 1;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- composite.setLayout(layout);
- Button javaAnnotationButton = new Button(composite, SWT.RADIO);
- javaAnnotationButton.setText(JptUiMessages.JpaMakePersistentWizardPage_annotateInJavaRadioButton);
- javaAnnotationButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- JpaMakePersistentWizardPage.this.annotateInJavaModel.setValue(Boolean.TRUE);
- JpaMakePersistentWizardPage.this.jptResourceType = JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- this.widgetSelected(e);
- }
- });
-
- Button mappingFileButton = new Button(composite, SWT.RADIO);
- mappingFileButton.setText(JptUiMessages.JpaMakePersistentWizardPage_mappingFileRadioButton);
- Composite mappingFileComposite = this.createMappingFileControl(composite);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.grabExcessHorizontalSpace = true;
- mappingFileComposite.setLayoutData(data);
-
- mappingFileButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- JpaMakePersistentWizardPage.this.annotateInJavaModel.setValue(Boolean.FALSE);
- if (JpaMakePersistentWizardPage.this.isFirstCheck) {
- JpaMakePersistentWizardPage.this.mappingFileModel.setValue(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- JpaMakePersistentWizardPage.this.isFirstCheck = false;
- }
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- this.widgetSelected(e);
- }
- });
-
-
- this.classTableViewer = new TableViewer(composite, SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
- this.classTableViewer.getTable().setLinesVisible(true);
- this.classTableViewer.getTable().setHeaderVisible(true);
- this.classTableViewer.setContentProvider(new TypeContentProvider());
- this.classTableViewer.setComparator(new TypeComparator());
- this.createTypeTableColumn();
- this.createMappingTableColumn();
- this.classTableViewer.setInput(this.selectedTypes);
-
- data = new GridData(SWT.FILL, SWT.FILL, true, true);
- data.heightHint = TABLE_HEIGHT;
- data.widthHint = TABLE_WIDTH;
- this.classTableViewer.getTable().setLayoutData(data);
-
- final Button persistenceXmlCheckBox = new Button(composite, SWT.CHECK);
- persistenceXmlCheckBox.setText(JptUiMessages.JpaMakePersistentWizardPage_listInPersistenceXmlCheckBox);
- SWTTools.bind(this.listInPersistenceXmlModel, persistenceXmlCheckBox);
- SWTTools.controlVisibleState(this.annotateInJavaModel, persistenceXmlCheckBox);
-
- setControl(composite);
-
- this.validate();
- }
-
- private Composite createMappingFileControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- layout.marginLeft = 10;
- composite.setLayout(layout);
-
- Link mappingFileLink = new Link(composite, SWT.LEFT);
- mappingFileLink.setText(JptUiMessages.JpaMakePersistentWizardPage_mappingFileLink);
- mappingFileLink.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- mappingFileLink.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- openNewMappingFileWizard();
- }
- }
- );
-
- Text mappingFileText = this.createText(composite, 1);
- SWTTools.bind(this.mappingFileModel, mappingFileText);
- this.mappingFileModel.addPropertyChangeListener(PropertyValueModel.VALUE, new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- JpaXmlResource ormXmlResource = getOrmXmlResource();
- if (ormXmlResource == null) {
- jptResourceType = JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE; //just default to 1.0 orm resource type
- }
- else {
- jptResourceType = ormXmlResource.getResourceType();
- }
- validate();
- }
- });
-
- Button browseButton = new Button(composite, SWT.PUSH);
- browseButton.setText(JptUiMessages.JpaMakePersistentWizardPage_mappingFileBrowseButton);
- browseButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- mappingFileBrowseButtonPressed();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // Do nothing
- }
- });
-
- SWTTools.controlEnabledState(new ListInOrmMappingFileModel(this.annotateInJavaModel), mappingFileLink, mappingFileText, browseButton);
-
- return composite;
- }
-
- private Text createText(Composite container, int span) {
- Text text = new Text(container, SWT.BORDER | SWT.SINGLE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.horizontalSpan = span;
- gd.grabExcessHorizontalSpace = true;
- text.setLayoutData(gd);
- return text;
- }
-
- private void mappingFileBrowseButtonPressed() {
- ViewerFilter filter = buildMappingFileDialogViewerFilter();
- ITreeContentProvider contentProvider = new WorkbenchContentProvider();
- ILabelProvider labelProvider = new WorkbenchLabelProvider();
- SelectMappingFileDialog dialog = new SelectMappingFileDialog(getShell(), this.jpaProject.getProject(), labelProvider, contentProvider);
- dialog.setTitle(EntityWizardMsg.MAPPING_XML_TITLE);
- dialog.setMessage(EntityWizardMsg.CHOOSE_MAPPING_XML_MESSAGE);
- dialog.addFilter(filter);
-
- JpaXmlResource resource = this.jpaProject.getMappingFileXmlResource(new Path(getMappingFileLocation()));
- IFile initialSelection = (resource != null) ? resource.getFile() : null;
- dialog.setInput(this.jpaProject.getProject());
-
- if (initialSelection != null) {
- dialog.setInitialSelection(initialSelection);
- }
- if (dialog.open() == Window.OK) {
- this.mappingFileModel.setValue(dialog.getChosenName());
- //have to validate in case the file name did not actually change, but the xml file was created
- validate();
- }
- }
-
- /**
- * This method create filter for the browse/add alternative mapping XML
- * @return new instance of viewer filter for the SelectMappingXMLDialog
- */
- protected ViewerFilter buildMappingFileDialogViewerFilter() {
- return new XmlMappingFileViewerFilter(this.jpaProject, JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE);
- }
-
- private void openNewMappingFileWizard() {
- IPath path = EmbeddedMappingFileWizard.createNewMappingFile(
- new StructuredSelection(this.jpaProject.getProject()),
- getMappingFileName());
- if (path != null) {
- this.mappingFileModel.setValue(path.toString());
- //have to validate in case the file name did not actually change, but the xml file was created
- this.validate();
- }
- }
-
- protected void createTypeTableColumn() {
- TableViewerColumn column = new TableViewerColumn(this.classTableViewer, SWT.NONE);
- column.getColumn().setWidth(200);
- column.getColumn().setText(JptUiMessages.JpaMakePersistentWizardPage_typeTableColumn);
- column.setLabelProvider(this.buildTypeColumnLabelProvider());
- }
-
- protected ColumnLabelProvider buildTypeColumnLabelProvider() {
- return new TypeColumnLabelProvider();
- }
-
- protected void createMappingTableColumn() {
- TableViewerColumn column;
- column = new TableViewerColumn(this.classTableViewer, SWT.NONE);
- column.getColumn().setWidth(200);
- column.getColumn().setText(JptUiMessages.JpaMakePersistentWizardPage_mappingTableColumn);
-
- column.setEditingSupport(new EditingSupport(this.classTableViewer) {
- @Override
- protected Object getValue(Object element) {
- return getMappingUiDefinition(((Type) element).mappingKey);
- }
-
- @Override
- protected void setValue(Object element, Object value) {
- ((Type) element).setMappingKey(((MappingUiDefinition<?, ?>) value).getKey());
- getViewer().update(element, null);
- }
-
- @Override
- protected CellEditor getCellEditor(Object element) {
- final ComboBoxViewerCellEditor comboCellEditor =
- new ComboBoxViewerCellEditor((Composite) JpaMakePersistentWizardPage.this.classTableViewer.getControl());
-
- comboCellEditor.setLabelProvider(buildMappingComboCellEditorLabelProvider());
- comboCellEditor.setContentProvider(buildMappingComboCellEditorContentProvider());
- comboCellEditor.setInput(element);
- return comboCellEditor;
- }
-
- @Override
- protected boolean canEdit(Object element) {
- return true;
- }
- });
-
- column.setLabelProvider(buildMappingColumnLabelProvider());
- }
-
- //The ComboBoxViewerCellEditor does not support the image, so no reason to implement getImage(Object)
- protected ColumnLabelProvider buildMappingComboCellEditorLabelProvider() {
- return new ColumnLabelProvider() {
- @Override
- public String getText(Object element) {
- return ((MappingUiDefinition<?, ?>) element).getLabel();
- }
- };
- }
-
- protected IStructuredContentProvider buildMappingComboCellEditorContentProvider() {
- return new IStructuredContentProvider() {
- public Object[] getElements(Object inputElement) {
- return CollectionTools.collection(((Type) inputElement).typeMappingUiDefinitions()).toArray();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
- //do nothing
- }
-
- public void dispose() {
- //do nothing
- }
- };
- }
-
- protected ColumnLabelProvider buildMappingColumnLabelProvider() {
- return new ColumnLabelProvider() {
- @Override
- public String getText(Object element) {
- MappingUiDefinition<? extends PersistentType, ?> mappingUiDefinition = getMappingUiDefinition(((Type) element).mappingKey);
- return mappingUiDefinition.getLabel();
- }
-
- @Override
- public Image getImage(Object element) {
- MappingUiDefinition<? extends PersistentType, ?> mappingUiDefinition = getMappingUiDefinition(((Type) element).mappingKey);
- return mappingUiDefinition.getImage();
- }
- };
- }
-
- protected MappingUiDefinition<? extends PersistentType, ?> getMappingUiDefinition(String mappingKey) {
- for (MappingUiDefinition<? extends PersistentType, ?> provider : typeMappingUiDefinitions(this.jptResourceType)) {
- if (provider.getKey() == mappingKey) {
- return provider;
- }
- }
- throw new IllegalArgumentException();
- }
-
- protected Iterable<String> typeMappingKeys(Iterable<? extends MappingUiDefinition<? extends PersistentType, ?>> mappingUiDefinitions) {
- return new TransformationIterable<MappingUiDefinition<? extends PersistentType, ?>, String>(mappingUiDefinitions) {
- @Override
- protected String transform(MappingUiDefinition<? extends PersistentType, ?> next) {
- return next.getKey();
- }
- };
- }
-
- protected Iterable<? extends MappingUiDefinition<? extends PersistentType, ?>> typeMappingUiDefinitions(JptResourceType jpaResourceType) {
- return CollectionTools.iterable(getJpaPlatformUi().typeMappingUiDefinitions(jpaResourceType));
- }
-
- protected void validate() {
- String errorMessage = null;
- if (this.selectedTypes.length == 0) {
- errorMessage = JptUiMessages.JpaMakePersistentWizardPage_selectedTypesPersistentError;
- }
- else if (this.isAddToOrmMappingFile()) {
- JpaXmlResource ormXmlResource = getOrmXmlResource();
- if (ormXmlResource == null) {
- errorMessage = JptUiMessages.JpaMakePersistentWizardPage_mappingFileDoesNotExistError;
- }
- else if (getJpaProject().getJpaFile(ormXmlResource.getFile()).getRootStructureNodesSize() == 0) {
- errorMessage = JptUiMessages.JpaMakePersistentWizardPage_mappingFileNotListedInPersistenceXmlError;
- }
- }
- setErrorMessage(errorMessage);
- setPageComplete(errorMessage == null);
- }
-
- @Override
- public final void performHelp() {
- PlatformUI.getWorkbench().getHelpSystem().displayHelp( this.helpContextId );
- }
-
- protected void performFinish() throws InvocationTargetException {
- if (this.isAddToOrmMappingFile()) {
- this.performAddToOrmXml();
- }
- else {
- this.performAnnotateInJava();
- }
- }
-
- private void performAddToOrmXml() throws InvocationTargetException {
- this.perform(new AddToOrmXmlRunnable(this.getJpaProject(), this.getOrmXmlResource(), this.selectedTypes));
- try {
- this.openEditor(this.getOrmXmlResource().getFile());
- }
- catch (Exception cantOpen) {
- throw new InvocationTargetException(cantOpen);
- }
- }
-
- private void performAnnotateInJava() {
- this.perform(new AnnotateInJavaRunnable(this.getJpaProject(), this.selectedTypes, this.isListInPersistenceXml()));
- }
-
- private void perform(IRunnableWithProgress runnable) {
- try {
- this.buildProgressMonitorDialog().run(true, true, runnable); // true => fork; true => cancellable
- } catch (InvocationTargetException ex) {
- JptJpaUiPlugin.log(ex);
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt();
- JptJpaUiPlugin.log(ex);
- }
- }
-
- private ProgressMonitorDialog buildProgressMonitorDialog() {
- return new ProgressMonitorDialog(null);
- }
-
- private void openEditor(final IFile file) {
- if (file != null) {
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- JptJpaUiPlugin.log(e);
- }
- }
- });
- }
- }
-
- protected JpaXmlResource getOrmXmlResource() {
- return this.getJpaProject().getMappingFileXmlResource(new Path(this.getMappingFileLocation()));
- }
-
- protected boolean isListInPersistenceXml() {
- return this.listInPersistenceXmlModel.getValue().booleanValue();
- }
-
- protected boolean isAnnotateInJavaModel() {
- return this.annotateInJavaModel.getValue().booleanValue();
- }
-
- protected boolean isAddToOrmMappingFile() {
- return !isAnnotateInJavaModel();
- }
-
- protected String getMappingFileLocation() {
- return this.mappingFileModel.getValue();
- }
-
- protected String getMappingFileName() {
- return new File(getMappingFileLocation()).getName();
- }
-
- private class Type implements AbstractPersistenceUnit.MappedType {
-
- private final IType jdtType;
-
- private String mappingKey;
-
- protected Type(IType jdtType) {
- super();
- this.jdtType = jdtType;
- this.mappingKey = MappingKeys.ENTITY_TYPE_MAPPING_KEY;
- }
-
- public String getFullyQualifiedName() {
- return this.jdtType.getFullyQualifiedName();
- }
-
- public String getMappingKey() {
- return this.mappingKey;
- }
-
- protected void setMappingKey(String mappingKey) {
- this.mappingKey = mappingKey;
- }
-
- protected Iterable<? extends MappingUiDefinition<? extends PersistentType, ?>> typeMappingUiDefinitions() {
- return CollectionTools.iterable(getJpaPlatformUi().typeMappingUiDefinitions(JpaMakePersistentWizardPage.this.jptResourceType));
- }
- }
-
- private final class TypeContentProvider implements IStructuredContentProvider
- {
- public Object[] getElements(Object inputElement){
- return (Type[]) inputElement;
- }
-
- public void dispose(){}
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput){}
-
- }
-
- private final class TypeColumnLabelProvider extends ColumnLabelProvider
- {
- private final JavaElementLabelProvider javaElementLabelProvider =
- new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_POST_QUALIFIED
- | JavaElementLabelProvider.SHOW_SMALL_ICONS
- | JavaElementLabelProvider.SHOW_OVERLAY_ICONS);
-
- @Override
- public String getText(Object element) {
- return this.javaElementLabelProvider.getText(((Type) element).jdtType);
- }
-
- @Override
- public Image getImage(Object element) {
- return this.javaElementLabelProvider.getImage(((Type) element).jdtType);
- }
- }
-
- private final class TypeComparator extends ViewerComparator {
- private final JavaElementComparator javaElementComparator = new JavaElementComparator();
-
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- return this.javaElementComparator.compare(viewer, ((Type) e1).jdtType, ((Type) e2).jdtType);
- }
- }
-
- static class ListInOrmMappingFileModel
- extends AspectPropertyValueModelAdapter<Boolean, Boolean>
- {
- ListInOrmMappingFileModel(PropertyValueModel<Boolean> annotateInJavaModel) {
- super(annotateInJavaModel);
- }
-
- @Override
- protected Boolean buildValue_() {
- return Boolean.valueOf(!this.subject.booleanValue());
- }
-
- @Override
- protected void engageSubject_() {/*nothing*/}
- @Override
- protected void disengageSubject_() {/*nothing*/}
- }
-
-
- // ********** add to orm.xml runnable **********
-
- /**
- * This is dispatched to the progress monitor dialog.
- */
- /* CU private */ static class AddToOrmXmlRunnable
- implements IRunnableWithProgress
- {
- private final JpaProject jpaProject;
- private final JpaXmlResource ormXmlResource;
- private final AbstractPersistenceUnit.MappedType[] selectedTypes;
-
- AddToOrmXmlRunnable(JpaProject jpaProject, JpaXmlResource ormXmlResource, AbstractPersistenceUnit.MappedType[] selectedTypes) {
- super();
- this.jpaProject = jpaProject;
- this.ormXmlResource = ormXmlResource;
- this.selectedTypes = selectedTypes;
- }
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- this.run_(monitor);
- } catch (CoreException ex) {
- throw new InvocationTargetException(ex);
- }
- }
-
- private void run_(IProgressMonitor monitor) throws CoreException {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- // lock the orm.xml resource, it is the only thing we will be modifying.
- ISchedulingRule rule = workspace.getRuleFactory().modifyRule(this.ormXmlResource.getFile());
- workspace.run(
- new AddToOrmXmlWorkspaceRunnable(this.jpaProject, this.ormXmlResource, this.selectedTypes),
- rule,
- IWorkspace.AVOID_UPDATE,
- monitor
- );
- }
- }
-
-
- // ********** add to orm.xml workspace runnable **********
-
- /**
- * This is dispatched to the Eclipse workspace.
- */
- /* CU private */ static class AddToOrmXmlWorkspaceRunnable
- implements IWorkspaceRunnable
- {
- private final JpaProject jpaProject;
- private final JpaXmlResource ormXmlResource;
- private final AbstractPersistenceUnit.MappedType[] selectedTypes;
-
- AddToOrmXmlWorkspaceRunnable(JpaProject jpaProject, JpaXmlResource ormXmlResource, AbstractPersistenceUnit.MappedType[] selectedTypes) {
- super();
- this.jpaProject = jpaProject;
- this.ormXmlResource = ormXmlResource;
- this.selectedTypes = selectedTypes;
- }
-
- public void run(IProgressMonitor monitor) {
- if (monitor.isCanceled()) {
- return;
- }
- Command addToOrmXmlCommand = new AddToOrmXmlCommand(this.getEntityMappings(),this.selectedTypes, monitor);
- try {
- this.getJpaProjectManager().execute(addToOrmXmlCommand, SynchronousUiCommandExecutor.instance());
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt(); // skip save?
- throw new RuntimeException(ex);
- }
- this.ormXmlResource.save();
- }
-
- protected EntityMappings getEntityMappings() {
- return (EntityMappings) this.jpaProject.getJpaFile(this.ormXmlResource.getFile()).getRootStructureNodes().iterator().next();
- }
-
- private JpaProjectManager getJpaProjectManager() {
- return (JpaProjectManager) this.getWorkspace().getAdapter(JpaProjectManager.class);
- }
-
- private IProject getProject() {
- return this.jpaProject.getProject();
- }
-
- private IWorkspace getWorkspace() {
- return this.getProject().getWorkspace();
- }
- }
-
-
- // ********** add to orm.xml command **********
-
- /**
- * This is dispatched to the JPA project manager.
- */
- /* CU private */ static class AddToOrmXmlCommand
- implements Command
- {
- private final EntityMappings entityMappings;
- private final AbstractPersistenceUnit.MappedType[] selectedTypes;
- private final IProgressMonitor monitor;
-
- AddToOrmXmlCommand(EntityMappings entityMappings, AbstractPersistenceUnit.MappedType[] selectedTypes, IProgressMonitor monitor) {
- super();
- this.entityMappings = entityMappings;
- this.selectedTypes = selectedTypes;
- this.monitor = monitor;
- }
-
- public void execute() {
- //TODO add API to EntityMappings - added this post-M6
- ((AbstractEntityMappings) this.entityMappings).addPersistentTypes(this.selectedTypes, this.monitor);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.selectedTypes);
- }
- }
-
-
- // ********** annotate in Java runnable **********
-
- /**
- * This is dispatched to the progress monitor dialog.
- */
- /* CU private */ static class AnnotateInJavaRunnable
- implements IRunnableWithProgress
- {
- private final JpaProject jpaProject;
- private final AbstractPersistenceUnit.MappedType[] selectedTypes;
- private final boolean listInPersistenceXml;
-
- AnnotateInJavaRunnable(JpaProject jpaProject, AbstractPersistenceUnit.MappedType[] selectedTypes, boolean listInPersistenceXml) {
- super();
- this.jpaProject = jpaProject;
- this.selectedTypes = selectedTypes;
- this.listInPersistenceXml = listInPersistenceXml;
- }
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- try {
- this.run_(monitor);
- } catch (CoreException ex) {
- throw new InvocationTargetException(ex);
- }
- }
-
- private void run_(IProgressMonitor monitor) throws CoreException {
- IWorkspace workspace = ResourcesPlugin.getWorkspace();
- // lock the entire project, since we could be modifying multiple java files and the persistence.xml file
- ISchedulingRule rule = workspace.getRuleFactory().modifyRule(this.jpaProject.getProject());
- workspace.run(
- new AnnotateInJavaWorkspaceRunnable(this.jpaProject, this.selectedTypes, this.listInPersistenceXml),
- rule,
- IWorkspace.AVOID_UPDATE,
- monitor
- );
- }
- }
-
-
- // ********** annotate in Java workspace runnable **********
-
- /**
- * This is dispatched to the Eclipse workspace.
- */
- /* CU private */ static class AnnotateInJavaWorkspaceRunnable
- implements IWorkspaceRunnable
- {
- private final JpaProject jpaProject;
- private final AbstractPersistenceUnit.MappedType[] selectedTypes;
- private final boolean listInPersistenceXml;
-
- AnnotateInJavaWorkspaceRunnable(JpaProject jpaProject, AbstractPersistenceUnit.MappedType[] selectedTypes, boolean listInPersistenceXml) {
- super();
- this.jpaProject = jpaProject;
- this.selectedTypes = selectedTypes;
- this.listInPersistenceXml = listInPersistenceXml;
- }
-
- public void run(IProgressMonitor monitor) {
- if (monitor.isCanceled()) {
- return;
- }
- PersistenceUnit persistenceUnit = this.getPersistenceUnit();
- if (persistenceUnit == null) {
- return; //unlikely...
- }
- Command annotateInJavaCommand = new AnnotateInJavaCommand(persistenceUnit, this.selectedTypes, this.listInPersistenceXml, monitor);
- try {
- this.getJpaProjectManager().execute(annotateInJavaCommand, SynchronousUiCommandExecutor.instance());
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt(); // skip save?
- throw new RuntimeException(ex);
- }
- if (this.listInPersistenceXml) {
- JpaXmlResource persistenceXmlResource = this.jpaProject.getPersistenceXmlResource();
- if (persistenceXmlResource != null) {
- persistenceXmlResource.save();
- }
- }
- }
-
- protected PersistenceUnit getPersistenceUnit() {
- Persistence p = this.getPersistence();
- if (p == null) {
- return null;
- }
- ListIterator<PersistenceUnit> units = p.getPersistenceUnits().iterator();
- return units.hasNext() ? units.next() : null;
- }
-
- protected Persistence getPersistence() {
- PersistenceXml pxml = this.getPersistenceXml();
- return (pxml == null) ? null : pxml.getPersistence();
- }
-
- protected PersistenceXml getPersistenceXml() {
- JpaRootContextNode rcn = this.jpaProject.getRootContextNode();
- return (rcn == null) ? null : rcn.getPersistenceXml();
- }
-
-
- private JpaProjectManager getJpaProjectManager() {
- return (JpaProjectManager) this.getWorkspace().getAdapter(JpaProjectManager.class);
- }
-
- private IProject getProject() {
- return this.jpaProject.getProject();
- }
-
- private IWorkspace getWorkspace() {
- return this.getProject().getWorkspace();
- }
- }
-
-
- // ********** annotate in Java command **********
-
- /**
- * This is dispatched to the JPA project manager.
- */
- /* CU private */ static class AnnotateInJavaCommand
- implements Command
- {
- private final PersistenceUnit persistenceUnit;
- private final AbstractPersistenceUnit.MappedType[] selectedTypes;
- private final boolean listInPersistenceXml;
- private final IProgressMonitor monitor;
-
- AnnotateInJavaCommand(PersistenceUnit persistenceUnit, AbstractPersistenceUnit.MappedType[] selectedTypes, boolean listInPersistenceXml, IProgressMonitor monitor) {
- super();
- this.persistenceUnit = persistenceUnit;
- this.selectedTypes = selectedTypes;
- this.listInPersistenceXml = listInPersistenceXml;
- this.monitor = monitor;
- }
-
- public void execute() {
- //TODO add API to PersistenceUnit - added this post-M6
- ((AbstractPersistenceUnit) this.persistenceUnit).addPersistentTypes(this.selectedTypes, this.listInPersistenceXml, this.monitor);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.selectedTypes);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/NewEntityDropDownAction.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/NewEntityDropDownAction.java
deleted file mode 100644
index dc5484761d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/NewEntityDropDownAction.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2010 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
- * Oracle - copied and modified from NewJavaEEDropDownAction and NewTypeDropDownAction
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.Platform;
-
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.Shell;
-
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IMenuCreator;
-import org.eclipse.jface.layout.PixelConverter;
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowPulldownDelegate2;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-
-import org.eclipse.jdt.ui.actions.AbstractOpenWizardAction;
-import org.eclipse.jdt.internal.ui.util.CoreUtility;
-
-
-/**
- * A type wizard is added to the type drop down if it has a paramater 'javatype':
- * <wizard
- * name="My JPT Wizard"
- * icon="icons/wiz.gif"
- * category="mycategory"
- * id="xx.MyWizard">
- * <class class="org.xx.MyWizard">
- * <parameter name="jptartifact" value="true"/>
- * </class>
- * <description>
- * My JPT Wizard
- * </description>
- * </wizard>
- */
-public class NewEntityDropDownAction extends Action implements IMenuCreator, IWorkbenchWindowPulldownDelegate2 {
-
- public static class OpenJptWizardAction extends AbstractOpenWizardAction implements Comparable<Object> {
-
- private final static String ATT_NAME = "name";//$NON-NLS-1$
- private final static String ATT_CLASS = "class";//$NON-NLS-1$
- private final static String ATT_ICON = "icon";//$NON-NLS-1$
- private static final String TAG_DESCRIPTION = "description"; //$NON-NLS-1$
-
- private IConfigurationElement fConfigurationElement;
- private int menuIndex;
-
- public OpenJptWizardAction(IConfigurationElement element) {
- this.fConfigurationElement= element;
- setText(element.getAttribute(ATT_NAME));
-
- String description= getDescriptionFromConfig(this.fConfigurationElement);
- setDescription(description);
- setToolTipText(description);
- setImageDescriptor(getIconFromConfig(this.fConfigurationElement));
- setMenuIndex(getMenuIndexFromConfig(this.fConfigurationElement));
- }
-
- private String getDescriptionFromConfig(IConfigurationElement config) {
- IConfigurationElement [] children = config.getChildren(TAG_DESCRIPTION);
- if (children.length>=1) {
- return children[0].getValue();
- }
- return ""; //$NON-NLS-1$
- }
-
- private ImageDescriptor getIconFromConfig(IConfigurationElement config) {
- String iconName = config.getAttribute(ATT_ICON);
- if (iconName != null) {
- return AbstractUIPlugin.imageDescriptorFromPlugin(config.getContributor().getName(), iconName);
- }
- return null;
- }
-
- private int getMenuIndexFromConfig(IConfigurationElement config) {
- IConfigurationElement[] classElements = config.getChildren(TAG_CLASS);
- if (classElements.length > 0) {
- for (IConfigurationElement classElement : classElements) {
- IConfigurationElement[] paramElements = classElement.getChildren(TAG_PARAMETER);
- for (IConfigurationElement paramElement : paramElements) {
- if (ATT_MENUINDEX.equals(paramElement.getAttribute(TAG_NAME))) {
- return Integer.parseInt(paramElement.getAttribute(TAG_VALUE));
- }
- }
- }
- }
- return Integer.MAX_VALUE;
- }
-
- @Override
- public void run() {
- Shell shell = getShell();
- try {
- INewWizard wizard = createWizard();
- wizard.init(PlatformUI.getWorkbench(), getSelection());
-
- WizardDialog dialog = new WizardDialog(shell, wizard);
- PixelConverter converter = new PixelConverter(JFaceResources.getDialogFont());
- dialog.setMinimumPageSize(converter.convertWidthInCharsToPixels(70), converter.convertHeightInCharsToPixels(20));
- dialog.create();
- int res = dialog.open();
-
- notifyResult(res == Window.OK);
- } catch (CoreException e) {
- JptJpaUiPlugin.log(e);
- }
- }
-
- @Override
- protected INewWizard createWizard() throws CoreException {
- return (INewWizard) CoreUtility.createExtension(fConfigurationElement, ATT_CLASS);
- }
-
- public int getMenuIndex() {
- return this.menuIndex;
- }
-
- public void setMenuIndex(int menuIndex) {
- this.menuIndex = menuIndex;
- }
-
- public int compareTo(Object o) {
- OpenJptWizardAction action = (OpenJptWizardAction) o;
- return getMenuIndex() - action.getMenuIndex();
- }
-
- }
-
-
-
- private final static String TAG_WIZARD = "wizard";//$NON-NLS-1$
- private final static String ATT_JPTARTIFACT = "jptartifact";//$NON-NLS-1$
-
- private final static String TAG_PARAMETER = "parameter";//$NON-NLS-1$
- private final static String TAG_NAME = "name";//$NON-NLS-1$
- private final static String TAG_VALUE = "value";//$NON-NLS-1$
- protected final static String ATT_MENUINDEX = "menuIndex";//$NON-NLS-1$
-
- private static final String PL_NEW = "newWizards"; //$NON-NLS-1$
- private static final String TAG_CLASS = "class"; //$NON-NLS-1$
-
- private Menu fMenu;
-
- private Shell fWizardShell;
-
- public NewEntityDropDownAction() {
- this.fMenu= null;
- setMenuCreator(this);
- //PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJavaHelpContextIds.OPEN_CLASS_WIZARD_ACTION);
- }
-
- public void dispose() {
- if (this.fMenu != null) {
- this.fMenu.dispose();
- this.fMenu= null;
- }
- }
-
- public Menu getMenu(Menu parent) {
- return null;
- }
-
- public Menu getMenu(Control parent) {
- if (this.fMenu == null) {
- this.fMenu = new Menu(parent);
- OpenJptWizardAction[] actions = getActionFromDescriptors();
- for (int i = 0; i < actions.length; i++) {
- OpenJptWizardAction curr = actions[i];
- curr.setShell(this.fWizardShell);
- ActionContributionItem item = new ActionContributionItem(curr);
- item.fill(this.fMenu, -1);
- }
-
- }
- return this.fMenu;
- }
-
- @Override
- public void run() {
- getDefaultAction().run();
- }
-
- public Action getDefaultAction() {
- Action[] actions = getActionFromDescriptors();
- if (actions.length > 0)
- return actions[0];
- return null;
- }
-
- public static OpenJptWizardAction[] getActionFromDescriptors() {
- ArrayList<OpenJptWizardAction> containers= new ArrayList<OpenJptWizardAction>();
-
- IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(PlatformUI.PLUGIN_ID, PL_NEW);
- if (extensionPoint != null) {
- IConfigurationElement[] elements = extensionPoint.getConfigurationElements();
- for (int i = 0; i < elements.length; i++) {
- IConfigurationElement element= elements[i];
- if (element.getName().equals(TAG_WIZARD) && isJptArtifactWizard(element)) {
- containers.add(new OpenJptWizardAction(element));
- }
- }
- }
- OpenJptWizardAction[] actions = containers.toArray(new OpenJptWizardAction[containers.size()]);
- Arrays.sort(actions);
- return actions;
- }
-
- private static boolean isJptArtifactWizard(IConfigurationElement element) {
- IConfigurationElement[] classElements= element.getChildren(TAG_CLASS);
- if (classElements.length > 0) {
- for (int i= 0; i < classElements.length; i++) {
- IConfigurationElement[] paramElements= classElements[i].getChildren(TAG_PARAMETER);
- for (int k = 0; k < paramElements.length; k++) {
- IConfigurationElement curr= paramElements[k];
- if (ATT_JPTARTIFACT.equals(curr.getAttribute(TAG_NAME))) {
- return Boolean.valueOf(curr.getAttribute(TAG_VALUE)).booleanValue();
- }
- }
- }
- }
- return false;
- }
-
- public void init(IWorkbenchWindow window) {
- fWizardShell= window.getShell();
- }
-
- public void run(IAction action) {
- run();
- }
-
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/SelectMappingFileDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/SelectMappingFileDialog.java
deleted file mode 100644
index 5e27540411..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/SelectMappingFileDialog.java
+++ /dev/null
@@ -1,142 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.wizards.orm.EmbeddedMappingFileWizard;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-
-public class SelectMappingFileDialog
- extends ElementTreeSelectionDialog
-{
- protected final IProject project;
-
- protected Label messageLabel;
- protected Tree treeWidget;
-
-
- public SelectMappingFileDialog(Shell parent, IProject project) {
- this(parent, project, new WorkbenchLabelProvider(), new WorkbenchContentProvider());
- }
-
- public SelectMappingFileDialog(Shell parent, IProject project, ILabelProvider labelProvider, ITreeContentProvider contentProvider) {
- super(parent, labelProvider, contentProvider);
- setAllowMultiple(false);
- this.project = project;
- }
-
- @Override
- protected Control createDialogArea(Composite parent) {
- Composite composite = (Composite) super.createDialogArea(parent);
- Button newButton = new Button(composite, SWT.PUSH);
- newButton.setText(JptUiMessages.SelectMappingFileDialog_newButton);
- GridData browseButtonData = new GridData(GridData.HORIZONTAL_ALIGN_END);
- newButton.setLayoutData(browseButtonData);
- newButton.setToolTipText(JptUiMessages.SelectMappingFileDialog_newButtonToolTip);
- newButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- openNewMappingFileWizard();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- return composite;
- }
-
- @Override
- protected Label createMessageArea(Composite composite) {
- this.messageLabel = super.createMessageArea(composite);
- return this.messageLabel;
- }
-
- @Override
- protected TreeViewer createTreeViewer(Composite parent) {
- TreeViewer treeViewer = super.createTreeViewer(parent);
- this.treeWidget = treeViewer.getTree();
- return treeViewer;
- }
-
- public String getChosenName() {
- IPath resourcePath = null;
- Object element = getFirstResult();
- if(element instanceof IContainer) {
- resourcePath = ((IContainer) element).getFullPath();
- } else {
- resourcePath = ((IFile) element).getFullPath();
- }
- return this.getProjectResourceLocator().getRuntimePath(resourcePath).toString();
- }
-
- @Override
- /*
- * @see ElementTreeSelectionDialog#updateOKStatus(Composite)
- */
- protected void updateOKStatus() {
- super.updateOKStatus();
- TreeSelection selection = (TreeSelection)getTreeViewer().getSelection();
- IResource selectedResource = (IResource) selection.getFirstElement();
- if (selectedResource instanceof IFile) {
- updateStatus(new Status(IStatus.OK, JptJpaUiPlugin.PLUGIN_ID, "")); //$NON-NLS-1$
- }
- else {
- updateStatus(new Status(IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID, "")); //$NON-NLS-1$
- }
- }
-
- protected void openNewMappingFileWizard() {
- IPath path = EmbeddedMappingFileWizard.createNewMappingFile(new StructuredSelection(this.project));
- updateDialog(path);
- }
-
- protected void updateDialog(IPath path) {
- if (path != null) {
- //these are disabled if the tree is empty when the dialog is created.
- this.messageLabel.setEnabled(true);
- this.treeWidget.setEnabled(true);
- IFile file = this.getProjectResourceLocator().getPlatformFile(path);
- getTreeViewer().refresh();
- getTreeViewer().setSelection(new StructuredSelection(file), true);
- }
- }
-
-
-
- protected ProjectResourceLocator getProjectResourceLocator() {
- return (ProjectResourceLocator) this.project.getAdapter(ProjectResourceLocator.class);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaGeneratorConversionWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaGeneratorConversionWizardPage.java
deleted file mode 100644
index 3b549a5022..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaGeneratorConversionWizardPage.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-
-public class GenericJavaGeneratorConversionWizardPage
- extends GenericJavaMetadataConversionWizardPage
-{
- public GenericJavaGeneratorConversionWizardPage(JpaProject jpaProject) {
- super(jpaProject, JptUiMessages.JavaGeneratorConversionWizardPage_title, JptUiMessages.JavaGeneratorConversionWizardPage_description);
- }
-
- @Override
- protected boolean hasConvertibleJavaMetadata_() {
- return this.persistenceUnit.hasConvertibleJavaGenerators();
- }
-
- @Override
- protected String getMissingJavaMetadataWarningMessage() {
- return JptUiMessages.JavaMetadataConversion_noGeneratorsToConvert;
- }
-
- @Override
- protected ConversionCommand.Strategy getConversionCommandStrategy() {
- return CONVERSION_COMMAND_STRATEGY;
- }
-
- public static final ConversionCommandStrategy CONVERSION_COMMAND_STRATEGY = new ConversionCommandStrategy();
-
- protected static class ConversionCommandStrategy
- implements ConversionCommand.Strategy
- {
- public void execute(EntityMappings entityMappings, IProgressMonitor monitor) {
- entityMappings.getPersistenceUnit().convertJavaGenerators(entityMappings, monitor);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaMetadataConversionWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaMetadataConversionWizardPage.java
deleted file mode 100644
index cb5c6c253f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaMetadataConversionWizardPage.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.ui.internal.wizards.SelectMappingFileDialog;
-import org.eclipse.jpt.jpa.ui.internal.wizards.orm.EmbeddedMappingFileWizard;
-
-public abstract class GenericJavaMetadataConversionWizardPage
- extends JavaMetadataConversionWizardPage
-{
- public GenericJavaMetadataConversionWizardPage(JpaProject jpaProject, String title, String description) {
- super(jpaProject, title, description);
- }
-
- @Override
- protected IPath getDefaultMappingFileRuntimPath() {
- return JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH;
- }
-
- @Override
- protected IContentType getMappingFileContentType() {
- return JptJpaCorePlugin.ORM_XML_CONTENT_TYPE;
- }
-
- @Override
- protected IPath openNewMappingFileWizard() {
- return EmbeddedMappingFileWizard.createNewMappingFile(new StructuredSelection(this.jpaProject.getProject()));
- }
-
- @Override
- protected SelectMappingFileDialog buildSelectMappingFileDialog(){
- return new SelectMappingFileDialog(this.getShell(), this.jpaProject.getProject());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaQueryConversionWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaQueryConversionWizardPage.java
deleted file mode 100644
index 5e9412a13f..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/GenericJavaQueryConversionWizardPage.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-
-public class GenericJavaQueryConversionWizardPage
- extends GenericJavaMetadataConversionWizardPage
-{
- public GenericJavaQueryConversionWizardPage(JpaProject jpaProject) {
- super(jpaProject, JptUiMessages.JavaQueryConversionWizardPage_title, JptUiMessages.JavaQueryConversionWizardPage_description);
- }
-
- @Override
- protected boolean hasConvertibleJavaMetadata_() {
- return this.persistenceUnit.hasConvertibleJavaQueries();
- }
-
- @Override
- protected String getMissingJavaMetadataWarningMessage() {
- return JptUiMessages.JavaMetadataConversion_noQueriesToConvert;
- }
-
- @Override
- protected ConversionCommand.Strategy getConversionCommandStrategy() {
- return CONVERSION_COMMAND_STRATEGY;
- }
-
- public static final ConversionCommandStrategy CONVERSION_COMMAND_STRATEGY = new ConversionCommandStrategy();
-
- protected static class ConversionCommandStrategy
- implements ConversionCommand.Strategy
- {
- public void execute(EntityMappings entityMappings, IProgressMonitor monitor) {
- entityMappings.getPersistenceUnit().convertJavaQueries(entityMappings, monitor);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizard.java
deleted file mode 100644
index fa2d215d37..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizard.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-
-public class JavaMetadataConversionWizard
- extends Wizard
-{
- private final JavaMetadataConversionWizardPage page;
-
-
- public JavaMetadataConversionWizard(JavaMetadataConversionWizardPage page) {
- super();
- if (page == null) {
- throw new NullPointerException();
- }
- this.page = page;
- this.setWindowTitle(JptUiMessages.JavaMetadataConversionWizard_title);
- this.setDefaultPageImageDescriptor(JptJpaUiPlugin.getImageDescriptor(JptUiIcons.JPA_FILE_WIZ_BANNER));
- }
-
- @Override
- public void addPages() {
- this.addPage(this.page);
- }
-
- @Override
- public boolean performFinish() {
- return this.page.performFinish();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizardPage.java
deleted file mode 100644
index 159ee0d120..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/conversion/java/JavaMetadataConversionWizardPage.java
+++ /dev/null
@@ -1,625 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.conversion.java;
-
-import java.lang.reflect.InvocationTargetException;
-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.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.core.runtime.jobs.ISchedulingRule;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.core.internal.utility.WorkspaceRunnableAdapter;
-import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.utility.SynchronousUiCommandExecutor;
-import org.eclipse.jpt.common.ui.internal.utility.swt.SWTTools;
-import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaProjectManager;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.MappingFile;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.jface.XmlMappingFileViewerFilter;
-import org.eclipse.jpt.jpa.ui.internal.wizards.SelectMappingFileDialog;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Link;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-
-public abstract class JavaMetadataConversionWizardPage
- extends WizardPage
-{
- /**
- * The JPA project can<em>not</em> be <code>null</code>.
- */
- protected final JpaProject jpaProject;
-
- /**
- * The persistence unit can be <code>null</code>.
- */
- protected final PersistenceUnit persistenceUnit;
- protected final boolean noConvertibleJavaMetadata;
-
- private final SimplePropertyValueModel<String> mappingFileNameModel = new SimplePropertyValueModel<String>();
-
- private static final String PAGE_NAME = "JavaMetadataConversion"; //$NON-NLS-1$
- public static final String HELP_CONTEXT_ID = JptJpaUiPlugin.PLUGIN_ID_ + PAGE_NAME;
-
-
- protected JavaMetadataConversionWizardPage(JpaProject jpaProject, String title, String description) {
- super(PAGE_NAME);
- if (jpaProject == null) {
- throw new NullPointerException();
- }
- this.jpaProject = jpaProject;
- this.persistenceUnit = this.buildPersistenceUnit();
- this.mappingFileNameModel.setValue(this.buildDefaultMappingFileName());
- this.setTitle(title);
- this.setDescription(description);
- this.noConvertibleJavaMetadata = this.hasNoConvertibleJavaMetadata();
- }
-
- /**
- * Return the JPA project's <em>first</em> persistence unit.
- */
- protected PersistenceUnit buildPersistenceUnit() {
- PersistenceXml persistenceXml = this.jpaProject.getRootContextNode().getPersistenceXml();
- if (persistenceXml == null) {
- return null;
- }
- Persistence persistence = persistenceXml.getPersistence();
- if (persistence == null) {
- return null;
- }
- Iterator<PersistenceUnit> stream = persistence.getPersistenceUnits().iterator();
- return stream.hasNext() ? stream.next() : null;
- }
-
- protected String buildDefaultMappingFileName() {
- IPath path = this.buildDefaultMappingFilePath();
- return (path == null) ? null : path.toString();
- }
-
- protected IPath buildDefaultMappingFilePath() {
- IPath path = this.getFirstMappingFilePath();
- return (path == null) ? this.getDefaultMappingFileRuntimPath() : this.convertToRuntimPath(path);
- }
-
- protected abstract IPath getDefaultMappingFileRuntimPath();
-
- /**
- * Return the JPA project's <em>first</em> mapping file with the
- * {@link #getMappingFileContentType() default content type}.
- */
- protected IPath getFirstMappingFilePath() {
- if (this.persistenceUnit == null) {
- return null;
- }
- for (MappingFileRef ref : this.persistenceUnit.getMappingFileRefs()) {
- MappingFile mappingFile = ref.getMappingFile();
- if (mappingFile != null) {
- IFile file = mappingFile.getXmlResource().getFile();
- if (this.jpaProject.getJpaFile(file).getContentType().isKindOf(this.getMappingFileContentType())) {
- return file.getFullPath();
- }
- }
- }
- return null;
- }
-
- protected IContentType getMappingFileContentType() {
- return JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE;
- }
-
- protected IPath convertToRuntimPath(IPath path) {
- ProjectResourceLocator locator = (ProjectResourceLocator) this.jpaProject.getProject().getAdapter(ProjectResourceLocator.class);
- return locator.getRuntimePath(path);
- }
-
-
- // ********** missing metadata warning message **********
-
- protected final boolean hasNoConvertibleJavaMetadata() {
- return ! this.hasConvertibleJavaMetadata();
- }
-
- protected final boolean hasConvertibleJavaMetadata() {
- return (this.persistenceUnit != null) && this.hasConvertibleJavaMetadata_();
- }
-
- /**
- * Pre-condition: the {@link #persistenceUnit persistence unit}
- * is not <code>null</code>.
- */
- protected abstract boolean hasConvertibleJavaMetadata_();
-
- protected abstract String getMissingJavaMetadataWarningMessage();
-
-
- // ********** UI control **********
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
-
- Label pageLabel = new Label(composite, SWT.NONE);
- pageLabel.setText(JptUiMessages.JavaMetadataConversionWizardPage_label);
- pageLabel.setBounds(3, 230, 150, 12);
-
- Control mappingFileControl = this.createMappingFileControl(composite);
- GridData data = new GridData(GridData.FILL_HORIZONTAL);
- data.heightHint = 58;
- data.grabExcessHorizontalSpace = true;
- mappingFileControl.setLayoutData(data);
-
- Text noteTextField = new Text(composite, SWT.READ_ONLY | SWT.MULTI);
- noteTextField.setText(NLS.bind(JptUiMessages.JavaMetadataConversion_warning, StringTools.CR));
- noteTextField.setFont(new Font(composite.getDisplay(), "Arial", 10, SWT.EMBEDDED)); //$NON-NLS-1$
- noteTextField.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, true, 1, 1));
-
- this.setControl(composite);
-
- // no need to remove this listener, since we build the model ourselves
- this.mappingFileNameModel.addPropertyChangeListener(PropertyValueModel.VALUE, this.buildMappingFileNameListener());
- this.setPageComplete(this.getOrmXmlResource() != null);
- }
-
- protected Control createMappingFileControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(3, false));
-
- Link link = new Link(composite, SWT.LEFT);
- link.setText(JptUiMessages.JavaMetadataConversionWizardPage_newMappingFileLink);
- link.setToolTipText(JptUiMessages.JavaMetadataConversionWizardPage_newMappingFileLinkToolTip);
- link.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- link.addSelectionListener(this.buildMappingFileLinkListener());
-
- Text nameTextField = new Text(composite, SWT.SEARCH | SWT.SINGLE);
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.grabExcessVerticalSpace = true;
- gridData.widthHint = 486;
- gridData.heightHint = 14;
- gridData.horizontalSpan = 1;
- gridData.grabExcessHorizontalSpace = true;
- nameTextField.setLayoutData(gridData);
- SWTTools.bind(this.mappingFileNameModel, nameTextField);
-
- Button browseButton = new Button(composite, SWT.CENTER);
- browseButton.setToolTipText(JptUiMessages.JavaMetadataConversionWizardPage_mappingFileBrowseButtonToolTip);
- browseButton.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
- browseButton.setText(JptUiMessages.JavaMetadataConversionWizardPage_mappingFileBrowseButton);
- browseButton.addSelectionListener(this.buildMappingFileBrowseButtonListener());
-
- return composite;
- }
-
-
- // ********** mapping file name listener **********
-
- protected PropertyChangeListener buildMappingFileNameListener() {
- return new MappingFileNameListener();
- }
-
- protected class MappingFileNameListener
- extends PropertyChangeAdapter
- {
- @Override
- public void propertyChanged(PropertyChangeEvent event) {
- JavaMetadataConversionWizardPage.this.validate();
- }
- }
-
- protected void validate() {
- String errorMessage = this.buildErrorMessage();
- this.setErrorMessage(errorMessage);
- this.setPageComplete(errorMessage == null);
- }
-
- protected String buildErrorMessage() {
- JpaXmlResource ormXmlResource = this.getOrmXmlResource();
- if (ormXmlResource == null) {
- return JptUiMessages.JavaMetadataConversion_mappingFileDoesNotExist;
- }
- String mappingFileVersion = ormXmlResource.getVersion();
- String jpaProjectVersion = this.getJpaProjectVersion();
- if (Tools.valuesAreDifferent(mappingFileVersion, jpaProjectVersion)) {
- return NLS.bind(JptUiMessages.JavaMetadataConversion_mappingFileVersionIsInvalid, mappingFileVersion, jpaProjectVersion);
- }
- if (this.getEntityMappings(ormXmlResource) == null) {
- return JptUiMessages.JavaMetadataConversion_mappingFileNotListedInPersistenceXml;
- }
- if (this.noConvertibleJavaMetadata) {
- this.setMessage(this.getMissingJavaMetadataWarningMessage(), IMessageProvider.WARNING);
- }
- return null;
- }
-
- protected EntityMappings getEntityMappings() {
- return this.getEntityMappings(this.getOrmXmlResource());
- }
-
- protected EntityMappings getEntityMappings(JpaXmlResource ormXmlResource) {
- return (ormXmlResource == null) ? null : this.getEntityMappings_(ormXmlResource);
- }
-
- /**
- * Pre-condition: the specified <code>orm.xml</code> resource is
- * not <code>null</code>.
- */
- protected EntityMappings getEntityMappings_(JpaXmlResource ormXmlResource) {
- Iterator<JpaStructureNode> nodes = this.jpaProject.getJpaFile(ormXmlResource.getFile()).getRootStructureNodes().iterator();
- return nodes.hasNext() ? (EntityMappings) nodes.next() : null;
- }
-
- protected JpaXmlResource getOrmXmlResource() {
- IPath mappingFilePath = this.getMappingFilePath();
- return (mappingFilePath == null) ? null : this.jpaProject.getMappingFileXmlResource(mappingFilePath);
- }
-
- protected IPath getMappingFilePath() {
- String mappingFileName = this.getMappingFileName();
- return StringTools.stringIsEmpty(mappingFileName) ? null : new Path(mappingFileName);
- }
-
- protected String getMappingFileName() {
- String mappingFileName = this.mappingFileNameModel.getValue();
- return StringTools.stringIsEmpty(mappingFileName) ? null : mappingFileName;
- }
-
- protected String getJpaProjectVersion(){
- return this.jpaProject.getJpaPlatform().getJpaVersion().getVersion();
- }
-
-
- // ********** mapping file link listener **********
-
- protected SelectionListener buildMappingFileLinkListener() {
- return new MappingFileLinkListener();
- }
-
- protected class MappingFileLinkListener
- extends SelectionAdapter
- {
- @Override
- public void widgetSelected(SelectionEvent event) {
- JavaMetadataConversionWizardPage.this.mappingFileLinkPressed();
- }
- }
-
- protected void mappingFileLinkPressed() {
- IPath path = this.openNewMappingFileWizard();
- if (path != null) {
- this.mappingFileNameModel.setValue(path.toString());
- // revalidate because the mapping file may have been created
- this.validate();
- }
- }
-
- protected abstract IPath openNewMappingFileWizard();
-
-
- // ********** mapping file browse button listener **********
-
- protected SelectionListener buildMappingFileBrowseButtonListener() {
- return new MappingFileBrowseButtonListener();
- }
-
- protected class MappingFileBrowseButtonListener
- extends SelectionAdapter
- {
- @Override
- public void widgetSelected(SelectionEvent event) {
- JavaMetadataConversionWizardPage.this.mappingFileBrowseButtonPressed();
- }
- }
-
- protected void mappingFileBrowseButtonPressed() {
- IProject project = this.jpaProject.getProject();
- SelectMappingFileDialog dialog = this.buildSelectMappingFileDialog();
- dialog.setTitle(JptUiMessages.SelectMappingFileDialog_title);
- dialog.setMessage(JptUiMessages.SelectMappingFileDialog_message);
- dialog.addFilter(this.buildSelectMappingFileDialogViewerFilter());
- dialog.setInput(project);
-
- JpaXmlResource resource = this.getOrmXmlResource();
- IFile file = (resource == null) ? null : resource.getFile();
- if (file != null) {
- dialog.setInitialSelection(file);
- }
- if (dialog.open() == Window.OK) {
- this.mappingFileNameModel.setValue(dialog.getChosenName());
- // revalidate because the mapping file may have been created
- this.validate();
- }
- }
-
- protected abstract SelectMappingFileDialog buildSelectMappingFileDialog();
-
- protected ViewerFilter buildSelectMappingFileDialogViewerFilter() {
- return new XmlMappingFileViewerFilter(this.jpaProject, this.getMappingFileContentType());
- }
-
-
- // ********** finish => conversion **********
-
- protected boolean performFinish() {
- return this.isOKToConvert() && this.performFinish_();
- }
-
- protected boolean isOKToConvert() {
- return this.hasConvertibleJavaMetadata();
- }
-
- protected boolean performFinish_() {
- // true=fork; true=cancellable
- try {
- this.buildProgressMonitorDialog().run(true, true, this.buildConversionRunnable());
- } catch (InvocationTargetException ex) {
- JptJpaUiPlugin.log(ex);
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt(); // runnable cancelled
- }
- return true;
- }
-
- protected ProgressMonitorDialog buildProgressMonitorDialog() {
- return new ProgressMonitorDialog(this.getShell());
- }
-
- protected IRunnableWithProgress buildConversionRunnable() {
- return new ConversionRunnable(this.getConversionCommandStrategy(), this.getEntityMappings());
- }
-
- protected abstract ConversionCommand.Strategy getConversionCommandStrategy();
-
- /**
- * UI runnable
- */
- protected static class ConversionRunnable
- implements IRunnableWithProgress
- {
- protected final ConversionCommand.Strategy conversionCommandStrategy;
- protected final EntityMappings entityMappings;
-
- protected ConversionRunnable(ConversionCommand.Strategy conversionCommandStrategy, EntityMappings entityMappings) {
- super();
- if ((conversionCommandStrategy == null) || (entityMappings == null)) {
- throw new NullPointerException();
- }
- this.conversionCommandStrategy = conversionCommandStrategy;
- this.entityMappings = entityMappings;
- }
-
- public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- ISchedulingRule rule = ws.getRuleFactory().modifyRule(ws.getRoot());
- try {
- ws.run(this.buildWorkspaceRunnable(), rule, IWorkspace.AVOID_UPDATE, monitor);
- } catch (CoreException ex) {
- if (ex.getStatus().getSeverity() == IStatus.CANCEL) {
- throw new InterruptedException(); // ???
- }
- throw new InvocationTargetException(ex);
- }
- }
-
- protected void run_(IProgressMonitor monitor) {
- Command conversionCommand = new ConversionCommand(this.conversionCommandStrategy, this.entityMappings, monitor);
- try {
- this.getJpaProjectManager().execute(conversionCommand, SynchronousUiCommandExecutor.instance());
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt();
- throw new OperationCanceledException();
- }
- }
-
- protected IWorkspaceRunnable buildWorkspaceRunnable() {
- return new WorkspaceRunnable();
- }
-
- protected JpaProjectManager getJpaProjectManager() {
- return (JpaProjectManager) this.getWorkspace().getAdapter(JpaProjectManager.class);
- }
-
- protected IWorkspace getWorkspace() {
- return this.entityMappings.getParent().getXmlResource().getFile().getWorkspace();
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
-
- /**
- * Workspace runnable
- */
- protected class WorkspaceRunnable
- extends WorkspaceRunnableAdapter
- {
- @Override
- public void run(IProgressMonitor monitor) throws CoreException {
- ConversionRunnable.this.run_(monitor);
- }
- }
- }
-
-
- /**
- * Conversion command.
- * This is dispatched to the JPA project manager.
- */
- protected static class ConversionCommand
- implements Command
- {
- protected final Strategy strategy;
- protected final EntityMappings entityMappings;
- protected final IProgressMonitor monitor;
-
- protected ConversionCommand(Strategy strategy, EntityMappings entityMappings, IProgressMonitor monitor) {
- super();
- if ((strategy == null) || (entityMappings == null) || (monitor == null)) {
- throw new NullPointerException();
- }
- this.strategy = strategy;
- this.entityMappings = entityMappings;
- this.monitor = monitor;
- }
-
- public void execute() {
- this.strategy.execute(this.entityMappings, this.monitor);
- this.getOrmXmlResource().save();
- this.saveAllFiles();
- this.openEditorOnMappingFile();
- }
-
- protected JpaXmlResource getOrmXmlResource() {
- return this.entityMappings.getParent().getXmlResource();
- }
-
- protected void saveAllFiles() {
- SWTUtil.asyncExec(this.buildSaveAllFilesRunnable());
- }
-
- protected Runnable buildSaveAllFilesRunnable() {
- return new SaveFilesRunnable(this.getProject());
- }
-
- protected IProject getProject() {
- return this.entityMappings.getJpaProject().getProject();
- }
-
- protected void openEditorOnMappingFile() {
- SWTUtil.asyncExec(this.buildOpenEditorOnMappingFileRunnable());
- }
-
- protected Runnable buildOpenEditorOnMappingFileRunnable() {
- return new OpenEditorRunnable(this.getOrmXmlResource().getFile());
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.entityMappings.getPersistenceUnit());
- }
-
- public interface Strategy {
- void execute(EntityMappings entityMappings, IProgressMonitor monitor);
- }
- }
-
-
- // ********** save files **********
-
- protected static class SaveFilesRunnable
- implements Runnable
- {
- protected final IResource[] resourceRoots;
-
- protected SaveFilesRunnable(IProject project) {
- super();
- if (project == null) {
- throw new NullPointerException();
- }
- this.resourceRoots = new IResource[] { project };
- }
-
- public void run() {
- IDE.saveAllEditors(this.resourceRoots, false); // false=no confirm
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.resourceRoots[0]);
- }
- }
-
-
- // ********** open editor **********
-
- protected static class OpenEditorRunnable
- implements Runnable
- {
- protected final IFile file;
-
- protected OpenEditorRunnable(IFile file) {
- super();
- if (file == null) {
- throw new NullPointerException();
- }
- this.file = file;
- }
-
- public void run() {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- try {
- IDE.openEditor(page, this.file);
- } catch (PartInitException ex) {
- JptJpaUiPlugin.log(ex);
- }
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this, this.file);
- }
- }
-
-
- // ********** misc **********
-
- @Override
- public final void performHelp() {
- PlatformUI.getWorkbench().getHelpSystem().displayHelp(HELP_CONTEXT_ID);
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/AnnotatedEntityTemplate.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/AnnotatedEntityTemplate.java
deleted file mode 100644
index a0c819c4af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/AnnotatedEntityTemplate.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity;
-
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.*;
-import java.util.*;
-
-public class AnnotatedEntityTemplate
-{
- protected static String nl;
- public static synchronized AnnotatedEntityTemplate create(String lineSeparator)
- {
- nl = lineSeparator;
- AnnotatedEntityTemplate result = new AnnotatedEntityTemplate();
- nl = null;
- return result;
- }
-
- public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "package ";
- protected final String TEXT_2 = ";";
- protected final String TEXT_3 = NL;
- protected final String TEXT_4 = NL + "import ";
- protected final String TEXT_5 = ";";
- protected final String TEXT_6 = NL + NL + "/**" + NL + " * Entity implementation class for Entity: ";
- protected final String TEXT_7 = NL + " *" + NL + " */";
- protected final String TEXT_8 = NL;
- protected final String TEXT_9 = "(name=\"";
- protected final String TEXT_10 = "\")";
- protected final String TEXT_11 = NL + "@Table(name=\"";
- protected final String TEXT_12 = "\")";
- protected final String TEXT_13 = NL;
- protected final String TEXT_14 = NL + "@IdClass(";
- protected final String TEXT_15 = ".class)";
- protected final String TEXT_16 = NL + "public class ";
- protected final String TEXT_17 = " extends ";
- protected final String TEXT_18 = " implements ";
- protected final String TEXT_19 = ", ";
- protected final String TEXT_20 = " {" + NL + "" + NL + "\t";
- protected final String TEXT_21 = " " + NL + "\t@Id";
- protected final String TEXT_22 = NL + "\tprivate ";
- protected final String TEXT_23 = " ";
- protected final String TEXT_24 = ";";
- protected final String TEXT_25 = NL + "\tprivate static final long serialVersionUID = 1L;" + NL + "" + NL + "\tpublic ";
- protected final String TEXT_26 = "() {" + NL + "\t\tsuper();" + NL + "\t}";
- protected final String TEXT_27 = " " + NL + "\t@Id ";
- protected final String TEXT_28 = " " + NL + "\tpublic ";
- protected final String TEXT_29 = " get";
- protected final String TEXT_30 = "() {" + NL + "\t\treturn this.";
- protected final String TEXT_31 = ";" + NL + "\t}" + NL + "" + NL + "\tpublic void set";
- protected final String TEXT_32 = "(";
- protected final String TEXT_33 = " ";
- protected final String TEXT_34 = ") {" + NL + "\t\tthis.";
- protected final String TEXT_35 = " = ";
- protected final String TEXT_36 = ";" + NL + "\t}";
- protected final String TEXT_37 = NL + " " + NL + "}";
- protected final String TEXT_38 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
- CreateEntityTemplateModel model = (CreateEntityTemplateModel) argument;
-if (model.getJavaPackageName()!=null && model.getJavaPackageName()!="") {
- stringBuffer.append(TEXT_1);
- stringBuffer.append(model.getJavaPackageName());
- stringBuffer.append(TEXT_2);
- }
- stringBuffer.append(TEXT_3);
- Collection<String> imports = model.getImports(false);
-for (String anImport : imports) {
- stringBuffer.append(TEXT_4);
- stringBuffer.append(anImport);
- stringBuffer.append(TEXT_5);
- }
- stringBuffer.append(TEXT_6);
- stringBuffer.append(model.getEntityName());
- stringBuffer.append(TEXT_7);
- stringBuffer.append(TEXT_8);
- stringBuffer.append(model.getArtifactType());
- String ENTITY_NAME = model.getEntityName();
-if (model.isEntityNameSet()) {
- stringBuffer.append(TEXT_9);
- stringBuffer.append(ENTITY_NAME);
- stringBuffer.append(TEXT_10);
- }
- if (model.isTableNameSet()) {
- stringBuffer.append(TEXT_11);
- stringBuffer.append(model.getTableName());
- stringBuffer.append(TEXT_12);
- }
- stringBuffer.append(TEXT_13);
- stringBuffer.append(model.getInheritanceStrategy());
- if (model.isCompositePK()) {
- stringBuffer.append(TEXT_14);
- stringBuffer.append(model.getIdClassName());
- stringBuffer.append(TEXT_15);
- }
- stringBuffer.append(TEXT_16);
- stringBuffer.append(model.getClassName());
- String superClass = model.getSuperclassName();
- if (! "".equals(superClass)) {
- stringBuffer.append(TEXT_17);
- stringBuffer.append(superClass);
- }
-
- List<String> interfaces = model.getInterfaces();
- if (interfaces.size()>0) {
- stringBuffer.append(TEXT_18);
- }
- for (int i=0; i<interfaces.size(); i++) {
- String INTERFACE = (String) interfaces.get(i);
- if (i>0) {
- stringBuffer.append(TEXT_19);
- }
- stringBuffer.append(INTERFACE);
- }
- stringBuffer.append(TEXT_20);
- List<EntityRow> fields = model.getEntityFields();
- List<String> pkFields = model.getPKFields();
- for (EntityRow entity : fields) {
- String NAME = entity.getName();
- if (pkFields.contains(NAME) && model.isFieldAccess()) {
-
- stringBuffer.append(TEXT_21);
- }
- stringBuffer.append(TEXT_22);
- stringBuffer.append(entity.getType());
- stringBuffer.append(TEXT_23);
- stringBuffer.append(entity.getName());
- stringBuffer.append(TEXT_24);
- }
- stringBuffer.append(TEXT_25);
- stringBuffer.append(model.getClassName());
- stringBuffer.append(TEXT_26);
-
- fields = model.getEntityFields();
- if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String TYPE = field.getType();
- String NAME = field.getName();
- String METHOD = NAME.substring(0,1).toUpperCase() + NAME.substring(1);
- if (pkFields.contains(NAME) && !model.isFieldAccess()) {
-
- stringBuffer.append(TEXT_27);
- }
- stringBuffer.append(TEXT_28);
- stringBuffer.append(TYPE);
- stringBuffer.append(TEXT_29);
- stringBuffer.append(METHOD);
- stringBuffer.append(TEXT_30);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_31);
- stringBuffer.append(METHOD);
- stringBuffer.append(TEXT_32);
- stringBuffer.append(TYPE);
- stringBuffer.append(TEXT_33);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_34);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_35);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_36);
- }
- stringBuffer.append(TEXT_37);
- stringBuffer.append(TEXT_38);
- return stringBuffer.toString();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityClassWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityClassWizardPage.java
deleted file mode 100644
index 249a70c579..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityClassWizardPage.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/***********************************************************************
- * Copyright (c) 2008, 2012 by SAP AG, Walldorf 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:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- ***********************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity;
-
-import java.io.File;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.jface.XmlMappingFileViewerFilter;
-import org.eclipse.jpt.jpa.ui.internal.wizards.SelectMappingFileDialog;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.IEntityDataModelProperties;
-import org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEUIMessages;
-import org.eclipse.jst.j2ee.internal.wizard.NewJavaClassWizardPage;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ISelectionStatusValidator;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.ui.model.WorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-public class EntityClassWizardPage
- extends NewJavaClassWizardPage {
-
- private static final String EMPTY = "";//$NON-NLS-1$
-
- private static final String SINGLE_TABLE = "SINGLE_TABLE";//$NON-NLS-1$
- private static final String TABLE_PER_CLASS = "TABLE_PER_CLASS";//$NON-NLS-1$
- private static final String JOINED = "JOINED";//$NON-NLS-1$
- private static final String[] INHERITANCE_STRATEGIES =
- new String[] {EMPTY, SINGLE_TABLE, TABLE_PER_CLASS, JOINED };
- private Combo inheritanceStrategyCombo;
- private Button entityButton;
- private Button mapedAsSuperclassButton;
- private Button inheritanceButton;
- private Label displayNameLabel;
- private Button xmlSupportButton;
- private boolean isFirstCheck = true;
- private Text ormXmlName;
- private Button browseButton;
-
-
- public EntityClassWizardPage(
- IDataModel model, String pageName, String pageDesc, String pageTitle) {
-
- super(model, pageName, pageDesc, pageTitle, null);
- }
-
-
- @Override
- protected String[] getValidationPropertyNames() {
- return ArrayTools.addAll(
- super.getValidationPropertyNames(),
- new String[] {IEntityDataModelProperties.XML_NAME, IEntityDataModelProperties.XML_SUPPORT});
- }
-
- private IProject getProject() {
- return (IProject) getDataModel().getProperty(INewJavaClassDataModelProperties.PROJECT);
- }
-
- /* Create top level composite (class properties) and add the entity's specific inheritance group
- * @see org.eclipse.jst.j2ee.internal.wizard.NewJavaClassWizardPage#createTopLevelComposite(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = super.createTopLevelComposite(parent);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.NEW_JPA_ENTITY_ENTITY_CLASS);
-
- createInheritanceControl(composite);
- this.inheritanceButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isChecked = inheritanceButton.getSelection();
- if (isChecked) {
- entityButton.setSelection(true);
- mapedAsSuperclassButton.setSelection(false);
- }
- inheritanceStrategyCombo.setEnabled(isChecked);
- model.setBooleanProperty(IEntityDataModelProperties.ENTITY, true);
- model.setBooleanProperty(IEntityDataModelProperties.MAPPED_AS_SUPERCLASS, false);
- entityButton.setEnabled(!isChecked);
- mapedAsSuperclassButton.setEnabled(!isChecked);
- }
- });
- createXMLstorageControl(composite);
- this.xmlSupportButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isChecked = xmlSupportButton.getSelection();
- enableMappingXMLChooseGroup(isChecked);
- if (isFirstCheck) {
- ormXmlName.setText(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- isFirstCheck = false;
- }
- }
- });
- return composite;
- }
-
- protected JpaProject getTargetJpaProject() {
- IProject project = getProject();
- return (project == null) ? null : this.getJpaProject(project);
- }
-
- protected JpaProject getJpaProject(IProject project) {
- return (JpaProject) project.getAdapter(JpaProject.class);
- }
-
- @Override
- protected ISelectionStatusValidator getContainerDialogSelectionValidator() {
- return new ISelectionStatusValidator() {
- public IStatus validate(Object[] selection) {
- if (selection != null && selection[0] != null) {
- if (selection[0] instanceof IProject) {
- IProject project = (IProject) selection[0];
- IJavaProject javaProject = JavaCore.create(project);
- for (IPackageFragmentRoot root : JDTTools.getJavaSourceFolders(javaProject)) {
- if (project.equals(root.getResource())) {
- return WTPCommonPlugin.OK_STATUS;
- }
- }
- }
- else {
- return WTPCommonPlugin.OK_STATUS;
- }
- }
- return WTPCommonPlugin.createErrorStatus(J2EEUIMessages.CONTAINER_SELECTION_DIALOG_VALIDATOR_MESG);
- }
- };
- }
-
- @Override
- protected ViewerFilter getContainerDialogViewerFilter() {
- return new ViewerFilter() {
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- String projectName = (String) model.getProperty(IEntityDataModelProperties.PROJECT_NAME);
- if (element instanceof IProject) {
- IProject project = (IProject) element;
- return project.getName().equals(projectName);
- }
- else if (element instanceof IFolder) {
- IFolder folder = (IFolder) element;
- // only show source folders
- IProject project = ProjectUtilities.getProject(projectName);
- IJavaProject javaProject = JavaCore.create(project);
- for (IPackageFragmentRoot root : JDTTools.getJavaSourceFolders(javaProject)) {
- if (folder.equals(root.getResource()))
- return true;
- }
- }
- return false;
- }
- };
- }
-
- /**
- * Create the inheritance group
- * @param parent the main composite
- */
- private void createInheritanceControl(Composite parent) {
- Group group = createGroup(parent, EntityWizardMsg.INHERITANCE_GROUP);
- this.entityButton = createRadioButton(group, EntityWizardMsg.ENTITY, IEntityDataModelProperties.ENTITY);
- this.mapedAsSuperclassButton = createRadioButton(group, EntityWizardMsg.MAPPED_AS_SUPERCLASS, IEntityDataModelProperties.MAPPED_AS_SUPERCLASS);
- this.inheritanceButton = createCheckButton(group, GridData.HORIZONTAL_ALIGN_FILL, 1/*horizontal span*/, EntityWizardMsg.INHERITANCE_CHECK_BOX, IEntityDataModelProperties.INHERITANCE);
- createComboBox(group, IEntityDataModelProperties.INHERITANCE_STRATEGY);
- }
-
- /**
- * Create the group, which manage entity mapping registration
- * @param parent the main composite
- */
- private void createXMLstorageControl(Composite parent) {
- Group group = createGroup(parent, EntityWizardMsg.XML_STORAGE_GROUP);
- this.xmlSupportButton = createCheckButton(group, GridData.FILL_HORIZONTAL, 3/*horizontal span*/, EntityWizardMsg.XML_SUPPORT, IEntityDataModelProperties.XML_SUPPORT);
- createBrowseGroup(group, EntityWizardMsg.CHOOSE_XML, IEntityDataModelProperties.XML_NAME);
- this.ormXmlName.setEnabled(false);
- this.browseButton.setEnabled(false);
- }
-
- /**
- * @param parent the main composite
- * @param text the name/title of the group
- * @return the created group
- */
- private Group createGroup(Composite parent, String text) {
- Group group = new Group(parent, SWT.NONE);
- GridData groupGridData = new GridData(GridData.FILL_HORIZONTAL);
- groupGridData.horizontalSpan = 3;
- group.setLayoutData(groupGridData);
- group.setLayout(new GridLayout(3, false));
- group.setText(text);
- return group;
- }
-
- /**
- * Create radio button
- * @param parent the main composite - inheritance group
- * @param text the label of the button
- * @param property the related property to which this button will be synchronized
- * @return the created button
- */
- private Button createRadioButton(Composite parent, String text, String property) {
- Button button = new Button(parent, SWT.RADIO);
- GridData groupGridData = new GridData(GridData.FILL_HORIZONTAL);
- groupGridData.horizontalSpan = 3;
- button.setLayoutData(groupGridData);
- button.setText(text);
- this.synchHelper.synchRadio(button, property, /*dependentControls*/ null);
- return button;
- }
-
- /**
- * Create check button
- * @param parent the main composite - inheritance group
- * @param text the label of the button
- * @param property the related property to which this button will be synchronized
- * @return the created button
- */
- private Button createCheckButton(Composite parent, int fillStrategy, int horizontalSpan, String text, String property) {
- final Button button = new Button(parent, SWT.CHECK);
- GridData groupGridData = new GridData(fillStrategy);
- groupGridData.horizontalSpan = horizontalSpan;
- button.setLayoutData(groupGridData);
- button.setText(text);
- this.synchHelper.synchCheckbox(button, property, /*dependentControls*/ null);
- return button;
- }
-
- /**
- * Create combo box, which presents the set of possible inheritance strategies
- * @param parent the main composite - inheritance group
- * @param property the related property to which this button will be synchronized
- * @return
- */
- private Combo createComboBox(Composite parent, String property) {
- this.inheritanceStrategyCombo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- GridData groupGridData = new GridData(GridData.FILL_HORIZONTAL);
- groupGridData.horizontalSpan = 2;
- this.inheritanceStrategyCombo.setLayoutData(groupGridData);
- this.inheritanceStrategyCombo.setItems(INHERITANCE_STRATEGIES);
- this.synchHelper.synchCombo(this.inheritanceStrategyCombo, property, /*dependentControls*/ null);
- this.inheritanceStrategyCombo.setEnabled(false);
- return this.inheritanceStrategyCombo;
-
- }
-
- /**
- * Create XML group
- * @param parent the main composite
- * @param label the name of the group
- * @param property the related property to which this group will be synchronized
- * @return the created group
- */
- private void createBrowseGroup(Composite parent, String label, String property) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(3, false));
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- this.displayNameLabel = new Label(composite, SWT.LEFT);
- this.displayNameLabel.setText(label);
- this.displayNameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
- this.ormXmlName = new Text(composite, SWT.SINGLE | SWT.BORDER);
- this.ormXmlName.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- this.browseButton = new Button(composite, SWT.PUSH);
- this.browseButton.setText(EntityWizardMsg.BROWSE_BUTTON_LABEL);
- GridData browseButtonData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- browseButtonData.horizontalSpan = 1;
- this.browseButton.setLayoutData(browseButtonData);
- this.browseButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- handleChooseXmlButtonPressed();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
- });
- this.synchHelper.synchText(this.ormXmlName, property, /*dependentControls*/null);
-
- enableMappingXMLChooseGroup(false);
- }
-
- protected String getMappingFileName() {
- String mappingFileLocation = this.model.getStringProperty(IEntityDataModelProperties.XML_NAME);
- return new File(mappingFileLocation).getName();
- }
-
- /**
- * Process browsing when the Browse... button have been pressed. Allow choosing of
- * XML for entity mapping registration
- *
- */
- private void handleChooseXmlButtonPressed() {
- IProject project = getProject();
- if (project == null) {
- return;
- }
- JpaProject jpaProject = this.getJpaProject(project);
- ViewerFilter filter = getDialogViewerFilter(jpaProject);
- ITreeContentProvider contentProvider = new WorkbenchContentProvider();
- ILabelProvider labelProvider = new WorkbenchLabelProvider();
- SelectMappingFileDialog dialog = new SelectMappingFileDialog(getShell(), project, labelProvider, contentProvider);
- dialog.setTitle(EntityWizardMsg.MAPPING_XML_TITLE);
- dialog.setMessage(EntityWizardMsg.CHOOSE_MAPPING_XML_MESSAGE);
- dialog.addFilter(filter);
-
- String ormFileName = this.ormXmlName.getText();
- JpaXmlResource resource = jpaProject.getMappingFileXmlResource(new Path(ormFileName));
- IFile initialSelection = (resource != null) ? resource.getFile() : null;
- dialog.setInput(project);
-
- if (initialSelection != null) {
- dialog.setInitialSelection(initialSelection);
- }
- if (dialog.open() == Window.OK) {
- boolean noNameChange = false;
- if (StringTools.stringsAreEqual(this.model.getStringProperty(IEntityDataModelProperties.XML_NAME), dialog.getChosenName())) {
- noNameChange = true;
- }
- this.model.setProperty(IEntityDataModelProperties.XML_NAME, dialog.getChosenName());
- if (noNameChange) {
- //if the xml name has not changed, the wizard page will not be validated (bug 345293)
- this.validatePage();
- }
- }
- }
-
- /**
- * This method create filter for the browse/add alternative mapping XML
- * @return new instance of viewer filter for the SelectMappingXMLDialog
- */
- protected ViewerFilter getDialogViewerFilter(JpaProject jpaProject) {
- return new XmlMappingFileViewerFilter(jpaProject, JptJpaCorePlugin.MAPPING_FILE_CONTENT_TYPE);
- }
-
- private void enableMappingXMLChooseGroup(boolean enabled) {
- this.displayNameLabel.setEnabled(enabled);
- this.ormXmlName.setEnabled(enabled);
- this.browseButton.setEnabled(enabled);
- }
-
- /**
- * This method is used by the project list initializer. The method checks
- * if the specified project is valid to include it in the project list.
- *
- * <p>Subclasses of this wizard page should override this method to
- * adjust filtering of the projects to their needs. </p>
- *
- * @param project reference to the project to be checked
- *
- * @return <code>true</code> if the project is valid to be included in
- * the project list, <code>false</code> - otherwise.
- */
- @Override
- protected boolean isProjectValid(IProject project) {
- return (project.isAccessible() && JpaFacet.isInstalled(project));
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityFieldsWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityFieldsWizardPage.java
deleted file mode 100644
index e36c8d0891..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityFieldsWizardPage.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/***********************************************************************
- * Copyright (c) 2008, 2010 by SAP AG, Walldorf.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- ***********************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.IEntityDataModelProperties;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-import org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-public class EntityFieldsWizardPage extends DataModelWizardPage {
-
- private Text entityNameText;
- private Text tableNameText;
- private Button tableNameCheckButton;
- private Button fieldAccessButton;
- private Button propertyAccessButton;
- private boolean isNonEntity = true;
- private boolean isButtonsCreated = false;
-
- public EntityFieldsWizardPage(IDataModel model, String pageName) {
- super(model, pageName);
- this.setTitle(EntityWizardMsg.ENTITY_PROPERTIES_TITLE);
- this.setDescription(EntityWizardMsg.ENTITY_PROPERTIES_DESCRIPTION);
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.jem.util.ui.wizard.WTPWizardPage#getValidationPropertyNames()
- */
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[]{IEntityDataModelProperties.ENTITY_FIELDS,
- IEntityDataModelProperties.PK_FIELDS};
- }
-
- /* Create the main composite and add to it the entity properties
- * @see org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage#createTopLevelComposite(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout());
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.NEW_JPA_ENTITY_ENTITY_PROPERTIES);
-
- GridData data = new GridData(GridData.FILL_BOTH);
- data.widthHint = 300;
- data.heightHint = 450;
- composite.setLayoutData(data);
- composite.pack();
-
- entityNameText = createNameGroup(composite, EntityWizardMsg.ENTITY_NAME, IEntityDataModelProperties.ENTITY_NAME);
- Group group = createGroup(composite, EntityWizardMsg.TABLE_NAME_GROUP);
- tableNameCheckButton= createCheckButton(group, EntityWizardMsg.USE_DEFAULT, IEntityDataModelProperties.TABLE_NAME_DEFAULT);
- tableNameText = createNameGroup(group, EntityWizardMsg.TABLE_NAME, IEntityDataModelProperties.TABLE_NAME);
- tableNameText.setEnabled(!tableNameCheckButton.getSelection());
- isButtonsCreated = true;
- initNameGroup();
- createEntityFieldsGroup(composite);
-
- Group accessTypeGroup = createGroup(composite, EntityWizardMsg.ACCESS_TYPE);
- fieldAccessButton = createRadioButton(accessTypeGroup, EntityWizardMsg.FIELD_BASED, IEntityDataModelProperties.FIELD_ACCESS_TYPE);
- propertyAccessButton = createRadioButton(accessTypeGroup, EntityWizardMsg.PROPERTY_BASED, IEntityDataModelProperties.PROPERTY_ACCESS_TYPE);
-
-
- IStatus projectStatus = validateProjectName();
- if (!projectStatus.isOK()) {
- setErrorMessage(projectStatus.getMessage());
- composite.setEnabled(false);
- }
- Dialog.applyDialogFont(parent);
- return composite;
- }
-
- /**
- * @return the status of the project name correctness
- */
- protected IStatus validateProjectName() {
- // check for empty
- if (model.getStringProperty(IArtifactEditOperationDataModelProperties.PROJECT_NAME) == null || model.getStringProperty(IArtifactEditOperationDataModelProperties.PROJECT_NAME).trim().length() == 0) {
- return WTPCommonPlugin.createErrorStatus(EntityWizardMsg.NO_JPA_PROJECTS);
- }
- return WTPCommonPlugin.OK_STATUS;
- }
-
- protected void createEntityFieldsGroup(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- GridData groupGridData = new GridData(GridData.FILL_BOTH);
- groupGridData.horizontalSpan = 3;
- group.setLayoutData(groupGridData);
- group.setLayout(new GridLayout(3, false));
- group.setText(EntityWizardMsg.ENTITY_FIELDS_GROUP);
- new EntityRowTableWizardSection(group, model, IEntityDataModelProperties.ENTITY_FIELDS);
- }
-
- /**
- * Create named group
- * @param parent the main composite
- * @param label the name of the group
- * @param property the related property to which this group will be synchronized
- * @return the created group
- */
- protected Text createNameGroup(Composite parent, String label, String property) {
- Composite composite = new Composite(parent, SWT.NULL);
- composite.setLayout(new GridLayout(3, false));
- composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- Label displayNameLabel = new Label(composite, SWT.LEFT);
- displayNameLabel.setText(label);
- displayNameLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- Text nameText = new Text(composite, SWT.SINGLE | SWT.BORDER);
- nameText.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- synchHelper.synchText(nameText, property, /*dependentControls*/null);
- return nameText;
- }
-
- /**
- * Create group
- * @param parent the main composite
- * @param text the name of the group
- * @return the created group
- */
- private Group createGroup(Composite parent, String text) {
- Group group = new Group(parent, SWT.NONE);
- GridData groupGridData = new GridData(GridData.FILL_HORIZONTAL);
- groupGridData.horizontalSpan = 3;
- group.setLayoutData(groupGridData);
- group.setLayout(new GridLayout(3, false));
- group.setText(text);
- return group;
- }
-
- /**
- * Create check button
- * @param parent the main composite - inheritance group
- * @param text the label of the button
- * @param property the related property to which this button will be synchronized
- * @return the created button
- */
- private Button createCheckButton(Composite parent, String text, String property) {
- final Button button = new Button(parent, SWT.CHECK);
- GridData groupGridData = new GridData(GridData.FILL_HORIZONTAL);
- groupGridData.horizontalSpan = 3;
- button.setLayoutData(groupGridData);
- button.setText(text);
- button.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- boolean isChecked = button.getSelection();
- if (tableNameText != null) {
- tableNameText.setEnabled(!isChecked);
- }
- }
- });
- synchHelper.synchCheckbox(button, property, /*dependentControls*/ null);
- return button;
- }
-
- /**
- * Create radio button
- * @param parent the main composite - inheritance group
- * @param text the label of the button
- * @param property the related property to which this button will be synchronized
- * @return the created button
- */
- private Button createRadioButton(Composite parent, String text, String property) {
- Button button = new Button(parent, SWT.RADIO);
- GridData groupGridData = new GridData(GridData.FILL_HORIZONTAL);
- groupGridData.horizontalSpan = 3;
- button.setLayoutData(groupGridData);
- button.setText(text);
- synchHelper.synchRadio(button, property, /*dependentControls*/ null);
- return button;
- }
-
- /*
- * If a property changes that we want to validate, force validation on this page.
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperationDataModelListener#propertyChanged(java.lang.String,
- * java.lang.Object, java.lang.Object)
- */
- @Override
- public void propertyChanged(DataModelEvent event) {
- String propertyName = event.getPropertyName();
- if (IEntityDataModelProperties.MAPPED_AS_SUPERCLASS.equals(propertyName)) {
- initNameGroup();
- }
- super.propertyChanged(event);
- }
-
- /**
- * The methods is for the internal use only. It will set the entity and table name
- * group to be disabled if the created artifact is not entity
- */
- private void initNameGroup() {
- isNonEntity = model.getBooleanProperty(IEntityDataModelProperties.MAPPED_AS_SUPERCLASS);
- if (isButtonsCreated) {
- entityNameText.setEnabled(!isNonEntity);
- tableNameCheckButton.setEnabled(!isNonEntity);
- tableNameText.setEnabled(!tableNameCheckButton.getSelection());
- }
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-}
-
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityRowTableWizardSection.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityRowTableWizardSection.java
deleted file mode 100644
index af03ced040..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityRowTableWizardSection.java
+++ /dev/null
@@ -1,822 +0,0 @@
-/***********************************************************************
- * Copyright (c) 2008, 2009 by SAP AG, Walldorf.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- ***********************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import org.eclipse.jdt.ui.IJavaElementSearchConstants;
-import org.eclipse.jdt.ui.JavaUI;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.IType;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.search.IJavaSearchScope;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jface.bindings.keys.KeyStroke;
-import org.eclipse.jface.bindings.keys.ParseException;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.IContentProposalProvider;
-import org.eclipse.jface.fieldassist.SimpleContentProposalProvider;
-import org.eclipse.jface.fieldassist.TextContentAdapter;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.DoubleClickEvent;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.IDoubleClickListener;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.EntityRow;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.IEntityDataModelProperties;
-import org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties;
-import org.eclipse.jst.j2ee.internal.dialogs.TypeSearchEngine;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ControlAdapter;
-import org.eclipse.swt.events.ControlEvent;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.dialogs.SelectionDialog;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * The class presents the table with entity fields. In the java file are included also content
- * and label provider, add and edit entity dialogs as well as help internal objects - listener
- * and callback from the dialog to the main composite (table).
- *
- */
-public class EntityRowTableWizardSection extends Composite {
-
- /**
- * The possible entity types, mentioned in the specification (Chapter 2.1.1 Persistent Fields and Properties p.20)
- */
- protected final static String[] VALID_TYPES = {"int",
- "long",
- "short",
- "char",
- "boolean",
- "byte",
- "double",
- "float",
- "java.lang.String",
- "java.lang.Integer",
- "java.lang.Long",
- "java.lang.Short",
- "java.lang.Character",
- "java.lang.Boolean",
- "java.lang.Byte",
- "java.lang.Double",
- "java.lang.Float",
- "java.math.BigDecimal",
- "java.math.BigInteger",
- "java.util.Date",
- "java.util.Calendar",
- "java.sql.Date",
- "java.sql.Time",
- "java.sql.Timestamp",
- "String",
- "Integer",
- "Long",
- "Short",
- "Character",
- "Boolean",
- "Byte",
- "Double",
- "Float" };
-
- private CheckboxTableViewer mTableViewer = null;
- private Table mTableWidget = null;
- private final int NAME_COLUMN = 1;
- private final int TYPE_COLUMN = 2;
-
-
-
-
- private Button addButton;
- private Button editButton;
- private Button removeButton;
- private String title = EntityWizardMsg.ENTITY_FIELDS_DIALOG_TITLE;
- private String[] typeProposals = VALID_TYPES;
- private String[] labelsForText = new String[]{EntityWizardMsg.TYPE_TEXT_FIELD, EntityWizardMsg.NAME_TEXT_FIELD};
- private IDataModel model;
- private String propertyName;
- private Image labelProviderImage = null;
- private DialogCallback callback;
- private static KeyStroke ks = null;
- static {
- try {
- ks = KeyStroke.getInstance("Ctrl+Space");
- } catch (ParseException e1) {
- JptJpaUiPlugin.log(e1);
- }
- }
-
-
- /**
- * @param parent the main composite - Entity fields page
- * @param model the data model representation
- * @param propertyName data property name
- */
- public EntityRowTableWizardSection(Composite parent, IDataModel model, String propertyName) {
- super(parent, SWT.NONE);
- this.model = model;
- this.propertyName = propertyName;
-
- GridLayout layout = new GridLayout(2, false);
- layout.marginHeight = 4;
- layout.marginWidth = 0;
- this.setLayout(layout);
- this.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- mTableWidget = new Table(this, SWT.CHECK | SWT.FULL_SELECTION | SWT.BORDER);
- mTableWidget.setHeaderVisible(true);
- mTableWidget.setLinesVisible(true);
-
- mTableViewer = new CheckboxTableViewer(mTableWidget);
- GridData data = new GridData(GridData.FILL_BOTH);
- data.verticalSpan = 2;
- mTableWidget.setLayoutData(data);
- mTableViewer.setContentProvider(new EntityRowContentProvider());
- mTableViewer.setLabelProvider(new EntityRowLabelProvider());
-
- final Composite buttonComposition = new Composite(this, SWT.NULL);
- layout = new GridLayout();
- layout.marginHeight = 0;
- buttonComposition.setLayout(layout);
- buttonComposition.setLayoutData(new GridData(GridData.FILL_VERTICAL | GridData.VERTICAL_ALIGN_BEGINNING));
-
- addButton = new Button(buttonComposition, SWT.PUSH);
- addButton.setText(EntityWizardMsg.ADD_BUTTON_LABEL);
- addButton.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL));
- addButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- handleAddButtonSelected();
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- //Do nothing
- }
- });
-
- editButton = new Button(buttonComposition, SWT.PUSH);
- editButton.setText(EntityWizardMsg.EDIT_BUTTON_LABEL);
- editButton.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL));
- editButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- handleEditButtonSelected();
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- //Do nothing
- }
- });
- editButton.setEnabled(false);
- mTableViewer.addDoubleClickListener(new IDoubleClickListener() {
- public void doubleClick(DoubleClickEvent event) {
- handleEditButtonSelected();
- }
- });
-
- removeButton = new Button(buttonComposition, SWT.PUSH);
- removeButton.setText(EntityWizardMsg.REMOVE_BUTTON_LABEL);
- removeButton.setLayoutData(new GridData(GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_FILL));
- removeButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent event) {
- handleRemoveButtonSelected();
- }
- public void widgetDefaultSelected(SelectionEvent event) {
- //Do nothing
- }
- });
- removeButton.setEnabled(false);
-
- mTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (editButton != null) {
- boolean enabled = ((IStructuredSelection) selection).size() == 1;
- editButton.setEnabled(enabled);
- }
- removeButton.setEnabled(!selection.isEmpty());
- }
- });
-
-
- final TableColumn pkColumn = new TableColumn(mTableWidget, SWT.CHECK);
- pkColumn.setText(EntityWizardMsg.KEY);
- pkColumn.pack();
- pkColumn.setResizable(false);
-
- TableColumn nameColumn = new TableColumn(mTableWidget, SWT.NONE);
- nameColumn.setText(EntityWizardMsg.NAME_COLUMN);
-
- TableColumn typeColumn = new TableColumn(mTableWidget, SWT.NONE);
- typeColumn.setText(EntityWizardMsg.TYPE_COLUMN);
-
- this.addControlListener(new ControlAdapter() {
- @Override
- public void controlResized(ControlEvent e) {
- Table table = mTableViewer.getTable();
- TableColumn[] columns = table.getColumns();
- Point buttonArea = buttonComposition.computeSize(SWT.DEFAULT, SWT.DEFAULT);
- Rectangle area = table.getParent().getClientArea();
- Point preferredSize = mTableViewer.getTable().computeSize(SWT.DEFAULT, SWT.DEFAULT);
- int width = area.width - 2 * table.getBorderWidth()- buttonArea.x - columns.length * 2 - pkColumn.getWidth();
- if (preferredSize.y > area.height + table.getHeaderHeight()) {
- // Subtract the scrollbar width from the total column width
- // if a vertical scrollbar will be required
- Point vBarSize = table.getVerticalBar().getSize();
- width -= vBarSize.x;
- }
- Point oldSize = table.getSize();
- int consumeWidth = 0;
- int col = columns.length - 1;
- for (int i = 1; i < columns.length; i++) {
- if (oldSize.x > area.width) {
- // table is getting smaller so make the columns
- // smaller first and then resize the table to
- // match the client area width
- consumeWidth = setColumntWidth(width, columns, consumeWidth, i);
- table.setSize(area.width - buttonArea.x - (col * 2 + pkColumn.getWidth()), area.height);
- } else {
- // table is getting bigger so make the table
- // bigger first and then make the columns wider
- // to match the client area width
- consumeWidth = setColumntWidth(width, columns, consumeWidth, i);
- table.setSize(area.width - buttonArea.x - (col * 2 + pkColumn.getWidth()), area.height);
- }
- }
- }
-
- private int setColumntWidth(int width, TableColumn[] columns,
- int consumeWidth, int i) {
- if (i < columns.length - 1) {
- columns[i].setWidth(width / (columns.length - 1));
- consumeWidth += columns[i].getWidth();
- } else {
- columns[i].setWidth(width - consumeWidth);
- }
- return consumeWidth;
- }
- });
-
- mTableViewer.addCheckStateListener(new PKFieldCheckStateListener());
- callback = new FieldDialogCallback();
- }
-
- /**
- * This method process the Add... button pressed event. It opens dialog to
- * add new entity field
- */
- private void handleAddButtonSelected() {
- AddFieldDialog dialog = new AddFieldDialog(getShell(), title, typeProposals, labelsForText);
- int result = dialog.open();
- if (result == Window.CANCEL) {
- return;
- }
- EntityRow entityRow = dialog.getEntityRow();
- addEntityRow(entityRow);
- }
-
- /**
- * Add new entity to the table input
- *
- * @param entity
- * the entity which have to be added to the table
- */
- private void addEntityRow(EntityRow entity) {
- if (entity == null)
- return;
- List<EntityRow> valueList = (ArrayList<EntityRow>) mTableViewer.getInput();
- if (valueList == null)
- valueList = new ArrayList<EntityRow>();
- valueList.add(entity);
- setInput(valueList);
- }
-
- /**
- * This method process the Edit... button pressed event. It opens dialog to edit chosen entity field
- */
- private void handleEditButtonSelected() {
- ISelection s = mTableViewer.getSelection();
- if (!(s instanceof IStructuredSelection))
- return;
- IStructuredSelection selection = (IStructuredSelection) s;
- if (selection.size() != 1)
- return;
-
- Object selectedObj = selection.getFirstElement();
- EntityRow entityForEdit = (EntityRow) selectedObj;
- int index = mTableWidget.getSelectionIndex();
- boolean isChecked = mTableViewer.getChecked(entityForEdit);
-
- EditFieldDialog dialog = new EditFieldDialog(getShell(), title, typeProposals, labelsForText, entityForEdit);
- dialog.open();
- EntityRow entityRow = dialog.getEntityRow();
- if (entityRow != null) {
- editEntityRow(index, entityRow);
- mTableViewer.setChecked(entityRow, isChecked);
- mTableViewer.setGrayed(entityRow, false);
- }
- }
-
- /**
- * Edit chosen entity from the table
- * @param index the index of the entity in the table
- * @param newEntity the edited entity field
- */
- private void editEntityRow(int index, EntityRow newEntity) {
- if (newEntity == null)
- return;
-
- List<EntityRow> valueList = (ArrayList<EntityRow>) mTableViewer.getInput();
- if (valueList == null) {
- valueList = new ArrayList();
- }
-
- if (index == -1) {
- valueList.add(newEntity);
- } else {
- valueList.set(index, newEntity);
- }
-
- setInput(valueList);
- }
-
- /**
- * This method process the Remove button pressed event.
- */
- private void handleRemoveButtonSelected() {
- ISelection selection = mTableViewer.getSelection();
- if (selection.isEmpty() || !(selection instanceof IStructuredSelection))
- return;
- List selectedObject = ((IStructuredSelection) selection).toList();
- removeEntityRow(selectedObject);
- }
-
- /**
- * Removes the selected entities from the table
- * @param entities list with entities, which should be removed
- */
- private void removeEntityRow(Collection entities) {
- List<EntityRow> valueList = (ArrayList<EntityRow>) mTableViewer.getInput();
- valueList.removeAll(entities);
- setInput(valueList);
- }
-
- /**
- * Set the input of the table
- * @param input the list with entities which have to be presented in the table
- */
- private void setInput(List input) {
- mTableViewer.setInput(input);
- // Create a new list to trigger property change
- ArrayList<EntityRow> newInput = new ArrayList<EntityRow>();
- newInput.addAll(input);
- model.setProperty(propertyName, newInput);
- }
-
- /**
- * @return the TableViewer of the table
- */
- public TableViewer getTableViewer() {
- return mTableViewer;
- }
-
- // PROVIDERS FOR THE FIELD TABLE
-
- /**
- * The content provider for the table items
- */
- protected class EntityRowContentProvider implements IStructuredContentProvider {
- public boolean isDeleted(Object element) {
- return false;
- }
- public Object[] getElements(Object element) {
- if (element instanceof List) {
- return ((List) element).toArray();
- }
- return new Object[0];
- }
- public void inputChanged(Viewer aViewer, Object oldInput, Object newInput) {
- //Default nothing
- }
- public void dispose() {
- //Default nothing
- }
- }
-
- /**
- * The label provider for the table items
- */
- protected class EntityRowLabelProvider extends LabelProvider implements ITableLabelProvider {
- public Image getColumnImage(Object element, int columnIndex) {
- if (columnIndex == 0) {
- return labelProviderImage;
- }
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- EntityRow entity = (EntityRow) element;
- if (columnIndex == NAME_COLUMN) {
- return entity.getName();
- }
- if (columnIndex == TYPE_COLUMN) {
- return entity.getFqnTypeName();
- }
- mTableViewer.setChecked(entity, entity.isKey());
- return "";
- }
-
- @Override
- public Image getImage(Object element) {
- return labelProviderImage;
- }
-
- @Override
- public String getText(Object element) {
- String[] array = (String[]) element;
- if (array.length > 0) {
- return array[0];
- } else {
- return super.getText(element);
- }
- }
- }
- // END - PROVIDERS FOR THE FIELD TABLE
-
- /**
- * Listener for the Primary Key check box in the table item
- */
- private class PKFieldCheckStateListener implements ICheckStateListener {
-
- public void checkStateChanged(CheckStateChangedEvent event) {
- List<String> pkFields = new ArrayList<String>();
- TableItem[] children = mTableViewer.getTable().getItems();
- for (int i = 0; i < children.length; i++) {
- TableItem item = children[i];
- EntityRow entityRow = (EntityRow)item.getData();
- entityRow.setKey(item.getChecked());
- if (item.getChecked())
- pkFields.add(entityRow.getName());
- }
- model.setProperty(IEntityDataModelProperties.PK_FIELDS, pkFields);
- }
-
- }
-
- // CALLBACK MECHANISM
- /**
- * Callback interface used by the Add/Edit-FieldDialog classes.
- */
- public interface DialogCallback {
-
- /**
- * Validates the text fields.
- * <p>Used to decide whether to enable the OK button of the dialog.
- * If the method returns <code>true</code> the OK button is enabled,
- * otherwise the OK button is disabled.</p>
- * @param combo contains the predefined types
- * @param texts the name of the entity field
- * @return <code>true</code> if the values in the text fields are
- * valid, <code>false</code> otherwise.
- */
- public boolean validate(Text type, Text[] texts);
-
- /**
- * Retrieves the entity presentation object from the fields of the dialog.
- * <p>Implementers of the callback can use these method to do some
- * preprocessing (like trimming) of the data in the text fields before
- * using it. The returned values will be the actual data that will be
- * put in the table viewer.</p>
- * @param combo contains the predefined types
- * @param texts the name of the entity field
- * @return the entity presentation object retrieved from the dialog
- */
- public EntityRow retrieveResultStrings(Text type, Text[] texts);
-
- }
-
- /**
- * Implementation of the <code>FieldDialogCallback</code> interface for
- * both "Name" and "Types" table columns.
- */
- public class FieldDialogCallback implements DialogCallback {
-
- /**
- * The first text field should not be empty.
- */
- public boolean validate(Text type, Text[] texts) {
- if (texts.length > 0) {
- IStatus validateFieldNameStatus = JavaConventions
- .validateFieldName(texts[0].getText(),
- JavaCore.VERSION_1_5,
- JavaCore.VERSION_1_5);
- if (!validateFieldNameStatus.isOK()) {
- return false;
- }
- }
- if (type.getText().equals("")) {
- return false;
- }
- return true;
- }
-
- /**
- * Just retrieves the unmodified values of the text fields as a
- * entity field presentation
- * @see org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.EntityRow
- */
- public EntityRow retrieveResultStrings(Text type, Text[] texts) {
- EntityRow entity = new EntityRow();
- entity.setFqnTypeName(type.getText());
- entity.setName(texts[0].getText());
- return entity;
- }
- }
-
- // THE DIALOGS USED FOR ADD/EDIT OF ENTITY FIELDS - BEGIN
-
- /**
- * The dialog which collect the information (name and type) for the new entity field
- */
- private class AddFieldDialog extends Dialog implements ModifyListener, SelectionListener {
- protected String windowTitle;
- protected String[] typeProposals;
- protected String[] labelsForText;
- protected Text[] texts;
- protected EntityRow entityRow;
- protected Text attributeType;
- protected ContentProposalAdapter contentProposalAdapter;
-
- /**
- * Constructs AddFieldDialog
- * @param shell
- * @param windowTitle dialog label
- * @param typeProposals the elements for the combo
- * @param labelsForText name text
- */
- public AddFieldDialog(Shell shell, String windowTitle, String[] typeProposals, String[] labelsForText) {
- super(shell);
- this.windowTitle = windowTitle;
- this.typeProposals = typeProposals;
- this.labelsForText = labelsForText;
- }
-
- /* Create the area of dialog
- * @see org.eclipse.jface.dialogs.Dialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public Control createDialogArea(Composite parent) {
-
- Composite composite = (Composite) super.createDialogArea(parent);
- getShell().setText(windowTitle);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 4;
- composite.setLayout(layout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- data.widthHint = 300;
- composite.setLayoutData(data);
-
- Label label = new Label(composite, SWT.LEFT);
- label.setText(labelsForText[0]);
- label.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
-
-
- attributeType = new Text(composite, SWT.SINGLE | SWT.BORDER);// | SWT.READ_ONLY);
- //combo.setItems(labelsForCombo);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- attributeType.setLayoutData(data);
-
- Button browseButton = new Button(composite, SWT.PUSH);
- browseButton.setText(EntityWizardMsg.BROWSE_BUTTON_LABEL);
- GridData browseButtonData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
- browseButtonData.horizontalSpan = 1;
- browseButton.setLayoutData(browseButtonData);
- browseButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- handleChooseEntityTypeButtonPressed();
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- // Do nothing
- }
- });
-
- int n = labelsForText.length;
- texts = new Text[n-1];
- for (int i = 1; i < n; i++) {
- Label labelI = new Label(composite, SWT.LEFT);
- labelI.setText(labelsForText[i]);
- labelI.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING));
- texts[i-1] = new Text(composite, SWT.SINGLE | SWT.BORDER);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 2;
- texts[i-1].setLayoutData(data);
- }
-
- attributeType.setFocus();
- Dialog.applyDialogFont(parent);
- createContentProposalProvider();
- return composite;
- }
-
- private IContentProposalProvider createContentProposalProvider() {
- SimpleContentProposalProvider contProvider = new SimpleContentProposalProvider(typeProposals);
- contProvider.setFiltering(true);
-
- contentProposalAdapter = new ContentProposalAdapter(
- attributeType,
- new TextContentAdapter(),
- contProvider,
- ks,
- new char[] {'b', 'c', 'd', 'i', 'f', 'l', 's', 'j', 'B', 'C', 'D', 'F', 'S', 'L', 'I'});
- contentProposalAdapter.setEnabled(true);
- contentProposalAdapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOSAL_REPLACE);
- return contProvider;
- }
-
-
- /**
- * Process browsing when the Browse... button have been pressed. Allow adding of entity field
- * with arbitrary type.
- */
- private void handleChooseEntityTypeButtonPressed() {
- //getControl().setCursor(new Cursor(getShell().getDisplay(), SWT.CURSOR_WAIT));
- IPackageFragmentRoot packRoot = (IPackageFragmentRoot) model.getProperty(INewJavaClassDataModelProperties.JAVA_PACKAGE_FRAGMENT_ROOT);
- if (packRoot == null) {
- return;
- }
-
- // this eliminates the non-exported classpath entries
- final IJavaSearchScope scope = TypeSearchEngine.createJavaSearchScopeForAProject(packRoot.getJavaProject(), true, true);
-
- // This includes all entries on the classpath.
- SelectionDialog dialog=null;
- try{
- dialog = JavaUI
- .createTypeDialog(
- getShell(),
- null,
- scope,
- IJavaElementSearchConstants.CONSIDER_ALL_TYPES,
- false);
- } catch (JavaModelException e) {
- JptJpaUiPlugin.instance().getLog().log(e.getStatus());
- return;
- }
-
- dialog.setTitle(EntityWizardMsg.TYPE_DIALOG_TITLE);
- dialog.setMessage(EntityWizardMsg.TYPE_DIALOG_DESCRIPTION);
-
- if (dialog.open() == Window.OK) {
- IType type;
- Object[] result = dialog.getResult();
- if (result == null || result.length == 0) {
- type = null;
- }
- else type = (IType) result[0];
- String superclassFullPath = IEntityDataModelProperties.EMPTY_STRING;
- if (type != null) {
- superclassFullPath = type.getFullyQualifiedName();
- }
- attributeType.setText(superclassFullPath);
- //getControl().setCursor(null);
- return;
- }
- //getControl().setCursor(null);
- }
-
-
- /* Create the content of the dialog
- * @see org.eclipse.jface.dialogs.Dialog#createContents(org.eclipse.swt.widgets.Composite)
- */
- @Override
- protected Control createContents(Composite parent) {
- Composite composite = (Composite) super.createContents(parent);
-
- attributeType.addSelectionListener(this);
- attributeType.addModifyListener(this);
- for (int i = 0; i < texts.length; i++) {
- texts[i].addModifyListener(this);
- }
-
- updateOKButton();
-
- return composite;
- }
-
- /* Processes OK button pressed event.
- * @see org.eclipse.jface.dialogs.Dialog#okPressed()
- */
- @Override
- protected void okPressed() {
- entityRow = callback.retrieveResultStrings(attributeType, texts);
- super.okPressed();
- }
-
- /**
- * @return the entity representation with the information collected from the dialog
- */
- public EntityRow getEntityRow() {
- return entityRow;
- }
-
- /* Processes text modifying event
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- updateOKButton();
- }
-
- /**
- * Sets state of the OK button in accordance with validate method of the callback object
- * @see DialogCallback
- */
- private void updateOKButton() {
- getButton(IDialogConstants.OK_ID).setEnabled(callback.validate(attributeType, texts));
- }
- /* (non-Javadoc)
- * @see org.eclipse.swt.events.SelectionListener#widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetDefaultSelected(SelectionEvent e) {
- // TODO Auto-generated method stub
-
- }
- /* Update OK button when the appropriate event occurs
- * @see org.eclipse.swt.events.SelectionListener#widgetSelected(org.eclipse.swt.events.SelectionEvent)
- */
- public void widgetSelected(SelectionEvent e) {
- updateOKButton();
- }
- }
-
- /**
- * Constructs EditFieldDialog
- */
- private class EditFieldDialog extends AddFieldDialog {
- protected EntityRow entityRow;
- /**
- * EditFieldDialog constructor comment.
- */
- public EditFieldDialog(Shell shell, String windowTitle, String[] labelsForCombo, String[] labelsForText, EntityRow entity) {
- super(shell, windowTitle, labelsForCombo, labelsForText);
- this.entityRow = entity;
- }
-
- /* Create the area of the dialog
- * @see org.eclipse.jpt.jpa.ui.internal.wizards.entity.EntityRowTableWizardSection.AddFieldDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
- */
- @Override
- public Control createDialogArea(Composite parent) {
-
- Composite composite = (Composite) super.createDialogArea(parent);
-
- attributeType.setText(entityRow.getFqnTypeName());
- texts[0].setText(entityRow.getName());
-
- return composite;
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityTemplate.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityTemplate.java
deleted file mode 100644
index 42f6853d0a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityTemplate.java
+++ /dev/null
@@ -1,126 +0,0 @@
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity;
-
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.*;
-import java.util.*;
-
-public class EntityTemplate
-{
- protected static String nl;
- public static synchronized EntityTemplate create(String lineSeparator)
- {
- nl = lineSeparator;
- EntityTemplate result = new EntityTemplate();
- nl = null;
- return result;
- }
-
- public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "package ";
- protected final String TEXT_2 = ";";
- protected final String TEXT_3 = NL;
- protected final String TEXT_4 = NL + "import ";
- protected final String TEXT_5 = ";";
- protected final String TEXT_6 = NL + NL + "/**" + NL + " * Entity implementation class for Entity: ";
- protected final String TEXT_7 = NL + " *" + NL + " */" + NL + "public class ";
- protected final String TEXT_8 = " extends ";
- protected final String TEXT_9 = " implements ";
- protected final String TEXT_10 = ", ";
- protected final String TEXT_11 = " {" + NL + "" + NL + "\t";
- protected final String TEXT_12 = " " + NL + "\tprivate ";
- protected final String TEXT_13 = " ";
- protected final String TEXT_14 = ";";
- protected final String TEXT_15 = NL + "\tprivate static final long serialVersionUID = 1L;\t" + NL + "\tpublic ";
- protected final String TEXT_16 = "() {" + NL + "\t\tsuper();" + NL + "\t} " + NL + "\t";
- protected final String TEXT_17 = " " + NL + "\tpublic ";
- protected final String TEXT_18 = " get";
- protected final String TEXT_19 = "() {" + NL + " \t\treturn this.";
- protected final String TEXT_20 = ";" + NL + "\t}" + NL + "" + NL + "\tpublic void set";
- protected final String TEXT_21 = "(";
- protected final String TEXT_22 = " ";
- protected final String TEXT_23 = ") {" + NL + "\t\tthis.";
- protected final String TEXT_24 = " = ";
- protected final String TEXT_25 = ";" + NL + "\t}" + NL + "\t";
- protected final String TEXT_26 = NL + " " + NL + "}";
- protected final String TEXT_27 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
- CreateEntityTemplateModel model = (CreateEntityTemplateModel) argument;
-if (model.getJavaPackageName()!=null && model.getJavaPackageName()!="") {
- stringBuffer.append(TEXT_1);
- stringBuffer.append(model.getJavaPackageName());
- stringBuffer.append(TEXT_2);
- }
- stringBuffer.append(TEXT_3);
- Collection<String> imports = model.getImports(false);
-for (String anImport : imports) {
- stringBuffer.append(TEXT_4);
- stringBuffer.append(anImport);
- stringBuffer.append(TEXT_5);
- }
- stringBuffer.append(TEXT_6);
- stringBuffer.append(model.getEntityName());
- stringBuffer.append(TEXT_7);
- stringBuffer.append(model.getClassName());
- String superClass = model.getSuperclassName();
- if (! "".equals(superClass)) {
- stringBuffer.append(TEXT_8);
- stringBuffer.append(superClass);
- }
-
- List<String> interfaces = model.getInterfaces();
- if (interfaces.size()>0) {
- stringBuffer.append(TEXT_9);
- }
- for (int i=0; i<interfaces.size(); i++) {
- String INTERFACE = (String) interfaces.get(i);
- if (i>0) {
- stringBuffer.append(TEXT_10);
- }
- stringBuffer.append(INTERFACE);
- }
- stringBuffer.append(TEXT_11);
- List<EntityRow> fields = model.getEntityFields();
- for (EntityRow entity : fields) {
-
- stringBuffer.append(TEXT_12);
- stringBuffer.append(entity.getType());
- stringBuffer.append(TEXT_13);
- stringBuffer.append(entity.getName());
- stringBuffer.append(TEXT_14);
- }
- stringBuffer.append(TEXT_15);
- stringBuffer.append(model.getClassName());
- stringBuffer.append(TEXT_16);
-
- fields = model.getEntityFields();
- if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String TYPE = field.getType();
- String NAME = field.getName();
- String METHOD = NAME.substring(0,1).toUpperCase() + NAME.substring(1);
-
- stringBuffer.append(TEXT_17);
- stringBuffer.append(TYPE);
- stringBuffer.append(TEXT_18);
- stringBuffer.append(METHOD);
- stringBuffer.append(TEXT_19);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_20);
- stringBuffer.append(METHOD);
- stringBuffer.append(TEXT_21);
- stringBuffer.append(TYPE);
- stringBuffer.append(TEXT_22);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_23);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_24);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_25);
- }
- stringBuffer.append(TEXT_26);
- stringBuffer.append(TEXT_27);
- return stringBuffer.toString();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityWizard.java
deleted file mode 100644
index f077845e53..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityWizard.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 SAP AG, Walldorf 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:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity;
-
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.OPEN_IN_EDITOR;
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.PROJECT;
-import static org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties.QUALIFIED_CLASS_NAME;
-import java.lang.reflect.InvocationTargetException;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.EntityDataModelProvider;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEEditorUtility;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard;
-
-public class EntityWizard
- extends DataModelWizard
- implements INewWizard {
-
- protected String initialProjectName;
-
- protected IStructuredSelection selection;
-
- public EntityWizard(IDataModel model) {
- super(model);
- setWindowTitle(EntityWizardMsg.ENTITY_WIZARD_TITLE);
- setDefaultPageImageDescriptor(JptJpaUiPlugin.getImageDescriptor(JptUiIcons.ENTITY_WIZ_BANNER));
- }
-
- public EntityWizard(){
- this(null);
- }
-
- @Override
- protected void doAddPages() {
- EntityClassWizardPage page1 = new EntityClassWizardPage(
- getDataModel(),
- "pageOne", //$NON-NLS-1$
- EntityWizardMsg.ENTITY_WIZARD_PAGE_DESCRIPTION,
- EntityWizardMsg.ENTITY_WIZARD_PAGE_TITLE);
- page1.setProjectName(this.initialProjectName);
- addPage(page1);
- EntityFieldsWizardPage page2 = new EntityFieldsWizardPage(getDataModel(), "pageTwo"); //$NON-NLS-1$
- addPage(page2);
- }
-
- public IStructuredSelection getSelection() {
- return this.selection;
- }
-
- /**
- * EntityDataModelProvider
- */
- @Override
- protected IDataModelProvider getDefaultProvider() {
- return new EntityDataModelProvider();
- }
-
- @Override
- public boolean canFinish() {
- return getDataModel().isValid();
- }
-
- /**
- * Override the parent method in order to open the generated entity class in java editor
- */
- @Override
- protected void postPerformFinish() throws InvocationTargetException {
- try {
- String className = getDataModel().getStringProperty(QUALIFIED_CLASS_NAME);
- IProject p = (IProject) getDataModel().getProperty(PROJECT);
- IJavaProject javaProject = J2EEEditorUtility.getJavaProject(p);
- IFile file = (IFile) javaProject.findType(className).getResource();
- openEditor(file);
- } catch (Exception cantOpen) {
- JptJpaUiPlugin.log(cantOpen);
- }
- }
-
- /**
- * This method is intended for internal use only. It will open the file, sent as parameter
- * in its own java editor
- */
- private void openEditor(final IFile file) {
- if (getDataModel().getBooleanProperty(OPEN_IN_EDITOR)) {
- if (file != null) {
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- JptJpaUiPlugin.log(e);
- }
- }
- });
- }
- }
- }
-
- public void init(IWorkbench workbench, IStructuredSelection sel) {
- this.selection = sel;
- this.initialProjectName = this.extractProjectName(sel.getFirstElement());
- getDataModel();
- }
-
- protected String extractProjectName(Object object) {
- if (object == null) {
- return null;
- }
-
- IResource resource = PlatformTools.getAdapter(object, IResource.class);
- if (resource != null) {
- return resource.getProject().getName();
- }
-
- IJavaElement javaElement = PlatformTools.getAdapter(object, IJavaElement.class);
- if (javaElement != null) {
- return javaElement.getJavaProject().getProject().getName();
- }
-
- JpaContextNode node = PlatformTools.getAdapter(object, JpaContextNode.class);
- if (node != null) {
- return node.getJpaProject().getProject().getName();
- }
-
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityWizardMsg.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityWizardMsg.java
deleted file mode 100644
index 39acda138a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/EntityWizardMsg.java
+++ /dev/null
@@ -1,127 +0,0 @@
-/***********************************************************************
- * Copyright (c) 2008, 2010 by SAP AG, Walldorf.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- ***********************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity;
-
-import com.ibm.icu.text.MessageFormat;
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-import org.eclipse.osgi.util.NLS;
-
-public class EntityWizardMsg extends NLS {
-
- private static final String BUNDLE_NAME = "jpt_ui_entity_wizard";//$NON-NLS-1$
- private static ResourceBundle resourceBundle;
-
- public static String ENTITY_WIZARD_TITLE;
- public static String ENTITY_WIZARD_PAGE_TITLE;
- public static String ENTITY_WIZARD_PAGE_DESCRIPTION;
- public static String DEFAULT_PACKAGE_WARNING;
- public static String ENTITY_PROPERTIES_TITLE;
- public static String ENTITY_PROPERTIES_DESCRIPTION;
- public static String ENTITY;
- public static String MAPPED_AS_SUPERCLASS;
- public static String INHERITANCE_GROUP;
- public static String INHERITANCE_CHECK_BOX;
- public static String XML_STORAGE_GROUP;
- public static String XML_SUPPORT;
- public static String CHOOSE_XML;
- public static String MAPPING_XML_TITLE;
- public static String XML_NAME_TITLE;
- public static String INVALID_XML_NAME;
- public static String MAPPING_FILE_NOT_LISTED_ERROR;
- public static String CHOOSE_MAPPING_XML_MESSAGE;
- public static String TYPE_DIALOG_TITLE;
- public static String TYPE_DIALOG_DESCRIPTION;
- public static String ENTITY_NAME;
- public static String TABLE_NAME;
- public static String TABLE_NAME_GROUP;
- public static String USE_DEFAULT;
- public static String ENTITY_FIELDS_DIALOG_TITLE;
- public static String ENTITY_FIELDS_GROUP;
- public static String KEY;
- public static String NAME_COLUMN;
- public static String TYPE_COLUMN;
- public static String NAME_TEXT_FIELD;
- public static String TYPE_TEXT_FIELD;
- public static String BROWSE_BUTTON_LABEL;
- public static String ADD_BUTTON_LABEL;
- public static String EDIT_BUTTON_LABEL;
- public static String EntityDataModelProvider_typeNotInProjectClasspath;
- public static String EntityDataModelProvider_invalidPKType;
- public static String EntityDataModelProvider_invalidArgument;
- public static String REMOVE_BUTTON_LABEL;
- public static String DUPLICATED_ENTITY_NAMES_MESSAGE;
- public static String ACCESS_TYPE;
- public static String FIELD_BASED;
- public static String PROPERTY_BASED;
- public static String NO_JPA_PROJECTS;
- public static String APPLY_CHANGES_TO_PERSISTENCE_XML;
- public static String ADD_MAPPED_SUPERCLASS_TO_XML;
- public static String ADD_ENTITY_TO_XML;
- private EntityWizardMsg() {
- // prevent instantiation of class
- }
-
- static {
- NLS.initializeMessages(BUNDLE_NAME, EntityWizardMsg.class);
- }
-
- /**
- * Returns the resource bundle used by all classes in this Project
- */
- public static ResourceBundle getResourceBundle() {
- try {
- return ResourceBundle.getBundle(BUNDLE_NAME);//$NON-NLS-1$
- } catch (MissingResourceException e) {
- // does nothing - this method will return null and getString(String) will return
- // the key it was called with
- }
- return null;
- }
-
- /**
- * Returns the externalized string, mapped to this key
- * @param key
- * @return the text mapped to the key parameter
- */
- public static String getString(String key) {
- if (resourceBundle == null) {
- resourceBundle = getResourceBundle();
- }
-
- if (resourceBundle != null) {
- try {
- return resourceBundle.getString(key);
- } catch (MissingResourceException e) {
- //exception during string obtaining
- return "-" + key + "-";//$NON-NLS-2$//$NON-NLS-1$
- }
- }
- //return key, because the relevant string missing in the bundle
- return "+" + key + "+";//$NON-NLS-2$//$NON-NLS-1$
- }
-
- /**
- * Returns the formated string, mapped to this key
- * @param key
- * @param arguments
- * @return the formated text, mapped to this key, with substituted arguments
- */
- public static String getString(String key, Object[] arguments) {
- try {
- return MessageFormat.format(getString(key), arguments);
- } catch (IllegalArgumentException e) {
- return getString(key);
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/IdClassTemplate.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/IdClassTemplate.java
deleted file mode 100644
index 8c5f1b244c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/IdClassTemplate.java
+++ /dev/null
@@ -1,255 +0,0 @@
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity;
-
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.*;
-import java.util.*;
-
-public class IdClassTemplate
-{
- protected static String nl;
- public static synchronized IdClassTemplate create(String lineSeparator)
- {
- nl = lineSeparator;
- IdClassTemplate result = new IdClassTemplate();
- nl = null;
- return result;
- }
-
- public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
- protected final String TEXT_1 = "package ";
- protected final String TEXT_2 = ";";
- protected final String TEXT_3 = NL;
- protected final String TEXT_4 = NL + "import ";
- protected final String TEXT_5 = ";";
- protected final String TEXT_6 = NL + NL + "/**" + NL + " * ID class for entity: ";
- protected final String TEXT_7 = NL + " *" + NL + " */ " + NL + "public class ";
- protected final String TEXT_8 = " ";
- protected final String TEXT_9 = " implements ";
- protected final String TEXT_10 = ", ";
- protected final String TEXT_11 = " { " + NL + " " + NL + "\t";
- protected final String TEXT_12 = " " + NL + "\tprivate ";
- protected final String TEXT_13 = " ";
- protected final String TEXT_14 = ";";
- protected final String TEXT_15 = NL + "\tprivate static final long serialVersionUID = 1L;" + NL + "" + NL + "\tpublic ";
- protected final String TEXT_16 = "() {}" + NL + "" + NL + "\t";
- protected final String TEXT_17 = NL + NL + "\tpublic ";
- protected final String TEXT_18 = " get";
- protected final String TEXT_19 = "() {" + NL + "\t\treturn this.";
- protected final String TEXT_20 = ";" + NL + "\t}" + NL + "" + NL + "\tpublic void set";
- protected final String TEXT_21 = "(";
- protected final String TEXT_22 = " ";
- protected final String TEXT_23 = ") {" + NL + "\t\tthis.";
- protected final String TEXT_24 = " = ";
- protected final String TEXT_25 = ";" + NL + "\t}" + NL + "\t";
- protected final String TEXT_26 = NL + " " + NL + "\t/*" + NL + "\t * @see java.lang.Object#equals(Object)" + NL + "\t */\t" + NL + "\tpublic boolean equals(Object o) {" + NL + "\t\tif (o == this) {" + NL + "\t\t\treturn true;" + NL + "\t\t}" + NL + "\t\tif (!(o instanceof ";
- protected final String TEXT_27 = ")) {" + NL + "\t\t\treturn false;" + NL + "\t\t}" + NL + "\t\t";
- protected final String TEXT_28 = " other = (";
- protected final String TEXT_29 = ") o;" + NL + "\t\treturn true";
- protected final String TEXT_30 = NL + "\t\t\t&& ";
- protected final String TEXT_31 = "() == other.";
- protected final String TEXT_32 = "()";
- protected final String TEXT_33 = NL + "\t\t\t&& (Double.doubleToLongBits(";
- protected final String TEXT_34 = "()) == Double.doubleToLongBits(other.";
- protected final String TEXT_35 = "()))";
- protected final String TEXT_36 = NL + "\t\t\t&& (Float.floatToIntBits(";
- protected final String TEXT_37 = "()) == Float.floatToIntBits(other.";
- protected final String TEXT_38 = "()))";
- protected final String TEXT_39 = NL + "\t\t\t&& (";
- protected final String TEXT_40 = "() == null ? other.";
- protected final String TEXT_41 = "() == null : ";
- protected final String TEXT_42 = "().equals(other.";
- protected final String TEXT_43 = "()))";
- protected final String TEXT_44 = ";" + NL + "\t}" + NL + "\t" + NL + "\t/*\t " + NL + "\t * @see java.lang.Object#hashCode()" + NL + "\t */\t" + NL + "\tpublic int hashCode() {" + NL + "\t\tfinal int prime = 31;" + NL + "\t\tint result = 1;";
- protected final String TEXT_45 = NL + "\t\tresult = prime * result + (";
- protected final String TEXT_46 = "() ? 1 : 0);";
- protected final String TEXT_47 = NL + "\t\tresult = prime * result + ";
- protected final String TEXT_48 = "();";
- protected final String TEXT_49 = NL + "\t\tresult = prime * result + ((int) ";
- protected final String TEXT_50 = "());";
- protected final String TEXT_51 = NL + "\t\tresult = prime * result + ((int) (";
- protected final String TEXT_52 = "() ^ (";
- protected final String TEXT_53 = "() >>> 32)));";
- protected final String TEXT_54 = NL + "\t\tresult = prime * result + ((int) (Double.doubleToLongBits(";
- protected final String TEXT_55 = "() ) ^ (Double.doubleToLongBits(";
- protected final String TEXT_56 = "()) >>> 32)));";
- protected final String TEXT_57 = NL + "\t\tresult = prime * result + Float.floatToIntBits(";
- protected final String TEXT_58 = "());";
- protected final String TEXT_59 = NL + "\t\tresult = prime * result + (";
- protected final String TEXT_60 = "() == null ? 0 : ";
- protected final String TEXT_61 = "().hashCode());";
- protected final String TEXT_62 = NL + "\t\treturn result;" + NL + "\t}" + NL + " " + NL + " " + NL + "}";
- protected final String TEXT_63 = NL;
-
- public String generate(Object argument)
- {
- final StringBuffer stringBuffer = new StringBuffer();
- CreateEntityTemplateModel model = (CreateEntityTemplateModel) argument;
-if (model.getJavaPackageName()!=null && model.getJavaPackageName()!="") {
- stringBuffer.append(TEXT_1);
- stringBuffer.append(model.getJavaPackageName());
- stringBuffer.append(TEXT_2);
- }
- stringBuffer.append(TEXT_3);
- Collection<String> imports = model.getImports(true);
-for (String anImport : imports) {
- stringBuffer.append(TEXT_4);
- stringBuffer.append(anImport);
- stringBuffer.append(TEXT_5);
- }
- stringBuffer.append(TEXT_6);
- stringBuffer.append(model.getClassName());
- stringBuffer.append(TEXT_7);
- stringBuffer.append(model.getIdClassName());
- stringBuffer.append(TEXT_8);
- List<String> interfaces = model.getInterfaces();
- if (interfaces.size()>0) {
- stringBuffer.append(TEXT_9);
- }
- for (int i=0; i<interfaces.size(); i++) {
- String INTERFACE = (String) interfaces.get(i);
- if (i>0) {
- stringBuffer.append(TEXT_10);
- }
- stringBuffer.append(INTERFACE);
- }
- stringBuffer.append(TEXT_11);
- List<EntityRow> fields = model.getEntityFields();
- List<String> pkFields = model.getPKFields();
- for (int i=0; i<fields.size(); i++) {
- EntityRow entity = (EntityRow) fields.get(i);
- if (!pkFields.contains(entity.getName())) {
- continue;
- }
-
- stringBuffer.append(TEXT_12);
- stringBuffer.append(entity.getType());
- stringBuffer.append(TEXT_13);
- stringBuffer.append(entity.getName());
- stringBuffer.append(TEXT_14);
- }
- stringBuffer.append(TEXT_15);
- stringBuffer.append(model.getIdClassName());
- stringBuffer.append(TEXT_16);
-
- fields = model.getEntityFields();
- if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String TYPE = field.getType();
- String NAME = field.getName();
- if (!pkFields.contains(NAME)) {
- continue;
- }
- String METHOD = NAME.substring(0,1).toUpperCase() + NAME.substring(1);
-
- stringBuffer.append(TEXT_17);
- stringBuffer.append(TYPE);
- stringBuffer.append(TEXT_18);
- stringBuffer.append(METHOD);
- stringBuffer.append(TEXT_19);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_20);
- stringBuffer.append(METHOD);
- stringBuffer.append(TEXT_21);
- stringBuffer.append(TYPE);
- stringBuffer.append(TEXT_22);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_23);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_24);
- stringBuffer.append(NAME);
- stringBuffer.append(TEXT_25);
- }
- stringBuffer.append(TEXT_26);
- stringBuffer.append(model.getIdClassName());
- stringBuffer.append(TEXT_27);
- stringBuffer.append(model.getIdClassName());
- stringBuffer.append(TEXT_28);
- stringBuffer.append(model.getIdClassName());
- stringBuffer.append(TEXT_29);
- if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String NAME = field.getName();
- if (!pkFields.contains(NAME)) {
- continue;
- }
- String TYPE = field.getType();
- String GET_METHOD = "get" + NAME.substring(0,1).toUpperCase() + NAME.substring(1);
- if (TYPE.equals("boolean") || TYPE.equals("byte") || TYPE.equals("char") || TYPE.equals("short") || TYPE.equals("int") || TYPE.equals("long")) {
- stringBuffer.append(TEXT_30);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_31);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_32);
- } else if (TYPE.equals("double")) {
- stringBuffer.append(TEXT_33);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_34);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_35);
- } else if (TYPE.equals("float")) {
- stringBuffer.append(TEXT_36);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_37);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_38);
- } else {
- stringBuffer.append(TEXT_39);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_40);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_41);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_42);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_43);
- }
- }
- stringBuffer.append(TEXT_44);
- if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String NAME = field.getName();
- if (!pkFields.contains(NAME)) {
- continue;
- }
- String TYPE = field.getType();
- String GET_METHOD = "get" + NAME.substring(0,1).toUpperCase() + NAME.substring(1);
- if (TYPE.equals("boolean")) {
- stringBuffer.append(TEXT_45);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_46);
- } else if (TYPE.equals("int")) {
- stringBuffer.append(TEXT_47);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_48);
- } else if (TYPE.equals("byte") || TYPE.equals("char") || TYPE.equals("short")) {
- stringBuffer.append(TEXT_49);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_50);
- } else if (TYPE.equals("long")) {
- stringBuffer.append(TEXT_51);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_52);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_53);
- } else if (TYPE.equals("double")) {
- stringBuffer.append(TEXT_54);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_55);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_56);
- } else if (TYPE.equals("float")) {
- stringBuffer.append(TEXT_57);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_58);
- } else {
- stringBuffer.append(TEXT_59);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_60);
- stringBuffer.append(GET_METHOD);
- stringBuffer.append(TEXT_61);
- }
- }
- stringBuffer.append(TEXT_62);
- stringBuffer.append(TEXT_63);
- return stringBuffer.toString();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/CreateEntityTemplateModel.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/CreateEntityTemplateModel.java
deleted file mode 100644
index 9755e94da1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/CreateEntityTemplateModel.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/***********************************************************************
- * Copyright (c) 2008, 2010 by SAP AG, Walldorf.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- ***********************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.TreeSet;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties;
-import org.eclipse.jst.j2ee.internal.project.J2EEProjectUtilities;
-import org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class CreateEntityTemplateModel {
-
- protected IDataModel dataModel;
-
- private static final String DOT = "."; //$NON-NLS-1$
- private static final String BRACKET = "["; //$NON-NLS-1$
- private static final String PK_SUFFIX = "PK"; //$NON-NLS-1$
- private static final String QUALIFIED_SERIALIZABLE = "java.io.Serializable"; //$NON-NLS-1$
- private static final String PERSISTENCE_PACKAGE = "javax.persistence.*"; //$NON-NLS-1$
- private static final String ENTITY_ANNOTATION = "@Entity"; //$NON-NLS-1$
- private static final String MAPPED_AS_SUPERCLASS_TYPE = "@MappedSuperclass"; //$NON-NLS-1$
- private static final String INHERITANCE_TYPE = "@Inheritance"; //$NON-NLS-1$
-
- /**
- * Constructs entity model as expansion of the data model
- * @param dataModel
- */
- public CreateEntityTemplateModel(IDataModel dataModel) {
- this.dataModel = dataModel;
- }
-
- /**
- * Returns the necessary imports on depends of entity (primary keys) fields. It is used from
- * JET emmiter when it generates entity (IdClass)
- * @param isIdClass flag, which indicates the case. When it is false, the result is
- * the import list for the entity class, in other case the results is the set for the IdClass
- * generation
- * @return the imports collection with the imports for the generated java class
- */
- public Collection<String> getImports(boolean isIdClass) {
- Collection<String> collection = new TreeSet<String>();
-
- String className = getClassName();
- String superclassName = getQualifiedSuperclassName();
-
- if (superclassName != null && superclassName.length() > 0 &&
- !equalSimpleNames(className, superclassName)) {
- collection.add(superclassName);
- }
-
- List interfaces = getQualifiedInterfaces();
- if (interfaces != null) {
- Iterator iterator = interfaces.iterator();
- while (iterator.hasNext()) {
- String iface = (String) iterator.next();
- if (!equalSimpleNames(getClassName(), iface)) {
- collection.add(iface);
- }
- }
- }
- if (isIdClass) {
- collection.addAll(getIdClassImportList());
- } else {
- collection.add(PERSISTENCE_PACKAGE);
- collection.addAll(getFieldImportList());
-
- }
- return collection;
- }
-
- /**
- * @return class name of the entity
- */
- public String getClassName() {
- return getProperty(INewJavaClassDataModelProperties.CLASS_NAME).trim();
- }
-
- /**
- * @return package name when the entity will be generated
- */
- public String getJavaPackageName() {
- return getProperty(INewJavaClassDataModelProperties.JAVA_PACKAGE).trim();
- }
-
- /**
- * @return fully qualified java class name
- */
- public String getQualifiedJavaClassName() {
- if (!getJavaPackageName().equals(IEntityDataModelProperties.EMPTY_STRING)) {
- return getJavaPackageName() + DOT + getClassName();
- }
- return getClassName();
- }
-
- /**
- * @return the name
- */
- public String getSuperclassName() {
- String qualified = getQualifiedSuperclassName();
- if (equalSimpleNames(getClassName(), qualified)) {
- return qualified;
- } else {
- return Signature.getSimpleName(qualified);
- }
- }
-
- /**
- * @return fully qualified name of the entity's super class
- */
- public String getQualifiedSuperclassName() {
- return getProperty(INewJavaClassDataModelProperties.SUPERCLASS).trim();
- }
-
- /**
- * @return list with the interfaces implemented from entity class
- */
- public List<String> getInterfaces() {
- List qualifiedInterfaces = getQualifiedInterfaces();
- List<String> interfaces = new ArrayList<String>(qualifiedInterfaces.size());
-
- Iterator iter = qualifiedInterfaces.iterator();
- while (iter.hasNext()) {
- String qualified = (String) iter.next();
- if (equalSimpleNames(getClassName(), qualified)) {
- interfaces.add(qualified);
- } else {
- interfaces.add(Signature.getSimpleName(qualified));
- }
- }
-
- return interfaces;
- }
-
- /**
- * @return list with the interfaces (fully qualified named) implemented from entity class
- */
- public List getQualifiedInterfaces() {
- List interfaces = (List) this.dataModel.getProperty(INewJavaClassDataModelProperties.INTERFACES);
- if (interfaces == null){
- interfaces = new ArrayList();
- }
- interfaces.add(QUALIFIED_SERIALIZABLE);
- return interfaces;
- }
-
- /**
- * Returns the value of the specified string property
- * @param propertyName
- * @return string value of teh specified propert
- */
- protected String getProperty(String propertyName) {
- return dataModel.getStringProperty(propertyName);
- }
-
- /**
- * This methods is used for the comparison of fully qualified types
- * @param name1 first type name
- * @param name2 second type name
- * @return whether the simple names of the types are equal
- */
- protected boolean equalSimpleNames(String name1, String name2) {
- String simpleName1 = Signature.getSimpleName(name1);
- String simpleName2 = Signature.getSimpleName(name2);
- return simpleName1.equals(simpleName2);
- }
-
- /**
- * @return the type of the artifact - Entity or Mapped superclass
- */
- public String getArtifactType() {
- if(dataModel.getBooleanProperty(IEntityDataModelProperties.MAPPED_AS_SUPERCLASS)) {
- return MAPPED_AS_SUPERCLASS_TYPE;
- }
- return ENTITY_ANNOTATION;
- }
-
- /**
- * @return whether entity set inheritance strategy
- */
- public boolean isInheritanceSet() {
- return dataModel.getBooleanProperty(IEntityDataModelProperties.INHERITANCE);
- }
-
- /**
- * @return the name of the inheritance strategy, as it is defined in the specification
- */
- public String getInheritanceStrategyName() {
- return getProperty(IEntityDataModelProperties.INHERITANCE_STRATEGY);
- }
-
- /**
- * @return the constructed @Inheritance annotation with the relevant strategy
- * if it is chosen
- */
- public String getInheritanceStrategy() {
- String result = IEntityDataModelProperties.EMPTY_STRING;
- if (isInheritanceSet()) {
- result = INHERITANCE_TYPE;
- if (!getProperty(IEntityDataModelProperties.INHERITANCE_STRATEGY).equals(IEntityDataModelProperties.EMPTY_STRING)) { //$NON-NLS-1$
- result += "(strategy=InheritanceType." + getProperty(IEntityDataModelProperties.INHERITANCE_STRATEGY) + ")"; //$NON-NLS-1$ $NON-NLS-2$
-
- }
- }
- return result;
- }
-
- /**
- * @return whether the generated artifact is not entity
- */
- public boolean isNonEntitySuperclass() {
- return !dataModel.getBooleanProperty(IEntityDataModelProperties.ENTITY);
- }
-
- /**
- * @return true the created artifact will be annotated
- * @return false the entity mappings will be registered in XML
- */
- public boolean isArtifactsAnnotated() {
- return !dataModel.getBooleanProperty(IEntityDataModelProperties.XML_SUPPORT);
- }
-
- public boolean isMappingXMLDefault() {
- if (getMappingXMLName().equals(IEntityDataModelProperties.EMPTY_STRING)) {
- return true;
- }
- return getMappingXMLName().equals(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- }
-
- public String getMappingXMLName() {
- return dataModel.getStringProperty(IEntityDataModelProperties.XML_NAME).trim();
- }
-
- public IFile getMappingXmlFile() {
- IFile ormFile = null;
- IProject project = getProject();
- IPackageFragmentRoot[] sourceFragments = J2EEProjectUtilities.getSourceContainers(project);
- for (IPackageFragmentRoot packageFragmentRoot : sourceFragments) {
- ormFile = project.getFile(packageFragmentRoot.getResource().getName() + File.separator + getMappingXMLName());
- if (ormFile.exists()) {
- break;
- }
- }
- return ormFile;
- }
-
- /**
- * @return the entity name (could be different from the class name)
- * See <code>isEntityNameSet()<code>
- */
- public String getEntityName() {
- return getProperty(IEntityDataModelProperties.ENTITY_NAME).trim();
- }
-
- /**
- * @return whether the entity name is different than class name
- */
- public boolean isEntityNameSet() {
- boolean result = false;
- if (!getClassName().equals(getEntityName())) {
- result = true;
- }
- return result;
- }
-
- /**
- * @return whether the table name is specified explicitly
- */
- public boolean isTableNameSet() {
- return !dataModel.getBooleanProperty(IEntityDataModelProperties.TABLE_NAME_DEFAULT);
- }
-
- /**
- * @return the table name (if it is specified)
- * See <code>isTableNameSet()<code>
- */
- public String getTableName() {
- return getProperty(IEntityDataModelProperties.TABLE_NAME).trim();
- }
-
- /**
- * @return list with the entity fields
- */
- public List<EntityRow> getEntityFields() {
- ArrayList<EntityRow> fields = (ArrayList<EntityRow>) dataModel.getProperty(IEntityDataModelProperties.ENTITY_FIELDS);
- if (fields == null){
- return new ArrayList<EntityRow>();
- } else
- return fields;
- }
-
- /**
- * @return list with the imports necessary for the entity (based on its fields)
- */
- public List<String> getFieldImportList() {
- List<String> imports = new ArrayList<String>();
- List<EntityRow> entities = getEntityFields();
- for (EntityRow entityRow : entities) {
- if (!imports.contains(entityRow.getFqnTypeName()) && !entityRow.getType().equals(entityRow.getFqnTypeName())) {
- String fqnTypeName = entityRow.getFqnTypeName();
- //remove the array brackets [] for the java.lang.Byte[] & java.lang.Character[]
- if (fqnTypeName.indexOf(BRACKET) != -1) {
- fqnTypeName = fqnTypeName.substring(0, fqnTypeName.indexOf("["));
- }
- imports.add(fqnTypeName);
- }
- }
- return imports;
- }
- /**
- * @return list with the imports necessary for the id class (based on its fields - primary keys of the entity)
- */
- public List<String> getIdClassImportList() {
- List<String> imports = new ArrayList<String>();
- List<EntityRow> entities = getEntityFields();
- List<String> pkFields = getPKFields();
- for (EntityRow entityRow : entities) {
- String name = entityRow.getName();
- if (pkFields.contains(name)) {
- if (!imports.contains(entityRow.getFqnTypeName()) && !entityRow.getType().equals(entityRow.getFqnTypeName())) {
- imports.add(entityRow.getFqnTypeName());
- }
- }
- }
- return imports;
- }
-
- /**
- * @return whether the access type is field based
- */
- public boolean isFieldAccess() {
- return dataModel.getBooleanProperty(IEntityDataModelProperties.FIELD_ACCESS_TYPE);
- }
-
- /**
- * @return the primary key is composite (more than one annotated as primary key field)
- */
- public boolean isCompositePK() {
- return getPKFields().size() > 1;
- }
-
- /**
- * @return list with primary key name(s)
- */
- public List<String> getPKFields() {
- return (ArrayList<String>)dataModel.getProperty(IEntityDataModelProperties.PK_FIELDS);
- }
-
- /**
- * @return constructed name of the id class (entity name + PK as suffix)
- */
- public String getIdClassName() {
- return getClassName() + PK_SUFFIX;
- }
-
- /**
- * @return constructed name of the mapping file id class (package name + entity name + PK as suffix)
- */
- public String getOrmIdClassName() {
- return getQualifiedJavaClassName() + PK_SUFFIX;
- }
-
- /**
- * @return IProject presentation of JPA project
- */
- public IProject getProject() {
- String projectName = dataModel.getStringProperty(IArtifactEditOperationDataModelProperties.PROJECT_NAME);
- return ProjectUtilities.getProject(projectName);
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/EntityDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/EntityDataModelProvider.java
deleted file mode 100644
index 30d1304520..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/EntityDataModelProvider.java
+++ /dev/null
@@ -1,506 +0,0 @@
-/***********************************************************************
- * Copyright (c) 2008, 2012 by SAP AG, Walldorf 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:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- ***********************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.core.resources.IContainer;
-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.IType;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.core.Signature;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.EntityWizardMsg;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.operation.NewEntityClassOperation;
-import org.eclipse.jst.j2ee.internal.common.J2EECommonMessages;
-import org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties;
-import org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModelProvider;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-import com.ibm.icu.text.MessageFormat;
-
-public class EntityDataModelProvider extends NewJavaClassDataModelProvider implements IEntityDataModelProperties{
-
- @Override
- public IDataModelOperation getDefaultOperation() {
- return new NewEntityClassOperation(getDataModel());
- }
-
- /**
- * Extends: <code>IDataModelProvider#getPropertyNames()</code>
- * and add own data model's properties specific for the entity model
- *
- * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider#getPropertyNames()
- */
- @Override
- public Set getPropertyNames() {
- Set propertyNames = super.getPropertyNames();
- propertyNames.add(INHERITANCE);
- propertyNames.add(ENTITY);
- propertyNames.add(MAPPED_AS_SUPERCLASS);
- propertyNames.add(INHERITANCE_STRATEGY);
- propertyNames.add(XML_SUPPORT);
- propertyNames.add(XML_NAME);
- propertyNames.add(ENTITY_NAME);
- propertyNames.add(TABLE_NAME_DEFAULT);
- propertyNames.add(TABLE_NAME);
- propertyNames.add(ENTITY_FIELDS);
- propertyNames.add(PK_FIELDS);
- propertyNames.add(FIELD_ACCESS_TYPE);
- propertyNames.add(PROPERTY_ACCESS_TYPE);
- return propertyNames;
- }
-
- /**
- * Returns the default value of the parameter (which should present a valid data model property).
- * This method does not accept a null parameter. It may return null.
- *
- * @see NewJavaClassDataModelProvider#getDefaultProperty(String)
- * @see IDataModelProvider#getDefaultProperty(String)
- *
- * @param propertyName
- * @return Object default value of property
- */
- @Override
- public Object getDefaultProperty(String propertyName) {
- // overridden
- if (propertyName.equals(SOURCE_FOLDER)) {
- IContainer container = getDefaultJavaSourceContainer();
- return (container == null) ? null : container.getFullPath().toString();
- }
-
- else if (propertyName.equals(INHERITANCE)) {
- return Boolean.FALSE;
- } else if (propertyName.equals(ENTITY)) {
- return Boolean.TRUE;
- } else if (propertyName.equals(MAPPED_AS_SUPERCLASS)) {
- return Boolean.FALSE;
- } else if (propertyName.equals(XML_SUPPORT)) {
- return Boolean.FALSE;
- } else if (propertyName.equals(XML_NAME)) {
- return EMPTY_STRING;
- } else if (propertyName.equals(ENTITY_NAME)) {
- return getStringProperty(CLASS_NAME);
- } else if (propertyName.equals(TABLE_NAME_DEFAULT)) {
- return Boolean.TRUE;
- } else if (propertyName.equals(TABLE_NAME)) {
- return getStringProperty(CLASS_NAME);
- } else if (propertyName.equals(INHERITANCE_STRATEGY)) {
- return EMPTY_STRING;
- } else if (propertyName.equals(SUPERCLASS)) {
- return EMPTY_STRING;
- } else if (propertyName.equals(ENTITY_FIELDS)) {
- return new ArrayList<EntityRow>();
- } else if (propertyName.equals(PK_FIELDS)) {
- return new ArrayList<String>();
- } else if (propertyName.equals(FIELD_ACCESS_TYPE)) {
- return Boolean.TRUE;
- } else if (propertyName.equals(PROPERTY_ACCESS_TYPE)) {
- return Boolean.FALSE;
- }
- // Otherwise check super for default value for property
- return super.getDefaultProperty(propertyName);
- }
-
- @Override
- protected IFolder getDefaultJavaSourceFolder() {
- return null;
- }
-
- protected IContainer getDefaultJavaSourceContainer() {
- JpaProject jpaProject = getTargetJpaProject();
- if (jpaProject == null) {
- return null;
- }
- IJavaProject javaProject = jpaProject.getJavaProject();
- try {
- for (IPackageFragmentRoot pfr : javaProject.getPackageFragmentRoots()) {
- if (pfr.getKind() == IPackageFragmentRoot.K_SOURCE) {
- return (IContainer) pfr.getUnderlyingResource();
- }
- }
- }
- catch (JavaModelException jme) {
- // fall through
- JptJpaUiPlugin.log(jme);
- }
- return null;
- }
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- boolean ok = super.propertySet(propertyName, propertyValue);
- if (ok) {
- if (COMPONENT_NAME.equals(propertyName) || PROJECT_NAME.equals(propertyName)) {
- this.model.notifyPropertyChange(SOURCE_FOLDER, IDataModel.DEFAULT_CHG);
- }
- if (PROJECT_NAME.equals(propertyName) || XML_SUPPORT.equals(propertyName)) {
- this.model.notifyPropertyChange(XML_NAME, IDataModel.VALID_VALUES_CHG);
- }
- }
- return ok;
- }
-
- /* Adds additional check to the model validation
- * @see org.eclipse.jst.j2ee.internal.common.operations.NewJavaClassDataModelProvider#validate(java.lang.String)
- */
- @Override
- public IStatus validate(String propertyName) {
- IStatus result = super.validate(propertyName);
- if (propertyName.equals(JAVA_PACKAGE)) {
- return validateJavaPackage(getStringProperty(propertyName));
- }
- if (propertyName.equals(SUPERCLASS) && EMPTY_STRING.equals(getStringProperty(propertyName))) {
- return WTPCommonPlugin.OK_STATUS;
- }
- if (propertyName.equals(XML_NAME)) {
- return validateXmlName(getStringProperty(propertyName));
- }
- if (propertyName.equals(ENTITY_FIELDS)) {
- return validateFieldsList((ArrayList<EntityRow>) getProperty(propertyName));
- }
- return result;
- }
-
- @Override
- protected IStatus validateJavaSourceFolder(String containerFullPath) {
- // Ensure that the source folder path is not empty
- if (containerFullPath == null || containerFullPath.length() == 0) {
- String msg = J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NAME_EMPTY;
- return WTPCommonPlugin.createErrorStatus(msg);
- }
- // Ensure that the source folder path is absolute
- else if (!new Path(containerFullPath).isAbsolute()) {
- String msg = J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NOT_ABSOLUTE;
- return WTPCommonPlugin.createErrorStatus(msg);
- }
- IProject project = getTargetProject();
- // Ensure project is not closed
- if (project == null) {
- String msg = J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NOT_EXIST;
- return WTPCommonPlugin.createErrorStatus(msg);
- }
- // Ensure project is accessible.
- if (!project.isAccessible()) {
- String msg = J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NOT_EXIST;
- return WTPCommonPlugin.createErrorStatus(msg);
- }
- // Ensure the project is a java project.
- try {
- if (!project.hasNature(JavaCore.NATURE_ID)) {
- String msg = J2EECommonMessages.ERR_JAVA_CLASS_NOT_JAVA_PROJECT;
- return WTPCommonPlugin.createErrorStatus(msg);
- }
- } catch (CoreException e) {
- J2EEPlugin.logError(e);
- }
- // Ensure the selected folder is a valid java source folder for the component
- IContainer container = getJavaSourceContainer();
- if (container == null || (! container.getFullPath().equals(new Path(containerFullPath)))) {
- String msg = J2EECommonMessages.getResourceString(J2EECommonMessages.ERR_JAVA_CLASS_FOLDER_NOT_SOURCE, new String[]{containerFullPath});
- return WTPCommonPlugin.createErrorStatus(msg);
- }
- // Valid source is selected
- return WTPCommonPlugin.OK_STATUS;
- }
-
- /**
- * This method is intended for internal use only. It will be used to validate the correctness of entity package
- * in accordance with Java convention requirements. This method will accept a null parameter.
- *
- * @see NewFilterClassDataModelProvider#validate(String)
- *
- * @param packName
- * @return IStatus is the package name satisfies Java convention requirements
- */
-
- private IStatus validateJavaPackage(String packName) {
- if (packName == null || packName.equals(EMPTY_STRING)) {
- return WTPCommonPlugin.createWarningStatus(EntityWizardMsg.DEFAULT_PACKAGE_WARNING);
- }
- // Use standard java conventions to validate the package name
- IStatus javaStatus = JavaConventions.validatePackageName(packName, JavaCore.VERSION_1_5, JavaCore.VERSION_1_5);
- if (javaStatus.getSeverity() == IStatus.ERROR) {
- String msg = J2EECommonMessages.ERR_JAVA_PACAKGE_NAME_INVALID + javaStatus.getMessage();
- return WTPCommonPlugin.createErrorStatus(msg);
- } else if (javaStatus.getSeverity() == IStatus.WARNING) {
- String msg = J2EECommonMessages.ERR_JAVA_PACKAGE_NAME_WARNING + javaStatus.getMessage();
- return WTPCommonPlugin.createWarningStatus(msg);
- }
- // java package name is valid
- return WTPCommonPlugin.OK_STATUS;
- }
-
- /**
- * This method is intended for internal use only. It will be used to validate
- * the correctness of xml file location.
- * This method will accept a null parameter.
- *
- * @see NewFilterClassDataModelProvider#validate(String)
- *
- * @param xmlName
- * @return IStatus is the package name satisfies Java convention requirements
- */
- private IStatus validateXmlName(String xmlName) {
- if (getBooleanProperty(XML_SUPPORT)) {
- String projectName = this.model.getStringProperty(PROJECT_NAME);
- IProject project = ProjectUtilities.getProject(projectName);
- if (project != null) {
- JpaXmlResource ormXmlResource = StringTools.stringIsEmpty(xmlName) ? null : getOrmXmlResource(xmlName);
- if (ormXmlResource == null) {
- return new Status(
- IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID,
- EntityWizardMsg.INVALID_XML_NAME);
- }
- else if (getTargetJpaProject().getJpaFile(ormXmlResource.getFile()).getRootStructureNodesSize() == 0) {
- return new Status(
- IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID,
- EntityWizardMsg.MAPPING_FILE_NOT_LISTED_ERROR);
- }
- }
- }
- return Status.OK_STATUS;
- }
-
- protected JpaXmlResource getOrmXmlResource(String xmlName) {
- return getTargetJpaProject().getMappingFileXmlResource(new Path(xmlName));
- }
-
- /**
- * This method is intended for internal use only. It will be used to validate the entity fields
- * list to ensure there are not any duplicates. This method will accept a null parameter.
- *
- * @see NewFilterClassDataModelProvider#validate(String)
- *
- * @param entities
- * @return IStatus is the fields names are unique
- */
- private IStatus validateFieldsList(ArrayList<EntityRow> entities) {
- if (entities != null && !entities.isEmpty()) {
- // Ensure there are not duplicate entries in the list
- boolean dup = hasDuplicatesInEntityFields(entities);
- if (dup) {
- String msg = EntityWizardMsg.DUPLICATED_ENTITY_NAMES_MESSAGE;
- return WTPCommonPlugin.createErrorStatus(msg);
- }
- // Ensure that the entries in the list are valid
- String errorMsg = checkInputElementsTypeValidation(entities);
- if (errorMsg != null) {
- return WTPCommonPlugin.createErrorStatus(errorMsg);
- }
- String warningMsg = checkInputElementsTypeExistence(entities);
- if (warningMsg != null) {
- return WTPCommonPlugin.createWarningStatus(warningMsg);
- }
- }
- return WTPCommonPlugin.OK_STATUS;
- }
-
- private String checkInputElementsTypeValidation(List<EntityRow> inputElements) {
- IStatus validateFieldTypeStatus = Status.OK_STATUS;
- for (EntityRow entityRow: inputElements) {
- if (entityRow.isKey() && !entityRow.couldBeKey()) {
- String message = MessageFormat.format(
- EntityWizardMsg.EntityDataModelProvider_invalidPKType, new Object[]{entityRow.getFqnTypeName()});
- validateFieldTypeStatus = new Status(IStatus.ERROR,
- JptJpaUiPlugin.PLUGIN_ID, message);
- break;
- }
- String sig = null;
- try {
- sig = Signature.createTypeSignature(entityRow.getFqnTypeName(), true);
- } catch (IllegalArgumentException e) {
- String message = MessageFormat.format(EntityWizardMsg.EntityDataModelProvider_invalidArgument, new Object[]{e.getLocalizedMessage()});
- validateFieldTypeStatus = new Status(IStatus.ERROR, JptJpaUiPlugin.PLUGIN_ID, message);
- break;
- }
- if (sig == null){
- validateFieldTypeStatus = JavaConventions.validateJavaTypeName(entityRow.getType(), JavaCore.VERSION_1_5, JavaCore.VERSION_1_5);
- break;
- }
- int sigType = Signature.getTypeSignatureKind(sig);
- if (sigType == Signature.BASE_TYPE_SIGNATURE) {
- continue;
- }
- else if (sigType == Signature.ARRAY_TYPE_SIGNATURE) {
- String elementSignature = Signature.getElementType(sig);
- if (Signature.getTypeSignatureKind(elementSignature) == Signature.BASE_TYPE_SIGNATURE) {
- continue;
- }
- }
- }
- if (!validateFieldTypeStatus.isOK()) {
- return validateFieldTypeStatus.getMessage();
- }
- return null;
- }
-
- private String checkInputElementsTypeExistence(List<EntityRow> inputElements) {
- IStatus validateFieldTypeStatus=Status.OK_STATUS;
- for (EntityRow entityRow: inputElements) {
- String sig = Signature.createTypeSignature(entityRow.getFqnTypeName() ,true);
- if (sig == null) {
- String message = MessageFormat.format(
- EntityWizardMsg.EntityDataModelProvider_typeNotInProjectClasspath, new Object[]{entityRow.getFqnTypeName()});
- validateFieldTypeStatus = new Status(IStatus.ERROR,
- JptJpaUiPlugin.PLUGIN_ID, message);
- break;
- }
- int sigType = Signature.getTypeSignatureKind(sig);
- if (sigType == Signature.BASE_TYPE_SIGNATURE){
- continue;
- }
- else if (sigType == Signature.ARRAY_TYPE_SIGNATURE) {
- String elementSignature = Signature.getElementType(sig);
- if(Signature.getTypeSignatureKind(elementSignature) == Signature.BASE_TYPE_SIGNATURE){
- continue;
- }
- String qualifiedName = Signature.toString(elementSignature);
- IProject project = (IProject) getProperty(INewJavaClassDataModelProperties.PROJECT);
- IJavaProject javaProject = JavaCore.create(project);
- IType type = null;
- try {
- type = javaProject.findType(qualifiedName);
- } catch (JavaModelException e) {
- validateFieldTypeStatus = e.getStatus();
- break;
- }
- if (type == null) {
- String message = MessageFormat.format(
- EntityWizardMsg.EntityDataModelProvider_typeNotInProjectClasspath, new Object[]{entityRow.getFqnTypeName()});
- validateFieldTypeStatus = new Status(IStatus.ERROR,
- JptJpaUiPlugin.PLUGIN_ID, message);
- break;
- }
- }
- else {
- IProject project = (IProject) getProperty(INewJavaClassDataModelProperties.PROJECT);
- IJavaProject javaProject = JavaCore.create(project);
- IType type = null;
- try {
- type = javaProject.findType(entityRow.getFqnTypeName());
- } catch (JavaModelException e) {
- validateFieldTypeStatus = e.getStatus();
- break;
- }
- if (type == null) {
- String message = MessageFormat.format(
- EntityWizardMsg.EntityDataModelProvider_typeNotInProjectClasspath, new Object[]{entityRow.getFqnTypeName()});
- validateFieldTypeStatus = new Status(IStatus.ERROR,
- JptJpaUiPlugin.PLUGIN_ID, message);
- break;
- }
- }
- }
- if(!validateFieldTypeStatus.isOK()) {
- return validateFieldTypeStatus.getMessage();
- }
- return null;
- }
-
-
-
- /**
- * This method is intended for internal use only. It provides a simple algorithm for detecting
- * if there are duplicate entries in a list. It will accept a null parameter. It will return
- * boolean.
- *
- * @param input
- * @return boolean are there duplications in the list
- */
- private boolean hasDuplicatesInEntityFields(ArrayList<EntityRow> input) {
- if (input == null) {
- return false;
- }
- int n = input.size();
- // nested for loops to check each element to see if other elements are the same
- for (int i = 0; i < n; i++) {
- EntityRow entity = input.get(i);
- for (int j = i + 1; j < n; j++) {
- EntityRow intEntity = input.get(j);
- if (intEntity.getName().equals(entity.getName())) {
- return true;
- }
- }
- }
- return false;
- }
-
- protected JpaProject getTargetJpaProject() {
- IProject project = getTargetProject();
- return ((project != null) && JpaFacet.isInstalled(project)) ?
- this.getJpaProject(project) :
- null;
- }
-
- protected JpaProject getJpaProject(IProject project) {
- return (JpaProject) project.getAdapter(JpaProject.class);
- }
-
- protected IContainer getJavaSourceContainer() {
- String containerFullPath = getStringProperty(SOURCE_FOLDER);
- JpaProject jpaProject = getTargetJpaProject();
- if (jpaProject == null) {
- return null;
- }
- IJavaProject javaProject = jpaProject.getJavaProject();
- try {
- for (IPackageFragmentRoot pfr : javaProject.getPackageFragmentRoots()) {
- if (pfr.getKind() == IPackageFragmentRoot.K_SOURCE) {
- IContainer container = (IContainer) pfr.getUnderlyingResource();
- if (container.getFullPath().equals(new Path(containerFullPath))) {
- return container;
- }
- }
- }
- }
- catch (JavaModelException jme) {
- // fall through
- JptJpaUiPlugin.log(jme);
- }
- return null;
- }
-
- @Override
- protected IPackageFragmentRoot getJavaPackageFragmentRoot() {
- JpaProject jpaProject = getTargetJpaProject();
- if (jpaProject != null) {
- IJavaProject javaProject = jpaProject.getJavaProject();
- // Return the source folder for the java project of the selected project
- if (javaProject != null) {
- IContainer sourceContainer = getJavaSourceContainer();
- if (sourceContainer != null) {
- return javaProject.getPackageFragmentRoot(sourceContainer);
- }
- }
- }
- return null;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/EntityRow.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/EntityRow.java
deleted file mode 100644
index 5c029894e4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/EntityRow.java
+++ /dev/null
@@ -1,206 +0,0 @@
-/***********************************************************************
- * Copyright (c) 2008, 2009 by SAP AG, Walldorf.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- ***********************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model;
-
-import java.util.Arrays;
-import java.util.List;
-
-public class EntityRow {
-
- private static final String DOT = ".";
- private static final char BRACKET_SQUARE = '[';
- private static final char BRACKET_ANGULAR = '<';
- private static final String PACKAGE_JAVA_LANG = "java.lang.";
- private boolean key = false;
- private String name = "";
- private String type = "";
- private String fqnTypeName = "";
-
- private final static String[] PK_TYPES = {"int", "long", "short", "char", "boolean", "byte", "double", "float",
- "java.lang.String", "java.sql.Date", "java.util.Date", "java.lang.Integer", "java.lang.Long", "java.lang.Short",
- "java.lang.Character", "java.lang.Boolean", "java.lang.Byte", "java.lang.Double", "java.lang.Float"};
-
- private final static String[] PK_TYPES_SHORT = { "String", "Integer", "Long", "Short", "Character", "Boolean",
- "Byte", "Double", "Float" };
-
- private final static List<String> VALID_PK_TYPES = Arrays.asList(PK_TYPES);
- private final static List<String> VALID_PK_TYPES_SHORT = Arrays.asList(PK_TYPES_SHORT);
-
- /**
- * @return whether the presented entity field is primary key or part of composite primary key
- */
- public boolean isKey() {
- return key;
- }
-
- /**
- * Sets the presented entity field to be primary key (or part of composite primari key)
- *
- * @param key
- */
- public void setKey(boolean key) {
- this.key = key;
- }
-
- /**
- * Check whether the type of the entity is allowed to be primary key.
- * The limitation in the current implementation is that Embedded PK are not checked
- * @return whether the type of field could be used as primary key
- */
- public boolean couldBeKey() {
- boolean result = false;
- result = VALID_PK_TYPES.contains(getFqnTypeName());
- return result;
- }
-
- /**
- * @return the name of the entity field
- */
- public String getName() {
- return name;
- }
-
- /**
- * Sets the name of the presented entity field
- * @param name
- */
- public void setName(String name) {
- this.name = name;
- }
-
- /**
- * @return the type (as a simple name) of the entity field
- */
- public String getType() {
- return type;
- }
-
- /**
- * Sets the type (as a simple name) of the entity field
- *
- * @param type
- */
- public void setType(String type) {
- this.type = type;
- }
-
- /**
- * @return the type (as fully qualified name) of the entity field
- */
- public String getFqnTypeName() {
- return fqnTypeName;
- }
-
- private String removeSpaces(String str) {
- str = str.trim();
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < str.length(); i++) {
- char c = str.charAt(i);
- if (!Character.isWhitespace(c))
- sb.append(c);
- }
- return sb.toString();
- }
-
- private String getBasicFQN(String fqn) {
- String res;
- int bsIndex = fqn.indexOf(BRACKET_SQUARE);
- int baIndex = fqn.indexOf(BRACKET_ANGULAR);
- if (bsIndex == -1) {
- if (baIndex == -1) res = fqn;
- else res = fqn.substring(0, baIndex);
- } else {
- if (baIndex == -1) res = fqn.substring(0, bsIndex);
- else res = fqn.substring(0, Math.max(bsIndex, baIndex));
- }
- return res;
- }
-
- /**
- * Sets the fully qualified type name of the entity field
- *
- * @param fqnTypeName
- */
- public void setFqnTypeName(String fqnTypeName) {
- fqnTypeName = removeSpaces(fqnTypeName);
- String fqnBasicTypeName = getBasicFQN(fqnTypeName);
- if (fqnBasicTypeName.indexOf(DOT) == -1) {
- if (VALID_PK_TYPES_SHORT.contains(fqnBasicTypeName)) {
- this.fqnTypeName = PACKAGE_JAVA_LANG + fqnTypeName;
- setType(fqnTypeName);
- } else {
- this.fqnTypeName = fqnTypeName;
- setType(fqnTypeName);
- }
- } else {
- this.fqnTypeName = fqnTypeName;
- setType(getSimpleName(fqnTypeName));
- }
- }
-
- /**
- * @return whether the type of the entity field is boolean. The information could be used
- * when the name of getter should be constructed
- */
- public boolean isBoolean() {
- return "boolean".equals(getType());
- }
-
- /**
- * For internal purpose only
- * Convert fully qualified name to the simple one
- * @param fullyName
- * @return the simple name form the fully qualified name parameter(last segment)
- */
- private String getSimpleName(String fullyName) {
- return fullyName.substring(fullyName.lastIndexOf(DOT) + 1);
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result
- + ((fqnTypeName == null) ? 0 : fqnTypeName.hashCode());
- result = prime * result + ((name == null) ? 0 : name.hashCode());
- return result;
- }
-
- /*
- * Implement equals, depending from name of the entity field and its type.
- * The type is presented from the fully qualified name
- * @see java.lang.Object#equals(java.lang.Object)
- */
- @Override
- public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
- final EntityRow other = (EntityRow) obj;
- if (fqnTypeName == null) {
- if (other.fqnTypeName != null)
- return false;
- } else if (!fqnTypeName.equals(other.fqnTypeName))
- return false;
- if (name == null) {
- if (other.name != null)
- return false;
- } else if (!name.equals(other.name))
- return false;
- return true;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/IEntityDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/IEntityDataModelProperties.java
deleted file mode 100644
index 62ea483a2e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/model/IEntityDataModelProperties.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/***********************************************************************
- * Copyright (c) 2008 by SAP AG, Walldorf.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- ***********************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model;
-
-import org.eclipse.jst.j2ee.application.internal.operations.IAnnotationsDataModel;
-import org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties;
-
-public interface IEntityDataModelProperties extends INewJavaClassDataModelProperties, IAnnotationsDataModel {
-
- public static final String ENTITY = "IEntityDataModelProperties.ENTITY"; //$NON-NLS-1$
- public static final String MAPPED_AS_SUPERCLASS = "IEntityDataModelProperties.MAPPED_AS_SUPERCLASS"; //$NON-NLS-1$
- public static final String INHERITANCE = "IEntityDataModelProperties.INHERITANCE"; //$NON-NLS-1$
- public static final String INHERITANCE_STRATEGY = "IEntityDataModelProperties.INHERITANCE_STRATEGY"; //$NON-NLS-1$
- public static final String XML_SUPPORT = "IEntityDataModelProperties.XML_SUPPORT"; //$NON-NLS-1$XML_SUPPORT
- public static final String XML_NAME = "IEntityDataModelProperties.XML_NAME"; //$NON-NLS-1$XML_SUPPORT
- public static final String ENTITY_NAME = "IEntityDataModelProperties.ENTITY_NAME"; //$NON-NLS-1$
- public static final String TABLE_NAME_DEFAULT = "IEntityDataModelProperties.TABLE_NAME_DEFAULT"; //$NON-NLS-1$
- public static final String TABLE_NAME = "IEntityDataModelProperties.TABLE_NAME"; //$NON-NLS-1$
- public static final String ENTITY_FIELDS = "IEntityDataModelProperties.ENTITY_FIELDS"; //$NON-NLS-1$
- public static final String PK_FIELDS = "IEntityDataModelProperties.PK_FIELDS"; //$NON-NLS-1$
- public static final String FIELD_ACCESS_TYPE = "IEntityDataModelProperties.FIELD_ACCESS_TYPE"; //$NON-NLS-1$
- public static final String PROPERTY_ACCESS_TYPE = "IEntityDataModelProperties.PROPERTY_ACCESS_TYPE"; //$NON-NLS-1$
- public static final String EMPTY_STRING = ""; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/operation/NewEntityClassOperation.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/operation/NewEntityClassOperation.java
deleted file mode 100644
index 9c692005a3..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/entity/data/operation/NewEntityClassOperation.java
+++ /dev/null
@@ -1,574 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 SAP AG, Walldorf 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:
- * SAP AG - initial API and implementation
- * Dimiter Dimitrov, d.dimitrov@sap.com - initial API and implementation
- * Oracle - additional maintenance
- ***********************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.operation;
-
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.URL;
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IMarker;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IWorkspace;
-import org.eclipse.core.resources.IWorkspaceRunnable;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.FileLocator;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.codegen.jet.JETEmitter;
-import org.eclipse.emf.codegen.jet.JETException;
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IJavaModelMarker;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.ui.internal.utility.SynchronousUiCommandExecutor;
-import org.eclipse.jpt.common.utility.command.Command;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaProjectManager;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdTypeMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.AnnotatedEntityTemplate;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.EntityTemplate;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.EntityWizardMsg;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.IdClassTemplate;
-import org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.CreateEntityTemplateModel;
-import org.eclipse.jst.common.internal.annotations.controller.AnnotationsController;
-import org.eclipse.jst.common.internal.annotations.controller.AnnotationsControllerManager;
-import org.eclipse.jst.j2ee.internal.common.operations.INewJavaClassDataModelProperties;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.internal.project.WTPJETEmitter;
-import org.eclipse.wst.common.componentcore.internal.operation.ArtifactEditProviderOperation;
-import org.eclipse.wst.common.componentcore.internal.operation.IArtifactEditOperationDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.enablement.nonui.WFTWrappedException;
-import org.eclipse.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
-
-/**
- * The NewEntityClassOperation is IDataModelOperation following the
- * IDataModel wizard and operation framework.
- *
- * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation
- * @see org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider
- *
- * This operation is used to generate java classes for the new JPA entity. It uses
- * EntityDataModelProvider to store the appropriate properties required to generate the new entity.
- * @see org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.modelEntityDataModelProvider
- *
- * A WTPJetEmitter entity template is used to create the class with the entity template.
- * @see org.eclipse.jst.j2ee.internal.project.WTPJETEmitter
- * @see org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.CreateEntityTemplateModel
- *
- * The use of this class is EXPERIMENTAL and is subject to substantial changes.
- */
-// TODO use JpaProjectManager.execute(Command...) and modify the context model
-public class NewEntityClassOperation extends AbstractDataModelOperation {
-
- private static final String DOT_JAVA = ".java"; //$NON-NLS-1$
- private static final String SEPARATOR = "/";//$NON-NLS-1$
- private static final String VERSION_STRING = "1.0";//$NON-NLS-1$
- private static final String FIELD = "FIELD";//$NON-NLS-1$
- private static final String PROPERTY = "PROPERTY";//$NON-NLS-1$
- protected static final String WTP_CUSTOMIZATION_PLUGIN = "WTP_CUSTOMIZATION_PLUGIN"; //$NON-NLS-1$
- protected static final String ANNOTATED_ENTITY_TEMPLATE_FILE = "/templates/annotated_entity.javajet"; //$NON-NLS-1$
- protected static final String ENTITY_TEMPLATE_FILE = "/templates/entity.javajet"; //$NON-NLS-1$
- protected static final String IDCLASS_TEMPLATE_FILE = "/templates/idClass.javajet"; //$NON-NLS-1$
- protected static final String BUILDER_ID = "builderId"; //$NON-NLS-1$
- private static final String EMPTY_STRING = "";//$NON-NLS-1$
- private static final String SINGLE_TABLE = "SINGLE_TABLE";//$NON-NLS-1$
-
- /**
- * Method name of template implementation classes.
- */
- protected static final String GENERATE_METHOD = "generate"; //$NON-NLS-1$
-
- /**
- * This is the constructor which should be used when creating a NewEntityClassOperation.
- * An instance of the CreateEntityTemplateModel should be passed in. This does not accept
- * null parameter. It will not return null.
- *
- * @see ArtifactEditProviderOperation#ArtifactEditProviderOperation(IDataModel)
- * @see CreateEntityTemplateModel
- *
- * @param dataModel
- * @return NewFilterClassOperation
- */
- public NewEntityClassOperation(IDataModel dataModel) {
- super(dataModel);
- }
-
- /**
- * The implementation of the execute method drives the running of the operation.
- * This implementation will create the java source folder, create the java package, and then
- * the entity (or mapped as superclass) and ID class files will be created using templates.
- *
- * @see org.eclipse.wst.common.frameworks.internal.operation.WTPOperation#execute(org.eclipse.core.runtime.IProgressMonitor)
- * @see NewEntityClassOperation#generateUsingTemplates(IProgressMonitor,
- * IPackageFragment)
- *
- * @param monitor
- * @throws CoreException
- * @throws InterruptedException
- * @throws InvocationTargetException
- */
- public IStatus doExecute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- // Create source folder if it does not exist
- createJavaSourceContainer();
- // Create java package if it does not exist
- IPackageFragment pack = createJavaPackage();
- // Generate filter class using templates
- try {
- generateUsingTemplates(monitor, pack);
- } catch (Exception e) {
- return WTPCommonPlugin.createErrorStatus(e.toString());
- }
- return OK_STATUS;
- }
-
- /**
- * This method will return the java package as specified by the new java
- * class data model. If the package does not exist, it will create the
- * package. This method should not return null.
- *
- * @see INewJavaClassDataModelProperties#JAVA_PACKAGE
- * @see IPackageFragmentRoot#createPackageFragment(java.lang.String,
- * boolean, org.eclipse.core.runtime.IProgressMonitor)
- *
- * @return IPackageFragment the java package
- */
- protected final IPackageFragment createJavaPackage() {
- // Retrieve the package name from the java class data model
- String packageName = model.getStringProperty(INewJavaClassDataModelProperties.JAVA_PACKAGE);
- IPackageFragmentRoot packRoot = (IPackageFragmentRoot) model
- .getProperty(INewJavaClassDataModelProperties.JAVA_PACKAGE_FRAGMENT_ROOT);
- IPackageFragment pack = packRoot.getPackageFragment(packageName);
- // Handle default package
- if (pack == null) {
- pack = packRoot.getPackageFragment(""); //$NON-NLS-1$
- }
-
- // Create the package fragment if it does not exist
- if (!pack.exists()) {
- String packName = pack.getElementName();
- try {
- pack = packRoot.createPackageFragment(packName, true, null);
- } catch (JavaModelException e) {
- JptJpaUiPlugin.log(e);
- }
- }
- // Return the package
- return pack;
- }
-
- /**
- * This implementation uses the creation of a CreateEntityTemplateModel and the WTPJETEmitter
- * to create the java class with the annotated tags. This method accepts null for monitor, it does not accept null
- * for fragment. If annotations are not being used the tags will be omitted from the class.
- *
- * @see CreateEntityTemplateModel
- * @see NewEntityClassOperation#generateTemplateSource(CreateEntityTemplateModel,
- * IProgressMonitor)
- *
- * @param monitor
- * @param fragment
- * @throws CoreException
- * @throws WFTWrappedException
- */
- protected void generateUsingTemplates(IProgressMonitor monitor, IPackageFragment fragment) throws WFTWrappedException, CoreException {
- // Create the entity template model
- CreateEntityTemplateModel tempModel = createTemplateModel();
- IProject project = getTargetProject();
- String entityClassSource = null;
- String idClassSource = null;
- // Generate the java source based on the entity template models
- try {
- if (tempModel.isArtifactsAnnotated()) {
- AnnotatedEntityTemplate tempImpl = AnnotatedEntityTemplate.create(null);
- entityClassSource = generateTemplateSource(tempModel, ANNOTATED_ENTITY_TEMPLATE_FILE, tempImpl, monitor);
- } else {
- EntityTemplate tempImpl = EntityTemplate.create(null);
- entityClassSource = generateTemplateSource(tempModel, ENTITY_TEMPLATE_FILE, tempImpl, monitor);
- }
- if (tempModel.isCompositePK()) {
- IdClassTemplate tempImpl = IdClassTemplate.create(null);
- idClassSource = generateTemplateSource(tempModel, IDCLASS_TEMPLATE_FILE, tempImpl, monitor);
- }
- } catch (Exception e) {
- throw new WFTWrappedException(e);
- }
- if (fragment != null) {
- // Create the java file
- String javaFileName = tempModel.getClassName() + DOT_JAVA;
- ICompilationUnit cu = fragment.getCompilationUnit(javaFileName);
- // Add the compilation unit to the java file
- if (cu == null || !cu.exists()) {
- cu = fragment.createCompilationUnit(javaFileName, entityClassSource, true, monitor);
- }
- IFile aFile = (IFile) cu.getResource();
- // Let the annotations controller process the annotated resource
- if (tempModel.isArtifactsAnnotated()) {
- AnnotationsController controller = AnnotationsControllerManager.INSTANCE.getAnnotationsController(project);
- if (controller != null) {
- controller.process(aFile);
- }
- }
- //Create IdClass if the primary key is complex
- if (idClassSource != null) {
- String entityPKName = tempModel.getIdClassName() + DOT_JAVA;
- ICompilationUnit cu1 = fragment.getCompilationUnit(entityPKName);
- // Add the compilation unit to the java file
- if (cu1 == null || !cu1.exists()) {
- cu1 = fragment.createCompilationUnit(entityPKName, idClassSource, true, monitor);
- }
- }
- }
-
- if (tempModel.isArtifactsAnnotated()) {
- if ( ! JptJpaCorePlugin.getDiscoverAnnotatedClasses(project)) {
- registerClassInPersistenceXml(tempModel, project).schedule();
- }
- } else {
- Command command = tempModel.isNonEntitySuperclass() ?
- new AddTypeMappingToXMLCommand(tempModel, project, MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY) :
- new AddEntityToXMLCommand(tempModel, project);
- this.run(new DaliRunnable(project.getWorkspace(), command));
- }
- }
-
- private void run(IWorkspaceRunnable runnable) {
- IWorkspace ws = ResourcesPlugin.getWorkspace();
- try {
- ws.run(
- runnable,
- ws.getRuleFactory().modifyRule(ws.getRoot()),
- IWorkspace.AVOID_UPDATE,
- null // no monitor
- );
- } catch (CoreException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- /**
- * This method is intended for internal use only. This method will create an
- * instance of the CreateEntityTemplateModel model to be used in conjunction
- * with the WTPJETEmitter. This method will not return null.
- *
- * @see CreateEntityTemplateModel
- * @see NewEntityClassOperation#generateUsingTemplates(IProgressMonitor,
- * IPackageFragment)
- *
- * @return CreateFilterTemplateModel
- */
- private CreateEntityTemplateModel createTemplateModel() {
- CreateEntityTemplateModel templateModel = new CreateEntityTemplateModel(model);
- return templateModel;
- }
-
- /**
- * This method is intended for internal use only. This will use the
- * WTPJETEmitter to create an annotated java file based on the passed template model.
- * This method does not accept null parameters. It will not return null.
- * If annotations are not used, it will use the non annotated template to omit the annotated tags.
- *
- * @see NewEntityClassOperation#generateUsingTemplates(IProgressMonitor,
- * IPackageFragment)
- * @see JETEmitter#generate(org.eclipse.core.runtime.IProgressMonitor,
- * java.lang.Object[])
- * @see CreateEntityTemplateModel
- *
- * @param templateModel
- * @param monitor
- * @param template_file
- * @return String the source for the java file
- * @throws JETException
- * @throws NoSuchMethodException
- * @throws SecurityException
- * @throws InvocationTargetException
- * @throws IllegalAccessException
- */
- private String generateTemplateSource(CreateEntityTemplateModel templateModel, String templateFile, Object templateImpl, IProgressMonitor monitor)
- throws JETException, SecurityException, NoSuchMethodException, IllegalAccessException, InvocationTargetException {
- Preferences preferences = J2EEPlugin.getDefault().getPluginPreferences();
- boolean dynamicTranslation = preferences.getBoolean(J2EEPlugin.DYNAMIC_TRANSLATION_OF_JET_TEMPLATES_PREF_KEY);
- if (dynamicTranslation) {
- URL templateURL = FileLocator.find(JptJpaUiPlugin.instance().getBundle(), new Path(templateFile), null);
- cleanUpOldEmitterProject();
- WTPJETEmitter emitter = new WTPJETEmitter(templateURL.toString(), this.getClass().getClassLoader());
- emitter.setIntelligentLinkingEnabled(true);
- emitter.addVariable(WTP_CUSTOMIZATION_PLUGIN, JptJpaUiPlugin.PLUGIN_ID);
- return emitter.generate(monitor, new Object[] { templateModel });
- } else {
- Method method = templateImpl.getClass().getMethod(GENERATE_METHOD, new Class[] { Object.class });
- return (String) method.invoke(templateImpl, templateModel);
- }
- }
-
- /**
- * This method is intended for internal use only. It will clean up the old emmiter project
- * in order to prevent generation issues
- */
- private void cleanUpOldEmitterProject() {
- IProject project = ProjectUtilities.getProject(WTPJETEmitter.PROJECT_NAME);
- if (project == null || !project.exists())
- return;
- try {
- IMarker[] markers = project.findMarkers(IJavaModelMarker.BUILDPATH_PROBLEM_MARKER, false, IResource.DEPTH_ZERO);
- for (int i = 0, l = markers.length; i < l; i++) {
- if (((Integer) markers[i].getAttribute(IMarker.SEVERITY)).intValue() == IMarker.SEVERITY_ERROR) {
- project.delete(true, new NullProgressMonitor());
- break;
- }
- }
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * This method will return the java source container as specified in the java
- * class data model. It will create the java source folder if it does not
- * exist. This method may return null.
- *
- * @see INewJavaClassDataModelProperties#SOURCE_FOLDER
- * @see IFolder#create(boolean, boolean,
- * org.eclipse.core.runtime.IProgressMonitor)
- *
- * @return IFolder the java source folder
- */
- protected final IContainer createJavaSourceContainer() {
- // Get the source folder name from the data model
- String containerFullPath = model.getStringProperty(INewJavaClassDataModelProperties.SOURCE_FOLDER);
- IContainer container = PlatformTools.getContainer(new Path(containerFullPath));
- // If container does not exist, create the folder with the specified path
- if (! container.exists()) {
- try {
- ((IFolder) container).create(true, true, null);
- } catch (CoreException e) {
- JptJpaUiPlugin.log(e);
- }
- }
- // Return the source folder
- return container;
- }
-
- @Override
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return doExecute(monitor, info);
- }
-
- public IProject getTargetProject() {
- String projectName = model.getStringProperty(IArtifactEditOperationDataModelProperties.PROJECT_NAME);
- return ProjectUtilities.getProject(projectName);
- }
-
-
- protected static class DaliRunnable
- implements IWorkspaceRunnable
- {
- protected final IWorkspace workspace;
- protected final Command command;
-
- DaliRunnable(IWorkspace workspace, Command command) {
- super();
- this.workspace = workspace;
- this.command = command;
- }
-
- public void run(IProgressMonitor monitor) throws CoreException {
- try {
- this.run();
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt();
- }
- }
-
- protected void run() throws InterruptedException {
- this.getJpaProjectManager().execute(this.command, SynchronousUiCommandExecutor.instance());
- }
-
- protected JpaProjectManager getJpaProjectManager() {
- return (JpaProjectManager) this.workspace.getAdapter(JpaProjectManager.class);
- }
-
- }
-
-
- protected static class AddTypeMappingToXMLCommand
- implements Command
- {
- protected final CreateEntityTemplateModel model;
- protected final IProject project;
- protected final String typeMappingKey;
-
- protected AddTypeMappingToXMLCommand(CreateEntityTemplateModel model, IProject project, String typeMappingKey) {
- super();
- this.model = model;
- this.project = project;
- this.typeMappingKey = typeMappingKey;
- }
-
- public void execute() {
- JpaXmlResource xmlResource = this.getOrmXmlResource();
- EntityMappings entityMappings = (EntityMappings) this.getJpaProject().getJpaFile(xmlResource.getFile()).getRootStructureNodes().iterator().next();
- OrmPersistentType persistentType = entityMappings.addPersistentType(this.typeMappingKey, this.model.getQualifiedJavaClassName());
-
- this.updatePersistentType(persistentType);
-
- try {
- xmlResource.saveIfNecessary();
- } catch (Exception e) {
- JptJpaUiPlugin.log(e);
- }
- }
-
- protected void updatePersistentType(OrmPersistentType persistentType) {
- this.updateTypeMapping(persistentType.getMapping());
-
- for (String fieldName : this.model.getPKFields()) {
- persistentType.getAttributeNamed(fieldName).addToXml(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- }
-
- persistentType.setSpecifiedAccess(this.getModelAccessType());
- }
-
- protected void updateTypeMapping(OrmTypeMapping typeMapping) {
- if (this.model.isCompositePK()) {
- ((OrmIdTypeMapping) typeMapping).getIdClassReference().setSpecifiedIdClassName(this.model.getOrmIdClassName());
- }
- }
-
- protected JpaXmlResource getOrmXmlResource() {
- return this.model.isMappingXMLDefault() ?
- this.getJpaProject().getDefaultOrmXmlResource() :
- this.getJpaProject().getMappingFileXmlResource(new Path(this.model.getMappingXMLName()));
- }
-
- protected AccessType getModelAccessType() {
- String accessTypeString = FIELD;
- if ( ! this.model.isFieldAccess()) {
- accessTypeString = PROPERTY;
- }
- return AccessType.fromOrmResourceModel(accessTypeString, getJpaProject().getJpaPlatform(), JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE);// TODO
- }
-
- protected JpaProject getJpaProject() {
- return (JpaProject) this.project.getAdapter(JpaProject.class);
- }
- }
-
-
- protected static class AddEntityToXMLCommand
- extends AddTypeMappingToXMLCommand
- {
- protected AddEntityToXMLCommand(CreateEntityTemplateModel model, IProject project) {
- super(model, project, MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- }
-
- @Override
- protected void updateTypeMapping(OrmTypeMapping typeMapping) {
- super.updateTypeMapping(typeMapping);
- Entity entity = (Entity) typeMapping;
- if (this.model.isInheritanceSet()) {
- entity.setSpecifiedInheritanceStrategy(this.getModelInheritanceType());
- }
- if (this.model.isEntityNameSet()) {
- entity.setSpecifiedName(this.model.getEntityName());
- }
- if (this.model.isTableNameSet()) {
- entity.getTable().setSpecifiedName(this.model.getTableName());
- }
- }
-
- protected InheritanceType getModelInheritanceType() {
- String strategy = this.model.getInheritanceStrategyName();
- if (strategy.equals(EMPTY_STRING)) {
- strategy = SINGLE_TABLE;
- }
- return InheritanceType.fromOrmResourceModel(OrmFactory.eINSTANCE.createInheritanceTypeFromString(null, strategy));//TODO
- }
- }
-
-
- /**
- * Regist the class in the persistence.xml
- *
- * @param model entity data model
- * @param project JPA project in which the entity will be created
- * @return the created job
- */
- private Job registerClassInPersistenceXml(final CreateEntityTemplateModel model, final IProject project) {
- Job job = new Job(EntityWizardMsg.APPLY_CHANGES_TO_PERSISTENCE_XML) {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- JpaProject jpaProject = (JpaProject) project.getAdapter(JpaProject.class);
- JpaXmlResource resource = jpaProject.getPersistenceXmlResource();
- XmlPersistence xmlPersistence = (XmlPersistence) resource.getRootObject();
- EList<XmlPersistenceUnit> persistenceUnits = xmlPersistence.getPersistenceUnits();
- XmlPersistenceUnit persistenceUnit = persistenceUnits.get(0);// Multiply persistence unit support
-
- if (!model.isNonEntitySuperclass()) {
- XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- classRef.setJavaClass(model.getQualifiedJavaClassName());
- persistenceUnit.getClasses().add(classRef);
- }
- resource.save();
-
- return Status.OK_STATUS;
- }
- };
- return job;
- }
-
- /**
- * @param input the name of mapping XML from the class wizard page. It is relative path from the source folder
- * and includes META-INF folder
- * @return the simple name of the mapping XML
- */
- private String getLastSegment(String input) {
- String output = input;
- if (input.indexOf(SEPARATOR) != -1) {
- output = input.substring(input.lastIndexOf(SEPARATOR) + 1);
- }
- return output;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationFigure.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationFigure.java
deleted file mode 100644
index ccc474a7a6..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationFigure.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import org.eclipse.draw2d.Button;
-import org.eclipse.draw2d.ChopboxAnchor;
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.ConnectionEndpointLocator;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.PolygonDecoration;
-import org.eclipse.draw2d.PolylineConnection;
-import org.eclipse.draw2d.XYLayout;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jpt.jpa.gen.internal.Association;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-
-
-class AssociationFigure extends Button {
-
- Color enabledColor = new Color( null, 14,66,115);
- Color disabledLineColor = new Color( null, 192,215,231);
- Color selectedColor = new Color( null, 232,232,232 );
-
- Color selectedBorderColor = new Color( null, 14,66,115 );
- LineBorder selectedBorder = new LineBorder( selectedBorderColor, 2 );
- LineBorder unselectedBorder = new LineBorder( ColorConstants.lightGray, 1 );
- Font descriptionFont = new Font(null, "Arial", 8, SWT.NONE);
-
- /**
- * The model behind the the view object
- */
- Association association;
- TableFigure tableFig1;
- TableFigure tableFig2;
- PolylineConnection connection ;
-
- PolygonDecoration referrerDecoration ;
- PolygonDecoration referencedDecoration ;
-
- Label referencedLabel ;
- Label referrerLabel ;
- Label descriptionLabel ;
-
- AssociationFigure(Association association, ResourceManager resourceManager) {
- this.association = association;
-
- XYLayout contentsLayout = new XYLayout();
- setLayoutManager(contentsLayout);
- setBorder( unselectedBorder );
-
- //Create the figures for referrer table and referenced table
- tableFig1 = new TableFigure( association.getReferrerTable().getName(), resourceManager);
- tableFig2 = new TableFigure( association.getReferencedTable().getName(), resourceManager);
-
- contentsLayout.setConstraint(tableFig1, new Rectangle(10,10,150,20));
- contentsLayout.setConstraint(tableFig2, new Rectangle(280, 10, 150, 20));
-
- connection = drawConnection(tableFig1, tableFig2);
-
- add(tableFig1);
- add(tableFig2);
- add(connection);
-
-
- descriptionLabel = new Label("");
- contentsLayout.setConstraint(descriptionLabel, new Rectangle(10,30,-1,-1));
- descriptionLabel.setFont( descriptionFont );
- add(descriptionLabel);
-
- //set white background
- this.setBackgroundColor(ColorConstants.white);
-
- update();
-
- }
-
- private PolylineConnection drawConnection(TableFigure tableFig1,
- TableFigure tableFig2) {
- /* Creating the connection */
- PolylineConnection connection = new PolylineConnection();
- ChopboxAnchor sourceAnchor = new ChopboxAnchor(tableFig1);
- ChopboxAnchor targetAnchor = new ChopboxAnchor(tableFig2);
- connection.setSourceAnchor(sourceAnchor);
- connection.setTargetAnchor(targetAnchor);
-
- /* Creating the decoration */
- referrerDecoration = new SmoothPolygonDecoration();
- connection.setSourceDecoration(referrerDecoration);
-
- referencedDecoration = new SmoothPolygonDecoration();
- connection.setTargetDecoration(referencedDecoration);
-
-
- /* Adding labels to the connection */
- ConnectionEndpointLocator sourceEndpointLocator =
- new ConnectionEndpointLocator(connection, false);
- sourceEndpointLocator.setVDistance(-5);
- referrerLabel = new Label("");
- connection.add(referrerLabel, sourceEndpointLocator);
-
- ConnectionEndpointLocator targetEndpointLocator =
- new ConnectionEndpointLocator(connection, true);
- targetEndpointLocator.setVDistance(-5);
- referencedLabel = new Label("");
- connection.add(referencedLabel, targetEndpointLocator);
-
- ConnectionEndpointLocator relationshipLocator =
- new ConnectionEndpointLocator(connection,true);
- relationshipLocator.setUDistance(10);
- relationshipLocator.setVDistance(-20);
- Label relationshipLabel = new Label("contains");
- connection.add(relationshipLabel,relationshipLocator);
- return connection;
- }
-
- public Association getAssociation() {
- return this.association;
- }
-
- @Override
- public void setSelected ( boolean isSelected ){
- this.setBackgroundColor( isSelected ? selectedColor : ColorConstants.white );
- this.setBorder(isSelected? selectedBorder : unselectedBorder);
- }
-
- /**
- * Update the view with the changes user made on the model
- */
- public void update(){
- boolean isGenerated = association.isGenerated();
-
- connection.setForegroundColor( isGenerated? enabledColor: disabledLineColor );
-
- tableFig1.setEnabled(isGenerated);
- tableFig2.setEnabled(isGenerated);
- descriptionLabel.setForegroundColor(isGenerated? enabledColor: disabledLineColor);
-
- //paintDirectionalityAndCardinality
- String cardinalityStr;
- String directionality = association.getDirectionality();
- String cardinality = association.getCardinality();
- //Draw referrerRole
- if (cardinality.equals(Association.MANY_TO_ONE) || cardinality.equals(Association.MANY_TO_MANY)) {
- cardinalityStr = "*";
- } else {
- cardinalityStr = "1";
- }
- if (directionality.equals(Association.BI_DI) || directionality.equals(Association.OPPOSITE_DI)) {
- connection.setSourceDecoration(this.referrerDecoration);
- }else{
- connection.setSourceDecoration(null);
- }
-
- this.referrerLabel.setText( cardinalityStr );
-
- //Draw referencedRole
- if (cardinality.equals(Association.MANY_TO_ONE) || cardinality.equals(Association.ONE_TO_ONE)) {
- cardinalityStr = "1";
- } else {
- cardinalityStr = "*";
- }
- if (directionality.equals(Association.BI_DI) || directionality.equals(Association.NORMAL_DI)) {
- connection.setTargetDecoration(this.referencedDecoration);
- }else{
- connection.setTargetDecoration(null);
- }
- this.referencedLabel.setText(cardinalityStr);
-
- String text = "";
- String referrerTableName = association.getReferrerTableName();
- String referencedTable = association.getReferencedTableName();
- if( cardinality.equals(Association.MANY_TO_ONE ) ){
- text = String.format( JptUiEntityGenMessages.manyToOneDesc, referencedTable , referrerTableName );
- }else if( cardinality.equals(Association.ONE_TO_ONE ) ){
- text = String.format( JptUiEntityGenMessages.oneToOneDesc, referrerTableName, referencedTable );
- }else if( cardinality.equals(Association.MANY_TO_MANY) ){
- text = String.format( JptUiEntityGenMessages.manyToManyDesc, referrerTableName, referencedTable, referencedTable, referrerTableName );
- }
-
- if( association.isCustom() ){
- connection.setLineStyle( SWT.LINE_DOT);
- }
-
- this.descriptionLabel.setText(text);
-
- }
-
- public void dispose() {
- this.descriptionFont.dispose();
- this.selectedBorderColor.dispose();
- this.selectedColor.dispose();
- this.disabledLineColor.dispose();
- this.enabledColor.dispose();
- this.tableFig1.dispose();
- this.tableFig2.dispose();
- }
-
- public class SmoothPolygonDecoration extends PolygonDecoration
- {
- public SmoothPolygonDecoration()
- {
- super();
- }
-
- @Override
- public void paintFigure(Graphics graphics)
- {
- int savedAntialias = graphics.getAntialias();
- graphics.setAntialias(SWT.ON);
- super.paintFigure(graphics);
- graphics.setAntialias(savedAntialias);
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationTablesPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationTablesPage.java
deleted file mode 100644
index c7c9e54238..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationTablesPage.java
+++ /dev/null
@@ -1,208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import static org.eclipse.jpt.jpa.ui.internal.wizards.gen.SWTUtil.createButton;
-import static org.eclipse.jpt.jpa.ui.internal.wizards.gen.SWTUtil.createLabel;
-import static org.eclipse.jpt.jpa.ui.internal.wizards.gen.SWTUtil.createText;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jpt.jpa.gen.internal.Association;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.jpt.jpa.ui.internal.ImageRepository;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-
-
-
-public class AssociationTablesPage extends NewAssociationWizardPage {
-
- private Button simpleAssoBtn;
- private Button mtmAssoBtn;
- private Text table1TextField ;
- private Text table2TextField ;
- private Text joinTableTextField;
- private Button joinTableBrowse;
-
- protected final ResourceManager resourceManager;
-
- public AssociationTablesPage(ORMGenCustomizer customizer, ResourceManager resourceManager) {
- super(customizer, "AssociationTablesPage");
- this.resourceManager = resourceManager;
- setTitle( JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_tablesPage_title);
- setDescription(JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_tablesPage_desc);
- }
-
- public void createControl(Composite composite) {
- initializeDialogUnits(composite);
- Composite parent = new Composite(composite, SWT.NONE);
- parent.setLayout(new GridLayout(1, true));
-
- Group assocKindGroup = new Group(parent, SWT.NULL);
- int nColumns= 3 ;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- assocKindGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- assocKindGroup.setLayout(layout);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.GENERATE_ENTITIES_WIZARD_ASSOCIATION_TABLES);
- assocKindGroup.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_tablesPage_assocKind);
-
- simpleAssoBtn = createButton(assocKindGroup, 3, JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_tablesPage_simpleAssoc, SWT.RADIO);
- mtmAssoBtn = createButton(assocKindGroup, 3, JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_tablesPage_m2mAssoc, SWT.RADIO);
-
-
- Group assocTablesGroup = new Group(parent, SWT.NULL);
- nColumns= 3 ;
- layout = new GridLayout();
- layout.numColumns = nColumns;
- assocTablesGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
- assocTablesGroup.setLayout(layout);
-
-
- assocTablesGroup.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_tablesPage_assocTables );
-
- createLabel(assocTablesGroup, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_tablesPage_table1);
- table1TextField = createText(assocTablesGroup, 1);
- table1TextField.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updatePageComplete();
- }
- });
-
- Button browser1 = createButton(assocTablesGroup, 1, "", SWT.NONE);
- browser1.setImage( ImageRepository.getBrowseButtonImage(this.resourceManager));
-
- browser1.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- SelectTableDialog dlg = new SelectTableDialog(Display.getDefault().getActiveShell(), resourceManager, customizer.getTableNames());
- if( dlg.open() ==Dialog.OK ){
- table1TextField.setText( dlg.getSelectedTable() );
- getWizardDataModel().put( NewAssociationWizard.ASSOCIATION_REFERRER_TABLE, table1TextField.getText());
- getWizard().getContainer().updateButtons();
- ((NewAssociationWizard)getWizard()).updateTableNames();
- }
- updatePageComplete();
- }
- });
-
- createLabel(assocTablesGroup, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_tablesPage_table2);
- table2TextField = createText(assocTablesGroup, 1);
- table2TextField.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- updatePageComplete();
- }
- });
-
- Button browser2 = createButton(assocTablesGroup, 1, "", SWT.NONE);
- browser2.setImage( ImageRepository.getBrowseButtonImage(this.resourceManager));
-
- browser2.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- SelectTableDialog dlg = new SelectTableDialog( Display.getDefault().getActiveShell(), resourceManager, customizer.getTableNames());
- if( dlg.open() == Dialog.OK){
- table2TextField.setText( dlg.getSelectedTable() );
- getWizardDataModel().put( NewAssociationWizard.ASSOCIATION_REFERENCED_TABLE, table2TextField.getText());
- ((NewAssociationWizard)getWizard()).updateTableNames();
- }
- updatePageComplete();
- }
- });
-
- createLabel(assocTablesGroup, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_tablesPage_intermediateTable );
- joinTableTextField = createText(assocTablesGroup, 1);
- joinTableTextField.setEnabled(false);
-
- joinTableBrowse = createButton(assocTablesGroup, 1, "", SWT.NONE);
- joinTableBrowse.setImage( ImageRepository.getBrowseButtonImage(this.resourceManager));
- joinTableBrowse.setEnabled(false);
-
- joinTableBrowse.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- SelectTableDialog dlg = new SelectTableDialog( Display.getDefault().getActiveShell(), resourceManager, customizer.getSchema() );
- if( dlg.open() == Dialog.OK){
- joinTableTextField.setText( dlg.getSelectedTable() );
- getWizardDataModel().put( NewAssociationWizard.ASSOCIATION_JOIN_TABLE, joinTableTextField.getText() );
- ((NewAssociationWizard)getWizard()).updateTableNames();
- getWizard().getContainer().updateButtons();
- }
- updatePageComplete();
- }
- });
-
- setControl(parent);
-
- simpleAssoBtn.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- joinTableTextField.setEnabled(false);
- joinTableTextField.clearSelection();
- joinTableTextField.setText("");
- joinTableBrowse.setEnabled(false);
- getWizardDataModel().put( NewAssociationWizard.ASSOCIATION_CADINALITY, Association.MANY_TO_ONE);
- getWizardDataModel().remove( NewAssociationWizard.ASSOCIATION_JOIN_TABLE );
- ((NewAssociationWizard)getWizard()).updateTableNames();
- updatePageComplete();
- }
-
- });
-
- mtmAssoBtn.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- joinTableTextField.setEnabled(true);
- joinTableBrowse.setEnabled(true);
- getWizardDataModel().put( NewAssociationWizard.ASSOCIATION_CADINALITY, Association.MANY_TO_MANY);
- ((NewAssociationWizard)getWizard()).updateTableNames();
- updatePageComplete();
- }
- });
-
- this.setPageComplete( false);
- table1TextField.setFocus();
- }
-
- @Override
- public boolean canFlipToNextPage() {
- return isPageComplete();
- }
-
- public void updatePageComplete() {
- if( this.table1TextField.getText().length() <= 0 ||
- this.table2TextField.getText().length() <= 0) {
- setPageComplete(false);
- return;
- }
- if( mtmAssoBtn.getSelection() ){
- if( this.joinTableTextField.getText().length() <= 0 ){
- setPageComplete(false);
- return;
- }
- }
- setPageComplete(true);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationsListComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationsListComposite.java
deleted file mode 100644
index 65e1978e48..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/AssociationsListComposite.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.List;
-
-import org.eclipse.draw2d.ActionEvent;
-import org.eclipse.draw2d.ActionListener;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.FigureCanvas;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.ToolbarLayout;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jpt.jpa.gen.internal.Association;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-
-/**
- * A Draw2d figure representing list of associations between two database tables
- *
- */
-public class AssociationsListComposite extends FigureCanvas {
-
- List<Association> associations;
- AssociationToggleSelectionListener listener ;
- TableAssociationsWizardPage tableAssociationsWizardPage; //the parent wizard page
- AssociationFigure selectedAssociationFigure ;
-
- protected final ResourceManager resourceManager;
-
- public AssociationsListComposite(Composite parent, TableAssociationsWizardPage tableAssociationsWizardPage, ResourceManager resourceManager){
- super(parent);
- this.tableAssociationsWizardPage = tableAssociationsWizardPage;
- this.resourceManager = resourceManager;
-
- setBounds(10, 10 , 500, 200);
- Color backgroundColor = new Color(Display.getDefault(), 255,255,255);
- setBackground(backgroundColor);
- backgroundColor.dispose();
-
- Figure figure = new Figure();
- figure.setLayoutManager(new ToolbarLayout());
- figure.setBorder(new LineBorder(1));
- this.listener = new AssociationToggleSelectionListener();
-
- this.setContents(figure);
- }
-
- public void updateAssociations(List<Association> associations){
- Figure figure = (Figure)this.getContents();
- this.disposeFigure(figure);
-
- this.associations = associations;
- if( associations != null ){
- for( int i = 0; i <associations.size(); i ++ ){
- Association association = associations.get(i);
- AssociationFigure assocFigure = new AssociationFigure(association, this.resourceManager);
- assocFigure.addActionListener( listener );
- figure.add(assocFigure);
- }
- }
- }
-
- public Association getSelectedAssociation(){
- return this.selectedAssociationFigure.getAssociation();
- }
-
- @SuppressWarnings("unchecked")
- public void updateSelectedAssociation(){
- Figure figure = (Figure)this.getContents();
- List<AssociationFigure> associationFigures = figure.getChildren();
- for(AssociationFigure assocFig : associationFigures){
- if( assocFig == this.selectedAssociationFigure){
- assocFig.update();
- }
- }
- }
-
- /**
- * Get the association just before the selected one in UI
- * @return
- */
- @SuppressWarnings("unchecked")
- public Association getPreviousAssociation(){
- Figure figure = (Figure)this.getContents();
- List<AssociationFigure> associationFigures = figure.getChildren();
- AssociationFigure ret = null;
- for(AssociationFigure assocFig : associationFigures){
- if( assocFig.isSelected() ){
- break;
- }
- ret = assocFig;
- }
- return ret==null?null:ret.getAssociation();
- }
-
- @Override
- public void dispose() {
- this.disposeFigure((Figure) getContents());
- super.dispose();
- }
-
- @SuppressWarnings("unchecked")
- protected void disposeFigure(Figure figure) {
- for (AssociationFigure associationFigure : (List<AssociationFigure>) figure.getChildren()) {
- associationFigure.removeActionListener(this.listener);
- associationFigure.dispose();
- }
- figure.removeAll();
- this.selectedAssociationFigure = null;
- }
-
- class AssociationToggleSelectionListener implements ActionListener {
- public void actionPerformed(ActionEvent event) {
- AssociationFigure figure = (AssociationFigure )event.getSource() ;
- figure.setSelected(true);
- Association association = figure.getAssociation();
- tableAssociationsWizardPage.updateAssociationEditPanel(association);
- //un-select the previous selected
- if( selectedAssociationFigure != null && selectedAssociationFigure!= figure ){
- selectedAssociationFigure.setSelected( false );
- }
- //Highlight new selection
- selectedAssociationFigure = figure;
- selectedAssociationFigure.setSelected( true );
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/CardinalityPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/CardinalityPage.java
deleted file mode 100644
index fca73e4df8..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/CardinalityPage.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import org.eclipse.jpt.jpa.gen.internal.Association;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-
-public class CardinalityPage extends NewAssociationWizardPage {
-
- private Label mtoDescLabel;
- private Label otmDescLabel;
- private Label otoDescLabel;
- private Label mtmDescLabel;
-
- private Button[] cardinalityButtons = new Button[4];
-
- protected CardinalityPage(ORMGenCustomizer customizer) {
- super( customizer , "CardinalityPage" );
- setTitle(JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_cardinalityPage_title);
- setDescription( JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_cardinalityPage_desc);
- }
-
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NULL);
- int nColumns= 1 ;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- composite.setLayout(layout);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.GENERATE_ENTITIES_WIZARD_ASSOCIATION_CARDINALITY);
-
- CardinalitySelectionListener selectionListener = new CardinalitySelectionListener();
- cardinalityButtons[0] = createRadioButton( composite, 1, JptUiEntityGenMessages.manyToOne);
- cardinalityButtons[0].addSelectionListener( selectionListener );
- //Default cardinality is MTO
- cardinalityButtons[0].setSelection(true);
- getWizardDataModel().put(NewAssociationWizard.ASSOCIATION_CADINALITY, Association.MANY_TO_ONE);
-
- mtoDescLabel = createLabel(composite,1, JptUiEntityGenMessages.manyToOneDesc);
-
- cardinalityButtons[1] = createRadioButton( composite, 1, JptUiEntityGenMessages.oneToMany);
- cardinalityButtons[1].addSelectionListener( selectionListener );
-
- otmDescLabel = createLabel(composite,1, JptUiEntityGenMessages.manyToOneDesc);
-
- cardinalityButtons[2] = createRadioButton( composite, 1, JptUiEntityGenMessages.oneToOne);
- cardinalityButtons[2].addSelectionListener( selectionListener );
-
- otoDescLabel = createLabel(composite,1, JptUiEntityGenMessages.oneToOneDesc);
-
- cardinalityButtons[3] = createRadioButton( composite, 1, JptUiEntityGenMessages.manyToMany);
- mtmDescLabel= createLabel(composite,1, JptUiEntityGenMessages.manyToManyDesc);
-
- setControl(composite);
- this.setPageComplete( true );
-
- cardinalityButtons[0].setFocus();
-
- }
-
- public void updateWithNewTables() {
- String s1 = getReferrerTableName() ;
- String s2 = getReferencedTableName() ;
- String joinTableName = getJoinTableName();
- if( s1 == null || s2 == null )
- return ;
-
- updateDescriptionText(s1, s2);
- if( joinTableName == null ){
- cardinalityButtons[0].setEnabled(true);
- cardinalityButtons[1].setEnabled(true);
- cardinalityButtons[2].setEnabled(true);
- cardinalityButtons[3].setEnabled(false);
- mtmDescLabel.setEnabled(false);
- }else{
- cardinalityButtons[0].setEnabled(false);
- cardinalityButtons[1].setEnabled(false);
- cardinalityButtons[2].setEnabled(false);
- cardinalityButtons[3].setEnabled(true);
- cardinalityButtons[3].setSelection(true);
- mtmDescLabel.setEnabled(true);
- }
- ((Composite)this.getControl()).layout() ;
- }
-
- private void updateDescriptionText(String s1, String s2) {
- //MTO
- String msg = String.format(JptUiEntityGenMessages.manyToOneDesc, s2, s1);
- mtoDescLabel.setText( msg );
- //OTM
- msg = String.format(JptUiEntityGenMessages.manyToOneDesc, s1, s2);
- otmDescLabel.setText( msg );
- msg = String.format(JptUiEntityGenMessages.oneToOneDesc, s1, s2);
- otoDescLabel.setText( msg );
- msg = String.format(JptUiEntityGenMessages.manyToManyDesc, s1, s2, s2, s1);
- mtmDescLabel.setText( msg );
- }
-
- public boolean canFlipToNextPage() {
- return false;
- }
-
- private Label createLabel(Composite container, int span, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- gd.horizontalIndent = 30;
- label.setLayoutData(gd);
- return label;
- }
-
-
- private Button createRadioButton(Composite container, int span, String text ) {
- Button btn = new Button(container, SWT.RADIO );
- btn.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- btn.setLayoutData(gd);
- return btn;
- }
-
-
- private class CardinalitySelectionListener implements SelectionListener {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- if( e.getSource() == cardinalityButtons[0]){
- getWizardDataModel().put(NewAssociationWizard.ASSOCIATION_CADINALITY, Association.MANY_TO_ONE);
- }else if( e.getSource() == cardinalityButtons[1]){
- getWizardDataModel().put(NewAssociationWizard.ASSOCIATION_CADINALITY, Association.ONE_TO_MANY );
- }else if( e.getSource() == cardinalityButtons[2]){
- getWizardDataModel().put(NewAssociationWizard.ASSOCIATION_CADINALITY, Association.ONE_TO_ONE);
- }else{
- getWizardDataModel().put(NewAssociationWizard.ASSOCIATION_CADINALITY, Association.MANY_TO_MANY);
- }
- CardinalityPage.this.setPageComplete(true);
-
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/CascadeDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/CascadeDialog.java
deleted file mode 100644
index 5cc417fcde..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/CascadeDialog.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.TrayDialog;
-import org.eclipse.jpt.jpa.gen.internal.AssociationRole;
-import org.eclipse.jpt.jpa.gen.internal.util.StringUtil;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-/**
- * Simple dialog allows user to set the cascade property of an associationRole.
- * The value of cascade can be "all", or any combination of other selections.
- *
- */
-public class CascadeDialog extends TrayDialog {
-
- private static String[] ALL_CASCADES = new String[] {TagNames.ALL_CASCADE, TagNames.PERSIST_CASCADE, TagNames.MERGE_CASCADE
- , TagNames.REMOVE_CASCADE, TagNames.REFRESH_CASCADE};
-
- private static String[] ALL_CASCADES_LABELS
- = new String[] { "&all", //$NON-NLS-1$
- "&persist", //$NON-NLS-1$
- "&merge", //$NON-NLS-1$
- "&remove", //$NON-NLS-1$
- "&refresh"}; //$NON-NLS-1$
-
-
- private Button[] allButtons = new Button[ALL_CASCADES.length];
-
- private AssociationRole associationRole;
- private List<String> cascades;
-
- protected CascadeDialog(Shell parentShell) {
- super(parentShell);
- }
-
- public static CascadeDialog create(AssociationRole role) {
- CascadeDialog dlg = new CascadeDialog(Display.getDefault().getActiveShell() );
- dlg.setAssociationRole(role);
- return dlg;
- }
-
- /*
- * (non-Javadoc) Method declared on Window.
- */
- protected void configureShell(Shell newShell) {
- super.configureShell(newShell);
- newShell.setText(JptUiEntityGenMessages.selectCascadeDlgTitle);
- this.getHelpSystem().setHelp(newShell, JpaHelpContextIds.GENERATE_ENTITIES_WIZARD_SELECT_CASCADE);
- }
-
- private void setAssociationRole(AssociationRole role) {
- this.associationRole = role;
- List<String> list = StringUtil.strToList(associationRole.getCascade(), ',', true/*trim*/); //role.getCascade() contains the comma separed cascades (see below)
- if (list == null) {
- list = Collections.emptyList();
- }
- cascades = list;
-
- }
-
- protected void createButtonsForButtonBar(Composite parent) {
- createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true);
- createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- protected Control createDialogArea(Composite parent) {
- Composite container = (Composite) super.createDialogArea(parent);
- createCascadeTypesGroup(container);
- Dialog.applyDialogFont(container);
- return container;
- }
-
- private void createCascadeTypesGroup(Composite parent) {
- Group group = new Group(parent, SWT.NONE);
- group.setLayout(new GridLayout());
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.widthHint = 275;
- group.setLayoutData(gd);
- group.setText(JptUiEntityGenMessages.cascade);
-
- for( int i=0; i< ALL_CASCADES.length; i ++ ){
- Button checkbox = new Button(group, SWT.CHECK);
- checkbox.setText( ALL_CASCADES_LABELS[i] );
- checkbox.setSelection( isInList(ALL_CASCADES[i]) ); //$NON-NLS-1$
- checkbox.setData(ALL_CASCADES[i]);
- allButtons[i] = checkbox;
- /*if <code>all</code> is selected then deselect all others*/
- checkbox.addSelectionListener( new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- Button b = (Button)e.getSource();
- if( b.getSelection() ){
- if( b == allButtons[0] ){
- for( Button btn : allButtons ){
- if( btn != e.getSource() ) btn.setSelection(false);
- }
- }else{
- allButtons[0].setSelection(false);
- }
- }
- }
- });
- }
- }
-
- protected void okPressed() {
- StringBuilder builder = new StringBuilder();
- for( Button b : allButtons ){
- if( b.getSelection() ){
- if( builder.length()>0 ){
- builder.append( ',');
- }
- builder.append( b.getData() );
- }
- }
- this.associationRole.setCascade( builder.toString() );
- super.okPressed();
- }
-
- private boolean isInList(String cascade) {
- for( String s : cascades ){
- if( s.equals(cascade )){
- return true;
- }
- }
- return false;
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
-}
-
-class TagNames
-{
- public static final String BASIC_TAG = "basic";
- public static final String CASCADE_TAG = "cascade";
- public static final String COLUMN_TAG = "column";
- public static final String EMBEDDED_TAG = "embedded";
- public static final String EMBEDDED_ID_TAG = "embedded-id";
- public static final String GENERATED_VALUE_TAG = "generated-value";
- public static final String ID_TAG = "id";
- public static final String ID_CLASS_TAG = "id";
- public static final String JOIN_COLUMN_TAG = "join-column";
- public static final String INVERSE_JOIN_COLUMN_TAG = "inverse-join-column";
- public static final String LOB_TAG = "lob";
- public static final String MANY_TO_MANY_TAG = "many-to-many";
- public static final String MANY_TO_ONE_TAG = "many-to-one";
- public static final String MAPPED_BY_TAG = "mapped-by";
- public static final String ONE_TO_MANY_TAG = "one-to-many";
- public static final String ONE_TO_ONE_TAG = "one-to-one";
- public static final String PK_JOIN_COLUMN_TAG = "primary-key-join-column";
- public static final String TABLE_TAG = "table";
- public static final String VERSION_TAG = "version";
- public static final String JOIN_TABLE_TAG = "join-table";
-
- /*cascade tags*/
- public static final String ALL_CASCADE = "all";
- public static final String PERSIST_CASCADE = "persist";
- public static final String MERGE_CASCADE = "merge";
- public static final String REMOVE_CASCADE = "remove";
- public static final String REFRESH_CASCADE = "refresh";
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/ColumnGenPanel.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/ColumnGenPanel.java
deleted file mode 100644
index 1dd842dc32..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/ColumnGenPanel.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenColumn;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * The panel used in the <code>TablesAndColumnsPage</code> wizard page
- * to edit the column generation properties.
- * An instance of this class is created by the <code>ORMGenWizard</code>
- * implementation.
-
- */
-public class ColumnGenPanel
-{
- TablesAndColumnsCustomizationWizardPage wizardPage ;
- Composite parent; //parent control with grid layout
- int columns; //total columns in the parent composite
-
- ORMGenCustomizer customizer;
-
- private ORMGenColumn mColumn;
- private boolean mPanelInited;
- private boolean mIsUpdatingControls;
-
- private Group columnMappingGroup;
- private Button mGeneratedCheckbox;
- private Text mPropNameField;
- private Combo mMappingKindCombo;
- private Combo mPropTypeCombo;
- private Button mUpdateableCheckBox;
- private Button mInsertableCheckBox;
-
- private Group domainClassGroup ;
- private ScopePanel mPropGetScopePanel;
- private ScopePanel mPropSetScopePanel;
-
- private boolean isDynamic;
-
- public ColumnGenPanel(Composite parent, int columns, ORMGenCustomizer customizer, TablesAndColumnsCustomizationWizardPage wizardPage, boolean isDynamic) {
- this.wizardPage = wizardPage;
- this.customizer = customizer;
- this.parent =parent;
- this.columns = columns;
- this.isDynamic = isDynamic;
-
- initPanel();
- }
- /**
- * Changes the table edited by the panel.
- * This is supposed to update the panel editing controls
- * using the column values.
- */
- public void setColumn(ORMGenColumn column) {
- mColumn = column;
-
- /*lazy init panel because it uses mColumn*/
- if (!mPanelInited) {
- initPanel();
- mPanelInited = true;
- }
-
- updateControls();
- }
- private void updateControls() {
- if (mIsUpdatingControls) {
- return;
- }
-
- mIsUpdatingControls = true;
- boolean isGenerated = mColumn.isGenerated();
- mGeneratedCheckbox.setSelection( isGenerated);
- mGeneratedCheckbox.setEnabled(true);
- enableControls(isGenerated);
- try {
- mPropNameField.setText(mColumn.getPropertyName());
-
- mPropTypeCombo.setText( mColumn.getPropertyType());
-
- mMappingKindCombo.setText( mColumn.getMappingKind());
-
- mUpdateableCheckBox.setSelection( mColumn.isUpdateable());
-
- mInsertableCheckBox.setSelection(mColumn.isInsertable());
-
- if(!this.isDynamic){
- mPropGetScopePanel.enableComponents(isGenerated);
- mPropGetScopePanel.setScope(mColumn.getPropertyGetScope());
-
- mPropSetScopePanel.enableComponents( isGenerated );
- mPropSetScopePanel.setScope(mColumn.getPropertySetScope());
- }
-
- if( mColumn.isPartOfCompositePrimaryKey()){
- enableControls(false);
- mPropNameField.setEnabled(true);
- mGeneratedCheckbox.setEnabled(false);
- }
-
- } catch (Exception e) {
- JptJpaUiPlugin.log(e);
- } finally {
- mIsUpdatingControls = false;
- }
- }
- private void enableControls(boolean isGenerated) {
- Control[] controls;
- if(!this.isDynamic) {
- controls = this.domainClassGroup.getChildren();
- for( Control c: controls){
- c.setEnabled( isGenerated );
- }
- }
-
- controls = this.columnMappingGroup.getChildren();
- for( Control c: controls){
- c.setEnabled( isGenerated );
- }
- }
- /**
- * Initializes the panel by adding the editing controls.
- * @param columns
- * @param parent
- */
- protected void initPanel() {
- createControls(parent, columns);
- this.mPanelInited = true;
- }
-
- //-------------------------------------------
- //----- ScopePanel class --------------------
- //-------------------------------------------
- /**
- * A panel containing 3 radios (public, protected, private)
- */
- private class ScopePanel
- {
- private Button mPublicRadio;
- private Button mProtectedRadio;
- private Button mPrivateRadio;
-
- public ScopePanel(Composite comp, SelectionListener listener) {
- //super(3, 20/*hspacing*/, 0/*vspacing*/);
-
- Composite radioGroup = new Composite( comp, SWT.NONE);
- radioGroup.setLayout(new GridLayout(3, true));
- GridData gd = new GridData();
- gd.horizontalSpan = 3;
- radioGroup.setLayoutData(gd);
-
- /*string not localized intentionally, they are used as the actual
- * scope value (see getText() usage)*/
- mPublicRadio = new Button( radioGroup, SWT.RADIO );
- mPublicRadio.setText( "public");
- mPublicRadio.setLayoutData(new GridData());
- mProtectedRadio = new Button( radioGroup, SWT.RADIO );
- mProtectedRadio.setText("protected");
- mProtectedRadio.setLayoutData(new GridData());
- mPrivateRadio = new Button(radioGroup, SWT.RADIO );
- mPrivateRadio.setText( "private");
- mPrivateRadio.setLayoutData(new GridData());
-
- mPublicRadio.addSelectionListener(listener);
- mProtectedRadio.addSelectionListener(listener);
- mPrivateRadio.addSelectionListener(listener);
-
- }
- public void enableComponents(boolean b) {
- mPublicRadio.setEnabled(b);
- mProtectedRadio.setEnabled(b);
- mPrivateRadio.setEnabled(b);
- }
- /**
- * Returns the currently selected scope.
- */
- public String getScope() {
- Button radio = null;
- if (mPublicRadio.getSelection()) {
- radio = mPublicRadio;
- } else if (mProtectedRadio.getSelection() ) {
- radio = mProtectedRadio;
- } else if (mPrivateRadio.getSelection() ) {
- radio = mPrivateRadio;
- }
- return radio != null ? radio.getText() : null;
- }
- public void setScope(String scope) {
- mPublicRadio.setSelection(false);
- mProtectedRadio.setSelection(false);
- mPrivateRadio.setSelection(false);
- if( scope == null )
- return;
- if (scope.equals(ORMGenColumn.PUBLIC_SCOPE)) {
- mPublicRadio.setSelection(true);
- } else if (scope.equals(ORMGenColumn.PROTECTED_SCOPE)) {
- mProtectedRadio.setSelection(true);
- } else if (scope.equals(ORMGenColumn.PRIVATE_SCOPE)) {
- mPrivateRadio.setSelection(true);
- }
- }
- }
-
- //-------------------------------------------
- //----- private methods ---------------------
- //-------------------------------------------
- private void createControls(Composite composite, int columns) {
- mGeneratedCheckbox = new Button(composite, SWT.CHECK);
- mGeneratedCheckbox.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_genProp);
- mGeneratedCheckbox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- if (!mIsUpdatingControls) {
- mColumn.setGenerated(mGeneratedCheckbox.getSelection() );
- updateControls();
- }
- }});
- SWTUtil.fillColumns(mGeneratedCheckbox, columns);
-
- columnMappingGroup = new Group( composite, SWT.NONE);
- columnMappingGroup.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_colMapping);
- columnMappingGroup.setLayout(new GridLayout(columns, false));
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = columns;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = false;
- layoutData.horizontalIndent = 20 ;
- columnMappingGroup.setLayoutData(layoutData);
-
- SWTUtil.createLabel(columnMappingGroup, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_propName );
- mPropNameField = new Text(columnMappingGroup, SWT.BORDER | SWT.SINGLE );
- mPropNameField.addModifyListener(new ModifyListener(){
- @SuppressWarnings("restriction")
- public void modifyText(ModifyEvent e) {
- if (!mIsUpdatingControls) {
- String fldName = mPropNameField.getText();
- IStatus status = JavaConventions.validateIdentifier( fldName,
- JavaCore.VERSION_1_3, JavaCore.VERSION_1_3 );
- if( !status.matches(IStatus.ERROR)){
- mColumn.setPropertyName(fldName);
- wizardPage.setErrorMessage(null);
- }else{
- wizardPage.setErrorMessage(status.getMessage());
- }
- }
- }
- });
- SWTUtil.fillColumns(mPropNameField ,3);
-
- SWTUtil.createLabel(columnMappingGroup, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_propType );
- mPropTypeCombo = new Combo(columnMappingGroup, SWT.SINGLE | SWT.READ_ONLY);
- mPropTypeCombo.setItems( this.customizer.getAllPropertyTypes());
- mPropTypeCombo.addModifyListener( new ModifyListener(){
- public void modifyText(ModifyEvent e) {
- if (!mIsUpdatingControls) {
- mColumn.setPropertyType(mPropTypeCombo.getText());
- }
- }
- });
- SWTUtil.fillColumns(mPropTypeCombo,3);
-
- SWTUtil.createLabel(columnMappingGroup, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_mapKind );
- mMappingKindCombo = new Combo(columnMappingGroup, SWT.SINGLE | SWT.READ_ONLY);
- mMappingKindCombo.setItems( this.customizer.getAllMappingKinds());
- mMappingKindCombo.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- if (!mIsUpdatingControls) {
- mColumn.setMappingKind((String)mMappingKindCombo.getText());
- }
-
- }});
- SWTUtil.fillColumns(mMappingKindCombo ,3);
-
- mUpdateableCheckBox = new Button(columnMappingGroup, SWT.CHECK);
- mUpdateableCheckBox.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_colUpdateable);
- mUpdateableCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- if (!mIsUpdatingControls) {
- mColumn.setUpdateable(mUpdateableCheckBox.getSelection() );
- }
- }});
- SWTUtil.fillColumns(mUpdateableCheckBox ,4);
-
- mInsertableCheckBox = new Button(columnMappingGroup, SWT.CHECK);
- mInsertableCheckBox.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_colInsertable);
- mInsertableCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- if (!mIsUpdatingControls) {
- mColumn.setInsertable(mInsertableCheckBox.getSelection());
- }
- }});
- SWTUtil.fillColumns(mInsertableCheckBox ,4);
-
- SWTUtil.createLabel(composite, 4,"");
- if (!this.wizardPage.isDynamic()) {
- createJavaBeanPropertyControls(composite, columns);
- }
- }
-
- void createJavaBeanPropertyControls(Composite composite, int columns){
- //Java class generation properties
- domainClassGroup = new Group(composite, SWT.NONE);
- domainClassGroup.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_beanProp );
- domainClassGroup.setLayout(new GridLayout(columns, false));
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = columns;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = false;
- layoutData.horizontalIndent = 20;
- domainClassGroup.setLayoutData(layoutData);
-
- SWTUtil.createLabel(domainClassGroup, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_getterScope );
- mPropGetScopePanel = new ScopePanel(domainClassGroup, new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- if (!mIsUpdatingControls) {
- if( ((Button)e.getSource()).getSelection() )
- mColumn.setPropertyGetScope(mPropGetScopePanel.getScope());
- }
-
- }});
-
- SWTUtil.createLabel(domainClassGroup, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_colPanel_setterScope );
- mPropSetScopePanel = new ScopePanel(domainClassGroup, new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- if (!mIsUpdatingControls) {
- if( ((Button)e.getSource()).getSelection() )
- mColumn.setPropertySetScope(mPropSetScopePanel.getScope());
- }
- }});
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DatabaseGroup.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DatabaseGroup.java
deleted file mode 100644
index df49880c86..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DatabaseGroup.java
+++ /dev/null
@@ -1,551 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.Collections;
-import java.util.EventListener;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-import java.util.SortedSet;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jface.wizard.IWizardContainer;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.SynchronizedBoolean;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.CloneIterator;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.db.ConnectionAdapter;
-import org.eclipse.jpt.jpa.db.ConnectionListener;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.JptJpaDbPlugin;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.db.ui.internal.DTPUiTools;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.ImageRepository;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-
-/**
- * A composite used to connect to database, includes following UI controls:
- * - connection combo-box
- * - schema combo-box
- * - add connection button
- * - reconnect button
- */
-public class DatabaseGroup
-{
- private final JpaProject jpaProject;
- private final Set<Listener> listeners = Collections.synchronizedSet(new HashSet<Listener>());
-
- // these are kept in sync with the selection
- private ConnectionProfile selectedConnectionProfile;
-
- private Schema selectedSchema;
-
- private final Combo connectionComboBox;
-
- private final Combo schemaComboBox;
-
- private final Button reconnectButton;
-
- private final ConnectionListener connectionListener;
-
- private IWizardContainer wizardContainer;
-
- protected final ResourceManager resourceManager;
-
- // ********** construction **********
-
- protected DatabaseGroup(IWizardContainer wizardContainer, JpaProject jpaProject, Composite parent, ResourceManager resourceManager, int widthHint) {
- super();
- this.wizardContainer = wizardContainer;
- this.jpaProject = jpaProject;
- this.resourceManager = resourceManager;
-
- // connection combo-box
- this.buildLabel(parent, 1, JptUiEntityGenMessages.connection);
- this.connectionComboBox = this.buildConnectionComboBox(parent, widthHint);
-
- // add connection button
- Button addConnectionButton = this.buildButton(parent, JptUiEntityGenMessages.addConnectionLink, ImageRepository.getAddConnectionButtonImage(this.resourceManager), this.buildAddConnectionLinkSelectionListener());
- addConnectionButton.setLayoutData(new GridData());
-
- // A composite holds the reconnect button & text
- this.buildLabel(parent, 1, ""); //$NON-NLS-1$
- Composite comp = new Composite( parent , SWT.NONE );
- GridData gridData = new GridData();
- gridData.grabExcessHorizontalSpace = true ;
- gridData.horizontalSpan = 2;
- comp.setLayoutData(gridData);
- GridLayout gridLayout = new GridLayout(2, false);
- // Make the reconnect button to be closer to the connection combo.
- gridLayout.marginTop = -5;
- comp.setLayout(gridLayout);
-
- // reconnection button
- this.reconnectButton = this.buildButton(comp, JptUiEntityGenMessages.connectLink, ImageRepository.getReconnectButtonImage(this.resourceManager), this.buildReconnectLinkSelectionListener());
- this.buildLabel(comp, 1, JptUiEntityGenMessages.schemaInfo);
-
- // schema combo-box
- this.buildLabel(parent, 1, JptUiEntityGenMessages.schema);
- this.schemaComboBox = this.buildSchemaComboBox(parent);
- // filler
- new Label(parent, SWT.NULL);
-
- this.connectionListener = this.buildConnectionListener();
- }
-
- public void init()
- {
- // initialize state, based on JPA project
- this.selectedConnectionProfile = this.getJpaProjectConnectionProfile();
- this.selectedSchema = this.getDefaultSchema();
-
- if(this.selectedSchema != null) {
- this.fireSchemaChanged(this.selectedSchema);
- }
- if(this.selectedConnectionProfile != null) {
- this.selectedConnectionProfile.addConnectionListener(this.connectionListener);
- this.fireConnectionProfileChanged(this.selectedConnectionProfile);
- }
-
- this.updateConnectionComboBox();
- this.updateSchemaComboBox();
- this.updateReconnectLink();
- }
-
- // ********** intra-wizard methods **********
-
- public Schema getSelectedSchema() {
- return this.selectedSchema;
- }
-
- public void dispose() {
- if(this.selectedConnectionProfile != null) {
- this.selectedConnectionProfile.removeConnectionListener(this.connectionListener);
- }
- }
-
- public boolean connectionIsActive() {
- return (this.selectedConnectionProfile != null) && (this.selectedConnectionProfile.isActive());
- }
-
- // ********** internal methods **********
-
- /**
- * this can return null;
- * called at start-up and when the selected connection profile changes
- */
- private ConnectionProfile getJpaProjectConnectionProfile() {
- return this.jpaProject.getConnectionProfile();
- }
-
- /**
- * this can return null;
- * called at start-up and when the selected connection profile changes
- */
- private Schema getDefaultSchema() {
- Schema schema = null;
- // If a schema is specified for the JPA project, set schema to the schema of the JPA project
- if (this.getJpaProjectConnectionProfile() != null) {
- // schema could be null when the default schema does not exist
- schema = jpaProject.getDefaultDbSchema();
- }
-
- // selected connection profile could be null when no connection specified
- if (schema == null && this.selectedConnectionProfile != null) {
- // check if the selected connection profile is active
- if (this.selectedConnectionProfile.isActive()) {
- // if active, get the default schema of the selected connection profile
- schema = this.selectedConnectionProfile.getDatabase().getDefaultSchema();
- // if the default schema does not exist, get the first available schema
- if (schema == null) {
- Iterable<Schema> schemata = this.selectedConnectionProfile.getDatabase().getSchemata();
- if (schemata.iterator().hasNext()) {
- schema = schemata.iterator().next();
- }
- }
- }
- }
-
- return schema;
- }
-
- /**
- * the connection combo-box is updated at start-up and when the user
- * adds a connection profile
- */
- private void updateConnectionComboBox() {
- this.connectionComboBox.removeAll();
- for(String cpName : this.buildSortedConnectionProfileNames()) {
- this.connectionComboBox.add(cpName);
- }
- if(this.selectedConnectionProfile != null) {
- this.connectionComboBox.select(this.connectionComboBox.indexOf(this.selectedConnectionProfile.getName()));
- }
- }
-
- private SortedSet<String> buildSortedConnectionProfileNames() {
- return CollectionTools.sortedSet(JptJpaDbPlugin.getConnectionProfileFactory().getConnectionProfileNames());
- }
-
- /**
- * called at start-up and when the selected connection profile changes
- */
- private void updateReconnectLink() {
- this.reconnectButton.setEnabled(this.reconnectLinkCanBeEnabled());
- }
-
- private boolean reconnectLinkCanBeEnabled() {
- return (this.selectedConnectionProfile != null) && !(this.selectedConnectionProfile.isActive());
- }
-
- /**
- * the schema combo-box is updated at start-up and
- * when the selected connection profile changes
- */
- private void updateSchemaComboBox() {
- this.schemaComboBox.removeAll();
- for(String name : this.getSchemaNames()) {
- this.schemaComboBox.add(name);
- }
- // the current schema *should* be in the current connection profile
- if(this.selectedSchema != null) {
- this.schemaComboBox.select(this.schemaComboBox.indexOf(this.selectedSchema.getName()));
- }
- }
-
- private Iterable<String> getSchemaNames() {
- SchemaContainer sc = this.jpaProject.getDefaultDbSchemaContainer();
- // use schema *names* since the combo-box is read-only
- return (sc != null) ? sc.getSortedSchemaNames() : EmptyIterable.<String>instance();
- }
-
- /**
- * If the specified name matches the name of the JPA project's
- * connection profile, return it; otherwise, build a new connection
- * profile.
- */
- private ConnectionProfile checkJpaProjectConnectionProfile(String cpName) {
- ConnectionProfile cp = this.getJpaProjectConnectionProfile();
- if((cp != null) && cp.getName().equals(cpName)) {
- return cp;
- }
- return this.buildConnectionProfile(cpName);
- }
-
- private ConnectionProfile buildConnectionProfile(String name) {
- return JptJpaDbPlugin.getConnectionProfileFactory().buildConnectionProfile(name);
- }
-
-
- // ********** listener callbacks **********
-
- private void selectedConnectionChanged() {
- String text = this.connectionComboBox.getText();
- if(text.length() == 0) {
- if(this.selectedConnectionProfile == null) {
- return; // no change
- }
- this.selectedConnectionProfile.removeConnectionListener(this.connectionListener);
- this.selectedConnectionProfile = null;
- }
- else {
- if(this.selectedConnectionProfile == null) {
- this.selectedConnectionProfile = this.checkJpaProjectConnectionProfile(text);
- }
- else {
- if(text.equals(this.selectedConnectionProfile.getName())) {
- return; // no change
- }
- this.selectedConnectionProfile.removeConnectionListener(this.connectionListener);
- this.selectedConnectionProfile = this.checkJpaProjectConnectionProfile(text);
- }
- this.selectedConnectionProfile.addConnectionListener(this.connectionListener);
- }
- this.fireConnectionProfileChanged(this.selectedConnectionProfile);
- this.connectionChanged();
- }
-
- private void selectedSchemaChanged() {
- Schema old = this.selectedSchema;
- this.selectedSchema = this.jpaProject.getDefaultDbSchemaContainer().getSchemaNamed(this.schemaComboBox.getText());
- if(this.selectedSchema != old) {
- fireSchemaChanged(this.selectedSchema);
- }
- }
-
- /**
- * Open the DTP New Connection Profile wizard.
- * If the user creates a new connection profile, start using it and
- * connect it
- */
- private void addConnection() {
- String addedProfileName = DTPUiTools.createNewConnectionProfile();
- if(addedProfileName == null) {
- return; // user pressed "Cancel"
- }
- if(this.selectedConnectionProfile != null) {
- this.selectedConnectionProfile.removeConnectionListener(this.connectionListener);
- }
- this.selectedConnectionProfile = this.buildConnectionProfile(addedProfileName);
- this.selectedConnectionProfile.addConnectionListener(this.connectionListener);
- this.updateConnectionComboBox();
- this.selectedConnectionProfile.connect();
- // everything else should be synchronized when we get the resulting open event
- this.fireConnectionProfileChanged(this.selectedConnectionProfile);
- this.updateSchemaComboBox();
- }
-
- private void reconnect() {
- try {
- this.wizardContainer.run(true, true, new IRunnableWithProgress() {
- public void run(final IProgressMonitor monitor)
- throws InvocationTargetException, InterruptedException
- {
- monitor.beginTask(JptUiEntityGenMessages.connectingToDatabase, 10);
- final SynchronizedBoolean finished = new SynchronizedBoolean(false);
- Thread t = new Thread() {
- @Override
- public void run() {
- try {
- DatabaseGroup.this.selectedConnectionProfile.connect();
- }
- catch (Exception ex) {
- JptJpaUiPlugin.log(ex);
- }
- finally {
- finished.setTrue();
- }
- }
- };
- t.start();
-// Updating the monitor caused TablesSelectorWizardPage buttons to be disable
-// while(finished.isFalse()) {
-// Thread.sleep(1000);
-// monitor.worked(1);
-// }
- // everything should be synchronized when we get the resulting open event
- monitor.done();
- }
- });
- }
- catch (Exception e) {
- JptJpaUiPlugin.log(e);
- }
- this.wizardContainer.updateButtons();
- }
-
- /**
- * called when
- * - the user selects a new connection
- * - the connection was opened
- * - the connection was closed (never happens?)
- * we need to update the schema stuff and the reconnect link
- */
- /* CU private */ void connectionChanged() {
- Schema old = this.selectedSchema;
- this.selectedSchema = this.getDefaultSchema();
- if(this.selectedSchema != old) {
- this.fireSchemaChanged(this.selectedSchema);
- }
- this.updateSchemaComboBox();
- this.updateReconnectLink();
- }
-
-
- // ********** listeners **********
-
- private SelectionListener buildConnectionComboBoxSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // nothing special for "default" (double-click?)
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- DatabaseGroup.this.selectedConnectionChanged();
- }
- @Override
- public String toString() {
- return "DatabaseConnectionWizardPage connection combo-box selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- private SelectionListener buildSchemaComboBoxSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent event) {
- // nothing special for "default" (double-click?)
- this.widgetSelected(event);
- }
- public void widgetSelected(SelectionEvent event) {
- DatabaseGroup.this.selectedSchemaChanged();
- }
- @Override
- public String toString() {
- return "DatabaseConnectionWizardPage schema combo-box selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- private SelectionListener buildAddConnectionLinkSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- DatabaseGroup.this.addConnection();
- }
- @Override
- public String toString() {
- return "DatabaseConnectionWizardPage add connection link selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- private SelectionListener buildReconnectLinkSelectionListener() {
- return new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- DatabaseGroup.this.reconnect();
- }
- @Override
- public String toString() {
- return "DatabaseConnectionWizardPage reconnect link selection listener"; //$NON-NLS-1$
- }
- };
- }
-
- private ConnectionListener buildConnectionListener() {
- return new LocalConnectionListener();
- }
-
- class LocalConnectionListener
- extends ConnectionAdapter
- {
- @Override
- public void opened(ConnectionProfile cp) {
- this.connectionChanged();
- }
- @Override // this probably won't ever get called...
- public void closed(ConnectionProfile cp) {
- this.connectionChanged();
- }
- private void connectionChanged() {
- org.eclipse.jpt.common.ui.internal.util.SWTUtil.asyncExec(
- new Runnable() {
- public void run() {
- DatabaseGroup.this.connectionChanged();
- }
- }
- );
- }
- }
-
- // ********** listeners **********
-
- public void addListener(Listener listener) {
- if( ! this.listeners.add(listener)) {
- throw new IllegalArgumentException("duplicate listener: " + listener); //$NON-NLS-1$
- }
- }
-
- public void removeListener(Listener listener) {
- if( ! this.listeners.remove(listener)) {
- throw new IllegalArgumentException("missing listener: " + listener); //$NON-NLS-1$
- }
- }
-
- private Iterator<Listener> listeners() {
- return new CloneIterator<Listener>(this.listeners);
- }
-
- private void fireConnectionProfileChanged(ConnectionProfile connectionProfile) {
- for(Iterator<Listener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().selectedConnectionProfileChanged(connectionProfile);
- }
- }
-
- private void fireSchemaChanged(Schema schema) {
- for(Iterator<Listener> stream = this.listeners(); stream.hasNext(); ) {
- stream.next().selectedSchemaChanged(schema);
- }
- }
-
- // ********** UI components **********
-
- private Label buildLabel(Composite parent, int span, String text) {
- Label label = new Label(parent, SWT.NONE);
- label.setText(text);
- GridData gridData = new GridData();
- gridData.horizontalSpan = span;
- label.setLayoutData(gridData);
- return label;
- }
-
- private Combo buildConnectionComboBox(Composite parent, int widthHint) {
- Combo combo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- GridData gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
- //gridData.grabExcessHorizontalSpace = true ;
- gridData.widthHint = widthHint;
- combo.setLayoutData(gridData);
- combo.addSelectionListener(this.buildConnectionComboBoxSelectionListener());
- return combo;
- }
-
- private Combo buildSchemaComboBox(Composite parent) {
- Combo combo = new Combo(parent, SWT.BORDER | SWT.READ_ONLY);
- GridData gridData = new GridData(SWT.BEGINNING, SWT.CENTER, true, false);
- gridData.horizontalAlignment = SWT.FILL;
- gridData.horizontalSpan = 1;
- gridData.grabExcessHorizontalSpace = true ;
- combo.setLayoutData(gridData);
- combo.addSelectionListener(this.buildSchemaComboBoxSelectionListener());
- return combo;
- }
-
- private Button buildButton(Composite parent, String toolTipText, Image image, SelectionListener listener) {
- Button button = new Button(parent, SWT.NONE);
- GridData gridData = new GridData(GridData.END, GridData.CENTER, false, false);
- gridData.horizontalSpan = 1;
- button.setLayoutData(gridData);
- button.setImage( image );
- button.setToolTipText( toolTipText);
- button.addSelectionListener(listener);
- return button;
- }
-
- // ********** listener interface **********
-
- /**
- * Allows clients to listen for changes to the selected connection profile
- * and schema.
- */
- public interface Listener extends EventListener
- {
- void selectedConnectionProfileChanged(ConnectionProfile connectionProfile);
-
- void selectedSchemaChanged(Schema schema);
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DefaultTableGenerationWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DefaultTableGenerationWizardPage.java
deleted file mode 100644
index a4a94bf17d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/DefaultTableGenerationWizardPage.java
+++ /dev/null
@@ -1,340 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.List;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaModel;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jdt.core.JavaModelException;
-import org.eclipse.jdt.internal.ui.wizards.NewWizardMessages;
-import org.eclipse.jdt.internal.ui.wizards.TypedElementSelectionValidator;
-import org.eclipse.jdt.internal.ui.wizards.TypedViewerFilter;
-import org.eclipse.jdt.ui.JavaElementComparator;
-import org.eclipse.jdt.ui.JavaElementLabelProvider;
-import org.eclipse.jdt.ui.StandardJavaElementContentProvider;
-import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.prefs.JpaEntityGenPreferencesManager;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenTable;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-/**
- * A wizard page allowing the entry of the default table generation
- * properties (Java classes package, base class, etc).
- * These properties apply to all tables unless explicitly overridden (in the table generation page).
- *
- * @author Danny Ju
- */
-@SuppressWarnings("restriction")
-public class DefaultTableGenerationWizardPage extends NewTypeWizardPage {
-
- protected JpaProject jpaProject;
-
- /*the instance used to get/set the default properties.*/
- protected ORMGenTable defaultsTable;
-
- protected ORMGenCustomizer customizer;
-
- protected TableGenPanel defaultTableGenPanel ;
-
- private JpaEntityGenPreferencesManager prefrencesManager;
-
- public DefaultTableGenerationWizardPage(JpaProject jpaProject) {
- super(true, "DefaultTableGenerationWizardPage"); //$NON-NLS-1$
- this.jpaProject = jpaProject;
- setTitle(JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_title);
- setDescription( JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_desc);
- this.prefrencesManager = buildEntityGenPreferencesManager();
- }
-
-
- // -------- Initialization ---------
- /**
- * The wizard owning this page is responsible for calling this method with the
- * current selection. The selection is used to initialize the fields of the wizard
- * page.
- *
- * @param selection used to initialize the fields
- */
- public void init(IStructuredSelection selection) {
- IJavaElement jelem = null;
- if ( selection!=null && selection.getFirstElement() instanceof IJavaElement ) {
- jelem = (IJavaElement) selection.getFirstElement();
- }else{
- jelem = this.jpaProject.getJavaProject();
- }
- if( jelem !=null ){
- initContainerPage(jelem);
- initTypePage(jelem);
- }
-
- }
-
- public void createControl(Composite parent) {
- this.initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NULL);
- int nColumns= 4 ;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- composite.setLayout(layout);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.GENERATE_ENTITIES_WIZARD_CUSTOMIZE_DEFAULT_ENTITY_GENERATION);
-
- //Create entity access, collection type, etc
- this.defaultTableGenPanel = new TableGenPanel(composite, 4, true, this);
-
- this.createDomainJavaClassesPropertiesGroup(composite, 4);
- this.setControl(composite);
-
- this.setPageComplete(true);
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- ORMGenCustomizer customizer = getCustomizer();
- //If user changed the connection or schema
- if ( this.customizer != customizer ) {
- this.customizer = customizer;
- this.defaultsTable = customizer.createGenTable(null);
- this.defaultTableGenPanel.setORMGenTable(this.defaultsTable);
- defaultTableGenPanel.updateControls();
- //set the super class and implemented interfaces value
- String baseClass = this.defaultsTable.getExtends() == null ?"" : this.defaultsTable.getExtends();
- this.setSuperClass(baseClass, true);
- this.setSuperInterfaces(this.defaultsTable.getImplements(), true);
- IPackageFragmentRoot root = getSourceFolder(this.defaultsTable.getSourceFolder());
- String initPackageName = this.getPackageText();
- if(initPackageName.length() == 0 ) {
- if(StringTools.stringIsEmpty(this.defaultsTable.getPackage())) {
- this.defaultsTable.setPackage(this.prefrencesManager.getDefaultPackagePreference());
- }
- this.setPackageName(root, this.defaultsTable.getPackage());
- }
- this.setPackageFragmentRoot(root, true/*canBeModified*/);
- }
- }
- }
-
- //search for the source folder with the given name or return the first
- //source folder if not found.
- private IPackageFragmentRoot getSourceFolder(String srcFolder) {
- IPackageFragmentRoot packageFragmentRoot = null;
- srcFolder = '/' + srcFolder;
- IJavaProject javaProject = this.jpaProject.getJavaProject();
-
- for (IPackageFragmentRoot root : JDTTools.getJavaSourceFolders(javaProject)) {
- //Save the first source root in case we don't find one that matches the saved value
- if (packageFragmentRoot == null) {
- packageFragmentRoot = root;
- }
- //check for alternative source root that matches the saved value
- if (root.getPath().toString().equals(srcFolder)){
- packageFragmentRoot = root;
- break;
- }
- }
- return packageFragmentRoot;
- }
-
- private void setPackageName(IPackageFragmentRoot packageFragmentRoot, String packageName) {
- if( packageName == null || packageName.length() == 0 || packageFragmentRoot==null) {
- return;
- }
- IPackageFragment packageFragment = packageFragmentRoot.getPackageFragment(packageName);
- setPackageFragment(packageFragment, true/*canBeModified*/);
- }
-
-
- protected void createDomainJavaClassesPropertiesGroup(Composite composite, int columns) {
- Group parent = new Group( composite, SWT.NONE);
- parent.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_domainJavaClass);
- parent.setLayout(new GridLayout( columns, false));
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = columns;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = true;
- parent.setLayoutData(layoutData);
-
- //default Java package name only available for default table generation
- createContainerControls(parent, columns);
- createPackageControls(parent, columns);
- createSuperClassControls(parent, columns);
- createSuperInterfacesControls(parent, columns);
- }
-
- @Override
- protected IStatus packageChanged() {
- IStatus status = super.packageChanged();
- IPackageFragment packageFragment = getPackageFragment();
- //String srcFolder = packageFragment.getPath().toPortableString();
- if (defaultsTable != null && !status.matches(IStatus.ERROR)) {
- defaultsTable.setPackage(packageFragment.getElementName());
- }
- return status;
- }
-
- @Override
- protected IStatus superClassChanged() {
- IStatus status = super.superClassChanged();
- String baseClass = getSuperClass();
- if (baseClass != null && defaultsTable != null && !status.matches(IStatus.ERROR)) {
- String oldBaseClass = defaultsTable.getExtends();
- if ( !baseClass.equals(oldBaseClass)) {
- defaultsTable.setExtends(baseClass);
- }
- }
- return status;
- }
- @Override
- protected IStatus containerChanged() {
- IStatus status = super.containerChanged();
- String srcFolder = getPackageFragmentRootText();
- if( !status.matches(IStatus.ERROR) ){
- if (defaultsTable != null ) {
- defaultsTable.setSourceFolder( srcFolder );
- }
- }
- return status;
- }
-
- /** Override to allow select source folder in current project only
- * @see org.eclipse.jdt.ui.wizards.NewContainerWizardPage#chooseContainer()
- */
- @Override
- protected IPackageFragmentRoot chooseContainer() {
- Class<?>[] acceptedClasses = new Class[] { IPackageFragmentRoot.class, IJavaProject.class };
- TypedElementSelectionValidator validator= new TypedElementSelectionValidator(acceptedClasses, false) {
- @Override
- public boolean isSelectedValid(Object element) {
- try {
- if (element instanceof IJavaProject) {
- IJavaProject jproject= (IJavaProject)element;
- IPath path= jproject.getProject().getFullPath();
- return (jproject.findPackageFragmentRoot(path) != null);
- } else if (element instanceof IPackageFragmentRoot) {
- return JDTTools.packageFragmentRootIsSourceFolder((IPackageFragmentRoot) element);
- }
- return true;
- } catch (JavaModelException e) {
- JptJpaUiPlugin.log(e); // just log, no UI in validation
- }
- return false;
- }
- };
-
- acceptedClasses= new Class[] { IJavaModel.class, IPackageFragmentRoot.class, IJavaProject.class };
- ViewerFilter filter= new TypedViewerFilter(acceptedClasses) {
- @Override
- public boolean select(Viewer viewer, Object parent, Object element) {
- if (element instanceof IPackageFragmentRoot) {
- return JDTTools.packageFragmentRootIsSourceFolder((IPackageFragmentRoot) element);
- }
- return super.select(viewer, parent, element);
- }
- };
-
- StandardJavaElementContentProvider provider= new StandardJavaElementContentProvider();
- ILabelProvider labelProvider= new JavaElementLabelProvider(JavaElementLabelProvider.SHOW_DEFAULT);
- ElementTreeSelectionDialog dialog= new ElementTreeSelectionDialog(getShell(), labelProvider, provider);
- dialog.setValidator(validator);
- dialog.setComparator(new JavaElementComparator());
- dialog.setTitle(NewWizardMessages.NewContainerWizardPage_ChooseSourceContainerDialog_title);
- dialog.setMessage(NewWizardMessages.NewContainerWizardPage_ChooseSourceContainerDialog_description);
- dialog.addFilter(filter);
- dialog.setInput(jpaProject.getJavaProject());
- dialog.setInitialSelection(getPackageFragmentRoot());
- dialog.setHelpAvailable(false);
-
- if (dialog.open() == Window.OK) {
- Object element= dialog.getFirstResult();
- if (element instanceof IJavaProject) {
- IJavaProject jproject= (IJavaProject)element;
- return jproject.getPackageFragmentRoot(jproject.getProject());
- } else if (element instanceof IPackageFragmentRoot) {
- return (IPackageFragmentRoot)element;
- }
- return null;
- }
- return null;
- }
-
- @Override
- protected void handleFieldChanged(String fieldName) {
- super.handleFieldChanged(fieldName);
- if (this.fContainerStatus.matches(IStatus.ERROR)) {
- updateStatus(fContainerStatus);
- }else if( ! this.fPackageStatus.matches(IStatus.OK) ) {
- updateStatus(fPackageStatus);
- } else if (this.fSuperClassStatus.matches(IStatus.ERROR)) {
- updateStatus(fSuperClassStatus);
- } else {
- updateStatus(Status.OK_STATUS);
- }
- }
-
- @Override
- @SuppressWarnings({ "unchecked", "rawtypes" })
- protected IStatus superInterfacesChanged() {
- IStatus ret = super.superInterfacesChanged();
- if ( ret.isOK() ) {
- List interfaces = getSuperInterfaces();
- if(defaultsTable!=null)
- defaultsTable.setImplements(interfaces);
- }
- return ret;
- }
-
- protected ORMGenCustomizer getCustomizer() {
- GenerateEntitiesFromSchemaWizard wizard = (GenerateEntitiesFromSchemaWizard) this.getWizard();
- return wizard.getCustomizer();
- }
-
- private JpaEntityGenPreferencesManager buildEntityGenPreferencesManager() {
- return new JpaEntityGenPreferencesManager(this.jpaProject.getProject());
- }
-
- @Override
- public final void performHelp() {
- this.getHelpSystem().displayHelp( GenerateEntitiesFromSchemaWizard.HELP_CONTEXT_ID );
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-}
-
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/GenerateEntitiesFromSchemaWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/GenerateEntitiesFromSchemaWizard.java
deleted file mode 100644
index 77f1b06df0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/GenerateEntitiesFromSchemaWizard.java
+++ /dev/null
@@ -1,509 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.io.File;
-import java.io.IOException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceRuleFactory;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IPackageFragment;
-import org.eclipse.jdt.core.IPackageFragmentRoot;
-import org.eclipse.jface.dialogs.IDialogConstants;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.resource.JFaceResources;
-import org.eclipse.jface.resource.LocalResourceManager;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.common.core.internal.utility.JDTTools;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.ui.internal.dialogs.OptionalMessageDialog;
-import org.eclipse.jpt.jpa.core.EntityGeneratorDatabaseAnnotationNameBuilder;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.gen.internal.BaseEntityGenCustomizer;
-import org.eclipse.jpt.jpa.gen.internal.DatabaseAnnotationNameBuilder;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenTable;
-import org.eclipse.jpt.jpa.gen.internal.PackageGenerator;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-
-public class GenerateEntitiesFromSchemaWizard extends Wizard
- implements INewWizard {
-
- public static final String HELP_CONTEXT_ID = JptJpaUiPlugin.PLUGIN_ID + ".GenerateEntitiesFromSchemaWizard"; //$NON-NLS-1$
-
- protected JpaProject jpaProject;
-
- protected IStructuredSelection selection;
-
- private ORMGenCustomizer customizer = null;
-
- private PromptJPAProjectWizardPage projectPage;
-
- protected TablesSelectorWizardPage tablesSelectorPage;
-
- protected TableAssociationsWizardPage tableAssociationsPage;
-
- protected DefaultTableGenerationWizardPage defaultTableGenerationPage;
-
- protected TablesAndColumnsCustomizationWizardPage tablesAndColumnsCustomizationPage;
-
- protected final ResourceManager resourceManager;
-
- public GenerateEntitiesFromSchemaWizard() {
- this.resourceManager = new LocalResourceManager(JFaceResources.getResources());
- this.setWindowTitle( JptUiEntityGenMessages.GenerateEntitiesWizard_generateEntities);
- }
-
- public GenerateEntitiesFromSchemaWizard( JpaProject jpaProject, IStructuredSelection selection) {
- super();
- this.jpaProject = jpaProject;
- this.selection = selection;
- this.resourceManager = new LocalResourceManager(JFaceResources.getResources());
- this.setWindowTitle( JptUiEntityGenMessages.GenerateEntitiesWizard_generateEntities);
- this.setDefaultPageImageDescriptor(JptJpaUiPlugin.getImageDescriptor(JptUiIcons.ENTITY_WIZ_BANNER));
- }
-
- @Override
- public void addPages() {
- setForcePreviousAndNextButtons(true);
-
- //If this.jpaProject is not initialized because user didn't select a JPA project
- if( this.jpaProject == null ){
- this.projectPage = new PromptJPAProjectWizardPage(HELP_CONTEXT_ID);
- this.addPage(this.projectPage);
- return;
- }
- addMainPages();
- }
-
- protected void addMainPages() {
- this.tablesSelectorPage = new TablesSelectorWizardPage(this.jpaProject, this.resourceManager, false);
- this.addPage(this.tablesSelectorPage);
-
- this.tableAssociationsPage = new TableAssociationsWizardPage(this.jpaProject, this.resourceManager);
- this.addPage(this.tableAssociationsPage);
-
- this.defaultTableGenerationPage = new DefaultTableGenerationWizardPage(this.jpaProject);
- this.addPage(this.defaultTableGenerationPage);
- this.defaultTableGenerationPage.init(this.selection);
-
- this.tablesAndColumnsCustomizationPage = new TablesAndColumnsCustomizationWizardPage(this.jpaProject, this.resourceManager);
- this.addPage(this.tablesAndColumnsCustomizationPage);
- this.tablesAndColumnsCustomizationPage.init(this.selection);
- }
-
- public ORMGenCustomizer getORMGenCustomizer(){
- return this.customizer;
- }
-
- /**
- * Create the ORMGenCustomizer when user selects a new connection profile and schema
- *
- * JpaPlatform implementor can provide a custom ORMGenCustomizer specific to a platform
- * with AdapterFactory through Eclipse org.eclipse.core.runtime.adapters extension point:
- * <pre>
- *
- *<extension
- * point="org.eclipse.core.runtime.adapters">
- * <factory
- * adaptableType="org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkPlatform"
- * class="oracle.eclipse.tools.orm.internal.EclipseLinkORMGenCustomizerAdapterFactory">
- * <adapter
- * type="oracle.eclipse.tools.orm.internal.ORMGenCustomizer">
- * </adapter>
- * </factory>
- *</extension>
- *</pre>
- *
- * @param schema
- */
- public ORMGenCustomizer createORMGenCustomizer(Schema schema){
- JpaPlatform jpaPlatform = this.jpaProject.getJpaPlatform();
- ORMGenCustomizer obj = PlatformTools.getAdapter( jpaPlatform, ORMGenCustomizer.class );
- if (obj != null) {
- this.customizer = (ORMGenCustomizer) obj;
- this.customizer.init(getCustomizationFile(), schema);
- } else{
- this.customizer = new BaseEntityGenCustomizer( );
- this.customizer.init(getCustomizationFile(), schema);
- }
-
- ORMGenTable newDefaultTable = getCustomizer().createGenTable(null);
- if ( selection!=null && selection.getFirstElement() instanceof IPackageFragment ) {
- IPackageFragment packageFrag = (IPackageFragment)selection.getFirstElement();
- newDefaultTable.setPackage( packageFrag.getElementName() );
- for (IPackageFragmentRoot root : JDTTools.getJavaSourceFolders(this.jpaProject.getJavaProject())) {
- String srcFolder = root.getPath().toPortableString();
- if( packageFrag.getPath().toPortableString().startsWith( srcFolder +'/' )){
- newDefaultTable.setSourceFolder(srcFolder.substring(1));
- }
- }
- }
- return this.customizer;
- }
-
- protected String getCustomizationFileName() {
- ConnectionProfile profile = getProjectConnectionProfile();
- String connection = profile == null ? "" : profile.getName();
- String name = "org.eclipse.jpt.entitygen." + (connection == null ? "" :connection.replace(' ', '-')); //$NON-NLS-1$
- Schema schema = getDefaultSchema();
- if ( schema!= null ) {
- name += "." + schema.getName();//$NON-NLS-1$
- }
- return name.toLowerCase();
- }
-
- /**
- * Returns the nodes state file.
- */
- private File getCustomizationFile() {
- String projectPath = this.jpaProject.getProject().getLocation().toPortableString();
- File genDir = new File(projectPath + "/.settings");//$NON-NLS-1$
- genDir.mkdirs();
- return new File(genDir, getCustomizationFileName());
- }
-
- @Override
- public boolean performFinish() {
- if (this.jpaProject == null) {
- return true;
- }
- // the customizer will be null if the user presses "Finish" on the
- // Select JPA Project page (Don't ask....)
- if (this.customizer == null) {
- return false;
- }
- try {
- this.customizer.setDatabaseAnnotationNameBuilder( buildDatabaseAnnotationNameBuilder() );
- this.customizer.save();
- } catch (IOException e) {
- JptJpaUiPlugin.log(e);
- }
- OverwriteConfirmer overwriteConfirmer = null;
- if (showOverwriteWarning()) {
- overwriteConfirmer = new OverwriteConfirmer();
- }
-
- scheduleGenerateEntitiesJob(overwriteConfirmer);
- return true;
- }
-
- protected void scheduleGenerateEntitiesJob(
- OverwriteConfirmer overwriteConfirmer) {
- WorkspaceJob genEntitiesJob = new GenerateEntitiesJob(this.jpaProject, getCustomizer(), overwriteConfirmer, false);
- genEntitiesJob.schedule();
- }
-
- // ********** generate entities job **********
-
- public static class GenerateEntitiesJob extends WorkspaceJob {
- final JpaProject jpaProject;
- final ORMGenCustomizer customizer;
- final OverwriteConfirmer confirmer;
- final boolean generateXml;
- public GenerateEntitiesJob(JpaProject jpaProject, ORMGenCustomizer customizer, OverwriteConfirmer confirmer, boolean generateXml) {
- super(JptUiMessages.EntitiesGenerator_jobName);
- this.customizer = customizer;
- this.jpaProject = jpaProject;
- this.confirmer = confirmer;
- this.generateXml = generateXml;
- IResourceRuleFactory ruleFactory = ResourcesPlugin.getWorkspace().getRuleFactory();
- this.setRule(ruleFactory.modifyRule(jpaProject.getProject()));
- }
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
- PackageGenerator.generate(this.jpaProject,this.customizer, this.confirmer, monitor, this.generateXml);
- return Status.OK_STATUS;
- }
- }
-
- public static boolean showOverwriteWarning(){
- return OptionalMessageDialog.isDialogEnabled(OverwriteConfirmerDialog.ID);
- }
-
- // ********** overwrite confirmer **********
-
- public static class OverwriteConfirmer implements org.eclipse.jpt.jpa.gen.internal.OverwriteConfirmer {
- private boolean overwriteAll = false;
- private boolean skipAll = false;
-
- OverwriteConfirmer() {
- }
-
- public boolean overwrite(final String className) {
- if (this.overwriteAll) {
- return true;
- }
- if (this.skipAll) {
- return false;
- }
- return this.promptUser(className);
- }
-
- private boolean promptUser(final String className) {
- // get on the UI thread synchronously, need feedback before continuing
- final boolean ret[]=new boolean[1];
- org.eclipse.jpt.common.ui.internal.util.SWTUtil.syncExec(new Runnable() {
- public void run() {
- final OverwriteConfirmerDialog dialog = new OverwriteConfirmerDialog(Display.getCurrent().getActiveShell(), className);
- dialog.open();
- if (dialog.getReturnCode() == Window.CANCEL) {
- //throw new OperationCanceledException();
- skipAll = true;
- ret[0] = false;
- return;
- }
- if (dialog.yes()) {
- ret[0] = true;
- }
- if (dialog.yesToAll()) {
- overwriteAll = true;
- ret[0] = true;
- }
- if (dialog.no()) {
- ret[0] = false;
- }
- if (dialog.noToAll()) {
- skipAll = true;
- ret[0] = false;
- }
- }
- });
- return ret[0];
- }
-
- }
-
-
- // ********** overwrite dialog **********
-
- static class OverwriteConfirmerDialog extends OptionalMessageDialog {
- private boolean yes = false;
- private boolean yesToAll = false;
- private boolean no = false;
- private boolean noToAll = false;
-
- private static final String ID= "dontShowOverwriteEntitesFromSchemas.warning"; //$NON-NLS-1$
-
- OverwriteConfirmerDialog(Shell parent, String className) {
- super(ID, parent,
- JptUiMessages.OverwriteConfirmerDialog_title,
- NLS.bind(JptUiMessages.OverwriteConfirmerDialog_text, className),
- MessageDialog.WARNING,
- new String[] {IDialogConstants.YES_LABEL,
- IDialogConstants.YES_TO_ALL_LABEL,
- IDialogConstants.NO_LABEL,
- IDialogConstants.NO_TO_ALL_LABEL,
- IDialogConstants.CANCEL_LABEL},
- 2);
- }
-
- @Override
- protected void createButtonsForButtonBar(Composite parent) {
- this.createButton(parent, IDialogConstants.YES_ID, IDialogConstants.YES_LABEL, false);
- this.createButton(parent, IDialogConstants.YES_TO_ALL_ID, IDialogConstants.YES_TO_ALL_LABEL, false);
- this.createButton(parent, IDialogConstants.NO_ID, IDialogConstants.NO_LABEL, true);
- this.createButton(parent, IDialogConstants.NO_TO_ALL_ID, IDialogConstants.NO_TO_ALL_LABEL, false);
- this.createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);
- }
-
- @Override
- protected void buttonPressed(int buttonId) {
- switch (buttonId) {
- case IDialogConstants.YES_ID :
- this.yesPressed();
- break;
- case IDialogConstants.YES_TO_ALL_ID :
- this.yesToAllPressed();
- break;
- case IDialogConstants.NO_ID :
- this.noPressed();
- break;
- case IDialogConstants.NO_TO_ALL_ID :
- this.noToAllPressed();
- break;
- case IDialogConstants.CANCEL_ID :
- this.cancelPressed();
- break;
- default :
- break;
- }
- }
-
- private void yesPressed() {
- this.yes = true;
- this.setReturnCode(OK);
- this.close();
- }
-
- private void yesToAllPressed() {
- this.yesToAll = true;
- this.setReturnCode(OK);
- this.close();
- }
-
- private void noPressed() {
- this.no = true;
- this.setReturnCode(OK);
- this.close();
- }
-
- private void noToAllPressed() {
- this.noToAll = true;
- this.setReturnCode(OK);
- this.close();
- }
-
- boolean yes() {
- return this.yes;
- }
-
- boolean yesToAll() {
- return this.yesToAll;
- }
-
- boolean no() {
- return this.no;
- }
-
- boolean noToAll() {
- return this.noToAll;
- }
- }
-
-
- private DatabaseAnnotationNameBuilder buildDatabaseAnnotationNameBuilder() {
- return new LocalDatabaseAnnotationNameBuilder(this.jpaProject.getJpaPlatform().getEntityGeneratorDatabaseAnnotationNameBuilder());
- }
-
- // ********** name builder adapter **********
-
- /**
- * adapt the JPA platform-supplied builder to the builder interface
- * expected by the entity generator
- */
- static class LocalDatabaseAnnotationNameBuilder implements DatabaseAnnotationNameBuilder {
- private EntityGeneratorDatabaseAnnotationNameBuilder builder;
- LocalDatabaseAnnotationNameBuilder(EntityGeneratorDatabaseAnnotationNameBuilder builder) {
- super();
- this.builder = builder;
- }
- public String buildTableAnnotationName(String entityName, Table table) {
- return this.builder.buildTableAnnotationName(entityName, table);
- }
- public String buildColumnAnnotationName(String attributeName, Column column) {
- return this.builder.buildColumnAnnotationName(attributeName, column);
- }
- public String buildJoinColumnAnnotationName(String attributeName, ForeignKey foreignKey) {
- return this.builder.buildJoinColumnAnnotationName(attributeName, foreignKey);
- }
- public String buildJoinColumnAnnotationName(Column column) {
- return this.builder.buildJoinColumnAnnotationName(column);
- }
- public String buildJoinTableAnnotationName(Table table) {
- return this.builder.buildJoinTableAnnotationName(table);
- }
- }
-
- @Override
- public IWizardPage getStartingPage() {
- if (this.projectPage != null) {
- if (this.tablesSelectorPage != null) {
- return this.tablesSelectorPage;
- }
- return this.projectPage;
- }
- return super.getStartingPage();
- }
-
- public ORMGenCustomizer getCustomizer (){
- return customizer;
- }
-
- public ConnectionProfile getProjectConnectionProfile() {
- return this.jpaProject.getConnectionProfile();
- }
-
- public JpaProject getJpaProject(){
- return this.jpaProject;
- }
-
- public void setJpaProject(JpaProject jpaProject) {
- if (this.jpaProject == null) {
- this.jpaProject = jpaProject;
- IWizardPage currentPage = getContainer().getCurrentPage();
- if (this.projectPage != null && currentPage.equals(this.projectPage)) {
- addMainPages();
- }
- }
- }
-
- public Schema getDefaultSchema() {
- return getJpaProject().getDefaultDbSchema();
- }
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- Object sel = selection.getFirstElement();
- if ( sel instanceof IResource ) {
- IProject proj = ((IResource) sel).getProject();
- JpaProject jpaProj = this.getJpaProject(proj);
- this.jpaProject = jpaProj;
- } else if( sel instanceof org.eclipse.jdt.core.IPackageFragmentRoot ) {
- org.eclipse.jdt.core.IPackageFragmentRoot root = (org.eclipse.jdt.core.IPackageFragmentRoot) sel;
- IProject proj = root.getJavaProject().getProject();
- JpaProject jpaProj = this.getJpaProject(proj);
- this.jpaProject = jpaProj;
- } else if( sel instanceof org.eclipse.jdt.core.IPackageFragment) {
- org.eclipse.jdt.core.IPackageFragment frag = (org.eclipse.jdt.core.IPackageFragment) sel;
- IProject proj = frag.getJavaProject().getProject();
- JpaProject jpaProj = this.getJpaProject(proj);
- this.jpaProject = jpaProj;
- }
-
- this.selection = selection;
- this.setWindowTitle(JptUiEntityGenMessages.GenerateEntitiesWizard_generateEntities);
- }
-
- protected JpaProject getJpaProject(IProject project) {
- return (JpaProject) project.getAdapter(JpaProject.class);
- }
-
- @Override
- public void dispose() {
- this.resourceManager.dispose();
- super.dispose();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/JoinColumnsPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/JoinColumnsPage.java
deleted file mode 100644
index 4bde36bf71..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/JoinColumnsPage.java
+++ /dev/null
@@ -1,629 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.TreeMap;
-
-import org.eclipse.core.runtime.Assert;
-import org.eclipse.jface.dialogs.IPageChangedListener;
-import org.eclipse.jface.dialogs.PageChangedEvent;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.ComboBoxCellEditor;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.ICellModifier;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.util.TableLayoutComposite;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.gen.internal.Association;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-
-
-public class JoinColumnsPage extends NewAssociationWizardPage {
-
- private Label joinColumnsDescLabel1;
- /*the table containing the association columns between table1 and table2
- * , or table1 and join table if many to many*/
- private TableViewer joinColumnsTable1;
- private ArrayList<SimpleJoin> tableDataModel1 = new ArrayList<SimpleJoin>();
- private Composite tablesGroup1;
-
- private Label joinColumnsDescLabel2;
- /*the table containing the association columns between join table and table2
- * if many to many*/
- private TableViewer joinColumnsTable2;
- private ArrayList<SimpleJoin> tableDataModel2 = new ArrayList<SimpleJoin>();
- private Composite tablesGroup2;
-
- static final String[] JOINCOLUMNS_TABLE_COLUMN_PROPERTIES = { "referrerColumn", "referencedColumn" };
-
- private static final int JOINCOLUMN1_COLUMN_INDEX = 0;
- private static final int JOINCOLUMN2_COLUMN_INDEX = 1;
-
- protected JoinColumnsPage(ORMGenCustomizer customizer ) {
- super(customizer, "JoinColumnsPage");
- setTitle( JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_colsPage_title);
- setDescription(JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_colsPage_desc);
- }
-
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NONE);
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- composite.setLayout(layout);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.GENERATE_ENTITIES_WIZARD_JOIN_COLUMNS);
-
- tablesGroup1 = new Composite(composite, SWT.SHADOW_ETCHED_IN);
- tablesGroup1.setLayoutData(new GridData());
- tablesGroup1.setLayout(new GridLayout(2, false));
- createJoinColumnsTableControl1(tablesGroup1);
-
- //createMtmJoinColumnsTable2(composite);
-
- setControl(composite);
- this.setPageComplete( false);
-
- ((WizardDialog)getContainer()).addPageChangedListener(new IPageChangedListener(){
- public void pageChanged(PageChangedEvent event) {
- if( event.getSelectedPage() == JoinColumnsPage.this ){
- ((Composite)JoinColumnsPage.this.getControl()).getParent().layout() ;
-
- }
- }
- });
- }
-
- private void createMtmJoinColumnsTable2(Composite composite) {
- tablesGroup2 = new Composite(composite, SWT.SHADOW_ETCHED_IN);
- tablesGroup2.setLayoutData(new GridData());
- tablesGroup2.setLayout(new GridLayout(2, false));
- createJoinColumnsTableControl2(tablesGroup2);
- }
-
- /**
- * Update wizard page UI with new table names
- */
- @Override
- public void updateWithNewTables() {
- String cardinality = this.getCardinality() ;
- if( Association.MANY_TO_MANY.equals( cardinality ) ){
- updateWithMtmTables();
- }else{
- updateWithOtmTables();
- }
- }
-
- /**
- * Update Wizard UI with a single TableViewer with columns from the two associated database tables
- */
- public void updateWithOtmTables() {
- TableColumn[] columns = joinColumnsTable1.getTable().getColumns();
- String table1Name = this.getReferrerTableName() ;
- String table2Name = this.getReferencedTableName() ;
-
- if( table1Name ==null || table2Name == null )
- return;
-
- columns[0].setText( table1Name );
- columns[1].setText( table2Name );
-
- //Hide the Join column table 2
- if( tablesGroup2 !=null )
- tablesGroup2.setVisible(false);
-
- tableDataModel1.clear();
- joinColumnsTable1.refresh();
-
- String msg = String.format(JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_colsPage_label, table1Name, table2Name);
- joinColumnsDescLabel1.setText(msg);
- joinColumnsDescLabel1.setToolTipText( msg );
- tablesGroup1.layout();
-
- String[] referrerColumnValues = getTableColumns(table1Name);
- String[] referencedColumnValues = getTableColumns(table2Name);
-
- updateCellEditors(joinColumnsTable1, referrerColumnValues, referencedColumnValues);
-
-
- ((Composite)this.getControl()).layout() ;
- }
-
- /**
- * Update Wizard UI with a two TableViewers with the first with columns from table1 to the MTM join table
- * and the second one with columns from the MTM join table to table2
- */
- public void updateWithMtmTables() {
- TableColumn[] columns = joinColumnsTable1.getTable().getColumns();
- String table1Name = this.getReferrerTableName() ;
- String table2Name = this.getReferencedTableName() ;
- String joinTableName = this.getJoinTableName() ;
- if( table1Name==null || table2Name==null || joinTableName==null ){
- return;
- }
- if( tablesGroup2 == null ){
- createMtmJoinColumnsTable2( tablesGroup1.getParent());
- }
-
- columns[0].setText( table1Name==null?"":table1Name );
- columns[1].setText( table2Name==null?"":joinTableName );
-
- //Update join column TableViewer 1
- tableDataModel1.clear();
- joinColumnsTable1.refresh();
-
- String msg = String.format(JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_colsPage_label, table1Name, joinTableName);
- joinColumnsDescLabel1.setText(msg);
- joinColumnsDescLabel1.setToolTipText( msg );
- String[] referrerColumnValues = getTableColumns(table1Name);
- String[] referencedColumnValues = getTableColumns(joinTableName);
-
- updateCellEditors(joinColumnsTable1, referrerColumnValues, referencedColumnValues );
-
- //Update join column TableViewer 2
- columns = joinColumnsTable2.getTable().getColumns();
- columns[0].setText( joinTableName==null?"":joinTableName );
- columns[1].setText( table2Name==null?"":table2Name );
- tablesGroup1.layout();
-
- tableDataModel2.clear();
- joinColumnsTable2.refresh();
- msg = String.format(JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_colsPage_label, joinTableName, table2Name);
- joinColumnsDescLabel2.setText(msg);
- joinColumnsDescLabel2.setToolTipText( msg );
- referrerColumnValues = getTableColumns(joinTableName);
- referencedColumnValues = getTableColumns(table2Name);
- updateCellEditors(joinColumnsTable2, referrerColumnValues, referencedColumnValues );
-
- tablesGroup2.layout();
-
- //Show the Join column TableViewer 2
- tablesGroup2.setVisible(true);
-
-
- ((Composite)this.getControl()).layout(new Control[]{this.tablesGroup1, this.tablesGroup2});
- }
-
-
- private void createAddRemoveButtonComposite(Composite tablesGroup, final TableViewer joinColumnsTable, final ArrayList<SimpleJoin> tableDataModel) {
- //Add and Remove JoinColumns buttons
- Composite buttonComposite = new Composite(tablesGroup, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonComposite.setLayout(buttonLayout);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(data);
-
- Button addButton = new Button(buttonComposite, SWT.PUSH);
- addButton.setText( JptUiEntityGenMessages.add );
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- addButton.setLayoutData(gridData);
- addButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- @SuppressWarnings("unchecked")
- public void widgetSelected(SelectionEvent e) {
-
- SimpleJoin join = getDefaultNewJoin(joinColumnsTable);
- tableDataModel.add(join);
- joinColumnsTable.refresh();
-
- //Update Wizard model
- TreeMap<String, String> joins = null;
- if( joinColumnsTable == joinColumnsTable1 ){
- joins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS1 );
- }else{
- joins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS2 );
- }
- joins.put( join.foreignKey, join.primaryKey);
-
- updatePageComplete();
- }
- });
-
- Button removeButton = new Button(buttonComposite, SWT.PUSH);
- removeButton.setText( JptUiEntityGenMessages.remove );
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- removeButton.setLayoutData(gridData);
- removeButton.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- @SuppressWarnings("unchecked")
- public void widgetSelected(SelectionEvent e) {
- StructuredSelection selection = (StructuredSelection)joinColumnsTable.getSelection();
- if( selection.isEmpty())
- return;
- SimpleJoin join = (SimpleJoin)selection.getFirstElement();
-
- //Update TableViewer model
- tableDataModel.remove( join );
- //Update Wizard model
-
- TreeMap<String, String> joins = null;
- if( joinColumnsTable == joinColumnsTable1 ){
- joins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS1 );
- }else{
- joins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS2 );
- }
- joins.remove(join.foreignKey);
-
- joinColumnsTable.refresh();
- }
- });
-
- addButton.setFocus();
-
- }
-
- protected SimpleJoin getDefaultNewJoin(TableViewer joinColumnsTable) {
- String table1Name = "";
- String table2Name = "";
-
- TreeMap<String, String> existingJoins = null;
- if( joinColumnsTable == this.joinColumnsTable1 ){
- existingJoins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS1 );
- if( this.getJoinTableName() == null) {
- table1Name = this.getReferrerTableName();
- table2Name = this.getReferencedTableName() ;
- }else{
- table1Name = this.getReferrerTableName();
- table2Name = this.getJoinTableName() ;
- }
- }else{
- existingJoins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS2 );
- table1Name = this.getJoinTableName();
- table2Name = this.getReferencedTableName() ;
- }
- //find next available column
- String[] table1ColumnValues = getTableColumns(table1Name);
- String nextCol1 = "";
- for( String s: table1ColumnValues ){
- if( !existingJoins.keySet().contains(s)){
- nextCol1 = s;
- break;
- }
- }
-
- String[] table2ColumnValues = getTableColumns(table2Name);
- String nextCol2 = "";
- for( String s: table2ColumnValues ){
- if( !existingJoins.values().contains(s)){
- nextCol2 = s;
- break;
- }
- }
- return new SimpleJoin( nextCol1, nextCol2);
- }
-
- @Override
- public boolean canFlipToNextPage() {
- return isPageComplete();
- }
-
- public void updatePageComplete() {
- boolean ret = tableDataModel1.size()> 0 ;
- setPageComplete( ret );
- }
-
- private Label createLabel(Composite container, int span, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- private void createJoinColumnsTableControl1(Composite tablesGroup) {
- joinColumnsDescLabel1 = createLabel(tablesGroup, 2, JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_colsPage_label );
- joinColumnsTable1 = createJoinColumnsTableControl(tablesGroup, this.tableDataModel1);
- createAddRemoveButtonComposite(tablesGroup, joinColumnsTable1, tableDataModel1);
- }
-
- private void createJoinColumnsTableControl2(Composite tablesGroup) {
- joinColumnsDescLabel2 = createLabel(tablesGroup, 2, JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_colsPage_label );
- joinColumnsTable2 = createJoinColumnsTableControl(tablesGroup, this.tableDataModel2);
- createAddRemoveButtonComposite(tablesGroup, joinColumnsTable2, tableDataModel2);
- }
-
- private TableViewer createJoinColumnsTableControl(Composite parent, ArrayList<SimpleJoin> tableDataModel ){
-
- TableLayoutComposite layout= new TableLayoutComposite(parent, SWT.NONE);
- addColumnLayoutData(layout);
-
- final org.eclipse.swt.widgets.Table table = new org.eclipse.swt.widgets.Table(layout, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER );
- table.setHeaderVisible(true);
- table.setLinesVisible(true);
-
- TableColumn referrerColumn = new TableColumn(table, SWT.NONE, JOINCOLUMN1_COLUMN_INDEX);
- referrerColumn.setText("%table1");
- referrerColumn.setResizable(true);
-
- TableColumn referencedColumn = new TableColumn(table, SWT.NONE, JOINCOLUMN2_COLUMN_INDEX);
- referencedColumn.setText("%table2");
- referencedColumn.setResizable(true);
-
- GridData gd= new GridData(GridData.FILL_BOTH);
- gd.heightHint= SWTUtil.getTableHeightHint(table, 3);
- gd.widthHint = 300;
- layout.setLayoutData(gd);
-
- TableViewer newJoinColumnsTable = new TableViewer(table);
- newJoinColumnsTable.setUseHashlookup(true);
- newJoinColumnsTable.setLabelProvider(this.buildTableTableLabelProvider());
- newJoinColumnsTable.setContentProvider(this.buildTableTableContentProvider());
- newJoinColumnsTable.setSorter(new ViewerSorter() {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- return ((SimpleJoin) e1).foreignKey.compareTo(((SimpleJoin) e2).foreignKey);
- }
- });
-
- newJoinColumnsTable.addPostSelectionChangedListener(new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- //handleTablesListSelectionChanged(event);
- }
- });
- populateTableDataModel();
- newJoinColumnsTable.setInput( tableDataModel );
- return newJoinColumnsTable;
- }
-
- @SuppressWarnings("unchecked")
- public void populateTableDataModel(){
- HashMap<String, Object> dataModel = getWizardDataModel();
- TreeMap<String, String> joinColumns = (TreeMap<String, String>)dataModel.get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS1);
- if( joinColumns!= null ){
- for( String referrerColumn : joinColumns.keySet() ){
- tableDataModel1.add(new SimpleJoin(referrerColumn, joinColumns.get(referrerColumn) ));
- }
- }
-
- TreeMap<String, String> joinColumns2 = (TreeMap<String, String>)dataModel.get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS2);
- if( joinColumns2!= null ){
- for( String referrerColumn : joinColumns2.keySet() ){
- tableDataModel2.add(new SimpleJoin(referrerColumn, joinColumns2.get(referrerColumn) ));
- }
- }
-
- }
-
- private IContentProvider buildTableTableContentProvider() {
- return new JoinColumnsContentProvider();
- }
-
-
- private IBaseLabelProvider buildTableTableLabelProvider() {
- return new JoinColumnsTableLabelProvider();
- }
-
-
- private void addColumnLayoutData(TableLayoutComposite layout) {
- layout.addColumnData(new ColumnWeightData(50, true));
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
-
- private void updateCellEditors(TableViewer joinColumnsTable, String[] referrerColumnValues, String[] referencedColumnValues ){
- joinColumnsTable.setColumnProperties(JOINCOLUMNS_TABLE_COLUMN_PROPERTIES);
- ComboBoxCellEditor[] editors = new ComboBoxCellEditor[JOINCOLUMNS_TABLE_COLUMN_PROPERTIES.length];
-
- editors[JOINCOLUMN1_COLUMN_INDEX]= new ComboBoxCellEditor(joinColumnsTable.getTable(), referrerColumnValues, SWT.SINGLE);
- editors[JOINCOLUMN2_COLUMN_INDEX]= new ComboBoxCellEditor(joinColumnsTable.getTable(), referencedColumnValues, SWT.SINGLE);
-
- joinColumnsTable.setCellEditors(editors);
- joinColumnsTable.setCellModifier(this.buildTableTableCellModifier(joinColumnsTable, referrerColumnValues, referencedColumnValues ));
- }
-
- public String[] getTableColumns(String tableName){
- Schema schema = (Schema)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_SCHEMA);
- Table table = schema.getTableNamed(tableName);
- List<String> list = new ArrayList<String>();
- for (Column column : table.getColumns()) {
- list.add(column.getName());
- }
- String[] ret = new String[list.size()];
- list.toArray(ret);
- return ret;
- }
-
- private ICellModifier buildTableTableCellModifier(TableViewer joinColumnsTable, String[] referrerColumnValues, String[] referencedColumnValues) {
- return new JoinColumnsCellModifier(joinColumnsTable, referrerColumnValues, referencedColumnValues);
- }
-
- /**
- * A ContentProvider translates the SimpleJoin list into a Collection for display
- *
- */
- private class JoinColumnsContentProvider implements IStructuredContentProvider {
-
- JoinColumnsContentProvider() {
- super();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- public void dispose() {}
- public Object[] getElements(Object inputElement) {
- return ((Collection<?>) inputElement).toArray();
- }
- }
-
- /**
- * Simple value object used as model backing the JFace table
- *
- */
- private class SimpleJoin {
- public SimpleJoin(String foreignKey, String primaryKey) {
- this.foreignKey = foreignKey;
- this.primaryKey = primaryKey;
- }
- public String foreignKey;
- public String primaryKey;
-
- @Override
- public String toString(){
- return "["+ this.foreignKey + " = " + this.primaryKey + "]";
- }
- }
-
- /**
- * A CellModifier to update the join columns in the wizard data model
- */
- private class JoinColumnsCellModifier implements ICellModifier {
- private TableViewer joinColumnsTable;
- private String[] referrerColumnValues;
- private String[] referencedColumnValues;
- JoinColumnsCellModifier(TableViewer joinColumnsTable, String[] referrerColumnValues, String[] referencedColumnValues) {
- super();
- this.joinColumnsTable = joinColumnsTable;
- this.referrerColumnValues = referrerColumnValues;
- this.referencedColumnValues = referencedColumnValues;
- }
-
- public boolean canModify(Object element, String property) {
- return true;
- }
-
- @SuppressWarnings("unchecked")
- public Object getValue(Object element, String property) {
-// SimpleJoin join = (SimpleJoin) element;
-// if (property.equals(JOINCOLUMNS_TABLE_COLUMN_PROPERTIES[JOINCOLUMN2_COLUMN_INDEX])) {
-// return join.primaryKey;
-// }
-// return join.foreignKey;
- // returnt the index of the value in the ComboxCellEditor
- ArrayList<SimpleJoin> tableDataModel = (ArrayList<SimpleJoin>) joinColumnsTable.getInput();
- for(int i=0; i< tableDataModel.size(); i ++ ){
- if( tableDataModel.get(i) == element )
- return new Integer(i);
- }
- return new Integer(0);
-
- }
-
- /**
- * element is the selected TableItem
- * value is the selected item index in the comboCellEditor
- */
- @SuppressWarnings("unchecked")
- public void modify(Object element, String property, Object value) {
- if ( ! (element instanceof TableItem)) {
- return;
- }
- Integer index = (Integer)value;
- TableItem item = (TableItem)element;
- boolean unchanged = false;
- SimpleJoin join = (SimpleJoin) item.getData();
- if (property.equals(JOINCOLUMNS_TABLE_COLUMN_PROPERTIES[JOINCOLUMN1_COLUMN_INDEX])) {
- unchanged = join.foreignKey.equals( referrerColumnValues[ index.intValue() ] );
- if (! unchanged) {
-
- //update the wizard datamodel
- TreeMap<String, String> joins = null;
- if( joinColumnsTable == joinColumnsTable1 ){
- joins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS1 );
- }else{
- joins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS2 );
- }
- joins.remove(join.foreignKey);
- joins.put(referrerColumnValues[ index.intValue() ], join.primaryKey);
-
- //Update the TableViewer model
- join.foreignKey = referrerColumnValues[ index.intValue()];
- joinColumnsTable.refresh();
- }
- return;
- }
-
- if (property.equals(JOINCOLUMNS_TABLE_COLUMN_PROPERTIES[JOINCOLUMN2_COLUMN_INDEX])) {
- unchanged = join.primaryKey.equals( referencedColumnValues[ index.intValue()] ) ;
- if (! unchanged) {
- //Update the TableViewer model
- join.primaryKey = referencedColumnValues[ index.intValue()] ;
-
- //Update wizard data model
- TreeMap<String, String> joins = null;
- if( joinColumnsTable == joinColumnsTable1 ){
- joins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS1 );
- }else{
- joins = (TreeMap<String, String>)getWizardDataModel().get(NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS2 );
- }
- joins.put(join.foreignKey, join.primaryKey);
-
- joinColumnsTable.refresh();
- }
- }
-
-
- }
-
- }
-
- /**
- * A table label provider to return the join column names for display
- *
- */
- private final class JoinColumnsTableLabelProvider extends LabelProvider implements ITableLabelProvider {
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
- public String getColumnText(Object element, int columnIndex) {
- if( !(element instanceof SimpleJoin) )
- return null;
- switch (columnIndex) {
- case 0:
- return ((SimpleJoin)element).foreignKey;
- case 1:
- return ((SimpleJoin)element).primaryKey;
- default:
- Assert.isTrue(false);
- return null;
- }
- }
- @Override
- public String getText(Object element) {
- return getColumnText(element, 0); // needed to make the sorter work
- }
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/JptUiEntityGenMessages.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/JptUiEntityGenMessages.java
deleted file mode 100644
index 8ea5c34d94..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/JptUiEntityGenMessages.java
+++ /dev/null
@@ -1,128 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import org.eclipse.osgi.util.NLS;
-
-/**
- * Localized messages used by Dali UI.
- *
- * @version 2.0
- * @since 2.0
- */
-public class JptUiEntityGenMessages {
- private static final String BUNDLE_NAME = "jpt_ui_entity_gen"; //$NON-NLS-1$
- private static final Class<?> BUNDLE_CLASS = JptUiEntityGenMessages.class;
-
- public static String GenerateEntitiesWizard_tableSelectPage_Restore_Defaults;
- public static String GenerateEntitiesWizard_generateEntities;
- public static String GenerateEntitiesWizard_selectJPAProject;
- public static String GenerateEntitiesWizard_selectJPAProject_msg;
- public static String GenerateEntitiesWizard_tableSelectPage_selectTable;
- public static String GenerateEntitiesWizard_tableSelectPage_chooseEntityTable;
- public static String GenerateEntitiesWizard_tableSelectPage_updatePersistenceXml;
- public static String GenerateEntitiesWizard_tableSelectPage_tables;
- public static String GenerateEntitiesWizard_tableSelectPage_tableColumn;
-
- public static String GenerateEntitiesWizard_tableSelectPage_getTables_jobName;
- public static String GenerateEntitiesWizard_tableSelectPage_getTables_taskName;
- public static String GenerateEntitiesWizard_tableSelectPage_getTables_subTaskName;
- public static String GenerateEntitiesWizard_tableSelectPage_statusUpdate_taskName;
-
- //Database connection group
- public static String connection;
- public static String addConnectionLink;
- public static String connectLink;
- public static String schemaInfo;
- public static String schema;
- public static String connectingToDatabase;
-
- //Default table gen properties
- public static String GenerateEntitiesWizard_defaultTablePage_title;
- public static String GenerateEntitiesWizard_defaultTablePage_desc;
- public static String GenerateEntitiesWizard_defaultTablePage_domainJavaClass;
- public static String GenerateEntitiesWizard_defaultTablePage_tableMapping;
- public static String GenerateEntitiesWizard_tablePanel_className;
- public static String GenerateEntitiesWizard_defaultTablePage_fetch;
- public static String GenerateEntitiesWizard_defaultTablePage_collType;
- public static String GenerateEntitiesWizard_defaultTablePage_sequence;
- public static String GenerateEntitiesWizard_defaultTablePage_sequenceNote;
- public static String GenerateEntitiesWizard_defaultTablePage_access;
- public static String GenerateEntitiesWizard_defaultTablePage_keyGen;
- public static String GenerateEntitiesWizard_defaultTablePage_genOptionalAnnotations;
- public static String GenerateEntitiesWizard_defaultTablePage_genOptionalAnnotations_desc;
-
- //Asso figure
- public static String manyToOneDesc;
- public static String oneToOneDesc;
- public static String manyToManyDesc;
- //table association wizard page
- public static String GenerateEntitiesWizard_assocPage_title;
- public static String GenerateEntitiesWizard_assocPage_desc;
- public static String GenerateEntitiesWizard_assocPage_label;
- public static String GenerateEntitiesWizard_assocPage_newAssoc;
- public static String GenerateEntitiesWizard_assocPage_delAssoc;
- public static String GenerateEntitiesWizard_assocEditor_genAssoc;
- public static String GenerateEntitiesWizard_assocEditor_entityRef;
- public static String property;
- public static String cascade;
- public static String GenerateEntitiesWizard_assocEditor_setRef;
- public static String GenerateEntitiesWizard_assocEditor_joinedWhen;
- public static String GenerateEntitiesWizard_assocEditor_tableJoin;
- public static String cardinality;
- public static String selectCascadeDlgTitle;
- //new association wizard
- public static String GenerateEntitiesWizard_newAssoc_title;
- public static String GenerateEntitiesWizard_newAssoc_tablesPage_title;
- public static String GenerateEntitiesWizard_newAssoc_tablesPage_desc;
- public static String GenerateEntitiesWizard_newAssoc_tablesPage_assocKind;
- public static String GenerateEntitiesWizard_newAssoc_tablesPage_simpleAssoc;
- public static String GenerateEntitiesWizard_newAssoc_tablesPage_m2mAssoc;
- public static String GenerateEntitiesWizard_newAssoc_tablesPage_assocTables;
- public static String GenerateEntitiesWizard_newAssoc_tablesPage_table1;
- public static String GenerateEntitiesWizard_newAssoc_tablesPage_table2;
- public static String GenerateEntitiesWizard_newAssoc_tablesPage_intermediateTable;
- public static String GenerateEntitiesWizard_newAssoc_colsPage_title;
- public static String GenerateEntitiesWizard_newAssoc_colsPage_desc;
- public static String GenerateEntitiesWizard_newAssoc_colsPage_label;
- public static String add;
- public static String remove;
- public static String GenerateEntitiesWizard_newAssoc_cardinalityPage_title;
- public static String GenerateEntitiesWizard_newAssoc_cardinalityPage_desc;
- public static String manyToOne;
- public static String oneToMany;
- public static String oneToOne;
- public static String manyToMany;
- //select table dialog
- public static String selectTableDlgTitle;
- public static String selectTableDlgDesc;
- //individual table and column gen properties
- public static String GenerateEntitiesWizard_tablesAndColumnsPage_title;
- public static String GenerateEntitiesWizard_tablesAndColumnsPage_desc;
- public static String GenerateEntitiesWizard_tablesAndColumnsPage_labelTableAndColumns;
- public static String GenerateEntitiesWizard_colPanel_genProp;
- public static String GenerateEntitiesWizard_colPanel_colMapping;
- public static String GenerateEntitiesWizard_colPanel_propName;
- public static String GenerateEntitiesWizard_colPanel_propType;
- public static String GenerateEntitiesWizard_colPanel_mapKind;
- public static String GenerateEntitiesWizard_colPanel_colUpdateable;
- public static String GenerateEntitiesWizard_colPanel_colInsertable;
- public static String GenerateEntitiesWizard_colPanel_beanProp;
- public static String GenerateEntitiesWizard_colPanel_getterScope;
- public static String GenerateEntitiesWizard_colPanel_setterScope;
- static {
- NLS.initializeMessages(BUNDLE_NAME, BUNDLE_CLASS);
- }
-
- private JptUiEntityGenMessages() {
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/NewAssociationWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/NewAssociationWizard.java
deleted file mode 100644
index 667b9d05af..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/NewAssociationWizard.java
+++ /dev/null
@@ -1,199 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.TreeMap;
-
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.gen.internal.Association;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-
-
-public class NewAssociationWizard extends Wizard {
-
- public static String ASSOCIATION_SCHEMA = "ASSOCIATION_SCHEMA"; //$NON-NLS-1$
- public static String ASSOCIATION_REFERRER_TABLE = "ASSOCIATION_REFERRER_TABLE"; //$NON-NLS-1$
- public static String ASSOCIATION_REFERENCED_TABLE = "ASSOCIATION_REFERENCED_TABLE"; //$NON-NLS-1$
- public static String ASSOCIATION_JOIN_COLUMNS1 = "ASSOCIATION_REFERRER_COLUMNS1"; //$NON-NLS-1$
- public static String ASSOCIATION_JOIN_COLUMNS2 = "ASSOCIATION_REFERRER_COLUMNS2"; //used in MTM associations only //$NON-NLS-1$
- public static String ASSOCIATION_JOIN_TABLE = "ASSOCIATION_JOIN_TABLE"; // TreeMap<String, String> //$NON-NLS-1$
- public static String ASSOCIATION_CADINALITY = "ASSOCIATION_CADINALITY"; //$NON-NLS-1$
-
- private JpaProject jpaProject;
- private HashMap<String, Object> associationDataModel = new HashMap<String, Object>();
-
- private ORMGenCustomizer customizer = null;
-
- private AssociationTablesPage associationTablesPage;
- private JoinColumnsPage joinColumnsPage;
- private CardinalityPage cardinalityPage;
-
- protected final ResourceManager resourceManager;
-
- public NewAssociationWizard( JpaProject jpaProject, ORMGenCustomizer customizer, ResourceManager resourceManager) {
- super();
- this.jpaProject = jpaProject;
- this.customizer = customizer;
- this.resourceManager = resourceManager;
- this.setWindowTitle( JptUiEntityGenMessages.GenerateEntitiesWizard_newAssoc_title);
-
- this.associationDataModel.put( NewAssociationWizard.ASSOCIATION_SCHEMA, this.customizer.getSchema());
- this.associationDataModel.put( NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS1, new TreeMap<String, String>());
- this.associationDataModel.put( NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS2, new TreeMap<String, String>());
- }
-
- @Override
- public void addPages() {
- super.addPages();
- this.associationTablesPage = new AssociationTablesPage( customizer, this.resourceManager);
- addPage(this.associationTablesPage);
-
- this.joinColumnsPage = new JoinColumnsPage(customizer);
- addPage(this.joinColumnsPage);
-
- this.cardinalityPage = new CardinalityPage(customizer);
- addPage(this.cardinalityPage);
- }
-
- @Override
- public boolean performFinish() {
- return true;
- }
-
- public ORMGenCustomizer getCustomizer (){
- return customizer;
- }
-
- public JpaProject getJpaProject(){
- return this.jpaProject;
- }
-
-// public Schema getDefaultSchema() {
-// return getJpaProject().getDefaultDbSchema();
-// }
-//
-// private boolean projectDefaultSchemaExists() {
-// return ( this.getDefaultSchema() != null);
-// }
-
- public HashMap<String, Object> getDataModel(){
- return this.associationDataModel;
- }
-
- public void updateTableNames(){
- IWizardPage[] pages = this.getPages();
- for( IWizardPage page : pages){
- ((NewAssociationWizardPage)page).updateWithNewTables();
- }
- }
-
- @SuppressWarnings("unchecked")
- public Association getNewAssociation(){
- String referrerTableName =getReferrerTableName();
- String referencedTableName = getReferencedTableName();
- List<String> referrerColNames = new ArrayList<String>();
- List<String> referencedColNames = new ArrayList<String>();
-
- String cardinality = (String)associationDataModel.get( NewAssociationWizard.ASSOCIATION_CADINALITY );
- if( cardinality.equals(Association.MANY_TO_MANY) ){
- return createManyToManyAssociation();
- }
-
- Object value = associationDataModel.get( NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS1);
- if(value!=null){
- TreeMap<String, String> joinColumns = (TreeMap<String, String>)value;
- for( String pk : joinColumns.keySet()){
- referrerColNames.add(pk);
- referencedColNames.add( joinColumns.get(pk));
- }
- }
-
- /*if one-to-many then convert it to many-to-one to be consistent
- * with the associations computed from the db foreign keys.
- * Don't see at this point how one-to-many would
- * affect the generation.*/
- if( cardinality.equals(Association.ONE_TO_MANY) ){
- cardinality = Association.MANY_TO_ONE;
-
- String temp1 = referrerTableName;
- referrerTableName = referencedTableName;
- referencedTableName = temp1;
-
- List<String> temp2 = referrerColNames;
- referrerColNames = referencedColNames;
- referencedColNames = temp2;
- }
-
- Association association = null;
- association = new Association(this.customizer, referrerTableName, referrerColNames , referencedTableName, referencedColNames);
- association.setCardinality( cardinality );
- association.setCustom(true);
- return association;
- }
-
- @SuppressWarnings("unchecked")
- private Association createManyToManyAssociation() {
- String referrerTableName =getReferrerTableName();
- String joinTable = getJoinTableName();
- String referencedTableName = getReferencedTableName();
-
- List<String> referrerColNames = new ArrayList<String>();
- List<String> referrerJoinColNames = new ArrayList<String>();
- Object value = associationDataModel.get( NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS1);
- if(value!=null){
- TreeMap<String, String> joinColumns = (TreeMap<String, String>)value;
- for( String pk : joinColumns.keySet()){
- referrerColNames.add(pk);
- referrerJoinColNames.add( joinColumns.get(pk));
- }
- }
-
- value = associationDataModel.get( NewAssociationWizard.ASSOCIATION_JOIN_COLUMNS2);
- List<String> referencedColNames = new ArrayList<String>();
- List<String> referencedJoinColNames = new ArrayList<String>();
- if(value!=null){
- TreeMap<String, String> joinColumns = (TreeMap<String, String>)value;
- for( String pk : joinColumns.keySet()){
- referencedJoinColNames.add(pk);
- referencedColNames.add( joinColumns.get(pk));
- }
- }
-
-
- Association association = null;
- association = new Association(this.customizer, referrerTableName, referrerColNames,
- referencedTableName, referencedColNames, joinTable, referrerJoinColNames, referencedJoinColNames);
- return association;
- }
-
- String getReferrerTableName(){
- return (String)associationDataModel.get(NewAssociationWizard.ASSOCIATION_REFERRER_TABLE);
- }
-
- String getReferencedTableName(){
- return (String)associationDataModel.get(NewAssociationWizard.ASSOCIATION_REFERENCED_TABLE);
- }
-
- String getJoinTableName(){
- return (String)associationDataModel.get(NewAssociationWizard.ASSOCIATION_JOIN_TABLE );
- }
-
- String getCardinality(){
- return (String)associationDataModel.get(NewAssociationWizard.ASSOCIATION_CADINALITY );
- }
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/NewAssociationWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/NewAssociationWizardPage.java
deleted file mode 100644
index 8263181770..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/NewAssociationWizardPage.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.HashMap;
-
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-
-public abstract class NewAssociationWizardPage extends WizardPage {
-
- protected ORMGenCustomizer customizer;
-
- public NewAssociationWizardPage(ORMGenCustomizer customizer, String name) {
- super(name);
- this.customizer = customizer ;
- }
-
- protected HashMap<String, Object> getWizardDataModel(){
- return ((NewAssociationWizard)this.getWizard()).getDataModel();
- }
-
- protected String getReferrerTableName(){
- return ((NewAssociationWizard)getWizard()).getReferrerTableName();
- }
-
- protected String getReferencedTableName(){
- return ((NewAssociationWizard)getWizard()).getReferencedTableName();
- }
-
- protected String getJoinTableName(){
- return ((NewAssociationWizard)getWizard()).getJoinTableName();
- }
-
- protected String getCardinality(){
- return ((NewAssociationWizard)getWizard()).getCardinality() ;
- }
-
- public void updateWithNewTables() {
- }
-
- /**
- * Returns the helps system.
- * @return The platform's help system
- */
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/PromptJPAProjectWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/PromptJPAProjectWizardPage.java
deleted file mode 100644
index bbeebf1c9b..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/PromptJPAProjectWizardPage.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.jpa.core.JpaProject;
-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.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-
-public class PromptJPAProjectWizardPage extends WizardPage {
-
- protected static String SELECT_PROJECT_PAGE_NAME = "SelectJPAProject"; //$NON-NLS-1$
- protected Table projTable;
- private TableViewer projTableViewer;
- private static int PROJECT_NAME_COLUMN_INDEX = 0;
- private final String helpContextId;
-
- public PromptJPAProjectWizardPage( final String helpContextId ) {
- super(SELECT_PROJECT_PAGE_NAME);
- setTitle( JptUiEntityGenMessages.GenerateEntitiesWizard_selectJPAProject );
- setMessage( JptUiEntityGenMessages.GenerateEntitiesWizard_selectJPAProject_msg );
- this.helpContextId = helpContextId;
- }
-
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- int nColumns= 1;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- composite.setLayout(layout);
- Label label = new Label( composite, SWT.NONE );
- label.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_selectJPAProject );
-
- projTableViewer = new TableViewer(composite, SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL | SWT.VIRTUAL);
- projTable = projTableViewer.getTable();
- GridData gd = new GridData( SWT.FILL, SWT.FILL, true, true );
- projTable.setLayoutData(gd);
-
- projTable.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- handleJpaProjectSelection();
- }
-
- @Override
- public void widgetDefaultSelected(SelectionEvent e) {
- widgetSelected(e);
- }
-
- });
-
- projTableViewer = new TableViewer(projTable);
- projTableViewer.setLabelProvider(new ProjectTableLabelProvider());
- projTableViewer.setContentProvider(new ProjectTableContentProvider());
- fillJpaProjectList();
- setControl( composite );
- validate();
- }
-
- protected void handleJpaProjectSelection() {
- if (projTable.getSelectionIndex() != -1) {
- TableItem item = projTable.getItem(projTable.getSelectionIndex());
- String projName = item.getText(0);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projName);
- JpaProject jpaProj = this.getJpaProject( project );
- ((GenerateEntitiesFromSchemaWizard)getWizard()).setJpaProject(jpaProj);
- validate();
- }
- }
-
- private void fillJpaProjectList() {
- IProject[] projects = ResourcesPlugin.getWorkspace().getRoot().getProjects();
- List<String> projNames = new ArrayList<String>();
- for ( IProject project : projects )
- {
- JpaProject jpaProj = this.getJpaProject( project );
- if ( jpaProj != null ) {
- projNames.add(project.getName());
- }
- }
- projTableViewer.setInput(projNames);
- }
-
- private JpaProject getJpaProject(IProject project) {
- return (JpaProject) project.getAdapter(JpaProject.class);
- }
-
- protected void validate() {
- if (projTable.getSelectionIndex() != -1)
- setPageComplete(true);
- else
- setPageComplete(false);
- }
-
- @Override
- public final void performHelp()
- {
- PlatformUI.getWorkbench().getHelpSystem().displayHelp( this.helpContextId );
- }
-
- // inner classes
- private final class ProjectTableLabelProvider extends LabelProvider implements ITableLabelProvider {
- public Image getColumnImage(Object element, int columnIndex)
- {
- if (columnIndex == PROJECT_NAME_COLUMN_INDEX)
- return PlatformUI.getWorkbench().getSharedImages().getImage(org.eclipse.ui.ide.IDE.SharedImages.IMG_OBJ_PROJECT);
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex)
- {
- assert element instanceof String;
- String projectName = (String)element;
- if (columnIndex == PROJECT_NAME_COLUMN_INDEX)
- return projectName;
- return null;
- }
- }
-
- private final class ProjectTableContentProvider implements IStructuredContentProvider
- {
- public Object[] getElements(Object inputElement){
- return ((Collection<?>) inputElement).toArray();
- }
-
- public void dispose(){}
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput){}
-
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/SWTUtil.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/SWTUtil.java
deleted file mode 100644
index c295097241..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/SWTUtil.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * Collection of utility methods to create SWT UI
- *
- */
-public class SWTUtil {
- /**
- * Set the layoutData of the input control to occupy specified number of columns
- * @param c
- * @param columns
- */
- public static void fillColumns(Control c, int columns){
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = columns;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = false;
- c.setLayoutData(layoutData);
- return ;
- }
-
- public static void fillColumnsWithIndent(Control c, int columns, int indent){
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = columns;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = false;
- layoutData.horizontalIndent = indent ;
- c.setLayoutData(layoutData);
- return ;
- }
-
- public static Label createLabel(Composite container, int span, String text) {
- Label label = new Label(container, SWT.NONE);
- label.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- label.setLayoutData(gd);
- return label;
- }
-
- /**
- * Create a new label which occupies one grid column
- * @param parent
- * @param text
- */
- public static Label newLabel(Composite parent, String text) {
- Label label = new Label( parent, SWT.NONE);
- label.setText( text );
- label.setLayoutData(new GridData());
- return label;
- }
-
- /**
- * Create a new label which occupies one grid column
- * @param parent
- * @param text
- */
- public static Label newLabelWithIndent(Composite parent, String text, int indent) {
- Label label = new Label( parent, SWT.NONE);
- label.setText( text );
- GridData layoutData = new GridData();
- layoutData.horizontalAlignment = SWT.BEGINNING;
- layoutData.verticalAlignment = SWT.TOP ;
- layoutData.horizontalIndent = indent ;
- label.setLayoutData(layoutData);
- return label;
- }
-
- /**
- * Creates a separator line. Expects a <code>GridLayout</code> with at least 1 column.
- *
- * @param composite the parent composite
- * @param nColumns number of columns to span
- */
- @SuppressWarnings("restriction")
- public static void createSeparator(Composite composite, int nColumns) {
- (new org.eclipse.jdt.internal.ui.wizards.dialogfields.Separator(
- SWT.SEPARATOR | SWT.HORIZONTAL)).doFillIntoGrid(composite, nColumns, 5);
- }
-
-
- public static Button createButton(Composite container, int span, String text, int style) {
- Button btn = new Button(container, style);
- btn.setText(text);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- btn.setLayoutData(gd);
- return btn;
- }
-
- public static Combo createCombo(Composite container, int span ) {
- Combo combo = new Combo(container, SWT.SINGLE | SWT.READ_ONLY);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- gd.grabExcessHorizontalSpace=true;
- gd.horizontalAlignment = SWT.FILL;
- combo.setLayoutData(gd);
- return combo;
- }
-
- public static Text createText(Composite container, int span ) {
- Text text = new Text(container, SWT.BORDER);
- GridData gd = new GridData();
- gd.horizontalSpan = span;
- gd.grabExcessHorizontalSpace=true;
- gd.horizontalAlignment = SWT.FILL;
- text.setLayoutData(gd);
- return text;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/SelectTableDialog.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/SelectTableDialog.java
deleted file mode 100644
index f9b9ee0d97..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/SelectTableDialog.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.jface.viewers.ILabelProviderListener;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.ui.internal.ImageRepository;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.dialogs.ElementListSelectionDialog;
-
-/**
- * A database table selection dialog which allows user to filter tables by name
- */
-public class SelectTableDialog extends ElementListSelectionDialog {
-
- public SelectTableDialog(Shell shell, final ResourceManager resourceManager){
- super(shell, new ILabelProvider(){
- public Image getImage(Object element) {
- return ImageRepository.getTableImage(resourceManager);
- }
-
- public String getText(Object element) {
- return element.toString();
- }
- public void addListener(ILabelProviderListener listener) {}
- public void dispose() {}
-
- public boolean isLabelProperty(Object element, String property) {
- return false;
- }
-
- public void removeListener(ILabelProviderListener listener) {}
-
- });
- this.setTitle( JptUiEntityGenMessages.selectTableDlgTitle );//
- this.setMessage( JptUiEntityGenMessages.selectTableDlgDesc);//
- }
-
- public SelectTableDialog(Shell shell, ResourceManager resourceManager, Schema schema){
- this(shell, resourceManager);
-
- ArrayList<String> list = new ArrayList<String>();
- for (Table table : schema.getTables()) {
- list.add(table.getName());
- }
- this.setElements( list.toArray() );
-
- }
-
- public SelectTableDialog(Shell shell, ResourceManager resourceManager, List<String> tableNames){
- this(shell, resourceManager);
- this.setElements( tableNames.toArray() );
- }
-
- public String getSelectedTable() {
- String tableName = (String)this.getFirstResult();
- return tableName ;
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableAssociationsWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableAssociationsWizardPage.java
deleted file mode 100644
index 0fae1b1a73..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableAssociationsWizardPage.java
+++ /dev/null
@@ -1,775 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-
-import static org.eclipse.jpt.jpa.ui.internal.wizards.gen.SWTUtil.fillColumns;
-import static org.eclipse.jpt.jpa.ui.internal.wizards.gen.SWTUtil.newLabel;
-import static org.eclipse.jpt.jpa.ui.internal.wizards.gen.SWTUtil.newLabelWithIndent;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jdt.internal.ui.dialogs.StatusUtil;
-import org.eclipse.jdt.internal.ui.wizards.dialogfields.DialogField;
-import org.eclipse.jdt.internal.ui.wizards.dialogfields.IStringButtonAdapter;
-import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
-import org.eclipse.jdt.internal.ui.wizards.dialogfields.StringButtonDialogField;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.gen.internal.Association;
-import org.eclipse.jpt.jpa.gen.internal.AssociationRole;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenColumn;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.jpt.jpa.ui.internal.ImageRepository;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.FillLayout;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-public class TableAssociationsWizardPage extends WizardPage {
-
- private JpaProject jpaProject;
- private ORMGenCustomizer customizer ;
-
- private AssociationsListComposite associationList;
- private Association selectedAssociation;
- private Button deleteAssociationLink ;
- private Button createAssociationLink ;
-
- //Controls in Association Edit Panel
- private Composite associationsEditPanel ;
- private Button generateAssociationCheckBox;
- private Label cardinalityLabel ;
- private Combo cardinalityCombo ;
- /*whether to generate the referrer-->referenced role.*/
- private Button referrerRoleCheckBox;
- /*the name of the property in the referrer-->referenced role.*/
- private Label referrerRolePropertyLabel;
- private Text referrerRolePropertyField ;
- /*the cascade in the referrer-->referenced role.*/
- @SuppressWarnings("restriction")
- private StringButtonDialogField referrerRoleCascadeField;
- /*whether to generate the referenced->referrer role.*/
- private Button referencedRoleCheckBox;
- /*the name of the property in the referenced->referrer role.*/
- private Label referencedRolePropertyLabel;
- private Text referencedRolePropertyField ;
- /*the cascade in the referenced->referrer role.*/
- @SuppressWarnings("restriction")
- private StringButtonDialogField referencedRoleCascadeField;
- private Label joinConditionLabel;
- private Text joinConditionText;
-
- private Composite detailPanel;
- private StackLayout detailPanelStatckLayout;
- private Composite emptyPanel;
-
- protected final ResourceManager resourceManager;
-
- public TableAssociationsWizardPage(JpaProject jpaProject, ResourceManager resourceManager) {
- super("Table Associations"); //$NON-NLS-1$
- this.jpaProject = jpaProject;
- this.resourceManager = resourceManager;
- setTitle(JptUiEntityGenMessages.GenerateEntitiesWizard_assocPage_title);
- setMessage(JptUiEntityGenMessages.GenerateEntitiesWizard_assocPage_desc);
-
- }
-
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
-
- Composite composite = new Composite(parent, SWT.NULL);
- int nColumns= 2 ;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- composite.setLayout(layout);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.GENERATE_ENTITIES_WIZARD_TABLE_ASSOCIATIONS);
-
- Label label = new Label(composite, SWT.NONE);
- label.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_assocPage_label );
- GridData gd = new GridData();
- gd.horizontalSpan = 2;
- label.setLayoutData( gd );
-
- createAssociationsListPanel(composite);
- createAddDeleteButtons(composite, nColumns);
- SWTUtil.createSeparator(composite, nColumns);
-
- createDetailPanel(composite);
- setControl(composite);
-
- composite.layout(true);
- this.setPageComplete( true);
-
- }
-
- private void createAddDeleteButtons(Composite composite, int columns) {
-
- Composite c = new Composite( composite, SWT.NONE);
- fillColumns(c, 1);
- c.setLayout( new GridLayout(1,true) );
-
- createAssociationLink = new Button(c, SWT.NONE);
- createAssociationLink.setToolTipText( JptUiEntityGenMessages.GenerateEntitiesWizard_assocPage_newAssoc );
- createAssociationLink.setImage( ImageRepository.getAddButtonImage(this.resourceManager) );
- createAssociationLink.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- launchNewAssociationsWizard();
- }
-
- });
-
- deleteAssociationLink = new Button(c, SWT.NONE);
- Color foreground = new Color(Display.getDefault(), 0,0,255);
- deleteAssociationLink.setForeground(foreground);
- foreground.dispose();
- deleteAssociationLink.setImage( ImageRepository.getDeleteButtonImage(this.resourceManager));
- deleteAssociationLink.setToolTipText( JptUiEntityGenMessages.GenerateEntitiesWizard_assocPage_delAssoc );
- deleteAssociationLink.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- Association association = associationList.getSelectedAssociation();
- if( association != null ){
- ORMGenCustomizer customizer = getCustomizer();
- customizer.deleteAssociation(association);
- List<Association> associations = customizer.getAssociations();
- associationList.updateAssociations(associations);
- if( associations.size()==0 ){
- hideAssociationDetail();
- }
- }
- }
- });
- deleteAssociationLink.setEnabled(false);
-
- }
-
- private void createGenerateAssociationCheckbox(Composite composite, int columns) {
- generateAssociationCheckBox = new Button(composite, SWT.CHECK);
- generateAssociationCheckBox.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_genAssoc);
- generateAssociationCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- Association association = associationList.getSelectedAssociation();
- if( association == null )
- return;
- association.setGenerated(generateAssociationCheckBox.getSelection());
-
- updateAssociationEditPanel(association);
- associationList.updateSelectedAssociation();
- }
-
- });
-
- fillColumns(generateAssociationCheckBox, columns-1);
- newLabel(composite, "");
- }
-
- @SuppressWarnings("restriction")
- private void createGenerateReferrerRoleControls(Composite parent, int columns) {
- referrerRoleCheckBox = new Button(parent, SWT.CHECK);
- referrerRoleCheckBox.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_entityRef );
- referrerRoleCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- boolean generate = referrerRoleCheckBox.getSelection();
- //referrerRolePropertyField.setEditable( generate );
- referrerRolePropertyLabel.setEnabled( generate );
- referrerRolePropertyField.setEnabled( generate );
- referrerRoleCascadeField.setEnabled(generate);
-
- //If both referencedRoleCheckBox and referencedRoleCheckBox unchecked,
- //the association itself shouldn't be generated
- if( !generate && !referencedRoleCheckBox.getSelection()){
- generateAssociationCheckBox.setSelection(false);
- cardinalityLabel.setEnabled( false );
- cardinalityCombo.setEnabled(false);
- referrerRoleCheckBox.setEnabled(false);
- referencedRoleCheckBox.setEnabled(false);
- }
-
- directionalityCheckBoxChanged( );
-
- if( generate ){
- AssociationRole role = selectedAssociation.getReferrerRole();
- referrerRolePropertyField.setText( role.getPropertyName() );
- }
- }
-
- });
-
- SWTUtil.fillColumnsWithIndent(referrerRoleCheckBox , columns-1, 20 );
- newLabel(parent, "");//$NON-NLS-1$
-
- referrerRolePropertyLabel = newLabelWithIndent( parent, JptUiEntityGenMessages.property, 40 );
- referrerRolePropertyField = new Text( parent, SWT.BORDER);
- fillColumns(referrerRolePropertyField, 2);
- referrerRolePropertyField.addModifyListener(new ModifyListener(){
- @SuppressWarnings("deprecation")
- public void modifyText(ModifyEvent e) {
- if( selectedAssociation.getReferrerRole() == null )
- return;
- String fieldName = referrerRolePropertyField.getText();
- IStatus status = JavaConventions.validateFieldName( fieldName );
- if( !status.matches(IStatus.ERROR) ){
- selectedAssociation.getReferrerRole().setPropertyName(fieldName);
- }
- updateStatus(status);
- }
- });
-
- Label label = new Label( parent, SWT.NONE);
- label.setText( "" );//$NON-NLS-1$
- label.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL));
-
- referrerRoleCascadeField = new StringButtonDialogField( new IStringButtonAdapter(){
- public void changeControlPressed(DialogField field) {
- if( editCascade( selectedAssociation.getReferrerRole() )){
- referrerRoleCascadeField.setText(selectedAssociation.getReferrerRole().getCascade());
- }
- }
- }) ;
- referrerRoleCascadeField.setLabelText( JptUiEntityGenMessages.cascade );
- referrerRoleCascadeField.setButtonLabel(""); //$NON-NLS-1$
- referrerRoleCascadeField.doFillIntoGrid(parent, 3);
- referrerRoleCascadeField.getTextControl(parent).setEditable(false);
- int maxFieldWidth = convertWidthInCharsToPixels(40);
- LayoutUtil.setWidthHint(referrerRoleCascadeField.getTextControl(null), maxFieldWidth );
- Button btn = referrerRoleCascadeField.getChangeControl(null);
- GridData data = (GridData)btn.getLayoutData();
- btn.setImage( ImageRepository.getBrowseButtonImage(this.resourceManager) );
- data.horizontalAlignment = SWT.BEGINNING;
- data.widthHint = 30;
- btn.setLayoutData(data);
-
- Label labelCtrl = referrerRoleCascadeField.getLabelControl(parent);
- data = (GridData)labelCtrl.getLayoutData();
- data.horizontalIndent = 40 ;
- labelCtrl.setLayoutData(data);
-
-
- label = new Label( parent, SWT.NONE);
- label.setText( "" );//$NON-NLS-1$
- label.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL));
-
- }
-
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if( visible ){
- hideAssociationDetail();
- updateAssociationsListPanel();
- }
- }
-
- private void hideAssociationDetail( ){
- this.detailPanelStatckLayout.topControl = emptyPanel;
- this.detailPanel.layout();
- this.detailPanel.getParent().layout();
- }
-
- /**
- * Updates the status line and the OK button according to the given status
- *
- * @param status status to apply
- */
- @SuppressWarnings("restriction")
- protected void updateStatus(IStatus status) {
- setPageComplete(!status.matches(IStatus.ERROR));
-
- StatusUtil.applyToStatusLine(this, status);
- if( status.getCode() == Status.OK ){
- setMessage(JptUiEntityGenMessages.GenerateEntitiesWizard_assocPage_desc);
- }
- }
-
- @SuppressWarnings("restriction")
- private void createGenerateReferencedRoleControls(Composite parent, int columns) {
- referencedRoleCheckBox = new Button(parent, SWT.CHECK);
- referencedRoleCheckBox.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_setRef );
- referencedRoleCheckBox.addSelectionListener(new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- boolean generate = referencedRoleCheckBox.getSelection();
- referencedRolePropertyLabel.setEnabled( generate);
- referencedRolePropertyField.setEnabled( generate);
- referencedRoleCascadeField.setEnabled(generate);
-
- if( !generate && !referrerRoleCheckBox.getSelection()){
- generateAssociationCheckBox.setSelection(false);
- cardinalityCombo.setEnabled(false);
- referrerRoleCheckBox.setEnabled(false);
- referencedRoleCheckBox.setEnabled(false);
- }
- directionalityCheckBoxChanged();
- if( generate ){
- AssociationRole role = selectedAssociation.getReferencedRole();
- referencedRolePropertyField.setText( role.getPropertyName() );
- }
- }
-
- });
-
- SWTUtil.fillColumnsWithIndent( referencedRoleCheckBox , columns-1, 20 );
- newLabel(parent, "");//$NON-NLS-1$
-
- referencedRolePropertyLabel = SWTUtil.newLabelWithIndent(parent, JptUiEntityGenMessages.property, 40 );
-
- referencedRolePropertyField = new Text( parent, SWT.BORDER);
- fillColumns(referencedRolePropertyField, 2);
- referencedRolePropertyField.addModifyListener(new ModifyListener(){
- public void modifyText(ModifyEvent e) {
- if( selectedAssociation.getReferencedRole() == null )
- return ;
-
- String fieldName = referencedRolePropertyField.getText();
- IStatus status = JavaConventions.validateIdentifier(fieldName,
- JavaCore.VERSION_1_3, JavaCore.VERSION_1_3);
- if( !status.matches(IStatus.ERROR) ){
- if( !fieldName.equals(selectedAssociation.getReferencedRole().getPropertyName()) )
- selectedAssociation.getReferencedRole().setPropertyName(fieldName);
- }
- updateStatus(status);
- }
- });
-
-
- Label label = new Label( parent, SWT.NONE);
- label.setText( "" );//$NON-NLS-1$
- label.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL));
-
-
- referencedRoleCascadeField = new StringButtonDialogField( new IStringButtonAdapter(){
- public void changeControlPressed(DialogField field) {
- if( editCascade( selectedAssociation.getReferencedRole() ) ){
- referencedRoleCascadeField.setText( selectedAssociation.getReferencedRole().getCascade() );
- }
- }
- }) ;
- referencedRoleCascadeField.setLabelText( JptUiEntityGenMessages.cascade );
- referencedRoleCascadeField.setButtonLabel(""); //$NON-NLS-1$
- referencedRoleCascadeField.doFillIntoGrid(parent, 3);
- referencedRoleCascadeField.getTextControl(parent).setEditable( false);
- int maxFieldWidth = convertWidthInCharsToPixels(40);
- LayoutUtil.setWidthHint(referencedRoleCascadeField.getTextControl(null), maxFieldWidth );
- Button btn = referencedRoleCascadeField.getChangeControl(null);
- btn.setImage( ImageRepository.getBrowseButtonImage(this.resourceManager) );
- GridData data = (GridData)btn.getLayoutData();
- data.horizontalAlignment = SWT.BEGINNING;
- data.widthHint = 30;
- btn.setLayoutData(data);
-
- Label labelCtrl = referencedRoleCascadeField.getLabelControl(parent);
- data = (GridData)labelCtrl.getLayoutData();
- data.horizontalIndent = 40 ;
- labelCtrl.setLayoutData(data);
-
- label = new Label( parent, SWT.NONE);
- label.setText( "" );//$NON-NLS-1$
- label.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL));
-
- }
-
- private void createDetailPanel(Composite composite ) {
-
- this.detailPanel = new Composite( composite, SWT.NONE);
- GridData gd = new GridData(GridData.FILL_HORIZONTAL);
- gd.grabExcessVerticalSpace = false;
- this.detailPanel.setLayoutData(gd);
- this.detailPanelStatckLayout = new StackLayout();
- this.detailPanel.setLayout( this.detailPanelStatckLayout );
-
- emptyPanel = new Composite( detailPanel, SWT.NONE);
- emptyPanel.setLayoutData(new GridData());
- detailPanelStatckLayout.topControl = emptyPanel;
- detailPanel.layout();
-
- composite.layout();
- }
-
-
- private Composite createAssociationsEditPanel(Composite composite, int columns) {
- Composite parent = new Composite( composite, SWT.NONE);
- fillColumns(parent, 4);
-
- createGenerateAssociationCheckbox(parent,columns);
- int nColumns= 4 ;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- parent.setLayout(layout);
-
- //Cardinality
- cardinalityLabel = new Label(parent, SWT.NONE);
- cardinalityLabel.setText( JptUiEntityGenMessages.cardinality);
- GridData gd = new GridData();
- gd.horizontalIndent = 20;
- cardinalityLabel.setLayoutData( gd );
-
- cardinalityCombo = new Combo(parent, SWT.SINGLE | SWT.READ_ONLY );
-
- fillColumns(cardinalityCombo, 1);
-
- cardinalityCombo.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- selectedAssociation.setCardinality( cardinalityCombo.getText());
- associationList.updateSelectedAssociation();
- }
- });
-
- //Adding a filler column
- Label label = new Label( parent, SWT.NONE);
- label.setText( "");//$NON-NLS-1$
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = 2;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- label.setLayoutData(layoutData);
-
- //Table join condition
- joinConditionLabel = newLabelWithIndent(parent, JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_tableJoin, 20 );
-
- joinConditionText = new Text( parent, SWT.MULTI | SWT.BORDER );
- joinConditionText.setEditable(false);
- joinConditionText.setText(JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_joinedWhen);
- layoutData = new GridData();
- layoutData.horizontalSpan = 2;
- layoutData.verticalAlignment = SWT.TOP;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = false;
- layoutData.heightHint = 50;
- joinConditionText.setLayoutData(layoutData);
- newLabel(parent, "");//$NON-NLS-1$
-
- //Generate UI controls for ReferrerRole
- createGenerateReferrerRoleControls(parent, columns);
-
- //Generate UI controls for ReferencedRole
- createGenerateReferencedRoleControls(parent, columns);
-
-
- return parent;
- }
-
- public boolean editCascade(AssociationRole role) {
- CascadeDialog dlg = CascadeDialog.create(role);
- if (dlg.open() == Window.CANCEL ) {
- return false;
- }
-
- return true;
- }
-
- private void createAssociationsListPanel(Composite parent) {
- Composite composite = new Composite( parent, SWT.NULL );
- composite.setLayout( new FillLayout());
- Color backgroundColor = new Color(Display.getDefault(),255, 0,0);
- composite.setBackground(backgroundColor);
- backgroundColor.dispose();
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = 1;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = false;
- layoutData.grabExcessVerticalSpace = true;
- layoutData.widthHint = 400;
- layoutData.heightHint = 400;
- composite.setLayoutData(layoutData);
-
- associationList = new AssociationsListComposite(composite, this, this.resourceManager);
- }
-
- private void launchNewAssociationsWizard() {
- ORMGenCustomizer customizer = getCustomizer();
- NewAssociationWizard wizard = new NewAssociationWizard(this.jpaProject, customizer, this.resourceManager);
-
- WizardDialog dialog = new WizardDialog( this.getShell(), wizard);
- dialog.create();
- int returnCode = dialog.open();
- if (returnCode == Window.OK) {
- Association association = wizard.getNewAssociation();
- if( association !=null ){
- customizer.addAssociation(association);
- updateForeignKeyColumnGenProperty(association);
- updateAssociationsListPanel();
- }
- }
- }
- /**
- * For user created association:
- * If association is to be generated, no need to generate the getter/setter for the column itself
- */
- private void updateForeignKeyColumnGenProperty(Association association) {
- //Need to process MANY_TO_ONE only since the the associations list are optimized to have MANY_TO_ONE
- if( association.isCustom() && association.getCardinality().equals( Association.MANY_TO_ONE ) ){
- boolean generateColumn = !association.isGenerated();
- //The "MANY" side DB table
- //ORMGenTable table1 = association.getReferrerTable();
- //The "ONE" side DB table
- //ORMGenTable table2 = association.getReferencedTable();
- //The list of foreign key columns in the MANY side, should not be generated
- //The list of primary keys in the ONE side, will be generated
- //List<ORMGenColumn> list2 = association.getReferencedColumns();
- List<ORMGenColumn> list1 = association.getReferrerColumns();
- for(ORMGenColumn c : list1 ){
- if( c.isGenerated() != generateColumn){
- if( !generateColumn && c.getDbColumn().isPartOfPrimaryKey() ){
- continue;
- }
- c.setGenerated(generateColumn);
- c.setInsertable(generateColumn);
- c.setUpdateable(generateColumn);
- }
- }
- }
- }
-
- private void updateAssociationsListPanel() {
- ORMGenCustomizer customizer = getCustomizer();
- //If user changed the connection or schema
- if( this.customizer != customizer ){
- this.customizer = customizer;
- }
- List<Association> associations = customizer.getAssociations();
- this.associationList.updateAssociations( associations );
- }
-
- @SuppressWarnings("restriction")
- public void updateAssociationEditPanel(Association association) {
- this.selectedAssociation = association;
-
- boolean enabled = association.isCustom();
- this.deleteAssociationLink.setEnabled(enabled);
-
- //Create and display the associationsEditPanel if it was hidden before
- if( associationsEditPanel == null ){
- associationsEditPanel = this.createAssociationsEditPanel(this.detailPanel, 4);
- }
- this.detailPanelStatckLayout.topControl = associationsEditPanel;
- this.detailPanel.layout();
- this.detailPanel.getParent().layout();
-
- //Update the UI controls from the model
- String table1Name = association.getReferrerTableName();
- String table2Name = association.getReferencedTableName();
- String joinTableName = association.getJoinTableName();
-
- boolean isGenerated = association.isGenerated();
- this.generateAssociationCheckBox.setSelection(isGenerated);
- this.referrerRolePropertyLabel.setEnabled( isGenerated );
- this.referrerRolePropertyField.setEnabled( isGenerated );
- this.referrerRoleCheckBox.setEnabled( isGenerated );
- this.referencedRolePropertyLabel.setEnabled( isGenerated );
- this.referencedRolePropertyField.setEnabled( isGenerated );
- this.referencedRoleCheckBox.setEnabled( isGenerated );
- this.cardinalityLabel.setEnabled(isGenerated);
- this.cardinalityCombo.setEnabled(isGenerated);
- this.joinConditionLabel.setEnabled( isGenerated );
- this.joinConditionText.setEnabled( isGenerated );
-
- String cardinality = association.getCardinality();
- if( Association.MANY_TO_MANY.equals( cardinality ) ){
- cardinalityCombo.removeAll();
- cardinalityCombo.add( Association.MANY_TO_MANY);
- }else{
- cardinalityCombo.removeAll();
- cardinalityCombo.add( Association.MANY_TO_ONE);
- cardinalityCombo.add( Association.ONE_TO_ONE);
- }
-
- cardinalityCombo.setText(cardinality);
- cardinalityCombo.setEnabled(enabled);
-
- String text = null;
- //if MTM
- if( Association.MANY_TO_MANY.equals( cardinality ) ){
- text = String.format( JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_setRef, table2Name, table1Name);
- }else{
- text = String.format( JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_entityRef, table2Name, table1Name);
- }
- this.referrerRoleCheckBox.setText(text);
-
- //if OTO
- if( Association.ONE_TO_ONE.equals( cardinality ) ){
- text = String.format( JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_entityRef, table1Name, table2Name);
- }else{
- text = String.format( JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_setRef, table1Name, table2Name);
- }
- this.referencedRoleCheckBox.setText(text);
-
- //AssociationRole properties
- AssociationRole referrerRole = association.getReferrerRole();
- if( referrerRole != null){
- this.referrerRoleCheckBox.setSelection( true );
- this.referrerRolePropertyField.setEditable(true);
- this.referrerRolePropertyField.setText(referrerRole.getPropertyName());
- this.referrerRoleCascadeField.setEnabled(true);
- String cascade = referrerRole.getCascade();
- if( cascade!=null )
- this.referrerRoleCascadeField.setText( cascade );
-
- //if MTO:
- if( Association.MANY_TO_ONE.equals( cardinality ) ){
- this.referrerRoleCheckBox.setEnabled( false );
- }
- }else{
- this.referrerRoleCheckBox.setSelection( false );
- this.referrerRolePropertyLabel.setEnabled(false);
- this.referrerRolePropertyField.setEditable(false);
- this.referrerRolePropertyField.setText("");
- this.referrerRoleCascadeField.setEnabled(false);
- }
-
- AssociationRole referencedRole = association.getReferencedRole();
- if( referencedRole != null){
- this.referencedRoleCheckBox.setSelection( true );
- this.referencedRolePropertyLabel.setEnabled(true);
- this.referencedRolePropertyField.setEditable(true);
- this.referencedRolePropertyField.setText(referencedRole.getPropertyName());
- this.referencedRoleCascadeField.setEnabled(true);
- String cascade = referencedRole.getCascade();
- if( cascade!=null )
- this.referencedRoleCascadeField.setText(cascade);
- }else{
- this.referencedRoleCheckBox.setSelection( false );
- this.referencedRolePropertyLabel.setEnabled(false);
- this.referencedRolePropertyField.setEditable(false);
- this.referencedRolePropertyField.setText("");
- this.referencedRoleCascadeField.setEnabled(false);
- }
-
- //Join conditions
- updateJoinConditions(association, table1Name, table2Name, joinTableName);
- }
-
- private void updateJoinConditions(Association association,
- String table1Name, String table2Name, String joinTableName) {
- String text = "%s";
- if( joinTableName == null ){
- StringBuilder strText = new StringBuilder();
- //text = JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_joinedWhen;
- List<String> columnList1 = association.getReferrerColumnNames() ;
- List<String> columnList2 = association.getReferencedColumnNames();
- for( int i=0; i < columnList1.size(); i++){
- strText.append( table1Name + "." + columnList1.get(i) );//$NON-NLS-1$
- strText.append( "=" );//$NON-NLS-1$
- strText.append( table2Name + "." + columnList2.get(i) );//$NON-NLS-1$
- if( i < columnList1.size()-1 )
- strText.append( "\n AND " );//$NON-NLS-1$
- }
- joinConditionText.setText( String.format( text , strText.toString()) );
- }else{
- StringBuilder strText = new StringBuilder();
- //text = JptUiEntityGenMessages.GenerateEntitiesWizard_assocEditor_joinedWhen;
- List<String> columnList1 = association.getReferrerColumnNames() ;
- List<String> joinColumnList1 = association.getReferrerJoinColumnNames() ;
- for( int i=0; i < columnList1.size(); i++){
- strText.append( table1Name + "." + columnList1.get(i) );//$NON-NLS-1$
- strText.append( "=" );//$NON-NLS-1$
- strText.append( joinTableName + "." + joinColumnList1.get(i) );
- strText.append( "\n AND " );//$NON-NLS-1$
- }
-
- List<String> joinTableColumnList2 = association.getReferencedJoinColumnNames();
- List<String> columnList2 = association.getReferencedColumnNames();
- for( int i=0; i < joinTableColumnList2.size(); i++){
- strText.append( joinTableName + "." + joinTableColumnList2.get(i) );
- strText.append( "=" );//$NON-NLS-1$
- strText.append( table2Name + "." + columnList2.get(i) );//$NON-NLS-1$
- if( i < joinTableColumnList2.size()-1 )
- strText.append( "\n AND " );//$NON-NLS-1$
- }
-
- joinConditionText.setText( String.format( text , strText.toString()) );
-
- }
- }
-
- /**
- * Called when one of referrerRoleCheckBox or referencedRoleCheckBox
- * changes value.
- *
- */
- private void directionalityCheckBoxChanged() {
- String dir;
- if (referrerRoleCheckBox.getSelection()) {
- dir = referencedRoleCheckBox.getSelection() ? Association.BI_DI : Association.NORMAL_DI;
- } else {
- if (referencedRoleCheckBox.getSelection()) {
- dir = Association.OPPOSITE_DI;
- } else {
- dir = null;
- }
- }
- if (dir != null) {
- selectedAssociation.setDirectionality(dir);
- } else {
- selectedAssociation.setGenerated(false);
- }
-
- this.associationList.updateSelectedAssociation();
- }
-
- private ORMGenCustomizer getCustomizer(){
- GenerateEntitiesFromSchemaWizard wizard = (GenerateEntitiesFromSchemaWizard) this.getWizard();
- return wizard.getCustomizer();
- }
-
-
- @Override
- public final void performHelp()
- {
- this.getHelpSystem().displayHelp( GenerateEntitiesFromSchemaWizard.HELP_CONTEXT_ID );
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
- @Override
- public void dispose() {
- //when the JPA project wizard page is shown first, the other wizard pages are lazily built, thus
- //associationList can be null - bug 307894
- if (this.associationList != null) {
- this.associationList.dispose();
- }
- super.dispose();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableFigure.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableFigure.java
deleted file mode 100644
index 7cf16fa95c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableFigure.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import org.eclipse.draw2d.ColorConstants;
-import org.eclipse.draw2d.Figure;
-import org.eclipse.draw2d.Graphics;
-import org.eclipse.draw2d.GridLayout;
-import org.eclipse.draw2d.Label;
-import org.eclipse.draw2d.LineBorder;
-import org.eclipse.draw2d.PositionConstants;
-import org.eclipse.draw2d.geometry.Insets;
-import org.eclipse.draw2d.geometry.Rectangle;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jpt.jpa.ui.internal.ImageRepository;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-
-/**
- * A draw2D figure representing a database table
- *
- */
-public class TableFigure extends Figure
-{
- private Color tableColor = new Color(null, 220, 232, 241);
-
- private Font tableFont = new Font(null, "Arial", 8, SWT.NONE); //$NON-NLS-1$
-
- private Color borderColor = new Color(null, 14, 66, 115);
-
- public static final int OUTLINE_CORNER_RADIUS = 6;
-
- protected final ResourceManager resourceManager;
-
- public TableFigure(String name, ResourceManager resourceManager) {
- this.resourceManager = resourceManager;
- GridLayout gl = new GridLayout();
- gl.marginHeight = 2;
- gl.marginWidth = 10;
- setLayoutManager(gl);
- setBorder(new LineBorder(this.tableColor, 0));
- setBackgroundColor(this.tableColor);
- setOpaque(true);
- setSize(150, 20);
- Label nameLabel = new Label("", ImageRepository.getTableObjImage(this.resourceManager));
- nameLabel.setFont(this.tableFont);
- nameLabel.setText(name);
- nameLabel.setForegroundColor(this.borderColor);
- nameLabel.setLabelAlignment(PositionConstants.CENTER);
- add(nameLabel);
- }
-
- @Override
- protected void paintClientArea(Graphics graphics) {
- super.paintClientArea(graphics);
- graphics.pushState();
- Rectangle r = getBounds().getCopy();
- graphics.drawRoundRectangle(r.expand(new Insets(-1, -1, -2, -2)), OUTLINE_CORNER_RADIUS, OUTLINE_CORNER_RADIUS);
- graphics.popState();
- }
-
- @Override
- public void setEnabled(boolean enabled) {
- super.setEnabled(enabled);
- if (enabled) {
- setBackgroundColor(this.tableColor);
- }
- else {
- setBackgroundColor(ColorConstants.white);
- }
- }
-
- public void dispose() {
- this.borderColor.dispose();
- this.tableFont.dispose();
- this.tableColor.dispose();
- }
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableGenPanel.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableGenPanel.java
deleted file mode 100644
index 06ab291530..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TableGenPanel.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.JavaConventions;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenTable;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.layout.RowLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-
-/**
- * The UI panel for setting the default and specific
- * table entity generation properties.
- *
- */
-public class TableGenPanel
-{
- WizardPage wizardPage ;
-
- private Text classNameField; // used in setting individual table/entity generation only
-
- private Combo idGeneratorCombo;
- private Text sequenceNameField;
-
- private Button entityAccessField;
- private Button entityAccessProperty;
- private Button associationFetchDefault;
- private Button associationFetchEager;
- private Button associationFetchLazy;
-
- private Button collectionTypeSet;
- private Button collectionTypeList;
-
- private Button generateOptionalAnnotations;
-
- private Label sequenceNameNoteLabel;
-
- private boolean isUpdatingControls;
-
- private ORMGenTable mTable;
-
- protected boolean isDefaultTable = false;
-
- public TableGenPanel(Composite parent, int columns , boolean isDefaultTable, WizardPage wizardPage ){
- super();
- this.wizardPage = wizardPage;
- this.isDefaultTable = isDefaultTable;
- createTableMappingPropertiesGroup(parent, columns);
- SWTUtil.createLabel(parent, 4, ""); //$NON-NLS-1$
- }
-
- protected void createTableMappingPropertiesGroup(Composite composite, int columns) {
- Group parent = new Group(composite, SWT.NONE );
- parent.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_tableMapping);
- parent.setLayout(new GridLayout(columns, false));
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = columns;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = false;
- parent.setLayoutData(layoutData);
-
- createClassNameControl(parent, columns);
-
- createIdGeneratorControls(parent, columns);
- createEntityAccessControls(parent, columns);
-
- //AssociationFetch and CollectionType only available for default table generation
- if ( isDefaultTable ) {
- createAssociationFetchControls(parent, columns);
- createCollectionTypeControls(parent, columns);
- createGenerateOptionalAnnotationControls(parent, columns);
- }
- }
-
- private void createGenerateOptionalAnnotationControls(Group parent, int columns) {
- generateOptionalAnnotations = new Button(parent, SWT.CHECK );
- generateOptionalAnnotations.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_genOptionalAnnotations);
- generateOptionalAnnotations.setToolTipText(JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_genOptionalAnnotations_desc);
-
- GridData gd = new GridData();
- gd.horizontalSpan = columns;
- generateOptionalAnnotations.setLayoutData(gd);
- generateOptionalAnnotations.addSelectionListener(new SelectionListener(){
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- boolean selected = generateOptionalAnnotations.getSelection();
- mTable.setGenerateDDLAnnotations(selected);
- }
- });
- }
-
- protected void createClassNameControl(Composite parent, int columns) {
- //Customize class name for specific table only
- if ( !isDefaultTable ) {
- SWTUtil.createLabel( parent, 1 , JptUiEntityGenMessages.GenerateEntitiesWizard_tablePanel_className );
-
- classNameField = new Text(parent, SWT.SINGLE | SWT.BORDER );
- //mPackageNameField.setEditable(false);
- SWTUtil.fillColumns(classNameField,3);
- classNameField.addModifyListener(new ModifyListener(){
- @SuppressWarnings({ "deprecation" })
- public void modifyText(ModifyEvent e) {
- if (e.getSource() == null || !isUpdatingControls) {
- String className = classNameField.getText();
- IStatus status = JavaConventions.validateJavaTypeName( className );
- if( !status.matches(IStatus.ERROR) ){
- mTable.setClassName( className );
- wizardPage.setErrorMessage(null);
- }else{
- wizardPage.setErrorMessage(status.getMessage());
- }
- }
- }
- });
- }
- }
-
- class AssociationFetchListener implements SelectionListener{
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- if (!isUpdatingControls) {
- Button radioBtn = (Button)e.getSource();
- mTable.setDefaultFetch( radioBtn.getData().toString());
- }
- }
- }
-
- protected void createAssociationFetchControls(Composite composite, int columns) {
- SWTUtil.createLabel(composite, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_fetch );
-
- Composite parent = new Composite( composite, SWT.NONE);
- parent.setLayout(new RowLayout());
- SWTUtil.fillColumns( parent , 3);
- associationFetchDefault = new Button( parent, SWT.RADIO );
- associationFetchDefault.setText( "Default");
- associationFetchDefault.setData( ORMGenTable.DEFAULT_FETCH );
-
- associationFetchEager = new Button( parent, SWT.RADIO );
- associationFetchEager.setText( "&Eager");
- associationFetchEager.setData( ORMGenTable.EAGER_FETCH );
-
- associationFetchLazy = new Button( parent, SWT.RADIO );
- associationFetchLazy.setText( "La&zy");
- associationFetchLazy.setData( ORMGenTable.LAZY_FETCH );
-
- AssociationFetchListener associationFetchListener = new AssociationFetchListener();
- associationFetchDefault.addSelectionListener( associationFetchListener );
- associationFetchLazy.addSelectionListener( associationFetchListener );
- associationFetchEager.addSelectionListener( associationFetchListener );
- }
-
- class CollectionTypeListener implements SelectionListener {
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- if (!isUpdatingControls) {
- Button radioBtn = (Button)e.getSource();
- mTable.setDefaultCollectionType( radioBtn.getData().toString());
- }
- }
- }
-
- protected void createCollectionTypeControls(Composite composite, int columns) {
- SWTUtil.createLabel(composite, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_collType );
-
- Composite parent = new Composite( composite, SWT.NONE);
- parent.setLayout(new RowLayout());
- SWTUtil.fillColumns( parent , 3);
-
- this.collectionTypeSet = new Button( parent, SWT.RADIO);
- this.collectionTypeSet.setText( "java.util.Se&t");
- this.collectionTypeSet.setData( ORMGenTable.SET_COLLECTION_TYPE );
- this.collectionTypeList = new Button( parent, SWT.RADIO);
- this.collectionTypeList.setText("java.util.&List");
- this.collectionTypeList.setData(ORMGenTable.LIST_COLLECTION_TYPE);
-
- CollectionTypeListener collectionTypeListener = new CollectionTypeListener();
- collectionTypeList.addSelectionListener( collectionTypeListener );
- collectionTypeSet.addSelectionListener( collectionTypeListener );
- }
-
-
- public void setORMGenTable(ORMGenTable table) {
- this.mTable = table;
- }
-
- //should be called after setting the ORMGenTable
- public void updateControls(){
-
- isUpdatingControls = true;
-
- try {
- updateClassNameField();
- udpateGeneratorControls();
- updateAccessControls();
- updateFetchControls();
-
- //DefaultTable only
- updateCollectionTypeControls();
- updateGenerateOptionalAnnotationControls();
-
-
- } catch (Exception e) {
- JptJpaUiPlugin.log(e);
- }
-
- isUpdatingControls = false;
- }
-
- private void updateCollectionTypeControls() {
- if (collectionTypeList != null) {
- String cType = this.mTable.getDefaultCollectionType();
- if ( ORMGenTable.LIST_COLLECTION_TYPE.equals( cType ) ) {
- this.collectionTypeList.setSelection( true );
- this.collectionTypeSet.setSelection( false );
- } else {
- this.collectionTypeSet.setSelection( true );
- this.collectionTypeList.setSelection( false );
- }
-
-
- }
- }
-
- protected void updateGenerateOptionalAnnotationControls(){
- if (generateOptionalAnnotations != null){
- this.generateOptionalAnnotations.setSelection( this.mTable.isGenerateDDLAnnotations());
- }
- }
-
- private void updateFetchControls() {
- if (associationFetchLazy != null && associationFetchEager != null ) {
- String defaultFetch = this.mTable.getDefaultFetch();
- //reset all three buttons
- associationFetchDefault.setSelection(false);
- associationFetchEager.setSelection(false);
- associationFetchLazy.setSelection(false);
- if( ORMGenTable.DEFAULT_FETCH.equals( defaultFetch ) )
- associationFetchDefault.setSelection(true);
- else if( ORMGenTable.EAGER_FETCH.equals( defaultFetch ) )
- associationFetchEager.setSelection(true);
- else
- associationFetchLazy.setSelection(true);
- }
- }
-
- protected void updateAccessControls() {
- String access = this.mTable.getAccess() ;
- if ( ORMGenTable.FIELD_ACCESS.equals( access ) ) {
- this.entityAccessField.setSelection( true );
- this.entityAccessProperty.setSelection( false );
- } else {
- this.entityAccessProperty.setSelection( true );
- this.entityAccessField.setSelection( false );
- }
- }
-
- private void udpateGeneratorControls() {
- final List<String> schemes = this.mTable.getCustomizer().getAllIdGenerators();
- String[] values = new String[schemes.size()];
- schemes.toArray(values);
- idGeneratorCombo.setItems( values );
- String idGenerator = this.mTable.getIdGenerator();
- idGeneratorCombo.setText( idGenerator);
-
- boolean isSequence = this.mTable.getCustomizer().getSequenceIdGenerators().contains(idGenerator);
- String sequenceName = this.mTable.isDefaultsTable() ? this.mTable.getSequence() : this.mTable.getFormattedSequence();
- sequenceName = ( sequenceName == null ? "" : sequenceName );
- sequenceNameField.setText( sequenceName );
- if ( isSequence ) {
- sequenceNameField.setEnabled(true);
- sequenceNameNoteLabel.setEnabled(true);
- } else {
- sequenceNameField.setEnabled(false);
- sequenceNameNoteLabel.setEnabled(false);
- }
- }
-
- private void updateClassNameField() {
- //ClassNameField is not available for default table
- if(classNameField!= null )
- classNameField.setText( this.mTable.getClassName() );
- }
-
- protected void createIdGeneratorControls(Composite parent, int columns) {
- SWTUtil.createLabel(parent, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_keyGen );
-
- idGeneratorCombo = new Combo(parent,SWT.SINGLE | SWT.READ_ONLY);
- SWTUtil.fillColumns(idGeneratorCombo, 3);
-
- idGeneratorCombo.addSelectionListener( new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- if (isUpdatingControls) {
- return;
- }
-
- idGenChanged();
- }});
-
- SWTUtil.createLabel(parent, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_sequence );
- sequenceNameField = new Text( parent, SWT.SINGLE | SWT.BORDER );
-
- SWTUtil.fillColumns(sequenceNameField, 3);
- sequenceNameField.addModifyListener(new ModifyListener(){
- public void modifyText(ModifyEvent e) {
- if (e.getSource() == null || !isUpdatingControls) {
-
- if ( idGeneratorCombo.getText().equals("sequence")) { //$NON-NLS-1$
- String sequenceName = sequenceNameField.getText();
- if ( sequenceName.toLowerCase().indexOf("$table") >= 0 || //$NON-NLS-1$
- sequenceName.toLowerCase().indexOf("$pk") >= 0 ) { //$NON-NLS-1$
- sequenceName = convertVarToLowerCase("$table", sequenceName); //$NON-NLS-1$
- sequenceName = convertVarToLowerCase("$pk", sequenceName); //$NON-NLS-1$
- }
- if ( sequenceName.trim().length() != 0 ) {
- mTable.setSequence( sequenceName );
- } else{
- mTable.setSequence( "" ); //$NON-NLS-1$
- }
- }
- }
- }
-
- private String convertVarToLowerCase(String var, String sequenceName) {
- int n = sequenceName.toLowerCase().indexOf( var );
- if( n==0 ) {
- return var + sequenceName.substring( var.length());
- } else if( n >0 ) {
- return sequenceName.substring(0,n) + var + sequenceName.substring( n + var.length());
- }
- return sequenceName;
- }
- });
-
- SWTUtil.newLabel(parent, "");//$NON-NLS-1$
- sequenceNameNoteLabel = new Label(parent, SWT.NONE);
- String text =String.format( JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_sequenceNote,
- ORMGenTable.TABLE_SEQ_PATTERN, ORMGenTable.PK_SEQ_PATTERN);
- sequenceNameNoteLabel.setText( text ) ;
- sequenceNameNoteLabel.setEnabled(false);
- SWTUtil.fillColumns( sequenceNameNoteLabel, 3);
- }
-
- private void idGenChanged() {
- String scheme = idGeneratorCombo.getText();
- mTable.setIdGenerator(scheme);
-
- boolean isSequence = this.mTable.getCustomizer().getSequenceIdGenerators().contains(scheme);
- if (!isSequence) {
- sequenceNameField.setText("");
- sequenceNameField.setEnabled(false);
- mTable.setSequence(null);
- sequenceNameNoteLabel.setEnabled(false);
- } else {
- sequenceNameField.setEnabled(true);
- Color NOTE_LABEL_COLOR = new Color( Display.getDefault(), 102,102,102);
- sequenceNameNoteLabel.setForeground( NOTE_LABEL_COLOR );
- NOTE_LABEL_COLOR.dispose();
- sequenceNameNoteLabel.setEnabled(true);
- if ( sequenceNameField.getText().length()==0 ) {
- String newMessage = "Please specify a sequence name";
- this.wizardPage.setMessage(newMessage);
- this.wizardPage.setPageComplete(true);
- } else {
- this.wizardPage.setErrorMessage(null);
- this.wizardPage.setPageComplete(true);
- }
- }
- }
-
- class EntityAccessFetchListener implements SelectionListener{
- public void widgetDefaultSelected(SelectionEvent e) {}
- public void widgetSelected(SelectionEvent e) {
- if (!isUpdatingControls) {
- Button radioBtn = (Button)e.getSource();
- mTable.setAccess( radioBtn.getData().toString() );
- }
- }
- }
-
- private void createEntityAccessControls(Composite composite, int columns) {
- SWTUtil.createLabel(composite, 1, JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_access );
-
- Composite parent = new Composite( composite, SWT.NONE);
- SWTUtil.fillColumns( parent , 3);
- parent.setLayout(new RowLayout());
-
- entityAccessField = new Button( parent, SWT.RADIO );
- entityAccessField.setText( "&Field" ); //$NON-NLS1$
- entityAccessField.setData( ORMGenTable.FIELD_ACCESS);
-
- entityAccessProperty = new Button( parent, SWT.RADIO );
- entityAccessProperty.setText( "&Property" );//$NON-NLS1$
- entityAccessProperty.setData( ORMGenTable.PROPERTY_ACCESS );
-
- EntityAccessFetchListener entityAccessFetchListener = new EntityAccessFetchListener();
- entityAccessField.addSelectionListener( entityAccessFetchListener );
- entityAccessProperty.addSelectionListener( entityAccessFetchListener );
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesAndColumnsCustomizationWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesAndColumnsCustomizationWizardPage.java
deleted file mode 100644
index 4916a46f6d..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesAndColumnsCustomizationWizardPage.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil;
-import org.eclipse.jdt.ui.wizards.NewTypeWizardPage;
-import org.eclipse.jface.dialogs.IMessageProvider;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeContentProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TreeSelection;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenColumn;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenTable;
-import org.eclipse.jpt.jpa.ui.internal.ImageRepository;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.StackLayout;
-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.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-public class TablesAndColumnsCustomizationWizardPage extends NewTypeWizardPage {
-
- private JpaProject jpaProject;
-
- private TreeViewer tableColumnTreeViewer;
-
- protected Composite detailPanel ;
- protected StackLayout detailPanelStatckLayout;
- protected Composite tableGenDetatilGroup;
- protected ColumnGenPanel columnGenPanel;
- protected Composite columnGenDetatilGroup;
- protected TableGenPanel tableGenPanel;
- protected ORMGenTable selectedTable;
-
- private ORMGenCustomizer customizer;
-
- protected final ResourceManager resourceManager;
-
- public TablesAndColumnsCustomizationWizardPage(JpaProject jpaProject, ResourceManager resourceManager) {
- super(true, "TablesAndColumnsCustomizationWizardPage"); //$NON-NLS-1$
- this.jpaProject = jpaProject;
- this.resourceManager = resourceManager;
- setTitle( JptUiEntityGenMessages.GenerateEntitiesWizard_tablesAndColumnsPage_title );
- setMessage( JptUiEntityGenMessages.GenerateEntitiesWizard_tablesAndColumnsPage_desc);
- }
-
- // -------- Initialization ---------
- /**
- * The wizard owning this page is responsible for calling this method with the
- * current selection. The selection is used to initialize the fields of the wizard
- * page.
- *
- * @param selection used to initialize the fields
- */
- public void init(IStructuredSelection selection) {
- if ( jpaProject != null ) {
- IJavaElement jelem = this.jpaProject.getJavaProject();
- initContainerPage(jelem);
- initTypePage(jelem);
- }
- }
-
- public void createControl(Composite parent) {
- initializeDialogUnits(parent);
- Composite composite = new Composite(parent, SWT.NULL);
- int nColumns= 1 ;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- composite.setLayout(layout);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.GENERATE_ENTITIES_WIZARD_CUSTOMIZE_INDIVIDUAL_ENTITIES);
-
- createTableAndColumnsListPanel(composite, 1);
-
- SWTUtil.createLabel( composite, 1, ""); //$NON-NLS-1$
-
- SWTUtil.createSeparator(composite, 1);
-
- createGenerateDetailGroup(composite, 1);
-
- setControl(composite);
- this.setPageComplete( true );
- }
-
- /**
- * A panel with JFace TreeViewer showing tables and columns to be generated into JPA entities
- *
- * @param parent
- * @param columns
- */
- private void createTableAndColumnsListPanel(Composite parent, int columns) {
- Label label = new Label(parent, columns );
- label.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_tablesAndColumnsPage_labelTableAndColumns );
- SWTUtil.fillColumns( label , columns);
-
- GridData data = new GridData();
- data.horizontalSpan = columns;
- data.verticalAlignment = SWT.FILL;
- data.horizontalAlignment = SWT.FILL;
- data.grabExcessHorizontalSpace = true;
- data.heightHint = 200;
- data.grabExcessVerticalSpace = true;
-
- tableColumnTreeViewer = new TreeViewer(parent);
- tableColumnTreeViewer.getTree().setLayoutData( data);
- tableColumnTreeViewer.setContentProvider(new TableColumnTreeContentProvider());
- tableColumnTreeViewer.setLabelProvider(new TableColumnTreeLabelProvider());
-
- tableColumnTreeViewer.addSelectionChangedListener( new ISelectionChangedListener(){
- public void selectionChanged(SelectionChangedEvent event) {
- updateDetailPanel(event.getSelection());
- }
-
- });
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if(visible){
- ORMGenCustomizer customizer = getCustomizer();
- //If user changed the connection or schema
- if( this.customizer != customizer ){
- this.customizer = customizer;
- tableColumnTreeViewer.setInput( customizer );
- }else{
- tableColumnTreeViewer.refresh();
- }
- List<String> tableNames = this.customizer.getTableNames();
-
- //Select the first table
- ORMGenTable ormGenTable = this.customizer.getTable(tableNames.get(0));
- updateTabelGenDetail( ormGenTable );
- }
- }
-
-
- private void updateDetailPanel(ISelection selection) {
- TreeSelection ts = (TreeSelection)selection;
- Object selectedObject = ts.getFirstElement();
- if( selectedObject instanceof ORMGenTable ){
- updateTabelGenDetail( (ORMGenTable)selectedObject );
- }else if( selectedObject instanceof ORMGenColumn ){
- updateColumnGenDetail( (ORMGenColumn)selectedObject );
- }
- }
-
- protected void updateColumnGenDetail(ORMGenColumn column) {
- if(columnGenDetatilGroup==null){
- columnGenDetatilGroup = new Composite(detailPanel, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 4;
- columnGenDetatilGroup.setLayout(gridLayout);
- this.columnGenPanel = new ColumnGenPanel(columnGenDetatilGroup, 4, getCustomizer() , this, false);
- }
- columnGenPanel.setColumn(column);
- this.detailPanelStatckLayout.topControl = columnGenDetatilGroup;
- this.detailPanel.layout();
- detailPanel.getParent().layout();
- }
-
- protected void updateTabelGenDetail(ORMGenTable table) {
- this.selectedTable = table;
- if(tableGenDetatilGroup==null){
- tableGenDetatilGroup = new Composite(detailPanel, SWT.NONE);
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 4;
- tableGenDetatilGroup.setLayout(gridLayout);
-
- this.tableGenPanel = new TableGenPanel(tableGenDetatilGroup, 4 , false, this );
- createDomainJavaClassesPropertiesGroup(tableGenDetatilGroup, 4 );
- }
- tableGenPanel.setORMGenTable(table);
- tableGenPanel.updateControls();
-
- this.detailPanelStatckLayout.topControl = tableGenDetatilGroup;
- this.detailPanel.layout();
-
- String baseClass = StringTools.stringIsEmpty(table.getExtends()) ? "" : table.getExtends();
- setSuperClass(baseClass, true);
-
-
- setSuperInterfaces(table.getImplements(), true);
-
- detailPanel.getParent().layout();
- }
-
- protected void createDomainJavaClassesPropertiesGroup(Composite composite, int columns) {
- Group parent = new Group( composite, SWT.NONE);
- parent.setText( JptUiEntityGenMessages.GenerateEntitiesWizard_defaultTablePage_domainJavaClass );
- parent.setLayout(new GridLayout(columns, false));
- SWTUtil.fillColumns( parent, columns);
-
- createSuperClassControls(parent, columns);
- createSuperInterfacesControls(parent, columns);
-
- //Resize supper class text width to fill the parent group.
- //Have to do it indirectly since fSuperClassDialogField is private in super class.
- Control[] controls = parent.getChildren();
- if( controls.length>1 && controls[1] instanceof Text ){
- Text text = (Text)(parent.getChildren()[1]);
- LayoutUtil.setWidthHint(text, getMaxFieldWidth());
- LayoutUtil.setHorizontalGrabbing(text);
- }
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.NewTypeWizardPage#superClassChanged()
- */
- @Override
- protected IStatus superClassChanged() {
- IStatus status = super.superClassChanged();
- String baseClass = getSuperClass();
- if(baseClass!=null && this.selectedTable!=null ){
- String oldBaseClass = this.selectedTable.getExtends();
- if( !baseClass.equals(oldBaseClass))
- this.selectedTable.setExtends(baseClass);
- }
- return status;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.NewTypeWizardPage#superInterfacesChanged()
- */
- @Override
- protected IStatus superInterfacesChanged() {
- IStatus status = super.superInterfacesChanged();
- List<String> superInterfaces = getSuperInterfaces();
- if (this.selectedTable != null) {
- this.selectedTable.setImplements(superInterfaces);
- }
- return status;
- }
-
- /* (non-Javadoc)
- * @see org.eclipse.jdt.ui.wizards.NewTypeWizardPage#addSuperInterface(java.lang.String)
- */
- @Override
- @SuppressWarnings("unchecked")
- public boolean addSuperInterface(String superInterface) {
- super.addSuperInterface(superInterface);
- List interfaces = getSuperInterfaces();
- if(this.selectedTable!=null)
- this.selectedTable.setImplements(interfaces);
- return true;
- }
-
- @Override
- protected void handleFieldChanged(String fieldName) {
- super.handleFieldChanged(fieldName);
- if( this.fSuperClassStatus.matches(IStatus.ERROR)){
- updateStatus(fSuperClassStatus);
- }else{
- setMessage("", IMessageProvider.NONE);
- setErrorMessage(null);
- }
-
- }
-
- protected ORMGenCustomizer getCustomizer(){
- GenerateEntitiesFromSchemaWizard wizard = (GenerateEntitiesFromSchemaWizard) this.getWizard();
- return wizard.getCustomizer();
- }
-
- public boolean isDynamic() {
- return false;
- }
-
- /**
- * Content provider, and label provider for the DB Table/Column TreeViewer
- *
- */
- class TableColumnTreeContentProvider implements ITreeContentProvider {
- public Object[] getElements(Object inputElement) {
- if( inputElement instanceof ORMGenCustomizer ){
- ORMGenCustomizer input = (ORMGenCustomizer )inputElement;
- List<String> tableNameList = input.getGenTableNames();
- List<ORMGenTable> ret = new ArrayList<ORMGenTable>();
- for(String t : tableNameList){
- ORMGenTable ormGenTable = getCustomizer().getTable( t );
- ret.add( ormGenTable );
- }
- return ret.toArray();
- }
- return new Object[]{};
- }
- public Object[] getChildren(Object parentElement) {
- if( parentElement instanceof ORMGenTable ){
- ORMGenTable table = (ORMGenTable) parentElement;
- List<ORMGenColumn> columns = table.getColumns();
- List<ORMGenColumn> ret = new ArrayList<ORMGenColumn>();
- for( ORMGenColumn col : columns){
- if( col.isForeignKey() )
- continue;
- if( col.isPrimaryKey() ){
- ret.add(0,col );
- }else{
- ret.add(col);
- }
- }
- return ret.toArray();
- }
- return new Object[]{};
- }
- public Object getParent(Object element) {
- if( element instanceof ORMGenColumn){
- return null;
- }
- return null;
- }
- public boolean hasChildren(Object element) {
- return( element instanceof ORMGenTable );
- }
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
- public void dispose() {}
- }
-
- class TableColumnTreeLabelProvider extends LabelProvider{
-
- @Override
- public Image getImage(Object element) {
- if( element instanceof ORMGenTable ){
- return ImageRepository.getTableImage(resourceManager);
- }else if( element instanceof ORMGenColumn ){
- ORMGenColumn col = ( ORMGenColumn)element;
- return col.isPrimaryKey() ?
- ImageRepository.getKeyColumnImage(resourceManager) :
- ImageRepository.getColumnImage(resourceManager);
- }
- return null;
- }
-
-
- @Override
- public String getText(Object element) {
- if( element instanceof ORMGenTable ){
- return ((ORMGenTable)element).getName();
- }else if( element instanceof ORMGenColumn ){
- return ((ORMGenColumn)element).getName();
- }
- return super.getText(element);
- }
- }
-
- private void createGenerateDetailGroup(Composite parent, int columns) {
- detailPanel = new Composite(parent, SWT.NONE);
- SWTUtil.fillColumns( detailPanel, columns);
-
- detailPanelStatckLayout = new StackLayout();
- detailPanel.setLayout(detailPanelStatckLayout);
-
- Composite emptyPanel = new Composite(detailPanel, SWT.NONE);
- emptyPanel.setLayoutData(new GridData());
-
- detailPanelStatckLayout.topControl = emptyPanel;
- detailPanel.layout();
- }
-
- @Override
- public final void performHelp()
- {
- this.getHelpSystem().displayHelp( GenerateEntitiesFromSchemaWizard.HELP_CONTEXT_ID );
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesSelectorWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesSelectorWizardPage.java
deleted file mode 100644
index 4e3c1c0da1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/gen/TablesSelectorWizardPage.java
+++ /dev/null
@@ -1,767 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-
-package org.eclipse.jpt.jpa.ui.internal.wizards.gen;
-
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-import org.eclipse.core.resources.WorkspaceJob;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.SubMonitor;
-import org.eclipse.core.runtime.jobs.IJobChangeEvent;
-import org.eclipse.core.runtime.jobs.JobChangeAdapter;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.resource.ResourceManager;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.ColumnWeightData;
-import org.eclipse.jface.viewers.IBaseLabelProvider;
-import org.eclipse.jface.viewers.IContentProvider;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredContentProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITableLabelProvider;
-import org.eclipse.jface.viewers.LabelProvider;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerSorter;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.WizardPage;
-import org.eclipse.jpt.common.ui.internal.util.SWTUtil;
-import org.eclipse.jpt.common.ui.internal.util.TableLayoutComposite;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.gen.internal.ORMGenCustomizer;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.ImageRepository;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.osgi.util.NLS;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.KeyAdapter;
-import org.eclipse.swt.events.KeyEvent;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Image;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.TableColumn;
-import org.eclipse.swt.widgets.TableItem;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.help.IWorkbenchHelpSystem;
-
-public class TablesSelectorWizardPage extends WizardPage {
-
- private static final int TABLE_COLUMN_INDEX = 0;
-
- private JpaProject jpaProject;
- private Schema schema;
- private ORMGenCustomizer customizer;
- private boolean updatePersistenceXml = true;
- private boolean isDynamic;
-
- private DatabaseGroup databaseGroup;
- private CheckboxTableViewer tableTable;
- private Button updatePersistenceXmlCheckBox;
- private Button refreshTablesButton;
- private Button selectAllButton;
- private Button deselectAllButton;
-
- private WorkspaceJob fetchTablesJob;
- protected final ResourceManager resourceManager;
-
- // ********** constructors **********
-
- public TablesSelectorWizardPage(JpaProject jpaProject, ResourceManager resourceManager, boolean isDynamic) {
- super("TablesSelectorWizardPage"); //$NON-NLS-1$
-
- this.jpaProject = jpaProject;
- this.resourceManager = resourceManager;
- this.schema = jpaProject.getDefaultDbSchema();
- this.isDynamic = isDynamic;
- this.setTitle(JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_selectTable );
- this.setMessage(JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_chooseEntityTable );
- }
-
- // ********** IDialogPage implementation **********
-
- public void createControl(Composite parent) {
- this.initializeDialogUnits(parent);
-
- this.setPageComplete(true);
- this.setControl(this.buildTopLevelControl(parent));
- }
-
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
-
- this.doStatusUpdate();
- this.updateButtons();
- }
-
- @Override
- public void dispose() {
- if(this.databaseGroup != null) {
- this.databaseGroup.dispose();
- }
- super.dispose();
- }
-
- @Override
- public final void performHelp() {
- this.getHelpSystem().displayHelp( GenerateEntitiesFromSchemaWizard.HELP_CONTEXT_ID);
- }
-
- protected final IWorkbenchHelpSystem getHelpSystem() {
- return PlatformUI.getWorkbench().getHelpSystem();
- }
-
- // ********** IWizardPage implementation **********
-
- @Override
- public IWizardPage getPreviousPage() {
- IWizardPage previousPage = super.getPreviousPage();
- if(previousPage instanceof PromptJPAProjectWizardPage)
- //Prevent going back to the PromptJPAProjectWizardPage
- //if JPA project already selected
- return previousPage.getPreviousPage();
- else
- return previousPage;
- }
-
- // ********** internal methods **********
-
- private Composite buildTopLevelControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- int nColumns= 3;
- GridLayout layout = new GridLayout();
- layout.numColumns = nColumns;
- composite.setLayout(layout);
- this.getHelpSystem().setHelp(composite, JpaHelpContextIds.GENERATE_ENTITIES_WIZARD_SELECT_TABLES);
-
- this.databaseGroup = this.createDatabaseGroup(composite, 400);
-
- this.createTablesSelectionControl(composite, nColumns);
-
- if (!isDynamic) {
- this.updatePersistenceXmlCheckBox = this.buildUpdatePersistenceXmlCheckBox(composite);
- this.fillColumns(this.updatePersistenceXmlCheckBox, 3);
- }
-
- //Filler column
- new Label( composite, SWT.NONE);
- //Restore defaults button
- this.buildRestoreDefaultsButton(composite);
-
- this.updateSelectionState(this.databaseGroup.getSelectedSchema());
- this.getHelpSystem().setHelp(this.tableTable.getControl(), JpaHelpContextIds.DIALOG_GENERATE_ENTITIES_TABLES);
- return composite;
- }
-
- private void createTablesSelectionControl(Composite parent, int columns) {
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- gridData.verticalAlignment = GridData.BEGINNING;
-
- Label tableLabel = new Label(parent, SWT.NONE);
- tableLabel.setLayoutData(gridData);
- tableLabel.setText(JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_tables );
-
- TableLayoutComposite layout = new TableLayoutComposite(parent, SWT.NONE);
- this.addColumnLayoutData(layout);
-
- this.tableTable = this.buildCheckboxTableViewer(this.buildTable(layout));
-
- this.createButtonComposite(parent);
- this.initTablesSelectionControl(this.possibleTables());
- }
-
- private void createButtonComposite(Composite parent){
- Composite buttonComposite = new Composite(parent, SWT.NULL);
- GridLayout buttonLayout = new GridLayout(1, false);
- buttonLayout.marginHeight = 0;
- buttonLayout.marginWidth = 0;
-
- buttonComposite.setLayout(buttonLayout);
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.verticalAlignment = GridData.BEGINNING;
- buttonComposite.setLayoutData(data);
-
- this.selectAllButton = this.buildSelectAllButton(buttonComposite);
- this.deselectAllButton = this.buildDeselectAllButton(buttonComposite);
- this.refreshTablesButton = this.buildRefreshTablesButton(buttonComposite);
- }
-
- private DatabaseGroup createDatabaseGroup(Composite parent, int widthHint) {
- DatabaseGroup dbGroup = new DatabaseGroup(this.getContainer(), this.jpaProject, parent, this.resourceManager, widthHint);
- /**
- * listen for when the Database Connection changes its selected schema
- * so we can keep the page in synch
- */
- class DatabasePageListener implements DatabaseGroup.Listener {
- public void selectedConnectionProfileChanged(ConnectionProfile connectionProfile) {
- jpaProject.getDataSource().setConnectionProfileName(connectionProfile.getName());
- }
- @SuppressWarnings("unchecked")
- public void selectedSchemaChanged(Schema schema) {
- if (schema==null) {
- updateTablesListViewer(Collections.EMPTY_LIST);
- }
- else {
- // store the *identifier* in the JPA project, since it gets put in Java annotations
- jpaProject.setUserOverrideDefaultSchema(schema.getIdentifier());
- setSchema(schema);
- updateButtons();
- updateSelectionState(schema);
- }
- doStatusUpdate();
- }
- }
- dbGroup.addListener(new DatabasePageListener());
- dbGroup.init();
- return dbGroup;
- }
-
- // ********** private methods **********
-
- private Schema getSchema() {
- return this.schema;
- }
-
- private void setSchema(Schema s) {
- this.schema = s;
- }
-
- private boolean connectionIsActive() {
- return this.databaseGroup.connectionIsActive();
- }
-
- private Collection<Table> getTables(Schema schema) {
- if(this.fetchTablesJobIsRunning()) {
- return Collections.<Table> emptyList();
- }
- return CollectionTools.collection(schema.getTables());
- }
-
- private Collection<Table> possibleTables() {
- Schema schema = this.getSchema();
- if(schema != null && schema.getName() != null) {
- return this.getTables(schema);
- }
- return Collections.<Table> emptyList();
- }
-
- private void updateButtons() {
- if(this.selectAllButton != null) {
- this.selectAllButton.setEnabled(this.connectionIsActive());
- }
- if(this.refreshTablesButton != null) {
- this.refreshTablesButton.setEnabled(this.connectionIsActive());
- }
- if(this.deselectAllButton != null) {
- this.deselectAllButton.setEnabled(this.connectionIsActive());
- }
- }
-
- private boolean updatePersistenceXml() {
- return this.updatePersistenceXml;
- }
-
- private void setShouldUpdatePersistenceXml(boolean updatePersistenceXml){
- this.updatePersistenceXml = updatePersistenceXml;
- this.doStatusUpdate();
- }
-
- private void restoreUpdatePersistenceXmlDefault() {
- this.updatePersistenceXmlCheckBox.setSelection(true);
- this.setShouldUpdatePersistenceXml(true);
- }
-
- private void selectAllTables() {
- this.tableTable.setAllChecked(true);
- this.doStatusUpdate();
- }
-
- private void deselectAllTables() {
- this.tableTable.setAllChecked(false);
- this.doStatusUpdate();
- }
-
- private void refreshTables() {
- this.schema.refresh();
- this.updateSelectionState(this.databaseGroup.getSelectedSchema());
- }
-
- private void initTablesSelectionControl(Collection<Table> possibleTables) {
- this.tableTable.setInput(possibleTables);
- }
-
- // ********** UI components **********
-
- private org.eclipse.swt.widgets.Table buildTable(Composite parent) {
- org.eclipse.swt.widgets.Table table = new org.eclipse.swt.widgets.Table(parent, SWT.H_SCROLL | SWT.V_SCROLL | SWT.SINGLE | SWT.FULL_SELECTION | SWT.BORDER | SWT.CHECK);
-
- TableColumn tableNameColumn = new TableColumn(table, SWT.NONE, TABLE_COLUMN_INDEX);
- tableNameColumn.setText(JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_tableColumn);
- tableNameColumn.setResizable(true);
-
- table.addKeyListener(this.buildTableKeyListener());
-
- GridData gridData= new GridData(GridData.FILL_BOTH);
- gridData.heightHint= SWTUtil.getTableHeightHint(table, 20);
- gridData.widthHint = 250;
- gridData.grabExcessHorizontalSpace = true;
- gridData.grabExcessVerticalSpace = true ;
-
- Color backgroundColor = new Color(Display.getDefault(), 255, 0,0);
- parent.setLayoutData(gridData);
- parent.setBackground(backgroundColor);
- backgroundColor.dispose();
-
- return table;
- }
-
- private CheckboxTableViewer buildCheckboxTableViewer(org.eclipse.swt.widgets.Table parent) {
- CheckboxTableViewer tableViewer = new CheckboxTableViewer(parent);
- tableViewer.setUseHashlookup(true);
-
- tableViewer.setLabelProvider(this.buildTableTableLabelProvider());
- tableViewer.setContentProvider(this.buildTableTableContentProvider());
-
- tableViewer.setSorter(this.buildTableViewerSorter());
- tableViewer.addPostSelectionChangedListener(this.buildTableSelectionChangedListener());
-
- return tableViewer;
- }
-
- private ViewerSorter buildTableViewerSorter() {
- return new ViewerSorter() {
- @Override
- public int compare(Viewer viewer, Object e1, Object e2) {
- return ((Table) e1).getName().compareTo(((Table) e2).getName());
- }
- };
- }
-
- private Button buildUpdatePersistenceXmlCheckBox(Composite parent) {
- Button checkBox = new Button(parent, SWT.CHECK);
- checkBox.setText(JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_updatePersistenceXml );
- checkBox.setSelection(this.updatePersistenceXml());
- checkBox.addSelectionListener(this.buildUpdatePersistenceXmlSelectionListener());
-
- return checkBox;
- }
-
- private Button buildRestoreDefaultsButton(Composite parent) {
- Button button = new Button(parent, SWT.PUSH);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = SWT.END;
- button.setLayoutData(gridData);
- button.setText(JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_Restore_Defaults);
- button.addSelectionListener(this.buildRestoreDefaultsSelectionListener());
-
- return button;
- }
-
- private Button buildSelectAllButton(Composite parent) {
- Button button = this.buildSelectionButton(parent,
- JptUiMessages.General_selectAll,
- ImageRepository.getSelectAllButtonImage(this.resourceManager));
-
- button.addSelectionListener(this.buildSelectAllSelectionListener());
- return button;
- }
-
- private Button buildDeselectAllButton(Composite parent) {
- Button button = this.buildSelectionButton(parent,
- JptUiMessages.General_deselectAll,
- ImageRepository.getDeselectAllButtonImage(this.resourceManager));
-
- button.addSelectionListener(this.buildDeselectAllSelectionListener());
- return button;
- }
-
- private Button buildRefreshTablesButton(Composite parent) {
- Button button = this.buildSelectionButton(parent,
- JptUiMessages.General_refresh,
- ImageRepository.getRefreshButtonImage(this.resourceManager));
-
- button.addSelectionListener(this.buildRefreshTablesSelectionListener());
- return button;
- }
-
- private Button buildSelectionButton(Composite parent, String toolTipText, Image buttonImage) {
- Button button = new Button(parent, SWT.PUSH);
- button.setToolTipText(toolTipText);
- button.setImage(buttonImage);
- GridData gridData = new GridData();
- gridData.horizontalAlignment = GridData.FILL;
- button.setLayoutData(gridData);
- return button;
- }
-
- private void addColumnLayoutData(TableLayoutComposite layout) {
- layout.addColumnData(new ColumnWeightData(50, true));
- }
-
- /**
- * Set the layoutData of the input control to occupy specified number of columns
- * @param c
- * @param columns
- */
- private void fillColumns(Control c, int columns){
- GridData layoutData = new GridData();
- layoutData.horizontalSpan = columns;
- layoutData.verticalAlignment = SWT.FILL;
- layoutData.horizontalAlignment = SWT.FILL;
- layoutData.grabExcessHorizontalSpace = true;
- layoutData.grabExcessVerticalSpace = false;
- c.setLayoutData(layoutData);
- return ;
- }
-
- private IBaseLabelProvider buildTableTableLabelProvider() {
- return new TableTableLabelProvider();
- }
-
- private IContentProvider buildTableTableContentProvider() {
- return new TableTableContentProvider();
- }
-
- // ********** listeners callbacks **********
-
- private void handleTablesListSelectionChanged(SelectionChangedEvent event) {
- this.doStatusUpdate();
- }
-
- // ********** listeners **********
-
- private KeyAdapter buildTableKeyListener() {
- return new KeyAdapter() {
- @Override
- public void keyPressed(KeyEvent e) {
- if(e.keyCode == SWT.F2 && e.stateMask == SWT.NONE) {
- editEntityNameIfPossible();
- e.doit= false;
- }
- }
- };
- }
-
- private ISelectionChangedListener buildTableSelectionChangedListener() {
- return new ISelectionChangedListener() {
- public void selectionChanged(SelectionChangedEvent event) {
- handleTablesListSelectionChanged(event);
- }
- };
- }
-
- private SelectionListener buildUpdatePersistenceXmlSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- setShouldUpdatePersistenceXml(updatePersistenceXmlCheckBox.getSelection());
- }
- };
- }
-
- private SelectionListener buildRestoreDefaultsSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- if(customizer != null && customizer.getFile() != null ){
- if(customizer.getFile().exists() ){
- customizer.getFile().delete();
- }
- deselectAllTables();
- restoreUpdatePersistenceXmlDefault();
- }
- }
- };
- }
-
- private SelectionListener buildSelectAllSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- selectAllTables();
- }
- };
- }
-
- private SelectionListener buildDeselectAllSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- deselectAllTables();
- }
- };
- }
-
- private SelectionListener buildRefreshTablesSelectionListener() {
- return new SelectionListener() {
- public void widgetDefaultSelected(SelectionEvent e) {}
-
- public void widgetSelected(SelectionEvent e) {
- refreshTables();
- }
- };
- }
-
- // ********** table behaviors **********
-
- private void editEntityNameIfPossible() {
- Object[] selected = ((IStructuredSelection) this.tableTable.getSelection()).toArray();
- if (selected.length != 1) {
- return;
- }
- }
-
- private Collection<Table> getSelectedTables() {
- ArrayList<Table> selectedTables = new ArrayList<Table>();
- for (Object selectedTable : this.tableTable.getCheckedElements())
- selectedTables.add((Table) selectedTable);
- return selectedTables;
- }
-
- private boolean hasTablesSelected() {
- return (this.tableTable != null) ? (this.getSelectedTables().size() > 0) : false;
- }
-
- private void updateTablesListViewer(Collection<Table> possibleTables) {
- if(this.tableTable != null) {
- this.initTablesSelectionControl(possibleTables);
- }
- }
-
- private boolean tableInitialized() {
- return (this.tableTable != null) && (this.tableTable.getTable().getItemCount() > 0);
- }
-
- // ********** fetch tables **********
-
- private boolean fetchTablesJobIsRunning() {
- return this.fetchTablesJob != null;
- }
-
- private WorkspaceJob buildFetchTablesJob(final Schema schema) {
- final Collection<Table> tables = new ArrayList<Table>();
-
- WorkspaceJob workspaceJob = new WorkspaceJob(JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_getTables_jobName) {
-
- @Override
- public IStatus runInWorkspace(IProgressMonitor monitor) {
- if(monitor.isCanceled()) {
- return Status.CANCEL_STATUS;
- }
- SubMonitor subMonitor = SubMonitor.convert(monitor,
- JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_getTables_taskName, 75);
- try {
- subMonitor.beginTask(schema.getContainer().getName(), 100);
- subMonitor.subTask(
- NLS.bind(
- JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_getTables_subTaskName,
- schema.getName()));
- subMonitor.worked(20);
-
- tables.addAll(CollectionTools.collection(schema.getTables()));
-
- subMonitor.worked(95);
- }
- catch(OperationCanceledException e) {
- return Status.CANCEL_STATUS;
- }
- finally {
- subMonitor.done();
- }
- return Status.OK_STATUS;
- }
- };
-
- workspaceJob.addJobChangeListener(new JobChangeAdapter() {
- @Override
- public void done(final IJobChangeEvent event) {
-
- SWTUtil.asyncExec(new Runnable() {
- public void run() {
- updateTablesListViewer(tables);
- }
- });
- event.getJob().removeJobChangeListener(this);
- fetchTablesJob = null;
- }
- });
- return workspaceJob;
- }
-
- // ********** updates **********
-
- /**
- * Update the status line and the OK button according to the given status
- */
- private void doStatusUpdate() {
- if( ! this.hasTablesSelected()) {
- this.setPageComplete(false);
- }
- else {
- this.setPageComplete(true);
- try{
- this.getContainer().run(false, false, new IRunnableWithProgress() {
- public void run( final IProgressMonitor monitor )
- throws InvocationTargetException, InterruptedException
- {
- monitor.beginTask(JptUiEntityGenMessages.GenerateEntitiesWizard_tableSelectPage_statusUpdate_taskName, 10);
-
- Collection<Table> ret = TablesSelectorWizardPage.this.getSelectedTables();
- ArrayList<String> tableNames = new ArrayList<String>();
- for(Table t : ret) {
- tableNames.add(t.getName());
- }
- Schema schema = getSchema();
- if(schema == null) {
- return;
- }
- customizer.setSchema(schema);
- customizer.setTableNames(tableNames);
- customizer.setUpdatePersistenceXml(updatePersistenceXml);
- monitor.done();
- }
- });
- }
- catch (Exception e) {
- JptJpaUiPlugin.log(e);
- }
- }
- }
-
- private void updateSelectionState(final Schema schema) {
- if(schema ==null) {
- return;
- }
- this.jpaProject.setUserOverrideDefaultSchema(schema.getIdentifier());
-
- if( ! this.fetchTablesJobIsRunning() && ! this.tableInitialized()) {
- this.fetchTablesJob = this.buildFetchTablesJob(schema);
- this.fetchTablesJob.schedule();
- }
- else {
- this.updateTablesListViewer(this.getTables(schema));
- }
-
- //Create the ORMGenCustomizer
- GenerateEntitiesFromSchemaWizard wizard = (GenerateEntitiesFromSchemaWizard) getWizard();
- this.customizer = wizard.createORMGenCustomizer(schema);
-
- if(this.tableTable!=null && this.customizer != null) {
- this.restoreWizardState();
- }
- this.doStatusUpdate();
- }
-
- private boolean restoreWizardState() {
- boolean pageComplete = false;
- if (this.updatePersistenceXmlCheckBox != null){
- this.updatePersistenceXmlCheckBox.setSelection(this.customizer.updatePersistenceXml());
- }
- List<String> preSelectedTableNames = this.customizer.getTableNames();
- if(preSelectedTableNames!=null && preSelectedTableNames.size()>0) {
- Set<String> set = new HashSet<String>();
- for(String s : preSelectedTableNames){
- set.add(s);
- }
- TableItem[] items = this.tableTable.getTable().getItems();
- for(int i = 0; i < items.length; ++i) {
- TableItem item = items[i];
- org.eclipse.jpt.jpa.db.Table element = (org.eclipse.jpt.jpa.db.Table)item.getData();
- if(element != null) {
- boolean check = set.contains(element.getName());
- // only set if different, to avoid flicker
- if(item.getChecked() != check) {
- item.setChecked(check);
- pageComplete = true;
- }
- }
- }
- }
- return pageComplete;
- }
-
- // ********** inner classes **********
-
- private class TableTableLabelProvider extends LabelProvider implements ITableLabelProvider {
-
- // ********** constructors **********
-
- TableTableLabelProvider() {
- super();
- }
-
- @Override
- public String getText(Object element) {
- return ((Table) element).getName();
- }
-
- public Image getColumnImage(Object element, int columnIndex) {
- return null;
- }
-
- public String getColumnText(Object element, int columnIndex) {
- if(element == null) {
- return null;
- }
- switch(columnIndex) {
- case TABLE_COLUMN_INDEX:
- return ((Table) element).getName();
- }
- throw new IllegalArgumentException("invalid column index: " + columnIndex);// $NON-NLS-1$
- }
- }
-
-
- private class TableTableContentProvider implements IStructuredContentProvider {
-
- // ********** constructors **********
-
- TableTableContentProvider() {
- super();
- }
-
- public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {}
-
- public void dispose() {}
-
- public Object[] getElements(Object inputElement) {
- return ((Collection<?>) inputElement).toArray();
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/EmbeddedMappingFileWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/EmbeddedMappingFileWizard.java
deleted file mode 100644
index 2cddf4578c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/EmbeddedMappingFileWizard.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.orm;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * This wizard will create a new mapping file without opening it afterwards.
- * It can be used within other wizards where opening the mapping file is
- * unnecessary, making the process smoother.
- */
-public class EmbeddedMappingFileWizard
- extends MappingFileWizard
-{
- public static IPath createNewMappingFile(IStructuredSelection selection) {
- return createNewMappingFile(selection, null);
- }
-
- public static IPath createNewMappingFile(IStructuredSelection selection, String xmlFileName) {
- if (xmlFileName == null) {
- xmlFileName = DEFAULT_XML_FILE_NAME;
- }
- EmbeddedMappingFileWizard wizard = new EmbeddedMappingFileWizard(DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider()));
- return MappingFileWizard.createMappingFile(selection, xmlFileName, wizard);
- }
-
- private static final String DEFAULT_XML_FILE_NAME = "orm.xml"; //$NON-NLS-1$
-
-
- public EmbeddedMappingFileWizard() {
- super();
- }
-
- public EmbeddedMappingFileWizard(IDataModel dataModel) {
- super(dataModel);
- }
-
- @Override
- public final boolean performFinish() {
- return this.createMappingFile();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileNewFileWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileNewFileWizardPage.java
deleted file mode 100644
index 858052f718..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileNewFileWizardPage.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.orm;
-
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.*;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class MappingFileNewFileWizardPage
- extends WizardNewFileCreationPage {
-
- protected IDataModel dataModel;
-
-
- public MappingFileNewFileWizardPage(
- String pageName, IStructuredSelection selection, IDataModel dataModel,
- String title, String description) {
-
- super(pageName, selection);
- init(dataModel);
- setTitle(title);
- setDescription(description);
- }
-
-
- protected void init(IDataModel dataModel) {
- this.dataModel = dataModel;
- IPath containerPath = (IPath) this.dataModel.getProperty(CONTAINER_PATH);
- if (containerPath != null) {
- setContainerFullPath(containerPath);
- }
- String fileName = (String) this.dataModel.getProperty(FILE_NAME);
- if (fileName != null) {
- setFileName(fileName);
- }
- }
-
- @Override
- protected boolean validatePage() {
- this.dataModel.setProperty(CONTAINER_PATH, getContainerFullPath());
- String fileName = getFileName();
- if( fileName != null && !fileName.toLowerCase().endsWith(".xml")) { //$NON-NLS-1$
- fileName = fileName + ".xml"; //$NON-NLS-1$
- }
- this.dataModel.setProperty(FILE_NAME, fileName);
-
- boolean valid = super.validatePage();
- if (! valid) {
- return valid;
- }
-
- IStatus validationStatus = this.dataModel.validateProperty(CONTAINER_PATH);
- if (validationStatus.isOK()) {
- validationStatus = this.dataModel.validateProperty(FILE_NAME);
- }
- if (validationStatus.isOK()) {
- setErrorMessage(null);
- return true;
- }
- else if (validationStatus.getSeverity() == IStatus.WARNING) {
- setErrorMessage(null);
- setMessage(validationStatus.getMessage(), IStatus.WARNING);
- return true;
- }
- else {
- setErrorMessage(validationStatus.getMessage());
- return false;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileOptionsWizardPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileOptionsWizardPage.java
deleted file mode 100644
index d6484a7f06..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileOptionsWizardPage.java
+++ /dev/null
@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.orm;
-
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.*;
-import static org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProperties.*;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardPage;
-
-public class MappingFileOptionsWizardPage
- extends DataModelWizardPage {
-
- private Label accessLabel;
-
- private Combo accessCombo;
-
- private Button addToPersistenceUnitButton;
-
- private Label persistenceUnitLabel;
-
- private Combo persistenceUnitCombo;
-
-
- public MappingFileOptionsWizardPage(
- String pageName, IDataModel dataModel,
- String title, String description) {
-
- super(dataModel, pageName);
- setTitle(title);
- setDescription(description);
- setPageComplete(false);
- }
-
-
- @Override
- protected String[] getValidationPropertyNames() {
- return new String[] {
- CONTAINER_PATH,
- FILE_NAME,
- DEFAULT_ACCESS,
- ADD_TO_PERSISTENCE_UNIT,
- PERSISTENCE_UNIT
- };
- }
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- Composite composite = new Composite(parent, SWT.NULL);
- GridLayout layout = new GridLayout();
- layout.numColumns = 3;
- composite.setLayout(layout);
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
-
- this.accessLabel = new Label(composite, SWT.NONE);
- this.accessLabel.setText(JptUiMessages.MappingFileWizardPage_accessLabel);
- data = new GridData();
- this.accessLabel.setLayoutData(data);
-
- this.accessCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- data.grabExcessHorizontalSpace = true;
- this.accessCombo.setLayoutData(data);
- this.synchHelper.synchCombo(this.accessCombo, DEFAULT_ACCESS, null);
- new Label(composite, SWT.NONE);
-
- this.addToPersistenceUnitButton = new Button(composite, SWT.CHECK | SWT.BEGINNING);
- this.addToPersistenceUnitButton.setText(JptUiMessages.MappingFileWizardPage_addToPersistenceUnitButton);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 3;
- data.verticalIndent = 10;
- this.addToPersistenceUnitButton.setLayoutData(data);
- this.synchHelper.synchCheckbox(this.addToPersistenceUnitButton, ADD_TO_PERSISTENCE_UNIT, null);
-
- this.persistenceUnitLabel = new Label(composite, SWT.NONE);
- this.persistenceUnitLabel.setText(JptUiMessages.MappingFileWizardPage_persistenceUnitLabel);
- data = new GridData();
- data.horizontalIndent = 10;
- this.persistenceUnitLabel.setLayoutData(data);
- this.persistenceUnitLabel.setEnabled(false);
- this.addToPersistenceUnitButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- persistenceUnitLabel.setEnabled(addToPersistenceUnitButton.getSelection());
- }
- public void widgetDefaultSelected(SelectionEvent e) {/*not called*/}
- });
-
- this.persistenceUnitCombo = new Combo(composite, SWT.BORDER | SWT.READ_ONLY);
- data = new GridData(GridData.FILL_HORIZONTAL);
- data.horizontalSpan = 1;
- data.grabExcessHorizontalSpace = true;
- this.persistenceUnitCombo.setLayoutData(data);
- this.synchHelper.synchCombo(this.persistenceUnitCombo, PERSISTENCE_UNIT, null);
-
- new Label(composite, SWT.NONE);
-
-// classText.setFocus();
- PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, getInfopopID());
- Dialog.applyDialogFont(parent);
- return composite;
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java
deleted file mode 100644
index 89d6e966f5..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/orm/MappingFileWizard.java
+++ /dev/null
@@ -1,384 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.orm;
-
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.CONTAINER_PATH;
-import static org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties.FILE_NAME;
-import static org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProperties.ADD_TO_PERSISTENCE_UNIT;
-import static org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProperties.PERSISTENCE_UNIT;
-import java.lang.reflect.InvocationTargetException;
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jdt.core.IJavaProject;
-import org.eclipse.jface.operation.IRunnableWithProgress;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.common.core.internal.utility.PlatformTools;
-import org.eclipse.jpt.common.core.resource.ProjectResourceLocator;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.context.JpaContextNode;
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.ide.IDE;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.IDataModelPausibleOperation;
-import org.eclipse.wst.common.frameworks.internal.dialog.ui.MessageDialog;
-import org.eclipse.wst.common.frameworks.internal.ui.ErrorDialog;
-import org.eclipse.wst.common.frameworks.internal.ui.WTPCommonUIResourceHandler;
-
-public class MappingFileWizard extends Wizard
- implements INewWizard
-{
- protected IDataModel dataModel;
-
- protected IStructuredSelection initialSelection;
-
- protected IStructuredSelection mungedSelection;
-
- private IWizardPage firstPage;
-
- private IWizardPage secondPage;
-
-
- public MappingFileWizard() {
- this(null);
- }
-
- public MappingFileWizard(IDataModel dataModel) {
- super();
- this.dataModel = dataModel;
- setWindowTitle(JptUiMessages.MappingFileWizard_title);
- setDefaultPageImageDescriptor(JptJpaUiPlugin.getImageDescriptor(JptUiIcons.JPA_FILE_WIZ_BANNER));
- }
-
-
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.initialSelection = selection;
- this.mungedSelection = selection;
-
- if (selection == null || selection.isEmpty()) {
- return;
- }
-
- Object firstSelection = selection.getFirstElement();
-
- PersistenceUnit pUnit = extractPersistenceUnit(firstSelection);
- IContainer container = extractContainer(pUnit, firstSelection);
-
- if (container != null) {
- this.mungedSelection = new StructuredSelection(container);
- }
-
- if (pUnit != null) {
- getDataModel().setBooleanProperty(ADD_TO_PERSISTENCE_UNIT, true);
- getDataModel().setStringProperty(PERSISTENCE_UNIT, pUnit.getName());
- }
- }
-
- private PersistenceUnit extractPersistenceUnit(Object selection) {
- if (selection instanceof JpaContextNode) {
- // may be null if node is above level of persistence unit, but in those cases
- // null is the expected result
- return ((JpaContextNode) selection).getPersistenceUnit();
- }
-
- // also get the persistence unit for a given jpa project selection
- JpaProject jpaProject = this.getJpaProject(selection);
- if (jpaProject != null) {
- PersistenceXml persistenceXml = jpaProject.getRootContextNode().getPersistenceXml();
- if (persistenceXml != null){
- Persistence persistence = persistenceXml.getPersistence();
- if ((persistence != null) && (persistence.getPersistenceUnitsSize() > 0)) {
- return persistence.getPersistenceUnit(0);
- }
- }
- }
- return null;
- }
-
- private JpaProject getJpaProject(Object selection) {
- IProject project = this.getProject(selection);
- return (project == null) ? null : this.getJpaProject(project);
- }
-
- private IProject getProject(Object selection) {
- if (selection instanceof IJavaProject) {
- return ((IJavaProject) selection).getProject();
- }
- if (selection instanceof IProject) {
- return (IProject) selection;
- }
- return null;
- }
-
- private JpaProject getJpaProject(IProject project) {
- return (JpaProject) project.getAdapter(JpaProject.class);
- }
-
- private IContainer extractContainer(PersistenceUnit pUnit, Object selection) {
- if (pUnit != null) {
- return pUnit.getResource().getParent();
- }
- if (selection instanceof IProject) {
- return getDefaultContainer((IProject) selection);
- }
- if (selection instanceof IContainer) {
- return (IContainer) selection;
- }
- if (selection instanceof JpaContextNode) {
- return getDefaultContainer(((JpaContextNode) selection).getJpaProject().getProject());
- }
-
- IResource resource = PlatformTools.getAdapter(selection, IResource.class);
- if (resource != null) {
- if (resource instanceof IProject) {
- return getDefaultContainer((IProject) resource);
- }
- if (resource instanceof IContainer) {
- return (IContainer) resource;
- }
- }
- JpaContextNode node = PlatformTools.getAdapter(selection, JpaContextNode.class);
- if (node != null) {
- return getDefaultContainer(node.getJpaProject().getProject());
- }
- return null;
- }
-
- private IContainer getDefaultContainer(IProject project) {
- if (JpaFacet.isInstalled(project)) {
- ProjectResourceLocator locator = (ProjectResourceLocator) project.getAdapter(ProjectResourceLocator.class);
- return locator.getDefaultResourceLocation();
- }
- return project;
- }
-
- @Override
- public void addPages() {
- super.addPages();
- this.firstPage = buildMappingFileNewFileWizardPage();
- this.secondPage = buildMappingFileOptionsWizardPage();
- addPage(this.firstPage);
- addPage(this.secondPage);
- }
-
- protected MappingFileNewFileWizardPage buildMappingFileNewFileWizardPage() {
- return new MappingFileNewFileWizardPage(
- "Page_1", this.mungedSelection, getDataModel(),
- JptUiMessages.MappingFileWizardPage_newFile_title,
- JptUiMessages.MappingFileWizardPage_newFile_desc);
- }
-
- protected MappingFileOptionsWizardPage buildMappingFileOptionsWizardPage() {
- return new MappingFileOptionsWizardPage(
- "Page_2", getDataModel(),
- JptUiMessages.MappingFileWizardPage_options_title,
- JptUiMessages.MappingFileWizardPage_options_desc);
- }
-
- @Override
- public boolean canFinish() {
- // override so that visit to second page is not necessary
- return this.firstPage.isPageComplete() && getDataModel().isValid();
- }
-
- public IDataModel getDataModel() {
- if (this.dataModel == null) {
- this.dataModel = DataModelFactory.createDataModel(getDefaultProvider());
- }
- return this.dataModel;
- }
-
- protected IDataModelProvider getDefaultProvider() {
- return new OrmFileCreationDataModelProvider();
- }
-
- protected IDataModelPausibleOperation getOperation() {
- return (IDataModelPausibleOperation) getDataModel().getDefaultOperation();
- }
-
- @Override
- public boolean performFinish() {
- createMappingFile();
- try {
- postPerformFinish();
- } catch (Exception e) {
- JptJpaUiPlugin.log(e);
- }
- return true;
- }
-
- protected boolean createMappingFile() {
- try {
- final IStatus st = runOperations();
-
- if (st.getSeverity() == IStatus.ERROR) {
- JptJpaUiPlugin.log(st);
- Throwable t = st.getException() == null ? new CoreException(st) : st.getException();
- ErrorDialog.openError(
- getShell(),
- WTPCommonUIResourceHandler.getString(WTPCommonUIResourceHandler.WTPWizard_UI_0, new Object[]{getWindowTitle()}),
- WTPCommonUIResourceHandler.getString(WTPCommonUIResourceHandler.WTPWizard_UI_1, new Object[]{getWindowTitle()}),
- t, 0, false);
- }
- else if(st.getSeverity() == IStatus.WARNING){
- MessageDialog.openWarning(
- getShell(),
- WTPCommonUIResourceHandler.getString(WTPCommonUIResourceHandler.WTPWizard_UI_2, new Object[]{getWindowTitle()}),
- st.getMessage(),
- st, IStatus.WARNING);
- }
- }
- catch (Exception e) {
- JptJpaUiPlugin.log(e);
- ErrorDialog.openError(
- getShell(),
- WTPCommonUIResourceHandler.getString(WTPCommonUIResourceHandler.WTPWizard_UI_0, new Object[]{getWindowTitle()}),
- WTPCommonUIResourceHandler.getString(WTPCommonUIResourceHandler.WTPWizard_UI_1, new Object[]{getWindowTitle()}),
- e, 0, false);
- }
- return true;
- }
-
- protected IStatus runOperations() {
-
- class CatchThrowableRunnableWithProgress
- implements IRunnableWithProgress {
-
- public IStatus status = null;
- public Throwable caught = null;
-
- public void run(IProgressMonitor pm) {
- try {
- status = getOperation().execute(pm, null);
- }
- catch (Throwable e) {
- caught = e;
- }
- }
- }
-
- CatchThrowableRunnableWithProgress runnable = new CatchThrowableRunnableWithProgress();
-
- try {
- getContainer().run(true, false, runnable);
- }
- catch (Throwable e) {
- runnable.caught = e;
- }
-
- if (runnable.caught == null) {
- return runnable.status;
- }
- else {
- JptJpaUiPlugin.log(runnable.caught);
- ErrorDialog.openError(
- getShell(),
- WTPCommonUIResourceHandler.getString(WTPCommonUIResourceHandler.WTPWizard_UI_0, new Object[]{getWindowTitle()}),
- WTPCommonUIResourceHandler.getString(WTPCommonUIResourceHandler.WTPWizard_UI_1, new Object[]{getWindowTitle()}),
- runnable.caught, 0, false);
- return new Status(IStatus.ERROR, "id", 0, runnable.caught.getMessage(), runnable.caught); //$NON-NLS-1$
- }
- }
-
- protected void postPerformFinish()
- throws InvocationTargetException {
-
- try {
- IPath containerPath = (IPath) getDataModel().getProperty(CONTAINER_PATH);
- String fileName = getDataModel().getStringProperty(FILE_NAME);
- IContainer container = PlatformTools.getContainer(containerPath);
- IFile file = container.getFile(new Path(fileName));
- openEditor(file);
- }
- catch (Exception cantOpen) {
- throw new InvocationTargetException(cantOpen);
- }
- }
-
- private void openEditor(final IFile file) {
- if (file != null) {
- getShell().getDisplay().asyncExec(new Runnable() {
- public void run() {
- try {
- IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IDE.openEditor(page, file, true);
- }
- catch (PartInitException e) {
- JptJpaUiPlugin.log(e);
- }
- }
- });
- }
- }
-
- @Override
- public void dispose() {
- super.dispose();
- getDataModel().dispose();
- }
-
- public static IPath createNewMappingFile(IStructuredSelection selection, String xmlFileName) {
- MappingFileWizard wizard = new MappingFileWizard(DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider()));
- return createMappingFile(selection, xmlFileName, wizard);
- }
-
- protected static IPath createMappingFile(IStructuredSelection selection, String xmlFileName, MappingFileWizard wizard) {
- wizard.getDataModel().setProperty(FILE_NAME, xmlFileName);
- wizard.init(PlatformUI.getWorkbench(), selection);
- WizardDialog dialog = new WizardDialog(getCurrentShell(), wizard);
- dialog.create();
- if (dialog.open() == Window.OK) {
- IPath containerPath = (IPath) wizard.getDataModel().getProperty(CONTAINER_PATH);
- String fileName = wizard.getDataModel().getStringProperty(FILE_NAME);
- IContainer container = PlatformTools.getContainer(containerPath);
- IPath filePath = container.getFullPath().append(fileName);
- IProject project = container.getProject();
- ProjectResourceLocator locator = (ProjectResourceLocator) project.getAdapter(ProjectResourceLocator.class);
- IPath runtimePath = locator.getRuntimePath(filePath);
-
- return runtimePath;
- }
- return null;
- }
-
- private static Shell getCurrentShell() {
- return Display.getCurrent().getActiveShell();
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/AddToEarComposite.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/AddToEarComposite.java
deleted file mode 100644
index 3b4f1efa4e..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/AddToEarComposite.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.proj;
-
-import static org.eclipse.jpt.jpa.ui.internal.wizards.proj.model.JpaProjectCreationDataModelProperties.*;
-import static org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties.FACET_RUNTIME;
-import org.eclipse.jface.dialogs.Dialog;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.window.Window;
-import org.eclipse.jface.wizard.WizardDialog;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jst.j2ee.ui.project.facet.EarProjectWizard;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelSynchHelper;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-
-public class AddToEarComposite {
-
- private final Button addToEar;
- private final Combo combo;
- private final Button newButton;
- private final Label label;
-
- private final IDataModel model;
- private DataModelSynchHelper synchhelper;
-
- public AddToEarComposite(IDataModel model, Composite parent) {
- this.model = model;
- this.synchhelper = new DataModelSynchHelper(model);
-
- Group group = new Group(parent, SWT.NONE);
- group.setLayoutData(gdhfill());
- group.setLayout(new GridLayout(3, false));
- group.setText(JptUiMessages.AddToEarComposite_earMemberShip);
-
- this.addToEar = new Button(group, SWT.CHECK);
- this.addToEar.setText(JptUiMessages.AddToEarComposite_addToEarLabel);
- GridDataFactory.defaultsFor(this.addToEar).span(3, 1).applyTo(this.addToEar);
- this.synchhelper.synchCheckbox(addToEar, ADD_TO_EAR, null);
-
- this.label = new Label(group, SWT.NULL);
- this.label.setText(JptUiMessages.AddToEarComposite_earProjectLabel);
- this.combo = new Combo(group, SWT.NONE);
- this.combo.setLayoutData(gdhfill());
-
- this.newButton = new Button(group, SWT.PUSH);
- this.newButton.setText(JptUiMessages.AddToEarComposite_newButtonLabel);
- GridDataFactory.defaultsFor(this.newButton).applyTo(this.newButton);
-
- this.newButton.addSelectionListener(
- new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent event) {
- handleAddButton();
- }
- });
-
- this.synchhelper.synchCombo(combo, EAR_PROJECT_NAME, new Control[]{label, newButton});
- Dialog.applyDialogFont(parent);
- }
-
- private void handleAddButton() {
- EarProjectWizard wizard = new EarProjectWizard();
-
- WizardDialog dialog = new WizardDialog(newButton.getShell(), wizard);
-
- IRuntime runtime = (IRuntime) this.model.getProperty(FACET_RUNTIME);
- wizard.setRuntimeInDataModel(runtime);
-
- if (dialog.open() != Window.CANCEL) {
- this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG);
- String earproj = wizard.getProjectName();
- this.model.setProperty(EAR_PROJECT_NAME, earproj);
- }
- }
-
- private static GridData gdhfill() {
- return new GridData(GridData.FILL_HORIZONTAL);
- }
-
- public static final GridData gdhspan(GridData gd, int span) {
- gd.horizontalSpan = span;
- return gd;
- }
-
- public void dispose() {
- if (this.synchhelper != null){
- this.synchhelper.dispose();
- this.synchhelper = null;
- }
- }
-
- public String getComboText(){
- return this.combo.getText();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/JpaProjectWizard.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/JpaProjectWizard.java
deleted file mode 100644
index c467795ea4..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/JpaProjectWizard.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.proj;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.jface.wizard.IWizardPage;
-import org.eclipse.jpt.jpa.ui.JptJpaUiPlugin;
-import org.eclipse.jpt.jpa.ui.internal.JptUiIcons;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.wizards.proj.model.JpaProjectCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectTemplate;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.web.ui.internal.wizards.NewProjectDataModelFacetWizard;
-
-public class JpaProjectWizard
- extends NewProjectDataModelFacetWizard {
-
- public JpaProjectWizard() {
- super();
- setWindowTitle(JptUiMessages.JpaProjectWizard_title);
- }
-
- public JpaProjectWizard(IDataModel dataModel) {
- super(dataModel);
- setWindowTitle(JptUiMessages.JpaProjectWizard_title);
- }
-
-
- @Override
- protected ImageDescriptor getDefaultPageImageDescriptor() {
- return JptJpaUiPlugin.getImageDescriptor(JptUiIcons.JPA_WIZ_BANNER);
- }
-
- @Override
- protected IWizardPage createFirstPage() {
- return new JpaProjectWizardFirstPage(model, "first.page"); //$NON-NLS-1$
- }
-
- @Override
- protected IDataModel createDataModel() {
- return DataModelFactory.createDataModel(new JpaProjectCreationDataModelProvider());
- }
-
- @Override
- protected IFacetedProjectTemplate getTemplate() {
- return ProjectFacetsManager.getTemplate("jpt.jpa.template");
- }
-
- @Override
- protected String getFinalPerspectiveID() {
- return "org.eclipse.jpt.ui.jpaPerspective";
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/JpaProjectWizardFirstPage.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/JpaProjectWizardFirstPage.java
deleted file mode 100644
index 33b11a0b74..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/JpaProjectWizardFirstPage.java
+++ /dev/null
@@ -1,121 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved. This
- * program and the accompanying materials are made available under the terms of
- * the Eclipse Public License v1.0 which accompanies this distribution, and is
- * available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: Oracle. - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.proj;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.internal.facet.FacetTools;
-import org.eclipse.jpt.jpa.ui.internal.JpaHelpContextIds;
-import org.eclipse.jpt.jpa.ui.internal.JptUiMessages;
-import org.eclipse.jpt.jpa.ui.internal.wizards.proj.model.JpaProjectCreationDataModelProperties;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.web.ui.internal.wizards.DataModelFacetCreationWizardPage;
-
-public class JpaProjectWizardFirstPage
- extends DataModelFacetCreationWizardPage {
-
- private AddToEarComposite addToEarComposite;
-
- public JpaProjectWizardFirstPage(IDataModel dataModel, String pageName) {
- super(dataModel, pageName);
- setTitle(JptUiMessages.NewJpaProjectWizard_firstPage_title);
- setDescription(JptUiMessages.NewJpaProjectWizard_firstPage_description);
- setInfopopID(JpaHelpContextIds.NEW_JPA_PROJECT);
- }
-
-
- @Override
- protected Composite createTopLevelComposite(Composite parent) {
- final Composite top = super.createTopLevelComposite(parent);
- createEarComposite(top);
- createWorkingSetGroupPanel(top, new String[] { RESOURCE_WORKING_SET, JAVA_WORKING_SET });
- return top;
- }
-
- private void createEarComposite(Composite top) {
- this.addToEarComposite = new AddToEarComposite(getDataModel(), top);
- }
-
- @Override
- public boolean internalLaunchNewRuntimeWizard(Shell shell, IDataModel model) {
- IFacetedProjectWorkingCopy fpwc = (IFacetedProjectWorkingCopy) model.getProperty(FACETED_PROJECT_WORKING_COPY);
- IProjectFacetVersion moduleFacet = FacetTools.getModuleFacet(fpwc);
- if (moduleFacet != null) {
- return launchNewRuntimeWizard(shell, model, moduleFacet.getProjectFacet().getId());
- }
- else {
- return launchNewRuntimeWizard(shell, model);
- }
- }
-
- @Override
- protected String getModuleTypeID() {
- return JpaFacet.ID;
- }
-
- @Override
- public void dispose() {
- super.dispose();
- this.addToEarComposite.dispose();
- }
-
- @Override
- public void storeDefaultSettings() {
- super.storeDefaultSettings();
- // TODO
-// IDialogSettings settings = getDialogSettings();
-// if (settings != null) {
-// FacetDataModelMap map = (FacetDataModelMap)model.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
-// String facetID = getModuleFacetID();
-// IDataModel j2eeModel = map.getFacetDataModel(facetID);
-// if(j2eeModel.getBooleanProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR)){
-// String lastEARName = j2eeModel.getStringProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME);
-// settings.put(STORE_LABEL, lastEARName);
-// }
-// }
- }
-
- @Override
- public void restoreDefaultSettings() {
- super.restoreDefaultSettings();
- // TODO
-// IDialogSettings settings = getDialogSettings();
-// if (settings != null) {
-// String lastEARName = settings.get(STORE_LABEL);
-// if (lastEARName != null){
-// FacetDataModelMap map = (FacetDataModelMap)model.getProperty(IFacetProjectCreationDataModelProperties.FACET_DM_MAP);
-// String facetID = getModuleFacetID();
-// IDataModel j2eeModel = map.getFacetDataModel(facetID);
-// j2eeModel.setProperty(IJ2EEModuleFacetInstallDataModelProperties.LAST_EAR_NAME, lastEARName);
-// }
-// }
- }
-
-// @Override
-// protected IDialogSettings getDialogSettings() {
-// return J2EEUIPlugin.getDefault().getDialogSettings();
-// }
-
- @Override
- protected String[] getValidationPropertyNames() {
- String[] superProperties = super.getValidationPropertyNames();
- List list = Arrays.asList(superProperties);
- ArrayList<String> arrayList = new ArrayList<String>();
- arrayList.addAll(list);
- arrayList.add(JpaProjectCreationDataModelProperties.EAR_PROJECT_NAME);
- arrayList.add(JpaProjectCreationDataModelProperties.ADD_TO_EAR );
- return arrayList.toArray( new String[0] );
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProperties.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProperties.java
deleted file mode 100644
index 50968897b1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProperties.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.proj.model;
-
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetProjectCreationDataModelProperties;
-
-public interface JpaProjectCreationDataModelProperties
- extends IFacetProjectCreationDataModelProperties {
-
- public static final String MODULE_FACET_DATA_MODEL
- = "JpaProjectCreationDataModelProperties.MODULE_FACET_DATA_MODEL"; //$NON-NLS-1$
-
- public static final String ADDED_UTILITY_FACET
- = "JpaProjectCreationDataModelProperties.ADDED_UTILITY_FACET"; //$NON-NLS-1$
-
- public static final String ADD_TO_EAR
- = "JpaProjectCreationDataModelProperties.ADD_TO_EAR"; //$NON-NLS-1$
-
- public static final String EAR_PROJECT_NAME
- = "JpaProjectCreationDataModelProperties.EAR_PROJECT_NAME"; //$NON-NLS-1$
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProvider.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProvider.java
deleted file mode 100644
index 156ef59942..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/internal/wizards/proj/model/JpaProjectCreationDataModelProvider.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.internal.wizards.proj.model;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-import java.util.Set;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.jem.util.emf.workbench.ProjectUtilities;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.internal.facet.FacetTools;
-import org.eclipse.jst.common.project.facet.core.JavaFacet;
-import org.eclipse.jst.j2ee.internal.plugin.J2EEPlugin;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEFacetConstants;
-import org.eclipse.jst.j2ee.project.facet.IJ2EEModuleFacetInstallDataModelProperties;
-import org.eclipse.wst.common.componentcore.datamodel.FacetProjectCreationDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModelProviderNew;
-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.IFacetedProject;
-import org.eclipse.wst.common.project.facet.core.IFacetedProjectWorkingCopy;
-import org.eclipse.wst.common.project.facet.core.IProjectFacet;
-import org.eclipse.wst.common.project.facet.core.IProjectFacetVersion;
-import org.eclipse.wst.common.project.facet.core.ProjectFacetsManager;
-import org.eclipse.wst.common.project.facet.core.runtime.IRuntime;
-
-public class JpaProjectCreationDataModelProvider
- extends FacetProjectCreationDataModelProvider
- implements JpaProjectCreationDataModelProperties {
-
- private IDataModelListener moduleFacetDataModelListener;
-
-
- public JpaProjectCreationDataModelProvider() {
- super();
- this.moduleFacetDataModelListener
- = new IDataModelListener() {
- public void propertyChanged(DataModelEvent event) {
- if (IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME.equals(event.getPropertyName())) {
- if (isPropertySet(EAR_PROJECT_NAME)) {
- setProperty(EAR_PROJECT_NAME, event.getProperty());
- }
- else {
- model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG);
- }
- }
- else if (IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR.equals(event.getPropertyName())) {
- setProperty(ADD_TO_EAR, event.getProperty());
- }
- }
- };
- }
-
-
- @Override
- public Set getPropertyNames() {
- Set names = super.getPropertyNames();
- names.add(MODULE_FACET_DATA_MODEL);
- names.add(ADDED_UTILITY_FACET);
- names.add(EAR_PROJECT_NAME);
- names.add(ADD_TO_EAR);
- return names;
- }
-
- @Override
- public void init() {
- super.init();
-
- Collection<IProjectFacet> requiredFacets = new ArrayList<IProjectFacet>();
- requiredFacets.add(JavaFacet.FACET);
- requiredFacets.add(JpaFacet.FACET);
- setProperty(REQUIRED_FACETS_COLLECTION, requiredFacets);
-
- getDataModel().addListener(
- new IDataModelListener() {
- public void propertyChanged(DataModelEvent event) {
- if (FACET_ACTION_MAP.equals(event.getPropertyName())) {
- updateModuleFacetDataModel();
- }
- }
- });
- }
-
- @Override
- public boolean isPropertyEnabled(String propertyName) {
- if (FACET_RUNTIME.equals(propertyName)) {
- if (isAddToEar()) {
- IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME));
- if (status.isOK()) {
- IProject earProject = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME));
- if (earProject != null) {
- IFacetedProject facetedEarProject;
- try {
- facetedEarProject = ProjectFacetsManager.create(earProject);
- if (facetedEarProject != null) {
- return false;
- }
- } catch (CoreException e) {
- J2EEPlugin.logError(e);
- }
- }
- }
- }
- return true;
- }
- else if (EAR_PROJECT_NAME.equals(propertyName)) {
- return isAddToEar();
- }
-
- return super.isPropertyEnabled(propertyName);
- }
-
- @Override
- public Object getDefaultProperty(String propertyName) {
- if (ADDED_UTILITY_FACET.equals(propertyName)) {
- return Boolean.FALSE;
- }
- else if (ADD_TO_EAR.equals(propertyName)) {
- IDataModel moduleFacetDataModel = getModuleFacetDataModel();
- if (moduleFacetDataModel != null) {
- return moduleFacetDataModel.getDefaultProperty(IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR);
- }
- }
- else if (EAR_PROJECT_NAME.equals(propertyName)) {
- IDataModel moduleFacetDataModel = getModuleFacetDataModel();
- if (moduleFacetDataModel !=null) {
- return moduleFacetDataModel.getDefaultProperty(IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME);
- }
- }
-
- return super.getDefaultProperty(propertyName);
- }
-
- @Override
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (FACET_RUNTIME.equals(propertyName) && isAddToEar()) {
- DataModelPropertyDescriptor[] descriptors = super.getValidPropertyDescriptors(propertyName);
- List list = new ArrayList();
- for (int i = 0; i < descriptors.length; i++) {
- IRuntime rt = (IRuntime) descriptors[i].getPropertyValue();
- if (rt == null || rt.supports(IJ2EEFacetConstants.ENTERPRISE_APPLICATION_FACET)) {
- list.add(descriptors[i]);
- }
- }
- descriptors = new DataModelPropertyDescriptor[list.size()];
- for (int i = 0; i < descriptors.length; i++) {
- descriptors[i] = (DataModelPropertyDescriptor) list.get(i);
- }
- return descriptors;
- }
- else if (EAR_PROJECT_NAME.equals(propertyName)) {
- IDataModel moduleFacetDataModel = getModuleFacetDataModel();
- if (moduleFacetDataModel != null) {
- return moduleFacetDataModel.getValidPropertyDescriptors(
- IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME);
- }
- else {
- return new DataModelPropertyDescriptor[0];
- }
- }
-
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- @Override
- public boolean propertySet(String propertyName, Object propertyValue) {
- if (EAR_PROJECT_NAME.equals(propertyName) || ADD_TO_EAR.equals(propertyName) || FACET_RUNTIME.equals(propertyName) || MODULE_FACET_DATA_MODEL.equals(propertyName)) {
- IDataModel moduleFacetDataModel = getModuleFacetDataModel();
- if (moduleFacetDataModel != null){
- if (EAR_PROJECT_NAME.equals(propertyName) || MODULE_FACET_DATA_MODEL.equals(propertyName)) {
- moduleFacetDataModel.setProperty(
- IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME, getEarProjectName());
- }
- if (ADD_TO_EAR.equals(propertyName) || MODULE_FACET_DATA_MODEL.equals(propertyName)) {
- moduleFacetDataModel.setProperty(
- IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR, isAddToEar());
- }
- if (FACET_RUNTIME.equals(propertyName) || MODULE_FACET_DATA_MODEL.equals(propertyName)) {
- moduleFacetDataModel.setProperty(
- IJ2EEModuleFacetInstallDataModelProperties.FACET_RUNTIME, getFacetRuntime());
- }
- }
- if (isAddToEar()) {
- IStatus status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME));
- if (status.isOK()) {
- IProject earProject = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME));
- if (earProject != null) {
- IFacetedProject facetedEarProject;
- try {
- facetedEarProject = ProjectFacetsManager.create(earProject);
- if (facetedEarProject != null) {
- setProperty(FACET_RUNTIME, facetedEarProject.getPrimaryRuntime());
- }
- }
- catch (CoreException e) {
- J2EEPlugin.logError(e);
- }
- }
- }
- }
- if (ADD_TO_EAR.equals(propertyName)) {
- this.model.notifyPropertyChange(FACET_RUNTIME, IDataModel.VALID_VALUES_CHG);
- IProjectFacetVersion moduleFacet = findModuleFacet();
- if (isAddToEar()) {
- if (moduleFacet == null) {
- getFacetedProject().addProjectFacet(IJ2EEFacetConstants.UTILITY_FACET_10);
- setBooleanProperty(ADDED_UTILITY_FACET, true);
- }
- }
- else {
- if (moduleFacet != null && isAddedUtilityFacet()) {
- if (moduleFacet.equals(IJ2EEFacetConstants.UTILITY_FACET_10)) {
- getFacetedProject().removeProjectFacet(IJ2EEFacetConstants.UTILITY_FACET_10);
- }
- setBooleanProperty(ADDED_UTILITY_FACET, false);
- }
- }
- this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.ENABLE_CHG);
- this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG);
- this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALUE_CHG);
- }
- this.model.notifyPropertyChange(FACET_RUNTIME, IDataModel.ENABLE_CHG);
- }
-
- return super.propertySet(propertyName, propertyValue);
- }
-
- @Override
- public IStatus validate(String propertyName) {
- IStatus status = super.validate(propertyName);
-
- if (status == null) {
- status = Status.OK_STATUS;
- }
-
- if (! status.isOK()) {
- return status;
- }
-
- if (ADD_TO_EAR.equals(propertyName) || EAR_PROJECT_NAME.equals(propertyName) || FACET_PROJECT_NAME.equals(propertyName)) {
- if (model.getBooleanProperty(ADD_TO_EAR)) {
- status = validateEAR(model.getStringProperty(EAR_PROJECT_NAME));
- if (status.isOK()) {
- if (getStringProperty(FACET_PROJECT_NAME).equals(getStringProperty(EAR_PROJECT_NAME))) {
- String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.SAME_MODULE_AND_EAR_NAME, new Object[]{getStringProperty(EAR_PROJECT_NAME)});
- status = WTPCommonPlugin.createErrorStatus(errorMessage);
- }
- }
- }
- }
-
- return status;
- }
-
- protected IStatus validateEAR(String earName) {
- if (earName.indexOf("#") != -1 || earName.indexOf("/") != -1) { //$NON-NLS-1$ //$NON-NLS-2$
- String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.ERR_INVALID_CHARS);
- return WTPCommonPlugin.createErrorStatus(errorMessage);
- }
- else if (earName.equals("")) { //$NON-NLS-1$
- String errorMessage = WTPCommonPlugin.getResourceString(WTPCommonMessages.ERR_EMPTY_MODULE_NAME);
- return WTPCommonPlugin.createErrorStatus(errorMessage);
- }
-
- IStatus status = ProjectCreationDataModelProviderNew.validateProjectName(earName);
- //check for the deleted case, the project is deleted from the workspace but still exists in the
- //file system.
- if (status.isOK()) {
- IProject earProject = ProjectUtilities.getProject(getStringProperty(EAR_PROJECT_NAME));
- if (! earProject.exists()) {
- IPath path = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- path = path.append(earName);
- status = ProjectCreationDataModelProviderNew.validateExisting(earName, path.toString());
- }
- }
- return status;
- }
-
- protected void updateModuleFacetDataModel() {
- IDataModel newModuleFacetDataModel = findModuleFacetDataModel();
- IDataModel oldModuleFacetDataModel = getModuleFacetDataModel();
-
- if (oldModuleFacetDataModel != newModuleFacetDataModel) {
- if (oldModuleFacetDataModel != null) {
- oldModuleFacetDataModel.removeListener(this.moduleFacetDataModelListener);
- }
- if (newModuleFacetDataModel != null) {
- newModuleFacetDataModel.setProperty(
- IJ2EEModuleFacetInstallDataModelProperties.ADD_TO_EAR,
- getProperty(ADD_TO_EAR));
- newModuleFacetDataModel.setProperty(
- IJ2EEModuleFacetInstallDataModelProperties.EAR_PROJECT_NAME,
- getProperty(EAR_PROJECT_NAME));
- newModuleFacetDataModel.addListener(this.moduleFacetDataModelListener);
- }
- else {
- this.model.setBooleanProperty(ADD_TO_EAR, false);
- this.model.setBooleanProperty(ADDED_UTILITY_FACET, false);
- }
- setProperty(MODULE_FACET_DATA_MODEL, newModuleFacetDataModel);
- this.model.notifyPropertyChange(ADD_TO_EAR, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.DEFAULT_CHG);
- this.model.notifyPropertyChange(EAR_PROJECT_NAME, IDataModel.VALID_VALUES_CHG);
- }
- }
-
- protected IFacetedProjectWorkingCopy getFacetedProject() {
- return (IFacetedProjectWorkingCopy) this.model.getProperty(FACETED_PROJECT_WORKING_COPY);
- }
-
- protected IRuntime getFacetRuntime() {
- return (IRuntime) getProperty(FACET_RUNTIME);
- }
-
- protected IDataModel getModuleFacetDataModel() {
- return (IDataModel) getProperty(MODULE_FACET_DATA_MODEL);
- }
-
- protected boolean isAddedUtilityFacet() {
- return getBooleanProperty(ADDED_UTILITY_FACET);
- }
-
- protected boolean isAddToEar() {
- return getBooleanProperty(ADD_TO_EAR);
- }
-
- protected String getEarProjectName() {
- return getStringProperty(EAR_PROJECT_NAME);
- }
-
- protected IDataModel findModuleFacetDataModel() {
- FacetActionMap map = (FacetActionMap) getProperty(FACET_ACTION_MAP);
- IProjectFacetVersion moduleFacet = findModuleFacet();
- if (moduleFacet != null) {
- IFacetedProject.Action action = map.getAction(moduleFacet.getProjectFacet().getId());
- return (action == null) ? null : (IDataModel) action.getConfig();
- }
- return null;
- }
-
- protected IProjectFacetVersion findModuleFacet() {
- return FacetTools.getModuleFacet(getFacetedProject());
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/java/JavaUiFactory2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/java/JavaUiFactory2_0.java
deleted file mode 100644
index 32616e75f2..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/java/JavaUiFactory2_0.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.jpa2.details.java;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.java.JavaUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Use {@link JavaUiFactory2_0} to create any java JPA composites
- * <p>
- * Provisional API: This interface is part of an interim API that is still under
- * development and expected to change significantly before reaching stability.
- * It is available at this early stage to solicit feedback from pioneering
- * adopters on the understanding that any code that uses this API will almost
- * certainly be broken (repeatedly) as the API evolves.
- *
- *
- * @version 3.0
- * @since 3.0
- */
-public interface JavaUiFactory2_0
- extends JavaUiFactory
-{
-
- JpaComposite createJavaElementCollectionMapping2_0Composite(
- PropertyValueModel<JavaElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/orm/OrmXmlUiFactory2_0.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/orm/OrmXmlUiFactory2_0.java
deleted file mode 100644
index 159a12dab1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/jpa2/details/orm/OrmXmlUiFactory2_0.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.jpa2.details.orm;
-
-import org.eclipse.jpt.common.ui.WidgetFactory;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.ui.details.JpaComposite;
-import org.eclipse.jpt.jpa.ui.details.orm.OrmXmlUiFactory;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * Use {@link OrmXmlUiFactory2_0} to create any ORM JPA composites
- * <p>
- * Provisional API: This interface is part of an interim API that is still under
- * development and expected to change significantly before reaching stability.
- * It is available at this early stage to solicit 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.jpa.ui.internal.BaseJpaUiFactory
- *
- * @version 3.0
- * @since 3.0
- */
-public interface OrmXmlUiFactory2_0 extends OrmXmlUiFactory
-{
-
- JpaComposite createOrmElementCollectionMapping2_0Composite(
- PropertyValueModel<OrmElementCollectionMapping2_0> subjectHolder,
- Composite parent,
- WidgetFactory widgetFactory);
-
-} \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaEditorManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaEditorManager.java
deleted file mode 100644
index db7cc7b005..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaEditorManager.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.selection;
-
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.ui.IEditorPart;
-
-/**
- * JPA manager implemented for any editor that can affect a page's
- * JPA file and/or selection.
- */
-public interface JpaEditorManager {
- /**
- * Return the manager's editor.
- */
- IEditorPart getEditor();
-
- /**
- * Return the manager's JPA file model.
- * This can be monitored by the corresponding view managers.
- */
- PropertyValueModel<JpaFile> getJpaFileModel();
-
- /**
- * Return the manager's JPA selection model.
- * This can be monitored and changed by the corresponding view managers.
- */
- ModifiablePropertyValueModel<JpaStructureNode> getJpaSelectionModel();
-
- /**
- * Dispose the manager. Remove any listeners from the manager's editor
- * and the JPA selection model and JPA file model.
- */
- void dispose();
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaSelectionManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaSelectionManager.java
deleted file mode 100644
index 8d1179f87a..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaSelectionManager.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.selection;
-
-import java.io.Serializable;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-
-/**
- * Each {@link org.eclipse.ui.IWorkbench workbench}
- * and {@link org.eclipse.ui.IWorkbenchWindow workbench window} has a corresponding
- * {@link JpaSelectionManager JPA selection manager}
- * that can be used to set the JPA selection in that workbench or window.
- * <p>
- * To access a workbench's JPA selection manager:
- * <pre>
- * JpaStructureNode structureNode = ...;
- * IWorkbenchWindow window = ...;
- * IWorkbench workbench = window.getWorkbench();
- * // even though IWorkbench extends IAdaptable, it does not delegate to the
- * // Platform adapter manager; so registered adapter factories are *not* used... :-(
- * // JpaSelectionManager selectionManager = (JpaSelectionManager) workbench.getAdapter(JpaSelectionManager.class);
- * JpaSelectionManager selectionManager = PlatformTools.getAdapter(workbench, JpaSelectionManager.class);
- * selectionManager.setSelection(structureNode);
- * </pre>
- * <p>
- * To access a workbench window's JPA selection manager:
- * <pre>
- * JpaStructureNode structureNode = ...;
- * IWorkbenchWindow window = ...;
- * // IWorkbenchWindow does not extend IAdaptable(!)
- * JpaSelectionManager selectionManager = PlatformTools.getAdapter(window, JpaSelectionManager.class);
- * selectionManager.setSelection(structureNode);
- * </pre>
- *
- * @see org.eclipse.jpt.jpa.ui.internal.selection.WorkbenchAdapterFactory
- * @see org.eclipse.jpt.jpa.ui.internal.selection.WorkbenchWindowAdapterFactory
- * @see org.eclipse.jpt.jpa.ui.internal.selection.JpaWorkbenchManager
- */
-public interface JpaSelectionManager {
- /**
- * Set the JPA selection for the selection manager's subject.
- */
- public void setSelection(JpaStructureNode selection);
-
-
- /**
- * A "null" JPA selection manager does nothing.
- */
- final class Null
- implements JpaSelectionManager, Serializable
- {
- public static final JpaSelectionManager INSTANCE = new Null();
- public static JpaSelectionManager instance() {
- return INSTANCE;
- }
- // ensure single instance
- private Null() {
- super();
- }
- public void setSelection(JpaStructureNode selection) {
- // do nothing
- }
- @Override
- public String toString() {
- return StringTools.buildSingletonToString(this);
- }
- private static final long serialVersionUID = 1L;
- private Object readResolve() {
- // replace this object with the singleton
- return INSTANCE;
- }
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaViewManager.java b/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaViewManager.java
deleted file mode 100644
index 5fdf6b3de0..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/src/org/eclipse/jpt/jpa/ui/selection/JpaViewManager.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.selection;
-
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IViewPart;
-
-/**
- * JPA view manager implemented for any view that can affect a page's
- * JPA selection.
- * <p>
- * Implementations are to be created by their corresponding views when the
- * views are created and {@link PageManager#addViewManager(JpaViewManager) added
- * to the page manager} if the view is to participate in the JPA selection
- * framework.
- * <p>
- * To retrieve the appropriate JPA page manager for a JPA view:
- * <pre>
- * IViewPart view = ...;
- * PageManager pageManager = (PageManager) view.getAdapter(PageManager.class);
- * </pre>
- * @see org.eclipse.jpt.jpa.ui.internal.selection.ViewPartAdapterFactory
- */
-public interface JpaViewManager {
- /**
- * Return the manager's view.
- */
- IViewPart getView();
-
-
- // ********** page manager **********
-
- /**
- * A view manager's parent page manager.
- */
- interface PageManager {
- /**
- * Add the specified view manager to the page manager. Each view
- * manager must add itself to its page manager upon the construction
- * of its view.
- */
- void addViewManager(JpaViewManager viewManager);
-
- /**
- * Remove the specified view manager from the page manager.
- * Each view manager must remove itself from its page manager upon
- * disposal of its view.
- */
- void removeViewManager(JpaViewManager viewManager);
-
- /**
- * Return the JPA editor manager for the specified editor.
- * Return <code>null</code> if the specified editor does not have a
- * corresponding manager.
- * This method can be used by a view manager whose view maintains state
- * for each editor (e.g. an "outline"-type view usually maintains a
- * separate tree for each editor page, so the trees' states do not
- * change as different editor pages are brought to the top of the editor
- * page book).
- *
- * @see #getJpaFileModel()
- * @see #getJpaSelectionModel()
- */
- JpaEditorManager getEditorManager(IEditorPart editor);
-
- /**
- * Return the manager's JPA file model.
- * This can be monitored by the corresponding view managers.
- * This method can used by a view manager whose view maintains state
- * only for the current editor page.
- *
- * @see #getJpaSelectionModel()
- * @see #getEditorManager(IEditorPart)
- */
- PropertyValueModel<JpaFile> getJpaFileModel();
-
- /**
- * Return the manager's JPA selection model.
- * This can be monitored and changed by the corresponding view managers.
- * This method can used by a view manager whose view maintains state
- * only for the current editor page.
- *
- * @see #getJpaFileModel()
- * @see #getEditorManager(IEditorPart)
- */
- ModifiablePropertyValueModel<JpaStructureNode> getJpaSelectionModel();
- }
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/templates/annotated_entity.javajet b/jpa/plugins/org.eclipse.jpt.jpa.ui/templates/annotated_entity.javajet
deleted file mode 100644
index 2b4bc1d95c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/templates/annotated_entity.javajet
+++ /dev/null
@@ -1,64 +0,0 @@
-<%@ jet package="org.eclipse.jpt.jpa.ui.internal.wizards.entity"
- imports="org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.* java.util.* "
- class="AnnotatedEntityTemplate"
-%>
-<% CreateEntityTemplateModel model = (CreateEntityTemplateModel) argument;
-if (model.getJavaPackageName()!=null && model.getJavaPackageName()!="") { %>package <%=model.getJavaPackageName()%>;<%}%>
-
-<% Collection<String> imports = model.getImports(false);
-for (String anImport : imports) { %>
-import <%=anImport%>;
-<% } %>
-
-/**
- * Entity implementation class for Entity: <%=model.getEntityName()%>
- *
- */
-<%=model.getArtifactType()%><%String ENTITY_NAME = model.getEntityName();
-if (model.isEntityNameSet()) {%>(name="<%=ENTITY_NAME%>")<%}%>
-<%if (model.isTableNameSet()) {%>
-@Table(name="<%=model.getTableName()%>")<%}%>
-<%=model.getInheritanceStrategy()%>
-<%if (model.isCompositePK()) {%>
-@IdClass(<%=model.getIdClassName()%>.class)<%}%>
-public class <%=model.getClassName()%><%String superClass = model.getSuperclassName();
- if (! "".equals(superClass)) {%> extends <%=superClass%><%}%><%
- List<String> interfaces = model.getInterfaces();
- if (interfaces.size()>0) {%> implements <% }
- for (int i=0; i<interfaces.size(); i++) {
- String INTERFACE = (String) interfaces.get(i);
- if (i>0) { %>, <%}%><%=INTERFACE%><%}%> {
-
- <% List<EntityRow> fields = model.getEntityFields();
- List<String> pkFields = model.getPKFields();
- for (EntityRow entity : fields) {
- String NAME = entity.getName();
- if (pkFields.contains(NAME) && model.isFieldAccess()) {
- %>
- @Id<%}%>
- private <%=entity.getType()%> <%=entity.getName()%>;<%}%>
- private static final long serialVersionUID = 1L;
-
- public <%=model.getClassName()%>() {
- super();
- }
- <%
- fields = model.getEntityFields();
- if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String TYPE = field.getType();
- String NAME = field.getName();
- String METHOD = NAME.substring(0,1).toUpperCase() + NAME.substring(1);
- if (pkFields.contains(NAME) && !model.isFieldAccess()) {
- %>
- @Id <%}%>
- public <%=TYPE%> get<%=METHOD%>() {
- return this.<%=NAME%>;
- }
-
- public void set<%=METHOD%>(<%=TYPE%> <%=NAME%>) {
- this.<%=NAME%> = <%=NAME%>;
- }
- <%}%>
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/templates/entity.javajet b/jpa/plugins/org.eclipse.jpt.jpa.ui/templates/entity.javajet
deleted file mode 100644
index 98dc806d15..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/templates/entity.javajet
+++ /dev/null
@@ -1,50 +0,0 @@
-<%@ jet package="org.eclipse.jpt.jpa.ui.internal.wizards.entity"
- imports="org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.* java.util.* "
- class="EntityTemplate"
-%>
-<% CreateEntityTemplateModel model = (CreateEntityTemplateModel) argument;
-if (model.getJavaPackageName()!=null && model.getJavaPackageName()!="") { %>package <%=model.getJavaPackageName()%>;<%}%>
-
-<% Collection<String> imports = model.getImports(false);
-for (String anImport : imports) { %>
-import <%=anImport%>;
-<% } %>
-
-/**
- * Entity implementation class for Entity: <%=model.getEntityName()%>
- *
- */
-public class <%=model.getClassName()%><%String superClass = model.getSuperclassName();
- if (! "".equals(superClass)) {%> extends <%=superClass%><%}%><%
- List<String> interfaces = model.getInterfaces();
- if (interfaces.size()>0) {%> implements <% }
- for (int i=0; i<interfaces.size(); i++) {
- String INTERFACE = (String) interfaces.get(i);
- if (i>0) { %>, <%}%><%=INTERFACE%><%}%> {
-
- <% List<EntityRow> fields = model.getEntityFields();
- for (EntityRow entity : fields) {
- %>
- private <%=entity.getType()%> <%=entity.getName()%>;<%}%>
- private static final long serialVersionUID = 1L;
- public <%=model.getClassName()%>() {
- super();
- }
- <%
- fields = model.getEntityFields();
- if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String TYPE = field.getType();
- String NAME = field.getName();
- String METHOD = NAME.substring(0,1).toUpperCase() + NAME.substring(1);
- %>
- public <%=TYPE%> get<%=METHOD%>() {
- return this.<%=NAME%>;
- }
-
- public void set<%=METHOD%>(<%=TYPE%> <%=NAME%>) {
- this.<%=NAME%> = <%=NAME%>;
- }
- <%}%>
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.jpa.ui/templates/idClass.javajet b/jpa/plugins/org.eclipse.jpt.jpa.ui/templates/idClass.javajet
deleted file mode 100644
index 2617675e2c..0000000000
--- a/jpa/plugins/org.eclipse.jpt.jpa.ui/templates/idClass.javajet
+++ /dev/null
@@ -1,124 +0,0 @@
-<%@ jet package="org.eclipse.jpt.jpa.ui.internal.wizards.entity"
- imports="org.eclipse.jpt.jpa.ui.internal.wizards.entity.data.model.* java.util.* "
- class="IdClassTemplate"
-%>
-<% CreateEntityTemplateModel model = (CreateEntityTemplateModel) argument;
-if (model.getJavaPackageName()!=null && model.getJavaPackageName()!="") { %>package <%=model.getJavaPackageName()%>;<%}%>
-
-<% Collection<String> imports = model.getImports(true);
-for (String anImport : imports) { %>
-import <%=anImport%>;
-<% } %>
-
-/**
- * ID class for entity: <%=model.getClassName()%>
- *
- */
-public class <%=model.getIdClassName()%>
-<% List<String> interfaces = model.getInterfaces();
- if (interfaces.size()>0) {%> implements <% }
- for (int i=0; i<interfaces.size(); i++) {
- String INTERFACE = (String) interfaces.get(i);
- if (i>0) { %>, <%}%><%=INTERFACE%><%}%> {
-
- <% List<EntityRow> fields = model.getEntityFields();
- List<String> pkFields = model.getPKFields();
- for (int i=0; i<fields.size(); i++) {
- EntityRow entity = (EntityRow) fields.get(i);
- if (!pkFields.contains(entity.getName())) {
- continue;
- }
- %>
- private <%=entity.getType()%> <%=entity.getName()%>;<%}%>
- private static final long serialVersionUID = 1L;
-
- public <%=model.getIdClassName()%>() {}
-
- <%
- fields = model.getEntityFields();
- if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String TYPE = field.getType();
- String NAME = field.getName();
- if (!pkFields.contains(NAME)) {
- continue;
- }
- String METHOD = NAME.substring(0,1).toUpperCase() + NAME.substring(1);
- %>
-
- public <%=TYPE%> get<%=METHOD%>() {
- return this.<%=NAME%>;
- }
-
- public void set<%=METHOD%>(<%=TYPE%> <%=NAME%>) {
- this.<%=NAME%> = <%=NAME%>;
- }
- <%}%>
-
- /*
- * @see java.lang.Object#equals(Object)
- */
- public boolean equals(Object o) {
- if (o == this) {
- return true;
- }
- if (!(o instanceof <%=model.getIdClassName()%>)) {
- return false;
- }
- <%=model.getIdClassName()%> other = (<%=model.getIdClassName()%>) o;
- return true
-<% if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String NAME = field.getName();
- if (!pkFields.contains(NAME)) {
- continue;
- }%>
-<% String TYPE = field.getType();
- String GET_METHOD = "get" + NAME.substring(0,1).toUpperCase() + NAME.substring(1); %>
-<% if (TYPE.equals("boolean") || TYPE.equals("byte") || TYPE.equals("char") || TYPE.equals("short") || TYPE.equals("int") || TYPE.equals("long")) { %>
- && <%=GET_METHOD%>() == other.<%=GET_METHOD%>()
-<% } else if (TYPE.equals("double")) { %>
- && (Double.doubleToLongBits(<%=GET_METHOD%>()) == Double.doubleToLongBits(other.<%=GET_METHOD%>()))
-<% } else if (TYPE.equals("float")) { %>
- && (Float.floatToIntBits(<%=GET_METHOD%>()) == Float.floatToIntBits(other.<%=GET_METHOD%>()))
-<% } else { %>
- && (<%=GET_METHOD%>() == null ? other.<%=GET_METHOD%>() == null : <%=GET_METHOD%>().equals(other.<%=GET_METHOD%>()))
-<% } %>
-<% } %>;
- }
-
- /*
- * @see java.lang.Object#hashCode()
- */
- public int hashCode() {
- final int prime = 31;
- int result = 1;
-<% if (fields != null) for (int i=0; i<fields.size(); i++) {
- EntityRow field = (EntityRow) fields.get(i);
- String NAME = field.getName();
- if (!pkFields.contains(NAME)) {
- continue;
- }%>
-<% String TYPE = field.getType();
- String GET_METHOD = "get" + NAME.substring(0,1).toUpperCase() + NAME.substring(1); %>
-<% if (TYPE.equals("boolean")) { %>
- result = prime * result + (<%=GET_METHOD%>() ? 1 : 0);
-<% } else if (TYPE.equals("int")) { %>
- result = prime * result + <%=GET_METHOD%>();
-<% } else if (TYPE.equals("byte") || TYPE.equals("char") || TYPE.equals("short")) { %>
- result = prime * result + ((int) <%=GET_METHOD%>());
-<% } else if (TYPE.equals("long")) { %>
- result = prime * result + ((int) (<%=GET_METHOD%>() ^ (<%=GET_METHOD%>() >>> 32)));
-<% } else if (TYPE.equals("double")) { %>
- result = prime * result + ((int) (Double.doubleToLongBits(<%=GET_METHOD%>() ) ^ (Double.doubleToLongBits(<%=GET_METHOD%>()) >>> 32)));
-<% } else if (TYPE.equals("float")) { %>
- result = prime * result + Float.floatToIntBits(<%=GET_METHOD%>());
-<% } else { %>
- result = prime * result + (<%=GET_METHOD%>() == null ? 0 : <%=GET_METHOD%>().hashCode());
-<% } %>
-<% } %>
- return result;
- }
-
-
-}
diff --git a/jpa/plugins/org.eclipse.jpt.ui/.project b/jpa/plugins/org.eclipse.jpt.ui/.project
deleted file mode 100644
index 254a17a7d7..0000000000
--- a/jpa/plugins/org.eclipse.jpt.ui/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.ui</name>
- <comment>renamed to org.eclipse.jpt.jpa.ui</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/plugins/org.eclipse.jpt.utility/.project b/jpa/plugins/org.eclipse.jpt.utility/.project
deleted file mode 100644
index 417751d1f1..0000000000
--- a/jpa/plugins/org.eclipse.jpt.utility/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.utility</name>
- <comment>renamed to org.eclipse.jpt.common.utility and moved to common component</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project b/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project
deleted file mode 100644
index 5eca35f465..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests.extension.resource/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core.tests.extension.resource</name>
- <comment>renamed to org.eclipse.jpt.jpa.core.tests.extension.resource</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.core.tests/.project b/jpa/tests/org.eclipse.jpt.core.tests/.project
deleted file mode 100644
index 5652fd45d3..0000000000
--- a/jpa/tests/org.eclipse.jpt.core.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.core.tests</name>
- <comment>renamed to rg.eclipse.jpt.jpa.core.tests</comment>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.db.tests/.project b/jpa/tests/org.eclipse.jpt.db.tests/.project
deleted file mode 100644
index a1ffb1d2c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.db.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.db.tests</name>
- <comment>renamed to org.eclipse.jpt.jpa.db.tests</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project b/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project
deleted file mode 100644
index baaef71e6a..0000000000
--- a/jpa/tests/org.eclipse.jpt.eclipselink.core.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.eclipselink.core.tests</name>
- <comment>renamed to org.eclipse.jpt.jpa.eclipselink.core.tests</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.gen.tests/.project b/jpa/tests/org.eclipse.jpt.gen.tests/.project
deleted file mode 100644
index 633d887433..0000000000
--- a/jpa/tests/org.eclipse.jpt.gen.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.gen.tests</name>
- <comment>renamed to org.eclipse.jpt.jpa.gen.tests</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.classpath b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.classpath
deleted file mode 100644
index fe3e03bba0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.classpath
+++ /dev/null
@@ -1,13 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.project b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.project
deleted file mode 100644
index b7783a563f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.core.tests.extension.resource</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 839a8cef45..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:34 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/META-INF/MANIFEST.MF
deleted file mode 100644
index 4ebad85e7b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.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.jpa.core.tests.extension.resource;singleton:=true
-Bundle-Version: 3.2.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.core.tests.extension.resource.ExtensionTestPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jdt.core,
- org.eclipse.wst.common.project.facet.core,
- org.eclipse.wst.validation,
- org.eclipse.jpt.common.utility,
- org.eclipse.jpt.common.core,
- org.eclipse.jpt.jpa.core,
- org.eclipse.jpt.jpa.gen,
- org.eclipse.jpt.jpa.db,
- org.eclipse.persistence.jpa.jpql,
- org.eclipse.swt,
- org.eclipse.jpt.common.ui,
- org.eclipse.jpt.jpa.ui
-Export-Package: org.eclipse.jpt.jpa.core.tests.extension.resource;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/about.html b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/build.properties b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/build.properties
deleted file mode 100644
index 6a1163bc4f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/build.properties
+++ /dev/null
@@ -1,17 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- plugin.xml,\
- plugin.properties,\
- about.html
-jars.compile.order = .
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.properties
deleted file mode 100644
index 0558789278..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = Dali Java Persistence Tools - Extension Tests
-providerName = Eclipse Web Tools Platform
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.xml b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.xml
deleted file mode 100644
index 747a8d16d1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/plugin.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.2"?> <!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-
-<plugin>
-
- <extension
- point="org.eclipse.jpt.jpa.core.jpaPlatforms">
-
- <jpaPlatform
- id="core.testJpaPlatform"
- label="Test Jpa Platform"
- factoryClass="org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformFactory"/>
-
- </extension>
-
- <extension
- point="org.eclipse.jpt.jpa.ui.jpaPlatformUis">
-
- <jpaPlatformUi
- id="core.testJpaPlatform.ui"
- jpaPlatform="core.testJpaPlatform"
- factoryClass="org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformUiFactory"/>
-
- </extension>
-
-</plugin>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/ExtensionTestPlugin.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/ExtensionTestPlugin.java
deleted file mode 100644
index ae5cd6e783..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/ExtensionTestPlugin.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The activator class controls the plug-in life cycle
- */
-public class ExtensionTestPlugin extends Plugin {
-
- // The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.jpt.jpa.core.tests.extension.resource"; //$NON-NLS-1$
-
- // The shared instance
- private static ExtensionTestPlugin plugin;
-
- /**
- * The constructor
- */
- public ExtensionTestPlugin() {
- super();
- }
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- plugin = this;
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- plugin = null;
- super.stop(context);
- }
-
- /**
- * Returns the shared instance
- *
- * @return the shared instance
- */
- public static ExtensionTestPlugin getDefault() {
- return plugin;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMapping.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMapping.java
deleted file mode 100644
index ead09942ed..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMapping.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaAttributeMapping;
-
-public class JavaTestAttributeMapping
- extends AbstractJavaAttributeMapping<Annotation>
-{
- public static final String TEST_ATTRIBUTE_MAPPING_KEY = "testAttribute"; //$NON-NLS-1$
- public static final String TEST_ATTRIBUTE_ANNOTATION_NAME = "test.TestAttribute"; //$NON-NLS-1$
-
-
- public JavaTestAttributeMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-
- public String getKey() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY;
- }
-
- @Override
- protected String getAnnotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java
deleted file mode 100644
index 00ba8dc305..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestAttributeMappingDefinition.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-
-public class JavaTestAttributeMappingDefinition
- implements JavaAttributeMappingDefinition
-{
- // singleton
- private static final JavaAttributeMappingDefinition INSTANCE = new JavaTestAttributeMappingDefinition();
-
- /**
- * Return the singleton.
- */
- public static JavaAttributeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaTestAttributeMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JavaTestAttributeMapping.TEST_ATTRIBUTE_ANNOTATION_NAME;
- }
-
- public boolean isSpecified(JavaPersistentAttribute persistentAttribute) {
- return persistentAttribute.getResourceAttribute().getAnnotation(this.getAnnotationName()) != null;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaAttributeMapping buildMapping(JavaPersistentAttribute persistentAttribute, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestAttributeMapping(persistentAttribute);
- }
-
- @Override
- public String toString() {
- return this.getClass().getSimpleName();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java
deleted file mode 100644
index f60da33a87..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMapping.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.context.Query;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaTypeMapping;
-
-public class JavaTestTypeMapping
- extends AbstractJavaTypeMapping<Annotation>
-{
- public static final String TEST_TYPE_MAPPING_KEY = "test"; //$NON-NLS-1$
- public static final String TEST_TYPE_ANNOTATION_NAME = "test.Test"; //$NON-NLS-1$
-
-
- public JavaTestTypeMapping(JavaPersistentType parent) {
- super(parent, null);
- }
-
- public String getKey() {
- return TEST_TYPE_MAPPING_KEY;
- }
-
- public JavaPersistentType getIdClass() {
- return null;
- }
-
- public boolean isMapped() {
- return true;
- }
-
- public boolean tableNameIsInvalid(String tableName) {
- return false;
- }
-
- public Iterable<Query> getQueries() {
- return EmptyIterable.instance();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMappingDefinition.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMappingDefinition.java
deleted file mode 100644
index 6b0be26a03..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/JavaTestTypeMappingDefinition.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.jpa.core.JpaFactory;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-
-public class JavaTestTypeMappingDefinition
- implements JavaTypeMappingDefinition
-{
- // singleton
- private static final JavaTestTypeMappingDefinition INSTANCE = new JavaTestTypeMappingDefinition();
-
- /**
- * Return the singleton
- */
- public static JavaTypeMappingDefinition instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private JavaTestTypeMappingDefinition() {
- super();
- }
-
- public String getKey() {
- return JavaTestTypeMapping.TEST_TYPE_MAPPING_KEY;
- }
-
- public String getAnnotationName() {
- return JavaTestTypeMapping.TEST_TYPE_ANNOTATION_NAME;
- }
-
- public Iterable<String> getSupportingAnnotationNames() {
- return EmptyIterable.instance();
- }
-
- public JavaTestTypeMapping buildMapping(JavaPersistentType persistentType, Annotation annotation, JpaFactory factory) {
- return ((TestJpaFactory) factory).buildJavaTestTypeMapping(persistentType);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaBasicMapping.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaBasicMapping.java
deleted file mode 100644
index c4ade4014e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaBasicMapping.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaBasicMapping;
-
-public class TestJavaBasicMapping
- extends AbstractJavaBasicMapping
-{
- public TestJavaBasicMapping(JavaPersistentAttribute parent) {
- super(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaEntity.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaEntity.java
deleted file mode 100644
index 2aee63a1e2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJavaEntity.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.context.java.AbstractJavaEntity;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCacheable2_0;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-
-public class TestJavaEntity
- extends AbstractJavaEntity
-{
- protected TestJavaEntity(JavaPersistentType parent, EntityAnnotation mappingAnnotation) {
- super(parent, mappingAnnotation);
- }
-
- public JavaCacheable2_0 getCacheable() {
- return null;
- }
-
- public boolean calculateDefaultCacheable() {
- return false;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaFactory.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaFactory.java
deleted file mode 100644
index 1fb3e08be3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaFactory.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaFactory;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-
-public class TestJpaFactory
- extends AbstractJpaFactory
-{
- @Override
- public JavaEntity buildJavaEntity(JavaPersistentType parent, EntityAnnotation entityAnnotation) {
- return new TestJavaEntity(parent, entityAnnotation);
- }
-
- @Override
- public JavaBasicMapping buildJavaBasicMapping(JavaPersistentAttribute parent) {
- return new TestJavaBasicMapping(parent);
- }
-
- public JavaTestTypeMapping buildJavaTestTypeMapping(JavaPersistentType parent) {
- return new JavaTestTypeMapping(parent);
- }
-
- public JavaTestAttributeMapping buildJavaTestAttributeMapping(JavaPersistentAttribute parent) {
- return new JavaTestAttributeMapping(parent);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformFactory.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformFactory.java
deleted file mode 100644
index d148ddcbc5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformFactory.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JpaPlatformFactory;
-import org.eclipse.jpt.jpa.core.JpaPlatformVariation;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatform;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaPlatformFactory.SimpleVersion;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.persistence.jpa.jpql.parser.DefaultJPQLGrammar;
-
-/**
- * All the state in the JPA platform should be "static" (i.e. unchanging once
- * it is initialized).
- */
-@SuppressWarnings("nls")
-public class TestJpaPlatformFactory
- implements JpaPlatformFactory
-{
- /**
- * zero-argument constructor
- */
- public TestJpaPlatformFactory() {
- super();
- }
-
- public JpaPlatform buildJpaPlatform(String id) {
- return new GenericJpaPlatform(
- id,
- buildJpaVersion(),
- new TestJpaFactory(),
- new JpaAnnotationProvider(GenericJpaAnnotationDefinitionProvider.instance()),
- TestJpaPlatformProvider.instance(),
- buildJpaPlatformVariation(),
- DefaultJPQLGrammar.instance());
- }
-
- private JpaPlatform.Version buildJpaVersion() {
- return new SimpleVersion(JpaFacet.VERSION_1_0.getVersionString()) {
- @Override
- public String getVersion() {
- return "BOOOYAH!";
- }
- };
- }
-
- protected JpaPlatformVariation buildJpaPlatformVariation() {
- return new JpaPlatformVariation() {
- public Supported getTablePerConcreteClassInheritanceIsSupported() {
- return Supported.MAYBE;
- }
- public boolean isJoinTableOverridable() {
- return false;
- }
- public AccessType[] getSupportedAccessTypes(JptResourceType resourceType) {
- return GENERIC_SUPPORTED_ACCESS_TYPES;
- }
- };
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformProvider.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformProvider.java
deleted file mode 100644
index 5a072bf5b1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformProvider.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import java.util.ArrayList;
-import org.eclipse.core.runtime.content.IContentType;
-import org.eclipse.jpt.common.core.JptCommonCorePlugin;
-import org.eclipse.jpt.common.core.JptResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.JpaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.ResourceDefinition;
-import org.eclipse.jpt.jpa.core.context.java.DefaultJavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.AbstractJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.internal.JarResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.JavaResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.OrmResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.PersistenceResourceModelProvider;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaBasicMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddableDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEmbeddedMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaEntityDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaIdMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaManyToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaManyToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaMappedSuperclassDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaOneToManyMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaOneToOneMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaTransientMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaVersionMappingDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmXmlDefinition;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.persistence.GenericPersistenceXmlDefinition;
-
-public class TestJpaPlatformProvider extends AbstractJpaPlatformProvider
-{
- public static final String ID = "core.testJpaPlatform"; //$NON-NLS-1$
-
- // singleton
- private static final JpaPlatformProvider INSTANCE = new TestJpaPlatformProvider();
-
-
- /**
- * Return the singleton.
- */
- public static JpaPlatformProvider instance() {
- return INSTANCE;
- }
-
-
- /**
- * Enforce singleton usage
- */
- private TestJpaPlatformProvider() {
- super();
- }
-
-
- // ********** resource models **********
-
- public JptResourceType getMostRecentSupportedResourceType(IContentType contentType) {
- if (contentType.equals(JptCommonCorePlugin.JAVA_SOURCE_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAVA_SOURCE_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptCommonCorePlugin.JAR_CONTENT_TYPE)) {
- return JptCommonCorePlugin.JAR_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.PERSISTENCE_XML_1_0_RESOURCE_TYPE;
- }
- else if (contentType.equals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE)) {
- return JptJpaCorePlugin.ORM_XML_1_0_RESOURCE_TYPE;
- }
- else {
- throw new IllegalArgumentException(contentType.toString());
- }
- }
-
- @Override
- protected void addResourceModelProvidersTo(ArrayList<JpaResourceModelProvider> providers) {
- CollectionTools.addAll(providers, RESOURCE_MODEL_PROVIDERS);
- }
-
- // order should not be important here
- protected static final JpaResourceModelProvider[] RESOURCE_MODEL_PROVIDERS = new JpaResourceModelProvider[] {
- JavaResourceModelProvider.instance(),
- JarResourceModelProvider.instance(),
- PersistenceResourceModelProvider.instance(),
- OrmResourceModelProvider.instance()
- };
-
-
- // ********** Java type mappings **********
-
- @Override
- protected void addJavaTypeMappingDefinitionsTo(ArrayList<JavaTypeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, JAVA_TYPE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by the Reference Implementation (EclipseLink)
- protected static final JavaTypeMappingDefinition[] JAVA_TYPE_MAPPING_DEFINITIONS = new JavaTypeMappingDefinition[] {
- JavaEntityDefinition.instance(),
- JavaEmbeddableDefinition.instance(),
- JavaMappedSuperclassDefinition.instance(),
- JavaTestTypeMappingDefinition.instance() // added
- };
-
-
- // ********** Java attribute mappings **********
-
- @Override
- protected void addDefaultJavaAttributeMappingDefinitionsTo(ArrayList<DefaultJavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by the Reference Implementation (EclipseLink)
- protected static final DefaultJavaAttributeMappingDefinition[] DEFAULT_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new DefaultJavaAttributeMappingDefinition[] {
- JavaEmbeddedMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance()
- };
- @Override
- protected void addSpecifiedJavaAttributeMappingDefinitionsTo(ArrayList<JavaAttributeMappingDefinition> definitions) {
- CollectionTools.addAll(definitions, SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS);
- }
-
- // order matches that used by the Reference Implementation (EclipseLink)
- protected static final JavaAttributeMappingDefinition[] SPECIFIED_JAVA_ATTRIBUTE_MAPPING_DEFINITIONS = new JavaAttributeMappingDefinition[] {
- JavaTransientMappingDefinition.instance(),
- JavaIdMappingDefinition.instance(),
- JavaVersionMappingDefinition.instance(),
- JavaBasicMappingDefinition.instance(),
- JavaEmbeddedMappingDefinition.instance(),
- JavaEmbeddedIdMappingDefinition.instance(),
- JavaManyToManyMappingDefinition.instance(),
- JavaManyToOneMappingDefinition.instance(),
- JavaOneToManyMappingDefinition.instance(),
- JavaOneToOneMappingDefinition.instance(),
- JavaTestAttributeMappingDefinition.instance() // added
- };
-
-
- // ********** resource definitions **********
-
- @Override
- protected void addResourceDefinitionsTo(ArrayList<ResourceDefinition> definitions) {
- CollectionTools.addAll(definitions, RESOURCE_DEFINITIONS);
- }
-
- protected static final ResourceDefinition[] RESOURCE_DEFINITIONS = new ResourceDefinition[] {
- GenericPersistenceXmlDefinition.instance(),
- GenericOrmXmlDefinition.instance()
- };
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformUiFactory.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformUiFactory.java
deleted file mode 100644
index 7bdf7f9ad3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests.extension.resource/src/org/eclipse/jpt/jpa/core/tests/extension/resource/TestJpaPlatformUiFactory.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.extension.resource;
-
-import org.eclipse.jpt.jpa.ui.JpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.JpaPlatformUiFactory;
-import org.eclipse.jpt.jpa.ui.internal.GenericJpaPlatformUiProvider;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUi;
-import org.eclipse.jpt.jpa.ui.internal.platform.generic.GenericJpaPlatformUiFactory;
-
-public class TestJpaPlatformUiFactory
- implements JpaPlatformUiFactory
-{
- /**
- * Zero arg constructor for extension point
- */
- public TestJpaPlatformUiFactory() {
- super();
- }
-
- public JpaPlatformUi buildJpaPlatformUi() {
- return new GenericJpaPlatformUi(
- GenericJpaPlatformUiFactory.NAVIGATOR_FACTORY_PROVIDER,
- GenericJpaPlatformUiProvider.instance()
- );
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.core.tests/.classpath
deleted file mode 100644
index 9bca2d5b69..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.classpath
+++ /dev/null
@@ -1,15 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.core.tests/.project
deleted file mode 100644
index b24f205d61..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index bf070b1a9e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:27 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index b8929c287b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,47 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.core.tests;singleton:=true
-Bundle-Version: 3.2.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.commands;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jdt.launching;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jem.util;bundle-version="[2.0.100,3.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.core.tests.extension.resource;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.common.utility.tests;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.junit;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jpt.jpa.core.tests;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.context;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.metadata;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.model;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.platform;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.projects;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.resource;x-internal:=true,
- org.eclipse.jpt.jpa.core.tests.internal.resource.java;x-internal:=true
-Bundle-Activator: org.eclipse.jpt.jpa.core.tests.JptJpaCoreTestsPlugin
-Bundle-ActivationPolicy: lazy
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/about.html b/jpa/tests/org.eclipse.jpt.jpa.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.core.tests/build.properties
deleted file mode 100644
index 82227ce10a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.core.tests/plugin.properties
deleted file mode 100644
index 113453a4d6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - Core Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/JptJpaCoreTestsPlugin.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/JptJpaCoreTestsPlugin.java
deleted file mode 100644
index f3b96b3b39..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/JptJpaCoreTestsPlugin.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jpa.core.JpaProjectManager;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.prefs.JpaPreferencesManager;
-import org.osgi.framework.BundleContext;
-
-/**
- * Configure the core for testing:<ul>
- * <li>handle events synchronously
- * <li>do not flush preferences
- * </ul>
- */
-@SuppressWarnings("nls")
-public class JptJpaCoreTestsPlugin
- extends Plugin
-{
- private static JptJpaCoreTestsPlugin INSTANCE;
-
- public static JptJpaCoreTestsPlugin instance() {
- return INSTANCE;
- }
-
-
- // ********** plug-in implementation **********
-
- public JptJpaCoreTestsPlugin() {
- super();
- if (INSTANCE != null) {
- throw new IllegalStateException();
- }
- // this convention is *wack*... ~bjv
- INSTANCE = this;
- }
-
-
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- JpaProjectManager jpaProjectManager = this.getJpaProjectManager();
- ReflectionTools.executeMethod(jpaProjectManager, "executeCommandsSynchronously");
- ReflectionTools.setFieldValue(jpaProjectManager, "test", Boolean.TRUE);
- ReflectionTools.executeStaticMethod(JpaPreferencesManager.class, "doNotFlushPreferences");
- }
-
- private JpaProjectManager getJpaProjectManager() {
- return (JpaProjectManager) ResourcesPlugin.getWorkspace().getAdapter(JpaProjectManager.class);
- }
-
- @Override
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/MiscTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/MiscTests.java
deleted file mode 100644
index f0ce85043d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/MiscTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.ILock;
-import org.eclipse.core.runtime.jobs.Job;
-
-@SuppressWarnings("nls")
-public class MiscTests extends TestCase {
-
- public MiscTests(String name) {
- super(name);
- }
-
- /*
- *
- */
- public void testJobsAndLocks() throws Exception {
- ILock lock = Job.getJobManager().newLock();
- Job testJob = new TestJob(lock);
- testJob.schedule();
- }
-
- class TestJob extends Job {
- private final ILock lock;
- TestJob(ILock lock) {
- super("test job");
- this.lock = lock;
- }
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- this.run();
- return Status.OK_STATUS;
- }
- private void run() {
- try {
- this.lock.acquire();
- MiscTests.sleep(100);
- } finally {
- this.lock.release();
- }
- }
- }
-
- static void sleep(long millis) {
- try {
- Thread.sleep(millis);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/JptJpaCoreTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/JptJpaCoreTests.java
deleted file mode 100644
index 85e0c1a8a5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/JptJpaCoreTests.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal;
-
-import java.io.File;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.core.tests.internal.context.JptJpaCoreContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.metadata.JptJpaCoreMetadataTests;
-import org.eclipse.jpt.jpa.core.tests.internal.model.JptJpaCoreModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.JptJpaCoreResourceModelTests;
-
-/**
- * decentralize test creation code
- *
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- */
-@SuppressWarnings("nls")
-public class JptJpaCoreTests {
- private static final String JPA_JAR_PROPERTY = TestJpaProject.JPA_JAR_NAME_SYSTEM_PROPERTY;
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaCoreTests.class.getPackage().getName());
- //****If you add a new suite, you must update test.xml where they are individually listed.
- suite.addTest(JptJpaCoreModelTests.suite());
- suite.addTest(JptJpaCoreResourceModelTests.suite());
- suite.addTest(JptJpaCoreContextModelTests.suite());
- suite.addTest(JptJpaCoreMetadataTests.suite());
- return suite;
- }
-
- public static boolean requiredJarsExists() {
- return jpaJarPropertyExists() && jpaJarFileExists();
- }
-
- public static boolean jpaJarPropertyExists() {
- return getSystemProperty(JPA_JAR_PROPERTY) != null;
- }
-
- public static boolean jpaJarFileExists() {
- return (new File(getSystemProperty(JPA_JAR_PROPERTY))).exists();
- }
-
- public static String buildMissingJarErrorMessage() {
- if( ! jpaJarPropertyExists()) {
- return errorMissingProperty(JPA_JAR_PROPERTY);
- }
- return errorJarFileDoesNotExist(getSystemProperty(JPA_JAR_PROPERTY));
- }
-
- /*********** private **********/
- private static String errorMissingProperty(String propertyName) {
- return "missing Java system property: \"" + propertyName + "\"";
- }
-
- private static String errorJarFileDoesNotExist(String propertyValue) {
- return "JAR file doesn't exist: \"" + propertyValue + "\"";
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
- private JptJpaCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/ContextModelTestCase.java
deleted file mode 100644
index f79ef43756..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/ContextModelTestCase.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context;
-
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.emf.ecore.resource.Resource;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.context.MappingFile;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.jpt.jpa.core.internal.prefs.JpaPreferencesManager;
-import org.eclipse.jpt.jpa.core.platform.GenericPlatform;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.internal.emfworkbench.WorkbenchResourceHelper;
-
-@SuppressWarnings("nls")
-public abstract class ContextModelTestCase extends AnnotationTestCase
-{
- protected static final String BASE_PROJECT_NAME = "ContextModelTestProject";
-
- protected JpaXmlResource persistenceXmlResource;
-
- protected JpaXmlResource ormXmlResource;
-
-
- protected ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.persistenceXmlResource = getJpaProject().getPersistenceXmlResource();
- this.ormXmlResource = getJpaProject().getDefaultOrmXmlResource();
- this.waitForWorkspaceJobsToFinish();
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.persistenceXmlResource = null;
- this.ormXmlResource = null;
- JpaPreferencesManager.clearWorkspacePreferences();
- this.waitForWorkspaceJobsToFinish();
- super.tearDown();
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return buildJpaProject(BASE_PROJECT_NAME, autoBuild, buildJpaConfigDataModel());
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig)
- throws Exception {
- return TestJpaProject.buildJpaProject(projectName, autoBuild, jpaConfig);
- }
-
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = DataModelFactory.createDataModel(new JpaFacetInstallDataModelProvider());
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, this.getJpaFacetVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, this.getJpaPlatformDescription());
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.valueOf(this.createOrmXml()));
- return dataModel;
- }
-
- // default facet version is 2.0 - most tests use 1.0
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_1_0.getVersionString();
- }
-
- // most tests use the basic generic platform
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return GenericPlatform.VERSION_1_0;
- }
-
- // most tests do use an orm.xml
- protected boolean createOrmXml() {
- return true;
- }
-
- protected JpaProject getJpaProject() {
- return getJavaProject().getJpaProject();
- }
-
- protected void waitForWorkspaceJobsToFinish() throws InterruptedException {
- // This job will not start running until all the other workspace jobs are done
- Job waitJob = new Job("Wait job") {
- @Override
- protected IStatus run(IProgressMonitor monitor) {
- return Status.OK_STATUS;
- }
- };
- waitJob.setRule(ResourcesPlugin.getWorkspace().getRoot());
- waitJob.schedule();
- waitJob.join();
- }
-
- protected JpaXmlResource getPersistenceXmlResource() {
- return this.persistenceXmlResource;
- }
-
- protected JpaXmlResource getOrmXmlResource() {
- return this.ormXmlResource;
- }
-
- /**
- * It's nice to be able to call this method from the debugger,
- * to force the XML files to be written out so you can see their current state.
- */
- protected void saveXmlFiles() {
- try {
- this.saveXmlFiles_();
- } catch (Exception ex) {
- throw new RuntimeException(ex);
- }
- }
-
- protected void saveXmlFiles_() throws Exception {
- this.persistenceXmlResource.saveIfNecessary();
- this.ormXmlResource.saveIfNecessary();
- }
-
- protected XmlEntityMappings getXmlEntityMappings() {
- return (XmlEntityMappings) getOrmXmlResource().getRootObject();
- }
-
- protected XmlPersistence getXmlPersistence() {
- return (XmlPersistence) getPersistenceXmlResource().getRootObject();
- }
-
- protected MappingFile getMappingFile() {
- return this.getPersistenceUnit().getMappingFileRefs().iterator().next().getMappingFile();
- }
-
- protected EntityMappings getEntityMappings() {
- MappingFile mappingFile = this.getMappingFile();
- return (mappingFile == null) ? null : (EntityMappings) mappingFile.getRoot();
- }
-
- protected XmlPersistenceUnit getXmlPersistenceUnit() {
- return getXmlPersistence().getPersistenceUnits().get(0);
- }
-
- protected PersistenceUnit getPersistenceUnit() {
- return getRootContextNode().getPersistenceXml().getPersistence().getPersistenceUnits().iterator().next();
- }
-
- protected ClassRef getSpecifiedClassRef() {
- return getPersistenceUnit().getSpecifiedClassRefs().iterator().next();
- }
-
- protected JavaPersistentType getJavaPersistentType() {
- return getSpecifiedClassRef().getJavaPersistentType();
- }
-
- protected JavaEntity getJavaEntity() {
- return (JavaEntity) getJavaPersistentType().getMapping();
- }
-
- protected void addXmlClassRef(String className) {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass(className);
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- }
-
- protected void removeXmlClassRef(String className) {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- XmlJavaClassRef xmlJavaClassRefToRemove = null;
- for (XmlJavaClassRef xmlJavaClassRef : xmlPersistenceUnit.getClasses()) {
- if (xmlJavaClassRef.getJavaClass().equals(className)) {
- xmlJavaClassRefToRemove = xmlJavaClassRef;
- }
- }
- if (xmlJavaClassRefToRemove == null) {
- throw new IllegalArgumentException();
- }
- xmlPersistenceUnit.getClasses().remove(xmlJavaClassRefToRemove);
- }
-
- protected void addXmlMappingFileRef(String fileName) {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName(fileName);
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
- }
-
- protected JpaRootContextNode getRootContextNode() {
- return getJavaProject().getJpaProject().getRootContextNode();
- }
-
- @Override
- protected TestJpaProject getJavaProject() {
- return (TestJpaProject) super.getJavaProject();
- }
-
- protected void deleteResource(Resource resource) throws CoreException {
- WorkbenchResourceHelper.deleteResource(resource);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaFileTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaFileTests.java
deleted file mode 100644
index a1f71f623d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaFileTests.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context;
-
-import java.util.Iterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JpaFile;
-import org.eclipse.jpt.jpa.core.JpaNode;
-import org.eclipse.jpt.jpa.core.JpaStructureNode;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-
-@SuppressWarnings("nls")
-public class JpaFileTests
- extends ContextModelTestCase
-{
- public JpaFileTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private JpaFile getJpaFile(ICompilationUnit cu) {
- return this.getJpaFile((IFile) cu.getResource());
- }
-
- private JpaFile getJpaFile(IFile file) {
- try {
- return this.getJpaFile_(file);
- } catch (InterruptedException ex) {
- Thread.currentThread().interrupt();
- throw new RuntimeException(ex);
- }
- }
-
- private JpaFile getJpaFile_(IFile file) throws InterruptedException {
- return this.getJpaFileReference(file).getValue();
- }
-
- private JpaFile.Reference getJpaFileReference(IFile file) {
- return (JpaFile.Reference) file.getAdapter(JpaFile.Reference.class);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- public void testGetRootStructureNode() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- IFile file = getOrmXmlResource().getFile();
- JpaFile ormXmlJpaFile = this.getJpaFile(file);
-
- assertEquals(getEntityMappings(), ormXmlJpaFile.getRootStructureNodes().iterator().next());
-
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- //verify the mapping file reference "wins" as the root structure node when both
- //persistence.xml <class> tag and mapping file <entity> tag exist for a particulary java class
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- getEntityMappings().removePersistentType(ormPersistentType);
-
- assertEquals(getJavaEntity().getPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
- }
-
- public void testEntityMappingsRootStructureNodeRemoved() throws Exception {
- IFile file = getOrmXmlResource().getFile();
- JpaFile ormXmlJpaFile = this.getJpaFile(file);
- assertEquals(getEntityMappings(), ormXmlJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) ormXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(ormXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testImpliedEntityMappingsRootStructureNodeRemoved() throws Exception {
- IFile file = getOrmXmlResource().getFile();
- JpaFile ormXmlJpaFile = this.getJpaFile(file);
-
- assertNull(getPersistenceUnit().getImpliedMappingFileRef());
-
- getXmlPersistenceUnit().getMappingFiles().remove(0);
- assertNotNull(getPersistenceUnit().getImpliedMappingFileRef());
- assertEquals(getPersistenceUnit().getImpliedMappingFileRef().getMappingFile().getRoot(), ormXmlJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) ormXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(ormXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testEntityMappingsRootStructureNodeRemovedFromResourceModel() throws Exception {
- IFile file = getOrmXmlResource().getFile();
- JpaFile ormXmlJpaFile = this.getJpaFile(file);
- assertEquals(getEntityMappings(), ormXmlJpaFile.getRootStructureNodes().iterator().next());
-
- getOrmXmlResource().getContents().remove(getOrmXmlResource().getRootObject());
-
- assertFalse(ormXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdatePersistenceRootStructureNodePersistenceRemoved() throws Exception {
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile persistenceXmlJpaFile = this.getJpaFile(file);
- assertEquals(getRootContextNode().getPersistenceXml().getPersistence(), persistenceXmlJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) persistenceXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(persistenceXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdateOrmJavaRootStructureNodePersistenceRemoved() throws Exception {
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile persistenceXmlJpaFile = this.getJpaFile(file);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) persistenceXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdateJavaRootStructureNodePersistenceRemoved() throws Exception {
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile persistenceXmlJpaFile = this.getJpaFile(file);
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- assertEquals(getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- JpaXmlResource resource = (JpaXmlResource) persistenceXmlJpaFile.getResourceModel();
- resource.getContents().remove(resource.getRootObject());
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testPersistenceRootStructureNodeRemovedFromResourceModel() throws Exception {
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile persistenceXmlJpaFile = this.getJpaFile(file);
- getRootContextNode().getPersistenceXml().getPersistence();
- assertEquals(getRootContextNode().getPersistenceXml().getPersistence(), persistenceXmlJpaFile.getRootStructureNodes().iterator().next());
-
- getPersistenceXmlResource().getContents().remove(getXmlPersistence());
-
- assertFalse(persistenceXmlJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdateOrmJavaRootStructureNodePersistenceXmlRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- getPersistenceXmlResource().getContents().remove(getXmlPersistence());
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testUpdateJavaRootStructureNodePersistenceXmlRemoved() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- assertEquals(getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- getPersistenceXmlResource().getContents().remove(getXmlPersistence());
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testOrmJavaPersistentTypeRootStructureNodeRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- JpaNode node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertTrue(node.getParent() instanceof OrmPersistentType);
-
-
- getEntityMappings().removePersistentType(0);
-
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertTrue(node.getParent() instanceof ClassRef);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- }
-
- public void testOrmJavaPersistentTypeRootStructureNodeRemovedFromResourceModel() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- JpaNode node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertTrue(node.getParent() instanceof OrmPersistentType);
-
- getXmlEntityMappings().getEntities().remove(0);
-
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertTrue(node.getParent() instanceof ClassRef);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- }
-
- public void testJavaPersistentTypeRootStructureNodeRemoved() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- JpaNode node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertEquals(getEntityMappings().getPersistenceUnit().getSpecifiedClassRefs().iterator().next(), node.getParent());
-
- getEntityMappings().getPersistenceUnit().removeSpecifiedClassRef(0);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertEquals(getEntityMappings().getPersistenceUnit().getImpliedClassRefs().iterator().next(), node.getParent());
- }
-
- public void testJavaPersistentTypeRootStructureNodeRemovedFromResourceModel() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- Iterator<JpaStructureNode> rootStructureNodes = javaJpaFile.getRootStructureNodes().iterator();
- JpaStructureNode rootStructureNode = rootStructureNodes.next();
- assertEquals(javaPersistentType, rootStructureNode);
- assertEquals(getEntityMappings().getPersistenceUnit().getSpecifiedClassRefs().iterator().next(), ((JpaNode) rootStructureNode).getParent());
- assertFalse(rootStructureNodes.hasNext());
-
- removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- JpaNode node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertEquals(getEntityMappings().getPersistenceUnit().getImpliedClassRefs().iterator().next(), node.getParent());
- }
-
- public void testImpliedJavaPersistentTypeRootStructureNodeRemoved() throws Exception {
- getJpaProject().setDiscoversAnnotatedClasses(true);
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- JavaPersistentType javaPersistentType = getPersistenceUnit().getImpliedClassRefs().iterator().next().getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- javaPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- }
-
- public void testJavaRootStructureNodesEntityMappingsRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getOrmXmlResource().getContents().remove(getXmlEntityMappings());
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- JpaNode node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertEquals(getPersistenceUnit().getImpliedClassRefs().iterator().next(), node.getParent());
- }
-
- public void testJavaRootStructureNodesPersistenceUnitRemovedFromResourceModel() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getXmlPersistence().getPersistenceUnits().remove(0);
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- assertEquals(0, javaJpaFile.getRootStructureNodesSize());
- }
-
- public void testJavaRootStructureNodesPersistenceUnitRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getJpaProject().getRootContextNode().getPersistenceXml().getPersistence().removePersistenceUnit(0);
-
- assertFalse(javaJpaFile.getRootStructureNodes().iterator().hasNext());
- assertEquals(0, javaJpaFile.getRootStructureNodesSize());
- }
-
- public void testJavaRootStructureNodesOrmPersistentTypeRemoved() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getEntityMappings().removePersistentType(0);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- JpaNode node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertEquals(getEntityMappings().getPersistenceUnit().getImpliedClassRefs().iterator().next(), node.getParent());
- }
-
- public void testJavaRootStructureNodesOrmTypeMappingMorphed() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- ormPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- javaPersistentType = getEntityMappings().getPersistentTypes().iterator().next().getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
- getEntityMappings().removePersistentType(0);
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- JpaNode node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertEquals(getEntityMappings().getPersistenceUnit().getImpliedClassRefs().iterator().next(), node.getParent());
- }
-
- public void testUpdateOrmJavaRootStructureNodeMappingFileRefChanged() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- MappingFileRef mappingFileRef = getPersistenceUnit().getMappingFileRefs().iterator().next();
- mappingFileRef.setFileName("foo");
-
- ormPersistentType = ((EntityMappings) getPersistenceUnit().getImpliedMappingFileRef().getMappingFile().getRoot()).getPersistentTypes().iterator().next();
- assertEquals(ormPersistentType.getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- IFile file = getPersistenceXmlResource().getFile();
- JpaFile ormXmlJpaFile = this.getJpaFile(file);
-
- assertEquals(1, ormXmlJpaFile.getRootStructureNodesSize());
- }
-
- public void testUpdateJavaRootStructureNodeMappingFileRefChanged() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- assertEquals(getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
-
- MappingFileRef mappingFileRef = getPersistenceUnit().getMappingFileRefs().iterator().next();
- mappingFileRef.setFileName("foo");
- assertEquals(getJavaPersistentType(), javaJpaFile.getRootStructureNodes().iterator().next());
- }
-
-
- public void testUpdateJavaRootStrucutreNodeDeleteOrmResource() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ICompilationUnit cu = createTestEntity();
- JpaFile javaJpaFile = this.getJpaFile(cu);
-
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
- assertEquals(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
-
-
- deleteResource(getOrmXmlResource());
-
- assertNotSame(javaPersistentType, javaJpaFile.getRootStructureNodes().iterator().next());
- assertEquals(1, javaJpaFile.getRootStructureNodesSize());
- JpaNode node = (JpaNode) javaJpaFile.getRootStructureNodes().iterator().next();
- assertEquals(getPersistenceUnit().getImpliedClassRefs().iterator().next(), node.getParent());
- }
- //TODO test rootStructureNodes with a static inner class
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaProjectTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaProjectTests.java
deleted file mode 100644
index 9d161a60e5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JpaProjectTests.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context;
-
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.internal.operations.PersistenceFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.GenericPlatform;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class JpaProjectTests extends TestCase
-{
- static final String BASE_PROJECT_NAME = JpaProjectTests.class.getSimpleName();
-
- TestJpaProject jpaProject;
-
-
- public JpaProjectTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.jpaProject = TestJpaProject.buildJpaProject(BASE_PROJECT_NAME, false, buildJpaConfigDataModel()); // false = no auto-build
- }
-
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = DataModelFactory.createDataModel(new JpaFacetInstallDataModelProvider());
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_1_0.getVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, GenericPlatform.VERSION_1_0);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.jpaProject.getProject().delete(true, true, null);
- this.jpaProject = null;
- super.tearDown();
- }
-
- protected JpaProject getJpaProject() {
- return this.jpaProject.getJpaProject();
- }
-
- public void testGetPersistenceXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getPersistenceXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/persistence.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the persistence.xml file and verify it is not returned from getPersistenceXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getPersistenceXmlResource();
- assertNull(resource);
-
- //add the persistence.xml file back
- createPersistenceXmlFile();
- resource = this.getJpaProject().getPersistenceXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.PERSISTENCE_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/persistence.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- private void createPersistenceXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new PersistenceFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
- //add the default orm.xml file back
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- private void createDefaultOrmXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createOrmXmlFile(String fileName) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, fileName);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
-
- //add the orm.xml file back
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- public void testGetMappingFileResourceDifferentlyName() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //create the orm2.xml file
- createOrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm2.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //add the orm2.xml file back
- createOrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JptJpaCoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JptJpaCoreContextModelTests.java
deleted file mode 100644
index 52c3042f96..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/JptJpaCoreContextModelTests.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.core.tests.internal.JptJpaCoreTests;
-import org.eclipse.jpt.jpa.core.tests.internal.context.java.JptCoreContextJavaModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.context.orm.JptCoreOrmContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.context.persistence.JptCorePersistenceContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java.Generic2_0JavaContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm.Generic2_0OrmContextModelTests;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence.Generic2_0PersistenceContextModelTests;
-
-/**
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- */
-public class JptJpaCoreContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaCoreContextModelTests.class.getPackage().getName());
-
- if (JptJpaCoreTests.requiredJarsExists()) {
- suite.addTestSuite(JpaProjectTests.class);
- suite.addTestSuite(JpaFileTests.class);
- suite.addTest(JptCorePersistenceContextModelTests.suite());
- suite.addTest(JptCoreOrmContextModelTests.suite());
- suite.addTest(JptCoreContextJavaModelTests.suite());
- suite.addTest(Generic2_0JavaContextModelTests.suite());
- suite.addTest(Generic2_0OrmContextModelTests.suite());
- suite.addTest(Generic2_0PersistenceContextModelTests.suite());
- } else {
- suite.addTest(TestSuite.warning(JptJpaCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptJpaCoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java
deleted file mode 100644
index 43bf4247d5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentAttributeTests.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaPersistentAttributeTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
-
- public GenericJavaPersistentAttributeTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
-
- assertEquals("id", persistentAttribute.getName());
- }
-
- public void testGetMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping() instanceof JavaIdMapping);
-
- persistentAttribute.setMappingKey(null);
- assertTrue(persistentAttribute.getMapping() instanceof JavaBasicMapping);
- }
-
- public void testGetSpecifiedMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping() instanceof JavaIdMapping);
-
- persistentAttribute.setMappingKey(null);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testGetSpecifiedMappingNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertNotNull(persistentAttribute.getMapping());
- }
-
- public void testMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
-
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute.setMappingKey(null);
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- }
-
- public void testDefaultMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
-
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
- }
-
- public void testSetSpecifiedMappingKey() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- assertNotNull(resourceAttribute.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertTrue(persistentAttribute.getMapping() instanceof JavaEmbeddedMapping);
- }
-
- public void testSetSpecifiedMappingKey2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- assertNotNull(resourceAttribute.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertTrue(persistentAttribute.getMapping() instanceof JavaEmbeddedMapping);
- }
-
- public void testSetSpecifiedMappingKeyNull() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- assertNull(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME));
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- resourceAttribute.setPrimaryAnnotation(EmbeddedAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel2() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
- resourceAttribute.setPrimaryAnnotation(BasicAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMapping().getKey());
- }
-
- public void testGetAccessField() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(AccessType.FIELD, persistentAttribute.getAccess());
- assertEquals(AccessType.FIELD, persistentAttribute.getDefaultAccess());
- assertEquals(null, persistentAttribute.getSpecifiedAccess());
- }
-
- public void testGetAccessProperty() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertEquals(AccessType.PROPERTY, persistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, persistentAttribute.getDefaultAccess());
- assertEquals(null, persistentAttribute.getSpecifiedAccess());
- }
-
- public void testNonResolvingField() throws Exception {
- createTestEntityWithNonResolvingField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = getJavaPersistentType().getJavaResourceType().getFields().iterator().next();
-
- JavaPersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("foo");
- assertTrue(attribute.isFor(resourceField));
- }
-
- public void testIsPersistableMethod2() throws Exception {
- createTestEntityWithNonResolvingMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<JavaResourceMethod> methods = getJavaPersistentType().getJavaResourceType().getMethods().iterator();
-
- JavaResourceMethod resourceGetter = methods.next();
- JavaResourceMethod resourceSetter = methods.next();
- JavaPersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("foo");
-
- assertTrue(attribute.isFor(resourceGetter, resourceSetter));
- }
-
- private ICompilationUnit createTestEntityWithNonResolvingField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private Foo foo;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonResolvingMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private Foo foo;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- sb.append(CR);
- sb.append(" public Foo getFoo() {").append(CR);
- sb.append(" return this.foo;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append(CR);
- sb.append(" public void setFoo(Foo foo) {").append(CR);
- sb.append(" this.foo = foo;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentTypeTests.java
deleted file mode 100644
index e1bc71fbb7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/GenericJavaPersistentTypeTests.java
+++ /dev/null
@@ -1,935 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.context.java.FieldAccessor;
-import org.eclipse.jpt.jpa.core.internal.context.java.PropertyAccessor;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class GenericJavaPersistentTypeTests extends ContextModelTestCase
-{
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
- private ICompilationUnit createTestEntityAnnotatedFieldAndMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubType() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createTestSubTypeWithFieldAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeWithMethodAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypePersistentExtendsNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild2.java", "AnnotationTestTypeChild2", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends AnnotationTestTypeChild ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedConstructor() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("@Id").append(CR);
- sb.append(" public " + TYPE_NAME + "() {").append(CR);
- sb.append(" super();").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public GenericJavaPersistentTypeTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, getJavaPersistentType().getName());
- }
-
- public void testGetAccessNothingAnnotated() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessField() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessProperty() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
- }
-
- public void testAccessFieldAndMethodAnnotated() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessInheritance() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance2() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance3() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubTypeWithMethodAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance4() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inherited class having annotations set wins over the default access set on persistence-unit-defaults
- public void testAccessInheritancePersistenceUnitDefaultAccess() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.FIELD);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlNoAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
-
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityPropertyAccessAndFieldAnnotations() throws Exception {
- //xml access set to property, field annotations, JavaPersistentType access is field
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityFieldAccessAndPropertyAnnotations() throws Exception {
- //xml access set to field, property annotations, JavaPersistentType access is property
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- ormPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessFieldAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inheritance wins over entity-mappings specified access
- public void testAccessXmlEntityMappingsAccessWithInheritance() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childEntityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- createTestEntityAnnotatedMethod();
- createTestSubType();
- JavaPersistentType childJavaPersistentType = childEntityPersistentType.getJavaPersistentType();
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.PROPERTY, entityPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.PROPERTY, childJavaPersistentType.getAccess());
- }
-
- public void testAccessXmlMetadataCompleteFieldAnnotations() throws Exception {
- //xml access set to property, java has field annotations so the access should be field
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- }
-
- public void testAccessNoXmlAccessXmlMetdataCompletePropertyAnnotations() throws Exception {
- //xml access not set, metadata complete set. JavaPersistentType access is property because properties are annotated
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testSuperPersistentType() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getSuperPersistentType());
- assertNull(rootJavaPersistentType.getSuperPersistentType());
- }
-
- public void testSuperPersistentType2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- //super is not added to the persistenceUnit, but it should still be found
- //as the superPersistentType because of impliedClassRefs and changes for bug 190317
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType javaPersistentType = classRefs.next().getJavaPersistentType();
-
- assertNotNull(javaPersistentType.getSuperPersistentType());
- }
-
- //Entity extends Non-Entity extends Entity
- public void testSuperPersistentType3() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getSuperPersistentType());
- assertNull(rootJavaPersistentType.getSuperPersistentType());
- }
-
- public void testInheritanceHierarchy() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.getInheritanceHierarchy().iterator();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testInheritanceHierarchy2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.getInheritanceHierarchy().iterator();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testGetMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey());
- }
-
- public void testGetMappingNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey());
- }
-
- public void testMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testMappingKeyNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNotNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNotNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKeyNull() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.setPrimaryAnnotation(EmbeddableAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
-
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel2() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.setPrimaryAnnotation(EntityAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testIsMapped() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertTrue(getJavaPersistentType().isMapped());
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertFalse(getJavaPersistentType().isMapped());
- }
-
- public void testAttributes() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
-
- assertEquals("id", attributes.next().getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributes2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
-
- JavaPersistentAttribute attribute = attributes.next();
- assertEquals("id", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof FieldAccessor);
- attribute = attributes.next();
- assertEquals("name", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof FieldAccessor);
- attribute = attributes.next();
- assertEquals("id", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof PropertyAccessor);
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributesSize() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(1, getJavaPersistentType().getAttributesSize());
- }
-
- public void testAttributesSize2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, getJavaPersistentType().getAttributesSize());
- }
-
- public void testAttributeNamed() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("id");
-
- assertEquals("id", attribute.getName());
- assertNull(getJavaPersistentType().getAttributeNamed("name"));
- assertNull(getJavaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testAttributeNamed2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("name");
-
- assertEquals("name", attribute.getName());
-
- assertNull(getJavaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testRenameAttribute() throws Exception {
- ICompilationUnit testType = createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute idAttribute = attributes.next();
- JavaPersistentAttribute nameAttribute = attributes.next();
-
-
- assertEquals("id", idAttribute.getName());
- assertEquals("name", nameAttribute.getName());
-
- IField idField = testType.findPrimaryType().getField("id");
- idField.rename("id2", false, null);
-
- attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute nameAttribute2 = attributes.next();
- JavaPersistentAttribute id2Attribute = attributes.next();
-
- assertNotSame(idAttribute, id2Attribute);
- assertEquals("id2", id2Attribute.getName());
- assertEquals(nameAttribute, nameAttribute2);
- assertEquals("name", nameAttribute2.getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testSuperPersistentTypeGeneric() throws Exception {
- createTestGenericEntity();
- createTestGenericMappedSuperclass();
-
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Entity2");
-
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- assertEquals("test.Entity1", javaPersistentType.getName());
- assertNotNull(javaPersistentType.getSuperPersistentType());
-
- assertEquals("test.Entity2", javaPersistentType.getSuperPersistentType().getName());
- }
-
- private void createTestGenericEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 ");
- sb.append("extends Entity2<Integer> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericMappedSuperclass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class Entity2<K> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity2.java", sourceWriter);
- }
-
-
- public void testGetAccessNoAttributesAnnotated() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessFieldsAnnotated() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessMethodsAnnotated() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessFieldsAndMethodsAnnotated() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessNonPersistableMethodAnnotated() throws Exception {
- createTestEntityAnnotatedNonPersistableMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessPersistableMethodAndNonPersistableFieldAnnotated() throws Exception {
- createTestEntityAnnotatedPersistableMethodNonPersistableField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- public void testGetAccessNoPersistableFieldsAnnotated() throws Exception {
- createTestEntityNoPersistableFields();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- //this is invalid and covered by validation (bug 360002)
- public void testGetAccessConstructorAnnotated() throws Exception {
- createTestEntityAnnotatedConstructor();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getDefaultAccess());
- assertNull(javaPersistentType.getSpecifiedAccess());
- }
-
- private ICompilationUnit createTestEntityAnnotatedNonPersistableMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetNameMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedPersistableMethodNonPersistableField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column");
- sb.append(" private transient int notPersistable;").append(CR);
- sb.append(CR);
-
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Column");
- }
- });
- }
-
- private ICompilationUnit createTestEntityNoPersistableFields() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.delete(sb.indexOf("private int id;"), sb.indexOf("private int id;") + "private int id;".length());
- sb.delete(sb.indexOf("private String name;"), sb.indexOf("private String name;") + "private String name;".length());
- }
- });
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAssociationOverrideTests.java
deleted file mode 100644
index b5e0df8915..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAssociationOverrideTests.java
+++ /dev/null
@@ -1,447 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaAssociationOverrideTests extends ContextModelTestCase
-{
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE_NAME";
-
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(CR);
- sb.append(" private AnnotationTestTypeChild address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public JavaAssociationOverrideTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME_ + "AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- VirtualAssociationOverride virtualOverride = overrideContainer.getVirtualOverrides().iterator().next();
- AssociationOverride javaAssociationOverride = virtualOverride.convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", javaAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
-
- //set name in the resource model, verify context model updated
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- //set name to null in the resource model
- associationOverrideResource.setName(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
- assertNull(associationOverrideResource.getName());
-
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, overrideContainer.getSpecifiedOverridesSize());
- javaAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator().hasNext());
- }
-
- public void testModifyName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- AssociationOverride javaAssociationOverride = virtualAssociationOverride.convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", javaAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
-
- //set name in the context model, verify resource model modified
- javaAssociationOverride.setName("foo");
- assertEquals("foo", javaAssociationOverride.getName());
- assertEquals("foo", associationOverrideResource.getName());
-
- //set name to null in the context model
- javaAssociationOverride.setName(null);
- assertNull(javaAssociationOverride.getName());
- associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- assertNull(associationOverrideResource.getName());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- JavaVirtualAssociationOverride virtualOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedOverride = virtualOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideAnnotation = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
-
- JavaJoinColumn joinColumn1 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn1.setSpecifiedName("FOO");
-
- assertEquals("FOO", associationOverrideAnnotation.joinColumnAt(0).getName());
-
- JavaJoinColumn joinColumn2 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", associationOverrideAnnotation.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverrideAnnotation.joinColumnAt(1).getName());
-
- JavaJoinColumn joinColumn3 = joiningStrategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideAnnotation.getJoinColumnsSize());
- assertEquals("BAR", associationOverrideAnnotation.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideAnnotation.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideAnnotation.joinColumnAt(2).getName());
- assertEquals("address_id", associationOverrideAnnotation.joinColumnAt(3).getName()); // the old default join column
-
- assertEquals(4, joiningStrategy.getSpecifiedJoinColumnsSize());
- ListIterator<JavaJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn1, joinColumns.next());
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName()); // the old default join column
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- JavaVirtualAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedOverride = javaAssociationOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals(1, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(3, associationOverrideResource.getJoinColumnsSize());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, associationOverrideResource.getJoinColumnsSize());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, associationOverrideResource.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- JavaVirtualAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedOverride = javaAssociationOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideResource.getJoinColumnsSize());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- JavaVirtualAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedOverride = javaAssociationOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- ListIterator<JavaJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- JoinColumn joinColumn = joinColumns.next();
- assertEquals("address_id", joinColumn.getSpecifiedName());
- assertEquals("id", joinColumn.getSpecifiedReferencedColumnName());
-
-
- associationOverrideResource.addJoinColumn(0);
- associationOverrideResource.addJoinColumn(1);
- associationOverrideResource.addJoinColumn(2);
-
- associationOverrideResource.joinColumnAt(0).setName("FOO");
- associationOverrideResource.joinColumnAt(1).setName("BAR");
- associationOverrideResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("address_id", joinColumns.next().getName());
-
- associationOverrideResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joiningStrategy.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", specifiedAssociationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
- specifiedAssociationOverride.setName("FOO");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("FOO", associationOverrideResource.getName());
- }
-
- public void testDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", associationOverride.getName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = entity.getAssociationOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertTrue(associationOverride.isVirtual());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAttributeOverrideTests.java
deleted file mode 100644
index 35bb9702ae..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaAttributeOverrideTests.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaAttributeOverrideTests extends ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "MY_ATTRIBUTE_OVERRIDE_NAME";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "MY_ATTRIBUTE_OVERRIDE_COLUMN_NAME";
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithAttributeOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public JavaAttributeOverrideTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- attributeOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", specifiedAttributeOverride.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
-
- specifiedAttributeOverride.setName("FOO");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertEquals("FOO", attributeOverrideResource.getName());
- }
-
- public void testColumnGetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation columnResource = attributeOverrideResource.getColumn();
- columnResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
-
- column = overrideContainer.getSpecifiedOverrides().iterator().next().getColumn();
- assertEquals("FOO", column.getName());
- }
-
- public void testColumnSetName() throws Exception {
- createTestEntityWithAttributeOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getName());
-
- column.setSpecifiedName("FOO");
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- ColumnAnnotation columnResource = attributeOverrideResource.getColumn();
-
- assertEquals("FOO", columnResource.getName());
-
- column.setSpecifiedName(null);
-
- attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertNull(attributeOverrideResource.getColumn());
- assertNotNull(specifiedAttributeOverride.getColumn());
- }
-
- public void testColumnDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- AttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", attributeOverride.getColumn().getDefaultName());
-
-
- JavaPersistentType mappedSuperclass = CollectionTools.list(getPersistenceUnit().getSpecifiedClassRefs()).get(1).getJavaPersistentType();
- BasicMapping basicMapping = (BasicMapping) mappedSuperclass.getAttributeNamed("id").getMapping();
- basicMapping.getColumn().setSpecifiedName("FOO");
-
- attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("FOO", attributeOverride.getColumn().getDefaultName());
- }
-
- public void testColumnDefaultTableName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- AttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("AnnotationTestTypeChild", attributeOverride.getColumn().getDefaultTable());
-
-
- JavaPersistentType mappedSuperclass = CollectionTools.list(getPersistenceUnit().getSpecifiedClassRefs()).get(1).getJavaPersistentType();
- BasicMapping basicMapping = (BasicMapping) mappedSuperclass.getAttributeNamed("id").getMapping();
- basicMapping.getColumn().setSpecifiedTable("BAR");
-
- attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("BAR", attributeOverride.getColumn().getDefaultTable());
- }
-
- public void testDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- AttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", attributeOverride.getName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- AttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertTrue(attributeOverride.isVirtual());
- }
-
- public void testSetColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- JavaVirtualAttributeOverride attributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- attributeOverride.convertToSpecified().getColumn().setSpecifiedName("FOO");
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AttributeOverrideAnnotation attributeOverrideResource = (AttributeOverrideAnnotation) resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertEquals("FOO", attributeOverrideResource.getColumn().getName());
- assertEquals("FOO", overrideContainer.getSpecifiedOverrides().iterator().next().getColumn().getSpecifiedName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaBasicMappingTests.java
deleted file mode 100644
index 4675a60f81..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaBasicMappingTests.java
+++ /dev/null
@@ -1,997 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.LobConverter;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaBasicMappingTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithBasicMappingFetchOptionalSpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(fetch=FetchType.EAGER, optional=false)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithLob() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.LOB);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Lob").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEnumerated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Enumerated(EnumType.STRING)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Temporal(TemporalType.TIMESTAMP)").append(CR);
- }
- });
- }
-
- public JavaBasicMappingTests(String name) {
- super(name);
- }
-
- public void testDefaultBasicGetDefaultFetch() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(FetchType.EAGER, basicMapping.getDefaultFetch());
- }
-
- public void testSpecifiedBasicGetDefaultFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(FetchType.EAGER, basicMapping.getDefaultFetch());
- }
-
- public void testGetFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(FetchType.EAGER, basicMapping.getFetch());
-
- basicMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, basicMapping.getFetch());
- }
-
- public void testGetSpecifiedFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getSpecifiedFetch());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- basic.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(FetchType.LAZY, basicMapping.getSpecifiedFetch());
- }
-
- public void testGetSpecifiedFetch2() throws Exception {
- createTestEntityWithBasicMappingFetchOptionalSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(FetchType.EAGER, basicMapping.getSpecifiedFetch());
- }
-
- public void testSetSpecifiedFetch() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedFetch());
-
- basicMapping.setSpecifiedFetch(FetchType.LAZY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, basic.getFetch());
-
- basicMapping.setSpecifiedFetch(null);
- assertNotNull(resourceField.getAnnotation(JPA.BASIC));
- }
-
- public void testSetSpecifiedFetch2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- createOrmXmlFile();
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedFetch());
- assertTrue(basicMapping.isDefault());
-
- basicMapping.setSpecifiedFetch(FetchType.LAZY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceMethod resourceMethod = resourceType.getMethods().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceMethod.getAnnotation(JPA.BASIC);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, basic.getFetch());
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(FetchType.LAZY, basicMapping.getSpecifiedFetch());
- assertFalse(basicMapping.isDefault());
-
- basicMapping.setSpecifiedFetch(null);
- assertNotNull(resourceMethod.getAnnotation(JPA.BASIC));
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- }
-
- protected void createOrmXmlFile() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testSetBasicToDefault() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(basicMapping.isDefault());
-
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
-
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNotSame(basicMapping, persistentAttribute.getMapping());
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertTrue(basicMapping.isDefault());
- assertEquals("FOO", basicMapping.getColumn().getSpecifiedName());
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToDefaultBasic() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseEnumeratedConverter.class);
- ((BaseEnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getEnumType());
-
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToVersion() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbedded() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbeddedId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToTransient() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IOneToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((IOneToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IOneToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertNotNull(resourceField.mappingAnnotation(OneToMany.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
- public void testBasicMorphToManyToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((IManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToManyToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((IManyToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertNotNull(resourceField.mappingAnnotation(ManyToMany.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultBasicGetDefaultOptional() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(true, basicMapping.isDefaultOptional());
- }
-
- public void testSpecifiedBasicGetDefaultOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(true, basicMapping.isDefaultOptional());
- }
-
- public void testGetOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(true, basicMapping.isOptional());
-
- basicMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(true, basicMapping.isOptional());
- }
-
- public void testGetSpecifiedOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getSpecifiedOptional());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- basic.setOptional(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
- }
-
- public void testGetSpecifiedOptional2() throws Exception {
- createTestEntityWithBasicMappingFetchOptionalSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
- }
-
- public void testSetSpecifiedOptional() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedOptional());
-
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
-
- assertEquals(Boolean.FALSE, basic.getOptional());
-
- basicMapping.setSpecifiedOptional(null);
- assertNotNull(resourceField.getAnnotation(JPA.BASIC));
- }
-
- public void testSetSpecifiedOptional2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getSpecifiedOptional());
- assertTrue(basicMapping.isDefault());
-
- basicMapping.setSpecifiedOptional(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
-
- assertEquals(Boolean.TRUE, basic.getOptional());
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertEquals(Boolean.TRUE, basicMapping.getSpecifiedOptional());
- assertFalse(basicMapping.isDefault());
-
- basicMapping.setSpecifiedOptional(null);
- assertNotNull(resourceField.getAnnotation(JPA.BASIC));
-
- basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- }
-
-
- public void testGetSpecifiedOptionalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getSpecifiedOptional());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- basic.setOptional(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
-
- basic.setOptional(null);
- getJpaProject().synchronizeContextModel();
- assertNull(basicMapping.getSpecifiedOptional());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
-
- basic.setOptional(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(true, ((BasicMapping) persistentAttribute.getMapping()).isOptional());
- }
-
-
- public void testIsLob() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertFalse(basicMapping.getConverter().getType() == LobConverter.class);
- }
-
- public void testIsLob2() throws Exception {
- createTestEntityWithLob();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertTrue(basicMapping.getConverter().getType() == LobConverter.class);
- }
-
- public void testSetLob() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- basicMapping.setConverter(LobConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
-
- basicMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- }
-
- public void testIsLobUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertFalse(basicMapping.getConverter().getType() == LobConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertTrue(basicMapping.getConverter().getType() == LobConverter.class);
-
- resourceField.removeAnnotation(LobAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertFalse(basicMapping.getConverter().getType() == LobConverter.class);
- }
-
- public void testDefaultBasicGetDefaultConverter() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
- }
-
- public void testSpecifiedBasicGetDefaultConverter() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
- }
-
- public void testGetEnumerated() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EnumeratedAnnotation enumeratedAnnotation = (EnumeratedAnnotation) resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) basicMapping.getConverter()).getDefaultEnumType());
-
- enumeratedAnnotation.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
- }
-
- public void testGetSpecifiedEnumerated() throws Exception {
- createTestEntityWithEnumerated();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
- }
-
- public void testSetSpecifiedEnumerated() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
-
- basicMapping.setConverter(BaseEnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((BaseEnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((BaseEnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- basicMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNull(((BaseEnumeratedConverter) basicMapping.getConverter()).getSpecifiedEnumType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
- }
-
- public void testGetTemporal() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(BaseTemporalConverter.class, basicMapping.getConverter().getType());
- }
-
- public void testGetTemporal2() throws Exception {
- createTestEntityWithTemporal();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(BaseTemporalConverter.class, basicMapping.getConverter().getType());
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) basicMapping.getConverter()).getTemporalType());
- }
-
- public void testSetTemporal() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
-
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- basicMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.DATE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(BaseTemporalConverter.class, basicMapping.getConverter().getType());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) basicMapping.getConverter()).getTemporalType());
-
- resourceField.removeAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getConverter().getType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
- }
-
- public void testGetColumn() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
- assertEquals("id", basicMapping.getColumn().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", basicMapping.getColumn().getSpecifiedName());
- assertEquals("foo", basicMapping.getColumn().getName());
- assertEquals("id", basicMapping.getColumn().getDefaultName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaCascadeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaCascadeTests.java
deleted file mode 100644
index b2fe6086c3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaCascadeTests.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaCascade;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaCascadeTests
- extends ContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
-
- public JavaCascadeTests(String name) {
- super(name);
- }
-
-
- public void testUpdateCascadeAll() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isAll());
- assertFalse(annotation.isCascadeAll());
-
- //set all in the resource model, verify context model updated
- annotation.setCascadeAll(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeAll());
- assertTrue(cascade.isAll());
-
- //set all to false in the resource model
- annotation.setCascadeAll(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeAll());
- assertFalse(cascade.isAll());
- }
-
- public void testModifyCascadeAll() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isAll());
- assertFalse(annotation.isCascadeAll());
-
- //set all in the context model, verify resource model updated
- cascade.setAll(true);
- assertTrue(annotation.isCascadeAll());
- assertTrue(cascade.isAll());
-
- //set all to false in the context model
- cascade.setAll(false);
- assertFalse(annotation.isCascadeAll());
- assertFalse(cascade.isAll());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isPersist());
- assertFalse(annotation.isCascadePersist());
-
- //set persist in the resource model, verify context model updated
- annotation.setCascadePersist(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadePersist());
- assertTrue(cascade.isPersist());
-
- //set persist to false in the resource model
- annotation.setCascadePersist(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadePersist());
- assertFalse(cascade.isPersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isPersist());
- assertFalse(annotation.isCascadePersist());
-
- //set persist in the context model, verify resource model updated
- cascade.setPersist(true);
- assertTrue(annotation.isCascadePersist());
- assertTrue(cascade.isPersist());
-
- //set persist to false in the context model
- cascade.setPersist(false);
- assertFalse(annotation.isCascadePersist());
- assertFalse(cascade.isPersist());
- }
-
- public void testUpdateCascadeMerge() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isMerge());
- assertFalse(annotation.isCascadeMerge());
-
- //set merge in the resource model, verify context model updated
- annotation.setCascadeMerge(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeMerge());
- assertTrue(cascade.isMerge());
-
- //set merge to false in the resource model
- annotation.setCascadeMerge(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeMerge());
- assertFalse(cascade.isMerge());
- }
-
- public void testModifyCascadeMerge() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isMerge());
- assertFalse(annotation.isCascadeMerge());
-
- //set merge in the context model, verify resource model updated
- cascade.setMerge(true);
- assertTrue(annotation.isCascadeMerge());
- assertTrue(cascade.isMerge());
-
- //set merge to false in the context model
- cascade.setMerge(false);
- assertFalse(annotation.isCascadeMerge());
- assertFalse(cascade.isMerge());
- }
-
- public void testUpdateCascadeRemove() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isRemove());
- assertFalse(annotation.isCascadeRemove());
-
- //set remove in the resource model, verify context model updated
- annotation.setCascadeRemove(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeRemove());
- assertTrue(cascade.isRemove());
-
- //set remove to false in the resource model
- annotation.setCascadeRemove(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeRemove());
- assertFalse(cascade.isRemove());
- }
-
- public void testModifyCascadeRemove() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isRemove());
- assertFalse(annotation.isCascadeRemove());
-
- //set remove in the context model, verify resource model updated
- cascade.setRemove(true);
- assertTrue(annotation.isCascadeRemove());
- assertTrue(cascade.isRemove());
-
- //set remove to false in the context model
- cascade.setRemove(false);
- assertFalse(annotation.isCascadeRemove());
- assertFalse(cascade.isRemove());
- }
-
- public void testUpdateCascadeRefresh() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isRefresh());
- assertFalse(annotation.isCascadeRefresh());
-
- //set refresh in the resource model, verify context model updated
- annotation.setCascadeRefresh(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeRefresh());
- assertTrue(cascade.isRefresh());
-
- //set refresh to false in the resource model
- annotation.setCascadeRefresh(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeRefresh());
- assertFalse(cascade.isRefresh());
- }
-
- public void testModifyCascadeRefresh() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping mapping = (JavaOneToOneMapping) persistentAttribute.getMapping();
- JavaCascade cascade = mapping.getCascade();
-
- assertFalse(cascade.isRefresh());
- assertFalse(annotation.isCascadeRefresh());
-
- //set refresh in the context model, verify resource model updated
- cascade.setRefresh(true);
- assertTrue(annotation.isCascadeRefresh());
- assertTrue(cascade.isRefresh());
-
- //set refresh to false in the context model
- cascade.setRefresh(false);
- assertFalse(annotation.isCascadeRefresh());
- assertFalse(cascade.isRefresh());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaColumnTests.java
deleted file mode 100644
index 5df35938fb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaColumnTests.java
+++ /dev/null
@@ -1,844 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyBaseColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaColumnTests extends ContextModelTestCase
-{
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String COLUMN_DEFINITION = "MY_COLUMN_DEFINITION";
-
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDefaultBasicColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name=\"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithBasicColumnTableSet() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Column(table=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithBasicColumnColumnDefinitionSet() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Column(columnDefinition=\"" + COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- public JavaColumnTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(COLUMN_NAME, basicMapping.getColumn().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(basicMapping.getPersistentAttribute().getName(), basicMapping.getColumn().getDefaultName());
- assertEquals("id", basicMapping.getColumn().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("id", basicMapping.getColumn().getDefaultName());
-
- basicMapping.getColumn().setSpecifiedName("foo");
- assertEquals("id", basicMapping.getColumn().getDefaultName());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals("id", basicMapping.getColumn().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(COLUMN_NAME, basicMapping.getColumn().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedName("foo");
-
- assertEquals("foo", basicMapping.getColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals("foo", column.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedName(null);
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetNameUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
-
- columnAnnotation.setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", basicMapping.getColumn().getSpecifiedName());
- assertEquals("foo", basicMapping.getColumn().getName());
-
- columnAnnotation.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(basicMapping.getColumn().getSpecifiedName());
- }
-
-
-
-
-
-
-
-
-
-
-
-
-
- public void testGetSpecifiedTableNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedTable());
- }
-
- public void testGetSpecifiedTable() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(TABLE_NAME, basicMapping.getColumn().getSpecifiedTable());
- }
-
- public void testGetDefaultTableSpecifiedTableNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(((Entity) basicMapping.getTypeMapping()).getName(), basicMapping.getColumn().getDefaultTable());
- assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable());
- }
-
- public void testGetDefaultTable() throws Exception {
- createTestEntityWithDefaultBasicColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable());
-
- basicMapping.getColumn().setSpecifiedTable("foo");
- assertEquals(TYPE_NAME, basicMapping.getColumn().getDefaultTable());
- }
-
- public void testGetTable() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(TABLE_NAME, basicMapping.getColumn().getTable());
- }
-
- public void testSetSpecifiedTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedTable("foo");
-
- assertEquals("foo", basicMapping.getColumn().getSpecifiedTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals("foo", column.getTable());
- }
-
- public void testSetSpecifiedTableNull() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setSpecifiedTable(null);
-
- assertNull(basicMapping.getColumn().getSpecifiedTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetTableUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
-
- column.setTable("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", basicMapping.getColumn().getSpecifiedTable());
- assertEquals("foo", basicMapping.getColumn().getTable());
-
- column.setTable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(basicMapping.getColumn().getSpecifiedTable());
- }
-
- public void testGetColumnDefinition() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(COLUMN_DEFINITION, basicMapping.getColumn().getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- createTestEntityWithBasicColumnTableSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- basicMapping.getColumn().setColumnDefinition("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals("foo", column.getColumnDefinition());
-
- basicMapping.getColumn().setColumnDefinition(null);
- assertNull(column.getColumnDefinition());
- }
-
- public void testGetColumnDefinitionUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getColumnDefinition());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
-
- column.setColumnDefinition("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", basicMapping.getColumn().getColumnDefinition());
-
- column.setColumnDefinition(null);
- getJpaProject().synchronizeContextModel();
- assertNull(basicMapping.getColumn().getColumnDefinition());
-
- }
-
- public void testGetLength() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, basicMapping.getColumn().getLength());
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(55));
- assertEquals(55, basicMapping.getColumn().getLength());
- }
-
- public void testGetDefaultLength() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, basicMapping.getColumn().getDefaultLength());
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(55));
-
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, basicMapping.getColumn().getDefaultLength());
- }
-
- public void testGetSpecifiedLength() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedLength());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setLength(Integer.valueOf(66));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getSpecifiedLength());
- assertEquals(66, basicMapping.getColumn().getLength());
-
- columnAnnotation.setLength(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedLength());
- }
-
- public void testSetSpecifiedLength() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedLength());
-
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(100));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(100), columnAnnotation.getLength());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedLength(null);
-
- assertNull(columnAnnotation.getLength());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetPrecision() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, basicMapping.getColumn().getPrecision());
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(55));
- assertEquals(55, basicMapping.getColumn().getPrecision());
- }
-
- public void testGetDefaultPrecision() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, basicMapping.getColumn().getDefaultPrecision());
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(55));
-
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, basicMapping.getColumn().getDefaultPrecision());
- }
-
- public void testGetSpecifiedPrecision() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedPrecision());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setPrecision(Integer.valueOf(66));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getSpecifiedPrecision());
- assertEquals(66, basicMapping.getColumn().getPrecision());
-
- columnAnnotation.setPrecision(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedPrecision());
- }
-
- public void testSetSpecifiedPrecision() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedPrecision());
-
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(100));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(100), columnAnnotation.getPrecision());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedPrecision(null);
-
- assertNull(columnAnnotation.getPrecision());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetScale() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, basicMapping.getColumn().getScale());
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(55));
- assertEquals(55, basicMapping.getColumn().getScale());
- }
-
- public void testGetDefaultScale() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, basicMapping.getColumn().getDefaultScale());
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(55));
-
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, basicMapping.getColumn().getDefaultScale());
- }
-
- public void testGetSpecifiedScale() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedScale());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setScale(Integer.valueOf(66));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(66), basicMapping.getColumn().getSpecifiedScale());
- assertEquals(66, basicMapping.getColumn().getScale());
-
- columnAnnotation.setScale(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedScale());
- }
-
- public void testSetSpecifiedScale() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedScale());
-
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(100));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(100), columnAnnotation.getScale());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedScale(null);
-
- assertNull(columnAnnotation.getScale());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetUnique() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().isUnique());
- basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- assertEquals(true, basicMapping.getColumn().isUnique());
- }
-
- public void testGetDefaultUnique() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().isDefaultUnique());
- basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UNIQUE, basicMapping.getColumn().isDefaultUnique());
- }
-
- public void testGetSpecifiedUnique() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUnique());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setUnique(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedUnique());
- assertEquals(true, basicMapping.getColumn().isUnique());
-
- columnAnnotation.setUnique(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedUnique());
- }
-
- public void testSetSpecifiedUnique() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUnique());
-
- basicMapping.getColumn().setSpecifiedUnique(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, columnAnnotation.getUnique());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedUnique(null);
-
- assertNull(columnAnnotation.getUnique());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetInsertable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().isInsertable());
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.TRUE);
- assertEquals(true, basicMapping.getColumn().isInsertable());
- }
-
- public void testGetDefaultInsertable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().isDefaultInsertable());
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.TRUE);
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_INSERTABLE, basicMapping.getColumn().isDefaultInsertable());
- }
-
- public void testGetSpecifiedInsertable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedInsertable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setInsertable(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedInsertable());
- assertEquals(true, basicMapping.getColumn().isInsertable());
-
- columnAnnotation.setInsertable(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedInsertable());
- }
-
- public void testSetSpecifiedInsertable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedInsertable());
-
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, columnAnnotation.getInsertable());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedInsertable(null);
-
- assertNull(columnAnnotation.getInsertable());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetNullable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().isNullable());
- basicMapping.getColumn().setSpecifiedNullable(Boolean.TRUE);
- assertEquals(true, basicMapping.getColumn().isNullable());
- }
-
- public void testGetDefaultNullable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().isDefaultNullable());
- basicMapping.getColumn().setSpecifiedNullable(Boolean.TRUE);
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_NULLABLE, basicMapping.getColumn().isDefaultNullable());
- }
-
- public void testGetSpecifiedNullable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedNullable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setNullable(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedNullable());
- assertEquals(true, basicMapping.getColumn().isNullable());
-
- columnAnnotation.setNullable(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedNullable());
- }
-
- public void testSetSpecifiedNullable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedNullable());
-
- basicMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, columnAnnotation.getNullable());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedNullable(null);
-
- assertNull(columnAnnotation.getNullable());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-
- public void testGetUpdatable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().isUpdatable());
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.TRUE);
- assertEquals(true, basicMapping.getColumn().isUpdatable());
- }
-
- public void testGetDefaultUpdatable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().isDefaultUpdatable());
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.TRUE);
-
- assertEquals(ReadOnlyBaseColumn.DEFAULT_UPDATABLE, basicMapping.getColumn().isDefaultUpdatable());
- }
-
- public void testGetSpecifiedUpdatable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUpdatable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- columnAnnotation.setUpdatable(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, basicMapping.getColumn().getSpecifiedUpdatable());
- assertEquals(true, basicMapping.getColumn().isUpdatable());
-
- columnAnnotation.setUpdatable(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getColumn().getSpecifiedUpdatable());
- }
-
- public void testSetSpecifiedUpdatable() throws Exception {
- createTestEntityWithBasicColumnColumnDefinitionSet();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- BasicMapping basicMapping = (BasicMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
-
- assertNull(basicMapping.getColumn().getSpecifiedUpdatable());
-
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation columnAnnotation = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.FALSE, columnAnnotation.getUpdatable());
-
- basicMapping.getColumn().setColumnDefinition(null);
- basicMapping.getColumn().setSpecifiedUpdatable(null);
-
- assertNull(columnAnnotation.getUpdatable());
- assertNull(resourceField.getAnnotation(JPA.COLUMN));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java
deleted file mode 100644
index d9dacae611..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaDiscriminatorColumnTests.java
+++ /dev/null
@@ -1,459 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaDiscriminatorColumnTests extends ContextModelTestCase
-{
- private static final String DISCRIMINATOR_COLUMN_NAME = "MY_DISCRIMINATOR_COLUMN";
- private static final String COLUMN_DEFINITION = "MY_COLUMN_DEFINITION";
-
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@DiscriminatorColumn(name=\"" + DISCRIMINATOR_COLUMN_NAME + "\")");
- }
- });
- }
-
- private void createTestAbstractEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
- public JavaDiscriminatorColumnTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_COLUMN_NAME, getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDefaultName());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDefaultName());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getDefaultName());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName("foo");
- assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getDefaultName());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getName());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals("DTYPE", getJavaEntity().getDiscriminatorColumn().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_COLUMN_NAME, getJavaEntity().getDiscriminatorColumn().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName("foo");
-
- assertEquals("foo", getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals("foo", discriminatorColumn.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName(null);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNull(discriminatorColumn);
- }
-
- public void testGetDefaultDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DiscriminatorType.STRING, getJavaEntity().getDiscriminatorColumn().getDefaultDiscriminatorType());
- }
-
- public void testGetDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DiscriminatorType.STRING, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
- assertEquals(DiscriminatorType.CHAR, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
- }
-
- public void testGetSpecifiedDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- discriminatorColumn.setDiscriminatorType(org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType.CHAR);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(DiscriminatorType.CHAR, getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
- }
-
- public void testSetSpecifiedDiscriminatorType() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType.CHAR, discriminatorColumn.getDiscriminatorType());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName(null);
- getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(null);
- assertNull(resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN));
- }
-
- public void testGetDiscriminatorTypeUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.addAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- column.setDiscriminatorType(org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType.INTEGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(DiscriminatorType.INTEGER, getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
- assertEquals(DiscriminatorType.INTEGER, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- column.setDiscriminatorType(null);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedDiscriminatorType());
- assertEquals(null, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, getJavaEntity().getDiscriminatorColumn().getDiscriminatorType());
- }
-
- public void testGetLength() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, getJavaEntity().getDiscriminatorColumn().getLength());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getLength());
- getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55));
- assertEquals(55, getJavaEntity().getDiscriminatorColumn().getLength());
- }
-
- public void testGetDefaultLength() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, getJavaEntity().getDiscriminatorColumn().getDefaultLength());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getDefaultLength());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(55));
-
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getDefaultLength());
- }
-
- public void testGetSpecifiedLength() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- discriminatorColumn.setLength(Integer.valueOf(66));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(66), getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(66, getJavaEntity().getDiscriminatorColumn().getLength());
- discriminatorColumn.setName(null);
- discriminatorColumn.setLength(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
- }
-
- public void testSetSpecifiedLength() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(100));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation discriminatorColumn = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(Integer.valueOf(100), discriminatorColumn.getLength());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedName(null);
- getJavaEntity().getDiscriminatorColumn().setSpecifiedLength(null);
- assertNull(resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN));
- }
-
- public void testGetLengthUpdatesFromResourceChange() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.addAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- column.setLength(Integer.valueOf(78));
- getJpaProject().synchronizeContextModel();
- assertEquals(Integer.valueOf(78), getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(78, getJavaEntity().getDiscriminatorColumn().getLength());
-
- column.setLength(null);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(0, getJavaEntity().getDiscriminatorColumn().getLength());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, getJavaEntity().getDiscriminatorColumn().getLength());
- }
-
-
- public void testGetColumnDefinition() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getColumnDefinition());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- column.setColumnDefinition(COLUMN_DEFINITION);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(COLUMN_DEFINITION, getJavaEntity().getDiscriminatorColumn().getColumnDefinition());
-
- column.setColumnDefinition(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getColumnDefinition());
-
- resourceType.removeAnnotation(JPA.DISCRIMINATOR_COLUMN);
- }
-
- public void testSetColumnDefinition() throws Exception {
- createTestEntityWithDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getDiscriminatorColumn().setColumnDefinition("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals("foo", column.getColumnDefinition());
-
- getJavaEntity().getDiscriminatorColumn().setColumnDefinition(null);
- column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertNull(column.getColumnDefinition());
- }
-
- public void testDefaults() throws Exception {
- createTestAbstractEntity();
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + "." + "AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- JavaEntity childEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
-
- //test defaults with single-table inheritance, no specified discriminator column set
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
-
- //test defaults with single-table inheritance, specified discriminator column set on root
- abstractEntity.getDiscriminatorColumn().setSpecifiedName("DTYPE2");
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(5));
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
-
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- assertEquals("DTYPE2", abstractEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals(Integer.valueOf(5), abstractEntity.getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(DiscriminatorType.CHAR, abstractEntity.getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals("DTYPE2", childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(5, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.CHAR, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
-
- //test defaults with table-per-class inheritance, discriminator column does not apply
- abstractEntity.getDiscriminatorColumn().setSpecifiedName(null);
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(null);
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(null);
- abstractEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getInheritanceStrategy());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(0, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, childEntity.getDefaultInheritanceStrategy());
- assertEquals(null, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(0, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(null, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddableTests.java
deleted file mode 100644
index c096920447..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddableTests.java
+++ /dev/null
@@ -1,171 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAbstractType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaEmbeddableTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable");
- }
- });
- }
-
-
- public JavaEmbeddableTests(String name) {
- super(name);
- }
-
- public void testMorphToEntity() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Entity);
-
- JavaResourceAbstractType resourceType = getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToMappedSuperclass() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass);
-
- JavaResourceAbstractType resourceType = getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- JavaResourceAbstractType resourceType = getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
- assertNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
- }
-
- public void testEmbeddable() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable);
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = embeddable.getOverridableAttributeNames().iterator();
- assertEquals(overridableAttributeNames.next(), "id");
- assertEquals(overridableAttributeNames.next(), "name");
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = embeddable.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testTableNameIsInvalid() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
-
- assertFalse(embeddable.tableNameIsInvalid(FULLY_QUALIFIED_TYPE_NAME));
- assertFalse(embeddable.tableNameIsInvalid("FOO"));
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
- assertTrue(embeddable.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(embeddable.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertFalse(embeddable.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
-
- public void testAssociatedTables() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
-
- assertFalse(embeddable.getAssociatedTables().iterator().hasNext());
- }
-
- public void testAssociatedTablesIncludingInherited() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
-
- assertFalse(embeddable.getAllAssociatedTables().iterator().hasNext());
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
-
- assertFalse(embeddable.getAllAssociatedTableNames().iterator().hasNext());
- }
-
- //TODO need to create a subclass mappedSuperclass and test this
- public void testAllOverridableAssociationNames() throws Exception {
- createTestEmbeddable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Embeddable embeddable = (Embeddable) getJavaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = embeddable.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java
deleted file mode 100644
index 7ce0b398e8..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedIdMappingTests.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaEmbeddedIdMappingTests extends ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@EmbeddedId").append(CR);
- sb.append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME +" myEmbeddedId;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
-
- public JavaEmbeddedIdMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((JavaEmbeddedMapping) persistentAttribute.getMapping()).getAttributeOverrideContainer().getOverrides().iterator().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("myEmbeddedId", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("myEmbeddedId", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state");
- getJpaProject().synchronizeContextModel();
- assertEquals(0, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state", virtualAttributeOverrides.next().getName());
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) getJavaPersistentType().getAttributeNamed("myEmbeddedId").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java
deleted file mode 100644
index c7ce2cafd5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEmbeddedMappingTests.java
+++ /dev/null
@@ -1,861 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaEmbeddedMappingTests extends ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded").append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME + " myEmbedded;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
- private void createTestEntityCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Customer").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
-
- public JavaEmbeddedMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((EmbeddedMapping) persistentAttribute.getMapping()).getAttributeOverrideContainer().getOverrides().iterator().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testDefaultEmbeddedMappingGenericEmbeddable() throws Exception {
- createTestEntityWithDefaultEmbeddedMapping();
- createTestGenericEmbeddable();
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Embeddable1");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertNotNull(persistentAttribute.getMapping());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- private void createTestEntityWithDefaultEmbeddedMapping() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 { ").append(CR);
- sb.append("private Embeddable1<Integer> myEmbeddable;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericEmbeddable() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class Embeddable1<T> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Embeddable1.java", sourceWriter);
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state");
- getJpaProject().synchronizeContextModel();
- assertEquals(0, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state", virtualAttributeOverrides.next().getName());
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- //1.0 projects do not support dot-notation, this tests to make sure that support does not exist
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType customerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- assertEquals(false, virtualAttributeOverrides.hasNext());
-
-
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- EmbeddedMapping nestedEmbeddedMapping = (EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping();
- AttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("plusfour", virtualAttributeOverride.getName());
-
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.zipCode) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour");
- assertEquals("plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //check the top-level embedded (Customer.address) attribute override to verify there is no attribute override named zipCode.plusfour
- virtualAttributeOverride = ((EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java
deleted file mode 100644
index d16f3b80ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaEntityTests.java
+++ /dev/null
@@ -1,3438 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.NamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyTable;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaEntityTests extends ContextModelTestCase
-{
- private static final String ENTITY_NAME = "entityName";
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String DISCRIMINATOR_VALUE = "MY_DISCRIMINATOR_VALUE";
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public JavaEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityInvalidNamedQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.NAMED_QUERIES, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@NamedQueries(value={@NamedQuery(query=\"asdf\", name=\"foo\"), @NamedQuer})");
- }
- });
- }
-
- private void createTestAbstractEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
- private ICompilationUnit createTestEntityAnnotationOnProperty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.MAPPED_SUPERCLASS,
- JPA.BASIC,
- JPA.VERSION,
- JPA.TRANSIENT,
- JPA.EMBEDDED,
- JPA.EMBEDDED_ID,
- JPA.ONE_TO_ONE,
- JPA.ONE_TO_MANY,
- JPA.MANY_TO_ONE,
- JPA.MANY_TO_MANY,
- JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @Basic");
- sb.append(CR);
- sb.append(" private int basic;").append(CR);
- sb.append(CR);
- sb.append(" @Version");
- sb.append(CR);
- sb.append(" private int version;").append(CR);
- sb.append(CR);
- sb.append(" @Transient");
- sb.append(CR);
- sb.append(" private int transient;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded");
- sb.append(CR);
- sb.append(" private int embedded;").append(CR);
- sb.append(CR);
- sb.append(" @EmbeddedId");
- sb.append(CR);
- sb.append(" private int embeddedId;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private " + SUB_TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int oneToMany;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int manyToOne;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int manyToMany;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity(name=\"" + ENTITY_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Table(name=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithInheritance() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDiscriminatorValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.DISCRIMINATOR_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@DiscriminatorValue(value=\"" + DISCRIMINATOR_VALUE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTable(name=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name=\"foo\"), @SecondaryTable(name=\"bar\")})");
- }
- });
- }
-
- private ICompilationUnit createAbstractTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- sb.append("abstract");
- }
- });
- }
-
- private void createTestIdClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append("TestTypeId").append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "TestTypeId.java", sourceWriter);
- }
-
- public void testMorphToMappedSuperclass() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = (JavaEntity) getJavaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.getGeneratorContainer().addTableGenerator();
- entity.getGeneratorContainer().addSequenceGenerator();
- entity.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- entity.getQueryContainer().addNamedNativeQuery(0);
- entity.getQueryContainer().addNamedQuery(0);
-
- getJavaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass);
-
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = (JavaEntity) getJavaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.getGeneratorContainer().addTableGenerator();
- entity.getGeneratorContainer().addSequenceGenerator();
- entity.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- entity.getQueryContainer().addNamedNativeQuery(0);
- entity.getQueryContainer().addNamedQuery(0);
-
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable);
-
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = (JavaEntity) getJavaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.getGeneratorContainer().addTableGenerator();
- entity.getGeneratorContainer().addSequenceGenerator();
- entity.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- entity.getQueryContainer().addNamedNativeQuery(0);
- entity.getQueryContainer().addNamedQuery(0);
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
- }
-
- public void testAccessNoAnnotations() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessAnnotationsOnSuper() throws Exception {
- createTestEntityAnnotationOnProperty();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME_ + "AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- JavaPersistentType childPersistentType = getJavaPersistentType();
- PersistentType superPersistentType = childPersistentType.getSuperPersistentType();
-
- assertEquals(AccessType.PROPERTY, superPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- ((IdMapping) superPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("FOO");
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- resourceType.getMethods().iterator().next().removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- //no mapping(Id) annotation, but still a Column annotation, so access should still be property
- assertEquals(AccessType.PROPERTY, superPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- ((BasicMapping) superPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName(null);
- assertEquals(AccessType.FIELD, superPersistentType.getAccess());
- assertEquals(AccessType.FIELD, childPersistentType.getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, superPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- //still accessType of PROPERTY because the java class is not specified in this orm.xml
- assertEquals(AccessType.PROPERTY, superPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, childPersistentType.getAccess());
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //only parent specified in orm.xml, i think this outcome is right??
- assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.FIELD, childPersistentType.getAccess());
-
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- removeXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- //both parent and child specified in orm.xml
- assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.FIELD, childOrmPersistentType.getJavaPersistentType().getAccess());
- }
-
- public void testAccessWithXmlSettings() throws Exception {
- createTestEntityAnnotationOnProperty();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("FOO");
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- resourceType.getMethods().iterator().next().removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- //no mapping(Id) annotation, but still a Column annotation, so access should still be property
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- ((BasicMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- //still accessType of PROPERTY because the java class is not specified in this orm.xml
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //now class is specified in orm.xml, so entityMappings access setting wins over persistence-unit-defaults
- assertEquals(AccessType.FIELD, ormPersistentType.getJavaPersistentType().getAccess());
-
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
-
- //accessType should be PROPERTY now, java gets the access from xml entity if it is specified
- assertEquals(AccessType.PROPERTY, ormPersistentType.getJavaPersistentType().getAccess());
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(ENTITY_NAME, getJavaEntity().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getDefaultName());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(ENTITY_NAME, getJavaEntity().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().setSpecifiedName("foo");
-
- assertEquals("foo", getJavaEntity().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals("foo", ((EntityAnnotation) resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME)).getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().setSpecifiedName(null);
-
- assertNull(getJavaEntity().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNull(((EntityAnnotation) resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME)).getName());
- }
-
- public void testUpdateFromSpecifiedNameChangeInResourceModel() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME);
- entity.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getSpecifiedName());
- }
-
- public void testGetTableName() throws Exception {
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityWithName();
-
- assertEquals(ENTITY_NAME, getJavaEntity().getPrimaryTableName());
- }
-
- public void testGetTableName2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getPrimaryTableName());
- }
-
- public void testGetTableName3() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TABLE_NAME, getJavaEntity().getPrimaryTableName());
- }
-
- public void testSetTableNameWithNullTable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = getJavaEntity().getTable();
- assertEquals(TYPE_NAME, table.getName());
- assertSourceDoesNotContain("@Table", cu);
-
- table.setSpecifiedName(TABLE_NAME);
- assertSourceContains("@Table(name = \"" + TABLE_NAME + "\")", cu);
-
- assertEquals(TABLE_NAME, getJavaEntity().getPrimaryTableName());
- assertEquals(TABLE_NAME, table.getName());
-
- table.setSpecifiedCatalog(TABLE_NAME);
- }
-
- public void testGetInheritanceStrategy() throws Exception {
- createTestEntityWithInheritance();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getInheritanceStrategy());
- }
-
- public void testGetDefaultInheritanceStrategy() throws Exception {
- createTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity childEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- Entity rootEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
-
- assertNotSame(childEntity, rootEntity);
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
-
- //change root inheritance strategy, verify default is changed for child entity
- rootEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.SINGLE_TABLE, rootEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, childEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, childEntity.getInheritanceStrategy());
- assertNull(childEntity.getSpecifiedInheritanceStrategy());
- }
-
- public void testGetSpecifiedInheritanceStrategy() throws Exception {
- createTestEntityWithInheritance();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getSpecifiedInheritanceStrategy());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME);
-
- inheritance.setStrategy(org.eclipse.jpt.jpa.core.resource.java.InheritanceType.JOINED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(InheritanceType.JOINED, getJavaEntity().getSpecifiedInheritanceStrategy());
-
- inheritance.setStrategy(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getSpecifiedInheritanceStrategy());
- }
-
- public void testSetSpecifiedInheritanceStrategy() throws Exception {
- createTestEntityWithInheritance();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(InheritanceType.TABLE_PER_CLASS, getJavaEntity().getSpecifiedInheritanceStrategy());
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-
- assertEquals(InheritanceType.JOINED, getJavaEntity().getSpecifiedInheritanceStrategy());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.InheritanceType.JOINED, inheritance.getStrategy());
-
- }
-
- public void testGetDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_VALUE, getJavaEntity().getDiscriminatorValue());
- }
-
- public void testGetDefaultDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaEntity().getDefaultDiscriminatorValue());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- assertEquals(getJavaEntity().getName(), getJavaEntity().getDefaultDiscriminatorValue());
-
- getJavaEntity().getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.INTEGER);
- assertNull(getJavaEntity().getDefaultDiscriminatorValue());
- }
-
- public void testGetSpecifiedDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(DISCRIMINATOR_VALUE, getJavaEntity().getSpecifiedDiscriminatorValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME);
-
- discriminatorValue.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getSpecifiedDiscriminatorValue());
-
- discriminatorValue.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getSpecifiedDiscriminatorValue());
- }
-
- public void testSetSpecifiedDiscriminatorValue() throws Exception {
- createTestEntityWithDiscriminatorValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(DISCRIMINATOR_VALUE, getJavaEntity().getSpecifiedDiscriminatorValue());
-
- getJavaEntity().setSpecifiedDiscriminatorValue("foo");
-
- assertEquals("foo", getJavaEntity().getSpecifiedDiscriminatorValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME);
- assertEquals("foo", discriminatorValue.getValue());
- }
-
- public void testSecondaryTables() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
-
- assertTrue(secondaryTables.hasNext());
- assertEquals("foo", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testSecondaryTablesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getSecondaryTablesSize());
-
- ((SecondaryTableAnnotation) resourceType.addAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(2, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getSecondaryTablesSize());
- }
-
- public void testSpecifiedSecondaryTables() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaSecondaryTable> specifiedSecondaryTables = getJavaEntity().getSpecifiedSecondaryTables().iterator();
-
- assertTrue(specifiedSecondaryTables.hasNext());
- assertEquals("foo", specifiedSecondaryTables.next().getName());
- assertEquals("bar", specifiedSecondaryTables.next().getName());
- assertFalse(specifiedSecondaryTables.hasNext());
- }
-
- public void testSpecifiedSecondaryTablesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getSpecifiedSecondaryTablesSize());
-
- ((SecondaryTableAnnotation) resourceType.addAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(2, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getSpecifiedSecondaryTablesSize());
- }
-
- public void testAddSpecifiedSecondaryTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> secondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testAddSpecifiedSecondaryTable2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> secondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testAddSpecifiedSecondaryTablePreservePkJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable specifiedSecondaryTable = getJavaEntity().addSpecifiedSecondaryTable(0);
- specifiedSecondaryTable.setSpecifiedName("FOO");
- specifiedSecondaryTable.setSpecifiedCatalog("CATALOG");
- specifiedSecondaryTable.setSpecifiedSchema("SCHEMA");
- specifiedSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("PK_NAME");
-
- //add another specified secondary table, pkJoinColumns from first should be saved.
- SecondaryTable specifiedSecondaryTable2 = getJavaEntity().addSpecifiedSecondaryTable(1);
- specifiedSecondaryTable2.setSpecifiedName("BAR");
-
-
- Iterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- SecondaryTable secondaryTable = secondaryTables.next();
- assertEquals(secondaryTable, specifiedSecondaryTable);
- assertEquals("FOO", secondaryTable.getName());
- assertEquals("CATALOG", secondaryTable.getCatalog());
- assertEquals("SCHEMA", secondaryTable.getSchema());
- assertEquals(1, secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize());
- PrimaryKeyJoinColumn pkJoinColumn = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("PK_NAME", pkJoinColumn.getName());
-
- secondaryTable = secondaryTables.next();
- assertEquals(secondaryTable, specifiedSecondaryTable2);
- assertEquals("BAR", secondaryTable.getName());
- assertEquals(0, secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize());
-
- }
-
- public void testRemoveSpecifiedSecondaryTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(3, resourceType.getAnnotationsSize(SecondaryTableAnnotation.ANNOTATION_NAME));
-
- getJavaEntity().removeSpecifiedSecondaryTable(1);
-
- Iterator<NestableAnnotation> secondaryTableResources = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName());
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName());
- assertFalse(secondaryTableResources.hasNext());
-
- Iterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
-
- getJavaEntity().removeSpecifiedSecondaryTable(1);
- secondaryTableResources = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTableResources.next()).getName());
- assertFalse(secondaryTableResources.hasNext());
-
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
-
- getJavaEntity().removeSpecifiedSecondaryTable(0);
- secondaryTableResources = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(secondaryTableResources.hasNext());
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertFalse(secondaryTables.hasNext());
-
- assertNull(resourceType.getAnnotation(SecondaryTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedSecondaryTable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- entity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- Iterator<NestableAnnotation> javaSecondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaSecondaryTables));
-
-
- entity.moveSpecifiedSecondaryTable(2, 0);
- ListIterator<JavaSecondaryTable> secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
- assertEquals("BAZ", secondaryTables.next().getSpecifiedName());
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
-
- javaSecondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("BAZ", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
-
-
- entity.moveSpecifiedSecondaryTable(0, 1);
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getSpecifiedName());
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
-
- javaSecondaryTables = resourceType.getAnnotations(SecondaryTableAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) javaSecondaryTables.next()).getName());
- }
-
- public void testUpdateSpecifiedSecondaryTables() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((SecondaryTableAnnotation) resourceType.addAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((SecondaryTableAnnotation) resourceType.addAnnotation(2, SecondaryTableAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaSecondaryTable> secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.moveAnnotation(2, 0, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.moveAnnotation(0, 1, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.removeAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.removeAnnotation(1, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- resourceType.removeAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- secondaryTables = entity.getSpecifiedSecondaryTables().iterator();
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testAssociatedTables() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, CollectionTools.size(getJavaEntity().getAssociatedTables()));
- Iterator<ReadOnlyTable> associatedTables = getJavaEntity().getAssociatedTables().iterator();
- ReadOnlyTable table1 = associatedTables.next();
- SecondaryTable table2 = (SecondaryTable) associatedTables.next();
- SecondaryTable table3 = (SecondaryTable) associatedTables.next();
- assertEquals(TYPE_NAME, table1.getName());
- assertEquals("foo", table2.getName());
- assertEquals("bar", table3.getName());
- }
-
- public void testAssociatedTablesIncludingInherited() throws Exception {
- createTestEntityWithSecondaryTables();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity childEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- Entity rootEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
-
- assertEquals(3, CollectionTools.size(rootEntity.getAllAssociatedTables()));
- Iterator<ReadOnlyTable> associatedTables = rootEntity.getAllAssociatedTables().iterator();
- ReadOnlyTable table1 = associatedTables.next();
- SecondaryTable table2 = (SecondaryTable) associatedTables.next();
- SecondaryTable table3 = (SecondaryTable) associatedTables.next();
- assertEquals(TYPE_NAME, table1.getName());
- assertEquals("foo", table2.getName());
- assertEquals("bar", table3.getName());
-
- //TODO probably want this to be 3, since in this case the child descriptor really uses the
- //parent table because it is single table inheritance strategy. Not sure yet how to deal with this.
- assertEquals(4, CollectionTools.size(childEntity.getAllAssociatedTables()));
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- createTestEntityWithSecondaryTables();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity childEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- Entity rootEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
-
- assertEquals(3, CollectionTools.size(rootEntity.getAllAssociatedTableNames()));
- Iterator<String> associatedTables = rootEntity.getAllAssociatedTableNames().iterator();
- String table1 = associatedTables.next();
- String table2 = associatedTables.next();
- String table3 = associatedTables.next();
- assertEquals(TYPE_NAME, table1);
- assertEquals("foo", table2);
- assertEquals("bar", table3);
-
- //TODO probably want this to be 3, since in this case the child descriptor really uses the
- //parent table because it is single table inheritance strategy. Not sure yet how to deal with this.
- assertEquals(4, CollectionTools.size(childEntity.getAllAssociatedTableNames()));
- }
-
- public void testAddSecondaryTableToResourceModel() throws Exception {
- createTestEntityWithName();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(1, getJavaEntity().getSecondaryTablesSize());
- assertEquals("FOO", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedName());
- assertEquals("FOO", getJavaEntity().getSecondaryTables().iterator().next().getName());
-
- SecondaryTableAnnotation secondaryTable2 = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTable2.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, getJavaEntity().getSecondaryTablesSize());
- ListIterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
-
- SecondaryTableAnnotation secondaryTable3 = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable3.setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, getJavaEntity().getSecondaryTablesSize());
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getSpecifiedName());
- assertEquals("FOO", secondaryTables.next().getSpecifiedName());
- assertEquals("BAR", secondaryTables.next().getSpecifiedName());
- }
-
- public void testRemoveSecondaryTableFromResourceModel() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedSecondaryTable(2).setSpecifiedName("baz");
- ListIterator<JavaSecondaryTable> secondaryTables = getJavaEntity().getSecondaryTables().iterator();
-
- assertEquals(3, getJavaEntity().getSecondaryTablesSize());
- assertEquals("foo", secondaryTables.next().getSpecifiedName());
- assertEquals("bar", secondaryTables.next().getSpecifiedName());
- assertEquals("baz", secondaryTables.next().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, getJavaEntity().getSecondaryTablesSize());
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("bar", secondaryTables.next().getSpecifiedName());
- assertEquals("baz", secondaryTables.next().getSpecifiedName());
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
- getJpaProject().synchronizeContextModel();
-
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals(1, getJavaEntity().getSecondaryTablesSize());
- assertEquals("baz", secondaryTables.next().getSpecifiedName());
-
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
- getJpaProject().synchronizeContextModel();
-
- secondaryTables = getJavaEntity().getSecondaryTables().iterator();
- assertEquals(0, getJavaEntity().getSecondaryTablesSize());
- assertFalse(secondaryTables.hasNext());
- }
-
- public void testGetSequenceGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
- assertEquals(0, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(JPA.SEQUENCE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
- assertEquals(2, resourceType.getAnnotationsSize());
- assertEquals(1, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
-
- getJavaEntity().getGeneratorContainer().getSequenceGenerator().setName("foo");
- assertEquals(1, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddSequenceGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
-
- getJavaEntity().getGeneratorContainer().addSequenceGenerator();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNotNull(resourceType.getAnnotation(JPA.SEQUENCE_GENERATOR));
- assertNotNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- getJavaEntity().getGeneratorContainer().addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(JPA.SEQUENCE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
- getJavaEntity().getGeneratorContainer().removeSequenceGenerator();
-
- assertNull(getJavaEntity().getGeneratorContainer().getSequenceGenerator());
- assertNull(resourceType.getAnnotation(JPA.SEQUENCE_GENERATOR));
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- getJavaEntity().getGeneratorContainer().removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetTableGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
- assertEquals(0, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(JPA.TABLE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
- assertEquals(2, resourceType.getAnnotationsSize());
- assertEquals(1, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
-
- getJavaEntity().getGeneratorContainer().getTableGenerator().setName("foo");
- assertEquals(1, getJavaEntity().getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
-
- getJavaEntity().getGeneratorContainer().addTableGenerator();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNotNull(resourceType.getAnnotation(JPA.TABLE_GENERATOR));
- assertNotNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- getJavaEntity().getGeneratorContainer().addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(JPA.TABLE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
- getJavaEntity().getGeneratorContainer().removeTableGenerator();
-
- assertNull(getJavaEntity().getGeneratorContainer().getTableGenerator());
- assertNull(resourceType.getAnnotation(JPA.TABLE_GENERATOR));
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- getJavaEntity().getGeneratorContainer().removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetDiscriminatorColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotNull(getJavaEntity().getDiscriminatorColumn());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.addAnnotation(JPA.DISCRIMINATOR_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- column.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaEntity().getDiscriminatorColumn().getSpecifiedName());
-
- resourceType.removeAnnotation(JPA.DISCRIMINATOR_COLUMN);
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(getJavaEntity().getDiscriminatorColumn());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
-
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- PrimaryKeyJoinColumnAnnotation pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- pkJoinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- pkJoinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
-
- pkJoinColumn = (PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- pkJoinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- resourceType.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- resourceType.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(specifiedPkJoinColumns.hasNext());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, getJavaEntity().getSpecifiedPrimaryKeyJoinColumnsSize());
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertEquals(3, getJavaEntity().getSpecifiedPrimaryKeyJoinColumnsSize());
- }
-
- public void testPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- //just the default pkJoinColumn, so 1
- assertEquals(1, getJavaEntity().getPrimaryKeyJoinColumnsSize());
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- //only the specified pkJoinColumns, 3
- assertEquals(3, getJavaEntity().getPrimaryKeyJoinColumnsSize());
- }
-
- public void testGetDefaultPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNotNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> pkJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertFalse(pkJoinColumns.hasNext());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn2() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> pkJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertFalse(pkJoinColumns.hasNext());
- }
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(3, resourceType.getAnnotationsSize(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
-
- getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> pkJoinColumnResources = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- Iterator<JavaPrimaryKeyJoinColumn> pkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(1);
- pkJoinColumnResources = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumnResources.next()).getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- pkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(0);
- pkJoinColumnResources = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(pkJoinColumnResources.hasNext());
- pkJoinColumns = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(pkJoinColumns.hasNext());
-
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- entity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- entity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- Iterator<NestableAnnotation> javaPrimaryKeyJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaPrimaryKeyJoinColumns));
-
-
- entity.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaPrimaryKeyJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
-
-
- entity.moveSpecifiedPrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaPrimaryKeyJoinColumns = resourceType.getAnnotations(PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaPrimaryKeyJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((PrimaryKeyJoinColumnAnnotation) resourceType.addAnnotation(2, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaPrimaryKeyJoinColumn> primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.moveAnnotation(2, 0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.moveAnnotation(0, 1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.removeAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.removeAnnotation(1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceType.removeAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = entity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(primaryKeyJoinColumns.hasNext());
- }
-
- public void testPrimaryKeyJoinColumnIsVirtual() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertTrue(getJavaEntity().getDefaultPrimaryKeyJoinColumn().isVirtual());
-
- getJavaEntity().addSpecifiedPrimaryKeyJoinColumn(0);
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(specifiedPkJoinColumn.isVirtual());
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
- }
-
- public void testTableNameIsInvalid() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertFalse(getJavaEntity().tableNameIsInvalid(TYPE_NAME));
- assertTrue(getJavaEntity().tableNameIsInvalid("FOO"));
-
- getJavaEntity().addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
-
- assertFalse(getJavaEntity().tableNameIsInvalid("BAR"));
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) getJavaPersistentType().getMapping();
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("foo", overridableAttributes.next());
- assertEquals("basic", overridableAttributes.next());
- assertEquals("version", overridableAttributes.next());
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("foo", overridableAttributes.next());
- assertEquals("basic", overridableAttributes.next());
- assertEquals("version", overridableAttributes.next());
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("foo", overridableAttributeNames.next());
- assertEquals("basic", overridableAttributeNames.next());
- assertEquals("version", overridableAttributeNames.next());
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrideDefaults() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertEquals("foo", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- BasicMapping fooMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("foo").getMapping();
- fooMapping.getColumn().setSpecifiedName("FOO");
- fooMapping.getColumn().setSpecifiedTable("BAR");
- fooMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- fooMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- fooMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- fooMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- fooMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- fooMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- fooMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- fooMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- fooMapping.getColumn().setSpecifiedName(null);
- fooMapping.getColumn().setSpecifiedTable(null);
- fooMapping.getColumn().setColumnDefinition(null);
- fooMapping.getColumn().setSpecifiedInsertable(null);
- fooMapping.getColumn().setSpecifiedUpdatable(null);
- fooMapping.getColumn().setSpecifiedUnique(null);
- fooMapping.getColumn().setSpecifiedNullable(null);
- fooMapping.getColumn().setSpecifiedLength(null);
- fooMapping.getColumn().setSpecifiedPrecision(null);
- fooMapping.getColumn().setSpecifiedScale(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertEquals("foo", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testVirtualAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- JavaEntity superclass = (JavaEntity) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(5, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(5, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(5, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(6, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("basic", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("basic", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(4, CollectionTools.size(resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME)));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("basic", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("version", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- Iterator<JavaAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("basic", attributeOverrides.next().getName());
- assertEquals("version", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("version", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("version", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("id", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrideResources.hasNext());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(4, CollectionTools.size(javaAttributeOverrides));
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<JavaAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("basic", attributeOverrides.next().getName());
- assertEquals("version", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("basic", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("version", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("version", attributeOverrides.next().getName());
- assertEquals("basic", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("version", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("basic", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(2, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("oneToOne", overridableAssociationNames.next());
- assertEquals("manyToOne", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociations() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("oneToOne", overridableAssociations.next());
- assertEquals("manyToOne", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-//
-// public void testAllOverridableAssociationsMappedSuperclassInOrmXml() throws Exception {
-// createTestMappedSuperclass();
-// createTestSubType();
-// addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-// getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// Iterator<RelationshipMapping> overridableAssociations = getJavaEntity().allOverridableAssociations();
-// assertEquals("oneToOne", overridableAssociations.next().getName());
-// assertEquals("manyToOne", overridableAssociations.next().getName());
-// assertFalse(overridableAssociations.hasNext());
-// }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrideDefaults() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AssociationOverrideContainer overrideContainer = javaEntity.getAssociationOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- ReadOnlyJoinColumnRelationshipStrategy joiningStrategy = ((ReadOnlyJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("oneToOne", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- ReadOnlyJoinColumn virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("oneToOne_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals(SUB_TYPE_NAME, virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) getJavaPersistentType().getAttributeNamed("oneToOne").getMapping();
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- joiningStrategy = ((ReadOnlyJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("oneToOne", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals("MY_JOIN_COLUMN", joiningStrategy.getJoinColumns().iterator().next().getName());
-
-
-
-
-
-
- //idMapping.getColumn().setSpecifiedName(null);
- //idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("oneToOne", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("oneToOne", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("oneToOne", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(2, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> associationOverrideResources = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("manyToOne", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- associationOverrideResources = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("manyToOne", associationOverrides.next().getName());
- assertEquals("oneToOne", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("oneToOne", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("oneToOne", associationOverrides.next().getName());
- assertEquals("manyToOne", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("oneToOne", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("manyToOne", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(2, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("oneToOne", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("manyToOne", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("manyToOne", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testAddNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- NamedQuery namedQuery1 = entity.getQueryContainer().addNamedQuery(0);
- namedQuery1.setName("FOO");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedQuery namedQuery2 = entity.getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
-
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedQuery namedQuery3 = entity.getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
-
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery1, namedQueries.next());
-
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("foo");
- }
-
- public void testInvalidNamedQueries() throws Exception {
- createTestEntityInvalidNamedQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- assertEquals(1, entity.getQueryContainer().getNamedQueriesSize());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
- entity.getQueryContainer().addNamedQuery(1).setName("BAR");
- entity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(2, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(1, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(0, CollectionTools.size(javaNamedQueries));
- }
-
- public void testAddNamedNativeQueryWithNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
-
-
- NamedNativeQueryAnnotation nativeQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- nativeQuery.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(1, entity.getQueryContainer().getNamedNativeQueriesSize());
- ListIterator<JavaNamedNativeQuery> namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- }
-
- public void testAddNamedQueryWithNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
-
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(1, entity.getQueryContainer().getNamedQueriesSize());
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- }
-
- public void testMoveNamedQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
- entity.getQueryContainer().addNamedQuery(1).setName("BAR");
- entity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
-
- entity.getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
-
-
- entity.getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(NamedQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAR", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQueryAnnotation) javaNamedQueries.next()).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
-
- ((NamedQueryAnnotation) resourceType.addAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedQueryAnnotation) resourceType.addAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedQueryAnnotation) resourceType.addAnnotation(2, NamedQueryAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.moveAnnotation(2, 0, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.moveAnnotation(0, 1, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.removeAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertFalse(namedQueries.hasNext());
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testNamedQueriesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getQueryContainer().getNamedQueriesSize());
-
- ((NamedQueryAnnotation) resourceType.addAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedQueryAnnotation) resourceType.addAnnotation(1, NamedQueryAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedQueryAnnotation) resourceType.addAnnotation(2, NamedQueryAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getQueryContainer().getNamedQueriesSize());
- }
-
- public void testAddNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery.setName("FOO");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedNativeQuery namedNativeQuery2 = entity.getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery2.setName("BAR");
-
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- NamedNativeQuery namedNativeQuery3 = entity.getQueryContainer().addNamedNativeQuery(1);
- namedNativeQuery3.setName("BAZ");
-
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- ListIterator<JavaNamedNativeQuery> namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals(namedNativeQuery2, namedQueries.next());
- assertEquals(namedNativeQuery3, namedQueries.next());
- assertEquals(namedNativeQuery, namedQueries.next());
-
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- entity.getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- entity.getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.getQueryContainer().removeNamedNativeQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(2, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.getQueryContainer().removeNamedNativeQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(1, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
- entity.getQueryContainer().removeNamedNativeQuery(0);
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(0, CollectionTools.size(javaNamedQueries));
- }
-
- public void testMoveNamedNativeQuery() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- entity.getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- entity.getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.getQueryContainer().moveNamedNativeQuery(2, 0);
- ListIterator<JavaNamedNativeQuery> namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
-
-
- entity.getQueryContainer().moveNamedNativeQuery(0, 1);
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(NamedNativeQueryAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("BAR", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedNativeQueryAnnotation) javaNamedQueries.next()).getName());
- }
-
- public void testUpdateNamedNativeQueries() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
-
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(2, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
- ListIterator<JavaNamedNativeQuery> namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.moveAnnotation(2, 0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.moveAnnotation(0, 1, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.removeAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedNativeQueries().iterator();
- assertFalse(namedQueries.hasNext());
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testNamedNativeQueriesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getQueryContainer().getNamedNativeQueriesSize());
-
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(1, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((NamedNativeQueryAnnotation) resourceType.addAnnotation(2, NamedNativeQueryAnnotation.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getQueryContainer().getNamedNativeQueriesSize());
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestEntity();
- createTestIdClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- IdClassAnnotation idClassAnnotation = (IdClassAnnotation) resourceType.addAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNotNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
-
- // test setting id class name to nonexistent class. test class name is set, but class is null
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassAnnotation.setValue(nonExistentIdClassName);
- getJpaProject().synchronizeContextModel();
- assertEquals(nonExistentIdClassName, getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertEquals(nonExistentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
-
- // test setting id class name to existent class. test class name is set and class is not null
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassAnnotation.setValue(existentIdClassName);
- getJpaProject().synchronizeContextModel();
- assertEquals(existentIdClassName, getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertEquals(existentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertNotNull(getJavaEntity().getIdClassReference().getIdClass());
-
- //test setting @IdClass value to null
- idClassAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
-
- //reset @IdClass value and then remove @IdClass
- idClassAnnotation = (IdClassAnnotation) resourceType.addAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- idClassAnnotation.setValue(existentIdClassName);
- resourceType.removeAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- createTestEntity();
- createTestIdClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME_ + "Foo";
- getJavaEntity().getIdClassReference().setSpecifiedIdClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(nonExistentIdClassName, getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
-
- String existentIdClassName = PACKAGE_NAME_ + "TestTypeId";
- getJavaEntity().getIdClassReference().setSpecifiedIdClassName(existentIdClassName);
- assertEquals(existentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(existentIdClassName, getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNotNull(getJavaEntity().getIdClassReference().getIdClass());
-
- getJavaEntity().getIdClassReference().setSpecifiedIdClassName(null);
- assertNull(getJavaEntity().getIdClassReference().getSpecifiedIdClassName());
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(getJavaEntity().getIdClassReference().getIdClass());
- }
-
- public void testGetPrimaryKeyColumnNameWithAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType entityPersistentType = classRefs.next().getJavaPersistentType();
- JavaEntity javaEntity = (JavaEntity) entityPersistentType.getMapping();
- JavaPersistentType mappedSuperclassPersistentType = classRefs.next().getJavaPersistentType();
-
- assertEquals("id", javaEntity.getPrimaryKeyColumnName());
-
- ((JavaIdMapping) mappedSuperclassPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("MY_ID", javaEntity.getPrimaryKeyColumnName());
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = javaEntity.getAttributeOverrideContainer().getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next();
- JavaVirtualAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
-
- virtualOverride.convertToSpecified().getColumn().setSpecifiedName("ID");
- assertEquals("ID", javaEntity.getPrimaryKeyColumnName());
- }
-
- public void testDiscriminatorValueIsUndefinedConcreteClass() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(getJavaEntity().discriminatorValueIsUndefined());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertFalse(getJavaEntity().discriminatorValueIsUndefined());
- }
-
- public void testDiscriminatorValueIsUndefinedAbstractClass() throws Exception {
- createTestAbstractEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(getJavaEntity().discriminatorValueIsUndefined());
-
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- assertTrue(getJavaEntity().discriminatorValueIsUndefined());
- }
-
- public void testSpecifiedDiscriminatorColumnIsAllowed() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity concreteEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
- //table-per-class, no discriminator column allowed
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertFalse(abstractEntity.specifiedDiscriminatorColumnIsAllowed());
-
-
- //single-table, discriminator column allowed on root entity
- abstractEntity.setSpecifiedInheritanceStrategy(null);
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertTrue(abstractEntity.specifiedDiscriminatorColumnIsAllowed());
- }
-
- public void testAbstractEntityGetDefaultDiscriminatorColumnNameTablePerClassInheritance() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity concreteEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getSpecifiedInheritanceStrategy());
- assertEquals(null, concreteEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, concreteEntity.getDefaultInheritanceStrategy());
-
-
- assertTrue(abstractEntity.discriminatorValueIsUndefined());
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(null, concreteEntity.getDiscriminatorColumn().getDefaultName());
-
- assertTrue(abstractEntity.discriminatorValueIsUndefined());
- assertEquals(null, abstractEntity.getDefaultDiscriminatorValue());
- assertTrue(concreteEntity.discriminatorValueIsUndefined());
- assertEquals(null, concreteEntity.getDefaultDiscriminatorValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaGeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaGeneratedValueTests.java
deleted file mode 100644
index 3df675ec4b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaGeneratedValueTests.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.GeneratedValue;
-import org.eclipse.jpt.jpa.core.context.GenerationType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaGeneratedValueTests extends ContextModelTestCase
-{
- private static final String GENERATOR = "MY_GENERATOR";
-
- private ICompilationUnit createTestEntityWithGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.GENERATED_VALUE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@GeneratedValue(generator=\"" + GENERATOR + "\")");
- }
- });
- }
-
- public JavaGeneratedValueTests(String name) {
- super(name);
- }
-
- public void testGetGenerator() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator());
-
- //change resource model sequenceGenerator name, verify the context model is updated
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- generatedValue.setGenerator("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", idMapping.getGeneratedValue().getGenerator());
- }
-
- public void testSetSpecifiedGenerator() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator());
-
- idMapping.getGeneratedValue().setSpecifiedGenerator("foo");
-
- assertEquals("foo", idMapping.getGeneratedValue().getGenerator());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- assertEquals("foo", generatedValue.getGenerator());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GENERATOR, idMapping.getGeneratedValue().getGenerator());
-
- idMapping.getGeneratedValue().setSpecifiedGenerator(null);
-
- assertNotNull(idMapping.getGeneratedValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- assertNotNull(generatedValue);
- }
-
- public void testGetStrategy() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy());
-
- //change resource model sequenceGenerator name, verify the context model is updated
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- generatedValue.setStrategy(org.eclipse.jpt.jpa.core.resource.java.GenerationType.IDENTITY);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(GenerationType.IDENTITY, idMapping.getGeneratedValue().getStrategy());
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getDefaultStrategy());
- }
-
- public void testSetSpecifiedStrategy() throws Exception {
- createTestEntityWithGeneratedValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy());
-
- idMapping.getGeneratedValue().setSpecifiedStrategy(GenerationType.IDENTITY);
-
- assertEquals(GenerationType.IDENTITY, idMapping.getGeneratedValue().getStrategy());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.GenerationType.IDENTITY, generatedValue.getStrategy());
-
- idMapping.getGeneratedValue().setSpecifiedStrategy(null);
-
- assertEquals(GeneratedValue.DEFAULT_STRATEGY, idMapping.getGeneratedValue().getStrategy());
- generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertNotNull(generatedValue);
- assertNull(generatedValue.getStrategy());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaIdMappingTests.java
deleted file mode 100644
index cb24daae2b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaIdMappingTests.java
+++ /dev/null
@@ -1,716 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaIdMappingTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@Temporal(TemporalType.TIMESTAMP)").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdMappingGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.GENERATED_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@GeneratedValue").append(CR);
- }
- });
- }
-
- public JavaIdMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporal() throws Exception {
- createTestEntityWithTemporal();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) idMapping.getConverter()).getTemporalType());
- }
-
- public void testSetTemporal() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertNull(idMapping.getConverter().getType());
-
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- idMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.DATE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) idMapping.getConverter()).getTemporalType());
-
- resourceField.removeAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(idMapping.getConverter().getType());
- assertFalse(idMapping.isDefault());
- assertSame(idMapping, persistentAttribute.getMapping());
- }
-
- public void testGetColumn() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getColumn().getSpecifiedName());
- assertEquals("id", idMapping.getColumn().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", idMapping.getColumn().getSpecifiedName());
- assertEquals("foo", idMapping.getColumn().getName());
- assertEquals("id", idMapping.getColumn().getDefaultName());
- }
-
- public void testGetSequenceGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator());
- assertEquals(0, idMapping.getPersistenceUnit().getGeneratorsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.SEQUENCE_GENERATOR);
- getJpaProject().synchronizeContextModel();
- assertNotNull(idMapping.getGeneratorContainer().getSequenceGenerator());
- assertEquals(2, resourceField.getAnnotationsSize());
- assertEquals(1, idMapping.getPersistenceUnit().getGeneratorsSize());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, idMapping.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddSequenceGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator());
-
- idMapping.getGeneratorContainer().addSequenceGenerator();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNotNull(resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR));
- assertNotNull(idMapping.getGeneratorContainer().getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- idMapping.getGeneratorContainer().addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.SEQUENCE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
-
- idMapping.getGeneratorContainer().removeSequenceGenerator();
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR));
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- idMapping.getGeneratorContainer().removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetTableGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertNull(idMapping.getGeneratorContainer().getTableGenerator());
- assertEquals(0, idMapping.getPersistenceUnit().getGeneratorsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.TABLE_GENERATOR);
- getJpaProject().synchronizeContextModel();
- assertNotNull(idMapping.getGeneratorContainer().getTableGenerator());
- assertEquals(2, resourceField.getAnnotationsSize());
- assertEquals(1, idMapping.getPersistenceUnit().getGeneratorsSize());
-
- idMapping.getGeneratorContainer().getTableGenerator().setName("foo");
- assertEquals(1, idMapping.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator());
-
- idMapping.getGeneratorContainer().addTableGenerator();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNotNull(resourceField.getAnnotation(JPA.TABLE_GENERATOR));
- assertNotNull(idMapping.getGeneratorContainer().getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- idMapping.getGeneratorContainer().addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.TABLE_GENERATOR);
- getJpaProject().synchronizeContextModel();
-
-
- idMapping.getGeneratorContainer().removeTableGenerator();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator());
- assertNull(resourceField.getAnnotation(JPA.TABLE_GENERATOR));
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- idMapping.getGeneratorContainer().removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testGetGeneratedValue() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getGeneratedValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.GENERATED_VALUE);
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(idMapping.getGeneratedValue());
- assertEquals(2, resourceField.getAnnotationsSize());
- }
-
- public void testGetGeneratedValue2() throws Exception {
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityWithIdMappingGeneratedValue();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNotNull(idMapping.getGeneratedValue());
- assertEquals(2, resourceField.getAnnotationsSize());
- }
-
- public void testAddGeneratedValue() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getGeneratedValue());
-
- idMapping.addGeneratedValue();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNotNull(resourceField.getAnnotation(JPA.GENERATED_VALUE));
- assertNotNull(idMapping.getGeneratedValue());
-
- //try adding another generated value, should get an IllegalStateException
- try {
- idMapping.addGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveGeneratedValue() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(JPA.GENERATED_VALUE);
- getJpaProject().synchronizeContextModel();
-
- idMapping.removeGeneratedValue();
-
- assertNull(idMapping.getGeneratedValue());
- assertNull(resourceField.getAnnotation(JPA.GENERATED_VALUE));
-
- //try removing the generatedValue again, should get an IllegalStateException
- try {
- idMapping.removeGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java
deleted file mode 100644
index e9bdd2a798..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinColumnTests.java
+++ /dev/null
@@ -1,550 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToOneMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaJoinColumnTests extends ContextModelTestCase
-{
- public JavaJoinColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- sb.append(" private Project project;").append(CR);
- }
- });
- }
-
- private void createTargetEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation joinColumnAnnotation = (JoinColumnAnnotation) resourceField.getAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(joinColumnAnnotation);
-
-
- //set name in the resource model, verify context model updated
- joinColumnAnnotation = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- joinColumnAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("FOO", joinColumnAnnotation.getName());
-
- //set name to null, annotation is NOT removed
- joinColumn.setSpecifiedName(null);
- assertEquals(1, joinColumns.getSpecifiedJoinColumnsSize());
- joinColumnAnnotation = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertNull(joinColumnAnnotation.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set name in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- JoinColumnAnnotation joinColumnAnnotation = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinColumn.getSpecifiedName());
- assertEquals("foo", joinColumnAnnotation.getName());
-
- //set name to null in the context model
- joinColumn.setSpecifiedName(null);
- assertNull(joinColumn.getSpecifiedName());
- joinColumnAnnotation = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertNull(joinColumnAnnotation.getName());
- }
-
- // <attribute name>_<referenced column name>
- // or
- // <target entity name>_<referenced column name>
- public void testDefaultName() throws Exception {
- createTestEntityWithValidOneToOne();
- createTargetEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
-// JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().attributes().next().getMapping();
-// JavaJoinColumnJoiningStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnJoiningStrategy();
-// JavaJoinColumn defaultJavaJoinColumn = joinColumns.getDefaultJoinColumn();
-//
-// assertNull(defaultJavaJoinColumn.getDefaultName());
-//TODO test default join column name
-// //add target entity to the persistence unit, now join table name is [table name]_[target table name]
-// addXmlClassRef(PACKAGE_NAME + ".Project");
-// assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-//
-// JavaPersistentTypeResource typeResource = jpaProject().javaPersistentTypeResource(FULLY_QUALIFIED_TYPE_NAME);
-// JavaPersistentresourceField resourceField = typeResource.attributes().next();
-// assertNull(resourceField.annotation(JoinTable.ANNOTATION_NAME));
-//
-// //target entity does not resolve, default name is null
-// manyToManyMapping.setSpecifiedTargetEntity("Foo");
-// assertNull(joinTable.getDefaultName());
-//
-// //default target entity does resolve, so default name is again [table name]_[target table name]
-// manyToManyMapping.setSpecifiedTargetEntity(null);
-// assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-//
-// //add the join table annotation, verify default join table name is the same
-// resourceField.addAnnotation(JoinTable.ANNOTATION_NAME);
-// assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-// assertNotNull(resourceField.annotation(JoinTable.ANNOTATION_NAME));
-//
-// //set a table on the target entity, very default join table name updates
-// manyToManyMapping.getResolvedTargetEntity().getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME + "_FOO", joinTable.getDefaultName());
-//
-// //set a table on the owning entity, very default join table name updates
-// javaEntity().getTable().setSpecifiedName("BAR");
-// assertEquals("BAR_FOO", joinTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set referenced column name in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setReferencedColumnName("BAR");
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals("BAR", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", javaJoinColumn.getReferencedColumnName());
-
- //set referenced column name to null in the resource model,
- javaJoinColumn.setReferencedColumnName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull("BAR", javaJoinColumn.getReferencedColumnName());
- }
-
- public void testModifySpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set referenced column name in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedReferencedColumnName("BAR");
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", javaJoinColumn.getReferencedColumnName());
-
- //set referenced column name to null in the context model
- joinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(javaJoinColumn.getReferencedColumnName());
- }
-
- public void testDefaultReferencedColumnName() throws Exception {
- //TODO test default join column referenced column name
-
- }
-
- public void testUpdateTable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set table in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setTable("BAR");
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals("BAR", joinColumn.getSpecifiedTable());
- assertEquals("BAR", javaJoinColumn.getTable());
-
- //set table to null in the resource model,
- javaJoinColumn.setTable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedTable());
- assertNull("BAR", javaJoinColumn.getTable());
- }
-
- public void testModifyTable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set table in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedTable("BAR");
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals("BAR", joinColumn.getSpecifiedTable());
- assertEquals("BAR", javaJoinColumn.getTable());
-
- //set table to null in the context model
- joinColumn.setSpecifiedTable(null);
- assertNull(joinColumn.getSpecifiedTable());
- assertNull(javaJoinColumn.getTable());
- }
-
- public void testDefaultTable() throws Exception {
- //TODO test default join column table
-
- }
-
- public void testUpdateUnique() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set unique in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setUnique(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, javaJoinColumn.getUnique());
-
- //set unique to null in the resource model,
- javaJoinColumn.setUnique(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedUnique());
- assertNull(javaJoinColumn.getUnique());
- }
-
- public void testModifyUnique() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set unique in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, javaJoinColumn.getUnique());
-
- //set unique to null in the context model
- joinColumn.setSpecifiedUnique(null);
- assertNull(joinColumn.getSpecifiedUnique());
- assertNull(javaJoinColumn.getUnique());
- }
-
- public void testUpdateNullable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set nullable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setNullable(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getNullable());
-
- //set nullable to null in the resource model,
- javaJoinColumn.setNullable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedNullable());
- assertNull(javaJoinColumn.getNullable());
- }
-
- public void testModifyNullable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set nullable in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getNullable());
-
- //set nullable to null in the context model
- joinColumn.setSpecifiedNullable(null);
- assertNull(joinColumn.getSpecifiedNullable());
- assertNull(javaJoinColumn.getNullable());
- }
-
- public void testUpdateInsertable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set insertable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setInsertable(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getInsertable());
-
- //set insertable to null in the resource model,
- javaJoinColumn.setInsertable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedInsertable());
- assertNull(javaJoinColumn.getInsertable());
- }
-
- public void testModifyInsertable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set insertable in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getInsertable());
-
- //set insertable to null in the context model
- joinColumn.setSpecifiedInsertable(null);
- assertNull(joinColumn.getSpecifiedInsertable());
- assertNull(javaJoinColumn.getInsertable());
- }
-
- public void testUpdateUpdatable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- assertNull(javaJoinColumn);
-
-
- //set updatable in the resource model, verify context model updated
- javaJoinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- javaJoinColumn.setName("FOO");
- javaJoinColumn.setUpdatable(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- JavaJoinColumn joinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getUpdatable());
-
- //set updatable to null in the resource model,
- javaJoinColumn.setUpdatable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinColumn.getSpecifiedUpdatable());
- assertNull(javaJoinColumn.getUpdatable());
- }
-
- public void testModifyUpdatable() throws Exception {
- createTestEntityWithOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaOneToOneMapping oneToOneMapping = (JavaOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JavaJoinColumn joinColumn = joinColumns.addSpecifiedJoinColumn(0);
- //set updatable in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
-
- JoinColumnAnnotation javaJoinColumn = (JoinColumnAnnotation) resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, javaJoinColumn.getUpdatable());
-
- //set updatable to null in the context model
- joinColumn.setSpecifiedUpdatable(null);
- assertNull(joinColumn.getSpecifiedUpdatable());
- assertNull(javaJoinColumn.getUpdatable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinTableTests.java
deleted file mode 100644
index f680861ebf..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaJoinTableTests.java
+++ /dev/null
@@ -1,1179 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaJoinTableTests extends ContextModelTestCase
-{
- public JavaJoinTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append(" private Collection<Project> projects;").append(CR);
- }
- });
- }
-
- private void createTargetEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(CR);
- sb.append("}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- private void createTargetEntityWithBackPointer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(" @ManyToMany(mappedBy=\"projects\"").append(CR);
- sb.append(" private java.util.Collection<" + TYPE_NAME + "> employees;").append(CR);
- sb.append(CR);
- sb.append("}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedName());
- assertNull(javaJoinTable);
-
-
- //set name in the resource model, verify context model updated
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("FOO", javaJoinTable.getName());
-
- //set name to null in the resource model
- javaJoinTable.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedName());
- assertNull(javaJoinTable.getName());
-
- javaJoinTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("FOO", javaJoinTable.getName());
-
- resourceField.removeAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedName());
- assertNull(joinTableAnnotation);
-
- //set name in the context model, verify resource model modified
- joinTable.setSpecifiedName("foo");
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinTable.getSpecifiedName());
- assertEquals("foo", joinTableAnnotation.getName());
-
- //set name to null in the context model
- joinTable.setSpecifiedName(null);
- assertNull(joinTable.getSpecifiedName());
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertNull(joinTableAnnotation.getName());
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinTable.getDefaultName());
-
- //add target entity to the persistence unit, now join table name is [table name]_[target table name]
- createTargetEntity();
- addXmlClassRef(PACKAGE_NAME + ".Project");
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //target entity does not resolve, default name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertNull(joinTable.getDefaultName());
-
- //default target entity does resolve, so default name is again [table name]_[target table name]
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- //add the join table annotation, verify default join table name is the same
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //set a table on the target entity, very default join table name updates
- manyToManyMapping.getResolvedTargetEntity().getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", joinTable.getDefaultName());
-
- //set a table on the owning entity, very default join table name updates
- getJavaEntity().getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", joinTable.getDefaultName());
- }
-
- public void testDefaultJoinColumns() throws Exception {
- createTestEntityWithValidManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JoinColumn joinColumn = joinTable.getJoinColumns().iterator().next();
- JoinColumn inverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add target entity to the persistence unit, join column default name and referenced column still null because owning entity has no primary key
- createTargetEntity();
- addXmlClassRef(PACKAGE_NAME + ".Project");
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //create primary key in owning entity
- getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(TYPE_NAME + "_id", joinColumn.getDefaultName());
- assertEquals("id", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //set specified column name on primary key in owning entity
- ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //target entity does not resolve, inverse join column name and referenced column name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //default target entity does resolve, so defaults for join column are back
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add the join table annotation, verify default join table name is the same
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultJoinColumnsBidirectionalRelationship() throws Exception {
- createTestEntityWithValidManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JoinColumn joinColumn = joinTable.getJoinColumns().iterator().next();
- JoinColumn inverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add target entity to the persistence unit, join column default name and referenced column still null because owning entity has no primary key
- createTargetEntityWithBackPointer();
- addXmlClassRef(PACKAGE_NAME + ".Project");
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //create primary key in owning entity
- getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("employees_id", joinColumn.getDefaultName());
- assertEquals("id", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //set specified column name on primary key in owning entity
- ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //target entity does not resolve, inverse join column name and referenced column name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //default target entity does resolve, so defaults for join column are back
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add the join table annotation, verify default join table name is the same
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(javaJoinTable);
-
-
- //set schema in the resource model, verify context model updated
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedSchema());
- assertEquals("FOO", javaJoinTable.getSchema());
-
- //set schema to null in the resource model
- javaJoinTable.setSchema(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(javaJoinTable.getSchema());
-
- javaJoinTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedSchema());
- assertEquals("FOO", javaJoinTable.getSchema());
-
- resourceField.removeAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedSchema());
- assertNull(joinTableAnnotation);
-
- //set schema in the context model, verify resource model modified
- joinTable.setSpecifiedSchema("foo");
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinTable.getSpecifiedSchema());
- assertEquals("foo", joinTableAnnotation.getSchema());
-
- //set schema to null in the context model
- joinTable.setSpecifiedSchema(null);
- assertNull(joinTable.getSpecifiedSchema());
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertNull(joinTableAnnotation.getSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(javaJoinTable);
-
-
- //set catalog in the resource model, verify context model updated
- resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- javaJoinTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedCatalog());
- assertEquals("FOO", javaJoinTable.getCatalog());
-
- //set catalog to null in the resource model
- javaJoinTable.setCatalog(null);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(javaJoinTable.getCatalog());
-
- javaJoinTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", joinTable.getSpecifiedCatalog());
- assertEquals("FOO", javaJoinTable.getCatalog());
-
- resourceField.removeAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertNull(joinTable.getSpecifiedCatalog());
- assertNull(joinTableAnnotation);
-
- //set catalog in the context model, verify resource model modified
- joinTable.setSpecifiedCatalog("foo");
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals("foo", joinTable.getSpecifiedCatalog());
- assertEquals("foo", joinTableAnnotation.getCatalog());
-
- //set catalog to null in the context model
- joinTable.setSpecifiedCatalog(null);
- assertNull(joinTable.getSpecifiedCatalog());
- joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertNull(joinTableAnnotation.getCatalog());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JoinColumn joinColumn = joinTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = joinTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = joinTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
- ListIterator<JavaJoinColumn> joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- joinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableAnnotation.getJoinColumnsSize());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableAnnotation.getJoinColumnsSize());
- assertEquals("BAR", joinTableAnnotation.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableAnnotation.joinColumnAt(1).getName());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableAnnotation.getJoinColumnsSize());
- assertEquals("BAZ", joinTableAnnotation.joinColumnAt(0).getName());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableAnnotation.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- joinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
-
- joinTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
-
- joinTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAR", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- joinTableResource.addJoinColumn(0);
- joinTableResource.addJoinColumn(1);
- joinTableResource.addJoinColumn(2);
-
- joinTableResource.joinColumnAt(0).setName("FOO");
- joinTableResource.joinColumnAt(1).setName("BAR");
- joinTableResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaJoinColumn> joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joinTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(0, joinTable.getSpecifiedJoinColumnsSize());
-
- joinTable.addSpecifiedJoinColumn(0);
- assertEquals(1, joinTable.getSpecifiedJoinColumnsSize());
-
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTable.getSpecifiedJoinColumnsSize());
- }
-
- public void testJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(1, joinTable.getJoinColumnsSize());
-
- joinTable.addSpecifiedJoinColumn(0);
- assertEquals(1, joinTable.getJoinColumnsSize());
-
- joinTable.addSpecifiedJoinColumn(0);
- assertEquals(2, joinTable.getJoinColumnsSize());
-
- joinTable.removeSpecifiedJoinColumn(0);
- joinTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTable.getJoinColumnsSize());
-
- // default columns
- assertNotNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable());
- JavaResourceAttribute resAttribute = this.getJavaPersistentType().getAttributes().iterator().next().getResourceAttribute();
- assertNotNull(resAttribute.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- manyToManyMapping.getRelationship().getJoinTableStrategy().removeStrategy();
- // default join table
- assertNotNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable());
- assertNull(resAttribute.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
-
- //if non-owning side of the relationship then no default join table
- manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("foo");
- assertNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable());
- }
-
- public void testAddSpecifiedInverseJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JoinColumn inverseJoinColumn = joinTable.addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("FOO");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(0).getName());
-
- JoinColumn inverseJoinColumn2 = joinTable.addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(1).getName());
-
- JoinColumn inverseJoinColumn3 = joinTable.addSpecifiedInverseJoinColumn(1);
- inverseJoinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(2).getName());
-
- ListIterator<JavaJoinColumn> inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals(inverseJoinColumn2, inverseJoinColumns.next());
- assertEquals(inverseJoinColumn3, inverseJoinColumns.next());
- assertEquals(inverseJoinColumn, inverseJoinColumns.next());
-
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedInverseJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- joinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getInverseJoinColumnsSize());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(2, joinTableResource.getInverseJoinColumnsSize());
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(1).getName());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTableResource.getInverseJoinColumnsSize());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(0).getName());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(0, joinTableResource.getInverseJoinColumnsSize());
- }
-
- public void testMoveSpecifiedInverseJoinColumn() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- joinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- joinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- joinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getInverseJoinColumnsSize());
-
-
- joinTable.moveSpecifiedInverseJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(2).getName());
-
-
- joinTable.moveSpecifiedInverseJoinColumn(0, 1);
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.inverseJoinColumnAt(0).getName());
- assertEquals("BAR", joinTableResource.inverseJoinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.inverseJoinColumnAt(2).getName());
- }
-
- public void testUpdateInverseJoinColumns() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- JoinTableAnnotation joinTableResource = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- joinTableResource.addInverseJoinColumn(0);
- joinTableResource.addInverseJoinColumn(1);
- joinTableResource.addInverseJoinColumn(2);
-
- joinTableResource.inverseJoinColumnAt(0).setName("FOO");
- joinTableResource.inverseJoinColumnAt(1).setName("BAR");
- joinTableResource.inverseJoinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaJoinColumn> inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.moveInverseJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.moveInverseJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.removeInverseJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.removeInverseJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- inverseJoinColumns = joinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- joinTableResource.removeInverseJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joinTable.getSpecifiedInverseJoinColumns().iterator().hasNext());
- }
-
- public void testGetDefaultInverseJoinColumn() {
- //TODO
- }
-
- public void testSpecifiedInverseJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(0, joinTable.getSpecifiedInverseJoinColumnsSize());
-
- joinTable.addSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTable.getSpecifiedInverseJoinColumnsSize());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(0, joinTable.getSpecifiedInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumnsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
-
- joinTable.addSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
-
- joinTable.addSpecifiedInverseJoinColumn(0);
- assertEquals(2, joinTable.getInverseJoinColumnsSize());
-
- joinTable.removeSpecifiedInverseJoinColumn(0);
- joinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
-
- //if non-owning side of the relationship then no default join table
- manyToManyMapping.getRelationship().setStrategyToMappedBy();
- assertNull(manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertEquals(0, joinTable.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, joinTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
- joinTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- joinTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- joinTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- joinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- joinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- joinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
-
- joinTable.moveUniqueConstraint(2, 0);
- ListIterator<? extends UniqueConstraint> uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- joinTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaManyToManyMapping manyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinTableAnnotation joinTableAnnotation = (JoinTableAnnotation) resourceField.addAnnotation(JoinTableAnnotation.ANNOTATION_NAME);
-
- joinTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- joinTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = joinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToManyMappingTests.java
deleted file mode 100644
index 6137fb3420..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToManyMappingTests.java
+++ /dev/null
@@ -1,1183 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaManyToManyMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithCollectionManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithNonCollectionManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Address addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Map;");
- sb.append(CR);
- sb.append("import ").append(JPA.MANY_TO_MANY).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Map<Integer, Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- public JavaManyToManyMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToManyAnnotation = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToManyAnnotation.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToManyAnnotation.setTargetEntity("newTargetEntity");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetEntity", manyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToManyAnnotation.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToManyAnnotation.setTargetEntity(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToManyAnnotation.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", manyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the context model
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(manyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
-
- //set fetch in the resource model, verify context model updated
- manyToMany.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.EAGER, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.LAZY, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, manyToMany.getFetch());
-
-
- //set fetch to null in the resource model
- manyToMany.setFetch(null);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
-
- //set fetch in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, manyToMany.getFetch());
-
- manyToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, manyToMany.getFetch());
-
- //set fetch to null in the context model
- manyToManyMapping.setSpecifiedFetch(null);
- assertNull(manyToManyMapping.getSpecifiedFetch());
- assertNull(manyToMany.getFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedByJoiningStrategy in the resource model, verify context model updated
- manyToMany.setMappedBy("newMappedBy");
- getJpaProject().synchronizeContextModel();
- assertEquals("newMappedBy", manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertEquals("newMappedBy", manyToMany.getMappedBy());
-
- //set mappedByJoiningStrategy to null in the resource model
- manyToMany.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("newTargetEntity");
- assertEquals("newTargetEntity", manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertEquals("newTargetEntity", manyToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute(null);
- assertNull(manyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation annotation = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping mapping = (ManyToManyMapping) contextAttribute.getMapping();
- ManyToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToManyAnnotation annotation = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping mapping = (ManyToManyMapping) contextAttribute.getMapping();
- ManyToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityNonCollectionType() throws Exception {
- createTestEntityWithNonCollectionManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getTargetEntity());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", manyToManyMapping.getTargetEntity());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", manyToManyMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(manyToManyMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, manyToManyMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- assertNull(manyToManyMapping.getResolvedTargetEntity());
-
-
- manyToManyMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, manyToManyMapping.getResolvedTargetEntity());
-
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, manyToManyMapping.getResolvedTargetEntity());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKey(null);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- manyToManyMapping.setNoMapKey(true);
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- javaManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = javaManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = javaManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
- public void testUpdateOrderBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertEquals("newOrderBy", manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyOrderBy() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set mappedBy in the context model, verify resource model updated
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set mappedBy to null in the context model
- manyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertNull(manyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateNoOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertTrue(manyToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isNoOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isNoOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertTrue(manyToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyNoOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertTrue(manyToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
-// manyToManyMapping.setNoOrdering(false); //this does nothing
-// //set mappedBy in the context model, verify resource model updated
-// manyToManyMapping.setOrderBy("newOrderBy");
-// assertEquals("newOrderBy", manyToManyMapping.getOrderBy());
-// OrderBy orderBy = (OrderBy) resourceField.annotation(OrderBy.ANNOTATION_NAME);
-// assertEquals("newOrderBy", orderBy.getValue());
-//
-// //set mappedBy to null in the context model
-// manyToManyMapping.setOrderBy(null);
-// assertNull(manyToManyMapping.getOrderBy());
-// assertNull(resourceField.annotation(OrderBy.ANNOTATION_NAME));
- }
-
- public void testUpdatePkOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(manyToManyMapping.getOrderable().isPkOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertTrue(manyToManyMapping.getOrderable().isPkOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isPkOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isPkOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateCustomOrdering() throws Exception {
- createTestEntityWithManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(manyToManyMapping.getOrderable().isCustomOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.getOrderable().isCustomOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertTrue(manyToManyMapping.getOrderable().isCustomOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(manyToManyMapping.getOrderable().isCustomOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultTargetEntityForMap() throws Exception {
- createTestEmployee();
- createTestDepartment();
- addXmlClassRef(PACKAGE_NAME + ".Department");
- addXmlClassRef(PACKAGE_NAME + ".Employee");
-
- JavaPersistentType departmentPersistentType = getJavaPersistentType();
- ManyToManyMapping employeesMapping = (ManyToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(PACKAGE_NAME + ".Employee", employeesMapping.getTargetEntity());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java
deleted file mode 100644
index 792e4730c7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaManyToOneMappingTests.java
+++ /dev/null
@@ -1,964 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneRelationship;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaManyToOneMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithCollectionManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Collection address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericizedCollectionManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- public JavaManyToOneMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToOne.setTargetEntity("newTargetEntity");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetEntity", manyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToOne.setTargetEntity(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- manyToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", manyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the context model
- manyToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(manyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
-
- //set optional in the resource model, verify context model updated
- manyToOne.setOptional(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
- //set optional to null in the resource model
- manyToOne.setOptional(null);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
-
- //set optional in the context model, verify resource model updated
- manyToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
-
- //set optional to null in the context model
- manyToOneMapping.setSpecifiedOptional(null);
- assertNull(manyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOne.getOptional());
- }
-
-
- public void testSpecifiedJoinColumns() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- ListIterator<? extends JoinColumn> specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
-
- assertFalse(specifiedJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(specifiedJoinColumns.hasNext());
- }
-
- public void testGetDefaultJoin() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getSpecifiedJoinColumnsSize());
-
- joinColumns.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- }
-
- public void testJoinColumnsSize() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(2, joinColumns.getJoinColumnsSize());
-
- joinColumns.removeSpecifiedJoinColumn(0);
- joinColumns.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getJoinColumnsSize());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedJoinColumn2() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
-
- joinColumns.removeSpecifiedJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- joinColumns.removeSpecifiedJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- joinColumns.removeSpecifiedJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
- joinColumns.moveSpecifiedJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> primaryKeyJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
-
-
- joinColumns.moveSpecifiedJoinColumn(0, 1);
- primaryKeyJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedJoinColumns() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN)).setName("FOO");
- ((JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN)).setName("BAR");
- ((JoinColumnAnnotation) resourceField.addAnnotation(2, JPA.JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, JoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, JoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
- public void testJoinColumnIsVirtual() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertTrue(joinColumns.getDefaultJoinColumn().isVirtual());
-
- joinColumns.addSpecifiedJoinColumn(0);
- JoinColumn specifiedJoinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isVirtual());
-
- assertNull(joinColumns.getDefaultJoinColumn());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping mapping = (ManyToOneMapping) contextAttribute.getMapping();
- ManyToOneRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping mapping = (ManyToOneMapping) contextAttribute.getMapping();
- ManyToOneRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertTrue(rel.strategyIsJoinColumn());
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertNull(manyToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityGenericizedCollectionType() throws Exception {
- createTestEntityWithGenericizedCollectionManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertNull(manyToOneMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidManyToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getTargetEntity());
-
- manyToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", manyToOneMapping.getTargetEntity());
-
- manyToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", manyToOneMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(manyToOneMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, manyToOneMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- manyToOneMapping.setSpecifiedTargetEntity("foo");
- assertNull(manyToOneMapping.getResolvedTargetEntity());
-
-
- manyToOneMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, manyToOneMapping.getResolvedTargetEntity());
-
-
- manyToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, manyToOneMapping.getResolvedTargetEntity());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaMappedSuperclassTests.java
deleted file mode 100644
index d078818d70..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.IdClassReference;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaMappedSuperclassTests extends ContextModelTestCase
-{
- public JavaMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
- });
- }
-
- private void createTestIdClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append("TestTypeId").append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "TestTypeId.java", sourceWriter);
- }
-
- public void testMorphToEntity() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- mappedSuperclass.getIdClassReference().setSpecifiedIdClassName("myIdClass");
-
- getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Entity);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddable() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- mappedSuperclass.getIdClassReference().setSpecifiedIdClassName("myIdClass");
-
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- mappedSuperclass.getIdClassReference().setSpecifiedIdClassName("myIdClass");
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- }
-
- public void testMappedSuperclass() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass);
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = mappedSuperclass.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = mappedSuperclass.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testTableNameIsInvalid() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.tableNameIsInvalid(FULLY_QUALIFIED_TYPE_NAME));
- assertFalse(mappedSuperclass.tableNameIsInvalid("FOO"));
- }
-
- public void testAssociatedTables() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.getAssociatedTables().iterator().hasNext());
- }
-
- public void testAssociatedTablesIncludingInherited() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.getAllAssociatedTables().iterator().hasNext());
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- assertFalse(mappedSuperclass.getAllAssociatedTableNames().iterator().hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- Iterator<String> overridableAttributeNames = mappedSuperclass.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- //TODO need to create a subclass mappedSuperclass and test this
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- Iterator<String> overridableAssociationNames = mappedSuperclass.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(mappedSuperclass.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestMappedSuperclass();
- createTestIdClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- IdClassReference idClassRef = mappedSuperclass.getIdClassReference();
-
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- IdClassAnnotation idClassAnnotation = (IdClassAnnotation) resourceType.addAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- this.getJpaProject().synchronizeContextModel();
- assertNotNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- // test setting id class name to nonexistent class. test class name is set, but class is null
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassAnnotation.setValue(nonExistentIdClassName);
- this.getJpaProject().synchronizeContextModel();
- assertEquals(nonExistentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- // test setting id class name to existent class. test class name is set and class is not null
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassAnnotation.setValue(existentIdClassName);
- this.getJpaProject().synchronizeContextModel();
- assertEquals(existentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- //test setting @IdClass value to null, IdClass annotation is removed
- idClassRef.setSpecifiedIdClassName(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- //reset @IdClass value and then remove @IdClass
- idClassAnnotation = (IdClassAnnotation) resourceType.addAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- idClassAnnotation.setValue(existentIdClassName);
- resourceType.removeAnnotation(IdClassAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- createTestMappedSuperclass();
- createTestIdClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
- IdClassReference idClassRef = mappedSuperclass.getIdClassReference();
-
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassRef.setSpecifiedIdClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassRef.setSpecifiedIdClassName(existentIdClassName);
- assertEquals(existentIdClassName, ((IdClassAnnotation) resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME)).getValue());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- idClassRef.setSpecifiedIdClassName(null);
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedNativeQueryTests.java
deleted file mode 100644
index ff43788f3f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedNativeQueryTests.java
+++ /dev/null
@@ -1,433 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.NamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.QueryHint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaNamedNativeQueryTests extends ContextModelTestCase
-{
- private static final String QUERY_NAME = "QUERY_NAME";
- private static final String QUERY_QUERY = "MY_QUERY";
-
- private ICompilationUnit createTestEntityWithNamedNativeQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedNativeQuery(name=\"" + QUERY_NAME + "\", query=\"" + QUERY_QUERY + "\")");
- }
- });
- }
-
-
-
- public JavaNamedNativeQueryTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedNativeQuery.getName());
- assertEquals(QUERY_NAME, namedNativeQuery.getName());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedNativeQuery.getName());
- assertNull(namedNativeQuery.getName());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedNativeQuery.getName());
- assertEquals("foo", namedNativeQuery.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedNativeQuery.getName());
- assertEquals(QUERY_NAME, namedNativeQuery.getName());
-
- //set name to null in the context model
- namedNativeQuery.setName(null);
- assertNull(javaNamedNativeQuery.getName());
- assertNull(namedNativeQuery.getName());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setName("foo");
- assertEquals("foo", javaNamedNativeQuery.getName());
- assertEquals("foo", namedNativeQuery.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedNativeQuery.getQuery());
- assertEquals(QUERY_QUERY, namedNativeQuery.getQuery());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setQuery(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedNativeQuery.getQuery());
- assertNull(namedNativeQuery.getQuery());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setQuery("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedNativeQuery.getQuery());
- assertEquals("foo", namedNativeQuery.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedNativeQuery.getQuery());
- assertEquals(QUERY_QUERY, namedNativeQuery.getQuery());
-
- //set name to null in the context model
- namedNativeQuery.setQuery(null);
- assertNull(javaNamedNativeQuery.getQuery());
- assertNull(namedNativeQuery.getQuery());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setQuery("foo");
- assertEquals("foo", javaNamedNativeQuery.getQuery());
- assertEquals("foo", namedNativeQuery.getQuery());
- }
-
-
- public void testAddHint() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
-
- QueryHint queryHint = namedNativeQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", javaNamedNativeQuery.hintAt(0).getName());
-
- QueryHint queryHint2 = namedNativeQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(1).getName());
-
- QueryHint queryHint3 = namedNativeQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(2).getName());
-
- ListIterator<? extends QueryHint> hints = namedNativeQuery.getHints().iterator();
- assertEquals(queryHint2, hints.next());
- assertEquals(queryHint3, hints.next());
- assertEquals(queryHint, hints.next());
-
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- namedNativeQuery.addHint(0).setName("FOO");
- namedNativeQuery.addHint(1).setName("BAR");
- namedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedNativeQuery.getHintsSize());
-
- namedNativeQuery.removeHint(0);
- assertEquals(2, javaNamedNativeQuery.getHintsSize());
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName());
-
- namedNativeQuery.removeHint(0);
- assertEquals(1, javaNamedNativeQuery.getHintsSize());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(0).getName());
-
- namedNativeQuery.removeHint(0);
- assertEquals(0, javaNamedNativeQuery.getHintsSize());
- }
-
- public void testMoveHint() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- namedNativeQuery.addHint(0).setName("FOO");
- namedNativeQuery.addHint(1).setName("BAR");
- namedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedNativeQuery.getHintsSize());
-
-
- namedNativeQuery.moveHint(2, 0);
- ListIterator<? extends QueryHint> hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(2).getName());
-
-
- namedNativeQuery.moveHint(0, 1);
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", javaNamedNativeQuery.hintAt(0).getName());
- assertEquals("BAR", javaNamedNativeQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedNativeQuery.hintAt(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation queryAnnotation = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- queryAnnotation.addHint(0).setName("FOO");
- queryAnnotation.addHint(1).setName("BAR");
- queryAnnotation.addHint(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends QueryHint> hints = namedNativeQuery.getHints().iterator();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.moveHint(2, 0);
- getJpaProject().synchronizeContextModel();
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.moveHint(0, 1);
- getJpaProject().synchronizeContextModel();
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.removeHint(1);
- getJpaProject().synchronizeContextModel();
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.removeHint(1);
- getJpaProject().synchronizeContextModel();
- hints = namedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- queryAnnotation.removeHint(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(namedNativeQuery.getHints().iterator().hasNext());
- }
-
- public void testHintsSize() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
-
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
- assertEquals(0, namedNativeQuery.getHintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
-
- javaNamedNativeQuery.addHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(1, namedNativeQuery.getHintsSize());
-
- javaNamedNativeQuery.addHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(2, namedNativeQuery.getHintsSize());
-
- javaNamedNativeQuery.removeHint(0);
- javaNamedNativeQuery.removeHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, namedNativeQuery.getHintsSize());
- }
-
- public void testUpdateResultClass() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation queryAnnotation = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, queryAnnotation.getResultClass());
- assertEquals(null, namedNativeQuery.getResultClass());
-
- //set name in the resource model, verify context model updated
- queryAnnotation.setResultClass("foo");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("foo", queryAnnotation.getResultClass());
- assertEquals("foo", namedNativeQuery.getResultClass());
-
- //set name to null in the resource model
- queryAnnotation.setResultClass(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(queryAnnotation.getResultClass());
- assertNull(namedNativeQuery.getResultClass());
- }
-
- public void testModifyResultClass() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultClass());
- assertEquals(null, namedNativeQuery.getResultClass());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setResultClass("foo");
- assertEquals("foo", javaNamedNativeQuery.getResultClass());
- assertEquals("foo", namedNativeQuery.getResultClass());
-
- //set name to null in the context model
- namedNativeQuery.setResultClass(null);
- assertNull(javaNamedNativeQuery.getResultClass());
- assertNull(namedNativeQuery.getResultClass());
- }
-
- public void testUpdateResultSetMapping() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultSetMapping());
- assertEquals(null, namedNativeQuery.getResultSetMapping());
-
- //set name in the resource model, verify context model updated
- javaNamedNativeQuery.setResultSetMapping("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedNativeQuery.getResultSetMapping());
- assertEquals("foo", namedNativeQuery.getResultSetMapping());
-
- //set name to null in the resource model
- javaNamedNativeQuery.setResultSetMapping(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedNativeQuery.getResultSetMapping());
- assertNull(namedNativeQuery.getResultSetMapping());
- }
-
- public void testModifyResultSetMapping() throws Exception {
- createTestEntityWithNamedNativeQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedNativeQuery namedNativeQuery = entity.getQueryContainer().getNamedNativeQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedNativeQueryAnnotation javaNamedNativeQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(null, javaNamedNativeQuery.getResultSetMapping());
- assertEquals(null, namedNativeQuery.getResultSetMapping());
-
- //set name in the context model, verify resource model updated
- namedNativeQuery.setResultSetMapping("foo");
- assertEquals("foo", javaNamedNativeQuery.getResultSetMapping());
- assertEquals("foo", namedNativeQuery.getResultSetMapping());
-
- //set name to null in the context model
- namedNativeQuery.setResultSetMapping(null);
- assertNull(javaNamedNativeQuery.getResultSetMapping());
- assertNull(namedNativeQuery.getResultSetMapping());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedQueryTests.java
deleted file mode 100644
index 6d95c28765..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaNamedQueryTests.java
+++ /dev/null
@@ -1,334 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.NamedQuery;
-import org.eclipse.jpt.jpa.core.context.QueryHint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaNamedQueryTests extends ContextModelTestCase
-{
- private static final String QUERY_NAME = "QUERY_NAME";
- private static final String QUERY_QUERY = "MY_QUERY";
-
- private ICompilationUnit createTestEntityWithNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQuery(name=\"" + QUERY_NAME + "\", query=\"" + QUERY_QUERY + "\")");
- }
- });
- }
-
-
-
- public JavaNamedQueryTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedQuery.getName());
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- //set name to null in the resource model
- javaNamedQuery.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedQuery.getName());
- assertNull(namedQuery.getName());
-
- //set name in the resource model, verify context model updated
- javaNamedQuery.setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedQuery.getName());
- assertEquals("foo", namedQuery.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_NAME, javaNamedQuery.getName());
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- //set name to null in the context model
- namedQuery.setName(null);
- assertNull(javaNamedQuery.getName());
- assertNull(namedQuery.getName());
-
- //set name in the context model, verify resource model updated
- namedQuery.setName("foo");
- assertEquals("foo", javaNamedQuery.getName());
- assertEquals("foo", namedQuery.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedQuery.getQuery());
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- //set name to null in the resource model
- javaNamedQuery.setQuery(null);
- getJpaProject().synchronizeContextModel();
- assertNull(javaNamedQuery.getQuery());
- assertNull(namedQuery.getQuery());
-
- //set name in the resource model, verify context model updated
- javaNamedQuery.setQuery("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", javaNamedQuery.getQuery());
- assertEquals("foo", namedQuery.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- assertEquals(QUERY_QUERY, javaNamedQuery.getQuery());
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- //set name to null in the context model
- namedQuery.setQuery(null);
- assertNull(javaNamedQuery.getQuery());
- assertNull(namedQuery.getQuery());
-
- //set name in the context model, verify resource model updated
- namedQuery.setQuery("foo");
- assertEquals("foo", javaNamedQuery.getQuery());
- assertEquals("foo", namedQuery.getQuery());
- }
-
-
- public void testAddHint() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
-
- QueryHint queryHint = namedQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", javaNamedQuery.hintAt(0).getName());
-
- QueryHint queryHint2 = namedQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(1).getName());
-
- QueryHint queryHint3 = namedQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(2).getName());
-
- ListIterator<? extends QueryHint> hints = namedQuery.getHints().iterator();
- assertEquals(queryHint2, hints.next());
- assertEquals(queryHint3, hints.next());
- assertEquals(queryHint, hints.next());
-
- hints = namedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1).setName("BAR");
- namedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedQuery.getHintsSize());
-
- namedQuery.removeHint(0);
- assertEquals(2, javaNamedQuery.getHintsSize());
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedQuery.hintAt(1).getName());
-
- namedQuery.removeHint(0);
- assertEquals(1, javaNamedQuery.getHintsSize());
- assertEquals("BAZ", javaNamedQuery.hintAt(0).getName());
-
- namedQuery.removeHint(0);
- assertEquals(0, javaNamedQuery.getHintsSize());
- }
-
- public void testMoveHint() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1).setName("BAR");
- namedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, javaNamedQuery.getHintsSize());
-
-
- namedQuery.moveHint(2, 0);
- ListIterator<? extends QueryHint> hints = namedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAZ", javaNamedQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(2).getName());
-
-
- namedQuery.moveHint(0, 1);
- hints = namedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", javaNamedQuery.hintAt(0).getName());
- assertEquals("BAR", javaNamedQuery.hintAt(1).getName());
- assertEquals("FOO", javaNamedQuery.hintAt(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation namedQueryAnnotation = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
- namedQueryAnnotation.addHint(0).setName("FOO");
- namedQueryAnnotation.addHint(1).setName("BAR");
- namedQueryAnnotation.addHint(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends QueryHint> hints = namedQuery.getHints().iterator();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.moveHint(2, 0);
- getJpaProject().synchronizeContextModel();
- hints = namedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.moveHint(0, 1);
- getJpaProject().synchronizeContextModel();
- hints = namedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.removeHint(1);
- getJpaProject().synchronizeContextModel();
- hints = namedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.removeHint(1);
- getJpaProject().synchronizeContextModel();
- hints = namedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryAnnotation.removeHint(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(namedQuery.getHints().iterator().hasNext());
- }
-
- public void testHintsSize() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = getJavaEntity();
-
- NamedQuery namedQuery = entity.getQueryContainer().getNamedQueries().iterator().next();
- assertEquals(0, namedQuery.getHintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation javaNamedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME);
-
-
- javaNamedQuery.addHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(1, namedQuery.getHintsSize());
-
- javaNamedQuery.addHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(2, namedQuery.getHintsSize());
-
- javaNamedQuery.removeHint(0);
- javaNamedQuery.removeHint(0);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, namedQuery.getHintsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToManyMappingTests.java
deleted file mode 100644
index caea3e45a0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToManyMappingTests.java
+++ /dev/null
@@ -1,1163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaOneToManyMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithCollectionOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithNonCollectionOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Address addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Map;");
- sb.append(CR);
- sb.append("import ").append(JPA.ONE_TO_MANY).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Map<Integer, Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- public JavaOneToManyMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToManyAnnotation = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToManyAnnotation.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToManyAnnotation.setTargetEntity("newTargetEntity");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetEntity", oneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToManyAnnotation.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToManyAnnotation.setTargetEntity(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToManyAnnotation.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", oneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the context model
- oneToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(oneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToMany.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.EAGER, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.LAZY, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, oneToMany.getFetch());
-
-
- //set fetch to null in the resource model
- oneToMany.setFetch(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
-
- //set fetch in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, oneToMany.getFetch());
-
- oneToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, oneToMany.getFetch());
-
- //set fetch to null in the context model
- oneToManyMapping.setSpecifiedFetch(null);
- assertNull(oneToManyMapping.getSpecifiedFetch());
- assertNull(oneToMany.getFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToMany.setMappedBy("newMappedBy");
- getJpaProject().synchronizeContextModel();
- assertEquals("newMappedBy", oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertEquals("newMappedBy", oneToMany.getMappedBy());
-
- //set mappedBy to null in the resource model
- oneToMany.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("newTargetEntity");
- assertEquals("newTargetEntity", oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertEquals("newTargetEntity", oneToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute(null);
- assertNull(oneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
- }
-
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- //TODO this needs to return null for 1.0 mappings. we want the validation error for dot-notation since this is only supported in 2.0
- //TODO need to copy this to all the other mapped by tests.
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping mapping = (OneToManyMapping) contextAttribute.getMapping();
- OneToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping mapping = (OneToManyMapping) contextAttribute.getMapping();
- OneToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityNonCollectionType() throws Exception {
- createTestEntityWithNonCollectionOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getTargetEntity());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", oneToManyMapping.getTargetEntity());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", oneToManyMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(oneToManyMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, oneToManyMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- assertNull(oneToManyMapping.getResolvedTargetEntity());
-
-
- oneToManyMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, oneToManyMapping.getResolvedTargetEntity());
-
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, oneToManyMapping.getResolvedTargetEntity());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKey(null);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- oneToManyMapping.setNoMapKey(true);
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testUpdateOrderBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertEquals("newOrderBy", oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyOrderBy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set mappedBy in the context model, verify resource model updated
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertEquals("newOrderBy", orderBy.getValue());
-
- //set mappedBy to null in the context model
- oneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertNull(oneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateNoOrdering() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertTrue(oneToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isNoOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isNoOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertTrue(oneToManyMapping.getOrderable().isNoOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdatePkOrdering() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(oneToManyMapping.getOrderable().isPkOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertTrue(oneToManyMapping.getOrderable().isPkOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isPkOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isPkOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateCustomOrdering() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertFalse(oneToManyMapping.getOrderable().isCustomOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
-
- //set orderBy in the resource model, verify context model updated
- resourceField.addAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.getOrderable().isCustomOrdering());
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- orderBy.setValue("newOrderBy");
- getJpaProject().synchronizeContextModel();
- assertTrue(oneToManyMapping.getOrderable().isCustomOrdering());
-
- //set orderBy to null in the resource model
- resourceField.removeAnnotation(OrderByAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(oneToManyMapping.getOrderable().isCustomOrdering());
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultTargetEntityForMap() throws Exception {
- createTestEmployee();
- createTestDepartment();
- addXmlClassRef(PACKAGE_NAME + ".Department");
- addXmlClassRef(PACKAGE_NAME + ".Employee");
-
- JavaPersistentType departmentPersistentType = getJavaPersistentType();
- OneToManyMapping employeesMapping = (OneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(PACKAGE_NAME + ".Employee", employeesMapping.getTargetEntity());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java
deleted file mode 100644
index b7bb8cfa7f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaOneToOneMappingTests.java
+++ /dev/null
@@ -1,1516 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneRelationship;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaOneToOneMappingTests extends ContextModelTestCase
-{
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithCollectionOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Collection address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericizedCollectionOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- public JavaOneToOneMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOneAnnotation = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOneAnnotation.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToOneAnnotation.setTargetEntity("newTargetEntity");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetEntity", oneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOneAnnotation.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToOneAnnotation.setTargetEntity(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOneAnnotation.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- oneToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", oneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the context model
- oneToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- MappedByRelationshipStrategy mappedBy = oneToOneMapping.getRelationship().getMappedByStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(mappedBy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToOne.setMappedBy("newMappedBy");
- getJpaProject().synchronizeContextModel();
- assertEquals("newMappedBy", mappedBy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToOne.getMappedBy());
-
- //set mappedBy to null in the resource model
- oneToOne.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappedBy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- MappedByRelationshipStrategy mappedBy = oneToOneMapping.getRelationship().getMappedByStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(mappedBy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedByJoiningStrategy in the context model, verify resource model updated
- mappedBy.setMappedByAttribute("newTargetEntity");
- assertEquals("newTargetEntity", mappedBy.getMappedByAttribute());
- assertEquals("newTargetEntity", oneToOne.getMappedBy());
-
- //set mappedByJoiningStrategy to null in the context model
- mappedBy.setMappedByAttribute(null);
- assertNull(mappedBy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
-
- //set optional in the resource model, verify context model updated
- oneToOne.setOptional(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
-
- //set optional to null in the resource model
- oneToOne.setOptional(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
-
- //set optional in the context model, verify resource model updated
- oneToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
-
- //set optional to null in the context model
- oneToOneMapping.setSpecifiedOptional(null);
- assertNull(oneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOne.getOptional());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToOne.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.EAGER, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.LAZY, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, oneToOne.getFetch());
-
- //set fetch to null in the resource model
- oneToOne.setFetch(null);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
-
- //set fetch in the context model, verify resource model updated
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, oneToOne.getFetch());
-
- oneToOneMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, oneToOne.getFetch());
-
- //set fetch to null in the context model
- oneToOneMapping.setSpecifiedFetch(null);
- assertNull(oneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOne.getFetch());
- }
-
- public void testSpecifiedJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- ListIterator<? extends JoinColumn> specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
-
- assertFalse(specifiedJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", specifiedJoinColumns.next().getName());
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", specifiedJoinColumns.next().getName());
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", specifiedJoinColumns.next().getName());
- assertFalse(specifiedJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(specifiedJoinColumns.hasNext());
- }
-
- public void testGetDefaultJoin() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getSpecifiedJoinColumnsSize());
-
- joinColumns.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinColumns.getSpecifiedJoinColumnsSize());
- }
-
- public void testJoinColumnsSize() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- joinColumns.addSpecifiedJoinColumn(0);
- assertEquals(2, joinColumns.getJoinColumnsSize());
-
- joinColumns.removeSpecifiedJoinColumn(0);
- joinColumns.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinColumns.getJoinColumnsSize());
-
- //if non-owning side of the relationship then no default join column
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("foo");
- assertEquals(0, joinColumns.getJoinColumnsSize());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedJoinColumn2() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
-
- joinColumns.removeSpecifiedJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- joinColumns.removeSpecifiedJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- joinColumns.removeSpecifiedJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- joinColumns.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joinColumns.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joinColumns.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- joinColumns.moveSpecifiedJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> primaryKeyJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
-
-
- joinColumns.moveSpecifiedJoinColumn(0, 1);
- primaryKeyJoinColumns = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN)).setName("FOO");
- ((JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN)).setName("BAR");
- ((JoinColumnAnnotation) resourceField.addAnnotation(2, JPA.JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, JoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, JoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = joinColumns.getSpecifiedJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testJoinColumnIsVirtual() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertTrue(joinColumns.getDefaultJoinColumn().isVirtual());
-
- joinColumns.addSpecifiedJoinColumn(0);
- JoinColumn specifiedJoinColumn = joinColumns.getSpecifiedJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isVirtual());
-
- assertNull(joinColumns.getDefaultJoinColumn());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testDefaultTargetEntity() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Entity, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityCollectionType() throws Exception {
- createTestEntityWithCollectionOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertNull(oneToOneMapping.getDefaultTargetEntity());
- }
-
- public void testDefaultTargetEntityGenericizedCollectionType() throws Exception {
- createTestEntityWithGenericizedCollectionOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertNull(oneToOneMapping.getDefaultTargetEntity());
- }
-
- public void testTargetEntity() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getTargetEntity());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- assertEquals("foo", oneToOneMapping.getTargetEntity());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(PACKAGE_NAME + ".Address", oneToOneMapping.getTargetEntity());
- }
-
- public void testResolvedTargetEntity() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit
- assertNull(oneToOneMapping.getResolvedTargetEntity());
-
- //add targetEntity to the persistence unit, now target entity should resolve
- createTestTargetEntityAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, oneToOneMapping.getResolvedTargetEntity());
-
- //test default still the same when specified target entity it set
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- assertNull(oneToOneMapping.getResolvedTargetEntity());
-
-
- oneToOneMapping.setSpecifiedTargetEntity(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, oneToOneMapping.getResolvedTargetEntity());
-
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- assertEquals(addressTypeMapping, oneToOneMapping.getResolvedTargetEntity());
- }
-
- public void testPrimaryKeyJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
- Iterator<? extends PrimaryKeyJoinColumn> primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
-
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
-
- joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertFalse(primaryKeyJoinColumns.hasNext());
- }
-
- public void testPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- assertEquals(0, strategy.getPrimaryKeyJoinColumnsSize());
-
- strategy.addPrimaryKeyJoinColumn(0);
- assertEquals(1, strategy.getPrimaryKeyJoinColumnsSize());
-
- strategy.removePrimaryKeyJoinColumn(0);
- assertEquals(0, strategy.getPrimaryKeyJoinColumnsSize());
- }
-
- public void testAddPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
-
- public void testAddPrimaryKeyJoinColumn2() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) joinColumns.next()).getName());
- assertFalse(joinColumns.hasNext());
- }
-
- public void testRemovePrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
-
- strategy.removePrimaryKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends PrimaryKeyJoinColumn> joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- strategy.removePrimaryKeyJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
-
- strategy.removePrimaryKeyJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertFalse(joinColumns.hasNext());
-
- assertNull(resourceField.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- }
-
- public void testMovePrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- strategy.movePrimaryKeyJoinColumn(2, 0);
- ListIterator<? extends PrimaryKeyJoinColumn> primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
-
-
- strategy.movePrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdatePrimaryKeyJoinColumns() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- PrimaryKeyJoinColumnRelationshipStrategy strategy =
- oneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
-
- ((PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN)).setName("FOO");
- ((PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN)).setName("BAR");
- ((PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(2, JPA.PRIMARY_KEY_JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends PrimaryKeyJoinColumn> joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.moveAnnotation(2, 0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.moveAnnotation(0, 1, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.removeAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.removeAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertFalse(joinColumns.hasNext());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping mapping = (OneToOneMapping) contextAttribute.getMapping();
- OneToOneRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping mapping = (OneToOneMapping) contextAttribute.getMapping();
- OneToOneRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java
deleted file mode 100644
index 42290f8735..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaPrimaryKeyJoinColumnTests.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaPrimaryKeyJoinColumnTests extends ContextModelTestCase
-{
- private static final String PRIMARY_KEY_JOIN_COLUMN_NAME = "MY_PRIMARY_KEY_JOIN_COLUMN";
- private static final String COLUMN_DEFINITION = "MY_COLUMN_DEFINITION";
-
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithPrimaryKeyJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@PrimaryKeyJoinColumn(name=\"" + PRIMARY_KEY_JOIN_COLUMN_NAME + "\")");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
-
- public JavaPrimaryKeyJoinColumnTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals(PRIMARY_KEY_JOIN_COLUMN_NAME, specifiedPkJoinColumn.getSpecifiedName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- pkJoinColumnResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("FOO", specifiedPkJoinColumn.getName());
- }
-
- public void testGetDefaultNameNoSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn pkJoinColumn = getJavaEntity().getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", pkJoinColumn.getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("id", specifiedPkJoinColumn.getDefaultName());
-
- //remove @Id annotation
- PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id");
- idAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(specifiedPkJoinColumn.getDefaultName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals(PRIMARY_KEY_JOIN_COLUMN_NAME, specifiedPkJoinColumn.getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
-
- specifiedPkJoinColumn.setSpecifiedName("foo");
- assertEquals("foo", specifiedPkJoinColumn.getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation columnAnnotation = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals("foo", columnAnnotation.getName());
-
- specifiedPkJoinColumn.setSpecifiedName(null);
- assertNull(specifiedPkJoinColumn.getSpecifiedName());
- columnAnnotation = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNull(columnAnnotation.getName());
- }
-
- public void testGetColumnDefinition() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertNull(specifiedPkJoinColumn.getColumnDefinition());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- column.setColumnDefinition(COLUMN_DEFINITION);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(COLUMN_DEFINITION, specifiedPkJoinColumn.getColumnDefinition());
-
- column.setColumnDefinition(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(specifiedPkJoinColumn.getColumnDefinition());
-
- resourceType.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(0, getJavaEntity().getSpecifiedPrimaryKeyJoinColumnsSize());
- }
-
- public void testSetColumnDefinition() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- specifiedPkJoinColumn.setColumnDefinition("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals("foo", column.getColumnDefinition());
-
- specifiedPkJoinColumn.setColumnDefinition(null);
- column = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNull(column.getColumnDefinition());
- }
-
- public void testGetSpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertNull(specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- pkJoinColumnResource.setReferencedColumnName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("FOO", specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testGetDefaultReferencedColumnNameNoSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn pkJoinColumn = getJavaEntity().getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", pkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testGetDefaultReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("id", specifiedPkJoinColumn.getDefaultReferencedColumnName());
-
-
- //remove @Id annotation
- PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id");
- idAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(specifiedPkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testGetReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation pkJoinColumnResource = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- pkJoinColumnResource.setReferencedColumnName("FOO");
- getJpaProject().synchronizeContextModel();
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertEquals("FOO", specifiedPkJoinColumn.getReferencedColumnName());
- }
-
- public void testSetSpecifiedReferencedColumnName() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
-
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName("foo");
- assertEquals("foo", specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- PrimaryKeyJoinColumnAnnotation columnAnnotation = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals("foo", columnAnnotation.getReferencedColumnName());
-
- specifiedPkJoinColumn.setSpecifiedName(null);
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(specifiedPkJoinColumn.getSpecifiedReferencedColumnName());
- columnAnnotation = (PrimaryKeyJoinColumnAnnotation) resourceType.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNull(columnAnnotation.getReferencedColumnName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(specifiedPkJoinColumn.isVirtual());
-
- assertNull(getJavaEntity().getDefaultPrimaryKeyJoinColumn());
- getJavaEntity().removeSpecifiedPrimaryKeyJoinColumn(0);
- assertTrue(getJavaEntity().getDefaultPrimaryKeyJoinColumn().isVirtual());
- }
-
- public void testIsReferencedColumnResolved() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(((Boolean) ReflectionTools.executeMethod(specifiedPkJoinColumn, "referencedColumnIsResolved")).booleanValue());
- }
-
- public void testDbColumn() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(specifiedPkJoinColumn.isResolved());
- }
-
- public void testDbReferencedColumn() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(((Boolean) ReflectionTools.executeMethod(specifiedPkJoinColumn, "referencedColumnIsResolved")).booleanValue());
- }
-
- public void testDbTable() throws Exception {
- createTestEntityWithPrimaryKeyJoinColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PrimaryKeyJoinColumn specifiedPkJoinColumn = getJavaEntity().getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertNull(specifiedPkJoinColumn.getDbTable());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaQueryHintTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaQueryHintTests.java
deleted file mode 100644
index 541ba70e81..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaQueryHintTests.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.QueryHint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaQueryHintTests extends ContextModelTestCase
-{
- private static final String QUERY_NAME = "QUERY_NAME";
-
- private ICompilationUnit createTestEntityWithNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQuery(name=\"" + QUERY_NAME + "\", hints=@QueryHint())");
- }
- });
- }
-
-
-
- public JavaQueryHintTests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- QueryHint queryHint = entity.getQueryContainer().getNamedQueries().iterator().next().getHints().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation queryAnnotation = ((NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- QueryHintAnnotation queryHintAnnotation = queryAnnotation.getHints().iterator().next();
-
- assertNull(queryHintAnnotation.getName());
- assertNull(queryHint.getName());
-
- //set name in the resource model, verify context model updated
- queryHintAnnotation.setName("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", queryHintAnnotation.getName());
- assertEquals("foo", queryHint.getName());
-
- //set name to null in the resource model
- queryHintAnnotation.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(queryHint.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- QueryHint queryHint = entity.getQueryContainer().getNamedQueries().iterator().next().getHints().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation queryAnnotation = ((NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- QueryHintAnnotation queryHintAnnotation = queryAnnotation.getHints().iterator().next();
-
- assertNull(queryHintAnnotation.getName());
- assertNull(queryHint.getName());
-
- //set name in the context model, verify resource model updated
- queryHint.setName("foo");
- assertEquals("foo", queryHintAnnotation.getName());
- assertEquals("foo", queryHint.getName());
-
- //set name to null in the context model
- queryHint.setName(null);
- assertNull(queryHintAnnotation.getName());
- assertNull(queryHint.getName());
- }
-
- public void testUpdateValue() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- QueryHint queryHint = entity.getQueryContainer().getNamedQueries().iterator().next().getHints().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation queryAnnotation = ((NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- QueryHintAnnotation queryHintAnnotation = queryAnnotation.getHints().iterator().next();
-
- assertNull(queryHintAnnotation.getValue());
- assertNull(queryHint.getValue());
-
- //set name in the resource model, verify context model updated
- queryHintAnnotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", queryHintAnnotation.getValue());
- assertEquals("foo", queryHint.getValue());
-
- //set name to null in the resource model
- queryHintAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNull(queryHint.getValue());
- }
-
- public void testModifyValue() throws Exception {
- createTestEntityWithNamedQuery();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- QueryHint queryHint = entity.getQueryContainer().getNamedQueries().iterator().next().getHints().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- NamedQueryAnnotation queryAnnotation = ((NamedQueryAnnotation) resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- QueryHintAnnotation queryHintAnnotation = queryAnnotation.getHints().iterator().next();
-
- assertNull(queryHintAnnotation.getValue());
- assertNull(queryHint.getValue());
-
- //set name in the context model, verify resource model updated
- queryHint.setValue("foo");
- assertEquals("foo", queryHintAnnotation.getValue());
- assertEquals("foo", queryHint.getValue());
-
- //set name to null in the context model
- queryHint.setValue(null);
- assertNull(queryHintAnnotation.getValue());
- assertNull(queryHint.getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSecondaryTableTests.java
deleted file mode 100644
index a6ce6ba34b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSecondaryTableTests.java
+++ /dev/null
@@ -1,731 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaSecondaryTableTests extends ContextModelTestCase
-{
- private static final String TABLE_NAME = "MY_TABLE";
-
- private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTable(name=\"" + TABLE_NAME + "\")");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name=\"foo\"), @SecondaryTable(name=\"bar\")})");
- }
- });
- }
-
-
-
-
- public JavaSecondaryTableTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSecondaryTables().iterator().next();
- assertEquals(TABLE_NAME, secondaryTable.getSpecifiedName());
- }
-
- public void testGetDefaultNameNull() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSecondaryTables().iterator().next();
- assertNull(secondaryTable.getDefaultName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSecondaryTables().iterator().next();
- assertEquals(TABLE_NAME, secondaryTable.getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSecondaryTables().iterator().next();
- secondaryTable.setSpecifiedName("foo");
-
- assertEquals("foo", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals("foo", table.getName());
- }
-
- public void testUpdateFromSpecifiedNameChangeInResourceModel() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- table.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedName());
- }
-
- public void testUpdateFromSpecifiedCatalogChangeInResourceModel() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> secondaryTableResources = resourceType.getAnnotations(JPA.SECONDARY_TABLE).iterator();
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setCatalog("foo");
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setCatalog("bar");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaSecondaryTable> secondaryTsbles = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("foo", secondaryTsbles.next().getSpecifiedCatalog());
- assertEquals("bar", secondaryTsbles.next().getSpecifiedCatalog());
- }
-
- public void testUpdateFromSpecifiedSchemaChangeInResourceModel() throws Exception {
- createTestEntityWithSecondaryTables();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> secondaryTableResources = resourceType.getAnnotations(JPA.SECONDARY_TABLE).iterator();
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setSchema("foo");
- ((SecondaryTableAnnotation) secondaryTableResources.next()).setSchema("bar");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaSecondaryTable> secondaryTsbles = getJavaEntity().getSecondaryTables().iterator();
- assertEquals("foo", secondaryTsbles.next().getSpecifiedSchema());
- assertEquals("bar", secondaryTsbles.next().getSpecifiedSchema());
- }
-
- public void testGetCatalog() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.setCatalog("myCatalog");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myCatalog", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedCatalog());
- assertEquals("myCatalog", getJavaEntity().getSecondaryTables().iterator().next().getCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getSecondaryTables().iterator().next().getDefaultCatalog());
-
- getJavaEntity().getSecondaryTables().iterator().next().setSpecifiedCatalog("myCatalog");
-
- assertNull(getJavaEntity().getSecondaryTables().iterator().next().getDefaultCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTable table = getJavaEntity().getSecondaryTables().iterator().next();
- table.setSpecifiedCatalog("myCatalog");
- table.setSpecifiedName(null);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals("myCatalog", tableAnnotation.getCatalog());
- }
-
- public void testGetSchema() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- tableResource.setSchema("mySchema");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("mySchema", getJavaEntity().getSecondaryTables().iterator().next().getSpecifiedSchema());
- assertEquals("mySchema", getJavaEntity().getSecondaryTables().iterator().next().getSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getSecondaryTables().iterator().next().getDefaultSchema());
-
- getJavaEntity().getSecondaryTables().iterator().next().setSpecifiedSchema("mySchema");
-
- assertNull(getJavaEntity().getSecondaryTables().iterator().next().getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTable table = getJavaEntity().getSecondaryTables().iterator().next();
- table.setSpecifiedSchema("mySchema");
- table.setSpecifiedName(null);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals("mySchema", tableAnnotation.getSchema());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumns() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- ListIterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
-
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- //add an annotation to the resource model and verify the context model is updated
- PrimaryKeyJoinColumnAnnotation pkJoinColumn = tableResource.addPkJoinColumn(0);
- pkJoinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- pkJoinColumn = tableResource.addPkJoinColumn(0);
- pkJoinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
-
- //move an annotation to the resource model and verify the context model is updated
- tableResource.movePkJoinColumn(1, 0);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- tableResource.removePkJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertFalse(specifiedPkJoinColumns.hasNext());
-
- tableResource.removePkJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(specifiedPkJoinColumns.hasNext());
- }
-
- public void testSpecifiedPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- assertEquals(0, secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertEquals(3, secondaryTable.getSpecifiedPrimaryKeyJoinColumnsSize());
- }
-
- public void testPrimaryKeyJoinColumnsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- //just the default pkJoinColumn, so 1
- assertEquals(1, secondaryTable.getPrimaryKeyJoinColumnsSize());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- //only the specified pkJoinColumns, 3
- assertEquals(3, secondaryTable.getPrimaryKeyJoinColumnsSize());
- }
-
- public void testGetDefaultPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- assertNotNull(secondaryTable.getDefaultPrimaryKeyJoinColumn());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- assertNull(secondaryTable.getDefaultPrimaryKeyJoinColumn());
- }
-
- public void testPrimaryKeyJoinColumnDefaults() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
- assertNotNull(defaultPkJoinColumn);
- assertEquals("id", defaultPkJoinColumn.getDefaultName());
- assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName());
-
-
- IdMapping idMapping = (IdMapping) getJavaEntity().getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- assertEquals("FOO", defaultPkJoinColumn.getDefaultName());
- assertEquals("FOO", defaultPkJoinColumn.getDefaultReferencedColumnName());
-
- idMapping.getColumn().setSpecifiedName(null);
- assertEquals("id", defaultPkJoinColumn.getDefaultName());
- assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- Iterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.getPkJoinColumns().iterator();
-
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn2() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- Iterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.getPkJoinColumns().iterator();
-
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
- }
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, tableResource.getPkJoinColumnsSize());
-
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(1);
-
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumnResources = tableResource.getPkJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumnResources.next().getName());
- assertEquals("BAZ", pkJoinColumnResources.next().getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- Iterator<JavaPrimaryKeyJoinColumn> pkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(1);
- pkJoinColumnResources = tableResource.getPkJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumnResources.next().getName());
- assertFalse(pkJoinColumnResources.hasNext());
-
- pkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertFalse(pkJoinColumns.hasNext());
-
-
- secondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- pkJoinColumnResources = tableResource.getPkJoinColumns().iterator();
- assertFalse(pkJoinColumnResources.hasNext());
- pkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertFalse(pkJoinColumns.hasNext());
-
- assertEquals(0, tableResource.getPkJoinColumnsSize());
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- Iterator<JavaPrimaryKeyJoinColumn> specifiedPkJoinColumns = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedPkJoinColumns.next().getName());
- assertEquals("BAR", specifiedPkJoinColumns.next().getName());
- assertEquals("BAZ", specifiedPkJoinColumns.next().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation tableResource = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- Iterator<PrimaryKeyJoinColumnAnnotation> pkJoinColumns = tableResource.getPkJoinColumns().iterator();
-
- assertEquals("FOO", pkJoinColumns.next().getName());
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
-
-
- secondaryTable.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- pkJoinColumns = tableResource.getPkJoinColumns().iterator();
-
- assertEquals("BAR", pkJoinColumns.next().getName());
- assertEquals("BAZ", pkJoinColumns.next().getName());
- assertEquals("FOO", pkJoinColumns.next().getName());
- }
-
- public void testPrimaryKeyJoinColumnGetDefaultName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", defaultPkJoinColumn.getDefaultName());
-
-
- //remove @Id annotation
- PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id");
- idAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(defaultPkJoinColumn.getDefaultName());
- }
- public void testPrimaryKeyJoinColumnGetDefaultReferencedColumnName() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- PrimaryKeyJoinColumn defaultPkJoinColumn = secondaryTable.getDefaultPrimaryKeyJoinColumn();
- assertEquals("id", defaultPkJoinColumn.getDefaultReferencedColumnName());
-
- //remove @Id annotation
- PersistentAttribute idAttribute = getJavaPersistentType().getAttributeNamed("id");
- idAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
-
- assertNull(defaultPkJoinColumn.getDefaultReferencedColumnName());
- }
-
- public void testPrimaryKeyJoinColumnIsVirtual() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- assertTrue(secondaryTable.getDefaultPrimaryKeyJoinColumn().isVirtual());
-
- secondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- PrimaryKeyJoinColumn specifiedPkJoinColumn = secondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator().next();
- assertFalse(specifiedPkJoinColumn.isVirtual());
-
- assertNull(secondaryTable.getDefaultPrimaryKeyJoinColumn());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
-
- assertEquals(0, secondaryTable.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- secondaryTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, secondaryTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = secondaryTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- SecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = secondaryTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, secondaryTableAnnotation.getUniqueConstraintsSize());
-
- secondaryTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- secondaryTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- secondaryTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- secondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- secondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- secondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, secondaryTableAnnotation.getUniqueConstraintsSize());
-
-
- secondaryTable.moveUniqueConstraint(2, 0);
- ListIterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- secondaryTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = secondaryTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithSecondaryTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaSecondaryTable secondaryTable = getJavaEntity().getSpecifiedSecondaryTables().iterator().next();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- SecondaryTableAnnotation secondaryTableAnnotation = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- secondaryTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- secondaryTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- secondaryTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = secondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSequenceGeneratorTests.java
deleted file mode 100644
index 06495d7bd0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaSequenceGeneratorTests.java
+++ /dev/null
@@ -1,236 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaSequenceGeneratorTests extends ContextModelTestCase
-{
- private static final String SEQUENCE_GENERATOR_NAME = "MY_SEQUENCE_GENERATOR";
-
-
- protected ICompilationUnit createTestEntityWithSequenceGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SEQUENCE_GENERATOR, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@SequenceGenerator(name=\"" + SEQUENCE_GENERATOR_NAME + "\")");
- }
- });
- }
-
- public JavaSequenceGeneratorTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getGeneratorContainer().getSequenceGenerator().getName());
-
- //change resource model sequenceGenerator name, verify the context model is updated
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", idMapping.getGeneratorContainer().getSequenceGenerator().getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(SEQUENCE_GENERATOR_NAME, idMapping.getGeneratorContainer().getSequenceGenerator().getName());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setName("foo");
-
- assertEquals("foo", idMapping.getGeneratorContainer().getSequenceGenerator().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals("foo", sequenceGenerator.getName());
- }
-
- public void testGetInitialValue() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getSequenceGenerator().getInitialValue());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setInitialValue(Integer.valueOf(82));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(82, idMapping.getGeneratorContainer().getSequenceGenerator().getInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedInitialValue());
- }
-
- public void testGetDefaultInitialValue() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultInitialValue());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedInitialValue(Integer.valueOf(82));
-
- assertEquals(SequenceGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedInitialValue());
- }
-
- public void testSetSpecifiedInitialValue() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedInitialValue(Integer.valueOf(20));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation generatorAnnotation = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals(Integer.valueOf(20), generatorAnnotation.getInitialValue());
- }
-
- public void testGetAllocationSize() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getSequenceGenerator().getAllocationSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setAllocationSize(Integer.valueOf(20));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(20, idMapping.getGeneratorContainer().getSequenceGenerator().getAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedAllocationSize());
- }
-
- public void testGetDefaultAllocationSize() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultAllocationSize());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedAllocationSize(Integer.valueOf(20));
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedAllocationSize());
- }
-
- public void testSetSpecifiedAllocationSize() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedAllocationSize(Integer.valueOf(25));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation generatorAnnotation = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals(Integer.valueOf(25), generatorAnnotation.getAllocationSize());
- }
-
-
-
- public void testGetSequenceName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator().getSequenceName());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- sequenceGenerator.setSequenceName("mySequenceName");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("mySequenceName", idMapping.getGeneratorContainer().getSequenceGenerator().getSequenceName());
- assertEquals("mySequenceName", idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedSequenceName());
- }
-
- public void testGetDefaultSequenceName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultSequenceName());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedSequenceName("mySequenceName");
-
- assertNull(idMapping.getGeneratorContainer().getSequenceGenerator().getDefaultSequenceName());
- assertEquals("mySequenceName", idMapping.getGeneratorContainer().getSequenceGenerator().getSpecifiedSequenceName());
- }
-
- public void testSetSpecifiedSequenceName() throws Exception {
- createTestEntityWithSequenceGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedSequenceName("mySequenceName");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- SequenceGeneratorAnnotation generatorAnnotation = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- assertEquals("mySequenceName", generatorAnnotation.getSequenceName());
-
- idMapping.getGeneratorContainer().getSequenceGenerator().setName(null);
- idMapping.getGeneratorContainer().getSequenceGenerator().setSpecifiedSequenceName(null);
- generatorAnnotation = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertNull(generatorAnnotation.getName());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableGeneratorTests.java
deleted file mode 100644
index f76929a311..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableGeneratorTests.java
+++ /dev/null
@@ -1,672 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Generator;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaTableGeneratorTests extends ContextModelTestCase
-{
- private static final String TABLE_GENERATOR_NAME = "MY_TABLE_GENERATOR";
-
- private ICompilationUnit createTestEntityWithTableGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE_GENERATOR, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@TableGenerator(name=\"" + TABLE_GENERATOR_NAME + "\")");
- }
- });
- }
-
- public JavaTableGeneratorTests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(TABLE_GENERATOR_NAME, idMapping.getGeneratorContainer().getTableGenerator().getName());
-
- //change resource model tableGenerator name, verify the context model is updated
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", idMapping.getGeneratorContainer().getTableGenerator().getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- assertEquals(TABLE_GENERATOR_NAME, idMapping.getGeneratorContainer().getTableGenerator().getName());
-
- idMapping.getGeneratorContainer().getTableGenerator().setName("foo");
-
- assertEquals("foo", idMapping.getGeneratorContainer().getTableGenerator().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("foo", tableGenerator.getName());
- }
-
- public void testGetCatalog() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getCatalog());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setCatalog("myCatalog");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myCatalog", idMapping.getGeneratorContainer().getTableGenerator().getCatalog());
- assertEquals("myCatalog", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultCatalog());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedCatalog("myCatalog");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultCatalog());
- assertEquals("myCatalog", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedCatalog("myCatalog");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myCatalog", generatorAnnotation.getCatalog());
- }
-
- public void testGetSchema() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getSchema());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setSchema("mySchema");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("mySchema", idMapping.getGeneratorContainer().getTableGenerator().getSchema());
- assertEquals("mySchema", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedSchema("mySchema");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
- assertEquals("mySchema", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntityWithTableGenerator();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- IdMapping idMapping = (IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA");
- assertEquals("BAR", idMapping.getGeneratorContainer().getTableGenerator().getDefaultSchema());
-
- getEntityMappings().removePersistentType(0);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file
- assertEquals("FOO", ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator().getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedSchema("mySchema");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("mySchema", generatorAnnotation.getSchema());
- }
-
- public void testGetPkColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getPkColumnName());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setPkColumnName("myPkColumnName");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myPkColumnName", idMapping.getGeneratorContainer().getTableGenerator().getPkColumnName());
- assertEquals("myPkColumnName", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedPkColumnName());
- }
-
- public void testGetDefaultPkColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultPkColumnName());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedPkColumnName("myPkColumnName");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultPkColumnName());
- assertEquals("myPkColumnName", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedPkColumnName());
- }
-
- public void testSetSpecifiedPkColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedPkColumnName("myPkColumnName");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myPkColumnName", generatorAnnotation.getPkColumnName());
- }
-
- public void testGetValueColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getValueColumnName());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setValueColumnName("myValueColumnName");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myValueColumnName", idMapping.getGeneratorContainer().getTableGenerator().getValueColumnName());
- assertEquals("myValueColumnName", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedValueColumnName());
- }
-
- public void testGetDefaultValueColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultValueColumnName());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedValueColumnName("myValueColumnName");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultValueColumnName());
- assertEquals("myValueColumnName", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedValueColumnName());
- }
-
- public void testSetSpecifiedValueColumnName() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedValueColumnName("myValueColumnName");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myValueColumnName", generatorAnnotation.getValueColumnName());
- }
-
- public void testGetPkColumnValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getPkColumnValue());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setPkColumnValue("myPkColumnValue");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myPkColumnValue", idMapping.getGeneratorContainer().getTableGenerator().getPkColumnValue());
- assertEquals("myPkColumnValue", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedPkColumnValue());
- }
-
- public void testGetDefaultPkColumnValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultPkColumnValue());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedPkColumnValue("myPkColumnValue");
-
- assertNull(idMapping.getGeneratorContainer().getTableGenerator().getDefaultPkColumnValue());
- assertEquals("myPkColumnValue", idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedPkColumnValue());
- }
-
- public void testSetSpecifiedPkColumnValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedPkColumnValue("myPkColumnValue");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals("myPkColumnValue", generatorAnnotation.getPkColumnValue());
- }
-
- public void testGetInitialValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getTableGenerator().getInitialValue());
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setInitialValue(Integer.valueOf(82));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(82, idMapping.getGeneratorContainer().getTableGenerator().getInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedInitialValue());
- }
-
- public void testGetDefaultInitialValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getTableGenerator().getDefaultInitialValue());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedInitialValue(Integer.valueOf(82));
-
- assertEquals(TableGenerator.DEFAULT_INITIAL_VALUE, idMapping.getGeneratorContainer().getTableGenerator().getDefaultInitialValue());
- assertEquals(Integer.valueOf(82), idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedInitialValue());
- }
-
- public void testSetSpecifiedInitialValue() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedInitialValue(Integer.valueOf(20));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(Integer.valueOf(20), generatorAnnotation.getInitialValue());
- }
-
- public void testGetAllocationSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getTableGenerator().getAllocationSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.setAllocationSize(Integer.valueOf(20));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(20, idMapping.getGeneratorContainer().getTableGenerator().getAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedAllocationSize());
- }
-
- public void testGetDefaultAllocationSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getTableGenerator().getDefaultAllocationSize());
-
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedAllocationSize(Integer.valueOf(20));
-
- assertEquals(Generator.DEFAULT_ALLOCATION_SIZE, idMapping.getGeneratorContainer().getTableGenerator().getDefaultAllocationSize());
- assertEquals(Integer.valueOf(20), idMapping.getGeneratorContainer().getTableGenerator().getSpecifiedAllocationSize());
- }
-
- public void testSetSpecifiedAllocationSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getGeneratorContainer().getTableGenerator().setSpecifiedAllocationSize(Integer.valueOf(25));
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation generatorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(Integer.valueOf(25), generatorAnnotation.getAllocationSize());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaTableGenerator tableGenerator =(JavaTableGenerator) ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
-
- assertEquals(0, tableGenerator.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableGeneratorAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableGeneratorAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableGeneratorAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(3, tableGeneratorAnnotation.getUniqueConstraintsSize());
-
- tableGenerator.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(3, tableGeneratorAnnotation.getUniqueConstraintsSize());
-
-
- tableGenerator.moveUniqueConstraint(2, 0);
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- tableGenerator.moveUniqueConstraint(0, 1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = tableGeneratorAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithTableGenerator();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- TableGenerator tableGenerator = ((IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping()).getGeneratorContainer().getTableGenerator();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TableGeneratorAnnotation tableGeneratorAnnotation = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGeneratorAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- tableGeneratorAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- tableGeneratorAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableTests.java
deleted file mode 100644
index bf56915960..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTableTests.java
+++ /dev/null
@@ -1,611 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.Table;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaTableTests extends ContextModelTestCase
-{
- private static final String TABLE_NAME = "MY_TABLE";
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Table(name=\"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSubType() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createAbstractTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- sb.append("abstract");
- }
- });
- }
-
-
- public JavaTableTests(String name) {
- super(name);
- }
-
- public void testGetSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getTable().getSpecifiedName());
- }
-
- public void testGetSpecifiedName() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TABLE_NAME, getJavaEntity().getTable().getSpecifiedName());
- }
-
- public void testGetDefaultNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getTable().getDefaultName());
- }
-
- public void testGetDefaultName() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getTable().getDefaultName());
-
- //test that setting the java entity name will change the table default name
- getJavaEntity().setSpecifiedName("foo");
- assertEquals("foo", getJavaEntity().getTable().getDefaultName());
- }
-
- public void testGetDefaultNameSingleTableInheritance() throws Exception {
- createTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity childEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- Entity rootEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
-
- assertNotSame(getJavaEntity(), rootEntity);
- assertEquals(TYPE_NAME, childEntity.getTable().getDefaultName());
- assertEquals(TYPE_NAME, rootEntity.getTable().getDefaultName());
-
- //test that setting the root java entity name will change the table default name of the child
- rootEntity.setSpecifiedName("foo");
- assertEquals("foo", childEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- JavaEntity javaEntity = ormEntity.getJavaTypeMapping();
-
- assertNull(javaEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", javaEntity.getTable().getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", javaEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA");
- assertEquals("BAR", javaEntity.getTable().getDefaultSchema());
-
- getEntityMappings().removePersistentType(0);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file
- assertEquals("FOO", getJavaEntity().getTable().getDefaultSchema());
-
- IFile file = getOrmXmlResource().getFile();
- //remove the mapping file reference from the persistence.xml. default schema
- //should still come from persistence-unit-defaults because of implied mapped-file-ref
- getXmlPersistenceUnit().getMappingFiles().remove(mappingFileRef);
- assertEquals("FOO", getJavaEntity().getTable().getDefaultSchema());
-
- file.delete(true, null);
- assertNull(getJavaEntity().getTable().getDefaultSchema());
- }
-
- public void testGetNameSpecifiedNameNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TYPE_NAME, getJavaEntity().getTable().getName());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(TABLE_NAME, getJavaEntity().getTable().getName());
- }
-
- public void testSetSpecifiedName() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getTable().setSpecifiedName("foo");
-
- assertEquals("foo", getJavaEntity().getTable().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals("foo", table.getName());
- }
-
- public void testSetSpecifiedNameNull() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaEntity().getTable().setSpecifiedName(null);
-
- assertNull(getJavaEntity().getTable().getSpecifiedName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertNull(table);
- }
-
- public void testUpdateFromSpecifiedNameChangeInResourceModel() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- table.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", getJavaEntity().getTable().getSpecifiedName());
-
- resourceType.removeAnnotation(JPA.TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(getJavaEntity().getTable().getSpecifiedName());
- }
-
- public void testGetCatalog() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.setCatalog("myCatalog");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myCatalog", getJavaEntity().getTable().getSpecifiedCatalog());
- assertEquals("myCatalog", getJavaEntity().getTable().getCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getTable().getDefaultCatalog());
-
- getJavaEntity().getTable().setSpecifiedCatalog("myCatalog");
-
- assertNull(getJavaEntity().getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- JavaEntity javaEntity = ormEntity.getJavaTypeMapping();
-
- assertNull(javaEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", javaEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().setSpecifiedCatalog("BAR");
- assertEquals("BAR", javaEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedCatalog("XML_CATALOG");
- assertEquals("BAR", javaEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().removePersistentType(0);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default catalog taken from persistence-unite-defaults not entity-mappings since the entity is not in an orm.xml file
- assertEquals("FOO", getJavaEntity().getTable().getDefaultCatalog());
-
- IFile file = getOrmXmlResource().getFile();
- //remove the mapping file reference from the persistence.xml. default schema
- //should still come from persistence-unit-defaults because of implied mapped-file-ref
- getXmlPersistenceUnit().getMappingFiles().remove(mappingFileRef);
- assertEquals("FOO", getJavaEntity().getTable().getDefaultCatalog());
-
- file.delete(true, null);
- assertNull(getJavaEntity().getTable().getDefaultCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Table table = getJavaEntity().getTable();
- table.setSpecifiedCatalog("myCatalog");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableResource = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals("myCatalog", tableResource.getCatalog());
-
- table.setSpecifiedCatalog(null);
- assertNull(resourceType.getAnnotation(JPA.TABLE));
- }
-
- public void testGetSchema() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.setSchema("mySchema");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("mySchema", getJavaEntity().getTable().getSpecifiedSchema());
- assertEquals("mySchema", getJavaEntity().getTable().getSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaEntity().getTable().getDefaultSchema());
-
- getJavaEntity().getTable().setSpecifiedSchema("mySchema");
-
- assertNull(getJavaEntity().getTable().getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Table table = getJavaEntity().getTable();
- table.setSpecifiedSchema("mySchema");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableResource = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals("mySchema", tableResource.getSchema());
-
- table.setSpecifiedSchema(null);
- assertNull(resourceType.getAnnotation(JPA.TABLE));
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = getJavaEntity().getTable().getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- tableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = getJavaEntity().getTable().getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(0, getJavaEntity().getTable().getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- tableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- tableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, getJavaEntity().getTable().getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = getJavaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(0).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Table table = getJavaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = tableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaTable table = getJavaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals(3, tableAnnotation.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaTable table = getJavaEntity().getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals(3, tableAnnotation.getUniqueConstraintsSize());
-
-
- table.moveUniqueConstraint(2, 0);
- ListIterator<JavaUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- table.moveUniqueConstraint(0, 1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = tableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithTable();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaTable table = getJavaEntity().getTable();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- tableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- tableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- tableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAbstractEntityGetDefaultNameTablePerClassInheritance() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- Entity concreteEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) specifiedClassRefs.next().getJavaPersistentType().getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getSpecifiedInheritanceStrategy());
- assertEquals(null, concreteEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, concreteEntity.getDefaultInheritanceStrategy());
-
-
- assertEquals(null, abstractEntity.getTable().getDefaultName());
- assertEquals(null, abstractEntity.getTable().getDefaultCatalog());
- assertEquals(null, abstractEntity.getTable().getDefaultSchema());
-
-
- assertEquals("AnnotationTestTypeChild", concreteEntity.getTable().getDefaultName());
- assertEquals(null, concreteEntity.getTable().getDefaultCatalog());
- assertEquals(null, concreteEntity.getTable().getDefaultSchema());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTransientMappingTests.java
deleted file mode 100644
index 1cd48c8b30..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaTransientMappingTests.java
+++ /dev/null
@@ -1,250 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaTransientMappingTests extends ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient").append(CR);
- }
- });
- }
-
- public JavaTransientMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testTransientMapping() throws Exception {
- createTestEntityWithTransientMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- TransientMapping transientMapping = (TransientMapping) persistentAttribute.getMapping();
-
- assertNotNull(transientMapping);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaVersionMappingTests.java
deleted file mode 100644
index 5c42e01a02..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JavaVersionMappingTests.java
+++ /dev/null
@@ -1,401 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaVersionMappingTests extends ContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append("@Temporal(TemporalType.TIMESTAMP)").append(CR);
- }
- });
- }
-
- public JavaVersionMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testGetTemporal() throws Exception {
- createTestEntityWithTemporal();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) versionMapping.getConverter()).getTemporalType());
- }
-
- public void testSetTemporal() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertNull(versionMapping.getConverter().getType());
-
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- versionMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertNull(versionMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.DATE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) versionMapping.getConverter()).getTemporalType());
-
- resourceField.removeAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(versionMapping.getConverter().getType());
- assertFalse(versionMapping.isDefault());
- assertSame(versionMapping, persistentAttribute.getMapping());
- }
-
- public void testGetColumn() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertNull(versionMapping.getColumn().getSpecifiedName());
- assertEquals("id", versionMapping.getColumn().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", versionMapping.getColumn().getSpecifiedName());
- assertEquals("foo", versionMapping.getColumn().getName());
- assertEquals("id", versionMapping.getColumn().getDefaultName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JptCoreContextJavaModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JptCoreContextJavaModelTests.java
deleted file mode 100644
index c81d28bf5d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/java/JptCoreContextJavaModelTests.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptCoreContextJavaModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCoreContextJavaModelTests.class.getPackage().getName());
- suite.addTestSuite(JavaAssociationOverrideTests.class);
- suite.addTestSuite(JavaAttributeOverrideTests.class);
- suite.addTestSuite(JavaBasicMappingTests.class);
- suite.addTestSuite(JavaCascadeTests.class);
- suite.addTestSuite(JavaColumnTests.class);
- suite.addTestSuite(JavaDiscriminatorColumnTests.class);
- suite.addTestSuite(JavaEmbeddableTests.class);
- suite.addTestSuite(JavaEmbeddedIdMappingTests.class);
- suite.addTestSuite(JavaEmbeddedMappingTests.class);
- suite.addTestSuite(JavaEntityTests.class);
- suite.addTestSuite(JavaGeneratedValueTests.class);
- suite.addTestSuite(JavaIdMappingTests.class);
- suite.addTestSuite(JavaJoinColumnTests.class);
- suite.addTestSuite(JavaJoinTableTests.class);
- suite.addTestSuite(JavaMappedSuperclassTests.class);
- suite.addTestSuite(JavaManyToManyMappingTests.class);
- suite.addTestSuite(JavaManyToOneMappingTests.class);
- suite.addTestSuite(JavaNamedQueryTests.class);
- suite.addTestSuite(JavaNamedNativeQueryTests.class);
- suite.addTestSuite(JavaQueryHintTests.class);
- suite.addTestSuite(JavaOneToManyMappingTests.class);
- suite.addTestSuite(JavaOneToOneMappingTests.class);
- suite.addTestSuite(GenericJavaPersistentTypeTests.class);
- suite.addTestSuite(GenericJavaPersistentAttributeTests.class);
- suite.addTestSuite(JavaPrimaryKeyJoinColumnTests.class);
- suite.addTestSuite(JavaSecondaryTableTests.class);
- suite.addTestSuite(JavaSequenceGeneratorTests.class);
- suite.addTestSuite(JavaTableGeneratorTests.class);
- suite.addTestSuite(JavaTableTests.class);
- suite.addTestSuite(JavaTransientMappingTests.class);
- suite.addTestSuite(JavaVersionMappingTests.class);
- return suite;
- }
-
- private JptCoreContextJavaModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/EntityMappingsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/EntityMappingsTests.java
deleted file mode 100644
index 78e1c50bba..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/EntityMappingsTests.java
+++ /dev/null
@@ -1,1066 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EntityMappingsTests extends ContextModelTestCase
-{
- public EntityMappingsTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testGetVersion() throws Exception {
- assertEquals("1.0", getEntityMappings().getVersion());
- }
-
- public void testUpdateDescription() throws Exception {
- assertNull(getEntityMappings().getDescription());
- assertNull(getXmlEntityMappings().getDescription());
-
- //set description in the resource model, verify context model updated
- getXmlEntityMappings().setDescription("newDescription");
- assertEquals("newDescription", getEntityMappings().getDescription());
- assertEquals("newDescription", getXmlEntityMappings().getDescription());
-
- //set description to null in the resource model
- getXmlEntityMappings().setDescription(null);
- assertNull(getEntityMappings().getDescription());
- assertNull(getXmlEntityMappings().getDescription());
- }
-
- public void testModifyDescription() throws Exception {
- assertNull(getEntityMappings().getDescription());
- assertNull(getXmlEntityMappings().getDescription());
-
- //set description in the context model, verify resource model modified
- getEntityMappings().setDescription("newDescription");
- assertEquals("newDescription", getEntityMappings().getDescription());
- assertEquals("newDescription", getXmlEntityMappings().getDescription());
-
- //set description to null in the context model
- getEntityMappings().setDescription(null);
- assertNull(getEntityMappings().getDescription());
- assertNull(getXmlEntityMappings().getDescription());
- }
-
- public void testUpdatePackage() throws Exception {
- assertNull(getEntityMappings().getPackage());
- assertNull(getXmlEntityMappings().getPackage());
-
- //set package in the resource model, verify context model updated
- getXmlEntityMappings().setPackage("foo.model");
- assertEquals("foo.model", getEntityMappings().getPackage());
- assertEquals("foo.model", getXmlEntityMappings().getPackage());
-
- //set package to null in the resource model
- getXmlEntityMappings().setPackage(null);
- assertNull(getEntityMappings().getPackage());
- assertNull(getXmlEntityMappings().getPackage());
- }
-
- public void testModifyPackage() throws Exception {
- assertNull(getEntityMappings().getPackage());
- assertNull(getXmlEntityMappings().getPackage());
-
- //set package in the context model, verify resource model modified
- getEntityMappings().setPackage("foo.model");
- assertEquals("foo.model", getEntityMappings().getPackage());
- assertEquals("foo.model", getXmlEntityMappings().getPackage());
-
- //set package to null in the context model
- getEntityMappings().setPackage(null);
- assertNull(getEntityMappings().getPackage());
- assertNull(getXmlEntityMappings().getPackage());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- //set schema in the resource model, verify context model updated
- getXmlEntityMappings().setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", getEntityMappings().getSpecifiedSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getSchema());
-
- //set schema to null in the resource model
- getXmlEntityMappings().setSchema(null);
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- //set schema in the context model, verify resource model modified
- getEntityMappings().setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", getEntityMappings().getSpecifiedSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getSchema());
-
- //set schema to null in the context model
- getEntityMappings().setSpecifiedSchema(null);
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- //set catalog in the resource model, verify context model updated
- getXmlEntityMappings().setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", getEntityMappings().getSpecifiedCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getCatalog());
-
- //set catalog to null in the resource model
- getXmlEntityMappings().setCatalog(null);
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- }
-
- public void testUpdateDefaultSchema() throws Exception {
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- persistenceUnitDefaults.setSchema(null);
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testUpdateSchema() throws Exception {
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- getXmlEntityMappings().setSchema("MY_SCHEMA");
- assertNull(getEntityMappings().getDefaultSchema());
- assertEquals("MY_SCHEMA", getEntityMappings().getSchema());
- assertEquals("MY_SCHEMA", getEntityMappings().getSpecifiedSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getSchema());
-
- getXmlEntityMappings().setSchema(null);
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("DEFAULT_SCHEMA");
- assertEquals("DEFAULT_SCHEMA", getEntityMappings().getDefaultSchema());
- assertEquals("DEFAULT_SCHEMA", getEntityMappings().getSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertNull(getEntityMappings().getDefaultSchema());
- assertNull(getEntityMappings().getSchema());
- assertNull(getEntityMappings().getSpecifiedSchema());
- assertNull(getXmlEntityMappings().getSchema());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- //set catalog in the context model, verify resource model modified
- getEntityMappings().setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", getEntityMappings().getSpecifiedCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getCatalog());
-
- //set catalog to null in the context model
- getEntityMappings().setSpecifiedCatalog(null);
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- }
-
- public void testUpdateDefaultCatalog() throws Exception {
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- persistenceUnitDefaults.setCatalog(null);
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testUpdateCatalog() throws Exception {
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- getXmlEntityMappings().setCatalog("MY_CATALOG");
- assertNull(getEntityMappings().getDefaultCatalog());
- assertEquals("MY_CATALOG", getEntityMappings().getCatalog());
- assertEquals("MY_CATALOG", getEntityMappings().getSpecifiedCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getCatalog());
-
- getXmlEntityMappings().setCatalog(null);
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("DEFAULT_CATALOG");
- assertEquals("DEFAULT_CATALOG", getEntityMappings().getDefaultCatalog());
- assertEquals("DEFAULT_CATALOG", getEntityMappings().getCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertNull(getEntityMappings().getDefaultCatalog());
- assertNull(getEntityMappings().getCatalog());
- assertNull(getEntityMappings().getSpecifiedCatalog());
- assertNull(getXmlEntityMappings().getCatalog());
- }
-
- public void testUpdateSpecifiedAccess() throws Exception {
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- //set access in the resource model, verify context model updated
- getXmlEntityMappings().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getAccess());
-
- //set access to null in the resource model
- getXmlEntityMappings().setAccess(null);
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- //set access in the context model, verify resource model modified
- getEntityMappings().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getAccess());
-
- //set access to null in the context model
- getEntityMappings().setSpecifiedAccess(null);
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testUpdateDefaultAccess() throws Exception {
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- persistenceUnitDefaults.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- persistenceUnitDefaults.setAccess(null);
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testUpdateAccess() throws Exception {
- assertNull(getEntityMappings().getAccess());
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getXmlEntityMappings().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertNull(getEntityMappings().getDefaultAccess());
- assertEquals(AccessType.FIELD, getEntityMappings().getAccess());
- assertEquals(AccessType.FIELD, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getAccess());
-
- getXmlEntityMappings().setAccess(null);
- assertNull(getEntityMappings().getAccess());
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, getEntityMappings().getDefaultAccess());
- assertEquals(AccessType.FIELD, getEntityMappings().getAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(null);
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
-
- public void testUpdateOrmPersistentTypes() throws Exception {
- assertFalse(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- //add embeddable in the resource model, verify context model updated
- XmlEmbeddable embeddable = OrmFactory.eINSTANCE.createXmlEmbeddable();
- getXmlEntityMappings().getEmbeddables().add(embeddable);
- embeddable.setClassName("model.Foo");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo", getXmlEntityMappings().getEmbeddables().get(0).getClassName());
-
- //add entity in the resource model, verify context model updated
- XmlEntity entity = OrmFactory.eINSTANCE.createXmlEntity();
- getXmlEntityMappings().getEntities().add(entity);
- entity.setClassName("model.Foo2");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo2", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo2", getXmlEntityMappings().getEntities().get(0).getClassName());
-
- //add mapped-superclass in the resource model, verify context model updated
- XmlMappedSuperclass mappedSuperclass = OrmFactory.eINSTANCE.createXmlMappedSuperclass();
- getXmlEntityMappings().getMappedSuperclasses().add(mappedSuperclass);
- mappedSuperclass.setClassName("model.Foo3");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo3", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertFalse(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo3", getXmlEntityMappings().getMappedSuperclasses().get(0).getClassName());
- }
-
-
- public void testAddOrmPersistentType() throws Exception {
- assertFalse(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- //add embeddable in the context model, verify resource model modified
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getEntityMappings().getPersistentTypes().iterator().next().getMapping().getKey());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo", getXmlEntityMappings().getEmbeddables().get(0).getClassName());
-
- //add entity in the context model, verify resource model modified
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo2", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getEntityMappings().getPersistentTypes().iterator().next().getMapping().getKey());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo2", getXmlEntityMappings().getEntities().get(0).getClassName());
-
- //add mapped-superclass in the context model, verify resource model modified
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3");
- assertTrue(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertEquals("model.Foo3", getEntityMappings().getPersistentTypes().iterator().next().getMapping().getClass_());
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, getEntityMappings().getPersistentTypes().iterator().next().getMapping().getKey());
- assertFalse(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertFalse(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
- assertEquals("model.Foo3", getXmlEntityMappings().getMappedSuperclasses().get(0).getClassName());
- }
-
- public void testRemoveOrmPersistentType() throws Exception {
- assertFalse(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3");
-
- //remove ormPersistentType from the context model, verify resource model modified
- getEntityMappings().removePersistentType(1);
- assertFalse(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertFalse(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- getEntityMappings().removePersistentType(1);
- assertFalse(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- getEntityMappings().removePersistentType(0);
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
- }
-
- public void testUpdateTableGenerators() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlTableGenerator tableGeneratorResource = OrmFactory.eINSTANCE.createXmlTableGenerator();
- getXmlEntityMappings().getTableGenerators().add(tableGeneratorResource);
- tableGeneratorResource.setName("FOO");
-
- TableGenerator tableGenerator = getEntityMappings().getTableGenerators().iterator().next();
- assertEquals("FOO", tableGenerator.getName());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlTableGenerator tableGeneratorResource2 = OrmFactory.eINSTANCE.createXmlTableGenerator();
- getXmlEntityMappings().getTableGenerators().add(0, tableGeneratorResource2);
- tableGeneratorResource2.setName("BAR");
-
- ListIterator<OrmTableGenerator> tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("BAR", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlTableGenerator tableGeneratorResource3 = OrmFactory.eINSTANCE.createXmlTableGenerator();
- getXmlEntityMappings().getTableGenerators().add(1, tableGeneratorResource3);
- tableGeneratorResource3.setName("BAZ");
-
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("BAR", tableGenerators.next().getName());
- assertEquals("BAZ", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().move(2, 0);
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("BAZ", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertEquals("BAR", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().remove(0);
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("FOO", tableGenerators.next().getName());
- assertEquals("BAR", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().remove(1);
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().clear();
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertFalse(tableGenerators.hasNext());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
- getEntityMappings().addTableGenerator(0).setName("FOO");
-
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(0).getName());
-
- getEntityMappings().addTableGenerator(0).setName("BAR");
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals(2, getXmlEntityMappings().getTableGenerators().size());
-
- ListIterator<OrmTableGenerator> tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertEquals("BAR", tableGenerators.next().getName());
- assertEquals("FOO", tableGenerators.next().getName());
- assertFalse(tableGenerators.hasNext());
- }
-
- public void testRemoveTableGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
-
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- tableGenerator.setName("FOO");
- TableGenerator tableGenerator2 = getEntityMappings().addTableGenerator(1);
- tableGenerator2.setName("BAR");
- TableGenerator tableGenerator3 = getEntityMappings().addTableGenerator(2);
- tableGenerator3.setName("BAZ");
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getTableGenerators().size());
-
- getEntityMappings().removeTableGenerator(0);
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(1).getName());
-
- ListIterator<OrmTableGenerator> tableGenerators = getEntityMappings().getTableGenerators().iterator();
- OrmTableGenerator xmlTableGenerator = tableGenerators.next();
- assertEquals("BAR", xmlTableGenerator.getName());
- assertEquals(tableGenerator2, xmlTableGenerator);
- xmlTableGenerator = tableGenerators.next();
- assertEquals("BAZ", xmlTableGenerator.getName());
- assertEquals(tableGenerator3, xmlTableGenerator);
- assertFalse(tableGenerators.hasNext());
-
-
- getEntityMappings().removeTableGenerator(1);
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(0).getName());
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- xmlTableGenerator = tableGenerators.next();
- assertEquals("BAR", xmlTableGenerator.getName());
- assertEquals(tableGenerator2, xmlTableGenerator);
- assertFalse(tableGenerators.hasNext());
-
-
- getEntityMappings().removeTableGenerator(0);
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
- tableGenerators = getEntityMappings().getTableGenerators().iterator();
- assertFalse(tableGenerators.hasNext());
- }
-
- public void testMoveTableGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
-
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- tableGenerator.setName("FOO");
- TableGenerator tableGenerator2 = getEntityMappings().addTableGenerator(1);
- tableGenerator2.setName("BAR");
- TableGenerator tableGenerator3 = getEntityMappings().addTableGenerator(2);
- tableGenerator3.setName("BAZ");
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getTableGenerators().size());
-
- getEntityMappings().moveTableGenerator(2, 0);
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getTableGenerators().size());
-
- getEntityMappings().moveTableGenerator(0, 2);
- assertEquals("FOO", getXmlEntityMappings().getTableGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getTableGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getTableGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getTableGenerators().size());
- }
-
- public void testTableGeneratorsSize() throws Exception {
- assertEquals(0, getEntityMappings().getTableGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getTableGenerators().size());
-
-
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- tableGenerator.setName("FOO");
- TableGenerator tableGenerator2 = getEntityMappings().addTableGenerator(1);
- tableGenerator2.setName("BAR");
- TableGenerator tableGenerator3 = getEntityMappings().addTableGenerator(2);
- tableGenerator3.setName("BAZ");
-
- assertEquals(3, getEntityMappings().getTableGeneratorsSize());
-
- getXmlEntityMappings().getTableGenerators().remove(0);
- assertEquals(2, getEntityMappings().getTableGeneratorsSize());
- }
-
- public void testUpdateSequenceGenerators() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlSequenceGenerator sequenceGeneratorResource = OrmFactory.eINSTANCE.createXmlSequenceGenerator();
- getXmlEntityMappings().getSequenceGenerators().add(sequenceGeneratorResource);
- sequenceGeneratorResource.setName("FOO");
-
- SequenceGenerator sequenceGenerator = getEntityMappings().getSequenceGenerators().iterator().next();
- assertEquals("FOO", sequenceGenerator.getName());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlSequenceGenerator sequenceGeneratorResource2 = OrmFactory.eINSTANCE.createXmlSequenceGenerator();
- getXmlEntityMappings().getSequenceGenerators().add(0, sequenceGeneratorResource2);
- sequenceGeneratorResource2.setName("BAR");
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- XmlSequenceGenerator sequenceGeneratorResource3 = OrmFactory.eINSTANCE.createXmlSequenceGenerator();
- getXmlEntityMappings().getSequenceGenerators().add(1, sequenceGeneratorResource3);
- sequenceGeneratorResource3.setName("BAZ");
-
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertEquals("BAZ", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getSequenceGenerators().move(2, 0);
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("BAZ", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
-
- getXmlEntityMappings().getSequenceGenerators().remove(0);
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getSequenceGenerators().remove(1);
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
-
- getXmlEntityMappings().getSequenceGenerators().clear();
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertFalse(sequenceGenerators.hasNext());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddSequenceGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
-
- getEntityMappings().addSequenceGenerator(0).setName("FOO");
-
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
-
- getEntityMappings().addSequenceGenerator(0).setName("BAR");
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals(2, getXmlEntityMappings().getSequenceGenerators().size());
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertEquals("BAR", sequenceGenerators.next().getName());
- assertEquals("FOO", sequenceGenerators.next().getName());
- assertFalse(sequenceGenerators.hasNext());
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
-
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- sequenceGenerator.setName("FOO");
- SequenceGenerator sequenceGenerator2 = getEntityMappings().addSequenceGenerator(1);
- sequenceGenerator2.setName("BAR");
- SequenceGenerator sequenceGenerator3 = getEntityMappings().addSequenceGenerator(2);
- sequenceGenerator3.setName("BAZ");
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getSequenceGenerators().size());
-
- getEntityMappings().removeSequenceGenerator(0);
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
-
- ListIterator<OrmSequenceGenerator> sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- SequenceGenerator xmlSequenceGenerator = sequenceGenerators.next();
- assertEquals("BAR", xmlSequenceGenerator.getName());
- assertEquals(sequenceGenerator2, xmlSequenceGenerator);
- xmlSequenceGenerator = sequenceGenerators.next();
- assertEquals("BAZ", xmlSequenceGenerator.getName());
- assertEquals(sequenceGenerator3, xmlSequenceGenerator);
- assertFalse(sequenceGenerators.hasNext());
-
-
- getEntityMappings().removeSequenceGenerator(1);
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- xmlSequenceGenerator = sequenceGenerators.next();
- assertEquals("BAR", xmlSequenceGenerator.getName());
- assertEquals(sequenceGenerator2, xmlSequenceGenerator);
- assertFalse(sequenceGenerators.hasNext());
-
-
- getEntityMappings().removeSequenceGenerator(0);
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
- sequenceGenerators = getEntityMappings().getSequenceGenerators().iterator();
- assertFalse(sequenceGenerators.hasNext());
- }
-
- public void testMoveSequenceGenerator() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
-
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- sequenceGenerator.setName("FOO");
- SequenceGenerator sequenceGenerator2 = getEntityMappings().addSequenceGenerator(1);
- sequenceGenerator2.setName("BAR");
- SequenceGenerator sequenceGenerator3 = getEntityMappings().addSequenceGenerator(2);
- sequenceGenerator3.setName("BAZ");
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getSequenceGenerators().size());
-
- getEntityMappings().moveSequenceGenerator(2, 0);
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getSequenceGenerators().size());
-
- getEntityMappings().moveSequenceGenerator(0, 2);
- assertEquals("FOO", getXmlEntityMappings().getSequenceGenerators().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getSequenceGenerators().get(1).getName());
- assertEquals("BAZ", getXmlEntityMappings().getSequenceGenerators().get(2).getName());
- assertEquals(3, getXmlEntityMappings().getSequenceGenerators().size());
-
- }
-
- public void testSequenceGeneratorsSize() throws Exception {
- assertEquals(0, getEntityMappings().getSequenceGeneratorsSize());
- assertEquals(0, getXmlEntityMappings().getSequenceGenerators().size());
-
-
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- sequenceGenerator.setName("FOO");
- SequenceGenerator sequenceGenerator2 = getEntityMappings().addSequenceGenerator(1);
- sequenceGenerator2.setName("BAR");
- SequenceGenerator sequenceGenerator3 = getEntityMappings().addSequenceGenerator(2);
- sequenceGenerator3.setName("BAZ");
-
- assertEquals(3, getEntityMappings().getSequenceGeneratorsSize());
-
- getXmlEntityMappings().getSequenceGenerators().remove(0);
- assertEquals(2, getEntityMappings().getSequenceGeneratorsSize());
- }
-
-
- public void testAddNamedQuery() throws Exception {
- OrmNamedQuery namedQuery = getEntityMappings().getQueryContainer().addNamedQuery(0);
- namedQuery.setName("FOO");
-
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(0).getName());
-
- OrmNamedQuery namedQuery2 = getEntityMappings().getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
-
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(1).getName());
-
- OrmNamedQuery namedQuery3 = getEntityMappings().getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
-
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(2).getName());
-
- ListIterator<OrmNamedQuery> namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
-
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- getEntityMappings().getQueryContainer().addNamedQuery(0).setName("FOO");
- getEntityMappings().getQueryContainer().addNamedQuery(1).setName("BAR");
- getEntityMappings().getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- assertEquals(3, getXmlEntityMappings().getNamedQueries().size());
-
- getEntityMappings().getQueryContainer().removeNamedQuery(0);
- assertEquals(2, getXmlEntityMappings().getNamedQueries().size());
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(1).getName());
-
- getEntityMappings().getQueryContainer().removeNamedQuery(0);
- assertEquals(1, getXmlEntityMappings().getNamedQueries().size());
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(0).getName());
-
- getEntityMappings().getQueryContainer().removeNamedQuery(0);
- assertEquals(0, getXmlEntityMappings().getNamedQueries().size());
- }
-
- public void testMoveNamedQuery() throws Exception {
- getEntityMappings().getQueryContainer().addNamedQuery(0).setName("FOO");
- getEntityMappings().getQueryContainer().addNamedQuery(1).setName("BAR");
- getEntityMappings().getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- assertEquals(3, getXmlEntityMappings().getNamedQueries().size());
-
-
- getEntityMappings().getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<OrmNamedQuery> namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(2).getName());
-
-
- getEntityMappings().getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAZ", getXmlEntityMappings().getNamedQueries().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getNamedQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedQueries().get(2).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- assertEquals(0, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- getXmlEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- getXmlEntityMappings().getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
-
- getXmlEntityMappings().getNamedQueries().get(0).setName("FOO");
- getXmlEntityMappings().getNamedQueries().get(1).setName("BAR");
- getXmlEntityMappings().getNamedQueries().get(2).setName("BAZ");
-
- ListIterator<OrmNamedQuery> namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedQueries().move(2, 0);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- getXmlEntityMappings().getNamedQueries().move(0, 1);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- getXmlEntityMappings().getNamedQueries().remove(1);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedQueries().remove(1);
- namedQueries = getEntityMappings().getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedQueries().remove(0);
- assertFalse(getEntityMappings().getQueryContainer().getNamedQueries().iterator().hasNext());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getQueriesSize());
- }
-
- public void testAddNamedNativeQuery() throws Exception {
- OrmNamedNativeQuery namedNativeQuery = getEntityMappings().getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery.setName("FOO");
-
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
-
- OrmNamedNativeQuery namedNativeQuery2 = getEntityMappings().getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery2.setName("BAR");
-
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
-
- OrmNamedNativeQuery namedNativeQuery3 = getEntityMappings().getQueryContainer().addNamedNativeQuery(1);
- namedNativeQuery3.setName("BAZ");
-
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(2).getName());
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals(namedNativeQuery2, namedNativeQueries.next());
- assertEquals(namedNativeQuery3, namedNativeQueries.next());
- assertEquals(namedNativeQuery, namedNativeQueries.next());
-
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- }
-
- public void testRemoveNamedNativeQuery() throws Exception {
- getEntityMappings().getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- getEntityMappings().getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- getEntityMappings().getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- assertEquals(3, getXmlEntityMappings().getNamedNativeQueries().size());
-
- getEntityMappings().getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(2, getXmlEntityMappings().getNamedNativeQueries().size());
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
-
- getEntityMappings().getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(1, getXmlEntityMappings().getNamedNativeQueries().size());
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
-
- getEntityMappings().getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(0, getXmlEntityMappings().getNamedNativeQueries().size());
- }
-
- public void testMoveNamedNativeQuery() throws Exception {
- getEntityMappings().getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- getEntityMappings().getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- getEntityMappings().getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- assertEquals(3, getXmlEntityMappings().getNamedNativeQueries().size());
-
-
- getEntityMappings().getQueryContainer().moveNamedNativeQuery(2, 0);
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(2).getName());
-
-
- getEntityMappings().getQueryContainer().moveNamedNativeQuery(0, 1);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAZ", getXmlEntityMappings().getNamedNativeQueries().get(0).getName());
- assertEquals("BAR", getXmlEntityMappings().getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", getXmlEntityMappings().getNamedNativeQueries().get(2).getName());
- }
-
- public void testUpdateNamedNativeQueries() throws Exception {
- assertEquals(0, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- getXmlEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- getXmlEntityMappings().getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
-
- getXmlEntityMappings().getNamedNativeQueries().get(0).setName("FOO");
- getXmlEntityMappings().getNamedNativeQueries().get(1).setName("BAR");
- getXmlEntityMappings().getNamedNativeQueries().get(2).setName("BAZ");
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(3, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedNativeQueries().move(2, 0);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- getXmlEntityMappings().getNamedNativeQueries().move(0, 1);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- getXmlEntityMappings().getNamedNativeQueries().remove(1);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(2, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedNativeQueries().remove(1);
- namedNativeQueries = getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(1, getEntityMappings().getPersistenceUnit().getQueriesSize());
-
- getXmlEntityMappings().getNamedNativeQueries().remove(0);
- assertFalse(getEntityMappings().getQueryContainer().getNamedNativeQueries().iterator().hasNext());
- assertEquals(0, getEntityMappings().getPersistenceUnit().getQueriesSize());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentAttributeTests.java
deleted file mode 100644
index 0d507b4a56..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentAttributeTests.java
+++ /dev/null
@@ -1,319 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmIdMapping;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.GenericOrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmPersistentAttributeTests extends ContextModelTestCase
-{
- public GenericOrmPersistentAttributeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestTypeNullAttributeMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(" private Address address;");
- }
- });
- }
-
- public void testMakeSpecified() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.addToXml();
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ormPersistentAttribute.addToXml();
-
- assertEquals(0, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeSpecifiedMappingKey() throws Exception {
- createTestTypeNullAttributeMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNull(ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute.addToXml(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof GenericOrmOneToOneMapping);
-
-
- ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ormPersistentAttribute.addToXml(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof GenericOrmIdMapping);
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeVirtual() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
-
- assertEquals(0, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- assertEquals(0, ormPersistentType.getSpecifiedAttributesSize());
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- }
-
- public void testMakeVirtualNoUnderlyingJavaAttribute() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
-
-
- ormPersistentType.getSpecifiedAttributes().iterator().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.getDefaultAttributes().iterator().next().getName());
- assertEquals("name", ormPersistentType.getSpecifiedAttributes().iterator().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("id", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete2() throws Exception {
- createTestEntityOneToOneMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- }
-
- public void testGetJavaPersistentAttribute() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- //virtual orm attribute, access type matches java : FIELD, name matches java
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- JavaResourceAttribute javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getFields().iterator().next(), javaResourceAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- //virtual orm attribute, java access type FIELD, orm access type PROPERTY, name matches java
- //verify both the property java resource attribute and the field java resource attribute are used in orm
- //because the field is annotated and property is specified
- ((OrmPersistentAttribute) ormPersistentAttribute).removeFromXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute idFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute idPropertyAttribute = attributes.next();
- assertEquals(ormPersistentAttribute, idFieldAttribute);
- assertNotSame(ormPersistentAttribute, idPropertyAttribute);
- ormPersistentAttribute = idPropertyAttribute;
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, idFieldAttribute.getJavaPersistentAttribute().getAccess());
- javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getMethods().iterator().next(), javaResourceAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmPersistentAttribute ormPersistentAttribute2 = ormPersistentAttribute.addToXml();
- ormPersistentAttribute2.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentTypeTests.java
deleted file mode 100644
index 639420c29d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/GenericOrmPersistentTypeTests.java
+++ /dev/null
@@ -1,502 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmPersistentTypeTests extends ContextModelTestCase
-{
- public static final String MODEL_TYPE_NAME = "Model";
- public static final String FULLY_QUALIFIED_MODEL_TYPE_NAME = PACKAGE_NAME + "." + MODEL_TYPE_NAME;
-
- public static final String EMPLOYEE_TYPE_NAME = "Employee";
- public static final String FULLY_QUALIFIED_EMPLOYEE_TYPE_NAME = PACKAGE_NAME + "." + EMPLOYEE_TYPE_NAME;
-
-
- public GenericOrmPersistentTypeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private void createModelType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public abstract class ").append(MODEL_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, MODEL_TYPE_NAME + ".java", sourceWriter);
- }
-
- private void createEmployeeType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(EMPLOYEE_TYPE_NAME).append(" extends ").append(MODEL_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String department;").append(CR);
- sb.append(CR);
- sb.append(" private java.util.Date startDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMPLOYEE_TYPE_NAME + ".java", sourceWriter);
- }
-
-// public void testUpdateXmlTypeMapping() throws Exception {
-// assertFalse(entityMappings().ormPersistentTypes().hasNext());
-// assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertTrue(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-//
-// //add embeddable in the resource model, verify context model updated
-// Embeddable embeddable = OrmFactory.eINSTANCE.createEmbeddable();
-// ormResource().getEntityMappings().getEmbeddables().add(embeddable);
-// embeddable.setClassName("model.Foo");
-// assertTrue(entityMappings().ormPersistentTypes().hasNext());
-// assertEquals("model.Foo", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
-// assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertTrue(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-// assertEquals("model.Foo", ormResource().getEntityMappings().getEmbeddables().get(0).getClassName());
-//
-// //add entity in the resource model, verify context model updated
-// Entity entity = OrmFactory.eINSTANCE.createEntity();
-// ormResource().getEntityMappings().getEntities().add(entity);
-// entity.setClassName("model.Foo2");
-// assertTrue(entityMappings().ormPersistentTypes().hasNext());
-// assertEquals("model.Foo2", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
-// assertTrue(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-// assertEquals("model.Foo2", ormResource().getEntityMappings().getEntities().get(0).getClassName());
-//
-// //add mapped-superclass in the resource model, verify context model updated
-// MappedSuperclass mappedSuperclass = OrmFactory.eINSTANCE.createMappedSuperclass();
-// ormResource().getEntityMappings().getMappedSuperclasses().add(mappedSuperclass);
-// mappedSuperclass.setClassName("model.Foo3");
-// assertTrue(entityMappings().ormPersistentTypes().hasNext());
-// assertEquals("model.Foo3", entityMappings().ormPersistentTypes().next().getMapping().getClass_());
-// assertFalse(ormResource().getEntityMappings().getMappedSuperclasses().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEntities().isEmpty());
-// assertFalse(ormResource().getEntityMappings().getEmbeddables().isEmpty());
-// assertEquals("model.Foo3", ormResource().getEntityMappings().getMappedSuperclasses().get(0).getClassName());
-// }
-//
-
- public void testMorphXmlTypeMapping() throws Exception {
- assertFalse(getEntityMappings().getPersistentTypes().iterator().hasNext());
- assertTrue(getXmlEntityMappings().getMappedSuperclasses().isEmpty());
- assertTrue(getXmlEntityMappings().getEntities().isEmpty());
- assertTrue(getXmlEntityMappings().getEmbeddables().isEmpty());
-
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo3");
-
- OrmPersistentType ormPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- assertEquals(mappedSuperclassPersistentType, ormPersistentType);
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, ormPersistentType.getMapping().getKey());
-
- ormPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertEquals(0, getXmlEntityMappings().getMappedSuperclasses().size());
- assertEquals(1, getXmlEntityMappings().getEntities().size());
- assertEquals(2, getXmlEntityMappings().getEmbeddables().size());
-
- Iterator<OrmPersistentType> ormPersistentTypes = getEntityMappings().getPersistentTypes().iterator();
- //the same OrmPersistentTypes should still be in the context model
- assertEquals(ormPersistentTypes.next(), entityPersistentType);
- assertEquals(ormPersistentTypes.next(), embeddablePersistentType);
- assertEquals(ormPersistentTypes.next(), mappedSuperclassPersistentType);
-
- assertEquals("model.Foo", getXmlEntityMappings().getEmbeddables().get(0).getClassName());
- assertEquals("model.Foo3", getXmlEntityMappings().getEmbeddables().get(1).getClassName());
- }
-
- public void testRemoveId() throws Exception {
- createTestType();
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityPersistentType.addAttributeToXml(entityPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("id", entity.getAttributes().getIds().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("id")).removeFromXml();
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveBasic() throws Exception {
- createTestType();
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityPersistentType.addAttributeToXml(entityPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("id", entity.getAttributes().getBasics().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("id")).removeFromXml();
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveVersion() throws Exception {
- createTestType();
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityPersistentType.addAttributeToXml(entityPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("id", entity.getAttributes().getVersions().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("id")).removeFromXml();
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveEmbedded() throws Exception {
- createTestType();
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityPersistentType.addAttributeToXml(entityPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("id", entity.getAttributes().getEmbeddeds().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("id")).removeFromXml();
- assertNull(entity.getAttributes());
- }
-
- public void testRemoveTransient() throws Exception {
- createTestType();
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- entityPersistentType.addAttributeToXml(entityPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("id", entity.getAttributes().getTransients().get(0).getName());
-
- ((OrmPersistentAttribute) entityPersistentType.getAttributeNamed("id")).removeFromXml();
- assertNull(entity.getAttributes());
- }
-
- public void testUpdateSpecifiedPersistentAttributes() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
-
- entity.setAttributes(OrmFactory.eINSTANCE.createAttributes());
- XmlBasic basic = OrmFactory.eINSTANCE.createXmlBasic();
- entity.getAttributes().getBasics().add(basic);
- basic.setName("basicAttribute");
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = entityPersistentType.getAttributes().iterator().next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
-
- XmlEmbedded embedded = OrmFactory.eINSTANCE.createXmlEmbedded();
- entity.getAttributes().getEmbeddeds().add(embedded);
- embedded.setName("embeddedAttribute");
-
- Iterator<OrmReadOnlyPersistentAttribute> attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlVersion version = OrmFactory.eINSTANCE.createXmlVersion();
- entity.getAttributes().getVersions().add(version);
- version.setName("versionAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlId id = OrmFactory.eINSTANCE.createXmlId();
- entity.getAttributes().getIds().add(id);
- id.setName("idAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlTransient transientResource = OrmFactory.eINSTANCE.createXmlTransient();
- entity.getAttributes().getTransients().add(transientResource);
- transientResource.setName("transientAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlManyToOne manyToOneResource = OrmFactory.eINSTANCE.createXmlManyToOne();
- entity.getAttributes().getManyToOnes().add(manyToOneResource);
- manyToOneResource.setName("manyToOneAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlManyToMany manyToManyResource = OrmFactory.eINSTANCE.createXmlManyToMany();
- entity.getAttributes().getManyToManys().add(manyToManyResource);
- manyToManyResource.setName("manyToManyAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlOneToMany oneToManyResource = OrmFactory.eINSTANCE.createXmlOneToMany();
- entity.getAttributes().getOneToManys().add(oneToManyResource);
- oneToManyResource.setName("oneToManyAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- XmlOneToOne oneToOneResource = OrmFactory.eINSTANCE.createXmlOneToOne();
- entity.getAttributes().getOneToOnes().add(oneToOneResource);
- oneToOneResource.setName("oneToOneAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
-
- XmlEmbeddedId embeddedIdResource = OrmFactory.eINSTANCE.createXmlEmbeddedId();
- entity.getAttributes().getEmbeddedIds().add(embeddedIdResource);
- embeddedIdResource.setName("embeddedIdAttribute");
-
- attributes = entityPersistentType.getAttributes().iterator();
- ormPersistentAttribute = attributes.next();
- assertEquals("idAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedIdAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("basicAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("versionAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("oneToOneAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("manyToManyAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("embeddedAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute = attributes.next();
- assertEquals("transientAttribute", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMapping().getKey());
- assertFalse(attributes.hasNext());
-
- entity.getAttributes().getBasics().remove(0);
- entity.getAttributes().getEmbeddeds().remove(0);
- entity.getAttributes().getTransients().remove(0);
- entity.getAttributes().getIds().remove(0);
- entity.getAttributes().getVersions().remove(0);
- entity.getAttributes().getManyToOnes().remove(0);
- entity.getAttributes().getManyToManys().remove(0);
- entity.getAttributes().getOneToManys().remove(0);
- entity.getAttributes().getOneToOnes().remove(0);
- entity.getAttributes().getEmbeddedIds().remove(0);
- assertFalse(entityPersistentType.getAttributes().iterator().hasNext());
- assertNotNull(entity.getAttributes());
- }
-
- public void testInheritedAttributesResolve() throws Exception {
- createModelType();
- createEmployeeType();
-
- OrmPersistentType employeePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_EMPLOYEE_TYPE_NAME);
-
-
- OrmPersistentAttribute attribute = employeePersistentType.addAttributeToXml(employeePersistentType.getAttributeNamed("startDate"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- attribute.getMapping().setName("id");
- attribute = employeePersistentType.addAttributeToXml(employeePersistentType.getAttributeNamed("startDate"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- attribute.getMapping().setName("name");
- OrmPersistentAttribute startDateAttribute = employeePersistentType.addAttributeToXml(employeePersistentType.getAttributeNamed("startDate"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- ((OrmBasicMapping) startDateAttribute.getMapping()).setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ((OrmBasicMapping) startDateAttribute.getMapping()).getConverter()).setTemporalType(TemporalType.DATE);
-
- OrmReadOnlyPersistentAttribute idAttribute = employeePersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = idAttribute.getJavaPersistentAttribute();
- assertNotNull(javaPersistentAttribute);
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals("test.Employee", javaPersistentAttribute.getOwningPersistentType().getName());
- assertEquals("test.Model", javaPersistentAttribute.getResourceAttribute().getParent().getQualifiedName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java
deleted file mode 100644
index 68e86e2e8a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/JptCoreOrmContextModelTests.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptCoreOrmContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCoreOrmContextModelTests.class.getPackage().getName());
- suite.addTestSuite(OrmXmlTests.class);
- suite.addTestSuite(EntityMappingsTests.class);
- suite.addTestSuite(PersistenceUnitMetadataTests.class);
- suite.addTestSuite(PersistenceUnitDefaultsTests.class);
- suite.addTestSuite(GenericOrmPersistentAttributeTests.class);
- suite.addTestSuite(GenericOrmPersistentTypeTests.class);
- suite.addTestSuite(OrmAssociationOverrideTests.class);
- suite.addTestSuite(OrmAttributeOverrideTests.class);
- suite.addTestSuite(OrmBasicMappingTests.class);
- suite.addTestSuite(OrmCascadeTests.class);
- suite.addTestSuite(OrmColumnTests.class);
- suite.addTestSuite(OrmDiscriminatorColumnTests.class);
- suite.addTestSuite(OrmIdMappingTests.class);
- suite.addTestSuite(OrmEmbeddableTests.class);
- suite.addTestSuite(OrmEmbeddedMappingTests.class);
- suite.addTestSuite(OrmEmbeddedIdMappingTests.class);
- suite.addTestSuite(OrmEntityTests.class);
- suite.addTestSuite(OrmGeneratedValueTests.class);
- suite.addTestSuite(OrmJoinColumnTests.class);
- suite.addTestSuite(OrmJoinTableTests.class);
- suite.addTestSuite(OrmMappedSuperclassTests.class);
- suite.addTestSuite(OrmManyToManyMappingTests.class);
- suite.addTestSuite(OrmManyToOneMappingTests.class);
- suite.addTestSuite(OrmNamedQueryTests.class);
- suite.addTestSuite(OrmNamedNativeQueryTests.class);
- suite.addTestSuite(OrmOneToManyMappingTests.class);
- suite.addTestSuite(OrmOneToOneMappingTests.class);
- suite.addTestSuite(OrmPrimaryKeyJoinColumnTests.class);
- suite.addTestSuite(OrmQueryHintTests.class);
- suite.addTestSuite(OrmSecondaryTableTests.class);
- suite.addTestSuite(OrmSequenceGeneratorTests.class);
- suite.addTestSuite(OrmTableGeneratorTests.class);
- suite.addTestSuite(OrmTableTests.class);
- suite.addTestSuite(OrmTransientMappingTests.class);
- suite.addTestSuite(OrmVersionMappingTests.class);
- return suite;
- }
-
- private JptCoreOrmContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAssociationOverrideTests.java
deleted file mode 100644
index fd8da14991..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAssociationOverrideTests.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmAssociationOverrideTests extends ContextModelTestCase
-{
- public OrmAssociationOverrideTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
- assertFalse(entityResource.getAssociationOverrides().isEmpty());
-
- //set name in the resource model, verify context model updated
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- //set name to null in the resource model
- xmlAssociationOverride.setName(null);
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
-
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- entityResource.getAssociationOverrides().remove(0);
- assertFalse(overrideContainer.getOverrides().iterator().hasNext());
- assertTrue(entityResource.getAssociationOverrides().isEmpty());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
-
- //set name in the context model, verify resource model modified
- ormAssociationOverride.setName("foo");
- assertEquals("foo", ormAssociationOverride.getName());
- assertEquals("foo", xmlAssociationOverride.getName());
-
- //set name to null in the context model
- ormAssociationOverride.setName(null);
- assertNull(ormAssociationOverride.getName());
- assertNull(entityResource.getAssociationOverrides().get(0).getName());
- }
-
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- OrmJoinColumn joinColumn = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = joiningStrategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, xmlAssociationOverride.getJoinColumns().size());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, xmlAssociationOverride.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, xmlAssociationOverride.getJoinColumns().size());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- OrmJoinColumnRelationshipStrategy joiningStrategy = ormAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- xmlAssociationOverride.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- xmlAssociationOverride.getJoinColumns().get(0).setName("FOO");
- xmlAssociationOverride.getJoinColumns().get(1).setName("BAR");
- xmlAssociationOverride.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(2, 0);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(0);
- assertFalse(joiningStrategy.getSpecifiedJoinColumns().iterator().hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAttributeOverrideTests.java
deleted file mode 100644
index a2879c6303..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmAttributeOverrideTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmAttributeOverrideTests extends ContextModelTestCase
-{
- public OrmAttributeOverrideTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- XmlAttributeOverride attributeOverrideResource = entityResource.getAttributeOverrides().get(0);
- OrmAttributeOverride ormAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertNull(ormAttributeOverride.getName());
- assertNull(attributeOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
- assertFalse(entityResource.getAttributeOverrides().isEmpty());
-
- //set name in the resource model, verify context model updated
- attributeOverrideResource.setName("FOO");
- assertEquals("FOO", ormAttributeOverride.getName());
- assertEquals("FOO", attributeOverrideResource.getName());
-
- //set name to null in the resource model
- attributeOverrideResource.setName(null);
- assertNull(ormAttributeOverride.getName());
- assertNull(attributeOverrideResource.getName());
-
- attributeOverrideResource.setName("FOO");
- assertEquals("FOO", ormAttributeOverride.getName());
- assertEquals("FOO", attributeOverrideResource.getName());
-
- entityResource.getAttributeOverrides().remove(0);
- assertFalse(overrideContainer.getOverrides().iterator().hasNext());
- assertTrue(entityResource.getAttributeOverrides().isEmpty());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- XmlAttributeOverride attributeOverrideResource = entityResource.getAttributeOverrides().get(0);
- OrmAttributeOverride ormAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertNull(ormAttributeOverride.getName());
- assertNull(attributeOverrideResource.getName());
-
- //set name in the context model, verify resource model modified
- ormAttributeOverride.setName("foo");
- assertEquals("foo", ormAttributeOverride.getName());
- assertEquals("foo", attributeOverrideResource.getName());
-
- //set name to null in the context model
- ormAttributeOverride.setName(null);
- assertNull(ormAttributeOverride.getName());
- assertNull(entityResource.getAttributeOverrides().get(0).getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmBasicMappingTests.java
deleted file mode 100644
index 90467e1087..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmBasicMappingTests.java
+++ /dev/null
@@ -1,724 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.LobConverter;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmBasicMappingTests extends ContextModelTestCase
-{
- public OrmBasicMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.FETCH_TYPE, JPA.COLUMN, JPA.LOB, JPA.TEMPORAL, JPA.TEMPORAL_TYPE, JPA.ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(fetch=FetchType.LAZY, optional=false)");
- sb.append(CR);
- sb.append(" @Column(name=\"MY_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\", length=5, precision=6, scale=7)");
- sb.append(CR);
- sb.append(" @Lob");
- sb.append(CR);
- sb.append(" @Temporal(TemporalType.TIMESTAMP)");
- sb.append(CR);
- sb.append(" @Enumerated(EnumType.STRING)");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertEquals("id", ormBasicMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertEquals("id", ormBasicMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(basicResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- basicResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormBasicMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, basicResource.getFetch());
-
- basicResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormBasicMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, basicResource.getFetch());
-
- //set fetch to null in the resource model
- basicResource.setFetch(null);
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(basicResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(basicResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormBasicMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, basicResource.getFetch());
- assertEquals(FetchType.EAGER, ormBasicMapping.getSpecifiedFetch());
-
- ormBasicMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, basicResource.getFetch());
- assertEquals(FetchType.LAZY, ormBasicMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormBasicMapping.setSpecifiedFetch(null);
- assertNull(basicResource.getFetch());
- assertNull(ormBasicMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- basicResource.setEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, basicResource.getEnumerated());
-
- basicResource.setEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, basicResource.getEnumerated());
-
- //set enumerated to null in the resource model
- basicResource.setEnumerated(null);
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormBasicMapping.setConverter(BaseEnumeratedConverter.class);
- ((BaseEnumeratedConverter) ormBasicMapping.getConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, basicResource.getEnumerated());
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
-
- ((BaseEnumeratedConverter) ormBasicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, basicResource.getEnumerated());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormBasicMapping.getConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormBasicMapping.setConverter(null);
- assertNull(basicResource.getEnumerated());
- assertNull(ormBasicMapping.getConverter().getType());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertNull(basicResource.getOptional());
-
- //set enumerated in the resource model, verify context model updated
- basicResource.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormBasicMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, basicResource.getOptional());
-
- basicResource.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormBasicMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, basicResource.getOptional());
-
- //set enumerated to null in the resource model
- basicResource.setOptional(null);
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertNull(basicResource.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertNull(basicResource.getOptional());
-
- //set enumerated in the context model, verify resource model updated
- ormBasicMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, basicResource.getOptional());
- assertEquals(Boolean.TRUE, ormBasicMapping.getSpecifiedOptional());
-
- ormBasicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, basicResource.getOptional());
- assertEquals(Boolean.FALSE, ormBasicMapping.getSpecifiedOptional());
-
- //set enumerated to null in the context model
- ormBasicMapping.setSpecifiedOptional(null);
- assertNull(basicResource.getOptional());
- assertNull(ormBasicMapping.getSpecifiedOptional());
- }
-
- public void testUpdateSpecifiedLob() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertFalse(basicResource.isLob());
-
- //set lob in the resource model, verify context model updated
- basicResource.setLob(true);
- assertEquals(LobConverter.class, ormBasicMapping.getConverter().getType());
- assertTrue(basicResource.isLob());
-
- //set lob to null in the resource model
- basicResource.setLob(false);
- assertNull(ormBasicMapping.getConverter().getType());
- assertFalse(basicResource.isLob());
- }
-
- public void testModifySpecifiedLob() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertFalse(basicResource.isLob());
-
- //set lob in the context model, verify resource model updated
- ormBasicMapping.setConverter(LobConverter.class);
- assertTrue(basicResource.isLob());
- assertEquals(LobConverter.class, ormBasicMapping.getConverter().getType());
-
- //set lob to false in the context model
- ormBasicMapping.setConverter(null);
- assertFalse(basicResource.isLob());
- assertNull(ormBasicMapping.getConverter().getType());
- }
-
- public void testUpdateTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getTemporal());
-
- //set temporal in the resource model, verify context model updated
- basicResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, basicResource.getTemporal());
-
- basicResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, basicResource.getTemporal());
-
- basicResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, basicResource.getTemporal());
-
- //set temporal to null in the resource model
- basicResource.setTemporal(null);
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getTemporal());
- }
-
- public void testModifyTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(basicResource.getTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormBasicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ormBasicMapping.getConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, basicResource.getTemporal());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormBasicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, basicResource.getTemporal());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormBasicMapping.getConverter()).setTemporalType(TemporalType.TIMESTAMP);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, basicResource.getTemporal());
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormBasicMapping.getConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormBasicMapping.setConverter(null);
- assertNull(basicResource.getTemporal());
- assertNull(ormBasicMapping.getConverter().getType());
- }
-
- //TODO test defaults
- //TODO test overriding java mapping with a different mapping type in xml
-
-
- public void testBasicMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- ormBasicMapping.setName("foo");
-
- assertEquals("foo", ormBasicMapping.getName());
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertEquals(FetchType.EAGER, ormBasicMapping.getFetch());
- assertEquals(true, ormBasicMapping.isOptional());
-
-
- OrmColumn ormColumn = ormBasicMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("foo", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", basicMapping.getName());
- assertEquals(BaseEnumeratedConverter.class, basicMapping.getConverter().getType());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) basicMapping.getConverter()).getEnumType());
- assertEquals(FetchType.LAZY, basicMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, basicMapping.getSpecifiedOptional());
-
- Column column = basicMapping.getColumn();
- assertEquals("MY_COLUMN", column.getSpecifiedName());
- assertEquals(Boolean.TRUE, column.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, column.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, column.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, column.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", column.getColumnDefinition());
- assertEquals("MY_TABLE", column.getSpecifiedTable());
- assertEquals(Integer.valueOf(5), column.getSpecifiedLength());
- assertEquals(Integer.valueOf(6), column.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), column.getSpecifiedScale());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", basicMapping.getName());
- assertNull(basicMapping.getConverter().getType());
- assertEquals(FetchType.EAGER, basicMapping.getFetch());
- assertTrue(basicMapping.isOptional());
-
- Column column = basicMapping.getColumn();
- assertEquals("id", column.getName());
- assertFalse(column.isUnique());
- assertTrue(column.isNullable());
- assertTrue(column.isInsertable());
- assertTrue(column.isUpdatable());
- assertNull(column.getColumnDefinition());
- assertEquals(TYPE_NAME, column.getTable());
- assertEquals(255, column.getLength());
- assertEquals(0, column.getPrecision());
- assertEquals(0, column.getScale());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormBasicMapping.getName());
- assertNull(ormBasicMapping.getConverter().getType());
- assertNull(ormBasicMapping.getSpecifiedFetch());
- assertNull(ormBasicMapping.getSpecifiedOptional());
- assertEquals(FetchType.EAGER, ormBasicMapping.getDefaultFetch());
- assertEquals(true, ormBasicMapping.isDefaultOptional());
-
- OrmColumn ormColumn = ormBasicMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("id", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
-
- }
- //3 things tested above
- //1. virtual mapping metadata complete=false - defaults are taken from the java annotations
- //2. virtual mapping metadata complete=true - defaults are taken from java defaults,annotations ignored
- //3. specified mapping (metadata complete=true/false - defaults are taken from java annotations
-
-
- public void testBasicMorphToIdMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testBasicMorphToVersionMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((VersionMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testBasicMorphToTransientMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToEmbeddedMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToOneToOneMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToOneToManyMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToManyToOneMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testBasicMorphToManyToManyMapping() throws Exception {
- createTestEntityBasicMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- BasicMapping basicMapping = (BasicMapping) ormPersistentAttribute.getMapping();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmCascadeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmCascadeTests.java
deleted file mode 100644
index e22566cfc9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmCascadeTests.java
+++ /dev/null
@@ -1,290 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmCascadeTests extends ContextModelTestCase
-{
- public OrmCascadeTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateCascadeAll() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isAll());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isAll());
- assertNotNull(oneToOne.getCascade());
-
- //set all in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeAll(true);
- assertEquals(true, cascade.isAll());
- assertEquals(true, oneToOne.getCascade().isCascadeAll());
-
- //set all to false in the resource model
- oneToOne.getCascade().setCascadeAll(false);
- assertEquals(false, cascade.isAll());
- assertEquals(false, oneToOne.getCascade().isCascadeAll());
- }
-
- public void testModifyCascadeAll() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isAll());
- assertNull(oneToOne.getCascade());
-
- //set all in the context model, verify resource model updated
- cascade.setAll(true);
- assertEquals(true, cascade.isAll());
- assertEquals(true, oneToOne.getCascade().isCascadeAll());
-
- //set all to false in the context model
- cascade.setAll(false);
- assertEquals(false, cascade.isAll());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isPersist());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isPersist());
- assertNotNull(oneToOne.getCascade());
-
- //set Persist in the resource model, verify context model updated
- oneToOne.getCascade().setCascadePersist(true);
- assertEquals(true, cascade.isPersist());
- assertEquals(true, oneToOne.getCascade().isCascadePersist());
-
- //set Persist to false in the resource model
- oneToOne.getCascade().setCascadePersist(false);
- assertEquals(false, cascade.isPersist());
- assertEquals(false, oneToOne.getCascade().isCascadePersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isPersist());
- assertNull(oneToOne.getCascade());
-
- //set Persist in the context model, verify resource model updated
- cascade.setPersist(true);
- assertEquals(true, cascade.isPersist());
- assertEquals(true, oneToOne.getCascade().isCascadePersist());
-
- //set Persist to false in the context model
- cascade.setPersist(false);
- assertEquals(false, cascade.isPersist());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadeMerge() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isMerge());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isMerge());
- assertNotNull(oneToOne.getCascade());
-
- //set Merge in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeMerge(true);
- assertEquals(true, cascade.isMerge());
- assertEquals(true, oneToOne.getCascade().isCascadeMerge());
-
- //set Merge to false in the resource model
- oneToOne.getCascade().setCascadeMerge(false);
- assertEquals(false, cascade.isMerge());
- assertEquals(false, oneToOne.getCascade().isCascadeMerge());
- }
-
- public void testModifyCascadeMerge() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isMerge());
- assertNull(oneToOne.getCascade());
-
- //set Merge in the context model, verify resource model updated
- cascade.setMerge(true);
- assertEquals(true, cascade.isMerge());
- assertEquals(true, oneToOne.getCascade().isCascadeMerge());
-
- //set Merge to false in the context model
- cascade.setMerge(false);
- assertEquals(false, cascade.isMerge());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadeRemove() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRemove());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isRemove());
- assertNotNull(oneToOne.getCascade());
-
- //set Remove in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeRemove(true);
- assertEquals(true, cascade.isRemove());
- assertEquals(true, oneToOne.getCascade().isCascadeRemove());
-
- //set Remove to false in the resource model
- oneToOne.getCascade().setCascadeRemove(false);
- assertEquals(false, cascade.isRemove());
- assertEquals(false, oneToOne.getCascade().isCascadeRemove());
- }
-
- public void testModifyCascadeRemove() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRemove());
- assertNull(oneToOne.getCascade());
-
- //set Remove in the context model, verify resource model updated
- cascade.setRemove(true);
- assertEquals(true, cascade.isRemove());
- assertEquals(true, oneToOne.getCascade().isCascadeRemove());
-
- //set Remove to false in the context model
- cascade.setRemove(false);
- assertEquals(false, cascade.isRemove());
- assertNull(oneToOne.getCascade());
- }
-
- public void testUpdateCascadeRefresh() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRefresh());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isRefresh());
- assertNotNull(oneToOne.getCascade());
-
- //set Refresh in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeRefresh(true);
- assertEquals(true, cascade.isRefresh());
- assertEquals(true, oneToOne.getCascade().isCascadeRefresh());
-
- //set Refresh to false in the resource model
- oneToOne.getCascade().setCascadeRefresh(false);
- assertEquals(false, cascade.isRefresh());
- assertEquals(false, oneToOne.getCascade().isCascadeRefresh());
- }
-
- public void testModifyCascadeRefresh() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade cascade = ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isRefresh());
- assertNull(oneToOne.getCascade());
-
- //set Refresh in the context model, verify resource model updated
- cascade.setRefresh(true);
- assertEquals(true, cascade.isRefresh());
- assertEquals(true, oneToOne.getCascade().isCascadeRefresh());
-
- //set Refresh to false in the context model
- cascade.setRefresh(false);
- assertEquals(false, cascade.isRefresh());
- assertNull(oneToOne.getCascade());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmColumnTests.java
deleted file mode 100644
index a903d3793f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmColumnTests.java
+++ /dev/null
@@ -1,856 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmColumnTests extends ContextModelTestCase
-{
- public OrmColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", basic.getColumn().getName());
-
- //set name to null in the resource model
- basic.getColumn().setName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn().getName());
-
- basic.getColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", basic.getColumn().getName());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedName("foo");
- assertEquals("foo", ormColumn.getSpecifiedName());
- assertEquals("foo", basic.getColumn().getName());
-
- //set name to null in the context model
- ormColumn.setSpecifiedName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateColumnDefinition() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", basic.getColumn().getColumnDefinition());
-
- //set name to null in the resource model
- basic.getColumn().setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn().getColumnDefinition());
-
- basic.getColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", basic.getColumn().getColumnDefinition());
-
- basic.setColumn(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
- }
-
- public void testModifyColumnDefinition() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setColumnDefinition("foo");
- assertEquals("foo", ormColumn.getColumnDefinition());
- assertEquals("foo", basic.getColumn().getColumnDefinition());
-
- //set name to null in the context model
- ormColumn.setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedTable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setTable("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedTable());
- assertEquals("FOO", basic.getColumn().getTable());
-
- //set name to null in the resource model
- basic.getColumn().setTable(null);
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn().getTable());
-
- basic.getColumn().setTable("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedTable());
- assertEquals("FOO", basic.getColumn().getTable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedTable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedTable("foo");
- assertEquals("foo", ormColumn.getSpecifiedTable());
- assertEquals("foo", basic.getColumn().getTable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedTable(null);
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedNullable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setNullable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, basic.getColumn().getNullable());
-
- //set name to null in the resource model
- basic.getColumn().setNullable(null);
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn().getNullable());
-
- basic.getColumn().setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, basic.getColumn().getNullable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedNullable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, basic.getColumn().getNullable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedNullable(null);
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedUpdatable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setUpdatable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, basic.getColumn().getUpdatable());
-
- //set name to null in the resource model
- basic.getColumn().setUpdatable(null);
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn().getUpdatable());
-
- basic.getColumn().setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, basic.getColumn().getUpdatable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedUpdatable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, basic.getColumn().getUpdatable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedUpdatable(null);
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedInsertable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setInsertable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, basic.getColumn().getInsertable());
-
- //set name to null in the resource model
- basic.getColumn().setInsertable(null);
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn().getInsertable());
-
- basic.getColumn().setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, basic.getColumn().getInsertable());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedInsertable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, basic.getColumn().getInsertable());
-
- //set name to null in the context model
- ormColumn.setSpecifiedInsertable(null);
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedUnique() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setUnique(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, basic.getColumn().getUnique());
-
- //set name to null in the resource model
- basic.getColumn().setUnique(null);
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn().getUnique());
-
- basic.getColumn().setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, basic.getColumn().getUnique());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedUnique() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, basic.getColumn().getUnique());
-
- //set name to null in the context model
- ormColumn.setSpecifiedUnique(null);
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedLength() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setLength(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(8), basic.getColumn().getLength());
-
- //set name to null in the resource model
- basic.getColumn().setLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn().getLength());
-
- basic.getColumn().setLength(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(11), basic.getColumn().getLength());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedLength() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedLength(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(7), basic.getColumn().getLength());
-
- //set name to null in the context model
- ormColumn.setSpecifiedLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedPrecision() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setPrecision(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(8), basic.getColumn().getPrecision());
-
- //set name to null in the resource model
- basic.getColumn().setPrecision(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn().getPrecision());
-
- basic.getColumn().setPrecision(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(11), basic.getColumn().getPrecision());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedPrecision() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedPrecision(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), basic.getColumn().getPrecision());
-
- //set name to null in the context model
- ormColumn.setSpecifiedPrecision(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testUpdateSpecifiedScale() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the resource model, verify context model updated
- basic.setColumn(OrmFactory.eINSTANCE.createXmlColumn());
- basic.getColumn().setScale(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedScale());
- assertEquals(Integer.valueOf(8), basic.getColumn().getScale());
-
- //set name to null in the resource model
- basic.getColumn().setScale(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn().getScale());
-
- basic.getColumn().setScale(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedScale());
- assertEquals(Integer.valueOf(11), basic.getColumn().getScale());
-
- basic.setColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testModifySpecifiedScale() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- OrmColumn ormColumn = ormBasicMapping.getColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlBasic basic = entityResource.getAttributes().getBasics().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedScale(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedScale());
- assertEquals(Integer.valueOf(7), basic.getColumn().getScale());
-
- //set name to null in the context model
- ormColumn.setSpecifiedScale(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(basic.getColumn());
- }
-
- public void testVirtualColumnDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- Iterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getDefaultAttributes().iterator();
- attributes.next();
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute namePersistentAttribute = attributes.next();
- BasicMapping nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- Column virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("name", virtualColumn.getName());
- assertEquals(TYPE_NAME, virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("name").getMapping();
- JavaColumn javaColumn = javaBasicMapping.getColumn();
- javaColumn.setSpecifiedName("FOO");
- javaColumn.setSpecifiedTable("FOO_TABLE");
- javaColumn.setColumnDefinition("COLUMN_DEFINITION");
- javaColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaColumn.setSpecifiedNullable(Boolean.FALSE);
- javaColumn.setSpecifiedUnique(Boolean.TRUE);
- javaColumn.setSpecifiedLength(Integer.valueOf(45));
- javaColumn.setSpecifiedPrecision(Integer.valueOf(46));
- javaColumn.setSpecifiedScale(Integer.valueOf(47));
-
- this.getJpaProject().synchronizeContextModel();
-
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("FOO", virtualColumn.getName());
- assertEquals("FOO_TABLE", virtualColumn.getTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertFalse(virtualColumn.isInsertable());
- assertFalse(virtualColumn.isUpdatable());
- assertFalse(virtualColumn.isNullable());
- assertTrue(virtualColumn.isUnique());
- assertEquals(45, virtualColumn.getLength());
- assertEquals(46, virtualColumn.getPrecision());
- assertEquals(47, virtualColumn.getScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("name", virtualColumn.getName());
- assertEquals(TYPE_NAME, virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("name", virtualColumn.getName());
- assertEquals(TYPE_NAME, virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("name", virtualColumn.getName());
- assertEquals(TYPE_NAME, virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set metadata-complete false, orm.xml virtual column gets setting from java annotation
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- nameVirtualMapping = (BasicMapping) namePersistentAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("FOO", virtualColumn.getName());
- assertEquals("FOO_TABLE", virtualColumn.getTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertFalse(virtualColumn.isInsertable());
- assertFalse(virtualColumn.isUpdatable());
- assertFalse(virtualColumn.isNullable());
- assertTrue(virtualColumn.isUnique());
- assertEquals(45, virtualColumn.getLength());
- assertEquals(46, virtualColumn.getPrecision());
- assertEquals(47, virtualColumn.getScale());
- }
-
- public void testNullColumnDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute namePersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("name"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- OrmBasicMapping nameVirtualMapping = (OrmBasicMapping) namePersistentAttribute.getMapping();
- OrmColumn ormColumn = nameVirtualMapping.getColumn();
-
- //set Column annotation in Java
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("name").getMapping();
- JavaColumn javaColumn = javaBasicMapping.getColumn();
- javaColumn.setSpecifiedName("FOO");
- javaColumn.setSpecifiedTable("FOO_TABLE");
- javaColumn.setColumnDefinition("COLUMN_DEFINITION");
- javaColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaColumn.setSpecifiedNullable(Boolean.FALSE);
- javaColumn.setSpecifiedUnique(Boolean.TRUE);
- javaColumn.setSpecifiedLength(Integer.valueOf(45));
- javaColumn.setSpecifiedPrecision(Integer.valueOf(46));
- javaColumn.setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("name", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualColumnTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute nameOrmAttribute = ormPersistentType.getAttributeNamed("name");
- BasicMapping nameVirtualMapping = (BasicMapping) nameOrmAttribute.getMapping();
- Column virtualColumn = nameVirtualMapping.getColumn();
-
- assertEquals(TYPE_NAME, virtualColumn.getTable());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("name").getMapping();
- javaBasicMapping.getColumn().setSpecifiedTable("JAVA_TABLE");
- nameVirtualMapping = (BasicMapping) nameOrmAttribute.getMapping();
- virtualColumn = nameVirtualMapping.getColumn();
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not default
- nameOrmAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("name"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- BasicMapping nameSpecifiedMapping = (OrmBasicMapping) nameOrmAttribute.getMapping();
- Column specifiedColumn = nameSpecifiedMapping.getColumn();
- assertNull(specifiedColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE", specifiedColumn.getDefaultTable());
- assertEquals("ORM_TABLE", specifiedColumn.getTable());
- }
-
-//public void testUpdateDefaultNameNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals("Foo", xmlEntity.getTable().getDefaultName());
-//}
-//
-//public void testUpdateDefaultNameFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
-//}
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java
deleted file mode 100644
index ba52aa35f2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmDiscriminatorColumnTests.java
+++ /dev/null
@@ -1,456 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmDiscriminatorColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmDiscriminatorColumnTests extends ContextModelTestCase
-{
- public OrmDiscriminatorColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private void createTestAbstractEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getName());
-
- //set name to null in the resource model
- entityResource.getDiscriminatorColumn().setName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn().getName());
-
- entityResource.getDiscriminatorColumn().setName("FOO");
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getName());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedName("foo");
- assertEquals("foo", ormColumn.getSpecifiedName());
- assertEquals("foo", entityResource.getDiscriminatorColumn().getName());
-
- //set name to null in the context model
- ormColumn.setSpecifiedName(null);
- assertNull(ormColumn.getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
-// public void testUpdateDefaultNameFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.javaEntity().getTable().setSpecifiedName("Foo");
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(null);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.getTable().setSpecifiedName("Bar");
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
-// }
-
- public void testUpdateSpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setLength(Integer.valueOf(8));
- assertEquals(Integer.valueOf(8), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(8), entityResource.getDiscriminatorColumn().getLength());
-
- //set name to null in the resource model
- entityResource.getDiscriminatorColumn().setLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn().getLength());
-
- entityResource.getDiscriminatorColumn().setLength(Integer.valueOf(11));
- assertEquals(Integer.valueOf(11), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(11), entityResource.getDiscriminatorColumn().getLength());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedLength() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setSpecifiedLength(Integer.valueOf(7));
- assertEquals(Integer.valueOf(7), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(7), entityResource.getDiscriminatorColumn().getLength());
-
- //set name to null in the context model
- ormColumn.setSpecifiedLength(null);
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testUpdateSpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- //set name to null in the resource model
- entityResource.getDiscriminatorColumn().setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- entityResource.getDiscriminatorColumn().setColumnDefinition("FOO");
- assertEquals("FOO", ormColumn.getColumnDefinition());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set name in the context model, verify resource model modified
- ormColumn.setColumnDefinition("foo");
- assertEquals("foo", ormColumn.getColumnDefinition());
- assertEquals("foo", entityResource.getDiscriminatorColumn().getColumnDefinition());
-
- //set name to null in the context model
- ormColumn.setColumnDefinition(null);
- assertNull(ormColumn.getColumnDefinition());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testUpdateSpecifiedDiscriminatorType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set discriminator type in the resource model, verify context model updated
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setDiscriminatorType(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.STRING);
- assertEquals(DiscriminatorType.STRING, ormColumn.getSpecifiedDiscriminatorType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.STRING, entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- //set discriminator type to null in the resource model
- entityResource.getDiscriminatorColumn().setDiscriminatorType(null);
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- entityResource.getDiscriminatorColumn().setDiscriminatorType(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.CHAR);
- assertEquals(DiscriminatorType.CHAR, ormColumn.getSpecifiedDiscriminatorType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.CHAR, entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- entityResource.setDiscriminatorColumn(null);
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testModifySpecifiedDiscriminatorType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmDiscriminatorColumn ormColumn = ormEntity.getDiscriminatorColumn();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
-
- //set discriminator type in the context model, verify resource model modified
- ormColumn.setSpecifiedDiscriminatorType(DiscriminatorType.STRING);
- assertEquals(DiscriminatorType.STRING, ormColumn.getSpecifiedDiscriminatorType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.DiscriminatorType.STRING, entityResource.getDiscriminatorColumn().getDiscriminatorType());
-
- //set discriminator type to null in the context model
- ormColumn.setSpecifiedDiscriminatorType(null);
- assertNull(ormColumn.getSpecifiedDiscriminatorType());
- assertNull(entityResource.getDiscriminatorColumn());
- }
-
- public void testDefaultsNoDiscriminatorColumnInJava() throws Exception {
- createTestAbstractEntity();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity abstractEntity = (OrmEntity) persistentType.getMapping();
-
- OrmPersistentType childPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + "." + "AnnotationTestTypeChild");
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- //test defaults with single-table inheritance, no specified discriminator column set
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
-
- //test defaults with single-table inheritance, specified discriminator column set on root
- abstractEntity.getDiscriminatorColumn().setSpecifiedName("DTYPE2");
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(5));
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
-
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- assertEquals("DTYPE2", abstractEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals(Integer.valueOf(5), abstractEntity.getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(DiscriminatorType.CHAR, abstractEntity.getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals("DTYPE2", childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(5, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.CHAR, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedLength());
- assertEquals(null, childEntity.getDiscriminatorColumn().getSpecifiedDiscriminatorType());
-
-
- //test defaults with table-per-class inheritance, discriminator column does not apply
- abstractEntity.getDiscriminatorColumn().setSpecifiedName(null);
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(null);
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(null);
- abstractEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getInheritanceStrategy());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(0, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, childEntity.getDefaultInheritanceStrategy());
- assertEquals(null, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(0, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(null, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
- }
-
- public void testDefaultsDiscriminatorColumnInJava() throws Exception {
- createTestAbstractEntity();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity abstractEntity = (OrmEntity) persistentType.getMapping();
-
- OrmPersistentType childPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + "." + "AnnotationTestTypeChild");
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- ((Entity) persistentType.getJavaPersistentType().getMapping()).getDiscriminatorColumn().setSpecifiedName("FOO");
- ((Entity) persistentType.getJavaPersistentType().getMapping()).getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(5));
- ((Entity) persistentType.getJavaPersistentType().getMapping()).getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.CHAR);
-
- //test defaults with single-table inheritance, specified discriminator column set in java
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals("FOO", abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(5, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.CHAR, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals("FOO", childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(5, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.CHAR, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
-
- //test defaults with single-table inheritance, specified discriminator column set in java, metadata-complete true
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
-
- //test defaults with single-table inheritance, specified discriminator column set in orm
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- abstractEntity.getDiscriminatorColumn().setSpecifiedName("BAR");
- abstractEntity.getDiscriminatorColumn().setSpecifiedLength(Integer.valueOf(6));
- abstractEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.INTEGER);
-
- assertEquals(InheritanceType.SINGLE_TABLE, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(DiscriminatorColumn.DEFAULT_NAME, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(DiscriminatorColumn.DEFAULT_LENGTH, abstractEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorColumn.DEFAULT_DISCRIMINATOR_TYPE, abstractEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- assertEquals(InheritanceType.SINGLE_TABLE, childEntity.getDefaultInheritanceStrategy());
- assertEquals("BAR", childEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(6, childEntity.getDiscriminatorColumn().getDefaultLength());
- assertEquals(DiscriminatorType.INTEGER, childEntity.getDiscriminatorColumn().getDefaultDiscriminatorType());
-
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddableTests.java
deleted file mode 100644
index af963c394f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddableTests.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmEmbeddableTests extends ContextModelTestCase
-{
- public OrmEmbeddableTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals("model.Foo", embeddableResource.getClassName());
-
- //set class in the resource model, verify context model updated
- embeddableResource.setClassName("com.Bar");
- assertEquals("com.Bar", ormEmbeddable.getClass_());
- assertEquals("com.Bar", embeddableResource.getClassName());
-
- //set class to null in the resource model
- embeddableResource.setClassName(null);
- assertNull(ormEmbeddable.getClass_());
- assertNull(embeddableResource.getClassName());
- }
-
- public void testModifyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals("model.Foo", embeddableResource.getClassName());
-
- //set class in the context model, verify resource model modified
- ormEmbeddable.setClass("com.Bar");
- assertEquals("com.Bar", ormEmbeddable.getClass_());
- assertEquals("com.Bar", embeddableResource.getClassName());
-
- //set class to null in the context model
- ormEmbeddable.setClass(null);
- assertNull(ormEmbeddable.getClass_());
- assertNull(embeddableResource.getClassName());
- }
- //TODO add tests for setting the className when the package is set on entity-mappings
-
- public void testUpdateSpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
-
- //set access in the resource model, verify context model updated
- embeddableResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, embeddableResource.getAccess());
-
- //set access to null in the resource model
- embeddableResource.setAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
-
- //set access in the context model, verify resource model modified
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddableResource.getAccess());
-
- //set access to null in the context model
- ormPersistentType.setSpecifiedAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(embeddableResource.getAccess());
- }
- //TODO test default access from
- //underlying java
- //persistence-unit-defaults
- //entity-mappings
- //with xml-mapping-metadata-complete set
-
- public void testUpdateSpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(embeddableResource.getMetadataComplete());
-
- //set metadata-complete in the resource model, verify context model updated
- embeddableResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, embeddableResource.getMetadataComplete());
-
- //set access to false in the resource model
- embeddableResource.setMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, embeddableResource.getMetadataComplete());
-
- embeddableResource.setMetadataComplete(null);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testModifySpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(embeddableResource.getMetadataComplete());
-
- //set access in the context model, verify resource model modified
- ormEmbeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, embeddableResource.getMetadataComplete());
-
- //set access to null in the context model
- ormEmbeddable.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, embeddableResource.getMetadataComplete());
-
- ormEmbeddable.setSpecifiedMetadataComplete(null);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testUpdateDefaultMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(ormEmbeddable.isOverrideMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEmbeddable.isOverrideMetadataComplete());
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(ormEmbeddable.isOverrideMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testUpdateMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable embeddableResource = getXmlEntityMappings().getEmbeddables().get(0);
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertFalse(ormEmbeddable.isMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEmbeddable.isMetadataComplete());
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(ormEmbeddable.isMetadataComplete());
- assertNull(ormEmbeddable.getSpecifiedMetadataComplete());
- assertNull(embeddableResource.getMetadataComplete());
- }
-
- public void testMakeEmbeddableEntity() throws Exception {
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddablePersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, embeddablePersistentType.getSpecifiedAccess());
- }
-
- //test with 2 Embeddables, make the second one an Entity so it has to move to the front of the list
- public void testMakeEmbeddableEntity2() throws Exception {
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddablePersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, embeddablePersistentType.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().getPersistentTypes().iterator();
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
- public void testMakeEmbeddableMappedSuperclass() throws Exception {
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddablePersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, embeddablePersistentType.getSpecifiedAccess());
- }
-
- //test with 2 Embeddables, make the second one a MappedSuperclass so it has to move to the front of the list
- public void testMakeEmbeddableMappedSuperclass2() throws Exception {
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType embeddablePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Foo");
- OrmEmbeddable embeddable = (OrmEmbeddable) embeddablePersistentType.getMapping();
- embeddablePersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- embeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- embeddablePersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) embeddablePersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, embeddablePersistentType.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().getPersistentTypes().iterator();
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java
deleted file mode 100644
index 7ed015db80..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedIdMappingTests.java
+++ /dev/null
@@ -1,928 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddedId;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmEmbeddedIdMappingTests extends ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public OrmEmbeddedIdMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityEmbeddedIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED_ID, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @EmbeddedId");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Column(name=\"A_STATE\")").append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
-// public void testUpdateName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// assertEquals("embeddedIdMapping", xmlEmbeddedIdMapping.getName());
-// assertEquals("embeddedIdMapping", embeddedIdResource.getName());
-//
-// //set name in the resource model, verify context model updated
-// embeddedIdResource.setName("newName");
-// assertEquals("newName", xmlEmbeddedIdMapping.getName());
-// assertEquals("newName", embeddedIdResource.getName());
-//
-// //set name to null in the resource model
-// embeddedIdResource.setName(null);
-// assertNull(xmlEmbeddedIdMapping.getName());
-// assertNull(embeddedIdResource.getName());
-// }
-//
-// public void testModifyName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// assertEquals("embeddedIdMapping", xmlEmbeddedIdMapping.getName());
-// assertEquals("embeddedIdMapping", embeddedIdResource.getName());
-//
-// //set name in the context model, verify resource model updated
-// xmlEmbeddedIdMapping.setName("newName");
-// assertEquals("newName", xmlEmbeddedIdMapping.getName());
-// assertEquals("newName", embeddedIdResource.getName());
-//
-// //set name to null in the context model
-// xmlEmbeddedIdMapping.setName(null);
-// assertNull(xmlEmbeddedIdMapping.getName());
-// assertNull(embeddedIdResource.getName());
-// }
-//
-// public void testAddSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// XmlAttributeOverride attributeOverride = xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0);
-// ormResource().save(null);
-// attributeOverride.setName("FOO");
-// ormResource().save(null);
-//
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(0).getName());
-//
-// XmlAttributeOverride attributeOverride2 = xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0);
-// ormResource().save(null);
-// attributeOverride2.setName("BAR");
-// ormResource().save(null);
-//
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(1).getName());
-//
-// XmlAttributeOverride attributeOverride3 = xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(1);
-// ormResource().save(null);
-// attributeOverride3.setName("BAZ");
-// ormResource().save(null);
-//
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-//
-// ListIterator<XmlAttributeOverride> attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals(attributeOverride2, attributeOverrides.next());
-// assertEquals(attributeOverride3, attributeOverrides.next());
-// assertEquals(attributeOverride, attributeOverrides.next());
-//
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// }
-//
-// public void testRemoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0).setName("FOO");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(1).setName("BAR");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// assertEquals(3, embeddedIdResource.getAttributeOverrides().size());
-//
-// xmlEmbeddedIdMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(2, embeddedIdResource.getAttributeOverrides().size());
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
-//
-// xmlEmbeddedIdMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(1, embeddedIdResource.getAttributeOverrides().size());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(0).getName());
-//
-// xmlEmbeddedIdMapping.removeSpecifiedAttributeOverride(0);
-// assertEquals(0, embeddedIdResource.getAttributeOverrides().size());
-// }
-//
-// public void testMoveSpecifiedAttributeOverride() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(0).setName("FOO");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(1).setName("BAR");
-// xmlEmbeddedIdMapping.addSpecifiedAttributeOverride(2).setName("BAZ");
-//
-// assertEquals(3, embeddedIdResource.getAttributeOverrides().size());
-//
-//
-// xmlEmbeddedIdMapping.moveSpecifiedAttributeOverride(2, 0);
-// ListIterator<XmlAttributeOverride> attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-//
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-//
-//
-// xmlEmbeddedIdMapping.moveSpecifiedAttributeOverride(0, 1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-//
-// assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(0).getName());
-// assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(1).getName());
-// assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-// }
-//
-// public void testUpdateAttributeOverrides() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlPersistentAttribute ormPersistentAttribute = ormPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY, "embeddedIdMapping");
-// XmlEmbeddedIdMapping xmlEmbeddedIdMapping = (XmlEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-// EmbeddedId embeddedIdResource = ormResource().getEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-//
-// embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createAttributeOverride());
-// embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createAttributeOverride());
-// embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createAttributeOverride());
-//
-// embeddedIdResource.getAttributeOverrides().get(0).setName("FOO");
-// embeddedIdResource.getAttributeOverrides().get(1).setName("BAR");
-// embeddedIdResource.getAttributeOverrides().get(2).setName("BAZ");
-//
-// ListIterator<XmlAttributeOverride> attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().move(2, 0);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().move(0, 1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("BAR", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().remove(1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertEquals("FOO", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().remove(1);
-// attributeOverrides = xmlEmbeddedIdMapping.specifiedAttributeOverrides();
-// assertEquals("BAZ", attributeOverrides.next().getName());
-// assertFalse(attributeOverrides.hasNext());
-//
-// embeddedIdResource.getAttributeOverrides().remove(0);
-// assertFalse(xmlEmbeddedIdMapping.specifiedAttributeOverrides().hasNext());
-// }
-
- public void testEmbeddedIdMorphToIdMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToVersionMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToTransientMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToBasicMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToEmbeddedMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- attributeOverride = ((EmbeddedMapping) ormPersistentAttribute.getMapping()).getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("override", attributeOverride.getName());
- assertEquals("OVERRIDE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- }
-
- public void testEmbeddedIdMorphToOneToOneMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToOneToManyMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToManyToOneMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedIdMorphToManyToManyMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedIdMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedIdMapping ormEmbeddedMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- XmlEmbeddedId embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- assertEquals("id", ormEmbeddedMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedIdMapping ormEmbeddedMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- XmlEmbeddedId embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- assertEquals("id", ormEmbeddedMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedIdMapping.getAttributeOverrideContainer();
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedIdResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedIdResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedIdResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, embeddedIdResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", embeddedIdResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", embeddedIdResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedIdResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedIdMapping.getAttributeOverrideContainer();
- XmlEmbeddedId embeddedIdResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddedIds().get(0);
-
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedIdResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedIdResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedIdResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedIdResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedIdResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
-
- public void testEmbeddedMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- ormEmbeddedIdMapping.setName("foo");
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedIdMapping.getAttributeOverrideContainer();
-
- assertEquals("foo", ormEmbeddedIdMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType embeddableAddressType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Address");
-
- //embedded mapping is virtual, attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("address");
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- AttributeOverride specifiedAttributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", specifiedAttributeOverride.getName());
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
-
- JavaEmbeddedIdMapping javaEmbeddedIdMapping = (JavaEmbeddedIdMapping) ormPersistentAttribute.resolveJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaEmbeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) embeddableAddressType.getJavaPersistentType().getAttributeNamed("state").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- specifiedAttributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", specifiedAttributeOverride.getName());
- assertEquals("FOO_COLUMN", specifiedAttributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(false, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(5, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(6, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(7, specifiedAttributeOverride.getColumn().getScale());
-
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualAttributeOverride.getColumn().getSpecifiedName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("address").addToXml();
- OrmEmbeddedIdMapping ormMapping = (OrmEmbeddedIdMapping) persistentType.getAttributeNamed("address").getMapping();
- OrmAttributeOverrideContainer ormOverrideContainer = ormMapping.getAttributeOverrideContainer();
- assertEquals(4, ormOverrideContainer.getOverridesSize());
- assertEquals(4, ormOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, ormOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> ormOverrides = ormOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride ormOverride = ormOverrides.next();
- assertEquals("id", ormOverride.getName());
- ormOverride = ormOverrides.next();
- assertEquals("city", ormOverride.getName());
- assertEquals("city", ormOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, ormOverride.getColumn().getDefaultTable());
- assertEquals(null, ormOverride.getColumn().getColumnDefinition());
- assertEquals(true, ormOverride.getColumn().isInsertable());
- assertEquals(true, ormOverride.getColumn().isUpdatable());
- assertEquals(false, ormOverride.getColumn().isUnique());
- assertEquals(true, ormOverride.getColumn().isNullable());
- assertEquals(255, ormOverride.getColumn().getLength());
- assertEquals(0, ormOverride.getColumn().getPrecision());
- assertEquals(0, ormOverride.getColumn().getScale());
- ormOverride = ormOverrides.next();
- assertEquals("state", ormOverride.getName());
- assertEquals("MY_STATE_COLUMN", ormOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, ormOverride.getColumn().getDefaultTable());
- ormOverride = ormOverrides.next();
- assertEquals("zip", ormOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- ormOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, ormOverrideContainer.getOverridesSize());
- assertEquals(1, ormOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, ormOverrideContainer.getVirtualOverridesSize());
- assertEquals("id", ormOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- ormOverrides = ormOverrideContainer.getVirtualOverrides().iterator();
- ormOverride = ormOverrides.next();
- assertEquals("city", ormOverride.getName());
- ormOverride = ormOverrides.next();
- assertEquals("state", ormOverride.getName());
- ormOverride = ormOverrides.next();
- assertEquals("zip", ormOverride.getName());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- JavaEmbeddedIdMapping embeddedIdMapping = (JavaEmbeddedIdMapping) ormPersistentAttribute.getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedIdMapping.getAttributeOverrideContainer();
- assertEquals("address", embeddedIdMapping.getName());
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- AttributeOverride specifiedAttributeOverride = specifiedAttributeOverrides.next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getSpecifiedName());
-
- this.ormXmlResource.saveIfNecessary();
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- JavaVirtualColumn virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("id", virtualColumn.getName());
- assertNull(virtualColumn.getSpecifiedName());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("A_STATE", virtualColumn.getName());
- assertEquals("A_STATE", virtualColumn.getSpecifiedName());
- assertEquals("A_STATE", virtualColumn.getDefaultName());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("zip", virtualColumn.getName());
- assertNull(virtualColumn.getSpecifiedName());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertTrue(ormPersistentAttribute.isVirtual());
-
- //will be an OrmEmbeddedMapping instead of OrmEmbeddedIdMapping since that is the default
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", embeddedMapping.getName());
-
- //TODO
-// assertEquals(4, ormEmbeddedIdMapping.specifiedAttributeOverridesSize());
-// assertEquals(0, CollectionTools.size(ormEmbeddedIdMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedIdMapping.specifiedAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getSpecifiedName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getSpecifiedName());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityEmbeddedIdMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedIdMapping ormEmbeddedIdMapping = (OrmEmbeddedIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormEmbeddedIdMapping.getName());
-
- assertEquals(0, ormEmbeddedIdMapping.getAttributeOverrideContainer().getSpecifiedOverridesSize());
- //TODO
-// assertEquals(4, CollectionTools.size(ormEmbeddedIdMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedIdMapping.defaultAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getDefaultName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getDefaultName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java
deleted file mode 100644
index 21809cb787..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEmbeddedMappingTests.java
+++ /dev/null
@@ -1,948 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmEmbeddedMappingTests extends ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public OrmEmbeddedMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityEmbeddedMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @Embedded");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Column(name=\"A_STATE\")").append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
- private void createTestEntityCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Customer").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress2() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("id", ormEmbeddedMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("id", ormEmbeddedMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, embeddedResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
-
- public void testEmbeddedMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- ormEmbeddedMapping.setName("foo");
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
-
- assertEquals("foo", ormEmbeddedMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Address");
-
- //embedded mapping is virtual, Java attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("address");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- AttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
- JavaEmbeddedMapping javaEmbeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaEmbeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType2.getJavaPersistentType().getAttributeNamed("state").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- embeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getMapping();
- attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", attributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, attributeOverride.getColumn().isInsertable());
- assertEquals(false, attributeOverride.getColumn().isUpdatable());
- assertEquals(true, attributeOverride.getColumn().isUnique());
- assertEquals(false, attributeOverride.getColumn().isNullable());
- assertEquals(5, attributeOverride.getColumn().getLength());
- assertEquals(6, attributeOverride.getColumn().getPrecision());
- assertEquals(7, attributeOverride.getColumn().getScale());
-
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualOverride.getColumn().getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("address").addToXml();
- OrmEmbeddedMapping ormMapping = (OrmEmbeddedMapping) persistentType.getAttributeNamed("address").getMapping();
- OrmAttributeOverrideContainer ormOverrideContainer = ormMapping.getAttributeOverrideContainer();
- assertEquals(4, ormOverrideContainer.getOverridesSize());
- assertEquals(4, ormOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, ormOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> ormVirtualAttributeOverrides = ormOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("id", ormVirtualOverride.getName());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("city", ormVirtualOverride.getName());
- assertEquals("city", ormVirtualOverride.getColumn().getName());
- assertEquals(TYPE_NAME, ormVirtualOverride.getColumn().getTable());
- assertEquals(null, ormVirtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, ormVirtualOverride.getColumn().isInsertable());
- assertEquals(true, ormVirtualOverride.getColumn().isUpdatable());
- assertEquals(false, ormVirtualOverride.getColumn().isUnique());
- assertEquals(true, ormVirtualOverride.getColumn().isNullable());
- assertEquals(255, ormVirtualOverride.getColumn().getLength());
- assertEquals(0, ormVirtualOverride.getColumn().getPrecision());
- assertEquals(0, ormVirtualOverride.getColumn().getScale());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("state", ormVirtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", ormVirtualOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, ormVirtualOverride.getColumn().getDefaultTable());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("zip", ormVirtualOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- ormOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, ormOverrideContainer.getOverridesSize());
- assertEquals(1, ormOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, ormOverrideContainer.getVirtualOverridesSize());
- assertEquals("id", ormOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- ormVirtualAttributeOverrides = ormOverrideContainer.getVirtualOverrides().iterator();
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("city", ormVirtualOverride.getName());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("state", ormVirtualOverride.getName());
- ormVirtualOverride = ormVirtualAttributeOverrides.next();
- assertEquals("zip", ormVirtualOverride.getName());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals("address", embeddedMapping.getName());
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- JavaAttributeOverride specifiedAttributeOverride = specifiedAttributeOverrides.next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, specifiedAttributeOverride.getName());
- Column column = specifiedAttributeOverride.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getSpecifiedName());
-
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- VirtualColumn virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("id", virtualColumn.getName());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("A_STATE", virtualColumn.getName());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualColumn = virtualAttributeOverride.getColumn();
- assertEquals("zip", virtualColumn.getName());
-
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", embeddedMapping.getName());
-
- //TODO
-// assertEquals(4, ormEmbeddedMapping.specifiedAttributeOverridesSize());
-// assertEquals(0, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getSpecifiedName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getSpecifiedName());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormEmbeddedMapping.getName());
-
- assertEquals(0, ormEmbeddedMapping.getAttributeOverrideContainer().getSpecifiedOverridesSize());
- //TODO
-// assertEquals(4, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.defaultAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getDefaultName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getDefaultName());
- }
-
-
- public void testEmbeddedMorphToIdMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToVersionMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToTransientMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToBasicMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- attributeOverride = ((EmbeddedIdMapping) ormPersistentAttribute.getMapping()).getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("override", attributeOverride.getName());
- assertEquals("OVERRIDE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- }
-
- public void testEmbeddedMorphToOneToOneMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToOneToManyMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToOneMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToManyMapping() throws Exception {
- createTestEntityEmbeddedMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- //1.0 projects do not support dot-notation, this tests to make sure that support does not exist
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityCustomer();
- createTestEmbeddableAddress2();
- createTestEmbeddableZipCode();
-
- OrmPersistentType customerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- customerPersistentType.getAttributeNamed("address").addToXml();
- OrmEmbeddedMapping embeddedMapping = (OrmEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- assertEquals(false, virtualAttributeOverrides.hasNext());
-
- addressPersistentType.getAttributeNamed("zipCode").addToXml();
- OrmEmbeddedMapping nestedEmbeddedMapping = (OrmEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping();
- OrmAttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("plusfour", virtualAttributeOverride.getName());
-
- zipCodePersistentType.getAttributeNamed("plusfour").addToXml();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.zipCode) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) ((OrmEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour");
- assertEquals("plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //check the top-level embedded (Customer.address) attribute override to verify there is no attribute override named zipCode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) ((OrmEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java
deleted file mode 100644
index dc697f1239..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmEntityTests.java
+++ /dev/null
@@ -1,2803 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.IdClassReference;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlySecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualSecondaryTable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmEntityTests extends ContextModelTestCase
-{
- protected static final String CHILD_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_CHILD_TYPE_NAME = PACKAGE_NAME + "." + CHILD_TYPE_NAME;
-
-
- public OrmEntityTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityDefaultFieldAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityFieldAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityPropertyAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append(CHILD_TYPE_NAME).append(" ");
- sb.append("extends ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestSubTypeUnmapped() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append(CHILD_TYPE_NAME).append(" ");
- sb.append("extends ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.MAPPED_SUPERCLASS,
- JPA.BASIC,
- JPA.VERSION,
- JPA.TRANSIENT,
- JPA.EMBEDDED,
- JPA.EMBEDDED_ID,
- JPA.ONE_TO_ONE,
- JPA.ONE_TO_MANY,
- JPA.MANY_TO_ONE,
- JPA.MANY_TO_MANY,
- JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @Basic");
- sb.append(CR);
- sb.append(" private int basic;").append(CR);
- sb.append(CR);
- sb.append(" @Version");
- sb.append(CR);
- sb.append(" private int version;").append(CR);
- sb.append(CR);
- sb.append(" @Transient");
- sb.append(CR);
- sb.append(" private int transient;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded");
- sb.append(CR);
- sb.append(" private int embedded;").append(CR);
- sb.append(CR);
- sb.append(" @EmbeddedId");
- sb.append(CR);
- sb.append(" private int embeddedId;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private " + CHILD_TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int oneToMany;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int manyToOne;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int manyToMany;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestAbstractType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public abstract class ").append(TYPE_NAME).append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, FILE_NAME, sourceWriter);
- }
-
- private ICompilationUnit createAbstractTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- sb.append("abstract");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestIdClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append("TestTypeId").append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "TestTypeId.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
-
- //set name in the resource model, verify context model updated
- entityResource.setName("foo");
- assertEquals("foo", ormEntity.getSpecifiedName());
- assertEquals("foo", entityResource.getName());
-
- //set name to null in the resource model
- entityResource.setName(null);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
-
- //set name in the context model, verify resource model modified
- ormEntity.setSpecifiedName("foo");
- assertEquals("foo", ormEntity.getSpecifiedName());
- assertEquals("foo", entityResource.getName());
-
- //set name to null in the context model
- ormEntity.setSpecifiedName(null);
- assertNull(ormEntity.getSpecifiedName());
- assertNull(entityResource.getName());
- }
-
- public void testUpdateDefaultName() throws Exception {
- createTestEntityFieldAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(TYPE_NAME, ormEntity.getDefaultName());
-
- ormEntity.getJavaTypeMapping().setSpecifiedName("Foo");
- //xml default entity name comes from java
- assertEquals("Foo", ormEntity.getDefaultName());
-
- //set class in the resource model, verify context model updated
- entityResource.setClassName("com.Bar");
- assertEquals("Bar", ormEntity.getDefaultName());
-
- //set class to null in the resource model
- entityResource.setClassName(null);
- assertNull(ormEntity.getDefaultName());
-
- entityResource.setClassName(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals("Foo", ormEntity.getDefaultName());
- entityResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME, ormEntity.getDefaultName());
-
- ormEntity.getJavaTypeMapping().setSpecifiedName("Foo1");
- assertEquals(TYPE_NAME, ormEntity.getDefaultName());
-
- entityResource.setMetadataComplete(null);
- assertEquals("Foo1", ormEntity.getDefaultName());
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals("Foo", ormEntity.getName());
-
- //set class in the resource model, verify context model updated
- entityResource.setClassName("com.Bar");
- assertEquals("Bar", ormEntity.getName());
-
- entityResource.setName("Baz");
- assertEquals("Baz", ormEntity.getName());
-
- //set class to null in the resource model
- entityResource.setClassName(null);
- assertEquals("Baz", ormEntity.getName());
-
- entityResource.setName(null);
- assertNull(ormEntity.getName());
- }
-
- public void testUpdateClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals("model.Foo", entityResource.getClassName());
-
- //set class in the resource model, verify context model updated
- entityResource.setClassName("com.Bar");
- assertEquals("com.Bar", ormEntity.getClass_());
- assertEquals("com.Bar", entityResource.getClassName());
-
- //set class to null in the resource model
- entityResource.setClassName(null);
- assertNull(ormEntity.getClass_());
- assertNull(entityResource.getClassName());
- }
-
- public void testModifyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals("model.Foo", entityResource.getClassName());
-
- //set class in the context model, verify resource model modified
- ormEntity.setClass("com.Bar");
- assertEquals("com.Bar", ormEntity.getClass_());
- assertEquals("com.Bar", entityResource.getClassName());
-
- //set class to null in the context model
- ormEntity.setClass(null);
- assertNull(ormEntity.getClass_());
- assertNull(entityResource.getClassName());
- }
- //TODO add tests for setting the className when the package is set on entity-mappings
-
- public void testUpdateSpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- //set access in the resource model, verify context model updated
- entityResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, entityResource.getAccess());
-
- //set access to null in the resource model
- entityResource.setAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- //set access in the context model, verify resource model modified
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entityResource.getAccess());
-
- //set access to null in the context model
- ormPersistentType.setSpecifiedAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
- }
-
- public void testUpdateDefaultAccessFromPersistenceUnitDefaults() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- assertNull(entityResource.getAccess());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(entityResource.getAccess());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- assertNull(entityResource.getAccess());
- }
-
- public void testUpdateDefaultAccessFromJava() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- //java has no annotations, defaultAccess in xml is FIELD anyway
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- //entityMappings access wins over persistence-unit-defaults access
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().setSpecifiedAccess(null);
- //persistence-unit-defaults access used now
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(null);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- //java has annotations on fields now, that should win in all cases
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().setSpecifiedAccess(AccessType.PROPERTY);
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
- }
-
- public void testUpdateDefaultAccessFromJavaFieldAccess() throws Exception {
- createTestEntityFieldAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- }
-
- public void testUpdateDefaultAccessFromJavaPropertyAccess() throws Exception {
- createTestEntityPropertyAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
- }
-
- public void testUpdateDefaultAccessNoUnderlyingJava() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- }
-
- public void testUpdateSpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- //set metadata-complete in the resource model, verify context model updated
- entityResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, entityResource.getMetadataComplete());
-
- //set access to false in the resource model
- entityResource.setMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, entityResource.getMetadataComplete());
-
- entityResource.setMetadataComplete(null);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
- }
-
- public void testModifySpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- //set access in the context model, verify resource model modified
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertTrue(ormEntity.getSpecifiedMetadataComplete().booleanValue());
- assertTrue(entityResource.getMetadataComplete().booleanValue());
-
- //set access to null in the context model
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertFalse(ormEntity.getSpecifiedMetadataComplete().booleanValue());
- assertFalse(entityResource.getMetadataComplete().booleanValue());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
- }
-
- public void testUpdateDefaultMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertFalse(ormEntity.isOverrideMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEntity.isOverrideMetadataComplete());
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertFalse(ormEntity.isOverrideMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormEntity.getSpecifiedMetadataComplete());
- assertTrue(ormEntity.isOverrideMetadataComplete());
- assertTrue(ormEntity.isMetadataComplete());
- }
-
- public void testUpdateMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertFalse(ormEntity.isMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormEntity.isMetadataComplete());
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(ormEntity.isMetadataComplete());
- assertNull(ormEntity.getSpecifiedMetadataComplete());
- assertNull(entityResource.getMetadataComplete());
- }
-
-
- public void testUpdateInheritanceStrategy() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getInheritanceStrategy());
- assertNull(entityResource.getInheritance());
-
- //set inheritance strategy in the resource model, verify context model updated
- entityResource.setInheritance(OrmFactory.eINSTANCE.createInheritance());
- entityResource.getInheritance().setStrategy(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.TABLE_PER_CLASS);
-
- assertEquals(InheritanceType.TABLE_PER_CLASS, ormEntity.getInheritanceStrategy());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.TABLE_PER_CLASS, entityResource.getInheritance().getStrategy());
- }
-
- public void testUpdateDefaultInheritanceStrategyFromJava() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- //no inheritance strategy specified in java so single-table is default
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.getJavaTypeMapping().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- //inheritance tag exists in xml, so it overrides anything in java
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedInheritanceStrategy(null);
- assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(InheritanceType.JOINED, ormEntity.getDefaultInheritanceStrategy());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //this setting overrides the false meta-data complete found on ormEntity
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getDefaultInheritanceStrategy());
- }
-
- public void testUpdateDefaultInheritanceStrategyFromParent() throws Exception {
- createTestEntityDefaultFieldAccess();
- createTestSubType();
-
- OrmPersistentType superPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType subPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) superPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) subPersistentType.getMapping();
-
- assertEquals(parentXmlEntity, childXmlEntity.getParentEntity());
- assertEquals(InheritanceType.SINGLE_TABLE, childXmlEntity.getDefaultInheritanceStrategy());
-
- //change root inheritance strategy, verify default is changed for child entity
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertEquals(InheritanceType.SINGLE_TABLE, parentXmlEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, childXmlEntity.getDefaultInheritanceStrategy());
- assertNull(childXmlEntity.getSpecifiedInheritanceStrategy());
-
- //set specified inheritance strategy in java and verify defaults in xml are correct
- parentXmlEntity.setSpecifiedInheritanceStrategy(null);
- parentXmlEntity.getJavaTypeMapping().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(InheritanceType.JOINED, parentXmlEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.JOINED, childXmlEntity.getDefaultInheritanceStrategy());
- assertNull(parentXmlEntity.getSpecifiedInheritanceStrategy());
- assertNull(childXmlEntity.getSpecifiedInheritanceStrategy());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(InheritanceType.SINGLE_TABLE, parentXmlEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.SINGLE_TABLE, childXmlEntity.getDefaultInheritanceStrategy());
- }
-
- public void testUpdateSpecifiedInheritanceStrategy() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
-
- //set strategy in the resource model, verify context model updated
- entityResource.setInheritance(OrmFactory.eINSTANCE.createInheritance());
- entityResource.getInheritance().setStrategy(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.JOINED);
- assertEquals(InheritanceType.JOINED, ormEntity.getSpecifiedInheritanceStrategy());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.JOINED, entityResource.getInheritance().getStrategy());
-
- //set strategy to null in the resource model
- entityResource.getInheritance().setStrategy(null);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance().getStrategy());
-
- entityResource.getInheritance().setStrategy(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.SINGLE_TABLE);
- assertEquals(InheritanceType.SINGLE_TABLE, ormEntity.getSpecifiedInheritanceStrategy());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.SINGLE_TABLE, entityResource.getInheritance().getStrategy());
-
- entityResource.setInheritance(null);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
- }
-
- public void testModifySpecifiedInheritanceStrategy() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
-
- //set strategy in the context model, verify resource model modified
- ormEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertEquals(InheritanceType.TABLE_PER_CLASS, ormEntity.getSpecifiedInheritanceStrategy());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.InheritanceType.TABLE_PER_CLASS, entityResource.getInheritance().getStrategy());
-
- //set strategy to null in the context model
- ormEntity.setSpecifiedInheritanceStrategy(null);
- assertNull(ormEntity.getSpecifiedInheritanceStrategy());
- assertNull(entityResource.getInheritance());
- }
-
- public void testAddSpecifiedSecondaryTable() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedName("FOO");
-
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getName());
-
- OrmSecondaryTable secondaryTable2 = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable2.setSpecifiedName("BAR");
-
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(1).getName());
-
- OrmSecondaryTable secondaryTable3 = ormEntity.addSpecifiedSecondaryTable(1);
- secondaryTable3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(1).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(2).getName());
-
- ListIterator<OrmSecondaryTable> secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals(secondaryTable2, secondaryTables.next());
- assertEquals(secondaryTable3, secondaryTables.next());
- assertEquals(secondaryTable, secondaryTables.next());
-
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- }
-
- public void testRemoveSpecifiedSecondaryTable() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getSecondaryTables().size());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(2, entityResource.getSecondaryTables().size());
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(1).getName());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(1, entityResource.getSecondaryTables().size());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(0).getName());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testMoveSpecifiedSecondaryTable() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedSecondaryTable(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedSecondaryTable(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getSecondaryTables().size());
-
-
- ormEntity.moveSpecifiedSecondaryTable(2, 0);
- ListIterator<OrmSecondaryTable> secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
-
- assertEquals("BAR", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAZ", entityResource.getSecondaryTables().get(1).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(2).getName());
-
-
- ormEntity.moveSpecifiedSecondaryTable(0, 1);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
-
- assertEquals("BAZ", entityResource.getSecondaryTables().get(0).getName());
- assertEquals("BAR", entityResource.getSecondaryTables().get(1).getName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(2).getName());
- }
-
- public void testUpdateSecondaryTables() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
-
- entityResource.getSecondaryTables().get(0).setName("FOO");
- entityResource.getSecondaryTables().get(1).setName("BAR");
- entityResource.getSecondaryTables().get(2).setName("BAZ");
-
- ListIterator<OrmSecondaryTable> secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().move(2, 0);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().move(0, 1);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().remove(1);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().remove(1);
- secondaryTables = ormEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAZ", secondaryTables.next().getName());
- assertFalse(secondaryTables.hasNext());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- }
-
- public void testVirtualSecondaryTables() throws Exception {
- createTestEntityFieldAccess();
- createTestSubType();
-
- OrmPersistentType superPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType subPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentOrmEntity = (OrmEntity) superPersistentType.getMapping();
- OrmEntity childOrmEntity = (OrmEntity) subPersistentType.getMapping();
- JavaEntity javaEntity = childOrmEntity.getJavaTypeMapping();
-
- JavaSecondaryTable javaSecondaryTableFoo = javaEntity.addSpecifiedSecondaryTable(0);
- javaSecondaryTableFoo.setSpecifiedName("FOO");
- OrmVirtualSecondaryTable virtualSecondaryTableFoo = childOrmEntity.getVirtualSecondaryTables().iterator().next();
- assertEquals("FOO", childOrmEntity.getSecondaryTables().iterator().next().getName());
- assertEquals("FOO", virtualSecondaryTableFoo.getName());
- assertEquals(0, virtualSecondaryTableFoo.getSpecifiedPrimaryKeyJoinColumnsSize());
- assertEquals("id", virtualSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultName());
- assertEquals("id", virtualSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultReferencedColumnName());
-
- assertEquals(0, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(1, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(1, childOrmEntity.getSecondaryTablesSize());
-
- javaEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
- ListIterator<OrmVirtualSecondaryTable> virtualSecondaryTables = childOrmEntity.getVirtualSecondaryTables().iterator();
- ListIterator<ReadOnlySecondaryTable> secondaryTables = childOrmEntity.getSecondaryTables().iterator();
- assertEquals("BAR", virtualSecondaryTables.next().getName());
- assertEquals("FOO", virtualSecondaryTables.next().getName());
- assertEquals("BAR", secondaryTables.next().getName());
- assertEquals("FOO", secondaryTables.next().getName());
- assertEquals(0, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getSecondaryTablesSize());
-
- childOrmEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(0, childOrmEntity.getVirtualSecondaryTablesSize());
-
- childOrmEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(2, childOrmEntity.getVirtualSecondaryTablesSize());
-
-
- childOrmEntity.setSecondaryTablesAreDefinedInXml(true);
- assertEquals(0, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getSecondaryTablesSize());
- ListIterator<OrmSecondaryTable> specifiedSecondaryTables = childOrmEntity.getSpecifiedSecondaryTables().iterator();
- assertEquals("BAR", specifiedSecondaryTables.next().getName());
- OrmSecondaryTable specifiedSecondaryTableFoo = specifiedSecondaryTables.next();
- assertEquals("FOO", specifiedSecondaryTableFoo.getName());
- assertEquals(0, specifiedSecondaryTableFoo.getSpecifiedPrimaryKeyJoinColumnsSize());
- assertEquals("id", specifiedSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultName());
- assertEquals("id", specifiedSecondaryTableFoo.getDefaultPrimaryKeyJoinColumn().getDefaultReferencedColumnName());
-
-
- childOrmEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(0, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(1, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(1, childOrmEntity.getSecondaryTablesSize());
- assertEquals("FOO", childOrmEntity.getSpecifiedSecondaryTables().iterator().next().getName());
-
-
- childOrmEntity.removeSpecifiedSecondaryTable(0);
- assertEquals(0, childOrmEntity.getSpecifiedSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getVirtualSecondaryTablesSize());
- assertEquals(2, childOrmEntity.getSecondaryTablesSize());
- virtualSecondaryTables = childOrmEntity.getVirtualSecondaryTables().iterator();
- assertEquals("BAR", virtualSecondaryTables.next().getName());
- assertEquals("FOO", virtualSecondaryTables.next().getName());
-
-
- //add a specified secondary table to the parent, this will not affect virtual secondaryTables in child
- parentOrmEntity.addSpecifiedSecondaryTable(0).setSpecifiedName("PARENT_TABLE");
- assertEquals(2, childOrmEntity.getVirtualSecondaryTablesSize());
- }
-
- public void testAssociatedTables() throws Exception {
- createTestEntityFieldAccess();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- assertEquals(1, CollectionTools.size(entity.getAssociatedTables()));
-
- entity.addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
- assertEquals(2, CollectionTools.size(entity.getAssociatedTables()));
-
- entity.addSpecifiedSecondaryTable(0).setSpecifiedName("BAR");
- assertEquals(3, CollectionTools.size(entity.getAssociatedTables()));
- }
-
- public void testAssociatedTableNamesIncludingInherited() throws Exception {
- // TODO
- }
-
- public void testTableNameIsInvalid() throws Exception {
- // TODO
- }
-
- public void testMakeEntityEmbeddable() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-
- entityPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, entityPersistentType.getSpecifiedAccess());
- }
-
- //TODO test that attribute mappings are not removed when changing type mapping.
- public void testMakeEntityEmbeddable2() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-// entityPersistentType.addSpecifiedPersistentAttribute(IMappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "basicMapping");
-
- entityPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-// assertEquals("basicMapping", embeddable.getAttributes().getBasics().get(0).getName());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, entityPersistentType.getSpecifiedAccess());
-// assertEquals("basicMapping", ormEmbeddable.persistentType().attributes().next().getName());
- }
-
- public void testMakeEntityMappedSuperclass() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-
- entityPersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, entityPersistentType.getSpecifiedAccess());
- }
-
- public void testMakeEntityMappedSuperclass2() throws Exception {
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo2");
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity entity = (OrmEntity) entityPersistentType.getMapping();
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- entity.setSpecifiedDiscriminatorValue("DISC_VALUE");
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- entity.setSpecifiedName("ENTITY_NAME");
-
- entityPersistentType.setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
-
- XmlMappedSuperclass mappedSuperclass = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", mappedSuperclass.getClassName());
- assertEquals(Boolean.TRUE, mappedSuperclass.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclass.getAccess());
-
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) entityPersistentType.getMapping();
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, entityPersistentType.getSpecifiedAccess());
- }
-
-
- public void testAddSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
-
- ormEntity.getGeneratorContainer().addSequenceGenerator();
-
- assertNotNull(entityResource.getSequenceGenerator());
- assertNotNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- ormEntity.getGeneratorContainer().addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
-
- ormEntity.getGeneratorContainer().addSequenceGenerator();
- assertNotNull(entityResource.getSequenceGenerator());
- assertNotNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
-
- ormEntity.getGeneratorContainer().removeSequenceGenerator();
-
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- ormEntity.getGeneratorContainer().removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateSequenceGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
- assertEquals(0, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- entityResource.setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGenerator());
-
- assertNotNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNotNull(entityResource.getSequenceGenerator());
- assertEquals(1, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- ormEntity.getGeneratorContainer().getSequenceGenerator().setName("foo");
- assertEquals(1, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- entityResource.setSequenceGenerator(null);
- assertNull(ormEntity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entityResource.getSequenceGenerator());
- assertEquals(0, ormEntity.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
-
- ormEntity.getGeneratorContainer().addTableGenerator();
-
- assertNotNull(entityResource.getTableGenerator());
- assertNotNull(ormEntity.getGeneratorContainer().getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- ormEntity.getGeneratorContainer().addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
-
- ormEntity.getGeneratorContainer().addTableGenerator();
- assertNotNull(entityResource.getTableGenerator());
- assertNotNull(ormEntity.getGeneratorContainer().getTableGenerator());
-
- ormEntity.getGeneratorContainer().removeTableGenerator();
-
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- ormEntity.getGeneratorContainer().removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateTableGenerator() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
- assertEquals(0, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- entityResource.setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGenerator());
-
- assertNotNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNotNull(entityResource.getTableGenerator());
- assertEquals(1, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- ormEntity.getGeneratorContainer().getTableGenerator().setName("foo");
- assertEquals(1, ormEntity.getPersistenceUnit().getGeneratorsSize());
-
- entityResource.setTableGenerator(null);
- assertNull(ormEntity.getGeneratorContainer().getTableGenerator());
- assertNull(entityResource.getTableGenerator());
- assertEquals(0, ormEntity.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testUpdateDiscriminatorColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNotNull(ormEntity.getDiscriminatorColumn());
-
- entityResource.setDiscriminatorColumn(OrmFactory.eINSTANCE.createXmlDiscriminatorColumn());
- entityResource.getDiscriminatorColumn().setName("FOO");
-
- assertEquals("FOO", ormEntity.getDiscriminatorColumn().getSpecifiedName());
- assertEquals("FOO", entityResource.getDiscriminatorColumn().getName());
-
- entityResource.getDiscriminatorColumn().setName(null);
-
- assertNull(ormEntity.getDiscriminatorColumn().getSpecifiedName());
- assertNull(entityResource.getDiscriminatorColumn().getName());
-
- entityResource.setDiscriminatorColumn(null);
-
- assertNotNull(ormEntity.getDiscriminatorColumn());
- }
-
- public void testUpdateDiscriminatorValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
-
- entityResource.setDiscriminatorValue("FOO");
-
- assertEquals("FOO", ormEntity.getSpecifiedDiscriminatorValue());
- assertEquals("FOO", entityResource.getDiscriminatorValue());
-
- entityResource.setDiscriminatorValue(null);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
- }
-
- public void testModifyDiscriminatorValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
-
- ormEntity.setSpecifiedDiscriminatorValue("FOO");
-
- assertEquals("FOO", ormEntity.getSpecifiedDiscriminatorValue());
- assertEquals("FOO", entityResource.getDiscriminatorValue());
-
- ormEntity.setSpecifiedDiscriminatorValue(null);
-
- assertNull(ormEntity.getSpecifiedDiscriminatorValue());
- assertNull(entityResource.getDiscriminatorValue());
- }
-
- public void testGetDefaultDiscriminatorValue() throws Exception {
- createTestEntityFieldAccess();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- JavaEntity javaEntity = (JavaEntity) persistentType.getJavaPersistentType().getMapping();
- assertEquals(null, ormEntity.getDefaultDiscriminatorValue());
-
- createTestSubType();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- assertEquals(ormEntity.getName(), ormEntity.getDefaultDiscriminatorValue());
-
- javaEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(DiscriminatorType.INTEGER);
- assertNull(ormEntity.getDefaultDiscriminatorValue());
-
- javaEntity.getDiscriminatorColumn().setSpecifiedDiscriminatorType(null);
- javaEntity.setSpecifiedDiscriminatorValue("FOO");
-
- assertEquals("FOO", ormEntity.getDefaultDiscriminatorValue());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(ormEntity.getName(), ormEntity.getDefaultDiscriminatorValue());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn2 = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn3 = ormEntity.addSpecifiedPrimaryKeyJoinColumn(1);
- primaryKeyJoinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(2).getName());
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals(primaryKeyJoinColumn2, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn3, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn, primaryKeyJoinColumns.next());
-
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getPrimaryKeyJoinColumns().size());
-
- ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(2, entityResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(1, entityResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- ormEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(0, entityResource.getPrimaryKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormEntity.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getPrimaryKeyJoinColumns().size());
-
-
- ormEntity.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(2).getName());
-
-
- ormEntity.moveSpecifiedPrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAZ", entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAR", entityResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", entityResource.getPrimaryKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdatePrimaryKeyJoinColumns() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- entityResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
-
- entityResource.getPrimaryKeyJoinColumns().get(0).setName("FOO");
- entityResource.getPrimaryKeyJoinColumns().get(1).setName("BAR");
- entityResource.getPrimaryKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().move(2, 0);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().move(0, 1);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- }
-
- public void testDefaultPrimaryKeyJoinColumns() throws Exception {
- createTestType();
- createTestSubTypeUnmapped();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- persistentType.getAttributeNamed("id").addToXml(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- ((OrmEntity) persistentType.getMapping()).setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
-
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
-
- OrmPrimaryKeyJoinColumn specifiedPkJoinColumn = childEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- specifiedPkJoinColumn.setSpecifiedName("FOO");
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName("BAR");
-
- assertFalse(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
-
- //remove the pkJoinColumn from the context mode, verify context model has a default pkJoinColumn
- childEntity.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
-
-
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- specifiedPkJoinColumn = childEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- specifiedPkJoinColumn.setSpecifiedName("FOO");
- specifiedPkJoinColumn.setSpecifiedReferencedColumnName("BAR");
- assertFalse(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- //now remove the pkJoinColumn from the resource model, verify context model updates and has a default pkJoinColumn
- childEntity.getXmlTypeMapping().getPrimaryKeyJoinColumns().remove(0);
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
- }
-
- public void testDefaultPrimaryKeyJoinColumnsFromJava() throws Exception {
- createTestEntityFieldAccess();
- createTestSubType();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
-
-
- ((JavaEntity) persistentType.getJavaPersistentType().getMapping()).setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-
- OrmEntity childEntity = (OrmEntity) childPersistentType.getMapping();
-
- assertTrue(childEntity.getDefaultPrimaryKeyJoinColumns().iterator().hasNext());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultName());
- assertEquals("id", childEntity.getDefaultPrimaryKeyJoinColumns().iterator().next().getDefaultReferencedColumnName());
-
- JavaEntity javaEntity = (JavaEntity) childPersistentType.getJavaPersistentType().getMapping();
- JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn = javaEntity.addSpecifiedPrimaryKeyJoinColumn(0);
- javaPrimaryKeyJoinColumn.setSpecifiedName("FOO");
- javaPrimaryKeyJoinColumn.setSpecifiedReferencedColumnName("BAR");
-
- JavaPrimaryKeyJoinColumn javaPrimaryKeyJoinColumn2 = javaEntity.addSpecifiedPrimaryKeyJoinColumn(1);
- javaPrimaryKeyJoinColumn2.setSpecifiedName("FOO2");
- javaPrimaryKeyJoinColumn2.setSpecifiedReferencedColumnName("BAR2");
-
- childPersistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- ListIterator<ReadOnlyPrimaryKeyJoinColumn> defaultPrimaryKeyJoinColumns = childEntity.getDefaultPrimaryKeyJoinColumns().iterator();
- ReadOnlyPrimaryKeyJoinColumn defaultPrimaryKeyJoinColumn = defaultPrimaryKeyJoinColumns.next();
- assertEquals("FOO", defaultPrimaryKeyJoinColumn.getName());
- assertEquals("BAR", defaultPrimaryKeyJoinColumn.getReferencedColumnName());
-
- defaultPrimaryKeyJoinColumn = defaultPrimaryKeyJoinColumns.next();
- assertEquals("FOO2", defaultPrimaryKeyJoinColumn.getName());
- assertEquals("BAR2", defaultPrimaryKeyJoinColumn.getReferencedColumnName());
- assertFalse(defaultPrimaryKeyJoinColumns.hasNext());
-
- childEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- defaultPrimaryKeyJoinColumns = childEntity.getDefaultPrimaryKeyJoinColumns().iterator();
- defaultPrimaryKeyJoinColumn = defaultPrimaryKeyJoinColumns.next();
- assertEquals("id", defaultPrimaryKeyJoinColumn.getDefaultName());
- assertEquals("id", defaultPrimaryKeyJoinColumn.getDefaultReferencedColumnName());
-
- assertFalse(defaultPrimaryKeyJoinColumns.hasNext());
-
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAttributeOverrides().get(2).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualOverride.getName());
- assertEquals("name", virtualOverride.getColumn().getName());
- assertEquals(CHILD_TYPE_NAME, virtualOverride.getColumn().getTable());
- assertEquals(null, virtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualOverride.getColumn().isInsertable());
- assertEquals(true, virtualOverride.getColumn().isUpdatable());
- assertEquals(false, virtualOverride.getColumn().isUnique());
- assertEquals(true, virtualOverride.getColumn().isNullable());
- assertEquals(255, virtualOverride.getColumn().getLength());
- assertEquals(0, virtualOverride.getColumn().getPrecision());
- assertEquals(0, virtualOverride.getColumn().getScale());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualOverride.getName());
-
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualOverride.getName());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- entity.setSpecifiedMetadataComplete(Boolean.FALSE);
- entity.getJavaTypeMapping().getAttributeOverrideContainer().getVirtualOverrides().iterator().next().convertToSpecified();
- JavaColumn javaColumn = entity.getJavaTypeMapping().getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
- javaColumn.setSpecifiedName("FOO");
- javaColumn.setSpecifiedTable("BAR");
- javaColumn.setColumnDefinition("COLUMN_DEF");
- javaColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaColumn.setSpecifiedUnique(Boolean.TRUE);
- javaColumn.setSpecifiedNullable(Boolean.FALSE);
- javaColumn.setSpecifiedLength(Integer.valueOf(7));
- javaColumn.setSpecifiedPrecision(Integer.valueOf(8));
- javaColumn.setSpecifiedScale(Integer.valueOf(9));
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualOverride.getName());
- assertEquals("FOO", virtualOverride.getColumn().getSpecifiedName());
- assertEquals("FOO", virtualOverride.getColumn().getDefaultName());
- assertEquals("BAR", virtualOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", virtualOverride.getColumn().getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, virtualOverride.getColumn().getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedNullable());
- assertEquals(Integer.valueOf(7), virtualOverride.getColumn().getSpecifiedLength());
- assertEquals(Integer.valueOf(8), virtualOverride.getColumn().getSpecifiedPrecision());
- assertEquals(Integer.valueOf(9), virtualOverride.getColumn().getSpecifiedScale());
-
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- assertNull(virtualOverride.getColumn().getSpecifiedName());
- assertEquals("basic", virtualOverride.getColumn().getDefaultName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualOverride.getName());
-
- persistentType2.getAttributeNamed("basic").addToXml();
- OrmBasicMapping basicMapping = (OrmBasicMapping) persistentType2.getAttributeNamed("basic").getMapping();
- basicMapping.getColumn().setSpecifiedName("MY_NAME");
- basicMapping.getColumn().setSpecifiedTable("BAR");
- basicMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- basicMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- basicMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- basicMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- basicMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- basicMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- basicMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- basicMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
-
-
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualOverride.getName());
- assertEquals("FOO", virtualOverride.getColumn().getSpecifiedName());//TODO specified or default?
- assertEquals("BAR", virtualOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", virtualOverride.getColumn().getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, virtualOverride.getColumn().getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualOverride.getColumn().getSpecifiedNullable());
- assertEquals(Integer.valueOf(7), virtualOverride.getColumn().getSpecifiedLength());
- assertEquals(Integer.valueOf(8), virtualOverride.getColumn().getSpecifiedPrecision());
- assertEquals(Integer.valueOf(9), virtualOverride.getColumn().getSpecifiedScale());
-
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("basic", virtualOverride.getName());
- assertEquals("MY_NAME", virtualOverride.getColumn().getSpecifiedName());
- assertEquals("BAR", virtualOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", virtualOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualOverride.getColumn().isInsertable());
- assertEquals(false, virtualOverride.getColumn().isUpdatable());
- assertEquals(true, virtualOverride.getColumn().isUnique());
- assertEquals(false, virtualOverride.getColumn().isNullable());
- assertEquals(5, virtualOverride.getColumn().getLength());
- assertEquals(6, virtualOverride.getColumn().getPrecision());
- assertEquals(7, virtualOverride.getColumn().getScale());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("version", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- }
-
- public void testVirtualAttributeOverridesNoJavaEntity() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- persistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(5, overrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride attributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("basic", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("version", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", attributeOverride.getName());
- }
-
- public void testAttributeOverrideColumnDefaults() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- OrmAttributeOverride attributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("foo", attributeOverride.getColumn().getDefaultName());
- assertEquals(CHILD_TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
-
- ((JavaEntity) persistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals("foo", attributeOverride.getColumn().getDefaultName());
- assertEquals("FOO", attributeOverride.getColumn().getDefaultTable());
-
- entity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals("foo", attributeOverride.getColumn().getDefaultName());
- assertEquals(CHILD_TYPE_NAME, attributeOverride.getColumn().getDefaultTable());
-
- entity.setSpecifiedMetadataComplete(Boolean.FALSE);
- entity.getTable().setSpecifiedName("BAR");
- assertEquals("foo", attributeOverride.getColumn().getDefaultName());
- assertEquals("BAR", attributeOverride.getColumn().getDefaultTable());
- }
-
- public void testAttributeOverrideColumnDefaultsNoJavaAnnotations() throws Exception {
- createTestType();
- createTestSubTypeUnmapped();
- OrmPersistentType childType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmEntity childEntity = (OrmEntity) childType.getMapping();
- OrmAttributeOverrideContainer childOverrideContainer = childEntity.getAttributeOverrideContainer();
- OrmReadOnlyAttributeOverride attributeOverride = childOverrideContainer.getVirtualOverrides().iterator().next();
- ((OrmReadOnlyPersistentAttribute) childType.getSuperPersistentType().getAttributeNamed("id")).addToXml();
- BasicMapping basicMapping = (BasicMapping) ((OrmReadOnlyPersistentAttribute) childType.getSuperPersistentType().getAttributeNamed("id")).getMapping();
- basicMapping.getColumn().setSpecifiedName("MY_COLUMN");
- basicMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals("MY_COLUMN", attributeOverride.getColumn().getDefaultName());
- assertEquals("BAR", attributeOverride.getColumn().getDefaultTable());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- attributeOverride = childOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("MY_COLUMN", attributeOverride.getColumn().getName());
- assertEquals("BAR", attributeOverride.getColumn().getTable());
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = (Entity) persistentType.getMapping();
- Iterator<String> overridableAttributes = persistentType.getMapping().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntityDefaultFieldAccess();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- Entity entity = (Entity) persistentType.getMapping();
- Iterator<String> overridableAttributeNames = persistentType.getMapping().getOverridableAttributeNames().iterator();
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
-
- Iterator<String> overridableAttributes = entity.getAllOverridableAttributeNames().iterator();
- assertEquals("foo", overridableAttributes.next());
- assertEquals("basic", overridableAttributes.next());
- assertEquals("version", overridableAttributes.next());
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- OrmEntity abstractEntity = (OrmEntity) abstractPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = entity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testVirtualAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
-
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType concretePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- OrmEntity concreteEntity = (OrmEntity) concretePersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = concreteEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- OrmVirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(CHILD_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- abstractPersistentType.getAttributeNamed("id").addToXml();
- BasicMapping idMapping = (OrmBasicMapping) abstractPersistentType.getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(CHILD_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
-
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- assertEquals(3, entityResource.getAssociationOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
-
- assertEquals("BAR", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("BAZ", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAssociationOverrides().get(2).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
-
- assertEquals("BAZ", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("BAR", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals("FOO", entityResource.getAssociationOverrides().get(2).getName());
- }
-
- public void testUpdateAssociationOverrides() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
-
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(2, 0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
- public void testVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
-
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualOverride = virtualOverrides.next();
- OrmVirtualJoinColumnRelationshipStrategy joiningStrategy = ((OrmVirtualJoinColumnRelationship) virtualOverride.getRelationship()).getJoinColumnStrategy();
-
- assertEquals("oneToOne", virtualOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- OrmVirtualJoinColumn virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("oneToOne_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals(CHILD_TYPE_NAME, virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
-
- virtualOverride = virtualOverrides.next();
- assertEquals("manyToOne", virtualOverride.getName());
- assertFalse(virtualOverrides.hasNext());
-
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualOverrides.next();
- assertEquals("manyToOne", virtualOverride.getName());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualOverrides.next();
- assertEquals("manyToOne", virtualOverride.getName());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- ormEntity.getJavaTypeMapping().getAssociationOverrideContainer().getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaAssociationOverride javaAssociationOverride = ormEntity.getJavaTypeMapping().getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- JavaJoinColumnRelationshipStrategy javaJoiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnStrategy();
- JavaJoinColumn javaJoinColumn = javaJoiningStrategy.getJoinColumns().iterator().next();
- javaJoinColumn.setSpecifiedName("FOO");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCE");
- javaJoinColumn.setSpecifiedTable("BAR");
- javaJoinColumn.setColumnDefinition("COLUMN_DEF");
- javaJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaJoinColumn.setSpecifiedUnique(Boolean.TRUE);
- javaJoinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualOverrides.next();
- joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy();
- assertEquals("oneToOne", virtualOverride.getName());
- OrmVirtualJoinColumn ormJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("FOO", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", ormJoinColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-
- virtualOverride = virtualOverrides.next();
- joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy();
- assertEquals("manyToOne", virtualOverride.getName());
- assertEquals(null, joiningStrategy.getJoinColumns().iterator().next().getSpecifiedName());
-
- persistentType2.getAttributeNamed("manyToOne").addToXml();
- OrmManyToOneMapping manyToOneMapping = (OrmManyToOneMapping) persistentType2.getAttributeNamed("manyToOne").getMapping();
- OrmJoinColumn joinColumn = manyToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_NAME");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERNCE_NAME");
- joinColumn.setSpecifiedTable("BAR2");
- joinColumn.setColumnDefinition("COLUMN_DEF2");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualOverrides.next();
- joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy();
- assertEquals("oneToOne", virtualOverride.getName());
- ormJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("FOO", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR", ormJoinColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-
- virtualOverride = virtualOverrides.next();
- joiningStrategy = virtualOverride.getRelationship().getJoinColumnStrategy();
- assertEquals("manyToOne", virtualOverride.getName());
- ormJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("MY_NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERNCE_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("BAR2", ormJoinColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEF2", ormJoinColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- }
-//TODO
-// public void testVirtualAssociationOverridesNoJavaEntity() throws Exception {
-// createTestMappedSuperclass();
-// createTestSubType();
-// OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
-// OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// persistentType.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-// persistentType2.getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-//
-// persistentType2.getAttributeNamed("oneToOne").setSpecifiedMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-// persistentType2.getAttributeNamed("manyToOne").setSpecifiedMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-//
-// OrmEntity entity = (OrmEntity) persistentType.getMapping();
-//
-// assertEquals(2, entity.virtualAssociationOverridesSize());
-// ListIterator<OrmAssociationOverride> virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// OrmAssociationOverride associationOverride = virtualAssociationOverrides.next();
-// assertEquals("oneToOne", associationOverride.getName());
-// assertEquals(1, associationOverride.joinColumnsSize());
-// OrmJoinColumn joinColumn = associationOverride.joinColumns().next();
-// assertEquals("oneToOne_id", joinColumn.getName());
-// assertEquals("id", joinColumn.getReferencedColumnName());
-// assertEquals(CHILD_TYPE_NAME, joinColumn.getTable());
-// assertEquals(null, joinColumn.getColumnDefinition());
-// assertEquals(true, joinColumn.isInsertable());
-// assertEquals(true, joinColumn.isUpdatable());
-// assertEquals(false, joinColumn.isUnique());
-// assertEquals(true, joinColumn.isNullable());
-//
-//
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("manyToOne", associationOverride.getName());
-// assertFalse(virtualAssociationOverrides.hasNext());
-//
-//
-// entity.virtualAssociationOverrides().next().convertToSpecified();
-//
-// assertEquals(1, entity.virtualAssociationOverridesSize());
-// virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("manyToOne", associationOverride.getName());
-//
-// entity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(1, entity.virtualAssociationOverridesSize());
-// virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("manyToOne", associationOverride.getName());
-//
-// entity.specifiedAssociationOverrides().next().setVirtual(true);
-// entity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// entity.getJavaEntity().virtualAssociationOverrides().next().convertToSpecified();
-// JavaAssociationOverride javaAssociationOverride = entity.getJavaEntity().specifiedAssociationOverrides().next();
-// JavaJoinColumn javaJoinColumn = javaAssociationOverride.addSpecifiedJoinColumn(0);
-// javaJoinColumn.setSpecifiedName("FOO");
-// javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCE");
-// javaJoinColumn.setSpecifiedTable("BAR");
-// javaJoinColumn.setColumnDefinition("COLUMN_DEF");
-// javaJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
-// javaJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
-// javaJoinColumn.setSpecifiedUnique(Boolean.TRUE);
-// javaJoinColumn.setSpecifiedNullable(Boolean.FALSE);
-//
-// assertEquals(2, entity.virtualAssociationOverridesSize());
-// virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("oneToOne", associationOverride.getName());
-// OrmJoinColumn ormJoinColumn = associationOverride.joinColumns().next();
-// assertEquals("FOO", ormJoinColumn.getSpecifiedName());
-// assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals("BAR", ormJoinColumn.getSpecifiedTable());
-// assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-//
-// associationOverride = virtualAssociationOverrides.next();
-// assertEquals("manyToOne", associationOverride.getName());
-// assertEquals(null, associationOverride.joinColumns().next().getSpecifiedName());
-//
-// persistentType2.getAttributeNamed("manyToOne").makeSpecified();
-// OrmManyToOneMapping manyToOneMapping = (OrmManyToOneMapping) persistentType2.getAttributeNamed("manyToOne").getMapping();
-// joinColumn = manyToOneMapping.getRelationship().getJoinColumnJoiningStrategy().addSpecifiedJoinColumn(0);
-// joinColumn.setSpecifiedName("MY_NAME");
-// joinColumn.setSpecifiedReferencedColumnName("MY_REFERNCE_NAME");
-// joinColumn.setSpecifiedTable("BAR2");
-// joinColumn.setColumnDefinition("COLUMN_DEF2");
-// joinColumn.setSpecifiedInsertable(Boolean.FALSE);
-// joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
-// joinColumn.setSpecifiedUnique(Boolean.TRUE);
-// joinColumn.setSpecifiedNullable(Boolean.FALSE);
-//
-//
-//
-// assertEquals(2, entity.virtualAssociationOverridesSize());
-// virtualAssociationOverrides = entity.virtualAssociationOverrides();
-// assertEquals("oneToOne", associationOverride.getName());
-// ormJoinColumn = associationOverride.joinColumns().next();
-// assertEquals("FOO", ormJoinColumn.getSpecifiedName());
-// assertEquals("REFERENCE", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals("BAR", ormJoinColumn.getSpecifiedTable());
-// assertEquals("COLUMN_DEF", ormJoinColumn.getColumnDefinition());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-//
-//
-// associationOverride = entity.virtualAssociationOverrides().next();
-// associationOverride = entity.virtualAssociationOverrides().next();
-// assertEquals("manyToOne", associationOverride.getName());
-// ormJoinColumn = associationOverride.joinColumns().next();
-// assertEquals("MY_NAME", ormJoinColumn.getSpecifiedName());
-// assertEquals("MY_REFERNCE_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals("BAR2", ormJoinColumn.getSpecifiedTable());
-// assertEquals("COLUMN_DEF2", ormJoinColumn.getColumnDefinition());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
-// }
-
- public void testAddNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmNamedQuery namedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
- namedQuery.setName("FOO");
-
- assertEquals("FOO", entityResource.getNamedQueries().get(0).getName());
-
- OrmNamedQuery namedQuery2 = ormEntity.getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(1).getName());
-
- OrmNamedQuery namedQuery3 = ormEntity.getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
-
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedQuery(0).setName("FOO");
- ormEntity.getQueryContainer().addNamedQuery(1).setName("BAR");
- ormEntity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(2, entityResource.getNamedQueries().size());
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(1, entityResource.getNamedQueries().size());
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(0, entityResource.getNamedQueries().size());
- }
-
- public void testMoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedQuery(0).setName("FOO");
- ormEntity.getQueryContainer().addNamedQuery(1).setName("BAR");
- ormEntity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
-
- ormEntity.getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
-
- ormEntity.getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
- assertEquals("BAR", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().get(0).setName("FOO");
- entityResource.getNamedQueries().get(1).setName("BAR");
- entityResource.getNamedQueries().get(2).setName("BAZ");
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().move(2, 0);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().move(0, 1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().remove(0);
- assertFalse(ormEntity.getQueryContainer().getNamedQueries().iterator().hasNext());
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testAddNamedNativeQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmNamedNativeQuery namedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery.setName("FOO");
-
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(0).getName());
-
- OrmNamedNativeQuery namedNativeQuery2 = ormEntity.getQueryContainer().addNamedNativeQuery(0);
- namedNativeQuery2.setName("BAR");
-
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(1).getName());
-
- OrmNamedNativeQuery namedNativeQuery3 = ormEntity.getQueryContainer().addNamedNativeQuery(1);
- namedNativeQuery3.setName("BAZ");
-
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(2).getName());
-
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals(namedNativeQuery2, namedNativeQueries.next());
- assertEquals(namedNativeQuery3, namedNativeQueries.next());
- assertEquals(namedNativeQuery, namedNativeQueries.next());
-
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- }
-
- public void testRemoveNamedNativeQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- ormEntity.getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- ormEntity.getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedNativeQueries().size());
-
- ormEntity.getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(2, entityResource.getNamedNativeQueries().size());
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(1).getName());
-
- ormEntity.getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(1, entityResource.getNamedNativeQueries().size());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(0).getName());
-
- ormEntity.getQueryContainer().removeNamedNativeQuery(0);
- assertEquals(0, entityResource.getNamedNativeQueries().size());
- }
-
- public void testMoveNamedNativeQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedNativeQuery(0).setName("FOO");
- ormEntity.getQueryContainer().addNamedNativeQuery(1).setName("BAR");
- ormEntity.getQueryContainer().addNamedNativeQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedNativeQueries().size());
-
-
- ormEntity.getQueryContainer().moveNamedNativeQuery(2, 0);
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(2).getName());
-
-
- ormEntity.getQueryContainer().moveNamedNativeQuery(0, 1);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
-
- assertEquals("BAZ", entityResource.getNamedNativeQueries().get(0).getName());
- assertEquals("BAR", entityResource.getNamedNativeQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedNativeQueries().get(2).getName());
- }
-
- public void testUpdateNamedNativeQueries() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- entityResource.getNamedNativeQueries().add(OrmFactory.eINSTANCE.createXmlNamedNativeQuery());
- entityResource.getNamedNativeQueries().get(0).setName("FOO");
- entityResource.getNamedNativeQueries().get(1).setName("BAR");
- entityResource.getNamedNativeQueries().get(2).setName("BAZ");
- ListIterator<OrmNamedNativeQuery> namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(3, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedNativeQueries().move(2, 0);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- entityResource.getNamedNativeQueries().move(0, 1);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("BAR", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
-
- entityResource.getNamedNativeQueries().remove(1);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertEquals("FOO", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(2, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedNativeQueries().remove(1);
- namedNativeQueries = ormEntity.getQueryContainer().getNamedNativeQueries().iterator();
- assertEquals("BAZ", namedNativeQueries.next().getName());
- assertFalse(namedNativeQueries.hasNext());
- assertEquals(1, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedNativeQueries().remove(0);
- assertFalse(ormEntity.getQueryContainer().getNamedNativeQueries().iterator().hasNext());
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestIdClass();
- OrmPersistentType persistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- IdClassReference idClassRef = ormEntity.getIdClassReference();
-
- assertNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- entityResource.setIdClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNotNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- entityResource.getIdClass().setClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, entityResource.getIdClass().getClassName());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- entityResource.getIdClass().setClassName(existentIdClassName);
- assertEquals(existentIdClassName, entityResource.getIdClass().getClassName());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- //test setting @IdClass value to null, id-class tag is not removed
- entityResource.getIdClass().setClassName(null);
- assertNotNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- //reset @IdClass value and then remove id-class tag
- entityResource.setIdClass(OrmFactory.eINSTANCE.createXmlClassReference());
- entityResource.getIdClass().setClassName("model.Foo");
- entityResource.setIdClass(null);
- assertNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- createTestIdClass();
- OrmPersistentType persistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- IdClassReference idClassRef = ormEntity.getIdClassReference();
-
- assertNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassRef.setSpecifiedIdClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, entityResource.getIdClass().getClassName());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassRef.setSpecifiedIdClassName(existentIdClassName);
- assertEquals(existentIdClassName, entityResource.getIdClass().getClassName());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- idClassRef.setSpecifiedIdClassName(null);
- assertNull(entityResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-
-
- public void testGetPrimaryKeyColumnNameWithAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType superPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType subPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity childXmlEntity = (OrmEntity) subPersistentType.getMapping();
-
- superPersistentType.getAttributeNamed("id").addToXml(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("id", childXmlEntity.getPrimaryKeyColumnName());
-
- ((OrmIdMapping) superPersistentType.getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("MY_ID", childXmlEntity.getPrimaryKeyColumnName());
-
- //TODO once bug 228718 is fixed
- OrmVirtualAttributeOverride ormAttributeOverride = childXmlEntity.getAttributeOverrideContainer().getVirtualOverrides().iterator().next();
- assertEquals("id", ormAttributeOverride.getName());
-
- ormAttributeOverride.convertToSpecified().getColumn().setSpecifiedName("ID");
- assertEquals("ID", childXmlEntity.getPrimaryKeyColumnName());
- }
-
-
- public void testDiscriminatorValueIsUndefinedConcreteClass() throws Exception {
- createTestType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- assertTrue(entity.discriminatorValueIsUndefined());
-
- createTestSubType();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- assertFalse(entity.discriminatorValueIsUndefined());
- }
-
- public void testDiscriminatorValueIsAllowedAbstractClass() throws Exception {
- createTestAbstractType();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) persistentType.getMapping();
- assertTrue(entity.discriminatorValueIsUndefined());
-
- createTestSubType();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_CHILD_TYPE_NAME);
- assertTrue(entity.discriminatorValueIsUndefined());
- }
-
- public void testDiscriminatorColumnIsAllowed() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
- OrmPersistentType concretePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Entity concreteEntity = (Entity) concretePersistentType.getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) abstractPersistentType.getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
-
- //table-per-class, no discriminator column allowed
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertFalse(abstractEntity.specifiedDiscriminatorColumnIsAllowed());
-
-
- //single-table, discriminator column allowed on root entity
- ((JavaEntity) abstractPersistentType.getJavaPersistentType().getMapping()).setSpecifiedInheritanceStrategy(null);
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertTrue(abstractEntity.specifiedDiscriminatorColumnIsAllowed());
- }
-
- public void testAbstractEntityGetDefaultDiscriminatorColumnNameTablePerClassInheritance() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
-
- OrmPersistentType concretePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Entity concreteEntity = (Entity) concretePersistentType.getMapping();
- assertEquals("AnnotationTestTypeChild", concreteEntity.getName());
-
- Entity abstractEntity = (Entity) abstractPersistentType.getMapping();
- assertEquals(TYPE_NAME, abstractEntity.getName());
-
-
- assertEquals(null, abstractEntity.getSpecifiedInheritanceStrategy());
- assertEquals(null, concreteEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, concreteEntity.getDefaultInheritanceStrategy());
-
-
- assertTrue(abstractEntity.discriminatorValueIsUndefined());
- assertFalse(concreteEntity.specifiedDiscriminatorColumnIsAllowed());
- assertEquals(null, abstractEntity.getDiscriminatorColumn().getDefaultName());
- assertEquals(null, concreteEntity.getDiscriminatorColumn().getDefaultName());
-
- assertTrue(abstractEntity.discriminatorValueIsUndefined());
- assertEquals(null, abstractEntity.getDefaultDiscriminatorValue());
- assertTrue(concreteEntity.discriminatorValueIsUndefined());
- assertEquals(null, concreteEntity.getDefaultDiscriminatorValue());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmGeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmGeneratedValueTests.java
deleted file mode 100644
index aab3848225..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmGeneratedValueTests.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.GeneratedValue;
-import org.eclipse.jpt.jpa.core.context.GenerationType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmGeneratedValue;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlGeneratedValue;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-
-@SuppressWarnings("nls")public class OrmGeneratedValueTests extends ContextModelTestCase
-{
- public OrmGeneratedValueTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- OrmGeneratedValue ormGeneratedValue = ormIdMapping.addGeneratedValue();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
- XmlGeneratedValue generatedValueResource = idResource.getGeneratedValue();
-
- //set generator in the resource model, verify context model updated
- generatedValueResource.setGenerator("FOO");
- assertEquals("FOO", ormGeneratedValue.getSpecifiedGenerator());
- assertEquals("FOO", generatedValueResource.getGenerator());
-
- //set name to null in the resource model
- generatedValueResource.setGenerator(null);
- assertNull(ormGeneratedValue.getSpecifiedGenerator());
- assertNull(generatedValueResource.getGenerator());
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- OrmGeneratedValue ormGeneratedValue = ormIdMapping.addGeneratedValue();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
- XmlGeneratedValue generatedValueResource = idResource.getGeneratedValue();
-
- //set name in the context model, verify resource model modified
- ormGeneratedValue.setSpecifiedGenerator("FOO");
- assertEquals("FOO", generatedValueResource.getGenerator());
- assertEquals("FOO", ormGeneratedValue.getSpecifiedGenerator());
-
- //set name to null in the context model
- ormGeneratedValue.setSpecifiedGenerator(null);
- assertNull(generatedValueResource.getGenerator());
- assertNull(ormGeneratedValue.getSpecifiedGenerator());
- }
-
- public void testDefaultsFromJava() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormIdAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- IdMapping ormIdMapping = (IdMapping) ormIdAttribute.getMapping();
- assertEquals(null, ormIdMapping.getGeneratedValue());
-
- IdMapping javaIdMapping = (IdMapping) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- GeneratedValue javaGeneratedValue = javaIdMapping.addGeneratedValue();
- javaGeneratedValue.setSpecifiedGenerator("Foo");
- javaGeneratedValue.setSpecifiedStrategy(GenerationType.SEQUENCE);
-
- assertEquals("Foo", ormIdMapping.getGeneratedValue().getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, ormIdMapping.getGeneratedValue().getSpecifiedStrategy());
- assertEquals("Foo", javaGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, javaGeneratedValue.getSpecifiedStrategy());
-
- ormIdAttribute.addToXml();
- ormIdAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- ormIdMapping = (IdMapping) ormIdAttribute.getMapping();
- assertEquals(null, ormIdMapping.getGeneratedValue());
- assertEquals("Foo", javaGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, javaGeneratedValue.getSpecifiedStrategy());
-
- ((OrmPersistentAttribute) ormIdAttribute).removeFromXml();
- ormIdAttribute = ormPersistentType.getAttributeNamed("id");
- ormIdMapping = (IdMapping) ormIdAttribute.getMapping();
- assertEquals("Foo", ormIdMapping.getGeneratedValue().getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, ormIdMapping.getGeneratedValue().getSpecifiedStrategy());
- assertEquals("Foo", javaGeneratedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.SEQUENCE, javaGeneratedValue.getSpecifiedStrategy());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmIdMappingTests.java
deleted file mode 100644
index 9f8e6a8197..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmIdMappingTests.java
+++ /dev/null
@@ -1,767 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.GeneratedValue;
-import org.eclipse.jpt.jpa.core.context.GenerationType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmIdMappingTests extends ContextModelTestCase
-{
- public OrmIdMappingTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN, JPA.TEMPORAL, JPA.TEMPORAL_TYPE, JPA.GENERATED_VALUE, JPA.GENERATION_TYPE, JPA.TABLE_GENERATOR, JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append(" @Column(name=\"MY_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\", length=5, precision=6, scale=7)");
- sb.append(CR);
- sb.append(" @Temporal(TemporalType.TIMESTAMP)");
- sb.append(CR);
- sb.append(" @GeneratedValue(strategy=GenerationType.TABLE, generator=\"myTableGenerator\")");
- sb.append(CR);
- sb.append(" @TableGenerator(name=\"myTableGenerator\", table=\"myTable\", catalog=\"myCatalog\", schema=\"mySchema\", pkColumnName=\"myPkColumnName\", valueColumnName=\"myValueColumnName\", pkColumnValue=\"myPkColumnValue\", initialValue=1, allocationSize=1)");
- sb.append(CR);
- sb.append(" @SequenceGenerator(name=\"mySequenceGenerator\")");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertEquals("id", ormIdMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertEquals("id", ormIdMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(idResource.getTemporal());
-
- //set temporal in the resource model, verify context model updated
- idResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormIdMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, idResource.getTemporal());
-
- idResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormIdMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, idResource.getTemporal());
-
- idResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormIdMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, idResource.getTemporal());
-
- //set temporal to null in the resource model
- idResource.setTemporal(null);
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(idResource.getTemporal());
- }
-
- public void testModifyTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(idResource.getTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormIdMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ormIdMapping.getConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, idResource.getTemporal());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormIdMapping.getConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormIdMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, idResource.getTemporal());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormIdMapping.getConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormIdMapping.getConverter()).setTemporalType(TemporalType.TIMESTAMP);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, idResource.getTemporal());
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormIdMapping.getConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormIdMapping.setConverter(null);
- assertNull(idResource.getTemporal());
- assertNull(ormIdMapping.getConverter().getType());
- }
-
- //TODO test defaults
- //TODO test overriding java mapping with a different mapping type in xml
-
-
- public void testAddSequenceGenerator() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
-
- ormIdMapping.getGeneratorContainer().addSequenceGenerator();
-
- assertNotNull(idResource.getSequenceGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- ormIdMapping.getGeneratorContainer().addSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveSequenceGenerator() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
-
- ormIdMapping.getGeneratorContainer().addSequenceGenerator();
- assertNotNull(idResource.getSequenceGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
-
- ormIdMapping.getGeneratorContainer().removeSequenceGenerator();
-
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- ormIdMapping.getGeneratorContainer().removeSequenceGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateSequenceGenerator() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
- assertEquals(0, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- idResource.setSequenceGenerator(OrmFactory.eINSTANCE.createXmlSequenceGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNotNull(idResource.getSequenceGenerator());
- assertEquals(1, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- ormIdMapping.getGeneratorContainer().getSequenceGenerator().setName("foo");
- assertEquals(1, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- idResource.setSequenceGenerator(null);
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(idResource.getSequenceGenerator());
- assertEquals(0, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddTableGenerator() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
-
- ormIdMapping.getGeneratorContainer().addTableGenerator();
-
- assertNotNull(idResource.getTableGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
- //try adding another table generator, should get an IllegalStateException
- try {
- ormIdMapping.getGeneratorContainer().addTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveTableGenerator() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
-
- ormIdMapping.getGeneratorContainer().addTableGenerator();
- assertNotNull(idResource.getTableGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
- ormIdMapping.getGeneratorContainer().removeTableGenerator();
-
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
-
- //try removing the table generator again, should get an IllegalStateException
- try {
- ormIdMapping.getGeneratorContainer().removeTableGenerator();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateTableGenerator() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
- assertEquals(0, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- idResource.setTableGenerator(OrmFactory.eINSTANCE.createXmlTableGenerator());
- assertNotNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNotNull(idResource.getTableGenerator());
- assertEquals(1, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
-
- ormIdMapping.getGeneratorContainer().getTableGenerator().setName("foo");
- assertEquals(1, ormIdMapping.getGeneratorContainer().getPersistenceUnit().getGeneratorsSize());
-
- idResource.setTableGenerator(null);
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
- assertNull(idResource.getTableGenerator());
- assertEquals(0, ormIdMapping.getPersistenceUnit().getGeneratorsSize());
- }
-
- public void testAddGeneratedValue() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- ormIdMapping.addGeneratedValue();
-
- assertNotNull(idResource.getGeneratedValue());
- assertNotNull(ormIdMapping.getGeneratedValue());
-
- //try adding another sequence generator, should get an IllegalStateException
- try {
- ormIdMapping.addGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testRemoveGeneratedValue() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- ormIdMapping.addGeneratedValue();
- assertNotNull(idResource.getGeneratedValue());
- assertNotNull(ormIdMapping.getGeneratedValue());
-
- ormIdMapping.removeGeneratedValue();
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- //try removing the sequence generator again, should get an IllegalStateException
- try {
- ormIdMapping.removeGeneratedValue();
- } catch (IllegalStateException e) {
- return;
- }
- fail("IllegalStateException not thrown");
- }
-
- public void testUpdateGeneratedValue() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId idResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
-
- idResource.setGeneratedValue(OrmFactory.eINSTANCE.createXmlGeneratedValue());
-
- assertNotNull(ormIdMapping.getGeneratedValue());
- assertNotNull(idResource.getGeneratedValue());
-
- idResource.setGeneratedValue(null);
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(idResource.getGeneratedValue());
- }
-
-
- public void testIdMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityIdMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- ormIdMapping.setName("foo");
-
- assertEquals("foo", ormIdMapping.getName());
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("foo", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", idMapping.getName());
- assertEquals(BaseTemporalConverter.class, idMapping.getConverter().getType());
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) idMapping.getConverter()).getTemporalType());
-
- Column column = idMapping.getColumn();
- assertEquals("MY_COLUMN", column.getSpecifiedName());
- assertEquals(Boolean.TRUE, column.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, column.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, column.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, column.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", column.getColumnDefinition());
- assertEquals("MY_TABLE", column.getSpecifiedTable());
- assertEquals(Integer.valueOf(5), column.getSpecifiedLength());
- assertEquals(Integer.valueOf(6), column.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), column.getSpecifiedScale());
-
- GeneratedValue generatedValue = idMapping.getGeneratedValue();
- assertEquals("myTableGenerator", generatedValue.getSpecifiedGenerator());
- assertEquals(GenerationType.TABLE, generatedValue.getSpecifiedStrategy());
-
-// >>> I'm going to argue there is no such thing as a "virtual" generator,
-// since a Java generator is *not* overridden when its ID mapping (or entity)
-// is overridden in the orm.xml file - both the orm.xml ID mapping and the
-// Java mapping can define an "active" generator as long as they have different
-// names ~bjv
- TableGenerator tableGenerator = idMapping.getGeneratorContainer().getTableGenerator();
- assertNull(tableGenerator);
-// assertEquals("myTableGenerator", tableGenerator.getName());
-// assertEquals("myTable", tableGenerator.getSpecifiedTable());
-// assertEquals("myCatalog", tableGenerator.getSpecifiedCatalog());
-// assertEquals("mySchema", tableGenerator.getSpecifiedSchema());
-// assertEquals("myPkColumnName", tableGenerator.getSpecifiedPkColumnName());
-// assertEquals("myPkColumnValue", tableGenerator.getSpecifiedPkColumnValue());
-// assertEquals("myValueColumnName", tableGenerator.getSpecifiedValueColumnName());
-// assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedInitialValue());
-// assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedAllocationSize());
-
- SequenceGenerator sequenceGenerator = idMapping.getGeneratorContainer().getSequenceGenerator();
- assertNull(sequenceGenerator);
-// assertEquals("mySequenceGenerator", sequenceGenerator.getName());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.addToXml(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals("id", ormIdMapping.getName());
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertEquals("id", ormColumn.getName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getTable());
- assertEquals(255, ormColumn.getLength());
- assertEquals(0, ormColumn.getPrecision());
- assertEquals(0, ormColumn.getScale());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityIdMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormIdMapping.getName());
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(ormIdMapping.getGeneratedValue());
- assertNull(ormIdMapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(ormIdMapping.getGeneratorContainer().getTableGenerator());
-
- OrmColumn ormColumn = ormIdMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("id", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- //3 things tested above
- //1. virtual mapping metadata complete=false - defaults are taken from the java annotations
- //2. virtual mapping metadata complete=true - defaults are taken from java defaults,annotations ignored
- //3. specified mapping (metadata complete=true/false - defaults are taken from java annotations
-
- public void testIdMorphToBasicMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testIdMorphToVersionMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((VersionMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testIdMorphToTransientMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToEmbeddedMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToOneToOneMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToOneToManyMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToManyToOneMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testIdMorphToManyToManyMapping() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- IdMapping idMapping = (IdMapping) ormPersistentAttribute.getMapping();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(idMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinColumnTests.java
deleted file mode 100644
index 10a3c111c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinColumnTests.java
+++ /dev/null
@@ -1,522 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmJoinColumnTests extends ContextModelTestCase
-{
- public OrmJoinColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinColumnResource.getName());
-
- //set name in the resource model, verify context model updated
- joinColumnResource.setName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("FOO", joinColumnResource.getName());
-
- //set name to null in the resource model
- joinColumnResource.setName(null);
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinColumnResource.getName());
-
- joinColumnResource.setName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("FOO", joinColumnResource.getName());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinColumnResource.getName());
-
- //set name in the context model, verify resource model modified
- joinColumn.setSpecifiedName("foo");
- assertEquals("foo", joinColumn.getSpecifiedName());
- assertEquals("foo", joinColumnResource.getName());
-
- //set name to null in the context model
- joinColumn.setSpecifiedName(null);
- assertNull(joinColumn.getSpecifiedName());
- assertNull(joinTableResource.getJoinColumns().get(0).getName());
- }
-
- public void testUpdateSpecifiedReferencedColumnName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinColumnResource.getReferencedColumnName());
-
- //set name in the resource model, verify context model updated
- joinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", joinColumnResource.getReferencedColumnName());
-
- //set name to null in the resource model
- joinColumnResource.setReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinColumnResource.getReferencedColumnName());
-
- joinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", joinColumnResource.getReferencedColumnName());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedReferencedColumnName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinColumnResource.getReferencedColumnName());
-
- //set name in the context model, verify resource model modified
- joinColumn.setSpecifiedReferencedColumnName("foo");
- assertEquals("foo", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals("foo", joinColumnResource.getReferencedColumnName());
-
- //set name to null in the context model
- joinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(joinColumn.getSpecifiedReferencedColumnName());
- assertNull(joinTableResource.getJoinColumns().get(0).getReferencedColumnName());
- }
-
- public void testUpdateSpecifiedColumnDefinition() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinColumnResource.getColumnDefinition());
-
- //set name in the resource model, verify context model updated
- joinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", joinColumn.getColumnDefinition());
- assertEquals("FOO", joinColumnResource.getColumnDefinition());
-
- //set name to null in the resource model
- joinColumnResource.setColumnDefinition(null);
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinColumnResource.getColumnDefinition());
-
- joinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", joinColumn.getColumnDefinition());
- assertEquals("FOO", joinColumnResource.getColumnDefinition());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedColumnDefinition() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinColumnResource.getColumnDefinition());
-
- //set name in the context model, verify resource model modified
- joinColumn.setColumnDefinition("foo");
- assertEquals("foo", joinColumn.getColumnDefinition());
- assertEquals("foo", joinColumnResource.getColumnDefinition());
-
- //set name to null in the context model
- joinColumn.setColumnDefinition(null);
- assertNull(joinColumn.getColumnDefinition());
- assertNull(joinTableResource.getJoinColumns().get(0).getColumnDefinition());
- }
-
- public void testUpdateSpecifiedTable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinColumnResource.getTable());
-
- //set table in the resource model, verify context model updated
- joinColumnResource.setTable("FOO");
- assertEquals("FOO", ormJoinColumn.getSpecifiedTable());
- assertEquals("FOO", joinColumnResource.getTable());
-
- //set table to null in the resource model
- joinColumnResource.setTable(null);
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinColumnResource.getTable());
-
- joinColumnResource.setTable("FOO");
- assertEquals("FOO", ormJoinColumn.getSpecifiedTable());
- assertEquals("FOO", joinColumnResource.getTable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedTable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinColumnResource.getTable());
-
- //set table in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedTable("foo");
- assertEquals("foo", ormJoinColumn.getSpecifiedTable());
- assertEquals("foo", joinColumnResource.getTable());
-
- //set table to null in the context model
- ormJoinColumn.setSpecifiedTable(null);
- assertNull(ormJoinColumn.getSpecifiedTable());
- assertNull(joinTableResource.getJoinColumns().get(0).getTable());
- }
-
- public void testUpdateSpecifiedNullable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinColumnResource.getNullable());
-
- //set nullable in the resource model, verify context model updated
- joinColumnResource.setNullable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, joinColumnResource.getNullable());
-
- //set nullable to null in the resource model
- joinColumnResource.setNullable(null);
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinColumnResource.getNullable());
-
- joinColumnResource.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumnResource.getNullable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedNullable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinColumnResource.getNullable());
-
- //set nullable in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumnResource.getNullable());
-
- //set nullable to null in the context model
- ormJoinColumn.setSpecifiedNullable(null);
- assertNull(ormJoinColumn.getSpecifiedNullable());
- assertNull(joinTableResource.getJoinColumns().get(0).getNullable());
- }
-
- public void testUpdateSpecifiedUpdatable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinColumnResource.getUpdatable());
-
- //set updatable in the resource model, verify context model updated
- joinColumnResource.setUpdatable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.TRUE, joinColumnResource.getUpdatable());
-
- //set updatable to null in the resource model
- joinColumnResource.setUpdatable(null);
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinColumnResource.getUpdatable());
-
- joinColumnResource.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, joinColumnResource.getUpdatable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedUpdatable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinColumnResource.getUpdatable());
-
- //set updatable in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, joinColumnResource.getUpdatable());
-
- //set updatable to null in the context model
- ormJoinColumn.setSpecifiedUpdatable(null);
- assertNull(ormJoinColumn.getSpecifiedUpdatable());
- assertNull(joinTableResource.getJoinColumns().get(0).getUpdatable());
- }
-
- public void testUpdateSpecifiedInsertable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinColumnResource.getInsertable());
-
- //set insertable in the resource model, verify context model updated
- joinColumnResource.setInsertable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.TRUE, joinColumnResource.getInsertable());
-
- //set insertable to null in the resource model
- joinColumnResource.setInsertable(null);
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinColumnResource.getInsertable());
-
- joinColumnResource.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumnResource.getInsertable());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedInsertable() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinColumnResource.getInsertable());
-
- //set insertable in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumnResource.getInsertable());
-
- //set insertable to null in the context model
- ormJoinColumn.setSpecifiedInsertable(null);
- assertNull(ormJoinColumn.getSpecifiedInsertable());
- assertNull(joinTableResource.getJoinColumns().get(0).getInsertable());
- }
-
- public void testUpdateSpecifiedUnique() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinColumnResource.getUnique());
-
- //set unique in the resource model, verify context model updated
- joinColumnResource.setUnique(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.TRUE, joinColumnResource.getUnique());
-
- //set unique to null in the resource model
- joinColumnResource.setUnique(null);
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinColumnResource.getUnique());
-
- joinColumnResource.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumnResource.getUnique());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- assertTrue(joinTableResource.getJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedUnique() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- OrmJoinColumn ormJoinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- XmlJoinColumn joinColumnResource = joinTableResource.getJoinColumns().get(0);
-
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinColumnResource.getUnique());
-
- //set unique in the context model, verify resource model modified
- ormJoinColumn.setSpecifiedUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumnResource.getUnique());
-
- //set unique to null in the context model
- ormJoinColumn.setSpecifiedUnique(null);
- assertNull(ormJoinColumn.getSpecifiedUnique());
- assertNull(joinTableResource.getJoinColumns().get(0).getUnique());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinTableTests.java
deleted file mode 100644
index b689dc22b6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmJoinTableTests.java
+++ /dev/null
@@ -1,1386 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.internal.context.orm.VirtualOrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmJoinTableTests extends ContextModelTestCase
-{
- public OrmJoinTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityWithValidManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append(" private Collection<Project> projects;").append(CR);
- }
- });
- }
-
- private void createTargetEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(CR);
- sb.append("}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- private void createTargetEntityWithBackPointer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Project {").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int proj_id;").append(CR);
- sb.append(" @ManyToMany(mappedBy=\"projects\"").append(CR);
- sb.append(" private java.util.Collection<" + TYPE_NAME + "> employees;").append(CR);
- sb.append(CR);
- sb.append("}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Project.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
-
-
- //set name in the resource model, verify context model updated
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- manyToMany.getJoinTable().setName("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedName());
- assertEquals("FOO", manyToMany.getJoinTable().getName());
-
- //set name to null in the resource model
- manyToMany.getJoinTable().setName(null);
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable().getName());
-
- manyToMany.getJoinTable().setName("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedName());
- assertEquals("FOO", manyToMany.getJoinTable().getName());
-
- manyToMany.setJoinTable(null);
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
-
- //set name in the context model, verify resource model modified
- ormJoinTable.setSpecifiedName("foo");
- assertEquals("foo", ormJoinTable.getSpecifiedName());
- assertEquals("foo", manyToMany.getJoinTable().getName());
-
- //set name to null in the context model
- ormJoinTable.setSpecifiedName(null);
- assertNull(ormJoinTable.getSpecifiedName());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidManyToMany();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, virtualJoinTable.getSpecifiedName());
-
- createTargetEntity();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Project");
-
- assertEquals(TYPE_NAME + "_Project", virtualJoinTable.getName());
- assertNull(virtualJoinTable.getSpecifiedCatalog());
- assertNull(virtualJoinTable.getSpecifiedSchema());
- assertEquals(0, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn ormJoinColumn = virtualJoinTable.getDefaultJoinColumn();
-//TODO need to test joinColumn defaults here as well as in java and all the relationship mapping types
-// assertEquals("id_project_id", ormJoinColumn.getDefaultName());
-// assertEquals("id_project_id", ormJoinColumn.getDefaultReferencedColumnName());
- JoinColumn inverseOrmJoinColumn = virtualJoinTable.getDefaultInverseJoinColumn();
-// assertEquals("id_project_id", inverseOrmJoinColumn.getDefaultName());
-// assertEquals("id_project_id", inverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaPersistentAttribute javaPersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) javaPersistentAttribute.getMapping();
- JavaJoinTable javaJoinTable = javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", virtualJoinTable.getSpecifiedName());
- assertEquals("CATALOG", virtualJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualJoinTable.getSpecifiedSchema());
- assertEquals(1, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- ormJoinColumn = virtualJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- inverseOrmJoinColumn = virtualJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", inverseOrmJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", inverseOrmJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidManyToMany();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("projects"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTargetEntity();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
- assertEquals(TYPE_NAME + "_Project", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- JavaManyToManyMapping javaManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").getMapping();
- javaManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Project", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.removeFromXml();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("projects");
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentAttribute2.getMapping();
- JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- assertTrue(ormPersistentAttribute2.isVirtual());
- assertEquals("JAVA_JOIN_TABLE", virtualJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- javaManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName(null);
- javaManyMapping.getRelationship().setStrategyToJoinTable();
- assertNull(virtualJoinTable.getSpecifiedName());
- assertEquals("BAR_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", virtualJoinTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
-
- //set schema in the resource model, verify context model updated
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- manyToMany.getJoinTable().setSchema("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedSchema());
- assertEquals("FOO", manyToMany.getJoinTable().getSchema());
-
- //set Schema to null in the resource model
- manyToMany.getJoinTable().setSchema(null);
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable().getSchema());
-
- manyToMany.getJoinTable().setSchema("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedSchema());
- assertEquals("FOO", manyToMany.getJoinTable().getSchema());
-
- manyToMany.setJoinTable(null);
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
- }
-
-// public void testUpdateDefaultSchemaFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedSchema("Foo");
-// assertEquals("Foo", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.setSpecifiedMetadataComplete(null);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.getTable().setSpecifiedName("Bar");
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-// }
-//
-// public void testUpdateDefaultSchemaNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-// }
-//
-// public void testUpdateDefaultSchemaFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertNull(parentXmlEntity.getTable().getDefaultSchema());
-// assertNull(childXmlEntity.getTable().getDefaultSchema());
-//
-// parentXmlEntity.getTable().setSpecifiedSchema("FOO");
-// assertNull(parentXmlEntity.getTable().getDefaultSchema());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultSchema());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertNull(parentXmlEntity.getTable().getDefaultSchema());
-// assertNull(childXmlEntity.getTable().getDefaultSchema());
-// }
-//
-// public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("FOO");
-// assertEquals("FOO", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().setSpecifiedSchema("BAR");
-// assertEquals("BAR", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedSchema("JAVA_SCHEMA");
-// assertEquals("JAVA_SCHEMA", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.getTable().setSpecifiedName("BLAH");
-// //xml entity now has a table element so default schema is not taken from java
-// assertEquals("BAR", xmlEntity.getTable().getDefaultSchema());
-//
-//
-// xmlEntity.entityMappings().setSpecifiedSchema(null);
-// assertEquals("FOO", xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null);
-// assertNull(xmlEntity.getTable().getDefaultSchema());
-//
-// xmlEntity.getTable().setSpecifiedName(null);
-// assertEquals("JAVA_SCHEMA", xmlEntity.getTable().getDefaultSchema());
-// }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
-
- //set Schema in the context model, verify resource model modified
- ormJoinTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormJoinTable.getSpecifiedSchema());
- assertEquals("foo", manyToMany.getJoinTable().getSchema());
-
- //set Schema to null in the context model
- ormJoinTable.setSpecifiedSchema(null);
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
-
- //set Catalog in the resource model, verify context model updated
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- manyToMany.getJoinTable().setCatalog("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedCatalog());
- assertEquals("FOO", manyToMany.getJoinTable().getCatalog());
-
- //set Catalog to null in the resource model
- manyToMany.getJoinTable().setCatalog(null);
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable().getCatalog());
-
- manyToMany.getJoinTable().setCatalog("FOO");
- assertEquals("FOO", ormJoinTable.getSpecifiedCatalog());
- assertEquals("FOO", manyToMany.getJoinTable().getCatalog());
-
- manyToMany.setJoinTable(null);
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
-
- //set Catalog in the context model, verify resource model modified
- ormJoinTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormJoinTable.getSpecifiedCatalog());
- assertEquals("foo", manyToMany.getJoinTable().getCatalog());
-
- //set Catalog to null in the context model
- ormJoinTable.setSpecifiedCatalog(null);
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(manyToMany.getJoinTable());
- }
-
-// public void testUpdateDefaultCatalogFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedCatalog("Foo");
-// assertEquals("Foo", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// xmlEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.setSpecifiedMetadataComplete(null);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.getTable().setSpecifiedName("Bar");
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-// }
-//
-// public void testUpdateDefaultCatalogNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-// }
-//
-// public void testUpdateDefaultCatalogFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertNull(parentXmlEntity.getTable().getDefaultCatalog());
-// assertNull(childXmlEntity.getTable().getDefaultCatalog());
-//
-// parentXmlEntity.getTable().setSpecifiedCatalog("FOO");
-// assertNull(parentXmlEntity.getTable().getDefaultCatalog());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultCatalog());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertNull(parentXmlEntity.getTable().getDefaultCatalog());
-// assertNull(childXmlEntity.getTable().getDefaultCatalog());
-// }
-//
-// public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("FOO");
-// assertEquals("FOO", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().setSpecifiedCatalog("BAR");
-// assertEquals("BAR", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.javaEntity().getTable().setSpecifiedCatalog("JAVA_CATALOG");
-// assertEquals("JAVA_CATALOG", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.getTable().setSpecifiedName("BLAH");
-// //xml entity now has a table element so default schema is not taken from java
-// assertEquals("BAR", xmlEntity.getTable().getDefaultCatalog());
-//
-//
-// xmlEntity.entityMappings().setSpecifiedCatalog(null);
-// assertEquals("FOO", xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.entityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null);
-// assertNull(xmlEntity.getTable().getDefaultCatalog());
-//
-// xmlEntity.getTable().setSpecifiedName(null);
-// assertEquals("JAVA_CATALOG", xmlEntity.getTable().getDefaultCatalog());
-//}
-
-//
-// public void testUpdateName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity xmlEntity = (XmlEntity) ormPersistentType.getMapping();
-// Entity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertEquals("Foo", xmlEntity.getName());
-//
-// //set class in the resource model, verify context model updated
-// entityResource.setClassName("com.Bar");
-// assertEquals("Bar", xmlEntity.getName());
-//
-// entityResource.setName("Baz");
-// assertEquals("Baz", xmlEntity.getName());
-//
-// //set class to null in the resource model
-// entityResource.setClassName(null);
-// assertEquals("Baz", xmlEntity.getName());
-//
-// entityResource.setName(null);
-// assertNull(xmlEntity.getName());
-// }
-
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals("FOO", joinTableResource.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormJoinTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormJoinTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ormJoinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getJoinColumns().size());
-
- ormJoinTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableResource.getJoinColumns().size());
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(1).getName());
-
- ormJoinTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableResource.getJoinColumns().size());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(0).getName());
-
- ormJoinTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableResource.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ormJoinTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getJoinColumns().size());
-
-
- ormJoinTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(2).getName());
-
-
- ormJoinTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.getJoinColumns().get(0).getName());
- assertEquals("BAR", joinTableResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getJoinColumns().get(2).getName());
- }
-
- public void testUpdateInverseJoinColumns() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- joinTableResource.getInverseJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- joinTableResource.getInverseJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- joinTableResource.getInverseJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- joinTableResource.getInverseJoinColumns().get(0).setName("FOO");
- joinTableResource.getInverseJoinColumns().get(1).setName("BAR");
- joinTableResource.getInverseJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().move(2, 0);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().move(0, 1);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().remove(1);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().remove(1);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getInverseJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedInverseJoinColumns().iterator().hasNext());
- }
-
- public void testAddSpecifiedInverseJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- OrmJoinColumn joinColumn = ormJoinTable.addSpecifiedInverseJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormJoinTable.addSpecifiedInverseJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormJoinTable.addSpecifiedInverseJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedInverseJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ormJoinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getInverseJoinColumns().size());
-
- ormJoinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(2, joinTableResource.getInverseJoinColumns().size());
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(1).getName());
-
- ormJoinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(1, joinTableResource.getInverseJoinColumns().size());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(0).getName());
-
- ormJoinTable.removeSpecifiedInverseJoinColumn(0);
- assertEquals(0, joinTableResource.getInverseJoinColumns().size());
- }
-
- public void testMoveSpecifiedInverseJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- ormJoinTable.addSpecifiedInverseJoinColumn(0).setSpecifiedName("FOO");
- ormJoinTable.addSpecifiedInverseJoinColumn(1).setSpecifiedName("BAR");
- ormJoinTable.addSpecifiedInverseJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
- assertEquals(3, joinTableResource.getInverseJoinColumns().size());
-
-
- ormJoinTable.moveSpecifiedInverseJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(2).getName());
-
-
- ormJoinTable.moveSpecifiedInverseJoinColumn(0, 1);
- joinColumns = ormJoinTable.getSpecifiedInverseJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.getInverseJoinColumns().get(0).getName());
- assertEquals("BAR", joinTableResource.getInverseJoinColumns().get(1).getName());
- assertEquals("FOO", joinTableResource.getInverseJoinColumns().get(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- joinTableResource.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- joinTableResource.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- joinTableResource.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- joinTableResource.getJoinColumns().get(0).setName("FOO");
- joinTableResource.getJoinColumns().get(1).setName("BAR");
- joinTableResource.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().move(2, 0);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().move(0, 1);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().remove(1);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().remove(1);
- joinColumns = ormJoinTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.getJoinColumns().remove(0);
- assertFalse(ormJoinTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- assertEquals(0, ormJoinTable.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormJoinTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = joinTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = joinTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, joinTableResource.getUniqueConstraints().size());
-
- ormJoinTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormJoinTable.removeUniqueConstraint(1);
- uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormJoinTable.removeUniqueConstraint(0);
- uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- ormJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormJoinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, joinTableResource.getUniqueConstraints().size());
-
-
- ormJoinTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormJoinTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = joinTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- OrmJoinTable ormJoinTable = ormManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- XmlJoinTable joinTableResource = manyToMany.getJoinTable();
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- joinTableResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableResource.getUniqueConstraints().remove(0);
- uniqueConstraints = ormJoinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntityWithValidManyToMany();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) virtualAttribute.getMapping();
- JoinTable virtualJoinTable = virtualManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- assertTrue(virtualAttribute.isVirtual());
-
- ListIterator<? extends UniqueConstraint> uniqueConstraints = virtualJoinTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaJoinTable javaJoinTable = javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- javaJoinTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- javaJoinTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- javaJoinTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- uniqueConstraints = virtualJoinTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- OrmManyToManyMapping specifiedManyToManyMapping = (OrmManyToManyMapping) ((VirtualOrmPersistentAttribute) virtualAttribute).addToXml().getMapping();
- assertEquals(0, specifiedManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().getUniqueConstraintsSize());
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidManyToMany();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ormPersistentType.getAttributeNamed("projects").addToXml();
- OrmManyToManyMapping manyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("projects").getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinTable.getDefaultName());
-
- //add target entity to the persistence unit, now join table name is [table name]_[target table name]
- createTargetEntity();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
- assertNull(manyToMany.getJoinTable());
-
- //target entity does not resolve, default name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertNull(joinTable.getDefaultName());
-
- //default target entity does resolve, so default name is again [table name]_[target table name]
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
-
- //add the join table xml element, verify default join table name is the same
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- assertEquals(TYPE_NAME + "_Project", joinTable.getDefaultName());
- assertNotNull(manyToMany.getJoinTable());
-
- //set a table on the target entity, very default join table name updates
- manyToManyMapping.getResolvedTargetEntity().getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", joinTable.getDefaultName());
-
- //set a table on the owning entity, very default join table name updates
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", joinTable.getDefaultName());
- }
-
- public void testDefaultJoinColumns() throws Exception {
- createTestEntityWithValidManyToMany();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ormPersistentType.getAttributeNamed("projects").addToXml();
- OrmManyToManyMapping manyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("projects").getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JoinColumn joinColumn = joinTable.getJoinColumns().iterator().next();
- JoinColumn inverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add target entity to the persistence unit, join column default name and referenced column still null because owning entity has no primary key
- createTargetEntity();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //create primary key in owning entity
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(TYPE_NAME + "_id", joinColumn.getDefaultName());
- assertEquals("id", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //set specified column name on primary key in owning entity
- ((IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
- assertNull(manyToMany.getJoinTable());
-
- //target entity does not resolve, inverse join column name and referenced column name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //default target entity does resolve, so defaults for join column are back
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add the join table xml element, verify default join column defaults are the same
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
- assertNotNull(manyToMany.getJoinTable());
- }
-
- public void testDefaultJoinColumnsBidirectionalRelationship() throws Exception {
- createTestEntityWithValidManyToMany();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- ormPersistentType.getAttributeNamed("projects").addToXml();
- OrmManyToManyMapping manyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("projects").getMapping();
- JoinTable joinTable = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable();
- JoinColumn joinColumn = joinTable.getJoinColumns().iterator().next();
- JoinColumn inverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
-
- //joinTable default name is null because targetEntity is not in the persistence unit
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add target entity to the persistence unit, join column default name and referenced column still null because owning entity has no primary key
- createTargetEntityWithBackPointer();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Project");
- assertNull(joinColumn.getDefaultName());
- assertNull(joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //create primary key in owning entity
- ormPersistentType.getJavaPersistentType().getAttributeNamed("id").setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("employees_id", joinColumn.getDefaultName());
- assertEquals("id", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //set specified column name on primary key in owning entity
- ((IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping()).getColumn().setSpecifiedName("MY_ID");
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
- assertNull(manyToMany.getJoinTable());
-
- //target entity does not resolve, inverse join column name and referenced column name is null
- manyToManyMapping.setSpecifiedTargetEntity("Foo");
- assertEquals(TYPE_NAME + "_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertNull(inverseJoinColumn.getDefaultName());
- assertNull(inverseJoinColumn.getDefaultReferencedColumnName());
-
- //default target entity does resolve, so defaults for join column are back
- manyToManyMapping.setSpecifiedTargetEntity(null);
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
-
- //add the join table xml element, verify default join column defaults are the same
- manyToMany.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- assertEquals("employees_MY_ID", joinColumn.getDefaultName());
- assertEquals("MY_ID", joinColumn.getDefaultReferencedColumnName());
- assertEquals("projects_proj_id", inverseJoinColumn.getDefaultName());
- assertEquals("proj_id", inverseJoinColumn.getDefaultReferencedColumnName());
- assertNotNull(manyToMany.getJoinTable());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToManyMappingTests.java
deleted file mode 100644
index 883ca5cd2e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToManyMappingTests.java
+++ /dev/null
@@ -1,1088 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmManyToManyMappingTests extends ContextModelTestCase
-{
- public OrmManyToManyMappingTests(String name) {
- super(name);
- }
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEntityWithManyToManyMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertEquals("id", ormManyToManyMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertEquals("id", ormManyToManyMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToMany.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToMany.setTargetEntity(null);
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testModifyTargetEntity() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToMany.getTargetEntity());
-
- //set target entity to null in the context model
- ormManyToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(ormManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(manyToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- assertNull(manyToManyResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- manyToManyResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormManyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, manyToManyResource.getFetch());
-
- manyToManyResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, manyToManyResource.getFetch());
-
- //set fetch to null in the resource model
- manyToManyResource.setFetch(null);
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- assertNull(manyToManyResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- assertNull(manyToManyResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, manyToManyResource.getFetch());
- assertEquals(FetchType.EAGER, ormManyToManyMapping.getSpecifiedFetch());
-
- ormManyToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, manyToManyResource.getFetch());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormManyToManyMapping.setSpecifiedFetch(null);
- assertNull(manyToManyResource.getFetch());
- assertNull(ormManyToManyMapping.getSpecifiedFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- OrmMappedByRelationshipStrategy strategy = ormManyToManyMapping.getRelationship().getMappedByStrategy();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- manyToMany.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", manyToMany.getMappedBy());
-
- //setmappedBy to null in the resource model
- manyToMany.setMappedBy(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- OrmMappedByRelationshipStrategy strategy = ormManyToManyMapping.getRelationship().getMappedByStrategy();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- strategy.setMappedByAttribute("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", manyToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- strategy.setMappedByAttribute(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(manyToMany.getMappedBy());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToManyMapping contextMapping = (OrmManyToManyMapping) contextAttribute.getMapping();
- OrmManyToManyRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToMany resourceMapping = resourceEntity.getAttributes().getManyToManys().get(0);
-
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToManyMapping contextMapping = (OrmManyToManyMapping) contextAttribute.getMapping();
- OrmManyToManyRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToMany resourceMapping = resourceEntity.getAttributes().getManyToManys().get(0);
-
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNotNull(manyToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKey().setName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey().getName());
-
- manyToMany.getMapKey().setName("myMapKey");
- manyToMany.setMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setNoMapKey(true);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualManyToManyMapping.getSpecifiedMapKey());
- assertNull(virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertTrue(virtualManyToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualManyToManyMapping.getMapKey());
- assertTrue(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setCustomMapKey(true);
- javaManyToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualManyToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertTrue(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
- }
-
- public void testUpdateOrderBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(manyToMany.getOrderBy());
-
- //set orderBy in the resource model, verify context model updated
- manyToMany.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", manyToMany.getOrderBy());
-
- //set orderBy to null in the resource model
- manyToMany.setOrderBy(null);
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(manyToMany.getOrderBy());
- }
-
- public void testModifyOrderBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(manyToMany.getOrderBy());
-
- //set mappedBy in the context model, verify resource model updated
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", manyToMany.getOrderBy());
-
- //set mappedBy to null in the context model
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(manyToMany.getOrderBy());
- }
-
- public void testIsNoOrdering() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertFalse(ormManyToManyMapping.getOrderable().isNoOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- }
-
- public void testSetNoOrdering() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertFalse(ormManyToManyMapping.getOrderable().isNoOrdering());
-
- ormManyToManyMapping.getOrderable().setNoOrdering(true);
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertNull(ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-//TODO
-// public boolean isOrderByPk() {
-// return "".equals(getOrderBy());
-// }
-//
-// public void setOrderByPk() {
-// setOrderBy("");
-// }
-
- public void testIsCustomOrdering() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
-
- assertFalse(ormManyToManyMapping.getOrderable().isCustomOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertTrue(ormManyToManyMapping.getOrderable().isCustomOrdering());
-
- ormManyToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertFalse(ormManyToManyMapping.getOrderable().isCustomOrdering());
- }
-
- public void testManyToManyMorphToIdMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToVersionMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToTransientMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToEmbeddedMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToEmbeddedIdMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testManyToManyMorphToOneToOneMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testManyToManyMorphToOneToManyMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- JoinTable joinTable = ((OneToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("MY_JOIN_TABLE", joinTable.getName());
- assertEquals("name", joinTable.getJoinColumns().iterator().next().getSpecifiedName());
- assertEquals("referenceName", joinTable.getJoinColumns().iterator().next().getSpecifiedReferencedColumnName());
- assertEquals("inverseName", joinTable.getInverseJoinColumns().iterator().next().getSpecifiedName());
- assertEquals("inverseReferenceName", joinTable.getInverseJoinColumns().iterator().next().getSpecifiedReferencedColumnName());
- }
-
- public void testManyToManyMorphToManyToOneMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(manyToManyMapping.isDefault());
- manyToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- manyToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- manyToManyMapping.setSpecifiedMapKey("mapKey");
- manyToManyMapping.getCascade().setAll(true);
- manyToManyMapping.getCascade().setMerge(true);
- manyToManyMapping.getCascade().setPersist(true);
- manyToManyMapping.getCascade().setRefresh(true);
- manyToManyMapping.getCascade().setRemove(true);
- assertFalse(manyToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").addToXml();
- OrmManyToManyMapping specifiedManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- specifiedManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- specifiedManyToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualManyToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(virtualManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.addToXml(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = ormManyToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToOneMappingTests.java
deleted file mode 100644
index 45c19e442b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmManyToOneMappingTests.java
+++ /dev/null
@@ -1,629 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmManyToOneMappingTests extends ContextModelTestCase
-{
- public OrmManyToOneMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEntityWithManyToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertEquals("id", ormManyToOneMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertEquals("id", ormManyToOneMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- manyToOne.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- manyToOne.setTargetEntity(null);
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testModifyTargetEntity() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormManyToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", manyToOne.getTargetEntity());
-
- //set target entity to null in the context model
- ormManyToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertNull(manyToOne.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(manyToOneResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- manyToOneResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, manyToOneResource.getFetch());
-
- manyToOneResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormManyToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, manyToOneResource.getFetch());
-
- //set fetch to null in the resource model
- manyToOneResource.setFetch(null);
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(manyToOneResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(manyToOneResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormManyToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, manyToOneResource.getFetch());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getSpecifiedFetch());
-
- ormManyToOneMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, manyToOneResource.getFetch());
- assertEquals(FetchType.LAZY, ormManyToOneMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormManyToOneMapping.setSpecifiedFetch(null);
- assertNull(manyToOneResource.getFetch());
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOneResource.getOptional());
-
- //set optional in the resource model, verify context model updated
- manyToOneResource.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormManyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, manyToOneResource.getOptional());
-
- manyToOneResource.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormManyToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, manyToOneResource.getOptional());
-
- //set optional to null in the resource model
- manyToOneResource.setOptional(null);
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOneResource.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(manyToOneResource.getOptional());
-
- //set optional in the context model, verify resource model updated
- ormManyToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, manyToOneResource.getOptional());
- assertEquals(Boolean.TRUE, ormManyToOneMapping.getSpecifiedOptional());
-
- ormManyToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOneResource.getOptional());
- assertEquals(Boolean.FALSE, ormManyToOneMapping.getSpecifiedOptional());
-
- //set optional to null in the context model
- ormManyToOneMapping.setSpecifiedOptional(null);
- assertNull(manyToOneResource.getOptional());
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnStrategy();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- OrmJoinColumn joinColumn = strategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = strategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = strategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnStrategy();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- strategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- strategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToOneResource.getJoinColumns().size());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, manyToOneResource.getJoinColumns().size());
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(1).getName());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, manyToOneResource.getJoinColumns().size());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(0).getName());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, manyToOneResource.getJoinColumns().size());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping contextMapping = (OrmManyToOneMapping) contextAttribute.getMapping();
- OrmManyToOneRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(rel.strategyIsJoinColumn());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(rel.strategyIsJoinColumn());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping contextMapping = (OrmManyToOneMapping) contextAttribute.getMapping();
- OrmManyToOneRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(rel.strategyIsJoinColumn());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(rel.strategyIsJoinColumn());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(rel.strategyIsJoinColumn());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnStrategy();
- XmlManyToOne manyToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToOnes().get(0);
-
- strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- strategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- strategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToOneResource.getJoinColumns().size());
-
-
- strategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(2).getName());
-
-
- strategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", manyToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAR", manyToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", manyToOneResource.getJoinColumns().get(2).getName());
- }
-
-
- public void testManyToOneMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- ormManyToOneMapping.setName("foo");
- OrmJoinColumnRelationshipStrategy strategy = ormManyToOneMapping.getRelationship().getJoinColumnStrategy();
-
- assertEquals("foo", ormManyToOneMapping.getName());
-
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getFetch());
- assertEquals(true, ormManyToOneMapping.isOptional());
- assertNull(ormManyToOneMapping.getTargetEntity());
-
-
- assertFalse(strategy.getSpecifiedJoinColumns().iterator().hasNext());
- //TODO default joinColumns
- //assertTrue(ormManyToOneMapping.defaultJoinColumns().hasNext());
-
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", manyToOneMapping.getName());
- assertEquals(FetchType.LAZY, manyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, manyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", manyToOneMapping.getSpecifiedTargetEntity());
-
- JoinColumn joinColumn = manyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", joinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", joinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", joinColumn.getSpecifiedTable());
-
- Cascade cascade = manyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.addToXml(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(true, ormManyToOneMapping.isDefaultOptional());
- //TODO hmm, is this correct?
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormManyToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormManyToOneMapping.getName());
- assertNull(ormManyToOneMapping.getSpecifiedFetch());
- assertNull(ormManyToOneMapping.getSpecifiedOptional());
- assertNull(ormManyToOneMapping.getSpecifiedTargetEntity());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getFetch());
- assertEquals(true, ormManyToOneMapping.isOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- assertFalse(ormManyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().hasNext());
-
- //TODO default join columns for specified xmlManyToOne mapping
-// XmlJoinColumn ormJoinColumn = ormManyToOneMapping.defaultJoinColumns().next();
-// assertNull(ormJoinColumn.getSpecifiedName());
-// assertNull(ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertNull(ormJoinColumn.getSpecifiedUnique());
-// assertNull(ormJoinColumn.getSpecifiedNullable());
-// assertNull(ormJoinColumn.getSpecifiedInsertable());
-// assertNull(ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertNull(ormJoinColumn.getSpecifiedTable());
-//
-// assertEquals("address", ormJoinColumn.getDefaultName());
-// assertEquals("address", ormJoinColumn.getDefaultReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getDefaultUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultUpdatable());
-// assertEquals(null, ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getDefaultTable());
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- //3 things tested above
- //1. virtual mapping metadata complete=false - defaults are taken from the java annotations
- //2. virtual mapping metadata complete=true - defaults are taken from java defaults,annotations ignored
- //3. specified mapping (metadata complete=true/false - defaults are taken from java annotations
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmMappedSuperclassTests.java
deleted file mode 100644
index f778dc33ec..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,386 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.IdClassReference;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmMappedSuperclassTests extends ContextModelTestCase
-{
- public OrmMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private void createTestIdClass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("public class ").append("TestTypeId").append(" ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "TestTypeId.java", sourceWriter);
- }
-
- public void testUpdateClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals("model.Foo", mappedSuperclassResource.getClassName());
-
- //set class in the resource model, verify context model updated
- mappedSuperclassResource.setClassName("com.Bar");
- assertEquals("com.Bar", ormMappedSuperclass.getClass_());
- assertEquals("com.Bar", mappedSuperclassResource.getClassName());
-
- //set class to null in the resource model
- mappedSuperclassResource.setClassName(null);
- assertNull(ormMappedSuperclass.getClass_());
- assertNull(mappedSuperclassResource.getClassName());
- }
-
- public void testModifyClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals("model.Foo", ormMappedSuperclass.getClass_());
- assertEquals("model.Foo", mappedSuperclassResource.getClassName());
-
- //set class in the context model, verify resource model modified
- ormMappedSuperclass.setClass("com.Bar");
- assertEquals("com.Bar", ormMappedSuperclass.getClass_());
- assertEquals("com.Bar", mappedSuperclassResource.getClassName());
-
- //set class to null in the context model
- ormMappedSuperclass.setClass(null);
- assertNull(ormMappedSuperclass.getClass_());
- assertNull(mappedSuperclassResource.getClassName());
- }
- //TODO add tests for setting the className when the package is set on entity-mappings
-
- public void testUpdateSpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
-
- //set access in the resource model, verify context model updated
- mappedSuperclassResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, mappedSuperclassResource.getAccess());
-
- //set access to null in the resource model
- mappedSuperclassResource.setAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
-
- //set access in the context model, verify resource model modified
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, mappedSuperclassResource.getAccess());
-
- //set access to null in the context model
- ormPersistentType.setSpecifiedAccess(null);
- assertNull(ormPersistentType.getSpecifiedAccess());
- assertNull(mappedSuperclassResource.getAccess());
- }
- //TODO test default access from
- //underlying java
- //persistence-unit-defaults
- //entity-mappings
- //with xml-mapping-metadata-complete set
-
- public void testUpdateSpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- //set metadata-complete in the resource model, verify context model updated
- mappedSuperclassResource.setMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, mappedSuperclassResource.getMetadataComplete());
-
- //set access to false in the resource model
- mappedSuperclassResource.setMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, mappedSuperclassResource.getMetadataComplete());
-
- mappedSuperclassResource.setMetadataComplete(null);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
- public void testModifySpecifiedMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0); assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- //set access in the context model, verify resource model modified
- ormMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(Boolean.TRUE, mappedSuperclassResource.getMetadataComplete());
-
- //set access to null in the context model
- ormMappedSuperclass.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertEquals(Boolean.FALSE, mappedSuperclassResource.getMetadataComplete());
-
- ormMappedSuperclass.setSpecifiedMetadataComplete(null);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
- public void testUpdateDefaultMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(ormMappedSuperclass.isOverrideMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormMappedSuperclass.isOverrideMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(ormMappedSuperclass.isOverrideMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
- public void testUpdateMetadataComplete() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertFalse(ormMappedSuperclass.isMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(ormMappedSuperclass.isMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(ormMappedSuperclass.isMetadataComplete());
- assertNull(ormMappedSuperclass.getSpecifiedMetadataComplete());
- assertNull(mappedSuperclassResource.getMetadataComplete());
- }
-
-
- public void testMakeMappedSuperclassEntity() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclassPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, mappedSuperclassPersistentType.getSpecifiedAccess());
- }
-
- //test with 2 MappedSuperclasses, make the first one an Entity so it has to move to the end of the list
- public void testMakeMappedSuperclassEntity2() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclassPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- XmlEntity entity = getXmlEntityMappings().getEntities().get(0);
- assertEquals("model.Foo", entity.getClassName());
- assertEquals(Boolean.TRUE, entity.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, entity.getAccess());
- assertNull(entity.getDiscriminatorValue());
- assertNull(entity.getName());
-
- OrmEntity ormEntity = (OrmEntity) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEntity.getClass_());
- assertEquals(Boolean.TRUE, ormEntity.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, mappedSuperclassPersistentType.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().getPersistentTypes().iterator();
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
- public void testMakeMappedSuperclassEmbeddable() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclassPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, mappedSuperclassPersistentType.getSpecifiedAccess());
- }
- //test with 2 MappedSuperclasses, make the first one an Embeddable so it has to move to the end of the list
- public void testMakeMappedSuperclassEmbeddable2() throws Exception {
- OrmPersistentType mappedSuperclassPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo2");
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) mappedSuperclassPersistentType.getMapping();
- mappedSuperclassPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- mappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- mappedSuperclassPersistentType.setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- XmlEmbeddable embeddable = getXmlEntityMappings().getEmbeddables().get(0);
- assertEquals("model.Foo", embeddable.getClassName());
- assertEquals(Boolean.TRUE, embeddable.getMetadataComplete());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, embeddable.getAccess());
-
- OrmEmbeddable ormEmbeddable = (OrmEmbeddable) mappedSuperclassPersistentType.getMapping();
- assertEquals("model.Foo", ormEmbeddable.getClass_());
- assertEquals(Boolean.TRUE, ormEmbeddable.getSpecifiedMetadataComplete());
- assertEquals(AccessType.PROPERTY, mappedSuperclassPersistentType.getSpecifiedAccess());
-
- ListIterator<OrmPersistentType> persistentTypes = getEntityMappings().getPersistentTypes().iterator();
- assertEquals(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, persistentTypes.next().getMappingKey());
- }
-
- public void testUpdateIdClass() throws Exception {
- createTestIdClass();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
-
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- IdClassReference idClassRef = ormMappedSuperclass.getIdClassReference();
-
- assertNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- mappedSuperclassResource.setIdClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNotNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- mappedSuperclassResource.getIdClass().setClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, mappedSuperclassResource.getIdClass().getClassName());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- mappedSuperclassResource.getIdClass().setClassName(existentIdClassName);
- assertEquals(existentIdClassName, mappedSuperclassResource.getIdClass().getClassName());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- //test setting @IdClass value to null, id-class tag is not removed
- mappedSuperclassResource.getIdClass().setClassName(null);
- assertNotNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- //reset @IdClass value and then remove id-class tag
- mappedSuperclassResource.setIdClass(OrmFactory.eINSTANCE.createXmlClassReference());
- mappedSuperclassResource.getIdClass().setClassName("model.Foo");
- mappedSuperclassResource.setIdClass(null);
- assertNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-
- public void testModifyIdClass() throws Exception {
- createTestIdClass();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Foo");
-
- XmlMappedSuperclass mappedSuperclassResource = getXmlEntityMappings().getMappedSuperclasses().get(0);
- OrmMappedSuperclass ormMappedSuperclass = (OrmMappedSuperclass) ormPersistentType.getMapping();
- IdClassReference idClassRef = ormMappedSuperclass.getIdClassReference();
-
- assertNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String nonExistentIdClassName = PACKAGE_NAME + ".Foo";
- idClassRef.setSpecifiedIdClassName(nonExistentIdClassName);
- assertEquals(nonExistentIdClassName, mappedSuperclassResource.getIdClass().getClassName());
- assertEquals(nonExistentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
-
- String existentIdClassName = PACKAGE_NAME + ".TestTypeId";
- idClassRef.setSpecifiedIdClassName(existentIdClassName);
- assertEquals(existentIdClassName, mappedSuperclassResource.getIdClass().getClassName());
- assertEquals(existentIdClassName, idClassRef.getSpecifiedIdClassName());
- assertNotNull(idClassRef.getIdClass());
-
- idClassRef.setSpecifiedIdClassName(null);
- assertNull(mappedSuperclassResource.getIdClass());
- assertNull(idClassRef.getSpecifiedIdClassName());
- assertNull(idClassRef.getIdClass());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java
deleted file mode 100644
index f5bcbe0f55..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedNativeQueryTests.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmNamedNativeQueryTests extends ContextModelTestCase
-{
- public OrmNamedNativeQueryTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setName("newName");
- assertEquals("newName", ormNamedNativeQuery.getName());
- assertEquals("newName", namedNativeQueryResource.getName());
-
- //set name to null in the resource model
- namedNativeQueryResource.setName(null);
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setName("newName");
- assertEquals("newName", ormNamedNativeQuery.getName());
- assertEquals("newName", namedNativeQueryResource.getName());
-
- //set name to null in the context model
- ormNamedNativeQuery.setName(null);
- assertNull(ormNamedNativeQuery.getName());
- assertNull(namedNativeQueryResource.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setQuery("newName");
- assertEquals("newName", ormNamedNativeQuery.getQuery());
- assertEquals("newName", namedNativeQueryResource.getQuery());
-
- //set name to null in the resource model
- namedNativeQueryResource.setQuery(null);
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setQuery("newName");
- assertEquals("newName", ormNamedNativeQuery.getQuery());
- assertEquals("newName", namedNativeQueryResource.getQuery());
-
- //set name to null in the context model
- ormNamedNativeQuery.setQuery(null);
- assertNull(ormNamedNativeQuery.getQuery());
- assertNull(namedNativeQueryResource.getQuery());
- }
-
- public void testAddHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- OrmQueryHint queryHint = ormNamedNativeQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", namedNativeQueryResource.getHints().get(0).getName());
-
- OrmQueryHint queryHint2 = ormNamedNativeQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(1).getName());
-
- OrmQueryHint queryHint3 = ormNamedNativeQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(2).getName());
-
- ListIterator<OrmQueryHint> queryHints = ormNamedNativeQuery.getHints().iterator();
- assertEquals(queryHint2, queryHints.next());
- assertEquals(queryHint3, queryHints.next());
- assertEquals(queryHint, queryHints.next());
-
- queryHints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAR", queryHints.next().getName());
- assertEquals("BAZ", queryHints.next().getName());
- assertEquals("FOO", queryHints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- ormNamedNativeQuery.addHint(0).setName("FOO");
- ormNamedNativeQuery.addHint(1).setName("BAR");
- ormNamedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedNativeQueryResource.getHints().size());
-
- ormNamedNativeQuery.removeHint(0);
- assertEquals(2, namedNativeQueryResource.getHints().size());
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(1).getName());
-
- ormNamedNativeQuery.removeHint(0);
- assertEquals(1, namedNativeQueryResource.getHints().size());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(0).getName());
-
- ormNamedNativeQuery.removeHint(0);
- assertEquals(0, namedNativeQueryResource.getHints().size());
- }
-
- public void testMoveHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- ormNamedNativeQuery.addHint(0).setName("FOO");
- ormNamedNativeQuery.addHint(1).setName("BAR");
- ormNamedNativeQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedNativeQueryResource.getHints().size());
-
-
- ormNamedNativeQuery.moveHint(2, 0);
- ListIterator<OrmQueryHint> hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(2).getName());
-
-
- ormNamedNativeQuery.moveHint(0, 1);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", namedNativeQueryResource.getHints().get(0).getName());
- assertEquals("BAR", namedNativeQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedNativeQueryResource.getHints().get(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedNativeQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
-
- namedNativeQueryResource.getHints().get(0).setName("FOO");
- namedNativeQueryResource.getHints().get(1).setName("BAR");
- namedNativeQueryResource.getHints().get(2).setName("BAZ");
-
- ListIterator<OrmQueryHint> hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().move(2, 0);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().move(0, 1);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().remove(1);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().remove(1);
- hints = ormNamedNativeQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedNativeQueryResource.getHints().remove(0);
- assertFalse(ormNamedNativeQuery.getHints().iterator().hasNext());
- }
-
-
- public void testUpdateResultSetMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultSetMapping());
- assertEquals(null, ormNamedNativeQuery.getResultSetMapping());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setResultSetMapping("foo");
- assertEquals("foo", namedNativeQueryResource.getResultSetMapping());
- assertEquals("foo", ormNamedNativeQuery.getResultSetMapping());
-
- //set name to null in the resource model
- namedNativeQueryResource.setResultSetMapping(null);
- assertNull(namedNativeQueryResource.getResultSetMapping());
- assertNull(ormNamedNativeQuery.getResultSetMapping());
- }
-
- public void testModifyResultSetMapping() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultSetMapping());
- assertEquals(null, ormNamedNativeQuery.getResultSetMapping());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setResultSetMapping("foo");
- assertEquals("foo", namedNativeQueryResource.getResultSetMapping());
- assertEquals("foo", ormNamedNativeQuery.getResultSetMapping());
-
- //set name to null in the context model
- ormNamedNativeQuery.setResultSetMapping(null);
- assertNull(namedNativeQueryResource.getResultSetMapping());
- assertNull(ormNamedNativeQuery.getResultSetMapping());
- }
-
- public void testUpdateResultClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultClass());
- assertEquals(null, ormNamedNativeQuery.getResultClass());
-
- //set name in the resource model, verify context model updated
- namedNativeQueryResource.setResultClass("foo");
- assertEquals("foo", namedNativeQueryResource.getResultClass());
- assertEquals("foo", ormNamedNativeQuery.getResultClass());
-
- //set name to null in the resource model
- namedNativeQueryResource.setResultClass(null);
- assertNull(namedNativeQueryResource.getResultClass());
- assertNull(ormNamedNativeQuery.getResultClass());
- }
-
- public void testModifyResultClass() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedNativeQuery ormNamedNativeQuery = ormEntity.getQueryContainer().addNamedNativeQuery(0);
-
- XmlNamedNativeQuery namedNativeQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedNativeQueries().get(0);
-
- assertEquals(null, namedNativeQueryResource.getResultClass());
- assertEquals(null, ormNamedNativeQuery.getResultClass());
-
- //set name in the context model, verify resource model updated
- ormNamedNativeQuery.setResultClass("foo");
- assertEquals("foo", namedNativeQueryResource.getResultClass());
- assertEquals("foo", ormNamedNativeQuery.getResultClass());
-
- //set name to null in the context model
- ormNamedNativeQuery.setResultClass(null);
- assertNull(namedNativeQueryResource.getResultClass());
- assertNull(ormNamedNativeQuery.getResultClass());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedQueryTests.java
deleted file mode 100644
index 61c3126611..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmNamedQueryTests.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmNamedQueryTests extends ContextModelTestCase
-{
- public OrmNamedQueryTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
-
- //set name in the resource model, verify context model updated
- namedQueryResource.setName("newName");
- assertEquals("newName", ormNamedQuery.getName());
- assertEquals("newName", namedQueryResource.getName());
-
- //set name to null in the resource model
- namedQueryResource.setName(null);
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
-
- //set name in the context model, verify resource model updated
- ormNamedQuery.setName("newName");
- assertEquals("newName", ormNamedQuery.getName());
- assertEquals("newName", namedQueryResource.getName());
-
- //set name to null in the context model
- ormNamedQuery.setName(null);
- assertNull(ormNamedQuery.getName());
- assertNull(namedQueryResource.getName());
- }
-
- public void testUpdateQuery() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
-
- //set name in the resource model, verify context model updated
- namedQueryResource.setQuery("newName");
- assertEquals("newName", ormNamedQuery.getQuery());
- assertEquals("newName", namedQueryResource.getQuery());
-
- //set name to null in the resource model
- namedQueryResource.setQuery(null);
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
- }
-
- public void testModifyQuery() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
-
- //set name in the context model, verify resource model updated
- ormNamedQuery.setQuery("newName");
- assertEquals("newName", ormNamedQuery.getQuery());
- assertEquals("newName", namedQueryResource.getQuery());
-
- //set name to null in the context model
- ormNamedQuery.setQuery(null);
- assertNull(ormNamedQuery.getQuery());
- assertNull(namedQueryResource.getQuery());
- }
-
- public void testAddHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- OrmQueryHint queryHint = ormNamedQuery.addHint(0);
- queryHint.setName("FOO");
-
- assertEquals("FOO", namedQueryResource.getHints().get(0).getName());
-
- OrmQueryHint queryHint2 = ormNamedQuery.addHint(0);
- queryHint2.setName("BAR");
-
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(1).getName());
-
- OrmQueryHint queryHint3 = ormNamedQuery.addHint(1);
- queryHint3.setName("BAZ");
-
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(2).getName());
-
- ListIterator<OrmQueryHint> queryHints = ormNamedQuery.getHints().iterator();
- assertEquals(queryHint2, queryHints.next());
- assertEquals(queryHint3, queryHints.next());
- assertEquals(queryHint, queryHints.next());
-
- queryHints = ormNamedQuery.getHints().iterator();
- assertEquals("BAR", queryHints.next().getName());
- assertEquals("BAZ", queryHints.next().getName());
- assertEquals("FOO", queryHints.next().getName());
- }
-
- public void testRemoveHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- ormNamedQuery.addHint(0).setName("FOO");
- ormNamedQuery.addHint(1).setName("BAR");
- ormNamedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedQueryResource.getHints().size());
-
- ormNamedQuery.removeHint(0);
- assertEquals(2, namedQueryResource.getHints().size());
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedQueryResource.getHints().get(1).getName());
-
- ormNamedQuery.removeHint(0);
- assertEquals(1, namedQueryResource.getHints().size());
- assertEquals("BAZ", namedQueryResource.getHints().get(0).getName());
-
- ormNamedQuery.removeHint(0);
- assertEquals(0, namedQueryResource.getHints().size());
- }
-
- public void testMoveHint() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- ormNamedQuery.addHint(0).setName("FOO");
- ormNamedQuery.addHint(1).setName("BAR");
- ormNamedQuery.addHint(2).setName("BAZ");
-
- assertEquals(3, namedQueryResource.getHints().size());
-
-
- ormNamedQuery.moveHint(2, 0);
- ListIterator<OrmQueryHint> hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAR", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAZ", namedQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(2).getName());
-
-
- ormNamedQuery.moveHint(0, 1);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
-
- assertEquals("BAZ", namedQueryResource.getHints().get(0).getName());
- assertEquals("BAR", namedQueryResource.getHints().get(1).getName());
- assertEquals("FOO", namedQueryResource.getHints().get(2).getName());
- }
-
- public void testUpdateHints() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmNamedQuery ormNamedQuery = ormEntity.getQueryContainer().addNamedQuery(0);
-
- XmlNamedQuery namedQueryResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0);
-
- namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
- namedQueryResource.getHints().add(OrmFactory.eINSTANCE.createXmlQueryHint());
-
- namedQueryResource.getHints().get(0).setName("FOO");
- namedQueryResource.getHints().get(1).setName("BAR");
- namedQueryResource.getHints().get(2).setName("BAZ");
-
- ListIterator<OrmQueryHint> hints = ormNamedQuery.getHints().iterator();
- assertEquals("FOO", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().move(2, 0);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAR", hints.next().getName());
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().move(0, 1);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("BAR", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().remove(1);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertEquals("FOO", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().remove(1);
- hints = ormNamedQuery.getHints().iterator();
- assertEquals("BAZ", hints.next().getName());
- assertFalse(hints.hasNext());
-
- namedQueryResource.getHints().remove(0);
- assertFalse(ormNamedQuery.getHints().iterator().hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToManyMappingTests.java
deleted file mode 100644
index 251000ad4c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToManyMappingTests.java
+++ /dev/null
@@ -1,1080 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmOneToManyMappingTests extends ContextModelTestCase
-{
- public OrmOneToManyMappingTests(String name) {
- super(name);
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithOneToManyMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each :ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals("id", ormOneToManyMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals("id", ormOneToManyMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToMany.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToMany.setTargetEntity(null);
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testModifyTargetEntity() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToManyMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToMany.getTargetEntity());
-
- //set target entity to null in the context model
- ormOneToManyMapping.setSpecifiedTargetEntity(null);
- assertNull(ormOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(oneToMany.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- assertNull(oneToManyResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToManyResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormOneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, oneToManyResource.getFetch());
-
- oneToManyResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, oneToManyResource.getFetch());
-
- //set fetch to null in the resource model
- oneToManyResource.setFetch(null);
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- assertNull(oneToManyResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- assertNull(oneToManyResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, oneToManyResource.getFetch());
- assertEquals(FetchType.EAGER, ormOneToManyMapping.getSpecifiedFetch());
-
- ormOneToManyMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, oneToManyResource.getFetch());
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormOneToManyMapping.setSpecifiedFetch(null);
- assertNull(oneToManyResource.getFetch());
- assertNull(ormOneToManyMapping.getSpecifiedFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- OrmMappedByRelationshipStrategy strategy = ormOneToManyMapping.getRelationship().getMappedByStrategy();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToMany.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToMany.getMappedBy());
-
- //setmappedBy to null in the resource model
- oneToMany.setMappedBy(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- OrmMappedByRelationshipStrategy strategy = ormOneToManyMapping.getRelationship().getMappedByStrategy();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- strategy.setMappedByAttribute("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToMany.getMappedBy());
-
- //set mappedBy to null in the context model
- strategy.setMappedByAttribute(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToMany.getMappedBy());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToManyMapping contextMapping = (OrmOneToManyMapping) contextAttribute.getMapping();
- OrmOneToManyRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToManyMapping contextMapping = (OrmOneToManyMapping) contextAttribute.getMapping();
- OrmOneToManyRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNotNull(oneToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKey().setName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey().getName());
-
- oneToMany.getMapKey().setName("myMapKey");
- oneToMany.setMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualOneToManyMapping.getSpecifiedMapKey());
- assertNull(virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertTrue(virtualOneToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualOneToManyMapping.getMapKey());
- assertTrue(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertFalse(virtualOneToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setCustomMapKey(true);
- javaOneToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualOneToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertTrue(virtualOneToManyMapping.isCustomMapKey());
- assertFalse(virtualOneToManyMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setNoMapKey(true);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testUpdateOrderBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(oneToMany.getOrderBy());
-
- //set orderBy in the resource model, verify context model updated
- oneToMany.setOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", oneToMany.getOrderBy());
-
- //set orderBy to null in the resource model
- oneToMany.setOrderBy(null);
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(oneToMany.getOrderBy());
- }
-
- public void testModifyOrderBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(oneToMany.getOrderBy());
-
- //set mappedBy in the context model, verify resource model updated
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("newOrderBy");
- assertEquals("newOrderBy", ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertEquals("newOrderBy", oneToMany.getOrderBy());
-
- //set mappedBy to null in the context model
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- assertNull(oneToMany.getOrderBy());
- }
-
- public void testIsNoOrdering() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
-
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertFalse(ormOneToManyMapping.getOrderable().isNoOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- }
-
- public void testSetNoOrdering() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
-
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertFalse(ormOneToManyMapping.getOrderable().isNoOrdering());
-
- ormOneToManyMapping.getOrderable().setNoOrdering(true);
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- assertNull(ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-//TODO
-// public boolean isOrderByPk() {
-// return "".equals(getOrderBy());
-// }
-//
-// public void setOrderByPk() {
-// setOrderBy("");
-// }
-
- public void testIsCustomOrdering() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
-
- assertFalse(ormOneToManyMapping.getOrderable().isCustomOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy("foo");
- assertTrue(ormOneToManyMapping.getOrderable().isCustomOrdering());
-
- ormOneToManyMapping.getOrderable().setSpecifiedOrderBy(null);
- assertFalse(ormOneToManyMapping.getOrderable().isCustomOrdering());
- }
-
- public void testOneToManyMorphToIdMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToVersionMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToTransientMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToEmbeddedMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToEmbeddedIdMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToManyMorphToOneToOneMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((OneToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToManyMorphToManyToManyMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- JoinColumn inverseJoinColumn = oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("inverseName");
- inverseJoinColumn.setSpecifiedReferencedColumnName("inverseReferenceName");
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- JoinTable joinTable = ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("MY_JOIN_TABLE", joinTable.getName());
- assertEquals("name", joinTable.getJoinColumns().iterator().next().getSpecifiedName());
- assertEquals("referenceName", joinTable.getJoinColumns().iterator().next().getSpecifiedReferencedColumnName());
- assertEquals("inverseName", joinTable.getInverseJoinColumns().iterator().next().getSpecifiedName());
- assertEquals("inverseReferenceName", joinTable.getInverseJoinColumns().iterator().next().getSpecifiedReferencedColumnName());
- }
-
- public void testOneToManyMorphToManyToOneMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToManyMapping.isDefault());
- oneToManyMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToManyMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("customOrder");
- oneToManyMapping.setSpecifiedMapKey("mapKey");
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToManyMapping.getCascade().setAll(true);
- oneToManyMapping.getCascade().setMerge(true);
- oneToManyMapping.getCascade().setPersist(true);
- oneToManyMapping.getCascade().setRefresh(true);
- oneToManyMapping.getCascade().setRemove(true);
- assertFalse(oneToManyMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) virtualAttribute.getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- OrmOneToManyMapping specifiedOneToManyMapping = (OrmOneToManyMapping) virtualAttribute.addToXml().getMapping();
- mapKeyNames = specifiedOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- specifiedOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = specifiedOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- specifiedOneToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = specifiedOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = virtualPersistentAttribute.addToXml(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getFetch());
- assertEquals("test.Address", ormOneToManyMapping.getTargetEntity());
- assertNull(ormOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = ormOneToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToOneMappingTests.java
deleted file mode 100644
index 39b5f335ed..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmOneToOneMappingTests.java
+++ /dev/null
@@ -1,1220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.MappedByRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneRelationship;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmOneToOneMappingTests extends ContextModelTestCase
-{
- public OrmOneToOneMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEntityWithOneToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals("id", ormOneToOneMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals("id", ormOneToOneMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the resource model, verify context model updated
- oneToOne.setTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the resource model
- oneToOne.setTargetEntity(null);
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testModifySpecifiedTargetEntity() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
-
- //set target entity in the context model, verify resource model updated
- ormOneToOneMapping.setSpecifiedTargetEntity("newTargetEntity");
- assertEquals("newTargetEntity", ormOneToOneMapping.getSpecifiedTargetEntity());
- assertEquals("newTargetEntity", oneToOne.getTargetEntity());
-
- //set target entity to null in the context model
- ormOneToOneMapping.setSpecifiedTargetEntity(null);
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOne.getTargetEntity());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOneResource.getFetch());
-
- //set fetch in the resource model, verify context model updated
- oneToOneResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, oneToOneResource.getFetch());
-
- oneToOneResource.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormOneToOneMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, oneToOneResource.getFetch());
-
- //set fetch to null in the resource model
- oneToOneResource.setFetch(null);
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOneResource.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(oneToOneResource.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormOneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, oneToOneResource.getFetch());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getSpecifiedFetch());
-
- ormOneToOneMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, oneToOneResource.getFetch());
- assertEquals(FetchType.LAZY, ormOneToOneMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormOneToOneMapping.setSpecifiedFetch(null);
- assertNull(oneToOneResource.getFetch());
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- }
-
- public void testUpdateMappedBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- MappedByRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getMappedByStrategy();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the resource model, verify context model updated
- oneToOne.setMappedBy("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToOne.getMappedBy());
-
- //set mappedBy to null in the resource model
- oneToOne.setMappedBy(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testModifyMappedBy() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- MappedByRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getMappedByStrategy();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
-
- //set mappedBy in the context model, verify resource model updated
- strategy.setMappedByAttribute("newMappedBy");
- assertEquals("newMappedBy", strategy.getMappedByAttribute());
- assertEquals("newMappedBy", oneToOne.getMappedBy());
-
- //set mappedBy to null in the context model
- strategy.setMappedByAttribute(null);
- assertNull(strategy.getMappedByAttribute());
- assertNull(oneToOne.getMappedBy());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping contextMapping = (OrmOneToOneMapping) contextAttribute.getMapping();
- OrmOneToOneRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping contextMapping = (OrmOneToOneMapping) contextAttribute.getMapping();
- OrmOneToOneRelationship rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.getPrimaryKeyJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdateSpecifiedOptional() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOneResource.getOptional());
-
- //set optional in the resource model, verify context model updated
- oneToOneResource.setOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormOneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.TRUE, oneToOneResource.getOptional());
-
- oneToOneResource.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormOneToOneMapping.getSpecifiedOptional());
- assertEquals(Boolean.FALSE, oneToOneResource.getOptional());
-
- //set optional to null in the resource model
- oneToOneResource.setOptional(null);
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOneResource.getOptional());
- }
-
- public void testModifySpecifiedOptional() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(oneToOneResource.getOptional());
-
- //set optional in the context model, verify resource model updated
- ormOneToOneMapping.setSpecifiedOptional(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneResource.getOptional());
- assertEquals(Boolean.TRUE, ormOneToOneMapping.getSpecifiedOptional());
-
- ormOneToOneMapping.setSpecifiedOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneResource.getOptional());
- assertEquals(Boolean.FALSE, ormOneToOneMapping.getSpecifiedOptional());
-
- //set optional to null in the context model
- ormOneToOneMapping.setSpecifiedOptional(null);
- assertNull(oneToOneResource.getOptional());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- OrmJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- OrmJoinColumn joinColumn = strategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = strategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = strategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- OrmJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- strategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- strategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getJoinColumns().size());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, oneToOneResource.getJoinColumns().size());
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(1).getName());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, oneToOneResource.getJoinColumns().size());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(0).getName());
-
- strategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, oneToOneResource.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- OrmJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- strategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- strategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- strategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getJoinColumns().size());
-
-
- strategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(2).getName());
-
-
- strategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = strategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", oneToOneResource.getJoinColumns().get(0).getName());
- assertEquals("BAR", oneToOneResource.getJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getJoinColumns().get(2).getName());
- }
-
- public void testOneToOneMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- ormOneToOneMapping.setName("foo");
- assertEquals("foo", ormOneToOneMapping.getName());
-
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertNull(ormOneToOneMapping.getTargetEntity());
-
-
- assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnStrategy().getJoinColumnsSize() > 0);
- //TODO default joinColumns
- //assertTrue(ormOneToOneMapping.defaultJoinColumns().hasNext());
-
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", oneToOneMapping.getName());
- assertEquals(FetchType.LAZY, oneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, oneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", oneToOneMapping.getSpecifiedTargetEntity());
- assertNull(oneToOneMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- JoinColumn joinColumn =
- oneToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", joinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", joinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, joinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, joinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", joinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", joinColumn.getSpecifiedTable());
-
- Cascade cascade = oneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.addToXml(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormOneToOneMapping.getName());
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- //TODO default target entity in xml
- //assertEquals("test.Address", ormOneToOneMapping.getDefaultTargetEntity());
-
- assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnStrategy().getJoinColumnsSize() > 0);
-
- //TODO default join columns for specified xmlOneToOne mapping
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.defaultJoinColumns().next();
-// assertNull(ormJoinColumn.getSpecifiedName());
-// assertNull(ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertNull(ormJoinColumn.getSpecifiedUnique());
-// assertNull(ormJoinColumn.getSpecifiedNullable());
-// assertNull(ormJoinColumn.getSpecifiedInsertable());
-// assertNull(ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertNull(ormJoinColumn.getSpecifiedTable());
-//
-// assertEquals("address", ormJoinColumn.getDefaultName());
-// assertEquals("address", ormJoinColumn.getDefaultReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getDefaultUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultUpdatable());
-// assertEquals(null, ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getDefaultTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- }
-
-
- public void testOneToOneMorphToIdMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToVersionMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToTransientMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToEmbeddedMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToEmbeddedIdMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testOneToOneMorphToManyToManyMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToOneMorphToOneToManyMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertEquals("mappedBy", ((OneToManyMapping) ormPersistentAttribute.getMapping()).getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((OneToManyMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
- }
-
- public void testOneToOneMorphToManyToOneMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- assertEquals("TargetEntity", ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedTargetEntity());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isAll());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isMerge());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isPersist());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRefresh());
- assertTrue(((ManyToOneMapping) ormPersistentAttribute.getMapping()).getCascade().isRemove());
-
- joinColumn = ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("name", joinColumn.getName());
- assertEquals("referenceName", joinColumn.getReferencedColumnName());
- }
-
- public void testOneToOneMorphToBasicMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OneToOneMapping oneToOneMapping = (OneToOneMapping) ormPersistentAttribute.getMapping();
- assertFalse(oneToOneMapping.isDefault());
- oneToOneMapping.setSpecifiedFetch(FetchType.EAGER);
- oneToOneMapping.setSpecifiedTargetEntity("TargetEntity");
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("mappedBy");
- oneToOneMapping.getCascade().setAll(true);
- oneToOneMapping.getCascade().setMerge(true);
- oneToOneMapping.getCascade().setPersist(true);
- oneToOneMapping.getCascade().setRefresh(true);
- oneToOneMapping.getCascade().setRemove(true);
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("name");
- joinColumn.setSpecifiedReferencedColumnName("referenceName");
- assertFalse(oneToOneMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
-
-
-
-
- public void testAddPrimaryKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- OrmPrimaryKeyJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- OrmPrimaryKeyJoinColumn joinColumn = strategy.addPrimaryKeyJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- OrmPrimaryKeyJoinColumn joinColumn2 = strategy.addPrimaryKeyJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- OrmPrimaryKeyJoinColumn joinColumn3 = strategy.addPrimaryKeyJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(2).getName());
-
- ListIterator<OrmPrimaryKeyJoinColumn> joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemovePrimaryKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- OrmPrimaryKeyJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getPrimaryKeyJoinColumns().size());
-
- strategy.removePrimaryKeyJoinColumn(0);
- assertEquals(2, oneToOneResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- strategy.removePrimaryKeyJoinColumn(0);
- assertEquals(1, oneToOneResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- strategy.removePrimaryKeyJoinColumn(0);
- assertEquals(0, oneToOneResource.getPrimaryKeyJoinColumns().size());
- }
-
- public void testMovePrimaryKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- OrmPrimaryKeyJoinColumnRelationshipStrategy strategy = ormOneToOneMapping.getRelationship().getPrimaryKeyJoinColumnStrategy();
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- strategy.addPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- strategy.addPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- strategy.addPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToOneResource.getPrimaryKeyJoinColumns().size());
-
-
- strategy.movePrimaryKeyJoinColumn(2, 0);
- ListIterator<OrmPrimaryKeyJoinColumn> joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(2).getName());
-
-
- strategy.movePrimaryKeyJoinColumn(0, 1);
- joinColumns = strategy.getPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", oneToOneResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAR", oneToOneResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToOneResource.getPrimaryKeyJoinColumns().get(2).getName());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertNull(stateFooMapping);
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java
deleted file mode 100644
index 429125de57..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmPrimaryKeyJoinColumnTests.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmPrimaryKeyJoinColumnTests extends ContextModelTestCase
-{
- public OrmPrimaryKeyJoinColumnTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(primaryKeyJoinColumnResource.getName());
-
- //set name in the resource model, verify context model updated
- primaryKeyJoinColumnResource.setName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getName());
-
- //set name to null in the resource model
- primaryKeyJoinColumnResource.setName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(primaryKeyJoinColumnResource.getName());
-
- primaryKeyJoinColumnResource.setName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getName());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- assertTrue(entityResource.getPrimaryKeyJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(primaryKeyJoinColumnResource.getName());
-
- //set name in the context model, verify resource model modified
- ormPrimaryKeyJoinColumn.setSpecifiedName("foo");
- assertEquals("foo", ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertEquals("foo", primaryKeyJoinColumnResource.getName());
-
- //set name to null in the context model
- ormPrimaryKeyJoinColumn.setSpecifiedName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedName());
- assertNull(entityResource.getPrimaryKeyJoinColumns().get(0).getName());
- }
-
- public void testUpdateSpecifiedReferencedColumnName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name in the resource model, verify context model updated
- primaryKeyJoinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name to null in the resource model
- primaryKeyJoinColumnResource.setReferencedColumnName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(primaryKeyJoinColumnResource.getReferencedColumnName());
-
- primaryKeyJoinColumnResource.setReferencedColumnName("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("FOO", primaryKeyJoinColumnResource.getReferencedColumnName());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- assertTrue(entityResource.getPrimaryKeyJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedReferencedColumnName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name in the context model, verify resource model modified
- ormPrimaryKeyJoinColumn.setSpecifiedReferencedColumnName("foo");
- assertEquals("foo", ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals("foo", primaryKeyJoinColumnResource.getReferencedColumnName());
-
- //set name to null in the context model
- ormPrimaryKeyJoinColumn.setSpecifiedReferencedColumnName(null);
- assertNull(ormPrimaryKeyJoinColumn.getSpecifiedReferencedColumnName());
- assertNull(entityResource.getPrimaryKeyJoinColumns().get(0).getReferencedColumnName());
- }
-
-// public void testUpdateDefaultNameFromJavaTable() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.javaEntity().getTable().setSpecifiedName("Foo");
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-// ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.setSpecifiedMetadataComplete(null);
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-//
-// ormEntity.entityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-//
-// ormEntity.getTable().setSpecifiedName("Bar");
-// assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameNoJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// assertEquals("Foo", ormEntity.getTable().getDefaultName());
-// }
-//
-// public void testUpdateDefaultNameFromParent() throws Exception {
-// createTestEntity();
-// createTestSubType();
-//
-// OrmPersistentType parentOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmPersistentType childOrmPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-// XmlEntity parentXmlEntity = (XmlEntity) parentOrmPersistentType.getMapping();
-// XmlEntity childXmlEntity = (XmlEntity) childOrmPersistentType.getMapping();
-//
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.getTable().setSpecifiedName("FOO");
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-//
-// parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
-// assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
-// assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
-// }
-
-
- public void testUpdateSpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name in the resource model, verify context model updated
- primaryKeyJoinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertEquals("FOO", primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name to null in the resource model
- primaryKeyJoinColumnResource.setColumnDefinition(null);
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(primaryKeyJoinColumnResource.getColumnDefinition());
-
- primaryKeyJoinColumnResource.setColumnDefinition("FOO");
- assertEquals("FOO", ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertEquals("FOO", primaryKeyJoinColumnResource.getColumnDefinition());
-
- entityResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormEntity.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- assertTrue(entityResource.getPrimaryKeyJoinColumns().isEmpty());
- }
-
- public void testModifySpecifiedColumnDefinition() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmPrimaryKeyJoinColumn ormPrimaryKeyJoinColumn = ormEntity.addSpecifiedPrimaryKeyJoinColumn(0);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlPrimaryKeyJoinColumn primaryKeyJoinColumnResource = entityResource.getPrimaryKeyJoinColumns().get(0);
-
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name in the context model, verify resource model modified
- ormPrimaryKeyJoinColumn.setColumnDefinition("foo");
- assertEquals("foo", ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertEquals("foo", primaryKeyJoinColumnResource.getColumnDefinition());
-
- //set name to null in the context model
- ormPrimaryKeyJoinColumn.setColumnDefinition(null);
- assertNull(ormPrimaryKeyJoinColumn.getColumnDefinition());
- assertNull(entityResource.getPrimaryKeyJoinColumns().get(0).getColumnDefinition());
- }
-
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmQueryHintTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmQueryHintTests.java
deleted file mode 100644
index 9a96d1436a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmQueryHintTests.java
+++ /dev/null
@@ -1,122 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlQueryHint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmQueryHintTests extends ContextModelTestCase
-{
- public OrmQueryHintTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.getQueryContainer().addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
-
- //set name in the resource model, verify context model updated
- queryHintResource.setName("newName");
- assertEquals("newName", ormQueryHint.getName());
- assertEquals("newName", queryHintResource.getName());
-
- //set name to null in the resource model
- queryHintResource.setName(null);
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
- }
-
- public void testModifyName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.getQueryContainer().addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
-
- //set name in the context model, verify resource model updated
- ormQueryHint.setName("newName");
- assertEquals("newName", ormQueryHint.getName());
- assertEquals("newName", queryHintResource.getName());
-
- //set name to null in the context model
- ormQueryHint.setName(null);
- assertNull(ormQueryHint.getName());
- assertNull(queryHintResource.getName());
- }
-
- public void testUpdateValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.getQueryContainer().addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
-
- //set name in the resource model, verify context model updated
- queryHintResource.setValue("newName");
- assertEquals("newName", ormQueryHint.getValue());
- assertEquals("newName", queryHintResource.getValue());
-
- //set name to null in the resource model
- queryHintResource.setValue(null);
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
- }
-
- public void testModifyValue() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmQueryHint ormQueryHint = ormEntity.getQueryContainer().addNamedQuery(0).addHint(0);
-
- XmlQueryHint queryHintResource = getXmlEntityMappings().getEntities().get(0).getNamedQueries().get(0).getHints().get(0);
-
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
-
- //set name in the context model, verify resource model updated
- ormQueryHint.setValue("newName");
- assertEquals("newName", ormQueryHint.getValue());
- assertEquals("newName", queryHintResource.getValue());
-
- //set name to null in the context model
- ormQueryHint.setValue(null);
- assertNull(ormQueryHint.getValue());
- assertNull(queryHintResource.getValue());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSecondaryTableTests.java
deleted file mode 100644
index f9c29b218a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSecondaryTableTests.java
+++ /dev/null
@@ -1,767 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlySecondaryTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyUniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.SecondaryTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPrimaryKeyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSecondaryTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualSecondaryTable;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSecondaryTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmSecondaryTableTests extends ContextModelTestCase
-{
- public OrmSecondaryTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set name in the resource model, verify context model updated
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().get(0).setName("FOO");
- OrmSecondaryTable secondaryTable = ormEntity.getSpecifiedSecondaryTables().iterator().next();
- assertEquals("FOO", secondaryTable.getSpecifiedName());
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getName());
-
- //set name to null in the resource model
- entityResource.getSecondaryTables().get(0).setName(null);
- assertNull(secondaryTable.getSpecifiedName());
- assertNull(entityResource.getSecondaryTables().get(0).getName());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set name in the context model, verify resource model modified
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedName("foo");
-
- assertEquals("foo", secondaryTable.getSpecifiedName());
- assertEquals("foo", entityResource.getSecondaryTables().get(0).getName());
-
- //set name to null in the context model
- secondaryTable.setSpecifiedName(null);
- assertNull(secondaryTable.getSpecifiedName());
- assertNull(entityResource.getSecondaryTables().get(0).getName());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0).setSpecifiedName("FOO");
-
- ReadOnlySecondaryTable ormSecondaryTable = ormEntity.getVirtualSecondaryTables().iterator().next();
- assertEquals("FOO", ormSecondaryTable.getSpecifiedName());
-
- ormEntity.getJavaTypeMapping().getSpecifiedSecondaryTables().iterator().next().setSpecifiedName("BAZ");
- assertEquals("BAZ", ormSecondaryTable.getSpecifiedName());
-
- ormEntity.setSecondaryTablesAreDefinedInXml(true);
- assertNull(ormEntity.getSpecifiedSecondaryTables().iterator().next().getDefaultName());
- assertEquals("BAZ", ormEntity.getSpecifiedSecondaryTables().iterator().next().getSpecifiedName());
-
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set schema in the resource model, verify context model updated
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().get(0).setSchema("FOO");
- OrmSecondaryTable secondaryTable = ormEntity.getSpecifiedSecondaryTables().iterator().next();
- assertEquals("FOO", secondaryTable.getSpecifiedSchema());
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getSchema());
-
- //set schema to null in the resource model
- entityResource.getSecondaryTables().get(0).setSchema(null);
- assertNull(secondaryTable.getSpecifiedSchema());
- assertNull(entityResource.getSecondaryTables().get(0).getSchema());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set schema in the context model, verify resource model modified
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedSchema("foo");
-
- assertEquals("foo", secondaryTable.getSpecifiedSchema());
- assertEquals("foo", entityResource.getSecondaryTables().get(0).getSchema());
-
- //set schema to null in the context model
- secondaryTable.setSpecifiedSchema(null);
- assertNull(secondaryTable.getSpecifiedSchema());
- assertNull(entityResource.getSecondaryTables().get(0).getSchema());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testUpdateDefaultSchemaFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedSchema("BAR");
-
- OrmVirtualSecondaryTable ormSecondaryTable = ormEntity.getVirtualSecondaryTables().iterator().next();
- assertEquals("BAR", ormSecondaryTable.getSpecifiedSchema());
-
- javaSecondaryTable.setSpecifiedSchema("BAZ");
- assertEquals("BAZ", ormSecondaryTable.getSpecifiedSchema());
-
-
- ormEntity.setSecondaryTablesAreDefinedInXml(true);
- assertNull(ormEntity.getSpecifiedSecondaryTables().iterator().next().getDefaultSchema());
- assertEquals("BAZ", ormEntity.getSpecifiedSecondaryTables().iterator().next().getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentOrmEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childOrmEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertNull(parentOrmEntity.getTable().getDefaultSchema());
- assertNull(childOrmEntity.getTable().getDefaultSchema());
-
- parentOrmEntity.getTable().setSpecifiedSchema("FOO");
- assertNull(parentOrmEntity.getTable().getDefaultSchema());
- assertEquals("FOO", childOrmEntity.getTable().getDefaultSchema());
-
- parentOrmEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertNull(parentOrmEntity.getTable().getDefaultSchema());
- assertNull(childOrmEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- ormSecondaryTable.setSpecifiedName("FOO");
- assertNull(ormSecondaryTable.getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", ormSecondaryTable.getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", ormSecondaryTable.getDefaultSchema());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedSchema("JAVA_SCHEMA");
- assertEquals("BAR", ormSecondaryTable.getDefaultSchema()); //schema is not defaulted from underlying java
-
- getEntityMappings().setSpecifiedSchema(null);
- assertEquals("FOO", ormSecondaryTable.getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertNull(ormSecondaryTable.getDefaultSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set catalog in the resource model, verify context model updated
- entityResource.getSecondaryTables().add(OrmFactory.eINSTANCE.createXmlSecondaryTable());
- entityResource.getSecondaryTables().get(0).setCatalog("FOO");
- OrmSecondaryTable secondaryTable = ormEntity.getSpecifiedSecondaryTables().iterator().next();
- assertEquals("FOO", secondaryTable.getSpecifiedCatalog());
- assertEquals("FOO", entityResource.getSecondaryTables().get(0).getCatalog());
-
- //set catalog to null in the resource model
- entityResource.getSecondaryTables().get(0).setCatalog(null);
- assertNull(secondaryTable.getSpecifiedCatalog());
- assertNull(entityResource.getSecondaryTables().get(0).getCatalog());
-
- entityResource.getSecondaryTables().remove(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //set catalog in the context model, verify resource model modified
- OrmSecondaryTable secondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- secondaryTable.setSpecifiedCatalog("foo");
-
- assertEquals("foo", secondaryTable.getSpecifiedCatalog());
- assertEquals("foo", entityResource.getSecondaryTables().get(0).getCatalog());
-
- //set catalog to null in the context model
- secondaryTable.setSpecifiedCatalog(null);
- assertNull(secondaryTable.getSpecifiedCatalog());
- assertNull(entityResource.getSecondaryTables().get(0).getCatalog());
-
- ormEntity.removeSpecifiedSecondaryTable(0);
- assertFalse(ormEntity.getSpecifiedSecondaryTables().iterator().hasNext());
- assertEquals(0, entityResource.getSecondaryTables().size());
- }
-
- public void testUpdateDefaultCatalogFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedCatalog("BAR");
-
- OrmVirtualSecondaryTable ormSecondaryTable = ormEntity.getVirtualSecondaryTables().iterator().next();
- assertEquals("BAR", ormSecondaryTable.getSpecifiedCatalog());
-
- javaSecondaryTable.setSpecifiedCatalog("BAZ");
- assertEquals("BAZ", ormSecondaryTable.getSpecifiedCatalog());
-
- ormEntity.setSecondaryTablesAreDefinedInXml(true);
- assertNull(ormEntity.getSpecifiedSecondaryTables().iterator().next().getDefaultCatalog());
- assertEquals("BAZ", ormEntity.getSpecifiedSecondaryTables().iterator().next().getSpecifiedCatalog());
- }
-
- public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- ormSecondaryTable.setSpecifiedName("FOO");
- assertNull(ormSecondaryTable.getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", ormSecondaryTable.getDefaultCatalog());
-
- getEntityMappings().setSpecifiedCatalog("BAR");
- assertEquals("BAR", ormSecondaryTable.getDefaultCatalog());
-
- SecondaryTable javaSecondaryTable = ormEntity.getJavaTypeMapping().addSpecifiedSecondaryTable(0);
- javaSecondaryTable.setSpecifiedName("FOO");
- javaSecondaryTable.setSpecifiedCatalog("JAVA_CATALOG");
- assertEquals("BAR", ormSecondaryTable.getDefaultCatalog()); //schema is not defaulted from underlying java
-
- getEntityMappings().setSpecifiedCatalog(null);
- assertEquals("FOO", ormSecondaryTable.getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertNull(ormSecondaryTable.getDefaultCatalog());
- }
-
- public void testAddSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn2 = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0);
- primaryKeyJoinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- OrmPrimaryKeyJoinColumn primaryKeyJoinColumn3 = ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(1);
- primaryKeyJoinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(2).getName());
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals(primaryKeyJoinColumn2, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn3, primaryKeyJoinColumns.next());
- assertEquals(primaryKeyJoinColumn, primaryKeyJoinColumns.next());
-
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, secondaryTableResource.getPrimaryKeyJoinColumns().size());
-
- ormSecondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(2, secondaryTableResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
-
- ormSecondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(1, secondaryTableResource.getPrimaryKeyJoinColumns().size());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
-
- ormSecondaryTable.removeSpecifiedPrimaryKeyJoinColumn(0);
- assertEquals(0, secondaryTableResource.getPrimaryKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedPrimaryKeyJoinColumn() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(0).setSpecifiedName("FOO");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(1).setSpecifiedName("BAR");
- ormSecondaryTable.addSpecifiedPrimaryKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, secondaryTableResource.getPrimaryKeyJoinColumns().size());
-
-
- ormSecondaryTable.moveSpecifiedPrimaryKeyJoinColumn(2, 0);
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(2).getName());
-
-
- ormSecondaryTable.moveSpecifiedPrimaryKeyJoinColumn(0, 1);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
-
- assertEquals("BAZ", secondaryTableResource.getPrimaryKeyJoinColumns().get(0).getName());
- assertEquals("BAR", secondaryTableResource.getPrimaryKeyJoinColumns().get(1).getName());
- assertEquals("FOO", secondaryTableResource.getPrimaryKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdatePrimaryKeyJoinColumns() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- secondaryTableResource.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().get(0).setName("FOO");
- secondaryTableResource.getPrimaryKeyJoinColumns().get(1).setName("BAR");
- secondaryTableResource.getPrimaryKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmPrimaryKeyJoinColumn> primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().move(2, 0);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().move(0, 1);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("BAR", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertEquals("FOO", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().remove(1);
- primaryKeyJoinColumns = ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator();
- assertEquals("BAZ", primaryKeyJoinColumns.next().getName());
- assertFalse(primaryKeyJoinColumns.hasNext());
-
- secondaryTableResource.getPrimaryKeyJoinColumns().remove(0);
- assertFalse(ormSecondaryTable.getSpecifiedPrimaryKeyJoinColumns().iterator().hasNext());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- assertEquals(0, ormSecondaryTable.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormSecondaryTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = secondaryTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = secondaryTableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, secondaryTableResource.getUniqueConstraints().size());
-
- ormSecondaryTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormSecondaryTable.removeUniqueConstraint(1);
- uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormSecondaryTable.removeUniqueConstraint(0);
- uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- ormSecondaryTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormSecondaryTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormSecondaryTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, secondaryTableResource.getUniqueConstraints().size());
-
-
- ormSecondaryTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormSecondaryTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = secondaryTableResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- OrmSecondaryTable ormSecondaryTable = ormEntity.addSpecifiedSecondaryTable(0);
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlSecondaryTable secondaryTableResource = entityResource.getSecondaryTables().get(0);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- secondaryTableResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- secondaryTableResource.getUniqueConstraints().remove(0);
- uniqueConstraints = ormSecondaryTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- JavaEntity javaEntity = (JavaEntity) ormPersistentType.getJavaPersistentType().getMapping();
- JavaSecondaryTable javaSecondaryTable = javaEntity.addSpecifiedSecondaryTable();
- javaSecondaryTable.setSpecifiedName("SECONDARY");
-
- ReadOnlySecondaryTable ormSecondaryTable = ormEntity.getSecondaryTables().iterator().next();
- assertTrue(ormSecondaryTable.isVirtual());
- assertFalse(ormSecondaryTable.getUniqueConstraints().iterator().hasNext());
-
-
- javaSecondaryTable.addUniqueConstraint().addColumnName("FOO");
- javaSecondaryTable.addUniqueConstraint().addColumnName("BAR");
- javaSecondaryTable.addUniqueConstraint().addColumnName("BAZ");
-
- List<ReadOnlyUniqueConstraint> uniqueConstraints = CollectionTools.list(ormSecondaryTable.getUniqueConstraints());
- assertEquals(3, uniqueConstraints.size());
- assertEquals("FOO", uniqueConstraints.get(0).getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.get(1).getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.get(2).getColumnNames().iterator().next());
-
- ormEntity.setSecondaryTablesAreDefinedInXml(true);
- OrmSecondaryTable ormSecondaryTable2 = ormEntity.getSpecifiedSecondaryTables().iterator().next();
- ormSecondaryTable2.setSpecifiedName("SECONDARY");
-
- assertEquals("SECONDARY", ormSecondaryTable.getSpecifiedName());
- assertFalse(ormSecondaryTable2.isVirtual());
- assertEquals(3, ormSecondaryTable2.getUniqueConstraintsSize());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java
deleted file mode 100644
index e345249de2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmSequenceGeneratorTests.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.SequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmSequenceGeneratorTests extends ContextModelTestCase
-{
- public OrmSequenceGeneratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setName("FOO");
- assertEquals("FOO", sequenceGenerator.getName());
- assertEquals("FOO", sequenceGeneratorResource.getName());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setName(null);
- assertNull(sequenceGenerator.getName());
- assertNull(sequenceGeneratorResource.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setName("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getName());
- assertEquals("FOO", sequenceGenerator.getName());
-
- //set name to null in the context model
- sequenceGenerator.setName(null);
- assertNull(sequenceGeneratorResource.getName());
- assertNull(sequenceGenerator.getName());
- }
-
- public void testUpdateSpecifiedSequenceName() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setSequenceName("FOO");
- assertEquals("FOO", sequenceGenerator.getSpecifiedSequenceName());
- assertEquals("FOO", sequenceGeneratorResource.getSequenceName());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setSequenceName(null);
- assertNull(sequenceGenerator.getSpecifiedSequenceName());
- assertNull(sequenceGeneratorResource.getSequenceName());
- }
-
- public void testModifySpecifiedSequenceName() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedSequenceName("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getSequenceName());
- assertEquals("FOO", sequenceGenerator.getSpecifiedSequenceName());
-
- //set name to null in the context model
- sequenceGenerator.setSpecifiedSequenceName(null);
- assertNull(sequenceGeneratorResource.getSequenceName());
- assertNull(sequenceGenerator.getSpecifiedSequenceName());
- }
-
- public void testUpdateSpecifiedInitialValue() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set initial value in the resource model, verify context model updated
- sequenceGeneratorResource.setInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getInitialValue());
-
- //set initial value to 1, which happens to be the default, in the resource model
- sequenceGeneratorResource.setInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), sequenceGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(1), sequenceGeneratorResource.getInitialValue());
-
- //set initial value to null in the resource model
- sequenceGeneratorResource.setInitialValue(null);
- assertNull(sequenceGenerator.getSpecifiedInitialValue());
- assertNull(sequenceGeneratorResource.getInitialValue());
- }
-
- public void testModifySpecifiedInitialValue() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set initial value in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedInitialValue());
-
- sequenceGenerator.setSpecifiedInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), sequenceGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(1), sequenceGenerator.getSpecifiedInitialValue());
-
- //set initial value to null in the context model
- sequenceGenerator.setSpecifiedInitialValue(null);
- assertNull(sequenceGeneratorResource.getInitialValue());
- assertNull(sequenceGenerator.getSpecifiedInitialValue());
- }
-
- public void testUpdateSpecifiedAllocationSize() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set allocation size in the resource model, verify context model updated
- sequenceGeneratorResource.setAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getAllocationSize());
-
- //set allocation size to 50, which happens to be the default, in the resource model
- sequenceGeneratorResource.setAllocationSize(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), sequenceGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(1), sequenceGeneratorResource.getAllocationSize());
-
- //set allocation size to null in the resource model
- sequenceGeneratorResource.setAllocationSize(null);
- assertNull(sequenceGenerator.getSpecifiedAllocationSize());
- assertNull(sequenceGeneratorResource.getAllocationSize());
- }
-
- public void testModifySpecifiedAllocationSize() throws Exception {
- SequenceGenerator sequenceGenerator = getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set allocation size in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), sequenceGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(10), sequenceGenerator.getSpecifiedAllocationSize());
-
- sequenceGenerator.setSpecifiedAllocationSize(Integer.valueOf(50));
- assertEquals(Integer.valueOf(50), sequenceGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(50), sequenceGenerator.getSpecifiedAllocationSize());
-
- //set allocation size to null in the context model
- sequenceGenerator.setSpecifiedAllocationSize(null);
- assertNull(sequenceGeneratorResource.getAllocationSize());
- assertNull(sequenceGenerator.getSpecifiedAllocationSize());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableGeneratorTests.java
deleted file mode 100644
index d063949658..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableGeneratorTests.java
+++ /dev/null
@@ -1,609 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.TableGenerator;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaTableGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTableGenerator;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmTableGeneratorTests extends ContextModelTestCase
-{
- public OrmTableGeneratorTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setName("FOO");
- assertEquals("FOO", tableGenerator.getName());
- assertEquals("FOO", tableGeneratorResource.getName());
-
- //set name to null in the resource model
- tableGeneratorResource.setName(null);
- assertNull(tableGenerator.getName());
- assertNull(tableGeneratorResource.getName());
- }
-
- public void testModifySpecifiedName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setName("FOO");
- assertEquals("FOO", tableGeneratorResource.getName());
- assertEquals("FOO", tableGenerator.getName());
-
- //set name to null in the context model
- tableGenerator.setName(null);
- assertNull(tableGeneratorResource.getName());
- assertNull(tableGenerator.getName());
- }
-
- public void testUpdateSpecifiedInitialValue() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set initial value in the resource model, verify context model updated
- tableGeneratorResource.setInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getInitialValue());
-
- //set initial value to 1, which happens to be the default, in the resource model
- tableGeneratorResource.setInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedInitialValue());
- assertEquals(Integer.valueOf(1), tableGeneratorResource.getInitialValue());
-
- //set initial value to null in the resource model
- tableGeneratorResource.setInitialValue(null);
- assertNull(tableGenerator.getSpecifiedInitialValue());
- assertNull(tableGeneratorResource.getInitialValue());
- }
-
- public void testModifySpecifiedInitialValue() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set initial value in the context model, verify resource model modified
- tableGenerator.setSpecifiedInitialValue(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedInitialValue());
-
- tableGenerator.setSpecifiedInitialValue(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), tableGeneratorResource.getInitialValue());
- assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedInitialValue());
-
- //set initial value to null in the context model
- tableGenerator.setSpecifiedInitialValue(null);
- assertNull(tableGeneratorResource.getInitialValue());
- assertNull(tableGenerator.getSpecifiedInitialValue());
- }
-
- public void testUpdateSpecifiedAllocationSize() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set allocation size in the resource model, verify context model updated
- tableGeneratorResource.setAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getAllocationSize());
-
- //set allocation size to 50, which happens to be the default, in the resource model
- tableGeneratorResource.setAllocationSize(Integer.valueOf(1));
- assertEquals(Integer.valueOf(1), tableGenerator.getSpecifiedAllocationSize());
- assertEquals(Integer.valueOf(1), tableGeneratorResource.getAllocationSize());
-
- //set allocation size to null in the resource model
- tableGeneratorResource.setAllocationSize(null);
- assertNull(tableGenerator.getSpecifiedAllocationSize());
- assertNull(tableGeneratorResource.getAllocationSize());
- }
-
- public void testModifySpecifiedAllocationSize() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set allocation size in the context model, verify resource model modified
- tableGenerator.setSpecifiedAllocationSize(Integer.valueOf(10));
- assertEquals(Integer.valueOf(10), tableGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(10), tableGenerator.getSpecifiedAllocationSize());
-
- tableGenerator.setSpecifiedAllocationSize(Integer.valueOf(50));
- assertEquals(Integer.valueOf(50), tableGeneratorResource.getAllocationSize());
- assertEquals(Integer.valueOf(50), tableGenerator.getSpecifiedAllocationSize());
-
- //set allocation size to null in the context model
- tableGenerator.setSpecifiedAllocationSize(null);
- assertNull(tableGeneratorResource.getAllocationSize());
- assertNull(tableGenerator.getSpecifiedAllocationSize());
- }
-
- public void testUpdateSpecifiedTable() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setTable("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedTable());
- assertEquals("FOO", tableGeneratorResource.getTable());
-
- //set name to null in the resource model
- tableGeneratorResource.setTable(null);
- assertNull(tableGenerator.getSpecifiedTable());
- assertNull(tableGeneratorResource.getTable());
- }
-
- public void testModifySpecifiedTable() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedTable("FOO");
- assertEquals("FOO", tableGeneratorResource.getTable());
- assertEquals("FOO", tableGenerator.getSpecifiedTable());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedTable(null);
- assertNull(tableGeneratorResource.getTable());
- assertNull(tableGenerator.getSpecifiedTable());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setSchema("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedSchema());
- assertEquals("FOO", tableGeneratorResource.getSchema());
-
- //set name to null in the resource model
- tableGeneratorResource.setSchema(null);
- assertNull(tableGenerator.getSpecifiedSchema());
- assertNull(tableGeneratorResource.getSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedSchema("FOO");
- assertEquals("FOO", tableGeneratorResource.getSchema());
- assertEquals("FOO", tableGenerator.getSpecifiedSchema());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedSchema(null);
- assertNull(tableGeneratorResource.getSchema());
- assertNull(tableGenerator.getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
-
- assertNull(tableGenerator.getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", tableGenerator.getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", tableGenerator.getDefaultSchema());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setCatalog("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedCatalog());
- assertEquals("FOO", tableGeneratorResource.getCatalog());
-
- //set name to null in the resource model
- tableGeneratorResource.setCatalog(null);
- assertNull(tableGenerator.getSpecifiedCatalog());
- assertNull(tableGeneratorResource.getCatalog());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedCatalog("FOO");
- assertEquals("FOO", tableGeneratorResource.getCatalog());
- assertEquals("FOO", tableGenerator.getSpecifiedCatalog());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedCatalog(null);
- assertNull(tableGeneratorResource.getCatalog());
- assertNull(tableGenerator.getSpecifiedCatalog());
- }
-
- public void testUpdateSpecifiedPkColumnName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setPkColumnName("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnName());
- assertEquals("FOO", tableGeneratorResource.getPkColumnName());
-
- //set name to null in the resource model
- tableGeneratorResource.setPkColumnName(null);
- assertNull(tableGenerator.getSpecifiedPkColumnName());
- assertNull(tableGeneratorResource.getPkColumnName());
- }
-
- public void testModifySpecifiedPkColumnName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedPkColumnName("FOO");
- assertEquals("FOO", tableGeneratorResource.getPkColumnName());
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnName());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedPkColumnName(null);
- assertNull(tableGeneratorResource.getPkColumnName());
- assertNull(tableGenerator.getSpecifiedPkColumnName());
- }
-
- public void testUpdateSpecifiedValueColumnName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setValueColumnName("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedValueColumnName());
- assertEquals("FOO", tableGeneratorResource.getValueColumnName());
-
- //set name to null in the resource model
- tableGeneratorResource.setValueColumnName(null);
- assertNull(tableGenerator.getSpecifiedValueColumnName());
- assertNull(tableGeneratorResource.getValueColumnName());
- }
-
- public void testModifySpecifiedValueColumnName() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedValueColumnName("FOO");
- assertEquals("FOO", tableGeneratorResource.getValueColumnName());
- assertEquals("FOO", tableGenerator.getSpecifiedValueColumnName());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedValueColumnName(null);
- assertNull(tableGeneratorResource.getValueColumnName());
- assertNull(tableGenerator.getSpecifiedValueColumnName());
- }
-
- public void testUpdateSpecifiedPkColumnValue() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- tableGeneratorResource.setPkColumnValue("FOO");
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnValue());
- assertEquals("FOO", tableGeneratorResource.getPkColumnValue());
-
- //set name to null in the resource model
- tableGeneratorResource.setPkColumnValue(null);
- assertNull(tableGenerator.getSpecifiedPkColumnValue());
- assertNull(tableGeneratorResource.getPkColumnValue());
- }
-
- public void testModifySpecifiedPkColumnValue() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- tableGenerator.setSpecifiedPkColumnValue("FOO");
- assertEquals("FOO", tableGeneratorResource.getPkColumnValue());
- assertEquals("FOO", tableGenerator.getSpecifiedPkColumnValue());
-
- //set name to null in the context model
- tableGenerator.setSpecifiedPkColumnValue(null);
- assertNull(tableGeneratorResource.getPkColumnValue());
- assertNull(tableGenerator.getSpecifiedPkColumnValue());
- }
-
-
- public void testUniqueConstraints() throws Exception {
- OrmTableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- assertEquals(0, tableGenerator.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableGeneratorResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableGeneratorResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, tableGeneratorResource.getUniqueConstraints().size());
-
- tableGenerator.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(1);
- uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- tableGenerator.removeUniqueConstraint(0);
- uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- tableGenerator.addUniqueConstraint(0).addColumnName(0, "FOO");
- tableGenerator.addUniqueConstraint(1).addColumnName(0, "BAR");
- tableGenerator.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, tableGeneratorResource.getUniqueConstraints().size());
-
-
- tableGenerator.moveUniqueConstraint(2, 0);
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- tableGenerator.moveUniqueConstraint(0, 1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = tableGeneratorResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- TableGenerator tableGenerator = getEntityMappings().addTableGenerator(0);
- XmlTableGenerator tableGeneratorResource = getXmlEntityMappings().getTableGenerators().get(0);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableGeneratorResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().remove(1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().remove(1);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableGeneratorResource.getUniqueConstraints().remove(0);
- uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributes().iterator().next();
- IdMapping virtualIdMapping = (IdMapping) virtualAttribute.getMapping();
-
- JavaIdMapping javaIdMapping = (JavaIdMapping) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaTableGenerator javaTableGenerator = javaIdMapping.getGeneratorContainer().addTableGenerator();
- javaTableGenerator.setName("TABLE_GENERATOR");
-
-// >>> I'm going to argue there is no such thing as a "virtual" generator,
-// since a Java generator is *not* overridden when its ID mapping (or entity)
-// is overridden in the orm.xml file - both the orm.xml ID mapping and the
-// Java mapping can define an "active" generator as long as they have different
-// names ~bjv
- TableGenerator tableGenerator = virtualIdMapping.getGeneratorContainer().getTableGenerator();
- assertNull(tableGenerator);
-// Iterator<UniqueConstraint> uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
-// assertFalse(uniqueConstraints.hasNext());
-
- javaTableGenerator.addUniqueConstraint().addColumnName("FOO");
- javaTableGenerator.addUniqueConstraint().addColumnName("BAR");
- javaTableGenerator.addUniqueConstraint().addColumnName("BAZ");
-
- assertNull(tableGenerator);
-// uniqueConstraints = tableGenerator.getUniqueConstraints().iterator();
-// assertTrue(uniqueConstraints.hasNext());
-// assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-// assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
-// assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
-// assertFalse(uniqueConstraints.hasNext());
-
- OrmIdMapping ormIdMapping = (OrmIdMapping) virtualAttribute.addToXml().getMapping();
-
- OrmTableGenerator ormTableGenerator2 = ormIdMapping.getGeneratorContainer().addTableGenerator();
- ormTableGenerator2.setName("TABLE_GENERATOR");
-
- assertEquals(0, ormTableGenerator2.getUniqueConstraintsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableTests.java
deleted file mode 100644
index ca9d06d9c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTableTests.java
+++ /dev/null
@@ -1,827 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmTableTests extends ContextModelTestCase
-{
- public OrmTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createAbstractTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)").append(CR);
- sb.append("abstract");
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
-
- //set name in the resource model, verify context model updated
- entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
- entityResource.getTable().setName("FOO");
- assertEquals("FOO", ormTable.getSpecifiedName());
- assertEquals("FOO", entityResource.getTable().getName());
-
- //set name to null in the resource model
- entityResource.getTable().setName(null);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable().getName());
-
- entityResource.getTable().setName("FOO");
- assertEquals("FOO", ormTable.getSpecifiedName());
- assertEquals("FOO", entityResource.getTable().getName());
-
- entityResource.setTable(null);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmTable ormTable = ((OrmEntity) ormPersistentType.getMapping()).getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
-
- //set name in the context model, verify resource model modified
- ormTable.setSpecifiedName("foo");
- assertEquals("foo", ormTable.getSpecifiedName());
- assertEquals("foo", entityResource.getTable().getName());
-
- //set name to null in the context model
- ormTable.setSpecifiedName(null);
- assertNull(ormTable.getSpecifiedName());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedName("Foo");
- assertEquals("Foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals("Foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.getTable().setSpecifiedName("Bar");
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultNameNoJava() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertEquals("Foo", ormEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultNameFromEntityName() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
- ormEntity.setSpecifiedName("foo");
-
- assertEquals("foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedName(null);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
-
- ormEntity.getJavaTypeMapping().setSpecifiedName("foo");
- assertEquals("foo", ormEntity.getTable().getDefaultName());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME, ormEntity.getTable().getDefaultName());
- }
-
- public void testUpdateDefaultNameFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
- assertEquals(TYPE_NAME, childXmlEntity.getTable().getDefaultName());
-
- parentXmlEntity.getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
- assertEquals("FOO", childXmlEntity.getTable().getDefaultName());
-
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(TYPE_NAME, parentXmlEntity.getTable().getDefaultName());
- assertEquals("AnnotationTestTypeChild", childXmlEntity.getTable().getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
-
- //set schema in the resource model, verify context model updated
- entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
- entityResource.getTable().setSchema("FOO");
- assertEquals("FOO", ormTable.getSpecifiedSchema());
- assertEquals("FOO", entityResource.getTable().getSchema());
-
- //set Schema to null in the resource model
- entityResource.getTable().setSchema(null);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable().getSchema());
-
- entityResource.getTable().setSchema("FOO");
- assertEquals("FOO", ormTable.getSpecifiedSchema());
- assertEquals("FOO", entityResource.getTable().getSchema());
-
- entityResource.setTable(null);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateDefaultSchemaFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedSchema("Foo");
- assertEquals("Foo", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals("Foo", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedName("Bar");
- assertNull(ormEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaNoJava() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertNull(parentXmlEntity.getTable().getDefaultSchema());
- assertNull(childXmlEntity.getTable().getDefaultSchema());
-
- parentXmlEntity.getTable().setSpecifiedSchema("FOO");
- assertNull(parentXmlEntity.getTable().getDefaultSchema());
- assertEquals("FOO", childXmlEntity.getTable().getDefaultSchema());
-
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertNull(parentXmlEntity.getTable().getDefaultSchema());
- assertNull(childXmlEntity.getTable().getDefaultSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedSchema("JAVA_SCHEMA");
- assertEquals("JAVA_SCHEMA", ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedName("BLAH");
- //xml entity now has a table element so default schema is not taken from java
- assertEquals("BAR", ormEntity.getTable().getDefaultSchema());
-
-
- getEntityMappings().setSpecifiedSchema(null);
- assertEquals("FOO", ormEntity.getTable().getDefaultSchema());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertNull(ormEntity.getTable().getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedName(null);
- assertEquals("JAVA_SCHEMA", ormEntity.getTable().getDefaultSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
-
- //set Schema in the context model, verify resource model modified
- ormTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormTable.getSpecifiedSchema());
- assertEquals("foo", entityResource.getTable().getSchema());
-
- //set Schema to null in the context model
- ormTable.setSpecifiedSchema(null);
- assertNull(ormTable.getSpecifiedSchema());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
-
- //set Catalog in the resource model, verify context model updated
- entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
- entityResource.getTable().setCatalog("FOO");
- assertEquals("FOO", ormTable.getSpecifiedCatalog());
- assertEquals("FOO", entityResource.getTable().getCatalog());
-
- //set Catalog to null in the resource model
- entityResource.getTable().setCatalog(null);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable().getCatalog());
-
- entityResource.getTable().setCatalog("FOO");
- assertEquals("FOO", ormTable.getSpecifiedCatalog());
- assertEquals("FOO", entityResource.getTable().getCatalog());
-
- entityResource.setTable(null);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmTable ormTable = ormEntity.getTable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
-
- //set Catalog in the context model, verify resource model modified
- ormTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormTable.getSpecifiedCatalog());
- assertEquals("foo", entityResource.getTable().getCatalog());
-
- //set Catalog to null in the context model
- ormTable.setSpecifiedCatalog(null);
- assertNull(ormTable.getSpecifiedCatalog());
- assertNull(entityResource.getTable());
- }
-
- public void testUpdateDefaultCatalogFromJavaTable() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedCatalog("Foo");
- assertEquals("Foo", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- ormEntity.setSpecifiedMetadataComplete(Boolean.FALSE);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.setSpecifiedMetadataComplete(null);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertEquals("Foo", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedName("Bar");
- assertNull(ormEntity.getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogNoJava() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogFromParent() throws Exception {
- createTestEntity();
- createTestSubType();
-
- OrmPersistentType parentOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity parentXmlEntity = (OrmEntity) parentOrmPersistentType.getMapping();
- OrmEntity childXmlEntity = (OrmEntity) childOrmPersistentType.getMapping();
-
- assertNull(parentXmlEntity.getTable().getDefaultCatalog());
- assertNull(childXmlEntity.getTable().getDefaultCatalog());
-
- parentXmlEntity.getTable().setSpecifiedCatalog("FOO");
- assertNull(parentXmlEntity.getTable().getDefaultCatalog());
- assertEquals("FOO", childXmlEntity.getTable().getDefaultCatalog());
-
- parentXmlEntity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertNull(parentXmlEntity.getTable().getDefaultCatalog());
- assertNull(childXmlEntity.getTable().getDefaultCatalog());
- }
-
- public void testUpdateDefaultCatalogFromPersistenceUnitDefaults() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().setSpecifiedCatalog("BAR");
- assertEquals("BAR", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getJavaTypeMapping().getTable().setSpecifiedCatalog("JAVA_CATALOG");
- assertEquals("JAVA_CATALOG", ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedName("BLAH");
- //xml entity now has a table element so default schema is not taken from java
- assertEquals("BAR", ormEntity.getTable().getDefaultCatalog());
-
-
- getEntityMappings().setSpecifiedCatalog(null);
- assertEquals("FOO", ormEntity.getTable().getDefaultCatalog());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertNull(ormEntity.getTable().getDefaultCatalog());
-
- ormEntity.getTable().setSpecifiedName(null);
- assertEquals("JAVA_CATALOG", ormEntity.getTable().getDefaultCatalog());
-}
-
-//
-// public void testUpdateName() throws Exception {
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(IMappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
-// XmlEntity ormEntity = (XmlEntity) ormPersistentType.getMapping();
-// Entity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertEquals("Foo", ormEntity.getName());
-//
-// //set class in the resource model, verify context model updated
-// entityResource.setClassName("com.Bar");
-// assertEquals("Bar", ormEntity.getName());
-//
-// entityResource.setName("Baz");
-// assertEquals("Baz", ormEntity.getName());
-//
-// //set class to null in the resource model
-// entityResource.setClassName(null);
-// assertEquals("Baz", ormEntity.getName());
-//
-// entityResource.setName(null);
-// assertNull(ormEntity.getName());
-// }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormEntity.getTable().getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable();
- entityResource.setTable(tableResource);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormEntity.getTable().getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- assertEquals(0, ormEntity.getTable().getUniqueConstraintsSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable();
- entityResource.setTable(tableResource);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormEntity.getTable().getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(0).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = tableResource.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- assertEquals(3, tableResource.getUniqueConstraints().size());
-
- table.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(1);
- uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- table.removeUniqueConstraint(0);
- uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
- table.addUniqueConstraint(0).addColumnName(0, "FOO");
- table.addUniqueConstraint(1).addColumnName(0, "BAR");
- table.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = entityResource.getTable();
-
- assertEquals(3, tableResource.getUniqueConstraints().size());
-
-
- table.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- table.moveUniqueConstraint(0, 1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = tableResource.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- OrmTable table = ormEntity.getTable();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlTable tableResource = OrmFactory.eINSTANCE.createXmlTable();
- entityResource.setTable(tableResource);
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- tableResource.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().move(2, 0);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().move(0, 1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().remove(1);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- tableResource.getUniqueConstraints().remove(0);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
-//TODO not yet supporting unique constriants from java
-// public void testUniqueConstraintsFromJava() throws Exception {
-// createTestEntity();
-//
-// OrmPersistentType ormPersistentType = entityMappings().addOrmPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-//
-// ListIterator<OrmUniqueConstraint> uniqueConstraints = ormEntity.getTable().uniqueConstraints();
-// assertFalse(uniqueConstraints.hasNext());
-//
-// JavaEntity javaEntity = (JavaEntity) ormPersistentType.getJavaPersistentType().getMapping();
-// javaEntity.getTable().addUniqueConstraint(0).addColumnName(0, "FOO");
-// javaEntity.getTable().addUniqueConstraint(1).addColumnName(0, "BAR");
-// javaEntity.getTable().addUniqueConstraint(2).addColumnName(0, "BAZ");
-//
-//
-// XmlEntity entityResource = ormResource().getEntityMappings().getEntities().get(0);
-// assertNull(entityResource.getTable());
-//
-// uniqueConstraints = ormEntity.getTable().uniqueConstraints();
-// assertTrue(uniqueConstraints.hasNext());
-// assertEquals("FOO", uniqueConstraints.next().columnNames().next());
-// assertEquals("BAR", uniqueConstraints.next().columnNames().next());
-// assertEquals("BAZ", uniqueConstraints.next().columnNames().next());
-// assertFalse(uniqueConstraints.hasNext());
-//
-// entityResource.setTable(OrmFactory.eINSTANCE.createXmlTable());
-// assertEquals(0, ormEntity.getTable().uniqueConstraintsSize());
-// }
-
- public void testAbstractEntityGetDefaultNameTablePerClassInheritance() throws Exception {
- createAbstractTestEntity();
- createTestSubType();
- OrmPersistentType abstractPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity abstractEntity = (OrmEntity) abstractPersistentType.getMapping();
- OrmPersistentType concretePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
- OrmEntity concreteEntity = (OrmEntity) concretePersistentType.getMapping();
-
- assertEquals(null, abstractEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, abstractEntity.getDefaultInheritanceStrategy());
- assertEquals(null, concreteEntity.getSpecifiedInheritanceStrategy());
- assertEquals(InheritanceType.TABLE_PER_CLASS, concreteEntity.getDefaultInheritanceStrategy());
-
-
- assertEquals(null, abstractEntity.getTable().getDefaultName());
- assertEquals(null, abstractEntity.getTable().getDefaultCatalog());
- assertEquals(null, abstractEntity.getTable().getDefaultSchema());
-
- assertEquals("AnnotationTestTypeChild", concreteEntity.getTable().getDefaultName());
- assertEquals(null, concreteEntity.getTable().getDefaultCatalog());
- assertEquals(null, concreteEntity.getTable().getDefaultSchema());
-
- //meta-data complete true, inheritance strategy no single-table
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(TYPE_NAME, abstractEntity.getTable().getDefaultName());
- assertEquals(null, abstractEntity.getTable().getDefaultCatalog());
- assertEquals(null, abstractEntity.getTable().getDefaultSchema());
-
- assertEquals("AnnotationTestType", concreteEntity.getTable().getDefaultName());
- assertEquals(null, concreteEntity.getTable().getDefaultCatalog());
- assertEquals(null, concreteEntity.getTable().getDefaultSchema());
-
-
- //set inheritance strategy to table-per-class in orm.xml
- abstractEntity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertEquals(null, abstractEntity.getTable().getDefaultName());
- assertEquals(null, abstractEntity.getTable().getDefaultCatalog());
- assertEquals(null, abstractEntity.getTable().getDefaultSchema());
-
- assertEquals("AnnotationTestTypeChild", concreteEntity.getTable().getDefaultName());
- assertEquals(null, concreteEntity.getTable().getDefaultCatalog());
- assertEquals(null, concreteEntity.getTable().getDefaultSchema());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTransientMappingTests.java
deleted file mode 100644
index 3e894c7236..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmTransientMappingTests.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTransientMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlTransient;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmTransientMappingTests extends ContextModelTestCase
-{
- public OrmTransientMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- OrmTransientMapping xmlTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- XmlTransient transientResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0);
-
- assertEquals("id", xmlTransientMapping.getName());
- assertEquals("id", transientResource.getName());
-
- //set name in the resource model, verify context model updated
- transientResource.setName("newName");
- assertEquals("newName", xmlTransientMapping.getName());
- assertEquals("newName", transientResource.getName());
-
- //set name to null in the resource model
- transientResource.setName(null);
- assertNull(xmlTransientMapping.getName());
- assertNull(transientResource.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- OrmTransientMapping xmlTransientnMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- XmlTransient transientResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getTransients().get(0);
-
- assertEquals("id", xmlTransientnMapping.getName());
- assertEquals("id", transientResource.getName());
-
- //set name in the context model, verify resource model updated
- xmlTransientnMapping.setName("newName");
- assertEquals("newName", xmlTransientnMapping.getName());
- assertEquals("newName", transientResource.getName());
-
- //set name to null in the context model
- xmlTransientnMapping.setName(null);
- assertNull(xmlTransientnMapping.getName());
- assertNull(transientResource.getName());
- }
-
-
- public void testTransientMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityTransientMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- ormTransientMapping.setName("foo");
- assertEquals("foo", ormTransientMapping.getName());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", transientMapping.getName());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.addToXml(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormTransientMapping.getName());
- assertFalse(ormPersistentAttribute.isVirtual());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityTransientMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmTransientMapping ormTransientMapping = (OrmTransientMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormTransientMapping.getName());
- }
-
- public void testTransientMorphToIdMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToVersionMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToTransientMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToEmbeddedMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToOneToOneMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToOneToManyMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToManyToOneMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testTransientMorphToManyToManyMapping() throws Exception {
- createTestEntityTransientMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- TransientMapping transientMapping = (TransientMapping) ormPersistentAttribute.getMapping();
- assertFalse(transientMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmVersionMappingTests.java
deleted file mode 100644
index 4ab3647e4e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmVersionMappingTests.java
+++ /dev/null
@@ -1,493 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmVersionMappingTests extends ContextModelTestCase
-{
- public OrmVersionMappingTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, JPA.COLUMN, JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version");
- sb.append(CR);
- sb.append(" @Column(name=\"MY_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\", length=5, precision=6, scale=7)");
- sb.append(CR);
- sb.append(" @Temporal(TemporalType.TIMESTAMP)");
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertEquals("id", ormVersionMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertEquals("id", ormVersionMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(versionResource.getTemporal());
-
- //set temporal in the resource model, verify context model updated
- versionResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, versionResource.getTemporal());
-
- versionResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, versionResource.getTemporal());
-
- versionResource.setTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, versionResource.getTemporal());
-
- //set temporal to null in the resource model
- versionResource.setTemporal(null);
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(versionResource.getTemporal());
- }
-
- public void testModifyTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion versionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(versionResource.getTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormVersionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ormVersionMapping.getConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, versionResource.getTemporal());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormVersionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, versionResource.getTemporal());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormVersionMapping.getConverter()).setTemporalType(TemporalType.TIMESTAMP);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, versionResource.getTemporal());
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormVersionMapping.getConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormVersionMapping.setConverter(null);
- assertNull(versionResource.getTemporal());
- assertNull(ormVersionMapping.getConverter().getType());
- }
-
- //TODO test defaults
- //TODO test overriding java mapping with a different mapping type in xml
-
- public void testVersionMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityVersionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- ormVersionMapping.setName("foo");
- assertEquals("foo", ormVersionMapping.getName());
- assertNull(ormVersionMapping.getConverter().getType());
-
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("foo", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- //@Basic(fetch=FetchType.LAZY, optional=false)
- //@Column(name="MY_COLUMN", unique=true, nullable=false, insertable=false, updatable=false,
- // columnDefinition="COLUMN_DEFINITION", table="MY_TABLE", length=5, precision=6, scale=7)");
- //@Column(
- //@Lob
- //@Temporal(TemporalType.TIMESTAMP)
- //@Enumerated(EnumType.STRING)
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", versionMapping.getName());
- assertEquals(BaseTemporalConverter.class, versionMapping.getConverter().getType());
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) versionMapping.getConverter()).getTemporalType());
-
- Column column = versionMapping.getColumn();
- assertEquals("MY_COLUMN", column.getSpecifiedName());
- assertEquals(Boolean.TRUE, column.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, column.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, column.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, column.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", column.getColumnDefinition());
- assertEquals("MY_TABLE", column.getSpecifiedTable());
- assertEquals(Integer.valueOf(5), column.getSpecifiedLength());
- assertEquals(Integer.valueOf(6), column.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(7), column.getSpecifiedScale());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertTrue(ormPersistentAttribute.isVirtual());
-
- ormPersistentAttribute.addToXml(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.getAttributeNamed("id");
-
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- assertEquals("id", ormVersionMapping.getName());
- assertFalse(ormPersistentAttribute.isVirtual());
- assertNull(ormVersionMapping.getConverter().getType());
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertEquals("id", ormColumn.getName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getTable());
- assertEquals(255, ormColumn.getLength());
- assertEquals(0, ormColumn.getPrecision());
- assertEquals(0, ormColumn.getScale());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityVersionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("id", ormVersionMapping.getName());
- assertNull(ormVersionMapping.getConverter().getType());
-
- OrmColumn ormColumn = ormVersionMapping.getColumn();
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
-
- assertEquals("id", ormColumn.getDefaultName());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertEquals(TYPE_NAME, ormColumn.getDefaultTable());
- assertEquals(255, ormColumn.getDefaultLength());
- assertEquals(0, ormColumn.getDefaultPrecision());
- assertEquals(0, ormColumn.getDefaultScale());
- }
-
- public void testVersionMorphToIdMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testVersionMorphToBasicMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- assertEquals("FOO", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getSpecifiedName());
- }
-
- public void testVersionMorphToTransientMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToEmbeddedMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToOneToOneMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToOneToManyMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToManyToOneMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testVersionMorphToManyToManyMapping() throws Exception {
- createTestEntityVersionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
-
- VersionMapping versionMapping = (VersionMapping) ormPersistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- assertFalse(versionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmXmlTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmXmlTests.java
deleted file mode 100644
index a3bb91a275..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/OrmXmlTests.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class OrmXmlTests extends ContextModelTestCase
-{
- public OrmXmlTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- getXmlPersistenceUnit().setName("foo");
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmXml getOrmXml() {
- return (OrmXml) getPersistenceUnit().getMappingFileRefs().iterator().next().getMappingFile();
- }
-
- public void testUpdateAddEntityMappings() throws Exception {
- assertEquals(2, getJpaProject().getJpaFilesSize());
- JpaXmlResource ormResource = getOrmXmlResource();
- ormResource.getContents().clear();
- ormResource.save(null);
-
- //the ContentType of the orm.xml file is no longer orm, so the jpa file is removed
- assertNull(getOrmXml());
- assertEquals(1, getJpaProject().getJpaFilesSize()); //should only be the persistence.xml file
-
- XmlEntityMappings xmlEntityMappings = OrmFactory.eINSTANCE.createXmlEntityMappings();
- xmlEntityMappings.setVersion("1.0");
- ormResource.getContents().add(xmlEntityMappings);
- ormResource.save(null);
-
- assertNotNull(getOrmXml().getRoot());
- assertEquals(2, getJpaProject().getJpaFilesSize());
- }
-
- public void testUpdateRemoveEntityMappings() throws Exception {
- JpaXmlResource ormResource = getOrmXmlResource();
-
- assertNotNull(getOrmXml().getRoot());
-
- ormResource.getContents().clear();
- assertNull(getOrmXml());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java
deleted file mode 100644
index 0ce25c36e7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitDefaultsTests.java
+++ /dev/null
@@ -1,369 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class PersistenceUnitDefaultsTests extends ContextModelTestCase
-{
- public PersistenceUnitDefaultsTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- XmlPersistenceUnitMetadata persistenceUnitMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- getXmlEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaultsResource = OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- persistenceUnitMetadata.setPersistenceUnitDefaults(persistenceUnitDefaultsResource);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(true);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(false);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
- }
-
- public void testUpdateSchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifySchema2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCatalog2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the resource model, persistence-unit-defaults tag not removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCascadePersist2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-
- public void testUpdateAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setSpecifiedAccess(null);
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyAccess2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- //set access to null in the context model
- persistenceUnitDefaults.setSpecifiedAccess(null);
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setSpecifiedAccess(null);
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java
deleted file mode 100644
index 42d6c8c41a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/orm/PersistenceUnitMetadataTests.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-public class PersistenceUnitMetadataTests extends ContextModelTestCase
-{
- public PersistenceUnitMetadataTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmPersistenceUnitMetadata persistenceUnitMetadata() {
- return getEntityMappings().getPersistenceUnitMetadata();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata persistenceUnitMetadata = OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- getXmlEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertFalse(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- assertFalse(persistenceUnitMetadata.isUnset());
- }
-
- public void testUpdateXmlMappingMetadataComplete() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(OrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-
- public void testModifyXmlMappingMetadataComplete() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the context model
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyXmlMappingMetadataComplete2() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the context model
- //set another element on the persistence-unit-metadata element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(OrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/ClassRefTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/ClassRefTests.java
deleted file mode 100644
index a74b1892a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/ClassRefTests.java
+++ /dev/null
@@ -1,113 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class ClassRefTests extends ContextModelTestCase
-{
- public ClassRefTests(String name) {
- super(name);
- }
-
- public void testUpdateClassName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add class ref
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- ClassRef classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
-
- // test that class names are initially equal
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set xml class name to different name, test equality
- xmlClassRef.setJavaClass("com.bar.Foo");
-
- classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set class name to empty string, test equality
- xmlClassRef.setJavaClass("");
-
- classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set name back to non empty string, test equality
- xmlClassRef.setJavaClass("com.foo.Bar");
-
- classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
- }
-
- public void testModifyClassName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add class ref
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- ClassRef classRef = persistenceUnit.getSpecifiedClassRefs().iterator().next();
-
- // test that class names are initially equal
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set context class name to different name, test equality
- classRef.setClassName("com.bar.Foo");
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set class name to empty string, test equality
- classRef.setClassName("");
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set class name to null, test equality
- classRef.setClassName(null);
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
-
- // set name back to non-null, test equality
- classRef.setClassName("com.foo.Bar");
-
- assertEquals(classRef.getClassName(), xmlClassRef.getJavaClass());
- }
-
-
- public void testGetPersistentType() throws Exception {
- createTestType();
-
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME);
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- ClassRef classRef = getSpecifiedClassRef();
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, classRef.getJavaPersistentType().getName());
-
- //test setting to a class that does not exist in the project
- xmlClassRef.setJavaClass("com.foo.Bar");
-
- classRef = getSpecifiedClassRef();
- assertNull(classRef.getJavaPersistentType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java
deleted file mode 100644
index e6456ad1f4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/JptCorePersistenceContextModelTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptCorePersistenceContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptCorePersistenceContextModelTests.class.getPackage().getName());
- suite.addTestSuite(RootContextNodeTests.class);
- suite.addTestSuite(PersistenceXmlTests.class);
- suite.addTestSuite(PersistenceTests.class);
- suite.addTestSuite(PersistenceUnitTests.class);
- suite.addTestSuite(MappingFileRefTests.class);
- suite.addTestSuite(ClassRefTests.class);
- return suite;
- }
-
- private JptCorePersistenceContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/MappingFileRefTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/MappingFileRefTests.java
deleted file mode 100644
index 7881090779..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/MappingFileRefTests.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class MappingFileRefTests extends ContextModelTestCase
-{
- public MappingFileRefTests(String name) {
- super(name);
- }
-
- protected MappingFileRef mappingFileRef() {
- return getPersistenceUnit().getMappingFileRefs().iterator().next();
- }
-
- public void testUpdateFileName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add mapping file ref
- XmlMappingFileRef xmlFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlFileRef.setFileName("foo.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlFileRef);
- MappingFileRef fileRef = persistenceUnit.getSpecifiedMappingFileRefs().iterator().next();
-
- // test that file names are initially equal
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set xml to different file name, test equality
- xmlFileRef.setFileName("bar.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to empty string, test equality
- xmlFileRef.setFileName("");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to null, test equality
- xmlFileRef.setFileName(null);
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name back to non-null, test equality
- xmlFileRef.setFileName("baz.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
- }
-
- public void testModifyFileName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add mapping file ref
- XmlMappingFileRef xmlFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlFileRef.setFileName("foo.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlFileRef);
- MappingFileRef fileRef = persistenceUnit.getSpecifiedMappingFileRefs().iterator().next();
-
- // test that file names are initially equal
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set context to different file name, test equality
- fileRef.setFileName("bar.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to empty string, test equality
- fileRef.setFileName("");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name to null, test equality
- fileRef.setFileName(null);
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
-
- // set file name back to non-null, test equality
- fileRef.setFileName("baz.xml");
-
- assertEquals(fileRef.getFileName(), xmlFileRef.getFileName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceTests.java
deleted file mode 100644
index 32f258e6c5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceTests.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.Persistence;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class PersistenceTests extends ContextModelTestCase
-{
- public PersistenceTests(String name) {
- super(name);
- }
-
- protected Persistence persistence() {
- return getRootContextNode().getPersistenceXml().getPersistence();
- }
-
- public void testUpdateAddPersistenceUnit() throws Exception {
- XmlPersistence xmlPersistence = getXmlPersistence();
- Persistence persistence = getRootContextNode().getPersistenceXml().getPersistence();
-
- // clear xml persistence units, test that it's clear in context
- xmlPersistence.getPersistenceUnits().clear();
-
- assertEquals(0, persistence.getPersistenceUnitsSize());
-
- // add xml persistence unit, test that it's added to context
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // add another, test that it *isn't* add to context
- xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test2");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(1, persistence.getPersistenceUnitsSize());
- }
-
- public void testModifyAddPersistencUnit() {
- XmlPersistence xmlPersistence = getXmlPersistence();
- Persistence persistence = persistence();
-
- // clear xml persistence units, test that it's clear in context
- xmlPersistence.getPersistenceUnits().clear();
- assertEquals(0, persistence.getPersistenceUnitsSize());
-
- // add persistence unit, test that it's added to resource
- persistence.addPersistenceUnit();
-
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // add another, test that we get an exception
- boolean exception = false;
- try {
- persistence.addPersistenceUnit();
- }
- catch (IndexOutOfBoundsException e) {
- exception = true;
- }
-
- assertTrue(exception);
- }
-
- public void testUpdateRemovePersistenceUnit() throws Exception {
- XmlPersistence xmlPersistence = getXmlPersistence();
- Persistence persistence = getRootContextNode().getPersistenceXml().getPersistence();
-
- // add a persistence unit and test that there are two existing xml and
- // one context persistence unit
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(2, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // remove persistence unit from xml, test that context remains unchanged
- xmlPersistenceUnit = xmlPersistence.getPersistenceUnits().get(0);
- xmlPersistence.getPersistenceUnits().remove(xmlPersistenceUnit);
-
- assertEquals(1, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // remove another one from xml, text that it's now removed from context
- xmlPersistenceUnit = xmlPersistence.getPersistenceUnits().get(0);
- xmlPersistence.getPersistenceUnits().remove(xmlPersistenceUnit);
-
- assertEquals(0, xmlPersistence.getPersistenceUnits().size());
- assertEquals(0, persistence.getPersistenceUnitsSize());
- }
-
- public void testModifyRemovePersistenceUnit() {
- XmlPersistence xmlPersistence = getXmlPersistence();
- Persistence persistence = persistence();
-
- // add a persistence unit and test that there are two existing xml and
- // one context persistence unit
- XmlPersistenceUnit xmlPersistenceUnit = PersistenceFactory.eINSTANCE.createXmlPersistenceUnit();
- xmlPersistenceUnit.setName("test");
- xmlPersistence.getPersistenceUnits().add(xmlPersistenceUnit);
-
- assertEquals(2, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // remove persistence unit, test that it's removed from resource and that
- // a *new* persistence unit representing the previously unrepresented one
- // is present
- persistence.removePersistenceUnit(0);
-
- assertEquals(1, xmlPersistence.getPersistenceUnits().size());
- assertEquals(1, persistence.getPersistenceUnitsSize());
-
- // remove new persistence unit, test that it's removed from resource and
- // context
- persistence.removePersistenceUnit(0);
-
- assertEquals(0, xmlPersistence.getPersistenceUnits().size());
- assertEquals(0, persistence.getPersistenceUnitsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java
deleted file mode 100644
index 7f4d035911..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTestCase.java
+++ /dev/null
@@ -1,367 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import java.util.Iterator;
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXmlEnumValue;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-/**
- * PersistenceUnitTestCase
- */
-@SuppressWarnings("nls")
-public abstract class PersistenceUnitTestCase extends ContextModelTestCase
-{
- protected PropertyChangeEvent propertyChangedEvent;
-
- protected int propertyChangedEventCount;
-
- protected int propertiesTotal;
-
- protected int modelPropertiesSizeOriginal;
-
- protected int modelPropertiesSize;
-
- // ********** constructors **********
- protected PersistenceUnitTestCase(String name) {
- super(name);
- }
-
- // ****** abstract methods *******
- protected abstract PersistenceUnitProperties getModel();
-
- /**
- * Initializes directly the PU properties before testing. Cannot use
- * Property Holder to initialize because it is not created yet
- */
- protected abstract void populatePu();
-
- /**
- * Gets the model's property identified by the given propertyName.
- *
- * @param propertyName
- * name of property to get
- * @throws Exception
- */
- protected abstract Object getProperty(String propertyName) throws Exception;
-
-
- /**
- * Sets the model's property identified by the given propertyName.
- * Used in verifySetProperty()
- *
- * @param propertyName
- * name of property to be set
- * @param newValue
- * value of property
- * @throws Exception
- */
- protected abstract void setProperty(String propertyName, Object newValue) throws Exception;
-
-
- // ****** convenience test methods *******
-
- protected String getPropertyStringValueOf(Object value) {
- if (value == null) {
- return null;
- }
- //TODO yes, I know, an instanceof check, this is a LOT of work to get rid of in the tests
- if (value instanceof PersistenceXmlEnumValue) {
- return ((PersistenceXmlEnumValue) value).getPropertyValue();
- }
- return value.toString();
- }
-
- protected <E> E getFirstElement(Iterator<E> iterator) {
- if(iterator.hasNext()) {
- return iterator.next();
- }
- return null;
- }
-
- /**
- * Put into persistenceUnit properties. Do not allows to put duplicate entry.
- *
- * @param key -
- * PersistenceUnit property key
- * @param value -
- * property value
- */
- protected void persistenceUnitSetProperty(String key, Object value) {
-
- this.persistenceUnitSetProperty( key, value, false);
- }
-
- protected void persistenceUnitSetProperty(String key, Object value, boolean allowDuplicates) {
- if (key == null) {
- throw new IllegalArgumentException("PersistenceUnit property key cannot be null");
- }
- if (value == null)
- this.setNullProperty(key);
- else
- this.putProperty_(key, value, allowDuplicates);
- }
-
- private void putProperty_(String puKey, Object value, boolean allowDuplicates) {
- this.clearEvent();
- this.getPersistenceUnit().setProperty(puKey, this.getPropertyStringValueOf(value), allowDuplicates);
- }
-
- protected void setNullProperty(String puKey) {
- this.clearEvent();
- this.getPersistenceUnit().setProperty(puKey, null, false);
- }
-
- protected void clearEvent() {
- this.propertyChangedEvent = null;
- this.propertyChangedEventCount = 0;
- }
-
- protected void throwMissingDefinition(String methodName, String propertyName) throws NoSuchFieldException {
- throw new NoSuchFieldException("Missing Definition for: " + methodName + "( " + propertyName + ")");
- }
-
- public void throwUnsupportedOperationException(ListEvent e) {
- throw new UnsupportedOperationException(e.getListName());
- }
-
- protected PropertyChangeListener buildPropertyChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent event) {
- PersistenceUnitTestCase.this.propertyChangedEvent = event;
- PersistenceUnitTestCase.this.propertyChangedEventCount++;
- }
-
- @Override
- public String toString() {
- return "PersistenceUnit listener";
- }
- };
- }
-
- /**
- * Verify if the property exists in the pesistence.xml
- */
- protected boolean propertyExists(String puPropertyName) {
- return this.getPersistenceUnit().getProperty(puPropertyName) != null;
- }
-
- protected boolean propertyValueEquals(String puPropertyName, String propertyValue) {
- return this.getPersistenceUnit().getProperty(puPropertyName).getValue().equals(propertyValue);
- }
-
- // ****** verify PersistenceUnit properties *******
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyAAValue(Boolean expectedValue, Boolean subjectValue, PropertyValueModel<Boolean> aa, String persistenceXmlKey) {
- assertEquals(expectedValue, subjectValue);
- assertEquals(expectedValue, aa.getValue());
- if (expectedValue != null) {
- assertTrue("PersistenceUnit property value not equals", this.propertyValueEquals(persistenceXmlKey, expectedValue.toString()));
- }
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected <T extends Enum<T>> void verifyAAValue(T expectedValue, T subjectValue, PropertyValueModel<? extends Enum<T>> aa, String puKey) {
- assertEquals(expectedValue, subjectValue);
- assertEquals(expectedValue, aa.getValue());
- if (expectedValue != null) {
- assertTrue("PersistenceUnit property value not equals", this.propertyValueEquals(puKey, this.getPropertyStringValueOf(expectedValue)));
- }
- }
-
- /**
- * Performs the following tests:<br>
- * 1. verify total number of PersistenceUnit properties<br>
- * 2. verify PU has the given propertyName<br>
- * 3. verify listening to propertyListAdapter<br>
- * 4. verify that the model can identify propertyName<br>
- */
- protected void verifyInitialState(String propertyName, String puKey, ListValueModel<PersistenceUnit.Property> propertyListAdapter) throws Exception {
- assertEquals("Total not updated in populatePu(): ", propertyListAdapter.size(), this.propertiesTotal);
- this.verifyPuHasProperty(puKey, "Property not added to populatePu()");
- this.verifyHasListeners(propertyListAdapter);
- this.verifyHasListeners(this.getModel(), propertyName);
-
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- assertTrue("model.itemIsProperty() is false: ", this.getModel().itemIsProperty(property));
- assertEquals("propertyIdFor() not updated: ", propertyName, this.getModel().propertyIdOf(property));
- }
-
- /**
- * Verifies that the persistence unit is populated, and that the model for
- * the tested Property is initialized with the value from the persistence
- * unit.
- * @throws Exception
- */
- protected void verifyModelInitialized(String puKey, Object expectedValue) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- assertTrue("model.itemIsProperty() is false: ", this.getModel().itemIsProperty(property));
-
- assertTrue("PersistenceUnit not populated - populatedPu()", this.propertyValueEquals(puKey, this.getPropertyStringValueOf(expectedValue)));
- String propertyName = this.getModel().propertyIdOf(property);
- Object modelValue = this.getProperty(propertyName);
- assertEquals(
- "Model not initialized - model.initializeProperties() - modelValue = " + modelValue,
- expectedValue,
- modelValue);
- }
-
- /**
- * Performs the following operations with the property:<br>
- * 1. verifies the initial state<br>
- * 2. persistenceUnit putProperty<br>
- * 3. adapter setProperty<br>
- */
- protected void verifySetProperty(String puKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- String propertyName = this.getModel().propertyIdOf(property);
-
- // Replace
- this.persistenceUnitSetProperty(puKey, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // Replace by setting model object
- this.clearEvent();
- this.setProperty(propertyName, testValue1);
- this.verifyPutProperty(propertyName, testValue1);
- }
-
- /**
- * Performs the following operations with the property:<br>
- * 1. performs a remove on the PU<br>
- * 2. performs a add with putProperty<br>
- * 3. performs a replace with putProperty<br>
- */
- protected void verifyAddRemoveProperty(String puKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- String propertyName = this.getModel().propertyIdOf(property);
-
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.verifyPuHasProperty(puKey, "persistenceUnit.properties doesn't contains: ");
- this.getPersistenceUnit().removeProperty(puKey);
- assertNull(this.getPersistenceUnit().getProperty(puKey));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
- this.verifyPutProperty(propertyName, null);
-
- // Add original CacheTypeDefault
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(puKey, testValue1);
- this.verifyPutProperty(propertyName, testValue1);
-
- // Replace
- this.persistenceUnitSetProperty(puKey, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
- }
-
- /**
- * Verifies the model's property identified by the given propertyName
- * Used in verifySetProperty() and verifyAddRemoveProperty
- *
- * @param propertyName
- * name of property to be verified
- * @param expectedValue
- * @throws Exception
- */
- protected void verifyPutProperty(String propertyName, Object expectedValue) throws Exception {
-
- this.verifyPutEvent(propertyName, this.getProperty(propertyName), expectedValue);
- }
-
- /**
- * Verifies the event of the put() action.
- *
- * @param propertyName
- * name of property to be verified
- * @param propertyValue
- * value of property
- * @param expectedValue
- * @throws Exception
- */
- protected void verifyPutEvent(String propertyName, Object propertyValue, Object expectedValue) {
-
- this.verifyEvent(propertyName);
- this.verifyEventValue(propertyValue, expectedValue);
- }
-
- /**
- * Performs the following tests:<br>
- * 1. verifies the new value of this.propertyChangedEvent<br>
- * 2. verifies the given value<br>
- */
- protected void verifyEventValue(Object value, Object expectedValue) {
- // verify event value
- assertEquals(expectedValue, this.propertyChangedEvent.getNewValue());
- assertEquals(expectedValue, value);
- }
-
- /**
- * Performs the following tests:<br>
- * 1. verifies that an event is fired<br>
- * 2. verifies that it is the correct event<br>
- * 3. verifies that a single event is fired<br>
- */
- protected void verifyEvent(String propertyName) {
- // verify event received
- assertNotNull("No Event Fired.", this.propertyChangedEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.propertyChangedEvent.getPropertyName(), propertyName);
- // verify event occurrence
- assertTrue("No Event Received.", this.propertyChangedEventCount > 0);
- assertTrue("Multiple Event Received (" + this.propertyChangedEventCount + ")",
- this.propertyChangedEventCount < 2);
- }
-
- protected void verifyHasNoListeners(ListValueModel<?> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasNoListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- protected void verifyHasListeners(ListValueModel<?> listValueModel) throws Exception {
- assertTrue(((AbstractModel) listValueModel).hasAnyListChangeListeners(ListValueModel.LIST_VALUES));
- }
-
- protected void verifyHasListeners(PersistenceUnitProperties model, String propertyName) throws Exception {
- assertTrue("Listener not added in setUp() - " + propertyName, ((AbstractModel) model).hasAnyPropertyChangeListeners(propertyName));
- }
-
- protected void verifyHasListeners(PropertyValueModel<?> pvm, String propertyName) throws Exception {
- assertTrue(((AbstractModel) pvm).hasAnyPropertyChangeListeners(propertyName));
- }
-
- protected void verifyPuHasProperty(String puPropertyName, String msg) {
- assertTrue(msg + " - " + puPropertyName, this.propertyExists(puPropertyName));
- }
-
- protected void verifyPuHasNotProperty(String puPropertyName, String msg) {
- assertFalse(msg + " - " + puPropertyName, this.propertyExists(puPropertyName));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTests.java
deleted file mode 100644
index 9b9928c7c4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceUnitTests.java
+++ /dev/null
@@ -1,1245 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.Tools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmXml;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlProperties;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlProperty;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class PersistenceUnitTests extends ContextModelTestCase
-{
-
- protected static final String INNER_CLASS_NAME = "InnerAnnotationTestType";
- protected static final String FULLY_QUALIFIED_INNER_CLASS_NAME = PACKAGE_NAME + "." + TYPE_NAME + "." + INNER_CLASS_NAME;
-
- public static final String OTHER_TYPE_NAME = "OtherTestType";
- public static final String FULLY_QUALIFIED_OTHER_TYPE_NAME = PACKAGE_NAME + "." + OTHER_TYPE_NAME;
-
-
- public PersistenceUnitTests(String name) {
- super(name);
- }
-
- public void testUpdateName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that names are initially equal
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to different name, test equality
- xmlPersistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to empty string, test equality
- xmlPersistenceUnit.setName("");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to null, test equality
- xmlPersistenceUnit.setName(null);
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name back to non-null, test equality
- xmlPersistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
- }
-
- public void testModifyName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that names are initially equal
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to different name, test equality
- persistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to empty string, test equality
- persistenceUnit.setName("");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name to null, test equality
- persistenceUnit.setName(null);
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
-
- // set name back to non-null, test equality
- persistenceUnit.setName("newName");
-
- assertEquals(xmlPersistenceUnit.getName(), persistenceUnit.getName());
- }
-
- public void testUpdateTransactionType() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // 1 - initial value is default
- assertNull(xmlPersistenceUnit.getTransactionType());
- assertNull(persistenceUnit.getSpecifiedTransactionType());
-
- // 2 - set value, context changed
- xmlPersistenceUnit.setTransactionType(XmlPersistenceUnitTransactionType.JTA);
-
- assertEquals(PersistenceUnitTransactionType.JTA, persistenceUnit.getSpecifiedTransactionType());
-
- xmlPersistenceUnit.setTransactionType(XmlPersistenceUnitTransactionType.RESOURCE_LOCAL);
-
- assertEquals(PersistenceUnitTransactionType.RESOURCE_LOCAL, persistenceUnit.getSpecifiedTransactionType());
-
- // 3 - unset value, context changed
- xmlPersistenceUnit.setTransactionType(null);
-
- assertNull(persistenceUnit.getSpecifiedTransactionType());
- }
-
- public void testModifyTransactionType() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // 1 - initial value is default
- assertNull(xmlPersistenceUnit.getTransactionType());
- assertNull(persistenceUnit.getSpecifiedTransactionType());
-
- // 2 - set context value, resource changed
- persistenceUnit.setSpecifiedTransactionType(PersistenceUnitTransactionType.JTA);
-
- assertEquals(XmlPersistenceUnitTransactionType.JTA, xmlPersistenceUnit.getTransactionType());
-
- persistenceUnit.setSpecifiedTransactionType(PersistenceUnitTransactionType.RESOURCE_LOCAL);
-
- assertEquals(XmlPersistenceUnitTransactionType.RESOURCE_LOCAL, xmlPersistenceUnit.getTransactionType());
-
- // 3 - set context value to default, resource unset
- persistenceUnit.setSpecifiedTransactionType(null);
-
- assertNull(persistenceUnit.getSpecifiedTransactionType());
- assertNull(xmlPersistenceUnit.getTransactionType());
- }
-
- public void testUpdateDescription() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that descriptions are initially equal
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to different description, test equality
- xmlPersistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to empty string, test equality
- xmlPersistenceUnit.setDescription("");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to null, test equality
- xmlPersistenceUnit.setDescription(null);
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description back to non-null, test equality
- xmlPersistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
- }
-
- public void testModifyDescription() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that descriptions are initially equal
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to different description, test equality
- persistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to empty string, test equality
- persistenceUnit.setDescription("");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description to null, test equality
- persistenceUnit.setDescription(null);
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
-
- // set description back to non-null, test equality
- persistenceUnit.setDescription("newDescription");
-
- assertEquals(xmlPersistenceUnit.getDescription(), persistenceUnit.getDescription());
- }
-
- public void testUpdateProvider() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that providers are initially equal
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to different provider, test equality
- xmlPersistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to empty string, test equality
- xmlPersistenceUnit.setProvider("");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to null, test equality
- xmlPersistenceUnit.setProvider(null);
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider back to non-null, test equality
- xmlPersistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
- }
-
- public void testModifyProvider() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that providers are initially equal
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to different provider, test equality
- persistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to empty string, test equality
- persistenceUnit.setProvider("");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider to null, test equality
- persistenceUnit.setProvider(null);
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
-
- // set provider back to non-null, test equality
- persistenceUnit.setProvider("newProvider");
-
- assertEquals(xmlPersistenceUnit.getProvider(), persistenceUnit.getProvider());
- }
-
- public void testUpdateJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that jtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to different jtaDataSource, test equality
- xmlPersistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to empty string, test equality
- xmlPersistenceUnit.setJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to null, test equality
- xmlPersistenceUnit.setJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource back to non-null, test equality
- xmlPersistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
- }
-
- public void testModifyJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that jtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to different jtaDataSource, test equality
- persistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to empty string, test equality
- persistenceUnit.setJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource to null, test equality
- persistenceUnit.setJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
-
- // set jtaDataSource back to non-null, test equality
- persistenceUnit.setJtaDataSource("newJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getJtaDataSource(), persistenceUnit.getJtaDataSource());
- }
-
- public void testUpdateNonJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that nonJtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to different nonJtaDataSource, test equality
- xmlPersistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to empty string, test equality
- xmlPersistenceUnit.setNonJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to null, test equality
- xmlPersistenceUnit.setNonJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource back to non-null, test equality
- xmlPersistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
- }
-
- public void testModifyNonJtaDataSource() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that nonJtaDataSources are initially equal
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to different nonJtaDataSource, test equality
- persistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to empty string, test equality
- persistenceUnit.setNonJtaDataSource("");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource to null, test equality
- persistenceUnit.setNonJtaDataSource(null);
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
-
- // set nonJtaDataSource back to non-null, test equality
- persistenceUnit.setNonJtaDataSource("newNonJtaDataSource");
-
- assertEquals(xmlPersistenceUnit.getNonJtaDataSource(), persistenceUnit.getNonJtaDataSource());
- }
-
- public void testUpdateJarFileRefs1() {
- // TODO
- }
-
- public void testUpdateJarFileRefs2() {
- // TODO
- }
-
- public void testUpdateImpliedMappingFileRef1() throws Exception {
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource ormResource = getOrmXmlResource();
- assertTrue(ormResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
-
- // remove orm.xml
- deleteResource(ormResource);
-
- assertFalse(ormResource.fileExists());
- assertNull(persistenceUnit.getImpliedMappingFileRef());
- }
-
- public void testUpdateImpliedMappingFileRef2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource ormResource = getOrmXmlResource();
- assertTrue(ormResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
-
- // add specified orm.xml
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("META-INF/orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- assertTrue(ormResource.fileExists());
- assertNull(persistenceUnit.getImpliedMappingFileRef());
- }
-
- public void testUpdateSpecifiedMappingFileRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals(0, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // add mapping file ref, test that it's added to context
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // add another ...
- xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm2.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(2, persistenceUnit.getSpecifiedMappingFileRefsSize());
- }
-
- public void testUpdateSpecifiedMappingFileRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two mapping file refs and test that there are two existing in xml and context
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
- xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm2.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(xmlPersistenceUnit.getMappingFiles().size(), 2);
- assertEquals(2, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // remove mapping file ref from xml, test that it's removed from context
- xmlMappingFileRef = xmlPersistenceUnit.getMappingFiles().get(0);
- xmlPersistenceUnit.getMappingFiles().remove(xmlMappingFileRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // remove another one ...
- xmlMappingFileRef = xmlPersistenceUnit.getMappingFiles().get(0);
- xmlPersistenceUnit.getMappingFiles().remove(xmlMappingFileRef);
-
- assertEquals(0, persistenceUnit.getSpecifiedMappingFileRefsSize());
- }
-
- public void testModifySpecifiedMappingFileRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals(0, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // add mapping file ref, test that it's added to resource
- persistenceUnit.addSpecifiedMappingFileRef("foo");
-
- assertEquals(1, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals("foo", xmlPersistenceUnit.getMappingFiles().get(0).getFileName());
-
- // add another ...
- persistenceUnit.addSpecifiedMappingFileRef("bar");
- assertEquals("foo", xmlPersistenceUnit.getMappingFiles().get(0).getFileName());
- assertEquals("bar", xmlPersistenceUnit.getMappingFiles().get(1).getFileName());
-
- assertEquals(2, xmlPersistenceUnit.getMappingFiles().size());
-
- // add another, testing order
- persistenceUnit.addSpecifiedMappingFileRef(0, "baz");
- assertEquals(3, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals("baz", xmlPersistenceUnit.getMappingFiles().get(0).getFileName());
- assertEquals("foo", xmlPersistenceUnit.getMappingFiles().get(1).getFileName());
- assertEquals("bar", xmlPersistenceUnit.getMappingFiles().get(2).getFileName());
- }
-
- public void testModifySpecifiedMappingFileRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two mapping file refs and test that there are two existing in xml and context
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
- xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("orm2.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(2, xmlPersistenceUnit.getMappingFiles().size());
- assertEquals(2, persistenceUnit.getSpecifiedMappingFileRefsSize());
-
- // remove mapping file ref from context, test that it's removed from xml
- persistenceUnit.removeSpecifiedMappingFileRef(0);
-
- assertEquals(1, xmlPersistenceUnit.getMappingFiles().size());
-
- // remove another one ...
- persistenceUnit.removeSpecifiedMappingFileRef(0);
-
- assertEquals(0, xmlPersistenceUnit.getMappingFiles().size());
- }
-
- public void testUpdateClassRefs1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getClasses().size());
- assertEquals(0, persistenceUnit.getSpecifiedClassRefsSize());
-
- // add mapping file ref, test that it's added to context
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedClassRefsSize());
-
- // add another ...
- xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Baz");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(2, persistenceUnit.getSpecifiedClassRefsSize());
- }
-
- public void testUpdateClassRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two class refs and test that there are two existing in xml and context
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Baz");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(2, xmlPersistenceUnit.getClasses().size());
- assertEquals(2, persistenceUnit.getSpecifiedClassRefsSize());
-
- // remove class ref from xml, test that it's removed from context
- xmlClassRef = xmlPersistenceUnit.getClasses().get(0);
- xmlPersistenceUnit.getClasses().remove(xmlClassRef);
-
- assertEquals(1, persistenceUnit.getSpecifiedClassRefsSize());
-
- // remove another one ...
- xmlClassRef = xmlPersistenceUnit.getClasses().get(0);
- xmlPersistenceUnit.getClasses().remove(xmlClassRef);
-
- assertEquals(0, persistenceUnit.getSpecifiedClassRefsSize());
- }
-
- public void testModifyClassRefs1() throws Exception {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertEquals(0, xmlPersistenceUnit.getClasses().size());
- assertEquals(0, persistenceUnit.getSpecifiedClassRefsSize());
-
- // add class ref, test that it's added to context
- persistenceUnit.addSpecifiedClassRef("Foo");
-
- getPersistenceXmlResource().save(null);
- assertEquals(1, xmlPersistenceUnit.getClasses().size());
- assertEquals("Foo", xmlPersistenceUnit.getClasses().get(0).getJavaClass());
-
- // add another ...
- persistenceUnit.addSpecifiedClassRef("Bar");
-
- assertEquals(2, xmlPersistenceUnit.getClasses().size());
- assertEquals("Foo", xmlPersistenceUnit.getClasses().get(0).getJavaClass());
- assertEquals("Bar", xmlPersistenceUnit.getClasses().get(1).getJavaClass());
-
-
- persistenceUnit.addSpecifiedClassRef(0, "Baz");
-
- assertEquals(3, xmlPersistenceUnit.getClasses().size());
- assertEquals("Baz", xmlPersistenceUnit.getClasses().get(0).getJavaClass());
- assertEquals("Foo", xmlPersistenceUnit.getClasses().get(1).getJavaClass());
- assertEquals("Bar", xmlPersistenceUnit.getClasses().get(2).getJavaClass());
- }
-
- public void testModifyClassRefs2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two class refs and test that there are two existing in xml and context
- XmlJavaClassRef xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Bar");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
- xmlClassRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- xmlClassRef.setJavaClass("com.foo.Baz");
- xmlPersistenceUnit.getClasses().add(xmlClassRef);
-
- assertEquals(2, xmlPersistenceUnit.getClasses().size());
- assertEquals(2, persistenceUnit.getSpecifiedClassRefsSize());
-
- // remove class ref from context, test that it's removed from xml
- persistenceUnit.removeSpecifiedClassRef(0);
-
- assertEquals(1, xmlPersistenceUnit.getClasses().size());
-
- // remove another one ...
- persistenceUnit.removeSpecifiedClassRef(0);
-
- assertEquals(0, xmlPersistenceUnit.getClasses().size());
- }
-
- public void testImpliedClassRefs1() throws Exception {
- createTestEntityWithPersistentInnerClass();
-
- getJpaProject().setDiscoversAnnotatedClasses(false);
- getPersistenceUnit().setSpecifiedExcludeUnlistedClasses(Boolean.TRUE);
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
-
- getJpaProject().setDiscoversAnnotatedClasses(true);
- getPersistenceUnit().setSpecifiedExcludeUnlistedClasses(Boolean.FALSE);
- assertEquals(2, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_TYPE_NAME);
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- removeXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(2, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_TYPE_NAME);
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- addXmlClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
-
- removeXmlClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
- this.verifyVirtualClassRef(FULLY_QUALIFIED_INNER_CLASS_NAME);
-
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_INNER_CLASS_NAME);
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
- }
-
- protected void verifyVirtualClassRef(String className) {
- if (this.getVirtualClassRef(className) == null) {
- fail("missing virtual class ref: " + className);
- }
- }
-
- protected ClassRef getVirtualClassRef(String className) {
- for (ClassRef ref : this.getPersistenceUnit().getImpliedClassRefs()) {
- if (Tools.valuesAreEqual(ref.getClassName(), className)) {
- return ref;
- }
- }
- return null;
- }
-
- public void testImpliedClassRefs2() throws Exception {
- createTestEntity();
- getJpaProject().setDiscoversAnnotatedClasses(true);
- JavaResourceType javaType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(1, CollectionTools.size(getPersistenceUnit().getImpliedClassRefs()));
-
- javaType.removeAnnotation(JPA.ENTITY);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
-
- javaType.addAnnotation(JPA.EMBEDDABLE);
- getJpaProject().synchronizeContextModel();
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
-
- javaType.removeAnnotation(JPA.EMBEDDABLE);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, getPersistenceUnit().getImpliedClassRefsSize());
-
- javaType.addAnnotation(JPA.MAPPED_SUPERCLASS);
- getJpaProject().synchronizeContextModel();
- assertEquals(1, getPersistenceUnit().getImpliedClassRefsSize());
- }
-
- public void testRenamePersistentTypeImpliedClassRefs() throws Exception {
- getJavaProject().getJpaProject().setDiscoversAnnotatedClasses(true);
- ICompilationUnit testType = createTestEntity();
- @SuppressWarnings("unused")
- ICompilationUnit otherTestType = this.createTestOtherTypeEntity();
-
- ClassRef testTypeClassRef = this.getVirtualClassRef(FULLY_QUALIFIED_TYPE_NAME);
- ClassRef otherTestTypeClassRef = this.getVirtualClassRef(FULLY_QUALIFIED_OTHER_TYPE_NAME);
-
- assertNotNull(testTypeClassRef);
- assertNotNull(otherTestTypeClassRef);
-
- JavaPersistentType testJavaPersistentType = testTypeClassRef.getJavaPersistentType();
- JavaPersistentType otherTestJavaPersistentType = otherTestTypeClassRef.getJavaPersistentType();
-
- testType.findPrimaryType().rename("TestType2", false, null);
-
- testTypeClassRef = this.getVirtualClassRef("test.TestType2");
- otherTestTypeClassRef = this.getVirtualClassRef(FULLY_QUALIFIED_OTHER_TYPE_NAME);
-
- assertNotNull(testTypeClassRef);
- assertNotNull(otherTestTypeClassRef);
-
- assertEquals(otherTestJavaPersistentType, otherTestTypeClassRef.getJavaPersistentType());
- assertNotSame(testJavaPersistentType, testTypeClassRef.getJavaPersistentType());
- }
-
- public void testUpdateExcludeUnlistedClasses() throws Exception {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // 1 - initial value is default
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 2 - set value, context changed
- xmlPersistenceUnit.setExcludeUnlistedClasses(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertTrue(persistenceUnit.excludesUnlistedClasses());
- assertEquals(Boolean.TRUE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- xmlPersistenceUnit.setExcludeUnlistedClasses(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertEquals(Boolean.FALSE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 3 - unset value, context changed
- xmlPersistenceUnit.setExcludeUnlistedClasses(null);
-
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
- }
-
- public void testModifyExcludeUnlistedClasses() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // 1 - initial value is default
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 2 - set value, resource changed
- persistenceUnit.setSpecifiedExcludeUnlistedClasses(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertTrue(persistenceUnit.excludesUnlistedClasses());
- assertEquals(Boolean.TRUE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- persistenceUnit.setSpecifiedExcludeUnlistedClasses(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertEquals(Boolean.FALSE, xmlPersistenceUnit.getExcludeUnlistedClasses());
-
- // 3 - set context to default, resource unset
- persistenceUnit.setSpecifiedExcludeUnlistedClasses(null);
-
- assertNull(persistenceUnit.getSpecifiedExcludeUnlistedClasses());
- assertFalse(persistenceUnit.excludesUnlistedClasses());
- assertNull(xmlPersistenceUnit.getExcludeUnlistedClasses());
- }
-
- public void testUpdateProperties1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertNull(xmlPersistenceUnit.getProperties());
- assertEquals(0, persistenceUnit.getPropertiesSize());
-
- // add "properties", test that there's no real change to context
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- assertEquals(0, persistenceUnit.getPropertiesSize());
-
- // add property, test that it's added to context
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("foo");
- xmlProperty.setValue("bar");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(1, persistenceUnit.getPropertiesSize());
-
- // add another ...
- xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("FOO");
- xmlProperty.setValue("BAR");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(2, persistenceUnit.getPropertiesSize());
- }
-
- public void testUpdateProperties2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("foo");
- xmlProperty.setValue("bar");
- xmlProperties.getProperties().add(xmlProperty);
- xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("FOO");
- xmlProperty.setValue("BAR");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, persistenceUnit.getPropertiesSize());
-
- // remove property from xml, test that it's removed from context
- xmlProperty = xmlProperties.getProperties().get(0);
- xmlProperties.getProperties().remove(xmlProperty);
-
- assertEquals(1, persistenceUnit.getPropertiesSize());
-
- // remove another one ...
- xmlProperty = xmlProperties.getProperties().get(0);
- xmlProperties.getProperties().remove(xmlProperty);
-
- assertEquals(0, persistenceUnit.getPropertiesSize());
- }
-
- public void testModifyProperties1() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test there are none initially
- assertNull(xmlPersistenceUnit.getProperties());
- assertEquals(0, persistenceUnit.getPropertiesSize());
-
- // add property, test that it's added to resource
- persistenceUnit.addProperty().setName("foo");
-
- assertNotNull(xmlPersistenceUnit.getProperties());
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals("foo", xmlPersistenceUnit.getProperties().getProperties().get(0).getName());
-
- // add another ...
- persistenceUnit.addProperty().setName("bar");
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals("foo", xmlPersistenceUnit.getProperties().getProperties().get(0).getName());
- assertEquals("bar", xmlPersistenceUnit.getProperties().getProperties().get(1).getName());
-
- // add another testing order
- persistenceUnit.addProperty(0).setName("baz");
-
- assertEquals(3, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals("baz", xmlPersistenceUnit.getProperties().getProperties().get(0).getName());
- assertEquals("foo", xmlPersistenceUnit.getProperties().getProperties().get(1).getName());
- assertEquals("bar", xmlPersistenceUnit.getProperties().getProperties().get(2).getName());
- }
-
- public void testModifyProperties2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("foo");
- xmlProperty.setValue("bar");
- xmlProperties.getProperties().add(xmlProperty);
- xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperty.setName("FOO");
- xmlProperty.setValue("BAR");
- xmlProperties.getProperties().add(xmlProperty);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, persistenceUnit.getPropertiesSize());
-
- // remove property from context, test that it's removed from resource
- persistenceUnit.removeProperty("foo");
-
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove another one. test that properties object is nulled
- persistenceUnit.removeProperty("FOO", "BAR");
-
- assertNull(xmlPersistenceUnit.getProperties());
- }
-
- public void testModifyProperties3() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- persistenceUnit.setProperty("foo", "bar", false);
- persistenceUnit.setProperty("FOO", "BAR", false);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, persistenceUnit.getPropertiesSize());
-
- // remove property from context, test that it's removed from resource
- persistenceUnit.removeProperty("foo", "bar");
-
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove another one, test that properties object is nulled
- persistenceUnit.removeProperty("FOO");
-
- assertNull(xmlPersistenceUnit.getProperties());
- }
-
- public void testModifyProperties4() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and test that there are two existing in xml and context
- persistenceUnit.setProperty("foo", "bar", false);
- persistenceUnit.setProperty("FOO", "BAR", false);
-
- assertEquals(2, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(2, persistenceUnit.getPropertiesSize());
-
- // modify a property, test its value
- persistenceUnit.setProperty("foo", "", false);
- assertEquals("", persistenceUnit.getProperty("foo").getValue());
-
- persistenceUnit.setProperty("foo", "BAR", false);
- assertEquals("BAR", persistenceUnit.getProperty("foo").getValue());
-
- // remove property from context, test that it's removed from resource
- persistenceUnit.removeProperty("FOO");
- assertNull(persistenceUnit.getProperty("FOO"));
- assertEquals(1, xmlPersistenceUnit.getProperties().getProperties().size());
-
- // remove by setting value to null, test that properties object is nulled
- persistenceUnit.setProperty("notExist", null, false);
- assertNull(persistenceUnit.getProperty("notExist"));
-
- persistenceUnit.setProperty("foo", null, false);
- assertNull(persistenceUnit.getProperty("foo"));
- assertNull(xmlPersistenceUnit.getProperties());
- }
-
- public void testModifyProperties5() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // testing duplicate keys, add four properties and test that there are four existing in xml and context
- persistenceUnit.setProperty("FOO", "BAR", false);
- persistenceUnit.setProperty("foo", "bar 3", true);
- persistenceUnit.setProperty("foo", "bar 2", true);
- persistenceUnit.setProperty("foo", "bar 1", true);
-
- assertEquals(4, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(4, persistenceUnit.getPropertiesSize());
-
- // remove a property, test that there are four existing in xml and context
- persistenceUnit.removeProperty("foo", "bar 1");
- assertEquals(3, xmlPersistenceUnit.getProperties().getProperties().size());
- assertEquals(3, persistenceUnit.getPropertiesSize());
- }
-
- public void testAccessProperty() {
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // add two properties and try to access it.
- persistenceUnit.setProperty("foo", "bar", false);
- persistenceUnit.setProperty("FOO", "BAR", false);
-
- PersistenceUnit.Property property = persistenceUnit.getProperty("foo");
- assertNotNull(property);
- assertEquals("bar", property.getValue());
- assertNotNull(persistenceUnit.getProperty("FOO"));
- assertEquals("BAR", persistenceUnit.getProperty("FOO").getValue());
- assertNull(persistenceUnit.getProperty("notExist"));
- }
-
- private PersistenceUnit.Property persistenceUnitFirstProperty() {
- return getPersistenceUnit().getProperties().iterator().next();
- }
-
- public void testUpdatePropertyName() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- // add property for testing
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperties.getProperties().add(xmlProperty);
-
- // test that names are initially equal
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
-
- // set name to different name, test equality
- xmlProperty.setName("newName");
-
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
-
- // set name to empty string, test equality
- xmlProperty.setName("");
-
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
-
- // set name back to non-null, test equality
- xmlProperty.setName("newName");
-
- assertEquals(xmlProperty.getName(), persistenceUnitFirstProperty().getName());
- }
-
- public void testUpdatePropertyValue() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
-
- // add property for testing
- XmlProperties xmlProperties = PersistenceFactory.eINSTANCE.createXmlProperties();
- xmlPersistenceUnit.setProperties(xmlProperties);
- XmlProperty xmlProperty = PersistenceFactory.eINSTANCE.createXmlProperty();
- xmlProperties.getProperties().add(xmlProperty);
-
- // test that values are initially equal
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value to different value, test equality
- xmlProperty.setValue("newValue");
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value to empty string, test equality
- xmlProperty.setValue("");
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value to null, test equality
- xmlProperty.setValue(null);
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
-
- // set value back to non-null, test equality
- xmlProperty.setValue("newValue");
-
- assertEquals(xmlProperty.getValue(), persistenceUnitFirstProperty().getValue());
- }
-
- public void testGetDefaultAccess() throws Exception {
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- createOrm2XmlFile();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- ListIterator<MappingFileRef> mappingFileRefs = getPersistenceUnit().getMappingFileRefs().iterator();
- OrmXml ormMappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
- OrmXml orm2MappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
-
- assertEquals(null, persistenceUnit.getDefaultAccess());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, persistenceUnit.getDefaultAccess());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnit.getDefaultAccess());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(null);
- assertFalse(ormMappingFile.getRoot().getPersistenceUnitMetadata().resourceExists());
- assertEquals(null, persistenceUnit.getDefaultAccess());
-
- orm2MappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnit.getDefaultAccess());
- }
-
- public void testGetDefaultSchema() throws Exception {
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- createOrm2XmlFile();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- ListIterator<MappingFileRef> mappingFileRefs = getPersistenceUnit().getMappingFileRefs().iterator();
- OrmXml ormMappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
- OrmXml orm2MappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
-
- assertEquals(null, persistenceUnit.getDefaultSchema());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", persistenceUnit.getDefaultSchema());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema(null);
- assertFalse(ormMappingFile.getRoot().getPersistenceUnitMetadata().resourceExists());
- assertEquals(null, persistenceUnit.getDefaultSchema());
-
- orm2MappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("BAR");
- assertEquals("BAR", persistenceUnit.getDefaultSchema());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- createOrm2XmlFile();
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- ListIterator<MappingFileRef> mappingFileRefs = getPersistenceUnit().getMappingFileRefs().iterator();
- OrmXml ormMappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
- OrmXml orm2MappingFile = (OrmXml) mappingFileRefs.next().getMappingFile();
-
- assertEquals(null, persistenceUnit.getDefaultCatalog());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("FOO");
- assertEquals("FOO", persistenceUnit.getDefaultCatalog());
-
- ormMappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog(null);
- assertFalse(ormMappingFile.getRoot().getPersistenceUnitMetadata().resourceExists());
- assertEquals(null, persistenceUnit.getDefaultCatalog());
-
- orm2MappingFile.getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedCatalog("BAR");
- assertEquals("BAR", persistenceUnit.getDefaultCatalog());
- }
-
- protected void createOrm2XmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, "orm2.xml");
- config.getDefaultOperation().execute(null, null);
-
- addXmlMappingFileRef("META-INF/orm2.xml");
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestOtherTypeEntity() throws Exception {
- return this.createTestType(PACKAGE_NAME, OTHER_TYPE_NAME + ".java", OTHER_TYPE_NAME, new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createTestEntityWithPersistentInnerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append(" public static class " + INNER_CLASS_NAME + " {}").append(CR);
- }
- });
- }
-
- public void testPersistentType() throws Exception {
- getJpaProject().setDiscoversAnnotatedClasses(false);
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- createTestEntity();
-
- //persistentType not listed in persistence.xml and discoverAnnotatedClasses is false
- //still find the persistentType because of changes for bug 190317
- assertFalse(getJpaProject().discoversAnnotatedClasses());
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType not listed in persistence.xml, discover annotated classes set to true
- getJpaProject().setDiscoversAnnotatedClasses(true);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType list as class in persistence.xml
- getJpaProject().setDiscoversAnnotatedClasses(false);
- XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- classRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME);
- getXmlPersistenceUnit().getClasses().add(classRef);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
-
- //test persistentType from orm.xml file that is specified in the persistence.xml
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- assertEquals(ormPersistentType, persistenceUnit.getPersistentType("model.Foo"));
-
- //test persistentType from orm.xml file that is implied(not specified) in the persistence.xml
- getXmlPersistenceUnit().getMappingFiles().remove(0);
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- }
-
-//TODO
-// String getDefaultSchema();
-// String getDefaultCatalog();
-// AccessType getDefaultAccess();
-// boolean getDefaultCascadePersist();
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceXmlTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceXmlTests.java
deleted file mode 100644
index 11bd30a5ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/PersistenceXmlTests.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceXml;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistence;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class PersistenceXmlTests extends ContextModelTestCase
-{
- public PersistenceXmlTests(String name) {
- super(name);
- }
-
- protected PersistenceXml getPersistenceXml() {
- return getRootContextNode().getPersistenceXml();
- }
-
- public void testUpdateAddPersistence() throws Exception {
- assertEquals(2, getJpaProject().getJpaFilesSize());
- JpaXmlResource prm = getPersistenceXmlResource();
- prm.getContents().clear();
- prm.save(null);
-
- //the ContentType of the persistence.xml file is no longer persistence, so the jpa file is removed
- assertNull(getPersistenceXml());
- assertEquals(1, getJpaProject().getJpaFilesSize()); //should only be the orm.xml file
-
- XmlPersistence xmlPersistence = PersistenceFactory.eINSTANCE.createXmlPersistence();
- xmlPersistence.setVersion("1.0");
- prm.getContents().add(xmlPersistence);
- prm.save(null);
-
- assertNotNull(getPersistenceXml().getPersistence());
- assertEquals(2, getJpaProject().getJpaFilesSize());
- }
-
- public void testUpdateRemovePersistence() throws Exception {
- JpaXmlResource prm = getPersistenceXmlResource();
-
- assertNotNull(getPersistenceXml().getPersistence());
-
- prm.getContents().clear();
- assertNull(getPersistenceXml());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/RootContextNodeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/RootContextNodeTests.java
deleted file mode 100644
index 82354ff11b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/context/persistence/RootContextNodeTests.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.context.JpaRootContextNode;
-import org.eclipse.jpt.jpa.core.internal.operations.PersistenceFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class RootContextNodeTests extends ContextModelTestCase
-{
- public RootContextNodeTests(String name) {
- super(name);
- }
-
- public void testUpdateAddPersistenceXml() throws Exception {
- deleteResource(getPersistenceXmlResource());
- JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContextNode();
-
- assertFalse(getPersistenceXmlResource().fileExists());
- assertNull(baseJpaContent.getPersistenceXml());
-
- IDataModel config =
- DataModelFactory.createDataModel(new PersistenceFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
-
- assertNotNull(baseJpaContent.getPersistenceXml());
- }
-
- public void testUpdateRemovePersistenceXml() throws Exception {
- JpaXmlResource pr = getPersistenceXmlResource();
- JpaRootContextNode baseJpaContent = getJavaProject().getJpaProject().getRootContextNode();
-
- assertNotNull(baseJpaContent.getPersistenceXml());
-
- deleteResource(pr);
-
- assertNull(baseJpaContent.getPersistenceXml());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/Generic2_0ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/Generic2_0ContextModelTestCase.java
deleted file mode 100644
index efc6a77229..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/Generic2_0ContextModelTestCase.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context;
-
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.platform.GenericPlatform;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class Generic2_0ContextModelTestCase extends ContextModelTestCase
-{
- protected Generic2_0ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_2_0.getVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, GenericPlatform.VERSION_2_0);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_2_0.getVersionString();
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return GenericPlatform.VERSION_2_0;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/Generic2_0JavaContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/Generic2_0JavaContextModelTests.java
deleted file mode 100644
index 2f80cfeb5f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/Generic2_0JavaContextModelTests.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class Generic2_0JavaContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(Generic2_0JavaContextModelTests.class.getPackage().getName());
- suite.addTestSuite(GenericJavaAssociationOverride2_0Tests.class);
- suite.addTestSuite(GenericJavaBasicMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaCascade2_0Tests.class);
- suite.addTestSuite(GenericJavaCollectionTable2_0Tests.class);
- suite.addTestSuite(GenericJavaElementCollectionMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaEntity2_0Tests.class);
- suite.addTestSuite(GenericJavaEmbeddedMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaEmbeddedIdMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaIdMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaManyToManyMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaManyToOneMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaOneToManyMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaOneToOneMapping2_0Tests.class);
- suite.addTestSuite(GenericJavaPersistentAttribute2_0Tests.class);
- suite.addTestSuite(GenericJavaPersistentType2_0Tests.class);
- suite.addTestSuite(GenericJavaSequenceGenerator2_0Tests.class);
- suite.addTestSuite(GenericJavaVersionMapping2_0Tests.class);
- return suite;
- }
-
- private Generic2_0JavaContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java
deleted file mode 100644
index fa0ff6e174..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaAssociationOverride2_0Tests.java
+++ /dev/null
@@ -1,580 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.OverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.VirtualOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaAssociationOverride2_0Tests extends Generic2_0ContextModelTestCase
-{
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE_NAME";
-
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(CR);
- sb.append(" private AnnotationTestTypeChild address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany");
- sb.append(CR);
- sb.append(" private java.util.Collection<AnnotationTestTypeChild> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@AssociationOverride(name=\"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public GenericJavaAssociationOverride2_0Tests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", javaAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
-
- //set name in the resource model, verify context model updated
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- //set name to null in the resource model
- associationOverrideResource.setName(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
- assertNull(associationOverrideResource.getName());
-
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, overrideContainer.getSpecifiedOverridesSize());
- javaAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", javaAssociationOverride.getName());
- assertEquals("FOO", associationOverrideResource.getName());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator().hasNext());
- }
-
- public void testModifyName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- AssociationOverride specifiedAssociationOverride = virtualAssociationOverride.convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("address", specifiedAssociationOverride.getName());
- assertEquals("address", associationOverrideResource.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
-
- //set name in the context model, verify resource model modified
- specifiedAssociationOverride.setName("foo");
- assertEquals("foo", specifiedAssociationOverride.getName());
- assertEquals("foo", associationOverrideResource.getName());
-
- //set name to null in the context model
- specifiedAssociationOverride.setName(null);
- assertNull(specifiedAssociationOverride.getName());
- associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- assertNull(associationOverrideResource.getName());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride specifiedOverride = overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- JoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
-
- JoinColumn joinColumn = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", associationOverrideResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = joiningStrategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
-
- ListIterator<? extends JoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- JoinColumnRelationshipStrategy joiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals(1, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(3, associationOverrideResource.getJoinColumnsSize());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, associationOverrideResource.getJoinColumnsSize());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, associationOverrideResource.getJoinColumnsSize());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, associationOverrideResource.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- AssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- JoinColumnRelationshipStrategy joiningStrategy = javaAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, associationOverrideResource.getJoinColumnsSize());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", associationOverrideResource.joinColumnAt(0).getName());
- assertEquals("BAR", associationOverrideResource.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverrideResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- JavaVirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- JavaAssociationOverride specifiedAssociationOverride = virtualAssociationOverride.convertToSpecified();
- JavaJoinColumnRelationshipStrategy joiningStrategy = specifiedAssociationOverride.getRelationship().getJoinColumnStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- ListIterator<JavaJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- JoinColumn joinColumn = joinColumns.next();
- assertEquals("address_id", joinColumn.getSpecifiedName());
- assertEquals("id", joinColumn.getSpecifiedReferencedColumnName());
-
- associationOverrideResource.addJoinColumn(0);
- associationOverrideResource.addJoinColumn(1);
- associationOverrideResource.addJoinColumn(2);
-
- associationOverrideResource.joinColumnAt(0).setName("FOO");
- associationOverrideResource.joinColumnAt(1).setName("BAR");
- associationOverrideResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("address_id", joinColumns.next().getName());
-
- associationOverrideResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joiningStrategy.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testGetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- associationOverrideResource.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("FOO", specifiedAssociationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals(ASSOCIATION_OVERRIDE_NAME, specifiedAssociationOverride.getName());
-
- specifiedAssociationOverride.setName("FOO");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation associationOverrideResource = (AssociationOverrideAnnotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- assertEquals("FOO", associationOverrideResource.getName());
- }
-
- public void testDefaultName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", associationOverride.getName());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = getJavaEntity();
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- assertEquals("AnnotationTestTypeChild", entity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertTrue(associationOverride.isVirtual());
- }
-
-
- public void testSetJoinTableName() throws Exception {
- createTestMappedSuperclassManyToMany();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified();
- JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverride2_0Annotation associationOverrideResource = (AssociationOverride2_0Annotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
-
- JoinTable joinTable = joiningStrategy.getJoinTable();
- joinTable.setSpecifiedName("FOO");
-
- assertEquals("FOO", associationOverrideResource.getJoinTable().getName());
- }
-
- public void testUpdateJoinTable() throws Exception {
- createTestMappedSuperclassManyToMany();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- javaAssociationOverride = ((VirtualAssociationOverride) javaAssociationOverride).convertToSpecified();
- JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(PACKAGE_NAME + ".AnnotationTestTypeChild", Kind.TYPE);
- AssociationOverride2_0Annotation associationOverrideResource = (AssociationOverride2_0Annotation) resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
-
- associationOverrideResource.getJoinTable().setName("MY_JOIN_TABLE");
- getJpaProject().synchronizeContextModel();
- assertEquals("MY_JOIN_TABLE", joiningStrategy.getJoinTable().getSpecifiedName());
-
- associationOverrideResource.getJoinTable().removeJoinColumn(0); // remove default
- associationOverrideResource.getJoinTable().addJoinColumn(0);
- associationOverrideResource.getJoinTable().addJoinColumn(1);
- associationOverrideResource.getJoinTable().addJoinColumn(2);
-
- associationOverrideResource.getJoinTable().joinColumnAt(0).setName("FOO");
- associationOverrideResource.getJoinTable().joinColumnAt(1).setName("BAR");
- associationOverrideResource.getJoinTable().joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- associationOverrideResource.getJoinTable().removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testDefaultJoinTableName() throws Exception {
- createTestMappedSuperclassManyToMany();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ReadOnlyAssociationOverride javaAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- VirtualOverrideRelationship2_0 rel = (VirtualOverrideRelationship2_0) javaAssociationOverride.getRelationship();
- VirtualJoinTable joinTable = rel.getJoinTableStrategy().getJoinTable();
-
- assertEquals("AnnotationTestTypeChild_AnnotationTestTypeChild", joinTable.getName());
-
-
- getJavaEntity().getTable().setSpecifiedName("FOO");
- assertEquals("FOO_FOO", joinTable.getName());
-
- PersistentType mappedSuperclass = getJavaEntity().getPersistentType().getSuperPersistentType();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) mappedSuperclass.getAttributeNamed("address").getMapping();
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTable.getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaBasicMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaBasicMapping2_0Tests.java
deleted file mode 100644
index 2737f5ab6b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaBasicMapping2_0Tests.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.LobAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaBasicMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
-
- public GenericJavaBasicMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testBasicMorphToDefaultBasic() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseEnumeratedConverter.class);
- ((BaseEnumeratedConverter) basicMapping.getConverter()).setSpecifiedEnumType(EnumType.STRING);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getEnumType());
-
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNull(((BasicMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToVersion() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbedded() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToEmbeddedId() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToTransient() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((OneToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((OneToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToOneToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((OneToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
- public void testBasicMorphToManyToOne() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
-//TODO assertEquals(FetchType.EAGER, ((ManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
-// assertEquals(Boolean.FALSE, ((ManyToOneMapping) persistentAttribute.getMapping()).getSpecifiedOptional());
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToManyToMany() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
-// assertEquals(FetchType.EAGER, ((ManyToManyMapping) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
- public void testBasicMorphToElementCollection() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(basicMapping.isDefault());
- basicMapping.getColumn().setSpecifiedName("FOO");
- resourceField.addAnnotation(TemporalAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(LobAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(EnumeratedAnnotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- basicMapping.setSpecifiedFetch(FetchType.EAGER);
- basicMapping.setSpecifiedOptional(Boolean.FALSE);
- assertFalse(basicMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
-// assertEquals(FetchType.EAGER, ((ElementCollectionMapping2_0) persistentAttribute.getMapping()).getSpecifiedFetch());
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(LobAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EnumeratedAnnotation.ANNOTATION_NAME));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCascade2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCascade2_0Tests.java
deleted file mode 100644
index f7858aa4ed..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCascade2_0Tests.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaCascade2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- }
-
-
- public GenericJavaCascade2_0Tests(String name) {
- super(name);
- }
-
-
- public void testUpdateCascadeDetach() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation annotation = (OneToOne2_0Annotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping2_0 mapping = (JavaOneToOneMapping2_0) persistentAttribute.getMapping();
- JavaCascade2_0 cascade = (JavaCascade2_0) mapping.getCascade();
-
- assertFalse(cascade.isDetach());
- assertFalse(annotation.isCascadeDetach());
-
- //set detach in the resource model, verify context model updated
- annotation.setCascadeDetach(true);
- getJpaProject().synchronizeContextModel();
- assertTrue(annotation.isCascadeDetach());
- assertTrue(cascade.isDetach());
-
- //set detach to false in the resource model
- annotation.setCascadeDetach(false);
- getJpaProject().synchronizeContextModel();
- assertFalse(annotation.isCascadeDetach());
- assertFalse(cascade.isDetach());
- }
-
- public void testModifyCascadeDetach() throws Exception {
- createTestEntityWithOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation annotation = (OneToOne2_0Annotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToOneMapping2_0 mapping = (JavaOneToOneMapping2_0) persistentAttribute.getMapping();
- JavaCascade2_0 cascade = (JavaCascade2_0) mapping.getCascade();
-
- assertFalse(cascade.isDetach());
- assertFalse(annotation.isCascadeDetach());
-
- //set detach in the context model, verify resource model updated
- cascade.setDetach(true);
- assertTrue(annotation.isCascadeDetach());
- assertTrue(cascade.isDetach());
-
- //set detach to false in the context model
- cascade.setDetach(false);
- assertFalse(annotation.isCascadeDetach());
- assertFalse(cascade.isDetach());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCollectionTable2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCollectionTable2_0Tests.java
deleted file mode 100644
index 58a2b8f8b1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaCollectionTable2_0Tests.java
+++ /dev/null
@@ -1,723 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaCollectionTable2_0Tests extends Generic2_0ContextModelTestCase
-{
- public GenericJavaCollectionTable2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append(" private Collection<String> projects;").append(CR);
- }
- });
- }
-
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable);
-
-
- //set name in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedName());
- assertEquals("FOO", resourceCollectionTable.getName());
-
- //set name to null in the resource model
- resourceCollectionTable.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable.getName());
-
- resourceCollectionTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedName());
- assertEquals("FOO", resourceCollectionTable.getName());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable3 = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable3);
-
- //set name in the context model, verify resource model modified
- collectionTable.setSpecifiedName("foo");
- resourceCollectionTable3 = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedName());
- assertEquals("foo", resourceCollectionTable3.getName());
-
- //set name to null in the context model
- collectionTable.setSpecifiedName(null);
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
-
- //add the collection table annotation, verify default collection table name is the same
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
- assertNotNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
-
- //set the entity name, verify default collection table name updates
- getJavaEntity().setSpecifiedName("Foo");
- assertEquals("Foo_projects", collectionTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable);
-
-
- //set schema in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceCollectionTable.getSchema());
-
- //set schema to null in the resource model
- resourceCollectionTable.setSchema(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable.getSchema());
-
- resourceCollectionTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceCollectionTable.getSchema());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable);
-
- //set schema in the context model, verify resource model modified
- collectionTable.setSpecifiedSchema("foo");
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedSchema());
- assertEquals("foo", resourceCollectionTable.getSchema());
-
- //set schema to null in the context model
- collectionTable.setSpecifiedSchema(null);
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable);
-
-
- //set catalog in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceCollectionTable.getCatalog());
-
- //set catalog to null in the resource model
- resourceCollectionTable.setCatalog(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable.getCatalog());
-
- resourceCollectionTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceCollectionTable.getCatalog());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable);
-
- //set catalog in the context model, verify resource model modified
- collectionTable.setSpecifiedCatalog("foo");
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedCatalog());
- assertEquals("foo", resourceCollectionTable.getCatalog());
-
- //set catalog to null in the context model
- collectionTable.setSpecifiedCatalog(null);
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JoinColumn joinColumn = collectionTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = collectionTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = collectionTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableResource.getJoinColumnsSize());
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableResource.getJoinColumnsSize());
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableResource.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
-
- collectionTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
-
- collectionTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAR", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- joinTableResource.addJoinColumn(0);
- joinTableResource.addJoinColumn(1);
- joinTableResource.addJoinColumn(2);
-
- joinTableResource.joinColumnAt(0).setName("FOO");
- joinTableResource.joinColumnAt(1).setName("BAR");
- joinTableResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(collectionTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testGetDefaultJoinColumn() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.getSpecifiedJoinColumnsSize());
-
- collectionTable.addSpecifiedJoinColumn(0);
- assertEquals(1, collectionTable.getSpecifiedJoinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, collectionTable.getSpecifiedJoinColumnsSize());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(2, collectionTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
- collectionTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
-
- collectionTable.moveUniqueConstraint(2, 0);
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- collectionTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- joinTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- joinTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java
deleted file mode 100644
index dffdb9a48f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaElementCollectionMapping2_0Tests.java
+++ /dev/null
@@ -1,2615 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaElementCollectionMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
- public static final String EMBEDDABLE_TYPE_NAME = "Address";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericEmbeddableElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericBasicElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<String> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonGenericElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEntityKeyElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddablePropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
- private void createSelfReferentialElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.List<Foo> elementCollection;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public GenericJavaElementCollectionMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollectionAnnotation = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollectionAnnotation.getTargetClass());
-
- //set target class in the resource model, verify context model updated
- elementCollectionAnnotation.setTargetClass("newTargetClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetClass", elementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollectionAnnotation.getTargetClass());
-
- //set target class to null in the resource model
- elementCollectionAnnotation.setTargetClass(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollectionAnnotation.getTargetClass());
- }
-
- public void testModifySpecifiedTargetClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedTargetClass("newTargetClass");
- assertEquals("newTargetClass", elementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the context model
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
- public void testDefaultTargetClass() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Embeddable, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassNonGenericCollection() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassGenericCollection() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassNonGenericMap() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassGenericMap() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testTargetClass() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getTargetClass());
-
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertEquals("foo", elementCollectionMapping.getTargetClass());
-
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getTargetClass());
- }
-
- protected Embeddable getResolvedTargetEmbeddable(ElementCollectionMapping2_0 mapping) {
- return (Embeddable) ReflectionTools.executeMethod(mapping, "getResolvedTargetEmbeddable");
- }
-
- public void testResolvedTargetEmbeddable() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target embeddable not in the persistence unit
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
- //add target embeddable to the persistence unit, now target embeddable should resolve
- createTestTargetEmbeddableAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
-
- elementCollectionMapping.setSpecifiedTargetClass(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
-
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
- }
-
- public void testResolvedTargetEmbeddableWithBasicType() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target is a basic type, so resolved target embeddable is null
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the resource model, verify context model updated
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.EAGER, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the resource model
- elementCollection.setFetch(null);
- getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the context model
- elementCollectionMapping.setSpecifiedFetch(null);
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testGetValueTypeEmbeddable() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeNone() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.NO_TYPE, elementCollectionMapping.getValueType());
-
- elementCollectionMapping.setSpecifiedTargetClass("Address");
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeBasic() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", elementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", elementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- elementCollectionMapping.setSpecifiedMapKey(null);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- elementCollectionMapping.setNoMapKey(true);
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- elementCollectionMapping2_0.setSpecifiedTargetClass("Address");
- mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- elementCollectionMapping2_0.setSpecifiedTargetClass("String");
- mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClass);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClass.setValue("myMapKeyClass");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKeyClass", elementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClass.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClass.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClass.getValue());
-
- mapKeyClass.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", elementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- elementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", elementCollectionMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", elementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", elementCollectionMapping.getMapKeyClass());
-
- elementCollectionMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", elementCollectionMapping.getMapKeyClass());
-
- elementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", elementCollectionMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) elementCollectionMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
- }
-
- public void testGetValueColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getValueColumn().getSpecifiedName());
- assertEquals("id", elementCollectionMapping.getValueColumn().getName());
- assertEquals(TYPE_NAME + "_id", elementCollectionMapping.getValueColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", elementCollectionMapping.getValueColumn().getSpecifiedName());
- assertEquals("foo", elementCollectionMapping.getValueColumn().getName());
- assertEquals("id", elementCollectionMapping.getValueColumn().getDefaultName());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_addresses", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_addresses", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(6, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(6, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state.name");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME_ + "State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType persistentType = specifiedClassRefs.next().getJavaPersistentType();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- assertEquals(false, virtualAttributeOverrides.hasNext());
-
-
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- EmbeddedMapping nestedEmbeddedMapping = (EmbeddedMapping) addressPersistentType.getAttributeNamed("state").getMapping();
- AttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("abbr", virtualAttributeOverride.getName());
-
- PersistentType statePersistentType = specifiedClassRefs.next().getJavaPersistentType();
- BasicMapping abbrMapping = (BasicMapping) statePersistentType.getAttributeNamed("abbr").getMapping();
- abbrMapping.getColumn().setSpecifiedName("BLAH");
- abbrMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- abbrMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- abbrMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- abbrMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- abbrMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- abbrMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.state) attribute override to verify it is getting settings from the specified column on State.abbr
- virtualAttributeOverride = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("state").getMapping()).getAttributeOverrideContainer().getOverrideNamed("abbr");
- assertEquals("abbr", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
- }
-
- public void testGetMapKeyColumn() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", elementCollectionMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_addresses", elementCollectionMapping.getMapKeyColumn().getTable());//collection table name
-
- elementCollectionMapping.getCollectionTable().setSpecifiedName("MY_COLLECTION_TABLE");
- assertEquals("MY_COLLECTION_TABLE", elementCollectionMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", elementCollectionMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", elementCollectionMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", elementCollectionMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("parcelNumber", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- classRefs.next();
- Embeddable propertyInfoEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping parcelNumberMapping = (BasicMapping) propertyInfoEmbeddable.getPersistentType().getAttributeNamed("parcelNumber").getMapping();
- parcelNumberMapping.getColumn().setSpecifiedName("FOO1");
- parcelNumberMapping.getColumn().setSpecifiedTable("BAR1");
- parcelNumberMapping.getColumn().setColumnDefinition("COLUMN_DEF1");
- parcelNumberMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- parcelNumberMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- parcelNumberMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- parcelNumberMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("FOO1", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR1", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF1", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- parcelNumberMapping.getColumn().setSpecifiedName(null);
- parcelNumberMapping.getColumn().setSpecifiedTable(null);
- parcelNumberMapping.getColumn().setColumnDefinition(null);
- parcelNumberMapping.getColumn().setSpecifiedInsertable(null);
- parcelNumberMapping.getColumn().setSpecifiedUpdatable(null);
- parcelNumberMapping.getColumn().setSpecifiedUnique(null);
- parcelNumberMapping.getColumn().setSpecifiedNullable(null);
- parcelNumberMapping.getColumn().setSpecifiedLength(null);
- parcelNumberMapping.getColumn().setSpecifiedPrecision(null);
- parcelNumberMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("parcelNumber", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, valueAttributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, valueAttributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(1, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(5, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(5, valueAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(6, valueAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(2, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.name");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, valueAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME_ + "PropertyInfo");
- addXmlClassRef(PACKAGE_NAME_ + "State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- valueOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- valueOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("value.size", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertFalse(overrideAnnotations.hasNext());
-
- valueOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- mapKeyOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("value.size", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertFalse(overrideAnnotations.hasNext());
-
- assertEquals("parcelNumber", valueOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(2, valueOverrideContainer.getVirtualOverridesSize());
- assertEquals("city", mapKeyOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(3, mapKeyOverrideContainer.getVirtualOverridesSize());
-
- valueOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- mapKeyOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(overrideAnnotations.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = valueOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("parcelNumber", virtualAttributeOverrides.next().getName());
- assertEquals("size", virtualAttributeOverrides.next().getName());
- assertEquals("tax", virtualAttributeOverrides.next().getName());
- assertEquals(3, valueOverrideContainer.getVirtualOverridesSize());
-
- virtualAttributeOverrides = mapKeyOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<? extends AttributeOverride> specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertEquals("size", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- this.getJpaProject().synchronizeContextModel();
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("value.size", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertFalse(overrideAnnotations.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("size", specifiedOverrides.next().getName());
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
-
- resourceField.moveAnnotation(3, 2, AttributeOverrideAnnotation.ANNOTATION_NAME);
- this.getJpaProject().synchronizeContextModel();
- getJpaProject().synchronizeContextModel();
-
- overrideAnnotations = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("value.size", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) overrideAnnotations.next()).getName());
- assertFalse(overrideAnnotations.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("size", specifiedOverrides.next().getName());
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSelfReferentialElementCollection() throws Exception {
- createSelfReferentialElementCollection();
- addXmlClassRef(PACKAGE_NAME + ".Foo");
-
- //If there is a StackOverflowError you will not be able to get the mapping
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("elementCollection").getMapping();
- assertFalse(elementCollectionMapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
- elementCollectionMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((BaseEnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((BaseEnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- elementCollectionMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseEnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
- elementCollectionMapping.setMapKeyConverter(BaseTemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((BaseTemporalConverter) elementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((BaseTemporalConverter) elementCollectionMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) elementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseTemporalConverter) elementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-
- public void testSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- ListIterator<? extends JoinColumn> specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
-
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
- }
-
- public void testSpecifiedMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(0, elementCollectionMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, elementCollectionMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, elementCollectionMapping.getSpecifiedMapKeyJoinColumnsSize());
- }
-
- public void testMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyElementCollectionMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(1, elementCollectionMapping.getMapKeyJoinColumnsSize());
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, elementCollectionMapping.getMapKeyJoinColumnsSize());
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, elementCollectionMapping.getMapKeyJoinColumnsSize());
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, elementCollectionMapping.getMapKeyJoinColumnsSize());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAR");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn2() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- elementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- elementCollectionMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
-
-
- elementCollectionMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("FOO");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAR");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(2, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testMapKeyJoinColumnIsDefault() throws Exception {
- createTestEntityWithEntityKeyElementCollectionMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertTrue(elementCollectionMapping.getDefaultMapKeyJoinColumn().isVirtual());
-
- elementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- JoinColumn specifiedJoinColumn = elementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isVirtual());
-
- assertNull(elementCollectionMapping.getDefaultMapKeyJoinColumn());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java
deleted file mode 100644
index a8557f089f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedIdMapping2_0Tests.java
+++ /dev/null
@@ -1,368 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaEmbeddedIdMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@EmbeddedId").append(CR);
- sb.append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME +" myEmbeddedId;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
-
- public GenericJavaEmbeddedIdMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((JavaEmbeddedMapping) persistentAttribute.getMapping()).getAttributeOverrideContainer().getOverrides().iterator().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithEmbeddedIdMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EmbeddedIdMapping embeddedIdMapping = (EmbeddedIdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- assertFalse(embeddedIdMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
- assertNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java
deleted file mode 100644
index 194856a99c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEmbeddedMapping2_0Tests.java
+++ /dev/null
@@ -1,1608 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumn;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTable;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.VirtualOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaEmbeddedMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- public static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithEmbeddedMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded").append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME + " myEmbedded;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
- private void createAddressEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Address {");
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Customer").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- public GenericJavaEmbeddedMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(((JavaEmbeddedMapping) persistentAttribute.getMapping()).getAttributeOverrideContainer().getOverrides().iterator().hasNext());
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testDefaultEmbeddedMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- assertTrue(persistentAttribute.getMapping() instanceof JavaEmbeddedMapping);
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testDefaultEmbeddedMappingGenericEmbeddable() throws Exception {
- createTestEntityWithDefaultEmbeddedMapping();
- createTestGenericEmbeddable();
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Embeddable1");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbeddable");
- assertNotNull(persistentAttribute.getMapping());
- assertEquals(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- private void createTestEntityWithDefaultEmbeddedMapping() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 { ").append(CR);
- sb.append("private Embeddable1<Integer> myEmbeddable;").append(CR);
- sb.append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericEmbeddable() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class Embeddable1<T> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Embeddable1.java", sourceWriter);
- }
-
- private void createSelfReferentialEmbedded() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Foo embedded;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributeNamed("myEmbedded");
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(embeddedMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
- assertNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("myEmbedded", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME, defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state");
- getJpaProject().synchronizeContextModel();
- assertEquals(0, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state", virtualAttributeOverrides.next().getName());
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
-
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("state", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrideDefaults() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- VirtualJoinColumnRelationshipStrategy joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("address", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- VirtualJoinColumn virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("address_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals(TYPE_NAME, virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaPersistentType javaEmbeddable = classRefs.next().getJavaPersistentType();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) javaEmbeddable.getAttributeNamed("address").getMapping();
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("address", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals("MY_JOIN_COLUMN", joiningStrategy.getJoinColumns().iterator().next().getName());
-
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- Iterator<NestableAnnotation> associationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
-
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("addresses", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- Iterator<NestableAnnotation> associationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
-
- assertEquals("addresses", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertEquals(2, CollectionTools.size(resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator()));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> associationOverrideResources = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("addresses", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("addresses", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- associationOverrideResources = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaAssociationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("addresses", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("addresses", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("addresses", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceField.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("addresses", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- ((AssociationOverrideAnnotation) resourceField.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE)).setName("FOO");
- ((AssociationOverrideAnnotation) resourceField.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE)).setName("BAR");
- ((AssociationOverrideAnnotation) resourceField.addAnnotation(2, JPA.ASSOCIATION_OVERRIDE)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.moveAnnotation(2, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.moveAnnotation(0, 1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
-
- public void testVirtualAssociationOverrideJoinTableDefaults() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- JavaAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- VirtualJoinTable joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals("AnnotationTestType_Address", joinTable.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- VirtualJoinColumn virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
- assertEquals("AnnotationTestType_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals("AnnotationTestType_Address", virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- VirtualJoinColumn virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("addresses_id", virtualInverseJoinColumn.getName());
- assertEquals("id", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("AnnotationTestType_Address", virtualInverseJoinColumn.getTable());
- assertEquals(null, virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(true, virtualInverseJoinColumn.isInsertable());
- assertEquals(true, virtualInverseJoinColumn.isUpdatable());
- assertEquals(false, virtualInverseJoinColumn.isUnique());
- assertEquals(true, virtualInverseJoinColumn.isNullable());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaPersistentType javaEmbeddable = classRefs.next().getJavaPersistentType();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) javaEmbeddable.getAttributeNamed("addresses").getMapping();
- JoinTableRelationshipStrategy joinTableStrategy = oneToManyMapping.getRelationship().getJoinTableStrategy();
- joinTableStrategy.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = joinTableStrategy.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- JoinColumn inverseJoinColumn = joinTableStrategy.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("MY_INVERSE_JOIN_COLUMN");
- inverseJoinColumn.setSpecifiedReferencedColumnName("MY_INVERSE_REFERENCE_COLUMN");
- inverseJoinColumn.setSpecifiedTable("INVERSE_BAR");
- inverseJoinColumn.setColumnDefinition("INVERSE_COLUMN_DEF");
- inverseJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
- inverseJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- inverseJoinColumn.setSpecifiedUnique(Boolean.TRUE);
- inverseJoinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("MY_INVERSE_JOIN_COLUMN", virtualInverseJoinColumn.getName());
- assertEquals("MY_INVERSE_REFERENCE_COLUMN", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("INVERSE_BAR", virtualInverseJoinColumn.getTable());
- assertEquals("INVERSE_COLUMN_DEF", virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(false, virtualInverseJoinColumn.isInsertable());
- assertEquals(false, virtualInverseJoinColumn.isUpdatable());
- assertEquals(true, virtualInverseJoinColumn.isUnique());
- assertEquals(false, virtualInverseJoinColumn.isNullable());
-
-
- assertNull(resourceField.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType customerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- JavaEmbeddedMapping embeddedMapping = (JavaEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- assertEquals(5, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("Customer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("Customer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- JavaEmbeddedMapping nestedEmbeddedMapping = (JavaEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping();
- JavaAttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("plusfour", virtualAttributeOverride.getName());
-
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.zipCode) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) ((JavaEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour");
- assertEquals("plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) ((JavaEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((JavaEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
- virtualAttributeOverride = (VirtualAttributeOverride) ((JavaEmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testSelfReferentialEmbeddedMapping() throws Exception {
- createSelfReferentialEmbedded();
- addXmlClassRef(PACKAGE_NAME + ".Foo");
-
- //If there is a StackOverflowError you will not be able to get the mapping
- JavaEmbeddedMapping2_0 embeddedMapping = (JavaEmbeddedMapping2_0) getJavaPersistentType().getAttributeNamed("embedded").getMapping();
- assertFalse(embeddedMapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java
deleted file mode 100644
index 7c9ee50303..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaEntity2_0Tests.java
+++ /dev/null
@@ -1,2057 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaNamedQuery;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.LockModeType2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.NamedQuery2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.NamedQuery2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaEntity2_0Tests extends Generic2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public GenericJavaEntity2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
- private void createTestMappedSuperclassCustomerWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEntityLongTimeCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("LongTimeCustomer extends Customer ");
- sb.append("{}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "LongTimeCustomer.java", sourceWriter);
- }
-
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@AssociationOverride(name=\"a\", joinTable=@JoinTable)");
- }
- });
- }
-
-
- private LockModeType2_0 lockModeOf(NamedQuery2_0Annotation resourceQuery) {
- return resourceQuery == null ? null : LockModeType2_0.fromJavaResourceModel(resourceQuery.getLockMode());
- }
-
- public void testAddNamedQuery2_0() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = this.getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- NamedQuery2_0 namedQuery1 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(0);
- namedQuery1.setName("FOO");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- NamedQuery2_0Annotation queryAnnotation = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("FOO", queryAnnotation.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(queryAnnotation));
-
- NamedQuery2_0 namedQuery2 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
- namedQuery2.setSpecifiedLockMode(LockModeType2_0.READ);
-
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- queryAnnotation = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAR", queryAnnotation.getName());
- assertEquals(LockModeType2_0.READ, this.lockModeOf(queryAnnotation));
- assertEquals("FOO", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
-
- NamedQuery2_0 namedQuery3 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
- namedQuery3.setSpecifiedLockMode(LockModeType2_0.WRITE);
-
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals("BAR", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
- queryAnnotation = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAZ", queryAnnotation.getName());
- assertEquals(LockModeType2_0.WRITE, this.lockModeOf(queryAnnotation));
- assertEquals("FOO", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
-
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery1, namedQueries.next());
-
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- entity.getQueryContainer().addNamedNativeQuery(0).setName("foo");
- }
-
- public void testRemoveNamedQuery2_0() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
- NamedQuery2_0 namedQuery1 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(1);
- namedQuery1.setName("BAR");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.READ);
-
- NamedQuery2_0 namedQuery2 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(2);
- namedQuery2.setName("BAZ");
- namedQuery2.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(2, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- NamedQuery2_0Annotation annotation1 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAR", annotation1.getName());
- assertEquals(LockModeType2_0.READ, this.lockModeOf(annotation1));
-
- NamedQuery2_0Annotation annotation2 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAZ", annotation2.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(annotation2));
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(1, CollectionTools.size(javaNamedQueries));
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- annotation2 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAZ", annotation2.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(annotation2));
-
- entity.getQueryContainer().removeNamedQuery(0);
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(0, CollectionTools.size(javaNamedQueries));
- }
-
- public void testMoveNamedQuery2_0() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- entity.getQueryContainer().addNamedQuery(0).setName("FOO");
- NamedQuery2_0 namedQuery1 = (NamedQuery2_0) entity.getQueryContainer().addNamedQuery(1);
- namedQuery1.setName("BAR");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
- entity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- Iterator<NestableAnnotation> javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals(3, CollectionTools.size(javaNamedQueries));
-
-
- entity.getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAR", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- NamedQuery2_0Annotation annotation1 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAR", annotation1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(annotation1));
- assertEquals("BAZ", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
- assertEquals("FOO", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
-
-
- entity.getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAR", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
-
- javaNamedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals("BAZ", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
- annotation1 = (NamedQuery2_0Annotation) javaNamedQueries.next();
- assertEquals("BAR", annotation1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(annotation1));
- assertEquals("FOO", ((NamedQuery2_0Annotation) javaNamedQueries.next()).getName());
- }
-
- public void testUpdateNamedQueries2_0() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
-
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(0, JPA.NAMED_QUERY)).setName("FOO");
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY)).setName("BAR");
- NamedQuery2_0Annotation annotation1 = (NamedQuery2_0Annotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY);
- annotation1.setName("BAZ");
- annotation1.setLockMode(org.eclipse.jpt.jpa.core.jpa2.resource.java.LockModeType_2_0.OPTIMISTIC);
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaNamedQuery> namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- NamedQuery2_0 namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAR", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.moveAnnotation(2, 0, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.moveAnnotation(0, 1, NamedQueryAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- namedQuery1 = (NamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- resourceType.removeAnnotation(1, JPA.NAMED_QUERY);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(1, JPA.NAMED_QUERY);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, entity.getPersistenceUnit().getQueriesSize());
-
- resourceType.removeAnnotation(0, JPA.NAMED_QUERY);
- getJpaProject().synchronizeContextModel();
- namedQueries = entity.getQueryContainer().getNamedQueries().iterator();
- assertFalse(namedQueries.hasNext());
- assertEquals(0, entity.getPersistenceUnit().getQueriesSize());
- }
-
- public void testNamedQueries2_0Size() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, entity.getQueryContainer().getNamedQueriesSize());
-
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(0, JPA.NAMED_QUERY)).setName("FOO");
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY)).setName("BAR");
- ((NamedQuery2_0Annotation) resourceType.addAnnotation(2, JPA.NAMED_QUERY)).setName("BAZ");
-
- this.getJpaProject().synchronizeContextModel();
- assertEquals(3, entity.getQueryContainer().getNamedQueriesSize());
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) getJavaPersistentType().getMapping();
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertEquals("foo", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- ListIterator<? extends AttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testVirtualAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- JavaEntity superclass = (JavaEntity) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(3, CollectionTools.size(resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator()));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> attributeOverrideResources = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- Iterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrideResources.hasNext());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAttributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals(3, CollectionTools.size(javaAttributeOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- }
-//
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE)).setName("FOO");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE)).setName("BAR");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(2, JPA.ATTRIBUTE_OVERRIDE)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
-
- public void testOverridableAssociations() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-// //TODO add all mapping types to the mapped superclass to test which ones are overridable
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociationNames.next());
- assertEquals("address2", overridableAssociationNames.next());
- assertEquals("address3", overridableAssociationNames.next());
- assertEquals("address4", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociationsMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<? extends AssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AssociationOverrideContainer overrideContainer = javaEntity.getAssociationOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-
- //MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- //BasicMapping idMapping = (BasicMapping) mappedSuperclass.persistentType().attributeNamed("id").getMapping();
- //idMapping.getColumn().setSpecifiedName("FOO");
- //idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- //idMapping.getColumn().setSpecifiedName(null);
- //idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
-
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
-
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(2, CollectionTools.size(resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator()));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> associationOverrideResources = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- associationOverrideResources = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAssociationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- Iterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE)).setName("FOO");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE)).setName("BAR");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(2, JPA.ASSOCIATION_OVERRIDE)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAttributeOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer associationOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, associationOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = associationOverrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testNestedVirtualAssociationOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer associationOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, associationOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = associationOverrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheable.setSpecifiedCacheable(null);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- getJavaPersistentType().getJavaResourceType().addAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(true)", cu);
-
- cacheableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- getJavaPersistentType().getJavaResourceType().removeAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- assertEquals(SharedCacheMode.UNSPECIFIED, persistenceUnit2_0.getSharedCacheMode());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testInheritedIsDefaultCacheable() throws Exception {
- createTestEntity();
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity().getParentEntity()).getCacheable();
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
- //This is a test for bug 301892
- public void testAssociationOverrideJoinTableUpdate() throws Exception {
- createTestEntityWithAssociationOverride();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverride associationOverride = getJavaEntity().getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("a", associationOverride.getName());
-
- AssociationOverride2_0Annotation annotation = (AssociationOverride2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.getJoinTable().setName("FOO");
- annotation.getJoinTable().addInverseJoinColumn(0).setName("BAR");
-
- getJpaProject().synchronizeContextModel();
-
- associationOverride = getJavaEntity().getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("a", associationOverride.getName());
- JoinTable joinTable = ((JavaOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("BAR", joinTable.getInverseJoinColumns().iterator().next().getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaIdMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaIdMapping2_0Tests.java
deleted file mode 100644
index 8010736106..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaIdMapping2_0Tests.java
+++ /dev/null
@@ -1,423 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaIdMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- }
- });
- }
-
- public GenericJavaIdMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((VersionMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((VersionMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));//OneToOne with Id annotation is valid in JPA 2.0
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));//ManyToOne with Id annotation is valid in JPA 2.0
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(idMapping.isDefault());
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
- idMapping.addGeneratedValue();
- idMapping.getGeneratorContainer().addTableGenerator();
- idMapping.getGeneratorContainer().addSequenceGenerator();
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(idMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
- assertNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(GeneratedValueAnnotation.ANNOTATION_NAME));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java
deleted file mode 100644
index ac5137a041..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToManyMapping2_0Tests.java
+++ /dev/null
@@ -1,1953 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaManyToManyMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericJavaManyToManyMapping2_0Tests(String name) {
- super(name);
- }
-
-
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Collection<AnnotationTestType> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private String address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEntityKeyManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityPropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- manyToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employees", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employees", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKey(null);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKey.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employees", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- manyToManyMapping2_0.setSpecifiedTargetEntity("Address");
- mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employees", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- manyToManyMapping2_0.setSpecifiedTargetEntity("String");
- mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", manyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", manyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", manyToManyMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", manyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", manyToManyMapping.getMapKeyClass());
-
- manyToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", manyToManyMapping.getMapKeyClass());
-
- manyToManyMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", manyToManyMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- addXmlClassRef(PACKAGE_NAME + ".PrintQueue");
- addXmlClassRef(PACKAGE_NAME + ".PrintJob");
- JavaPersistentType printQueuePersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintQueue");
- ManyToManyMapping jobsMapping = (ManyToManyMapping) printQueuePersistentType.getAttributeNamed("jobs").getMapping();
- JavaPersistentType printJobPersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ManyToManyMapping queuesMapping = (ManyToManyMapping) printJobPersistentType.getAttributeNamed("queues").getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- OrderColumn2_0 jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(null, jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable()); //the join table name
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- OrderColumn2_0 queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(null, queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- jobsOrderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderColumn.setSpecifiedName("BAR");
- assertEquals("BAR", queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
- assertEquals("MY_TABLE_PrintQueue", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printQueuePersistentType.getMapping()).getTable().setSpecifiedName("OTHER_TABLE");
- assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable());
-
- queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany(mappedBy=\"queues\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintQueue> queues;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testGetMapKeyColumn() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name
-
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnMappedByStrategy() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
- manyToManyMapping.getRelationship().setStrategyToMappedBy();
- manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employees");
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address_" + TYPE_NAME, manyToManyMapping.getMapKeyColumn().getTable());//join table name of owning many-to-many
-
- PersistentType persistentType = getPersistenceUnit().getPersistentType("test.Address");
- ManyToManyMapping owningManyToManyMapping = (ManyToManyMapping) persistentType.getAttributeNamed("employees").getMapping();
- ((JoinTableRelationshipStrategy) owningManyToManyMapping.getRelationship().getStrategy()).getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnJoinTableStrategy() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name
-
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
-
- public void testMapKeySpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
- manyToManyMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((BaseEnumeratedConverter) manyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((BaseEnumeratedConverter) manyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- manyToManyMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) manyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseEnumeratedConverter) manyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(manyToManyMapping.isDefault());
- assertSame(manyToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
- manyToManyMapping.setMapKeyConverter(BaseTemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((BaseTemporalConverter) manyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((BaseTemporalConverter) manyToManyMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) manyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseTemporalConverter) manyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(manyToManyMapping.isDefault());
- assertSame(manyToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- ListIterator<? extends JoinColumn> specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
-
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
- }
-
- public void testSpecifiedMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(0, manyToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, manyToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, manyToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
- }
-
- public void testMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(1, manyToManyMapping.getMapKeyJoinColumnsSize());
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, manyToManyMapping.getMapKeyJoinColumnsSize());
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, manyToManyMapping.getMapKeyJoinColumnsSize());
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, manyToManyMapping.getMapKeyJoinColumnsSize());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAR");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn2() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- manyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- manyToManyMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
-
-
- manyToManyMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("FOO");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAR");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(2, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testMapKeyJoinColumnIsDefault() throws Exception {
- createTestEntityWithEntityKeyManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertTrue(manyToManyMapping.getDefaultMapKeyJoinColumn().isVirtual());
-
- manyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- JoinColumn specifiedJoinColumn = manyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isVirtual());
-
- assertNull(manyToManyMapping.getDefaultMapKeyJoinColumn());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
deleted file mode 100644
index 20189d9a68..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaManyToOneMapping2_0Tests.java
+++ /dev/null
@@ -1,682 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaManyToOneMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericJavaManyToOneMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestEntityWithManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdDerivedIdentity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping manyToOneMapping = (ManyToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = manyToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(manyToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testUpdateId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testUpdatePredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
- JavaDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.addAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testSetPredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
- JavaDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setMapsIdDerivedIdentityStrategy();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setNullDerivedIdentityStrategy();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setIdDerivedIdentityStrategy();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaIdMapping);
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaManyToOneMapping2_0);
-
- contextAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaBasicMapping);
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java
deleted file mode 100644
index 489deda957..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToManyMapping2_0Tests.java
+++ /dev/null
@@ -1,2214 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaOneToManyMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericJavaOneToManyMapping2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithValidOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(orphanRemoval=false)").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private AnnotationTestType employee;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private String address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEntityKeyOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityPropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- oneToManyMapping.getOrderable().setSpecifiedOrderBy("asdf");
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("FOO");
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToManyMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(JoinTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(OrderByAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employee", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employee", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- public void testDefaultOneToManyGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToManyMapping).isDefaultOrphanRemoval());
- }
-
- public void testSpecifiedOneToManyGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToManyMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertEquals(false, mappingsOrphanRemoval.isOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(true, mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testSetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_MANY)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_MANY));
-
- oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- }
-
- public void testGetSpecifiedOrphanRemovalUpdatesFromResourceModelChange() throws Exception {
- this.createTestEntityWithValidOneToManyMapping();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- oneToMany.setOrphanRemoval(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
-
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKey(null);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping2_0 = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- oneToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employee", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping2_0 = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = oneToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- oneToManyMapping2_0.setSpecifiedTargetEntity("Address");
- mapKeyNames = oneToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employee", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- oneToManyMapping2_0.setSpecifiedTargetEntity("String");
- mapKeyNames = oneToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", oneToManyMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", oneToManyMapping.getMapKeyClass());
-
- oneToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", oneToManyMapping.getMapKeyClass());
-
- oneToManyMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", oneToManyMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- addXmlClassRef(PACKAGE_NAME + ".PrintQueue");
- addXmlClassRef(PACKAGE_NAME + ".PrintJob");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) getJavaPersistentType().getAttributeNamed("jobs").getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- JavaPersistentType printJobPersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
-
- assertEquals("MY_TABLE", orderColumn.getTable());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany(mappedBy=\"queue\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private PrintQueue queue;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testGetMapKeyColumnMappedByStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- oneToManyMapping.getRelationship().setStrategyToMappedBy();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employee");
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//owing entity table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnJoinTableStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", oneToManyMapping.getMapKeyColumn().getTable());//join table name
-
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testTargetForeignKeyJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- JoinColumn joinColumn = ((JoinColumnRelationship) oneToManyMapping.getRelationship()).getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
-
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("Address", joinColumn.getDefaultTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- joinColumn.setSpecifiedName("FOO");
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
- }
-
- //target foreign key case
- public void testGetMapKeyColumnJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getDefaultTable());
- }
-
- //target foreign key case
- public void testOrderColumnDefaultsJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- ((Orderable2_0) oneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn();
-
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("Address", orderColumn.getTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testMapKeySpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
- oneToManyMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((BaseEnumeratedConverter) oneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((BaseEnumeratedConverter) oneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- oneToManyMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) oneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseEnumeratedConverter) oneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(oneToManyMapping.isDefault());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
- oneToManyMapping.setMapKeyConverter(BaseTemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((BaseTemporalConverter) oneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((BaseTemporalConverter) oneToManyMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) oneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseTemporalConverter) oneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(oneToManyMapping.isDefault());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- ListIterator<? extends JoinColumn> specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
-
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", specifiedMapKeyJoinColumns.next().getName());
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", specifiedMapKeyJoinColumns.next().getName());
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyJoinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(specifiedMapKeyJoinColumns.hasNext());
- }
-
- public void testSpecifiedMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(0, oneToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, oneToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, oneToManyMapping.getSpecifiedMapKeyJoinColumnsSize());
- }
-
- public void testMapKeyJoinColumnsSize() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(1, oneToManyMapping.getMapKeyJoinColumnsSize());
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, oneToManyMapping.getMapKeyJoinColumnsSize());
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, oneToManyMapping.getMapKeyJoinColumnsSize());
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, oneToManyMapping.getMapKeyJoinColumnsSize());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAR");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn2() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> joinColumnsIterator =
- resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
-
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnsIterator.next()).getName());
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertEquals(3, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(1);
-
- Iterator<NestableAnnotation> joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- Iterator<? extends JoinColumn> joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(1);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumnResources.next()).getName());
- assertFalse(joinColumnResources.hasNext());
-
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
-
- oneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- joinColumnResources = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertFalse(joinColumnResources.hasNext());
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
-
- assertNull(resourceField.getAnnotation(0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- Iterator<NestableAnnotation> javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals(3, CollectionTools.size(javaJoinColumns));
-
-
- oneToManyMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
-
-
- oneToManyMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getSpecifiedName());
- assertEquals("BAR", joinColumns.next().getSpecifiedName());
- assertEquals("FOO", joinColumns.next().getSpecifiedName());
-
- javaJoinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) javaJoinColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedMapKeyJoinColumns() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("FOO");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAR");
- ((MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(2, JPA2_0.MAP_KEY_JOIN_COLUMN)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends JoinColumn> joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(2, 0, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.moveAnnotation(0, 1, MapKeyJoinColumn2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("BAR", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertEquals("FOO", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumnsIterator.next().getName());
- assertFalse(joinColumnsIterator.hasNext());
-
- resourceField.removeAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- joinColumnsIterator = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertFalse(joinColumnsIterator.hasNext());
- }
-
- public void testMapKeyJoinColumnIsDefault() throws Exception {
- createTestEntityWithEntityKeyOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertTrue(oneToManyMapping.getDefaultMapKeyJoinColumn().isVirtual());
-
- oneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- JoinColumn specifiedJoinColumn = oneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator().next();
- assertFalse(specifiedJoinColumn.isVirtual());
-
- assertNull(oneToManyMapping.getDefaultMapKeyJoinColumn());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
deleted file mode 100644
index ebb5d7cb16..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaOneToOneMapping2_0Tests.java
+++ /dev/null
@@ -1,1141 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaOneToOneMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericJavaOneToOneMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestEntity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdDerivedIdentity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEntityWithValidOneToOneMappingOrphanRemovalSpecified() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(orphanRemoval=false)");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JoinColumnRelationshipStrategy joinColumns = oneToOneMapping.getRelationship().getJoinColumnStrategy();
- joinColumns.addSpecifiedJoinColumn(0);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(oneToOneMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- assertNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(0, JoinColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testUpdateId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testUpdatePredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
- JavaDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testSetPredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
- JavaDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setIdDerivedIdentityStrategy();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setNullDerivedIdentityStrategy();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setMapsIdDerivedIdentityStrategy();
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
-
- ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- public void testDefaultOneToOneGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToOneMapping).isDefaultOrphanRemoval());
- }
-
- public void testSpecifiedOneToOneGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToOneMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertEquals(false, mappingsOrphanRemoval.isOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(true, mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToOneMappingOrphanRemovalSpecified();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(Boolean.FALSE, this.getOrphanRemovalOf(oneToOneMapping).getSpecifiedOrphanRemoval());
- }
-
- public void testSetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
-
- assertEquals(Boolean.TRUE, oneToOne.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_ONE)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
-
- assertEquals(Boolean.TRUE, oneToOne.getOrphanRemoval());
-
- oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_ONE));
- }
-
- public void testGetSpecifiedOrphanRemovalUpdatesFromResourceModelChange() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- oneToOne.setOrphanRemoval(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertSame(oneToOneMapping, persistentAttribute.getMapping());
-
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0Tests.java
deleted file mode 100644
index 024ecacb5f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentAttribute2_0Tests.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaPersistentAttribute2_0Tests extends Generic2_0ContextModelTestCase
-{
- private ICompilationUnit createTestEntityForDerivedId() throws Exception {
- return createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntitySpecifiedAccessField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.BASIC, JPA.TRANSIENT, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.FIELD)");
- }
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("transient");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createTestEntitySpecifiedAccessProperty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.BASIC, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Access(AccessType.FIELD)");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
-
- public GenericJavaPersistentAttribute2_0Tests(String name) {
- super(name);
- }
-
- public void testGetAccessField() throws Exception {
- createTestEntitySpecifiedAccessField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute namePersistentAttribute = getJavaPersistentType().getAttributeNamed("name");
- assertEquals(AccessType.FIELD, namePersistentAttribute.getAccess());
- assertEquals(AccessType.FIELD, namePersistentAttribute.getDefaultAccess());
- assertEquals(null, namePersistentAttribute.getSpecifiedAccess());
-
- PersistentAttribute idPersistentAttribute = getJavaPersistentType().getAttributeNamed("id");
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, idPersistentAttribute.getMappingKey());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getDefaultAccess());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getSpecifiedAccess());
- }
-
- public void testGetAccessProperty() throws Exception {
- createTestEntitySpecifiedAccessProperty();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute namePersistentAttribute = getJavaPersistentType().getAttributeNamed("name");
- assertEquals(AccessType.FIELD, namePersistentAttribute.getAccess());
- assertEquals(AccessType.FIELD, namePersistentAttribute.getDefaultAccess());
- assertEquals(AccessType.FIELD, namePersistentAttribute.getSpecifiedAccess());
-
- PersistentAttribute idPersistentAttribute = getJavaPersistentType().getAttributeNamed("id");
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, idPersistentAttribute.getMappingKey());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, idPersistentAttribute.getDefaultAccess());
- assertEquals(null, idPersistentAttribute.getSpecifiedAccess());
- }
-
- public void testDerivedIdMappingInitialization() throws Exception {
- createTestEntityForDerivedId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaPersistentAttribute id = getJavaPersistentType().getAttributeNamed("id");
- assertEquals(id.getMappingKey(), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
-
- id.getResourceAttribute().addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- id.getResourceAttribute().addAnnotation(JPA.ONE_TO_ONE);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(id.getResourceAttribute().getAnnotation(JPA.ID));
-
- id.getResourceAttribute().removeAnnotation(JPA.ONE_TO_ONE);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- id.getResourceAttribute().addAnnotation(JPA.MANY_TO_ONE);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(id.getResourceAttribute().getAnnotation(JPA.ID));
-
- id.getResourceAttribute().removeAnnotation(JPA.MANY_TO_ONE);
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- id.getResourceAttribute().setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
- assertEquals(id.getMappingKey(), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentType2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentType2_0Tests.java
deleted file mode 100644
index 26997a7544..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaPersistentType2_0Tests.java
+++ /dev/null
@@ -1,863 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.internal.context.java.FieldAccessor;
-import org.eclipse.jpt.jpa.core.internal.context.java.PropertyAccessor;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaPersistentType2_0Tests extends Generic2_0ContextModelTestCase
-{
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedFieldAndMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedFieldPropertySpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Access(AccessType.PROPERTY)");
- }
-
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedPropertyFieldSpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createTestSubType() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- });
- }
-
- private ICompilationUnit createTestSubTypeWithFieldAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeWithMethodAnnotation() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypeNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild.java", "AnnotationTestTypeChild", new DefaultAnnotationWriter() {
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends " + TYPE_NAME + " ");
- }
- });
- }
-
- private ICompilationUnit createTestSubTypePersistentExtendsNonPersistent() throws Exception {
- return this.createTestType(PACKAGE_NAME, "AnnotationTestTypeChild2.java", "AnnotationTestTypeChild2", new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("extends AnnotationTestTypeChild ");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public GenericJavaPersistentType2_0Tests(String name) {
- super(name);
- }
-
- public void testGetName() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, getJavaPersistentType().getName());
- }
-
- public void testGetAccessNothingAnnotated() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessField() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessProperty() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
- }
-
- public void testAccessFieldAndMethodAnnotated() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
- }
-
- public void testAccessFieldAnnotatedPropertySpecified() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.PROPERTY, getJavaPersistentType().getAccess());
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute javaPersistentAttribute = attributes.next();
- assertEquals("name", javaPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMapping().getKey());
-
- javaPersistentAttribute = attributes.next();
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- assertFalse(attributes.hasNext());
- }
-
- public void testAccessPropertyAnnotatedFieldSpecified() throws Exception {
- createTestEntityAnnotatedPropertyFieldSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(AccessType.FIELD, getJavaPersistentType().getAccess());
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute javaPersistentAttribute = attributes.next();
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- javaPersistentAttribute = attributes.next();
- assertEquals("name", javaPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- javaPersistentAttribute = attributes.next();
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- assertFalse(attributes.hasNext());
-
- attributes = getJavaPersistentType().getAttributes().iterator();
- attributes.next().getResourceAttribute().setPrimaryAnnotation(TransientAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- attributes = getJavaPersistentType().getAttributes().iterator();
- javaPersistentAttribute = attributes.next();
-
- javaPersistentAttribute = attributes.next();
- assertEquals("name", javaPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
- javaPersistentAttribute = attributes.next();
- assertEquals("id", javaPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
- assertFalse(attributes.hasNext());
- }
-
- public void testAccessInheritance() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance2() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance3() throws Exception {
- createTestEntityAnnotatedField();
- createTestSubTypeWithMethodAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
-
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessInheritance4() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inherited class having annotations set wins over the default access set on persistence-unit-defaults
- public void testAccessInheritancePersistenceUnitDefaultAccess() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.FIELD);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef classRef = classRefs.next();
- JavaPersistentType javaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(PACKAGE_NAME + ".AnnotationTestTypeChild", javaPersistentType.getName());
-
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlNoAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
-
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessNoAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntity();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityPropertyAccessAndFieldAnnotations() throws Exception {
- //xml access set to property, field annotations, JavaPersistentType access is field
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlEntityFieldAccessAndPropertyAnnotations() throws Exception {
- //xml access set to field, property annotations, JavaPersistentType access is property
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- entityPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testAccessXmlPersistenceUnitDefaultsAccessFieldAnnotations() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- //inheritance wins over entity-mappings specified access
- public void testAccessXmlEntityMappingsAccessWithInheritance() throws Exception {
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType childEntityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- createTestEntityAnnotatedMethod();
- createTestSubType();
- JavaPersistentType childJavaPersistentType = childEntityPersistentType.getJavaPersistentType();
-
- getEntityMappings().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.PROPERTY, entityPersistentType.getJavaPersistentType().getAccess());
- assertEquals(AccessType.PROPERTY, childJavaPersistentType.getAccess());
- }
-
- public void testAccessXmlMetadataCompleteFieldAnnotations() throws Exception {
- //xml access set to property, java has field annotations so the access should be field
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedField();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.PROPERTY);
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
-
- }
-
- public void testAccessNoXmlAccessXmlMetdataCompletePropertyAnnotations() throws Exception {
- //xml access not set, metadata complete set. JavaPersistentType access is property because properties are annotated
- OrmPersistentType entityPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- createTestEntityAnnotatedMethod();
- JavaPersistentType javaPersistentType = entityPersistentType.getJavaPersistentType();
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testSuperPersistentType() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getSuperPersistentType());
- assertNull(rootJavaPersistentType.getSuperPersistentType());
- }
-
- public void testSuperPersistentType2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeWithFieldAnnotation();
-
- //super is not added to the getPersistenceUnit, but it should still be found
- //as the superPersistentType because of impliedClassRefs and changes for bug 190317
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType javaPersistentType = classRefs.next().getJavaPersistentType();
-
- assertNotNull(javaPersistentType.getSuperPersistentType());
- }
-
- //Entity extends Non-Entity extends Entity
- public void testSuperPersistentType3() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- ClassRef classRef = classRefs.next();
- JavaPersistentType rootJavaPersistentType = classRef.getJavaPersistentType();
-
- classRef = classRefs.next();
- JavaPersistentType childJavaPersistentType = classRef.getJavaPersistentType();
-
- assertEquals(rootJavaPersistentType, childJavaPersistentType.getSuperPersistentType());
- assertNull(rootJavaPersistentType.getSuperPersistentType());
- }
-
- public void testInheritanceHierarchy() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.getInheritanceHierarchy().iterator();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testInheritanceHierarchy2() throws Exception {
- createTestEntityAnnotatedMethod();
- createTestSubTypeNonPersistent();
- createTestSubTypePersistentExtendsNonPersistent();
-
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild2");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- JavaPersistentType childJavaPersistentType = classRefs.next().getJavaPersistentType();
- JavaPersistentType rootJavaPersistentType = classRefs.next().getJavaPersistentType();
-
- Iterator<PersistentType> inheritanceHierarchy = childJavaPersistentType.getInheritanceHierarchy().iterator();
-
- assertEquals(childJavaPersistentType, inheritanceHierarchy.next());
- assertEquals(rootJavaPersistentType, inheritanceHierarchy.next());
- }
-
- public void testGetMapping() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey());
- }
-
- public void testGetMappingNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMapping().getKey());
- }
-
- public void testMappingKey() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testMappingKeyNull() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNotNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKey2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNotNull(resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testSetMappingKeyNull() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.setPrimaryAnnotation(EmbeddableAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
- assertEquals(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testGetMappingKeyMappingChangeInResourceModel2() throws Exception {
- createTestType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(MappingKeys.NULL_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.setPrimaryAnnotation(EntityAnnotation.ANNOTATION_NAME, EmptyIterable.<String>instance());
- this.getJpaProject().synchronizeContextModel();
- assertEquals(MappingKeys.ENTITY_TYPE_MAPPING_KEY, getJavaPersistentType().getMappingKey());
- }
-
- public void testIsMapped() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertTrue(getJavaPersistentType().isMapped());
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertFalse(getJavaPersistentType().isMapped());
- }
-
- public void testAttributes() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
-
- assertEquals("id", attributes.next().getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributes2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
-
- JavaPersistentAttribute attribute = attributes.next();
- assertEquals("id", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof FieldAccessor);
- attribute = attributes.next();
- assertEquals("name", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof FieldAccessor);
- attribute = attributes.next();
- assertEquals("id", attribute.getName());
- assertTrue(attribute.getAccessor() instanceof PropertyAccessor);
- assertFalse(attributes.hasNext());
- }
-
- public void testAttributesSize() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(1, getJavaPersistentType().getAttributesSize());
- }
-
- public void testAttributesSize2() throws Exception {
- createTestEntityAnnotatedFieldAndMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, getJavaPersistentType().getAttributesSize());
- }
-
- public void testAttributeNamed() throws Exception {
- createTestEntityAnnotatedMethod();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("id");
-
- assertEquals("id", attribute.getName());
- assertNull(getJavaPersistentType().getAttributeNamed("name"));
- assertNull(getJavaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testAttributeNamed2() throws Exception {
- createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute attribute = getJavaPersistentType().getAttributeNamed("name");
-
- assertEquals("name", attribute.getName());
-
- assertNull(getJavaPersistentType().getAttributeNamed("foo"));
- }
-
- public void testRenameAttribute() throws Exception {
- ICompilationUnit testType = createTestEntityAnnotatedField();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute idAttribute = attributes.next();
- JavaPersistentAttribute nameAttribute = attributes.next();
-
-
- assertEquals("id", idAttribute.getName());
- assertEquals("name", nameAttribute.getName());
-
- IField idField = testType.findPrimaryType().getField("id");
- idField.rename("id2", false, null);
-
- attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute nameAttribute2 = attributes.next();
- JavaPersistentAttribute id2Attribute = attributes.next();
-
- assertNotSame(idAttribute, id2Attribute);
- assertEquals("id2", id2Attribute.getName());
- assertEquals(nameAttribute, nameAttribute2);
- assertEquals("name", nameAttribute2.getName());
- assertFalse(attributes.hasNext());
- }
-
- public void testSuperPersistentTypeGeneric() throws Exception {
- createTestGenericEntity();
- createTestGenericMappedSuperclass();
-
- addXmlClassRef(PACKAGE_NAME + ".Entity1");
- addXmlClassRef(PACKAGE_NAME + ".Entity2");
-
- JavaPersistentType javaPersistentType = getJavaPersistentType();
- assertEquals("test.Entity1", javaPersistentType.getName());
- assertNotNull(javaPersistentType.getSuperPersistentType());
-
- assertEquals("test.Entity2", javaPersistentType.getSuperPersistentType().getName());
- }
-
- private void createTestGenericEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Entity1 ");
- sb.append("extends Entity2<Integer> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity1.java", sourceWriter);
- }
-
- private void createTestGenericMappedSuperclass() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class Entity2<K> {}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Entity2.java", sourceWriter);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0Tests.java
deleted file mode 100644
index 2632244b86..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaSequenceGenerator2_0Tests.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.jpa2.context.SequenceGenerator2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-/**
- * GenericJavaSequenceGenerator2_0Tests
- */
-@SuppressWarnings("nls")
-public class GenericJavaSequenceGenerator2_0Tests extends Generic2_0ContextModelTestCase
-{
- private static final String SEQUENCE_GENERATOR_NAME = "TEST_SEQUENCE_GENERATOR";
-
- public GenericJavaSequenceGenerator2_0Tests(String name) {
- super(name);
- }
-
- // ********** catalog **********
-
- public void testGetCatalog() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getCatalog());
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- SequenceGenerator2_0Annotation annotation = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- annotation.setCatalog("testCatalog");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("testCatalog", sequenceGenerator.getCatalog());
- assertEquals("testCatalog", sequenceGenerator.getSpecifiedCatalog());
- }
-
- public void testGetDefaultCatalog() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getDefaultCatalog());
-
- sequenceGenerator.setSpecifiedCatalog("testCatalog");
-
- assertNull(sequenceGenerator.getDefaultCatalog());
- assertEquals("testCatalog", sequenceGenerator.getSpecifiedCatalog());
- }
-
- public void testSetSpecifiedCatalog() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- sequenceGenerator.setSpecifiedCatalog("testCatalog");
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- SequenceGenerator2_0Annotation annotation = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals("testCatalog", annotation.getCatalog());
-
- sequenceGenerator.setSpecifiedCatalog(null);
- assertNull(annotation.getCatalog());
- }
-
- // ********** schema **********
-
- public void testGetSchema() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) this.getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getSchema());
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- SequenceGenerator2_0Annotation annotation = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
-
- annotation.setSchema("testSchema");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("testSchema", sequenceGenerator.getSchema());
- assertEquals("testSchema", sequenceGenerator.getSpecifiedSchema());
- }
-
- public void testGetDefaultSchema() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getDefaultSchema());
-
- sequenceGenerator.setSpecifiedSchema("testSchema");
-
- assertNull(sequenceGenerator.getDefaultSchema());
- assertEquals("testSchema", sequenceGenerator.getSpecifiedSchema());
- }
-
- public void testUpdateDefaultSchemaFromPersistenceUnitDefaults() throws Exception {
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
-
- createTestEntityWithSequenceGenerator();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- IdMapping idMapping = (IdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- assertNull(sequenceGenerator.getDefaultSchema());
-
- this.getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedSchema("FOO");
- assertEquals("FOO", sequenceGenerator.getDefaultSchema());
-
- this.getEntityMappings().setSpecifiedSchema("BAR");
- assertEquals("BAR", sequenceGenerator.getDefaultSchema());
-
- ormEntity.getTable().setSpecifiedSchema("XML_SCHEMA");
- assertEquals("BAR", sequenceGenerator.getDefaultSchema());
-
- this.getEntityMappings().removePersistentType(0);
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- //default schema taken from persistence-unit-defaults not entity-mappings since the entity is not in an orm.xml file
- idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
- assertEquals("FOO", sequenceGenerator.getDefaultSchema());
- }
-
- public void testSetSpecifiedSchema() throws Exception {
- this.createTestEntityWithSequenceGenerator();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- IdMapping idMapping = (IdMapping) getJavaPersistentType().getAttributeNamed("id").getMapping();
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) idMapping.getGeneratorContainer().getSequenceGenerator();
-
- sequenceGenerator.setSpecifiedSchema("testSchema");
-
- JavaResourceField resourceField = ((JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE)).getFields().iterator().next();
- SequenceGenerator2_0Annotation annotation = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals("testSchema", annotation.getSchema());
-
- sequenceGenerator.setSpecifiedSchema(null);
- assertNull(annotation.getSchema());
- }
-
- // ********** utility **********
-
- protected ICompilationUnit createTestEntityWithSequenceGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SEQUENCE_GENERATOR, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@SequenceGenerator(name=\"" + SEQUENCE_GENERATOR_NAME + "\")");
- }
- });
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaVersionMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaVersionMapping2_0Tests.java
deleted file mode 100644
index 9f5434f05e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/java/GenericJavaVersionMapping2_0Tests.java
+++ /dev/null
@@ -1,352 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericJavaVersionMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- }
- });
- }
-
- public GenericJavaVersionMapping2_0Tests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((BasicMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((BasicMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals("FOO", ((IdMapping) persistentAttribute.getMapping()).getColumn().getSpecifiedName());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ((IdMapping) persistentAttribute.getMapping()).getConverter()).getTemporalType());
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToOneMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToElementCollectionMapping() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertFalse(versionMapping.isDefault());
- versionMapping.getColumn().setSpecifiedName("FOO");
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
- resourceField.addAnnotation(Access2_0Annotation.ANNOTATION_NAME);
- assertFalse(versionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ElementCollectionMapping2_0);
-
- assertNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(Access2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ColumnAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/Generic2_0OrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/Generic2_0OrmContextModelTests.java
deleted file mode 100644
index afbf7de334..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/Generic2_0OrmContextModelTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class Generic2_0OrmContextModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(Generic2_0OrmContextModelTests.class.getPackage().getName());
- suite.addTestSuite(GenericOrmAssociationOverride2_0Tests.class);
- suite.addTestSuite(GenericOrmCascade2_0Tests.class);
- suite.addTestSuite(GenericOrmCollectionTable2_0Tests.class);
- suite.addTestSuite(GenericOrmElementCollectionMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmEntity2_0Tests.class);
- suite.addTestSuite(GenericOrmEmbeddedMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmManyToManyMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmManyToOneMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmOneToManyMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmOneToOneMapping2_0Tests.class);
- suite.addTestSuite(GenericOrmPersistentAttribute2_0Tests.class);
- suite.addTestSuite(GenericOrmPersistentType2_0Tests.class);
- suite.addTestSuite(GenericOrmSequenceGenerator2_0Tests.class);
- return suite;
- }
-
- private Generic2_0OrmContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java
deleted file mode 100644
index 03fa3afff6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmAssociationOverride2_0Tests.java
+++ /dev/null
@@ -1,534 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTable;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.OverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.VirtualOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmAssociationOverride2_0Tests extends Generic2_0ContextModelTestCase
-{
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(CR);
- sb.append(" private AnnotationTestTypeChild address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany");
- sb.append(CR);
- sb.append(" private java.util.Collection<AnnotationTestTypeChild> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
-
-
- public GenericOrmAssociationOverride2_0Tests(String name) {
- super(name);
- }
-
- public void testUpdateName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormVirtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormVirtualAssociationOverride.getName());
-
- ormVirtualAssociationOverride.convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- OrmAssociationOverride ormAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertEquals("address", ormAssociationOverride.getName());
- assertEquals("address", xmlAssociationOverride.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
- assertFalse(entityResource.getAssociationOverrides().isEmpty());
-
- //set name in the resource model, verify context model updated
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- //set name to null in the resource model
- xmlAssociationOverride.setName(null);
- assertNull(ormAssociationOverride.getName());
- assertNull(xmlAssociationOverride.getName());
-
- xmlAssociationOverride.setName("FOO");
- assertEquals("FOO", ormAssociationOverride.getName());
- assertEquals("FOO", xmlAssociationOverride.getName());
-
- entityResource.getAssociationOverrides().remove(0);
- assertFalse(overrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertTrue(entityResource.getAssociationOverrides().isEmpty());
- }
-
- public void testModifyName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
-
- assertEquals("address", specifiedAssociationOverride.getName());
- assertEquals("address", xmlAssociationOverride.getName());
- assertTrue(overrideContainer.getOverrides().iterator().hasNext());
- assertFalse(entityResource.getAssociationOverrides().isEmpty());
-
- //set name in the context model, verify resource model modified
- specifiedAssociationOverride.setName("foo");
- assertEquals("foo", specifiedAssociationOverride.getName());
- assertEquals("foo", xmlAssociationOverride.getName());
-
- //set name to null in the context model
- specifiedAssociationOverride.setName(null);
- assertNull(specifiedAssociationOverride.getName());
- xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
- assertNull(xmlAssociationOverride.getName());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormAssociationOverride.getName());
-
- OrmAssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified();
- OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
-
- JoinColumn joinColumn = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- JoinColumn joinColumn2 = joiningStrategy.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- JoinColumn joinColumn3 = joiningStrategy.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormAssociationOverride.getName());
-
- AssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified();
- JoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- assertEquals(1, xmlAssociationOverride.getJoinColumns().size());
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, xmlAssociationOverride.getJoinColumns().size());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(3, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(2, xmlAssociationOverride.getJoinColumns().size());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(1, xmlAssociationOverride.getJoinColumns().size());
-
- joiningStrategy.removeSpecifiedJoinColumn(0);
- assertEquals(0, xmlAssociationOverride.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormAssociationOverride.getName());
-
- OrmAssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified();
- OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- joiningStrategy.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- joiningStrategy.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- joiningStrategy.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(4, xmlAssociationOverride.getJoinColumns().size());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
-
-
- joiningStrategy.moveSpecifiedJoinColumn(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", xmlAssociationOverride.getJoinColumns().get(0).getName());
- assertEquals("BAR", xmlAssociationOverride.getJoinColumns().get(1).getName());
- assertEquals("FOO", xmlAssociationOverride.getJoinColumns().get(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride ormAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", ormAssociationOverride.getName());
-
- OrmAssociationOverride specifiedOverride = ormAssociationOverride.convertToSpecified();
- OrmJoinColumnRelationshipStrategy joiningStrategy = specifiedOverride.getRelationship().getJoinColumnStrategy();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- JoinColumn joinColumn = joinColumns.next();
- assertEquals("address_id", joinColumn.getSpecifiedName());
- assertEquals("id", joinColumn.getSpecifiedReferencedColumnName());
-
- xmlAssociationOverride.getJoinColumns().add(0, OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinColumns().add(1, OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinColumns().add(2, OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- xmlAssociationOverride.getJoinColumns().get(0).setName("FOO");
- xmlAssociationOverride.getJoinColumns().get(1).setName("BAR");
- xmlAssociationOverride.getJoinColumns().get(2).setName("BAZ");
-
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(2, 0);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().move(0, 1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("address_id", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinColumns().remove(0);
- joinColumns = joiningStrategy.getSpecifiedJoinColumns().iterator();
- assertEquals("address_id", joinColumns.next().getName());
-
- xmlAssociationOverride.getJoinColumns().remove(0);
- assertFalse(joiningStrategy.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals("AnnotationTestTypeChild", ormEntity.getName());
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertTrue(associationOverride.isVirtual());
- }
-
-
- public void testSetJoinTableName() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- OrmVirtualAssociationOverride virtualOverride = overrideContainer.getVirtualOverrides().iterator().next();
- OrmAssociationOverride associationOverride = virtualOverride.convertToSpecified();
- ((OverrideRelationship2_0) associationOverride.getRelationship()).setStrategyToJoinTable();
- JoinTableRelationshipStrategy joiningStrategy = ((OverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
-
- JoinTable joinTable = joiningStrategy.getJoinTable();
- joinTable.setSpecifiedName("FOO");
-
- assertEquals("FOO", xmlAssociationOverride.getJoinTable().getName());
- }
-
- public void testUpdateJoinTable() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- OrmVirtualAssociationOverride virtualOverride = overrideContainer.getVirtualOverrides().iterator().next();
- OrmAssociationOverride associationOverride = virtualOverride.convertToSpecified();
- ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).setStrategyToJoinTable();
- OrmJoinTableRelationshipStrategy joiningStrategy = ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- XmlAssociationOverride xmlAssociationOverride = entityResource.getAssociationOverrides().get(0);
-
- xmlAssociationOverride.getJoinTable().setName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", joiningStrategy.getJoinTable().getSpecifiedName());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinTable().getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- xmlAssociationOverride.getJoinTable().getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().get(0).setName("FOO");
- xmlAssociationOverride.getJoinTable().getJoinColumns().get(1).setName("BAR");
- xmlAssociationOverride.getJoinTable().getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().move(2, 0);
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().move(0, 1);
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().remove(1);
- joinColumns = joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- xmlAssociationOverride.getJoinTable().getJoinColumns().remove(0);
- assertFalse(joiningStrategy.getJoinTable().getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testDefaultJoinTableName() throws Exception {
- createTestMappedSuperclassManyToMany();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ReadOnlyAssociationOverride associationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy();
-
- VirtualJoinTable joinTable = joiningStrategy.getJoinTable();
-
- assertEquals("AnnotationTestTypeChild_AnnotationTestTypeChild", joinTable.getName());
-
-
- ormEntity.getTable().setSpecifiedName("FOO");
- assertEquals("FOO_FOO", joinTable.getName());
-
- PersistentType mappedSuperclass = ormPersistentType.getSuperPersistentType();
- ((OrmReadOnlyPersistentAttribute) mappedSuperclass.getAttributeNamed("address")).addToXml();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) mappedSuperclass.getAttributeNamed("address").getMapping();
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("BAR");
- assertEquals("BAR", manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCascade2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCascade2_0Tests.java
deleted file mode 100644
index 0d3a2482d4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCascade2_0Tests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmCascade2_0Tests extends Generic2_0ContextModelTestCase
-{
- public GenericOrmCascade2_0Tests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- public void testUpdateCascadeDetach() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
- Cascade2_0 cascade = (Cascade2_0) ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isDetach());
- assertNull(oneToOne.getCascade());
-
- //set cascade in the resource model, verify context model does not change
- oneToOne.setCascade(OrmFactory.eINSTANCE.createCascadeType());
- assertEquals(false, cascade.isDetach());
- assertNotNull(oneToOne.getCascade());
-
- //set detach in the resource model, verify context model updated
- oneToOne.getCascade().setCascadeDetach(true);
- assertEquals(true, cascade.isDetach());
- assertEquals(true, oneToOne.getCascade().isCascadeDetach());
-
- //set detach to false in the resource model
- oneToOne.getCascade().setCascadeDetach(false);
- assertEquals(false, cascade.isDetach());
- assertEquals(false, oneToOne.getCascade().isCascadeDetach());
- }
-
- public void testModifyCascadeDetach() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping ormOneToOneMapping = (OrmOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlOneToOne oneToOne = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- Cascade2_0 cascade = (Cascade2_0) ormOneToOneMapping.getCascade();
-
- assertEquals(false, cascade.isDetach());
- assertNull(oneToOne.getCascade());
-
- //set detach in the context model, verify resource model updated
- cascade.setDetach(true);
- assertEquals(true, cascade.isDetach());
- assertEquals(true, oneToOne.getCascade().isCascadeDetach());
-
- //set detach to false in the context model
- cascade.setDetach(false);
- assertEquals(false, cascade.isDetach());
- assertNull(oneToOne.getCascade());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCollectionTable2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCollectionTable2_0Tests.java
deleted file mode 100644
index c720e0a1f7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmCollectionTable2_0Tests.java
+++ /dev/null
@@ -1,770 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmCollectionTable2_0Tests extends Generic2_0ContextModelTestCase
-{
- public GenericOrmCollectionTable2_0Tests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityWithValidElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append(" private Collection<String> projects;").append(CR);
- sb.append("@Id").append(CR);
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = elementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
-
-
- //set name in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setName("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedName());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getName());
-
- //set name to null in the resource model
- resourceElementCollection.getCollectionTable().setName(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable().getName());
-
- resourceElementCollection.getCollectionTable().setName("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedName());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getName());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = elementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set name in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedName("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedName());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getName());
-
- //set name to null in the context model
- ormCollectionTable.setSpecifiedName(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testVirtualCollectionTable() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(TYPE_NAME + "_projects", virtualCollectionTable.getName());
- assertNull(virtualCollectionTable.getSpecifiedCatalog());
- assertNull(virtualCollectionTable.getSpecifiedSchema());
- assertEquals(0, virtualCollectionTable.getSpecifiedJoinColumnsSize());
- JoinColumn virtualJoinColumn = virtualCollectionTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_id", virtualJoinColumn.getDefaultName());
- assertEquals("id", virtualJoinColumn.getDefaultReferencedColumnName());
-
- JavaPersistentAttribute javaPersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) javaPersistentAttribute.getMapping();
- JavaCollectionTable2_0 javaCollectionTable = javaElementCollectionMapping.getCollectionTable();
- javaCollectionTable.setSpecifiedName("FOO");
- javaCollectionTable.setSpecifiedCatalog("CATALOG");
- javaCollectionTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaCollectionTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
-
- assertEquals("FOO", virtualCollectionTable.getSpecifiedName());
- assertEquals("CATALOG", virtualCollectionTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualCollectionTable.getSpecifiedSchema());
- assertEquals(1, virtualCollectionTable.getSpecifiedJoinColumnsSize());
- virtualJoinColumn = virtualCollectionTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", virtualJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", virtualJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("projects"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- assertEquals(TYPE_NAME + "_projects", ormCollectionTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).setSpecifiedName("Foo");
- assertEquals("Foo_projects", ormCollectionTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).setSpecifiedName("Bar");
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
-
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove element collection mapping from the orm.xml file
- ormPersistentAttribute.removeFromXml();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("projects");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
- assertTrue(ormPersistentAttribute2.isVirtual());
- assertEquals("JAVA_COLLECTION_TABLE", virtualCollectionTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName(null);
- assertEquals("Bar_projects", virtualCollectionTable.getName());
- assertEquals("Bar_projects", virtualCollectionTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set schema in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setSchema("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getSchema());
-
- //set Schema to null in the resource model
- resourceElementCollection.getCollectionTable().setSchema(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable().getSchema());
-
- resourceElementCollection.getCollectionTable().setSchema("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getSchema());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Schema in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedSchema());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getSchema());
-
- //set Schema to null in the context model
- ormCollectionTable.setSpecifiedSchema(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Catalog in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setCatalog("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getCatalog());
-
- //set Catalog to null in the resource model
- resourceElementCollection.getCollectionTable().setCatalog(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable().getCatalog());
-
- resourceElementCollection.getCollectionTable().setCatalog("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getCatalog());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Catalog in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getCatalog());
-
- //set Catalog to null in the context model
- ormCollectionTable.setSpecifiedCatalog(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- OrmJoinColumn joinColumn = ormCollectionTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormCollectionTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormCollectionTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- ormCollectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormCollectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormCollectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals(3, resourceCollectionTable.getJoinColumns().size());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, resourceCollectionTable.getJoinColumns().size());
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, resourceCollectionTable.getJoinColumns().size());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(0).getName());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, resourceCollectionTable.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- ormCollectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormCollectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormCollectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals(3, resourceCollectionTable.getJoinColumns().size());
-
-
- ormCollectionTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
-
-
- ormCollectionTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
- }
-
-
- public void testUpdateJoinColumns() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- resourceCollectionTable.getJoinColumns().get(0).setName("FOO");
- resourceCollectionTable.getJoinColumns().get(1).setName("BAR");
- resourceCollectionTable.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().move(2, 0);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().move(0, 1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(0);
- assertFalse(ormCollectionTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- assertEquals(0, ormCollectionTable.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormCollectionTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = resourceCollectionTable.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = resourceCollectionTable.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, resourceCollectionTable.getUniqueConstraints().size());
-
- ormCollectionTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(1);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(0);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, resourceCollectionTable.getUniqueConstraints().size());
-
-
- ormCollectionTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormCollectionTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(0);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributes().iterator().next();
- assertTrue(virtualAttribute.isVirtual());
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) virtualAttribute.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
-
- ListIterator<? extends UniqueConstraint> uniqueConstraints = virtualCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping2_0 = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 javaCollectionTable = javaElementCollectionMapping2_0.getCollectionTable();
-
- javaCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- javaCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- javaCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- uniqueConstraints = virtualCollectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- virtualAttribute.addToXml();
-
- virtualElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributes().iterator().next().getMapping();
- assertEquals(0, virtualElementCollectionMapping.getCollectionTable().getUniqueConstraintsSize());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0Tests.java
deleted file mode 100644
index 1194bbcd35..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmElementCollectionMapping2_0Tests.java
+++ /dev/null
@@ -1,1741 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmElementCollectionMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public GenericOrmElementCollectionMapping2_0Tests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityWithElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection(targetClass=String.class, fetch=FetchType.EAGER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonGenericElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericBasicElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<String> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createSelfReferentialElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.List<Foo> elementCollection;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertEquals("id", ormElementCollectionMapping.getName());
- assertEquals("id", elementCollection.getName());
-
- //set name in the resource model, verify context model updated
- elementCollection.setName("newName");
- assertEquals("newName", ormElementCollectionMapping.getName());
- assertEquals("newName", elementCollection.getName());
-
- //set name to null in the resource model
- elementCollection.setName(null);
- assertNull(ormElementCollectionMapping.getName());
- assertNull(elementCollection.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertEquals("id", ormElementCollectionMapping.getName());
- assertEquals("id", elementCollection.getName());
-
- //set name in the context model, verify resource model updated
- ormElementCollectionMapping.setName("newName");
- assertEquals("newName", ormElementCollectionMapping.getName());
- assertEquals("newName", elementCollection.getName());
-
- //set name to null in the context model
- ormElementCollectionMapping.setName(null);
- assertNull(ormElementCollectionMapping.getName());
- assertNull(elementCollection.getName());
- }
-
- public void testMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- ormElementCollectionMapping.setName("foo");
- assertEquals("foo", ormElementCollectionMapping.getName());
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", virtualElementCollectionMapping.getName());
- assertEquals(FetchType.EAGER, virtualElementCollectionMapping.getSpecifiedFetch());
- assertEquals("String", virtualElementCollectionMapping.getSpecifiedTargetClass());
-
- ormPersistentAttribute = ormPersistentAttribute.addToXml();
- OrmElementCollectionMapping2_0 specifiedElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", specifiedElementCollectionMapping.getName());
- assertEquals(null, specifiedElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, specifiedElementCollectionMapping.getDefaultFetch());
- assertEquals(null, specifiedElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals(PACKAGE_NAME + ".Address", specifiedElementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.addToXml(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormElementCollectionMapping.getName());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormElementCollectionMapping.getName());
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
-
- public void testMorphToIdMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the resource model, verify context model updated
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the resource model
- elementCollection.setFetch(null);
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
-
- ormElementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, elementCollection.getFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormElementCollectionMapping.setSpecifiedFetch(null);
- assertNull(elementCollection.getFetch());
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedTargetClass() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the resource model, verify context model updated
- elementCollection.setTargetClass("newTargetClass");
- assertEquals("newTargetClass", ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the resource model
- elementCollection.setTargetClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
- public void testModifySpecifiedTargetClass() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedTargetClass("newTargetClass");
- assertEquals("newTargetClass", ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the context model
- ormElementCollectionMapping.setSpecifiedTargetClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
-
- public void testGetValueTypeEmbeddable() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeEntity() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeNone() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.NO_TYPE, elementCollectionMapping.getValueType());
-
- elementCollectionMapping.setSpecifiedTargetClass("test.Address");
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeBasic() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(elementCollection.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- elementCollection.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNotNull(elementCollection.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- elementCollection.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormElementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", elementCollection.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- elementCollection.getMapKey().setName(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(elementCollection.getMapKey().getName());
-
- elementCollection.getMapKey().setName("myMapKey");
- elementCollection.setMapKey(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(elementCollection.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualElementCollectionMapping.getSpecifiedMapKey());
- assertNull(virtualElementCollectionMapping.getMapKey());
- assertFalse(virtualElementCollectionMapping.isPkMapKey());
- assertFalse(virtualElementCollectionMapping.isCustomMapKey());
- assertTrue(virtualElementCollectionMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setPkMapKey(true);
- assertEquals(null, virtualElementCollectionMapping.getMapKey());//no primary key on an embeddable
- assertTrue(virtualElementCollectionMapping.isPkMapKey());
- assertFalse(virtualElementCollectionMapping.isCustomMapKey());
- assertFalse(virtualElementCollectionMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setCustomMapKey(true);
- javaElementCollectionMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualElementCollectionMapping.getSpecifiedMapKey());
- assertEquals("city", virtualElementCollectionMapping.getMapKey());
- assertFalse(virtualElementCollectionMapping.isPkMapKey());
- assertTrue(virtualElementCollectionMapping.isCustomMapKey());
- assertFalse(virtualElementCollectionMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 xmlElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(xmlElementCollection.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormElementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", xmlElementCollection.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormElementCollectionMapping.setSpecifiedMapKey(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertTrue(ormElementCollectionMapping.isPkMapKey());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").addToXml();
- virtualElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- virtualElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- virtualElementCollectionMapping.setSpecifiedTargetClass("String");
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- elementCollection.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNotNull(elementCollection.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- elementCollection.getMapKeyClass().setClassName("String");
- assertEquals("String", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", elementCollection.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- elementCollection.getMapKeyClass().setClassName(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass().getClassName());
-
- elementCollection.getMapKeyClass().setClassName("String");
- elementCollection.setMapKeyClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", virtualElementCollectionMapping.getMapKeyClass());
- assertNull(virtualElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualElementCollectionMapping.getMapKeyClass());
- assertEquals("Integer", virtualElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", elementCollection.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormElementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = (Orderable2_0) elementCollectionMapping.getOrderable();
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = (Orderable2_0) elementCollectionMapping.getOrderable();
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaElementCollectionMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 virtualCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
- orderable = (Orderable2_0) virtualCollectionMapping.getOrderable();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(false, orderable.isNoOrdering());
- assertEquals(TYPE_NAME + "_addresses", orderable.getOrderColumn().getTable());
- assertEquals("addresses_ORDER", orderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaElementCollectionMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_addresses", orderable.getOrderColumn().getTable());
- assertEquals("FOO", orderable.getOrderColumn().getName());
- }
-
- public void testVirtualValueColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attrubte in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getValueColumn();
- assertEquals("addresses", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getValueColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getValueColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getValueColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getValueColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getValueColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- OrmColumn ormColumn = addressesVirtualMapping.getValueColumn();
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getValueColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getValueColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getValueColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getValueColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getValueColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualValueColumnTable() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getValueColumn();
-
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
- assertEquals("JAVA_COLLECTION_TABLE", virtualColumn.getTable());
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not default
- addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesVirtualMapping.getValueColumn();
- assertNull(virtualColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getDefaultTable());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- elementCollectionResource.getAttributeOverrides().get(0).setName("FOO");
- elementCollectionResource.getAttributeOverrides().get(1).setName("BAR");
- elementCollectionResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, elementCollectionResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", elementCollectionResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", elementCollectionResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", elementCollectionResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- elementCollectionResource.getAttributeOverrides().get(0).setName("FOO");
- elementCollectionResource.getAttributeOverrides().get(1).setName("BAR");
- elementCollectionResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
- public void testElementCollectionMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- ormElementCollectionMapping.setName("foo");
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals("foo", ormElementCollectionMapping.getName());
-
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType persistentType3 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- //embedded mapping is virtual, specified attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<? extends ReadOnlyAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- ReadOnlyAttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- ListIterator<? extends ReadOnlyAttributeOverride> virtualOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- attributeOverride = virtualOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- attributeOverride = virtualOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaElementCollectionMapping.getValueAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType3.getJavaPersistentType().getAttributeNamed("name").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", attributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, attributeOverride.getColumn().isInsertable());
- assertEquals(false, attributeOverride.getColumn().isUpdatable());
- assertEquals(true, attributeOverride.getColumn().isUnique());
- assertEquals(false, attributeOverride.getColumn().isNullable());
- assertEquals(5, attributeOverride.getColumn().getLength());
- assertEquals(6, attributeOverride.getColumn().getPrecision());
- assertEquals(7, attributeOverride.getColumn().getScale());
-
- virtualOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = virtualOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- attributeOverride = virtualOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("addresses").addToXml();
- elementCollectionMapping = (OrmElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualOverride.getColumn().getName());
- assertEquals(TYPE_NAME + "_addresses", virtualOverride.getColumn().getTable());
- assertEquals(null, virtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualOverride.getColumn().isInsertable());
- assertEquals(true, virtualOverride.getColumn().isUpdatable());
- assertEquals(false, virtualOverride.getColumn().isUnique());
- assertEquals(true, virtualOverride.getColumn().isNullable());
- assertEquals(255, virtualOverride.getColumn().getLength());
- assertEquals(0, virtualOverride.getColumn().getPrecision());
- assertEquals(0, virtualOverride.getColumn().getScale());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualOverride.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualOverride.getColumn().getDefaultTable());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals("city", attributeOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
- assertEquals("JAVA_COLLECTION_TABLE", virtualColumn.getTable());
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not default
- addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertNull(virtualColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getDefaultTable());
- }
-
- public void testSelfReferentialElementCollectionMapping() throws Exception {
- createSelfReferentialElementCollection();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Foo");
-
- ElementCollectionMapping2_0 mapping = (ElementCollectionMapping2_0) persistentType.getAttributeNamed("elementCollection").getMapping();
- assertFalse(mapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- elementCollectionResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, elementCollectionResource.getMapKeyEnumerated());
-
- elementCollectionResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- elementCollectionResource.setMapKeyEnumerated(null);
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormElementCollectionMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
- ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, elementCollectionResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, elementCollectionResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormElementCollectionMapping.setMapKeyConverter(null);
- assertNull(elementCollectionResource.getMapKeyEnumerated());
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, elementCollectionResource.getMapKeyTemporal());
-
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, elementCollectionResource.getMapKeyTemporal());
-
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, elementCollectionResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- elementCollectionResource.setMapKeyTemporal(null);
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormElementCollectionMapping.setMapKeyConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, elementCollectionResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, elementCollectionResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormElementCollectionMapping.setMapKeyConverter(null);
- assertNull(elementCollectionResource.getMapKeyTemporal());
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- JoinColumn joinColumn = ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
-
- JoinColumn joinColumn2 = ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
-
- JoinColumn joinColumn3 = ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(2).getName());
-
- ListIterator<? extends JoinColumn> joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, elementCollectionResource.getMapKeyJoinColumns().size());
-
- ormElementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, elementCollectionResource.getMapKeyJoinColumns().size());
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
-
- ormElementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, elementCollectionResource.getMapKeyJoinColumns().size());
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
-
- ormElementCollectionMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, elementCollectionResource.getMapKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormElementCollectionMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, elementCollectionResource.getMapKeyJoinColumns().size());
-
-
- ormElementCollectionMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(2).getName());
-
-
- ormElementCollectionMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", elementCollectionResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAR", elementCollectionResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getMapKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdateMapKeyJoinColumns() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 ormElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- elementCollectionResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- elementCollectionResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- elementCollectionResource.getMapKeyJoinColumns().get(0).setName("FOO");
- elementCollectionResource.getMapKeyJoinColumns().get(1).setName("BAR");
- elementCollectionResource.getMapKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<? extends JoinColumn> joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().move(2, 0);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().move(0, 1);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- elementCollectionResource.getMapKeyJoinColumns().remove(0);
- assertFalse(ormElementCollectionMapping.getSpecifiedMapKeyJoinColumns().iterator().hasNext());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java
deleted file mode 100644
index 8730f200ed..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEmbeddedMapping2_0Tests.java
+++ /dev/null
@@ -1,1739 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTable;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumn;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinColumnRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.VirtualJoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaReadOnlyAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.EmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ReadOnlyOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.VirtualOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmEmbeddedMapping2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEmbedded;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmEmbeddedMapping2_0Tests extends Generic2_0ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- private static final String EMBEDDABLE_TYPE_NAME = "MyEmbeddable";
- private static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- public GenericOrmEmbeddedMapping2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityEmbeddedMappingAttributeOverrides() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @Embedded");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
- private ICompilationUnit createTestEntityWithEmbeddedMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDED, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded").append(CR);
- sb.append(" private " + EMBEDDABLE_TYPE_NAME + " myEmbedded;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createEmbeddableType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append(EMBEDDABLE_TYPE_NAME).append(" {");
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, EMBEDDABLE_TYPE_NAME + ".java", sourceWriter);
- }
-
- private void createAddressEntity() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class Address {");
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" ");
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Column(name=\"A_STATE\")").append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Customer").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEmbeddableAddress2() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- private void createSelfReferentialEmbedded() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Foo embedded;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public void testUpdateName() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("id", ormEmbeddedMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("id", ormEmbeddedMapping.getName());
- assertEquals("id", 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 {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, embeddedResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", embeddedResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", embeddedResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", embeddedResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- embeddedResource.getAttributeOverrides().get(0).setName("FOO");
- embeddedResource.getAttributeOverrides().get(1).setName("BAR");
- embeddedResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- embeddedResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
-
- public void testEmbeddedMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
- ormEmbeddedMapping.setName("foo");
- OrmAttributeOverrideContainer attributeOverrideContainer = ormEmbeddedMapping.getAttributeOverrideContainer();
-
- assertEquals("foo", ormEmbeddedMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType persistentType2 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //embedded mapping is virtual, specified attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("address");
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<? extends ReadOnlyAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- ReadOnlyAttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- ListIterator<? extends ReadOnlyAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- JavaEmbeddedMapping javaEmbeddedMapping = (JavaEmbeddedMapping) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaEmbeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType2.getJavaPersistentType().getAttributeNamed("state").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", attributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, attributeOverride.getColumn().isInsertable());
- assertEquals(false, attributeOverride.getColumn().isUpdatable());
- assertEquals(true, attributeOverride.getColumn().isUnique());
- assertEquals(false, attributeOverride.getColumn().isNullable());
- assertEquals(5, attributeOverride.getColumn().getLength());
- assertEquals(6, attributeOverride.getColumn().getPrecision());
- assertEquals(7, attributeOverride.getColumn().getScale());
-
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("address").addToXml();
- embeddedMapping = (OrmEmbeddedMapping) persistentType.getAttributeNamed("address").getMapping();
- attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualOverride.getName());
- assertEquals("city", virtualOverride.getColumn().getName());
- assertEquals(TYPE_NAME, virtualOverride.getColumn().getTable());
- assertEquals(null, virtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualOverride.getColumn().isInsertable());
- assertEquals(true, virtualOverride.getColumn().isUpdatable());
- assertEquals(false, virtualOverride.getColumn().isUnique());
- assertEquals(true, virtualOverride.getColumn().isNullable());
- assertEquals(255, virtualOverride.getColumn().getLength());
- assertEquals(0, virtualOverride.getColumn().getPrecision());
- assertEquals(0, virtualOverride.getColumn().getScale());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualOverride.getColumn().getDefaultName());
- assertEquals(TYPE_NAME, virtualOverride.getColumn().getDefaultTable());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals("id", attributeOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- EmbeddedMapping virtualEmbeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- AttributeOverrideContainer attributeOverrideContainer = virtualEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals("address", virtualEmbeddedMapping.getName());
-
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends ReadOnlyAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- ReadOnlyAttributeOverride override = specifiedAttributeOverrides.next();
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, override.getName());
- ReadOnlyColumn column = override.getColumn();
- assertEquals(ATTRIBUTE_OVERRIDE_COLUMN_NAME, column.getSpecifiedName());
-
- ListIterator<? extends ReadOnlyAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- override = virtualAttributeOverrides.next();
- assertEquals("id", override.getName());
- column = override.getColumn();
- assertEquals("id", column.getName());
-
- override = virtualAttributeOverrides.next();
- assertEquals("state", override.getName());
- column = override.getColumn();
- assertEquals("A_STATE", column.getName());
-
- override = virtualAttributeOverrides.next();
- assertEquals("zip", override.getName());
- column = override.getColumn();
- assertEquals("zip", column.getName());
-
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- EmbeddedMapping virtualEmbeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", virtualEmbeddedMapping.getName());
-
- //TODO
-// assertEquals(4, ormEmbeddedMapping.specifiedAttributeOverridesSize());
-// assertEquals(0, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.specifiedAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getSpecifiedName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getSpecifiedName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getSpecifiedName());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- createTestEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEmbeddedMapping ormEmbeddedMapping = (OrmEmbeddedMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormEmbeddedMapping.getName());
-
- assertEquals(0, ormEmbeddedMapping.getAttributeOverrideContainer().getSpecifiedOverridesSize());
- //TODO
-// assertEquals(4, CollectionTools.size(ormEmbeddedMapping.defaultAttributeOverrides()));
-// ListIterator<XmlAttributeOverride> ormAttributeOverrides = ormEmbeddedMapping.defaultAttributeOverrides();
-//
-// XmlAttributeOverride ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals(ATTRIBUTE_OVERRIDE_NAME, ormAttributeOverride.getName());
-// XmlColumn xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("city", xmlColumn.getDefaultName());
-//// assertEquals(Boolean.TRUE, xmlColumn.getSpecifiedUnique());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedNullable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedInsertable());
-//// assertEquals(Boolean.FALSE, xmlColumn.getSpecifiedUpdatable());
-//// assertEquals("COLUMN_DEFINITION", xmlColumn.getColumnDefinition());
-//// assertEquals("MY_TABLE", xmlColumn.getSpecifiedTable());
-//// assertEquals(Integer.valueOf(5), xmlColumn.getSpecifiedLength());
-//// assertEquals(Integer.valueOf(6), xmlColumn.getSpecifiedPrecision());
-//// assertEquals(Integer.valueOf(7), xmlColumn.getSpecifiedScale());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("id", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("id", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("state", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("state", xmlColumn.getDefaultName());
-//
-// ormAttributeOverride = ormAttributeOverrides.next();
-// assertEquals("zip", ormAttributeOverride.getName());
-// xmlColumn = ormAttributeOverride.getColumn();
-// assertEquals("zip", xmlColumn.getDefaultName());
- }
-
-
- public void testEmbeddedMorphToIdMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToVersionMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToTransientMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToBasicMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- attributeOverride = ((EmbeddedIdMapping) ormPersistentAttribute.getMapping()).getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("override", attributeOverride.getName());
- assertEquals("OVERRIDE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- }
-
- public void testEmbeddedMorphToOneToOneMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToOneToManyMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToOneMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testEmbeddedMorphToManyToManyMapping() throws Exception {
- createTestEntityEmbeddedMappingAttributeOverrides();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
-
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) ormPersistentAttribute.getMapping();
- assertFalse(embeddedMapping.isDefault());
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- embeddedResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- AttributeOverride attributeOverride = embeddedMapping.getAttributeOverrideContainer().getSpecifiedOverrides().iterator().next();
- attributeOverride.setName("override");
- attributeOverride.getColumn().setSpecifiedName("OVERRIDE_COLUMN");
- assertFalse(embeddedMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("id", ormPersistentAttribute.getMapping().getName());
- }
-
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
-
- OrmAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- XmlAssociationOverride associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(associationOverride);
- associationOverride.setName("FOO");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(1, associationOverride);
- associationOverride.setName("BAR");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(0, associationOverride);
- associationOverride.setName("BAZ");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- embeddedResource.getAssociationOverrides().move(1, 0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- embeddedResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrideDefaults() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- VirtualJoinColumnRelationshipStrategy joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("address", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- VirtualJoinColumn virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("address_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals(TYPE_NAME, virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
-
- JavaPersistentType javaEmbeddable = getPersistenceUnit().getSpecifiedClassRefs().iterator().next().getJavaPersistentType();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) javaEmbeddable.getAttributeNamed("address").getMapping();
- JoinColumn joinColumn = oneToOneMapping.getRelationship().getJoinColumnStrategy().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- joiningStrategy = ((VirtualJoinColumnRelationship) virtualAssociationOverride.getRelationship()).getJoinColumnStrategy();
- assertEquals("address", virtualAssociationOverride.getName());
- assertEquals(1, joiningStrategy.getJoinColumnsSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- virtualJoinColumn = joiningStrategy.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals("MY_JOIN_COLUMN", joiningStrategy.getJoinColumns().iterator().next().getName());
-
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- //add an annotation to the resource model and verify the context model is updated
- XmlAssociationOverride associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(associationOverride);
- associationOverride.setName("FOO");
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(0, associationOverride);
- associationOverride.setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getOverridesSize());
-
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- XmlAssociationOverride associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(associationOverride);
- associationOverride.setName("bar");
- assertEquals(3, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("address", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, embeddedResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- OrmAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", embeddedResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, embeddedResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- OrmAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- assertEquals(2, embeddedResource.getAssociationOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals(1, embeddedResource.getAssociationOverrides().size());
-
- Iterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("addresses", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, embeddedResource.getAssociationOverrides().size());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
- assertEquals(2, embeddedResource.getAssociationOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("addresses", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", embeddedResource.getAssociationOverrides().get(1).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("addresses", associationOverrides.next().getName());
-
- assertEquals("address", embeddedResource.getAssociationOverrides().get(0).getName());
- assertEquals("addresses", embeddedResource.getAssociationOverrides().get(1).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- XmlEmbedded embeddedResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getEmbeddeds().get(0);
-
- XmlAssociationOverride associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(0, associationOverride);
- associationOverride.setName("FOO");
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(1, associationOverride);
- associationOverride.setName("BAR");
- associationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- embeddedResource.getAssociationOverrides().add(2, associationOverride);
- associationOverride.setName("BAZ");
-
- ListIterator<? extends AssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().move(2, 0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().move(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- embeddedResource.getAssociationOverrides().remove(0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- OrmAssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrideJoinTableDefaults() throws Exception {
- createTestEntityWithEmbeddedMapping();
- createEmbeddableType();
- createAddressEntity();
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME_ + "Address");
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myEmbedded"), MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- OrmEmbeddedMapping2_0 embeddedMapping = (OrmEmbeddedMapping2_0) ormPersistentAttribute.getMapping();
- AssociationOverrideContainer overrideContainer = embeddedMapping.getAssociationOverrideContainer();
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- VirtualJoinTableRelationshipStrategy joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- ReadOnlyJoinTable joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals("AnnotationTestType_Address", joinTable.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- ReadOnlyJoinColumn virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
- assertEquals("AnnotationTestType_id", virtualJoinColumn.getName());
- assertEquals("id", virtualJoinColumn.getReferencedColumnName());
- assertEquals("AnnotationTestType_Address", virtualJoinColumn.getTable());
- assertEquals(null, virtualJoinColumn.getColumnDefinition());
- assertEquals(true, virtualJoinColumn.isInsertable());
- assertEquals(true, virtualJoinColumn.isUpdatable());
- assertEquals(false, virtualJoinColumn.isUnique());
- assertEquals(true, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- ReadOnlyJoinColumn virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("addresses_id", virtualInverseJoinColumn.getName());
- assertEquals("id", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("AnnotationTestType_Address", virtualInverseJoinColumn.getTable());
- assertEquals(null, virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(true, virtualInverseJoinColumn.isInsertable());
- assertEquals(true, virtualInverseJoinColumn.isUpdatable());
- assertEquals(false, virtualInverseJoinColumn.isUnique());
- assertEquals(true, virtualInverseJoinColumn.isNullable());
-
- JavaPersistentType javaEmbeddable = getPersistenceUnit().getSpecifiedClassRefs().iterator().next().getJavaPersistentType();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) javaEmbeddable.getAttributeNamed("addresses").getMapping();
- JoinTableRelationshipStrategy joinTableStrategy = oneToManyMapping.getRelationship().getJoinTableStrategy();
- joinTableStrategy.getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- JoinColumn joinColumn = joinTableStrategy.getJoinTable().addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("MY_JOIN_COLUMN");
- joinColumn.setSpecifiedReferencedColumnName("MY_REFERENCE_COLUMN");
- joinColumn.setSpecifiedTable("BAR");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setSpecifiedInsertable(Boolean.FALSE);
- joinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- joinColumn.setSpecifiedUnique(Boolean.TRUE);
- joinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- JoinColumn inverseJoinColumn = joinTableStrategy.getJoinTable().addSpecifiedInverseJoinColumn(0);
- inverseJoinColumn.setSpecifiedName("MY_INVERSE_JOIN_COLUMN");
- inverseJoinColumn.setSpecifiedReferencedColumnName("MY_INVERSE_REFERENCE_COLUMN");
- inverseJoinColumn.setSpecifiedTable("INVERSE_BAR");
- inverseJoinColumn.setColumnDefinition("INVERSE_COLUMN_DEF");
- inverseJoinColumn.setSpecifiedInsertable(Boolean.FALSE);
- inverseJoinColumn.setSpecifiedUpdatable(Boolean.FALSE);
- inverseJoinColumn.setSpecifiedUnique(Boolean.TRUE);
- inverseJoinColumn.setSpecifiedNullable(Boolean.FALSE);
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("MY_INVERSE_JOIN_COLUMN", virtualInverseJoinColumn.getName());
- assertEquals("MY_INVERSE_REFERENCE_COLUMN", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("INVERSE_BAR", virtualInverseJoinColumn.getTable());
- assertEquals("INVERSE_COLUMN_DEF", virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(false, virtualInverseJoinColumn.isInsertable());
- assertEquals(false, virtualInverseJoinColumn.isUpdatable());
- assertEquals(true, virtualInverseJoinColumn.isUnique());
- assertEquals(false, virtualInverseJoinColumn.isNullable());
-
-
- //add the java association override and make sure the settings are not used in determining the association override defaults in the specified orm embedded mapping
- JavaEmbeddedMapping2_0 javaEmbeddedMapping = (JavaEmbeddedMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("myEmbedded").getMapping();
- ListIterator<JavaReadOnlyAssociationOverride> javaAssociationOverrides = javaEmbeddedMapping.getAssociationOverrideContainer().getOverrides().iterator();
- javaAssociationOverrides.next();
- JavaAssociationOverride javaAssociationOverride = ((JavaVirtualAssociationOverride) javaAssociationOverrides.next()).convertToSpecified();
- assertEquals("addresses", javaAssociationOverride.getName());
- JavaJoinTable javaJoinTable = ((JavaOverrideRelationship2_0) javaAssociationOverride.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("JAVA_FOO");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("JAVA_JOIN_COLUMN_NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("JAVA_JOIN_COLUMN_REFERENCED_NAME");
- JavaJoinColumn javaInverseJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- javaInverseJoinColumn.setSpecifiedName("JAVA_INVERSE_JOIN_COLUMN_NAME");
- javaInverseJoinColumn.setSpecifiedReferencedColumnName("JAVA_INVERSE_JOIN_COLUMN_REFERENCED_NAME");
-
-
-
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = CollectionTools.get(overrideContainer.getVirtualOverrides(), 1);
- joiningStrategy = ((VirtualOverrideRelationship2_0) virtualAssociationOverride.getRelationship()).getJoinTableStrategy();
- joinTable = joiningStrategy.getJoinTable();
- assertEquals("addresses", virtualAssociationOverride.getName());
- assertEquals("MY_JOIN_TABLE", joinTable.getName());
- assertEquals(1, joinTable.getJoinColumnsSize());
- virtualJoinColumn = joinTable.getJoinColumns().iterator().next();
-
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
- assertEquals("COLUMN_DEF", virtualJoinColumn.getColumnDefinition());
- assertEquals(false, virtualJoinColumn.isInsertable());
- assertEquals(false, virtualJoinColumn.isUpdatable());
- assertEquals(true, virtualJoinColumn.isUnique());
- assertEquals(false, virtualJoinColumn.isNullable());
-
- assertEquals(1, joinTable.getInverseJoinColumnsSize());
- virtualInverseJoinColumn = joinTable.getInverseJoinColumns().iterator().next();
- assertEquals("MY_INVERSE_JOIN_COLUMN", virtualInverseJoinColumn.getName());
- assertEquals("MY_INVERSE_REFERENCE_COLUMN", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("INVERSE_BAR", virtualInverseJoinColumn.getTable());
- assertEquals("INVERSE_COLUMN_DEF", virtualInverseJoinColumn.getColumnDefinition());
- assertEquals(false, virtualInverseJoinColumn.isInsertable());
- assertEquals(false, virtualInverseJoinColumn.isUpdatable());
- assertEquals(true, virtualInverseJoinColumn.isUnique());
- assertEquals(false, virtualInverseJoinColumn.isNullable());
-
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
-
- ormPersistentAttribute.removeFromXml();
- EmbeddedMapping2_0 virtualEmbeddedMapping = (EmbeddedMapping2_0) ormPersistentType.getAttributeNamed("myEmbedded").getMapping();
- overrideContainer = virtualEmbeddedMapping.getAssociationOverrideContainer();
- AssociationOverride associationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertEquals("addresses", associationOverride.getName());
- ReadOnlyJoinTableRelationshipStrategy strategy = ((ReadOnlyOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy();
- joinTable = strategy.getJoinTable();
- assertEquals("JAVA_FOO", joinTable.getName());
- assertEquals(2, joinTable.getJoinColumnsSize());
- ListIterator<? extends ReadOnlyJoinColumn> joinColumns = joinTable.getJoinColumns().iterator();
- virtualJoinColumn = joinColumns.next();
- assertEquals("JAVA_JOIN_COLUMN_NAME", virtualJoinColumn.getName());
- assertEquals("JAVA_JOIN_COLUMN_REFERENCED_NAME", virtualJoinColumn.getReferencedColumnName());
- assertEquals("JAVA_FOO", virtualJoinColumn.getTable());
- virtualJoinColumn = joinColumns.next();
- assertEquals("MY_JOIN_COLUMN", virtualJoinColumn.getName());
- assertEquals("MY_REFERENCE_COLUMN", virtualJoinColumn.getReferencedColumnName());
- assertEquals("BAR", virtualJoinColumn.getTable());
-
- assertEquals(2, joinTable.getInverseJoinColumnsSize());
- ListIterator<? extends ReadOnlyJoinColumn> inverseJoinColumns = joinTable.getInverseJoinColumns().iterator();
- virtualInverseJoinColumn = inverseJoinColumns.next();
- assertEquals("JAVA_INVERSE_JOIN_COLUMN_NAME", virtualInverseJoinColumn.getName());
- assertEquals("JAVA_INVERSE_JOIN_COLUMN_REFERENCED_NAME", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("JAVA_FOO", virtualInverseJoinColumn.getTable());
- virtualInverseJoinColumn = inverseJoinColumns.next();
- assertEquals("MY_INVERSE_JOIN_COLUMN", virtualInverseJoinColumn.getName());
- assertEquals("MY_INVERSE_REFERENCE_COLUMN", virtualInverseJoinColumn.getReferencedColumnName());
- assertEquals("INVERSE_BAR", virtualInverseJoinColumn.getTable());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityCustomer();
- createTestEmbeddableAddress2();
- createTestEmbeddableZipCode();
-
- OrmPersistentType customerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- customerPersistentType.getAttributeNamed("address").addToXml();
- EmbeddedMapping embeddedMapping = (EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = embeddedMapping.getAttributeOverrideContainer();
-
- assertEquals(5, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("Customer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("Customer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- addressPersistentType.getAttributeNamed("zipCode").addToXml();
- EmbeddedMapping nestedEmbeddedMapping = (EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping();
- AttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("plusfour", virtualAttributeOverride.getName());
-
- zipCodePersistentType.getAttributeNamed("plusfour").addToXml();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.zipCode) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour");
- assertEquals("plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) ((EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
- virtualAttributeOverride = (VirtualAttributeOverride) ((EmbeddedMapping) customerPersistentType.getAttributeNamed("address").getMapping()).getAttributeOverrideContainer().getOverrideNamed("zipCode.plusfour");
- assertEquals("zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testSelfReferentialEmbeddedMapping() throws Exception {
- createSelfReferentialEmbedded();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Foo");
-
- EmbeddedMapping2_0 embeddedMapping = (EmbeddedMapping2_0) persistentType.getAttributeNamed("embedded").getMapping();
- assertFalse(embeddedMapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java
deleted file mode 100644
index e6955b98a1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmEntity2_0Tests.java
+++ /dev/null
@@ -1,1972 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.LockModeType2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmNamedQuery2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOverrideRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinColumn;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlJoinTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlNamedQuery;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlAssociationOverride_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmEntity2_0Tests extends Generic2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public GenericOrmEntity2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
- private void createTestMappedSuperclassCustomerWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEntityLongTimeCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("LongTimeCustomer extends Customer ");
- sb.append("{}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "LongTimeCustomer.java", sourceWriter);
- }
-
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- private LockModeType2_0 lockModeOf(XmlNamedQuery resourceQuery) {
- return resourceQuery == null ? null : LockModeType2_0.fromOrmResourceModel(resourceQuery.getLockMode());
- }
-
- public void testAddNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- OrmNamedQuery2_0 namedQuery = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(0);
- namedQuery.setName("FOO");
- namedQuery.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
-
- XmlNamedQuery resourceQuery = entityResource.getNamedQueries().get(0);
- assertEquals("FOO", resourceQuery.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(resourceQuery));
-
- OrmNamedQuery2_0 namedQuery2 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(0);
- namedQuery2.setName("BAR");
- namedQuery2.setSpecifiedLockMode(LockModeType2_0.READ);
-
- resourceQuery = entityResource.getNamedQueries().get(0);
- assertEquals("BAR", resourceQuery.getName());
- assertEquals(LockModeType2_0.READ, this.lockModeOf(resourceQuery));
- assertEquals("FOO", entityResource.getNamedQueries().get(1).getName());
-
- OrmNamedQuery2_0 namedQuery3 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(1);
- namedQuery3.setName("BAZ");
- namedQuery3.setSpecifiedLockMode(LockModeType2_0.WRITE);
-
- assertEquals("BAR", entityResource.getNamedQueries().get(0).getName());
- resourceQuery = entityResource.getNamedQueries().get(1);
- assertEquals("BAZ", resourceQuery.getName());
- assertEquals(LockModeType2_0.WRITE, this.lockModeOf(resourceQuery));
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals(namedQuery2, namedQueries.next());
- assertEquals(namedQuery3, namedQueries.next());
- assertEquals(namedQuery, namedQueries.next());
-
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- }
-
- public void testRemoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedQuery(0).setName("FOO");
- OrmNamedQuery2_0 namedQuery1 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(1);
- namedQuery1.setName("BAR");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.READ);
-
- OrmNamedQuery2_0 namedQuery2 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(2);
- namedQuery2.setName("BAZ");
- namedQuery2.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(2, entityResource.getNamedQueries().size());
- XmlNamedQuery xmlQuery0 = entityResource.getNamedQueries().get(0);
- assertEquals("BAR", xmlQuery0.getName());
- assertEquals(LockModeType2_0.READ, this.lockModeOf(xmlQuery0));
-
- XmlNamedQuery xmlQuery1 = entityResource.getNamedQueries().get(1);
- assertEquals("BAZ", xmlQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(xmlQuery1));
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(1, entityResource.getNamedQueries().size());
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
- xmlQuery0 = entityResource.getNamedQueries().get(0);
- assertEquals("BAZ", xmlQuery0.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(xmlQuery0));
-
- ormEntity.getQueryContainer().removeNamedQuery(0);
- assertEquals(0, entityResource.getNamedQueries().size());
- }
-
- public void testMoveNamedQuery() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- ormEntity.getQueryContainer().addNamedQuery(0).setName("FOO");
- OrmNamedQuery2_0 namedQuery1 = (OrmNamedQuery2_0) ormEntity.getQueryContainer().addNamedQuery(1);
- namedQuery1.setName("BAR");
- namedQuery1.setSpecifiedLockMode(LockModeType2_0.OPTIMISTIC);
- ormEntity.getQueryContainer().addNamedQuery(2).setName("BAZ");
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getNamedQueries().size());
-
-
- ormEntity.getQueryContainer().moveNamedQuery(2, 0);
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAR", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAZ", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
-
- XmlNamedQuery xmlQuery0 = entityResource.getNamedQueries().get(0);
- assertEquals("BAR", xmlQuery0.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(xmlQuery0));
- assertEquals("BAZ", entityResource.getNamedQueries().get(1).getName());
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
-
-
- ormEntity.getQueryContainer().moveNamedQuery(0, 1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAZ", namedQueries.next().getName());
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAR", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
-
- assertEquals("BAZ", entityResource.getNamedQueries().get(0).getName());
- XmlNamedQuery xmlQuery1 = entityResource.getNamedQueries().get(1);
- assertEquals("BAR", xmlQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, this.lockModeOf(xmlQuery1));
- assertEquals("FOO", entityResource.getNamedQueries().get(2).getName());
- }
-
- public void testUpdateNamedQueries() throws Exception {
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) persistentType.getMapping();
-
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().add(OrmFactory.eINSTANCE.createXmlNamedQuery());
- entityResource.getNamedQueries().get(0).setName("FOO");
- entityResource.getNamedQueries().get(1).setName("BAR");
- XmlNamedQuery xmlQuery = entityResource.getNamedQueries().get(2);
- xmlQuery.setName("BAZ");
- xmlQuery.setLockMode(org.eclipse.jpt.jpa.core.resource.orm.v2_0.LockModeType_2_0.OPTIMISTIC);
-
- ListIterator<OrmNamedQuery> namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("FOO", namedQueries.next().getName());
- assertEquals("BAR", namedQueries.next().getName());
- OrmNamedQuery2_0 namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertFalse(namedQueries.hasNext());
- assertEquals(3, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().move(2, 0);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- assertEquals("BAR", namedQueries.next().getName());
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().move(0, 1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("BAR", namedQueries.next().getName());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertEquals("FOO", namedQueries.next().getName());
- assertFalse(namedQueries.hasNext());
- assertEquals(2, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().remove(1);
- namedQueries = ormEntity.getQueryContainer().getNamedQueries().iterator();
- namedQuery1 = (OrmNamedQuery2_0) namedQueries.next();
- assertEquals("BAZ", namedQuery1.getName());
- assertEquals(LockModeType2_0.OPTIMISTIC, namedQuery1.getLockMode());
- assertFalse(namedQueries.hasNext());
- assertEquals(1, ormEntity.getPersistenceUnit().getQueriesSize());
-
- entityResource.getNamedQueries().remove(0);
- assertFalse(ormEntity.getQueryContainer().getNamedQueries().iterator().hasNext());
- assertEquals(0, ormEntity.getPersistenceUnit().getQueriesSize());
- }
-
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = ormEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- OrmEntity abstractEntity = (OrmEntity) ormEntity.getParentEntity();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociations = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- OrmEntity abstractEntity = (OrmEntity) ormEntity.getParentEntity();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-//TODO
-// public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
-// createTestMappedSuperclass();
-// createTestSubType();
-// addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-// getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// Iterator<PersistentAttribute> overridableAttributes = getJavaEntity().allOverridableAttributes();
-// assertEquals("id", overridableAttributes.next().getName());
-// assertEquals("name", overridableAttributes.next().getName());
-// assertEquals("foo", overridableAttributes.next().getName());
-// assertFalse(overridableAttributes.hasNext());
-// }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributeNames = ormEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertEquals("foo", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().add(1, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("BAZ");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().move(1, 0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testDefaultAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) ormEntity.getPersistentType().getSuperPersistentType().getMapping();
-
- mappedSuperclass.getPersistentType().getAttributeNamed("id").addToXml();
- BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testDefaultAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- OrmEntity superclass = (OrmEntity) ormEntity.getParentEntity();
-
- superclass.getPersistentType().getAttributeNamed("id").addToXml();
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("bar");
- assertEquals(4, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("id", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("name", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("foo", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
-
- Iterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals("foo", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals(1, entityResource.getAttributeOverrides().size());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, entityResource.getAttributeOverrides().size());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("foo", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(2).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- assertEquals("foo", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("name", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().add(1, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().add(2, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociationNames = entity.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-// //TODO add all mapping types to the mapped superclass to test which ones are overridable
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociationNames = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociationNames.next());
- assertEquals("address2", overridableAssociationNames.next());
- assertEquals("address3", overridableAssociationNames.next());
- assertEquals("address4", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociations() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociations = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- XmlAssociationOverride xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(0, xmlAssociationOverride);
- xmlAssociationOverride.setName("FOO");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(1, xmlAssociationOverride);
- xmlAssociationOverride.setName("BAR");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(0, xmlAssociationOverride);
- xmlAssociationOverride.setName("BAZ");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- entityResource.getAssociationOverrides().move(1, 0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testDefaultAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(FULLY_QUALIFIED_SUB_TYPE_NAME, entityResource.getClassName());
- assertTrue(entityResource.getAssociationOverrides().isEmpty());
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-//
-// //MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-// //BasicMapping idMapping = (BasicMapping) mappedSuperclass.persistentType().attributeNamed("id").getMapping();
-// //idMapping.getColumn().setSpecifiedName("FOO");
-// //idMapping.getColumn().setSpecifiedTable("BAR");
-//
-// assertEquals(SUB_TYPE_NAME, entityResource.getName());
-// assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
-// assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-// //idMapping.getColumn().setSpecifiedName(null);
-// //idMapping.getColumn().setSpecifiedTable(null);
-// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-// assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
-// assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-//// assertNull(typeResource.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(typeResource.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-//// assertNull(typeResource.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(typeResource.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- //add to the resource model and verify the context model is updated
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("bar");
- assertEquals(5, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("address", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address2", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, entityResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, entityResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals(1, entityResource.getAssociationOverrides().size());
-
- Iterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, entityResource.getAssociationOverrides().size());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", entityResource.getAssociationOverrides().get(1).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- assertEquals("address", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address2", entityResource.getAssociationOverrides().get(1).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().add(1, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().add(2, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(2, 0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAttributeOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- zipCodePersistentType.getAttributeNamed("plusfour").addToXml();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- addressPersistentType.getAttributeNamed("zipCode").addToXml();
- OrmAttributeOverride specifiedAttributeOverride = ((OrmVirtualAttributeOverride) ((OrmEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
- public void testNestedVirtualAttributeOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- OrmPersistentType customerPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAttributeOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- zipCodePersistentType.getAttributeNamed("plusfour").addToXml();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- addressPersistentType.getAttributeNamed("zipCode").addToXml();
- OrmAttributeOverride specifiedAttributeOverride = ((OrmVirtualAttributeOverride) ((OrmEmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAssociationOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testNestedVirtualAssociationOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAssociationOverrideContainer overrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, entityResource.getCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, entityResource.getCacheable());
-
- cacheable.setSpecifiedCacheable(null);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
-
- entityResource.setCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, entityResource.getCacheable());
-
- entityResource.setCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, entityResource.getCacheable());
-
- entityResource.setCacheable(null);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- assertEquals(SharedCacheMode.UNSPECIFIED, persistenceUnit2_0.getSharedCacheMode());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromSuperType() throws Exception {
- createTestEntity();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subOrmPersistentType.getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromJava() throws Exception {
- createTestEntity();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subOrmPersistentType.getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
-
- Cacheable2_0 javaCacheable = ((CacheableHolder2_0) ormPersistentType.getJavaPersistentType().getMapping()).getCacheable();
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = (PersistenceUnit2_0) getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- //This is a test for bug 301892
- public void testAssociationOverrideJoinTableUpdate() throws Exception {
- createTestEntity();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- XmlEntity resourceEntity = getXmlEntityMappings().getEntities().get(0);
-
- XmlAssociationOverride_2_0 resourceAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- resourceEntity.getAssociationOverrides().add((XmlAssociationOverride) resourceAssociationOverride);
- ((XmlAssociationOverride) resourceAssociationOverride).setName("a");
-
- OrmAssociationOverride associationOverride = entity.getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("a", associationOverride.getName());
-
- XmlJoinTable resourceJoinTable = OrmFactory.eINSTANCE.createXmlJoinTable();
- resourceAssociationOverride.setJoinTable(resourceJoinTable);
- resourceJoinTable.setName("FOO");
- XmlJoinColumn resourceJoinColumn = OrmFactory.eINSTANCE.createXmlJoinColumn();
- resourceJoinTable.getInverseJoinColumns().add(resourceJoinColumn);
- resourceJoinColumn.setName("BAR");
-
- associationOverride = entity.getAssociationOverrideContainer().getSpecifiedOverrides().iterator().next();
- assertEquals("a", associationOverride.getName());
- JoinTable joinTable = ((OrmOverrideRelationship2_0) associationOverride.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals("FOO", joinTable.getSpecifiedName());
- assertEquals("BAR", joinTable.getInverseJoinColumns().iterator().next().getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java
deleted file mode 100644
index 148a505fdb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToManyMapping2_0Tests.java
+++ /dev/null
@@ -1,1208 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.NullOrmConverter;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlManyToMany_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmManyToManyMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericOrmManyToManyMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, JPA2_0.MAP_KEY_ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @MapKeyEnumerated(EnumType.STRING)").append(CR);
- sb.append(" private java.util.Map<String, Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNotNull(manyToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKey().setName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey().getName());
-
- manyToMany.getMapKey().setName("myMapKey");
- manyToMany.setMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualManyToManyMapping.getSpecifiedMapKey());
- assertNull(virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertTrue(virtualManyToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualManyToManyMapping.getMapKey());
- assertTrue(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setCustomMapKey(true);
- javaManyToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualManyToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertTrue(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany xmlManyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(xmlManyToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", xmlManyToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setSpecifiedMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(xmlManyToMany.getMapKey().getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").addToXml();
- virtualManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- virtualManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- virtualManyToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNotNull(manyToMany.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKeyClass().setClassName("String");
- assertEquals("String", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", manyToMany.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKeyClass().setClassName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass().getClassName());
-
- manyToMany.getMapKeyClass().setClassName("String");
- manyToMany.setMapKeyClass(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping2_0 virtualManyToManyMapping = (ManyToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", virtualManyToManyMapping.getMapKeyClass());
- assertNull(virtualManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualManyToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualManyToManyMapping.getMapKeyClass());
- assertEquals("Integer", virtualManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualManyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", manyToMany.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType printQueuePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- OrmPersistentAttribute jobsPersistentAttribute = printQueuePersistentType.addAttributeToXml(printQueuePersistentType.getAttributeNamed("jobs"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping jobsMapping = (OrmManyToManyMapping) jobsPersistentAttribute.getMapping();
- jobsMapping.getRelationship().setStrategyToMappedBy();
- jobsMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queues");
-
- OrmPersistentType printJobPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute queuesPersistentAttribute = printJobPersistentType.addAttributeToXml(printJobPersistentType.getAttributeNamed("queues"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping queuesMapping = (OrmManyToManyMapping) queuesPersistentAttribute.getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- OrderColumn2_0 jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- OrderColumn2_0 queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
-
- jobsOrderable.setOrderColumnOrdering(true);
- jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(null, jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderable.setOrderColumnOrdering(true);
- queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(null, queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- jobsOrderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderColumn.setSpecifiedName("BAR");
- assertEquals("BAR", queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
-
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
- assertEquals("MY_TABLE_PrintQueue", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printQueuePersistentType.getMapping()).getTable().setSpecifiedName("OTHER_TABLE");
- assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable());
-
- queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType printQueuePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- OrmPersistentAttribute jobsPersistentAttribute = printQueuePersistentType.addAttributeToXml(printQueuePersistentType.getAttributeNamed("jobs"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping jobsMapping = (OrmManyToManyMapping) jobsPersistentAttribute.getMapping();
-
- OrmPersistentType printJobPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute queuesPersistentAttribute = printJobPersistentType.addAttributeToXml(printJobPersistentType.getAttributeNamed("queues"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping queuesMapping = (OrmManyToManyMapping) queuesPersistentAttribute.getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
- JavaManyToManyMapping javaJobsManyToManyMapping = (JavaManyToManyMapping) jobsPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaJobsManyToManyMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
- jobsPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute jobsPersistentAttribute2 = printQueuePersistentType.getAttributeNamed("jobs");
- ManyToManyMapping virtualJobsMapping = (ManyToManyMapping) jobsPersistentAttribute2.getMapping();
- jobsOrderable = ((Orderable2_0) virtualJobsMapping.getOrderable());
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(false, jobsOrderable.isNoOrdering());
- assertEquals("PrintJob_PrintQueue", jobsOrderable.getOrderColumn().getTable());
- assertEquals("jobs_ORDER", jobsOrderable.getOrderColumn().getName());
- queuesPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute queuesPersistentAttribute2 = printJobPersistentType.getAttributeNamed("queues");
- ManyToManyMapping virtualQueuesMapping = (ManyToManyMapping) queuesPersistentAttribute2.getMapping();
- queuesOrderable = ((Orderable2_0) virtualQueuesMapping.getOrderable());
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(false, queuesOrderable.isNoOrdering());
- assertEquals("PrintJob_PrintQueue", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaJobsManyToManyMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals("PrintJob_PrintQueue", jobsOrderable.getOrderColumn().getTable());
- assertEquals("FOO", jobsOrderable.getOrderColumn().getName());
- assertEquals("PrintJob_PrintQueue", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
-
- JavaManyToManyMapping javaQueuesManyToManyMapping = (JavaManyToManyMapping) queuesPersistentAttribute.getJavaPersistentAttribute().getMapping();
- javaQueuesManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JOIN_TABLE");
- assertEquals("JOIN_TABLE", jobsOrderable.getOrderColumn().getTable());
- assertEquals("FOO", jobsOrderable.getOrderColumn().getName());
- assertEquals("JOIN_TABLE", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany(mappedBy=\"queues\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<test.PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<test.PrintQueue> queues;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- ManyToManyMapping2_0 addressesVirtualMapping = (ManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", ormColumn.getName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertTrue(ormColumn.isInsertable());
- assertTrue(ormColumn.isUpdatable());
- assertTrue(ormColumn.isNullable());
- assertFalse(ormColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getScale());
-
- //set Column annotation in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaManyToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", ormColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", ormColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), ormColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OrmManyToManyMapping2_0 addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaManyToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ManyToManyMapping2_0 addressesVirtualMapping = (ManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column column = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", column.getTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", column.getTable());
-
- //set Column table element in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", column.getTable());
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", column.getTable());
-
- //make name persistent attribute not default
- addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- column = addressesVirtualMapping.getMapKeyColumn();
- assertNull(column.getSpecifiedTable());
- assertEquals("ORM_TABLE_Address", column.getDefaultTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ManyToManyMapping2_0 virtualManyToManyMapping = (ManyToManyMapping2_0) virtualAttribute.getMapping();
- assertEquals("address", virtualManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) virtualManyToManyMapping.getMapKeyConverter()).getEnumType());
-
- Cascade2_0 cascade = (Cascade2_0) virtualManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(virtualManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
- virtualPersistentAttribute.addToXml(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertTrue(ormManyToManyMapping.getMapKeyConverter() instanceof NullOrmConverter);
-
- Cascade2_0 cascade = (Cascade2_0) ormManyToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- manyToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, manyToManyResource.getMapKeyEnumerated());
-
- manyToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- manyToManyResource.setMapKeyEnumerated(null);
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormManyToManyMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
- ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, manyToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, manyToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormManyToManyMapping.setMapKeyConverter(null);
- assertNull(manyToManyResource.getMapKeyEnumerated());
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, manyToManyResource.getMapKeyTemporal());
-
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, manyToManyResource.getMapKeyTemporal());
-
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, manyToManyResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- manyToManyResource.setMapKeyTemporal(null);
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormManyToManyMapping.setMapKeyConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, manyToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, manyToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormManyToManyMapping.setMapKeyConverter(null);
- assertNull(manyToManyResource.getMapKeyTemporal());
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- JoinColumn joinColumn = ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
-
- JoinColumn joinColumn2 = ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
-
- JoinColumn joinColumn3 = ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(2).getName());
-
- ListIterator<? extends JoinColumn> joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToManyResource.getMapKeyJoinColumns().size());
-
- ormManyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, manyToManyResource.getMapKeyJoinColumns().size());
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
-
- ormManyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, manyToManyResource.getMapKeyJoinColumns().size());
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
-
- ormManyToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, manyToManyResource.getMapKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormManyToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, manyToManyResource.getMapKeyJoinColumns().size());
-
-
- ormManyToManyMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(2).getName());
-
-
- ormManyToManyMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", manyToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAR", manyToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", manyToManyResource.getMapKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdateMapKeyJoinColumns() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- ManyToManyMapping2_0 ormManyToManyMapping = (ManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- manyToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- manyToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- manyToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- manyToManyResource.getMapKeyJoinColumns().get(0).setName("FOO");
- manyToManyResource.getMapKeyJoinColumns().get(1).setName("BAR");
- manyToManyResource.getMapKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<? extends JoinColumn> joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().move(2, 0);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().move(0, 1);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- manyToManyResource.getMapKeyJoinColumns().remove(0);
- assertFalse(ormManyToManyMapping.getSpecifiedMapKeyJoinColumns().iterator().hasNext());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java
deleted file mode 100644
index 43afdfdfaf..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmManyToOneMapping2_0Tests.java
+++ /dev/null
@@ -1,673 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmManyToOneMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericOrmManyToOneMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestEntityWithIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEntityWithManyToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testUpdateId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("");
- assertEquals("", resourceMapping.getMapsId());
- assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("");
- assertEquals("", resourceMapping.getMapsId());
- assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testUpdatePredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setMapsId("foo");
- assertNotNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setId(Boolean.TRUE);
- assertNotNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testSetPredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setMapsIdDerivedIdentityStrategy();
- assertNotNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setIdDerivedIdentityStrategy();
- assertNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setNullDerivedIdentityStrategy();
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = (OrmPersistentAttribute) contextType.getAttributeNamed("manyToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
-
- XmlManyToOne resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- resourceManyToOne.setMapsId("foo");
- assertNull(resourceManyToOne.getId());
- assertFalse(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceManyToOne.getMapsId());
- assertEquals("foo", ((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- XmlOneToOne resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- assertNull(resourceOneToOne.getId());
- assertFalse(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceOneToOne.getMapsId());
- assertEquals("foo", ((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- assertNull(resourceManyToOne.getId());
- assertFalse(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceManyToOne.getMapsId());
- assertEquals("foo", ((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidManyToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaManyToOneMapping2_0 javaManyToOneMapping = ((JavaManyToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, virtualJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertEquals(TYPE_NAME + "_Address", virtualJoinTable.getName());
- assertNull(virtualJoinTable.getSpecifiedCatalog());
- assertNull(virtualJoinTable.getSpecifiedSchema());
- assertEquals(0, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn virtualJoinColumn = virtualJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", virtualJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", virtualJoinColumn.getDefaultName());
- assertEquals("id", virtualJoinColumn.getDefaultReferencedColumnName());
- JoinColumn virtualInverseJoinColumn = virtualJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", virtualInverseJoinColumn.getDefaultTable());
- assertEquals("address_id", virtualInverseJoinColumn.getDefaultName());
- assertEquals("id", virtualInverseJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = ((JavaManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", virtualJoinTable.getSpecifiedName());
- assertEquals("CATALOG", virtualJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualJoinTable.getSpecifiedSchema());
- assertEquals(1, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- virtualJoinColumn = virtualJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", virtualJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", virtualJoinColumn.getSpecifiedReferencedColumnName());
- virtualInverseJoinColumn = virtualJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", virtualInverseJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", virtualInverseJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidManyToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping2_0 ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((ManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- OrmJoinTable ormJoinTable = ((OrmManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTestTargetEntityAddress();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- JavaManyToOneMapping2_0 javaManyToOneMapping = (JavaManyToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.removeFromXml();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) virtualPersistentAttribute.getMapping();
- JoinTable virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertTrue(virtualPersistentAttribute.isVirtual());
- assertEquals("JAVA_JOIN_TABLE", virtualJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().removeStrategy();
- virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(virtualJoinTable);
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- virtualJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(virtualJoinTable.getSpecifiedName());
- assertEquals("BAR_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", virtualJoinTable.getDefaultName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationship2_0 rel = (OrmManyToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationship2_0 rel = (OrmManyToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ManyToOneMapping virtualManyToOneMapping = (ManyToOneMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualManyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualManyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualManyToOneMapping.getSpecifiedTargetEntity());
-
- JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) virtualManyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.addToXml(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmManyToOneMapping ormManyToOneMapping = (OrmManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(true, ormManyToOneMapping.isDefaultOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- Cascade2_0 cascade = (Cascade2_0) ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java
deleted file mode 100644
index 357c01c4ce..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToManyMapping2_0Tests.java
+++ /dev/null
@@ -1,1500 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.orm.NullOrmConverter;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlOneToMany_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmOneToManyMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericOrmOneToManyMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithValidOneToManyMapping() throws Exception {
- this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, JPA2_0.MAP_KEY_ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(fetch=FetchType.EAGER, targetEntity=Address.class, orphanRemoval = true, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @MapKeyEnumerated(EnumType.STRING)").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.name", attributeNames.next());
- assertEquals("state.abbr", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.name", attributeNames.next());
- assertEquals("state.abbr", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.name");
- assertEquals("name", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.name", attributeNames.next());
- assertEquals("state.abbr", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.name", attributeNames.next());
- assertEquals("state.abbr", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.name");
- assertEquals("name", stateFooMapping.getName());
- }
- private OrmOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((OrmOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- public void testUpdateSpecifiedOrphanRemoval() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToManyMapping);
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToManyResource.getOrphanRemoval());
-
- //set enumerated in the resource model, verify context model updated
- oneToManyResource.setOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.TRUE, oneToManyResource.getOrphanRemoval());
-
- oneToManyResource.setOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.FALSE, oneToManyResource.getOrphanRemoval());
- }
-
- public void testModifySpecifiedOrphanRemoval() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToManyMapping);
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToManyResource.getOrphanRemoval());
-
- //set enumerated in the context model, verify resource model updated
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToManyResource.getOrphanRemoval());
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToManyResource.getOrphanRemoval());
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNotNull(oneToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKey().setName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey().getName());
-
- oneToMany.getMapKey().setName("myMapKey");
- oneToMany.setMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToManyMapping.getMapKey());
- assertFalse(oneToManyMapping.isPkMapKey());
- assertFalse(oneToManyMapping.isCustomMapKey());
- assertTrue(oneToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setPkMapKey(true);
- assertEquals("id", oneToManyMapping.getMapKey());
- assertTrue(oneToManyMapping.isPkMapKey());
- assertFalse(oneToManyMapping.isCustomMapKey());
- assertFalse(oneToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setCustomMapKey(true);
- javaOneToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("city", oneToManyMapping.getMapKey());
- assertFalse(oneToManyMapping.isPkMapKey());
- assertTrue(oneToManyMapping.isCustomMapKey());
- assertFalse(oneToManyMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", oneToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setSpecifiedMapKey(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(oneToMany.getMapKey().getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").addToXml();
- oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- oneToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNotNull(oneToMany.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKeyClass().setClassName("String");
- assertEquals("String", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", oneToMany.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKeyClass().setClassName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass().getClassName());
-
- oneToMany.getMapKeyClass().setClassName("String");
- oneToMany.setMapKeyClass(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", oneToManyMapping.getMapKeyClass());
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", oneToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", oneToManyMapping.getMapKeyClass());
- assertEquals("Integer", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", oneToMany.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("jobs"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping oneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- oneToManyMapping.getRelationship().setStrategyToMappedBy();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queue");
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- OrmPersistentType printJobPersistentType = (OrmPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
-
- assertEquals("MY_TABLE", orderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("jobs"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("jobs");
- oneToManyMapping = (OneToManyMapping) ormPersistentAttribute2.getMapping();
- orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(false, orderable.isNoOrdering());
- assertEquals("PrintJob", orderable.getOrderColumn().getTable());
- assertEquals("jobs_ORDER", orderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals("PrintJob", orderable.getOrderColumn().getTable());
- assertEquals("FOO", orderable.getOrderColumn().getName());
- }
-
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany(mappedBy=\"queue\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private PrintQueue queue;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 virtualAddressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = virtualAddressesMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_Address", virtualColumn.getTable());
- assertNull(virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaOneToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getName());
- assertEquals("FOO_TABLE", virtualColumn.getTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertFalse(virtualColumn.isInsertable());
- assertFalse(virtualColumn.isUpdatable());
- assertFalse(virtualColumn.isNullable());
- assertTrue(virtualColumn.isUnique());
- assertEquals(45, virtualColumn.getLength());
- assertEquals(46, virtualColumn.getPrecision());
- assertEquals(47, virtualColumn.getScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OrmOneToManyMapping2_0 addressesVirtualMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaOneToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- OneToManyMapping2_0 virtualAddressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = virtualAddressesMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", virtualColumn.getTable());
- assertNull(virtualColumn.getSpecifiedTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", virtualColumn.getTable());
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not default
- addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OneToManyMapping2_0 specifiedAddressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column specifiedColumn = specifiedAddressesMapping.getMapKeyColumn();
- assertNull(specifiedColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE_Address", specifiedColumn.getDefaultTable());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 contextMapping = (OrmOneToManyMapping2_0) contextAttribute.getMapping();
- OrmOneToManyRelationship2_0 rel = (OrmOneToManyRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 contextMapping = (OrmOneToManyMapping2_0) contextAttribute.getMapping();
- OrmOneToManyRelationship2_0 rel = (OrmOneToManyRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testTargetForeignKeyJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- OneToManyRelationship2_0 rr = (OneToManyRelationship2_0) javaOneToManyMapping.getRelationship();
- rr.setStrategyToJoinColumn();
-
- JoinColumn joinColumn = rr.getJoinColumnStrategy().getJoinColumns().iterator().next();
- assertTrue(persistentAttribute.isVirtual());
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("Address", joinColumn.getDefaultTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- //override the mapping in orm.xml
- persistentAttribute.addToXml();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- rr = (OneToManyRelationship2_0) oneToManyMapping.getRelationship();
- assertFalse(rr.strategyIsJoinColumn());
-
- rr.setStrategyToJoinColumn();
- joinColumn = rr.getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertFalse(persistentAttribute.isVirtual());
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- joinColumn.setSpecifiedName("FOO");
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
- }
-
- //target foreign key case
- public void testGetMapKeyColumnJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- OneToManyRelationship2_0 rr = (OneToManyRelationship2_0) javaOneToManyMapping.getRelationship();
- rr.setStrategyToJoinColumn();
-
- assertTrue(persistentAttribute.isVirtual());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getDefaultTable());
-
- //override the mapping in orm.xml
- persistentAttribute.addToXml();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- rr = (OneToManyRelationship2_0) oneToManyMapping.getRelationship();
- assertFalse(rr.strategyIsJoinColumn());
-
- rr.setStrategyToJoinColumn();
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- oneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("FOO", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getDefaultTable());
- }
-
- //target foreign key case
- public void testOrderColumnDefaultsJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- OneToManyRelationship2_0 rr = (OneToManyRelationship2_0) javaOneToManyMapping.getRelationship();
- rr.setStrategyToJoinColumn();
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn();
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals("Address", orderColumn.getTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());
-
- //override the mapping in orm.xml
- persistentAttribute.addToXml();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- oneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- rr = (OneToManyRelationship2_0) oneToManyMapping.getRelationship();
- assertFalse(rr.strategyIsJoinColumn());
-
- rr.setStrategyToJoinColumn();
- assertFalse(((Orderable2_0) oneToManyMapping.getOrderable()).isOrderColumnOrdering());
- ((Orderable2_0) oneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn();
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", orderColumn.getTable());//target table name
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) virtualOneToManyMapping.getMapKeyConverter()).getEnumType());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertTrue(((OrphanRemovalHolder2_0) virtualOneToManyMapping).getOrphanRemoval().isOrphanRemoval());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.addToXml(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormOneToManyMapping.getFetch());
- assertEquals("test.Address", ormOneToManyMapping.getTargetEntity());
- assertNull(ormOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertTrue(ormOneToManyMapping.getMapKeyConverter() instanceof NullOrmConverter);
-
- Cascade2_0 cascade = (Cascade2_0) ormOneToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertTrue(ormOneToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertFalse(((OrmOrphanRemovalHolder2_0) ormOneToManyMapping).getOrphanRemoval().isOrphanRemoval());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- oneToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, oneToManyResource.getMapKeyEnumerated());
-
- oneToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- oneToManyResource.setMapKeyEnumerated(null);
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormOneToManyMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
- ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, oneToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, oneToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormOneToManyMapping.setMapKeyConverter(null);
- assertNull(oneToManyResource.getMapKeyEnumerated());
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, oneToManyResource.getMapKeyTemporal());
-
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, oneToManyResource.getMapKeyTemporal());
-
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, oneToManyResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- oneToManyResource.setMapKeyTemporal(null);
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormOneToManyMapping.setMapKeyConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, oneToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, oneToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormOneToManyMapping.setMapKeyConverter(null);
- assertNull(oneToManyResource.getMapKeyTemporal());
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testAddSpecifiedMapKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OneToManyMapping2_0 ormOneToManyMapping = (OneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- JoinColumn joinColumn = ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
-
- JoinColumn joinColumn2 = ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
-
- JoinColumn joinColumn3 = ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(2).getName());
-
- ListIterator<? extends JoinColumn> joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OneToManyMapping2_0 ormOneToManyMapping = (OneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToManyResource.getMapKeyJoinColumns().size());
-
- ormOneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(2, oneToManyResource.getMapKeyJoinColumns().size());
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
-
- ormOneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(1, oneToManyResource.getMapKeyJoinColumns().size());
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
-
- ormOneToManyMapping.removeSpecifiedMapKeyJoinColumn(0);
- assertEquals(0, oneToManyResource.getMapKeyJoinColumns().size());
- }
-
- public void testMoveSpecifiedMapKeyJoinColumn() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OneToManyMapping2_0 ormOneToManyMapping = (OneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(0).setSpecifiedName("FOO");
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(1).setSpecifiedName("BAR");
- ormOneToManyMapping.addSpecifiedMapKeyJoinColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, oneToManyResource.getMapKeyJoinColumns().size());
-
-
- ormOneToManyMapping.moveSpecifiedMapKeyJoinColumn(2, 0);
- ListIterator<? extends JoinColumn> joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(2).getName());
-
-
- ormOneToManyMapping.moveSpecifiedMapKeyJoinColumn(0, 1);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", oneToManyResource.getMapKeyJoinColumns().get(0).getName());
- assertEquals("BAR", oneToManyResource.getMapKeyJoinColumns().get(1).getName());
- assertEquals("FOO", oneToManyResource.getMapKeyJoinColumns().get(2).getName());
- }
-
- public void testUpdateMapKeyJoinColumns() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OneToManyMapping2_0 ormOneToManyMapping = (OneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- oneToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- oneToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- oneToManyResource.getMapKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- oneToManyResource.getMapKeyJoinColumns().get(0).setName("FOO");
- oneToManyResource.getMapKeyJoinColumns().get(1).setName("BAR");
- oneToManyResource.getMapKeyJoinColumns().get(2).setName("BAZ");
-
- ListIterator<? extends JoinColumn> joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().move(2, 0);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().move(0, 1);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().remove(1);
- joinColumns = ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- oneToManyResource.getMapKeyJoinColumns().remove(0);
- assertFalse(ormOneToManyMapping.getSpecifiedMapKeyJoinColumns().iterator().hasNext());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java
deleted file mode 100644
index a4e2ade0a5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmOneToOneMapping2_0Tests.java
+++ /dev/null
@@ -1,992 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmDerivedIdentity2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmOneToOneMapping2_0Tests
- extends Generic2_0ContextModelTestCase
-{
- public GenericOrmOneToOneMapping2_0Tests(String name) {
- super(name);
- }
-
-
- private void createTestEntityWithIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private void createTestEntityWithOneToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, orphanRemoval = true, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testUpdateId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("");
- assertEquals("", resourceMapping.getMapsId());
- assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("");
- assertEquals("", resourceMapping.getMapsId());
- assertEquals("", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testUpdatePredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setId(Boolean.TRUE);
- assertNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setMapsId("foo");
- assertNotNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setId(null);
- assertNotNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testSetPredominantDerivedIdentityStrategy() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmDerivedIdentity2_0 derivedIdentity = contextMapping.getDerivedIdentity();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setIdDerivedIdentityStrategy();
- assertNull(resourceMapping.getMapsId());
- assertNotNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setMapsIdDerivedIdentityStrategy();
- assertNotNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertTrue(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesNullDerivedIdentityStrategy());
-
- derivedIdentity.setNullDerivedIdentityStrategy();
- assertNull(resourceMapping.getMapsId());
- assertNull(resourceMapping.getId());
- assertFalse(derivedIdentity.usesMapsIdDerivedIdentityStrategy());
- assertFalse(derivedIdentity.usesIdDerivedIdentityStrategy());
- assertTrue(derivedIdentity.usesNullDerivedIdentityStrategy());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = (OrmPersistentAttribute) contextType.getAttributeNamed("oneToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
-
- XmlOneToOne resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- resourceOneToOne.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceOneToOne.getId());
- assertTrue(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceOneToOne.getMapsId());
- assertNull(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- XmlManyToOne resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- assertEquals(Boolean.TRUE, resourceManyToOne.getId());
- assertTrue(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceManyToOne.getMapsId());
- assertNull(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- assertEquals(Boolean.TRUE, resourceOneToOne.getId());
- assertTrue(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceOneToOne.getMapsId());
- assertNull(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames = oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
- private OrmOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((OrmOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- public void testUpdateSpecifiedOrphanRemoval() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToOneMapping);
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToOneResource.getOrphanRemoval());
-
- //set enumerated in the resource model, verify context model updated
- oneToOneResource.setOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.TRUE, oneToOneResource.getOrphanRemoval());
-
- oneToOneResource.setOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.FALSE, oneToOneResource.getOrphanRemoval());
- }
-
- public void testModifySpecifiedOrphanRemoval() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToOneMapping);
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToOneResource.getOrphanRemoval());
-
- //set enumerated in the context model, verify resource model updated
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneResource.getOrphanRemoval());
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneResource.getOrphanRemoval());
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidOneToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaOneToOneMapping2_0 javaOneToOneMapping = ((JavaOneToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- JavaOneToOneMapping2_0 virtualOneToOneMapping = (JavaOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, virtualJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertNull(virtualJoinTable.getSpecifiedName());
- assertEquals(TYPE_NAME + "_Address", virtualJoinTable.getDefaultName());
- assertNull(virtualJoinTable.getSpecifiedCatalog());
- assertNull(virtualJoinTable.getSpecifiedSchema());
- assertEquals(0, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn ormJoinColumn = virtualJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", ormJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", ormJoinColumn.getDefaultName());
- assertEquals("id", ormJoinColumn.getDefaultReferencedColumnName());
- JoinColumn inverseOrmJoinColumn = virtualJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", inverseOrmJoinColumn.getDefaultTable());
- assertEquals("address_id", inverseOrmJoinColumn.getDefaultName());
- assertEquals("id", inverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = ((JavaOneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", virtualJoinTable.getSpecifiedName());
- assertEquals("CATALOG", virtualJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualJoinTable.getSpecifiedSchema());
- assertEquals(1, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- ormJoinColumn = virtualJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- inverseOrmJoinColumn = virtualJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", inverseOrmJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", inverseOrmJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidOneToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((OneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- OrmJoinTable ormJoinTable = ((OrmOneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTestTargetEntityAddress();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- JavaOneToOneMapping2_0 javaOneToOneMapping = (JavaOneToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.removeFromXml();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute virtualAttribute = ormPersistentType.getAttributeNamed("address");
- OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) virtualAttribute.getMapping();
- JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertTrue(virtualAttribute.isVirtual());
- assertEquals("JAVA_JOIN_TABLE", virtualJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().removeStrategy();
- virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(virtualJoinTable);
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals("BAR_FOO", virtualJoinTable.getName());
- assertNull(virtualJoinTable.getSpecifiedName());
- assertEquals("BAR_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", virtualJoinTable.getDefaultName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationship2_0 rel = (OrmOneToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationship2_0 rel = (OrmOneToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getPrimaryKeyJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualOneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToOneMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- JoinColumn virtualJoinColumn =
- virtualOneToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(((OrphanRemovalHolder2_0) virtualOneToOneMapping).getOrphanRemoval().isOrphanRemoval());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.addToXml(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OneToOneMapping2_0 ormOneToOneMapping = (OneToOneMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertFalse(((OrmOrphanRemovalHolder2_0) ormOneToOneMapping).getOrphanRemoval().isOrphanRemoval());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0Tests.java
deleted file mode 100644
index 28786fb284..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentAttribute2_0Tests.java
+++ /dev/null
@@ -1,565 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmPersistentAttribute2_0Tests
- extends Generic2_0ContextModelTestCase
-{
-
- public GenericOrmPersistentAttribute2_0Tests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestTypeNullAttributeMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMappingPropertyAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(" private Address address;");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedFieldPropertySpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.PROPERTY)");
- }
-
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testMakeSpecified() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.addToXml();
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ormPersistentAttribute.addToXml();
-
- assertEquals(0, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeSpecifiedWithAccess() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = CollectionTools.get(ormPersistentType.getDefaultAttributes(), 1);
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertEquals(null, ormPersistentAttribute.getJavaPersistentAttribute().getSpecifiedAccess());
- ormPersistentAttribute.addToXml();
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertEquals(null, specifiedOrmPersistentAttribute.getSpecifiedAccess());
- assertEquals(AccessType.PROPERTY, specifiedOrmPersistentAttribute.getAccess());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("name", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- ormPersistentAttribute.addToXml();
-
- assertEquals(0, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, specifiedOrmPersistentAttribute.getAccess());
- assertEquals(null, specifiedOrmPersistentAttribute.getSpecifiedAccess());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, specifiedOrmPersistentAttribute.getSpecifiedAccess());
- }
-
- public void testMakeSpecifiedMappingKey() throws Exception {
- createTestTypeNullAttributeMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertTrue(ormPersistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- ormPersistentAttribute.addToXml(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmOneToOneMapping);
-
-
- ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ormPersistentAttribute.addToXml(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmIdMapping);
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeVirtual() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
-
- assertEquals(0, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- assertEquals(0, ormPersistentType.getSpecifiedAttributesSize());
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- }
-
- public void testMakeVirtualNoUnderlyingJavaAttribute() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
-
-
- ormPersistentType.getSpecifiedAttributes().iterator().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.getDefaultAttributes().iterator().next().getName());
- assertEquals("name", ormPersistentType.getSpecifiedAttributes().iterator().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("id", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete2() throws Exception {
- createTestEntityOneToOneMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- }
-
- public void testGetJavaPersistentAttribute() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- //virtual orm attribute, access type matches java : FIELD, name matches java
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- JavaResourceAttribute javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertTrue(javaResourceAttribute.getKind() == Kind.FIELD);
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getFields().iterator().next(), javaResourceAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- //virtual orm attribute, java access type FIELD, orm access type PROPERTY, name matches java
- //verify both the property java resource attribute and the field java resource attribute are used in orm
- //because the field is annotated and property is specified
- ((OrmPersistentAttribute) ormPersistentAttribute).removeFromXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute idFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute idPropertyAttribute = attributes.next();
- assertEquals(ormPersistentAttribute, idFieldAttribute);
- assertNotSame(ormPersistentAttribute, idPropertyAttribute);
- ormPersistentAttribute = idPropertyAttribute;
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, idFieldAttribute.getJavaPersistentAttribute().getAccess());
- javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getMethods().iterator().next(), javaResourceAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmPersistentAttribute ormPersistentAttribute2 = ormPersistentAttribute.addToXml();
- ormPersistentAttribute2.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
- }
-
- public void testGetJavaPersistentAttributeMixedAccess() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute ormFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute ormPropertyAttribute = attributes.next();
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertEquals(AccessType.FIELD, ormFieldAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPropertyAttribute.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getOwningPersistentType().getAccess());
- assertTrue(ormFieldAttribute.isVirtual());
- assertTrue(ormPropertyAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormFieldAttribute.getMappingKey());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPropertyAttribute.getMappingKey());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
-
- ormPropertyAttribute.addToXml();
- ormPropertyAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPropertyAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPropertyAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertTrue(ormPropertyAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
- ((OrmPersistentAttribute) ormPropertyAttribute).setSpecifiedAccess(AccessType.FIELD);
- ormPropertyAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPropertyAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPropertyAttribute.getAccess());
- assertEquals(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertTrue(ormPropertyAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- }
-
- public void testGetAccess() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- }
-
- public void testGetAccessPropertyInJava() throws Exception {
- createTestEntityIdMappingPropertyAccess();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
- }
-
- public void testGetAccessPropertyInJava2() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- OrmReadOnlyPersistentAttribute nameOrmPersistentAttribute = ormPersistentType.getAttributeNamed("name");
- JavaPersistentAttribute nameJavaPersistentAttribute = javaPersistentType.getAttributeNamed("name");
-
- assertTrue(nameOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getAccess());
- assertTrue(nameOrmPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, nameJavaPersistentAttribute.getAccess());
- assertTrue(nameJavaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
- nameOrmPersistentAttribute.addToXml();
- nameOrmPersistentAttribute = ormPersistentType.getAttributeNamed("name");
- assertFalse(nameOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getAccess());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertTrue(nameOrmPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, nameJavaPersistentAttribute.getAccess());
- assertTrue(nameJavaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(nameJavaPersistentAttribute, nameOrmPersistentAttribute.getJavaPersistentAttribute());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
- assertFalse(nameOrmPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, nameOrmPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, nameOrmPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, nameJavaPersistentAttribute.getAccess());
- assertTrue(nameJavaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentType2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentType2_0Tests.java
deleted file mode 100644
index 12901a4fcf..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmPersistentType2_0Tests.java
+++ /dev/null
@@ -1,285 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class GenericOrmPersistentType2_0Tests
- extends Generic2_0ContextModelTestCase
-{
-
- public GenericOrmPersistentType2_0Tests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedFieldPropertySpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.PROPERTY)");
- }
-
- @Override
- public void appendNameFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- sb.append("@Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityFieldSpecifiedPropertyAnnotated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.FIELD)");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityPropertySpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- public void testGetAccessWithJavaAnnotations() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(null, javaPersistentType.getSpecifiedAccess());
-
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.addToXml();
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(null, javaPersistentType.getSpecifiedAccess());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
- public void testGetAccessWithJavaAnnotationsProperty() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, ormPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getSpecifiedAccess());
-
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.addToXml();
- assertEquals(AccessType.PROPERTY, ormPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getSpecifiedAccess());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
- }
-
- public void testVirtualAttributes() throws Exception {
- createTestEntityAnnotatedFieldPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
- assertEquals("name", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
-
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
-
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("name", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
- }
-
- public void testVirtualAttributes2() throws Exception {
- createTestEntityPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
-
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("name", ormPersistentAttribute.getName());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
- virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- ormPersistentAttribute = virtualAttributes.next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
- }
-
- public void testVirtualAttributes3() throws Exception {
- createTestEntityFieldSpecifiedPropertyAnnotated();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- assertEquals(AccessType.PROPERTY, virtualAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
-
- virtualAttribute.addToXml();
-
- virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
-
-
- OrmPersistentAttribute specifiedAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedAttribute.getName());
- assertEquals(AccessType.PROPERTY, specifiedAttribute.getSpecifiedAccess());
-
-
- virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- virtualAttributes.next();
- virtualAttributes.next().addToXml();
- virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- assertEquals(AccessType.FIELD, virtualAttribute.getAccess());
-
- assertFalse(virtualAttributes.hasNext());
- }
-
- public void testGetDefaultAccess() throws Exception {
- createTestEntityPropertySpecified();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
- javaPersistentType.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-
- javaPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0Tests.java
deleted file mode 100644
index 527e131e50..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/orm/GenericOrmSequenceGenerator2_0Tests.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.orm;
-
-import org.eclipse.jpt.jpa.core.jpa2.context.SequenceGenerator2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlSequenceGenerator;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-/**
- * Generic2_0OrmSequenceGenerator2_0Tests
- */
-@SuppressWarnings("nls")
-public class GenericOrmSequenceGenerator2_0Tests
- extends Generic2_0ContextModelTestCase
-{
-
- public GenericOrmSequenceGenerator2_0Tests(String name) {
- super(name);
- }
-
- // ********** catalog **********
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setCatalog("FOO");
- assertEquals("FOO", sequenceGenerator.getSpecifiedCatalog());
- assertEquals("FOO", sequenceGeneratorResource.getCatalog());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setCatalog(null);
- assertNull(sequenceGenerator.getSpecifiedCatalog());
- assertNull(sequenceGeneratorResource.getCatalog());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedCatalog("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getCatalog());
- assertEquals("FOO", sequenceGenerator.getSpecifiedCatalog());
-
- //set name to null in the context model
- sequenceGenerator.setSpecifiedCatalog(null);
- assertNull(sequenceGeneratorResource.getCatalog());
- assertNull(sequenceGenerator.getSpecifiedCatalog());
- }
-
- // ********** schema **********
-
- public void testUpdateSpecifiedSchema() throws Exception {
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the resource model, verify context model updated
- sequenceGeneratorResource.setSchema("FOO");
- assertEquals("FOO", sequenceGenerator.getSpecifiedSchema());
- assertEquals("FOO", sequenceGeneratorResource.getSchema());
-
- //set name to null in the resource model
- sequenceGeneratorResource.setSchema(null);
- assertNull(sequenceGenerator.getSpecifiedSchema());
- assertNull(sequenceGeneratorResource.getSchema());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- SequenceGenerator2_0 sequenceGenerator = (SequenceGenerator2_0) getEntityMappings().addSequenceGenerator(0);
- XmlSequenceGenerator sequenceGeneratorResource = getXmlEntityMappings().getSequenceGenerators().get(0);
-
- //set name in the context model, verify resource model modified
- sequenceGenerator.setSpecifiedSchema("FOO");
- assertEquals("FOO", sequenceGeneratorResource.getSchema());
- assertEquals("FOO", sequenceGenerator.getSpecifiedSchema());
-
- //set name to null in the context model
- sequenceGenerator.setSpecifiedSchema(null);
- assertNull(sequenceGeneratorResource.getSchema());
- assertNull(sequenceGenerator.getSpecifiedSchema());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0ConnectionTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0ConnectionTests.java
deleted file mode 100644
index a913b9e229..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0ConnectionTests.java
+++ /dev/null
@@ -1,186 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-
-/**
- * GenericConnection2_0Tests
- */
-@SuppressWarnings("nls")
-public class Generic2_0ConnectionTests extends Generic2_0PersistenceUnitTests
-{
- private JpaConnection2_0 connection;
-
- public static final String DRIVER_KEY = JpaConnection2_0.PERSISTENCE_JDBC_DRIVER;
- public static final String DRIVER_TEST_VALUE = "test";
- public static final String DRIVER_TEST_VALUE_2 = "test_2";
-
- public static final String URL_KEY = JpaConnection2_0.PERSISTENCE_JDBC_URL;
- public static final String URL_TEST_VALUE = "test";
- public static final String URL_TEST_VALUE_2 = "test_2";
-
- public static final String USER_KEY = JpaConnection2_0.PERSISTENCE_JDBC_USER;
- public static final String USER_TEST_VALUE = "test";
- public static final String USER_TEST_VALUE_2 = "test_2";
-
- public static final String PASSWORD_KEY = JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD;
- public static final String PASSWORD_TEST_VALUE = "test";
- public static final String PASSWORD_TEST_VALUE_2 = "test_2";
-
- // ********** constructors **********
- public Generic2_0ConnectionTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.connection = (JpaConnection2_0) this.subject.getConnection();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.connection.addPropertyChangeListener(JpaConnection2_0.DRIVER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(JpaConnection2_0.URL_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(JpaConnection2_0.USER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(JpaConnection2_0.PASSWORD_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PersistenceUnit properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 4; // PersistenceUnit properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 1 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes PersistenceUnit properties
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(DRIVER_KEY, DRIVER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(URL_KEY, URL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(USER_KEY, USER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(PASSWORD_KEY, PASSWORD_TEST_VALUE.toString());
-
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.connection;
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(JpaConnection2_0.DRIVER_PROPERTY))
- modelValue = this.connection.getDriver();
- else if (propertyName.equals(JpaConnection2_0.URL_PROPERTY))
- modelValue = this.connection.getUrl();
- else if (propertyName.equals(JpaConnection2_0.USER_PROPERTY))
- modelValue = this.connection.getUser();
- else if (propertyName.equals(JpaConnection2_0.PASSWORD_PROPERTY))
- modelValue = this.connection.getPassword();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(JpaConnection2_0.DRIVER_PROPERTY))
- this.connection.setDriver((String) newValue);
- else if (propertyName.equals(JpaConnection2_0.URL_PROPERTY))
- this.connection.setUrl((String) newValue);
- else if (propertyName.equals(JpaConnection2_0.USER_PROPERTY))
- this.connection.setUser((String) newValue);
- else if (propertyName.equals(JpaConnection2_0.PASSWORD_PROPERTY))
- this.connection.setPassword((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- // ********** Driver tests **********
- public void testSetDriver() throws Exception {
- this.verifyModelInitialized(
- DRIVER_KEY,
- DRIVER_TEST_VALUE);
- this.verifySetProperty(
- DRIVER_KEY,
- DRIVER_TEST_VALUE,
- DRIVER_TEST_VALUE_2);
- }
-
- public void testAddRemoveDriver() throws Exception {
- this.verifyAddRemoveProperty(
- DRIVER_KEY,
- DRIVER_TEST_VALUE,
- DRIVER_TEST_VALUE_2);
- }
-
- // ********** Url tests **********
- public void testSetUrl() throws Exception {
- this.verifyModelInitialized(
- URL_KEY,
- URL_TEST_VALUE);
- this.verifySetProperty(
- URL_KEY,
- URL_TEST_VALUE,
- URL_TEST_VALUE_2);
- }
-
- public void testAddRemoveUrl() throws Exception {
- this.verifyAddRemoveProperty(
- URL_KEY,
- URL_TEST_VALUE,
- URL_TEST_VALUE_2);
- }
-
- // ********** User tests **********
- public void testSetUser() throws Exception {
- this.verifyModelInitialized(
- USER_KEY,
- USER_TEST_VALUE);
- this.verifySetProperty(
- USER_KEY,
- USER_TEST_VALUE,
- USER_TEST_VALUE_2);
- }
-
- public void testAddRemoveUser() throws Exception {
- this.verifyAddRemoveProperty(
- USER_KEY,
- USER_TEST_VALUE,
- USER_TEST_VALUE_2);
- }
-
- // ********** Password tests **********
- public void testSetPassword() throws Exception {
- this.verifyModelInitialized(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE);
- this.verifySetProperty(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE,
- PASSWORD_TEST_VALUE_2);
- }
-
- public void testAddRemovePassword() throws Exception {
- this.verifyAddRemoveProperty(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE,
- PASSWORD_TEST_VALUE_2);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0JpaMetadataConversionTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0JpaMetadataConversionTests.java
deleted file mode 100644
index 8e84da3f7c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0JpaMetadataConversionTests.java
+++ /dev/null
@@ -1,650 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.JpaNamedContextNode;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedNativeQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmNamedQuery;
-import org.eclipse.jpt.jpa.core.context.orm.OrmQueryHint;
-import org.eclipse.jpt.jpa.core.context.orm.OrmSequenceGenerator;
-import org.eclipse.jpt.jpa.core.context.orm.OrmTableGenerator;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.jpa2.context.orm.GenericOrmSequenceGenerator2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.LockModeType2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmNamedQuery2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.Generic2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class Generic2_0JpaMetadataConversionTests extends
- Generic2_0ContextModelTestCase {
-
- private IProgressMonitor progressMonitor;
-
- public Generic2_0JpaMetadataConversionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.progressMonitor = new IProgressMonitor() {
- public void worked(int work) {}
- public void subTask(String name) {}
- public void setTaskName(String name) {}
- public void setCanceled(boolean value) {}
- public boolean isCanceled() {return false;}
- public void internalWorked(double work) {}
- public void done() {}
- public void beginTask(String name, int totalWork) {}
- } ;
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.progressMonitor = null;
- super.tearDown();
- }
-
- // ************ entity with queries*************
-
- private ICompilationUnit createTestEntityWithNamedQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_QUERIES, JPA.NAMED_QUERY, JPA.QUERY_HINT, JPA2_0.LOCK_MODE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQueries({" +
- "@NamedQuery(name=\"nq1\", query=\"abcd\", lockMode=LockModeType.OPTIMISTIC, " +
- "hints={@QueryHint(name=\"nq1hint1\", value = \"aaa\"), " +
- "@QueryHint(name=\"nq1hint2\", value=\"bbb\")}), " +
- "@NamedQuery(name=\"nq2\", query=\"efgh\", lockMode=LockModeType.READ, " +
- "hints=@QueryHint(name=\"nq2hint1\", value=\"ccc\"))})");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNamedNativeQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedNativeQueries({" +
- "@NamedNativeQuery(name=\"nnq1\", query=\"abcd\", resultClass=foo1.class, resultSetMapping=\"bar1\", " +
- "hints={@QueryHint(name=\"nnq1hint1\", value = \"aaa\"), " +
- "@QueryHint(name=\"nnq1hint2\", value=\"bbb\")}), " +
- "@NamedNativeQuery(name=\"nnq2\", query=\"efgh\", resultClass=foo2.class, resultSetMapping=\"bar2\", " +
- "hints=@QueryHint(name=\"nnq2hint1\", value=\"ccc\"))})");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDuplicateQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.NAMED_QUERY, JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQuery(name=\"query\")").append(CR);
- sb.append("@NamedNativeQueries({@NamedNativeQuery(name=\"query\"), @NamedNativeQuery(name=\"nnq\")})");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.NAMED_QUERIES, JPA.NAMED_QUERY, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQueries({@NamedQuery(name=\"nq\"), @NamedQuery(name=\"query\")})").append(CR);
- sb.append("@NamedNativeQuery(name=\"nnq\")");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperWithNamedQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.NAMED_QUERIES, JPA.NAMED_QUERY, JPA.QUERY_HINT, JPA2_0.LOCK_MODE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@NamedQueries({" +
- "@NamedQuery(name=\"nq1\", query=\"abcd\", lockMode=LockModeType.OPTIMISTIC, " +
- "hints={@QueryHint(name=\"nq1hint1\", value = \"aaa\"), " +
- "@QueryHint(name=\"nq1hint2\", value=\"bbb\")}), " +
- "@NamedQuery(name=\"nq2\", query=\"efgh\", lockMode=LockModeType.READ, " +
- "hints=@QueryHint(name=\"nq2hint1\", value=\"ccc\"))})");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithNamedNativeQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@NamedNativeQueries({" +
- "@NamedNativeQuery(name=\"nnq1\", query=\"abcd\", resultClass=foo1.class, resultSetMapping=\"bar1\", " +
- "hints={@QueryHint(name=\"nnq1hint1\", value = \"aaa\"), " +
- "@QueryHint(name=\"nnq1hint2\", value=\"bbb\")}), " +
- "@NamedNativeQuery(name=\"nnq2\", query=\"efgh\", resultClass=foo2.class, resultSetMapping=\"bar2\", " +
- "hints=@QueryHint(name=\"nnq2hint1\", value=\"ccc\"))})");
- }
- });
- }
-
- public void testConvertNamedQueriesOnEntity() throws Exception {
- createTestEntityWithNamedQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaQueries(entityMappings, progressMonitor);
-
- // test Java queries are converted to orm.xml and removed from the Java entity
- assertEquals(2, entityMappings.getQueryContainer().getNamedQueriesSize());
- assertEquals(0, entity.getQueryContainer().getNamedQueriesSize());
-
- // test the mapping file queries have correct values
- ListIterator<OrmNamedQuery> namedQueries= entityMappings.getQueryContainer().getNamedQueries().iterator();
- OrmNamedQuery nq1 = namedQueries.next();
-
- // test the first mapping file query
- assertEquals("nq1", (nq1.getName()));
- assertEquals("abcd", (nq1.getQuery()));
- assertEquals(2, (nq1.getHintsSize()));
-
- // test the query hints of the first mapping file query have the correct value
- ListIterator<OrmQueryHint> nq1hints = nq1.getHints().iterator();
-
- // test the first query hint of the first mapping file query
- OrmQueryHint nq1hint1 = nq1hints.next();
- assertEquals("nq1hint1", nq1hint1.getName());
- assertEquals("aaa", nq1hint1.getValue());
-
- // test the second query hint of the first mapping file query
- OrmQueryHint nq1hint2 = nq1hints.next();
- assertEquals("nq1hint2", nq1hint2.getName());
- assertEquals("bbb", nq1hint2.getValue());
-
- // test the second mapping file query
- OrmNamedQuery nq2 = namedQueries.next();
- assertEquals("nq2", (nq2.getName()));
- assertEquals("efgh", (nq2.getQuery()));
- assertEquals(1, (nq2.getHintsSize()));
-
- // test the query hints of the second mapping file query have the correct value
- OrmQueryHint nq2hint1 = nq2.getHints().iterator().next();
-
- // test the query hint of the second mapping file query
- assertEquals("nq2hint1", nq2hint1.getName());
- assertEquals("ccc", nq2hint1.getValue());
-
- assertEquals(LockModeType2_0.OPTIMISTIC, ((OrmNamedQuery2_0)nq1).getLockMode());
- assertEquals(LockModeType2_0.READ, ((OrmNamedQuery2_0)nq2).getLockMode());
- }
-
- public void testConvertNamedNativeQueriesOnEntity() throws Exception {
- createTestEntityWithNamedNativeQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaQueries(entityMappings, progressMonitor);
-
- // test Java queries are converted to orm.xml and removed from the Java entity
- assertEquals(2, entityMappings.getQueryContainer().getNamedNativeQueriesSize());
- assertEquals(0, entity.getQueryContainer().getNamedNativeQueriesSize());
-
- // test the mapping file queries have correct values
- Collection<OrmNamedNativeQuery> namedNativeQueries = CollectionTools.collection(entityMappings.getQueryContainer().getNamedNativeQueries());
-
- // test the first mapping file query
- OrmNamedNativeQuery nnq1 = selectNodeNamed(namedNativeQueries, "nnq1");
- assertEquals("nnq1", (nnq1.getName()));
- assertEquals("abcd", (nnq1.getQuery()));
- assertEquals("foo1", nnq1.getResultClass());
- assertEquals("bar1", nnq1.getResultSetMapping());
- assertEquals(2, (nnq1.getHintsSize()));
-
- // test the query hints of the first mapping file query have the correct value
- ListIterator<OrmQueryHint> nq1hints = nnq1.getHints().iterator();
-
- // test the first query hint of the first mapping file query
- OrmQueryHint nnq1hint1 = nq1hints.next();
- assertEquals("nnq1hint1", nnq1hint1.getName());
- assertEquals("aaa", nnq1hint1.getValue());
-
- // test the second query hint of the first mapping file query
- OrmQueryHint nnq1hint2 = nq1hints.next();
- assertEquals("nnq1hint2", nnq1hint2.getName());
- assertEquals("bbb", nnq1hint2.getValue());
-
- // test the second mapping file query
- OrmNamedNativeQuery nnq2 = selectNodeNamed(namedNativeQueries, "nnq2");
- assertEquals("nnq2", (nnq2.getName()));
- assertEquals("efgh", (nnq2.getQuery()));
- assertEquals("foo2", nnq2.getResultClass());
- assertEquals("bar2", nnq2.getResultSetMapping());
- assertEquals(1, (nnq2.getHintsSize()));
-
- // test the query hints of the second mapping file query have the correct value
- OrmQueryHint nnq2hint1 = nnq2.getHints().iterator().next();
-
- // test the query hint of the second mapping file query
- assertEquals("nnq2hint1", nnq2hint1.getName());
- assertEquals("ccc", nnq2hint1.getValue());
-
- }
-
- public static <N extends JpaNamedContextNode> N selectNodeNamed(Iterable<N> nodes, String name) {
- for (N node : nodes) {
- if (node.getName().equals(name)) {
- return node;
- }
- }
- return null;
- }
-
- public void testConvertOverriddenQueries() throws Exception {
- createTestEntityWithQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
- OrmNamedNativeQuery nnq = entityMappings.getQueryContainer().addNamedNativeQuery();
- nnq.setName("nq");
- OrmNamedQuery nq = entityMappings.getQueryContainer().addNamedQuery();
- nq.setName("nnq");
-
- JavaEntity entity = getJavaEntity();
- persistenceUnit.convertJavaQueries(entityMappings, progressMonitor);
-
- // test overridden Java queries are not converted to orm.xml and not
- // removed from the Java entity, but unique query is
- assertEquals(1, entity.getQueryContainer().getNamedQueriesSize());
- assertEquals(1, entity.getQueryContainer().getNamedNativeQueriesSize());
- assertEquals(2, entityMappings.getQueryContainer().getNamedQueriesSize());
- assertEquals(1, entityMappings.getQueryContainer().getNamedNativeQueriesSize());
- }
-
- public void testConvertDuplicateQueries() throws Exception {
- createTestEntityWithDuplicateQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
- persistenceUnit.convertJavaQueries(entityMappings, progressMonitor);
-
- JavaEntity entity = getJavaEntity();
-
- // test duplicate Java queries are not converted to orm.xml and
- // not removed from the Java entity, but unique query is
- assertEquals(1, entity.getQueryContainer().getNamedQueriesSize());
- assertEquals(1, entity.getQueryContainer().getNamedNativeQueriesSize());
- assertEquals(0, entityMappings.getQueryContainer().getNamedQueriesSize());
- assertEquals(1, entityMappings.getQueryContainer().getNamedNativeQueriesSize());
- }
-
- public void testConvertNamedQueriesOnMappedSuperclass() throws Exception {
- createTestMappedSuperWithNamedQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaMappedSuperclass mappedSuperclass = (JavaMappedSuperclass) getJavaPersistentType().getMapping();
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaQueries(entityMappings, progressMonitor);
-
- // test Java queries are converted to orm.xml and removed from the Java entity
- assertEquals(2, entityMappings.getQueryContainer().getNamedQueriesSize());
- assertEquals(0, mappedSuperclass.getQueryContainer().getNamedQueriesSize());
-
- // test the mapping file queries have correct values
- ListIterator<OrmNamedQuery> namedQueries= entityMappings.getQueryContainer().getNamedQueries().iterator();
- OrmNamedQuery nq1 = namedQueries.next();
-
- // test the first mapping file query
- assertEquals("nq1", (nq1.getName()));
- assertEquals("abcd", (nq1.getQuery()));
- assertEquals(2, (nq1.getHintsSize()));
-
- // test the query hints of the first mapping file query have the correct value
- ListIterator<OrmQueryHint> nq1hints = nq1.getHints().iterator();
-
- // test the first query hint of the first mapping file query
- OrmQueryHint nq1hint1 = nq1hints.next();
- assertEquals("nq1hint1", nq1hint1.getName());
- assertEquals("aaa", nq1hint1.getValue());
-
- // test the second query hint of the first mapping file query
- OrmQueryHint nq1hint2 = nq1hints.next();
- assertEquals("nq1hint2", nq1hint2.getName());
- assertEquals("bbb", nq1hint2.getValue());
-
- // test the second mapping file query
- OrmNamedQuery nq2 = namedQueries.next();
- assertEquals("nq2", (nq2.getName()));
- assertEquals("efgh", (nq2.getQuery()));
- assertEquals(1, (nq2.getHintsSize()));
-
- // test the query hints of the second mapping file query have the correct value
- OrmQueryHint nq2hint1 = nq2.getHints().iterator().next();
-
- // test the query hint of the second mapping file query
- assertEquals("nq2hint1", nq2hint1.getName());
- assertEquals("ccc", nq2hint1.getValue());
-
- assertEquals(LockModeType2_0.OPTIMISTIC, ((OrmNamedQuery2_0)nq1).getLockMode());
- assertEquals(LockModeType2_0.READ, ((OrmNamedQuery2_0)nq2).getLockMode());
- }
-
- public void testConvertNamedNativeQueriesOnMappedSuperclass() throws Exception {
- createTestMappedSuperclassWithNamedNativeQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaMappedSuperclass mappedSuperclass = (JavaMappedSuperclass) getJavaPersistentType().getMapping();
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaQueries(entityMappings, progressMonitor);
-
- // test Java queries are converted to orm.xml and removed from the Java entity
- assertEquals(2, entityMappings.getQueryContainer().getNamedNativeQueriesSize());
- assertEquals(0, mappedSuperclass.getQueryContainer().getNamedNativeQueriesSize());
-
- // test the mapping file queries have correct values
- Collection<OrmNamedNativeQuery> namedNativeQueries = CollectionTools.collection(entityMappings.getQueryContainer().getNamedNativeQueries());
-
- // test the first mapping file query
- OrmNamedNativeQuery nnq1 = selectNodeNamed(namedNativeQueries, "nnq1");
- assertEquals("nnq1", (nnq1.getName()));
- assertEquals("abcd", (nnq1.getQuery()));
- assertEquals("foo1", nnq1.getResultClass());
- assertEquals("bar1", nnq1.getResultSetMapping());
- assertEquals(2, (nnq1.getHintsSize()));
-
- // test the query hints of the first mapping file query have the correct value
- ListIterator<OrmQueryHint> nq1hints = nnq1.getHints().iterator();
-
- // test the first query hint of the first mapping file query
- OrmQueryHint nnq1hint1 = nq1hints.next();
- assertEquals("nnq1hint1", nnq1hint1.getName());
- assertEquals("aaa", nnq1hint1.getValue());
-
- // test the second query hint of the first mapping file query
- OrmQueryHint nnq1hint2 = nq1hints.next();
- assertEquals("nnq1hint2", nnq1hint2.getName());
- assertEquals("bbb", nnq1hint2.getValue());
-
- // test the second mapping file query
- OrmNamedNativeQuery nnq2 = selectNodeNamed(namedNativeQueries, "nnq2");
- assertEquals("nnq2", (nnq2.getName()));
- assertEquals("efgh", (nnq2.getQuery()));
- assertEquals("foo2", nnq2.getResultClass());
- assertEquals("bar2", nnq2.getResultSetMapping());
- assertEquals(1, (nnq2.getHintsSize()));
-
- // test the query hints of the second mapping file query have the correct value
- OrmQueryHint nnq2hint1 = nnq2.getHints().iterator().next();
-
- // test the query hint of the second mapping file query
- assertEquals("nnq2hint1", nnq2hint1.getName());
- assertEquals("ccc", nnq2hint1.getValue());
-
- }
-
-
- // ************ entity with generators*************
-
- private ICompilationUnit createTestEntityWithGenerators() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.TABLE_GENERATOR, JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@TableGenerator(name=\"tgen\", table=\"ID_GEN\", schema=\"APP\", catalog=\"FOO\"," +
- "pkColumnName=\"GEN_NAME\", valueColumnName=\"GEN_VALUE\", pkColumnValue=\"TGEN\"," +
- "allocationSize=50, initialValue=100)").append(CR);
- sb.append("@SequenceGenerator(name=\"sgen\", sequenceName=\"Foo_Seq\", schema=\"SYS\", catalog=\"BAR\"," +
- "allocationSize=5, initialValue=10)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGeneratorsOnIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.TABLE_GENERATOR, JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@TableGenerator(name=\"tgen\", table=\"ID_GEN\", schema=\"APP\", catalog=\"FOO\"," +
- "pkColumnName=\"GEN_NAME\", valueColumnName=\"GEN_VALUE\", pkColumnValue=\"TGEN\"," +
- "allocationSize=50, initialValue=100)").append(CR);
- sb.append("@SequenceGenerator(name=\"sgen\", sequenceName=\"Foo_Seq\", schema=\"SYS\", catalog=\"BAR\"," +
- "allocationSize=5, initialValue=10)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDuplicateGenerators() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.TABLE_GENERATOR, JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@TableGenerator(name=\"gen\", table=\"ID_GEN\", schema=\"APP\", catalog=\"FOO\"," +
- "pkColumnName=\"GEN_NAME\", valueColumnName=\"GEN_VALUE\", pkColumnValue=\"TGEN\"," +
- "allocationSize=50, initialValue=100)").append(CR);
- sb.append("@SequenceGenerator(name=\"gen\", sequenceName=\"Foo_Seq\", schema=\"SYS\", catalog=\"BAR\"," +
- "allocationSize=5, initialValue=10)");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@TableGenerator(name=\"tgen\", table=\"ID_GEN\", schema=\"APP\", catalog=\"FOO\"," +
- "pkColumnName=\"GEN_NAME\", valueColumnName=\"GEN_VALUE\", pkColumnValue=\"TGEN\"," +
- "allocationSize=50, initialValue=100)").append(CR);
- sb.append("@SequenceGenerator(name=\"gen\", sequenceName=\"Foo_Seq\", schema=\"SYS\", catalog=\"BAR\"," +
- "allocationSize=5, initialValue=10)");
- }
- });
- }
-
- public void testTestConvertGenerators() throws Exception {
- createTestEntityWithGenerators();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaGenerators(entityMappings, progressMonitor);
-
- // test Java generators are converted to orm.xml and removed from the Java entity
- assertEquals(1, entityMappings.getSequenceGeneratorsSize());
- assertEquals(1, entityMappings.getTableGeneratorsSize());
- assertNull(entity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entity.getGeneratorContainer().getTableGenerator());
-
- // test the mapping file generators have correct values
- OrmTableGenerator tableGen = entityMappings.getTableGenerators().iterator().next();
- assertEquals("tgen", tableGen.getName());
- assertEquals("ID_GEN", tableGen.getTable());
- assertEquals("APP", tableGen.getSchema());
- assertEquals("FOO", tableGen.getCatalog());
- assertEquals("GEN_NAME", tableGen.getPkColumnName());
- assertEquals("GEN_VALUE", tableGen.getValueColumnName());
- assertEquals("TGEN", tableGen.getPkColumnValue());
- assertEquals(50, tableGen.getAllocationSize());
- assertEquals(100, tableGen.getInitialValue());
-
- OrmSequenceGenerator seqGen = entityMappings.getSequenceGenerators().iterator().next();
- assertEquals("sgen", seqGen.getName());
- assertEquals("Foo_Seq", seqGen.getSequenceName());
- assertEquals(5, seqGen.getAllocationSize());
- assertEquals(10, seqGen.getInitialValue());
-
- assertEquals("SYS", ((GenericOrmSequenceGenerator2_0)seqGen).getSchema());
- assertEquals("BAR", ((GenericOrmSequenceGenerator2_0)seqGen).getCatalog());
- }
-
- public void testTestConvertGeneratorsOnIdMapping() throws Exception {
- createTestEntityWithGeneratorsOnIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEntity entity = getJavaEntity();
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaGenerators(entityMappings, progressMonitor);
-
- // test Java generators are converted to orm.xml and removed from the Java entity
- assertEquals(1, entityMappings.getSequenceGeneratorsSize());
- assertEquals(1, entityMappings.getTableGeneratorsSize());
-
- JavaIdMapping mapping = (JavaIdMapping)entity.getIdAttribute().getMapping();
- assertNull(mapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(mapping.getGeneratorContainer().getTableGenerator());
-
- // test the mapping file generators have correct values
- OrmTableGenerator tableGen = entityMappings.getTableGenerators().iterator().next();
- assertEquals("tgen", tableGen.getName());
- assertEquals("ID_GEN", tableGen.getTable());
- assertEquals("APP", tableGen.getSchema());
- assertEquals("FOO", tableGen.getCatalog());
- assertEquals("GEN_NAME", tableGen.getPkColumnName());
- assertEquals("GEN_VALUE", tableGen.getValueColumnName());
- assertEquals("TGEN", tableGen.getPkColumnValue());
- assertEquals(50, tableGen.getAllocationSize());
- assertEquals(100, tableGen.getInitialValue());
-
- OrmSequenceGenerator seqGen = entityMappings.getSequenceGenerators().iterator().next();
- assertEquals("sgen", seqGen.getName());
- assertEquals("Foo_Seq", seqGen.getSequenceName());
- assertEquals(5, seqGen.getAllocationSize());
- assertEquals(10, seqGen.getInitialValue());
-
- assertEquals("SYS", ((GenericOrmSequenceGenerator2_0)seqGen).getSchema());
- assertEquals("BAR", ((GenericOrmSequenceGenerator2_0)seqGen).getCatalog());
- }
-
- public void testConvertOverridenGenerators() throws Exception {
- createTestEntityWithDuplicateGenerators();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
- OrmSequenceGenerator sequence = entityMappings.addSequenceGenerator();
- sequence.setName("gen");
-
- JavaEntity entity = getJavaEntity();
- JavaIdMapping mapping = (JavaIdMapping)entity.getIdAttribute().getMapping();
-
- persistenceUnit.convertJavaGenerators(entityMappings, progressMonitor);
-
- // test overriden Java generators are not converted to orm.xml and not
- // removed from the Java entity, but unique generator is
- assertNotNull(entity.getGeneratorContainer().getSequenceGenerator());
- assertNotNull(entity.getGeneratorContainer().getTableGenerator());
- assertEquals(1, entityMappings.getSequenceGeneratorsSize());
- assertEquals(1, entityMappings.getTableGeneratorsSize());
- assertNotNull(mapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(mapping.getGeneratorContainer().getTableGenerator());
- }
-
- public void testConvertDuplicateGenerators() throws Exception {
- createTestEntityWithDuplicateGenerators();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- JavaEntity entity = getJavaEntity();
- JavaIdMapping mapping = (JavaIdMapping)entity.getIdAttribute().getMapping();
-
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
- persistenceUnit.convertJavaGenerators(entityMappings, progressMonitor);
-
- // test overriden Java generators are not converted to orm.xml and not
- // removed from the Java entity, but unique generator is
- assertNotNull(entity.getGeneratorContainer().getSequenceGenerator());
- assertNotNull(entity.getGeneratorContainer().getTableGenerator());
- assertEquals(0, entityMappings.getSequenceGeneratorsSize());
- assertEquals(1, entityMappings.getTableGeneratorsSize());
- assertNotNull(mapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(mapping.getGeneratorContainer().getTableGenerator());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0OptionsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0OptionsTests.java
deleted file mode 100644
index 10ea07e67f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0OptionsTests.java
+++ /dev/null
@@ -1,520 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;
-
-import java.util.ListIterator;
-
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.JpaOptions2_0;
-
-/**
- * GenericOptions2_0Tests
- */
-@SuppressWarnings("nls")
-public class Generic2_0OptionsTests extends Generic2_0PersistenceUnitTests
-{
- private JpaOptions2_0 options;
- private ListChangeEvent prePersistEvent;
- private ListChangeEvent preUpdateEvent;
- private ListChangeEvent preRemoveEvent;
-
- public static final String LOCK_TIMEOUT_KEY = JpaOptions2_0.PERSISTENCE_LOCK_TIMEOUT;
- public static final Integer LOCK_TIMEOUT_TEST_VALUE = 100;
- public static final Integer LOCK_TIMEOUT_TEST_VALUE_2 = 200;
-
- public static final String QUERY_TIMEOUT_KEY = JpaOptions2_0.PERSISTENCE_QUERY_TIMEOUT;
- public static final Integer QUERY_TIMEOUT_TEST_VALUE = 100;
- public static final Integer QUERY_TIMEOUT_TEST_VALUE_2 = 200;
-
- public static final String VALIDATION_GROUP_PRE_PERSIST_KEY = JpaOptions2_0.PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST;
- public static final String VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE = "test_pre-persist_group";
- public static final String VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2 = "test_2_pre-persist_group";
-
- public static final String VALIDATION_GROUP_PRE_UPDATE_KEY = JpaOptions2_0.PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE;
- public static final String VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE = "test_pre-update_group";
- public static final String VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2 = "test_2_pre-update_group";
-
- public static final String VALIDATION_GROUP_PRE_REMOVE_KEY = JpaOptions2_0.PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE;
- public static final String VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE = "test_pre-remove_group";
- public static final String VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2 = "test_2_pre-remove_group";
-
- // ********** constructors **********
- public Generic2_0OptionsTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.options = (JpaOptions2_0) this.subject.getOptions();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.options.addPropertyChangeListener(JpaOptions2_0.LOCK_TIMEOUT_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(JpaOptions2_0.QUERY_TIMEOUT_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY, propertyChangeListener);
-
- ListChangeListener validationGroupListChangeListener = this.buildValidationGroupListChangeListener();
- this.options.addListChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_LIST, validationGroupListChangeListener);
- this.options.addListChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_LIST, validationGroupListChangeListener);
- this.options.addListChangeListener(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_LIST, validationGroupListChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PersistenceUnit properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 5; // PersistenceUnit properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 1 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes PersistenceUnit properties
- this.persistenceUnitSetProperty(LOCK_TIMEOUT_KEY, LOCK_TIMEOUT_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(QUERY_TIMEOUT_KEY, QUERY_TIMEOUT_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
-
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_PERSIST_KEY, VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE);
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_UPDATE_KEY, VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE);
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_REMOVE_KEY, VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.options;
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(JpaOptions2_0.LOCK_TIMEOUT_PROPERTY))
- modelValue = this.options.getLockTimeout();
- else if (propertyName.equals(JpaOptions2_0.QUERY_TIMEOUT_PROPERTY))
- modelValue = this.options.getQueryTimeout();
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPrePersists().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPreUpdates().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPreRemoves().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(JpaOptions2_0.LOCK_TIMEOUT_PROPERTY))
- this.options.setLockTimeout((Integer) newValue);
- else if (propertyName.equals(JpaOptions2_0.QUERY_TIMEOUT_PROPERTY))
- this.options.setQueryTimeout((Integer) newValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.addValidationGroupPrePersist((String) newValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.addValidationGroupPreUpdate((String) newValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.addValidationGroupPreRemove((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- // ********** LockTimeout tests **********
- public void testSetLockTimeout() throws Exception {
- this.verifyModelInitialized(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE);
- this.verifySetProperty(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE,
- LOCK_TIMEOUT_TEST_VALUE_2);
- }
-
- public void testAddRemoveLockTimeout() throws Exception {
- this.verifyAddRemoveProperty(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE,
- LOCK_TIMEOUT_TEST_VALUE_2);
- }
-
- // ********** QueryTimeout tests **********
- public void testSetQueryTimeout() throws Exception {
- this.verifyModelInitialized(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE);
- this.verifySetProperty(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE,
- QUERY_TIMEOUT_TEST_VALUE_2);
- }
-
- public void testAddRemoveQueryTimeout() throws Exception {
- this.verifyAddRemoveProperty(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE,
- QUERY_TIMEOUT_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPrePersist tests **********
- public void testSetValidationGroupPrePersist() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPrePersist() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPrePersistCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPrePersistCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPreUpdate tests **********
- public void testSetValidationGroupPreUpdate() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreUpdate() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPreUpdateCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPreUpdateCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPreRemove tests **********
- public void testSetValidationGroupPreRemove() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreRemove() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPreRemoveCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPreRemoveCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- // ********** ValidationGroups list **********
- public void testValidationGroupsList() throws Exception {
- this.verifyListEvents(
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2,
- JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_LIST);
-
- this.verifyListEvents(
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2,
- JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_LIST);
-
- this.verifyListEvents(
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2,
- JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_LIST);
- }
-
- // ********** override **********
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.prePersistEvent = null;
- this.preUpdateEvent = null;
- this.preRemoveEvent = null;
- }
-
- // ****** convenience methods *******
-
- // ********** verify ValidationGroup property **********
- protected void verifySetValidationGroupProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2, true);
- this.propertiesTotal++;
- this.verifyPutValidationGroupProperty(propertyName, testValue1);
- }
-
- @SuppressWarnings("unused")
- protected void verifyAddRemoveValidationGroupProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- assertTrue(this.validationGroupValueExists(propertyName, (String)testValue1));
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key, (String)testValue1);
- assertFalse(this.validationGroupValueExists(propertyName, (String)testValue1));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1, true);
- this.verifyPutValidationGroupProperty(propertyName, testValue1);
- }
-
- protected void verifyAddCompositeValue(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- String stringTestValue1 = (String)testValue1;
- String stringTestValue2 = (String)testValue2;
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- this.addValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 2);
-
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue2));
-
- String propertyValue = this.getPersistenceUnit().getProperty(key).getValue();
- assertTrue(propertyValue.indexOf(stringTestValue1) != -1);
- assertTrue(propertyValue.indexOf(stringTestValue2) != -1);
- }
-
- protected void verifyRemoveCompositeValue(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- String stringTestValue1 = (String)testValue1;
- String stringTestValue2 = (String)testValue2;
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- this.addValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 2);
-
- this.removeValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- assertFalse(this.validationGroupValueExists(propertyName, stringTestValue2));
- String propertyValue = this.getPersistenceUnit().getProperty(key).getValue();
- assertTrue(propertyValue.indexOf(stringTestValue1) != -1);
- assertTrue(propertyValue.indexOf(stringTestValue2) == -1);
-
- this.removeValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 1);
-
- this.removeValidationGroupValue(propertyName, stringTestValue1);
- assertEquals(this.getValidationGroupSize(propertyName), 0);
- assertFalse(this.validationGroupValueExists(propertyName, stringTestValue1));
-
- assertNull(this.getPersistenceUnit().getProperty(key));
- }
-
- protected void verifyListEvents(String propertyName, String testValue, String listName) throws Exception {
- // add
- this.clearEvent();
- this.addValidationGroupValue(propertyName, testValue);
-
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event for the expected property
- assertEquals("Wrong Event.", this.getEventFor(propertyName).getListName(), listName);
-
- // remove
- this.clearEvent();
-
- this.removeValidationGroupValue(propertyName, testValue);
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event for the expected property
- assertEquals("Wrong Event.", this.getEventFor(propertyName).getListName(), listName);
- }
-
- protected void verifyPutValidationGroupProperty(String propertyName, Object expectedValue) throws Exception {
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event value
- assertTrue(this.validationGroupValueExists(propertyName, (String) expectedValue));
- return;
- }
-
- // ********** internal method **********
-
- private ListChangeListener buildValidationGroupListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- Generic2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listChanged(ListChangeEvent e) {
-
- Generic2_0OptionsTests.this.validationGroupChanged(e);
- }
- };
- }
-
- private void validationGroupChanged(ListChangeEvent e) {
- String listName = e.getListName();
-
- if (listName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_LIST))
- this.prePersistEvent = e;
- else if (listName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_LIST))
- this.preUpdateEvent = e;
- else if (listName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_LIST))
- this.preRemoveEvent = e;
- else
- this.throwUnsupportedOperationException(e);
- }
-
- private void addValidationGroupValue(String propertyName, String propertyValue) throws NoSuchFieldException {
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.addValidationGroupPrePersist(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.addValidationGroupPreUpdate(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.addValidationGroupPreRemove(propertyValue);
- else
- this.throwMissingDefinition("addValidationGroupValue", propertyName);
- }
-
- private void removeValidationGroupValue(String propertyName, String propertyValue) throws NoSuchFieldException {
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.removeValidationGroupPrePersist(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.removeValidationGroupPreUpdate(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.removeValidationGroupPreRemove(propertyValue);
- else
- this.throwMissingDefinition("removeValidationGroupValue", propertyName);
- }
-
- private boolean validationGroupValueExists(String propertyName, String propertyValue) throws NoSuchFieldException {
- boolean result = false;
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- result = this.options.validationGroupPrePersistExists(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- result = this.options.validationGroupPreUpdateExists(propertyValue);
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- result = this.options.validationGroupPreRemoveExists(propertyValue);
- else
- this.throwMissingDefinition("verifyValidationGroupValueExists", propertyName);
- return result;
- }
-
- private int getValidationGroupSize(String propertyName) throws NoSuchFieldException {
- int result = 0;
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- result = this.options.getValidationGroupPrePersistsSize();
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- result = this.options.getValidationGroupPreUpdatesSize();
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- result = this.options.getValidationGroupPreRemovesSize();
- else
- this.throwMissingDefinition("verifyValidationGroupSize", propertyName);
- return result;
- }
-
- private ListChangeEvent getEventFor(String propertyName) throws NoSuchFieldException {
- ListChangeEvent event = null;
- if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- event = this.prePersistEvent;
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- event = this.preUpdateEvent;
- else if (propertyName.equals(JpaOptions2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- event = this.preRemoveEvent;
- else
- this.throwMissingDefinition("getEventFor", propertyName);
- return event;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceContextModelTests.java
deleted file mode 100644
index d2fd0dd4f2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceContextModelTests.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class Generic2_0PersistenceContextModelTests
- extends TestCase
-{
-
- public static Test suite() {
- TestSuite suite = new TestSuite(Generic2_0ConnectionTests.class.getPackage().getName());
- suite.addTestSuite(Generic2_0OptionsTests.class);
- suite.addTestSuite(Generic2_0JpaMetadataConversionTests.class);
- return suite;
- }
-
- private Generic2_0PersistenceContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceUnitTests.java
deleted file mode 100644
index b1158a47d4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/context/persistence/Generic2_0PersistenceUnitTests.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2010 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.platform.GenericPlatform;
-import org.eclipse.jpt.jpa.core.tests.internal.context.persistence.PersistenceUnitTestCase;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * GenericPersistenceUnit2_0Tests
- */
-public abstract class Generic2_0PersistenceUnitTests extends PersistenceUnitTestCase
-{
- protected PersistenceUnit2_0 subject;
-
- protected PropertyValueModel<PersistenceUnit2_0> subjectHolder;
-
- // ********** constructors **********
- protected Generic2_0PersistenceUnitTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject = this.getPersistenceUnit();
- this.subjectHolder = new SimplePropertyValueModel<PersistenceUnit2_0>(this.subject);
- this.populatePu();
- }
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_2_0.getVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, GenericPlatform.VERSION_2_0);
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- @Override
- protected PersistenceUnit2_0 getPersistenceUnit() {
- return (PersistenceUnit2_0) super.getPersistenceUnit();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Access2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Access2_0AnnotationTests.java
deleted file mode 100644
index 49e5095a15..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Access2_0AnnotationTests.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMethod;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Access2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.AccessType;
-
-@SuppressWarnings("nls")
-public class Access2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public Access2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAccessOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- private ICompilationUnit createTestAccessOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Access(AccessType.FIELD)");
- }
- });
- }
-
- private ICompilationUnit createTestAccessOnProperty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ACCESS, JPA2_0.ACCESS_TYPE);
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Access(AccessType.PROPERTY)");
- }
- });
- }
-
- public void testGetAccessOnType() throws Exception {
- ICompilationUnit cu = this.createTestAccessOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceType.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
- assertEquals(AccessType.PROPERTY, access.getValue());
- }
-
- public void testSetAccessOnType() throws Exception {
- ICompilationUnit cu = this.createTestType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceType.getAnnotation(JPA2_0.ACCESS);
- assertNull(access);
-
- resourceType.addAnnotation(JPA2_0.ACCESS);
- assertSourceContains("@Access", cu);
-
- access = (Access2_0Annotation) resourceType.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
-
- access.setValue(AccessType.FIELD);
- assertEquals(AccessType.FIELD, access.getValue());
- assertSourceContains("@Access(FIELD)", cu);
-
- access.setValue(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, access.getValue());
- assertSourceContains("@Access(PROPERTY)", cu);
-
- access.setValue(null);
- assertSourceDoesNotContain("@Access(", cu);
- }
-
- public void testGetAccessOnField() throws Exception {
- ICompilationUnit cu = this.createTestAccessOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceField.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
- assertEquals(AccessType.FIELD, access.getValue());
- }
-
- public void testSetAccessOnField() throws Exception {
- ICompilationUnit cu = this.createTestType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceField.getAnnotation(JPA2_0.ACCESS);
- assertNull(access);
-
- resourceField.addAnnotation(JPA2_0.ACCESS);
- assertSourceContains("@Access", cu);
-
- access = (Access2_0Annotation) resourceField.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
-
- access.setValue(AccessType.FIELD);
- assertEquals(AccessType.FIELD, access.getValue());
- assertSourceContains("@Access(FIELD)", cu);
-
- access.setValue(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, access.getValue());
- assertSourceContains("@Access(PROPERTY)", cu);
-
- access.setValue(null);
- assertSourceDoesNotContain("@Access(", cu);
- }
-
- public void testGetAccessOnProperty() throws Exception {
- ICompilationUnit cu = this.createTestAccessOnProperty();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = CollectionTools.get(resourceType.getMethods(), 0);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceMethod.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
- assertEquals(AccessType.PROPERTY, access.getValue());
- }
-
- public void testSetAccessOnProperty() throws Exception {
- ICompilationUnit cu = this.createTestType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceMethod resourceMethod = CollectionTools.get(resourceType.getMethods(), 0);
-
- Access2_0Annotation access = (Access2_0Annotation) resourceMethod.getAnnotation(JPA2_0.ACCESS);
- assertNull(access);
-
- resourceMethod.addAnnotation(JPA2_0.ACCESS);
- assertSourceContains("@Access", cu);
-
- access = (Access2_0Annotation) resourceMethod.getAnnotation(JPA2_0.ACCESS);
- assertNotNull(access);
-
- access.setValue(AccessType.FIELD);
- assertEquals(AccessType.FIELD, access.getValue());
- assertSourceContains("@Access(FIELD)", cu);
-
- access.setValue(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, access.getValue());
- assertSourceContains("@Access(PROPERTY)", cu);
-
- access.setValue(null);
- assertSourceDoesNotContain("@Access(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverride2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverride2_0Tests.java
deleted file mode 100644
index c1b5eaca0c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverride2_0Tests.java
+++ /dev/null
@@ -1,861 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-
-@SuppressWarnings("nls")
-public class AssociationOverride2_0Tests extends JavaResourceModel2_0TestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
- private static final String JOIN_TABLE_NAME = "MY_JOIN_TABLE";
- private static final String CATALOG_NAME = "MY_CATALOG";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
-
- public AssociationOverride2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"" + JOIN_TABLE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(catalog = \"" + CATALOG_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(schema = \"" + SCHEMA_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn}))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithInverseJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn}))");
- }
- });
- }
-
- private AssociationOverride2_0Annotation associationOverrideAt(int index, JavaResourceMember resourceMember) {
- return (AssociationOverride2_0Annotation) resourceMember.getAnnotation(index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverride(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- }
-
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertEquals(0, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertNull(associationOverride.joinColumnAt(2).getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = @JoinColumn)", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@AssociationOverride(", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-
- public void testGetNullJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNotNull(associationOverride);
- assertNull(joinTable);
- }
-
- public void testJoinTableGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertEquals(JOIN_TABLE_NAME, joinTable.getName());
- }
-
- public void testJoinTableSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertEquals(JOIN_TABLE_NAME, joinTable.getName());
-
- joinTable.setName("Foo");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"Foo\"))", cu);
-
- joinTable.setName(null);
- assertNull(associationOverride.getJoinTable().getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable)", cu);
- }
-
- public void testAddJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNull(joinTable);
-
- associationOverride.addJoinTable();
- joinTable = associationOverride.getJoinTable();
- assertNotNull(joinTable);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable)", cu);
- }
-
- public void testRemoveJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNull(joinTable);
- }
-
- public void testJoinTableGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testJoinTableSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", catalog = \"Foo\"))", cu);
- }
-
- public void testJoinTableSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testJoinTableSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", schema = \"Foo\"))", cu);
- }
-
- public void testJoinTableSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint}))", cu);
- }
-
- public void testJoinTableRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, table.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(2, table.getUniqueConstraintsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals("BAZ", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(1, table.getUniqueConstraintsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"})))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals(0, table.getUniqueConstraintsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})}))", cu);
- }
-
- public void testJoinTableMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})}))", cu);
- }
-
- public void testJoinTableJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getJoinColumnsSize());
- }
-
- public void testJoinTableJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addJoinColumn(0);
- table.addJoinColumn(1);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinTableJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinTableAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addJoinColumn(0).setName("FOO");
- table.addJoinColumn(1);
- table.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addJoinColumn(0).setName("FOO");
-
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertEquals("BAR", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
-
- table.removeJoinColumn(1);
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals(2, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
-
- table.removeJoinColumn(0);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals(1, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = @JoinColumn))", cu);
-
-
- table.removeJoinColumn(0);
- assertEquals(0, table.getJoinColumnsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
- table.moveJoinColumn(2, 0);
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals("FOO", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
-
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
-
- table.moveJoinColumn(0, 2);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertEquals("BAR", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")}))", cu);
- }
-
- public void testJoinTableSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableInverseJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addInverseJoinColumn(0);
- table.addInverseJoinColumn(1);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testJoinTableInverseJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testAddInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addInverseJoinColumn(0).setName("FOO");
- table.addInverseJoinColumn(1);
- table.addInverseJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", table.inverseJoinColumnAt(1).getName());
- assertNull(table.inverseJoinColumnAt(2).getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", inverseJoinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableRemoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(2).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(1);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")}))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = @JoinColumn(name = \"FOO\")))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(2, 0);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableMoveInverseJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(1).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(0, 2);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn, @JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableSetInverseJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getInverseJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.inverseJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java
deleted file mode 100644
index 4e0600d561..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/AssociationOverrides2_0Tests.java
+++ /dev/null
@@ -1,949 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.AssociationOverride2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-
-@SuppressWarnings("nls")
-public class AssociationOverrides2_0Tests extends JavaResourceModel2_0TestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
- private static final String JOIN_TABLE_NAME = "MY_JOIN_TABLE";
- private static final String CATALOG_NAME = "MY_CATALOG";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
-
- public AssociationOverrides2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn}))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"" + JOIN_TABLE_NAME + "\")))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(catalog = \"" + CATALOG_NAME + "\")))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(schema = \"" + SCHEMA_NAME + "\")))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideJoinTableWithInverseJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDES, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})))");
- }
- });
- }
-
-
- private AssociationOverride2_0Annotation associationOverrideAt(int index, JavaResourceMember resourceMember) {
- return (AssociationOverride2_0Annotation) resourceMember.getAnnotation(index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverride2_0Annotation associationOverride = this.associationOverrideAt(0, resourceField);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- assertSourceContains("@AssociationOverrides", cu);
- }
-
- public void testAddAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.ASSOCIATION_OVERRIDE));
- }
-
- public void testAddAssociationOverrideToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AssociationOverride(name = \"BAZ\"),";
- expected3 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")), @AssociationOverride(name = \"BAR\") })";
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
-
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("BAZ", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("FOO", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("BAR", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.ASSOCIATION_OVERRIDE));
- }
-
- public void testRemoveAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\"))";
- resourceType.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- assertSourceContains(expected2, cu);
- assertSourceDoesNotContain("@AssociationOverrides", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- assertEquals(0, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = @JoinColumn))", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@AssociationOverride(", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")}))", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceField);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
- public void testGetNullJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNotNull(associationOverride);
- assertNull(joinTable);
- }
-
- public void testJoinTableGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertEquals(JOIN_TABLE_NAME, joinTable.getName());
- }
-
- public void testJoinTableSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertEquals(JOIN_TABLE_NAME, joinTable.getName());
-
- joinTable.setName("Foo");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"Foo\"))", cu);
-
- joinTable.setName(null);
- assertNull(associationOverride.getJoinTable().getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable)", cu);
- }
-
- public void testAddJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNull(joinTable);
-
- associationOverride.addJoinTable();
- joinTable = associationOverride.getJoinTable();
- assertNotNull(joinTable);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable)", cu);
- }
-
- public void testRemoveJoinTable() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation joinTable = associationOverride.getJoinTable();
- assertNull(joinTable);
- }
-
- public void testJoinTableGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testJoinTableSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", catalog = \"Foo\"))", cu);
- }
-
- public void testJoinTableSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testJoinTableSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", schema = \"Foo\"))", cu);
- }
-
- public void testJoinTableSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testJoinTableAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint}))", cu);
- }
-
- public void testJoinTableRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, table.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(2, table.getUniqueConstraintsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals("BAZ", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(1, table.getUniqueConstraintsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"})))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals(0, table.getUniqueConstraintsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})}))", cu);
- }
-
- public void testJoinTableMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})}))", cu);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})}))", cu);
- }
-
- public void testJoinTableJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getJoinColumnsSize());
- }
-
- public void testJoinTableJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addJoinColumn(0);
- table.addJoinColumn(1);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinTableJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinTableAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addJoinColumn(0).setName("FOO");
- table.addJoinColumn(1);
- table.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addJoinColumn(0).setName("FOO");
-
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertEquals("BAR", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
-
- table.removeJoinColumn(1);
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals(2, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
-
- table.removeJoinColumn(0);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals(1, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = @JoinColumn))", cu);
-
-
- table.removeJoinColumn(0);
- assertEquals(0, table.getJoinColumnsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
- table.moveJoinColumn(2, 0);
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals("FOO", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
-
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
-
- table.moveJoinColumn(0, 2);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertEquals("BAR", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")}))", cu);
- }
-
- public void testJoinTableSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableInverseJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(0, table.getInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
-
- table.addInverseJoinColumn(0);
- table.addInverseJoinColumn(1);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testJoinTableInverseJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testAddInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- table.addInverseJoinColumn(0).setName("FOO");
- table.addInverseJoinColumn(1);
- table.addInverseJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", table.inverseJoinColumnAt(1).getName());
- assertNull(table.inverseJoinColumnAt(2).getName());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(name = \"MY_JOIN_TABLE\", inverseJoinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testJoinTableRemoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(2).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(1);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")}))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = @JoinColumn(name = \"FOO\")))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testJoinTableMoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(2, 0);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableMoveInverseJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
- table.addInverseJoinColumn(1).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(0, 2);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn, @JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testJoinTableSetInverseJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- AssociationOverride2_0Annotation associationOverride = associationOverrideAt(0, resourceType);
- JoinTableAnnotation table = associationOverride.getJoinTable();
-
- assertEquals(2, table.getInverseJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.inverseJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinTable = @JoinTable(inverseJoinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Cacheable2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Cacheable2_0AnnotationTests.java
deleted file mode 100644
index 018be5caf0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/Cacheable2_0AnnotationTests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-
-@SuppressWarnings("nls")
-public class Cacheable2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public Cacheable2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestCacheable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.CACHEABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cacheable");
- }
- });
- }
-
- private ICompilationUnit createTestCacheableWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.CACHEABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cacheable(value=true)");
- }
- });
- }
-
-
-
- public void testCacheableAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestCacheable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertNotNull(resourceType.getAnnotation(JPA2_0.CACHEABLE));
-
- resourceType.removeAnnotation(JPA2_0.CACHEABLE);
- assertNull(resourceType.getAnnotation(JPA2_0.CACHEABLE));
-
- resourceType.addAnnotation(JPA2_0.CACHEABLE);
- assertNotNull(resourceType.getAnnotation(JPA2_0.CACHEABLE));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestCacheableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) resourceType.getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestCacheableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) resourceType.getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
-
- cacheableAnnotation.setValue(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
-
- assertSourceContains("@Cacheable(value=false)", cu);
-
- cacheableAnnotation.setValue(null);
- cacheableAnnotation.setValue(Boolean.FALSE);
- assertSourceContains("@Cacheable(false)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) resourceType.getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
-
- cacheableAnnotation.setValue(null);
- assertNull(cacheableAnnotation.getValue());
-
- assertSourceContains("@Cacheable", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/CollectionTable2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/CollectionTable2_0AnnotationTests.java
deleted file mode 100644
index 69cdd9cedb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/CollectionTable2_0AnnotationTests.java
+++ /dev/null
@@ -1,499 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class CollectionTable2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public CollectionTable2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestCollectionTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(name = \"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(schema = \"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(catalog = \"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- private ICompilationUnit createTestCollectionTableWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.COLLECTION_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@CollectionTable(joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@CollectionTable(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@CollectionTable(catalog = \"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@CollectionTable(schema = \"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, table.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(2, table.getUniqueConstraintsSize());
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals("BAZ", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(1, table.getUniqueConstraintsSize());
- assertSourceContains("@CollectionTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals(0, table.getUniqueConstraintsSize());
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@CollectionTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(0, table.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
-
- table.addJoinColumn(0);
- table.addJoinColumn(1);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- table.addJoinColumn(0).setName("FOO");
- table.addJoinColumn(1);
- table.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- table.addJoinColumn(0).setName("FOO");
-
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertEquals("BAR", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
-
- table.removeJoinColumn(1);
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals(2, table.getJoinColumnsSize());
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
-
- table.removeJoinColumn(0);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals(1, table.getJoinColumnsSize());
- assertSourceContains("@CollectionTable(joinColumns = @JoinColumn)", cu);
-
-
- table.removeJoinColumn(0);
- assertEquals(0, table.getJoinColumnsSize());
- assertSourceDoesNotContain("@CollectionTable(", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- table.moveJoinColumn(2, 0);
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals("FOO", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
-
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
-
- table.moveJoinColumn(0, 2);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertEquals("BAR", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestCollectionTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- CollectionTable2_0Annotation table = (CollectionTable2_0Annotation) resourceField.getAnnotation(JPA2_0.COLLECTION_TABLE);
-
- assertEquals(2, table.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@CollectionTable(joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ElementCollection2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ElementCollection2_0AnnotationTests.java
deleted file mode 100644
index 92f96531e7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ElementCollection2_0AnnotationTests.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class ElementCollection2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public ElementCollection2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection");
- }
- });
- }
-
- private ICompilationUnit createTestElementCollectionWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestElementCollectionWithTargetClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection(targetClass = AnnotationTestType.class)");
- }
- });
- }
-
- public void testElementCollection() throws Exception {
- ICompilationUnit cu = this.createTestElementCollection();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertNotNull(elementCollection);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(FetchType.EAGER, elementCollection.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, elementCollection.getFetch());
-
- assertSourceContains("@ElementCollection(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(null);
- assertNull(elementCollection.getFetch());
-
- assertSourceContains("@ElementCollection", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetClass() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithTargetClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(TYPE_NAME, elementCollection.getTargetClass());
- }
-
- public void testSetTargetClass() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithTargetClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(TYPE_NAME, elementCollection.getTargetClass());
-
- elementCollection.setTargetClass("Foo");
-
- assertSourceContains("@ElementCollection(targetClass = Foo.class)", cu);
- }
-
- public void testSetTargetClassNull() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithTargetClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(TYPE_NAME, elementCollection.getTargetClass());
-
- elementCollection.setTargetClass(null);
-
- assertSourceContains("@ElementCollection", cu);
- assertSourceDoesNotContain("targetClass", cu);
- }
-
-
- public void testGetFullyQualifiedTargetClass() throws Exception {
- ICompilationUnit cu = this.createTestElementCollectionWithTargetClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(JPA2_0.ELEMENT_COLLECTION);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, elementCollection.getFullyQualifiedTargetClassName());
-
- elementCollection.setTargetClass("Foo");
-
- assertSourceContains("@ElementCollection(targetClass = Foo.class)", cu);
-
- assertEquals("Foo", elementCollection.getTargetClass());
-
- assertEquals("Foo", elementCollection.getFullyQualifiedTargetClassName()); //bug 196200 changed this
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResource2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResource2_0Tests.java
deleted file mode 100644
index bd74f43e5c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResource2_0Tests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JavaResource2_0Tests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JavaResource2_0Tests.class.getPackage().getName());
-
- suite.addTestSuite(Access2_0AnnotationTests.class);
- suite.addTestSuite(AssociationOverride2_0Tests.class);
- suite.addTestSuite(AssociationOverrides2_0Tests.class);
- suite.addTestSuite(Cacheable2_0AnnotationTests.class);
- suite.addTestSuite(CollectionTable2_0AnnotationTests.class);
- suite.addTestSuite(ElementCollection2_0AnnotationTests.class);
- suite.addTestSuite(ManyToMany2_0AnnotationTests.class);
- suite.addTestSuite(ManyToOne2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyClass2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyColumn2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyEnumerated2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyJoinColumn2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyJoinColumns2_0AnnotationTests.class);
- suite.addTestSuite(MapKeyTemporal2_0AnnotationTests.class);
- suite.addTestSuite(MapsId2_0AnnotationTests.class);
- suite.addTestSuite(OneToMany2_0AnnotationTests.class);
- suite.addTestSuite(OneToOne2_0AnnotationTests.class);
- suite.addTestSuite(OrderColumn2_0AnnotationTests.class);
- suite.addTestSuite(SequenceGenerator2_0AnnotationTests.class);
-
- return suite;
- }
-
- private JavaResource2_0Tests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResourceModel2_0TestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResourceModel2_0TestCase.java
deleted file mode 100644
index 933d5c1f27..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/JavaResourceModel2_0TestCase.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.jpa2.Generic2_0JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-
-public class JavaResourceModel2_0TestCase extends JpaJavaResourceModelTestCase
-{
-
- public JavaResourceModel2_0TestCase(String name) {
- super(name);
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- Generic2_0JpaAnnotationDefinitionProvider.instance());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToMany2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToMany2_0AnnotationTests.java
deleted file mode 100644
index 58efc38818..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToMany2_0AnnotationTests.java
+++ /dev/null
@@ -1,410 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ManyToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class ManyToMany2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public ManyToMany2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToMany() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertNotNull(manyToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(null);
- assertNull(manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity(null);
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToMany.getFullyQualifiedTargetEntityClassName());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", manyToMany.getTargetEntity());
-
- assertEquals("Foo", manyToMany.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(null, manyToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertNull(manyToMany.getMappedBy());
- manyToMany.setMappedBy("bar");
- assertEquals("bar", manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
-
- manyToMany.setMappedBy(null);
- assertNull(manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertSourceContains("@ManyToMany(cascade = ALL)", cu);
-
- assertTrue(manyToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(true);
- assertSourceContains("@ManyToMany(cascade = MERGE)", cu);
-
- assertTrue(manyToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadePersist());
-
- manyToMany.setCascadePersist(true);
- assertSourceContains("@ManyToMany(cascade = PERSIST)", cu);
-
- assertTrue(manyToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeRemove(true);
- assertSourceContains("@ManyToMany(cascade = REMOVE)", cu);
-
- assertTrue(manyToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRefresh());
-
- manyToMany.setCascadeRefresh(true);
- assertSourceContains("@ManyToMany(cascade = REFRESH)", cu);
-
- assertTrue(manyToMany.isCascadeRefresh());
- }
-
- public void testSetCascadeDetach() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToMany2_0Annotation manyToMany = (ManyToMany2_0Annotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeDetach());
-
- manyToMany.setCascadeDetach(true);
- assertSourceContains("@ManyToMany(cascade = DETACH)", cu);
-
- assertTrue(manyToMany.isCascadeDetach());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertTrue(manyToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToMany(cascade = CascadeType.ALL)", cu);
-
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false); //TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false);
- assertFalse(manyToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
- assertTrue(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeMerge(false);
- assertSourceContains("@ManyToMany(cascade = REMOVE)", cu);
-
- manyToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToOne2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToOne2_0AnnotationTests.java
deleted file mode 100644
index 8120a1a7ce..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/ManyToOne2_0AnnotationTests.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ManyToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-
-@SuppressWarnings("nls")
-public class ManyToOne2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public ManyToOne2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToOne() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertNotNull(manyToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(null);
- assertNull(manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity(null);
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToOne.getFullyQualifiedTargetEntityClassName());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", manyToOne.getTargetEntity());
-
- assertEquals("Foo", manyToOne.getFullyQualifiedTargetEntityClassName());//bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(null);
- assertNull(manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertSourceContains("@ManyToOne(cascade = ALL)", cu);
-
- assertTrue(manyToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(true);
- assertSourceContains("@ManyToOne(cascade = MERGE)", cu);
-
- assertTrue(manyToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadePersist());
-
- manyToOne.setCascadePersist(true);
- assertSourceContains("@ManyToOne(cascade = PERSIST)", cu);
-
- assertTrue(manyToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeRemove(true);
- assertSourceContains("@ManyToOne(cascade = REMOVE)", cu);
-
- assertTrue(manyToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRefresh());
-
- manyToOne.setCascadeRefresh(true);
- assertSourceContains("@ManyToOne(cascade = REFRESH)", cu);
-
- assertTrue(manyToOne.isCascadeRefresh());
- }
-
- public void testSetCascadeDetach() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOne2_0Annotation manyToOne = (ManyToOne2_0Annotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeDetach());
-
- manyToOne.setCascadeDetach(true);
- assertSourceContains("@ManyToOne(cascade = DETACH)", cu);
-
- assertTrue(manyToOne.isCascadeDetach());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertTrue(manyToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToOne(cascade = CascadeType.ALL)", cu);
-
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);
- assertFalse(manyToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
- assertTrue(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeMerge(false);
- assertSourceContains("@ManyToOne(cascade = REMOVE)", cu);
-
- manyToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyClass2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyClass2_0AnnotationTests.java
deleted file mode 100644
index 8d64639bdb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyClass2_0AnnotationTests.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapKeyClass2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String MAP_KEY_CLASS_VALUE = "MyClass";
-
- public MapKeyClass2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMapKeyClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_CLASS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyClass");
- }
- });
- }
-
- private ICompilationUnit createTestMapKeyClassWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_CLASS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyClass(" + MAP_KEY_CLASS_VALUE + ".class)");
- }
- });
- }
-
- public void testMapKeyClass() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_CLASS);
- assertNotNull(mapKeyClass);
- assertNull(mapKeyClass.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_CLASS);
- assertEquals(MAP_KEY_CLASS_VALUE, mapKeyClass.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_CLASS);
- assertEquals(MAP_KEY_CLASS_VALUE, mapKeyClass.getValue());
-
- mapKeyClass.setValue("foo");
- assertEquals("foo", mapKeyClass.getValue());
-
- assertSourceContains("@MapKeyClass(foo.class)", cu);
-
- mapKeyClass.setValue(null);
-
- assertSourceDoesNotContain("@MapKeyClass(", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_CLASS);
- assertNotNull(mapKeyClass.getValue());
- assertEquals("MyClass", mapKeyClass.getFullyQualifiedClassName()); //bug 196200 changed this
-
-
- mapKeyClass.setValue(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, mapKeyClass.getFullyQualifiedClassName());
- assertSourceContains("@MapKeyClass(" + TYPE_NAME + ".class)", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationTests.java
deleted file mode 100644
index cf6cae8309..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyColumn2_0AnnotationTests.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapKeyColumn2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public MapKeyColumn2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyColumn(" + intElement + " = 5)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@MapKeyColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@MapKeyColumn(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@MapKeyColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUnique());
-
- assertSourceContains("@MapKeyColumn(unique = false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@MapKeyColumn(nullable = false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@MapKeyColumn(insertable = false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@MapKeyColumn(updatable = false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@MapKeyColumn(length = 5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("precision");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getPrecision());
- }
-
- public void testSetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertEquals(null, column.getPrecision());
-
- column.setPrecision(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getPrecision());
-
- assertSourceContains("@MapKeyColumn(precision = 5)", cu);
-
- column.setPrecision(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-
- public void testGetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("scale");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getScale());
- }
-
- public void testSetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getScale());
-
- column.setScale(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getScale());
-
- assertSourceContains("@MapKeyColumn(scale = 5)", cu);
-
- column.setScale(null);
- assertSourceDoesNotContain("@MapKeyColumn(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationTests.java
deleted file mode 100644
index efd68d8ec6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyEnumerated2_0AnnotationTests.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.EnumType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class MapKeyEnumerated2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public MapKeyEnumerated2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMapKeyEnumerated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_ENUMERATED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyEnumerated");
- }
- });
- }
-
- private ICompilationUnit createTestMapKeyEnumeratedWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyEnumerated(EnumType.ORDINAL)");
- }
- });
- }
-
- public void testMapKeyEnumerated() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyEnumerated();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_ENUMERATED);
- assertNotNull(enumerated);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyEnumeratedWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_ENUMERATED);
- assertEquals(EnumType.ORDINAL, enumerated.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyEnumerated();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_ENUMERATED);
-
- enumerated.setValue(EnumType.STRING);
-
- assertSourceContains("@MapKeyEnumerated(STRING)", cu);
-
- enumerated.setValue(null);
-
- assertSourceDoesNotContain("@MapKeyEnumerated(", cu);
- assertSourceContains("@MapKeyEnumerated", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationTests.java
deleted file mode 100644
index 17b702d78d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumn2_0AnnotationTests.java
+++ /dev/null
@@ -1,358 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapKeyJoinColumn2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public MapKeyJoinColumn2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- private MapKeyJoinColumn2_0Annotation mapKeyJoinColumnAt(int index, JavaResourceMember resourceMember) {
- return (MapKeyJoinColumn2_0Annotation) resourceMember.getAnnotation(index, JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@MapKeyJoinColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@MapKeyJoinColumn(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@MapKeyJoinColumn(referencedColumnName = \"Foo\")", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@MapKeyJoinColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(Boolean.TRUE, column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUnique());
-
- assertSourceContains("@MapKeyJoinColumn(unique = false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@MapKeyJoinColumn(nullable = false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@MapKeyJoinColumn(insertable = false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@MapKeyJoinColumn(updatable = false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationTests.java
deleted file mode 100644
index 1a808db599..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyJoinColumns2_0AnnotationTests.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyJoinColumn2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapKeyJoinColumns2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public MapKeyJoinColumns2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn)");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(name = \"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(table = \"" + COLUMN_TABLE + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumns(@MapKeyJoinColumn(" + booleanElement + " = true))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_JOIN_COLUMN, JPA2_0.MAP_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")");
- }
- });
- }
-
- private MapKeyJoinColumn2_0Annotation mapKeyJoinColumnAt(int index, JavaResourceMember resourceMember) {
- return (MapKeyJoinColumn2_0Annotation) resourceMember.getAnnotation(index, JPA2_0.MAP_KEY_JOIN_COLUMN);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(table = \"Foo\"))", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(referencedColumnName = \"Foo\"))", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(columnDefinition = \"Foo\"))", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertTrue(column.getUnique().booleanValue());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertFalse(column.getUnique().booleanValue());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(unique = false))", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertTrue(column.getNullable().booleanValue());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertFalse(column.getNullable().booleanValue());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(nullable = false))", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertTrue(column.getInsertable().booleanValue());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertFalse(column.getInsertable().booleanValue());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(insertable = false))", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertTrue(column.getUpdatable().booleanValue());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- MapKeyJoinColumn2_0Annotation column = this.mapKeyJoinColumnAt(0, resourceField);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertFalse(column.getUpdatable().booleanValue());
-
- assertSourceContains("@MapKeyJoinColumns(@MapKeyJoinColumn(updatable = false))", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@MapKeyJoinColumn(", cu);
- }
-
-
- public void testAddJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@MapKeyJoinColumns({";
- String expected2 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@MapKeyJoinColumn(name = \"FOO\") })";
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAP_KEY_JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAP_KEY_JOIN_COLUMNS));
- assertNotNull(resourceField.getAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN));
- assertEquals(2, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
- }
-
- public void testAddJoinColumnToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@MapKeyJoinColumns({";
- String expected2 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@MapKeyJoinColumn(name = \"FOO\") })";
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@MapKeyJoinColumn(name = \"BAZ\"),";
- expected3 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @MapKeyJoinColumn(name = \"FOO\") })";
- joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> joinColumns = resourceField.getAnnotations(JPA2_0.MAP_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((MapKeyJoinColumn2_0Annotation) joinColumns.next()).getName());
- assertEquals("BAR", ((MapKeyJoinColumn2_0Annotation) joinColumns.next()).getName());
- assertEquals("FOO", ((MapKeyJoinColumn2_0Annotation) joinColumns.next()).getName());
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAP_KEY_JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAP_KEY_JOIN_COLUMNS));
- assertNotNull(resourceField.getAnnotation(0, JPA2_0.MAP_KEY_JOIN_COLUMN));
- assertEquals(3, resourceField.getAnnotationsSize(JPA2_0.MAP_KEY_JOIN_COLUMN));
- }
-
-
- public void testRemoveJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@MapKeyJoinColumns({";
- String expected2 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@MapKeyJoinColumn(name = \"FOO\") })";
- MapKeyJoinColumn2_0Annotation joinColumn = (MapKeyJoinColumn2_0Annotation) resourceField.addAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@MapKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")";
- resourceField.removeAnnotation(1, JPA2_0.MAP_KEY_JOIN_COLUMN);
- assertSourceContains(expected2, cu);
- assertSourceDoesNotContain("@MapKeyJoinColumns", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationTests.java
deleted file mode 100644
index eb24ff354d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapKeyTemporal2_0AnnotationTests.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalType;
-
-@SuppressWarnings("nls")
-public class MapKeyTemporal2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public MapKeyTemporal2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_TEMPORAL);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyTemporal");
- }
- });
- }
-
- private ICompilationUnit createTestTemporalWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAP_KEY_TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyTemporal(TemporalType.DATE)");
- }
- });
- }
-
- public void testTemporal() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_TEMPORAL);
- assertNotNull(temporal);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporalWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_TEMPORAL);
- assertEquals(TemporalType.DATE, temporal.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(JPA2_0.MAP_KEY_TEMPORAL);
-
- temporal.setValue(TemporalType.TIME);
-
- assertSourceContains("@MapKeyTemporal(TIME)", cu);
-
- temporal.setValue(null);
-
- assertSourceDoesNotContain("@MapKeyTemporal(", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapsId2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapsId2_0AnnotationTests.java
deleted file mode 100644
index ea19e54fb6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/MapsId2_0AnnotationTests.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-
-@SuppressWarnings("nls")
-public class MapsId2_0AnnotationTests
- extends JavaResourceModel2_0TestCase
-{
- public MapsId2_0AnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestMapsId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAPS_ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapsId");
- }
- });
- }
-
- private ICompilationUnit createTestMapsIdWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.MAPS_ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapsId(\"foo\")");
- }
- });
- }
-
- public void testMapsId() throws Exception {
- ICompilationUnit cu = this.createTestMapsId();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapsIdWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertEquals("foo", annotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMapsId();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapsId2_0Annotation annotation = (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- assertSourceContains("@MapsId(\"foo\")", cu);
-
- annotation.setValue(null);
- assertSourceContains("@MapsId", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToMany2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToMany2_0AnnotationTests.java
deleted file mode 100644
index 9f45b12f7b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToMany2_0AnnotationTests.java
+++ /dev/null
@@ -1,413 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class OneToMany2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public OneToMany2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToMany() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertNotNull(oneToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToMany.getFetch());
-
- assertSourceContains("@OneToMany(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(null);
- assertNull(oneToMany.getFetch());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity(null);
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToMany.getFullyQualifiedTargetEntityClassName());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", oneToMany.getTargetEntity());
-
- assertEquals("Foo", oneToMany.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
- }
-
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(null, oneToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertNull(oneToMany.getMappedBy());
- oneToMany.setMappedBy("bar");
- assertEquals("bar", oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
-
- oneToMany.setMappedBy(null);
- assertNull(oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertSourceContains("@OneToMany(cascade = ALL)", cu);
-
- assertTrue(oneToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(true);
- assertSourceContains("@OneToMany(cascade = MERGE)", cu);
-
- assertTrue(oneToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadePersist());
-
- oneToMany.setCascadePersist(true);
- assertSourceContains("@OneToMany(cascade = PERSIST)", cu);
-
- assertTrue(oneToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeRemove(true);
- assertSourceContains("@OneToMany(cascade = REMOVE)", cu);
-
- assertTrue(oneToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRefresh());
-
- oneToMany.setCascadeRefresh(true);
- assertSourceContains("@OneToMany(cascade = REFRESH)", cu);
-
- assertTrue(oneToMany.isCascadeRefresh());
- }
-
- public void testSetCascadeDetach() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeDetach());
-
- oneToMany.setCascadeDetach(true);
- assertSourceContains("@OneToMany(cascade = DETACH)", cu);
-
- assertTrue(oneToMany.isCascadeDetach());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertTrue(oneToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToMany(cascade = CascadeType.ALL)", cu);
-
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);
- assertFalse(oneToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
- assertTrue(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeMerge(false);
- assertSourceContains("@OneToMany(cascade = REMOVE)", cu);
-
- oneToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToOne2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToOne2_0AnnotationTests.java
deleted file mode 100644
index 28b8bedbd7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OneToOne2_0AnnotationTests.java
+++ /dev/null
@@ -1,463 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-
-@SuppressWarnings("nls")
-public class OneToOne2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- public OneToOne2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToOne() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertNotNull(oneToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToOne.getFetch());
-
- assertSourceContains("@OneToOne(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(null);
- assertNull(oneToOne.getFetch());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity(null);
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToOne.getFullyQualifiedTargetEntityClassName());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", oneToOne.getTargetEntity());
-
- assertEquals("Foo", oneToOne.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
- assertSourceContains("@OneToOne(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(null);
- assertNull(oneToOne.getOptional());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(null, oneToOne.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertNull(oneToOne.getMappedBy());
- oneToOne.setMappedBy("bar");
- assertEquals("bar", oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
-
- oneToOne.setMappedBy(null);
- assertNull(oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertSourceContains("@OneToOne(cascade = ALL)", cu);
-
- assertTrue(oneToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(true);
- assertSourceContains("@OneToOne(cascade = MERGE)", cu);
-
- assertTrue(oneToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadePersist());
-
- oneToOne.setCascadePersist(true);
- assertSourceContains("@OneToOne(cascade = PERSIST)", cu);
-
- assertTrue(oneToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeRemove(true);
- assertSourceContains("@OneToOne(cascade = REMOVE)", cu);
-
- assertTrue(oneToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRefresh());
-
- oneToOne.setCascadeRefresh(true);
- assertSourceContains("@OneToOne(cascade = REFRESH)", cu);
-
- assertTrue(oneToOne.isCascadeRefresh());
- }
-
- public void testSetCascadeDetach() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeDetach());
-
- oneToOne.setCascadeDetach(true);
- assertSourceContains("@OneToOne(cascade = DETACH)", cu);
-
- assertTrue(oneToOne.isCascadeDetach());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertTrue(oneToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToOne(cascade = CascadeType.ALL)", cu);
-
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);
- assertFalse(oneToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
- assertTrue(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeMerge(false);
- assertSourceContains("@OneToOne(cascade = REMOVE)", cu);
-
- oneToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OrderColumn2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OrderColumn2_0AnnotationTests.java
deleted file mode 100644
index 68aaca4c4f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/OrderColumn2_0AnnotationTests.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OrderColumn2_0Annotation;
-
-@SuppressWarnings("nls")
-public class OrderColumn2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public OrderColumn2_0AnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOrderColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ORDER_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderColumn");
- }
- });
- }
-
- private ICompilationUnit createTestOrderColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ORDER_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestOrderColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ORDER_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestOrderColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA2_0.ORDER_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUpdatable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@OrderColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@OrderColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@OrderColumn(nullable = false)", cu);
-
- column.setNullable(null);
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@OrderColumn(insertable = false)", cu);
-
- column.setInsertable(null);
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestOrderColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- OrderColumn2_0Annotation column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@OrderColumn(updatable = false)", cu);
-
- column.setUpdatable(null);
-
- column = (OrderColumn2_0Annotation) resourceField.getAnnotation(JPA2_0.ORDER_COLUMN);
- assertNotNull(column);
- assertSourceContains("@OrderColumn", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationTests.java
deleted file mode 100644
index 971b31af4d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/jpa2/resource/java/SequenceGenerator2_0AnnotationTests.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.SequenceGenerator2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-/**
- * SequenceGenerator2_0Tests
- */
-@SuppressWarnings("nls")
-public class SequenceGenerator2_0AnnotationTests extends JavaResourceModel2_0TestCase {
-
- private static final String GENERATOR_CATALOG = "TEST_CATALOG";
- private static final String GENERATOR_SCHEMA = "TEST_SCHEMA";
-
- public SequenceGenerator2_0AnnotationTests(String name) {
- super(name);
- }
-
- // ********** catalog **********
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithCatalog();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- SequenceGenerator2_0Annotation sequenceGenerator = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, sequenceGenerator.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithCatalog();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- SequenceGenerator2_0Annotation sequenceGenerator = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, sequenceGenerator.getCatalog());
-
- sequenceGenerator.setCatalog("foo");
- assertEquals("foo", sequenceGenerator.getCatalog());
-
- assertSourceContains("@SequenceGenerator(catalog = \"foo\")", cu);
-
- sequenceGenerator.setCatalog(null);
- assertNull(sequenceGenerator.getCatalog());
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
- }
-
- // ********** schema **********
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSchema();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- SequenceGenerator2_0Annotation sequenceGenerator = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, sequenceGenerator.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSchema();
- JavaResourceType resourceType = this.buildJavaResourceType(cu);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- SequenceGenerator2_0Annotation sequenceGenerator = (SequenceGenerator2_0Annotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, sequenceGenerator.getSchema());
-
- sequenceGenerator.setSchema("foo");
- assertEquals("foo", sequenceGenerator.getSchema());
-
- assertSourceContains("@SequenceGenerator(schema = \"foo\")", cu);
-
- sequenceGenerator.setSchema(null);
- assertNull(sequenceGenerator.getSchema());
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
- }
-
- // ********** utility **********
-
- protected ICompilationUnit createTestSequenceGeneratorWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithCatalog() throws Exception {
- return this.createTestSequenceGeneratorWithStringElement("catalog", GENERATOR_CATALOG);
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithSchema() throws Exception {
- return this.createTestSequenceGeneratorWithStringElement("schema", GENERATOR_SCHEMA);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaEntityGenMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaEntityGenMetadataTests.java
deleted file mode 100644
index e21c902e3f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaEntityGenMetadataTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.metadata;
-
-import junit.framework.Assert;
-
-import org.eclipse.jpt.jpa.core.prefs.JpaEntityGenPreferencesManager;
-
-/**
- * JpaEntityGenMetadataTests
- */
-public class JpaEntityGenMetadataTests extends JpaMetadataTests {
-
- public static final String DEFAULT_PACKAGE_PREF_KEY = "entitygen.DEFAULT_PACKAGE"; //$NON-NLS-1$
-
- public static final String DEFAULT_PACKAGE_TEST_VALUE = "test.model"; //$NON-NLS-1$
-
- protected JpaEntityGenPreferencesManager projectPrefsManager;
-
- // ********** constructor **********
-
- public JpaEntityGenMetadataTests(String name) {
- super(name);
- }
-
- // ********** overrides **********
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.projectPrefsManager = new JpaEntityGenPreferencesManager(this.getJavaProject().getProject());
- Assert.assertNotNull(this.projectPrefsManager);
- }
-
- // ********** tests **********
-
- public void testDefaultPackageWorkspaceMetadata() throws Exception {
- JpaEntityGenPreferencesManager.setDefaultPackageWorkspacePreference(DEFAULT_PACKAGE_TEST_VALUE);
- JpaEntityGenPreferencesManager.getLegacyWorkspacePreferences().flush();
-
- String value = this.getWorkspacePrefs().get(DEFAULT_PACKAGE_PREF_KEY);
- Assert.assertNotNull(value);
- Assert.assertTrue(DEFAULT_PACKAGE_TEST_VALUE.equals(value));
-
- JpaEntityGenPreferencesManager.removeLegacyWorkspacePreference(DEFAULT_PACKAGE_PREF_KEY);
- }
-
- public void testDefaultPackageProjectMetadata() throws Exception {
-
- this.projectPrefsManager.setDefaultPackagePreference(DEFAULT_PACKAGE_TEST_VALUE);
- this.projectPrefsManager.getLegacyProjectPreferences().flush();
-
- String value = this.getProjectPrefs().get(DEFAULT_PACKAGE_PREF_KEY);
- Assert.assertNotNull(value);
- Assert.assertTrue(DEFAULT_PACKAGE_TEST_VALUE.equals(value));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaJpqlMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaJpqlMetadataTests.java
deleted file mode 100644
index df1daea08d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaJpqlMetadataTests.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.metadata;
-
-import junit.framework.Assert;
-
-import org.eclipse.jpt.jpa.core.prefs.JpaEntityGenPreferencesManager;
-import org.eclipse.jpt.jpa.core.prefs.JpaJpqlPreferencesManager;
-
-/**
- * JpaJpqlMetadataTests
- */
-public class JpaJpqlMetadataTests extends JpaMetadataTests {
-
- public static final String CASE_PREF_KEY = "jpqlIdentifier.CASE";
- public static final String MATCH_FIRST_CHARACTER_CASE_PREF_KEY = "jpqlIdentifier.MATCH_FIRST_CHARACTER_CASE";
-
- public static final String CASE_TEST_VALUE = JpaJpqlPreferencesManager.JPQL_IDENTIFIER_UPPERCASE_PREF_VALUE;
- public static final boolean MATCH_FIRST_CHARACTER_CASE_TEST_VALUE = ! JpaJpqlPreferencesManager.DEFAULT_MATCH_FIRST_CHARACTER_CASE;
-
- // ********** constructor **********
-
- public JpaJpqlMetadataTests(String name) {
- super(name);
- }
-
- // ********** tests **********
-
- public void testIdentifiersCaseWorkspaceMetadata() throws Exception {
- JpaJpqlPreferencesManager.setIdentifiersCaseWorkspacePreference(CASE_TEST_VALUE);
- JpaJpqlPreferencesManager.getLegacyWorkspacePreferences().flush();
-
- String value = this.getWorkspacePrefs().get(CASE_PREF_KEY);
- Assert.assertNotNull(value);
- Assert.assertTrue(CASE_TEST_VALUE.equals(value));
-
- JpaEntityGenPreferencesManager.removeLegacyWorkspacePreference(CASE_PREF_KEY);
- }
-
- public void testMatchFirstCharacterCaseWorkspaceMetadata() throws Exception {
- JpaJpqlPreferencesManager.setMatchFirstCharacterCaseWorkspacePreference(MATCH_FIRST_CHARACTER_CASE_TEST_VALUE);
- JpaJpqlPreferencesManager.getLegacyWorkspacePreferences().flush();
-
- String stringValue = this.getWorkspacePrefs().get(MATCH_FIRST_CHARACTER_CASE_PREF_KEY);
- Assert.assertNotNull(stringValue);
- boolean value = Boolean.valueOf(stringValue);
- Assert.assertTrue(value == MATCH_FIRST_CHARACTER_CASE_TEST_VALUE);
-
- JpaEntityGenPreferencesManager.removeLegacyWorkspacePreference(MATCH_FIRST_CHARACTER_CASE_PREF_KEY);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaMetadataTests.java
deleted file mode 100644
index 2997c41acc..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaMetadataTests.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.metadata;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Properties;
-import java.util.Set;
-
-import org.eclipse.core.resources.IWorkspaceRoot;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.preferences.IEclipsePreferences;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-
-/**
- * JpaMetadataTests
- */
-public abstract class JpaMetadataTests extends AnnotationTestCase {
-
- private static final String SETTINGS_DIR = ".settings/";
- private static final String ECLIPSE_CORE_SETTINGS_DIR = ".metadata/.plugins/org.eclipse.core.runtime/" + SETTINGS_DIR;
- public static final String PREFS_FILE_NAME = JptJpaCorePlugin.LEGACY_PLUGIN_ID + ".prefs";
-
- protected IEclipsePreferences workspacePreferences;
- private String eclipseCoreSettingsDir;
- private String projectSettingsDir;
-
- // ********** constructor **********
-
- protected JpaMetadataTests(String name) {
- super(name);
- }
-
- // ********** overrides **********
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- IPath workspacePath = this.getWorkspaceRoot().getLocation();
- this.eclipseCoreSettingsDir = workspacePath + "/" + ECLIPSE_CORE_SETTINGS_DIR;
-
- IPath projectPath = this.javaProject.getProject().getLocation();
- this.projectSettingsDir = projectPath + "/" + SETTINGS_DIR;
- }
-
- // ********** preferences **********
-
- protected Map<String, String> getWorkspacePrefs() {
- return this.getSettings(this.eclipseCoreSettingsDir + PREFS_FILE_NAME);
- }
-
- protected Map<String, String> getProjectPrefs() {
- return this.getSettings(this.projectSettingsDir + PREFS_FILE_NAME);
- }
-
- // ********** internal methods **********
-
- private IWorkspaceRoot getWorkspaceRoot() {
- return ResourcesPlugin.getWorkspace().getRoot();
- }
-
- private Map<String, String> getSettings(String settingsPath) {
- Set<Entry<Object, Object>> settingsSet = null;
- try {
- settingsSet = this.loadMetadata(settingsPath);
- }
- catch (IOException e) {
- throw new RuntimeException("Missing: " + settingsPath, e);
- }
-
- Map<String, String> settings = new HashMap<String, String>();
- for(Entry<Object, Object> property : settingsSet) {
- settings.put((String)property.getKey(), (String)property.getValue());
- }
- return settings;
- }
-
- private Set<Entry<Object, Object>> loadMetadata(String metadataPath) throws IOException {
- FileInputStream stream = new FileInputStream(metadataPath);
-
- Properties properties = new Properties();
- properties.load(stream);
- stream.close();
-
- return properties.entrySet();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaValidationMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaValidationMetadataTests.java
deleted file mode 100644
index 00394e1e6f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JpaValidationMetadataTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.metadata;
-
-import junit.framework.Assert;
-
-import org.eclipse.jpt.jpa.core.internal.validation.JpaValidationMessages;
-import org.eclipse.jpt.jpa.core.prefs.JpaValidationPreferencesManager;
-
-/**
- * JpaValidationMetadataTests
- */
-public class JpaValidationMetadataTests extends JpaMetadataTests {
-
- public static final String WORKSPACE_OVERRIDEN_PREF_KEY = "workspace_preferences_overriden";
- public static final String PERSISTENCE_NO_PERSISTENCE_UNIT_PREF_KEY = "problem." + JpaValidationMessages.PERSISTENCE_NO_PERSISTENCE_UNIT;
-
- public static final boolean WORKSPACE_OVERRIDEN_TEST_VALUE = true;
- public static final String PERSISTENCE_NO_PERSISTENCE_UNIT_TEST_VALUE = JpaValidationPreferencesManager.INFO;
-
- protected JpaValidationPreferencesManager projectPrefsManager;
-
- // ********** constructor **********
-
- public JpaValidationMetadataTests(String name) {
- super(name);
- }
-
- // ********** overrides **********
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.projectPrefsManager = new JpaValidationPreferencesManager(this.getJavaProject().getProject());
- Assert.assertNotNull(this.projectPrefsManager);
- }
-
- // ********** tests **********
-
- public void testWorkspaceLevelProblemMetadata() throws Exception {
- JpaValidationPreferencesManager.setWorkspaceLevelProblemPreference(
- JpaValidationMessages.PERSISTENCE_NO_PERSISTENCE_UNIT,
- PERSISTENCE_NO_PERSISTENCE_UNIT_TEST_VALUE);
- JpaValidationPreferencesManager.getLegacyWorkspacePreferences().flush();
-
- String value = this.getWorkspacePrefs().get(PERSISTENCE_NO_PERSISTENCE_UNIT_PREF_KEY);
- Assert.assertNotNull(value);
- Assert.assertTrue(PERSISTENCE_NO_PERSISTENCE_UNIT_TEST_VALUE.equals(value));
-
- JpaValidationPreferencesManager.removeLegacyWorkspacePreference(PERSISTENCE_NO_PERSISTENCE_UNIT_PREF_KEY);
- }
-
- public void testProjectHasSpecificOptionsMetadata() throws Exception {
-
- this.projectPrefsManager.setProjectHasSpecificOptions(WORKSPACE_OVERRIDEN_TEST_VALUE);
- this.projectPrefsManager.getLegacyProjectPreferences().flush();
-
- String stringValue = this.getProjectPrefs().get(WORKSPACE_OVERRIDEN_PREF_KEY);
- Assert.assertNotNull(stringValue);
- boolean value = Boolean.valueOf(stringValue);
- Assert.assertTrue(value == WORKSPACE_OVERRIDEN_TEST_VALUE);
- }
-
- public void testProjectLevelProblemMetadata() throws Exception {
-
- this.projectPrefsManager.setProjectLevelProblemPreference(
- JpaValidationMessages.PERSISTENCE_NO_PERSISTENCE_UNIT,
- PERSISTENCE_NO_PERSISTENCE_UNIT_TEST_VALUE);
- this.projectPrefsManager.getLegacyProjectPreferences().flush();
-
- String value = this.getProjectPrefs().get(PERSISTENCE_NO_PERSISTENCE_UNIT_PREF_KEY);
- Assert.assertNotNull(value);
- Assert.assertTrue(PERSISTENCE_NO_PERSISTENCE_UNIT_TEST_VALUE.equals(value));
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JptJpaCoreMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JptJpaCoreMetadataTests.java
deleted file mode 100644
index 41ba644d5c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/metadata/JptJpaCoreMetadataTests.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.metadata;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * JptJpaCoreMetadataTests
- */
-public class JptJpaCoreMetadataTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaCoreMetadataTests.class.getPackage().getName());
- suite.addTestSuite(JpaEntityGenMetadataTests.class);
- suite.addTestSuite(JpaJpqlMetadataTests.class);
- suite.addTestSuite(JpaValidationMetadataTests.class);
- return suite;
- }
-
- private JptJpaCoreMetadataTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JpaProjectManagerTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JpaProjectManagerTests.java
deleted file mode 100644
index afa17889bd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JpaProjectManagerTests.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.model;
-
-import java.io.BufferedInputStream;
-import java.io.ByteArrayInputStream;
-import java.io.InputStream;
-import junit.framework.TestCase;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestFacetedProject;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestPlatformProject;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.JpaProjectManager;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class JpaProjectManagerTests
- extends TestCase
-{
- /** carriage return */
- public static final String CR = System.getProperty("line.separator");
-
- private TestFacetedProject testProjectHarness;
-
-
- public JpaProjectManagerTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- if (this.debug()) {
- this.printName();
- }
- this.testProjectHarness = this.buildTestProjectHarness();
- }
-
- private boolean debug() {
- Boolean debug = (Boolean) ReflectionTools.executeStaticMethod(this.getGenericJpaProjectManagerClass(), "debug");
- return debug.booleanValue();
- }
-
- // InternalJpaProjectManager is package-private
- private Class<?> getGenericJpaProjectManagerClass() {
- return this.getJpaProjectManager().getClass();
- }
-
- protected JpaProjectManager getJpaProjectManager() {
- return (JpaProjectManager) ResourcesPlugin.getWorkspace().getAdapter(JpaProjectManager.class);
- }
-
- 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.testProjectHarness.getProject().delete(true, true, null);
- this.testProjectHarness = null;
- super.tearDown();
- }
-
- private JpaProject getJpaProject() {
- return this.getJpaProject(this.getProject());
- }
-
- private JpaProject getJpaProject(IProject project) {
- try {
- return this.getJpaProject_(project);
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private JpaProject getJpaProject_(IProject project) throws InterruptedException {
- return this.getJpaProjectReference(project).getValue();
- }
-
- private JpaProject.Reference getJpaProjectReference(IProject project) {
- return (JpaProject.Reference) project.getAdapter(JpaProject.Reference.class);
- }
-
- private IProject getProject() {
- return this.testProjectHarness.getProject();
- }
-
- /**
- * Builds a project with the java and utility facets installed, and with
- * pre-existing entities added.
- */
- private TestFacetedProject buildTestProjectHarness() throws Exception {
- TestJavaProject tjp = TestJavaProject.buildJavaProject(this.getClass().getSimpleName(), true);
- tjp.createCompilationUnit("test.pkg", "TestEntity.java", "@Entity public class TestEntity {}");
- tjp.createCompilationUnit("test.pkg", "TestEntity2.java", "@Entity public class TestEntity2 {}");
- return tjp;
- }
-
- private IFile getFile(TestPlatformProject p, String path) {
- return p.getProject().getFile(new Path(path));
- }
-
- public void testJpaProjectManager() {
- assertNotNull(this.getJpaProjectManager());
- }
-
- private IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = DataModelFactory.createDataModel(new JpaFacetInstallDataModelProvider());
- dataModel.setProperty(JpaFacetInstallDataModelProperties.CREATE_ORM_XML, Boolean.TRUE);
- return dataModel;
- }
-
- public void testProjectCloseReopen() throws Exception {
- this.testProjectHarness.installFacet(JpaFacet.ID, "1.0", buildJpaConfigDataModel());
- JpaProject jpaProject = this.getJpaProject();
- assertNotNull(jpaProject);
-
- this.testProjectHarness.getProject().close(null);
- assertFalse("Project is not closed", this.testProjectHarness.getProject().isOpen());
- jpaProject = this.getJpaProject();
- assertNull("JpaProject is not null", jpaProject);
-
- this.testProjectHarness.getProject().open(null);
- assertTrue(this.testProjectHarness.getProject().isOpen());
- jpaProject = this.getJpaProject();
- assertNotNull("JpaProject is null", jpaProject);
- assertEquals(4, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity2.java")));
-
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/META-INF/orm.xml")));
- }
-
- public void testProjectDeleteReimport() throws Exception {
- this.testProjectHarness.installFacet(JpaFacet.ID, "1.0", buildJpaConfigDataModel());
- JpaProject jpaProject = this.getJpaProject();
- assertNotNull(jpaProject);
- assertEquals(1, CollectionTools.size(this.getJpaProjectManager().waitToGetJpaProjects()));
-
- this.testProjectHarness.getProject().delete(false, true, null);
- jpaProject = this.getJpaProject();
- assertNull(jpaProject);
- assertEquals(0, CollectionTools.size(this.getJpaProjectManager().waitToGetJpaProjects()));
- assertEquals(0, ResourcesPlugin.getWorkspace().getRoot().getProjects().length);
-
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(this.testProjectHarness.getProject().getName());
- project.create(null);
- assertEquals(1, ResourcesPlugin.getWorkspace().getRoot().getProjects().length);
- project.open(null);
-
- assertTrue(project.isOpen());
- assertTrue(JpaFacet.isInstalled(project));
- jpaProject = this.getJpaProject(project);
- assertNotNull(jpaProject);
- assertEquals(4, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity2.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/META-INF/orm.xml")));
- }
-
- public void testFacetInstallUninstall() throws Exception {
- assertNull(this.getJpaProject());
-
- this.testProjectHarness.installFacet(JpaFacet.ID, "1.0", buildJpaConfigDataModel());
- assertEquals(1, CollectionTools.size(this.getJpaProjectManager().waitToGetJpaProjects()));
- JpaProject jpaProject = this.getJpaProject();
- assertNotNull(jpaProject);
- assertEquals(4, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity2.java")));
-
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/META-INF/orm.xml")));
-
- this.testProjectHarness.uninstallFacet(JpaFacet.ID, "1.0");
- assertEquals(0, CollectionTools.size(this.getJpaProjectManager().waitToGetJpaProjects()));
- jpaProject = this.getJpaProject();
- assertNull(jpaProject);
- }
-
- public void testEditFacetSettingsFileAddThenRemoveJpaFacet() throws Exception {
- assertNull(this.getJpaProject());
-
- // add the JPA facet by modifying the facet settings file directly
- IFile facetSettingsFile = this.getFile(this.testProjectHarness, ".settings/org.eclipse.wst.common.project.facet.core.xml");
- InputStream inStream = new BufferedInputStream(facetSettingsFile.getContents());
- int fileSize = inStream.available();
- byte[] buf = new byte[fileSize];
- inStream.read(buf);
- inStream.close();
-
- String oldDocument = new String(buf);
- String oldString = "<installed facet=\"java\" version=\"1.5\"/>";
- String newString = oldString + CR + " " + "<installed facet=\"jpt.jpa\" version=\"1.0\"/>";
- String newDocument = oldDocument.replaceAll(oldString, newString);
-
- facetSettingsFile.setContents(new ByteArrayInputStream(newDocument.getBytes()), false, false, null);
-
- assertEquals(1, CollectionTools.size(this.getJpaProjectManager().waitToGetJpaProjects()));
- JpaProject jpaProject = this.getJpaProject();
- assertNotNull(jpaProject);
- // persistence.xml and orm.xml do not get created in this situation (?)
- assertEquals(2, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity2.java")));
-// assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/persistence.xml")));
-// assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProject, "src/META-INF/orm.xml")));
-
-
- // now remove the JPA facet
- facetSettingsFile.setContents(new ByteArrayInputStream(oldDocument.getBytes()), false, false, null);
- assertEquals(0, CollectionTools.size(this.getJpaProjectManager().waitToGetJpaProjects()));
- jpaProject = this.getJpaProject();
- assertNull(jpaProject);
- }
-
- public void testEditFacetSettingsFileRemoveThenAddJpaFacet() throws Exception {
- this.testProjectHarness.installFacet(JpaFacet.ID, "1.0", buildJpaConfigDataModel());
- JpaProject jpaProject = this.getJpaProject();
- assertNotNull(jpaProject);
-
- // remove the JPA facet by modifying the facet settings file directly
- IFile facetSettingsFile = this.getFile(this.testProjectHarness, ".settings/org.eclipse.wst.common.project.facet.core.xml");
- InputStream inStream = new BufferedInputStream(facetSettingsFile.getContents());
- int fileSize = inStream.available();
- byte[] buf = new byte[fileSize];
- inStream.read(buf);
- inStream.close();
-
- String oldDocument = new String(buf);
- String oldString = "<installed facet=\"java\" version=\"1.5\"/>" + CR + " " + "<installed facet=\"jpt.jpa\" version=\"1.0\"/>";
- String newString = "<installed facet=\"java\" version=\"1.5\"/>";
- String newDocument = oldDocument.replaceAll(oldString, newString);
-
- facetSettingsFile.setContents(new ByteArrayInputStream(newDocument.getBytes()), false, false, null);
- assertEquals(0, CollectionTools.size(this.getJpaProjectManager().waitToGetJpaProjects()));
- jpaProject = this.getJpaProject();
- assertNull(jpaProject);
-
- // now add the JPA facet back
- facetSettingsFile.setContents(new ByteArrayInputStream(oldDocument.getBytes()), false, false, null);
- assertEquals(1, CollectionTools.size(this.getJpaProjectManager().waitToGetJpaProjects()));
- jpaProject = this.getJpaProject();
- assertNotNull(jpaProject);
- assertEquals(4, jpaProject.getJpaFilesSize());
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/test/pkg/TestEntity2.java")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/META-INF/persistence.xml")));
- assertNotNull(jpaProject.getJpaFile(this.getFile(this.testProjectHarness, "src/META-INF/orm.xml")));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JptJpaCoreModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JptJpaCoreModelTests.java
deleted file mode 100644
index 706de29305..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/model/JptJpaCoreModelTests.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.model;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptJpaCoreModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaCoreModelTests.class.getPackage().getName());
- suite.addTestSuite(JpaProjectManagerTests.class);
- return suite;
- }
-
- private JptJpaCoreModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/BaseJpaPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/BaseJpaPlatformTests.java
deleted file mode 100644
index a22c358b8a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/BaseJpaPlatformTests.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-
-@SuppressWarnings("nls")
-public class BaseJpaPlatformTests extends TestCase
-{
- protected TestJpaProject jpaProject;
-
- protected static final String PROJECT_NAME = "PlatformTestProject";
- protected static final String PACKAGE_NAME = "platform.test";
- protected static final String PERSISTENCE_XML_LOCATION = "src/META-INF/persistence.xml";
- protected static final String ORM_XML_LOCATION = "src/META-INF/orm.xml";
-
-
- public BaseJpaPlatformTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.jpaProject = this.buildJpaProject(PROJECT_NAME, false); // false = no auto-build
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJpaProject(projectName, autoBuild); // false = no auto-build
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.jpaProject.getProject().delete(true, true, null);
- this.jpaProject = null;
- super.tearDown();
- }
-
-// public void testPersistentTypes() throws CoreException, IOException {
-// IFile persistenceXmlIFile = jpaProject.getProject().getFile(PERSISTENCE_XML_LOCATION);
-// IJpaFile persistenceXmlJpaFile = jpaProject.getJpaProject().getJpaFile(persistenceXmlIFile);
-// PersistenceXmlRootContentNode persistenceRoot = (PersistenceXmlRootContentNode) persistenceXmlJpaFile.getContent();
-// XmlPersistence persistence = persistenceRoot.getPersistence();
-//
-// IFile ormXmlIFile = jpaProject.getProject().getFile(ORM_XML_LOCATION);
-// IJpaFile ormXmlJpaFile = jpaProject.getJpaProject().getJpaFile(ormXmlIFile);
-// XmlRootContentNode ormRoot = (XmlRootContentNode) ormXmlJpaFile.getContent();
-// EntityMappingsInternal entityMappings = ormRoot.getEntityMappings();
-//
-// // add xml persistent type
-// XmlEntityInternal xmlEntity = OrmFactory.eINSTANCE.createXmlEntityInternal();
-// xmlEntity.setSpecifiedName("XmlEntity");
-// entityMappings.getTypeMappings().add(xmlEntity);
-// entityMappings.eResource().save(null);
-// assertEquals(1, CollectionTools.size(jpaProject.getJpaProject().getPlatform().persistentTypes(PROJECT_NAME)));
-//
-// // add java persistent type
-// jpaProject.createType(PACKAGE_NAME, "JavaEntity.java",
-// "@Entity public class JavaEntity {}"
-// );
-// XmlJavaClassRef javaClassRef = PersistenceFactory.eINSTANCE.createJavaClassRef();
-// javaClassRef.setJavaClass(PACKAGE_NAME + ".JavaEntity");
-// persistence.getPersistenceUnits().get(0).getClasses().add(javaClassRef);
-// persistence.eResource().save(null);
-//
-// assertEquals(2, CollectionTools.size(jpaProject.getJpaProject().getPlatform().persistentTypes(PROJECT_NAME)));
-// }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformExtensionTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformExtensionTests.java
deleted file mode 100644
index b387c46c0e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformExtensionTests.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.platform;
-
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IExtensionRegistry;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-
-@SuppressWarnings("nls")
-public class JpaPlatformExtensionTests extends ContextModelTestCase
-{
- public static final String TEST_PLATFORM_ID = TestJpaPlatformProvider.ID;
- public static final JpaPlatformDescription TEST_PLATFORM_DESC =
- JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(TEST_PLATFORM_ID);
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
-
- protected TestJpaProject testProject;
-
- public JpaPlatformExtensionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- verifyExtensionTestProjectExists();
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return super.buildJpaProject(PROJECT_NAME, autoBuild, this.buildConfig());
- }
-
- protected IDataModel buildConfig() throws Exception {
- IActionConfigFactory configFactory = new JpaFacetInstallDataModelProvider();
- IDataModel config = (IDataModel) configFactory.create();
- config.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_1_0.getVersionString());
- config.setProperty(JpaFacetDataModelProperties.PLATFORM, TEST_PLATFORM_DESC);
- return config;
- }
-
- public static void verifyExtensionTestProjectExists() {
- IExtensionRegistry registry = Platform.getExtensionRegistry();
- IExtensionPoint extensionPoint =
- registry.getExtensionPoint(JptJpaCorePlugin.PLUGIN_ID, "jpaPlatform");
- IExtension[] extensions = extensionPoint.getExtensions();
- boolean extensionFound = false;
- for (IExtension extension : extensions) {
- if (extension.getContributor().getName().equals(ExtensionTestPlugin.PLUGIN_ID)) {
- extensionFound = true;
- }
- }
- if (!extensionFound) {
- throw new RuntimeException("Missing Extension " + TEST_PLATFORM_ID + ". The ExtensionTestProject plugin must be in your testing workspace.");
- }
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- public void testAllJpaPlatformIds() {
- assertTrue(CollectionTools.size(JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatforms()) >= 2);
- }
-
- public void testJpaPlatformLabel() {
- assertEquals(TEST_PLATFORM_LABEL, JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(TEST_PLATFORM_ID).getLabel());
- }
-
- public void testJpaPlatform() {
- assertNotNull(JptJpaCorePlugin.getJpaPlatformManager().buildJpaPlatformImplementation(this.testProject.getProject()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformTests.java
deleted file mode 100644
index 3766cc134f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/platform/JpaPlatformTests.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.platform;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaPlatform;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaTypeMapping;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetInstallDataModelProvider;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.JavaTestAttributeMapping;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.JavaTestAttributeMappingDefinition;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.JavaTestTypeMapping;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.JavaTestTypeMappingDefinition;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJavaBasicMapping;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJavaEntity;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaFactory;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.project.facet.core.IActionConfigFactory;
-
-@SuppressWarnings("nls")
-public class JpaPlatformTests
- extends ContextModelTestCase
-{
- protected TestJpaProject testProject;
-
- public static final String TEST_PLUGIN_CLASS = ExtensionTestPlugin.class.getName();
- public static final String TEST_PLUGIN_ID = "org.eclipse.jpt.jpa.core.tests.extension.resource";
-
- public static final String TEST_PLATFORM_CLASS_NAME = TestJpaPlatformProvider.class.getName();
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
- public static final String TEST_JPA_FACTORY = TestJpaFactory.class.getName();
- public static final String TEST_TYPE_MAPPING_PROVIDER_CLASS = JavaTestTypeMappingDefinition.class.getName();
- public static final String TEST_ATTRIBUTE_MAPPING_PROVIDER_CLASS = JavaTestAttributeMappingDefinition.class.getName();
-
- public JpaPlatformTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- JpaPlatformExtensionTests.verifyExtensionTestProjectExists();
- }
-
- @Override
- protected TestJavaProject buildJavaProject(boolean autoBuild) throws Exception {
- return super.buildJpaProject(PROJECT_NAME, autoBuild, this.buildConfig());
- }
-
- protected IDataModel buildConfig() throws Exception {
- IActionConfigFactory configFactory = new JpaFacetInstallDataModelProvider();
- IDataModel config = (IDataModel) configFactory.create();
- config.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_1_0.getVersionString());
- config.setProperty(
- JpaFacetDataModelProperties.PLATFORM,
- JptJpaCorePlugin.getJpaPlatformManager().getJpaPlatform(TestJpaPlatformProvider.ID));
- return config;
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
-
- protected JpaPlatform jpaPlatform() {
- return this.getJpaProject().getJpaPlatform();
- }
-
- public void testJpaFactory() {
- assertTrue(jpaPlatform().getJpaFactory().getClass().getName().equals(TEST_JPA_FACTORY));
- }
-
- public void testBuildJavaTypeMappingFromMappingKey() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- this.getJavaPersistentType().setMappingKey(JavaTestTypeMapping.TEST_TYPE_MAPPING_KEY);
- JavaTypeMapping mapping = this.getJavaPersistentType().getMapping();
- assertTrue(mapping instanceof JavaTestTypeMapping);
-
- this.getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- mapping = this.getJavaPersistentType().getMapping();
- assertTrue(mapping instanceof TestJavaEntity);
- }
-
- public void testBuildJavaAttributeMappingFromMappingKey() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaPersistentAttribute javaAttribute = this.getJavaPersistentType().getAttributeNamed("name");
- javaAttribute.setMappingKey(JavaTestAttributeMapping.TEST_ATTRIBUTE_MAPPING_KEY);
- JavaAttributeMapping mapping = javaAttribute.getMapping();
- assertTrue(mapping instanceof JavaTestAttributeMapping);
-
- javaAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- mapping = javaAttribute.getMapping();
- assertTrue(mapping instanceof TestJavaBasicMapping);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/projects/TestJpaProject.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/projects/TestJpaProject.java
deleted file mode 100644
index 25a39ccccb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/projects/TestJpaProject.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2005, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.projects;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * This builds and holds a "JPA" project.
- * Support for adding packages and types.
- *
- * The JPA project's settings (platform, database connection, etc.) can be
- * controlled by building a data model and passing it into the constructor.
- */
-@SuppressWarnings("nls")
-public class TestJpaProject
- extends TestJavaProject
-{
- public static final String JPA_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.jpa.jar";
- public static final String ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY = "org.eclipse.jpt.eclipselink.jar";
-
-
- // ********** builders **********
-
- public static TestJpaProject buildJpaProject(String baseProjectName, boolean autoBuild, IDataModel jpaConfig)
- throws CoreException {
- return new TestJpaProject(baseProjectName, autoBuild, jpaConfig);
- }
-
- public static TestJpaProject buildJpaProject(String baseProjectName, boolean autoBuild)
- throws CoreException {
- return buildJpaProject(baseProjectName, autoBuild, null);
- }
-
- // ********** constructors/initialization **********
-
- public TestJpaProject(String projectName) throws CoreException {
- this(projectName, false);
- }
-
- public TestJpaProject(String projectName, boolean autoBuild) throws CoreException {
- this(projectName, autoBuild, null);
- }
-
- public TestJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig) throws CoreException {
- super(projectName, autoBuild);
- String jpaFacetVersion = JpaFacet.VERSION_1_0.getVersionString();
- if (jpaConfig != null) {
- jpaFacetVersion = jpaConfig.getStringProperty(IFacetDataModelProperties.FACET_VERSION_STR);
- }
- this.installFacet("jst.utility", "1.0");
- this.installFacet(JpaFacet.ID, jpaFacetVersion, jpaConfig);
- this.addJar(jpaJarName());
- if (eclipseLinkJarName() != null) {
- this.addJar(eclipseLinkJarName());
- }
- this.getJpaProject().setDiscoversAnnotatedClasses(true);
- }
-
- public static String jpaJarName() {
- return getSystemProperty(JPA_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- public static String eclipseLinkJarName() {
- return getSystemProperty(ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY);
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
-
- // ********** public methods **********
-
- public JpaProject getJpaProject() {
- try {
- return this.getJpaProject_();
- } catch (InterruptedException ex) {
- throw new RuntimeException(ex);
- }
- }
-
- private JpaProject getJpaProject_() throws InterruptedException {
- return this.getJpaProjectReference().getValue();
- }
-
- private JpaProject.Reference getJpaProjectReference() {
- return (JpaProject.Reference) this.getProject().getAdapter(JpaProject.Reference.class);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/JptJpaCoreResourceModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/JptJpaCoreResourceModelTests.java
deleted file mode 100644
index 856925d1f3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/JptJpaCoreResourceModelTests.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.core.tests.internal.JptJpaCoreTests;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.resource.java.JavaResource2_0Tests;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JptJavaResourceTests;
-
-/**
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- */
-public class JptJpaCoreResourceModelTests
- extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaCoreResourceModelTests.class.getPackage().getName());
-
- if (JptJpaCoreTests.requiredJarsExists()) {
- suite.addTest(JptJavaResourceTests.suite());
- suite.addTest(JavaResource2_0Tests.suite());
- } else {
- suite.addTest(TestSuite.warning(JptJpaCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptJpaCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverrideTests.java
deleted file mode 100644
index fb8831a64f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverrideTests.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class AssociationOverrideTests extends JpaJavaResourceModelTestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
-
- public AssociationOverrideTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- private AssociationOverrideAnnotation getAssociationOverrideAnnotationAt(JavaResourceMember resourceMember, int index) {
- return (AssociationOverrideAnnotation) resourceMember.getAnnotation(index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverride(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- }
-
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(0, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertNull(associationOverride.joinColumnAt(2).getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = @JoinColumn)", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverridesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverridesTests.java
deleted file mode 100644
index 10434abf8f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AssociationOverridesTests.java
+++ /dev/null
@@ -1,344 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class AssociationOverridesTests extends JpaJavaResourceModelTestCase {
-
- private static final String ASSOCIATION_OVERRIDE_NAME = "MY_ASSOCIATION_OVERRIDE";
-
- public AssociationOverridesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAssociationOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverrideWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ASSOCIATION_OVERRIDE, JPA.ASSOCIATION_OVERRIDES, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn}))");
- }
- });
- }
-
- private ICompilationUnit createTestAssociationOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ASSOCIATION_OVERRIDE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\"))");
- }
- });
- }
-
- private AssociationOverrideAnnotation getAssociationOverrideAnnotationAt(JavaResourceMember resourceMember, int index) {
- return (AssociationOverrideAnnotation) resourceMember.getAnnotation(index, JPA.ASSOCIATION_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(associationOverride);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName("Foo");
- assertEquals("Foo", associationOverride.getName());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- assertEquals(ASSOCIATION_OVERRIDE_NAME, associationOverride.getName());
-
- associationOverride.setName(null);
- assertNull(associationOverride.getName());
-
- assertSourceDoesNotContain("@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AssociationOverride", cu);
- assertSourceContains("@AssociationOverrides", cu);
- }
-
- public void testAddAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.ASSOCIATION_OVERRIDE));
- }
-
- public void testAddAssociationOverrideToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AssociationOverride(name = \"BAZ\"),";
- expected3 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")), @AssociationOverride(name = \"BAR\") })";
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(JPA.ASSOCIATION_OVERRIDE).iterator();
- assertEquals("BAZ", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("FOO", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("BAR", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
-
- assertNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ASSOCIATION_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ASSOCIATION_OVERRIDE));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.ASSOCIATION_OVERRIDE));
- }
-
- public void testRemoveAssociationOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAssociationOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- String expected1 = "@AssociationOverrides({";
- String expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\")),";
- String expected3 = "@AssociationOverride(name = \"BAR\") })";
-
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AssociationOverride(name = \"FOO\", joinColumns = @JoinColumn(name = \"FOO\", columnDefinition = \"BAR\", referencedColumnName = \"BAZ\"))";
- resourceType.removeAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- assertSourceContains(expected2, cu);
- assertSourceDoesNotContain("@AssociationOverrides", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(0, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- associationOverride.addJoinColumn(0);
- associationOverride.addJoinColumn(1);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- associationOverride.addJoinColumn(0).setName("FOO");
- associationOverride.addJoinColumn(1);
- associationOverride.addJoinColumn(0).setName("BAR");
-
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- associationOverride.addJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(1);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn}))", cu);
-
- associationOverride.removeJoinColumn(0);
- joinColumns = associationOverride.getJoinColumns().iterator();
- assertNull(joinColumns.next().getName());
- assertEquals(false, joinColumns.hasNext());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = @JoinColumn))", cu);
-
-
- associationOverride.setName(null);
- associationOverride.removeJoinColumn(0);
- assertSourceDoesNotContain("@JoinColumn", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
-
- associationOverride.moveJoinColumn(2, 0);
- assertEquals("BAR", associationOverride.joinColumnAt(0).getName());
- assertNull(associationOverride.joinColumnAt(1).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- associationOverride.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn}))", cu);
- associationOverride.moveJoinColumn(0, 2);
- assertNull(associationOverride.joinColumnAt(0).getName());
- assertEquals("FOO", associationOverride.joinColumnAt(1).getName());
- assertEquals("BAR", associationOverride.joinColumnAt(2).getName());
- assertEquals(3, associationOverride.getJoinColumnsSize());
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")}))", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestAssociationOverrideWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- AssociationOverrideAnnotation associationOverride = this.getAssociationOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(2, associationOverride.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = associationOverride.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@AssociationOverrides(@AssociationOverride(name = \"" + ASSOCIATION_OVERRIDE_NAME + "\", joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn}))", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverrideTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverrideTests.java
deleted file mode 100644
index eec0cf1f62..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverrideTests.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class AttributeOverrideTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String ATTRIBUTE_OVERRIDE_NAME = "MY_ATTRIBUTE_OVERRIDE";
-
- public AttributeOverrideTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAttributeOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestAttributeOverrideWithColumnOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name = \"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private AttributeOverrideAnnotation getAttributeOverrideAnnotationAt(JavaResourceMember resourceMember, int index) {
- return (AttributeOverrideAnnotation) resourceMember.getAnnotation(index, JPA.ATTRIBUTE_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
- }
-
- public void testGetNullColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNotNull(attributeOverride);
- assertNull(column);
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName("Foo");
- assertEquals("Foo", attributeOverride.getName());
- assertSourceContains("@AttributeOverride(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName(null);
- assertNull(attributeOverride.getName());
-
- assertSourceDoesNotContain("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AttributeOverride", cu);
- }
-
- public void testColumnGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testColumnSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName("Foo");
-
- assertSourceContains("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name = \"Foo\"))", cu);
-
- column.setName(null);
- assertNull(attributeOverride.getColumn().getName());
- attributeOverride.removeColumn();
- assertNull(attributeOverride.getColumn());
- assertSourceContains("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- }
-
- public void testAddColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNull(column);
-
- attributeOverride.addColumn();
- column = attributeOverride.getColumn();
- assertNotNull(column);
- assertSourceContains("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column)", cu);
- }
-
- public void testRemoveColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNull(column);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverridesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverridesTests.java
deleted file mode 100644
index 2331276d19..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/AttributeOverridesTests.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class AttributeOverridesTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String ATTRIBUTE_OVERRIDE_NAME = "MY_ATTRIBUTE_OVERRIDE";
-
- public AttributeOverridesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestAttributeOverrideOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverrides(@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestAttributeOverrideWithColumnOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@AttributeOverrides(@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name = \"" + COLUMN_NAME + "\")))");
- }
- });
- }
-
- private ICompilationUnit createTestAttributeOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1))");
- }
- });
- }
-
- private AttributeOverrideAnnotation getAttributeOverrideAnnotationAt(JavaResourceMember resourceMember, int index) {
- return (AttributeOverrideAnnotation) resourceMember.getAnnotation(index, JPA.ATTRIBUTE_OVERRIDE);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
- }
-
- public void testGetNullColumn() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- ColumnAnnotation column = attributeOverride.getColumn();
- assertNotNull(attributeOverride);
- assertNull(column);
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertNotNull(attributeOverride);
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName("Foo");
- assertEquals("Foo", attributeOverride.getName());
- assertSourceContains("@AttributeOverrides(@AttributeOverride(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- assertEquals(ATTRIBUTE_OVERRIDE_NAME, attributeOverride.getName());
-
- attributeOverride.setName(null);
- assertNull(attributeOverride.getName());
-
- assertSourceDoesNotContain("@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- assertSourceContains("@AttributeOverride", cu);
- assertSourceContains("@AttributeOverrides", cu);
- }
-
- public void testColumnGetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- ColumnAnnotation column = attributeOverride.getColumn();
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testColumnSetName() throws Exception {
- ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- AttributeOverrideAnnotation attributeOverride = this.getAttributeOverrideAnnotationAt(resourceField, 0);
-
- ColumnAnnotation column = attributeOverride.getColumn();
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName("Foo");
-
- assertSourceContains("@AttributeOverrides(@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\", column = @Column(name = \"Foo\")))", cu);
-
- column.setName(null);
- assertNull(attributeOverride.getColumn().getName());
- attributeOverride.removeColumn();
- assertNull(attributeOverride.getColumn());
- assertSourceContains("@AttributeOverride(name = \"" + ATTRIBUTE_OVERRIDE_NAME + "\")", cu);
- }
-
- public void testAddAttributeOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAttributeOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@AttributeOverrides({";
- String expected2 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)),";
- String expected3 = "@AttributeOverride(name = \"BAR\") })";
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- public void testAddAttributeOverrideToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestAttributeOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@AttributeOverrides({";
- String expected2 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)),";
- String expected3 = "@AttributeOverride(name = \"BAR\") })";
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@AttributeOverride(name = \"BAZ\"),";
- expected3 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)), @AttributeOverride(name = \"BAR\") })";
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator();
- assertEquals("BAZ", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("FOO", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("BAR", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
-
- assertNull(resourceType.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceType.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceType.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- public void testRemoveAttributeOverrideCopyExisting() throws Exception {
- ICompilationUnit cu = createTestAttributeOverride();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@AttributeOverrides({";
- String expected2 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1)),";
- String expected3 = "@AttributeOverride(name = \"BAR\") })";
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@AttributeOverride(name = \"FOO\", column = @Column(name = \"FOO\", columnDefinition = \"BAR\", table = \"BAZ\", unique = false, nullable = false, insertable = false, updatable = false, length = 1, precision = 1, scale = 1))";
- resourceType.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@AttributeOverrides", cu);
- }
- //not sure i want to test this api, how can we keep ContainerAnnotation.add, move, remove from being public?
- //users should go throught AbstractJavapersistenceResource. this gets confusing because you would handle it differently
- //for non top-level annotations
-// public void testAdd() throws Exception {
-// ICompilationUnit cu = this.createTestType();
-// JavaPersistentTypeResource typeResource = buildJavaTypeResource(cu);
-// JavaPersistentAttributeResource attributeResource = typeResource.fields().next();
-// AttributeOverrides attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-// assertNull(attributeOverrides);
-//
-// attributeResource.addAnnotation(JPA.ATTRIBUTE_OVERRIDES);
-// attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-// assertNotNull(attributeOverrides);
-//
-// assertSourceContains("@AttributeOverrides");
-//
-// AttributeOverride fooAttributeOverride = attributeOverrides.add(0);
-// fooAttributeOverride.setName("Foo");
-//
-// assertSourceContains("@AttributeOverrides(@AttributeOverride(name=\"Foo\"))");
-//
-// AttributeOverride barAttributeOverride = attributeOverrides.add(0);
-// barAttributeOverride.setName("Bar");
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"Bar\"), @AttributeOverride(name=\"Foo\")})");
-//
-// }
-//
-// public void testMove() throws Exception {
-// ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
-// JavaPersistentTypeResource typeResource = buildJavaTypeResource(cu);
-// JavaPersistentAttributeResource attributeResource = typeResource.fields().next();
-// AttributeOverrides attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-//
-// AttributeOverride fooAttributeOverride = attributeOverrides.add(1);
-// fooAttributeOverride.setName("Foo");
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\"), @AttributeOverride(name=\"Foo\")})");
-//
-// attributeOverrides.move(0, 1);
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"Foo\"), @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\")})");
-// }
-//
-// public void testRemove() throws Exception {
-// ICompilationUnit cu = this.createTestAttributeOverrideWithColumnOnField();
-// JavaPersistentTypeResource typeResource = buildJavaTypeResource(cu);
-// JavaPersistentAttributeResource attributeResource = typeResource.fields().next();
-// AttributeOverrides attributeOverrides = (AttributeOverrides) attributeResource.annotation(JPA.ATTRIBUTE_OVERRIDES);
-//
-// AttributeOverride fooAttributeOverride = attributeOverrides.add(1);
-// fooAttributeOverride.setName("Foo");
-//
-// assertSourceContains("@AttributeOverrides({@AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\"), @AttributeOverride(name=\"Foo\")})");
-//
-// attributeOverrides.remove(0);
-//
-// assertSourceContains("@AttributeOverrides(@AttributeOverride(name=\"Foo\"))");
-//
-// attributeOverrides.remove(0);
-//
-// assertSourceContains("@AttributeOverrides()");
-//
-// }
-
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/BasicTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/BasicTests.java
deleted file mode 100644
index e90df300fb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/BasicTests.java
+++ /dev/null
@@ -1,152 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class BasicTests extends JpaJavaResourceModelTestCase {
-
- public BasicTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestBasic() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.BASIC);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic");
- }
- });
- }
-
- private ICompilationUnit createTestBasicWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.BASIC);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestBasicWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.BASIC, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic(fetch = FetchType.EAGER)");
- }
- });
- }
-
- public void testBasic() throws Exception {
- ICompilationUnit cu = this.createTestBasic();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertNotNull(basic);
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(Boolean.TRUE, basic.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(Boolean.TRUE, basic.getOptional());
-
- basic.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, basic.getOptional());
-
- assertSourceContains("@Basic(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(Boolean.TRUE, basic.getOptional());
-
- basic.setOptional(null);
- assertNull(basic.getOptional());
-
- assertSourceContains("@Basic", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(FetchType.EAGER, basic.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(FetchType.EAGER, basic.getFetch());
-
- basic.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, basic.getFetch());
-
- assertSourceContains("@Basic(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestBasicWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- BasicAnnotation basic = (BasicAnnotation) resourceField.getAnnotation(JPA.BASIC);
- assertEquals(FetchType.EAGER, basic.getFetch());
-
- basic.setFetch(null);
- assertNull(basic.getFetch());
-
- assertSourceContains("@Basic", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ColumnTests.java
deleted file mode 100644
index 06ba8be96f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ColumnTests.java
+++ /dev/null
@@ -1,405 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class ColumnTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public ColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(" + booleanElement + " = true)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(" + intElement + " = 5)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@Column(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@Column(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("table", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@Column(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("columnDefinition", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUnique());
-
- assertSourceContains("@Column(unique = false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("unique", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@Column(nullable = false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("nullable", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@Column(insertable = false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("insertable", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@Column(updatable = false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("updatable", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@Column(length = 5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("length", cu);
- }
-
- public void testGetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("precision");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getPrecision());
- }
-
- public void testSetPrecision() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertEquals(null, column.getPrecision());
-
- column.setPrecision(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getPrecision());
-
- assertSourceContains("@Column(precision = 5)", cu);
-
- column.setPrecision(null);
- assertSourceDoesNotContain("precision", cu);
- }
-
- public void testGetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("scale");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getScale());
- }
-
- public void testSetScale() throws Exception {
- ICompilationUnit cu = this.createTestColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
-
- assertNotNull(column);
- assertNull(column.getScale());
-
- column.setScale(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getScale());
-
- assertSourceContains("@Column(scale = 5)", cu);
-
- column.setScale(null);
- assertSourceDoesNotContain("scale", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorColumnTests.java
deleted file mode 100644
index efbde613b9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorColumnTests.java
+++ /dev/null
@@ -1,212 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class DiscriminatorColumnTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
-
- public DiscriminatorColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorColumnWithDiscriminatorType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN, JPA.DISCRIMINATOR_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(discriminatorType = DiscriminatorType.CHAR)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorColumn(" + intElement + " = 5)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getDiscriminatorType());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@DiscriminatorColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@DiscriminatorColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("(columnDefinition", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@DiscriminatorColumn(length = 5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("(length", cu);
- }
-
- public void testGetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumnWithDiscriminatorType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
- assertEquals(DiscriminatorType.CHAR, column.getDiscriminatorType());
- }
-
- public void testSetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- DiscriminatorColumnAnnotation column = (DiscriminatorColumnAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_COLUMN);
-
- assertNull(column.getDiscriminatorType());
-
- column.setDiscriminatorType(DiscriminatorType.INTEGER);
- assertEquals(DiscriminatorType.INTEGER, column.getDiscriminatorType());
-
- assertSourceContains("@DiscriminatorColumn(discriminatorType = INTEGER)", cu);
-
- column.setDiscriminatorType(null);
- assertSourceDoesNotContain("(discriminatorType", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorValueTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorValueTests.java
deleted file mode 100644
index fdacd1b956..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/DiscriminatorValueTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class DiscriminatorValueTests extends JpaJavaResourceModelTestCase {
-
- public DiscriminatorValueTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestDiscriminatorValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorValue");
- }
- });
- }
-
- private ICompilationUnit createTestDiscriminatorValueWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.DISCRIMINATOR_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@DiscriminatorValue(value = \"discriminator\")");
- }
- });
- }
-
- public void testDiscriminatorValue() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_VALUE);
- assertNotNull(discriminatorValue);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorValueWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_VALUE);
- assertEquals("discriminator", discriminatorValue.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestDiscriminatorValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- DiscriminatorValueAnnotation discriminatorValue = (DiscriminatorValueAnnotation) resourceType.getAnnotation(JPA.DISCRIMINATOR_VALUE);
-
- discriminatorValue.setValue("foo");
-
- assertSourceContains("@DiscriminatorValue(\"foo\")", cu);
-
- discriminatorValue.setValue(null);
-
- assertSourceDoesNotContain("@DiscriminatorValue(", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddableTests.java
deleted file mode 100644
index 21eee17559..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddableTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class EmbeddableTests extends JpaJavaResourceModelTestCase {
-
- public EmbeddableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableAndEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append("@Embeddable");
- }
- });
- }
-
- public void testEmbeddable() throws Exception {
- ICompilationUnit cu = this.createTestEmbeddable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- JavaResourceNode mappingAnnotation = resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EmbeddableAnnotation);
- }
-
- public void testEmbeddableAndEntity() throws Exception {
- ICompilationUnit cu = this.createTestEmbeddableAndEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- JavaResourceNode mappingAnnotation = resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EmbeddableAnnotation);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertNotNull(entity);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedIdTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedIdTests.java
deleted file mode 100644
index 12317ee4a7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedIdTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class EmbeddedIdTests extends JpaJavaResourceModelTestCase {
-
- public EmbeddedIdTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbeddedId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED_ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@EmbeddedId");
- }
- });
- }
-
- public void testEmbeddedId() throws Exception {
- ICompilationUnit cu = this.createTestEmbeddedId();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EmbeddedIdAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedTests.java
deleted file mode 100644
index 2335e75954..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EmbeddedTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class EmbeddedTests extends JpaJavaResourceModelTestCase {
-
- public EmbeddedTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbedded() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- }
- });
- }
-
- public void testEmbedded() throws Exception {
- ICompilationUnit cu = this.createTestEmbedded();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EmbeddedAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EntityTests.java
deleted file mode 100644
index a1d9de6f4f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EntityTests.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-
-@SuppressWarnings("nls")
-public class EntityTests extends JpaJavaResourceModelTestCase {
-
- private static final String ENTITY_NAME = "Foo";
-
- public EntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity(name = \"" + ENTITY_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassAndEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- sb.append("@Entity");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertTrue(entity != null);
- assertEquals(ENTITY_NAME, entity.getName());
- }
-
- public void testGetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertTrue(entity != null);
- assertNull(entity.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertNull(entity.getName());
- entity.setName("Foo");
- assertEquals("Foo", entity.getName());
-
- assertSourceContains("@Entity(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation entity = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertEquals(ENTITY_NAME, entity.getName());
-
- entity.setName(null);
- assertNull(entity.getName());
-
- assertSourceContains("@Entity", cu);
- assertSourceDoesNotContain("@Entity(name = \"Foo\")", cu);
- }
-
- public void testMappedSuperclassAndEntity() throws Exception {
- ICompilationUnit cu = this.createTestMappedSuperclassAndEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation mappingAnnotation = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertNotNull(mappingAnnotation);
-
- MappedSuperclassAnnotation mappedSuperclass = (MappedSuperclassAnnotation) resourceType.getAnnotation(JPA.MAPPED_SUPERCLASS);
- assertNotNull(mappedSuperclass);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EnumeratedTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EnumeratedTests.java
deleted file mode 100644
index 7a6f8d44df..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/EnumeratedTests.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EnumType;
-import org.eclipse.jpt.jpa.core.resource.java.EnumeratedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class EnumeratedTests extends JpaJavaResourceModelTestCase {
-
- public EnumeratedTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEnumerated() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENUMERATED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Enumerated");
- }
- });
- }
-
- private ICompilationUnit createTestEnumeratedWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENUMERATED, JPA.ENUM_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Enumerated(EnumType.ORDINAL)");
- }
- });
- }
-
- public void testEnumerated() throws Exception {
- ICompilationUnit cu = this.createTestEnumerated();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.getAnnotation(JPA.ENUMERATED);
- assertNotNull(enumerated);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestEnumeratedWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.getAnnotation(JPA.ENUMERATED);
- assertEquals(EnumType.ORDINAL, enumerated.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestEnumerated();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EnumeratedAnnotation enumerated = (EnumeratedAnnotation) resourceField.getAnnotation(JPA.ENUMERATED);
-
- enumerated.setValue(EnumType.STRING);
-
- assertSourceContains("@Enumerated(STRING)", cu);
-
- enumerated.setValue(null);
-
- assertSourceDoesNotContain("@Enumerated(", cu);
- assertSourceContains("@Enumerated", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/GeneratedValueTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/GeneratedValueTests.java
deleted file mode 100644
index ee536a2732..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/GeneratedValueTests.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GenerationType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class GeneratedValueTests extends JpaJavaResourceModelTestCase {
-
- private static final String GENERATOR = "MY_GENERATOR";
- public GeneratedValueTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.GENERATED_VALUE, JPA.GENERATION_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@GeneratedValue");
- }
- });
- }
-
- private ICompilationUnit createTestGeneratedValueWithGenerator() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.GENERATED_VALUE, JPA.GENERATION_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@GeneratedValue(generator = \"" + GENERATOR + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestGeneratedValueWithStrategy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.GENERATED_VALUE, JPA.GENERATION_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@GeneratedValue(strategy = GenerationType.SEQUENCE)");
- }
- });
- }
-
- public void testGeneratedValue() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertNotNull(generatedValue);
- }
-
- public void testGetGenerator() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithGenerator();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GENERATOR, generatedValue.getGenerator());
- }
-
- public void testSetGenerator() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithGenerator();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GENERATOR, generatedValue.getGenerator());
-
- generatedValue.setGenerator("foo");
- assertEquals("foo", generatedValue.getGenerator());
-
- assertSourceContains("@GeneratedValue(generator = \"foo\")", cu);
-
- generatedValue.setGenerator(null);
- assertNull(generatedValue.getGenerator());
-
- assertSourceDoesNotContain("generator", cu);
- assertSourceContains("@GeneratedValue", cu);
- }
-
- public void testGetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithStrategy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GenerationType.SEQUENCE, generatedValue.getStrategy());
- }
-
- public void testSetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestGeneratedValueWithStrategy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- GeneratedValueAnnotation generatedValue = (GeneratedValueAnnotation) resourceField.getAnnotation(JPA.GENERATED_VALUE);
- assertEquals(GenerationType.SEQUENCE, generatedValue.getStrategy());
-
- generatedValue.setStrategy(GenerationType.TABLE);
- assertEquals(GenerationType.TABLE, generatedValue.getStrategy());
-
- assertSourceContains("@GeneratedValue(strategy = TABLE)", cu);
-
- generatedValue.setStrategy(null);
- assertNull(generatedValue.getStrategy());
- assertSourceDoesNotContain("strategy", cu);
- assertSourceContains("@GeneratedValue", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdClassTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdClassTests.java
deleted file mode 100644
index ced5111f8f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdClassTests.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class IdClassTests extends JpaJavaResourceModelTestCase {
-
- private static final String ID_CLASS_VALUE = "MyClass";
-
- public IdClassTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestIdClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ID_CLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@IdClass");
- }
- });
- }
-
- private ICompilationUnit createTestIdClassWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ID_CLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@IdClass(" + ID_CLASS_VALUE + ".class)");
- }
- });
- }
-
- public void testIdClass() throws Exception {
- ICompilationUnit cu = this.createTestIdClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) resourceType.getAnnotation(JPA.ID_CLASS);
- assertNotNull(idClass);
- assertNull(idClass.getValue());
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestIdClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) resourceType.getAnnotation(JPA.ID_CLASS);
- assertEquals(ID_CLASS_VALUE, idClass.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestIdClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) resourceType.getAnnotation(JPA.ID_CLASS);
- assertEquals(ID_CLASS_VALUE, idClass.getValue());
-
- idClass.setValue("foo");
- assertEquals("foo", idClass.getValue());
-
- assertSourceContains("@IdClass(foo.class)", cu);
-
- idClass.setValue(null);
-
- assertSourceDoesNotContain("@IdClass(", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestIdClassWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- IdClassAnnotation idClass = (IdClassAnnotation) resourceType.getAnnotation(JPA.ID_CLASS);
- assertNotNull(idClass.getValue());
- assertEquals("MyClass", idClass.getFullyQualifiedClassName()); //bug 196200 changed this
-
-
- idClass.setValue(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, idClass.getFullyQualifiedClassName());
- assertSourceContains("@IdClass(" + TYPE_NAME + ".class)", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdTests.java
deleted file mode 100644
index 26fc303f9d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/IdTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class IdTests extends JpaJavaResourceModelTestCase {
-
- public IdTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ID);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testId() throws Exception {
- ICompilationUnit cu = this.createTestId();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof IdAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/InheritanceTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/InheritanceTests.java
deleted file mode 100644
index a4e7beed25..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/InheritanceTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-
-@SuppressWarnings("nls")
-public class InheritanceTests extends JpaJavaResourceModelTestCase {
-
- public InheritanceTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestInheritance() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.INHERITANCE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Inheritance");
- }
- });
- }
-
- private ICompilationUnit createTestInheritanceWithStrategy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.INHERITANCE, JPA.INHERITANCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Inheritance(strategy = InheritanceType.JOINED)");
- }
- });
- }
-
- public void testInheritance() throws Exception {
- ICompilationUnit cu = this.createTestInheritance();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(JPA.INHERITANCE);
- assertNotNull(inheritance);
- }
-
- public void testGetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestInheritanceWithStrategy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(JPA.INHERITANCE);
- assertEquals(InheritanceType.JOINED, inheritance.getStrategy());
- }
-
- public void testSetStrategy() throws Exception {
- ICompilationUnit cu = this.createTestInheritance();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- InheritanceAnnotation inheritance = (InheritanceAnnotation) resourceType.getAnnotation(JPA.INHERITANCE);
- inheritance.setStrategy(InheritanceType.TABLE_PER_CLASS);
-
- assertSourceContains("@Inheritance(strategy = TABLE_PER_CLASS)", cu);
-
- inheritance.setStrategy(null);
-
- assertSourceDoesNotContain("strategy", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JPTToolsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JPTToolsTests.java
deleted file mode 100644
index 7598f87526..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JPTToolsTests.java
+++ /dev/null
@@ -1,479 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.dom.CompilationUnit;
-import org.eclipse.jpt.common.core.utility.jdt.FieldAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.MethodAttribute;
-import org.eclipse.jpt.common.core.utility.jdt.Type;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-
-@SuppressWarnings("nls")
-public class JPTToolsTests extends JpaJavaResourceModelTestCase {
-
- public JPTToolsTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTypeFieldWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" " + modifier + " String foo;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- protected FieldAttribute fooField(ICompilationUnit cu) {
- return this.buildField("foo", cu);
- }
-
-
- private ICompilationUnit createTestTypeGetMethodWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" " + modifier + " int getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeInvalidMethodName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public int foo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeConstructor() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public " + TYPE_NAME + "() {").append(CR);
- sb.append(" super();").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeVoidMethodReturnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public void getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeInvalidMethodReturnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("com.foo.Foo");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public Foo getFoo() {").append(CR);
- sb.append(" return null;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(Foo id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeIsMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public boolean isFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(boolean id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeIsMethodReturnInt() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public int isFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeIsAndGetMethodWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" " + modifier + " boolean isFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" " + modifier + " boolean getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" public void setFoo(boolean id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeSetMethodWithModifier(final String modifier) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public int getFoo() {").append(CR);
- sb.append(" return this.id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- sb.append(" " + modifier + " void setFoo(int id) {").append(CR);
- sb.append(" this.id = id;").append(CR);
- sb.append(" }").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeWithMemberTypes() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append(" public static class FooStatic {}").append(CR);
- sb.append(CR);
- sb.append(" public class FooNotStatic {}").append(CR);
- sb.append(CR);
- sb.append(" public @interface MyAnnotation {}").append(CR);
- sb.append(CR);
- sb.append(" public enum MyEnum {}").append(CR);
- }
- });
- }
-
- protected MethodAttribute fooMethod(ICompilationUnit cu) {
- return this.buildMethod("getFoo", cu);
- }
-
- //private String foo; - persistable
- public void testFieldIsPersistable1() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private");
- FieldAttribute fieldAttribute = fooField(cu);
- assertTrue(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private static String foo; - not persistable
- public void testFieldIsPersistable2() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private static");
- FieldAttribute fieldAttribute = fooField(cu);
- assertFalse(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private transient String foo; - not persistable
- public void testFieldIsPersistable3() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private transient");
- FieldAttribute fieldAttribute = fooField(cu);
- assertFalse(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private final String foo; - persistable
- public void testFieldIsPersistable4() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("private final");
- FieldAttribute fieldAttribute = fooField(cu);
- assertTrue(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public String foo; - persistable
- public void testFieldIsPersistable5() throws Exception {
- ICompilationUnit cu = createTestTypeFieldWithModifier("public");
- FieldAttribute fieldAttribute = fooField(cu);
- assertTrue(fieldAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
-
- //public int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter01() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("public");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //protected int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter02() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("protected");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter03() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter04() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("private");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public static int getFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter05() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("public static");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertFalse(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public final int getFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter06() throws Exception {
- ICompilationUnit cu = createTestTypeGetMethodWithModifier("public final");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter07() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("public");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //protected void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter08() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("protected");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter09() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //private void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter10() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("private");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public static void setFoo(int foo) {} - not persistable
- public void testMethodIsPersistablePropertyGetter11() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("public static");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertFalse(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public final void setFoo(int foo) {} - persistable
- public void testMethodIsPersistablePropertyGetter12() throws Exception {
- ICompilationUnit cu = createTestTypeSetMethodWithModifier("public final");
- MethodAttribute methodAttribute = fooMethod(cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public boolean isFoo() {} - persistable
- public void testMethodIsPersistablePropertyGetter13() throws Exception {
- ICompilationUnit cu = createTestTypeIsMethod();
- MethodAttribute methodAttribute = this.buildMethod("isFoo", cu);
- assertTrue(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public int isFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter14() throws Exception {
- ICompilationUnit cu = createTestTypeIsMethodReturnInt();
- MethodAttribute methodAttribute = this.buildMethod("isFoo", cu);
- assertFalse(methodAttribute.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public int isFoo() {} - persistable
- //public int getFoo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter15() throws Exception {
- ICompilationUnit cu = createTestTypeIsAndGetMethodWithModifier("public");
- MethodAttribute isFooMethod = this.buildMethod("isFoo", cu);
- MethodAttribute getFooMethod = this.buildMethod("getFoo", cu);
-
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(isFooMethod.isPersistable(astRoot));
- assertFalse(getFooMethod.isPersistable(astRoot));
- }
-
- //public int foo() {} - not persistable
- public void testMethodIsPersistablePropertyGetter16() throws Exception {
- ICompilationUnit cu = createTestTypeInvalidMethodName();
- MethodAttribute fooMethod = this.buildMethod("foo", cu);
- assertFalse(fooMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public void getFoo() {} - not persistable - void return type
- public void testMethodIsPersistablePropertyGetter17() throws Exception {
- ICompilationUnit cu = createTestTypeVoidMethodReturnType();
- MethodAttribute fooMethod = this.buildMethod("getFoo", cu);
- assertFalse(fooMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public Foo getFoo() {} - persistable??? - Foo does not resolve
- public void testMethodIsPersistablePropertyGetter18() throws Exception {
- ICompilationUnit cu = createTestTypeInvalidMethodReturnType();
- MethodAttribute getFooMethod = this.buildMethod("getFoo", cu);
- assertTrue(getFooMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //method with parameters - not persistable
- public void testMethodIsPersistablePropertyGetter19() throws Exception {
- ICompilationUnit cu = createTestType();
- MethodAttribute setIdMethod = idSetMethod(cu);
- assertFalse(setIdMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //constructor - not persistable
- public void testMethodIsPersistablePropertyGetter20() throws Exception {
- ICompilationUnit cu = createTestTypeConstructor();
- MethodAttribute constructor = buildMethod(TYPE_NAME, cu);
- assertFalse(constructor.isPersistable(this.buildASTRoot(cu)));
- }
-
- //no corresponding set method - not persistable
- public void testMethodIsPersistablePropertyGetter21() throws Exception {
- ICompilationUnit cu = createTestType();
- MethodAttribute getNameMethod = nameGetMethod(cu);
- assertFalse(getNameMethod.isPersistable(this.buildASTRoot(cu)));
- }
-
- //public class AnnotationTestType
- public void testTypeIsPersistable1() throws Exception {
- ICompilationUnit cu = createTestType();
- Type type = testType(cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(type.isPersistable(astRoot));
- }
-
- //public final class MyFinal
- public void testTypeIsPersistable2() throws Exception {
- ICompilationUnit cu = this.javaProject.createCompilationUnit("finals", "MyFinal.java", "public final class MyFinal { }");
- Type type = buildType("MyFinal", cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(type.isPersistable(astRoot));
- }
-
- //public interface MyInterface
- public void testTypeIsPersistable3() throws Exception {
- ICompilationUnit cu = this.javaProject.createCompilationUnit("interfaces", "MyInterface.java", "public interface MyInterface { }");
- Type type = buildType("MyInterface", cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertFalse(type.isPersistable(astRoot));
- }
-
- //enum not persistable
- public void testTypeIsPersistable4() throws Exception {
- ICompilationUnit cu = this.createEnumAndMembers("TestEnum", "FOO, BAR, BAZ");
- Type type = buildType("TestEnum", cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertFalse(type.isPersistable(astRoot));
- }
-
- //annotation not persistable
- public void testTypeIsPersistable5() throws Exception {
- ICompilationUnit cu = this.createAnnotationAndMembers("TestAnnotation", "TestEnum foo();");
- Type type = buildType("TestAnnotation", cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertFalse(type.isPersistable(astRoot));
- }
-
- //public static member type is persistable
- public void testTypeIsPersistable6() throws Exception {
- ICompilationUnit cu = this.createTestTypeWithMemberTypes();
- Type testType = this.testType(cu);
- Type memberType = this.buildType(testType, "FooStatic", 1, cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(memberType.isPersistable(astRoot));
- }
-
- //non-static member type is persistable, handled with validation
- public void testTypeIsPersistable7() throws Exception {
- ICompilationUnit cu = this.createTestTypeWithMemberTypes();
- Type testType = this.testType(cu);
- Type memberType = this.buildType(testType, "FooNotStatic", 1, cu);
- CompilationUnit astRoot = this.buildASTRoot(cu);
- assertTrue(memberType.isPersistable(astRoot));
- }
- //TODO still need to test typeIsPersistable() returns false for local and anonymous classes
-
-
-}
-
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceAttributeTests.java
deleted file mode 100644
index 1ec05fdc56..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceAttributeTests.java
+++ /dev/null
@@ -1,718 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.lang.reflect.Modifier;
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.Iterator;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement.Editor;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceIdAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceOneToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.GeneratedValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class JavaResourceAttributeTests extends JpaJavaResourceModelTestCase {
-
- public JavaResourceAttributeTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonResolvingField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private Foo foo;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityMultipleVariableDeclarationsPerLine() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" ");
- sb.append("@Id");
- sb.append(CR);
- sb.append(" ");
- sb.append("@Column(name = \"baz\")");
- sb.append(" private String foo, bar;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdAndBasic() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append("@Basic");
- }
- });
- }
-
- private ICompilationUnit createTestEntityAnnotatedField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append(" ");
- sb.append("@Column");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name = \"FOO\", table = \"MY_TABLE\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdColumnGeneratedValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN, JPA.ID, JPA.GENERATED_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append(CR);
- sb.append("@Column");
- sb.append(CR);
- sb.append("@GeneratedValue");
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityMultipleColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Column(name = \"FOO\")");
- sb.append(CR);
- sb.append("@Column(name = \"BAR\")");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddedWithAttributeOverride() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverride(name = \"FOO\")");
- }
- });
- }
- private ICompilationUnit createTestEmbeddedWithAttributeOverrides() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverrides(@AttributeOverride(name = \"FOO\"))");
- }
- });
- }
- private ICompilationUnit createTestEmbeddedWithAttributeOverridesEmpty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverrides()");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddedWith2AttributeOverrides() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDED, JPA.ATTRIBUTE_OVERRIDE, JPA.ATTRIBUTE_OVERRIDES);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Embedded");
- sb.append(CR);
- sb.append("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\")})");
- }
- });
- }
-
- private ICompilationUnit createTestTypePublicAttribute() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public String foo;");
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypePackageAttribute() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" String foo;");
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeFinalAttribute() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" public final String foo;");
- sb.append(CR);
- }
- });
- }
-
- public void testJavaAttributeAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertEquals(1, resourceAttribute.getAnnotationsSize());
- }
-
- public void testJavaAttributeAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertNotNull(resourceAttribute.getAnnotation(JPA.COLUMN));
- }
-
- public void testJavaAttributeAnnotationNull() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertNull(resourceAttribute.getAnnotation(JPA.TABLE));
- }
-
- //This will result in a compilation error, but we assume the first column found
- public void testDuplicateAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityMultipleColumns();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- ColumnAnnotation columnResource = (ColumnAnnotation) resourceAttribute.getAnnotation(JPA.COLUMN);
- assertEquals("FOO", columnResource.getName());
- }
-
- public void testRemoveColumn() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- resourceAttribute.removeAnnotation(JPA.COLUMN);
-
- assertSourceDoesNotContain("@Column", cu);
- }
-
- public void testRemoveColumnName() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- ColumnAnnotation columnResource = (ColumnAnnotation) resourceAttribute.getAnnotation(JPA.COLUMN);
- columnResource.setTable(null);
- assertSourceContains("@Column(name = \"FOO\")", cu);
-
- columnResource.setName(null);
- assertSourceDoesNotContain("(name", cu);
- assertSourceDoesNotContain("@Column(", cu);
- }
-
- public void testMultipleAttributeMappings() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithIdAndBasic();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertEquals(2, resourceAttribute.getAnnotationsSize());
- assertNotNull(resourceAttribute.getAnnotation(JPA.BASIC));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ID));
-
- JavaResourceNode javaAttributeMappingAnnotation = resourceAttribute.getAnnotation(BasicAnnotation.ANNOTATION_NAME);
- assertTrue(javaAttributeMappingAnnotation instanceof BasicAnnotation);
- assertSourceContains("@Basic", cu);
- assertSourceContains("@Id", cu);
-
- resourceAttribute.setPrimaryAnnotation(JPA.ONE_TO_MANY, EmptyIterable.<String>instance());
- assertEquals(1, resourceAttribute.getAnnotationsSize());
- javaAttributeMappingAnnotation = resourceAttribute.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertTrue(javaAttributeMappingAnnotation instanceof OneToManyAnnotation);
- assertSourceDoesNotContain("@Id", cu);
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("@Basic", cu);
- }
-
- public void testSetJavaAttributeMappingAnnotation() throws Exception {
- ICompilationUnit cu = createTestType();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertEquals(0, resourceAttribute.getAnnotationsSize());
-
- resourceAttribute.setPrimaryAnnotation(JPA.ID, EmptyIterable.<String>instance());
- assertTrue(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME) instanceof IdAnnotation);
- assertSourceContains("@Id", cu);
- }
-
- public void testSetJavaAttributeMappingAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEntityWithColumn();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertEquals(1, resourceAttribute.getAnnotationsSize());
-
- resourceAttribute.setPrimaryAnnotation(JPA.ID, Collections.singleton(ColumnAnnotation.ANNOTATION_NAME));
- assertTrue(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME) instanceof IdAnnotation);
-
- assertSourceContains("@Id", cu);
- assertSourceContains("@Column", cu);
- }
-
- public void testSetJavaAttributeMappingAnnotation3() throws Exception {
- ICompilationUnit cu = createTestEntityWithIdColumnGeneratedValue();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertTrue(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME) instanceof IdAnnotation);
-
- resourceAttribute.setPrimaryAnnotation(
- JPA.BASIC,
- Arrays.asList(new String[] {
- ColumnAnnotation.ANNOTATION_NAME,
- GeneratedValueAnnotation.ANNOTATION_NAME}));
- assertTrue(resourceAttribute.getAnnotation(BasicAnnotation.ANNOTATION_NAME) instanceof BasicAnnotation);
-
- assertSourceDoesNotContain("@Id", cu);
- assertSourceContains("@GeneratedValue", cu); //not supported by Basic
- assertSourceContains("@Column", cu); //common between Id and Basic
- }
-
- public void testSetJavaAttributeMappingAnnotationNull() throws Exception {
- ICompilationUnit cu = createTestEntityWithIdColumnGeneratedValue();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertTrue(resourceAttribute.getAnnotation(IdAnnotation.ANNOTATION_NAME) instanceof IdAnnotation);
-
- resourceAttribute.setPrimaryAnnotation(
- null,
- Arrays.asList(new String[] {
- ColumnAnnotation.ANNOTATION_NAME,
- GeneratedValueAnnotation.ANNOTATION_NAME}));
-
- assertEquals(2, resourceAttribute.getAnnotationsSize());
- assertSourceDoesNotContain("@Id", cu);
- assertSourceContains("@GeneratedValue", cu); //not supported by Basic
- assertSourceContains("@Column", cu); //common between Id and Basic
- }
-
- public void testAddJavaAttributeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType typeResource = buildJavaResourceType(cu);
-
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertSourceDoesNotContain("@Column", cu);
- resourceAttribute.addAnnotation(JPA.COLUMN);
- assertSourceContains("@Column", cu);
- }
-
- public void testRemoveJavaAttributeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedField();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- assertSourceContains("@Column", cu);
- resourceAttribute.removeAnnotation(JPA.COLUMN);
- assertSourceDoesNotContain("@Column", cu);
- }
-
- //update source code to change from @Id to @OneToOne and make sure @Column is not removed
- public void testChangeAttributeMappingInSource() throws Exception {
- ICompilationUnit cu = createTestEntityAnnotatedField();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- final JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- idField(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SourceIdAnnotation.DECLARATION_ANNOTATION_ADAPTER.removeAnnotation(declaration);
- }
- });
-
- cu.createImport("javax.persistence.OneToOne", null, new NullProgressMonitor());
-
- idField(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SourceOneToOneAnnotation.DECLARATION_ANNOTATION_ADAPTER.newMarkerAnnotation(declaration);
- }
- });
-
- assertNotNull(resourceAttribute.getAnnotation(JPA.COLUMN));
- assertNull(resourceAttribute.getAnnotation(JPA.ID));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ONE_TO_ONE));
- assertSourceContains("@Column", cu);
- }
-
- public void testJavaAttributeAnnotationsNestable() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertEquals(1, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.getAnnotations(JPA.ATTRIBUTE_OVERRIDE).iterator().next();
-
- assertEquals("FOO", attributeOverride.getName());
- }
-
- public void testJavaAttributeAnnotationsNoNestable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertEquals(0, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- public void testJavaAttributeAnnotationsContainerNoNestable() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverridesEmpty();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- assertEquals(0, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- // -->> @AttributeOverride(name="FOO")
- public void testAddJavaAttributeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- assertSourceContains("@AttributeOverride(name = \"FOO\")", cu);
- }
-
- // @Embedded -->> @Embedded
- // @AttributeOverride(name="FOO") @AttributeOverrides({@AttributeOverride(name="FOO"), @AttributeOverride(name="BAR")})
- public void testAddJavaAttributeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({ @AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\") })", cu);
-
- assertNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceAttribute.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(2, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- // @Embedded
- // @AttributeOverrides(@AttributeOverride(name="FOO"))
- // ||
- // \/
- // @Embedded
- // @AttributeOverrides({@AttributeOverride(name="FOO"), @AttributeOverride(name="BAR")})
- public void testAddJavaAttributeAnnotationNestableContainer3() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"),@AttributeOverride(name = \"BAR\")})", cu);
-
- assertNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceAttribute.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(2, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- public void testAddJavaAttributeAnnotationNestableContainer5() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"BAR\"),@AttributeOverride(name = \"FOO\")})", cu);
-
- assertNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDE));
- assertNotNull(resourceAttribute.getAnnotation(JPA.ATTRIBUTE_OVERRIDES));
- assertNotNull(resourceAttribute.getAnnotation(0, JPA.ATTRIBUTE_OVERRIDE));
- assertEquals(2, resourceAttribute.getAnnotationsSize(JPA.ATTRIBUTE_OVERRIDE));
- }
-
- //@Entity
- //@AttributeOverride(name="FOO")
- public void testRemoveJavaAttributeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverride();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- resourceAttribute.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertSourceDoesNotContain("@AttributeOverride", cu);
- }
-
- //@Embedded
- //@AttributeOverrides(@AttributeOverride(name = \"FOO\"))
- public void testRemoveJavaAttributeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWithAttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- resourceAttribute.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertSourceDoesNotContain("@AttributeOverride(name = \"FOO\")", cu);
- assertSourceContains("@AttributeOverrides", cu);
- }
-
- public void testRemoveJavaAttributeAnnotationIndex() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- resourceAttribute.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
-
- assertSourceDoesNotContain("@AttributeOverride(name = \"FOO\"", cu);
- assertSourceContains("@AttributeOverride(name = \"BAR\"", cu);
- assertSourceDoesNotContain("@AttributeOverrides", cu);
- }
-
- public void testRemoveJavaAttributeAnnotationIndex2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation newAnnotation = (AttributeOverrideAnnotation)resourceAttribute.addAnnotation(2, JPA.ATTRIBUTE_OVERRIDE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAZ\")})", cu);
-
- resourceAttribute.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAZ\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = typeResource.getFields().iterator().next();
-
- AttributeOverrideAnnotation newAnnotation = (AttributeOverrideAnnotation)resourceAttribute.addAnnotation(2, JPA.ATTRIBUTE_OVERRIDE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAZ\")})", cu);
-
-
- resourceAttribute.moveAnnotation(0, 2, JPA.ATTRIBUTE_OVERRIDE);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"BAZ\"), @AttributeOverride(name = \"FOO\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAR\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEmbeddedWith2AttributeOverrides();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
-
- AttributeOverrideAnnotation newAnnotation = (AttributeOverrideAnnotation) resourceAttribute.addAnnotation(2, JPA.ATTRIBUTE_OVERRIDE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"FOO\"), @AttributeOverride(name = \"BAR\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAZ\")})", cu);
-
- resourceAttribute.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- assertSourceContains("@AttributeOverrides({@AttributeOverride(name = \"BAR\"), @AttributeOverride(name = \"FOO\"),", cu);
- assertSourceContains("@AttributeOverride(name = \"BAZ\")})", cu);
- }
-
- public void testGetTypeName() throws Exception {
- ICompilationUnit cu = createTestEntityWithNonResolvingField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceAttribute resourceAttribute = resourceType.getFields().iterator().next();
-
- assertEquals("foo", resourceAttribute.getName());
- assertEquals("test.Foo", resourceAttribute.getTypeName()); //bug 196200 changed this
-
- this.javaProject.createCompilationUnit("test", "Foo.java", "public class Foo {}");
-
- assertEquals("test.Foo", resourceAttribute.getTypeName());
- }
-
- //this tests that we handle mutliple variable declarations in one line.
- //The annotations should apply to all fields defined. This is not really a useful
- //thing to do with JPA beyond the most basic things that use default column names
- public void testMultipleVariableDeclarationsPerLine() throws Exception {
- ICompilationUnit cu = createTestEntityMultipleVariableDeclarationsPerLine();
- JavaResourceType typeResource = buildJavaResourceType(cu);
-
- assertEquals(4, CollectionTools.size(typeResource.getFields()));
- Iterator<JavaResourceField> fields = typeResource.getFields().iterator();
- JavaResourceField resourceField = fields.next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertEquals("baz", column.getName());
-
- resourceField = fields.next();
- column = (ColumnAnnotation) resourceField.getAnnotation(JPA.COLUMN);
- assertEquals("baz", column.getName());
- }
-
- public void testIsPublic() throws Exception {
- ICompilationUnit cu = createTestTypePublicAttribute();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute attribute = typeResource.getFields().iterator().next();
-
- assertTrue(Modifier.isPublic(attribute.getModifiers()));
- }
-
- public void testIsPublicFalse() throws Exception {
- ICompilationUnit cu = createTestTypePackageAttribute();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute attribute = typeResource.getFields().iterator().next();
-
- assertFalse(Modifier.isPublic(attribute.getModifiers()));
- }
-
- public void testIsFinal() throws Exception {
- ICompilationUnit cu = createTestTypeFinalAttribute();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute attribute = typeResource.getFields().iterator().next();
-
- assertTrue(Modifier.isFinal(attribute.getModifiers()));
- }
-
- public void testIsFinalFalse() throws Exception {
- ICompilationUnit cu = createTestTypePackageAttribute();
- JavaResourceType typeResource = buildJavaResourceType(cu);
- JavaResourceAttribute attribute = typeResource.getFields().iterator().next();
-
- assertFalse(Modifier.isFinal(attribute.getModifiers()));
- }
-
- //TODO add tests for JPTTools static methods
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceModelTestCase.java
deleted file mode 100644
index 00701545e0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceModelTestCase.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import org.eclipse.jdt.core.ElementChangedEvent;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jdt.core.IElementChangedListener;
-import org.eclipse.jdt.core.IJavaElement;
-import org.eclipse.jdt.core.IJavaElementDelta;
-import org.eclipse.jdt.core.JavaCore;
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.internal.resource.java.source.SourceTypeCompilationUnit;
-import org.eclipse.jpt.common.core.internal.utility.jdt.NullAnnotationEditFormatter;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackage;
-import org.eclipse.jpt.common.core.resource.java.JavaResourcePackageInfoCompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.tests.internal.utility.jdt.AnnotationTestCase;
-import org.eclipse.jpt.common.utility.command.CommandExecutor;
-import org.eclipse.jpt.common.utility.internal.BitTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.jpa.core.JpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-
-
-@SuppressWarnings("nls")
-public class JavaResourceModelTestCase
- extends AnnotationTestCase {
-
- private JavaElementChangeListener javaElementChangeListener;
- protected JavaResourceCompilationUnit javaResourceCompilationUnit;
-
-
- public JavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaElementChangeListener = new JavaElementChangeListener();
- JavaCore.addElementChangedListener(this.javaElementChangeListener);
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- JavaCore.removeElementChangedListener(this.javaElementChangeListener);
- this.javaElementChangeListener = null;
- }
-
- private class JavaElementChangeListener
- implements IElementChangedListener {
-
- JavaElementChangeListener() {
- super();
- }
-
- public void elementChanged(ElementChangedEvent event) {
- JavaResourceModelTestCase.this.javaElementChanged(event);
- }
-
- @Override
- public String toString() {
- return StringTools.buildToStringFor(this);
- }
- }
-
- void javaElementChanged(ElementChangedEvent event) {
- if (this.javaResourceCompilationUnit == null) {
- return;
- }
- this.syncWithJavaDelta(event.getDelta());
- }
-
- /**
- * NB: this is copied from GenericJpaProject, so it might need to be
- * kept in synch with that code if it changes... yech...
- */
- protected void syncWithJavaDelta(IJavaElementDelta delta) {
- switch (delta.getElement().getElementType()) {
- case IJavaElement.JAVA_MODEL :
- case IJavaElement.JAVA_PROJECT :
- case IJavaElement.PACKAGE_FRAGMENT_ROOT :
- case IJavaElement.PACKAGE_FRAGMENT :
- this.syncWithJavaDeltaChildren(delta);
- break;
- case IJavaElement.COMPILATION_UNIT :
- this.javaCompilationUnitChanged(delta);
- break;
- default :
- break; // ignore the elements inside a compilation unit
- }
- }
-
- protected void syncWithJavaDeltaChildren(IJavaElementDelta delta) {
- for (IJavaElementDelta child : delta.getAffectedChildren()) {
- this.syncWithJavaDelta(child); // recurse
- }
- }
-
- protected void javaCompilationUnitChanged(IJavaElementDelta delta) {
- if (this.deltaIsRelevant(delta)) {
- this.javaResourceCompilationUnit.synchronizeWithJavaSource();
- }
- }
-
- protected boolean deltaIsRelevant(IJavaElementDelta delta) {
- if (BitTools.onlyFlagIsSet(delta.getFlags(), IJavaElementDelta.F_PRIMARY_WORKING_COPY)) {
- return false;
- }
- return delta.getKind() == IJavaElementDelta.CHANGED;
- }
-
- protected ICompilationUnit createAnnotationAndMembers(String packageName, String annotationName, String annotationBody) throws Exception {
- return this.javaProject.createCompilationUnit(packageName, annotationName + ".java", "public @interface " + annotationName + " { " + annotationBody + " }");
- }
-
- protected ICompilationUnit createEnumAndMembers(String packageName, String enumName, String enumBody) throws Exception {
- return this.javaProject.createCompilationUnit(packageName, enumName + ".java", "public enum " + enumName + " { " + enumBody + " }");
- }
-
- protected JavaResourcePackage buildJavaResourcePackage(ICompilationUnit cu) {
- JavaResourcePackageInfoCompilationUnit pkgCu =
- new SourcePackageInfoCompilationUnit(
- cu,
- this.buildAnnotationProvider(),
- NullAnnotationEditFormatter.instance(),
- CommandExecutor.Default.instance());
- this.javaResourceCompilationUnit = pkgCu;
- return pkgCu.getPackage();
- }
-
- protected JavaResourceType buildJavaResourceType(ICompilationUnit cu) {
- this.javaResourceCompilationUnit = this.buildJavaResourceCompilationUnit(cu);
- this.javaResourceCompilationUnit.resolveTypes();
- return this.hackJavaResourceType();
- }
-
- protected JavaResourceType hackJavaResourceType() {
- return (JavaResourceType) ReflectionTools.getFieldValue(this.javaResourceCompilationUnit, "primaryType");
- }
-
- protected JavaResourceCompilationUnit buildJavaResourceCompilationUnit(ICompilationUnit cu) {
- if (this.javaResourceCompilationUnit != null) {
- throw new IllegalStateException();
- }
- return new SourceTypeCompilationUnit(
- cu,
- this.buildAnnotationProvider(),
- NullAnnotationEditFormatter.instance(),
- CommandExecutor.Default.instance()
- );
- }
-
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(this.annotationDefinitionProvider());
- }
-
- protected JpaAnnotationDefinitionProvider annotationDefinitionProvider() {
- return GenericJpaAnnotationDefinitionProvider.instance();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceTypeTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceTypeTests.java
deleted file mode 100644
index f32ee74085..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JavaResourceTypeTests.java
+++ /dev/null
@@ -1,679 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.utility.jdt.ModifiedDeclaration;
-import org.eclipse.jpt.common.core.utility.jdt.AnnotatedElement.Editor;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceEmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.internal.resource.java.source.SourceEntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-
-@SuppressWarnings("nls")
-public class JavaResourceTypeTests extends JpaJavaResourceModelTestCase {
-
- public JavaResourceTypeTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestInvalidAnnotations() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("javax.persistence.Foo");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Foo");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Foo");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMemberEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append(" @Embeddable");
- sb.append(CR);
- sb.append(" public static class Foo { }").append(CR);
-
- }
- });
- }
-
- private ICompilationUnit createTestEntityDuplicates() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity(name = \"FirstEntity\")").append(CR);
- sb.append("@Entity(name = \"SecondEntity\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEmbeddable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@Embeddable");
- }
- });
- }
-
-
-// private ICompilationUnit createTestEntityLarge(final int i) throws Exception {
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY + i);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity" + i);
-// sb.append(CR);
-// }
-// @Override
-// public String typeName() {
-// return TYPE_NAME + i;
-// }
-// });
-// }
-//
-// public void testLarge() throws Exception {
-// for (int i = START; i <= END; i++) {
-// this.createAnnotationAndMembers("Entity" +i, "String name();");
-// }
-//
-// List<ICompilationUnit> cus = new ArrayList<ICompilationUnit>();
-// for (int i = START; i <= END; i++) {
-// cus.add(createTestEntityLarge(i));
-// }
-// long start = System.currentTimeMillis();
-// List<JavaPersistentresourceType> resourceTypes = new ArrayList<JavaPersistentresourceType>();
-// for (int i = 0; i < END; i++) {
-// resourceTypes.add(buildJavaresourceType(cus.get(i)));
-// }
-// long end = System.currentTimeMillis();
-//
-// System.out.println(end-start + "ms");
-// for (int i = 0; i < END; i++) {
-// assertEquals(1, CollectionTools.size(resourceTypes.get(i).javaTypeMappingAnnotations()));
-// assertNotNull(resourceTypes.get(i).javaTypeMappingAnnotation(JPA.ENTITY + (i+1)));
-// }
-//
-//
-//// assertEquals(0, CollectionTools.size(resourceType.javaTypeAnnotations()));
-// }
-
-
-
- private ICompilationUnit createTestEntityWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@Table(name = \"FOO\", schema = \"BAR\")");
- }
- });
- }
-
-// private ICompilationUnit createTestEntityWithTableAndIdClass() throws Exception {
-// createEntityAnnotation();
-// this.createAnnotationAndMembers("Table", "String name(); String schema();");
-// this.createAnnotationAndMembers("IdClass", "Class value();");
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE, JPA.ID_CLASS);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity");
-// sb.append(CR);
-// sb.append("@Table");
-// sb.append(CR);
-// sb.append("@IdClass");
-// }
-// });
-// }
-//
-
- private ICompilationUnit createTestEntityMultipleTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@Table(name = \"FOO\")");
- sb.append(CR);
- sb.append("@Table(name = \"BAR\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTable(name = \"FOO\")");
- }
- });
- }
- private ICompilationUnit createTestEntityWithEmptySecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTables()");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTables(@SecondaryTable(name = \"FOO\"))");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWith2SecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\")})");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMemberTypes() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendMemberTypeTo(StringBuilder sb) {
- sb.append(" static class FooStatic {}").append(CR);
- sb.append(CR);
- sb.append(" class FooNotStatic {}").append(CR);
- sb.append(CR);
- sb.append(" @interface MyAnnotation {}").append(CR);
- sb.append(CR);
- sb.append(" enum MyEnum {}").append(CR);
- }
- });
- }
-
- public void testJavaTypeAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertEquals(2, resourceType.getAnnotationsSize());
- }
-
- public void testJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertNotNull(resourceType.getAnnotation(JPA.TABLE));
- }
-
- public void testJavaTypeAnnotationNull() throws Exception {
- ICompilationUnit cu = this.createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertNull(resourceType.getAnnotation(JPA.TABLE));
- }
-
- //This will result in a compilation error, but we assume the first table found
- public void testDuplicateAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestEntityMultipleTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation tableResource = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertEquals("FOO", tableResource.getName());
- }
-
- public void testRemoveTable() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- resourceType.removeAnnotation(JPA.TABLE);
-
- assertSourceDoesNotContain("@Table", cu);
- }
-
- public void testRemoveTableName() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation tableAnnotation = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- tableAnnotation.setSchema(null);
- assertSourceContains("@Table(name = \"FOO\")", cu);
-
- tableAnnotation.setName(null);
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testMultipleTypeMappings() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithEmbeddable();
-
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals(2, resourceType.getAnnotationsSize());
- assertNotNull(resourceType.getAnnotation(JPA.EMBEDDABLE));
- assertNotNull(resourceType.getAnnotation(JPA.ENTITY));
-
- JavaResourceNode javaTypeMappingAnnotation = resourceType.getAnnotation(EmbeddableAnnotation.ANNOTATION_NAME);
- assertTrue(javaTypeMappingAnnotation instanceof EmbeddableAnnotation);
- assertSourceContains("@Entity", cu);
- assertSourceContains("@Embeddable", cu);
-
- resourceType.setPrimaryAnnotation(JPA.MAPPED_SUPERCLASS, EmptyIterable.<String>instance());
- assertEquals(1, resourceType.getAnnotationsSize());
- javaTypeMappingAnnotation = resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME);
- assertTrue(javaTypeMappingAnnotation instanceof MappedSuperclassAnnotation);
- assertSourceDoesNotContain("@Entity", cu);
- assertSourceContains("@MappedSuperclass", cu);
- assertSourceDoesNotContain("@Embeddable", cu);
- }
-
- public void testSetJavaTypeMappingAnnotation() throws Exception {
- ICompilationUnit cu = createTestType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertEquals(0, resourceType.getAnnotationsSize());
-
- resourceType.setPrimaryAnnotation(JPA.ENTITY, EmptyIterable.<String>instance());
- assertTrue(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME) instanceof EntityAnnotation);
- assertSourceContains("@Entity", cu);
- }
-
- public void testAddJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertSourceDoesNotContain("@Table", cu);
- resourceType.addAnnotation(JPA.TABLE);
-
- assertSourceContains("@Table", cu);
- }
-
- public void testRemoveJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntityWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertSourceContains("@Table", cu);
- resourceType.removeAnnotation(JPA.TABLE);
- assertSourceDoesNotContain("@Table", cu);
- }
-
- //update source code to change from @Entity to @Embeddable and make sure @Table is not removed
- public void testChangeTypeMappingInSource() throws Exception {
- ICompilationUnit cu = createTestEntityWithTable();
- final JavaResourceType resourceType = buildJavaResourceType(cu);
-
- testType(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SourceEntityAnnotation.DECLARATION_ANNOTATION_ADAPTER.removeAnnotation(declaration);
- }
- });
-
- cu.createImport("javax.persistence.Embeddable", null, new NullProgressMonitor());
-
- this.testType(cu).edit(new Editor() {
- public void edit(ModifiedDeclaration declaration) {
- SourceEmbeddableAnnotation.DECLARATION_ANNOTATION_ADAPTER.newMarkerAnnotation(declaration);
- }
- });
-
- assertNotNull(resourceType.getAnnotation(JPA.TABLE));
- assertNull(resourceType.getAnnotation(JPA.ENTITY));
- assertNotNull(resourceType.getAnnotation(JPA.EMBEDDABLE));
- assertSourceContains("@Table", cu);
- }
-
- public void testJavaTypeAnnotationsNestable() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals(1, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.getAnnotations(JPA.SECONDARY_TABLE).iterator().next();
-
- assertEquals("FOO", secondaryTableResource.getName());
- }
-
- public void testJavaTypeAnnotationsNoNestable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals(0, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testJavaTypeAnnotationsContainerNoNestable() throws Exception {
- ICompilationUnit cu = createTestEntityWithEmptySecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals(0, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- // @Entity -->> @Entity
- // @SecondaryTable(name="FOO")
- public void testAddJavaTypeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("FOO");
- assertSourceContains("@SecondaryTable(name = \"FOO\")", cu);
- }
-
- // @Entity -->> @Entity
- // @SecondaryTable(name="FOO") @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
- public void testAddJavaTypeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({ @SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\") })", cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- // @Entity
- // @SecondaryTables(@SecondaryTable(name="FOO"))
- // ||
- // \/
- // @Entity
- // @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
- public void testAddJavaTypeAnnotationNestableContainer3() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"),@SecondaryTable(name = \"BAR\")})", cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testAddJavaTypeAnnotationNestableContainer5() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAR\"),@SecondaryTable(name = \"FOO\")})", cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testAddJavaTypeAnnotationNestableContainer6() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAR");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAR\"),@SecondaryTable(name = \"FOO\")})", cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
-
- secondaryTableResource = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTableResource.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAZ\"),@SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"FOO\")})", cu);
-
- assertEquals(3, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
-
- //@Entity
- //@SecondaryTable(name="FOO")
- public void testRemoveJavaTypeAnnotationNestableContainer() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertSourceDoesNotContain("@SecondaryTable", cu);
- }
-
-
- //@Entity
- //@SecondaryTables(@SecondaryTable(name="FOO"))
- public void testRemoveJavaTypeAnnotationNestableContainer2() throws Exception {
- ICompilationUnit cu = createTestEntityWithSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertSourceDoesNotContain("@SecondaryTable(name = \"FOO\")", cu);
- assertSourceContains("@SecondaryTables", cu);
- }
-
- public void testRemoveJavaTypeAnnotationIndex() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- resourceType.removeAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertSourceDoesNotContain("@SecondaryTable(name = \"FOO\"", cu);
- assertSourceContains("@SecondaryTable(name = \"BAR\"", cu);
- assertSourceDoesNotContain("@SecondaryTables", cu);
- }
-
- public void testRemoveJavaTypeAnnotationIndex2() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation newAnnotation = (SecondaryTableAnnotation)resourceType.addAnnotation(2, JPA.SECONDARY_TABLE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"BAZ", cu);
-
- resourceType.removeAnnotation(1, JPA.SECONDARY_TABLE);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAZ\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation newAnnotation = (SecondaryTableAnnotation)resourceType.addAnnotation(2, JPA.SECONDARY_TABLE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"BAZ\")})", cu);
-
- resourceType.moveAnnotation(0, 2, JPA.SECONDARY_TABLE);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAZ\"), @SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\")})", cu);
- }
-
- public void testMoveJavaTypeAnnotation2() throws Exception {
- ICompilationUnit cu = createTestEntityWith2SecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation newAnnotation = (SecondaryTableAnnotation)resourceType.addAnnotation(2, JPA.SECONDARY_TABLE);
- newAnnotation.setName("BAZ");
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"FOO\"), @SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"BAZ\")})", cu);
-
- resourceType.moveAnnotation(2, 0, JPA.SECONDARY_TABLE);
- assertSourceContains("@SecondaryTables({@SecondaryTable(name = \"BAR\"), @SecondaryTable(name = \"BAZ\"), @SecondaryTable(name = \"FOO\")})", cu);
- }
-
- public void testNestedTypes() throws Exception {
- ICompilationUnit cu = createTestEntityWithMemberTypes();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals("only not classes and interfaces should be returned by #getTypes()", 2, CollectionTools.size(resourceType.getTypes()));
- assertEquals("only enums should be returned by #getEnums()", 1, CollectionTools.size(resourceType.getEnums()));
- }
-
- public void testDuplicateEntityAnnotations() throws Exception {
- ICompilationUnit cu = createTestEntityDuplicates();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EntityAnnotation javaTypeMappingAnnotation = (EntityAnnotation) resourceType.getAnnotation(JPA.ENTITY);
- assertEquals("FirstEntity", javaTypeMappingAnnotation.getName());
-
- assertEquals(1, resourceType.getAnnotationsSize());
-
- javaTypeMappingAnnotation = (EntityAnnotation) resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME);
- assertEquals("FirstEntity", javaTypeMappingAnnotation.getName());
-
- }
-
-
- public void testAttributes() throws Exception {
- // TODO
- }
-
- public void testFields() throws Exception {
- // TODO
- }
-
- public void testProperties() throws Exception {
- // TODO
- }
-
-
- //TODO more tests here with superclasses other than Object.
- //1. Test where the superclass does not resolve
- //2. Test a superclass that does resolve
- //3. What about a superclass that is a class file in a jar??
- //4.
- public void testGetSuperclassQualifiedName() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertEquals("java.lang.Object", resourceType.getSuperclassQualifiedName());
-
- }
-
- public void testIsAnnotated() throws Exception {
- ICompilationUnit cu = createTestEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertTrue(resourceType.isAnnotated());
-
- resourceType.removeAnnotation(JPA.ENTITY);
- assertFalse(resourceType.isAnnotated());
-
- resourceType.addAnnotation(JPA.TABLE);
- assertTrue(resourceType.isAnnotated());
- }
-
- public void testAnnotatedMemberType() throws Exception {
- ICompilationUnit cu = this.createTestEntityWithMemberEmbeddable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertNotNull(resourceType.getAnnotation(JPA.ENTITY));
- assertNull(resourceType.getAnnotation(JPA.EMBEDDABLE));
-
- JavaResourceType nestedType = resourceType.getTypes().iterator().next();
- assertNull(nestedType.getAnnotation(JPA.ENTITY));
- assertNotNull(nestedType.getAnnotation(JPA.EMBEDDABLE));
- }
-
- public void testInvalidAnnotations() throws Exception {
- ICompilationUnit cu = this.createTestInvalidAnnotations();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- assertEquals(0, resourceType.getAnnotationsSize());
- assertEquals(0, resourceType.getAnnotationsSize());
-
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals(0, resourceField.getAnnotationsSize());
- assertEquals(0, resourceField.getAnnotationsSize());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnTests.java
deleted file mode 100644
index a570ab8bfe..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnTests.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class JoinColumnTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public JoinColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@JoinColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@JoinColumn(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("(table", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@JoinColumn(referencedColumnName = \"Foo\")", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@JoinColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("(columnDefinition", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUnique());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUnique());
-
- assertSourceContains("@JoinColumn(unique = false)", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getNullable());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getNullable());
-
- assertSourceContains("@JoinColumn(nullable = false)", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getInsertable());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getInsertable());
-
- assertSourceContains("@JoinColumn(insertable = false)", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getUpdatable());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = (JoinColumnAnnotation) resourceField.getAnnotation(0, JPA.JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getUpdatable());
-
- assertSourceContains("@JoinColumn(updatable = false)", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnsTests.java
deleted file mode 100644
index 8c568a50fe..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinColumnsTests.java
+++ /dev/null
@@ -1,446 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceMember;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class JoinColumnsTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_TABLE = "MY_TABLE";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public JoinColumnsTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn)");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(name = \"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(table = \"" + COLUMN_TABLE + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumns(@JoinColumn(" + booleanElement + " = true))");
- }
- });
- }
-
- private ICompilationUnit createTestJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_COLUMN, JPA.JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")");
- }
- });
- }
-
- private JoinColumnAnnotation joinColumnAt(JavaResourceMember resourceMember, int index) {
- return (JoinColumnAnnotation) CollectionTools.get(resourceMember.getAnnotations(JPA.JOIN_COLUMN), index);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getNullable());
- assertNull(column.getInsertable());
- assertNull(column.getUnique());
- assertNull(column.getUpdatable());
- assertNull(column.getTable());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@JoinColumns(@JoinColumn(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@JoinColumns(@JoinColumn(table = \"Foo\"))", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@JoinColumns(@JoinColumn(referencedColumnName = \"Foo\"))", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@JoinColumns(@JoinColumn(columnDefinition = \"Foo\"))", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("unique");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertTrue(column.getUnique().booleanValue());
- }
-
- public void testSetUnique() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getUnique());
-
- column.setUnique(Boolean.FALSE);
- assertFalse(column.getUnique().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(unique = false))", cu);
-
- column.setUnique(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("nullable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertTrue(column.getNullable().booleanValue());
- }
-
- public void testSetNullable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getNullable());
-
- column.setNullable(Boolean.FALSE);
- assertFalse(column.getNullable().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(nullable = false))", cu);
-
- column.setNullable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("insertable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertTrue(column.getInsertable().booleanValue());
- }
-
- public void testSetInsertable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getInsertable());
-
- column.setInsertable(Boolean.FALSE);
- assertFalse(column.getInsertable().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(insertable = false))", cu);
-
- column.setInsertable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
- public void testGetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumnWithBooleanElement("updatable");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertTrue(column.getUpdatable().booleanValue());
- }
-
- public void testSetUpdatable() throws Exception {
- ICompilationUnit cu = this.createTestJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinColumnAnnotation column = this.joinColumnAt(resourceField, 0);
-
- assertNotNull(column);
- assertNull(column.getUpdatable());
-
- column.setUpdatable(Boolean.FALSE);
- assertFalse(column.getUpdatable().booleanValue());
-
- assertSourceContains("@JoinColumns(@JoinColumn(updatable = false))", cu);
-
- column.setUpdatable(null);
- assertSourceDoesNotContain("@JoinColumn(", cu);
- }
-
-
- public void testAddJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@JoinColumns({";
- String expected2 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@JoinColumn(name = \"FOO\") })";
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertEquals(2, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
- }
-
- public void testAddJoinColumnToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@JoinColumns({";
- String expected2 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@JoinColumn(name = \"FOO\") })";
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@JoinColumn(name = \"BAZ\"),";
- expected3 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn(name = \"FOO\") })";
- joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- joinColumn.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> joinColumns = resourceField.getAnnotations(JPA.JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("BAR", ((JoinColumnAnnotation) joinColumns.next()).getName());
- assertEquals("FOO", ((JoinColumnAnnotation) joinColumns.next()).getName());
-
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertEquals(3, resourceField.getAnnotationsSize(JPA.JOIN_COLUMN));
- }
-
-
- public void testRemoveJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@JoinColumns({";
- String expected2 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"),";
- String expected3 = "@JoinColumn(name = \"FOO\") })";
- JoinColumnAnnotation joinColumn = (JoinColumnAnnotation) resourceField.addAnnotation(1, JPA.JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")";
- resourceField.removeAnnotation(1, JPA.JOIN_COLUMN);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@JoinColumns", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinTableTests.java
deleted file mode 100644
index 6bfb8ac293..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JoinTableTests.java
+++ /dev/null
@@ -1,656 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.JoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JoinTableAnnotation;
-
-@SuppressWarnings("nls")
-public class JoinTableTests extends JpaJavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public JoinTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(name = \"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(schema = \"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(catalog = \"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(joinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- private ICompilationUnit createTestJoinTableWithInverseJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.JOIN_TABLE, JPA.JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@JoinTable(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@JoinTable(catalog = \"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@JoinTable(schema = \"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, table.getUniqueConstraintsSize());
-
- table.removeUniqueConstraint(1);
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(2, table.getUniqueConstraintsSize());
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals("BAZ", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(1, table.getUniqueConstraintsSize());
- assertSourceContains("@JoinTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- assertEquals(0, table.getUniqueConstraintsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@JoinTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
- public void testJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(0, table.getJoinColumnsSize());
- }
-
- public void testJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
-
- table.addJoinColumn(0);
- table.addJoinColumn(1);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.getJoinColumnsSize());
- }
-
- public void testAddJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- table.addJoinColumn(0).setName("FOO");
- table.addJoinColumn(1);
- table.addJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- table.addJoinColumn(0).setName("FOO");
-
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertEquals("BAR", table.joinColumnAt(1).getName());
- assertNull(table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
-
- table.removeJoinColumn(1);
- assertEquals("FOO", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals(2, table.getJoinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
-
- table.removeJoinColumn(0);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals(1, table.getJoinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns = @JoinColumn)", cu);
-
-
- table.removeJoinColumn(0);
- assertEquals(0, table.getJoinColumnsSize());
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testMoveJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
- table.moveJoinColumn(2, 0);
- assertEquals("BAR", table.joinColumnAt(0).getName());
- assertNull(table.joinColumnAt(1).getName());
- assertEquals("FOO", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setUnique(Boolean.FALSE);
- joinColumn.setNullable(Boolean.FALSE);
- joinColumn.setInsertable(Boolean.FALSE);
- joinColumn.setUpdatable(Boolean.FALSE);
- joinColumn.setColumnDefinition("COLUMN_DEF");
- joinColumn.setTable("TABLE");
-
- table.addJoinColumn(0).setName("FOO");
-
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\"), @JoinColumn})", cu);
-
-
- table.moveJoinColumn(0, 2);
- assertNull(table.joinColumnAt(0).getName());
- assertEquals("FOO", table.joinColumnAt(1).getName());
- assertEquals("BAR", table.joinColumnAt(2).getName());
- assertEquals(3, table.getJoinColumnsSize());
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn, @JoinColumn(name = \"FOO\"), @JoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", unique = false, nullable = false, insertable = false, updatable = false, columnDefinition = \"COLUMN_DEF\", table = \"TABLE\")})", cu);
- }
-
- public void testSetJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.getJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.joinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@JoinTable(joinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-
- public void testInverseJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(0, table.getInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
-
- table.addInverseJoinColumn(0);
- table.addInverseJoinColumn(1);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testInverseJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
- }
-
- public void testAddInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- table.addInverseJoinColumn(0).setName("FOO");
- table.addInverseJoinColumn(1);
- table.addInverseJoinColumn(0).setName("BAR");
-
- assertEquals("BAR", table.inverseJoinColumnAt(0).getName());
- assertEquals("FOO", table.inverseJoinColumnAt(1).getName());
- assertNull(table.inverseJoinColumnAt(2).getName());
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"),@JoinColumn(name = \"FOO\"), @JoinColumn})", cu);
- }
-
- public void testRemoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- table.addInverseJoinColumn(2).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(1);
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")})", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceContains("@JoinTable(inverseJoinColumns = @JoinColumn(name = \"FOO\"))", cu);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertFalse(inverseJoinColumns.hasNext());
-
- table.removeInverseJoinColumn(0);
- assertSourceDoesNotContain("@JoinTable(", cu);
- }
-
- public void testMoveInverseJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- table.addInverseJoinColumn(0).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(2, 0);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"BAR\"), @JoinColumn, @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testMoveInverseJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
- table.addInverseJoinColumn(1).setName("FOO");
-
- Iterator<JoinColumnAnnotation> inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
- assertNull(inverseJoinColumns.next().getName());
-
- table.moveInverseJoinColumn(0, 2);
- inverseJoinColumns = table.getInverseJoinColumns().iterator();
- assertNull(inverseJoinColumns.next().getName());
- assertEquals("BAR", inverseJoinColumns.next().getName());
- assertEquals("FOO", inverseJoinColumns.next().getName());
-
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn, @JoinColumn(name = \"BAR\"), @JoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testSetInverseJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestJoinTableWithInverseJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JoinTableAnnotation table = (JoinTableAnnotation) resourceField.getAnnotation(JPA.JOIN_TABLE);
-
- assertEquals(2, table.getInverseJoinColumnsSize());
-
- JoinColumnAnnotation joinColumn = table.inverseJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@JoinTable(inverseJoinColumns = {@JoinColumn(name = \"foo\"), @JoinColumn})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JpaJavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JpaJavaResourceModelTestCase.java
deleted file mode 100644
index 18e758ca5f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JpaJavaResourceModelTestCase.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-
-public class JpaJavaResourceModelTestCase
- extends JavaResourceModelTestCase {
-
- public static final String JAVAX_PERSISTENCE_PACKAGE_NAME = "javax.persistence"; //$NON-NLS-1$
-
-
- public JpaJavaResourceModelTestCase(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.javaProject.addJar(TestJpaProject.jpaJarName());
- if (TestJpaProject.eclipseLinkJarName() != null) {
- this.javaProject.addJar(TestJpaProject.eclipseLinkJarName());
- }
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- // nothing as of yet
- }
-
- protected ICompilationUnit createAnnotationAndMembers(String annotationName, String annotationBody) throws Exception {
- return createAnnotationAndMembers(JAVAX_PERSISTENCE_PACKAGE_NAME, annotationName, annotationBody);
- }
-
- protected ICompilationUnit createEnumAndMembers(String enumName, String enumBody) throws Exception {
- return createEnumAndMembers(JAVAX_PERSISTENCE_PACKAGE_NAME, enumName, enumBody);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JptJavaResourceTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JptJavaResourceTests.java
deleted file mode 100644
index cb7d7cc80c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/JptJavaResourceTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptJavaResourceTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJavaResourceTests.class.getPackage().getName());
- suite.addTestSuite(JavaResourceTypeTests.class);
- suite.addTestSuite(JavaResourceAttributeTests.class);
- suite.addTestSuite(JPTToolsTests.class);
-
- suite.addTestSuite(AssociationOverrideTests.class);
- suite.addTestSuite(AssociationOverridesTests.class);
- suite.addTestSuite(AttributeOverrideTests.class);
- suite.addTestSuite(AttributeOverridesTests.class);
- suite.addTestSuite(BasicTests.class);
- suite.addTestSuite(ColumnTests.class);
- suite.addTestSuite(DiscriminatorValueTests.class);
- suite.addTestSuite(DiscriminatorColumnTests.class);
- suite.addTestSuite(EmbeddableTests.class);
- suite.addTestSuite(EmbeddedTests.class);
- suite.addTestSuite(EmbeddedIdTests.class);
- suite.addTestSuite(EntityTests.class);
- suite.addTestSuite(EnumeratedTests.class);
- suite.addTestSuite(GeneratedValueTests.class);
- suite.addTestSuite(IdClassTests.class);
- suite.addTestSuite(IdTests.class);
- suite.addTestSuite(InheritanceTests.class);
- suite.addTestSuite(JoinColumnTests.class);
- suite.addTestSuite(JoinColumnsTests.class);
- suite.addTestSuite(JoinTableTests.class);
- suite.addTestSuite(LobTests.class);
- suite.addTestSuite(ManyToManyTests.class);
- suite.addTestSuite(ManyToOneTests.class);
- suite.addTestSuite(MapKeyTests.class);
- suite.addTestSuite(MappedSuperclassTests.class);
- suite.addTestSuite(NamedNativeQueryTests.class);
- suite.addTestSuite(NamedNativeQueriesTests.class);
- suite.addTestSuite(NamedQueryTests.class);
- suite.addTestSuite(NamedQueriesTests.class);
- suite.addTestSuite(OneToManyTests.class);
- suite.addTestSuite(OneToOneTests.class);
- suite.addTestSuite(OrderByTests.class);
- suite.addTestSuite(PrimaryKeyJoinColumnTests.class);
- suite.addTestSuite(PrimaryKeyJoinColumnsTests.class);
- suite.addTestSuite(QueryHintTests.class);
- suite.addTestSuite(SecondaryTableTests.class);
- suite.addTestSuite(SecondaryTablesTests.class);
- suite.addTestSuite(SequenceGeneratorTests.class);
- suite.addTestSuite(TableGeneratorTests.class);
- suite.addTestSuite(TableTests.class);
- suite.addTestSuite(TemporalTests.class);
- suite.addTestSuite(TransientTests.class);
- suite.addTestSuite(VersionTests.class);
-
- return suite;
- }
-
- private JptJavaResourceTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/LobTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/LobTests.java
deleted file mode 100644
index d660c8103b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/LobTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.LobAnnotation;
-
-@SuppressWarnings("nls")
-public class LobTests extends JpaJavaResourceModelTestCase {
-
- public LobTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestLob() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.LOB);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Lob");
- }
- });
- }
-
- public void testLob() throws Exception {
- ICompilationUnit cu = this.createTestLob();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- LobAnnotation lob = (LobAnnotation) resourceField.getAnnotation(JPA.LOB);
- assertNotNull(lob);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToManyTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToManyTests.java
deleted file mode 100644
index fae22f1be4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToManyTests.java
+++ /dev/null
@@ -1,395 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class ManyToManyTests extends JpaJavaResourceModelTestCase {
-
- public ManyToManyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToMany() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertNotNull(manyToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FetchType.EAGER, manyToMany.getFetch());
-
- manyToMany.setFetch(null);
- assertNull(manyToMany.getFetch());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(TYPE_NAME, manyToMany.getTargetEntity());
-
- manyToMany.setTargetEntity(null);
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToMany.getFullyQualifiedTargetEntityClassName());
-
- manyToMany.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToMany(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", manyToMany.getTargetEntity());
-
- assertEquals("Foo", manyToMany.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals(null, manyToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertNull(manyToMany.getMappedBy());
- manyToMany.setMappedBy("bar");
- assertEquals("bar", manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertEquals("foo", manyToMany.getMappedBy());
-
- manyToMany.setMappedBy(null);
- assertNull(manyToMany.getMappedBy());
-
- assertSourceContains("@ManyToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertSourceContains("@ManyToMany(cascade = ALL)", cu);
-
- assertTrue(manyToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(true);
- assertSourceContains("@ManyToMany(cascade = MERGE)", cu);
-
- assertTrue(manyToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadePersist());
-
- manyToMany.setCascadePersist(true);
- assertSourceContains("@ManyToMany(cascade = PERSIST)", cu);
-
- assertTrue(manyToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeRemove(true);
- assertSourceContains("@ManyToMany(cascade = REMOVE)", cu);
-
- assertTrue(manyToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertFalse(manyToMany.isCascadeRefresh());
-
- manyToMany.setCascadeRefresh(true);
- assertSourceContains("@ManyToMany(cascade = REFRESH)", cu);
-
- assertTrue(manyToMany.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeAll());
-
- manyToMany.setCascadeAll(true);
- assertTrue(manyToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToMany(cascade = CascadeType.ALL)", cu);
-
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToMany.setCascadeAll(false);
- assertFalse(manyToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false); //TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToMany.isCascadeMerge());
-
- manyToMany.setCascadeMerge(false);
- assertFalse(manyToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToManyWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToManyAnnotation manyToMany = (ManyToManyAnnotation) resourceField.getAnnotation(JPA.MANY_TO_MANY);
- assertTrue(manyToMany.isCascadeMerge());
- assertTrue(manyToMany.isCascadeRemove());
-
- manyToMany.setCascadeMerge(false);
- assertSourceContains("@ManyToMany(cascade = REMOVE)", cu);
-
- manyToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToOneTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToOneTests.java
deleted file mode 100644
index d221a7a029..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/ManyToOneTests.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-
-@SuppressWarnings("nls")
-public class ManyToOneTests extends JpaJavaResourceModelTestCase {
-
- public ManyToOneTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestManyToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestManyToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MANY_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testManyToOne() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertNotNull(manyToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FetchType.EAGER, manyToOne.getFetch());
-
- manyToOne.setFetch(null);
- assertNull(manyToOne.getFetch());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(TYPE_NAME, manyToOne.getTargetEntity());
-
- manyToOne.setTargetEntity(null);
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, manyToOne.getFullyQualifiedTargetEntityClassName());
-
- manyToOne.setTargetEntity("Foo");
-
- assertSourceContains("@ManyToOne(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", manyToOne.getTargetEntity());
-
- assertEquals("Foo", manyToOne.getFullyQualifiedTargetEntityClassName());//bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertEquals(Boolean.TRUE, manyToOne.getOptional());
-
- manyToOne.setOptional(null);
- assertNull(manyToOne.getOptional());
-
- assertSourceContains("@ManyToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertSourceContains("@ManyToOne(cascade = ALL)", cu);
-
- assertTrue(manyToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(true);
- assertSourceContains("@ManyToOne(cascade = MERGE)", cu);
-
- assertTrue(manyToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadePersist());
-
- manyToOne.setCascadePersist(true);
- assertSourceContains("@ManyToOne(cascade = PERSIST)", cu);
-
- assertTrue(manyToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeRemove(true);
- assertSourceContains("@ManyToOne(cascade = REMOVE)", cu);
-
- assertTrue(manyToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestManyToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertFalse(manyToOne.isCascadeRefresh());
-
- manyToOne.setCascadeRefresh(true);
- assertSourceContains("@ManyToOne(cascade = REFRESH)", cu);
-
- assertTrue(manyToOne.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeAll());
-
- manyToOne.setCascadeAll(true);
- assertTrue(manyToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@ManyToOne(cascade = CascadeType.ALL)", cu);
-
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- manyToOne.setCascadeAll(false);
- assertFalse(manyToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(manyToOne.isCascadeMerge());
-
- manyToOne.setCascadeMerge(false);
- assertFalse(manyToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestManyToOneWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- ManyToOneAnnotation manyToOne = (ManyToOneAnnotation) resourceField.getAnnotation(JPA.MANY_TO_ONE);
- assertTrue(manyToOne.isCascadeMerge());
- assertTrue(manyToOne.isCascadeRemove());
-
- manyToOne.setCascadeMerge(false);
- assertSourceContains("@ManyToOne(cascade = REMOVE)", cu);
-
- manyToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MapKeyTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MapKeyTests.java
deleted file mode 100644
index 0ef74ab3ea..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MapKeyTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-
-@SuppressWarnings("nls")
-public class MapKeyTests extends JpaJavaResourceModelTestCase {
-
- public MapKeyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMapKey() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAP_KEY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKey");
- }
- });
- }
-
- private ICompilationUnit createTestMapKeyWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAP_KEY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKey(name = \"key\")");
- }
- });
- }
-
- public void testMapKey() throws Exception {
- ICompilationUnit cu = this.createTestMapKey();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(JPA.MAP_KEY);
- assertNotNull(mapKey);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(JPA.MAP_KEY);
- assertEquals("key", mapKey.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestMapKey();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(JPA.MAP_KEY);
-
- mapKey.setName("foo");
-
- assertSourceContains("@MapKey(name = \"foo\")", cu);
-
- mapKey.setName(null);
-
- assertSourceContains("@MapKey", cu);
- assertSourceDoesNotContain("@MapKey(name = \"foo\")", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MappedSuperclassTests.java
deleted file mode 100644
index 03d08f6a39..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/MappedSuperclassTests.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-
-@SuppressWarnings("nls")
-public class MappedSuperclassTests extends JpaJavaResourceModelTestCase {
-
- public MappedSuperclassTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassAndEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- sb.append("@Entity");
- }
- });
- }
-
- public void testMappedSuperclass() throws Exception {
- ICompilationUnit cu = this.createTestMappedSuperclass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- JavaResourceNode mappingAnnotation = resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof MappedSuperclassAnnotation);
- }
-
- public void testMappedSuperclassAndEntity() throws Exception {
- ICompilationUnit cu = this.createTestMappedSuperclassAndEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- JavaResourceNode mappingAnnotation = resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof EntityAnnotation);
-
- MappedSuperclassAnnotation mappedSuperclass = (MappedSuperclassAnnotation) resourceType.getAnnotation(JPA.MAPPED_SUPERCLASS);
- assertNotNull(mappedSuperclass);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueriesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueriesTests.java
deleted file mode 100644
index f8e60be450..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueriesTests.java
+++ /dev/null
@@ -1,425 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-
-@SuppressWarnings("nls")
-public class NamedNativeQueriesTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
- private static final String QUERY_RESULT_CLASS = "Result";
- private static final String QUERY_RESULT_SET_MAPPING = "resultSetMapping";
-
- public NamedNativeQueriesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedNativeQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery)");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithName() throws Exception {
- return createTestNamedNativeQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQuery() throws Exception {
- return createTestNamedNativeQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultSetMapping() throws Exception {
- return createTestNamedNativeQueryWithStringElement("resultSetMapping", QUERY_RESULT_SET_MAPPING);
- }
-
-
- private ICompilationUnit createTestNamedNativeQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery(" + elementName + " = \"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery(resultClass = " + QUERY_RESULT_CLASS + ".class))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQueries(@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint}))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\")");
- }
- });
- }
-
- public void testNamedNativeQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedNativeQuery(name = \"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedNativeQuery(query = \"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
- }
-
- public void testSetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
-
- namedQuery.setResultClass("foo");
- assertEquals("foo", namedQuery.getResultClass());
-
- assertSourceContains("@NamedNativeQuery(resultClass = foo.class)", cu);
-
- namedQuery.setResultClass(null);
- assertNull(namedQuery.getResultClass());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery.getResultClass());
- assertEquals("Result", namedQuery.getFullyQualifiedResultClassName());//bug 196200 changed this
-
- namedQuery.setResultClass(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, namedQuery.getFullyQualifiedResultClassName());
- assertSourceContains("@NamedNativeQuery(resultClass = " + TYPE_NAME + ".class)", cu);
- }
-
- public void testGetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
- }
-
- public void testSetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
-
- namedQuery.setResultSetMapping("foo");
- assertEquals("foo", namedQuery.getResultSetMapping());
-
- assertSourceContains("@NamedNativeQuery(resultSetMapping = \"foo\")", cu);
-
- namedQuery.setResultSetMapping(null);
- assertNull(namedQuery.getResultSetMapping());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(0, namedQuery.getHintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- namedQuery.addHint(0).setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\"),@QueryHint(name = \"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints = {@QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")}))", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints = @QueryHint(name = \"BAR\", value = \"FOO\")))", cu);
-
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.getHintsSize());
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint, @QueryHint(name = \"BAZ\")}))", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQueries(@NamedNativeQuery(hints = {@QueryHint, @QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")}))", cu);
- }
-
- public void testAddNamedNativeQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedNativeQueries({";
- String expected2 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"),";
- String expected3 = "@NamedNativeQuery(name = \"BAR\") })";
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_NATIVE_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.NAMED_NATIVE_QUERY));
- assertNotNull(resourceType.getAnnotation(JPA.NAMED_NATIVE_QUERIES));
- assertNotNull(resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.NAMED_NATIVE_QUERY));
- }
-
- public void testAddNamedNativeQueryToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedNativeQueries({";
- String expected2 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"),";
- String expected3 = "@NamedNativeQuery(name = \"BAR\") })";
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_NATIVE_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@NamedNativeQuery(name = \"BAZ\"),";
- expected3 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"), @NamedNativeQuery(name = \"BAR\") })";
- namedQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- namedQuery.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> namedQueries = resourceType.getAnnotations(JPA.NAMED_NATIVE_QUERY).iterator();
- assertEquals("BAZ", ((NamedNativeQueryAnnotation) namedQueries.next()).getName());
- assertEquals("foo", ((NamedNativeQueryAnnotation) namedQueries.next()).getName());
- assertEquals("BAR", ((NamedNativeQueryAnnotation) namedQueries.next()).getName());
-
- assertNull(resourceType.getAnnotation(JPA.NAMED_NATIVE_QUERY));
- assertNotNull(resourceType.getAnnotation(JPA.NAMED_NATIVE_QUERIES));
- assertNotNull(resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.NAMED_NATIVE_QUERY));
- }
-
- public void testRemoveNamedNativeQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedNativeQueries({";
- String expected2 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\"),";
- String expected3 = "@NamedNativeQuery(name = \"BAR\") })";
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_NATIVE_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@NamedNativeQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"), resultClass = Foo.class, resultSetMapping = \"mapping\")";
- resourceType.removeAnnotation(1, JPA.NAMED_NATIVE_QUERY);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@NamedNativeQueries", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueryTests.java
deleted file mode 100644
index e8fa64dd6e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedNativeQueryTests.java
+++ /dev/null
@@ -1,341 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-
-@SuppressWarnings("nls")
-public class NamedNativeQueryTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
- private static final String QUERY_RESULT_CLASS = "Result";
- private static final String QUERY_RESULT_SET_MAPPING = "resultSetMapping";
-
- public NamedNativeQueryTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedNativeQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithName() throws Exception {
- return createTestNamedNativeQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQuery() throws Exception {
- return createTestNamedNativeQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultSetMapping() throws Exception {
- return createTestNamedNativeQueryWithStringElement("resultSetMapping", QUERY_RESULT_SET_MAPPING);
- }
-
-
- private ICompilationUnit createTestNamedNativeQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithResultClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(resultClass = " + QUERY_RESULT_CLASS + ".class)");
- }
- });
- }
-
- private ICompilationUnit createTestNamedNativeQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint})");
- }
- });
- }
-
- public void testNamedNativeQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedNativeQuery(name = \"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedNativeQuery(query = \"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
- }
-
- public void testSetResultClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_CLASS, namedQuery.getResultClass());
-
- namedQuery.setResultClass("foo");
- assertEquals("foo", namedQuery.getResultClass());
-
- assertSourceContains("@NamedNativeQuery(resultClass = foo.class)", cu);
-
- namedQuery.setResultClass(null);
- assertNull(namedQuery.getResultClass());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testGetFullyQualifiedClass() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertNotNull(namedQuery.getResultClass());
- assertEquals("Result", namedQuery.getFullyQualifiedResultClassName());//bug 196200 changed this
-
- namedQuery.setResultClass(TYPE_NAME);
-
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, namedQuery.getFullyQualifiedResultClassName());
- assertSourceContains("@NamedNativeQuery(resultClass = " + TYPE_NAME + ".class)", cu);
- }
-
- public void testGetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
- }
-
- public void testSetResultSetMapping() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithResultSetMapping();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- assertEquals(QUERY_RESULT_SET_MAPPING, namedQuery.getResultSetMapping());
-
- namedQuery.setResultSetMapping("foo");
- assertEquals("foo", namedQuery.getResultSetMapping());
-
- assertSourceContains("@NamedNativeQuery(resultSetMapping = \"foo\")", cu);
-
- namedQuery.setResultSetMapping(null);
- assertNull(namedQuery.getResultSetMapping());
-
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(0, namedQuery.getHintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- namedQuery.addHint(0).setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\"),@QueryHint(name = \"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")})", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQuery(hints = @QueryHint(name = \"BAR\", value = \"FOO\"))", cu);
-
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.getHintsSize());
- assertSourceDoesNotContain("@NamedNativeQuery(", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
-
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint, @QueryHint(name = \"BAZ\")})", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedNativeQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedNativeQueryAnnotation namedQuery = (NamedNativeQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_NATIVE_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedNativeQuery(hints = {@QueryHint, @QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueriesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueriesTests.java
deleted file mode 100644
index 91a9a27ec1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueriesTests.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-
-@SuppressWarnings("nls")
-public class NamedQueriesTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
-
- public NamedQueriesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERIES, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQueries(@NamedQuery)");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithName() throws Exception {
- return createTestNamedQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedQueryWithQuery() throws Exception {
- return createTestNamedQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERIES, JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQueries(@NamedQuery(" + elementName + " = \"" + value + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERIES, JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQueries(@NamedQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint}))");
- }
- });
- }
-
-
- private ICompilationUnit createTestNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"))");
- }
- });
- }
-
- public void testNamedQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedQuery(name = \"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedQuery(query = \"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- assertEquals(0, namedQuery.getHintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueries();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- namedQuery.addHint(0).setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
-
- assertSourceContains("@NamedQuery(hints = {@QueryHint(name = \"BAR\"),@QueryHint(name = \"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.getHintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints = {@QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")}))", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.getHintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints = @QueryHint(name = \"BAR\", value = \"FOO\")))", cu);
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.getHintsSize());
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint, @QueryHint(name = \"BAZ\")}))", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedQueries(@NamedQuery(hints = {@QueryHint, @QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")}))", cu);
- }
-
- public void testAddNamedQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedQueries({";
- String expected2 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\")),";
- String expected3 = "@NamedQuery(name = \"BAR\") })";
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNull(resourceType.getAnnotation(JPA.NAMED_QUERY));
- assertNotNull(resourceType.getAnnotation(JPA.NAMED_QUERIES));
- assertNotNull(resourceType.getAnnotation(0, JPA.NAMED_QUERY));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.NAMED_QUERY));
- }
-
- public void testAddNamedQueryToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedQueries({";
- String expected2 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\")),";
- String expected3 = "@NamedQuery(name = \"BAR\") })";
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
-
- expected2 = "@NamedQuery(name = \"BAZ\"),";
- expected3 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\")), @NamedQuery(name = \"BAR\") })";
- namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> namedQueries = resourceType.getAnnotations(JPA.NAMED_QUERY).iterator();
- assertEquals("BAZ", ((NamedQueryAnnotation) namedQueries.next()).getName());
- assertEquals("foo", ((NamedQueryAnnotation) namedQueries.next()).getName());
- assertEquals("BAR", ((NamedQueryAnnotation) namedQueries.next()).getName());
-
- assertNull(resourceType.getAnnotation(JPA.NAMED_QUERY));
- assertNotNull(resourceType.getAnnotation(JPA.NAMED_QUERIES));
- assertNotNull(resourceType.getAnnotation(0, JPA.NAMED_QUERY));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.NAMED_QUERY));
- }
-
- public void testRemoveNamedQueryCopyExisting() throws Exception {
- ICompilationUnit cu = createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@NamedQueries({";
- String expected2 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\")),";
- String expected3 = "@NamedQuery(name = \"BAR\") })";
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.addAnnotation(1, JPA.NAMED_QUERY);
- namedQuery.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@NamedQuery(name = \"foo\", query = \"bar\", hints = @QueryHint(name = \"BAR\", value = \"FOO\"))";
- resourceType.removeAnnotation(1, JPA.NAMED_QUERY);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@NamedNativeQueries", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueryTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueryTests.java
deleted file mode 100644
index 6a1491711c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/NamedQueryTests.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
-
-@SuppressWarnings("nls")
-public class NamedQueryTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_NAME = "myQuery";
- private static final String QUERY_QUERY = "SELECT name FROM Employee";
-
- public NamedQueryTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedQuery() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithName() throws Exception {
- return createTestNamedQueryWithStringElement("name", QUERY_NAME);
- }
-
- private ICompilationUnit createTestNamedQueryWithQuery() throws Exception {
- return createTestNamedQueryWithStringElement("query", QUERY_QUERY);
- }
-
- private ICompilationUnit createTestNamedQueryWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint})");
- }
- });
- }
-
- public void testNamedQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertNotNull(namedQuery);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_NAME, namedQuery.getName());
-
- namedQuery.setName("foo");
- assertEquals("foo", namedQuery.getName());
-
- assertSourceContains("@NamedQuery(name = \"foo\")", cu);
-
- namedQuery.setName(null);
- assertNull(namedQuery.getName());
-
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testGetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
- }
-
- public void testSetQuery() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- assertEquals(QUERY_QUERY, namedQuery.getQuery());
-
- namedQuery.setQuery("foo");
- assertEquals("foo", namedQuery.getQuery());
-
- assertSourceContains("@NamedQuery(query = \"foo\")", cu);
-
- namedQuery.setQuery(null);
- assertNull(namedQuery.getQuery());
-
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testHints() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- assertEquals(0, namedQuery.getHintsSize());
- }
-
- public void testHints2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- namedQuery.addHint(0);
- namedQuery.addHint(1);
-
- assertEquals(2, namedQuery.getHintsSize());
- }
-
- public void testHints3() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- assertEquals(2, namedQuery.getHintsSize());
-
- ListIterator<QueryHintAnnotation> iterator = namedQuery.getHints().iterator();
- assertEquals("BAR", iterator.next().getName());
- assertNull(iterator.next().getName());
- }
-
- public void testAddHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQuery();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
-
- namedQuery.addHint(0).setName("FOO");
- namedQuery.addHint(1);
- QueryHintAnnotation queryHint = namedQuery.addHint(0);
- queryHint.setName("BAR");
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals("FOO", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertSourceContains("@NamedQuery(hints = {@QueryHint(name = \"BAR\"),@QueryHint(name = \"FOO\"), @QueryHint})", cu);
- }
-
- public void testRemoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.removeHint(2);
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertEquals(2, namedQuery.getHintsSize());
- assertSourceContains("@NamedQuery(hints = {@QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")})", cu);
-
- namedQuery.removeHint(0);
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertEquals(1, namedQuery.getHintsSize());
- assertSourceContains("@NamedQuery(hints = @QueryHint(name = \"BAR\", value = \"FOO\"))", cu);
-
- namedQuery.removeHint(0);
- assertEquals(0, namedQuery.getHintsSize());
- assertSourceDoesNotContain("@NamedQuery(", cu);
- }
-
- public void testMoveHint() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(2, 0);
-
- assertEquals("BAR", namedQuery.hintAt(0).getName());
- assertNull(namedQuery.hintAt(1).getName());
- assertEquals("BAZ", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedQuery(hints = {@QueryHint(name = \"BAR\", value = \"FOO\"), @QueryHint, @QueryHint(name = \"BAZ\")})", cu);
- }
-
- public void testMoveHint2() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- namedQuery.addHint(0).setName("BAZ");
-
- assertEquals("BAZ", namedQuery.hintAt(0).getName());
- assertEquals("BAR", namedQuery.hintAt(1).getName());
- assertNull(namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
-
- namedQuery.moveHint(0, 2);
-
- assertNull(namedQuery.hintAt(0).getName());
- assertEquals("BAZ", namedQuery.hintAt(1).getName());
- assertEquals("BAR", namedQuery.hintAt(2).getName());
- assertEquals(3, namedQuery.getHintsSize());
- assertSourceContains("@NamedQuery(hints = {@QueryHint, @QueryHint(name = \"BAZ\"), @QueryHint(name = \"BAR\", value = \"FOO\")})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToManyTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToManyTests.java
deleted file mode 100644
index 88e6f08235..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToManyTests.java
+++ /dev/null
@@ -1,398 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-
-@SuppressWarnings("nls")
-public class OneToManyTests extends JpaJavaResourceModelTestCase {
-
- public OneToManyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToManyWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_MANY, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToMany() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertNotNull(oneToMany);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToMany.getFetch());
-
- assertSourceContains("@OneToMany(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FetchType.EAGER, oneToMany.getFetch());
-
- oneToMany.setFetch(null);
- assertNull(oneToMany.getFetch());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(TYPE_NAME, oneToMany.getTargetEntity());
-
- oneToMany.setTargetEntity(null);
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToMany.getFullyQualifiedTargetEntityClassName());
-
- oneToMany.setTargetEntity("Foo");
-
- assertSourceContains("@OneToMany(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", oneToMany.getTargetEntity());
-
- assertEquals("Foo", oneToMany.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
- }
-
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals(null, oneToMany.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertNull(oneToMany.getMappedBy());
- oneToMany.setMappedBy("bar");
- assertEquals("bar", oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertEquals("foo", oneToMany.getMappedBy());
-
- oneToMany.setMappedBy(null);
- assertNull(oneToMany.getMappedBy());
-
- assertSourceContains("@OneToMany", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertSourceContains("@OneToMany(cascade = ALL)", cu);
-
- assertTrue(oneToMany.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(true);
- assertSourceContains("@OneToMany(cascade = MERGE)", cu);
-
- assertTrue(oneToMany.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadePersist());
-
- oneToMany.setCascadePersist(true);
- assertSourceContains("@OneToMany(cascade = PERSIST)", cu);
-
- assertTrue(oneToMany.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeRemove(true);
- assertSourceContains("@OneToMany(cascade = REMOVE)", cu);
-
- assertTrue(oneToMany.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToMany();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertFalse(oneToMany.isCascadeRefresh());
-
- oneToMany.setCascadeRefresh(true);
- assertSourceContains("@OneToMany(cascade = REFRESH)", cu);
-
- assertTrue(oneToMany.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeAll());
-
- oneToMany.setCascadeAll(true);
- assertTrue(oneToMany.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToMany(cascade = CascadeType.ALL)", cu);
-
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToMany.setCascadeAll(false);
- assertFalse(oneToMany.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToMany.isCascadeMerge());
-
- oneToMany.setCascadeMerge(false);
- assertFalse(oneToMany.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToManyWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToManyAnnotation oneToMany = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- assertTrue(oneToMany.isCascadeMerge());
- assertTrue(oneToMany.isCascadeRemove());
-
- oneToMany.setCascadeMerge(false);
- assertSourceContains("@OneToMany(cascade = REMOVE)", cu);
-
- oneToMany.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToOneTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToOneTests.java
deleted file mode 100644
index fe0f567469..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OneToOneTests.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-
-@SuppressWarnings("nls")
-public class OneToOneTests extends JpaJavaResourceModelTestCase {
-
- public OneToOneTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(fetch = FetchType.EAGER)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithTargetEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(targetEntity = AnnotationTestType.class)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMappedBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(mappedBy = \"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = CascadeType.ALL)");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithMultipleCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = {CascadeType.MERGE, CascadeType.REMOVE})");
- }
- });
- }
-
- private ICompilationUnit createTestOneToOneWithDuplicateCascade() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ONE_TO_ONE, JPA.CASCADE_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne(cascade = {CascadeType.MERGE, CascadeType.MERGE})");
- }
- });
- }
-
- public void testOneToOne() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertNotNull(oneToOne);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, oneToOne.getFetch());
-
- assertSourceContains("@OneToOne(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FetchType.EAGER, oneToOne.getFetch());
-
- oneToOne.setFetch(null);
- assertNull(oneToOne.getFetch());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-
-
- public void testGetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
- }
-
- public void testSetTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity = Foo.class)", cu);
- }
-
- public void testSetTargetEntityNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(TYPE_NAME, oneToOne.getTargetEntity());
-
- oneToOne.setTargetEntity(null);
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("targetEntity", cu);
- }
-
-
- public void testGetFullyQualifiedTargetEntity() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithTargetEntity();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(FULLY_QUALIFIED_TYPE_NAME, oneToOne.getFullyQualifiedTargetEntityClassName());
-
- oneToOne.setTargetEntity("Foo");
-
- assertSourceContains("@OneToOne(targetEntity = Foo.class)", cu);
-
- assertEquals("Foo", oneToOne.getTargetEntity());
-
- assertEquals("Foo", oneToOne.getFullyQualifiedTargetEntityClassName()); //bug 196200 changed this
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOne.getOptional());
-
- assertSourceContains("@OneToOne(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(Boolean.TRUE, oneToOne.getOptional());
-
- oneToOne.setOptional(null);
- assertNull(oneToOne.getOptional());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
- }
-
- public void testGetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals(null, oneToOne.getMappedBy());
- }
-
- public void testSetMappedBy() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertNull(oneToOne.getMappedBy());
- oneToOne.setMappedBy("bar");
- assertEquals("bar", oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne(mappedBy = \"bar\")", cu);
- }
-
- public void testSetMappedByNull() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMappedBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertEquals("foo", oneToOne.getMappedBy());
-
- oneToOne.setMappedBy(null);
- assertNull(oneToOne.getMappedBy());
-
- assertSourceContains("@OneToOne", cu);
- assertSourceDoesNotContain("mappedBy", cu);
- }
-
- public void testSetCascadeAll() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertSourceContains("@OneToOne(cascade = ALL)", cu);
-
- assertTrue(oneToOne.isCascadeAll());
- }
-
- public void testSetCascadeMerge() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(true);
- assertSourceContains("@OneToOne(cascade = MERGE)", cu);
-
- assertTrue(oneToOne.isCascadeMerge());
- }
-
- public void testSetCascadePersist() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadePersist());
-
- oneToOne.setCascadePersist(true);
- assertSourceContains("@OneToOne(cascade = PERSIST)", cu);
-
- assertTrue(oneToOne.isCascadePersist());
- }
-
- public void testSetCascadeRemove() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeRemove(true);
- assertSourceContains("@OneToOne(cascade = REMOVE)", cu);
-
- assertTrue(oneToOne.isCascadeRemove());
- }
-
- public void testSetCascadeRefresh() throws Exception {
- ICompilationUnit cu = this.createTestOneToOne();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertFalse(oneToOne.isCascadeRefresh());
-
- oneToOne.setCascadeRefresh(true);
- assertSourceContains("@OneToOne(cascade = REFRESH)", cu);
-
- assertTrue(oneToOne.isCascadeRefresh());
- }
-
- public void testCascadeMoreThanOnce() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeAll());
-
- oneToOne.setCascadeAll(true);
- assertTrue(oneToOne.isCascadeAll());
- //a second CascadeType.All should not have been added
- assertSourceContains("@OneToOne(cascade = CascadeType.ALL)", cu);
-
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
-
- //test setting cascadeAll to false again, should just do nothing
- oneToOne.setCascadeAll(false);
- assertFalse(oneToOne.isCascadeAll());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testDuplicateCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithDuplicateCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);//TODO should the resource model handle this and remove both MERGE
- //settings instead of having to set it false twice?
- assertTrue(oneToOne.isCascadeMerge());
-
- oneToOne.setCascadeMerge(false);
- assertFalse(oneToOne.isCascadeMerge());
-
- assertSourceDoesNotContain("cascade", cu);
- }
-
- public void testMultipleCascade() throws Exception {
- ICompilationUnit cu = this.createTestOneToOneWithMultipleCascade();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OneToOneAnnotation oneToOne = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- assertTrue(oneToOne.isCascadeMerge());
- assertTrue(oneToOne.isCascadeRemove());
-
- oneToOne.setCascadeMerge(false);
- assertSourceContains("@OneToOne(cascade = REMOVE)", cu);
-
- oneToOne.setCascadeRemove(false);
- assertSourceDoesNotContain("cascade", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OrderByTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OrderByTests.java
deleted file mode 100644
index 45af210208..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/OrderByTests.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OrderByAnnotation;
-
-@SuppressWarnings("nls")
-public class OrderByTests extends JpaJavaResourceModelTestCase {
-
- public OrderByTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestOrderBy() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ORDER_BY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderBy");
- }
- });
- }
-
- private ICompilationUnit createTestOrderByWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ORDER_BY);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OrderBy(value = \"key\")");
- }
- });
- }
-
- public void testOrderBy() throws Exception {
- ICompilationUnit cu = this.createTestOrderBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(JPA.ORDER_BY);
- assertNotNull(orderBy);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestOrderByWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(JPA.ORDER_BY);
- assertEquals("key", orderBy.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestOrderBy();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- OrderByAnnotation orderBy = (OrderByAnnotation) resourceField.getAnnotation(JPA.ORDER_BY);
-
- orderBy.setValue("foo");
-
- assertSourceContains("@OrderBy(\"foo\")", cu);
-
- orderBy.setValue(null);
-
- assertSourceContains("@OrderBy", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java
deleted file mode 100644
index ac65d38137..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnTests.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class PrimaryKeyJoinColumnTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public PrimaryKeyJoinColumnTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@PrimaryKeyJoinColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
-
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@PrimaryKeyJoinColumn(referencedColumnName = \"Foo\")", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@PrimaryKeyJoinColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java
deleted file mode 100644
index cfa0bb6714..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/PrimaryKeyJoinColumnsTests.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-
-@SuppressWarnings("nls")
-public class PrimaryKeyJoinColumnsTests extends JpaJavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_REFERENCED_COLUMN_NAME = "MY_REF_COLUMN_NAME";
-
- public PrimaryKeyJoinColumnsTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn)");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(name = \"" + COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithReferencedColumnName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(referencedColumnName = \"" + COLUMN_REFERENCED_COLUMN_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestPrimaryKeyJoinColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.PRIMARY_KEY_JOIN_COLUMN, JPA.PRIMARY_KEY_JOIN_COLUMNS);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\")");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getReferencedColumnName());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
- public void testGetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithReferencedColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_REFERENCED_COLUMN_NAME, column.getReferencedColumnName());
- }
-
- public void testSetReferencedColumnName() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getReferencedColumnName());
-
- column.setReferencedColumnName("Foo");
- assertEquals("Foo", column.getReferencedColumnName());
-
- assertSourceContains("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(referencedColumnName = \"Foo\"))", cu);
-
-
- column.setReferencedColumnName(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestPrimaryKeyJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
- PrimaryKeyJoinColumnAnnotation column = (PrimaryKeyJoinColumnAnnotation) resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@PrimaryKeyJoinColumns(@PrimaryKeyJoinColumn(columnDefinition = \"Foo\"))", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumn(", cu);
- }
-
-
- public void testAddPrimaryKeyJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@PrimaryKeyJoinColumns({";
- String expected2 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"),";
- String expected3 = "@PrimaryKeyJoinColumn(name = \"FOO\") })";
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertEquals(2, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
- }
- public void testAddPrimaryKeyJoinColumnToBeginningOfList() throws Exception {
- ICompilationUnit cu = createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@PrimaryKeyJoinColumns({";
- String expected2 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"),";
- String expected3 = "@PrimaryKeyJoinColumn(name = \"FOO\") })";
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@PrimaryKeyJoinColumn(name = \"BAZ\"),";
- expected3 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"), @PrimaryKeyJoinColumn(name = \"FOO\") })";
- joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> pkJoinColumns = resourceField.getAnnotations(JPA.PRIMARY_KEY_JOIN_COLUMN).iterator();
- assertEquals("BAZ", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("BAR", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
- assertEquals("FOO", ((PrimaryKeyJoinColumnAnnotation) pkJoinColumns.next()).getName());
-
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertEquals(3, resourceField.getAnnotationsSize(JPA.PRIMARY_KEY_JOIN_COLUMN));
- }
-
- public void testRemovePrimaryKeyJoinColumnCopyExisting() throws Exception {
- ICompilationUnit cu = createTestPrimaryKeyJoinColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- String expected1 = "@PrimaryKeyJoinColumns({";
- String expected2 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\"),";
- String expected3 = "@PrimaryKeyJoinColumn(name = \"FOO\") })";
- PrimaryKeyJoinColumnAnnotation joinColumn = (PrimaryKeyJoinColumnAnnotation) resourceField.addAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- joinColumn.setName("FOO");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@PrimaryKeyJoinColumn(name = \"BAR\", columnDefinition = \"COLUMN_DEF\", referencedColumnName = \"REF_NAME\")";
- resourceField.removeAnnotation(1, JPA.PRIMARY_KEY_JOIN_COLUMN);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@PrimaryKeyJoinColumns", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/QueryHintTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/QueryHintTests.java
deleted file mode 100644
index 8a07427449..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/QueryHintTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.QueryHintAnnotation;
-
-@SuppressWarnings("nls")
-public class QueryHintTests extends JpaJavaResourceModelTestCase {
-
- private static final String QUERY_HINT_NAME = "myHint";
- private static final String QUERY_HINT_VALUE = "myValue";
-
- public QueryHintTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestNamedQueryWithQueryHints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.NAMED_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@NamedQuery(hints = {@QueryHint(name = \"" + QUERY_HINT_NAME + "\", value = \"" + QUERY_HINT_VALUE + "\"), @QueryHint})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- QueryHintAnnotation queryHint = namedQuery.hintAt(0);
- assertEquals(QUERY_HINT_NAME, queryHint.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestNamedQueryWithQueryHints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- NamedQueryAnnotation namedQuery = (NamedQueryAnnotation) resourceType.getAnnotation(0, JPA.NAMED_QUERY);
- QueryHintAnnotation queryHint = namedQuery.hintAt(0);
- assertEquals(QUERY_HINT_NAME, queryHint.getName());
-
- queryHint.setName("foo");
- assertEquals("foo", queryHint.getName());
-
- assertSourceContains("@QueryHint(name = \"foo\", value = \"" + QUERY_HINT_VALUE + "\")", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTableTests.java
deleted file mode 100644
index d8d4ed5122..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTableTests.java
+++ /dev/null
@@ -1,436 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-
-@SuppressWarnings("nls")
-public class SecondaryTableTests extends JpaJavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public SecondaryTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(name = \"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(schema = \"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(catalog = \"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithPkJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"), @PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\")})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@SecondaryTable(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@SecondaryTable(catalog = \"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@SecondaryTable(schema = \"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.removeUniqueConstraint(1);
- Iterator<UniqueConstraintAnnotation> uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- assertSourceContains("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- assertSourceContains("@SecondaryTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- uniqueConstraints = table.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, secondaryTable.getUniqueConstraintsSize());
-
- secondaryTable.moveUniqueConstraint(2, 0);
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, secondaryTable.getUniqueConstraintsSize());
- assertSourceContains("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, secondaryTable.getUniqueConstraintsSize());
-
- secondaryTable.moveUniqueConstraint(0, 2);
- assertEquals("BAZ", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertEquals(3, secondaryTable.getUniqueConstraintsSize());
- assertSourceContains("@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
-
- public void testPkJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(0, table.getPkJoinColumnsSize());
- }
-
- public void testPkJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addPkJoinColumn(0);
- table.addPkJoinColumn(1);
-
- assertEquals(2, table.getPkJoinColumnsSize());
- }
-
- public void testPkJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getPkJoinColumnsSize());
- }
-
- public void testAddPkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
-
- table.addPkJoinColumn(0).setName("FOO");
- table.addPkJoinColumn(0);
- table.addPkJoinColumn(0).setName("BAR");//test adding a pkJoinColumn in front of 2 other joinColumns
-
- assertEquals("BAR", table.pkJoinColumnAt(0).getName());
- assertNull(table.pkJoinColumnAt(1).getName());
- assertEquals("FOO", table.pkJoinColumnAt(2).getName());
-
- assertEquals(3, table.getPkJoinColumnsSize());
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"),@PrimaryKeyJoinColumn, @PrimaryKeyJoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testRemovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.removePkJoinColumn(1);
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"), @PrimaryKeyJoinColumn(name = \"BAZ\")})", cu);
-
- table.removePkJoinColumn(0);
- assertSourceContains("@SecondaryTable(pkJoinColumns = @PrimaryKeyJoinColumn(name = \"BAZ\"))", cu);
-
-
- table.removePkJoinColumn(0);
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testMovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(2, 0);
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\"), @PrimaryKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\")})", cu);
- }
-
- public void testMovePkJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(0, 2);
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAZ\"), @PrimaryKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\"), @PrimaryKeyJoinColumn(name = \"FOO\")})", cu);
- }
-
- public void testSetPkJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getPkJoinColumnsSize());
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"foo\"), @PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\")})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTablesTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTablesTests.java
deleted file mode 100644
index af866a8313..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SecondaryTablesTests.java
+++ /dev/null
@@ -1,503 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.Annotation;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-
-@SuppressWarnings("nls")
-public class SecondaryTablesTests extends JpaJavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public SecondaryTablesTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestSecondaryTables() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable)");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(name = \"" + TABLE_NAME + "\"))");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(schema = \"" + SCHEMA_NAME + "\"))");
- }
- });
- }
- private ICompilationUnit createTestSecondaryTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(catalog = \"" + CATALOG_NAME + "\"))");
- }
- });
- }
-
-
- private ICompilationUnit createTestSecondaryTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLE, JPA.SECONDARY_TABLES, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint}))");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.SECONDARY_TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- sb.append("@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = {\"BAR\"}))");
- }
- });
- }
-
- private ICompilationUnit createTestSecondaryTablesWithPkJoinColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SECONDARY_TABLES, JPA.SECONDARY_TABLE, JPA.PRIMARY_KEY_JOIN_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"), @PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\")}))");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- Annotation secondaryTables = resourceType.getAnnotation(JPA.SECONDARY_TABLES);
- assertNotNull(secondaryTables);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(TABLE_NAME, secondaryTable.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNull(secondaryTable.getName());
- assertNull(secondaryTable.getCatalog());
- assertNull(secondaryTable.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertNull(secondaryTable.getName());
-
- secondaryTable.setName("Foo");
- assertEquals("Foo", secondaryTable.getName());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(name = \"Foo\"))", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(TABLE_NAME, secondaryTable.getName());
-
- secondaryTable.setName(null);
- assertNull(secondaryTable.getName());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(CATALOG_NAME, secondaryTable.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNull(secondaryTable.getCatalog());
-
- secondaryTable.setCatalog("Foo");
- assertEquals("Foo", secondaryTable.getCatalog());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(catalog = \"Foo\"))", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(CATALOG_NAME, secondaryTable.getCatalog());
-
- secondaryTable.setCatalog(null);
- assertNull(secondaryTable.getCatalog());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNotNull(secondaryTable);
- assertEquals(SCHEMA_NAME, secondaryTable.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertNull(secondaryTable.getSchema());
-
- secondaryTable.setSchema("Foo");
- assertEquals("Foo", secondaryTable.getSchema());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(schema = \"Foo\"))", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- assertEquals(SCHEMA_NAME, secondaryTable.getSchema());
-
- secondaryTable.setSchema(null);
- assertNull(secondaryTable.getSchema());
-
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(0, secondaryTable.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- secondaryTable.addUniqueConstraint(0);
- secondaryTable.addUniqueConstraint(1);
-
- assertEquals(2, secondaryTable.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(2, secondaryTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
- secondaryTable.addUniqueConstraint(1);
- secondaryTable.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, secondaryTable.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint}))", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
-
- secondaryTable.removeUniqueConstraint(2);
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
-
- secondaryTable.removeUniqueConstraint(0);
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAR\"}))", cu);
-
- secondaryTable.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
-
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, secondaryTable.uniqueConstraintAt(2).getColumnNamesSize());
-
- secondaryTable.moveUniqueConstraint(2, 0);
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals(0, secondaryTable.uniqueConstraintAt(1).getColumnNamesSize());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint, @UniqueConstraint(columnNames = \"FOO\")}))", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.addUniqueConstraint(0).addColumnName("FOO");
-
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, secondaryTable.uniqueConstraintAt(2).getColumnNamesSize());
-
- secondaryTable.moveUniqueConstraint(0, 2);
- assertEquals(0, secondaryTable.uniqueConstraintAt(0).getColumnNamesSize());
- assertEquals("FOO", secondaryTable.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals("BAR", secondaryTable.uniqueConstraintAt(2).columnNameAt(0));
- assertSourceContains("@SecondaryTables(@SecondaryTable(uniqueConstraints = {@UniqueConstraint, @UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint(columnNames = {\"BAR\"})}))", cu);
- }
-
-
- // @Entity -->> @Entity
- // @SecondaryTable(name="FOO") @SecondaryTables({@SecondaryTable(name="FOO"), @SecondaryTable(name="BAR")})
- public void testAddSecondaryTableCopyExisting() throws Exception {
- ICompilationUnit cu = createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@SecondaryTables({";
- String expected2 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" })),";
- String expected3 = "@SecondaryTable(name = \"BAR\") })";
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTable.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(2, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testAddSecondaryTable() throws Exception {
- ICompilationUnit cu = createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@SecondaryTables({";
- String expected2 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" })),";
- String expected3 = "@SecondaryTable(name = \"BAR\") })";
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTable.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected2 = "@SecondaryTable(name = \"BAZ\"),";
- expected3 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" })), @SecondaryTable(name = \"BAR\") })";
- secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(0, JPA.SECONDARY_TABLE);
- secondaryTable.setName("BAZ");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- Iterator<NestableAnnotation> secondaryTables = resourceType.getAnnotations(JPA.SECONDARY_TABLE).iterator();
- assertEquals("BAZ", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("FOO", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
- assertEquals("BAR", ((SecondaryTableAnnotation) secondaryTables.next()).getName());
-
- assertNotNull(resourceType.getAnnotation(0, JPA.SECONDARY_TABLE));
- assertEquals(3, resourceType.getAnnotationsSize(JPA.SECONDARY_TABLE));
- }
-
- public void testRemoveSecondaryTableCopyExisting() throws Exception {
- ICompilationUnit cu = createTestSecondaryTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- String expected1 = "@SecondaryTables({";
- String expected2 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" })),";
- String expected3 = "@SecondaryTable(name = \"BAR\") })";
- SecondaryTableAnnotation secondaryTable = (SecondaryTableAnnotation) resourceType.addAnnotation(1, JPA.SECONDARY_TABLE);
- secondaryTable.setName("BAR");
- assertSourceContains(expected1, cu);
- assertSourceContains(expected2, cu);
- assertSourceContains(expected3, cu);
-
- expected1 = "@SecondaryTable(name = \"FOO\", catalog = \"BAR\", schema = \"BAZ\", uniqueConstraints = @UniqueConstraint(columnNames = { \"BAR\" }))";
- resourceType.removeAnnotation(1, JPA.SECONDARY_TABLE);
- assertSourceContains(expected1, cu);
- assertSourceDoesNotContain("@SecondaryTables", cu);
- }
-
-
- public void testPkJoinColumns() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(0, table.getPkJoinColumnsSize());
- }
-
- public void testPkJoinColumns2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addPkJoinColumn(0);
- table.addPkJoinColumn(1);
-
- assertEquals(2, table.getPkJoinColumnsSize());
- }
-
- public void testPkJoinColumns3() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getPkJoinColumnsSize());
- }
-
- public void testAddPkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTables();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.addPkJoinColumn(0).setName("FOO");
- table.addPkJoinColumn(1);
- table.addPkJoinColumn(0).setName("BAR");
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"),@PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn}))", cu);
- }
-
- public void testRemovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- table.removePkJoinColumn(1);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAR\"), @PrimaryKeyJoinColumn(name = \"BAZ\")}))", cu);
-
- table.removePkJoinColumn(0);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = @PrimaryKeyJoinColumn(name = \"BAZ\")))", cu);
-
- table.removePkJoinColumn(0);
- assertSourceDoesNotContain("@SecondaryTable(", cu);
- }
-
- public void testMovePkJoinColumn() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(2, 0);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\"), @PrimaryKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\")}))", cu);
- }
-
- public void testMovePkJoinColumn2() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
- joinColumn.setReferencedColumnName("REF_NAME");
- joinColumn.setColumnDefinition("COLUMN_DEF");
- table.movePkJoinColumn(0, 2);
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"BAZ\"), @PrimaryKeyJoinColumn(name = \"BAR\", referencedColumnName = \"REF_NAME\", columnDefinition = \"COLUMN_DEF\"), @PrimaryKeyJoinColumn(name = \"FOO\")}))", cu);
- }
-
- public void testSetPkJoinColumnName() throws Exception {
- ICompilationUnit cu = this.createTestSecondaryTablesWithPkJoinColumns();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- SecondaryTableAnnotation table = (SecondaryTableAnnotation) resourceType.getAnnotation(0, JPA.SECONDARY_TABLE);
-
- assertEquals(3, table.getPkJoinColumnsSize());
-
- PrimaryKeyJoinColumnAnnotation joinColumn = table.pkJoinColumnAt(0);
-
- assertEquals("BAR", joinColumn.getName());
-
- joinColumn.setName("foo");
- assertEquals("foo", joinColumn.getName());
-
- assertSourceContains("@SecondaryTables(@SecondaryTable(pkJoinColumns = {@PrimaryKeyJoinColumn(name = \"foo\"), @PrimaryKeyJoinColumn(name = \"FOO\"), @PrimaryKeyJoinColumn(name = \"BAZ\")}))", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SequenceGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SequenceGeneratorTests.java
deleted file mode 100644
index 8e99caf5bb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/SequenceGeneratorTests.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-
-@SuppressWarnings("nls")
-public class SequenceGeneratorTests extends JpaJavaResourceModelTestCase {
-
- private static final String GENERATOR_NAME = "MY_GENERATOR";
- private static final String GENERATOR_SEQUENCE_NAME = "MY_SEQUENCE";
- private static final Integer GENERATOR_ALLOCATION_SIZE = Integer.valueOf(5);
- private static final Integer GENERATOR_INITIAL_VALUE = Integer.valueOf(5);
-
- public SequenceGeneratorTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestSequenceGeneratorOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithName() throws Exception {
- return createTestSequenceGeneratorWithStringElement("name", GENERATOR_NAME);
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithSequenceName() throws Exception {
- return createTestSequenceGeneratorWithStringElement("sequenceName", GENERATOR_SEQUENCE_NAME);
- }
-
- protected ICompilationUnit createTestSequenceGeneratorWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithAllocationSize() throws Exception {
- return createTestSequenceGeneratorWithIntElement("allocationSize", GENERATOR_ALLOCATION_SIZE.intValue());
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithInitialValue() throws Exception {
- return createTestSequenceGeneratorWithIntElement("initialValue", GENERATOR_INITIAL_VALUE.intValue());
- }
-
- private ICompilationUnit createTestSequenceGeneratorWithIntElement(final String elementName, final int value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@SequenceGenerator(" + elementName + " = " + value + ")");
- }
- });
- }
-
- public void testSequenceGeneratorOnField() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertNotNull(sequenceGenerator);
- }
-
- public void testSequenceGeneratorOnType() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceType.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertNotNull(sequenceGenerator);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_NAME, sequenceGenerator.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_NAME, sequenceGenerator.getName());
-
- sequenceGenerator.setName("foo");
- assertEquals("foo", sequenceGenerator.getName());
-
- assertSourceContains("@SequenceGenerator(name = \"foo\")", cu);
-
- sequenceGenerator.setName(null);
- assertNull(sequenceGenerator.getName());
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
- }
-
- public void testGetSequenceName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSequenceName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SEQUENCE_NAME, sequenceGenerator.getSequenceName());
- }
-
- public void testSetSequenceName() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithSequenceName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_SEQUENCE_NAME, sequenceGenerator.getSequenceName());
-
- sequenceGenerator.setSequenceName("foo");
- assertEquals("foo", sequenceGenerator.getSequenceName());
-
- assertSourceContains("@SequenceGenerator(sequenceName = \"foo\")", cu);
-
- sequenceGenerator.setSequenceName(null);
- assertNull(sequenceGenerator.getSequenceName());
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
- }
-
- public void testGetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithAllocationSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, sequenceGenerator.getAllocationSize());
- }
-
- public void testSetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithAllocationSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, sequenceGenerator.getAllocationSize());
-
- sequenceGenerator.setAllocationSize(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), sequenceGenerator.getAllocationSize());
-
- assertSourceContains("@SequenceGenerator(allocationSize = 500)", cu);
-
- sequenceGenerator.setAllocationSize(null);
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
-
- sequenceGenerator.setAllocationSize(Integer.valueOf(0));
- assertSourceContains("@SequenceGenerator(allocationSize = 0)", cu);
- }
-
- public void testGetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithInitialValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, sequenceGenerator.getInitialValue());
- }
-
- public void testSetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestSequenceGeneratorWithInitialValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- SequenceGeneratorAnnotation sequenceGenerator = (SequenceGeneratorAnnotation) resourceField.getAnnotation(JPA.SEQUENCE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, sequenceGenerator.getInitialValue());
-
- sequenceGenerator.setInitialValue(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), sequenceGenerator.getInitialValue());
-
- assertSourceContains("@SequenceGenerator(initialValue = 500)", cu);
-
- sequenceGenerator.setInitialValue(null);
-
- assertSourceDoesNotContain("@SequenceGenerator(", cu);
-
- sequenceGenerator.setInitialValue(Integer.valueOf(0));
- assertSourceContains("@SequenceGenerator(initialValue = 0)", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableGeneratorTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableGeneratorTests.java
deleted file mode 100644
index cf2ec06bbf..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableGeneratorTests.java
+++ /dev/null
@@ -1,502 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-
-@SuppressWarnings("nls")
-public class TableGeneratorTests extends JpaJavaResourceModelTestCase {
-
- private static final String GENERATOR_NAME = "MY_GENERATOR";
- private static final String GENERATOR_TABLE = "MY_TABLE";
- private static final String GENERATOR_CATALOG = "MY_CATALOG";
- private static final String GENERATOR_SCHEMA = "MY_SCHEMA";
- private static final String GENERATOR_PK_COLUMN_NAME = "MY_PK_COLUMN_NAME";
- private static final String GENERATOR_VALUE_COLUMN_NAME = "MY_VALUE_COLUMN_NAME";
- private static final String GENERATOR_PK_COLUMN_VALUE = "MY_PK_COLUMN_VALUE";
- private static final Integer GENERATOR_ALLOCATION_SIZE = Integer.valueOf(5);
- private static final Integer GENERATOR_INITIAL_VALUE = Integer.valueOf(5);
-
- public TableGeneratorTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTableGeneratorOnField() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorOnType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorWithName() throws Exception {
- return createTestTableGeneratorWithStringElement("name", GENERATOR_NAME);
- }
-
- private ICompilationUnit createTestTableGeneratorWithTable() throws Exception {
- return createTestTableGeneratorWithStringElement("table", GENERATOR_TABLE);
- }
-
- private ICompilationUnit createTestTableGeneratorWithCatalog() throws Exception {
- return createTestTableGeneratorWithStringElement("catalog", GENERATOR_CATALOG);
- }
-
- private ICompilationUnit createTestTableGeneratorWithSchema() throws Exception {
- return createTestTableGeneratorWithStringElement("schema", GENERATOR_SCHEMA);
- }
- private ICompilationUnit createTestTableGeneratorWithPkColumnName() throws Exception {
- return createTestTableGeneratorWithStringElement("pkColumnName", GENERATOR_PK_COLUMN_NAME);
- }
-
- private ICompilationUnit createTestTableGeneratorWithValueColumnName() throws Exception {
- return createTestTableGeneratorWithStringElement("valueColumnName", GENERATOR_VALUE_COLUMN_NAME);
- }
-
- private ICompilationUnit createTestTableGeneratorWithPkColumnValue() throws Exception {
- return createTestTableGeneratorWithStringElement("pkColumnValue", GENERATOR_PK_COLUMN_VALUE);
- }
-
- private ICompilationUnit createTestTableGeneratorWithStringElement(final String elementName, final String value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator(" + elementName + " = \"" + value + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorWithAllocationSize() throws Exception {
- return createTestTableGeneratorWithIntElement("allocationSize", GENERATOR_ALLOCATION_SIZE.intValue());
- }
-
- private ICompilationUnit createTestTableGeneratorWithInitialValue() throws Exception {
- return createTestTableGeneratorWithIntElement("initialValue", GENERATOR_INITIAL_VALUE.intValue());
- }
-
- private ICompilationUnit createTestTableGeneratorWithIntElement(final String elementName, final int value) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator(" + elementName + " = " + value + ")");
- }
- });
- }
-
- private ICompilationUnit createTestTableGeneratorWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE_GENERATOR, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- public void testTableGeneratorOnField() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertNotNull(tableGenerator);
- }
-
- public void testTableGeneratorOnType() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceType.getAnnotation(JPA.TABLE_GENERATOR);
- assertNotNull(tableGenerator);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_NAME, tableGenerator.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_NAME, tableGenerator.getName());
-
- tableGenerator.setName("foo");
- assertEquals("foo", tableGenerator.getName());
-
- assertSourceContains("@TableGenerator(name = \"foo\")", cu);
-
- tableGenerator.setName(null);
- assertNull(tableGenerator.getName());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_TABLE, tableGenerator.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_TABLE, tableGenerator.getTable());
-
- tableGenerator.setTable("foo");
- assertEquals("foo", tableGenerator.getTable());
-
- assertSourceContains("@TableGenerator(table = \"foo\")", cu);
-
- tableGenerator.setTable(null);
- assertNull(tableGenerator.getTable());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, tableGenerator.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_CATALOG, tableGenerator.getCatalog());
-
- tableGenerator.setCatalog("foo");
- assertEquals("foo", tableGenerator.getCatalog());
-
- assertSourceContains("@TableGenerator(catalog = \"foo\")", cu);
-
- tableGenerator.setCatalog(null);
- assertNull(tableGenerator.getCatalog());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, tableGenerator.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_SCHEMA, tableGenerator.getSchema());
-
- tableGenerator.setSchema("foo");
- assertEquals("foo", tableGenerator.getSchema());
-
- assertSourceContains("@TableGenerator(schema = \"foo\")", cu);
-
- tableGenerator.setSchema(null);
- assertNull(tableGenerator.getSchema());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetPkColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_NAME, tableGenerator.getPkColumnName());
- }
-
- public void testSetPkColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_NAME, tableGenerator.getPkColumnName());
-
- tableGenerator.setPkColumnName("foo");
- assertEquals("foo", tableGenerator.getPkColumnName());
-
- assertSourceContains("@TableGenerator(pkColumnName = \"foo\")", cu);
-
- tableGenerator.setPkColumnName(null);
- assertNull(tableGenerator.getPkColumnName());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetValueColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithValueColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_VALUE_COLUMN_NAME, tableGenerator.getValueColumnName());
- }
-
- public void testSetValueColumnName() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithValueColumnName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_VALUE_COLUMN_NAME, tableGenerator.getValueColumnName());
-
- tableGenerator.setValueColumnName("foo");
- assertEquals("foo", tableGenerator.getValueColumnName());
-
- assertSourceContains("@TableGenerator(valueColumnName = \"foo\")", cu);
-
- tableGenerator.setValueColumnName(null);
- assertNull(tableGenerator.getValueColumnName());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetPkColumnValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_VALUE, tableGenerator.getPkColumnValue());
- }
-
- public void testSetPkColumnValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithPkColumnValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_PK_COLUMN_VALUE, tableGenerator.getPkColumnValue());
-
- tableGenerator.setPkColumnValue("foo");
- assertEquals("foo", tableGenerator.getPkColumnValue());
-
- assertSourceContains("@TableGenerator(pkColumnValue = \"foo\")", cu);
-
- tableGenerator.setPkColumnValue(null);
- assertNull(tableGenerator.getPkColumnValue());
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testGetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithAllocationSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, tableGenerator.getAllocationSize());
- }
-
- public void testSetAllocationSize() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithAllocationSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_ALLOCATION_SIZE, tableGenerator.getAllocationSize());
-
- tableGenerator.setAllocationSize(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), tableGenerator.getAllocationSize());
-
- assertSourceContains("@TableGenerator(allocationSize = 500)", cu);
-
- tableGenerator.setAllocationSize(null);
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
-
- tableGenerator.setAllocationSize(Integer.valueOf(0));
- assertSourceContains("@TableGenerator(allocationSize = 0)", cu);
- }
-
- public void testGetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithInitialValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, tableGenerator.getInitialValue());
- }
-
- public void testSetInitialValue() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithInitialValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
- assertEquals(GENERATOR_INITIAL_VALUE, tableGenerator.getInitialValue());
-
- tableGenerator.setInitialValue(Integer.valueOf(500));
- assertEquals(Integer.valueOf(500), tableGenerator.getInitialValue());
-
- assertSourceContains("@TableGenerator(initialValue = 500)", cu);
-
- tableGenerator.setInitialValue(null);
-
- assertSourceDoesNotContain("@TableGenerator(", cu);
-
- tableGenerator.setInitialValue(Integer.valueOf(0));
- assertSourceContains("@TableGenerator(initialValue = 0)", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(0, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.addUniqueConstraint(0);
- tableGenerator.addUniqueConstraint(1);
-
- assertEquals(2, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- assertEquals(3, tableGenerator.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorOnField();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.addUniqueConstraint(0).addColumnName("FOO");
- tableGenerator.addUniqueConstraint(1);
- tableGenerator.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", tableGenerator.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", tableGenerator.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, tableGenerator.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertEquals(3, tableGenerator.getUniqueConstraintsSize());
- assertSourceContains("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.removeUniqueConstraint(1);
- assertSourceContains("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- tableGenerator.removeUniqueConstraint(0);
- assertSourceContains("@TableGenerator(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- tableGenerator.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@TableGenerator(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.moveUniqueConstraint(2, 0);
- assertSourceContains("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTableGeneratorWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TableGeneratorAnnotation tableGenerator = (TableGeneratorAnnotation) resourceField.getAnnotation(JPA.TABLE_GENERATOR);
-
- tableGenerator.moveUniqueConstraint(0, 2);
- assertSourceContains("@TableGenerator(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableTests.java
deleted file mode 100644
index f14a6b4aba..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TableTests.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-
-@SuppressWarnings("nls")
-public class TableTests extends JpaJavaResourceModelTestCase {
-
- private static final String TABLE_NAME = "MY_TABLE";
- private static final String SCHEMA_NAME = "MY_SCHEMA";
- private static final String CATALOG_NAME = "MY_CATALOG";
-
- public TableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(name = \"" + TABLE_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithSchema() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(schema = \"" + SCHEMA_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithCatalog() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(catalog = \"" + CATALOG_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTableWithUniqueConstraints() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TABLE, JPA.UNIQUE_CONSTRAINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertEquals(TABLE_NAME, table.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getName());
- assertNull(table.getCatalog());
- assertNull(table.getSchema());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getName());
-
- table.setName("Foo");
- assertEquals("Foo", table.getName());
-
- assertSourceContains("@Table(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestTableWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertEquals(TABLE_NAME, table.getName());
-
- table.setName(null);
- assertNull(table.getName());
-
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testGetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertEquals(CATALOG_NAME, table.getCatalog());
- }
-
- public void testSetCatalog() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getCatalog());
-
- table.setCatalog("Foo");
- assertEquals("Foo", table.getCatalog());
-
- assertSourceContains("@Table(catalog = \"Foo\")", cu);
- }
-
- public void testSetCatalogNull() throws Exception {
- ICompilationUnit cu = this.createTestTableWithCatalog();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertEquals(CATALOG_NAME, table.getCatalog());
-
- table.setCatalog(null);
- assertNull(table.getCatalog());
-
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testGetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertEquals(SCHEMA_NAME, table.getSchema());
- }
-
- public void testSetSchema() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertNotNull(table);
- assertNull(table.getSchema());
-
- table.setSchema("Foo");
- assertEquals("Foo", table.getSchema());
-
- assertSourceContains("@Table(schema = \"Foo\")", cu);
- }
-
- public void testSetSchemaNull() throws Exception {
- ICompilationUnit cu = this.createTestTableWithSchema();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- assertEquals(SCHEMA_NAME, table.getSchema());
-
- table.setSchema(null);
- assertNull(table.getSchema());
-
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testUniqueConstraints() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals(0, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints2() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1);
-
- assertEquals(2, table.getUniqueConstraintsSize());
- }
-
- public void testUniqueConstraints3() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- assertEquals(3, table.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1);
- table.addUniqueConstraint(0).addColumnName("BAR");
-
- assertEquals("BAR", table.uniqueConstraintAt(0).columnNameAt(0));
- assertEquals("FOO", table.uniqueConstraintAt(1).columnNameAt(0));
- assertEquals(0, table.uniqueConstraintAt(2).getColumnNamesSize());
-
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"FOO\"), @UniqueConstraint})", cu);
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(0);
- table.addUniqueConstraint(1).addColumnName("BAR");
- table.uniqueConstraintAt(1).addColumnName("BAZ");
-
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint,@UniqueConstraint(columnNames = { \"BAR\", \"BAZ\" }), @UniqueConstraint(columnNames = \"FOO\")})", cu);
-
- assertEquals("FOO", table.uniqueConstraintAt(2).columnNameAt(0));
- ListIterator<String> columnNames = table.uniqueConstraintAt(1).getColumnNames().iterator();
- assertEquals("BAR", columnNames.next());
- assertEquals("BAZ", columnNames.next());
- }
- public void testRemoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.removeUniqueConstraint(1);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"BAZ\"})})", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceContains("@Table(uniqueConstraints = @UniqueConstraint(columnNames = {\"BAZ\"}))", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testRemoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1).addColumnName("BAR");
- table.addUniqueConstraint(2).addColumnName("BAZ");
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"FOO\"),@UniqueConstraint(columnNames = \"BAR\"), @UniqueConstraint(columnNames = \"BAZ\")})", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"BAR\"),@UniqueConstraint(columnNames = \"BAZ\")})", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceContains("@Table(uniqueConstraints = @UniqueConstraint(columnNames = \"BAZ\"))", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testRemoveUniqueConstraint3() throws Exception {
- ICompilationUnit cu = this.createTestTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
- table.addUniqueConstraint(0).addColumnName("FOO");
- table.addUniqueConstraint(1).addColumnName("BAR");
- table.addUniqueConstraint(2).addColumnName("BAZ");
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"FOO\"),@UniqueConstraint(columnNames = \"BAR\"), @UniqueConstraint(columnNames = \"BAZ\")})", cu);
-
- table.removeUniqueConstraint(2);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = \"FOO\"),@UniqueConstraint(columnNames = \"BAR\")})", cu);
-
- table.removeUniqueConstraint(1);
- assertSourceContains("@Table(uniqueConstraints = @UniqueConstraint(columnNames = \"FOO\"))", cu);
-
- table.removeUniqueConstraint(0);
- assertSourceDoesNotContain("@Table(", cu);
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.moveUniqueConstraint(2, 0);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {\"FOO\"}), @UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"})})", cu);
- }
-
- public void testMoveUniqueConstraint2() throws Exception {
- ICompilationUnit cu = this.createTestTableWithUniqueConstraints();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- TableAnnotation table = (TableAnnotation) resourceType.getAnnotation(JPA.TABLE);
-
- table.moveUniqueConstraint(0, 2);
- assertSourceContains("@Table(uniqueConstraints = {@UniqueConstraint(columnNames = {\"BAZ\"}), @UniqueConstraint(columnNames = {\"BAR\"}), @UniqueConstraint(columnNames = {\"FOO\"})})", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TemporalTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TemporalTests.java
deleted file mode 100644
index 61953901d4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TemporalTests.java
+++ /dev/null
@@ -1,89 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalType;
-
-@SuppressWarnings("nls")
-public class TemporalTests extends JpaJavaResourceModelTestCase {
-
- public TemporalTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTemporal() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TEMPORAL);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Temporal");
- }
- });
- }
-
- private ICompilationUnit createTestTemporalWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TEMPORAL, JPA.TEMPORAL_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Temporal(TemporalType.DATE)");
- }
- });
- }
-
- public void testTemporal() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(JPA.TEMPORAL);
- assertNotNull(temporal);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporalWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(JPA.TEMPORAL);
- assertEquals(TemporalType.DATE, temporal.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestTemporal();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(JPA.TEMPORAL);
-
- temporal.setValue(TemporalType.TIME);
-
- assertSourceContains("@Temporal(TIME)", cu);
-
- temporal.setValue(null);
-
- assertSourceDoesNotContain("@Temporal(", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TransientTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TransientTests.java
deleted file mode 100644
index 8815516a87..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/TransientTests.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-
-@SuppressWarnings("nls")
-public class TransientTests extends JpaJavaResourceModelTestCase {
-
- public TransientTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTransient() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.TRANSIENT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient");
- }
- });
- }
-
- public void testTransient() throws Exception {
- ICompilationUnit cu = this.createTestTransient();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof TransientAnnotation);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/VersionTests.java b/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/VersionTests.java
deleted file mode 100644
index 2f045e7a63..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/src/org/eclipse/jpt/jpa/core/tests/internal/resource/java/VersionTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceNode;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-
-@SuppressWarnings("nls")
-public class VersionTests extends JpaJavaResourceModelTestCase {
-
- public VersionTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestVersion() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.VERSION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version");
- }
- });
- }
-
- public void testVersion() throws Exception {
- ICompilationUnit cu = this.createTestVersion();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- JavaResourceNode mappingAnnotation = resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME);
- assertTrue(mappingAnnotation instanceof VersionAnnotation);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.core.tests/test.xml b/jpa/tests/org.eclipse.jpt.jpa.core.tests/test.xml
deleted file mode 100644
index 2188dfd2f6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.core.tests/test.xml
+++ /dev/null
@@ -1,35 +0,0 @@
-<?xml version="1.0"?> <!--
- Copyright (c) 2007, 2010 Oracle. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation -->
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jpa.core.tests"/> <echo level="debug" message="testRoot: ${testRoot}" />
- <fail message="testRoot must be set" unless="testRoot" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.core.tests.internal.model.JptJpaCoreModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> </ant> </target> <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.core.tests.internal.resource.JptJpaCoreResourceModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar}"/> </ant> </target> <target name="suite3"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.core.tests.internal.context.JptJpaCoreContextModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar}"/> </ant> </target> <target name="suite4"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.core.tests.internal.metadata.JptJpaCoreMetadataTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar}"/> </ant> </target>
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, suite2, suite3, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.db.tests/.classpath
deleted file mode 100644
index 5c128f330d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.db.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.db.tests/.project
deleted file mode 100644
index fdaecf7d3c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.db.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.db.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 486063b88e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:08:49 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.db.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index f296c9f361..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,19 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.db.tests
-Bundle-Version: 2.0.0.qualifier
-Bundle-Activator: org.eclipse.jpt.jpa.db.tests.internal.JptJpaDbTestsPlugin
-Bundle-ActivationPolicy: lazy
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.datatools.connectivity;bundle-version="[1.1.0,1.3.0)",
- org.eclipse.datatools.connectivity.sqm.core;bundle-version="1.0.1",
- org.eclipse.datatools.modelbase.sql;bundle-version="1.0.0",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.junit;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jpt.jpa.db.tests.internal;x-internal:=true,
- org.eclipse.jpt.jpa.db.tests.internal.platforms;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/about.html b/jpa/tests/org.eclipse.jpt.jpa.db.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/build.properties
deleted file mode 100644
index d27ab8f407..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/build.properties
+++ /dev/null
@@ -1,14 +0,0 @@
-################################################################################
-# Copyright (c) 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = .,\
- META-INF/,\
- plugin.properties
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/derby.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/derby.properties
deleted file mode 100644
index 242d156070..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/derby.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional for Derby
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/derby/lib/derby.jar
-jars =
-
-# the JDBC URL is required for Derby
-# url = jdbc:derby:C:/derby/data/testdb;create=true
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/mysql.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/mysql.properties
deleted file mode 100644
index d6407deb25..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/mysql.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/mysql/mysql-connector-java-5.0.6-bin.jar
-jars =
-
-# the JDBC URL is optional for MySQL
-# url = jdbc:mysql://localhost:3306
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10g.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10g.properties
deleted file mode 100644
index 4b911b44e1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10g.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID = scott
-password = tiger
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/oracle/jdbc/lib/ojdbc5.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:oracle:thin:@localhost:1521:testdb
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10gXE.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10gXE.properties
deleted file mode 100644
index e67c01a28e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle10gXE.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID = scott
-password = tiger
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/oracle/jdbc/lib/ojdbc5.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:oracle:thin:@localhost:1521:XE
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle9i.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle9i.properties
deleted file mode 100644
index 4b911b44e1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/oracle9i.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID = scott
-password = tiger
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/oracle/jdbc/lib/ojdbc5.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:oracle:thin:@localhost:1521:testdb
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/postgresql.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/postgresql.properties
deleted file mode 100644
index 32fafe463b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/postgresql.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/postgresql/jdbc/postgresql-8.2-505.jdbc3.jar
-jars =
-
-# the JDBC URL is optional for PostgreSQL
-# url = jdbc:postgresql
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sqlserver.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sqlserver.properties
deleted file mode 100644
index f72b645c52..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sqlserver.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/sqlserver/lib/sqljdbc.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:sqlserver://localhost:1433
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sybase.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sybase.properties
deleted file mode 100644
index 493d5d4ad9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/config/sybase.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2008 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-
-# Configure the workspace- and database server-specific settings here.
-
-# user and password are optional, depending on the platform
-userID =
-password =
-
-# the JDBC driver JAR(s) must be specified;
-# if there are multiple JARs, separate the names with commas
-# jars = C:/sybase/lib/jconn3.jar
-jars =
-
-# the JDBC URL is required
-# url = jdbc:sybase:Tds:localhost:5000
-url =
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.db.tests/plugin.properties
deleted file mode 100644
index 2c98779595..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/plugin.properties
+++ /dev/null
@@ -1,24 +0,0 @@
-################################################################################
-# Copyright (c) 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName = JPA DB Tests
-providerName = Eclipse.org
-
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTests.java
deleted file mode 100644
index 9d2efa4996..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTests.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-
-import junit.framework.TestCase;
-
-/**
- * These aren't tests. They are just an easy way to dump JDBC metadata to the
- * console.
- */
-@SuppressWarnings("nls")
-public class JDBCTests extends TestCase {
-
- public JDBCTests(String name) {
- super(name);
- }
-
- public void testDerby() throws Exception {
- this.dumpMetaData(DERBY);
- }
-
- public void testMySQL() throws Exception {
- this.dumpMetaData(MYSQL);
- }
-
- public void testOracle() throws Exception {
- this.dumpMetaData(ORACLE);
- }
-
- public void testPostgreSQL() throws Exception {
- this.dumpMetaData(POSTGRESQL);
- }
-
- public void testSybase() throws Exception {
- this.dumpMetaData(SYBASE);
- }
-
- protected void dumpMetaData(ConnectionConfig config) throws Exception {
- System.out.println("***** PLATFORM: " + config.platformName + " *****");
- System.out.println();
- Class.forName(config.driverClassName);
- Connection connection = DriverManager.getConnection(this.buildURL(config), config.user, config.password);
- System.out.println("CATALOGS:");
- JDBCTools.dump(connection.getMetaData().getCatalogs());
- System.out.println();
- System.out.println("SCHEMATA:");
- JDBCTools.dump(connection.getMetaData().getSchemas());
- connection.close();
- System.out.println();
- }
-
- protected String buildURL(ConnectionConfig config) {
- return "jdbc:" + config.databaseURL;
- }
-
- protected static final ConnectionConfig DERBY =
- new ConnectionConfig(
- "Derby",
- "org.apache.derby.jdbc.EmbeddedDriver",
- "derby:C:/derby/data/test",
- null,
- null
- );
-
- protected static final ConnectionConfig MYSQL =
- new ConnectionConfig(
- "MySQL",
- "com.mysql.jdbc.Driver",
- "mysql://localhost:3306",
- "root",
- "oracle"
- );
-
- protected static final ConnectionConfig ORACLE =
- new ConnectionConfig(
- "Oracle",
- "oracle.jdbc.OracleDriver",
- "oracle:thin:@localhost:1521:orcl",
- "scott",
- "tiger"
- );
-
- protected static final ConnectionConfig POSTGRESQL =
- new ConnectionConfig(
- "PostgreSQL",
- "org.postgresql.Driver",
- "postgresql:postgres",
- "postgres",
- "oracle"
- );
-
- // the Sybase server must be configured explicitly to "localhost"
- // in the config file [SYBASE]/ini/sql.ini
- protected static final ConnectionConfig SYBASE =
- new ConnectionConfig(
- "Sybase",
- "com.sybase.jdbc3.jdbc.SybDriver",
- "sybase:Tds:localhost:5000",
- "sa",
- "oracle"
- );
-
- protected static class ConnectionConfig {
- protected final String platformName;
- protected final String driverClassName;
- protected final String databaseURL;
- protected final String user;
- protected final String password;
- protected ConnectionConfig(
- String platformName,
- String driverClassName,
- String databaseURL,
- String user,
- String password
- ) {
- super();
- this.platformName = platformName;
- this.driverClassName = driverClassName;
- this.databaseURL = databaseURL;
- this.user = user;
- this.password = password;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTools.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTools.java
deleted file mode 100644
index 4f8d879705..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JDBCTools.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal;
-
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.eclipse.jpt.common.utility.internal.iterators.ResultSetIterator;
-
-@SuppressWarnings("nls")
-public class JDBCTools {
-
- public static void dump(Connection connection, String sql) throws SQLException {
- dump(execute(connection, sql));
- }
-
- public static void dump(ResultSet resultSet) throws SQLException {
- PrintWriter pw = new PrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- dumpOn(resultSet, pw);
- }
- pw.flush();
- }
-
- public static void dumpOn(ResultSet resultSet, PrintWriter pw) throws SQLException {
- ArrayList<HashMap<String, Object>> maps = convertToMaps(resultSet);
- for (Iterator<HashMap<String, Object>> mapStream = maps.iterator(); mapStream.hasNext(); ) {
- for (Iterator<Map.Entry<String, Object>> entryStream = mapStream.next().entrySet().iterator(); entryStream.hasNext(); ) {
- Map.Entry<String, Object> entry = entryStream.next();
- pw.print(entry.getKey());
- pw.print(" = ");
- pw.print(entry.getValue());
- pw.println();
- }
- if (mapStream.hasNext()) {
- pw.println();
- }
- }
- pw.println("total rows: " + maps.size());
- }
-
- public static ArrayList<HashMap<String, Object>> convertToMaps(Connection connection, String sql) throws SQLException {
- return convertToMaps(execute(connection, sql));
- }
-
- public static ResultSet execute(Connection connection, String sql) throws SQLException {
- Statement statement = connection.createStatement();
- statement.execute(sql);
- ResultSet resultSet = statement.getResultSet();
- statement.close();
- return resultSet;
- }
-
- public static ArrayList<HashMap<String, Object>> convertToMaps(ResultSet resultSet) throws SQLException {
- ArrayList<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
- for (Iterator<HashMap<String, Object>> stream = buildMapIterator(resultSet); stream.hasNext(); ) {
- rows.add(stream.next());
- }
- return rows;
- }
-
- public static Iterator<HashMap<String, Object>> buildMapIterator(ResultSet resultSet) throws SQLException {
- return new ResultSetIterator<HashMap<String, Object>>(resultSet, new MapResultSetIteratorAdapter(buildColumnNames(resultSet)));
- }
-
- public static String[] buildColumnNames(ResultSet resultSet) throws SQLException {
- String[] names = new String[resultSet.getMetaData().getColumnCount()];
- for (int i = 0; i < names.length; i++) {
- names[i] = resultSet.getMetaData().getColumnName(i + 1); // NB: ResultSet index/subscript is 1-based
- }
- return names;
- }
-
- public static class MapResultSetIteratorAdapter implements ResultSetIterator.Adapter<HashMap<String, Object>> {
- private final String[] columnNames;
- public MapResultSetIteratorAdapter(String[] columnNames) {
- super();
- this.columnNames = columnNames;
- }
- public HashMap<String, Object> buildNext(ResultSet rs) throws SQLException {
- HashMap<String, Object> map = new HashMap<String, Object>(this.columnNames.length);
- for (int i = 0; i < this.columnNames.length; i++) {
- map.put(this.columnNames[i], rs.getObject(i + 1)); // NB: ResultSet index/subscript is 1-based
- }
- return map;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTests.java
deleted file mode 100644
index 937b8c2b8c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.db.tests.internal.platforms.AllPlatformTests;
-
-/**
- * JPT DB Tests
- */
-public class JptJpaDbTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaDbTests.class.getPackage().getName());
-
- suite.addTest( AllPlatformTests.suite());
-
- return suite;
- }
-
- private JptJpaDbTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTestsPlugin.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTestsPlugin.java
deleted file mode 100644
index f42832e95f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/JptJpaDbTestsPlugin.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal;
-
-import org.eclipse.core.runtime.Plugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * JptJpaDbTestsPlugin
- */
-public class JptJpaDbTestsPlugin extends Plugin {
-
- // The shared instance
- private static JptJpaDbTestsPlugin INSTANCE;
-
- public static final String BUNDLE_ID = "org.eclipse.jpt.jpa.db.tests"; //$NON-NLS-1$
-
- /**
- * Returns the shared instance
- */
- public static JptJpaDbTestsPlugin instance() {
- return INSTANCE;
- }
-
- /**
- * The constructor
- */
- public JptJpaDbTestsPlugin() {
- super();
- INSTANCE = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- @Override
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- @Override
- public void stop(BundleContext context) throws Exception {
- INSTANCE = null;
- super.stop(context);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/AllPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/AllPlatformTests.java
deleted file mode 100644
index 042e954e6a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/AllPlatformTests.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class AllPlatformTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(AllPlatformTests.class.getPackage().getName());
-
- suite.addTestSuite(DerbyTests.class);
- suite.addTestSuite(MySQLTests.class);
- suite.addTestSuite(Oracle10gTests.class);
-// suite.addTestSuite(Oracle10gXETests.class);
-// suite.addTestSuite(Oracle9iTests.class);
- suite.addTestSuite(PostgreSQLTests.class);
-// suite.addTestSuite(SQLServerTests.class);
- suite.addTestSuite(SybaseTests.class);
-
- return suite;
- }
-
- private AllPlatformTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DTPPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DTPPlatformTests.java
deleted file mode 100644
index 6cb7b60962..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DTPPlatformTests.java
+++ /dev/null
@@ -1,1030 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.net.URL;
-import java.sql.Connection;
-import java.sql.DatabaseMetaData;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import junit.framework.TestCase;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.datatools.connectivity.ConnectionProfileException;
-import org.eclipse.datatools.connectivity.IConnectionProfile;
-import org.eclipse.datatools.connectivity.ProfileManager;
-import org.eclipse.datatools.connectivity.drivers.IDriverMgmtConstants;
-import org.eclipse.datatools.connectivity.drivers.IPropertySet;
-import org.eclipse.datatools.connectivity.drivers.PropertySetImpl;
-import org.eclipse.datatools.connectivity.drivers.XMLFileManager;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.internal.ConnectivityPlugin;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.common.utility.IndentingPrintWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.StringTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ResultSetIterator;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ConnectionListener;
-import org.eclipse.jpt.jpa.db.ConnectionProfile;
-import org.eclipse.jpt.jpa.db.ConnectionProfileFactory;
-import org.eclipse.jpt.jpa.db.ConnectionProfileListener;
-import org.eclipse.jpt.jpa.db.Database;
-import org.eclipse.jpt.jpa.db.DatabaseIdentifierAdapter;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.JptJpaDbPlugin;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.SchemaContainer;
-import org.eclipse.jpt.jpa.db.Sequence;
-import org.eclipse.jpt.jpa.db.Table;
-import org.eclipse.jpt.jpa.db.tests.internal.JptJpaDbTestsPlugin;
-
-/**
- * Base class for testing DTP wrappers on various databases.
- */
-@SuppressWarnings("nls")
-public abstract class DTPPlatformTests extends TestCase {
-
- /**
- * The platform properties are loaded from a Java properties file in the
- * 'org.eclipse.jpt.jpa.db.tests/config' directory. Each database platform has
- * its own properties file (e.g. 'derby.properties').
- */
- private Properties platformProperties;
-
- /**
- * This is the Dali connection profile wrapper.
- */
- protected ConnectionProfile connectionProfile;
-
-
- // ********** constants **********
-
- private static final String PLATFORM_CONFIG_DIRECTORY = "config";
-
- private static final String DB_USER_ID_PROPERTY = "userID";
- private static final String DB_USER_ID_DEFAULT = "user";
-
- private static final String DB_PASSWORD_PROPERTY = "password";
- private static final String DB_PASSWORD_DEFAULT = "";
-
- private static final String DB_DRIVER_JARS_PROPERTY = "jars";
- // required - no default
-
- private static final String DB_URL_PROPERTY = "url";
- // required - no default
-
-
-
- // ********** constructor **********
-
- protected DTPPlatformTests(String name) {
- super(name);
- }
-
-
- // ********** set-up/tear-down **********
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.platformProperties = this.loadPlatformProperties();
- this.buildDTPDriverDefinitionFile();
- this.buildDTPConnectionProfile();
- this.connectionProfile = this.getConnectionProfileFactory().buildConnectionProfile(this.getProfileName(), DatabaseIdentifierAdapter.Default.instance());
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.connectionProfile = null;
- this.platformProperties = null;
-
- super.tearDown();
- }
-
- // ***** platform properties file
- private Properties loadPlatformProperties() throws IOException {
- Properties p = new Properties();
- p.load(this.buildPlatformPropertiesFileURL().openStream());
- return p;
- }
-
- private URL buildPlatformPropertiesFileURL() {
- return Platform.getBundle(this.getTestPluginBundleID()).getEntry(this.getPlatformPropertiesFilePath());
- }
-
- private String getTestPluginBundleID() {
- return JptJpaDbTestsPlugin.BUNDLE_ID;
- }
-
- private String getPlatformPropertiesFilePath() {
- return this.getPlatformPropertiesDirectoryName() + '/' + this.getPlatformPropertiesFileName();
- }
-
- private String getPlatformPropertiesDirectoryName() {
- return PLATFORM_CONFIG_DIRECTORY;
- }
-
- /**
- * Each database platform has a separate properties file in the 'config'
- * directory that must be customized by whomever is executing the tests.
- */
- protected abstract String getPlatformPropertiesFileName();
-
- // ***** driver definition file
- private void buildDTPDriverDefinitionFile() throws CoreException {
- XMLFileManager.setStorageLocation(this.getDTPDriverDefinitionLocation());
- XMLFileManager.setFileName(this.getDTPDriverFileName());
-
- IPropertySet[] sets = XMLFileManager.loadPropertySets();
- for (IPropertySet set : sets) {
- if (set.getID().equals(this.getDriverDefinitionID())) {
- return; // property sets live across tests
- }
- }
-
- XMLFileManager.saveNamedPropertySet(this.buildDTPDriverDefinitionPropertySets());
-
- // verify the file was created:
- File driverDefinitioneFile = this.getDTPDriverDefinitionLocation().append(this.getDTPDriverFileName()).toFile();
- assertTrue(driverDefinitioneFile.exists());
- }
-
- private IPath getDTPDriverDefinitionLocation() {
- return ConnectivityPlugin.getDefault().getStateLocation();
- }
-
- private String getDTPDriverFileName() {
- return IDriverMgmtConstants.DRIVER_FILE;
- }
-
- private IPropertySet[] buildDTPDriverDefinitionPropertySets() {
- IPropertySet[] propertySets = new IPropertySet[1];
- PropertySetImpl propertySet = new PropertySetImpl(this.getDriverName(), this.getDriverDefinitionID());
- propertySet.setProperties(this.getDriverDefinitionID(), this.buildDTPDriverDefinitionProperties());
- propertySets[0] = propertySet;
- return propertySets;
- }
-
- protected abstract String getDriverName();
-
- protected abstract String getDriverDefinitionID();
-
- private Properties buildDTPDriverDefinitionProperties() {
- Properties p = new Properties();
- p.setProperty(ConnectionProfile.DRIVER_DEFINITION_TYPE_PROP_ID, this.getDriverDefinitionType());
- p.setProperty(ConnectionProfile.DRIVER_JAR_LIST_PROP_ID, this.getJDBCDriverJarList());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.getDatabaseVendor());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.getDatabaseVersion());
- p.setProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.getDriverClass());
- p.setProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID, this.getJDBCURL());
- p.setProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID, this.getUserID());
- p.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID, this.getPassword());
- return p;
- }
-
- protected abstract String getDriverDefinitionType();
-
- /**
- * The JAR list is workspace-specific and is set in the properties file.
- */
- private String getJDBCDriverJarList() {
- return this.getRequiredPlatformProperty(DB_DRIVER_JARS_PROPERTY);
- }
-
- protected abstract String getDatabaseVendor();
-
- protected abstract String getDatabaseVersion();
-
- protected abstract String getDriverClass();
-
- /**
- * The database URL is workspace-specific and is set in the properties file
- * for some databases.
- */
- private String getJDBCURL() {
- return this.platformProperties.getProperty(DB_URL_PROPERTY, this.getDefaultJDBCURL());
- }
-
- protected String getDefaultJDBCURL() {
- return "";
- }
-
- /**
- * The user ID is optional and can be set in the properties file.
- */
- protected String getUserID() {
- return this.platformProperties.getProperty(DB_USER_ID_PROPERTY, DB_USER_ID_DEFAULT);
- }
-
- /**
- * The password is optional and can be set in the properties file.
- */
- private String getPassword() {
- return this.platformProperties.getProperty(DB_PASSWORD_PROPERTY, DB_PASSWORD_DEFAULT);
- }
-
- // ***** DTP connection profile
- private void buildDTPConnectionProfile() throws ConnectionProfileException {
- if (this.getDTPProfileManager().getProfileByName(this.getProfileName()) != null) {
- return; // profiles live across tests
- }
- this.createProfile(this.getProfileName());
- assertNotNull(this.getDTPProfileManager().getProfileByName(this.getProfileName()));
- }
-
- protected void createProfile(String profileName) throws ConnectionProfileException {
- this.getDTPProfileManager().createProfile(
- profileName,
- this.getProfileDescription(),
- this.getProviderID(),
- this.buildDTPConnectionProfileProperties()
- );
- }
-
- protected abstract String getProfileName();
-
- protected abstract String getProfileDescription();
-
- protected String getProviderID() {
- return ConnectionProfile.CONNECTION_PROFILE_TYPE;
- }
-
- protected Properties buildDTPConnectionProfileProperties() {
- Properties p = new Properties();
- p.setProperty(IJDBCDriverDefinitionConstants.USERNAME_PROP_ID, this.getUserID());
- p.setProperty(IJDBCDriverDefinitionConstants.PASSWORD_PROP_ID, this.getPassword());
- p.setProperty(ConnectionProfile.DRIVER_DEFINITION_PROP_ID, this.getDriverDefinitionID());
-
- p.setProperty(IJDBCDriverDefinitionConstants.DRIVER_CLASS_PROP_ID, this.getDriverClass());
- p.setProperty(IJDBCDriverDefinitionConstants.URL_PROP_ID, this.getJDBCURL());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VENDOR_PROP_ID, this.getDatabaseVendor());
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_VERSION_PROP_ID, this.getDatabaseVersion());
-
- p.setProperty(ConnectionProfile.DATABASE_SAVE_PWD_PROP_ID, this.passwordIsSaved());
- return p;
- }
-
- private String passwordIsSaved() {
- return "true";
- }
-
-
- // ********** tests **********
-
- public void testConnectionProfileListener() throws ConnectionProfileException {
- TestConnectionProfileListener listener = new TestConnectionProfileListener();
- this.getConnectionProfileFactory().addConnectionProfileListener(listener);
-
- String cpName1 = this.getProfileName() + "1";
- this.createProfile(cpName1);
- IConnectionProfile dtpCP = this.getDTPProfileManager().getProfileByName(cpName1);
- assertNotNull(dtpCP);
-
- assertEquals(cpName1, listener.addedName);
- listener.clear();
-
- String cpName2 = this.getProfileName() + "2";
- this.getDTPProfileManager().modifyProfile(dtpCP, cpName2, null);
- assertEquals(cpName1, listener.renamedOldName);
- assertEquals(cpName2, listener.renamedNewName);
- listener.clear();
-
- ConnectionProfile cp = this.getConnectionProfileFactory().buildConnectionProfile(cpName2);
- assertNotNull(cp);
-
- this.getDTPProfileManager().deleteProfile(dtpCP);
- assertEquals(cpName2, listener.removedName);
- listener.clear();
-
- cp = this.getConnectionProfileFactory().buildConnectionProfile(cpName2);
- assertNull(cp);
-
- this.getConnectionProfileFactory().removeConnectionProfileListener(listener);
- }
-
- public void testName() {
- assertEquals(this.getProfileName(), this.connectionProfile.getName());
- }
-
- public void testConnection() throws Exception {
- assertTrue(this.connectionProfile.isInactive());
- assertTrue(this.connectionProfile.isDisconnected());
- this.connectionProfile.connect();
- assertTrue(this.connectionProfile.isActive());
- assertTrue(this.connectionProfile.isConnected());
-
- this.verifyDatabaseVersionNumber();
- this.verifyDatabaseVendor();
- this.verifyDatabaseContent();
-
- this.connectionProfile.disconnect();
- assertTrue(this.connectionProfile.isInactive());
- assertTrue(this.connectionProfile.isDisconnected());
- }
-
- private void verifyDatabaseVersionNumber() {
- Database database = this.connectionProfile.getDatabase();
- assertNotNull(database);
-
- String actual = database.getVersion();
- String expected = this.getDatabaseVersion();
- String errorMessage = "expected: " + expected + " - actual: " + actual;
- // partial match is good enough
- assertTrue(errorMessage, actual.indexOf(expected) != -1);
- }
-
- private void verifyDatabaseVendor() {
- Database database = this.connectionProfile.getDatabase();
- String actual = database.getVendorName();
- String expected = this.getDatabaseVendor();
- assertEquals(expected, actual);
- }
-
- private void verifyDatabaseContent() {
- Database database = this.connectionProfile.getDatabase();
- assertTrue(database.getSchemataSize() >= 0);
-
- Schema schema = database.getDefaultSchema();
- if (schema != null) {
- if (schema.getTablesSize() > 0) {
- Table table = schema.getTables().iterator().next();
- assertTrue(table.getColumnsSize() >= 0);
- assertTrue(table.getPrimaryKeyColumnsSize() >= 0);
- assertTrue(table.getForeignKeysSize() >= 0);
- }
- }
- }
-
- protected abstract boolean executeOfflineTests();
-
- public final void testOffline() {
- if ( ! this.executeOfflineTests()) {
- return;
- }
- if ( ! this.connectionProfile.supportsWorkOfflineMode()) {
- return;
- }
-
- this.prepareForOfflineWork();
-
- IStatus status = this.connectionProfile.workOffline();
- assertTrue(status.isOK());
- assertTrue(this.connectionProfile.isActive());
- assertTrue(this.connectionProfile.isWorkingOffline());
-
- this.connectionProfile.disconnect();
- assertTrue(this.connectionProfile.isInactive());
- assertTrue(this.connectionProfile.isDisconnected());
- }
-
- protected void prepareForOfflineWork() {
- if ( ! this.connectionProfile.canWorkOffline()) {
- this.connectionProfile.connect();
- IStatus status = this.connectionProfile.saveWorkOfflineData();
- assertTrue(status.isOK());
- this.connectionProfile.disconnect();
- assertTrue(this.connectionProfile.canWorkOffline());
- }
- }
-
- public void testConnectionListenerConnect() {
- assertTrue(this.connectionProfileHasNoListeners());
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
- assertTrue(this.connectionProfileHasAnyListeners());
-
- this.connectionProfile.connect();
- assertSame(this.connectionProfile, listener.openedProfile);
- listener.clear();
-
- this.connectionProfile.disconnect();
- assertSame(this.connectionProfile, listener.okToCloseProfile);
- assertSame(this.connectionProfile, listener.aboutToCloseProfile);
- assertSame(this.connectionProfile, listener.closedProfile);
-
- this.connectionProfile.removeConnectionListener(listener);
- assertTrue(this.connectionProfileHasNoListeners());
- }
-
- public final void testConnectionListenerOffline() {
- if ( ! this.executeOfflineTests()) {
- return;
- }
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.prepareForOfflineWork();
- listener.clear();
-
- this.connectionProfile.workOffline();
- assertSame(this.connectionProfile, listener.openedProfile);
- listener.clear();
-
- this.connectionProfile.disconnect();
- assertSame(this.connectionProfile, listener.okToCloseProfile);
- assertSame(this.connectionProfile, listener.aboutToCloseProfile);
- assertSame(this.connectionProfile, listener.closedProfile);
- listener.clear();
-
- this.connectionProfile.removeConnectionListener(listener);
- }
-
- public void testConnectionListenerDatabase() {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.connectionProfile.getDatabase(), listener.changedDatabase);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testConnectionListenerCatalog() {
- this.connectionProfile.connect();
- if ( ! this.connectionProfile.getDatabase().supportsCatalogs()) {
- this.connectionProfile.disconnect();
- return;
- }
-
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // take the first catalog
- org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog = this.getFirstDTPCatalog();
- Catalog catalog = this.getCatalogNamed(dtpCatalog.getName());
- ((ICatalogObject) dtpCatalog).refresh();
- assertSame(catalog, listener.changedCatalog);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testConnectionListenerSchema() {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- List<org.eclipse.datatools.modelbase.sql.schema.Catalog> dtpCatalogs = this.getDTPCatalogs();
- org.eclipse.datatools.modelbase.sql.schema.Catalog dtpCatalog = null;
- org.eclipse.datatools.modelbase.sql.schema.Schema dtpSchema = null;
- Schema schema = null;
- if (this.connectionProfile.getDatabase().supportsCatalogs()) {
- dtpCatalog = dtpCatalogs.get(0);
- dtpSchema = (org.eclipse.datatools.modelbase.sql.schema.Schema) dtpCatalog.getSchemas().get(0);
- schema = this.getCatalogNamed(dtpCatalog.getName()).getSchemaNamed(dtpSchema.getName());
- } else {
- if (dtpCatalogs.isEmpty()) {
- dtpSchema = (org.eclipse.datatools.modelbase.sql.schema.Schema) this.getDTPDatabase().getSchemas().get(0);
- schema = this.connectionProfile.getDatabase().getSchemaNamed(dtpSchema.getName());
- } else {
- dtpCatalog = dtpCatalogs.get(0); // should be the "virtual" catalog
- assertEquals("", dtpCatalog.getName());
- dtpSchema = (org.eclipse.datatools.modelbase.sql.schema.Schema) dtpCatalog.getSchemas().get(0);
- // the schemata are held directly by the database in this situation
- schema = this.getDatabase().getSchemaNamed(dtpSchema.getName());
- }
- }
- assertTrue(schema.getTablesSize() >= 0); // force tables to be loaded
- ((ICatalogObject) dtpSchema).refresh();
- assertSame(schema, listener.changedSchema);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSupportsCatalogs() {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- boolean supportsCatalogs = this.supportsCatalogs();
- assertEquals(supportsCatalogs, this.connectionProfile.getDatabase().supportsCatalogs());
- if (supportsCatalogs) {
- assertTrue(this.connectionProfile.getDatabase().getCatalogsSize() > 0);
- assertEquals(0, this.connectionProfile.getDatabase().getSchemataSize());
- } else {
- assertEquals(0, this.connectionProfile.getDatabase().getCatalogsSize());
- assertTrue(this.connectionProfile.getDatabase().getSchemataSize() > 0);
- }
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- protected abstract boolean supportsCatalogs();
-
-// public void testDEBUG() throws Exception {
-// this.connectionProfile.connect();
-// this.dumpJDBCCatalogs();
-// this.dumpJDBCSchemata();
-// this.dumpDatabaseContainers();
-// this.connectionProfile.disconnect();
-// }
-
-
- // ********** convenience methods **********
-
- protected ConnectionProfileFactory getConnectionProfileFactory() {
- return JptJpaDbPlugin.getConnectionProfileFactory();
- }
-
- protected ConnectionProfile getConnectionProfile() {
- return this.connectionProfile;
- }
-
- protected Database getDatabase() {
- return this.connectionProfile.getDatabase();
- }
-
- protected Catalog getDefaultCatalog() {
- return this.getDatabase().getDefaultCatalog();
- }
-
- /**
- * only valid on databases that do not support catalogs
- */
- protected Schema getDefaultSchema() {
- return this.getDatabase().getDefaultSchema();
- }
-
- protected Catalog getCatalogNamed(String catalogName) {
- return this.connectionProfile.getDatabase().getCatalogNamed(catalogName);
- }
-
- protected String getRequiredPlatformProperty(String propertyKey) {
- String propertyValue = this.platformProperties.getProperty(propertyKey);
- if (StringTools.stringIsEmpty(propertyValue)) {
- throw new IllegalArgumentException("The database platform properties file '" + this.getPlatformPropertiesFilePath()
- + "' is missing a value for the property '" + propertyKey + "'.");
- }
- return propertyValue;
- }
-
- protected boolean connectionProfileHasAnyListeners() {
- return connectionProfileHasAnyListeners(this.connectionProfile);
- }
-
- protected static boolean connectionProfileHasAnyListeners(ConnectionProfile cp) {
- return ((Boolean) ReflectionTools.executeMethod(cp, "hasAnyListeners")).booleanValue();
- }
-
- protected boolean connectionProfileHasNoListeners() {
- return connectionProfileHasNoListeners(this.connectionProfile);
- }
-
- protected static boolean connectionProfileHasNoListeners(ConnectionProfile cp) {
- return ((Boolean) ReflectionTools.executeMethod(cp, "hasNoListeners")).booleanValue();
- }
-
-
- // ********** DTP model **********
-
- protected ProfileManager getDTPProfileManager() {
- return ProfileManager.getInstance();
- }
-
- protected IConnectionProfile getDTPConnectionProfile() {
- return getDTPConnectionProfile(this.connectionProfile);
- }
-
- protected static IConnectionProfile getDTPConnectionProfile(ConnectionProfile cp) {
- return (IConnectionProfile) ReflectionTools.getFieldValue(cp, "dtpConnectionProfile");
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase() {
- return getDTPDatabase(this.connectionProfile.getDatabase());
- }
-
- protected static org.eclipse.datatools.modelbase.sql.schema.Database getDTPDatabase(Database database) {
- return (org.eclipse.datatools.modelbase.sql.schema.Database) ReflectionTools.getFieldValue(database, "dtpDatabase");
- }
-
- @SuppressWarnings("unchecked")
- protected List<org.eclipse.datatools.modelbase.sql.schema.Catalog> getDTPCatalogs() {
- return this.getDTPDatabase().getCatalogs();
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Catalog getFirstDTPCatalog() {
- return this.getDTPCatalogs().get(0);
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Catalog getDTPCatalogNamed(String name) {
- return getDTPCatalog(this.getDatabase().getCatalogNamed(name));
- }
-
- protected static org.eclipse.datatools.modelbase.sql.schema.Catalog getDTPCatalog(Catalog catalog) {
- return (org.eclipse.datatools.modelbase.sql.schema.Catalog) ReflectionTools.getFieldValue(catalog, "dtpCatalog");
- }
-
- protected org.eclipse.datatools.modelbase.sql.schema.Schema getDTPSchemaNamed(String name) {
- return getDTPSchema(this.getDatabase().getSchemaNamed(name));
- }
-
- protected static org.eclipse.datatools.modelbase.sql.schema.Schema getDTPSchema(Schema schema) {
- return (org.eclipse.datatools.modelbase.sql.schema.Schema) ReflectionTools.getFieldValue(schema, "dtpSchema");
- }
-
-
- // ********** execute SQL **********
-
- /**
- * ignore any errors (useful for dropping database objects that might
- * not be there)
- */
- protected void executeUpdateIgnoreErrors(String sql) {
- try {
- this.executeUpdate(sql);
- } catch (Exception ex) {
-// System.err.println("SQL: " + sql);
-// ex.printStackTrace();
- }
- }
-
- protected void executeUpdate(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- try {
- jdbcStatement.executeUpdate(sql);
- } finally {
- jdbcStatement.close();
- }
- }
-
- protected void dump(String sql) throws SQLException {
- this.dump(sql, 30);
- }
-
- protected void dump(String sql, int columnWidth) throws SQLException {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpOn(sql, pw, columnWidth);
- }
- pw.flush();
- }
-
- protected void dumpOn(String sql, IndentingPrintWriter pw, int columnWidth) throws SQLException {
- pw.println(sql);
- for (HashMap<String, Object> row : this.execute(sql)) {
- for (Map.Entry<String, Object> field : row.entrySet()) {
- StringTools.padOrTruncateOn(String.valueOf(field.getKey()), columnWidth/2, pw);
- pw.print('=');
- StringTools.padOrTruncateOn(String.valueOf(field.getValue()), columnWidth/2, pw);
- pw.print(' ');
- }
- pw.println();
- }
- }
-
- protected ArrayList<HashMap<String, Object>> execute(String sql) throws SQLException {
- Statement jdbcStatement = this.createJDBCStatement();
- jdbcStatement.execute(sql);
- ArrayList<HashMap<String, Object>> rows = this.buildRows(jdbcStatement.getResultSet());
- jdbcStatement.close();
- return rows;
- }
-
- protected ArrayList<HashMap<String, Object>> buildRows(ResultSet resultSet) throws SQLException {
- ArrayList<HashMap<String, Object>> rows = new ArrayList<HashMap<String, Object>>();
- CollectionTools.addAll(rows, this.buildResultSetIterator(resultSet));
- return rows;
- }
-
- protected Iterator<HashMap<String, Object>> buildResultSetIterator(ResultSet resultSet) throws SQLException {
- return new ResultSetIterator<HashMap<String, Object>>(resultSet, new MapResultSetIteratorAdapter(resultSet.getMetaData()));
- }
-
- public static class MapResultSetIteratorAdapter
- implements ResultSetIterator.Adapter<HashMap<String, Object>>
- {
- private final int columnCount;
- private final String[] columnNames;
- public MapResultSetIteratorAdapter(ResultSetMetaData rsMetaData) throws SQLException {
- super();
- this.columnCount = rsMetaData.getColumnCount();
- this.columnNames = new String[this.columnCount + 1]; // leave zero slot empty
- for (int i = 1; i <= this.columnCount; i++) { // NB: ResultSet index/subscript is 1-based
- this.columnNames[i] = rsMetaData.getColumnName(i);
- }
- }
- public HashMap<String, Object> buildNext(ResultSet rs) throws SQLException {
- HashMap<String, Object> row = new HashMap<String, Object>(this.columnCount);
- for (int i = 1; i <= this.columnCount; i++) { // NB: ResultSet index/subscript is 1-based
- row.put(this.columnNames[i], rs.getObject(i));
- }
- return row;
- }
- }
-
- protected Statement createJDBCStatement() throws SQLException {
- return this.getJDBCConnection().createStatement();
- }
-
- protected Connection getJDBCConnection() {
- return this.connectionProfile.getJDBCConnection();
- }
-
- protected DatabaseMetaData getDatabaseMetaData() throws SQLException {
- return this.getJDBCConnection().getMetaData();
- }
-
-
- // ********** dump DTP metadata **********
-
- /**
- * dump all the database metadata to the console
- */
- protected void dumpDatabase() {
- this.dumpDatabase(true);
- }
-
- /**
- * dump the database catalogs and schemata to the console
- */
- protected void dumpDatabaseContainers() {
- this.dumpDatabase(false);
- }
-
- protected void dumpDatabase(boolean deep) {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpDatabaseOn(pw, deep);
- }
- pw.flush();
- }
-
- protected void dumpDatabaseOn(IndentingPrintWriter pw, boolean deep) {
- Database database = this.connectionProfile.getDatabase();
- pw.print("database: ");
- pw.println(database.getName());
- if (database.supportsCatalogs()) {
- for (Catalog catalog : database.getCatalogs()) {
- this.dumpCatalogOn(catalog, pw, deep);
- }
- } else {
- this.dumpSchemaContainerOn(database, pw, deep);
- }
- }
-
- protected void dumpCatalogOn(Catalog catalog, IndentingPrintWriter pw, boolean deep) {
- pw.print("catalog: ");
- pw.println(catalog.getName());
- pw.indent();
- this.dumpSchemaContainerOn(catalog, pw, deep);
- pw.undent();
- }
-
- protected void dumpSchemaContainerOn(SchemaContainer schemaContainer, IndentingPrintWriter pw, boolean deep) {
- for (Schema schema : schemaContainer.getSchemata()) {
- this.dumpSchemaOn(schema, pw, deep);
- }
- }
-
- protected void dumpSchema(Schema schema) {
- this.dumpSchema(schema, true);
- }
-
- protected void dumpSchema(Schema schema, boolean deep) {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpSchemaOn(schema, pw, deep);
- }
- pw.flush();
- }
-
- protected void dumpSchemaOn(Schema schema, IndentingPrintWriter pw, boolean deep) {
- pw.print("schema: ");
- pw.println(schema.getName());
- if (deep) {
- pw.indent();
- for (Table table : schema.getTables()) {
- this.dumpTableOn(table, pw);
- }
- for (Sequence sequence : schema.getSequences()) {
- this.dumpSequenceOn(sequence, pw);
- }
- pw.undent();
- }
- }
-
- protected void dumpTableOn(Table table, IndentingPrintWriter pw) {
- pw.print("table: ");
- pw.println(table.getName());
- pw.indent();
- for (Column column : table.getColumns()) {
- this.dumpColumnOn(column, pw);
- }
- for (ForeignKey foreignKey : table.getForeignKeys()) {
- this.dumpForeignKeyOn(foreignKey, pw);
- }
- pw.undent();
- }
-
- protected void dumpColumnOn(Column column, IndentingPrintWriter pw) {
- pw.print("column: ");
- pw.print(column.getName());
- pw.print(" : ");
- pw.print(column.getDataTypeName());
- if (column.isPartOfPrimaryKey()) {
- pw.print(" [primary key]");
- }
- pw.println();
- }
-
- protected void dumpForeignKeyOn(ForeignKey foreignKey, IndentingPrintWriter pw) {
- pw.print("foreign key: ");
- pw.print(foreignKey.getName());
- pw.print("=>");
- pw.print(foreignKey.getReferencedTable().getName());
- pw.print(" (");
- for (Iterator<ForeignKey.ColumnPair> stream = foreignKey.getColumnPairs().iterator(); stream.hasNext(); ) {
- ForeignKey.ColumnPair cp = stream.next();
- pw.print(cp.getBaseColumn().getName());
- pw.print("=>");
- pw.print(cp.getReferencedColumn().getName());
- if (stream.hasNext()) {
- pw.print(", ");
- }
- }
- pw.print(')');
- pw.println();
- }
-
- protected void dumpSequenceOn(Sequence sequence, IndentingPrintWriter pw) {
- pw.print("sequence: ");
- pw.println(sequence.getName());
- }
-
-
- // ********** dump JDBC metadata **********
-
- protected void dumpJDBCCatalogs() throws SQLException {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpJDBCCatalogsOn(pw);
- }
- pw.flush();
- }
-
- protected void dumpJDBCCatalogsOn(IndentingPrintWriter pw) throws SQLException {
- pw.println("JDBC catalogs: ");
- pw.indent();
- ArrayList<HashMap<String, Object>> rows = this.buildRows(this.getDatabaseMetaData().getCatalogs());
- for (Iterator<HashMap<String, Object>> stream = rows.iterator(); stream.hasNext(); ) {
- HashMap<String, Object> row = stream.next();
- pw.println(row.get("TABLE_CAT"));
- }
- pw.undent();
- }
-
- protected void dumpJDBCSchemata() throws SQLException {
- IndentingPrintWriter pw = new IndentingPrintWriter(new OutputStreamWriter(System.out));
- // synchronize the console so everything is contiguous
- synchronized (System.out) {
- this.dumpJDBCSchemataOn(pw);
- }
- pw.flush();
- }
-
- protected void dumpJDBCSchemataOn(IndentingPrintWriter pw) throws SQLException {
- pw.println("JDBC schemata: ");
- pw.indent();
- ArrayList<HashMap<String, Object>> rows = this.buildRows(this.getDatabaseMetaData().getSchemas());
- for (HashMap<String, Object> row : rows) {
- if (row.size() == 2) { // catalogs were added in jdk 1.4
- Object catalog = row.get("TABLE_CATALOG");
- pw.print(catalog);
- pw.print('.');
- }
- Object schema = row.get("TABLE_SCHEM");
- pw.println(schema);
- }
- pw.undent();
- }
-
-
- // ********** connection profile listener **********
-
- protected static class TestConnectionProfileListener implements ConnectionProfileListener {
- public String addedName;
- public String removedName;
- public String renamedOldName;
- public String renamedNewName;
-
- public void connectionProfileAdded(String name) {
- this.addedName = name;
- }
- public void connectionProfileRemoved(String name) {
- this.removedName = name;
- }
- public void connectionProfileRenamed(String oldName, String newName) {
- this.renamedOldName = oldName;
- this.renamedNewName = newName;
- }
- public void clear() {
- this.addedName = null;
- this.removedName = null;
- this.renamedOldName = null;
- this.renamedNewName = null;
- }
- }
-
-
- // ********** connection listener **********
-
- protected static class TestConnectionListener implements ConnectionListener {
- public ConnectionProfile openedProfile;
- public ConnectionProfile modifiedProfile;
- public ConnectionProfile okToCloseProfile;
- public ConnectionProfile aboutToCloseProfile;
- public ConnectionProfile closedProfile;
- public Database changedDatabase;
- public Catalog changedCatalog;
- public Schema changedSchema;
- public Sequence changedSequence;
- public Table changedTable;
- public Column changedColumn;
- public ForeignKey changedForeignKey;
-
- public void opened(ConnectionProfile profile) {
- this.openedProfile = profile;
- }
- public void modified(ConnectionProfile profile) {
- this.modifiedProfile = profile;
- }
- public boolean okToClose(ConnectionProfile profile) {
- this.okToCloseProfile = profile;
- return true;
- }
- public void aboutToClose(ConnectionProfile profile) {
- this.aboutToCloseProfile = profile;
- }
- public void closed(ConnectionProfile profile) {
- this.closedProfile = profile;
- }
- public void databaseChanged(ConnectionProfile profile, Database database) {
- this.changedDatabase = database;
- }
- public void catalogChanged(ConnectionProfile profile, Catalog catalog) {
- this.changedCatalog = catalog;
- }
- public void schemaChanged(ConnectionProfile profile, Schema schema) {
- this.changedSchema = schema;
- }
- public void sequenceChanged(ConnectionProfile profile, Sequence sequence) {
- this.changedSequence = sequence;
- }
- public void tableChanged(ConnectionProfile profile, Table table) {
- this.changedTable = table;
- }
- public void columnChanged(ConnectionProfile profile, Column column) {
- this.changedColumn = column;
- }
- public void foreignKeyChanged(ConnectionProfile profile, ForeignKey foreignKey) {
- this.changedForeignKey = foreignKey;
- }
- public void clear() {
- this.openedProfile = null;
- this.modifiedProfile = null;
- this.okToCloseProfile = null;
- this.aboutToCloseProfile = null;
- this.closedProfile = null;
- this.changedDatabase = null;
- this.changedCatalog = null;
- this.changedSchema = null;
- this.changedSequence = null;
- this.changedTable = null;
- this.changedColumn = null;
- this.changedForeignKey = null;
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DerbyTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DerbyTests.java
deleted file mode 100644
index 4dd8792c63..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/DerbyTests.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-@SuppressWarnings("nls")
-public class DerbyTests extends DTPPlatformTests {
-
- public DerbyTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- }
-
- @Override
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "derby.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Derby Embedded JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Derby Embedded JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.connectivity.db.derby101.genericDriverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Derby";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "10.1";
- }
-
- @Override
- protected String getDriverClass() {
- return "org.apache.derby.jdbc.EmbeddedDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Derby_10.1_Embedded";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Derby 10.1 Embedded JDBC Profile [Test]";
- }
-
- @Override
- protected String getProviderID() {
- return "org.eclipse.datatools.connectivity.db.derby.embedded.connectionProfile";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- return true;
- }
-
- public void testSchema() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("TEST1");
- this.dropSchema("TEST2");
-
- this.executeUpdate("CREATE SCHEMA TEST1");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema1 = this.getDatabase().getSchemaNamed("TEST1");
- assertNotNull(schema1);
-
- this.executeUpdate("CREATE SCHEMA TEST2");
- Schema schema2 = this.getDatabase().getSchemaNamed("TEST2");
- assertNull(schema2); // should be null until refresh
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.getDatabase(), listener.changedDatabase);
-
- schema2 = this.getDatabase().getSchemaNamed("TEST2");
- assertNotNull(schema2);
- assertNotSame(schema1, this.getDatabase().getSchemaNamed("TEST1")); // we should have a new schema after the refresh
-
- this.dropSchema("TEST2");
- this.dropSchema("TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- this.executeUpdate("CREATE SCHEMA LOOKUP_TEST");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNotNull(this.getDatabase().getSchemaNamed("LOOKUP_TEST"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_test"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("lookup_test"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_TEST"));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("lookup_TEST"));
-
- assertNotNull(this.getDatabase().getSchemaForIdentifier("\"LOOKUP_TEST\""));
- assertNull(this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\""));
-
- this.dropSchema("LOOKUP_TEST");
-
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNull(this.getDatabase().getSchemaNamed("LOOKUP_TEST"));
- assertNull(this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNull(this.getDatabase().getSchemaNamed("lookup_test"));
- assertNull(this.getDatabase().getSchemaForIdentifier("lookup_test"));
-
- assertNotNull(this.getDatabase().getSchemaNamed("lookup_TEST"));
- assertNull(this.getDatabase().getSchemaForIdentifier("lookup_TEST"));
-
- assertNull(this.getDatabase().getSchemaForIdentifier("\"LOOKUP_TEST\""));
- assertNotNull(this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\""));
-
- this.dropSchema("\"lookup_TEST\"");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaIdentifier() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
-
- this.executeUpdate("CREATE SCHEMA lookup_test"); // this gets folded to uppercase
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getSchemaForIdentifier("LOOKUP_TEST");
- assertEquals("LOOKUP_TEST", schema.getIdentifier());
- assertEquals("LOOKUP_TEST", schema.getIdentifier("LookupTest"));
- assertNull(schema.getIdentifier("Lookup_Test"));
-
- schema = this.getDatabase().getSchemaForIdentifier("lookup_test");
- assertEquals("LOOKUP_TEST", schema.getIdentifier());
-
- schema = this.getDatabase().getSchemaForIdentifier("\"lookup_TEST\"");
- assertEquals("\"lookup_TEST\"", schema.getIdentifier());
- assertEquals("\"lookup_TEST\"", schema.getIdentifier("lookup_TEST"));
-
- this.dropSchema("\"lookup_TEST\"");
- this.dropSchema("LOOKUP_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.executeUpdate("CREATE SCHEMA TABLE_TEST");
- this.executeUpdate("SET SCHEMA = TABLE_TEST");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getSchemaNamed("TABLE_TEST");
-
- // FOO
- Table fooTable = schema.getTableNamed("FOO");
- assertEquals(4, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("ID", pkColumn.getName());
- Column idColumn = fooTable.getColumnNamed("ID");
- assertSame(pkColumn, idColumn);
- assertEquals("INTEGER", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertEquals("int", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnNamed("NAME");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertEquals(20, nameColumn.getLength());
- assertFalse(nameColumn.isPartOfPrimaryKey());
- assertFalse(nameColumn.isNumeric());
- assertTrue(nameColumn.isNullable());
-
- Column barColumn = fooTable.getColumnNamed("BAR_ID");
- assertEquals("INTEGER", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- Column salaryColumn = fooTable.getColumnNamed("SALARY");
- assertEquals("DECIMAL", salaryColumn.getDataTypeName());
- assertTrue(salaryColumn.isNullable());
- assertTrue(salaryColumn.isNumeric());
- assertEquals(11, salaryColumn.getPrecision());
- assertEquals(2, salaryColumn.getScale());
- assertEquals(-1, salaryColumn.getLength());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("BAR", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("BAR_ID", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableNamed("BAR");
- assertEquals(3, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("ID", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
-
- Column id2Column = barTable.getColumnNamed("ID2");
- assertEquals("INTEGER", id2Column.getDataTypeName());
-// assertTrue(id2Column.isPartOfUniqueConstraint()); // doesn't work(?)
- assertFalse(id2Column.isNullable());
- assertTrue(id2Column.isNumeric());
- assertEquals(0, id2Column.getPrecision()); // not sure what to expect here...
- assertEquals(0, id2Column.getScale()); // not sure what to expect here either...
- assertEquals("BLOB", barTable.getColumnNamed("CHUNK").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnNamed("CHUNK").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnNamed("CHUNK").isLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // BAZ
- Table bazTable = schema.getTableNamed("BAZ");
- Column nicknameColumn = bazTable.getColumnNamed("NICKNAME");
- assertEquals(20, nicknameColumn.getLength());
-// assertTrue(nicknameColumn.isPartOfUniqueConstraint()); // doesn't work(?)
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableNamed("FOO_BAZ");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnNamed("FOO_ID").isPartOfForeignKey());
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAR (").append(CR);
- sb.append(" ID INT PRIMARY KEY,").append(CR);
- sb.append(" ID2 INT UNIQUE NOT NULL,").append(CR);
- sb.append(" CHUNK BLOB(100K)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO (").append(CR);
- sb.append(" ID INT PRIMARY KEY,").append(CR);
- sb.append(" NAME VARCHAR(20),").append(CR);
- sb.append(" SALARY DECIMAL(11, 2),").append(CR);
- sb.append(" BAR_ID INT REFERENCES BAR(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAZ (").append(CR);
- sb.append(" ID INT PRIMARY KEY,").append(CR);
- sb.append(" NICKNAME VARCHAR(20) NOT NULL UNIQUE").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO_BAZ (").append(CR);
- sb.append(" FOO_ID INT REFERENCES FOO(ID),").append(CR);
- sb.append(" BAZ_ID INT REFERENCES BAZ(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("COLUMN_TEST", "test");
- this.dropSchema("COLUMN_TEST");
-
- this.executeUpdate("CREATE SCHEMA COLUMN_TEST");
- this.executeUpdate("SET SCHEMA = COLUMN_TEST");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id INTEGER, name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("COLUMN_TEST", "test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID INTEGER, NAME VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.dropTable("COLUMN_TEST", "test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id INTEGER, Name VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.dropTable("COLUMN_TEST", "test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (\"Id\" INTEGER, \"Name\" VARCHAR(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getSchemaNamed("COLUMN_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("COLUMN_TEST", "test");
- this.dropSchema("COLUMN_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testCrossSchemaReference() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("XREF_TEST2", "EMP");
- this.dropSchema("XREF_TEST2");
- this.dropTable("XREF_TEST1", "ORG");
- this.dropSchema("XREF_TEST1");
-
- this.executeUpdate("CREATE SCHEMA XREF_TEST1");
- this.executeUpdate("SET SCHEMA = XREF_TEST1");
- this.executeUpdate("CREATE TABLE ORG (ID INTEGER PRIMARY KEY, NAME VARCHAR(20))");
-
- this.executeUpdate("CREATE SCHEMA XREF_TEST2");
- this.executeUpdate("SET SCHEMA = XREF_TEST2");
- this.executeUpdate("CREATE TABLE EMP (ID INTEGER PRIMARY KEY, NAME VARCHAR(20), " +
- "ORG_ID INTEGER REFERENCES XREF_TEST1.ORG(ID))");
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- Schema schema1 = this.getDatabase().getSchemaNamed("XREF_TEST1");
- assertNotNull(schema1);
- Table orgTable = schema1.getTableNamed("ORG");
- assertNotNull(orgTable);
-
- Schema schema2 = this.getDatabase().getSchemaNamed("XREF_TEST2");
- assertNotNull(schema2);
- Table empTable = schema2.getTableNamed("EMP");
- assertNotNull(empTable);
- assertEquals(1, empTable.getForeignKeysSize());
- ForeignKey fk = empTable.getForeignKeys().iterator().next();
- Table refTable = fk.getReferencedTable();
- assertNotNull(refTable);
- assertEquals("ORG", refTable.getName());
- assertEquals(1, fk.getColumnPairsSize());
- ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next();
- Column baseColumn = cp.getBaseColumn();
- assertEquals("ORG_ID", baseColumn.getName());
- Column refColumn = cp.getReferencedColumn();
- assertEquals("ID", refColumn.getName());
-
- this.dropTable("XREF_TEST2", "EMP");
- this.dropSchema("XREF_TEST2");
- this.dropTable("XREF_TEST1", "ORG");
- this.dropSchema("XREF_TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String schemaName, String tableName) throws Exception {
- Schema schema= this.getDatabase().getSchemaForIdentifier(schemaName);
- if (schema != null) {
- if (schema.getTableForIdentifier(tableName) != null) {
- this.executeUpdate("DROP TABLE " + schemaName + '.' + tableName);
- }
- }
- }
-
- /**
- * NB: A Derby schema must be empty before it can be dropped.
- */
- private void dropSchema(String name) throws Exception {
- if (this.getDatabase().getSchemaForIdentifier(name) != null) {
- this.executeUpdate("DROP SCHEMA " + name + " RESTRICT");
- }
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/MySQLTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/MySQLTests.java
deleted file mode 100644
index e35b7e7fca..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/MySQLTests.java
+++ /dev/null
@@ -1,417 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import org.eclipse.datatools.connectivity.drivers.jdbc.IJDBCDriverDefinitionConstants;
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.common.utility.internal.ArrayTools;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-/**
- * MySQL
- *
- * Notes:<ul>
- * <li>We can only get database objects from the database associated with our
- * connection profile.
- * <li>We can reference objects across multiple databases, so they are sorta like
- * schemas....
- * <li>Foreign keys must be defined as table-level constraints; they cannot be
- * defined as part of the column clause.
- * <li>Case-sensitivity and -folding is whacked on MySQL....
- * </ul>
- */
-@SuppressWarnings("nls")
-public class MySQLTests extends DTPPlatformTests {
-
- public MySQLTests( String name) {
- super(name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "mysql.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "MySQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.MySQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.mysql.4_1.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "MySql";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "4.1";
- }
-
- @Override
- protected String getDriverClass() {
- return "com.mysql.jdbc.Driver";
- }
-
- @Override
- protected String getDefaultJDBCURL() {
- return "jdbc:mysql://localhost:3306";
- }
-
- @Override
- protected String getProfileName() {
- return "MySQL_4.1";
- }
-
- @Override
- protected String getProfileDescription() {
- return "MySQL 4.1 JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected Properties buildDTPConnectionProfileProperties() {
- Properties p = super.buildDTPConnectionProfileProperties();
- p.setProperty(IJDBCDriverDefinitionConstants.DATABASE_NAME_PROP_ID, this.getDatabaseName());
- return p;
- }
-
- private String getDatabaseName() {
- return this.getUserID(); // by convention...
- }
-
- @Override
- protected boolean executeOfflineTests() {
- return true; // seems to work...
- }
-
- public void testDatabase() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // DTP: MySQL has a single schema with the same name as the database
- Schema schema = this.getDatabase().getSchemaNamed(this.getDatabaseName());
- assertNotNull(schema);
- assertSame(this.getDefaultSchema(), schema);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog(this.getDatabaseName());
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- Schema schema = this.getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableNamed("foo");
- assertEquals(3, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- // if the tables are created with MyISAM as the backing store
- // there will be no foreign keys
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("id", pkColumn.getName());
- Column idColumn = fooTable.getColumnNamed("id");
- assertSame(pkColumn, idColumn);
- assertEquals("INT", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertEquals("int", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnNamed("name");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPartOfPrimaryKey());
-
- Column barColumn = fooTable.getColumnNamed("bar_id");
- assertEquals("INT", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("bar", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableNamed("bar");
- assertEquals(2, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("id", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BLOB", barTable.getColumnNamed("chunk").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnNamed("chunk").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnNamed("chunk").isLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableNamed("foo_baz");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnNamed("foo_id").isPartOfForeignKey());
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator");
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE bar (").append(CR);
- sb.append(" id INTEGER PRIMARY KEY,").append(CR);
- sb.append(" chunk BLOB").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo (").append(CR);
- sb.append(" id INTEGER PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR(20),").append(CR);
- sb.append(" bar_id INTEGER,").append(CR);
- sb.append(" CONSTRAINT BAR FOREIGN KEY (bar_id) REFERENCES bar(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE baz (").append(CR);
- sb.append(" id INTEGER PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo_baz (").append(CR);
- sb.append(" foo_id INT,").append(CR);
- sb.append(" baz_id INT,").append(CR);
- sb.append(" FOREIGN KEY (foo_id) REFERENCES foo(id),").append(CR);
- sb.append(" FOREIGN KEY (baz_id) REFERENCES baz(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- /**
- * On Windows, table names get folded to lowercase by default;
- * even if the name is delimited (apparently).
- */
- public void testTableLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog(this.getDatabaseName());
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("`TEST3`");
-
- this.executeUpdate("CREATE TABLE test1 (id INTEGER, name VARCHAR(20))");
- this.executeUpdate("CREATE TABLE TEST2 (id INTEGER, name VARCHAR(20))");
- this.executeUpdate("CREATE TABLE `TEST3` (id INTEGER, name VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- Schema schema = this.getDefaultSchema();
-
- Table test1Table = schema.getTableForIdentifier("test1");
- assertNotNull(test1Table);
-
- // if 'lctn' is 0 (UNIX), the table name is case-sensitive
- int lctn = this.getLowerCaseTableNamesFromDatabase();
-
- String test2Identifier = (lctn == 0) ? "TEST2" : "test2";
- Table test2Table = schema.getTableForIdentifier(test2Identifier);
- assertNotNull(test2Table);
-
- String test3Identifier = (lctn == 0) ? "`TEST3`" : "`test3`";
- Table test3Table = schema.getTableForIdentifier(test3Identifier);
- assertNotNull(test3Table);
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("`TEST3`");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- protected int getLowerCaseTableNamesFromDatabase() throws SQLException {
- // the underscore is a wild character on MySQL, so we need to escape it
- ArrayList<HashMap<String, Object>> rows = this.execute("show variables like 'lower\\_case\\_table\\_names'");
- Map<String, Object> row = rows.get(0);
- return Integer.valueOf((String) row.get("Value")).intValue();
- }
-
- /**
- * MySQL preserves the case of column names, delimited or not;
- * but they are <em>not</em> case-sensitive when used in SQL.
- * Delimiters are useful for reserved identifiers and special characters.
- */
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog(this.getDatabaseName());
-
- this.dropTable("test");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id INTEGER, name VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- Table table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("id"));
- assertNotNull(table.getColumnNamed("name"));
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID INTEGER, NAME VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("ID"));
- assertNotNull(table.getColumnNamed("NAME"));
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id INTEGER, Name VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("Id"));
- assertNotNull(table.getColumnNamed("Name"));
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (`Id` INTEGER, `Name` VARCHAR(20))");
- // the MySQL database does NOT refresh - see bug 279721...
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- // ...refresh the single schema instead
- ((ICatalogObject) getDTPSchema(this.getDefaultSchema())).refresh();
-
- table = this.getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("Id"));
- assertNotNull(table.getColumnNamed("Name"));
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- boolean quotes = this.getANSIQuotesFromDatabase();
- assertNotNull(table.getColumnForIdentifier("`Id`"));
- if (quotes) {
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- }
-
- assertNotNull(table.getColumnForIdentifier("`Name`"));
- if (quotes) {
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
- }
-
- this.dropTable("test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- protected boolean getANSIQuotesFromDatabase() throws SQLException {
- ArrayList<HashMap<String, Object>> rows = this.execute("SELECT @@SESSION.sql_mode");
- Map<String, Object> row = rows.get(0);
- String sql_mode = (String) row.get("@@SESSION.sql_mode");
- String[] modes = sql_mode.split(",");
- return Boolean.valueOf(ArrayTools.contains(modes, "ANSI_QUOTES")).booleanValue();
- }
-
- private void dropTable(String tableName) throws Exception {
- this.executeUpdate("DROP TABLE IF EXISTS " + tableName);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gTests.java
deleted file mode 100644
index c4711e8830..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gTests.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import java.sql.SQLException;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-@SuppressWarnings("nls")
-public class Oracle10gTests extends DTPPlatformTests {
-
- public Oracle10gTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "oracle10g.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Oracle 10g Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.10.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "10";
- }
-
- @Override
- protected String getDriverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Oracle10g_10.1.0.4";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Oracle10g (10.1.0.4) JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // working offline is pretty ugly
- return false;
- }
-
- public void testDatabase() throws Exception {
- if (this.connectionProfile.getUserName().toUpperCase().equals("SYS")) {
- System.out.println("skipped test: " + this.getClass() + '.' + this.getName());
- return; // SYS does not have a schema
- }
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- // Oracle should have a schema with the same name as the user
- Schema schema = this.getDatabase().getSchemaForIdentifier(this.getUserID());
- assertNotNull(schema);
- assertSame(this.getDefaultSchema(), schema);
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableForIdentifier("foo");
- assertEquals(3, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("ID", pkColumn.getName());
- Column idColumn = fooTable.getColumnForIdentifier("id");
- assertSame(pkColumn, idColumn);
- assertEquals("NUMBER", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertEquals("java.math.BigDecimal", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnForIdentifier("name");
- assertEquals("VARCHAR2", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPartOfPrimaryKey());
-
- Column barColumn = fooTable.getColumnForIdentifier("bar_id");
- assertEquals("NUMBER", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("BAR", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("BAR_ID", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableForIdentifier("bar");
- assertEquals(2, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("ID", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BLOB", barTable.getColumnForIdentifier("chunk").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnForIdentifier("chunk").getJavaTypeDeclaration());
- assertTrue(barTable.getColumnForIdentifier("chunk").isLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableForIdentifier("foo_baz");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnForIdentifier("foo_id").isPartOfForeignKey());
-
- this.dropTable("foo_baz");
- this.dropTable("baz");
- this.dropTable("foo");
- this.dropTable("bar");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE bar (").append(CR);
- sb.append(" id NUMBER(10) PRIMARY KEY,").append(CR);
- sb.append(" chunk BLOB").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo (").append(CR);
- sb.append(" id NUMBER(10) PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR2(20),").append(CR);
- sb.append(" bar_id REFERENCES bar(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE baz (").append(CR);
- sb.append(" id NUMBER(10) PRIMARY KEY,").append(CR);
- sb.append(" name VARCHAR2(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE foo_baz (").append(CR);
- sb.append(" foo_id NUMBER(10) REFERENCES foo(id),").append(CR);
- sb.append(" baz_id NUMBER(10) REFERENCES baz(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testTableLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("\"test3\"");
-
- this.executeUpdate("CREATE TABLE test1 (id NUMBER(10), name VARCHAR2(20))");
- this.executeUpdate("CREATE TABLE TEST2 (id NUMBER(10), name VARCHAR2(20))");
- this.executeUpdate("CREATE TABLE \"test3\" (id NUMBER(10), name VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDefaultSchema();
-
- Table test1Table = schema.getTableForIdentifier("test1");
- assertNotNull(test1Table);
- test1Table = schema.getTableForIdentifier("TEST1");
- assertNotNull(test1Table);
-
- Table test2Table = schema.getTableForIdentifier("test2");
- assertNotNull(test2Table);
- test2Table = schema.getTableForIdentifier("TEST2");
- assertNotNull(test2Table);
-
- Table test3Table = schema.getTableForIdentifier("\"test3\"");
- assertNotNull(test3Table);
- test3Table = schema.getTableForIdentifier("test3");
- assertNull(test3Table);
-
- this.dropTable("test1");
- this.dropTable("TEST2");
- this.dropTable("\"test3\"");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("test");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id NUMBER(10), name VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID NUMBER(10), NAME VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.dropTable("test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id NUMBER(10), Name VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.dropTable("test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (\"Id\" NUMBER(10), \"Name\" VARCHAR2(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultSchema().getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testCrossSchemaReference() throws Exception {
- if ( ! this.connectionProfile.getUserName().toUpperCase().equals("SYS")) {
- System.out.println("skipped test: " + this.getClass() + '.' + this.getName());
- return; // SYS does not have a schema
- }
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.executeUpdateIgnoreErrors("DROP USER XREF_TEST2 CASCADE");
- this.executeUpdateIgnoreErrors("DROP USER XREF_TEST1 CASCADE");
-
- this.executeUpdate("CREATE USER XREF_TEST1 IDENTIFIED BY foo");
- this.executeUpdate("ALTER USER XREF_TEST1 QUOTA UNLIMITED ON USERS");
- this.executeUpdate("CREATE TABLE XREF_TEST1.ORG (ID NUMBER(10) PRIMARY KEY, NAME VARCHAR2(20))");
-
- this.executeUpdate("CREATE USER XREF_TEST2 IDENTIFIED BY foo");
- this.executeUpdate("ALTER USER XREF_TEST2 QUOTA UNLIMITED ON USERS");
- this.executeUpdate("GRANT ALL ON XREF_TEST1.ORG TO XREF_TEST2");
- this.executeUpdate("CREATE TABLE XREF_TEST2.EMP (ID NUMBER(10) PRIMARY KEY, NAME VARCHAR2(20), " +
- "ORG_ID NUMBER(10) REFERENCES XREF_TEST1.ORG(ID))");
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- Schema schema1 = this.getDatabase().getSchemaNamed("XREF_TEST1");
- assertNotNull(schema1);
- Table orgTable = schema1.getTableNamed("ORG");
- assertNotNull(orgTable);
-
- Schema schema2 = this.getDatabase().getSchemaNamed("XREF_TEST2");
- assertNotNull(schema2);
- Table empTable = schema2.getTableNamed("EMP");
- assertNotNull(empTable);
- assertEquals(1, empTable.getForeignKeysSize());
- ForeignKey fk = empTable.getForeignKeys().iterator().next();
- Table refTable = fk.getReferencedTable();
- assertNotNull(refTable);
- assertEquals("ORG", refTable.getName());
- assertEquals(1, fk.getColumnPairsSize());
- ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next();
- Column baseColumn = cp.getBaseColumn();
- assertEquals("ORG_ID", baseColumn.getName());
- Column refColumn = cp.getReferencedColumn();
- assertEquals("ID", refColumn.getName());
-
- this.executeUpdate("DROP USER XREF_TEST2 CASCADE");
- this.executeUpdate("DROP USER XREF_TEST1 CASCADE");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String tableName) throws Exception {
- this.executeUpdateIgnoreErrors("DROP TABLE " + tableName + " CASCADE CONSTRAINTS");
- }
-
-// need Oracle enablement plug-in
-// public void testSequence() throws Exception {
-// this.connectionProfile.connect();
-// TestConnectionListener listener = new TestConnectionListener();
-// this.connectionProfile.addConnectionListener(listener);
-//
-// this.dropSequence("FOO_SEQ");
-//
-// this.executeUpdate("CREATE SEQUENCE FOO_SEQ");
-// ((ICatalogObject) this.getDTPDatabase()).refresh();
-//
-// Sequence sequence = this.getDatabase().getDefaultSchema().getSequenceForIdentifier("FOO");
-// assertNotNull(sequence);
-// assertEquals("FOO_SEQ", sequence.getName());
-//
-// this.dropSequence("FOO_SEQ");
-//
-// this.connectionProfile.removeConnectionListener(listener);
-// this.connectionProfile.disconnect();
-// }
-//
-// private void dropSequence(String sequenceName) throws Exception {
-// this.executeUpdateIgnoreErrors("DROP SEQUENCE " + sequenceName);
-// }
-//
- protected void dumpUserObjects() throws SQLException {
- this.dump("select * from user_objects");
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gXETests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gXETests.java
deleted file mode 100644
index d966a9a14b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle10gXETests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-
-/**
- * Oracle 10g Thin Driver Test
- */
-@SuppressWarnings("nls")
-public class Oracle10gXETests extends DTPPlatformTests {
-
- public Oracle10gXETests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "oracle10gXE.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Oracle 10g Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.10.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "10";
- }
-
- @Override
- protected String getDriverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Oracle10g_XE";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Oracle10g XE Release 2 (10.2) JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // working offline is pretty ugly
- return false;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle9iTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle9iTests.java
deleted file mode 100644
index 102e91970d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/Oracle9iTests.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-
-/**
- * Oracle 9i Thin Driver Test
- */
-@SuppressWarnings("nls")
-public class Oracle9iTests extends DTPPlatformTests {
-
- public Oracle9iTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "oracle9i.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Oracle 9i Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Oracle Thin Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.oracle.9.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Oracle";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "9";
- }
-
- @Override
- protected String getDriverClass() {
- return "oracle.jdbc.OracleDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Oracle9i";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Oracle9i JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return false;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // working offline is pretty ugly
- return false;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/PostgreSQLTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/PostgreSQLTests.java
deleted file mode 100644
index 6e501a7942..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/PostgreSQLTests.java
+++ /dev/null
@@ -1,486 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-@SuppressWarnings("nls")
-public class PostgreSQLTests extends DTPPlatformTests {
-
- public PostgreSQLTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "postgresql.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "PostgreSQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.PostgreSQL JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.postgresql.postgresqlDriverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "postgres";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "8.x";
- }
-
- @Override
- protected String getDriverClass() {
- return "org.postgresql.Driver";
- }
-
- @Override
- protected String getDefaultJDBCURL() {
- // using this URL will result in the DTP database containing a single
- // catalog named "" - which, unfortunately, resembles the pseudo-catalog
- // generated by DTP for databases that do not return any catalogs via
- // JDBC metadata calls...
- return "jdbc:postgresql";
- }
-
- @Override
- protected String getProfileName() {
- return "PostgreSQL";
- }
-
- @Override
- protected String getProfileDescription() {
- return "PostgreSQL 8.2 JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // DTP does not support PostgreSQL off-line - see 226704/241558
- return false;
- }
-
- public void testSchema() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("TEST1");
- this.dropSchema("TEST2");
-
- this.executeUpdate("CREATE SCHEMA TEST1");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema1 = this.getDefaultCatalog().getSchemaForIdentifier("TEST1");
- assertNotNull(schema1);
-
- this.executeUpdate("CREATE SCHEMA TEST2");
- Schema schema2 = this.getDefaultCatalog().getSchemaForIdentifier("TEST2");
- assertNull(schema2); // should be null until refresh
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.getDatabase(), listener.changedDatabase);
-
- schema2 = this.getDefaultCatalog().getSchemaForIdentifier("TEST2");
- assertNotNull(schema2);
- assertNotSame(schema1, this.getDefaultCatalog().getSchemaForIdentifier("TEST1")); // we should have a new schema after the refresh
-
- this.dropSchema("TEST2");
- this.dropSchema("TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
-
- this.executeUpdate("CREATE SCHEMA LOOKUP_TEST");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNull(this.getDefaultCatalog().getSchemaNamed("LOOKUP_TEST"));
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNotNull(this.getDefaultCatalog().getSchemaNamed("lookup_test"));
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("lookup_test"));
-
- assertNull(this.getDefaultCatalog().getSchemaNamed("lookup_TEST"));
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("lookup_TEST"));
-
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("\"lookup_test\""));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("\"lookup_TEST\""));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("\"LOOKUP_TEST\""));
-
- this.dropSchema("LOOKUP_TEST");
-
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- assertNull(this.getDefaultCatalog().getSchemaNamed("LOOKUP_TEST"));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("LOOKUP_TEST"));
-
- assertNull(this.getDefaultCatalog().getSchemaNamed("lookup_test"));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("lookup_test"));
-
- assertNotNull(this.getDefaultCatalog().getSchemaNamed("lookup_TEST"));
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("lookup_TEST"));
-
- assertNull(this.getDefaultCatalog().getSchemaForIdentifier("\"LOOKUP_TEST\""));
- assertNotNull(this.getDefaultCatalog().getSchemaForIdentifier("\"lookup_TEST\""));
-
- this.dropSchema("\"lookup_TEST\"");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testSchemaIdentifier() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropSchema("LOOKUP_TEST");
- this.dropSchema("\"lookup_TEST\"");
-
- this.executeUpdate("CREATE SCHEMA lookup_test"); // this gets folded to lowercase
- this.executeUpdate("CREATE SCHEMA \"lookup_TEST\"");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDefaultCatalog().getSchemaForIdentifier("LOOKUP_TEST");
- assertEquals("lookup_test", schema.getIdentifier());
- assertEquals("lookup_test", schema.getIdentifier("LookupTest"));
- assertNull(schema.getIdentifier("Lookup_Test"));
-
- schema = this.getDefaultCatalog().getSchemaNamed("lookup_test");
- assertEquals("lookup_test", schema.getIdentifier());
-
- schema = this.getDefaultCatalog().getSchemaForIdentifier("\"lookup_TEST\"");
- assertEquals("\"lookup_TEST\"", schema.getIdentifier());
- assertEquals("\"lookup_TEST\"", schema.getIdentifier("lookup_TEST"));
-
- this.dropSchema("\"lookup_TEST\"");
- this.dropSchema("LOOKUP_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.executeUpdate("CREATE SCHEMA TABLE_TEST");
- this.executeUpdate("SET search_path TO TABLE_TEST");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST");
-
- // FOO
- Table fooTable = schema.getTableForIdentifier("FOO");
- assertEquals(3, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("id", pkColumn.getName());
- Column idColumn = fooTable.getColumnForIdentifier("ID");
- assertSame(pkColumn, idColumn);
- assertEquals("INT4", idColumn.getDataTypeName());
- assertSame(fooTable, idColumn.getTable());
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertEquals("java.lang.Integer", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnForIdentifier("NAME");
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
- assertFalse(nameColumn.isPartOfPrimaryKey());
-
- Column barColumn = fooTable.getColumnForIdentifier("BAR_ID");
- assertEquals("INT4", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("bar", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableForIdentifier("BAR");
- assertEquals(2, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("id", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- assertEquals("BYTEA", barTable.getColumnForIdentifier("CHUNK").getDataTypeName());
- assertEquals("byte[]", barTable.getColumnForIdentifier("CHUNK").getJavaTypeDeclaration());
- // assertTrue(barTable.getColumnForIdentifier("CHUNK").dataTypeIsLOB());
- assertSame(barTable, barFK.getReferencedTable());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableForIdentifier("FOO_BAZ");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnForIdentifier("FOO_ID").isPartOfForeignKey());
-
- this.dropTable("TABLE_TEST", "FOO_BAZ");
- this.dropTable("TABLE_TEST", "BAZ");
- this.dropTable("TABLE_TEST", "FOO");
- this.dropTable("TABLE_TEST", "BAR");
- this.dropSchema("TABLE_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAR (").append(CR);
- sb.append(" ID integer PRIMARY KEY,").append(CR);
- sb.append(" CHUNK bytea").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO (").append(CR);
- sb.append(" ID integer PRIMARY KEY,").append(CR);
- sb.append(" NAME varchar(20),").append(CR);
- sb.append(" BAR_ID integer REFERENCES BAR(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE BAZ (").append(CR);
- sb.append(" ID integer PRIMARY KEY,").append(CR);
- sb.append(" NAME varchar(20)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("CREATE TABLE FOO_BAZ (").append(CR);
- sb.append(" FOO_ID int REFERENCES FOO(ID),").append(CR);
- sb.append(" BAZ_ID int REFERENCES BAZ(ID)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("TABLE_TEST", "test");
- this.dropSchema("TABLE_TEST");
-
- this.executeUpdate("CREATE SCHEMA TABLE_TEST");
- this.executeUpdate("SET search_path TO TABLE_TEST");
-
- // lowercase
- this.executeUpdate("CREATE TABLE test (id int, name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("id"));
- assertNotNull(table.getColumnForIdentifier("name"));
-
- this.dropTable("TABLE_TEST", "test");
-
- // uppercase
- this.executeUpdate("CREATE TABLE test (ID int, NAME varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.dropTable("TABLE_TEST", "test");
-
- // mixed case
- this.executeUpdate("CREATE TABLE test (Id int, Name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.dropTable("TABLE_TEST", "test");
-
- // delimited
- this.executeUpdate("CREATE TABLE test (\"Id\" int, \"Name\" varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDefaultCatalog().getSchemaForIdentifier("TABLE_TEST").getTableForIdentifier("test");
- assertNotNull(table.getColumnForIdentifier("\"Id\""));
- assertNotNull(table.getColumnForIdentifier("\"Name\""));
-
- this.dropTable("TABLE_TEST", "test");
- this.dropSchema("TABLE_TEST");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testCrossSchemaReference() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.dropTable("XREF_TEST2", "EMP");
- this.dropSchema("XREF_TEST2");
- this.dropTable("XREF_TEST1", "ORG");
- this.dropSchema("XREF_TEST1");
-
- this.executeUpdate("CREATE SCHEMA XREF_TEST1");
- this.executeUpdate("SET search_path TO XREF_TEST1");
- this.executeUpdate("CREATE TABLE ORG (ID integer PRIMARY KEY, NAME varchar(20))");
-
- this.executeUpdate("CREATE SCHEMA XREF_TEST2");
- this.executeUpdate("SET search_path TO XREF_TEST2");
- this.executeUpdate("CREATE TABLE EMP (ID integer PRIMARY KEY, NAME varchar(20), " +
- "ORG_ID integer REFERENCES XREF_TEST1.ORG(ID))");
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- Schema schema1 = this.getDefaultCatalog().getSchemaNamed("xref_test1");
- assertNotNull(schema1);
- Table orgTable = schema1.getTableNamed("org");
- assertNotNull(orgTable);
-
- Schema schema2 = this.getDefaultCatalog().getSchemaNamed("xref_test2");
- assertNotNull(schema2);
- Table empTable = schema2.getTableNamed("emp");
- assertNotNull(empTable);
- assertEquals(1, empTable.getForeignKeysSize());
- ForeignKey fk = empTable.getForeignKeys().iterator().next();
- Table refTable = fk.getReferencedTable();
- assertNotNull(refTable);
- assertEquals("org", refTable.getName());
- assertEquals(1, fk.getColumnPairsSize());
- ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next();
- Column baseColumn = cp.getBaseColumn();
- assertEquals("org_id", baseColumn.getName());
- Column refColumn = cp.getReferencedColumn();
- assertEquals("id", refColumn.getName());
-
- this.dropTable("XREF_TEST2", "EMP");
- this.dropSchema("XREF_TEST2");
- this.dropTable("XREF_TEST1", "ORG");
- this.dropSchema("XREF_TEST1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private void dropTable(String schemaName, String tableName) throws Exception {
- Schema schema= this.getDefaultCatalog().getSchemaForIdentifier(schemaName);
- if (schema != null) {
- if (schema.getTableForIdentifier(tableName) != null) {
- this.executeUpdate("DROP TABLE " + schemaName + '.' + tableName);
- }
- }
- }
-
- private void dropSchema(String name) throws Exception {
- if (this.getDefaultCatalog().getSchemaForIdentifier(name) != null) {
- this.executeUpdate("DROP SCHEMA " + name + " CASCADE");
- }
- }
-
-// see 241578/241557
-// public void testSequence() throws Exception {
-// this.connectionProfile.connect();
-// TestConnectionListener listener = new TestConnectionListener();
-// this.connectionProfile.addConnectionListener(listener);
-//
-// this.dropSequence("SEQUENCE_TEST", "FOO");
-// this.dropSchema("SEQUENCE_TEST");
-//
-// this.executeUpdate("CREATE SCHEMA SEQUENCE_TEST");
-// this.executeUpdate("SET search_path TO SEQUENCE_TEST");
-//
-// this.executeUpdate(this.buildBarDDL());
-// this.executeUpdate("CREATE SEQUENCE FOO START 1");
-//// List<Object[]> list = this.execute("SELECT nextval('foo')");
-//// System.out.println(list);
-// ((ICatalogObject) this.getDTPDatabase()).refresh();
-//
-// Schema schema = this.getDefaultCatalog().getSchemaNamed("SEQUENCE_TEST");
-// Sequence sequence = schema.getSequenceNamed("FOO");
-// assertNotNull(sequence);
-// assertEquals("foo_seq", sequence.getName());
-//
-// this.dropSequence("SEQUENCE_TEST", "FOO");
-// this.dropSchema("SEQUENCE_TEST");
-//
-// this.connectionProfile.removeConnectionListener(listener);
-// this.connectionProfile.disconnect();
-// }
-//
-// private void dropSequence(String schemaName, String sequenceName) throws Exception {
-// Schema schema= this.getDefaultCatalog().getSchemaNamed(schemaName);
-// if (schema != null) {
-// if (schema.getSequenceNamed(sequenceName) != null) {
-// this.executeUpdate("DROP SEQUENCE " + schemaName + '.' + sequenceName);
-// }
-// }
-// }
-//
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SQLServerTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SQLServerTests.java
deleted file mode 100644
index 346583f282..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SQLServerTests.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-
-/**
- * SQL Server 2005 Driver Test
- */
-@SuppressWarnings("nls")
-public class SQLServerTests extends DTPPlatformTests {
-
- public SQLServerTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "sqlserver.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Microsoft SQL Server 2005 JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Microsoft SQL Server 2005 JDBC Driver";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.enablement.msft.sqlserver.2005.driverTemplate";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "SQLServer";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "2005";
- }
-
- @Override
- protected String getDriverClass() {
- return "com.microsoft.sqlserver.jdbc.SQLServerDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "SQLServer_2005";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Microsoft SQL Server 2005 JDBC Profile [Test]";
- }
-
- @Override
- protected String getProviderID() {
- return "org.eclipse.datatools.connectivity.db.generic.connectionProfile";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- return true; // haven't actually tried this yet...
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SybaseTests.java b/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SybaseTests.java
deleted file mode 100644
index ef91d7ab57..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.db.tests/src/org/eclipse/jpt/jpa/db/tests/internal/platforms/SybaseTests.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2009 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.db.tests.internal.platforms;
-
-import org.eclipse.datatools.connectivity.sqm.core.rte.ICatalogObject;
-import org.eclipse.jpt.jpa.db.Catalog;
-import org.eclipse.jpt.jpa.db.Column;
-import org.eclipse.jpt.jpa.db.ForeignKey;
-import org.eclipse.jpt.jpa.db.Schema;
-import org.eclipse.jpt.jpa.db.Table;
-
-@SuppressWarnings("nls")
-public class SybaseTests extends DTPPlatformTests {
-
- public SybaseTests( String name) {
- super( name);
- }
-
- @Override
- protected String getPlatformPropertiesFileName() {
- return "sybase.properties";
- }
-
- @Override
- protected String getDriverName() {
- return "Sybase JDBC Driver for Sybase ASE 15.x";
- }
-
- @Override
- protected String getDriverDefinitionID() {
- return "DriverDefn.Sybase JDBC Driver for Sybase ASE 15.x";
- }
-
- @Override
- protected String getDriverDefinitionType() {
- return "org.eclipse.datatools.connectivity.db.sybase.ase.genericDriverTemplate_15";
- }
-
- @Override
- protected String getDatabaseVendor() {
- return "Sybase_ASE";
- }
-
- @Override
- protected String getDatabaseVersion() {
- return "15.x";
- }
-
- @Override
- protected String getDriverClass() {
- return "com.sybase.jdbc3.jdbc.SybDriver";
- }
-
- @Override
- protected String getProfileName() {
- return "Sybase_15";
- }
-
- @Override
- protected String getProfileDescription() {
- return "Sybase ASE 15 jConnect JDBC Profile [Test]";
- }
-
- @Override
- protected boolean supportsCatalogs() {
- return true;
- }
-
- @Override
- protected boolean executeOfflineTests() {
- // working offline is pretty ugly
- return false;
- }
-
- /**
- * Sybase "databases" become DTP "catalogs"
- */
- public void testCatalog() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database test1");
- this.executeUpdateIgnoreErrors("drop database test2");
-
- this.executeUpdate("create database test1");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Catalog catalog1 = this.getDatabase().getCatalogNamed("test1");
- assertNotNull(catalog1);
- Schema schema1 = catalog1.getSchemaNamed("dbo");
- assertNotNull(schema1);
- assertSame(schema1, catalog1.getDefaultSchema());
-
- this.executeUpdate("create database test2");
- Catalog catalog2 = this.getDatabase().getCatalogNamed("test2");
- assertNull(catalog2); // should be null until refresh
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- assertSame(this.getDatabase(), listener.changedDatabase);
-
- catalog2 = this.getDatabase().getCatalogNamed("test2");
- assertNotNull(catalog2);
- Schema schema2 = catalog2.getDefaultSchema();
- assertNotNull(schema2);
-
- assertNotSame(catalog1, this.getDatabase().getCatalogNamed("test1")); // we should have a new catalog after the refresh
- assertNotSame(schema1, this.getDatabase().getCatalogNamed("test1").getDefaultSchema()); // we should have a new schema after the refresh
-
- this.executeUpdate("drop database test2");
- this.executeUpdate("drop database test1");
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testTable() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database table_test");
- this.executeUpdate("create database table_test");
- this.getJDBCConnection().setCatalog("table_test");
-
- this.executeUpdate(this.buildBarDDL());
- this.executeUpdate(this.buildFooDDL());
- this.executeUpdate(this.buildBazDDL());
- this.executeUpdate(this.buildFooBazDDL());
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getCatalogNamed("table_test").getDefaultSchema();
-
- // foo
- Table fooTable = schema.getTableNamed("foo");
- assertEquals(3, fooTable.getColumnsSize());
- assertEquals(1, fooTable.getPrimaryKeyColumnsSize());
- assertEquals(1, fooTable.getForeignKeysSize());
-
- Column pkColumn = fooTable.getPrimaryKeyColumn();
- assertEquals("id", pkColumn.getName());
- Column idColumn = fooTable.getColumnNamed("id");
- assertSame(fooTable, idColumn.getTable());
- assertSame(pkColumn, idColumn);
- assertTrue(idColumn.isPartOfPrimaryKey());
- assertFalse(idColumn.isPartOfForeignKey());
- assertTrue(idColumn.isPartOfUniqueConstraint());
- assertFalse(idColumn.isNullable());
-
- assertEquals("INT", idColumn.getDataTypeName());
- assertTrue(idColumn.isNumeric());
- assertEquals(0, idColumn.getPrecision());
- assertEquals(0, idColumn.getScale());
- assertEquals(-1, idColumn.getLength());
- assertFalse(idColumn.isLOB());
- assertEquals("int", idColumn.getJavaTypeDeclaration());
-
- Column nameColumn = fooTable.getColumnNamed("name");
- assertFalse(nameColumn.isPartOfPrimaryKey());
- assertFalse(nameColumn.isPartOfForeignKey());
- assertTrue(nameColumn.isPartOfUniqueConstraint());
- assertFalse(nameColumn.isNullable()); // implied "NOT NULL" ?
-
- assertEquals("VARCHAR", nameColumn.getDataTypeName());
- assertFalse(nameColumn.isNumeric());
- assertEquals(-1, nameColumn.getPrecision());
- assertEquals(-1, nameColumn.getScale());
- assertEquals(20, nameColumn.getLength());
- assertFalse(nameColumn.isLOB());
- assertEquals("java.lang.String", nameColumn.getJavaTypeDeclaration());
-
- Column barColumn = fooTable.getColumnNamed("bar_id");
- assertEquals("INT", barColumn.getDataTypeName());
- assertTrue(barColumn.isPartOfForeignKey());
- assertFalse(barColumn.isPartOfPrimaryKey());
-
- ForeignKey barFK = fooTable.getForeignKeys().iterator().next(); // there should only be 1 foreign key
- assertEquals(1, barFK.getColumnPairsSize());
- assertEquals("bar", barFK.getAttributeName());
- assertNull(barFK.getJoinColumnAnnotationIdentifier("bar"));
- assertEquals("bar_id", barFK.getJoinColumnAnnotationIdentifier("primaryBar"));
- assertSame(fooTable, barFK.getBaseTable());
-
- assertFalse(fooTable.isPossibleJoinTable());
- assertSame(schema, fooTable.getSchema());
-
- // BAR
- Table barTable = schema.getTableNamed("bar");
- assertEquals(2, barTable.getColumnsSize());
- assertEquals(1, barTable.getPrimaryKeyColumnsSize());
- assertEquals(0, barTable.getForeignKeysSize());
- assertEquals("id", barTable.getPrimaryKeyColumn().getName());
- assertFalse(barTable.isPossibleJoinTable());
- Column chunkColumn = barTable.getColumnNamed("chunk");
- assertEquals("IMAGE", chunkColumn.getDataTypeName());
- assertFalse(chunkColumn.isNumeric());
- assertTrue(chunkColumn.isLOB());
- assertEquals("byte[]", chunkColumn.getJavaTypeDeclaration());
- assertSame(barTable, barFK.getReferencedTable());
-
- // BAZ
- Table bazTable = schema.getTableNamed("baz");
- assertEquals(4, bazTable.getColumnsSize());
- assertEquals(1, bazTable.getPrimaryKeyColumnsSize());
- assertEquals(0, bazTable.getForeignKeysSize());
-
- Column nicknameColumn = bazTable.getColumnNamed("nickname");
- assertTrue(nicknameColumn.isNullable());
-
- Column songColumn = bazTable.getColumnNamed("song");
- assertFalse(songColumn.isNullable());
-
- Column salaryColumn = bazTable.getColumnNamed("salary");
- assertFalse(salaryColumn.isPartOfUniqueConstraint());
- assertEquals("DECIMAL", salaryColumn.getDataTypeName());
- assertTrue(salaryColumn.isNumeric());
- assertEquals(10, salaryColumn.getPrecision());
- assertEquals(2, salaryColumn.getScale());
- assertEquals(-1, salaryColumn.getLength());
- assertFalse(salaryColumn.isLOB());
-
- // FOO_BAZ
- Table foo_bazTable = schema.getTableNamed("foo_baz");
- assertEquals(2, foo_bazTable.getColumnsSize());
- assertEquals(0, foo_bazTable.getPrimaryKeyColumnsSize());
- assertEquals(2, foo_bazTable.getForeignKeysSize());
- assertTrue(foo_bazTable.isPossibleJoinTable());
- assertTrue(foo_bazTable.joinTableNameIsDefault());
- assertTrue(foo_bazTable.getColumnNamed("foo_id").isPartOfForeignKey());
-
- this.executeUpdate("drop table foo_baz");
- this.executeUpdate("drop table baz");
- this.executeUpdate("drop table foo");
- this.executeUpdate("drop table bar");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("drop database table_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- private static final String CR = System.getProperty("line.separator"); //$NON-NLS-1$
-
- private String buildBarDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table bar (").append(CR);
- sb.append(" id integer primary key,").append(CR);
- sb.append(" chunk image").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table foo (").append(CR);
- sb.append(" id integer primary key,").append(CR);
- sb.append(" name varchar(20) unique,").append(CR);
- sb.append(" bar_id integer references bar(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table baz (").append(CR);
- sb.append(" id integer primary key,").append(CR);
- sb.append(" nickname varchar(20) null,").append(CR);
- sb.append(" song varchar(20) not null,").append(CR);
- sb.append(" salary decimal(10, 2)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- private String buildFooBazDDL() {
- StringBuilder sb = new StringBuilder(200);
- sb.append("create table foo_baz (").append(CR);
- sb.append(" foo_id integer references foo(id),").append(CR);
- sb.append(" baz_id integer references baz(id)").append(CR);
- sb.append(")").append(CR);
- return sb.toString();
- }
-
- public void testTableLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database table_lookup_test");
- this.executeUpdate("create database table_lookup_test");
- this.getJDBCConnection().setCatalog("table_lookup_test");
-
- this.executeUpdate("create table test1 (id integer, name varchar(20))");
- this.executeUpdate("create table TEST2 (id integer, name varchar(20))");
- this.executeUpdate("create table [Test3] (id integer, name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Schema schema = this.getDatabase().getCatalogNamed("table_lookup_test").getDefaultSchema();
-
- assertNotNull(schema.getTableNamed("test1"));
- assertNotNull(schema.getTableForIdentifier("test1"));
-
- assertNotNull(schema.getTableNamed("TEST2"));
- assertNotNull(schema.getTableForIdentifier("TEST2"));
-
- assertNotNull(schema.getTableForIdentifier("[Test3]"));
-
- this.executeUpdate("drop table [Test3]");
- this.executeUpdate("drop table TEST2");
- this.executeUpdate("drop table test1");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("drop database table_lookup_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testColumnLookup() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database column_lookup_test");
- this.executeUpdate("create database column_lookup_test");
- this.getJDBCConnection().setCatalog("column_lookup_test");
-
- // lowercase
- this.executeUpdate("create table test (id integer, name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- Table table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnNamed("id"));
- assertNotNull(table.getColumnNamed("name"));
-
- this.executeUpdate("drop table test");
-
- // uppercase
- this.executeUpdate("create table test (ID integer, NAME varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("ID"));
- assertNotNull(table.getColumnForIdentifier("NAME"));
-
- this.executeUpdate("drop table test");
-
- // mixed case
- this.executeUpdate("create table test (Id integer, Name varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("Id"));
- assertNotNull(table.getColumnForIdentifier("Name"));
-
- this.executeUpdate("drop table test");
-
- // delimited
- this.executeUpdate("create table test ([Id] integer, [Name] varchar(20))");
- ((ICatalogObject) this.getDTPDatabase()).refresh();
-
- table = this.getDatabase().getCatalogNamed("column_lookup_test").getDefaultSchema().getTableNamed("test");
- assertNotNull(table.getColumnForIdentifier("[Id]"));
- assertNotNull(table.getColumnForIdentifier("[Name]"));
-
- this.executeUpdate("drop table test");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("drop database column_lookup_test");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
- public void testCrossSchemaReference() throws Exception {
- this.connectionProfile.connect();
- TestConnectionListener listener = new TestConnectionListener();
- this.connectionProfile.addConnectionListener(listener);
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdateIgnoreErrors("drop database xref_test2");
- this.executeUpdateIgnoreErrors("drop database xref_test1");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("create database xref_test1");
- this.getJDBCConnection().setCatalog("xref_test1");
- this.executeUpdate("create table org (id integer primary key, name varchar(20))");
-
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("create database xref_test2");
- this.getJDBCConnection().setCatalog("xref_test2");
- this.executeUpdate("create table emp (id integer primary key, name varchar(20), " +
- "org_id integer references xref_test1..org(id))");
-
- ((ICatalogObject) this.getDTPDatabase()).refresh();
- Catalog catalog1 = this.getDatabase().getCatalogNamed("xref_test1");
- assertNotNull(catalog1);
- Schema schema1 = catalog1.getSchemaNamed("dbo");
- assertNotNull(schema1);
- Table orgTable = schema1.getTableNamed("org");
- assertNotNull(orgTable);
-
- Catalog catalog2 = this.getDatabase().getCatalogNamed("xref_test2");
- assertNotNull(catalog2);
- Schema schema2 = catalog2.getSchemaNamed("dbo");
- assertNotNull(schema2);
- Table empTable = schema2.getTableNamed("emp");
- assertNotNull(empTable);
- assertEquals(1, empTable.getForeignKeysSize());
- ForeignKey fk = empTable.getForeignKeys().iterator().next();
- Table refTable = fk.getReferencedTable();
- assertNotNull(refTable);
- assertEquals("org", refTable.getName());
- assertEquals(1, fk.getColumnPairsSize());
- ForeignKey.ColumnPair cp = fk.getColumnPairs().iterator().next();
- Column baseColumn = cp.getBaseColumn();
- assertEquals("org_id", baseColumn.getName());
- Column refColumn = cp.getReferencedColumn();
- assertEquals("id", refColumn.getName());
-
- this.getJDBCConnection().setCatalog("xref_test2");
- this.executeUpdate("drop table emp");
- this.getJDBCConnection().setCatalog("xref_test1");
- this.executeUpdate("drop table org");
- this.getJDBCConnection().setCatalog("master");
- this.executeUpdate("drop database xref_test2");
- this.executeUpdate("drop database xref_test1");
-
- this.connectionProfile.removeConnectionListener(listener);
- this.connectionProfile.disconnect();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.classpath
deleted file mode 100644
index 3fbf40ae96..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jst/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/wst/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.project
deleted file mode 100644
index 0dcf45fd19..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.eclipselink.core.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 4034685449..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:13 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index db2960f014..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,33 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.eclipselink.core.tests
-Bundle-Version: 2.2.0.qualifier
-Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.commands;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.resources;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.emf.ecore.xmi;bundle-version="[2.4.0,3.0.0)",
- org.eclipse.jpt.common.core;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.core.tests;bundle-version="[1.0.0,2.0.0)",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jdt.core;bundle-version="[3.4.0,4.0.0)",
- org.eclipse.jpt.jpa.core;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.jpt.jpa.eclipselink.core;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.core.tests;bundle-version="[3.0.0,4.0.0)",
- org.eclipse.wst.common.emf;bundle-version="[1.1.201,2.0.0)",
- org.eclipse.wst.common.emfworkbench.integration;bundle-version="[1.1.201,2.0.0)",
- org.eclipse.wst.common.frameworks;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.modulecore;bundle-version="[1.1.200,2.0.0)",
- org.eclipse.wst.common.project.facet.core;bundle-version="[1.3.0,2.0.0)",
- org.junit;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jpt.jpa.eclipselink.core.tests.internal;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.metadata;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource;x-internal:=true,
- org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/about.html b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/build.properties
deleted file mode 100644
index 82227ce10a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/plugin.properties
deleted file mode 100644
index 5b9cfcd182..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2009 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - EclipseLink Support - Core Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java
deleted file mode 100644
index 97d7891e9c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/JptJpaEclipseLinkCoreTests.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal;
-
-import java.io.File;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.JptJpaEclipseLinkCoreContextModelTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.metadata.JptJpaEclipseLinkCoreMetadataTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.JptJpaEclipselinkCoreResourceModelTests;
-
-/**
- * decentralize test creation code
- *
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- * -Dorg.eclipse.jpt.eclipselink.jar=<eclipselink.jar path>
- */
-@SuppressWarnings("nls")
-public class JptJpaEclipseLinkCoreTests
-{
- private static final String JPA_JAR_PROPERTY = TestJpaProject.JPA_JAR_NAME_SYSTEM_PROPERTY;
- private static final String ECLIPSELINK_JAR_PROPERTY = TestJpaProject.ECLIPSELINK_JAR_NAME_SYSTEM_PROPERTY;
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaEclipseLinkCoreTests.class.getPackage().getName());
- suite.addTest(JptJpaEclipselinkCoreResourceModelTests.suite());
- suite.addTest(JptJpaEclipseLinkCoreContextModelTests.suite());
- suite.addTest(JptJpaEclipseLinkCoreMetadataTests.suite());
- return suite;
- }
-
- public static boolean requiredJarsExists() {
- return jpaJarPropertyExists()
- && jpaJarFileExists()
- && eclipselinkJarPropertyExists()
- && eclipselinkJarFileExists();
- }
-
- public static boolean jpaJarPropertyExists() {
- return getSystemProperty(JPA_JAR_PROPERTY) != null;
- }
-
- public static boolean jpaJarFileExists() {
- return (new File(getSystemProperty(JPA_JAR_PROPERTY))).exists();
- }
-
- public static boolean eclipselinkJarPropertyExists() {
- return getSystemProperty(ECLIPSELINK_JAR_PROPERTY) != null;
- }
-
- public static boolean eclipselinkJarFileExists() {
- return (new File(getSystemProperty(ECLIPSELINK_JAR_PROPERTY))).exists();
- }
-
- public static String buildMissingJarErrorMessage() {
- if( ! jpaJarPropertyExists()) {
- return errorMissingProperty(JPA_JAR_PROPERTY);
- }
- else if( ! jpaJarFileExists()) {
- return errorJarFileDoesNotExist(getSystemProperty(JPA_JAR_PROPERTY));
- }
- else if( ! eclipselinkJarPropertyExists()) {
- return errorMissingProperty(ECLIPSELINK_JAR_PROPERTY);
- }
- return errorJarFileDoesNotExist(getSystemProperty(ECLIPSELINK_JAR_PROPERTY));
- }
-
- /*********** private **********/
-
- private static String errorMissingProperty(String propertyName) {
- return "missing Java system property: \"" + propertyName + "\"";
- }
-
- private static String errorJarFileDoesNotExist(String propertyValue) {
- return "JAR file doesn't exist: \"" + propertyValue + "\"";
- }
-
- private static String getSystemProperty(String propertyName) {
- return System.getProperty(propertyName);
- }
-
- private JptJpaEclipseLinkCoreTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java
deleted file mode 100644
index ecfe5cb6ec..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1ContextModelTestCase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-
-public abstract class EclipseLink1_1ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- public static final String JPA_ANNOTATIONS_PACKAGE_NAME = "javax.persistence"; //$NON-NLS-1$
-
- protected EclipseLink1_1ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_1;
- }
-
- @Override
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink1_1.SCHEMA_VERSION;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java
deleted file mode 100644
index 939a527af0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_1JpaProjectTests.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.operations.JpaFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_1.EclipseLink1_1;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1JpaProjectTests
- extends ContextModelTestCase
-{
-
- public EclipseLink1_1JpaProjectTests(String name) {
- super(name);
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_1;
- }
-
- @Override
- protected EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
- //add the orm.xml file with eclipselink 1.1 orm content type
- createDefaultOrmXmlFileWithEclipseLink1_1ContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file with eclipselink orm content type
- createDefaultOrmXmlFileWithEclipseLinkContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file this time with orm content type
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- public void testGetDefaultEclipseLinkOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.1 file
- createDefaultEclipseLink1_1OrmXmlFile();
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
- }
-
- private void createDefaultOrmXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLinkContentType() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME,
- JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLink1_1ContentType() throws Exception {
- createEclipseLink1_1OrmXmlFile(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createDefaultEclipseLink1_1OrmXmlFile() throws Exception {
- createEclipseLink1_1OrmXmlFile(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createEclipseLink1_1OrmXmlFile(String fileName) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, fileName);
- config.setProperty(JpaFileCreationDataModelProperties.VERSION, EclipseLink1_1.SCHEMA_VERSION);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.1 file
- createDefaultEclipseLink1_1OrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
- }
-
- public void testGetDifferentlyNamedMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //create the orm2.xml file
- createEclipseLink1_1OrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm2.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //add the orm2.xml file back
- createEclipseLink1_1OrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_1_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java
deleted file mode 100644
index 19d0fd251c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2ContextModelTestCase.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-
-public abstract class EclipseLink1_2ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- public static final String JPA_ANNOTATIONS_PACKAGE_NAME = "javax.persistence"; //$NON-NLS-1$
-
- protected EclipseLink1_2ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_2;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java
deleted file mode 100644
index 67272257d3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink1_2JpaProjectTests.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.operations.JpaFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v1_2.EclipseLink1_2;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_2JpaProjectTests
- extends ContextModelTestCase
-{
-
- public EclipseLink1_2JpaProjectTests(String name) {
- super(name);
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_2;
- }
-
- @Override
- protected EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
- //add the orm.xml file with eclipselink 1.2 orm content type
- createDefaultOrmXmlFileWithEclipseLink1_2ContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file with eclipselink orm content type
- createDefaultOrmXmlFileWithEclipseLinkContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file this time with orm content type
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- public void testGetDefaultEclipseLinkOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.2 file
- createDefaultEclipseLink1_2OrmXmlFile();
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
- }
-
- private void createDefaultOrmXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLinkContentType() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME,
- JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLink1_2ContentType() throws Exception {
- createEclipseLink1_2OrmXmlFile(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createDefaultEclipseLink1_2OrmXmlFile() throws Exception {
- createEclipseLink1_2OrmXmlFile(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createEclipseLink1_2OrmXmlFile(String fileName) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, fileName);
- config.setProperty(JpaFileCreationDataModelProperties.VERSION, EclipseLink1_2.SCHEMA_VERSION);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
-
- //add the eclipselink-orm.xml 1.2 file
- createDefaultEclipseLink1_2OrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
- }
-
- public void testGetDifferentlyNamedMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //create the orm2.xml file
- createEclipseLink1_2OrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm2.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //add the orm2.xml file back
- createEclipseLink1_2OrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_1_2_RESOURCE_TYPE, resource.getResourceType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java
deleted file mode 100644
index e2967967c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_0ContextModelTestCase.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_0.EclipseLink2_0;
-
-public abstract class EclipseLink2_0ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- protected EclipseLink2_0ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_2_0.getVersionString();
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_2_0;
- }
-
- @Override
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink2_0.SCHEMA_VERSION;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_1ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_1ContextModelTestCase.java
deleted file mode 100644
index abd561e377..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_1ContextModelTestCase.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLink2_1;
-
-public abstract class EclipseLink2_1ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- protected EclipseLink2_1ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_2_0.getVersionString();
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_2_1;
- }
-
- @Override
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink2_1.SCHEMA_VERSION;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_2ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_2ContextModelTestCase.java
deleted file mode 100644
index 13fbb0ee6f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_2ContextModelTestCase.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.EclipseLink2_2;
-
-public abstract class EclipseLink2_2ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- protected EclipseLink2_2ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_2_0.getVersionString();
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_2_2;
- }
-
- @Override
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink2_2.SCHEMA_VERSION;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_3ContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_3ContextModelTestCase.java
deleted file mode 100644
index dd6efe8e3c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLink2_3ContextModelTestCase.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.EclipseLink2_3;
-
-public abstract class EclipseLink2_3ContextModelTestCase extends EclipseLinkContextModelTestCase
-{
- protected EclipseLink2_3ContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected String getJpaFacetVersionString() {
- return JpaFacet.VERSION_2_0.getVersionString();
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_2_3;
- }
-
- @Override
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink2_3.SCHEMA_VERSION;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java
deleted file mode 100644
index ceea67f3a2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkContextModelTestCase.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.operations.JpaFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationOperation;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public abstract class EclipseLinkContextModelTestCase
- extends ContextModelTestCase
-{
- protected JpaXmlResource eclipseLinkOrmXmlResource;
-
- protected EclipseLinkContextModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.eclipseLinkOrmXmlResource = getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.eclipseLinkOrmXmlResource = null;
- super.tearDown();
- }
-
- @Override
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild, IDataModel jpaConfig) throws Exception {
- TestJpaProject testJpaProject = super.buildJpaProject(projectName, autoBuild, jpaConfig);
-
- if (createEclipseLinkOrmXml()) {
- EclipseLinkOrmFileCreationOperation operation =
- new EclipseLinkOrmFileCreationOperation(buildEclipseLinkOrmConfig(testJpaProject));
- operation.execute(null, null);
- }
-
- return testJpaProject;
- }
-
- @Override
- protected boolean createOrmXml() {
- return false;
- }
-
- protected boolean createEclipseLinkOrmXml() {
- return true;
- }
-
- protected IDataModel buildEclipseLinkOrmConfig(TestJpaProject testJpaProject) {
- IDataModel dataModel =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- dataModel.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- testJpaProject.getProject().getFolder("src/META-INF").getFullPath()); //$NON-NLS-1$
- dataModel.setProperty(JpaFileCreationDataModelProperties.VERSION, this.getEclipseLinkSchemaVersion());
- dataModel.setProperty(OrmFileCreationDataModelProperties.ADD_TO_PERSISTENCE_UNIT, Boolean.TRUE);
- return dataModel;
- }
-
- protected String getEclipseLinkSchemaVersion() {
- return EclipseLink.SCHEMA_VERSION;
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_0;
- }
-
- @Override
- protected EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- @Override
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
- @Override
- protected JavaEclipseLinkEntity getJavaEntity() {
- return (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- }
-
- protected JavaEclipseLinkEmbeddable getJavaEmbeddable() {
- return (JavaEclipseLinkEmbeddable) getJavaPersistentType().getMapping();
- }
-
- protected JavaEclipseLinkMappedSuperclass getJavaMappedSuperclass() {
- return (JavaEclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- }
-
- @Override
- protected JpaXmlResource getOrmXmlResource() {
- return this.eclipseLinkOrmXmlResource;
- }
-
- @Override
- protected XmlEntityMappings getXmlEntityMappings() {
- return (XmlEntityMappings) super.getXmlEntityMappings();
- }
-
- @Override
- protected EclipseLinkEntityMappings getEntityMappings() {
- return (EclipseLinkEntityMappings) super.getEntityMappings();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java
deleted file mode 100644
index b9d5154465..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/EclipseLinkJpaProjectTests.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import org.eclipse.core.runtime.Path;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.core.platform.JpaPlatformDescription;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.context.ContextModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJpaProjectTests
- extends ContextModelTestCase
-{
-
- public EclipseLinkJpaProjectTests(String name) {
- super(name);
- }
-
- @Override
- protected boolean createOrmXml() {
- return true;
- }
-
- @Override
- protected JpaPlatformDescription getJpaPlatformDescription() {
- return EclipseLinkPlatform.VERSION_1_0;
- }
-
- @Override
- protected EclipseLinkJpaProject getJpaProject() {
- return (EclipseLinkJpaProject) super.getJpaProject();
- }
-
- public void testGetDefaultOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
- //add the orm.xml file with eclipselink orm content type
- createDefaultOrmXmlFileWithEclipseLinkContentType();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNull(resource);
-
-
- //add the orm.xml file this time with orm content type
- createDefaultOrmXmlFile();
- resource = this.getJpaProject().getDefaultOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaCorePlugin.ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm.xml", resource.getFile().getProjectRelativePath().toString());
- }
-
- public void testGetDefaultEclipseLinkOrmXmlResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
-
- //add the eclipselink-orm.xml file
- createDefaultEclipseLinkOrmXmlFile();
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getDefaultOrmXmlResource()
- resource.delete(null);
- resource = this.getJpaProject().getDefaultEclipseLinkOrmXmlResource();
- assertNull(resource);
- }
-
- private void createDefaultOrmXmlFile() throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new OrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.getDefaultOperation().execute(null, null);
- }
-
- private void createDefaultOrmXmlFileWithEclipseLinkContentType() throws Exception {
- createEclipseLinkOrmXmlFile(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createDefaultEclipseLinkOrmXmlFile() throws Exception {
- createEclipseLinkOrmXmlFile(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.lastSegment());
- }
-
- private void createEclipseLinkOrmXmlFile(String fileName) throws Exception {
- IDataModel config =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- config.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- getJpaProject().getProject().getFolder("src/META-INF").getFullPath());
- config.setProperty(JptFileCreationDataModelProperties.FILE_NAME, fileName);
- config.getDefaultOperation().execute(null, null);
- }
-
- public void testGetMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
-
- //add the eclipselink-orm.xml file
- createDefaultEclipseLinkOrmXmlFile();
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/eclipselink-orm.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the eclipselink-orm.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH);
- assertNull(resource);
- }
-
- public void testGetDifferentlyNamedMappingFileResource() throws Exception {
- JpaXmlResource resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //create the orm2.xml file
- createEclipseLinkOrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
-
- //delete the orm2.xml file and verify it is not returned from getMappingFileResource()
- resource.delete(null);
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNull(resource);
-
- //add the orm2.xml file back
- createEclipseLinkOrmXmlFile("orm2.xml");
- resource = this.getJpaProject().getMappingFileXmlResource(new Path("META-INF/orm2.xml"));
- assertNotNull(resource);
- assertEquals(JptJpaEclipseLinkCorePlugin.ECLIPSELINK_ORM_XML_CONTENT_TYPE, resource.getContentType());
- assertEquals("src/META-INF/orm2.xml", resource.getFile().getProjectRelativePath().toString());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/JptJpaEclipseLinkCoreContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/JptJpaEclipseLinkCoreContextModelTests.java
deleted file mode 100644
index c0071318c1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/JptJpaEclipseLinkCoreContextModelTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.JptJpaEclipseLinkCoreTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java.JptEclipseLinkCoreJavaContextModelTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm.JptEclipseLinkCoreOrmContextModelTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence.JptEclipseLinkCorePersistenceContextModelTests;
-
-/**
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- * -Dorg.eclipse.jpt.eclipselink.jar=<eclipselink.jar path>
- */
-public class JptJpaEclipseLinkCoreContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaEclipseLinkCoreContextModelTests.class.getName());
- if(JptJpaEclipseLinkCoreTests.requiredJarsExists()) {
- suite.addTestSuite(EclipseLinkJpaProjectTests.class);
- suite.addTestSuite(EclipseLink1_1JpaProjectTests.class);
- suite.addTestSuite(EclipseLink1_2JpaProjectTests.class);
- suite.addTest(JptEclipseLinkCorePersistenceContextModelTests.suite());
- suite.addTest(JptEclipseLinkCoreJavaContextModelTests.suite());
- suite.addTest(JptEclipseLinkCoreOrmContextModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(JptJpaEclipseLinkCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptJpaEclipseLinkCoreContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java
deleted file mode 100644
index 8ed576a31d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaCollectionTableTests.java
+++ /dev/null
@@ -1,724 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaUniqueConstraint;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.CollectionTable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.UniqueConstraintAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaCollectionTableTests extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaCollectionTableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append(" private Collection<String> projects;").append(CR);
- }
- });
- }
-
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable);
-
-
- //set name in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedName());
- assertEquals("FOO", resourceCollectionTable.getName());
-
- //set name to null in the resource model
- resourceCollectionTable.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable.getName());
-
- resourceCollectionTable.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedName());
- assertEquals("FOO", resourceCollectionTable.getName());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable3 = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceCollectionTable3);
-
- //set name in the context model, verify resource model modified
- collectionTable.setSpecifiedName("foo");
- resourceCollectionTable3 = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedName());
- assertEquals("foo", resourceCollectionTable3.getName());
-
- //set name to null in the context model
- collectionTable.setSpecifiedName(null);
- assertNull(collectionTable.getSpecifiedName());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultName() throws Exception {
- createTestEntityWithValidElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
-
- //add the collection table annotation, verify default collection table name is the same
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(TYPE_NAME + "_projects", collectionTable.getDefaultName());
- assertNotNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
-
- //set the entity name, verify default collection table name updates
- getJavaEntity().setSpecifiedName("Foo");
- assertEquals("Foo_projects", collectionTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable);
-
-
- //set schema in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceCollectionTable.getSchema());
-
- //set schema to null in the resource model
- resourceCollectionTable.setSchema(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable.getSchema());
-
- resourceCollectionTable.setSchema("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceCollectionTable.getSchema());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceCollectionTable);
-
- //set schema in the context model, verify resource model modified
- collectionTable.setSpecifiedSchema("foo");
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedSchema());
- assertEquals("foo", resourceCollectionTable.getSchema());
-
- //set schema to null in the context model
- collectionTable.setSpecifiedSchema(null);
- assertNull(collectionTable.getSpecifiedSchema());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable);
-
-
- //set catalog in the resource model, verify context model updated
- resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- resourceCollectionTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceCollectionTable.getCatalog());
-
- //set catalog to null in the resource model
- resourceCollectionTable.setCatalog(null);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable.getCatalog());
-
- resourceCollectionTable.setCatalog("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", collectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceCollectionTable.getCatalog());
-
- resourceField.removeAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceCollectionTable);
-
- //set catalog in the context model, verify resource model modified
- collectionTable.setSpecifiedCatalog("foo");
- resourceCollectionTable = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals("foo", collectionTable.getSpecifiedCatalog());
- assertEquals("foo", resourceCollectionTable.getCatalog());
-
- //set catalog to null in the context model
- collectionTable.setSpecifiedCatalog(null);
- assertNull(collectionTable.getSpecifiedCatalog());
- assertNull(resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
-
- JoinColumn joinColumn = collectionTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals("FOO", joinTableResource.joinColumnAt(0).getName());
-
- JoinColumn joinColumn2 = collectionTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(1).getName());
-
- JoinColumn joinColumn3 = collectionTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, joinTableResource.getJoinColumnsSize());
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, joinTableResource.getJoinColumnsSize());
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, joinTableResource.getJoinColumnsSize());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- collectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- collectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- collectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- assertEquals(3, joinTableResource.getJoinColumnsSize());
-
-
- collectionTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAZ", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
-
-
- collectionTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", joinTableResource.joinColumnAt(0).getName());
- assertEquals("BAR", joinTableResource.joinColumnAt(1).getName());
- assertEquals("FOO", joinTableResource.joinColumnAt(2).getName());
- }
-
- public void testUpdateJoinColumns() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- CollectionTable2_0Annotation joinTableResource = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- joinTableResource.addJoinColumn(0);
- joinTableResource.addJoinColumn(1);
- joinTableResource.addJoinColumn(2);
-
- joinTableResource.joinColumnAt(0).setName("FOO");
- joinTableResource.joinColumnAt(1).setName("BAR");
- joinTableResource.joinColumnAt(2).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaJoinColumn> joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(2, 0);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.moveJoinColumn(0, 1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(1);
- getJpaProject().synchronizeContextModel();
- joinColumns = collectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- joinTableResource.removeJoinColumn(0);
- getJpaProject().synchronizeContextModel();
- assertFalse(collectionTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testGetDefaultJoinColumn() {
- //TODO
- }
-
- public void testSpecifiedJoinColumnsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.getSpecifiedJoinColumnsSize());
-
- collectionTable.addSpecifiedJoinColumn(0);
- assertEquals(1, collectionTable.getSpecifiedJoinColumnsSize());
-
- collectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, collectionTable.getSpecifiedJoinColumnsSize());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "bar");
- getJpaProject().synchronizeContextModel();
-
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testgetUniqueConstraintsSize() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
-
- assertEquals(0, collectionTable.getUniqueConstraintsSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- joinTableAnnotation.addUniqueConstraint(0).addColumnName(0, "foo");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName(0, "bar");
-
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, collectionTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- CollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
- ListIterator<UniqueConstraintAnnotation> uniqueConstraints = joinTableAnnotation.getUniqueConstraints().iterator();
-
- assertEquals("BAZ", uniqueConstraints.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraints.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraints.next().columnNameAt(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
- collectionTable.removeUniqueConstraint(1);
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- Iterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(1);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertFalse(uniqueConstraintAnnotations.hasNext());
-
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- collectionTable.removeUniqueConstraint(0);
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraintAnnotations.hasNext());
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- collectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- collectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- collectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.getAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- assertEquals(3, joinTableAnnotation.getUniqueConstraintsSize());
-
-
- collectionTable.moveUniqueConstraint(2, 0);
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<UniqueConstraintAnnotation> uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
-
-
- collectionTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintAnnotations = joinTableAnnotation.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("BAR", uniqueConstraintAnnotations.next().columnNameAt(0));
- assertEquals("FOO", uniqueConstraintAnnotations.next().columnNameAt(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestEntityWithElementCollection();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 collectionTable = elementCollectionMapping.getCollectionTable();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- CollectionTable2_0Annotation joinTableAnnotation = (CollectionTable2_0Annotation) resourceField.addAnnotation(CollectionTable2_0Annotation.ANNOTATION_NAME);
-
- joinTableAnnotation.addUniqueConstraint(0).addColumnName("FOO");
- joinTableAnnotation.addUniqueConstraint(1).addColumnName("BAR");
- joinTableAnnotation.addUniqueConstraint(2).addColumnName("BAZ");
- getJpaProject().synchronizeContextModel();
-
-
- ListIterator<JavaUniqueConstraint> uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(2, 0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.moveUniqueConstraint(0, 1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(1);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- joinTableAnnotation.removeUniqueConstraint(0);
- getJpaProject().synchronizeContextModel();
- uniqueConstraints = collectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java
deleted file mode 100644
index 673694ed71..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaElementCollectionMappingTests.java
+++ /dev/null
@@ -1,2280 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.ReflectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.TypeMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.ElementCollection2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.BasicAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EmbeddedIdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.ManyToOneAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TransientAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.VersionAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaElementCollectionMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public static final String EMBEDDABLE_TYPE_NAME = "Address";
- public static final String FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME = PACKAGE_NAME + "." + EMBEDDABLE_TYPE_NAME;
-
- private ICompilationUnit createTestEntityWithElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- }
- });
- }
- private ICompilationUnit createTestEntityWithElementCollectionMappingWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithGenericEmbeddableElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericBasicElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<String> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonGenericElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddablePropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
- private void createSelfReferentialElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.List<Foo> elementCollection;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- public EclipseLink2_0JavaElementCollectionMappingTests(String name) {
- super(name);
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof BasicMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(BasicAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToDefault() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof VersionMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(VersionAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof IdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(IdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(EmbeddedIdAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof TransientMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(TransientAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToOneAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof OneToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
-
- persistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertTrue(persistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertFalse(persistentAttribute.getMapping().isDefault());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME));
- assertNotNull(resourceField.getAnnotation(ManyToManyAnnotation.ANNOTATION_NAME));
- }
-
- public void testUpdateSpecifiedTargetEntity() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollectionAnnotation = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollectionAnnotation.getTargetClass());
-
- //set target class in the resource model, verify context model updated
- elementCollectionAnnotation.setTargetClass("newTargetClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("newTargetClass", elementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollectionAnnotation.getTargetClass());
-
- //set target class to null in the resource model
- elementCollectionAnnotation.setTargetClass(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollectionAnnotation.getTargetClass());
- }
-
- public void testModifySpecifiedTargetClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedTargetClass("newTargetClass");
- assertEquals("newTargetClass", elementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the context model
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertNull(elementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
- public void testDefaultTargetClass() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //targetEntity not in the persistence unit, default still set, handled by validation
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- //add targetEntity to the persistence unit
- addXmlClassRef(PACKAGE_NAME + ".Address");
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- JavaPersistentType addressPersistentType = addressClassRef.getJavaPersistentType();
-
- //test target is not an Embeddable, default target entity still exists, this case handled with validation
- addressPersistentType.setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassNonGenericCollection() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassGenericCollection() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassNonGenericMap() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testDefaultTargetClassGenericMap() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testTargetClass() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getTargetClass());
-
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertEquals("foo", elementCollectionMapping.getTargetClass());
-
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertEquals(PACKAGE_NAME + ".Address", elementCollectionMapping.getTargetClass());
- }
-
- protected Embeddable getResolvedTargetEmbeddable(ElementCollectionMapping2_0 mapping) {
- return (Embeddable) ReflectionTools.executeMethod(mapping, "getResolvedTargetEmbeddable");
- }
-
- public void testResolvedTargetEmbeddable() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target embeddable not in the persistence unit
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
- //add target embeddable to the persistence unit, now target embeddable should resolve
- createTestTargetEmbeddableAddress();
- addXmlClassRef(PACKAGE_NAME + ".Address");
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- ClassRef addressClassRef = classRefs.next();
- TypeMapping addressTypeMapping = addressClassRef.getJavaPersistentType().getMapping();
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedTargetClass("foo");
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
-
- elementCollectionMapping.setSpecifiedTargetClass(PACKAGE_NAME + ".Address");
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
-
-
- elementCollectionMapping.setSpecifiedTargetClass(null);
- assertEquals(addressTypeMapping, this.getResolvedTargetEmbeddable(elementCollectionMapping));
- }
-
- public void testResolvedTargetEmbeddableWithBasicType() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- //target is a basic type, so resolved target embeddable is null
- assertNull(this.getResolvedTargetEmbeddable(elementCollectionMapping));
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the resource model, verify context model updated
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(FetchType.EAGER, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the resource model
- elementCollection.setFetch(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ElementCollection2_0Annotation elementCollection = (ElementCollection2_0Annotation) resourceField.getAnnotation(ElementCollection2_0Annotation.ANNOTATION_NAME);
-
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(FetchType.EAGER, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, elementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the context model
- elementCollectionMapping.setSpecifiedFetch(null);
- assertNull(elementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testGetValueTypeEmbeddable() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeNone() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.NO_TYPE, elementCollectionMapping.getValueType());
-
- elementCollectionMapping.setSpecifiedTargetClass("Address");
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeBasic() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", elementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", elementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKeyAnnotation.getName());
-
- //set mapKey to null in the context model
- elementCollectionMapping.setSpecifiedMapKey(null);
- assertNull(elementCollectionMapping.getSpecifiedMapKey());
- mapKeyAnnotation = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKeyAnnotation.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping2_0 = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- elementCollectionMapping2_0.setSpecifiedTargetClass("Address");
- mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- elementCollectionMapping2_0.setSpecifiedTargetClass("String");
- mapKeyNames = elementCollectionMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", elementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- elementCollectionMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", elementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- elementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertNull(elementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", elementCollectionMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- elementCollectionMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", elementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", elementCollectionMapping.getMapKeyClass());
-
- elementCollectionMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", elementCollectionMapping.getMapKeyClass());
-
- elementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", elementCollectionMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) elementCollectionMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
- }
-
- public void testGetValueColumn() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getValueColumn().getSpecifiedName());
- assertEquals("id", elementCollectionMapping.getValueColumn().getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- ColumnAnnotation column = (ColumnAnnotation) resourceField.addAnnotation(JPA.COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", elementCollectionMapping.getValueColumn().getSpecifiedName());
- assertEquals("foo", elementCollectionMapping.getValueColumn().getName());
- assertEquals("id", elementCollectionMapping.getValueColumn().getDefaultName());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_addresses", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable embeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) embeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("addresses", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_addresses", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, attributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(6, attributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(6, attributeOverrideContainer.getOverridesSize());
- }
-
- public void testVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("state.name");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("city", attributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestEntityWithGenericEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType persistentType = specifiedClassRefs.next().getJavaPersistentType();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualAttributeOverride.getName());
- assertEquals(false, virtualAttributeOverrides.hasNext());
-
-
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- EmbeddedMapping nestedEmbeddedMapping = (EmbeddedMapping) addressPersistentType.getAttributeNamed("state").getMapping();
- AttributeOverrideContainer nestedAttributeOverrideContainer = nestedEmbeddedMapping.getAttributeOverrideContainer();
- assertEquals(2, nestedAttributeOverrideContainer.getVirtualOverridesSize());
- virtualAttributeOverrides = nestedAttributeOverrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("abbr", virtualAttributeOverride.getName());
-
- PersistentType statePersistentType = specifiedClassRefs.next().getJavaPersistentType();
- BasicMapping abbrMapping = (BasicMapping) statePersistentType.getAttributeNamed("abbr").getMapping();
- abbrMapping.getColumn().setSpecifiedName("BLAH");
- abbrMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- abbrMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- abbrMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- abbrMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- abbrMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- abbrMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- abbrMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- //check the nested embedded (Address.state) attribute override to verify it is getting settings from the specified column on State.abbr
- virtualAttributeOverride = ((EmbeddedMapping) addressPersistentType.getAttributeNamed("state").getMapping()).getAttributeOverrideContainer().getOverrideNamed("abbr");
- assertEquals("abbr", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
- }
-
- public void testGetMapKeyColumn() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", elementCollectionMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_addresses", elementCollectionMapping.getMapKeyColumn().getTable());//collection table name
-
- elementCollectionMapping.getCollectionTable().setSpecifiedName("MY_COLLECTION_TABLE");
- assertEquals("MY_COLLECTION_TABLE", elementCollectionMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", elementCollectionMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", elementCollectionMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", elementCollectionMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("parcelNumber", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- classRefs.next();
- Embeddable propertyInfoEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping parcelNumberMapping = (BasicMapping) propertyInfoEmbeddable.getPersistentType().getAttributeNamed("parcelNumber").getMapping();
- parcelNumberMapping.getColumn().setSpecifiedName("FOO1");
- parcelNumberMapping.getColumn().setSpecifiedTable("BAR1");
- parcelNumberMapping.getColumn().setColumnDefinition("COLUMN_DEF1");
- parcelNumberMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- parcelNumberMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- parcelNumberMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- parcelNumberMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- parcelNumberMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
-
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("FOO1", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR1", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF1", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- parcelNumberMapping.getColumn().setSpecifiedName(null);
- parcelNumberMapping.getColumn().setSpecifiedTable(null);
- parcelNumberMapping.getColumn().setColumnDefinition(null);
- parcelNumberMapping.getColumn().setSpecifiedInsertable(null);
- parcelNumberMapping.getColumn().setSpecifiedUpdatable(null);
- parcelNumberMapping.getColumn().setSpecifiedUnique(null);
- parcelNumberMapping.getColumn().setSpecifiedNullable(null);
- parcelNumberMapping.getColumn().setSpecifiedLength(null);
- parcelNumberMapping.getColumn().setSpecifiedPrecision(null);
- parcelNumberMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = attributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("parcelNumber", defaultAttributeOverride.getName());
- assertEquals("parcelNumber", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_parcels", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, attributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, valueAttributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, valueAttributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(1, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(5, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(5, valueAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, mapKeyAttributeOverrideContainer.getOverridesSize());
- assertEquals(6, valueAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.parcelNumber");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(2, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.name");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, valueAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- valueAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- assertEquals("parcelNumber", valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(2, valueAttributeOverrideContainer.getVirtualOverridesSize());
- assertEquals("city", mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().getName());
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- valueAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = valueAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("parcelNumber", virtualAttributeOverrides.next().getName());
- assertEquals("size", virtualAttributeOverrides.next().getName());
- assertEquals("tax", virtualAttributeOverrides.next().getName());
- assertEquals(3, valueAttributeOverrideContainer.getVirtualOverridesSize());
-
- virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.name", virtualAttributeOverrides.next().getName());
- assertEquals("state.abbr", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyAndValueElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
- createTestEmbeddablePropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_EMBEDDABLE_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- AttributeOverrideContainer valueAttributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- AttributeOverrideContainer mapKeyAttributeOverrideContainer = elementCollectionMapping.getMapKeyAttributeOverrideContainer();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- valueAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<? extends AttributeOverride> specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertEquals("size", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("size", specifiedOverrides.next().getName());
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
-
- resourceField.moveAnnotation(3, 2, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("value.size", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("value.parcelNumber", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = valueAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("size", specifiedOverrides.next().getName());
- assertEquals("parcelNumber", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.name", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSelfReferentialElementCollection() throws Exception {
- createSelfReferentialElementCollection();
- addXmlClassRef(PACKAGE_NAME + ".Foo");
-
- //If there is a StackOverflowError you will not be able to get the mapping
- JavaElementCollectionMapping2_0 elementCollectionMapping = (JavaElementCollectionMapping2_0) getJavaPersistentType().getAttributeNamed("elementCollection").getMapping();
- assertFalse(elementCollectionMapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
- elementCollectionMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((BaseEnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((BaseEnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- elementCollectionMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseEnumeratedConverter) elementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
- elementCollectionMapping.setMapKeyConverter(BaseTemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((BaseTemporalConverter) elementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((BaseTemporalConverter) elementCollectionMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) elementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseTemporalConverter) elementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-
-
- public void testGetConvert() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, elementCollectionMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithElementCollectionMappingWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, elementCollectionMapping.getConverter().getType());
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, ((EclipseLinkConvert) elementCollectionMapping.getConverter()).getConverterName());
- }
-
- public void testSetConvert() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
- assertNull(elementCollectionMapping.getConverter().getType());
-
- elementCollectionMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) elementCollectionMapping.getConverter()).setSpecifiedConverterName("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation eclipselinkConvert = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
-
- assertEquals("foo", eclipselinkConvert.getValue());
-
- elementCollectionMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithElementCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) persistentAttribute.getMapping();
-
- assertNull(elementCollectionMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, elementCollectionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) elementCollectionMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(elementCollectionMapping.getConverter().getType());
- assertFalse(elementCollectionMapping.isDefault());
- assertSame(elementCollectionMapping, persistentAttribute.getMapping());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java
deleted file mode 100644
index a19846c3e6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaEntityTests.java
+++ /dev/null
@@ -1,1804 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.VirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaEntityTests extends EclipseLink2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public EclipseLink2_0JavaEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
- private void createTestMappedSuperclassCustomerWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEntityLongTimeCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("LongTimeCustomer extends Customer ");
- sb.append("{}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "LongTimeCustomer.java", sourceWriter);
- }
-
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) getJavaPersistentType().getMapping();
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- getJavaEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = getJavaEntity().getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity abstractEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributeNames = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertEquals("foo", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- ListIterator<JavaAttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testDefaultAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- MappedSuperclass mappedSuperclass = (MappedSuperclass) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testDefaultAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AttributeOverrideContainer overrideContainer = javaEntity.getAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- JavaEntity superclass = (JavaEntity) getJavaPersistentType().getMapping();
-
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(4, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> attributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(3, resourceType.getAnnotationsSize(AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("name", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- Iterator<JavaAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("foo", ((AttributeOverrideAnnotation) attributeOverrideResources.next()).getName());
- assertFalse(attributeOverrideResources.hasNext());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrideResources = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrideResources.hasNext());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaAttributeOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- javaAttributeOverrides = resourceType.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("foo", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("name", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- assertEquals("id", ((AttributeOverrideAnnotation) javaAttributeOverrides.next()).getName());
- }
-//
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- AttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AttributeOverrideAnnotation) resourceType.addAnnotation(2, AttributeOverrideAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends AttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- resourceType.removeAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAttributeOverrideContainer overrideContainer = getJavaEntity().getAttributeOverrideContainer();
-
- ListIterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- JavaVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
-
- public void testOverridableAssociations() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-// //TODO add all mapping types to the mapped superclass to test which ones are overridable
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociationNames = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociationNames.next());
- assertEquals("address2", overridableAssociationNames.next());
- assertEquals("address3", overridableAssociationNames.next());
- assertEquals("address4", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociationsMappedSuperclassInOrmXml() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAssociations = getJavaEntity().getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- ListIterator<JavaAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(1, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceType.moveAnnotation(1, 0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- resourceType.removeAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- JavaEntity javaEntity = (JavaEntity) classRefs.next().getJavaPersistentType().getMapping();
- AssociationOverrideContainer overrideContainer = javaEntity.getAssociationOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- VirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-
- //MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
- //BasicMapping idMapping = (BasicMapping) mappedSuperclass.persistentType().attributeNamed("id").getMapping();
- //idMapping.getColumn().setSpecifiedName("FOO");
- //idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- //idMapping.getColumn().setSpecifiedName(null);
- //idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(SUB_TYPE_NAME, resourceType.getName());
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, resourceType.getName());
-//// assertNull(resourceType.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(resourceType.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- //add an annotation to the resource model and verify the context model is updated
- AssociationOverrideAnnotation associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("FOO");
- associationOverride = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- associationOverride.setName("BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testVirtualAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- AssociationOverrideAnnotation annotation = (AssociationOverrideAnnotation) resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- annotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals(5, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- AssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> associationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) associationOverrides.next()).getName());
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
- assertEquals(2, resourceType.getAnnotationsSize(AssociationOverrideAnnotation.ANNOTATION_NAME));
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- Iterator<NestableAnnotation> associationOverrideResources = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("address2", ((AssociationOverrideAnnotation) associationOverrideResources.next()).getName());
- assertFalse(associationOverrideResources.hasNext());
-
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- associationOverrideResources = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(associationOverrideResources.hasNext());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
-
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_SUB_TYPE_NAME, Kind.TYPE);
-
- Iterator<NestableAnnotation> javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals(2, CollectionTools.size(javaAssociationOverrides));
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- javaAssociationOverrides = resourceType.getAnnotations(AssociationOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("address", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- assertEquals("address2", ((AssociationOverrideAnnotation) javaAssociationOverrides.next()).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("FOO");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("BAR");
- ((AssociationOverrideAnnotation) resourceType.addAnnotation(2, AssociationOverrideAnnotation.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- Iterator<JavaAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(2, 0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.moveAnnotation(0, 1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(1, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- resourceType.removeAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaAssociationOverrideContainer overrideContainer = getJavaEntity().getAssociationOverrideContainer();
-
- ListIterator<JavaVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType customerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAttributeOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- PersistentType customerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType addressPersistentType = specifiedClassRefs.next().getJavaPersistentType();
- PersistentType zipCodePersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AttributeOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (VirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testNestedVirtualAssociationOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- addXmlClassRef(PACKAGE_NAME + ".Customer");
- addXmlClassRef(PACKAGE_NAME + ".LongTimeCustomer");
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".ZipCode");
- ListIterator<ClassRef> specifiedClassRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- specifiedClassRefs.next();
- PersistentType longTimeCustomerPersistentType = specifiedClassRefs.next().getJavaPersistentType();
-
- AssociationOverrideContainer attributeOverrideContainer = ((Entity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<? extends VirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- VirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheable.setSpecifiedCacheable(null);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- getJavaPersistentType().getJavaResourceType().addAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(true)", cu);
-
- cacheableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- getJavaPersistentType().getJavaResourceType().removeAnnotation(JPA2_0.CACHEABLE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- PersistenceUnit2_0 persistenceUnit = getPersistenceUnit();
- assertEquals(SharedCacheMode.DISABLE_SELECTIVE, persistenceUnit.getSharedCacheMode());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.UNSPECIFIED);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testInheritedIsDefaultCacheable() throws Exception {
- createTestEntity();
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) getJavaEntity()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaEntity().getParentEntity()).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java
deleted file mode 100644
index 7cb3e5e5e2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToManyMappingTests.java
+++ /dev/null
@@ -1,1411 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.JoinTableRelationshipStrategy;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.PersistentType;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaManyToManyMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaManyToManyMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithJoinFetchManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Integer, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Collection<AnnotationTestType> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private String address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityPropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employees", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertEquals("employees", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", manyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKey(null);
- assertNull(manyToManyMapping.getSpecifiedMapKey());
- mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKey.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames =
- manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employees", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping2_0 = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- manyToManyMapping2_0.setSpecifiedTargetEntity("Address");
- mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employees", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- manyToManyMapping2_0.setSpecifiedTargetEntity("String");
- mapKeyNames = manyToManyMapping2_0.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", manyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- manyToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", manyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- manyToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(manyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", manyToManyMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- manyToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.Integer", manyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.Integer", manyToManyMapping.getMapKeyClass());
-
- manyToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", manyToManyMapping.getMapKeyClass());
-
- manyToManyMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.Integer", manyToManyMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- addXmlClassRef(PACKAGE_NAME + ".PrintQueue");
- addXmlClassRef(PACKAGE_NAME + ".PrintJob");
- JavaPersistentType printQueuePersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintQueue");
- ManyToManyMapping jobsMapping = (ManyToManyMapping) printQueuePersistentType.getAttributeNamed("jobs").getMapping();
- JavaPersistentType printJobPersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ManyToManyMapping queuesMapping = (ManyToManyMapping) printJobPersistentType.getAttributeNamed("queues").getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- OrderColumn2_0 jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(null, jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable()); //the join table name
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- OrderColumn2_0 queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(null, queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- jobsOrderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderColumn.setSpecifiedName("BAR");
- assertEquals("BAR", queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
- assertEquals("MY_TABLE_PrintQueue", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printQueuePersistentType.getMapping()).getTable().setSpecifiedName("OTHER_TABLE");
- assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable());
-
- queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany(mappedBy=\"queues\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintQueue> queues;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testGetMapKeyColumnMappedByStrategy() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
- manyToManyMapping.getRelationship().setStrategyToMappedBy();
- manyToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employees");
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address_" + TYPE_NAME, manyToManyMapping.getMapKeyColumn().getTable());//join table name of owning many-to-many
-
- PersistentType persistentType = getPersistenceUnit().getPersistentType("test.Address");
- ManyToManyMapping owningManyToManyMapping = (ManyToManyMapping) persistentType.getAttributeNamed("employees").getMapping();
- ((JoinTableRelationshipStrategy) owningManyToManyMapping.getRelationship().getStrategy()).getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnJoinTableStrategy() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToManyMapping2_0 manyToManyMapping = (ManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", manyToManyMapping.getMapKeyColumn().getTable());//join table name
-
- manyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", manyToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", manyToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", manyToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testMapKeySpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyManyToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = manyToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
- manyToManyMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((BaseEnumeratedConverter) manyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((BaseEnumeratedConverter) manyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- manyToManyMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) manyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseEnumeratedConverter) manyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(manyToManyMapping.isDefault());
- assertSame(manyToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
- manyToManyMapping.setMapKeyConverter(BaseTemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((BaseTemporalConverter) manyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((BaseTemporalConverter) manyToManyMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapManyToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaManyToManyMapping2_0 manyToManyMapping = (JavaManyToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(manyToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) manyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseTemporalConverter) manyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(manyToManyMapping.isDefault());
- assertSame(manyToManyMapping, persistentAttribute.getMapping());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java
deleted file mode 100644
index 6a2db0f465..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaManyToOneMappingTests.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaManyToOneMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaManyToOneMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestEntity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdDerivedIdentity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- public void testUpdateDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("address");
- JavaManyToOneMapping2_0 contextMapping = (JavaManyToOneMapping2_0) contextAttribute.getMapping();
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
-
- ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertFalse(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertEquals("foo", ((MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID)).getValue());
- assertEquals("foo", ((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- ManyToOneMapping2_0 mapping = (ManyToOneMapping2_0) contextAttribute.getMapping();
- ManyToOneRelationship2_0 rel = (ManyToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java
deleted file mode 100644
index 6dafe46d33..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,529 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.Cacheable2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaMappedSuperclassTests extends EclipseLink2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createTestMappedSuperclassWithReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@ReadOnly").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithConvertAndCustomizerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append(" @Customizer(Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CHANGE_TRACKING);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append(" @ChangeTracking").append(CR);
- }
- });
- }
-
- public EclipseLink2_0JavaMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- public void testGetReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
- }
-
- public void testGetSpecifiedReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- //TODO test inheriting a default readonly from you superclass
- public void testGetDefaultReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(false, readOnly.isDefaultReadOnly());
- }
-
- public void testSetSpecifiedReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
-
- readOnly.setSpecifiedReadOnly(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(null, readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
-
- readOnly.setSpecifiedReadOnly(Boolean.TRUE);
- assertNotNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
- readOnly.setSpecifiedReadOnly(null);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(null, readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
- }
-
- public void testSpecifiedReadOnlyUpdatesFromResourceModelChange() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.removeAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(null, readOnly.getSpecifiedReadOnly());
- assertEquals(false, readOnly.isDefaultReadOnly());
-
- resourceType.addAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- public void testGetCustomizerClass() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping()).getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testSetCustomizerClass() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping()).getCustomizer();
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
- }
-
- public void testGetCustomizerClassUpdatesFromResourceModelChange() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkCustomizer customizer = mappedSuperclass.getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- resourceType.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.addAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation.setValue("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testGetChangeTracking() throws Exception {
- createTestMappedSuperclassWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = mappedSuperclass.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change resource to ATTRIBUTE specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change resource to OBJECT specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change resource to DEFERRED specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change resource to AUTO specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove value from resource, test context
-
- resourceChangeTracking.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove annotation, text context
-
- resourceType.removeAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertNull(contextChangeTracking.getSpecifiedType());
- }
-
- public void testSetChangeTracking() throws Exception {
- createTestMappedSuperclassWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = mappedSuperclass.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to ATTRIBUTE specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change context to OBJECT specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change context to DEFERRED specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME));
- assertNull(contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically (this time from no annotation), test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
- resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
- }
-
-
- public void testSetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaPersistentType().getMapping()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheable.setSpecifiedCacheable(null);
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- ICompilationUnit cu = createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaPersistentType().getMapping()).getCacheable();
- Cacheable2_0Annotation cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
-
- getJavaPersistentType().getJavaResourceType().addAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- cacheableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(false)", cu);
-
- cacheableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable(true)", cu);
-
- cacheableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation.getValue());
- assertSourceContains("@Cacheable", cu);
-
- getJavaPersistentType().getJavaResourceType().removeAnnotation(JPA2_0.CACHEABLE);
- getJpaProject().synchronizeContextModel();
- cacheableAnnotation = (Cacheable2_0Annotation) getJavaPersistentType().getJavaResourceType().getAnnotation(JPA2_0.CACHEABLE);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, cacheableAnnotation);
- assertSourceDoesNotContain("@Cacheable", cu);
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaPersistentType().getMapping()).getCacheable();
- PersistenceUnit2_0 persistenceUnit = getPersistenceUnit();
- assertEquals(SharedCacheMode.DISABLE_SELECTIVE, persistenceUnit.getSharedCacheMode());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit.setSpecifiedSharedCacheMode(SharedCacheMode.UNSPECIFIED);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testInheritedIsDefaultCacheable() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(FULLY_QUALIFIED_SUB_TYPE_NAME);
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) getJavaPersistentType().getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) getJavaPersistentType().getSuperPersistentType().getMapping()).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java
deleted file mode 100644
index 5b9476a095..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToManyMappingTests.java
+++ /dev/null
@@ -1,1531 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinColumnRelationship;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.java.JavaVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.persistence.ClassRef;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyClass2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyEnumerated2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyTemporal2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToMany2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MapKeyAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-/**
- * EclipseLink2_0JavaOneToManyMappingTests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaOneToManyMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaOneToManyMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private AnnotationTestType employee;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private String address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableKeyOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<Address, PropertyInfo> parcels;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityPropertyInfo() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PropertyInfo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private Integer parcelNumber;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private Integer size;").append(CR);
- sb.append(CR);
- sb.append(" private java.math.BigDecimal tax;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PropertyInfo.java", sourceWriter);
- }
- private ICompilationUnit createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(orphanRemoval=false)").append(CR);
- sb.append(" private Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- public void testDefaultOneToManyGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToManyMapping).isDefaultOrphanRemoval());
- }
-
- public void testSpecifiedOneToManyGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToManyMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
-
- assertEquals(false, mappingsOrphanRemoval.isOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(true, mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testSetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_MANY)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
-
- assertEquals(Boolean.TRUE, oneToMany.getOrphanRemoval());
-
- oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_MANY));
-
- oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- }
-
- public void testGetSpecifiedOrphanRemovalUpdatesFromResourceModelChange() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToMany2_0Annotation oneToMany = (OneToMany2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- oneToMany.setOrphanRemoval(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
-
- oneToMany.setOrphanRemoval(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNotNull(mapKey);
-
- //set mapKey name in the resource model, verify context model updated
- mapKey.setName("myMapKey");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey name to null in the resource model
- mapKey.setName(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(mapKey.getName());
-
- mapKey.setName("myMapKey");
- resourceField.removeAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKey() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping oneToManyMapping = (OneToManyMapping) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- assertNull(resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKey("myMapKey");
- MapKeyAnnotation mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertEquals("myMapKey", oneToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", mapKey.getName());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKey(null);
- assertNull(oneToManyMapping.getSpecifiedMapKey());
- mapKey = (MapKeyAnnotation) resourceField.getAnnotation(MapKeyAnnotation.ANNOTATION_NAME);
- assertNull(mapKey.getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employee", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = javaOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertEquals("employee", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the resource model, verify context model does not change
- resourceField.addAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- MapKeyClass2_0Annotation mapKeyClassAnnotation = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertNotNull(mapKeyClassAnnotation);
-
- //set mapKey name in the resource model, verify context model updated
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- this.getJpaProject().synchronizeContextModel();
- assertEquals("myMapKeyClass", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("myMapKeyClass", mapKeyClassAnnotation.getValue());
-
- //set mapKey name to null in the resource model
- mapKeyClassAnnotation.setValue(null);
- this.getJpaProject().synchronizeContextModel();
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(mapKeyClassAnnotation.getValue());
-
- mapKeyClassAnnotation.setValue("myMapKeyClass");
- resourceField.removeAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
-
- //set mapKey in the context model, verify resource model updated
- oneToManyMapping.setSpecifiedMapKeyClass("String");
- MapKeyClass2_0Annotation mapKeyClass = (MapKeyClass2_0Annotation) resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME);
- assertEquals("String", oneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", mapKeyClass.getValue());
-
- //set mapKey to null in the context model
- oneToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(oneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(resourceField.getAnnotation(MapKeyClass2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testDefaultMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.String", oneToManyMapping.getDefaultMapKeyClass());
-
- //test default still the same when specified target entity it set
- oneToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("java.lang.String", oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testDefaultMapKeyClassCollectionType() throws Exception {
- createTestEntityWithValidOneToManyMappingOrphanRemovalSpecified();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testMapKeyClass() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertEquals("java.lang.String", oneToManyMapping.getMapKeyClass());
-
- oneToManyMapping.setSpecifiedMapKeyClass("foo");
- assertEquals("foo", oneToManyMapping.getMapKeyClass());
-
- oneToManyMapping.setSpecifiedMapKeyClass(null);
- assertEquals("java.lang.String", oneToManyMapping.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- addXmlClassRef(PACKAGE_NAME + ".PrintQueue");
- addXmlClassRef(PACKAGE_NAME + ".PrintJob");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) getJavaPersistentType().getAttributeNamed("jobs").getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- JavaPersistentType printJobPersistentType = (JavaPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
-
- assertEquals("MY_TABLE", orderColumn.getTable());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany(mappedBy=\"queue\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private PrintQueue queue;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testGetMapKeyColumnMappedByStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- oneToManyMapping.getRelationship().setStrategyToMappedBy();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("employee");
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//owing entity table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testGetMapKeyColumnJoinTableStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals(TYPE_NAME + "_Address", oneToManyMapping.getMapKeyColumn().getTable());//join table name
-
- oneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_PRIMARY_TABLE");
- assertEquals("MY_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- }
-
- public void testTargetForeignKeyJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- JoinColumn joinColumn = ((JoinColumnRelationship) oneToManyMapping.getRelationship()).getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
-
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("Address", joinColumn.getDefaultTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- joinColumn.setSpecifiedName("FOO");
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
- }
-
- //target foreign key case
- public void testGetMapKeyColumnJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- assertNull(oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", oneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", oneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", oneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", oneToManyMapping.getMapKeyColumn().getDefaultTable());
- }
-
- //target foreign key case
- public void testOrderColumnDefaultsJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 oneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- ((JoinColumnRelationship) oneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- ((Orderable2_0) oneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = ((Orderable2_0) oneToManyMapping.getOrderable()).getOrderColumn();
-
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("Address", orderColumn.getTable());//target table name
-
- Entity addressEntity = getPersistenceUnit().getEntity("test.Address");
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToManyMapping2_0 mapping = (OneToManyMapping2_0) contextAttribute.getMapping();
- OneToManyRelationship2_0 rel = (OneToManyRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testMapKeySpecifiedAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
-
- ListIterator<JavaAttributeOverride> specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.BAR");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAZ");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BLAH");
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- resourceField.moveAnnotation(1, 0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(1, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BLAH", specifiedMapKeyAttributeOverrides.next().getName());
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("value.BAR", specifiedMapKeyAttributeOverrides.next().getName());
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
-
- resourceField.removeAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- getJpaProject().synchronizeContextModel();
- specifiedMapKeyAttributeOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedMapKeyAttributeOverrides.hasNext());
- }
-
- public void testMapKeyValueVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- ReadOnlyAttributeOverride defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
-
- ListIterator<ClassRef> classRefs = getPersistenceUnit().getSpecifiedClassRefs().iterator();
- classRefs.next();
- Embeddable addressEmbeddable = (Embeddable) classRefs.next().getJavaPersistentType().getMapping();
-
- BasicMapping cityMapping = (BasicMapping) addressEmbeddable.getPersistentType().getAttributeNamed("city").getMapping();
- cityMapping.getColumn().setSpecifiedName("FOO");
- cityMapping.getColumn().setSpecifiedTable("BAR");
- cityMapping.getColumn().setColumnDefinition("COLUMN_DEF");
- cityMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- cityMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- cityMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- cityMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- cityMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- assertEquals("parcels", resourceField.getName());
- assertNull(resourceField.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("FOO", defaultAttributeOverride.getColumn().getName());
- assertEquals("BAR", defaultAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEF", defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(false, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(5, defaultAttributeOverride.getColumn().getLength());
- assertEquals(6, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(7, defaultAttributeOverride.getColumn().getScale());
-
- cityMapping.getColumn().setSpecifiedName(null);
- cityMapping.getColumn().setSpecifiedTable(null);
- cityMapping.getColumn().setColumnDefinition(null);
- cityMapping.getColumn().setSpecifiedInsertable(null);
- cityMapping.getColumn().setSpecifiedUpdatable(null);
- cityMapping.getColumn().setSpecifiedUnique(null);
- cityMapping.getColumn().setSpecifiedNullable(null);
- cityMapping.getColumn().setSpecifiedLength(null);
- cityMapping.getColumn().setSpecifiedPrecision(null);
- cityMapping.getColumn().setSpecifiedScale(null);
- defaultAttributeOverride = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("city", defaultAttributeOverride.getName());
- assertEquals("city", defaultAttributeOverride.getColumn().getName());
- assertEquals(TYPE_NAME +"_PropertyInfo", defaultAttributeOverride.getColumn().getTable());
- assertEquals(null, defaultAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, defaultAttributeOverride.getColumn().isInsertable());
- assertEquals(true, defaultAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, defaultAttributeOverride.getColumn().isUnique());
- assertEquals(true, defaultAttributeOverride.getColumn().isNullable());
- assertEquals(255, defaultAttributeOverride.getColumn().getLength());
- assertEquals(0, defaultAttributeOverride.getColumn().getPrecision());
- assertEquals(0, defaultAttributeOverride.getColumn().getScale());
-
- AttributeOverrideAnnotation annotation = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- annotation.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(0, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(3, mapKeyAttributeOverrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("value.FOO2");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("city");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- getJpaProject().synchronizeContextModel();
- assertEquals(7, mapKeyAttributeOverrideContainer.getOverridesSize());
- }
-
- public void testMapKeyValueVirtualAttributeOverridesSize() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- //add an annotation to the resource model and verify the context model is updated
- AttributeOverrideAnnotation attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("FOO");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.BAR");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.city");
- getJpaProject().synchronizeContextModel();
- assertEquals(3, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
-
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("key.state.foo");
- attributeOverride = (AttributeOverrideAnnotation) resourceField.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- attributeOverride.setName("size");
- getJpaProject().synchronizeContextModel();
- assertEquals(2, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
- public void testMapKeyValueAttributeOverrideSetVirtual() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
- assertFalse(attributeOverrides.hasNext());
-
- Iterator<JavaVirtualAttributeOverride> virtualAttributeOverrides = mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator();
- assertEquals("city", virtualAttributeOverrides.next().getName());
- assertEquals("state.foo", virtualAttributeOverrides.next().getName());
- assertEquals("state.address", virtualAttributeOverrides.next().getName());
- assertEquals("zip", virtualAttributeOverrides.next().getName());
- assertEquals(4, mapKeyAttributeOverrideContainer.getVirtualOverridesSize());
- }
-
-
- public void testMapKeyValueMoveSpecifiedAttributeOverride() throws Exception {
- createTestEntityWithEmbeddableKeyOneToManyMapping();
- createTestEmbeddableAddress();
- createTestEmbeddableState();
- createTestEntityPropertyInfo();
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".PropertyInfo");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) getJavaPersistentType().getAttributeNamed("parcels").getMapping();
- JavaAttributeOverrideContainer mapKeyAttributeOverrideContainer = oneToManyMapping.getMapKeyAttributeOverrideContainer();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- mapKeyAttributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- ListIterator<JavaAttributeOverride> specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("city", specifiedOverrides.next().getName());
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
-
- resourceField.moveAnnotation(1, 0, AttributeOverrideAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- Iterator<NestableAnnotation> attributeOverrides = resourceField.getAnnotations(AttributeOverrideAnnotation.ANNOTATION_NAME).iterator();
-
- assertEquals("key.state.foo", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertEquals("key.city", ((AttributeOverrideAnnotation) attributeOverrides.next()).getName());
- assertFalse(attributeOverrides.hasNext());
-
- specifiedOverrides = mapKeyAttributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("state.foo", specifiedOverrides.next().getName());
- assertEquals("city", specifiedOverrides.next().getName());
- assertFalse(specifiedOverrides.hasNext());
- }
-
- public void testSetSpecifiedMapKeyEnumerated() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
- oneToManyMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(enumerated);
- assertEquals(null, enumerated.getValue());
-
- ((BaseEnumeratedConverter) oneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING, enumerated.getValue());
-
- ((BaseEnumeratedConverter) oneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(null);
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(enumerated.getValue());
-
- oneToManyMapping.setMapKeyConverter(null);
- assertNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetSpecifiedMapKeyEnumeratedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyEnumerated2_0Annotation enumerated = (MapKeyEnumerated2_0Annotation) resourceField.addAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME);
- enumerated.setValue(org.eclipse.jpt.jpa.core.resource.java.EnumType.STRING);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) oneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- enumerated.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyEnumerated2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseEnumeratedConverter) oneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertFalse(oneToManyMapping.isDefault());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
- }
-
- public void testSetMapKeyTemporal() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
- oneToManyMapping.setMapKeyConverter(BaseTemporalConverter.class);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
-
- assertNotNull(temporal);
- assertEquals(null, temporal.getValue());
-
- ((BaseTemporalConverter) oneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- ((BaseTemporalConverter) oneToManyMapping.getMapKeyConverter()).setTemporalType(null);
- assertNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- }
-
- public void testGetMapKeyTemporalUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaOneToManyMapping2_0 oneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getMapping();
-
- assertNull(oneToManyMapping.getMapKeyConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyTemporal2_0Annotation temporal = (MapKeyTemporal2_0Annotation) resourceField.addAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME);
- temporal.setValue(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) oneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- temporal.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(MapKeyTemporal2_0Annotation.ANNOTATION_NAME));
- assertNull(((BaseTemporalConverter) oneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertFalse(oneToManyMapping.isDefault());
- assertSame(oneToManyMapping, persistentAttribute.getMapping());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java
deleted file mode 100644
index 430e82d192..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_0JavaOneToOneMappingTests.java
+++ /dev/null
@@ -1,814 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapsId2_0Annotation;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.OneToOne2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0JavaOneToOneMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0JavaOneToOneMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestEntity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestEntityWithValidOneToOneMappingOrphanRemovalSpecified() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- sb.append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(orphanRemoval=false)");
- sb.append(CR);
- sb.append(" private Address address;");
- sb.append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithIdDerivedIdentity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- public void testUpdateDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.removeAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceField.addAnnotation(JPA.ID);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- annotation.setValue("foo");
- getJpaProject().synchronizeContextModel();
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- annotation.setValue("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceField.removeAnnotation(JPA2_0.MAPS_ID);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("address");
- JavaOneToOneMapping2_0 contextMapping = (JavaOneToOneMapping2_0) contextAttribute.getMapping();
-
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- MapsId2_0Annotation annotation =
- (MapsId2_0Annotation) resourceField.getAnnotation(JPA2_0.MAPS_ID);
- assertNotNull(annotation);
- assertEquals("foo", annotation.getValue());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", annotation.getValue());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNotNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- JavaPersistentType contextType = getJavaPersistentType();
- JavaPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
-
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertTrue(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertNull(((JavaManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- // this is no longer supported (it was a bit of a testing hack anyway...)
- // contextAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- // the *real* test is whether the Id annotation still results in a 1:1 mapping...
- contextAttribute.setMappingKey(null); // clear any mapping annotation
- resourceField.addAnnotation(JPA.ID); // add Id annotation
- this.getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaOneToOneMapping2_0);
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertNotNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaManyToOneMapping2_0);
-
- contextAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertNull(resourceField.getAnnotation(JPA.ID));
- assertNull(resourceField.getAnnotation(JPA2_0.MAPS_ID));
- assertTrue(contextAttribute.getMapping() instanceof JavaBasicMapping);
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- PersistentAttribute persistentAttribute = (getJavaPersistentType()).getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- private JavaOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((JavaOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- public void testDefaultOneToOneGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToOneMapping).isDefaultOrphanRemoval());
- }
-
- public void testSpecifiedOneToOneGetDefaultOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- assertEquals(false, this.getOrphanRemovalOf(oneToOneMapping).isDefaultOrphanRemoval());
- }
-
- public void testGetOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertEquals(false, mappingsOrphanRemoval.isOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(true, mappingsOrphanRemoval.isOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testGetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntityWithValidOneToOneMappingOrphanRemovalSpecified();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
-
- assertEquals(Boolean.FALSE, this.getOrphanRemovalOf(oneToOneMapping).getSpecifiedOrphanRemoval());
- }
-
- public void testSetSpecifiedOrphanRemoval() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
-
- assertEquals(Boolean.TRUE, oneToOne.getOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_ONE)); // .getElement);
- }
-
- public void testSetSpecifiedOrphanRemoval2() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
-
- assertEquals(Boolean.TRUE, oneToOne.getOrphanRemoval());
-
- oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(null);
- assertNotNull(resourceField.getAnnotation(JPA.ONE_TO_ONE));
- }
-
- public void testGetSpecifiedOrphanRemovalUpdatesFromResourceModelChange() throws Exception {
- this.createTestEntity();
- this.addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 oneToOneMapping = (OneToOneMapping2_0) persistentAttribute.getMapping();
- JavaOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToOneMapping);
-
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOne2_0Annotation oneToOne = (OneToOne2_0Annotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- oneToOne.setOrphanRemoval(null);
- getJpaProject().synchronizeContextModel();
- assertNull(mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertSame(oneToOneMapping, persistentAttribute.getMapping());
-
- oneToOne.setOrphanRemoval(Boolean.FALSE);
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- getJpaProject().synchronizeContextModel();
-
- assertTrue(persistentAttribute.getMapping().isDefault());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation = (OneToOneAnnotation) resourceField.getAnnotation(JPA.ONE_TO_ONE);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- OneToOneMapping2_0 mapping = (OneToOneMapping2_0) contextAttribute.getMapping();
- OneToOneRelationship2_0 rel = (OneToOneRelationship2_0) mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNotNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(0, JPA.PRIMARY_KEY_JOIN_COLUMN));
- assertNull(annotation.getMappedBy());
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_2JavaEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_2JavaEntityTests.java
deleted file mode 100644
index 645d6696e6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_2JavaEntityTests.java
+++ /dev/null
@@ -1,175 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.MappedSuperclass;
-import org.eclipse.jpt.jpa.core.resource.java.AssociationOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.AttributeOverrideAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorValueAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.EntityAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.InheritanceAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.NamedNativeQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.NamedQueryAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.PrimaryKeyJoinColumnAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SecondaryTableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.SequenceGeneratorAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.TableGeneratorAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_2ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_2JavaEntityTests extends EclipseLink2_2ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public EclipseLink2_2JavaEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- public void testMorphToMappedSuperclass() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.getGeneratorContainer().addTableGenerator();
- entity.getGeneratorContainer().addSequenceGenerator();
- entity.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- entity.getQueryContainer().addNamedNativeQuery(0);
- entity.getQueryContainer().addNamedQuery(0);
- entity.getConverterContainer().addCustomConverter(0);
- entity.getConverterContainer().addCustomConverter(1);
- entity.getConverterContainer().addObjectTypeConverter(0);
- entity.getConverterContainer().addObjectTypeConverter(1);
- entity.getConverterContainer().addTypeConverter(0);
- entity.getConverterContainer().addTypeConverter(1);
- entity.getConverterContainer().addStructConverter(0);
- entity.getConverterContainer().addStructConverter(1);
-
- getJavaPersistentType().setMappingKey(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof MappedSuperclass);
-
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddable() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- entity.getTable().setSpecifiedName("FOO");
- entity.addSpecifiedSecondaryTable(0);
- entity.addSpecifiedPrimaryKeyJoinColumn(0);
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(0, JPA.ATTRIBUTE_OVERRIDE);
- resourceType.addAnnotation(0, JPA.ASSOCIATION_OVERRIDE);
- entity.setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- entity.setSpecifiedDiscriminatorValue("asdf");
- entity.getDiscriminatorColumn().setSpecifiedName("BAR");
- entity.getGeneratorContainer().addTableGenerator();
- entity.getGeneratorContainer().addSequenceGenerator();
- entity.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- entity.getQueryContainer().addNamedNativeQuery(0);
- entity.getQueryContainer().addNamedQuery(0);
- entity.getConverterContainer().addCustomConverter(0);
- entity.getConverterContainer().addCustomConverter(1);
- entity.getConverterContainer().addObjectTypeConverter(0);
- entity.getConverterContainer().addObjectTypeConverter(1);
- entity.getConverterContainer().addTypeConverter(0);
- entity.getConverterContainer().addTypeConverter(1);
- entity.getConverterContainer().addStructConverter(0);
- entity.getConverterContainer().addStructConverter(1);
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable);
-
- assertNull(resourceType.getAnnotation(EntityAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, SecondaryTableAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, PrimaryKeyJoinColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AttributeOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, AssociationOverrideAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(InheritanceAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorValueAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(DiscriminatorColumnAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(TableGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(SequenceGeneratorAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedQueryAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, NamedNativeQueryAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_2JavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_2JavaMappedSuperclassTests.java
deleted file mode 100644
index 509c2bc8a2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_2JavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Embeddable;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.internal.context.java.JavaNullTypeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.IdClassAnnotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.MappedSuperclassAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_2ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_2JavaMappedSuperclassTests extends EclipseLink2_2ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
-
- public EclipseLink2_2JavaMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- public void testMorphToEntity() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- mappedSuperclass.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- mappedSuperclass.getConverterContainer().addCustomConverter(0);
- mappedSuperclass.getConverterContainer().addCustomConverter(1);
- mappedSuperclass.getConverterContainer().addObjectTypeConverter(0);
- mappedSuperclass.getConverterContainer().addObjectTypeConverter(1);
- mappedSuperclass.getConverterContainer().addTypeConverter(0);
- mappedSuperclass.getConverterContainer().addTypeConverter(1);
- mappedSuperclass.getConverterContainer().addStructConverter(0);
- mappedSuperclass.getConverterContainer().addStructConverter(1);
-
- getJavaPersistentType().setMappingKey(MappingKeys.ENTITY_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Entity);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToEmbeddable() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- mappedSuperclass.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- mappedSuperclass.getConverterContainer().addCustomConverter(0);
- mappedSuperclass.getConverterContainer().addCustomConverter(1);
- mappedSuperclass.getConverterContainer().addObjectTypeConverter(0);
- mappedSuperclass.getConverterContainer().addObjectTypeConverter(1);
- mappedSuperclass.getConverterContainer().addTypeConverter(0);
- mappedSuperclass.getConverterContainer().addTypeConverter(1);
- mappedSuperclass.getConverterContainer().addStructConverter(0);
- mappedSuperclass.getConverterContainer().addStructConverter(1);
-
- getJavaPersistentType().setMappingKey(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof Embeddable);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME));
- assertNotNull(resourceType.getAnnotation(1, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME));
- }
-
- public void testMorphToNull() throws Exception {
- createTestMappedSuperclass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- mappedSuperclass.getIdClassReference().setSpecifiedIdClassName("myIdClass");
- mappedSuperclass.getConverterContainer().addCustomConverter(0);
- mappedSuperclass.getConverterContainer().addCustomConverter(1);
- mappedSuperclass.getConverterContainer().addObjectTypeConverter(0);
- mappedSuperclass.getConverterContainer().addObjectTypeConverter(1);
- mappedSuperclass.getConverterContainer().addTypeConverter(0);
- mappedSuperclass.getConverterContainer().addTypeConverter(1);
- mappedSuperclass.getConverterContainer().addStructConverter(0);
- mappedSuperclass.getConverterContainer().addStructConverter(1);
-
- getJavaPersistentType().setMappingKey(MappingKeys.NULL_TYPE_MAPPING_KEY);
- assertTrue(getJavaPersistentType().getMapping() instanceof JavaNullTypeMapping);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(MappedSuperclassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(IdClassAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME));
- assertNull(resourceType.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_3JavaMultitenancyTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_3JavaMultitenancyTests.java
deleted file mode 100644
index 4614fb2a29..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLink2_3JavaMultitenancyTests.java
+++ /dev/null
@@ -1,631 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.NestableAnnotation;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_3ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_3JavaMultitenancyTests extends EclipseLink2_3ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public EclipseLink2_3JavaMultitenancyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMultitenant() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.MULTITENANT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Multitenant");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTenantDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.MULTITENANT, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithTenantDiscriminatorColumns() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.MULTITENANT, EclipseLink.TENANT_DISCRIMINATOR_COLUMN, EclipseLink.TENANT_DISCRIMINATOR_COLUMNS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@TenantDiscriminatorColumns({@TenantDiscriminatorColumn(name=\"foo\"), @TenantDiscriminatorColumn(name=\"bar\")})");
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.MAPPED_SUPERCLASS,
- EclipseLink.MULTITENANT,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@Multitenant").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"MS_TENANT_ID\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantRootEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.ENTITY,
- JPA.INHERITANCE,
- EclipseLink.MULTITENANT,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritenace").append(CR);
- sb.append("@Multitenant").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"ROOT_ENTITY_TENANT_ID\")").append(CR);
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public JavaEclipseLinkMultitenancy2_3 getJavaMultitenancy() {
- return getJavaEntity().getMultitenancy();
- }
-
- public void testGetTypeNull() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaMultitenancy().getType());
- }
-
- public void testGetType() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, getJavaMultitenancy().getType());
- }
-
- public void testGetSpecifiedType() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(null, getJavaMultitenancy().getSpecifiedType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
-
- multitenant.setValue(MultitenantType2_3.SINGLE_TABLE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, getJavaMultitenancy().getSpecifiedType());
-
- multitenant.setValue(MultitenantType2_3.TABLE_PER_TENANT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT, getJavaMultitenancy().getSpecifiedType());
-
- multitenant.setValue(MultitenantType2_3.VPD);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkMultitenantType2_3.VPD, getJavaMultitenancy().getSpecifiedType());
-
- multitenant.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaMultitenancy().getSpecifiedType());
- }
-
- public void testSetSpecifiedType() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- assertEquals(null, getJavaMultitenancy().getSpecifiedType());
-
- getJavaMultitenancy().setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
-
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, getJavaMultitenancy().getSpecifiedType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
- assertEquals(MultitenantType2_3.SINGLE_TABLE, multitenant.getValue());
-
-
- getJavaMultitenancy().setSpecifiedType(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT);
-
- assertEquals(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT, getJavaMultitenancy().getSpecifiedType());
- assertEquals(MultitenantType2_3.TABLE_PER_TENANT, multitenant.getValue());
-
- getJavaMultitenancy().setSpecifiedType(EclipseLinkMultitenantType2_3.VPD);
-
- assertEquals(EclipseLinkMultitenantType2_3.VPD, getJavaMultitenancy().getSpecifiedType());
- assertEquals(MultitenantType2_3.VPD, multitenant.getValue());
- }
-
- public void testIsIncludeCriteria() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(true, getJavaMultitenancy().isIncludeCriteria());
-
- getJavaMultitenancy().setSpecifiedIncludeCriteria(Boolean.FALSE);
- assertEquals(false, getJavaMultitenancy().isIncludeCriteria());
- }
-
- public void testGetSpecifiedIncludeCriteria() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaMultitenancy().getSpecifiedIncludeCriteria());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
- multitenant.setIncludeCriteria(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, getJavaMultitenancy().getSpecifiedIncludeCriteria());
-
- multitenant.setIncludeCriteria(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, getJavaMultitenancy().getSpecifiedIncludeCriteria());
-
- multitenant.setIncludeCriteria(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(getJavaMultitenancy().getSpecifiedIncludeCriteria());
- multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
- assertNotNull(multitenant);
- }
-
- public void testSetSpecifiedIncludeCriteria() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- assertNull(getJavaMultitenancy().getSpecifiedIncludeCriteria());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
-
- assertNull(multitenant.getIncludeCriteria());
-
- getJavaMultitenancy().setSpecifiedIncludeCriteria(Boolean.TRUE);
- assertEquals(Boolean.TRUE, multitenant.getIncludeCriteria());
-
- getJavaMultitenancy().setSpecifiedIncludeCriteria(null);
- multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLinkMultitenantAnnotation2_3.ANNOTATION_NAME);
- assertNull(multitenant.getIncludeCriteria());
- assertNull(getJavaMultitenancy().getSpecifiedIncludeCriteria());
- }
-
- public void testSpecifiedTenantDiscriminatorColumn() throws Exception {
- createTestEntityWithTenantDiscriminatorColumn();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaTenantDiscriminatorColumn2_3> tenandDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
-
- assertTrue(tenandDiscriminatorColumns.hasNext());
- assertEquals("foo", tenandDiscriminatorColumns.next().getName());
- assertFalse(tenandDiscriminatorColumns.hasNext());
- }
-
- public void testSpecifiedTenantDiscriminatorColumnsSize() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 javaMultitenancy = getJavaMultitenancy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(0, javaMultitenancy.getSpecifiedTenantDiscriminatorColumnsSize());
-
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(0, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("FOO");
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("BAR");
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(2, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("BAZ");
-
- getJpaProject().synchronizeContextModel();
- assertEquals(3, javaMultitenancy.getSpecifiedTenantDiscriminatorColumnsSize());
- }
-
- public void testSpecifiedTenantDiscriminatorColumns() throws Exception {
- createTestEntityWithTenantDiscriminatorColumns();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- ListIterator<JavaTenantDiscriminatorColumn2_3> tenandDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
-
- assertTrue(tenandDiscriminatorColumns.hasNext());
- assertEquals("foo", tenandDiscriminatorColumns.next().getName());
- assertEquals("bar", tenandDiscriminatorColumns.next().getName());
- assertFalse(tenandDiscriminatorColumns.hasNext());
- }
-
- public void testAddSpecifiedTenantDiscriminatorColumn() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("BAR");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> tenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertEquals("BAR", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
- }
-
- public void testAddSpecifiedTenantDiscriminatorColumn2() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- Iterator<NestableAnnotation> tenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
-
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertEquals("BAR", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumns.next()).getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
- }
-
- public void testRemoveSpecifiedTenantDiscriminatorColumn() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- getJavaMultitenancy().addSpecifiedTenantDiscriminatorColumn(2).setSpecifiedName("BAZ");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(3, resourceType.getAnnotationsSize(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME));
-
- getJavaMultitenancy().removeSpecifiedTenantDiscriminatorColumn(1);
-
- Iterator<NestableAnnotation> tenantDiscriminatorColumnAnnotations = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumnAnnotations.next()).getName());
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumnAnnotations.next()).getName());
- assertFalse(tenantDiscriminatorColumnAnnotations.hasNext());
-
- Iterator<JavaTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
-
- getJavaMultitenancy().removeSpecifiedTenantDiscriminatorColumn(1);
- tenantDiscriminatorColumnAnnotations = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) tenantDiscriminatorColumnAnnotations.next()).getName());
- assertFalse(tenantDiscriminatorColumnAnnotations.hasNext());
-
- tenantDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
-
- getJavaMultitenancy().removeSpecifiedTenantDiscriminatorColumn(0);
- tenantDiscriminatorColumnAnnotations = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertFalse(tenantDiscriminatorColumnAnnotations.hasNext());
- tenantDiscriminatorColumns = getJavaMultitenancy().getSpecifiedTenantDiscriminatorColumns().iterator();
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- assertNull(resourceType.getAnnotation(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME));
- }
-
- public void testMoveSpecifiedTenantDiscriminatorColumn() throws Exception {
- createTestEntityWithMultitenant();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 javaMultitenancy = getJavaMultitenancy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- javaMultitenancy.addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- javaMultitenancy.addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- javaMultitenancy.addSpecifiedTenantDiscriminatorColumn(2).setSpecifiedName("BAZ");
-
- Iterator<NestableAnnotation> javaTenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals(3, CollectionTools.size(javaTenantDiscriminatorColumns));
-
-
- javaMultitenancy.moveSpecifiedTenantDiscriminatorColumn(2, 0);
- ListIterator<JavaTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getSpecifiedName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getSpecifiedName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getSpecifiedName());
-
- javaTenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals("BAR", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
-
-
- javaMultitenancy.moveSpecifiedTenantDiscriminatorColumn(0, 1);
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getSpecifiedName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getSpecifiedName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getSpecifiedName());
-
- javaTenantDiscriminatorColumns = resourceType.getAnnotations(EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME).iterator();
- assertEquals("BAZ", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- assertEquals("BAR", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- assertEquals("FOO", ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) javaTenantDiscriminatorColumns.next()).getName());
- }
-
- public void testUpdateSpecifiedTenantDiscriminatorColumns() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 javaMultitenancy = getJavaMultitenancy();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(0, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("FOO");
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("BAR");
- ((EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.addAnnotation(2, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME)).setName("BAZ");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<JavaTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.moveAnnotation(2, 0, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.moveAnnotation(0, 1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.removeAnnotation(1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.removeAnnotation(1, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- resourceType.removeAnnotation(0, EclipseLinkTenantDiscriminatorColumnAnnotation2_3.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- tenantDiscriminatorColumns = javaMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertFalse(tenantDiscriminatorColumns.hasNext());
- }
-
- //MappedSuperclass specifies multitenancy, all subclass entities are multitenant by default.
- public void testTenantDiscriminatorColumnsWithMappedSuperclass() throws Exception {
- createTestMultitenantMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 multitenancy = getJavaMultitenancy();
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("MS_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if the java entity specifies multitenant, then it does not get the tenant discriminator columns from the mapped superclass
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- //Root entity specifies multitenancy and SINGLE_TABLE inheritance, all subclass entities are multitenant by default.
- public void testTenantDiscriminatorColumnsWithInheritance() throws Exception {
- createTestMultitenantRootEntity();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMultitenancy2_3 multitenancy = getJavaMultitenancy();
- assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- getJavaEntity().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- getJavaEntity().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertFalse(multitenancy.isMultitenant()); //not multitenant since inheritance strategy is table per class
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
- assertFalse(multitenancy.isMultitenant()); //not multitenant since inheritance strategy is table per class
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //get the default tenant discriminator column from the persistence unit defaults instead of the root entity since inheritance strategy is table per class
- multitenancy.setSpecifiedMultitenant(true);
- assertTrue(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- multitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("CHILD_TENANT_ID");
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- getJavaEntity().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- public void testTenantDiscriminatorColumnsWithPersistenceUnitDefaults() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
-
- JavaEclipseLinkMultitenancy2_3 multitenancy = getJavaMultitenancy();
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if there are specified tenant discriminator columns then there should not be any default ones
- multitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("ENTITY_TENANT_ID");
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals(0, multitenancy.getDefaultTenantDiscriminatorColumnsSize());
- assertEquals("ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if java entity is not multitenant than there are no tenant discriminator columns
- getJavaMultitenancy().setSpecifiedMultitenant(false);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
- }
-
- public void testTenantDiscriminatorColumnsWithEntityMappingsDefaults() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntityMappings entityMappings = (EclipseLinkEntityMappings) getMappingFile().getRoot();
- entityMappings.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("EM_TENANT_ID");
-
- JavaEclipseLinkMultitenancy2_3 multitenancy = getJavaMultitenancy();
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //entity is not listed in the orm.xml file, so does not get default from entity mappings
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- OrmPersistentType persistentType = entityMappings.addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- multitenancy = ((JavaEclipseLinkEntity) persistentType.getJavaPersistentType().getMapping()).getMultitenancy();
-
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if java entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //if java entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedMultitenant(false);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- entityMappings.removePersistentType(0);
- multitenancy = getJavaMultitenancy();
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java
deleted file mode 100644
index 04ca5994bb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaBasicMappingTests.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaBasicMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableBasic() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.MUTABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append("@Mutable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableBasicDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public EclipseLinkJavaBasicMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetConvert() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, basicMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, basicMapping.getConverter().getType());
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, ((EclipseLinkConvert) basicMapping.getConverter()).getConverterName());
- }
-
- public void testSetConvert() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- assertNull(basicMapping.getConverter().getType());
-
- basicMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) basicMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- basicMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, basicMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) basicMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getConverter().getType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
- }
-
- public void testGetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- mutableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, mutable.getSpecifiedMutable());
-
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, mutable.getSpecifiedMutable());
-
- resourceField.addAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
- }
-
- public void testSetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(null);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation);
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
- }
-
- public void testIsDefaultMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertTrue(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
- }
-
- public void testIsDefaultMutableForDate() throws Exception {
- createTestEntityWithMutableBasicDate();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertFalse(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertFalse(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertFalse(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.TRUE);
- assertTrue(mutable.isDefaultMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertFalse(mutable.isDefaultMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(null);
- assertFalse(mutable.isDefaultMutable());
- }
-
- public void testIsMutable() throws Exception {
- createTestEntityWithMutableBasic();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkBasicMapping basicMapping = (EclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = basicMapping.getMutable();
- assertTrue(mutable.isMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertTrue(mutable.isMutable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java
deleted file mode 100644
index bad747da6c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaCachingTests.java
+++ /dev/null
@@ -1,742 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaCachingTests extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkJavaCachingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- public void testSetSpecifiedShared() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(true, caching.isShared());
-
- caching.setSpecifiedShared(Boolean.FALSE);
-
-
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedShared());
- assertEquals(false, entity.getCaching().isShared());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.FALSE, cacheAnnotation.getShared());
- }
-
- public void testSetSpecifiedSharedFalseUnsetsOtherCacheSettings() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- caching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- caching.setSpecifiedSize(Integer.valueOf(500));
- caching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
- caching.setSpecifiedRefreshOnlyIfNewer(Boolean.FALSE);
- caching.setSpecifiedDisableHits(Boolean.FALSE);
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- caching.setExistenceChecking(true);
- caching.setSpecifiedExistenceType(EclipseLinkExistenceType.CHECK_CACHE);
- caching.setExpiry(Integer.valueOf(8000));
-
- caching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(null, caching.getSpecifiedType());
- assertEquals(null, caching.getSpecifiedSize());
- assertEquals(null, caching.getSpecifiedAlwaysRefresh());
- assertEquals(null, caching.getSpecifiedRefreshOnlyIfNewer());
- assertEquals(null, caching.getSpecifiedDisableHits());
- assertEquals(null, caching.getSpecifiedCoordinationType());
- assertEquals(null, caching.getExpiry());
-
-
- //existence checking is the only thing that isn't unset when shared is set to false
- assertTrue(caching.isExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_CACHE, caching.getSpecifiedExistenceType());
-
- caching.setSpecifiedShared(null);
- EclipseLinkTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
- timeOfDayExpiry.setHour(Integer.valueOf(5));
-
- caching.setSpecifiedShared(Boolean.FALSE);
- assertNull(caching.getExpiryTimeOfDay());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.FALSE, cacheAnnotation.getShared());
- assertNull(cacheAnnotation.getExpiryTimeOfDay());
- }
-
- public void testGetDefaultShared() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertTrue(caching.isDefaultShared());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT, "false");
-
- assertFalse(caching.isDefaultShared());
- }
-
- public void testGetSpecifiedShared() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(true, caching.isShared());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setShared(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.FALSE, cacheAnnotation.getShared());
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedShared());
- assertEquals(false, entity.getCaching().isShared());
- }
-
- public void testSetSpecifiedType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
-
- caching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
-
-
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getSpecifiedType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.HARD_WEAK, cacheAnnotation.getType());
-
-
- //set specified type to the same as the default, verify it is not set to default
- caching.setSpecifiedType(EclipseLinkCacheType.SOFT_WEAK);
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getSpecifiedType());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.SOFT_WEAK, cacheAnnotation.getType());
-
- caching.setSpecifiedType(null);
- assertNull(caching.getSpecifiedType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
- }
-
- public void testGetDefaultType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getDefaultType());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT, EclipseLinkCacheType.FULL.toString());
-
- assertEquals(EclipseLinkCacheType.FULL, caching.getDefaultType());
- }
-
- public void testGetSpecifiedType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setType(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.HARD_WEAK);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType.HARD_WEAK, cacheAnnotation.getType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getSpecifiedType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getType());
- }
-
- public void testSetSpecifiedAlwaysRefresh() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isAlwaysRefresh());
-
- caching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
-
-
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedAlwaysRefresh());
- assertEquals(false, entity.getCaching().isAlwaysRefresh());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.FALSE, cacheAnnotation.getAlwaysRefresh());
- }
-
- public void testGetSpecifiedAlwaysRefresh() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isAlwaysRefresh());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setAlwaysRefresh(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getAlwaysRefresh());
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedAlwaysRefresh());
- assertEquals(true, entity.getCaching().isAlwaysRefresh());
- }
-
- public void testSetSpecifiedRefreshOnlyIfNewer() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isRefreshOnlyIfNewer());
-
- caching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
-
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedRefreshOnlyIfNewer());
- assertEquals(true, entity.getCaching().isRefreshOnlyIfNewer());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getRefreshOnlyIfNewer());
- }
-
- public void testGetSpecifiedRefreshOnlyIfNewer() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isRefreshOnlyIfNewer());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setRefreshOnlyIfNewer(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedRefreshOnlyIfNewer());
- assertEquals(true, entity.getCaching().isRefreshOnlyIfNewer());
- }
-
- public void testSetSpecifiedDisableHits() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isDisableHits());
-
- caching.setSpecifiedDisableHits(Boolean.TRUE);
-
-
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedDisableHits());
- assertEquals(true, entity.getCaching().isDisableHits());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getDisableHits());
- }
-
- public void testGetSpecifiedDisableHits() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isDisableHits());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setDisableHits(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, cacheAnnotation.getDisableHits());
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedDisableHits());
- assertEquals(true, entity.getCaching().isDisableHits());
- }
-
- public void testSetSpecifiedCoordinationType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
-
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
-
-
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getCoordinationType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, cacheAnnotation.getCoordinationType());
-
-
- //set specified coordination type to the same as the default, verify it is not set to default
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES);
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getSpecifiedCoordinationType());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.SEND_OBJECT_CHANGES, cacheAnnotation.getCoordinationType());
-
- caching.setSpecifiedCoordinationType(null);
- assertNull(caching.getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
- }
-
- public void testGetSpecifiedCoordinationType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setCoordinationType(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, cacheAnnotation.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getCoordinationType());
- }
-
- public void testHasExistenceChecking() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isExistenceChecking());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.addAnnotation(EclipseLink.EXISTENCE_CHECKING);
- getJpaProject().synchronizeContextModel();
- assertEquals(true, caching.isExistenceChecking());
-
- resourceType.removeAnnotation(EclipseLink.EXISTENCE_CHECKING);
- getJpaProject().synchronizeContextModel();
- assertEquals(false, caching.isExistenceChecking());
- }
-
- public void testSetExistenceChecking() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- assertEquals(false, caching.isExistenceChecking());
- assertNull(resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING));
-
- caching.setExistenceChecking(true);
-
- assertEquals(true, caching.isExistenceChecking());
- assertNotNull(resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING));
- }
-
- public void testGetDefaultExistenceType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, caching.getDefaultExistenceType());
-
- caching.setExistenceChecking(true);
- assertEquals(EclipseLinkExistenceType.CHECK_CACHE, caching.getDefaultExistenceType());
- }
-
- public void testGetSpecifiedExistenceType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, caching.getExistenceType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkExistenceCheckingAnnotation existenceCheckingAnnotation = (EclipseLinkExistenceCheckingAnnotation) resourceType.addAnnotation(EclipseLink.EXISTENCE_CHECKING);
- existenceCheckingAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_NON_EXISTENCE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_NON_EXISTENCE, existenceCheckingAnnotation.getValue());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, entity.getCaching().getSpecifiedExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, entity.getCaching().getExistenceType());
- }
-
- public void testSetSpecifiedExistenceType() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, caching.getExistenceType());
-
- caching.setExistenceChecking(true);
- caching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
-
-
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, entity.getCaching().getSpecifiedExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, entity.getCaching().getExistenceType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkExistenceCheckingAnnotation existenceCheckingAnnotation = (EclipseLinkExistenceCheckingAnnotation) resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.ASSUME_NON_EXISTENCE, existenceCheckingAnnotation.getValue());
-
-
- //set specified coordination type to the same as the default, verify it is not set to default
- caching.setSpecifiedExistenceType(EclipseLinkExistenceType.CHECK_DATABASE);
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, caching.getSpecifiedExistenceType());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType.CHECK_DATABASE, existenceCheckingAnnotation.getValue());
-
- caching.setSpecifiedExistenceType(null);
- assertNull(caching.getSpecifiedExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_CACHE, caching.getExistenceType());
- }
-
- public void testGetExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
-
- assertNull(entity.getCaching().getExpiry());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- assertNull(entity.getCaching().getExpiry());
-
- cacheAnnotation.setExpiry(Integer.valueOf(57));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Integer.valueOf(57), entity.getCaching().getExpiry());
-
- resourceType.removeAnnotation(EclipseLink.CACHE);
- getJpaProject().synchronizeContextModel();
- assertNull(entity.getCaching().getExpiry());
- }
-
- public void testSetExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- caching.setExpiry(Integer.valueOf(58));
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(58), cacheAnnotation.getExpiry());
-
-
- caching.setExpiry(null);
- cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNull(cacheAnnotation.getExpiry());
- }
-
- public void testSetExpiryUnsetsExpiryTimeOfDay() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- caching.addExpiryTimeOfDay();
- caching.getExpiryTimeOfDay().setHour(Integer.valueOf(5));
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(5), cacheAnnotation.getExpiryTimeOfDay().getHour());
-
- caching.setExpiry(Integer.valueOf(900));
-
- assertNull(caching.getExpiryTimeOfDay());
- assertNull(cacheAnnotation.getExpiryTimeOfDay());
- assertEquals(Integer.valueOf(900), cacheAnnotation.getExpiry());
- assertEquals(Integer.valueOf(900), caching.getExpiry());
- }
-
- public void testGetTimeOfDayExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
-
- cacheAnnotation.addExpiryTimeOfDay();
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(caching.getExpiryTimeOfDay());
- }
-
- public void testAddTimeOfDayExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNotNull(cacheAnnotation.getExpiryTimeOfDay());
- assertNotNull(caching.getExpiryTimeOfDay());
- assertEquals(timeOfDayExpiry, caching.getExpiryTimeOfDay());
- }
-
- public void testRemoveTimeOfDayExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.addExpiryTimeOfDay();
- getJpaProject().synchronizeContextModel();
-
- assertNotNull(caching.getExpiryTimeOfDay());
-
- caching.removeExpiryTimeOfDay();
- getJpaProject().synchronizeContextModel();
- assertNull(caching.getExpiryTimeOfDay());
- }
-
- public void testAddTimeOfDayExpiryUnsetsExpiry() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- caching.setExpiry(Integer.valueOf(800));
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(800), cacheAnnotation.getExpiry());
-
-
- caching.addExpiryTimeOfDay();
-
-
- assertNull(caching.getExpiry());
- assertNull(cacheAnnotation.getExpiry());
- assertNotNull(cacheAnnotation.getExpiryTimeOfDay());
- }
-
-
- public void testSetSpecifiedSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getSize());
-
- caching.setSpecifiedSize(new Integer(50));
-
-
- assertEquals(new Integer(50), entity.getCaching().getSpecifiedSize());
- assertEquals(50, entity.getCaching().getSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(new Integer(50), cacheAnnotation.getSize());
- }
-
- public void testGetDefaultSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getDefaultSize());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_SIZE_DEFAULT, "333");
-
- assertEquals(333, caching.getDefaultSize());
- }
-
- public void testGetSpecifiedSize() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getSize());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setSize(new Integer(50));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(new Integer(50), cacheAnnotation.getSize());
- assertEquals(new Integer(50), entity.getCaching().getSpecifiedSize());
- assertEquals(50, entity.getCaching().getSize());
- }
-
- public void testSetSpecifiedIsolation() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
-
- caching.setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2.PROTECTED);
-
-
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getIsolation());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
-
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.PROTECTED, cacheAnnotation.getIsolation());
-
-
- //set specified coordination type to the same as the default, verify it is not set to default
- caching.setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2.SHARED);
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getSpecifiedIsolation());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.SHARED, cacheAnnotation.getIsolation());
-
- caching.setSpecifiedIsolation(null);
- assertNull(caching.getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- }
-
- public void testGetSpecifiedIsolation() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = (JavaEclipseLinkEntity) getJavaPersistentType().getMapping();
- JavaEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(caching.getSpecifiedIsolation());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCacheAnnotation cacheAnnotation = (EclipseLinkCacheAnnotation) resourceType.addAnnotation(EclipseLink.CACHE);
- cacheAnnotation.setIsolation(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.PROTECTED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2.PROTECTED, cacheAnnotation.getIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getIsolation());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java
deleted file mode 100644
index 42f3da3dc3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConvertTests.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaConvertTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"class-instance\")").append(CR);
- sb.append(" @TypeConverter");
- }
- });
- }
-
- public EclipseLinkJavaConvertTests(String name) {
- super(name);
- }
-
-
- public void testGetConverterName() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
-
- assertEquals(EclipseLinkConvert.NO_CONVERTER, eclipseLinkConvert.getConverterName());
- assertEquals(EclipseLinkConvert.NO_CONVERTER, eclipseLinkConvert.getDefaultConverterName());
- assertEquals(null, eclipseLinkConvert.getSpecifiedConverterName());
- }
-
- public void testGetConvertName2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
-
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, eclipseLinkConvert.getConverterName());
- }
-
- public void testSetSpecifiedConverterName() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
- basicMapping.setConverter(EclipseLinkConvert.class);
- EclipseLinkConvert eclipseLinkConvert = (EclipseLinkConvert) basicMapping.getConverter();
- assertEquals(null, eclipseLinkConvert.getSpecifiedConverterName());
-
- eclipseLinkConvert.setSpecifiedConverterName("foo");
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convertAnnotation = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
-
- assertEquals("foo", convertAnnotation.getValue());
-
- eclipseLinkConvert.setSpecifiedConverterName(null);
- convertAnnotation = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- assertNotNull(convertAnnotation);
- assertEquals(null, convertAnnotation.getValue());
- }
-
- public void testGetConverterNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithBasicMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- BasicMapping basicMapping = (BasicMapping) persistentAttribute.getMapping();
-
- assertNull(basicMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, basicMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) basicMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(basicMapping.getConverter().getType());
- assertFalse(basicMapping.isDefault());
- assertSame(basicMapping, persistentAttribute.getMapping());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java
deleted file mode 100644
index 414f99b7fa..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaConverterTests.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaConverterTests extends EclipseLinkContextModelTestCase
-{
-
-
- private ICompilationUnit createTestEntityWithConvertAndConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @Converter(name=\"foo\"");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndConverterClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @Converter(converterClass=Foo.class");
- }
- });
- }
-
- public EclipseLinkJavaConverterTests(String name) {
- super(name);
- }
-
-
- public void testGetName() throws Exception {
- createTestEntityWithConvertAndConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkCustomConverter converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
-
- assertEquals("foo", converter.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithConvertAndConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkCustomConverter converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
- assertEquals("foo", converter.getName());
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkCustomConverter converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
-
- assertEquals("foo", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- resourceField.removeAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getCustomConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
- assertEquals("FOO", converter.getName());
- }
-
-
- public void testGetConverterClass() throws Exception {
- createTestEntityWithConvertAndConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkCustomConverter converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
-
- assertEquals("Foo", converter.getConverterClass());
- }
-
- public void testSetConverterClass() throws Exception {
- createTestEntityWithConvertAndConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkCustomConverter converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
- assertEquals("Foo", converter.getConverterClass());
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverterClass());
-
-
- converter.setConverterClass(null);
- assertEquals(null, converter.getConverterClass());
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getConverterClass());
-
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverterClass());
- }
-
- public void testGetConverterClassUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkCustomConverter converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
-
- assertEquals("Foo", converter.getConverterClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConverterAnnotation converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setConverterClass("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getConverterClass());
-
- resourceField.removeAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getCustomConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setConverterClass("FooBar");
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getCustomConverters().iterator().next();
- assertEquals("FooBar", converter.getConverterClass());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java
deleted file mode 100644
index 5ab3f6f0a6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEmbeddableTests.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaEmbeddableTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEmbeddableWithConvertAndCustomizerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- sb.append(" @Customizer(Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableWithChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, EclipseLink.CHANGE_TRACKING);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- sb.append(" @ChangeTracking").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaEmbeddableTests(String name) {
- super(name);
- }
-
-
- public void testGetCustomizerClass() throws Exception {
- createTestEmbeddableWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkEmbeddable) getJavaPersistentType().getMapping()).getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testSetCustomizerClass() throws Exception {
- createTestEmbeddableWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkEmbeddable) getJavaPersistentType().getMapping()).getCustomizer();
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
- }
-
- public void testGetCustomizerClassUpdatesFromResourceModelChange() throws Exception {
- createTestEmbeddableWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkEmbeddable embeddable = (EclipseLinkEmbeddable) getJavaPersistentType().getMapping();
- EclipseLinkCustomizer customizer = embeddable.getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- resourceType.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.addAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation.setValue("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testGetChangeTracking() throws Exception {
- createTestEmbeddableWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEmbeddable embeddable = (EclipseLinkEmbeddable) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = embeddable.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change resource to ATTRIBUTE specifically, test context
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change resource to OBJECT specifically, test context
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change resource to DEFERRED specifically, test context
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change resource to AUTO specifically, test context
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove value from resource, test context
- resourceChangeTracking.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove annotation, text context
- resourceType.removeAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertNull(contextChangeTracking.getSpecifiedType());
- }
-
- public void testSetChangeTracking() throws Exception {
- createTestEmbeddableWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEmbeddable embeddable = (EclipseLinkEmbeddable) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = embeddable.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to ATTRIBUTE specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change context to OBJECT specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change context to DEFERRED specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME));
- assertNull(contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically (this time from no annotation), test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
- resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java
deleted file mode 100644
index 0c279ea185..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaEntityTests.java
+++ /dev/null
@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.EclipseLinkMappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaEntityTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndCustomizerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append(" @Customizer(Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CHANGE_TRACKING);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append(" @ChangeTracking").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@ReadOnly").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaEntityTests(String name) {
- super(name);
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Entity entity = (Entity) getJavaPersistentType().getMapping();
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.BASIC_COLLECTION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.BASIC_MAP_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.TRANSFORMATION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(EclipseLinkMappingKeys.VARIABLE_ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- }
-
-
- public void testGetCustomizerClass() throws Exception {
- createTestEntityWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkEntity) getJavaPersistentType().getMapping()).getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testSetCustomizerClass() throws Exception {
- createTestEntityWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkEntity) getJavaPersistentType().getMapping()).getCustomizer();
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
- }
-
- public void testGetCustomizerClassUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkEntity entity = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkCustomizer customizer = entity.getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- resourceType.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.addAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation.setValue("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testGetChangeTracking() throws Exception {
- createTestEntityWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity entity = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = entity.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change resource to ATTRIBUTE specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change resource to OBJECT specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change resource to DEFERRED specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change resource to AUTO specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove value from resource, test context
-
- resourceChangeTracking.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove annotation, text context
-
- resourceType.removeAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertNull(contextChangeTracking.getSpecifiedType());
- }
-
- public void testSetChangeTracking() throws Exception {
- createTestEntityWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity entity = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = entity.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to ATTRIBUTE specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change context to OBJECT specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change context to DEFERRED specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME));
- assertNull(contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically (this time from no annotation), test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
- resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
- }
-
- public void testGetReadOnly() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
- }
-
- public void testGetSpecifiedReadOnly() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- //TODO test inheriting a default readonly from you superclass
- public void testGetDefaultReadOnly() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(false, readOnly.isDefaultReadOnly());
- }
-
- public void testSetSpecifiedReadOnly() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
-
- readOnly.setSpecifiedReadOnly(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertNull(readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
-
- readOnly.setSpecifiedReadOnly(Boolean.TRUE);
- assertNotNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
- readOnly.setSpecifiedReadOnly(null);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertNull(readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
- }
-
- public void testSpecifiedReadOnlyUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity mappedSuperclass = (EclipseLinkEntity) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.removeAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(readOnly.getSpecifiedReadOnly());
- assertEquals(false, readOnly.isDefaultReadOnly());
-
- resourceType.addAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java
deleted file mode 100644
index f77a956deb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaIdMappingTests.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaIdMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableId() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.MUTABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@Mutable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableIdDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public EclipseLinkJavaIdMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetConvert() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, idMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, idMapping.getConverter().getType());
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, ((EclipseLinkConvert) idMapping.getConverter()).getConverterName());
- }
-
- public void testSetConvert() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
- assertNull(idMapping.getConverter().getType());
-
- idMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) idMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- idMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithIdMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- IdMapping idMapping = (IdMapping) persistentAttribute.getMapping();
-
- assertNull(idMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, idMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) idMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(idMapping.getConverter().getType());
- assertFalse(idMapping.isDefault());
- assertSame(idMapping, persistentAttribute.getMapping());
- }
-
- public void testGetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- mutableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, mutable.getSpecifiedMutable());
-
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, mutable.getSpecifiedMutable());
-
- resourceField.addAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
- }
-
- public void testSetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(null);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation);
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
- }
-
- public void testIsDefaultMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertTrue(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
- }
-
- public void testIsDefaultMutableForDate() throws Exception {
- createTestEntityWithMutableIdDate();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertFalse(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertFalse(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertFalse(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.TRUE);
- assertTrue(mutable.isDefaultMutable());
-
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.FALSE);
- assertFalse(mutable.isDefaultMutable());
-
- (getPersistenceUnit()).getOptions().setTemporalMutable(null);
- assertFalse(mutable.isDefaultMutable());
- }
-
- public void testIsMutable() throws Exception {
- createTestEntityWithMutableId();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkIdMapping idMapping = (EclipseLinkIdMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = idMapping.getMutable();
- assertTrue(mutable.isMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertTrue(mutable.isMutable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java
deleted file mode 100644
index 6f7cab9b99..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToManyMappingTests.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaManyToManyMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithJoinFetchManyToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToMany").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaManyToManyMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java
deleted file mode 100644
index 9a346e8dcd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaManyToOneMappingTests.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaManyToOneMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithJoinFetchManyToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaManyToOneMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchManyToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java
deleted file mode 100644
index a994c249f5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaMappedSuperclassTests.java
+++ /dev/null
@@ -1,349 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTracking;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomizer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkReadOnly;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaMappedSuperclassTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestMappedSuperclassWithReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@ReadOnly").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithConvertAndCustomizerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append(" @Customizer(Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CHANGE_TRACKING);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append(" @ChangeTracking").append(CR);
- }
- });
- }
-
- public EclipseLinkJavaMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- public void testGetReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
- }
-
- public void testGetSpecifiedReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- //TODO test inheriting a default readonly from you superclass
- public void testGetDefaultReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(false, readOnly.isDefaultReadOnly());
- }
-
- public void testSetSpecifiedReadOnly() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(true, readOnly.isReadOnly());
-
- readOnly.setSpecifiedReadOnly(Boolean.FALSE);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertNull(readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
-
- readOnly.setSpecifiedReadOnly(Boolean.TRUE);
- assertNotNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
- readOnly.setSpecifiedReadOnly(null);
- assertNull(resourceType.getAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME));
- assertNull(readOnly.getSpecifiedReadOnly());//Boolean.FALSE and null really mean the same thing since there are only 2 states in the java resource model
- }
-
- public void testSpecifiedReadOnlyUpdatesFromResourceModelChange() throws Exception {
- createTestMappedSuperclassWithReadOnly();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkReadOnly readOnly = mappedSuperclass.getReadOnly();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- resourceType.removeAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(readOnly.getSpecifiedReadOnly());
- assertEquals(false, readOnly.isDefaultReadOnly());
-
- resourceType.addAnnotation(EclipseLinkReadOnlyAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, readOnly.getSpecifiedReadOnly());
- }
-
- public void testGetCustomizerClass() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping()).getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testSetCustomizerClass() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkCustomizer customizer = ((EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping()).getCustomizer();
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
-
-
- customizer.setSpecifiedCustomizerClass(null);
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals(null, customizerAnnotation);
-
-
- customizer.setSpecifiedCustomizerClass("Bar");
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", customizerAnnotation.getValue());
- }
-
- public void testGetCustomizerClassUpdatesFromResourceModelChange() throws Exception {
- createTestMappedSuperclassWithConvertAndCustomizerClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkCustomizer customizer = mappedSuperclass.getCustomizer();
-
- assertEquals("Foo", customizer.getSpecifiedCustomizerClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkCustomizerAnnotation customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- customizerAnnotation.setValue("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", customizer.getSpecifiedCustomizerClass());
-
- resourceType.removeAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation = (EclipseLinkCustomizerAnnotation) resourceType.addAnnotation(EclipseLinkCustomizerAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, customizer.getSpecifiedCustomizerClass());
-
- customizerAnnotation.setValue("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", customizer.getSpecifiedCustomizerClass());
- }
-
- public void testGetChangeTracking() throws Exception {
- createTestMappedSuperclassWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = mappedSuperclass.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change resource to ATTRIBUTE specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change resource to OBJECT specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change resource to DEFERRED specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change resource to AUTO specifically, test context
-
- resourceChangeTracking.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove value from resource, test context
-
- resourceChangeTracking.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // remove annotation, text context
-
- resourceType.removeAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getDefaultType());
- assertNull(contextChangeTracking.getSpecifiedType());
- }
-
- public void testSetChangeTracking() throws Exception {
- createTestMappedSuperclassWithChangeTracking();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) getJavaPersistentType().getMapping();
- EclipseLinkChangeTracking contextChangeTracking = mappedSuperclass.getChangeTracking();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- EclipseLinkChangeTrackingAnnotation resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertNull(resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
-
- // change context to ATTRIBUTE specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.ATTRIBUTE, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, contextChangeTracking.getSpecifiedType());
-
- // change context to OBJECT specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.OBJECT, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, contextChangeTracking.getSpecifiedType());
-
- // change context to DEFERRED specifically, test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.DEFERRED, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, contextChangeTracking.getSpecifiedType());
-
- // change context to null, test resource
-
- contextChangeTracking.setSpecifiedType(null);
-
- assertNull(resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME));
- assertNull(contextChangeTracking.getSpecifiedType());
-
- // change context to AUTO specifically (this time from no annotation), test resource
-
- contextChangeTracking.setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
- resourceChangeTracking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLinkChangeTrackingAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType.AUTO, resourceChangeTracking.getValue());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, contextChangeTracking.getSpecifiedType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java
deleted file mode 100644
index 6b46a4dd1f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaObjectTypeConverterTests.java
+++ /dev/null
@@ -1,631 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaObjectTypeConverterTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithConvertAndObjectTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter(name=\"foo\", defaultObjectValue=\"bar\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndDataType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter(dataType=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndObjectType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter(objectType=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndObjectTypeConverterConversionValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter(name=\"foo\", defaultObjectValue=\"bar\", conversionValues = @ConversionValue(dataValue=\"f\", objectValue=\"female\"))");
- }
- });
- }
-
- public EclipseLinkJavaObjectTypeConverterTests(String name) {
- super(name);
- }
-
-
- public void testGetName() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaPersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- assertEquals("foo", converter.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertEquals("foo", converter.getName());
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- assertEquals("foo", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- resourceField.removeAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getObjectTypeConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", converter.getName());
- }
-
- public void testGetDataType() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
-
-
- converter.setDataType(null);
- assertEquals(null, converter.getDataType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getDataType());
-
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
- }
-
- public void testGetDataTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- assertEquals("Foo", converter.getDataType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setDataType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getDataType());
-
- resourceField.removeAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getObjectTypeConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setDataType("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", converter.getDataType());
- }
-
- public void testGetObjectType() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
-
-
- converter.setObjectType(null);
- assertEquals(null, converter.getObjectType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getObjectType());
-
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
- }
-
- public void testGetObjectTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- assertEquals("Foo", converter.getObjectType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setObjectType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getObjectType());
-
- resourceField.removeAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getObjectTypeConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setObjectType("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", converter.getObjectType());
- }
-
-
- public void testAddConversionValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- EclipseLinkConversionValue conversionValue = converter.addConversionValue(0);
- conversionValue.setDataValue("F");
- conversionValue.setObjectValue("female");
-
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- EclipseLinkConversionValueAnnotation resourceConversionValue = resourceConversionValues.next();
- assertEquals("F", resourceConversionValue.getDataValue());
- assertEquals("female", resourceConversionValue.getObjectValue());
-
- EclipseLinkConversionValue conversionValue2 = converter.addConversionValue(0);
- conversionValue2.setDataValue("M");
- conversionValue2.setObjectValue("male");
-
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("M", resourceConversionValue.getDataValue());
- assertEquals("male", resourceConversionValue.getObjectValue());
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("F", resourceConversionValue.getDataValue());
- assertEquals("female", resourceConversionValue.getObjectValue());
-
- EclipseLinkConversionValue conversionValue3 = converter.addConversionValue(1);
- conversionValue3.setDataValue("O");
- conversionValue3.setObjectValue("male");
-
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("M", resourceConversionValue.getDataValue());
- assertEquals("male", resourceConversionValue.getObjectValue());
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("O", resourceConversionValue.getDataValue());
- assertEquals("male", resourceConversionValue.getObjectValue());
- resourceConversionValue = resourceConversionValues.next();
- assertEquals("F", resourceConversionValue.getDataValue());
- assertEquals("female", resourceConversionValue.getObjectValue());
-
- ListIterator<? extends EclipseLinkConversionValue> conversionValues = converter.getConversionValues().iterator();
- assertEquals(conversionValue2, conversionValues.next());
- assertEquals(conversionValue3, conversionValues.next());
- assertEquals(conversionValue, conversionValues.next());
-
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("M", conversionValues.next().getDataValue());
- assertEquals("O", conversionValues.next().getDataValue());
- assertEquals("F", conversionValues.next().getDataValue());
- }
-
- public void testRemoveConversionValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- converter.addConversionValue(0).setDataValue("F");
- converter.addConversionValue(1).setDataValue("M");
- converter.addConversionValue(2).setDataValue("O");
-
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
-
- converter.removeConversionValue(0);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(2, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals("M", resourceConversionValues.next().getDataValue());
- assertEquals("O", resourceConversionValues.next().getDataValue());
-
- converter.removeConversionValue(0);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(1, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals("O", resourceConversionValues.next().getDataValue());
-
- converter.removeConversionValue(0);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(0, CollectionTools.size(resourceConversionValues));
- }
-
- public void testMoveConversionValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- converter.addConversionValue(0).setDataValue("F");
- converter.addConversionValue(1).setDataValue("M");
- converter.addConversionValue(2).setDataValue("O");
-
- ListIterator<EclipseLinkConversionValueAnnotation> resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
-
- converter.moveConversionValue(2,0);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals("M", resourceConversionValues.next().getDataValue());
- assertEquals("O", resourceConversionValues.next().getDataValue());
- assertEquals("F", resourceConversionValues.next().getDataValue());
-
- converter.moveConversionValue(0,1);
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals(3, CollectionTools.size(resourceConversionValues));
- resourceConversionValues = converterAnnotation.getConversionValues().iterator();
- assertEquals("O", resourceConversionValues.next().getDataValue());
- assertEquals("M", resourceConversionValues.next().getDataValue());
- assertEquals("F", resourceConversionValues.next().getDataValue());
- }
-
- public void testUpdateConversionValues() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- converterAnnotation.addConversionValue(0).setDataValue("F");
- converterAnnotation.addConversionValue(1).setDataValue("M");
- converterAnnotation.addConversionValue(2).setDataValue("O");
- getJpaProject().synchronizeContextModel();
-
- ListIterator<? extends EclipseLinkConversionValue> conversionValues = converter.getConversionValues().iterator();
- assertEquals("F", conversionValues.next().getDataValue());
- assertEquals("M", conversionValues.next().getDataValue());
- assertEquals("O", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.moveConversionValue(2, 0);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("M", conversionValues.next().getDataValue());
- assertEquals("O", conversionValues.next().getDataValue());
- assertEquals("F", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.moveConversionValue(0, 1);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("O", conversionValues.next().getDataValue());
- assertEquals("M", conversionValues.next().getDataValue());
- assertEquals("F", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.removeConversionValue(1);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("O", conversionValues.next().getDataValue());
- assertEquals("F", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.removeConversionValue(1);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("O", conversionValues.next().getDataValue());
- assertFalse(conversionValues.hasNext());
-
- converterAnnotation.removeConversionValue(0);
- getJpaProject().synchronizeContextModel();
- conversionValues = converter.getConversionValues().iterator();
- assertFalse(conversionValues.hasNext());
- }
-
- public void testConversionValuesSize() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
-
- assertEquals(0, converter.getConversionValuesSize());
-
- converterAnnotation.addConversionValue(0).setDataValue("F");
- converterAnnotation.addConversionValue(1).setDataValue("M");
- converterAnnotation.addConversionValue(2).setDataValue("O");
-
- this.getJpaProject().synchronizeContextModel();
- assertEquals(3, converter.getConversionValuesSize());
- }
-
-
- public void testGetDefaultObjectValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- assertEquals("bar", converter.getDefaultObjectValue());
- }
-
- public void testSetDefaultObjectValue() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertEquals("bar", converter.getDefaultObjectValue());
-
- converter.setDefaultObjectValue("baz");
- assertEquals("baz", converter.getDefaultObjectValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("baz", converterAnnotation.getDefaultObjectValue());
-
-
- converter.setDefaultObjectValue(null);
- assertEquals(null, converter.getDefaultObjectValue());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getDefaultObjectValue());
-
-
- converter.setDefaultObjectValue("bar");
- assertEquals("bar", converter.getDefaultObjectValue());
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getDefaultObjectValue());
- }
-
- public void testGetDefaultObjectValueUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- assertEquals("bar", converter.getDefaultObjectValue());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkObjectTypeConverterAnnotation converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setDefaultObjectValue("baz");
- getJpaProject().synchronizeContextModel();
- assertEquals("baz", converter.getDefaultObjectValue());
-
- resourceField.removeAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getObjectTypeConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkObjectTypeConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkObjectTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setDefaultObjectValue("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", converter.getDefaultObjectValue());
- }
-
- public void testInitializeConversionValues() throws Exception {
- createTestEntityWithConvertAndObjectTypeConverterConversionValue();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter converter = basicMapping.getConverterContainer().getObjectTypeConverters().iterator().next();
-
- assertEquals(1, converter.getConversionValuesSize());
- assertEquals("f", converter.getConversionValues().iterator().next().getDataValue());
- assertEquals("female", converter.getConversionValues().iterator().next().getObjectValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java
deleted file mode 100644
index 791423d1d1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToManyMappingTests.java
+++ /dev/null
@@ -1,582 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToManyAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaOneToManyMappingTests extends EclipseLinkContextModelTestCase
-{
- private ICompilationUnit createTestEntityWithOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithPrivateOwnedOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- sb.append("@PrivateOwned").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithJoinFetchOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDefaultOneToMany() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
-
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("implements java.io.Serializable");
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private java.util.Collection<" + TYPE_NAME + "> myTypes;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- public EclipseLinkJavaOneToManyMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToManyMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testSetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToManyMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(false);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(true);
- assertNotNull(resourceField.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testPrivateOwnedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithPrivateOwnedOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToManyMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- resourceField.addAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping mapping = (EclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation = (OneToManyAnnotation) resourceField.getAnnotation(JPA.ONE_TO_MANY);
- PersistentAttribute contextAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToManyMapping mapping = (EclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship rel = mapping.getRelationship();
-
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- annotation.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceField.addAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNotNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- annotation.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNotNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(JPA.JOIN_TABLE);
- getJpaProject().synchronizeContextModel();
- assertNotNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceField.removeAnnotation(0, JPA.JOIN_COLUMN);
- getJpaProject().synchronizeContextModel();
- assertNull(resourceField.getAnnotation(0, JPA.JOIN_COLUMN));
- assertNull(resourceField.getAnnotation(JPA.JOIN_TABLE));
- assertNull(annotation.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testDefaultOneToMany() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, attributes.next().getDefaultMappingKey());
- }
-
- public void testDefaultOneToManySetFetch() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedFetch(FetchType.LAZY);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(FetchType.LAZY, specifiedOneToManyMapping.getFetch());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, annotation.getFetch());
- }
-
- public void testDefaultOneToManySetTargetEntity() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.setSpecifiedTargetEntity("Foo");
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("Foo", specifiedOneToManyMapping.getSpecifiedTargetEntity());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getTargetEntity());
- }
-
- public void testDefaultOneToManySetMappedBy() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("Foo");
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("Foo", specifiedOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getMappedBy());
- }
-
- public void testDefaultOneToManySetCascadeAll() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setAll(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isAll());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeAll());
- }
-
- public void testDefaultOneToManySetCascadeMerge() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setMerge(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isMerge());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeMerge());
- }
-
- public void testDefaultOneToManySetCascadePersist() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setPersist(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isPersist());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadePersist());
- }
-
- public void testDefaultOneToManySetCascadeRefresh() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setRefresh(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isRefresh());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertEquals(true, annotation.isCascadeRefresh());
- }
-
- public void testDefaultOneToManySetCascadeRemove() throws Exception {
- createTestEntityWithDefaultOneToMany();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToManyMapping oneToManyMapping = (EclipseLinkOneToManyMapping) persistentAttribute.getMapping();
- oneToManyMapping.getCascade().setRemove(true);
-
- EclipseLinkOneToManyMapping specifiedOneToManyMapping = (EclipseLinkOneToManyMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToManyMapping.getCascade().isRemove());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToManyAnnotation annotation =
- (OneToManyAnnotation) resourceField.getAnnotation(OneToManyAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeRemove());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java
deleted file mode 100644
index 2ad25364c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaOneToOneMappingTests.java
+++ /dev/null
@@ -1,449 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.OneToOneAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetch;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkPrivateOwned;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaOneToOneMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithPrivateOwnedOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- sb.append("@PrivateOwned").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithJoinFetchOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, EclipseLink.JOIN_FETCH);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- sb.append("@JoinFetch").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDefaultOneToOne() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
-
- @Override
- public void appendExtendsImplementsTo(StringBuilder sb) {
- sb.append("implements java.io.Serializable");
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("private " + TYPE_NAME + " myType;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- public EclipseLinkJavaOneToOneMappingTests(String name) {
- super(name);
- }
-
-
- public void testGetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToOneMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testSetPrivateOwned() throws Exception {
- createTestEntityWithPrivateOwnedOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToOneMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(false);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- assertNull(resourceField.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- privateOwnable.setPrivateOwned(true);
- assertNotNull(resourceField.getAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME));
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testPrivateOwnedUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithPrivateOwnedOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- EclipseLinkPrivateOwned privateOwnable = oneToOneMapping.getPrivateOwned();
- assertEquals(true, privateOwnable.isPrivateOwned());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(false, privateOwnable.isPrivateOwned());
-
- resourceField.addAnnotation(EclipseLinkPrivateOwnedAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(true, privateOwnable.isPrivateOwned());
- }
-
- public void testGetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test context value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to INNER specifically, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change resource to OUTER, test context
-
- joinFetchAnnotation.setValue(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // remove value from resource, test context
-
- joinFetchAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // remove annotation, text context
-
- resourceField.removeAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(joinFetchAnnotation.getValue());
- assertNull(contextJoinFetch.getValue());
- }
-
- public void testSetJoinFetchValue() throws Exception {
- createTestEntityWithJoinFetchOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkRelationshipMapping manyToManyMapping = (EclipseLinkRelationshipMapping) persistentAttribute.getMapping();
- EclipseLinkJoinFetch contextJoinFetch = manyToManyMapping.getJoinFetch();
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkJoinFetchAnnotation joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- // base annotated, test resource value
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to INNER specifically, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
-
- assertNull(joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
-
- // change context to OUTER, test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.OUTER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextJoinFetch.getValue());
-
- // set context to null, test resource
-
- contextJoinFetch.setValue(null);
-
- assertNull(resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME));
- assertNull(contextJoinFetch.getValue());
-
- // change context to INNER specifically (this time from no annotation), test resource
-
- contextJoinFetch.setValue(EclipseLinkJoinFetchType.INNER);
- joinFetchAnnotation = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLinkJoinFetchAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType.INNER, joinFetchAnnotation.getValue());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextJoinFetch.getValue());
- }
-
- public void testDefaultOneToOne() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, attributes.next().getDefaultMappingKey());
- }
-
- public void testDefaultOneToOneSetFetch() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.setSpecifiedFetch(FetchType.LAZY);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(FetchType.LAZY, specifiedOneToOneMapping.getFetch());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.FetchType.LAZY, annotation.getFetch());
- }
-
- public void testDefaultOneToOneSetTargetEntity() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.setSpecifiedTargetEntity("Foo");
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("Foo", specifiedOneToOneMapping.getSpecifiedTargetEntity());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getTargetEntity());
- }
-
- public void testDefaultOneToOneSetMappedBy() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("Foo");
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals("Foo", specifiedOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals("Foo", annotation.getMappedBy());
- }
-
- public void testDefaultOneToOneSetCascadeAll() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setAll(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isAll());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeAll());
- }
-
- public void testDefaultOneToOneSetCascadeMerge() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setMerge(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isMerge());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeMerge());
- }
-
- public void testDefaultOneToOneSetCascadePersist() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setPersist(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isPersist());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadePersist());
- }
-
- public void testDefaultOneToOneSetCascadeRefresh() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setRefresh(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isRefresh());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeRefresh());
- }
-
- public void testDefaultOneToOneSetCascadeRemove() throws Exception {
- createTestEntityWithDefaultOneToOne();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<JavaPersistentAttribute> attributes = getJavaPersistentType().getAttributes().iterator();
- JavaPersistentAttribute persistentAttribute = attributes.next();
- assertTrue(persistentAttribute.getMapping().isDefault());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getDefaultMappingKey());
-
- EclipseLinkOneToOneMapping oneToOneMapping = (EclipseLinkOneToOneMapping) persistentAttribute.getMapping();
- oneToOneMapping.getCascade().setRemove(true);
-
- EclipseLinkOneToOneMapping specifiedOneToOneMapping = (EclipseLinkOneToOneMapping) getJavaPersistentType().getAttributes().iterator().next().getMapping();
- assertEquals(true, specifiedOneToOneMapping.getCascade().isRemove());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- OneToOneAnnotation annotation =
- (OneToOneAnnotation) resourceField.getAnnotation(OneToOneAnnotation.ANNOTATION_NAME);
- assertNotNull(annotation);
- assertEquals(true, annotation.isCascadeRemove());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java
deleted file mode 100644
index 6e6cae6238..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaStructConverterTests.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaStructConverterTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithConvertAndStructConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @StructConverter(name=\"foo\"");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndStructConverterClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @StructConverter(converter=\"Foo\"");
- }
- });
- }
-
- public EclipseLinkJavaStructConverterTests(String name) {
- super(name);
- }
-
-
- public void testGetName() throws Exception {
- createTestEntityWithConvertAndStructConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkStructConverter converter = basicMapping.getConverterContainer().getStructConverters().iterator().next();
-
- assertEquals("foo", converter.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithConvertAndStructConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkStructConverter converter = basicMapping.getConverterContainer().getStructConverters().iterator().next();
- assertEquals("foo", converter.getName());
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndStructConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkStructConverter converter = basicMapping.getConverterContainer().getStructConverters().iterator().next();
-
- assertEquals("foo", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- resourceField.removeAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getStructConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getStructConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- assertEquals("FOO", converter.getName());
- }
-
-
- public void testGetConverterClass() throws Exception {
- createTestEntityWithConvertAndStructConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkStructConverter converter = basicMapping.getConverterContainer().getStructConverters().iterator().next();
-
- assertEquals("Foo", converter.getConverterClass());
- }
-
- public void testSetConverterClass() throws Exception {
- createTestEntityWithConvertAndStructConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkStructConverter converter = basicMapping.getConverterContainer().getStructConverters().iterator().next();
- assertEquals("Foo", converter.getConverterClass());
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverter());
-
-
- converter.setConverterClass(null);
- assertEquals(null, converter.getConverterClass());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getConverter());
-
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getConverter());
- }
-
- public void testGetConverterClassUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndStructConverterClass();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkStructConverter converter = basicMapping.getConverterContainer().getStructConverters().iterator().next();
-
- assertEquals("Foo", converter.getConverterClass());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkStructConverterAnnotation converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setConverter("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getConverterClass());
-
- resourceField.removeAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getStructConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkStructConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkStructConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getStructConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setConverter("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", converter.getConverterClass());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java
deleted file mode 100644
index 715a7b9a10..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaTypeConverterTests.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.java.JavaEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaTypeConverterTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithConvertAndTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @TypeConverter(name=\"foo\"");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndDataType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @TypeConverter(dataType=Foo.class");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConvertAndObjectType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(\"foo\")").append(CR);
- sb.append(" @TypeConverter(objectType=Foo.class");
- }
- });
- }
-
- public EclipseLinkJavaTypeConverterTests(String name) {
- super(name);
- }
-
-
- public void testGetName() throws Exception {
- createTestEntityWithConvertAndTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkTypeConverter converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
-
- assertEquals("foo", converter.getName());
- }
-
- public void testSetName() throws Exception {
- createTestEntityWithConvertAndTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkTypeConverter converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
- assertEquals("foo", converter.getName());
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
-
-
- converter.setName(null);
- assertEquals(null, converter.getName());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getName());
-
-
- converter.setName("bar");
- assertEquals("bar", converter.getName());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("bar", converterAnnotation.getName());
- }
-
- public void testGetNameUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndTypeConverter();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkTypeConverter converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
-
- assertEquals("foo", converter.getName());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setName("bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("bar", converter.getName());
-
- resourceField.removeAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getTypeConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setName("FOO");
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
- assertEquals("FOO", converter.getName());
- }
-
- public void testGetDataType() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkTypeConverter converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
-
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkTypeConverter converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
-
-
- converter.setDataType(null);
- assertEquals(null, converter.getDataType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getDataType());
-
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getDataType());
- }
-
- public void testGetDataTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndDataType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkTypeConverter converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
-
- assertEquals("Foo", converter.getDataType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setDataType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getDataType());
-
- resourceField.removeAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getTypeConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setDataType("FooBar");
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
- assertEquals("FooBar", converter.getDataType());
- }
-
- public void testGetObjectType() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkTypeConverter converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
-
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkTypeConverter converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
-
-
- converter.setObjectType(null);
- assertEquals(null, converter.getObjectType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals(null, converterAnnotation.getObjectType());
-
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- assertEquals("Bar", converterAnnotation.getObjectType());
- }
-
- public void testGetObjectTypeUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithConvertAndObjectType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- JavaEclipseLinkBasicMapping basicMapping = (JavaEclipseLinkBasicMapping) persistentAttribute.getMapping();
- EclipseLinkTypeConverter converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
-
- assertEquals("Foo", converter.getObjectType());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkTypeConverterAnnotation converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- converterAnnotation.setObjectType("Bar");
- getJpaProject().synchronizeContextModel();
- assertEquals("Bar", converter.getObjectType());
-
- resourceField.removeAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertFalse(basicMapping.getConverterContainer().getTypeConverters().iterator().hasNext());
-
- converterAnnotation = (EclipseLinkTypeConverterAnnotation) resourceField.addAnnotation(0, EclipseLinkTypeConverterAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- converter = basicMapping.getConverterContainer().getTypeConverters().iterator().next();
- assertNotNull(converter);
-
- converterAnnotation.setObjectType("FooBar");
- getJpaProject().synchronizeContextModel();
- assertEquals("FooBar", converter.getObjectType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java
deleted file mode 100644
index 73b1363344..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/EclipseLinkJavaVersionMappingTests.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.context.PersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.java.TemporalAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMutable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkJavaVersionMappingTests extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- }
- });
- }
-
-
- private ICompilationUnit createTestEntityWithConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, EclipseLink.CONVERT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append("@Convert(\"class-instance\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableVersion() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, EclipseLink.MUTABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append("@Mutable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableVersionDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public EclipseLinkJavaVersionMappingTests(String name) {
- super(name);
- }
-
- public void testGetConvert() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, versionMapping.getConverter().getType());
- }
-
- public void testGetConvert2() throws Exception {
- createTestEntityWithConvert();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertEquals(EclipseLinkConvert.class, versionMapping.getConverter().getType());
- assertEquals(EclipseLinkConvert.CLASS_INSTANCE_CONVERTER, ((EclipseLinkConvert) versionMapping.getConverter()).getConverterName());
- }
-
- public void testSetConvert() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
- assertNull(versionMapping.getConverter().getType());
-
- versionMapping.setConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) versionMapping.getConverter()).setTemporalType(TemporalType.TIME);
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- TemporalAnnotation temporal = (TemporalAnnotation) resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME);
-
- assertEquals(org.eclipse.jpt.jpa.core.resource.java.TemporalType.TIME, temporal.getValue());
-
- versionMapping.setConverter(null);
- assertNull(resourceField.getAnnotation(TemporalAnnotation.ANNOTATION_NAME));
- }
-
- public void testGetConvertUpdatesFromResourceModelChange() throws Exception {
- createTestEntityWithVersionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- VersionMapping versionMapping = (VersionMapping) persistentAttribute.getMapping();
-
- assertNull(versionMapping.getConverter().getType());
-
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.addAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- convert.setValue("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals(EclipseLinkConvert.class, versionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) versionMapping.getConverter()).getConverterName());
-
- resourceField.removeAnnotation(EclipseLinkConvertAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
-
- assertNull(versionMapping.getConverter().getType());
- assertFalse(versionMapping.isDefault());
- assertSame(versionMapping, persistentAttribute.getMapping());
- }
-
- public void testGetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- mutableAnnotation.setValue(Boolean.TRUE);
- getJpaProject().synchronizeContextModel();
-
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(null);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- mutableAnnotation.setValue(Boolean.FALSE);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.FALSE, mutable.getSpecifiedMutable());
-
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(null, mutable.getSpecifiedMutable());
-
- resourceField.addAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- getJpaProject().synchronizeContextModel();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
- }
-
- public void testSetSpecifiedMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertEquals(Boolean.TRUE, mutable.getSpecifiedMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(null, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(null);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(null, mutableAnnotation);
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
- }
-
- public void testIsDefaultMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertTrue(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.FALSE);
- assertTrue(mutable.isDefaultMutable());
- }
-
- public void testIsDefaultMutableForDate() throws Exception {
- createTestEntityWithMutableVersionDate();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertFalse(mutable.isDefaultMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertFalse(mutable.isDefaultMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertFalse(mutable.isDefaultMutable());
-
- //set mutable default to false in the persistence unit properties, verify default in java still true since this is not a Date/Calendar
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.TRUE);
- assertTrue(mutable.isDefaultMutable());
-
- (getPersistenceUnit()).getOptions().setTemporalMutable(Boolean.FALSE);
- assertFalse(mutable.isDefaultMutable());
-
- (getPersistenceUnit()).getOptions().setTemporalMutable(null);
- assertFalse(mutable.isDefaultMutable());
- }
-
- public void testIsMutable() throws Exception {
- createTestEntityWithMutableVersion();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistentAttribute persistentAttribute = getJavaPersistentType().getAttributes().iterator().next();
- EclipseLinkVersionMapping versionMapping = (EclipseLinkVersionMapping) persistentAttribute.getMapping();
- EclipseLinkMutable mutable = versionMapping.getMutable();
- assertTrue(mutable.isMutable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- resourceField.removeAnnotation(EclipseLinkMutableAnnotation.ANNOTATION_NAME);
- assertTrue(mutable.isMutable());
-
- mutable.setSpecifiedMutable(Boolean.TRUE);
- assertTrue(mutable.isMutable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java
deleted file mode 100644
index aeaa2d33d3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/java/JptEclipseLinkCoreJavaContextModelTests.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.java;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLinkCoreJavaContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCoreJavaContextModelTests.class.getName());
- suite.addTestSuite(EclipseLinkJavaBasicMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaCachingTests.class);
- suite.addTestSuite(EclipseLinkJavaConverterTests.class);
- suite.addTestSuite(EclipseLinkJavaConvertTests.class);
- suite.addTestSuite(EclipseLinkJavaEmbeddableTests.class);
- suite.addTestSuite(EclipseLinkJavaEntityTests.class);
- suite.addTestSuite(EclipseLinkJavaIdMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaManyToManyMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaManyToOneMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaMappedSuperclassTests.class);
- suite.addTestSuite(EclipseLinkJavaObjectTypeConverterTests.class);
- suite.addTestSuite(EclipseLinkJavaOneToManyMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaOneToOneMappingTests.class);
- suite.addTestSuite(EclipseLinkJavaStructConverterTests.class);
- suite.addTestSuite(EclipseLinkJavaTypeConverterTests.class);
- suite.addTestSuite(EclipseLinkJavaVersionMappingTests.class);
- suite.addTestSuite(EclipseLink2_0JavaCollectionTableTests.class);
- suite.addTestSuite(EclipseLink2_0JavaElementCollectionMappingTests.class);
- suite.addTestSuite(EclipseLink2_0JavaEntityTests.class);
- suite.addTestSuite(EclipseLink2_0JavaManyToManyMappingTests.class);
- suite.addTestSuite(EclipseLink2_0JavaManyToOneMappingTests.class);
- suite.addTestSuite(EclipseLink2_0JavaMappedSuperclassTests.class);
- suite.addTestSuite(EclipseLink2_0JavaOneToManyMappingTests.class);
- suite.addTestSuite(EclipseLink2_0JavaOneToOneMappingTests.class);
- suite.addTestSuite(EclipseLink2_3JavaMultitenancyTests.class);
- suite.addTestSuite(EclipseLink2_2JavaEntityTests.class);
- suite.addTestSuite(EclipseLink2_2JavaMappedSuperclassTests.class);
- return suite;
- }
-
- private JptEclipseLinkCoreJavaContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java
deleted file mode 100644
index d337783f5b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentAttributeTests.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink1_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1OrmPersistentAttributeTests
- extends EclipseLink1_1ContextModelTestCase
-{
- public EclipseLink1_1OrmPersistentAttributeTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestTypeNullAttributeMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMappingPropertyAccess() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(" private Address address;");
- }
- });
- }
-
- public void testMakeSpecified() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.addToXml();
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ormPersistentAttribute.addToXml();
-
- assertEquals(0, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeSpecifiedMappingKey() throws Exception {
- createTestTypeNullAttributeMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNull(ormPersistentAttribute.getMapping().getKey());
- ormPersistentAttribute.addToXml(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmEclipseLinkOneToOneMapping);
-
-
- ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ormPersistentAttribute.addToXml(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmEclipseLinkIdMapping);
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeVirtual() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
-
- assertEquals(0, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- assertEquals(0, ormPersistentType.getSpecifiedAttributesSize());
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- }
-
- public void testMakeVirtualNoUnderlyingJavaAttribute() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
-
-
- ormPersistentType.getSpecifiedAttributes().iterator().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.getDefaultAttributes().iterator().next().getName());
- assertEquals("name", ormPersistentType.getSpecifiedAttributes().iterator().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("id", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete2() throws Exception {
- createTestEntityOneToOneMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- }
-
- public void testGetJavaPersistentAttribute() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- //virtual orm attribute, access type matches java : FIELD, name matches java
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- JavaResourceAttribute javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertTrue(javaResourceAttribute instanceof JavaResourceField);
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getFields().iterator().next(), javaResourceAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- //virtual orm attribute, java access type FIELD, orm access type PROPERTY, name matches java
- //verify both the property java resource attribute and the field java resource attribute are used in orm
- //because the field is annotated and property is specified
- ((OrmPersistentAttribute) ormPersistentAttribute).removeFromXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute idFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute idPropertyAttribute = attributes.next();
- assertEquals(ormPersistentAttribute, idFieldAttribute);
- assertNotSame(ormPersistentAttribute, idPropertyAttribute);
- ormPersistentAttribute = idPropertyAttribute;
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, idFieldAttribute.getJavaPersistentAttribute().getAccess());
- javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getMethods().iterator().next(), javaResourceAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmPersistentAttribute ormPersistentAttribute2 = ormPersistentAttribute.addToXml();
- ormPersistentAttribute2.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
- }
-
- public void testGetJavaPersistentAttributeMixedAccess() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute ormFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute ormPropertyAttribute = attributes.next();
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertEquals(AccessType.FIELD, ormFieldAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPropertyAttribute.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getOwningPersistentType().getAccess());
- assertTrue(ormFieldAttribute.isVirtual());
- assertTrue(ormPropertyAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormFieldAttribute.getMappingKey());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPropertyAttribute.getMappingKey());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, javaPersistentAttribute.getMappingKey());
-
-
- ormPropertyAttribute.addToXml();
- ormPropertyAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPropertyAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPropertyAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertTrue(ormPropertyAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
- ((OrmPersistentAttribute) ormPropertyAttribute).setSpecifiedAccess(AccessType.FIELD);
- ormPropertyAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPropertyAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPropertyAttribute.getAccess());
- assertEquals(javaPersistentAttribute, ormPropertyAttribute.getJavaPersistentAttribute());
- assertTrue(ormPropertyAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- }
-
- public void testGetAccess() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.FIELD);
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.FIELD);
- }
-
- public void testGetAccessPropertyInJava() throws Exception {
- createTestEntityIdMappingPropertyAccess();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
- assertTrue(ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute().getKind() == Kind.METHOD);
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.PROPERTY, javaPersistentAttribute.getAccess());
- assertTrue(javaPersistentAttribute.getResourceAttribute().getKind() == Kind.METHOD);
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java
deleted file mode 100644
index 888070c305..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmPersistentTypeTests.java
+++ /dev/null
@@ -1,293 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink1_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1OrmPersistentTypeTests
- extends EclipseLink1_1ContextModelTestCase
-{
- public EclipseLink1_1OrmPersistentTypeTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-//
-// private void createAccessTypeEnum() throws Exception {
-// this.createEnumAndMembers(JPA_ANNOTATIONS_PACKAGE_NAME, "AccessType", "FIELD, PROPERTY;");
-// }
-//
-// private void createAccessAnnotation() throws Exception {
-// this.createAnnotationAndMembers(JPA_ANNOTATIONS_PACKAGE_NAME, "Access", "AccessType value();");
-// createAccessTypeEnum();
-// }
-//
-// private ICompilationUnit createTestEntityAnnotatedFieldPropertySpecified() throws Exception {
-// createAccessAnnotation();
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA.ACCESS, JPA.ACCESS_TYPE);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity");
-// sb.append("@Access(AccessType.PROPERTY)");
-// }
-//
-// @Override
-// public void appendNameFieldAnnotationTo(StringBuilder sb) {
-// sb.append("@Basic");
-// sb.append("@Access(AccessType.FIELD)");
-// }
-//
-// @Override
-// public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
-// sb.append("@Id");
-// }
-// });
-// }
-//
-// private ICompilationUnit createTestEntityFieldSpecifiedPropertyAnnotated() throws Exception {
-// createAccessAnnotation();
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, JPA.ID, JPA.ACCESS, JPA.ACCESS_TYPE);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity");
-// sb.append("@Access(AccessType.FIELD)");
-// }
-//
-// @Override
-// public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
-// sb.append("@Id");
-// sb.append("@Access(AccessType.PROPERTY)");
-// }
-// });
-// }
-//
-// private ICompilationUnit createTestEntityPropertySpecified() throws Exception {
-// createAccessAnnotation();
-// return this.createTestType(new DefaultAnnotationWriter() {
-// @Override
-// public Iterator<String> imports() {
-// return new ArrayIterator<String>(JPA.ENTITY, JPA.ACCESS, JPA.ACCESS_TYPE);
-// }
-// @Override
-// public void appendTypeAnnotationTo(StringBuilder sb) {
-// sb.append("@Entity");
-// sb.append("@Access(AccessType.PROPERTY)");
-// }
-// });
-// }
-
- public void testGetAccessWithJavaAnnotations() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(null, javaPersistentType.getSpecifiedAccess());
-
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentAttribute.addToXml();
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- assertEquals(null, javaPersistentType.getSpecifiedAccess());
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
- assertEquals(AccessType.FIELD, javaPersistentType.getAccess());
- }
-
-//TODO Access annotation test
-// public void testGetAccessWithJavaAnnotationsProperty() throws Exception {
-// createTestEntityAnnotatedFieldPropertySpecified();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-//
-// assertEquals(AccessType.PROPERTY, ormPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getSpecifiedAccess());
-//
-//
-// OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
-// ormPersistentAttribute.makeSpecified();
-// assertEquals(AccessType.PROPERTY, ormPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getSpecifiedAccess());
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(AccessType.FIELD, ormPersistentType.getAccess());
-// assertEquals(AccessType.PROPERTY, javaPersistentType.getAccess());
-// }
-//
-// public void testVirtualAttributes() throws Exception {
-// createTestEntityAnnotatedFieldPropertySpecified();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// ListIterator<OrmPersistentAttribute> virtualAttributes = ormPersistentType.virtualAttributes();
-// OrmPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-//
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-// }
-//
-// public void testVirtualAttributes2() throws Exception {
-// createTestEntityPropertySpecified();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// ListIterator<OrmPersistentAttribute> virtualAttributes = ormPersistentType.virtualAttributes();
-// OrmPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-// }
-//
-// public void testVirtualAttributes3() throws Exception {
-// createTestEntityFieldSpecifiedPropertyAnnotated();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// ListIterator<OrmPersistentAttribute> virtualAttributes = ormPersistentType.virtualAttributes();
-// OrmPersistentAttribute ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-//
-// ormPersistentAttribute.makeSpecified();
-//
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("id", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-//
-//
-// OrmPersistentAttribute specifiedPersistentAttribute = ormPersistentType.specifiedAttributes().next();
-// assertEquals("id", specifiedPersistentAttribute.getName());
-// assertEquals(AccessType.PROPERTY, specifiedPersistentAttribute.getSpecifiedAccess());
-//
-//
-// ormPersistentType.virtualAttributes().next().makeSpecified();
-// virtualAttributes = ormPersistentType.virtualAttributes();
-// ormPersistentAttribute = virtualAttributes.next();
-// assertEquals("name", ormPersistentAttribute.getName());
-// assertEquals(AccessType.FIELD, ormPersistentAttribute.getAccess());
-//
-// assertFalse(virtualAttributes.hasNext());
-// }
-//
-// public void testGetDefaultAccess() throws Exception {
-// createTestEntityPropertySpecified();
-// OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-// JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-//
-// assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-//
-// javaPersistentType.setSpecifiedAccess(AccessType.FIELD);
-// assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-//
-// javaPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
-// assertEquals(AccessType.PROPERTY, ormPersistentType.getDefaultAccess());
-//
-//
-// ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-// assertEquals(AccessType.FIELD, ormPersistentType.getDefaultAccess());
-// }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java
deleted file mode 100644
index 5e0a4e638c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink1_1OrmTransientMappingTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink1_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink1_1OrmTransientMappingTests
- extends EclipseLink1_1ContextModelTestCase
-{
- public EclipseLink1_1OrmTransientMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient").append(CR);
- }
- });
- }
-
- public void testCreateTransientMapping() throws Exception {
- createTestEntityWithTransientMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertTrue(persistentAttribute.isVirtual());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- persistentAttribute = ormPersistentType.addAttributeToXml(persistentAttribute, MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
-
- assertFalse(persistentAttribute.isVirtual());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMapping().getKey());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java
deleted file mode 100644
index 58ab370e5a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmCollectionTableTests.java
+++ /dev/null
@@ -1,816 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.UniqueConstraint;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmUniqueConstraint;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmCollectionTable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlCollectionTable;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlUniqueConstraint;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmCollectionTableTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmCollectionTableTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestEntityWithValidElementCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID, "java.util.Collection");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append(" private Collection<String> projects;").append(CR);
- sb.append("@Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestTypeWithCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("java.util.Collection");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" private Collection<String> elementCollection;").append(CR);
- }
- });
- }
-
- public void testUpdateSpecifiedName() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = elementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
-
-
- //set name in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setName("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedName());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getName());
-
- //set name to null in the resource model
- resourceElementCollection.getCollectionTable().setName(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable().getName());
-
- resourceElementCollection.getCollectionTable().setName("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedName());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getName());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedName() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = elementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set name in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedName("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedName());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getName());
-
- //set name to null in the context model
- ormCollectionTable.setSpecifiedName(null);
- assertNull(ormCollectionTable.getSpecifiedName());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testVirtualCollectionTable() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("projects");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(TYPE_NAME + "_projects", virtualCollectionTable.getName());
- assertNull(virtualCollectionTable.getSpecifiedCatalog());
- assertNull(virtualCollectionTable.getSpecifiedSchema());
- assertEquals(0, virtualCollectionTable.getSpecifiedJoinColumnsSize());
- JoinColumn virtualJoinColumn = virtualCollectionTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_id", virtualJoinColumn.getDefaultName());
- assertEquals("id", virtualJoinColumn.getDefaultReferencedColumnName());
-
- JavaPersistentAttribute javaPersistentAttribute = ormPersistentAttribute.getJavaPersistentAttribute();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) javaPersistentAttribute.getMapping();
- JavaCollectionTable2_0 javaCollectionTable = javaElementCollectionMapping.getCollectionTable();
- javaCollectionTable.setSpecifiedName("FOO");
- javaCollectionTable.setSpecifiedCatalog("CATALOG");
- javaCollectionTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaCollectionTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
-
- assertEquals("FOO", virtualCollectionTable.getSpecifiedName());
- assertEquals("CATALOG", virtualCollectionTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualCollectionTable.getSpecifiedSchema());
- assertEquals(1, virtualCollectionTable.getSpecifiedJoinColumnsSize());
- virtualJoinColumn = virtualCollectionTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", virtualJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", virtualJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("projects"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- assertEquals(TYPE_NAME + "_projects", ormCollectionTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).setSpecifiedName("Foo");
- assertEquals("Foo_projects", ormCollectionTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).setSpecifiedName("Bar");
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("projects").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
-
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals("Bar_projects", ormCollectionTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove element collection mapping from the orm.xml file
- ormPersistentAttribute.removeFromXml();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("projects");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
- assertTrue(ormPersistentAttribute2.isVirtual());
- assertEquals("JAVA_COLLECTION_TABLE", virtualCollectionTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName(null);
- assertNull(virtualCollectionTable.getSpecifiedName());
- assertEquals("Bar_projects", virtualCollectionTable.getDefaultName());
- }
-
- public void testUpdateSpecifiedSchema() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set schema in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setSchema("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getSchema());
-
- //set Schema to null in the resource model
- resourceElementCollection.getCollectionTable().setSchema(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable().getSchema());
-
- resourceElementCollection.getCollectionTable().setSchema("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedSchema());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getSchema());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedSchema() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Schema in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedSchema("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedSchema());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getSchema());
-
- //set Schema to null in the context model
- ormCollectionTable.setSpecifiedSchema(null);
- assertNull(ormCollectionTable.getSpecifiedSchema());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testUpdateSpecifiedCatalog() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Catalog in the resource model, verify context model updated
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- resourceElementCollection.getCollectionTable().setCatalog("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getCatalog());
-
- //set Catalog to null in the resource model
- resourceElementCollection.getCollectionTable().setCatalog(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable().getCatalog());
-
- resourceElementCollection.getCollectionTable().setCatalog("FOO");
- assertEquals("FOO", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("FOO", resourceElementCollection.getCollectionTable().getCatalog());
-
- resourceElementCollection.setCollectionTable(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testModifySpecifiedCatalog() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
-
- //set Catalog in the context model, verify resource model modified
- ormCollectionTable.setSpecifiedCatalog("foo");
- assertEquals("foo", ormCollectionTable.getSpecifiedCatalog());
- assertEquals("foo", resourceElementCollection.getCollectionTable().getCatalog());
-
- //set Catalog to null in the context model
- ormCollectionTable.setSpecifiedCatalog(null);
- assertNull(ormCollectionTable.getSpecifiedCatalog());
- assertNull(resourceElementCollection.getCollectionTable());
- }
-
- public void testAddSpecifiedJoinColumn() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- OrmJoinColumn joinColumn = ormCollectionTable.addSpecifiedJoinColumn(0);
- joinColumn.setSpecifiedName("FOO");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(0).getName());
-
- OrmJoinColumn joinColumn2 = ormCollectionTable.addSpecifiedJoinColumn(0);
- joinColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(1).getName());
-
- OrmJoinColumn joinColumn3 = ormCollectionTable.addSpecifiedJoinColumn(1);
- joinColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
-
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals(joinColumn2, joinColumns.next());
- assertEquals(joinColumn3, joinColumns.next());
- assertEquals(joinColumn, joinColumns.next());
-
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- }
-
- public void testRemoveSpecifiedJoinColumn() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- ormCollectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormCollectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormCollectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals(3, resourceCollectionTable.getJoinColumns().size());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(2, resourceCollectionTable.getJoinColumns().size());
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(1, resourceCollectionTable.getJoinColumns().size());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(0).getName());
-
- ormCollectionTable.removeSpecifiedJoinColumn(0);
- assertEquals(0, resourceCollectionTable.getJoinColumns().size());
- }
-
- public void testMoveSpecifiedJoinColumn() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
-
- ormCollectionTable.addSpecifiedJoinColumn(0).setSpecifiedName("FOO");
- ormCollectionTable.addSpecifiedJoinColumn(1).setSpecifiedName("BAR");
- ormCollectionTable.addSpecifiedJoinColumn(2).setSpecifiedName("BAZ");
-
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
- assertEquals(3, resourceCollectionTable.getJoinColumns().size());
-
-
- ormCollectionTable.moveSpecifiedJoinColumn(2, 0);
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
-
-
- ormCollectionTable.moveSpecifiedJoinColumn(0, 1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
-
- assertEquals("BAZ", resourceCollectionTable.getJoinColumns().get(0).getName());
- assertEquals("BAR", resourceCollectionTable.getJoinColumns().get(1).getName());
- assertEquals("FOO", resourceCollectionTable.getJoinColumns().get(2).getName());
- }
-
-
- public void testUpdateJoinColumns() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- resourceCollectionTable.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
-
- resourceCollectionTable.getJoinColumns().get(0).setName("FOO");
- resourceCollectionTable.getJoinColumns().get(1).setName("BAR");
- resourceCollectionTable.getJoinColumns().get(2).setName("BAZ");
-
- ListIterator<OrmJoinColumn> joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("FOO", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().move(2, 0);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().move(0, 1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("BAR", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertEquals("FOO", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(1);
- joinColumns = ormCollectionTable.getSpecifiedJoinColumns().iterator();
- assertEquals("BAZ", joinColumns.next().getName());
- assertFalse(joinColumns.hasNext());
-
- resourceCollectionTable.getJoinColumns().remove(0);
- assertFalse(ormCollectionTable.getSpecifiedJoinColumns().iterator().hasNext());
- }
-
- public void testUniqueConstraints() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("bar", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("foo", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsSize() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- assertEquals(0, ormCollectionTable.getUniqueConstraintsSize());
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "foo");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "bar");
-
- assertEquals(2, ormCollectionTable.getUniqueConstraintsSize());
- }
-
- public void testAddUniqueConstraint() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = resourceCollectionTable.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testAddUniqueConstraint2() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "BAZ");
-
- ListIterator<XmlUniqueConstraint> uniqueConstraints = resourceCollectionTable.getUniqueConstraints().listIterator();
-
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().get(0));
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testRemoveUniqueConstraint() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, resourceCollectionTable.getUniqueConstraints().size());
-
- ormCollectionTable.removeUniqueConstraint(1);
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- Iterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(1);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- assertFalse(uniqueConstraintResources.hasNext());
-
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
-
- ormCollectionTable.removeUniqueConstraint(0);
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertFalse(uniqueConstraintResources.hasNext());
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testMoveUniqueConstraint() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- ormCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- ormCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- ormCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- assertEquals(3, resourceCollectionTable.getUniqueConstraints().size());
-
-
- ormCollectionTable.moveUniqueConstraint(2, 0);
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- ListIterator<XmlUniqueConstraint> uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
-
-
- ormCollectionTable.moveUniqueConstraint(0, 1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
-
- uniqueConstraintResources = resourceCollectionTable.getUniqueConstraints().listIterator();
- assertEquals("BAZ", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("BAR", uniqueConstraintResources.next().getColumnNames().get(0));
- assertEquals("FOO", uniqueConstraintResources.next().getColumnNames().get(0));
- }
-
- public void testUpdateUniqueConstraints() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("elementCollection");
- ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentAttribute, MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 resourceElementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- OrmCollectionTable2_0 ormCollectionTable = ormElementCollectionMapping.getCollectionTable();
- resourceElementCollection.setCollectionTable(OrmFactory.eINSTANCE.createXmlCollectionTable());
- XmlCollectionTable resourceCollectionTable = resourceElementCollection.getCollectionTable();
-
- XmlUniqueConstraint uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(0, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "FOO");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(1, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAR");
-
- uniqueConstraintResource = OrmFactory.eINSTANCE.createXmlUniqueConstraint();
- resourceCollectionTable.getUniqueConstraints().add(2, uniqueConstraintResource);
- uniqueConstraintResource.getColumnNames().add(0, "BAZ");
-
-
- ListIterator<OrmUniqueConstraint> uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(2, 0);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().move(0, 1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(1);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- resourceCollectionTable.getUniqueConstraints().remove(0);
- uniqueConstraints = ormCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
- }
-
- public void testUniqueConstraintsFromJava() throws Exception {
- createTestEntityWithValidElementCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributes().iterator().next().getMapping();
- CollectionTable2_0 virtualCollectionTable = virtualElementCollectionMapping.getCollectionTable();
-
- assertTrue(ormPersistentType.getAttributes().iterator().next().isVirtual());
-
- ListIterator<? extends UniqueConstraint> uniqueConstraints = virtualCollectionTable.getUniqueConstraints().iterator();
- assertFalse(uniqueConstraints.hasNext());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping2_0 = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributes().iterator().next().getMapping();
- JavaCollectionTable2_0 javaCollectionTable = javaElementCollectionMapping2_0.getCollectionTable();
-
- javaCollectionTable.addUniqueConstraint(0).addColumnName(0, "FOO");
- javaCollectionTable.addUniqueConstraint(1).addColumnName(0, "BAR");
- javaCollectionTable.addUniqueConstraint(2).addColumnName(0, "BAZ");
-
- uniqueConstraints = virtualCollectionTable.getUniqueConstraints().iterator();
- assertTrue(uniqueConstraints.hasNext());
- assertEquals("FOO", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAR", uniqueConstraints.next().getColumnNames().iterator().next());
- assertEquals("BAZ", uniqueConstraints.next().getColumnNames().iterator().next());
- assertFalse(uniqueConstraints.hasNext());
-
- ormPersistentType.getAttributes().iterator().next().addToXml();
-
- virtualElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributes().iterator().next().getMapping();
- assertEquals(0, virtualElementCollectionMapping.getCollectionTable().getUniqueConstraintsSize());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java
deleted file mode 100644
index 9dccb43689..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmElementCollectionMappingTests.java
+++ /dev/null
@@ -1,1703 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.EmbeddedIdMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.TransientMapping;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmColumn;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlElementCollection;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlElementCollection_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkElementCollectionMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmElementCollectionMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- private static final String ATTRIBUTE_OVERRIDE_NAME = "city";
- private static final String ATTRIBUTE_OVERRIDE_COLUMN_NAME = "E_CITY";
-
- public EclipseLink2_0OrmElementCollectionMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection(targetClass=String.class, fetch=FetchType.EAGER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithEmbeddableElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.FETCH_TYPE, JPA.ATTRIBUTE_OVERRIDE, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection");
- sb.append(CR);
- sb.append(" @AttributeOverride(name=\"" + ATTRIBUTE_OVERRIDE_NAME + "\", column=@Column(name=\"" + ATTRIBUTE_OVERRIDE_COLUMN_NAME + "\"))");
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithNonGenericElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithGenericBasicElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<String> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapElementCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createSelfReferentialElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR).append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Foo").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.List<Foo> elementCollection;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Foo.java", sourceWriter);
- }
-
- private ICompilationUnit createTestTypeWithCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("java.util.Collection");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" private Collection<String> elementCollection;").append(CR);
- }
- });
- }
-
- public void testUpdateName() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertEquals("elementCollection", ormElementCollectionMapping.getName());
- assertEquals("elementCollection", elementCollection.getName());
-
- //set name in the resource model, verify context model updated
- elementCollection.setName("newName");
- assertEquals("newName", ormElementCollectionMapping.getName());
- assertEquals("newName", elementCollection.getName());
-
- //set name to null in the resource model
- elementCollection.setName(null);
- assertNull(ormElementCollectionMapping.getName());
- assertNull(elementCollection.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertEquals("elementCollection", ormElementCollectionMapping.getName());
- assertEquals("elementCollection", elementCollection.getName());
-
- //set name in the context model, verify resource model updated
- ormElementCollectionMapping.setName("newName");
- assertEquals("newName", ormElementCollectionMapping.getName());
- assertEquals("newName", elementCollection.getName());
-
- //set name to null in the context model
- ormElementCollectionMapping.setName(null);
- assertNull(ormElementCollectionMapping.getName());
- assertNull(elementCollection.getName());
- }
-
- public void testMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute.getMapping().setName("foo");
-
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals("foo", ormElementCollectionMapping.getName());
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", virtualElementCollectionMapping.getName());
- assertEquals(FetchType.EAGER, virtualElementCollectionMapping.getSpecifiedFetch());
- assertEquals("String", virtualElementCollectionMapping.getSpecifiedTargetClass());
-
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormElementCollectionMapping.getName());
- assertEquals(null, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getDefaultFetch());
- assertEquals(null, ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals(PACKAGE_NAME + ".Address", ormElementCollectionMapping.getDefaultTargetClass());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
- ormPersistentAttribute.addToXml(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormElementCollectionMapping.getName());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityWithElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormElementCollectionMapping.getName());
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getFetch());
- }
-
-
- public void testMorphToIdMapping() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof IdMapping);
- assertEquals("elementCollection", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToVersionMapping() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof VersionMapping);
- assertEquals("elementCollection", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToTransientMapping() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof TransientMapping);
- assertEquals("elementCollection", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToEmbeddedMapping() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedMapping);
- assertEquals("elementCollection", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToEmbeddedIdMapping() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof EmbeddedIdMapping);
- assertEquals("elementCollection", ormPersistentAttribute.getMapping().getName());
- }
-
- public void testMorphToManyToManyMapping() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToManyMapping);
- assertEquals("elementCollection", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((ManyToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToOneToManyMapping() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof OneToManyMapping);
- assertEquals("elementCollection", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((OneToManyMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToManyToOneMapping() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof ManyToOneMapping);
- assertEquals("elementCollection", ormPersistentAttribute.getMapping().getName());
-// assertEquals(FetchType.EAGER, ((ManyToOneMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testMorphToBasicMapping() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- assertFalse(elementCollectionMapping.isDefault());
- elementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertFalse(elementCollectionMapping.isDefault());
-
- ormPersistentAttribute.setMappingKey(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- assertEquals(ormPersistentAttribute, ormPersistentType.getSpecifiedAttributes().iterator().next());
- assertTrue(ormPersistentAttribute.getMapping() instanceof BasicMapping);
- assertEquals("elementCollection", ormPersistentAttribute.getMapping().getName());
-//TODO assertEquals(FetchType.EAGER, ((IBasicMapping) ormPersistentAttribute.getMapping()).getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedFetch() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the resource model, verify context model updated
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER);
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
-
- elementCollection.setFetch(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY);
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getSpecifiedFetch());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, elementCollection.getFetch());
-
- //set fetch to null in the resource model
- elementCollection.setFetch(null);
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
- }
-
- public void testModifySpecifiedFetch() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- assertNull(elementCollection.getFetch());
-
- //set fetch in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedFetch(FetchType.EAGER);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.EAGER, elementCollection.getFetch());
- assertEquals(FetchType.EAGER, ormElementCollectionMapping.getSpecifiedFetch());
-
- ormElementCollectionMapping.setSpecifiedFetch(FetchType.LAZY);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.FetchType.LAZY, elementCollection.getFetch());
- assertEquals(FetchType.LAZY, ormElementCollectionMapping.getSpecifiedFetch());
-
- //set fetch to null in the context model
- ormElementCollectionMapping.setSpecifiedFetch(null);
- assertNull(elementCollection.getFetch());
- assertNull(ormElementCollectionMapping.getSpecifiedFetch());
- }
-
- public void testUpdateSpecifiedTargetClass() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the resource model, verify context model updated
- elementCollection.setTargetClass("newTargetClass");
- assertEquals("newTargetClass", ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the resource model
- elementCollection.setTargetClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
- public void testModifySpecifiedTargetClass() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
-
- //set target class in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedTargetClass("newTargetClass");
- assertEquals("newTargetClass", ormElementCollectionMapping.getSpecifiedTargetClass());
- assertEquals("newTargetClass", elementCollection.getTargetClass());
-
- //set target class to null in the context model
- ormElementCollectionMapping.setSpecifiedTargetClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedTargetClass());
- assertNull(elementCollection.getTargetClass());
- }
-
-
- public void testGetValueTypeEmbeddable() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeEntity() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeNone() throws Exception {
- createTestEntityWithNonGenericElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.NO_TYPE, elementCollectionMapping.getValueType());
-
- elementCollectionMapping.setSpecifiedTargetClass("test.Address");
- assertEquals(ElementCollectionMapping2_0.Type.EMBEDDABLE_TYPE, elementCollectionMapping.getValueType());
- }
-
- public void testGetValueTypeBasic() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.Address");
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- assertEquals(ElementCollectionMapping2_0.Type.BASIC_TYPE, elementCollectionMapping.getValueType());
- }
-
-
- public void testUpdateMapKey() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(elementCollection.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- elementCollection.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNotNull(elementCollection.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- elementCollection.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormElementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", elementCollection.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- elementCollection.getMapKey().setName(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(elementCollection.getMapKey().getName());
-
- elementCollection.getMapKey().setName("myMapKey");
- elementCollection.setMapKey(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(elementCollection.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualElementCollectionMapping.getSpecifiedMapKey());
- assertNull(virtualElementCollectionMapping.getMapKey());
- assertFalse(virtualElementCollectionMapping.isPkMapKey());
- assertFalse(virtualElementCollectionMapping.isCustomMapKey());
- assertTrue(virtualElementCollectionMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setPkMapKey(true);
- assertEquals(null, virtualElementCollectionMapping.getMapKey());//no primary key on an embeddable
- assertTrue(virtualElementCollectionMapping.isPkMapKey());
- assertFalse(virtualElementCollectionMapping.isCustomMapKey());
- assertFalse(virtualElementCollectionMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setCustomMapKey(true);
- javaElementCollectionMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualElementCollectionMapping.getSpecifiedMapKey());
- assertEquals("city", virtualElementCollectionMapping.getMapKey());
- assertFalse(virtualElementCollectionMapping.isPkMapKey());
- assertTrue(virtualElementCollectionMapping.isCustomMapKey());
- assertFalse(virtualElementCollectionMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection xmlElementColection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(xmlElementColection.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormElementCollectionMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", xmlElementColection.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormElementCollectionMapping.setSpecifiedMapKey(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKey());
- assertNull(xmlElementColection.getMapKey().getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- OrmReadOnlyPersistentAttribute attribute = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) attribute.getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = virtualElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- attribute.addToXml();
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormElementCollectionMapping.setSpecifiedTargetClass("test.Address");
- mapKeyNames = ormElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormElementCollectionMapping.setSpecifiedTargetClass("String");
- mapKeyNames = ormElementCollectionMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- elementCollection.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNotNull(elementCollection.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- elementCollection.getMapKeyClass().setClassName("String");
- assertEquals("String", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", elementCollection.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- elementCollection.getMapKeyClass().setClassName(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass().getClassName());
-
- elementCollection.getMapKeyClass().setClassName("String");
- elementCollection.setMapKeyClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaElementCollectionMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualElementCollectionMapping.getMapKeyClass());
- assertEquals("Integer", virtualElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualElementCollectionMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection elementCollection = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormElementCollectionMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertEquals("String", elementCollection.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormElementCollectionMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormElementCollectionMapping.getSpecifiedMapKeyClass());
- assertNull(elementCollection.getMapKeyClass());
- }
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = (Orderable2_0) elementCollectionMapping.getOrderable();
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", orderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 elementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = (Orderable2_0) elementCollectionMapping.getOrderable();
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaElementCollectionMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 virtualElementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
- orderable = (Orderable2_0) virtualElementCollectionMapping.getOrderable();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(false, orderable.isNoOrdering());
- assertEquals(TYPE_NAME + "_addresses", orderable.getOrderColumn().getTable());
- assertEquals("addresses_ORDER", orderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaElementCollectionMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_addresses", orderable.getOrderColumn().getTable());
- assertEquals("FOO", orderable.getOrderColumn().getName());
- }
-
- public void testVirtualValueColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attrubte in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getValueColumn();
- assertEquals("addresses", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getValueColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getValueColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getValueColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getValueColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getValueColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullColumnDefaults() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- OrmColumn ormColumn = addressesVirtualMapping.getValueColumn();
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getValueColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getValueColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getValueColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getValueColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getValueColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getValueColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualValueColumnTable() throws Exception {
- createTestEntityWithGenericBasicElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //default attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getValueColumn();
-
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
- assertEquals("JAVA_COLLECTION_TABLE", virtualColumn.getTable());
- javaElementCollectionMapping.getValueColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make name persistent attribute not default
- addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesVirtualMapping.getValueColumn();
- assertNull(virtualColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getDefaultTable());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- elementCollectionResource.getAttributeOverrides().get(0).setName("FOO");
- elementCollectionResource.getAttributeOverrides().get(1).setName("BAR");
- elementCollectionResource.getAttributeOverrides().get(2).setName("BAZ");
-
- assertEquals(3, elementCollectionResource.getAttributeOverrides().size());
-
- attributeOverrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAR", elementCollectionResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAZ", elementCollectionResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getAttributeOverrides().get(2).getName());
-
-
- attributeOverrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
-
- assertEquals("BAZ", elementCollectionResource.getAttributeOverrides().get(0).getName());
- assertEquals("BAR", elementCollectionResource.getAttributeOverrides().get(1).getName());
- assertEquals("FOO", elementCollectionResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateAttributeOverrides() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- elementCollectionResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
-
- elementCollectionResource.getAttributeOverrides().get(0).setName("FOO");
- elementCollectionResource.getAttributeOverrides().get(1).setName("BAR");
- elementCollectionResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(1);
- attributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- elementCollectionResource.getAttributeOverrides().remove(0);
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- }
-
- public void testElementCollectionMappingNoUnderylingJavaAttribute() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"));
- ormPersistentAttribute.getMapping().setName("foo");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
-
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- OrmAttributeOverrideContainer attributeOverrideContainer = ormElementCollectionMapping.getValueAttributeOverrideContainer();
-
- assertEquals("foo", ormElementCollectionMapping.getName());
-
-
- assertFalse(attributeOverrideContainer.getSpecifiedOverrides().iterator().hasNext());
- assertFalse(attributeOverrideContainer.getVirtualOverrides().iterator().hasNext());
- }
-
- public void testVirtualAttributeOverrides() throws Exception {
- createTestEntityWithEmbeddableElementCollectionMapping();
- createTestTargetEmbeddableAddress();
- createTestEmbeddableState();
-
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType persistentType3 = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- //embedded mapping is virtual, specified attribute overrides should exist
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = persistentType.getAttributeNamed("addresses");
- ElementCollectionMapping2_0 elementCollectionMapping = (ElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- AttributeOverrideContainer attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- ListIterator<? extends AttributeOverride> specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- ReadOnlyAttributeOverride attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- ListIterator<? extends VirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- Column javaAttributeOverrideColumn = javaElementCollectionMapping.getValueAttributeOverrideContainer().getSpecifiedOverrides().iterator().next().getColumn();
-
- javaAttributeOverrideColumn.setSpecifiedName("FOO_COLUMN");
- javaAttributeOverrideColumn.setSpecifiedTable("FOO_TABLE");
- javaAttributeOverrideColumn.setColumnDefinition("COLUMN_DEF");
- javaAttributeOverrideColumn.setSpecifiedInsertable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUpdatable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedUnique(Boolean.TRUE);
- javaAttributeOverrideColumn.setSpecifiedNullable(Boolean.FALSE);
- javaAttributeOverrideColumn.setSpecifiedLength(Integer.valueOf(5));
- javaAttributeOverrideColumn.setSpecifiedPrecision(Integer.valueOf(6));
- javaAttributeOverrideColumn.setSpecifiedScale(Integer.valueOf(7));
-
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) persistentType3.getJavaPersistentType().getAttributeNamed("name").getMapping();
- javaBasicMapping.getColumn().setSpecifiedName("MY_STATE_COLUMN");
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- specifiedAttributeOverrides = attributeOverrideContainer.getSpecifiedOverrides().iterator();
- attributeOverride = specifiedAttributeOverrides.next();
- assertEquals("city", attributeOverride.getName());
- assertEquals("FOO_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- assertEquals("FOO_TABLE", attributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEF", attributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, attributeOverride.getColumn().isInsertable());
- assertEquals(false, attributeOverride.getColumn().isUpdatable());
- assertEquals(true, attributeOverride.getColumn().isUnique());
- assertEquals(false, attributeOverride.getColumn().isNullable());
- assertEquals(5, attributeOverride.getColumn().getLength());
- assertEquals(6, attributeOverride.getColumn().getPrecision());
- assertEquals(7, attributeOverride.getColumn().getScale());
-
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", attributeOverride.getName());
- assertEquals("MY_STATE_COLUMN", attributeOverride.getColumn().getSpecifiedName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", attributeOverride.getName());
- attributeOverride = virtualAttributeOverrides.next();
- assertEquals("zip", attributeOverride.getName());
-
-
-
- //embedded mapping is specified, virtual attribute overrides should exist
- persistentType.getAttributeNamed("addresses").addToXml();
- elementCollectionMapping = (OrmElementCollectionMapping2_0) persistentType.getAttributeNamed("addresses").getMapping();
- attributeOverrideContainer = elementCollectionMapping.getValueAttributeOverrideContainer();
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(4, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals(0, attributeOverrideContainer.getSpecifiedOverridesSize());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- ReadOnlyAttributeOverride virtualOverride = virtualAttributeOverrides.next();
- assertEquals("city", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualOverride.getName());
- assertEquals("MY_STATE_COLUMN", virtualOverride.getColumn().getName());
- assertEquals(TYPE_NAME + "_addresses", virtualOverride.getColumn().getTable());
- assertEquals(null, virtualOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualOverride.getColumn().isInsertable());
- assertEquals(true, virtualOverride.getColumn().isUpdatable());
- assertEquals(false, virtualOverride.getColumn().isUnique());
- assertEquals(true, virtualOverride.getColumn().isNullable());
- assertEquals(255, virtualOverride.getColumn().getLength());
- assertEquals(0, virtualOverride.getColumn().getPrecision());
- assertEquals(0, virtualOverride.getColumn().getScale());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualOverride.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualOverride.getColumn().getDefaultTable());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
-
- //set one of the virtual attribute overrides to specified, verify others are still virtual
- attributeOverrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- assertEquals(4, attributeOverrideContainer.getOverridesSize());
- assertEquals(1, attributeOverrideContainer.getSpecifiedOverridesSize());
- assertEquals(3, attributeOverrideContainer.getVirtualOverridesSize());
- assertEquals("city", attributeOverrideContainer.getSpecifiedOverrides().iterator().next().getName());
- virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.name", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("state.abbr", virtualOverride.getName());
- virtualOverride = virtualAttributeOverrides.next();
- assertEquals("zip", virtualOverride.getName());
- }
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //no longer an element collection mapping
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
-
- OrmElementCollectionMapping2_0 addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaElementCollectionMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_addresses", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ElementCollectionMapping2_0 addressesVirtualMapping = (ElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //entity table should have no affect on the collection table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getTable());
-
- //set Column table element in Java
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaElementCollectionMapping.getCollectionTable().setSpecifiedName("JAVA_COLLECTION_TABLE");
- assertEquals("JAVA_COLLECTION_TABLE", virtualColumn.getTable());
- javaElementCollectionMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", virtualColumn.getTable());
-
- //make addresses persistent attribute not default
- addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- addressesVirtualMapping = (OrmElementCollectionMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertNull(virtualColumn.getSpecifiedTable());
- assertEquals(TYPE_NAME + "_addresses", virtualColumn.getDefaultTable());
- }
-
- public void testSelfReferentialElementCollectionMapping() throws Exception {
- createSelfReferentialElementCollection();
- OrmPersistentType persistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Foo");
-
- ElementCollectionMapping2_0 mapping = (ElementCollectionMapping2_0) persistentType.getAttributeNamed("elementCollection").getMapping();
- assertFalse(mapping.getAllOverridableAttributeMappingNames().iterator().hasNext());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- elementCollectionResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, elementCollectionResource.getMapKeyEnumerated());
-
- elementCollectionResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- elementCollectionResource.setMapKeyEnumerated(null);
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormElementCollectionMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
- ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, elementCollectionResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, elementCollectionResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormElementCollectionMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormElementCollectionMapping.setMapKeyConverter(null);
- assertNull(elementCollectionResource.getMapKeyEnumerated());
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, elementCollectionResource.getMapKeyTemporal());
-
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, elementCollectionResource.getMapKeyTemporal());
-
- elementCollectionResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, elementCollectionResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- elementCollectionResource.setMapKeyTemporal(null);
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlElementCollection_2_0 elementCollectionResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- assertNull(elementCollectionResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormElementCollectionMapping.setMapKeyConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, elementCollectionResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, elementCollectionResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormElementCollectionMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormElementCollectionMapping.setMapKeyConverter(null);
- assertNull(elementCollectionResource.getMapKeyTemporal());
- assertNull(ormElementCollectionMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateConvert() throws Exception {
- createTestEntityWithElementCollectionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlConvertibleMapping elementCollectionResource = (XmlConvertibleMapping) getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
- JavaElementCollectionMapping2_0 javaElementCollectionMapping = (JavaElementCollectionMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
-
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- elementCollectionResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.class, ormElementCollectionMapping.getConverter().getType());
- assertEquals("myConvert", elementCollectionResource.getConvert());
-
- //set lob to null in the resource model
- elementCollectionResource.setConvert(null);
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
-
-
- javaElementCollectionMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("address");
- EclipseLinkElementCollectionMapping2_0 virtualElementCollectionMapping = (EclipseLinkElementCollectionMapping2_0) ormPersistentAttribute2.getMapping();
-
- assertEquals(EclipseLinkConvert.class, virtualElementCollectionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) virtualElementCollectionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, elementCollectionResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.class, virtualElementCollectionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) virtualElementCollectionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, elementCollectionResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaElementCollectionMapping.getConverter()).getSpecifiedConverterName());
-
- javaElementCollectionMapping.setConverter(null);
- assertNull(virtualElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
- assertNull(javaElementCollectionMapping.getConverter().getType());
- }
-
- public void testModifyConvert() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("elementCollection"), MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmElementCollectionMapping2_0 ormElementCollectionMapping = (OrmElementCollectionMapping2_0) ormPersistentAttribute.getMapping();
- XmlConvertibleMapping elementCollectionResource = (XmlConvertibleMapping) getXmlEntityMappings().getEntities().get(0).getAttributes().getElementCollections().get(0);
-
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormElementCollectionMapping.setConverter(EclipseLinkConvert.class);
- assertEquals("", elementCollectionResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormElementCollectionMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormElementCollectionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", elementCollectionResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormElementCollectionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormElementCollectionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormElementCollectionMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
-
- //set lob to false in the context model
- ormElementCollectionMapping.setConverter(null);
- assertNull(ormElementCollectionMapping.getConverter().getType());
- assertEquals(null, elementCollectionResource.getConvert());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java
deleted file mode 100644
index 02c27dd067..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmEntityTests.java
+++ /dev/null
@@ -1,1807 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AssociationOverride;
-import org.eclipse.jpt.jpa.core.context.AssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.AttributeOverride;
-import org.eclipse.jpt.jpa.core.context.AttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.EmbeddedMapping;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.VirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAssociationOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmAttributeOverrideContainer;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmMappedSuperclass;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAssociationOverride;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVirtualAttributeOverride;
-import org.eclipse.jpt.jpa.core.jpa2.MappingKeys2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlAssociationOverride;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmEntityTests
- extends EclipseLink2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public EclipseLink2_0OrmEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private ICompilationUnit createTestAbstractEntityTablePerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.INHERITANCE, JPA.INHERITANCE_TYPE, JPA.ONE_TO_ONE, JPA.MANY_TO_ONE, JPA.ONE_TO_MANY, JPA.MANY_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritance(strategy=InheritanceType.TABLE_PER_CLASS)");
- sb.append("abstract");
- }
-
- @Override
- public void appendGetIdMethodAnnotationTo(StringBuilder sb) {
- sb.append("private String foo;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne");
- sb.append(CR);
- sb.append(" private int address;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne");
- sb.append(CR);
- sb.append(" private int address2;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany");
- sb.append(CR);
- sb.append(" private int address3;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany");
- sb.append(CR);
- sb.append(" private int address4;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestMappedSuperclassCustomerWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("Customer ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String id;").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Customer.java", sourceWriter);
- }
-
- private void createTestEntityLongTimeCustomer() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("LongTimeCustomer extends Customer ");
- sb.append("{}");
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "LongTimeCustomer.java", sourceWriter);
- }
-
-
- private void createTestEmbeddableAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDED);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String street;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" @Embedded").append(CR);
- sb.append(" private ZipCode zipCode;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEmbeddableZipCode() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("ZipCode").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String zip;").append(CR);
- sb.append(CR);
- sb.append(" private String plusfour;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "ZipCode.java", sourceWriter);
- }
-
- public void testAttributeMappingKeyAllowed() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.EMBEDDED_ID_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- assertTrue(entity.attributeMappingKeyAllowed(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY));
- }
-
- public void testOverridableAttributes() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributes.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributes = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testOverridableAttributeNames() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertFalse(overridableAttributeNames.hasNext());
-
-
- entity.setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
-
- overridableAttributeNames = entity.getOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testAllOverridableAttributes() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- Iterator<String> overridableAttributes = getJavaEntity().getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAttributesTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributes = ormEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
-
-
- OrmEntity abstractEntity = (OrmEntity) ormEntity.getParentEntity();
- overridableAttributes = abstractEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributes.next());
- assertEquals("name", overridableAttributes.next());
- assertEquals("foo", overridableAttributes.next());
- assertFalse(overridableAttributes.hasNext());
- }
-
- public void testAllOverridableAssociationsTablePerClass() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociations = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
-
-
- OrmEntity abstractEntity = (OrmEntity) ormEntity.getParentEntity();
- overridableAssociations = abstractEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-//TODO
-// public void testAllOverridableAttributesMappedSuperclassInOrmXml() throws Exception {
-// createTestMappedSuperclass();
-// createTestSubType();
-// addXmlClassRef(PACKAGE_NAME + ".AnnotationTestTypeChild");
-// getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-//
-// Iterator<PersistentAttribute> overridableAttributes = getJavaEntity().allOverridableAttributes();
-// assertEquals("id", overridableAttributes.next().getName());
-// assertEquals("name", overridableAttributes.next().getName());
-// assertEquals("foo", overridableAttributes.next().getName());
-// assertFalse(overridableAttributes.hasNext());
-// }
-
- public void testAllOverridableAttributeNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAttributeNames = ormEntity.getAllOverridableAttributeNames().iterator();
- assertEquals("id", overridableAttributeNames.next());
- assertEquals("name", overridableAttributeNames.next());
- assertEquals("foo", overridableAttributeNames.next());
- assertFalse(overridableAttributeNames.hasNext());
- }
-
- public void testSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = entity.getAttributeOverrideContainer();
-
- ListIterator<OrmAttributeOverride> specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().add(1, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
-
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("BAZ");
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().move(1, 0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAttributeOverrides.next().getName());
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAttributeOverrides.next().getName());
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAttributeOverrides.next().getName());
- assertFalse(specifiedAttributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- specifiedAttributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAttributeOverrides.hasNext());
- }
-
- public void testDefaultAttributeOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- OrmMappedSuperclass mappedSuperclass = (OrmMappedSuperclass) ormEntity.getPersistentType().getSuperPersistentType().getMapping();
-
- mappedSuperclass.getPersistentType().getAttributeNamed("id").addToXml();
- BasicMapping idMapping = (BasicMapping) mappedSuperclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testDefaultAttributeOverridesEntityHierachy() throws Exception {
- createTestAbstractEntityTablePerClass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- VirtualAttributeOverride virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
-
- OrmEntity superclass = (OrmEntity) ormEntity.getParentEntity();
-
- superclass.getPersistentType().getAttributeNamed("id").addToXml();
- BasicMapping idMapping = (BasicMapping) superclass.getPersistentType().getAttributeNamed("id").getMapping();
- idMapping.getColumn().setSpecifiedName("FOO");
- idMapping.getColumn().setSpecifiedTable("BAR");
-
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("FOO", virtualAttributeOverride.getColumn().getName());
- assertEquals("BAR", virtualAttributeOverride.getColumn().getTable());
-
- idMapping.getColumn().setSpecifiedName(null);
- idMapping.getColumn().setSpecifiedTable(null);
- assertEquals(0, entityResource.getAttributeOverrides().size());
-
- virtualAttributeOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertEquals("id", virtualAttributeOverride.getColumn().getName());
- assertEquals(SUB_TYPE_NAME, virtualAttributeOverride.getColumn().getTable());
-
- virtualAttributeOverride.convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testSpecifiedAttributeOverridesSize() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().add(OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAttributeOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("bar");
- assertEquals(4, overrideContainer.getOverridesSize());
- }
-
- public void testAttributeOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("id", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("name", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
- }
-
- public void testAttributeOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverrides.next();
- virtualAttributeOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
- }
-
- public void testAttributeOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("foo", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals(2, entityResource.getAttributeOverrides().size());
-
- Iterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals("foo", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals(1, entityResource.getAttributeOverrides().size());
-
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, entityResource.getAttributeOverrides().size());
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAttributeOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(3, entityResource.getAttributeOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(2, 0);
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- assertEquals("name", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("foo", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(2).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("foo", attributeOverrides.next().getName());
- assertEquals("name", attributeOverrides.next().getName());
- assertEquals("id", attributeOverrides.next().getName());
-
- assertEquals("foo", entityResource.getAttributeOverrides().get(0).getName());
- assertEquals("name", entityResource.getAttributeOverrides().get(1).getName());
- assertEquals("id", entityResource.getAttributeOverrides().get(2).getName());
- }
-
- public void testUpdateSpecifiedAttributeOverrides() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- entityResource.getAttributeOverrides().add(0, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(0).setName("FOO");
- entityResource.getAttributeOverrides().add(1, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(1).setName("BAR");
- entityResource.getAttributeOverrides().add(2, OrmFactory.eINSTANCE.createXmlAttributeOverride());
- entityResource.getAttributeOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAttributeOverride> attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(2, 0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().move(0, 1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("BAR", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertEquals("FOO", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(1);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", attributeOverrides.next().getName());
- assertFalse(attributeOverrides.hasNext());
-
- entityResource.getAttributeOverrides().remove(0);
- attributeOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(attributeOverrides.hasNext());
- }
-
- public void testAttributeOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAttributeOverrideContainer overrideContainer = ormEntity.getAttributeOverrideContainer();
-
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AttributeOverride specifiedAttributeOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAttributeOverride.isVirtual());
-
-
- virtualAttributeOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
-
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("foo", virtualAttributeOverride.getName());
- assertTrue(virtualAttributeOverride.isVirtual());
- assertFalse(virtualAttributeOverrides.hasNext());
- }
-
- public void testOverridableAssociationNames() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity entity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociationNames = entity.getOverridableAssociationNames().iterator();
- assertFalse(overridableAssociationNames.hasNext());
- }
-
-// //TODO add all mapping types to the mapped superclass to test which ones are overridable
- public void testAllOverridableAssociationNames() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociationNames = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociationNames.next());
- assertEquals("address2", overridableAssociationNames.next());
- assertEquals("address3", overridableAssociationNames.next());
- assertEquals("address4", overridableAssociationNames.next());
- assertFalse(overridableAssociationNames.hasNext());
- }
-
- public void testAllOverridableAssociations() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
-
- Iterator<String> overridableAssociations = ormEntity.getAllOverridableAssociationNames().iterator();
- assertEquals("address", overridableAssociations.next());
- assertEquals("address2", overridableAssociations.next());
- assertEquals("address3", overridableAssociations.next());
- assertEquals("address4", overridableAssociations.next());
- assertFalse(overridableAssociations.hasNext());
- }
-
- public void testSpecifiedAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmAssociationOverride> specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
-
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- //add an annotation to the resource model and verify the context model is updated
- XmlAssociationOverride xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(0, xmlAssociationOverride);
- xmlAssociationOverride.setName("FOO");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(1, xmlAssociationOverride);
- xmlAssociationOverride.setName("BAR");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- xmlAssociationOverride = OrmFactory.eINSTANCE.createXmlAssociationOverride();
- entityResource.getAssociationOverrides().add(0, xmlAssociationOverride);
- xmlAssociationOverride.setName("BAZ");
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- //move an annotation to the resource model and verify the context model is updated
- entityResource.getAssociationOverrides().move(1, 0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", specifiedAssociationOverrides.next().getName());
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", specifiedAssociationOverrides.next().getName());
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", specifiedAssociationOverrides.next().getName());
- assertFalse(specifiedAssociationOverrides.hasNext());
-
-
- entityResource.getAssociationOverrides().remove(0);
- specifiedAssociationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(specifiedAssociationOverrides.hasNext());
- }
-
- public void testDefaultAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(FULLY_QUALIFIED_SUB_TYPE_NAME, entityResource.getClassName());
- assertTrue(entityResource.getAssociationOverrides().isEmpty());
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- OrmVirtualAssociationOverride virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-//
-// //MappedSuperclass mappedSuperclass = (MappedSuperclass) javaPersistentType().getMapping();
-// //BasicMapping idMapping = (BasicMapping) mappedSuperclass.persistentType().attributeNamed("id").getMapping();
-// //idMapping.getColumn().setSpecifiedName("FOO");
-// //idMapping.getColumn().setSpecifiedTable("BAR");
-//
-// assertEquals(SUB_TYPE_NAME, entityResource.getName());
-// assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
-// assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
-// //idMapping.getColumn().setSpecifiedName(null);
-// //idMapping.getColumn().setSpecifiedTable(null);
-// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-// assertNull(typeResource.getAnnotation(AssociationOverrideAnnotation.ANNOTATION_NAME));
-// assertNull(typeResource.getAnnotation(AssociationOverridesAnnotation.ANNOTATION_NAME));
-
- virtualAssociationOverride = overrideContainer.getVirtualOverrides().iterator().next();
- assertEquals("address", virtualAssociationOverride.getName());
-
- virtualAssociationOverride.convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
-
-
-// //TODO joinColumns for default association overrides
-//// IJoinColumn defaultJoinColumn = defaultAssociationOverride.joinColumns().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-////
-//// IMappedSuperclass mappedSuperclass = (IMappedSuperclass) javaPersistentType().getMapping();
-////
-//// IOneToOneMapping addressMapping = (IOneToOneMapping) mappedSuperclass.persistentType().attributeNamed("address").getMapping();
-//// IJoinColumn joinColumn = addressMapping.addSpecifiedJoinColumn(0);
-//// joinColumn.setSpecifiedName("FOO");
-//// joinColumn.setSpecifiedReferencedColumnName("BAR");
-//// joinColumn.setSpecifiedTable("BAZ");
-////
-//// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-//// assertNull(typeResource.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(typeResource.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// assertEquals(1, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultAssociationOverride.getName());
-//// assertEquals("FOO", defaultJoinColumn.getName());
-//// assertEquals("BAR", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals("BAZ", defaultJoinColumn.getTable());
-////
-//// joinColumn.setSpecifiedName(null);
-//// joinColumn.setSpecifiedReferencedColumnName(null);
-//// joinColumn.setSpecifiedTable(null);
-//// assertEquals(SUB_TYPE_NAME, typeResource.getName());
-//// assertNull(typeResource.annotation(AssociationOverride.ANNOTATION_NAME));
-//// assertNull(typeResource.annotation(AssociationOverrides.ANNOTATION_NAME));
-////
-//// defaultAssociationOverride = javaEntity.defaultAssociationOverrides().next();
-//// assertEquals("address", defaultJoinColumn.getName());
-//// assertEquals("address", defaultJoinColumn.getReferencedColumnName());
-//// assertEquals(SUB_TYPE_NAME, defaultJoinColumn.getTable());
-////
-//// javaEntity.addSpecifiedAssociationOverride(0).setName("address");
-//// assertEquals(0, CollectionTools.size(javaEntity.defaultAssociationOverrides()));
-
- }
-
- public void testSpecifiedAssociationOverridesSize() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, overrideContainer.getSpecifiedOverridesSize());
-
- //add to the resource model and verify the context model is updated
- entityResource.getAssociationOverrides().add(OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("BAR");
-
- assertEquals(2, overrideContainer.getSpecifiedOverridesSize());
- }
-
- public void testDefaultAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(3, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(2, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(1, overrideContainer.getVirtualOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(0, overrideContainer.getVirtualOverridesSize());
- }
-
- public void testAssociationOverridesSize() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- assertEquals(4, overrideContainer.getOverridesSize());
-
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("bar");
- assertEquals(5, overrideContainer.getOverridesSize());
- }
-
- public void testAssociationOverrideSetVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- AssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("address", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address2", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, entityResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtual2() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverrides.next();
- virtualAssociationOverrides.next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", entityResource.getAssociationOverrides().get(1).getName());
- assertEquals(2, entityResource.getAssociationOverrides().size());
- }
-
- public void testAssociationOverrideSetVirtualTrue() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals(1, entityResource.getAssociationOverrides().size());
-
- Iterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
-
- overrideContainer.getSpecifiedOverrides().iterator().next().convertToVirtual();
- assertEquals(0, entityResource.getAssociationOverrides().size());
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testMoveSpecifiedAssociationOverride() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
-
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(2, entityResource.getAssociationOverrides().size());
-
-
- overrideContainer.moveSpecifiedOverride(1, 0);
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address2", associationOverrides.next().getName());
- assertEquals("address", associationOverrides.next().getName());
-
- assertEquals("address2", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address", entityResource.getAssociationOverrides().get(1).getName());
-
-
- overrideContainer.moveSpecifiedOverride(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("address", associationOverrides.next().getName());
- assertEquals("address2", associationOverrides.next().getName());
-
- assertEquals("address", entityResource.getAssociationOverrides().get(0).getName());
- assertEquals("address2", entityResource.getAssociationOverrides().get(1).getName());
- }
-
- public void testUpdateSpecifiedAssociationOverrides() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
-
- entityResource.getAssociationOverrides().add(0, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(0).setName("FOO");
- entityResource.getAssociationOverrides().add(1, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(1).setName("BAR");
- entityResource.getAssociationOverrides().add(2, OrmFactory.eINSTANCE.createXmlAssociationOverride());
- entityResource.getAssociationOverrides().get(2).setName("BAZ");
-
- ListIterator<OrmAssociationOverride> associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("FOO", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(2, 0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().move(0, 1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("BAR", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertEquals("FOO", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(1);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertEquals("BAZ", associationOverrides.next().getName());
- assertFalse(associationOverrides.hasNext());
-
- entityResource.getAssociationOverrides().remove(0);
- associationOverrides = overrideContainer.getSpecifiedOverrides().iterator();
- assertFalse(associationOverrides.hasNext());
- }
-
- public void testAssociationOverrideIsVirtual() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "test.AnnotationTestTypeChild");
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEntity ormEntity = (OrmEntity) ormPersistentType.getMapping();
- OrmAssociationOverrideContainer overrideContainer = ormEntity.getAssociationOverrideContainer();
-
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
-
- overrideContainer.getVirtualOverrides().iterator().next().convertToSpecified();
- AssociationOverride specifiedAssociationOverride = overrideContainer.getSpecifiedOverrides().iterator().next();
- assertFalse(specifiedAssociationOverride.isVirtual());
-
-
- virtualAssociationOverrides = overrideContainer.getVirtualOverrides().iterator();
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address2", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address3", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
-
- virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address4", virtualAssociationOverride.getName());
- assertTrue(virtualAssociationOverride.isVirtual());
- assertFalse(virtualAssociationOverrides.hasNext());
- }
-
- public void testNestedVirtualAttributeOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAttributeOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- zipCodePersistentType.getAttributeNamed("plusfour").addToXml();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- addressPersistentType.getAttributeNamed("zipCode").addToXml();
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
-
- public void testNestedVirtualAttributeOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- OrmPersistentType customerPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- OrmPersistentType addressPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentType zipCodePersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- customerPersistentType.getJavaPersistentType().getAttributeNamed("address").setMappingKey(MappingKeys2_0.ELEMENT_COLLECTION_ATTRIBUTE_MAPPING_KEY);
- OrmAttributeOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
-
- assertEquals(6, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAttributeOverride> virtualAttributeOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAttributeOverride virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("id", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("name", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.street", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.city", virtualAttributeOverride.getName());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.zip", virtualAttributeOverride.getName());
- assertEquals("zip", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- virtualAttributeOverride = virtualAttributeOverrides.next();
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("plusfour", virtualAttributeOverride.getColumn().getName());
- assertEquals("LongTimeCustomer", virtualAttributeOverride.getColumn().getTable());
- assertEquals(null, virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
-
- zipCodePersistentType.getAttributeNamed("plusfour").addToXml();
- BasicMapping plusFourMapping = (BasicMapping) zipCodePersistentType.getAttributeNamed("plusfour").getMapping();
- plusFourMapping.getColumn().setSpecifiedName("BLAH");
- plusFourMapping.getColumn().setSpecifiedTable("BLAH_TABLE");
- plusFourMapping.getColumn().setColumnDefinition("COLUMN_DEFINITION");
- plusFourMapping.getColumn().setSpecifiedInsertable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUpdatable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedUnique(Boolean.TRUE);
- plusFourMapping.getColumn().setSpecifiedNullable(Boolean.FALSE);
- plusFourMapping.getColumn().setSpecifiedLength(Integer.valueOf(5));
- plusFourMapping.getColumn().setSpecifiedPrecision(Integer.valueOf(6));
- plusFourMapping.getColumn().setSpecifiedScale(Integer.valueOf(7));
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- //check the top-level embedded (Customer.address) attribute override to verify it is getting settings from the specified column on Zipcode.plusfour
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(false, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(false, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(5, virtualAttributeOverride.getColumn().getLength());
- assertEquals(6, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(7, virtualAttributeOverride.getColumn().getScale());
-
- //set an attribute override on Address.zipCode embedded mapping
- addressPersistentType.getAttributeNamed("zipCode").addToXml();
- AttributeOverride specifiedAttributeOverride = ((VirtualAttributeOverride) ((EmbeddedMapping) addressPersistentType.getAttributeNamed("zipCode").getMapping()).getAttributeOverrideContainer().getOverrideNamed("plusfour")).convertToSpecified();
- specifiedAttributeOverride.getColumn().setSpecifiedName("BLAH_OVERRIDE");
- specifiedAttributeOverride.getColumn().setSpecifiedTable("BLAH_TABLE_OVERRIDE");
- specifiedAttributeOverride.getColumn().setColumnDefinition("COLUMN_DEFINITION_OVERRIDE");
-
-
- attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAttributeOverrideContainer();
- virtualAttributeOverride = (OrmVirtualAttributeOverride) attributeOverrideContainer.getOverrideNamed("address.zipCode.plusfour");
- assertEquals("address.zipCode.plusfour", virtualAttributeOverride.getName());
- assertEquals("BLAH_OVERRIDE", virtualAttributeOverride.getColumn().getName());
- assertEquals("BLAH_TABLE_OVERRIDE", virtualAttributeOverride.getColumn().getTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", virtualAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, virtualAttributeOverride.getColumn().isInsertable());
- assertEquals(true, virtualAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, virtualAttributeOverride.getColumn().isUnique());
- assertEquals(true, virtualAttributeOverride.getColumn().isNullable());
- assertEquals(255, virtualAttributeOverride.getColumn().getLength());
- assertEquals(0, virtualAttributeOverride.getColumn().getPrecision());
- assertEquals(0, virtualAttributeOverride.getColumn().getScale());
-
- specifiedAttributeOverride = virtualAttributeOverride.convertToSpecified();
- assertEquals(false, specifiedAttributeOverride.isVirtual());
- assertEquals("address.zipCode.plusfour", specifiedAttributeOverride.getName());
- //TODO I have the default wrong in this case, but this was wrong before as well. Need to fix this later
-// assertEquals("plusfour", specifiedAttributeOverride.getColumn().getDefaultName());
- assertEquals("BLAH_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedName());
-// assertEquals("Customer", specifiedAttributeOverride.getColumn().getDefaultTable());
- assertEquals("BLAH_TABLE_OVERRIDE", specifiedAttributeOverride.getColumn().getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION_OVERRIDE", specifiedAttributeOverride.getColumn().getColumnDefinition());
- assertEquals(true, specifiedAttributeOverride.getColumn().isInsertable());
- assertEquals(true, specifiedAttributeOverride.getColumn().isUpdatable());
- assertEquals(false, specifiedAttributeOverride.getColumn().isUnique());
- assertEquals(true, specifiedAttributeOverride.getColumn().isNullable());
- assertEquals(255, specifiedAttributeOverride.getColumn().getLength());
- assertEquals(0, specifiedAttributeOverride.getColumn().getPrecision());
- assertEquals(0, specifiedAttributeOverride.getColumn().getScale());
- }
- public void testNestedVirtualAssociationOverrides() throws Exception {
- createTestMappedSuperclassCustomer();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAssociationOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testNestedVirtualAssociationOverridesElementCollection() throws Exception {
- createTestMappedSuperclassCustomerWithElementCollection();
- createTestEntityLongTimeCustomer();
- createTestEmbeddableAddress();
- createTestEmbeddableZipCode();
-
- getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Customer");
- OrmPersistentType longTimeCustomerPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".LongTimeCustomer");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".ZipCode");
-
- OrmAssociationOverrideContainer attributeOverrideContainer = ((OrmEntity) longTimeCustomerPersistentType.getMapping()).getAssociationOverrideContainer();
-
- assertEquals(1, attributeOverrideContainer.getVirtualOverridesSize());
- ListIterator<OrmVirtualAssociationOverride> virtualAssociationOverrides = attributeOverrideContainer.getVirtualOverrides().iterator();
- OrmVirtualAssociationOverride virtualAssociationOverride = virtualAssociationOverrides.next();
- assertEquals("address.state", virtualAssociationOverride.getName());
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable2_0 = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(null, cacheable2_0.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable2_0.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, entityResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable2_0.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, entityResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(null);
- assertEquals(null, cacheable2_0.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlEntity entityResource = getXmlEntityMappings().getEntities().get(0);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
-
- entityResource.setCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, entityResource.getCacheable());
-
- entityResource.setCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, entityResource.getCacheable());
-
- entityResource.setCacheable(null);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, entityResource.getCacheable());
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- assertEquals(SharedCacheMode.DISABLE_SELECTIVE, persistenceUnit2_0.getSharedCacheMode());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.UNSPECIFIED);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromSuperType() throws Exception {
- createTestEntity();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity subEntity = (EclipseLinkEntity) subOrmPersistentType.getMapping();
- EclipseLinkEntity entity = (EclipseLinkEntity) ormPersistentType.getMapping();
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subEntity).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) entity).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromJava() throws Exception {
- createTestEntity();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subOrmPersistentType.getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
-
- Cacheable2_0 javaCacheable = ((CacheableHolder2_0) ormPersistentType.getJavaPersistentType().getMapping()).getCacheable();
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromMappedSuperClass() throws Exception {
- createTestMappedSuperclass();
- createTestSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntity subEntity = (EclipseLinkEntity) subOrmPersistentType.getMapping();
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subEntity).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) mappedSuperclass).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java
deleted file mode 100644
index 5dfe280f5c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToManyMappingTests.java
+++ /dev/null
@@ -1,1099 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlManyToMany_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmManyToManyMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmManyToManyMappingTests(String name) {
- super(name);
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestTypeWithCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("java.util.Collection");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" private Collection<Foo> manyToManyMapping;").append(CR);
- }
- });
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidManyToManyMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- ManyToManyMapping manyToManyMapping = (ManyToManyMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- manyToManyMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- manyToManyMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = manyToManyMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testUpdateMapKey() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToManyMapping"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKey(OrmFactory.eINSTANCE.createMapKey());
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNotNull(manyToMany.getMapKey());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKey().setName("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKey().setName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey().getName());
-
- manyToMany.getMapKey().setName("myMapKey");
- manyToMany.setMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualManyToManyMapping.getSpecifiedMapKey());
- assertNull(virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertTrue(virtualManyToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualManyToManyMapping.getMapKey());
- assertTrue(virtualManyToManyMapping.isPkMapKey());
- assertFalse(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setCustomMapKey(true);
- javaManyToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualManyToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualManyToManyMapping.getMapKey());
- assertFalse(virtualManyToManyMapping.isPkMapKey());
- assertTrue(virtualManyToManyMapping.isCustomMapKey());
- assertFalse(virtualManyToManyMapping.isNoMapKey());
- }
-
- public void testModifyMapKey() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToManyMapping"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping ormManyToManyMapping = (OrmManyToManyMapping) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKey("myMapKey");
- assertEquals("myMapKey", ormManyToManyMapping.getSpecifiedMapKey());
- assertEquals("myMapKey", manyToMany.getMapKey().getName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setSpecifiedMapKey(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKey());
- assertNull(manyToMany.getMapKey().getName());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping javaManyToManyMapping = (JavaManyToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").addToXml();
- OrmManyToManyMapping specifiedManyToManyMapping = (OrmManyToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- specifiedManyToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.foo", mapKeyNames.next());
- assertEquals("state.address", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- specifiedManyToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = specifiedManyToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToManyMapping"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- manyToMany.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNotNull(manyToMany.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- manyToMany.getMapKeyClass().setClassName("String");
- assertEquals("String", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", manyToMany.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- manyToMany.getMapKeyClass().setClassName(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass().getClassName());
-
- manyToMany.getMapKeyClass().setClassName("String");
- manyToMany.setMapKeyClass(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- ManyToManyMapping2_0 virtualManyToManyMapping = (ManyToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertEquals("java.lang.String", virtualManyToManyMapping.getMapKeyClass());
- assertNull(virtualManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualManyToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaManyToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualManyToManyMapping.getMapKeyClass());
- assertEquals("Integer", virtualManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualManyToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToManyMapping"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany manyToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormManyToManyMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", manyToMany.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormManyToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormManyToManyMapping.getSpecifiedMapKeyClass());
- assertNull(manyToMany.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType printQueuePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- OrmPersistentAttribute jobsPersistentAttribute = printQueuePersistentType.addAttributeToXml(printQueuePersistentType.getAttributeNamed("jobs"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping jobsMapping = (OrmManyToManyMapping) jobsPersistentAttribute.getMapping();
- jobsMapping.getRelationship().setStrategyToMappedBy();
- jobsMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queues");
-
- OrmPersistentType printJobPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute queuesPersistentAttribute = printJobPersistentType.addAttributeToXml(printJobPersistentType.getAttributeNamed("queues"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping queuesMapping = (OrmManyToManyMapping) queuesPersistentAttribute.getMapping();
-
- getOrmXmlResource().save(null);
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- OrderColumn2_0 jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- OrderColumn2_0 queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
-
- jobsOrderable.setOrderColumnOrdering(true);
- jobsOrderColumn = jobsOrderable.getOrderColumn();
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(null, jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderable.setOrderColumnOrdering(true);
- queuesOrderColumn = queuesOrderable.getOrderColumn();
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(null, queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
- jobsOrderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", jobsOrderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", jobsOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", jobsOrderColumn.getTable());
- queuesOrderColumn.setSpecifiedName("BAR");
- assertEquals("BAR", queuesOrderColumn.getSpecifiedName());
- assertEquals("queues_ORDER", queuesOrderColumn.getDefaultName());
- assertEquals("PrintJob_PrintQueue", queuesOrderColumn.getTable());
-
-
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
- assertEquals("MY_TABLE_PrintQueue", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_PrintQueue", queuesOrderColumn.getTable());
-
- ((Entity) printQueuePersistentType.getMapping()).getTable().setSpecifiedName("OTHER_TABLE");
- assertEquals("MY_TABLE_OTHER_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_TABLE_OTHER_TABLE", queuesOrderColumn.getTable());
-
- queuesMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("MY_JOIN_TABLE");
- assertEquals("MY_JOIN_TABLE", jobsOrderColumn.getTable());
- assertEquals("MY_JOIN_TABLE", queuesOrderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType printQueuePersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- OrmPersistentAttribute jobsPersistentAttribute = printQueuePersistentType.addAttributeToXml(printQueuePersistentType.getAttributeNamed("jobs"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping jobsMapping = (OrmManyToManyMapping) jobsPersistentAttribute.getMapping();
-
- OrmPersistentType printJobPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute queuesPersistentAttribute = printJobPersistentType.addAttributeToXml(printJobPersistentType.getAttributeNamed("queues"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping queuesMapping = (OrmManyToManyMapping) queuesPersistentAttribute.getMapping();
-
- Orderable2_0 jobsOrderable = ((Orderable2_0) jobsMapping.getOrderable());
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- Orderable2_0 queuesOrderable = ((Orderable2_0) queuesMapping.getOrderable());
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
- JavaManyToManyMapping javaJobsManyToManyMapping = (JavaManyToManyMapping) jobsPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaJobsManyToManyMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, jobsOrderable.isOrderColumnOrdering());
- assertEquals(true, jobsOrderable.isNoOrdering());
- assertEquals(false, queuesOrderable.isOrderColumnOrdering());
- assertEquals(true, queuesOrderable.isNoOrdering());
-
- jobsPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute jobsPersistentAttribute2 = printQueuePersistentType.getAttributeNamed("jobs");
- ManyToManyMapping virtualJobsMapping = (ManyToManyMapping) jobsPersistentAttribute2.getMapping();
- jobsOrderable = ((Orderable2_0) virtualJobsMapping.getOrderable());
- assertEquals(true, jobsOrderable.isOrderColumnOrdering());
- assertEquals(false, jobsOrderable.isNoOrdering());
- assertEquals("PrintJob_PrintQueue", jobsOrderable.getOrderColumn().getTable());
- assertEquals("jobs_ORDER", jobsOrderable.getOrderColumn().getName());
- queuesPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute queuesPersistentAttribute2 = printJobPersistentType.getAttributeNamed("queues");
- ManyToManyMapping virtualQueuesMapping = (ManyToManyMapping) queuesPersistentAttribute2.getMapping();
- queuesOrderable = ((Orderable2_0) virtualQueuesMapping.getOrderable());
- assertEquals(true, queuesOrderable.isOrderColumnOrdering());
- assertEquals(false, queuesOrderable.isNoOrdering());
- assertEquals("PrintJob_PrintQueue", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaJobsManyToManyMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals("PrintJob_PrintQueue", jobsOrderable.getOrderColumn().getTable());
- assertEquals("FOO", jobsOrderable.getOrderColumn().getName());
- assertEquals("PrintJob_PrintQueue", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
-
- JavaManyToManyMapping javaQueuesManyToManyMapping = (JavaManyToManyMapping) queuesPersistentAttribute2.getJavaPersistentAttribute().getMapping();
- javaQueuesManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JOIN_TABLE");
- assertEquals("JOIN_TABLE", jobsOrderable.getOrderColumn().getTable());
- assertEquals("FOO", jobsOrderable.getOrderColumn().getName());
- assertEquals("JOIN_TABLE", queuesOrderable.getOrderColumn().getTable());
- assertEquals("queues_ORDER", queuesOrderable.getOrderColumn().getName());
- }
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany(mappedBy=\"queues\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<test.PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<test.PrintQueue> queues;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ManyToManyMapping2_0 addressesVirtualMapping = (ManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column virtualColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_Address", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
-
- //set Column annotation in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaManyToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", virtualColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", virtualColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", virtualColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, virtualColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, virtualColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), virtualColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), virtualColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), virtualColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- //becomes a 1-m by default
- OneToManyMapping2_0 addressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- virtualColumn = addressesMapping.getMapKeyColumn();
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
-
- assertEquals("addresses_KEY", virtualColumn.getName());
- assertEquals(TYPE_NAME + "_Address", virtualColumn.getTable());
- assertEquals(null, virtualColumn.getColumnDefinition());
- assertTrue(virtualColumn.isInsertable());
- assertTrue(virtualColumn.isUpdatable());
- assertTrue(virtualColumn.isNullable());
- assertFalse(virtualColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, virtualColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, virtualColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, virtualColumn.getScale());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OrmManyToManyMapping2_0 addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaManyToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ManyToManyMapping2_0 addressesVirtualMapping = (ManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", ormColumn.getTable());
-
- //set Column table element in Java
- JavaManyToManyMapping2_0 javaManyToManyMapping = (JavaManyToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaManyToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", ormColumn.getTable());
- javaManyToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", ormColumn.getTable());
-
- //make addresses persistent attribute not default
- addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- addressesVirtualMapping = (OrmManyToManyMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertNull(ormColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE_Address", ormColumn.getDefaultTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualManyToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = (Cascade2_0) virtualManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(virtualManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualManyToManyMapping).getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.addToXml(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute= ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmEclipseLinkManyToManyMapping ormManyToManyMapping = (OrmEclipseLinkManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = (Cascade2_0) ormManyToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(null, ormManyToManyMapping.getJoinFetch().getValue());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToManyMapping"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- manyToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, manyToManyResource.getMapKeyEnumerated());
-
- manyToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- manyToManyResource.setMapKeyEnumerated(null);
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToManyMapping"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormManyToManyMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
- ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, manyToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, manyToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormManyToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormManyToManyMapping.setMapKeyConverter(null);
- assertNull(manyToManyResource.getMapKeyEnumerated());
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToManyMapping"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, manyToManyResource.getMapKeyTemporal());
-
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, manyToManyResource.getMapKeyTemporal());
-
- manyToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, manyToManyResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- manyToManyResource.setMapKeyTemporal(null);
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToManyMapping"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmManyToManyMapping2_0 ormManyToManyMapping = (OrmManyToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlManyToMany_2_0 manyToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getManyToManys().get(0);
-
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- assertNull(manyToManyResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormManyToManyMapping.setMapKeyConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, manyToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, manyToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormManyToManyMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormManyToManyMapping.setMapKeyConverter(null);
- assertNull(manyToManyResource.getMapKeyTemporal());
- assertNull(ormManyToManyMapping.getMapKeyConverter().getType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToOneMappingTests.java
deleted file mode 100644
index c47a6fd817..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmManyToOneMappingTests.java
+++ /dev/null
@@ -1,589 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.ManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmManyToOneMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmManyToOneMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestEntityWithIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " manyToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithManyToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ManyToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- public void testUpdateDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("manyToOne");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = (OrmPersistentAttribute) contextType.getAttributeNamed("manyToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
-
- XmlManyToOne resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- resourceManyToOne.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceManyToOne.getId());
- assertTrue(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceManyToOne.getMapsId());
- assertNull(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- XmlOneToOne resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- assertEquals(Boolean.TRUE, resourceOneToOne.getId());
- assertTrue(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceOneToOne.getMapsId());
- assertNull(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- resourceManyToOne.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceManyToOne.getId());
- assertTrue(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertNull(resourceManyToOne.getMapsId());
- assertNull(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidManyToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaManyToOneMapping2_0 javaManyToOneMapping = ((JavaManyToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, ormJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getName());
- assertNull(ormJoinTable.getSpecifiedCatalog());
- assertNull(ormJoinTable.getSpecifiedSchema());
- assertEquals(0, ormJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, ormJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn ormJoinColumn = ormJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", ormJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", ormJoinColumn.getDefaultName());
- assertEquals("id", ormJoinColumn.getDefaultReferencedColumnName());
- JoinColumn inverseOrmJoinColumn = ormJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", inverseOrmJoinColumn.getDefaultTable());
- assertEquals("address_id", inverseOrmJoinColumn.getDefaultName());
- assertEquals("id", inverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = ((JavaManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", ormJoinTable.getSpecifiedName());
- assertEquals("CATALOG", ormJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", ormJoinTable.getSpecifiedSchema());
- assertEquals(1, ormJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, ormJoinTable.getSpecifiedInverseJoinColumnsSize());
- ormJoinColumn = ormJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", ormJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", ormJoinColumn.getSpecifiedReferencedColumnName());
- inverseOrmJoinColumn = ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", inverseOrmJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", inverseOrmJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidManyToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmManyToOneMapping2_0 ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((ManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable ormJoinTable = ((OrmManyToOneRelationship2_0) ormManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTestTargetEntityAddress();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- JavaManyToOneMapping2_0 javaManyToOneMapping = (JavaManyToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.removeFromXml();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("address");
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) ormPersistentAttribute2.getMapping();
- ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertTrue(ormPersistentAttribute2.isVirtual());
- assertEquals("JAVA_JOIN_TABLE", ormJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).getJoinTableStrategy().removeStrategy();
- ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(ormJoinTable);
- ((ManyToOneRelationship2_0) javaManyToOneMapping.getRelationship()).setStrategyToJoinTable();
- ormJoinTable = ((ManyToOneRelationship2_0) virtualManyToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals("BAR_FOO", ormJoinTable.getName());
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", ormJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", ormJoinTable.getDefaultName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationship2_0 rel = (OrmManyToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithManyToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmManyToOneMapping2_0 contextMapping = (OrmManyToOneMapping2_0) contextAttribute.getMapping();
- OrmManyToOneRelationship2_0 rel = (OrmManyToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlManyToOne resourceMapping = resourceEntity.getAttributes().getManyToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ManyToOneMapping2_0 virtualManyToOneMapping = (ManyToOneMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualManyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualManyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualManyToOneMapping.getSpecifiedTargetEntity());
-
- JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) virtualManyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualManyToOneMapping).getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- virtualPersistentAttribute.addToXml(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
-
- OrmManyToOneMapping2_0 ormManyToOneMapping = (OrmManyToOneMapping2_0) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(true, ormManyToOneMapping.isDefaultOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- Cascade2_0 cascade = (Cascade2_0) ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertEquals(null, ((EclipseLinkJoinFetchMapping) ormManyToOneMapping).getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java
deleted file mode 100644
index fdae3b9339..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,2377 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cacheable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.CacheableHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.PersistenceUnit2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.options.SharedCacheMode;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmMappedSuperclassTests
- extends EclipseLink2_0ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
- public EclipseLink2_0OrmMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestMappedSuperclassForReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CHANGE_TRACKING);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private void createTestMappedSuperclassSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MAPPED_SUPERCLASS);
- sb.append(";");
- sb.append(CR);
- sb.append("@MappedSuperclass");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- private ICompilationUnit createTestMappedSuperclassForConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForObjectTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForStructConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- public void testUpdateReadOnly() throws Exception {
- createTestMappedSuperclassForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to true, check defaults
-
- resourceMappedSuperclass.setReadOnly(null);
- javaContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to false, check defaults
-
- resourceMappedSuperclass.setReadOnly(null);
- javaContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testModifyReadOnly() throws Exception {
- createTestMappedSuperclassForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to true, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to false, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to null, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(null);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testUpdateCustomizerClass() throws Exception {
- createTestMappedSuperclassForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set xml customizer, check defaults
- resourceMappedSuperclass.setCustomizer(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
-
- // set xml customizer class, check override
-
- resourceMappedSuperclass.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // clear xml customizer class, set java customizer class, check defaults
-
- resourceMappedSuperclass.getCustomizer().setClassName(null);
- javaContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass("bar");
-
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- // set xml customizer class, check override
-
- resourceMappedSuperclass.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- //set xml customizer null
- javaContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass(null);
- resourceMappedSuperclass.setCustomizer(null);
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- }
-
- public void testModifyCustomizerClass() throws Exception {
- createTestMappedSuperclassForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer, check resource
-
- ormContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer to null, check resource
-
- ormContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass(null);
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
- }
-
- public void testUpdateChangeTracking() throws Exception {
- createTestMappedSuperclassForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to ATTRIBUTE, check context
-
- resourceMappedSuperclass.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to OBJECT, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to DEFERRED, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to AUTO, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // clear xml change tracking, set java change tracking, check defaults
-
- resourceMappedSuperclass.setChangeTracking(null);
- javaContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // unset metadataComplete, set xml change tracking to OBJECT, check context
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- resourceMappedSuperclass.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
- }
-
- public void testModifyChangeTracking() throws Exception {
- createTestMappedSuperclassForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to ATTRIBUTE, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to OBJECT, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to DEFERRED, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to AUTO, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to null, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(null);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
- }
-
- public void testUpdateCacheType() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set xml cache type, check settings
- resourceMappedSuperclass.getCache().setType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedType(EclipseLinkCacheType.WEAK);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
- // clear xml cache type, check defaults
- resourceMappedSuperclass.getCache().setType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheType() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set context cache type, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.HARD_WEAK, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getSpecifiedType());
-
- // set context customizer to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
- }
-
- public void testUpdateCacheCoordinationType() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set xml cache type, check settings
- resourceMappedSuperclass.getCache().setCoordinationType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
- // clear xml cache type, check defaults
- resourceMappedSuperclass.getCache().setCoordinationType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheCoordinationType() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context cache coordination type, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context coordination type to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedCoordinationType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
- }
-
-
- public void testUpdateCacheSize() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass xmlMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, xmlMappedSuperclass.getCache());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set xml cache, check defaults
- xmlMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, xmlMappedSuperclass.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set xml cache size, check settings
- xmlMappedSuperclass.getCache().setSize(new Integer(105));
- assertEquals(new Integer(105), xmlMappedSuperclass.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedSize(new Integer(50));
-
- assertEquals(new Integer(105), xmlMappedSuperclass.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
- // clear xml cache size, check defaults
- xmlMappedSuperclass.getCache().setSize(null);
-
- assertEquals(null, xmlMappedSuperclass.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // clear xml cache, check defaults
- xmlMappedSuperclass.setCache(null);
-
- assertEquals(null, xmlMappedSuperclass.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(50, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, xmlMappedSuperclass.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheSize() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedSize(new Integer(50));
- assertEquals(new Integer(50), resourceMappedSuperclass.getCache().getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(50), ormContextCaching.getSpecifiedSize());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedSize(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
- }
-
- public void testUpdateCacheAlwaysRefresh() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set xml cache always refresh, check settings
- resourceMappedSuperclass.getCache().setAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set java cache always refresh, check defaults
-
- javaContextCaching.setSpecifiedAlwaysRefresh(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setAlwaysRefresh(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setAlwaysRefresh(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testModifyCacheAlwaysRefresh() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedAlwaysRefresh(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testUpdateCacheRefreshOnlyIfNewer() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testModifyCacheRefreshOnlyIfNewer() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testUpdateCacheDisableHits() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedDisableHits(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setDisableHits(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedDisableHits());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setDisableHits(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testModifyCacheDisableHits() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedDisableHits(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testUpdateCacheShared() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setShared(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedShared());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setShared(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testModifyCacheShared() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedShared(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testUpdateExistenceChecking() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set xml existence checking, check settings
- resourceMappedSuperclass.setExistenceChecking(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
-
- // set java cache existence checking, check defaults
-
- javaContextCaching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // clear xml existence checking, check defaults
- resourceMappedSuperclass.setExistenceChecking(null);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyExistenceChecking() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set context cache existence checking, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // set context existence checking to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedExistenceType(null);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
- }
- public void testUpdateCustomConverters() throws Exception {
- createTestMappedSuperclassForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceMappedSuperclass.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceMappedSuperclass.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- createTestMappedSuperclassForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateTypeConverters() throws Exception {
- createTestMappedSuperclassForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceMappedSuperclass.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceMappedSuperclass.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- createTestMappedSuperclassForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- createTestMappedSuperclassForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceMappedSuperclass.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceMappedSuperclass.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- createTestMappedSuperclassForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- createTestMappedSuperclassForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceMappedSuperclass.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceMappedSuperclass.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- createTestMappedSuperclassForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testSetSpecifiedCacheable() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable2_0 = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlMappedSuperclass mappedSuperclassResource = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals(null, cacheable2_0.getSpecifiedCacheable());
- assertEquals(null, mappedSuperclassResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable2_0.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, mappedSuperclassResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable2_0.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, mappedSuperclassResource.getCacheable());
-
- cacheable2_0.setSpecifiedCacheable(null);
- assertEquals(null, cacheable2_0.getSpecifiedCacheable());
- assertEquals(null, mappedSuperclassResource.getCacheable());
- }
-
- public void testGetSpecifiedCacheable() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- XmlMappedSuperclass mappedSuperclassResource = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, mappedSuperclassResource.getCacheable());
-
- mappedSuperclassResource.setCacheable(Boolean.TRUE);
- assertEquals(Boolean.TRUE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.TRUE, mappedSuperclassResource.getCacheable());
-
- mappedSuperclassResource.setCacheable(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cacheable.getSpecifiedCacheable());
- assertEquals(Boolean.FALSE, mappedSuperclassResource.getCacheable());
-
- mappedSuperclassResource.setCacheable(null);
- assertEquals(null, cacheable.getSpecifiedCacheable());
- assertEquals(null, mappedSuperclassResource.getCacheable());
- }
-
- public void testIsDefaultCacheable() throws Exception {
- createTestMappedSuperclass();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- assertEquals(SharedCacheMode.DISABLE_SELECTIVE, persistenceUnit2_0.getSharedCacheMode());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ALL);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.UNSPECIFIED);
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromSuperType() throws Exception {
- createTestMappedSuperclass();
- createTestMappedSuperclassSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass subMappedSuperclass = (EclipseLinkMappedSuperclass) subOrmPersistentType.getMapping();
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subMappedSuperclass).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) mappedSuperclass).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromJava() throws Exception {
- createTestMappedSuperclass();
- createTestMappedSuperclassSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subOrmPersistentType.getMapping()).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) ormPersistentType.getMapping()).getCacheable();
-
- Cacheable2_0 javaCacheable = ((CacheableHolder2_0) ormPersistentType.getJavaPersistentType().getMapping()).getCacheable();
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- javaCacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
- }
-
- public void testIsDefaultCacheableFromMappedSuperClass() throws Exception {
- createTestMappedSuperclass();
- createTestMappedSuperclassSubType();
- OrmPersistentType subOrmPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_SUB_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkMappedSuperclass subMappedSuperclass = (EclipseLinkMappedSuperclass) subOrmPersistentType.getMapping();
- EclipseLinkMappedSuperclass mappedSuperclass = (EclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- Cacheable2_0 subCacheable = ((CacheableHolder2_0) subMappedSuperclass).getCacheable();
- Cacheable2_0 cacheable = ((CacheableHolder2_0) mappedSuperclass).getCacheable();
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- PersistenceUnit2_0 persistenceUnit2_0 = getPersistenceUnit();
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(null);
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.DISABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.FALSE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(true, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
- assertEquals(false, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- cacheable.setSpecifiedCacheable(Boolean.TRUE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
-
- persistenceUnit2_0.setSpecifiedSharedCacheMode(SharedCacheMode.NONE);
- assertEquals(true, subCacheable.isDefaultCacheable());
- assertEquals(false, cacheable.isDefaultCacheable());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java
deleted file mode 100644
index fe46a49657..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToManyMappingTests.java
+++ /dev/null
@@ -1,1215 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Column;
-import org.eclipse.jpt.jpa.core.context.Entity;
-import org.eclipse.jpt.jpa.core.context.EnumType;
-import org.eclipse.jpt.jpa.core.context.BaseEnumeratedConverter;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyColumn;
-import org.eclipse.jpt.jpa.core.context.BaseTemporalConverter;
-import org.eclipse.jpt.jpa.core.context.TemporalType;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrderColumn2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.Orderable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToManyMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.MapKeyColumn2_0Annotation;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlOneToMany_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-/**
- * EclipseLink2_0OrmOneToManyMappingTests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmOneToManyMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmOneToManyMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithValidOneToManyMapping() throws Exception {
- this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Collection<Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" private String abbr;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(fetch=FetchType.EAGER, targetEntity=Address.class, orphanRemoval = true, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestTypeWithCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("java.util.Collection");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" private Collection<Foo> oneToMany;").append(CR);
- }
- });
- }
-
- private OrmOrphanRemovable2_0 getOrphanRemovalOf(OneToManyMapping2_0 oneToManyMapping) {
- return ((OrmOrphanRemovalHolder2_0) oneToManyMapping).getOrphanRemoval();
- }
-
- public void testUpdateSpecifiedOrphanRemoval() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 oneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToManyResource.getOrphanRemoval());
-
- //set enumerated in the resource model, verify context model updated
- oneToManyResource.setOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.TRUE, oneToManyResource.getOrphanRemoval());
-
- oneToManyResource.setOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.FALSE, oneToManyResource.getOrphanRemoval());
- }
-
- public void testModifySpecifiedOrphanRemoval() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 oneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(oneToManyMapping);
- XmlOneToMany oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToManyResource.getOrphanRemoval());
-
- //set enumerated in the context model, verify resource model updated
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToManyResource.getOrphanRemoval());
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToManyResource.getOrphanRemoval());
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME_ + "State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualOneToManyMapping.getSpecifiedMapKey());
- assertNull(virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertTrue(virtualOneToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setPkMapKey(true);
- assertEquals("id", virtualOneToManyMapping.getMapKey());
- assertTrue(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertFalse(virtualOneToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setCustomMapKey(true);
- javaOneToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", virtualOneToManyMapping.getSpecifiedMapKey());
- assertEquals("city", virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertTrue(virtualOneToManyMapping.isCustomMapKey());
- assertFalse(virtualOneToManyMapping.isNoMapKey());
-
- //set metadata complete and verify that the orm model ignores the java annotations
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- assertEquals(null, virtualOneToManyMapping.getSpecifiedMapKey());
- assertEquals(null, virtualOneToManyMapping.getMapKey());
- assertFalse(virtualOneToManyMapping.isPkMapKey());
- assertFalse(virtualOneToManyMapping.isCustomMapKey());
- assertTrue(virtualOneToManyMapping.isNoMapKey());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = virtualOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").addToXml();
- OrmOneToManyMapping ormOneToManyMapping = (OrmOneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("state.name", mapKeyNames.next());
- assertEquals("state.abbr", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testUpdateMapKeyClass() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
-
- //set mapKey in the resource model, verify context model does not change
- oneToMany.setMapKeyClass(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNotNull(oneToMany.getMapKeyClass());
-
- //set mapKey name in the resource model, verify context model updated
- oneToMany.getMapKeyClass().setClassName("String");
- assertEquals("String", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", oneToMany.getMapKeyClass().getClassName());
-
- //set mapKey name to null in the resource model
- oneToMany.getMapKeyClass().setClassName(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass().getClassName());
-
- oneToMany.getMapKeyClass().setClassName("String");
- oneToMany.setMapKeyClass(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
- }
-
- public void testUpdateVirtualMapKeyClass() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(virtualOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getDefaultMapKeyClass());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setSpecifiedMapKeyClass("Integer");
- assertEquals("Integer", virtualOneToManyMapping.getMapKeyClass());
- assertEquals("Integer", virtualOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getDefaultMapKeyClass());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- virtualOneToManyMapping = (OneToManyMapping2_0) ormPersistentType.getAttributeNamed("addresses").getMapping();
- assertEquals(null, virtualOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getMapKeyClass());
- assertEquals("java.lang.String", virtualOneToManyMapping.getDefaultMapKeyClass());
- }
-
- public void testModifyMapKeyClass() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany oneToMany = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
-
- //set mapKey in the context model, verify resource model updated
- ormOneToManyMapping.setSpecifiedMapKeyClass("String");
- assertEquals("String", ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertEquals("String", oneToMany.getMapKeyClass().getClassName());
-
- //set mapKey to null in the context model
- ormOneToManyMapping.setSpecifiedMapKeyClass(null);
- assertNull(ormOneToManyMapping.getSpecifiedMapKeyClass());
- assertNull(oneToMany.getMapKeyClass());
- }
-
- public void testOrderColumnDefaults() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("jobs"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping oneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
- oneToManyMapping.getRelationship().setStrategyToMappedBy();
- oneToManyMapping.getRelationship().getMappedByStrategy().setMappedByAttribute("queue");
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- orderable.setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = orderable.getOrderColumn();
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(null, orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- orderColumn.setSpecifiedName("FOO");
- assertEquals("FOO", orderColumn.getSpecifiedName());
- assertEquals("jobs_ORDER", orderColumn.getDefaultName());
- assertEquals("PrintJob", orderColumn.getTable());
-
- OrmPersistentType printJobPersistentType = (OrmPersistentType) getPersistenceUnit().getPersistentType("test.PrintJob");
- ((Entity) printJobPersistentType.getMapping()).getTable().setSpecifiedName("MY_TABLE");
-
- assertEquals("MY_TABLE", orderColumn.getTable());
- }
-
- public void testVirtualOrderColumn() throws Exception {
- createTestEntityPrintQueue();
- createTestEntityPrintJob();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintQueue");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".PrintJob");
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("jobs"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping oneToManyMapping = (OrmOneToManyMapping) ormPersistentAttribute.getMapping();
-
- Orderable2_0 orderable = ((Orderable2_0) oneToManyMapping.getOrderable());
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentAttribute.getJavaPersistentAttribute().getMapping();
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
-
- assertEquals(false, orderable.isOrderColumnOrdering());
- assertEquals(true, orderable.isNoOrdering());
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("jobs");
- OneToManyMapping virtualOneToManyMapping = (OneToManyMapping) ormPersistentAttribute2.getMapping();
- orderable = ((Orderable2_0) virtualOneToManyMapping.getOrderable());
- assertEquals(true, orderable.isOrderColumnOrdering());
- assertEquals(false, orderable.isNoOrdering());
- assertEquals("PrintJob", orderable.getOrderColumn().getTable());
- assertEquals("jobs_ORDER", orderable.getOrderColumn().getName());
-
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).getOrderColumn().setSpecifiedName("FOO");
- assertEquals("PrintJob", orderable.getOrderColumn().getTable());
- assertEquals("FOO", orderable.getOrderColumn().getName());
- }
-
-
- private void createTestEntityPrintQueue() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ONE_TO_MANY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ORDER_COLUMN);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintQueue").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private String name;").append(CR);
- sb.append(CR);
- sb.append(" @OneToMany(mappedBy=\"queue\")").append(CR);
- sb.append(" @OrderColumn").append(CR);
- sb.append(" private java.util.List<PrintJob> jobs;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintQueue.java", sourceWriter);
- }
-
- private void createTestEntityPrintJob() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.MANY_TO_ONE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("PrintJob").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private PrintQueue queue;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "PrintJob.java", sourceWriter);
- }
-
- public void testVirtualMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no value Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- OneToManyMapping2_0 addressesVirtualMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
- assertEquals("addresses_KEY", ormColumn.getName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertTrue(ormColumn.isInsertable());
- assertTrue(ormColumn.isUpdatable());
- assertTrue(ormColumn.isNullable());
- assertFalse(ormColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getScale());
-
- //set Column annotation in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaOneToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
- assertEquals("FOO", ormColumn.getSpecifiedName());
- assertEquals("FOO_TABLE", ormColumn.getSpecifiedTable());
- assertEquals("COLUMN_DEFINITION", ormColumn.getColumnDefinition());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedUpdatable());
- assertEquals(Boolean.FALSE, ormColumn.getSpecifiedNullable());
- assertEquals(Boolean.TRUE, ormColumn.getSpecifiedUnique());
- assertEquals(Integer.valueOf(45), ormColumn.getSpecifiedLength());
- assertEquals(Integer.valueOf(46), ormColumn.getSpecifiedPrecision());
- assertEquals(Integer.valueOf(47), ormColumn.getSpecifiedScale());
-
-
- //set metadata-complete, orm.xml virtual column ignores java column annotation
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- OneToManyMapping2_0 addressesMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesMapping.getMapKeyColumn();
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, addressesPersistentAttribute.getMappingKey());
-
- assertEquals("addresses_KEY", ormColumn.getName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
- assertEquals(null, ormColumn.getColumnDefinition());
- assertTrue(ormColumn.isInsertable());
- assertTrue(ormColumn.isUpdatable());
- assertTrue(ormColumn.isNullable());
- assertFalse(ormColumn.isUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getScale());
- }
-
- public void testNullMapKeyColumnDefaults() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- OrmPersistentAttribute addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OrmOneToManyMapping2_0 addressesVirtualMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- //set Column annotation in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("FOO_TABLE");
- javaOneToManyMapping.getMapKeyColumn().setColumnDefinition("COLUMN_DEFINITION");
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedInsertable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUpdatable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedNullable(Boolean.FALSE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedUnique(Boolean.TRUE);
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedLength(Integer.valueOf(45));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedPrecision(Integer.valueOf(46));
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedScale(Integer.valueOf(47));
-
-
- assertEquals("addresses_KEY", ormColumn.getDefaultName());
- assertEquals(TYPE_NAME + "_Address", ormColumn.getDefaultTable());
- assertEquals(true, ormColumn.isDefaultInsertable());
- assertEquals(true, ormColumn.isDefaultUpdatable());
- assertEquals(true, ormColumn.isDefaultNullable());
- assertEquals(false, ormColumn.isDefaultUnique());
- assertEquals(ReadOnlyColumn.DEFAULT_LENGTH, ormColumn.getDefaultLength());
- assertEquals(ReadOnlyColumn.DEFAULT_PRECISION, ormColumn.getDefaultPrecision());
- assertEquals(ReadOnlyColumn.DEFAULT_SCALE, ormColumn.getDefaultScale());
- assertNull(ormColumn.getSpecifiedName());
- assertNull(ormColumn.getSpecifiedTable());
- assertNull(ormColumn.getColumnDefinition());
- assertNull(ormColumn.getSpecifiedInsertable());
- assertNull(ormColumn.getSpecifiedUpdatable());
- assertNull(ormColumn.getSpecifiedNullable());
- assertNull(ormColumn.getSpecifiedUnique());
- assertNull(ormColumn.getSpecifiedLength());
- assertNull(ormColumn.getSpecifiedPrecision());
- assertNull(ormColumn.getSpecifiedScale());
- }
-
- public void testVirtualMapKeyColumnTable() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //virtual attribute in orm.xml, java attribute has no Column annotation
- OrmReadOnlyPersistentAttribute addressesPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- OneToManyMapping2_0 addressesVirtualMapping = (OneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- Column ormColumn = addressesVirtualMapping.getMapKeyColumn();
-
- assertEquals(TYPE_NAME + "_Address", ormColumn.getTable());
-
- //entity table changes the join table default name
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE");
- assertEquals("ORM_TABLE_Address", ormColumn.getTable());
-
- //set Column table element in Java
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- javaOneToManyMapping.getRelationship().getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
- assertEquals("JAVA_JOIN_TABLE", ormColumn.getTable());
- javaOneToManyMapping.getMapKeyColumn().setSpecifiedTable("JAVA_TABLE");
- assertEquals("JAVA_TABLE", ormColumn.getTable());
-
- //make name persistent attribute not default
- addressesPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("addresses"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 addressesMapping = (OrmOneToManyMapping2_0) addressesPersistentAttribute.getMapping();
- ormColumn = addressesMapping.getMapKeyColumn();
- assertNull(ormColumn.getSpecifiedTable());
- assertEquals("ORM_TABLE_Address", ormColumn.getDefaultTable());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship2_0 rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithValidOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("addresses");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship2_0 rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testTargetForeignKeyJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- JoinColumn joinColumn = ((OneToManyRelationship2_0) virtualOneToManyMapping.getRelationship()).getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertTrue(persistentAttribute.isVirtual());
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("Address", joinColumn.getDefaultTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- //override the mapping in orm.xml
- persistentAttribute.addToXml();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).strategyIsJoinColumn());
-
- ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- joinColumn = ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertFalse(persistentAttribute.isVirtual());
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
-
- joinColumn.setSpecifiedName("FOO");
- assertEquals("addresses_id", joinColumn.getDefaultName());
- assertEquals("FOO", joinColumn.getSpecifiedName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", joinColumn.getDefaultTable());
- }
-
- //target foreign key case
- public void testGetMapKeyColumnJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
-
- assertTrue(persistentAttribute.isVirtual());
- assertEquals("addresses_KEY", virtualOneToManyMapping.getMapKeyColumn().getName());
- assertEquals("Address", virtualOneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", virtualOneToManyMapping.getMapKeyColumn().getTable());
-
- JavaResourceType resourceType = (JavaResourceType) getJpaProject().getJavaResourceType(FULLY_QUALIFIED_TYPE_NAME, Kind.TYPE);
- JavaResourceField resourceField = resourceType.getFields().iterator().next();
- MapKeyColumn2_0Annotation column = (MapKeyColumn2_0Annotation) resourceField.addAnnotation(JPA2_0.MAP_KEY_COLUMN);
- column.setName("foo");
- getJpaProject().synchronizeContextModel();
-
- assertEquals("foo", virtualOneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("foo", virtualOneToManyMapping.getMapKeyColumn().getName());
- assertEquals("addresses_KEY", virtualOneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("ADDRESS_PRIMARY_TABLE", virtualOneToManyMapping.getMapKeyColumn().getDefaultTable());
-
- //override the mapping in orm.xml
- persistentAttribute.addToXml();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).strategyIsJoinColumn());
-
- ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- assertEquals("addresses_KEY", ormOneToManyMapping.getMapKeyColumn().getName());
- assertEquals("ADDRESS_PRIMARY_TABLE", ormOneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("addresses_KEY", ormOneToManyMapping.getMapKeyColumn().getName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", ormOneToManyMapping.getMapKeyColumn().getTable());//target table name
-
- ormOneToManyMapping.getMapKeyColumn().setSpecifiedName("FOO");
- assertEquals("addresses_KEY", ormOneToManyMapping.getMapKeyColumn().getDefaultName());
- assertEquals("FOO", ormOneToManyMapping.getMapKeyColumn().getSpecifiedName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", ormOneToManyMapping.getMapKeyColumn().getDefaultTable());
- }
-
- //target foreign key case
- public void testOrderColumnDefaultsJoinColumnStrategy() throws Exception {
- createTestEntityWithValidGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormTargetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- //test virtual orm mapping, setting the join column on the java mapping
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OneToManyMapping2_0 virtualOneToManyMapping = (OneToManyMapping2_0) persistentAttribute.getMapping();
- JavaOneToManyMapping2_0 javaOneToManyMapping = (JavaOneToManyMapping2_0) persistentAttribute.getJavaPersistentAttribute().getMapping();
- ((OneToManyRelationship2_0) javaOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- ((Orderable2_0) javaOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- OrderColumn2_0 orderColumn = ((Orderable2_0) virtualOneToManyMapping.getOrderable()).getOrderColumn();
-
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("Address", orderColumn.getTable());//target table name
-
- JavaEntity addressEntity = (JavaEntity) ormTargetPersistentType.getJavaPersistentType().getMapping();
- addressEntity.getTable().setSpecifiedName("ADDRESS_PRIMARY_TABLE");
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());
-
- //override the mapping in orm.xml
- persistentAttribute.addToXml();
- persistentAttribute = ormPersistentType.getAttributeNamed("addresses");
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) persistentAttribute.getMapping();
- assertFalse(persistentAttribute.isVirtual());
- assertFalse(((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).strategyIsJoinColumn());
-
- ((OneToManyRelationship2_0) ormOneToManyMapping.getRelationship()).setStrategyToJoinColumn();
- assertFalse(((Orderable2_0) ormOneToManyMapping.getOrderable()).isOrderColumnOrdering());
- ((Orderable2_0) ormOneToManyMapping.getOrderable()).setOrderColumnOrdering(true);
- orderColumn = ((Orderable2_0) ormOneToManyMapping.getOrderable()).getOrderColumn();
-
- assertNull(orderColumn.getSpecifiedName());
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("ADDRESS_PRIMARY_TABLE", orderColumn.getTable());//target table name
-
- OrmEntity ormAddressEntity = (OrmEntity) ormTargetPersistentType.getMapping();
- ormAddressEntity.getTable().setSpecifiedName("ORM_ADDRESS_PRIMARY_TABLE");
- assertEquals("addresses_ORDER", orderColumn.getName());
- assertEquals("ORM_ADDRESS_PRIMARY_TABLE", orderColumn.getTable());//target table name
- }
-
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- EclipseLinkOneToManyMapping virtualOneToManyMapping = (EclipseLinkOneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertTrue(((OrphanRemovalHolder2_0) virtualOneToManyMapping).getOrphanRemoval().isOrphanRemoval());
- assertEquals(EclipseLinkJoinFetchType.INNER, virtualOneToManyMapping.getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
-
- EclipseLinkOneToManyMapping virtualOneToManyMapping = (EclipseLinkOneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToManyMapping.getFetch());
- assertEquals("test.Address", virtualOneToManyMapping.getTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertFalse(((OrphanRemovalHolder2_0) virtualOneToManyMapping).getOrphanRemoval().isOrphanRemoval());
- assertEquals(null, virtualOneToManyMapping.getJoinFetch().getValue());
- }
-
- public void testUpdateSpecifiedEnumerated() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the resource model, verify context model updated
- oneToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL);
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, oneToManyResource.getMapKeyEnumerated());
-
- oneToManyResource.setMapKeyEnumerated(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING);
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated to null in the resource model
- oneToManyResource.setMapKeyEnumerated(null);
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
- }
-
- public void testModifySpecifiedEnumerated() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyEnumerated());
-
- //set enumerated in the context model, verify resource model updated
- ormOneToManyMapping.setMapKeyConverter(BaseEnumeratedConverter.class);
- ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.ORDINAL);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.ORDINAL, oneToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.ORDINAL, ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).setSpecifiedEnumType(EnumType.STRING);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.EnumType.STRING, oneToManyResource.getMapKeyEnumerated());
- assertEquals(EnumType.STRING, ((BaseEnumeratedConverter) ormOneToManyMapping.getMapKeyConverter()).getSpecifiedEnumType());
-
- //set enumerated to null in the context model
- ormOneToManyMapping.setMapKeyConverter(null);
- assertNull(oneToManyResource.getMapKeyEnumerated());
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- }
-
- public void testUpdateSpecifiedTemporal() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
-
- //set temporal in the resource model, verify context model updated
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE);
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, oneToManyResource.getMapKeyTemporal());
-
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME);
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, oneToManyResource.getMapKeyTemporal());
-
- oneToManyResource.setMapKeyTemporal(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP);
- assertEquals(TemporalType.TIMESTAMP, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIMESTAMP, oneToManyResource.getMapKeyTemporal());
-
- //set temporal to null in the resource model
- oneToManyResource.setMapKeyTemporal(null);
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
- }
-
- public void testModifySpecifiedTemporal() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- OrmOneToManyMapping2_0 ormOneToManyMapping = (OrmOneToManyMapping2_0) ormPersistentAttribute.getMapping();
- XmlOneToMany_2_0 oneToManyResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToManys().get(0);
-
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- assertNull(oneToManyResource.getMapKeyTemporal());
-
- //set temporal in the context model, verify resource model updated
- ormOneToManyMapping.setMapKeyConverter(BaseTemporalConverter.class);
- ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.DATE);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.DATE, oneToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.DATE, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).setTemporalType(TemporalType.TIME);
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.TemporalType.TIME, oneToManyResource.getMapKeyTemporal());
- assertEquals(TemporalType.TIME, ((BaseTemporalConverter) ormOneToManyMapping.getMapKeyConverter()).getTemporalType());
-
- //set temporal to null in the context model
- ormOneToManyMapping.setMapKeyConverter(null);
- assertNull(oneToManyResource.getMapKeyTemporal());
- assertNull(ormOneToManyMapping.getMapKeyConverter().getType());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java
deleted file mode 100644
index 20c59ff897..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_0OrmOneToOneMappingTests.java
+++ /dev/null
@@ -1,923 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AttributeMapping;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.ReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinColumn;
-import org.eclipse.jpt.jpa.core.context.java.JavaJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmEntity;
-import org.eclipse.jpt.jpa.core.context.orm.OrmJoinTable;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.jpa2.context.Cascade2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.OrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.java.JavaOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmManyToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOneToOneRelationship2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovable2_0;
-import org.eclipse.jpt.jpa.core.jpa2.context.orm.OrmOrphanRemovalHolder2_0;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlDerivedId_2_0;
-import org.eclipse.jpt.jpa.core.resource.orm.v2_0.XmlMapsId_2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_0ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_0OrmOneToOneMappingTests
- extends EclipseLink2_0ContextModelTestCase
-{
- public EclipseLink2_0OrmOneToOneMappingTests(String name) {
- super(name);
- }
-
-
- private void createTestEntityWithIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @Id").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private void createTestEntityWithMapsIdDerivedIdentity() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA2_0.MAPS_ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne @MapsId").append(CR);
- sb.append(" private " + TYPE_NAME + " oneToOne;").append(CR);
- sb.append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddressWithElementCollection() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA2_0.ELEMENT_COLLECTION);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" @ElementCollection").append(CR);
- sb.append(" private java.util.Collection<State> state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityWithValidOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private void createTestEntityWithOneToOneMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE, EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, orphanRemoval = true, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH, CascadeType.DETACH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" @PrivateOwned)");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestTypeWithOneToOneAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" private Foo oneToOne;").append(CR);
- }
- });
- }
-
- public void testUpdateDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- resourceMapping.setId(null);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testSetDerivedId() throws Exception {
- createTestEntityWithIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlDerivedId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(true);
- assertEquals(Boolean.TRUE, resourceMapping.getId());
- assertTrue(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
-
- contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().setValue(false);
- assertNull(resourceMapping.getId());
- assertFalse(contextMapping.getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- }
-
- public void testUpdateMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- resourceMapping.setMapsId(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testSetMapsId() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("oneToOne");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlMapsId_2_0 resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("foo");
- assertEquals("foo", resourceMapping.getMapsId());
- assertEquals("foo", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName("bar");
- assertEquals("bar", resourceMapping.getMapsId());
- assertEquals("bar", contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().setSpecifiedIdAttributeName(null);
- assertNull(resourceMapping.getMapsId());
- assertNull(contextMapping.getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testMorphMapping() throws Exception {
- createTestEntityWithMapsIdDerivedIdentity();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute contextAttribute = (OrmPersistentAttribute) contextType.getAttributeNamed("oneToOne");
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
-
- XmlOneToOne resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- resourceOneToOne.setMapsId("foo");
- assertNull(resourceOneToOne.getId());
- assertFalse(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceOneToOne.getMapsId());
- assertEquals("foo", ((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- XmlManyToOne resourceManyToOne = resourceEntity.getAttributes().getManyToOnes().get(0);
- assertNull(resourceManyToOne.getId());
- assertFalse(((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceManyToOne.getMapsId());
- assertEquals("foo", ((OrmManyToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
-
- contextAttribute.setMappingKey(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- resourceOneToOne = resourceEntity.getAttributes().getOneToOnes().get(0);
- assertNull(resourceOneToOne.getId());
- assertFalse(((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getIdDerivedIdentityStrategy().getValue());
- assertEquals("foo", resourceOneToOne.getMapsId());
- assertEquals("foo", ((OrmOneToOneMapping2_0) contextAttribute.getMapping()).
- getDerivedIdentity().getMapsIdDerivedIdentityStrategy().getSpecifiedIdAttributeName());
- }
-
- public void testCandidateMappedByAttributeNames() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- public void testCandidateMappedByAttributeNamesElementCollection() throws Exception {
- createTestEntityWithValidOneToOneMapping();
- createTestTargetEntityAddressWithElementCollection();
- createTestEmbeddableState();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
- addXmlClassRef(PACKAGE_NAME + ".Address");
- addXmlClassRef(PACKAGE_NAME + ".State");
-
- ReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributes().iterator().next();
- OneToOneMapping oneToOneMapping = (OneToOneMapping) persistentAttribute.getMapping();
-
- Iterator<String> attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity("foo");
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertFalse(attributeNames.hasNext());
-
- oneToOneMapping.setSpecifiedTargetEntity(null);
- attributeNames =
- oneToOneMapping.getRelationship().getMappedByStrategy().getCandidateMappedByAttributeNames().iterator();
- assertEquals("id", attributeNames.next());
- assertEquals("city", attributeNames.next());
- assertEquals("state", attributeNames.next());
- assertEquals("state.foo", attributeNames.next());
- assertEquals("state.address", attributeNames.next());
- assertEquals("zip", attributeNames.next());
- assertFalse(attributeNames.hasNext());
-
- AttributeMapping stateFooMapping = oneToOneMapping.getResolvedTargetEntity().resolveAttributeMapping("state.foo");
- assertEquals("foo", stateFooMapping.getName());
- }
-
- private OrmOrphanRemovable2_0 getOrphanRemovalOf(OneToOneMapping2_0 oneToOneMapping) {
- return ((OrmOrphanRemovalHolder2_0) oneToOneMapping).getOrphanRemoval();
- }
-
- public void testUpdateSpecifiedOrphanRemoval() throws Exception {
- createTestTypeWithOneToOneAttribute();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToOne"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToOneMapping);
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToOneResource.getOrphanRemoval());
-
- //set enumerated in the resource model, verify context model updated
- oneToOneResource.setOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.TRUE, oneToOneResource.getOrphanRemoval());
-
- oneToOneResource.setOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(Boolean.FALSE, oneToOneResource.getOrphanRemoval());
- }
-
- public void testModifySpecifiedOrphanRemoval() throws Exception {
- createTestTypeWithOneToOneAttribute();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToOne"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- OrmOrphanRemovable2_0 mappingsOrphanRemoval = this.getOrphanRemovalOf(ormOneToOneMapping);
- XmlOneToOne oneToOneResource = getXmlEntityMappings().getEntities().get(0).getAttributes().getOneToOnes().get(0);
-
- assertEquals(null, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- assertEquals(null, oneToOneResource.getOrphanRemoval());
-
- //set enumerated in the context model, verify resource model updated
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.TRUE);
- assertEquals(Boolean.TRUE, oneToOneResource.getOrphanRemoval());
- assertEquals(Boolean.TRUE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
-
- mappingsOrphanRemoval.setSpecifiedOrphanRemoval(Boolean.FALSE);
- assertEquals(Boolean.FALSE, oneToOneResource.getOrphanRemoval());
- assertEquals(Boolean.FALSE, mappingsOrphanRemoval.getSpecifiedOrphanRemoval());
- }
-
- public void testVirtualJoinTable() throws Exception {
- createTestEntityWithValidOneToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- JavaOneToOneMapping2_0 javaOneToOneMapping = ((JavaOneToOneMapping2_0) ormPersistentAttribute.getJavaPersistentAttribute().getMapping());
- OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
-
- assertTrue(ormPersistentAttribute.isVirtual());
- assertEquals(null, virtualJoinTable.getSpecifiedName());
-
- createTestTargetEntityAddress();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- assertEquals(TYPE_NAME + "_Address", virtualJoinTable.getName());
- assertNull(virtualJoinTable.getSpecifiedCatalog());
- assertNull(virtualJoinTable.getSpecifiedSchema());
- assertEquals(0, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(0, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- JoinColumn virtualJoinColumn = virtualJoinTable.getDefaultJoinColumn();
- assertEquals(TYPE_NAME + "_Address", virtualJoinColumn.getDefaultTable());
- assertEquals(TYPE_NAME + "_id", virtualJoinColumn.getDefaultName());
- assertEquals("id", virtualJoinColumn.getDefaultReferencedColumnName());
- JoinColumn virtualInverseOrmJoinColumn = virtualJoinTable.getDefaultInverseJoinColumn();
- assertEquals(TYPE_NAME + "_Address", virtualInverseOrmJoinColumn.getDefaultTable());
- assertEquals("address_id", virtualInverseOrmJoinColumn.getDefaultName());
- assertEquals("id", virtualInverseOrmJoinColumn.getDefaultReferencedColumnName());
-
- JavaJoinTable javaJoinTable = ((JavaOneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- javaJoinTable.setSpecifiedName("FOO");
- javaJoinTable.setSpecifiedCatalog("CATALOG");
- javaJoinTable.setSpecifiedSchema("SCHEMA");
- JavaJoinColumn javaJoinColumn = javaJoinTable.addSpecifiedJoinColumn(0);
- javaJoinColumn.setSpecifiedName("NAME");
- javaJoinColumn.setSpecifiedReferencedColumnName("REFERENCED_NAME");
- JavaJoinColumn inverseJavaJoinColumn = javaJoinTable.addSpecifiedInverseJoinColumn(0);
- inverseJavaJoinColumn.setSpecifiedName("INVERSE_NAME");
- inverseJavaJoinColumn.setSpecifiedReferencedColumnName("INVERSE_REFERENCED_NAME");
-
- assertEquals("FOO", virtualJoinTable.getSpecifiedName());
- assertEquals("CATALOG", virtualJoinTable.getSpecifiedCatalog());
- assertEquals("SCHEMA", virtualJoinTable.getSpecifiedSchema());
- assertEquals(1, virtualJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals(1, virtualJoinTable.getSpecifiedInverseJoinColumnsSize());
- virtualJoinColumn = virtualJoinTable.getSpecifiedJoinColumns().iterator().next();
- assertEquals("NAME", virtualJoinColumn.getSpecifiedName());
- assertEquals("REFERENCED_NAME", virtualJoinColumn.getSpecifiedReferencedColumnName());
- virtualInverseOrmJoinColumn = virtualJoinTable.getSpecifiedInverseJoinColumns().iterator().next();
- assertEquals("INVERSE_NAME", virtualInverseOrmJoinColumn.getSpecifiedName());
- assertEquals("INVERSE_REFERENCED_NAME", virtualInverseOrmJoinColumn.getSpecifiedReferencedColumnName());
- }
-
- public void testUpdateDefaultNameFromJavaTable() throws Exception {
- createTestEntityWithValidOneToOneMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- OrmOneToOneMapping2_0 ormOneToOneMapping = (OrmOneToOneMapping2_0) ormPersistentAttribute.getMapping();
- ((OneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- OrmJoinTable ormJoinTable = ((OrmOneToOneRelationship2_0) ormOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals(null, ormJoinTable.getDefaultName());
-
- createTestTargetEntityAddress();
- OrmPersistentType targetPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- ((JavaEntity) targetPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("FOO");
- assertEquals(TYPE_NAME + "_FOO", ormJoinTable.getDefaultName());
-
- ((JavaEntity) ormPersistentType.getJavaPersistentType().getMapping()).getTable().setSpecifiedName("BAR");
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
- JavaOneToOneMapping2_0 javaOneToOneMapping = (JavaOneToOneMapping2_0) ormPersistentType.getJavaPersistentType().getAttributeNamed("address").getMapping();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable().setSpecifiedName("JAVA_JOIN_TABLE");
-
- assertEquals("BAR_FOO", ormJoinTable.getDefaultName());
-
-
- //set metadata-complete to true, will ignore java annotation settings
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(TYPE_NAME + "_Address", ormJoinTable.getDefaultName());
-
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- //remove m-m mapping from the orm.xml file
- ormPersistentAttribute.removeFromXml();
- //ormPersistentType.getMapping().setSpecifiedMetadataComplete(null);
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("address");
- OneToOneMapping2_0 virtualOneToOneMapping = (OneToOneMapping2_0) ormPersistentAttribute2.getMapping();
- JoinTable virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertTrue(ormPersistentAttribute2.isVirtual());
- assertEquals("JAVA_JOIN_TABLE", virtualJoinTable.getSpecifiedName());//specifiedName since this is a virtual mapping now
-
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).getJoinTableStrategy().removeStrategy();
- virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertNull(virtualJoinTable);
- ((OneToOneRelationship2_0) javaOneToOneMapping.getRelationship()).setStrategyToJoinTable();
- virtualJoinTable = ((OneToOneRelationship2_0) virtualOneToOneMapping.getRelationship()).getJoinTableStrategy().getJoinTable();
- assertEquals("BAR_FOO", virtualJoinTable.getName());
- assertEquals("BAR_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) ormPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TABLE_NAME");
- assertEquals("ORM_TABLE_NAME_FOO", virtualJoinTable.getDefaultName());
-
- ((OrmEntity) targetPersistentType.getMapping()).getTable().setSpecifiedName("ORM_TARGET");
- assertEquals("ORM_TABLE_NAME_ORM_TARGET", virtualJoinTable.getDefaultName());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationship2_0 rel = (OrmOneToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToPrimaryKeyJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- rel.setStrategyToJoinColumn();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToOneMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmOneToOneMapping2_0 contextMapping = (OrmOneToOneMapping2_0) contextAttribute.getMapping();
- OrmOneToOneRelationship2_0 rel = (OrmOneToOneRelationship2_0) contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToOne resourceMapping = resourceEntity.getAttributes().getOneToOnes().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getPrimaryKeyJoinColumns().add(OrmFactory.eINSTANCE.createXmlPrimaryKeyJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertFalse(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getPrimaryKeyJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertTrue(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNotNull(resourceMapping.getJoinTable());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertTrue(rel.strategyIsJoinTable());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertTrue(resourceMapping.getPrimaryKeyJoinColumns().isEmpty());
- assertNull(resourceMapping.getMappedBy());
- assertNull(resourceMapping.getJoinTable());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsPrimaryKeyJoinColumn());
- assertFalse(rel.strategyIsMappedBy());
- assertFalse(rel.strategyIsJoinTable());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- EclipseLinkOneToOneMapping2_0 virtualOneToOneMapping = (EclipseLinkOneToOneMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualOneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToOneMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- JoinColumn ormJoinColumn =
- virtualOneToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", ormJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", ormJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", ormJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", ormJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) virtualOneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
- assertTrue(cascade.isDetach());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, virtualOneToOneMapping.getJoinFetch().getValue());
- assertTrue(virtualOneToOneMapping.getPrivateOwned().isPrivateOwned());
-
- assertTrue(((OrphanRemovalHolder2_0) virtualOneToOneMapping).getOrphanRemoval().isOrphanRemoval());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- EclipseLinkOneToOneMapping2_0 ormOneToOneMapping = (EclipseLinkOneToOneMapping2_0) virtualPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade2_0 cascade = (Cascade2_0) ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
- assertFalse(cascade.isDetach());
-
- assertEquals(null, ormOneToOneMapping.getJoinFetch().getValue());
- assertFalse(ormOneToOneMapping.getPrivateOwned().isPrivateOwned());
-
- assertFalse(((OrphanRemovalHolder2_0) ormOneToOneMapping).getOrphanRemoval().isOrphanRemoval());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1EntityMappingsTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1EntityMappingsTests.java
deleted file mode 100644
index 9792369f93..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1EntityMappingsTests.java
+++ /dev/null
@@ -1,275 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_1EntityMappingsTests
- extends EclipseLink2_1ContextModelTestCase
-{
- public EclipseLink2_1EntityMappingsTests(String name) {
- super(name);
- }
-
- public void testUpdateSpecifiedAccess() throws Exception {
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- //set access in the resource model, verify context model updated
- getXmlEntityMappings().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getAccess());
-
- //set access to VIRTUAL in the resource model, verify context model updated
- getXmlEntityMappings().setAccess(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL);
- assertEquals(EclipseLinkAccessType.VIRTUAL, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL, getXmlEntityMappings().getAccess());
-
- //set access to null in the resource model
- getXmlEntityMappings().setAccess(null);
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testModifySpecifiedAccess() throws Exception {
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- //set access in the context model, verify resource model modified
- getEntityMappings().setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getAccess());
-
- //set access in the context model, verify resource model modified
- getEntityMappings().setSpecifiedAccess(EclipseLinkAccessType.VIRTUAL);
- assertEquals(EclipseLinkAccessType.VIRTUAL, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL, getXmlEntityMappings().getAccess());
-
- //set access to null in the context model
- getEntityMappings().setSpecifiedAccess(null);
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testUpdateDefaultAccess() throws Exception {
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults persistenceUnitDefaults = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(persistenceUnitDefaults);
- persistenceUnitDefaults.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- persistenceUnitDefaults.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- persistenceUnitDefaults.setAccess(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL);
- assertEquals(EclipseLinkAccessType.VIRTUAL, getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- persistenceUnitDefaults.setAccess(null);
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testUpdateAccess() throws Exception {
- assertNull(getEntityMappings().getAccess());
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getXmlEntityMappings().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertNull(getEntityMappings().getDefaultAccess());
- assertEquals(AccessType.FIELD, getEntityMappings().getAccess());
- assertEquals(AccessType.FIELD, getEntityMappings().getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getAccess());
-
- getXmlEntityMappings().setAccess(null);
- assertNull(getEntityMappings().getAccess());
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, getEntityMappings().getDefaultAccess());
- assertEquals(AccessType.FIELD, getEntityMappings().getAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(EclipseLinkAccessType.VIRTUAL);
- assertEquals(EclipseLinkAccessType.VIRTUAL, getEntityMappings().getDefaultAccess());
- assertEquals(EclipseLinkAccessType.VIRTUAL, getEntityMappings().getAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
-
- getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSpecifiedAccess(null);
- assertNull(getEntityMappings().getDefaultAccess());
- assertNull(getEntityMappings().getAccess());
- assertNull(getEntityMappings().getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getAccess());
- }
-
- public void testUpdateSpecifiedGetMethod() throws Exception {
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- assertNull(entityMappings.getSpecifiedGetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods());
-
- //set getMethod in the resource model, verify context model updated
- getXmlEntityMappings().setAccessMethods(EclipseLinkOrmFactory.eINSTANCE.createXmlAccessMethods());
- getXmlEntityMappings().getAccessMethods().setGetMethod("getFoo");
- assertEquals("getFoo", entityMappings.getSpecifiedGetMethod());
- assertEquals("getFoo", getXmlEntityMappings().getAccessMethods().getGetMethod());
-
- //set getMethod to null in the resource model
- getXmlEntityMappings().getAccessMethods().setGetMethod(null);
- assertNull(entityMappings.getSpecifiedGetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods().getGetMethod());
- }
-
- public void testModifySpecifiedGetMethod() throws Exception {
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- assertNull(entityMappings.getSpecifiedGetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods());
-
- //set getMethod in the context model, verify resource model modified
- entityMappings.setSpecifiedGetMethod("getMe");
- assertEquals("getMe", entityMappings.getSpecifiedGetMethod());
- assertEquals("getMe", getXmlEntityMappings().getAccessMethods().getGetMethod());
-
- //set getMethod to null in the context model
- entityMappings.setSpecifiedGetMethod(null);
- assertNull(entityMappings.getSpecifiedGetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods());
- }
-
- public void testModifySpecifiedGetMethod2() throws Exception {
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- assertNull(entityMappings.getSpecifiedGetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods());
-
- //set getMethod in the context model, verify resource model modified
- entityMappings.setSpecifiedGetMethod("getMe");
- assertEquals("getMe", entityMappings.getGetMethod());
- assertEquals("getMe", getXmlEntityMappings().getAccessMethods().getGetMethod());
-
- //set another element on the access-methods element so it doesn't get removed
- getXmlEntityMappings().getAccessMethods().setSetMethod("setMe");
- //set getMethod to null in the context model
- entityMappings.setSpecifiedGetMethod(null);
- assertNull(entityMappings.getGetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods().getGetMethod());
- }
-
- public void testGetDefaultGetMethod() throws Exception {
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- assertNull(entityMappings.getDefaultGetMethod());
- assertNull(entityMappings.getGetMethod());
-
- getPersistenceUnitDefaults().setSpecifiedGetMethod("getFoo");
- assertEquals("getFoo", entityMappings.getDefaultGetMethod());
- assertEquals("getFoo", entityMappings.getGetMethod());
-
- entityMappings.setSpecifiedGetMethod("getBar");
- assertEquals("getFoo", entityMappings.getDefaultGetMethod());
- assertEquals("getBar", entityMappings.getGetMethod());
-
- getPersistenceUnitDefaults().setSpecifiedGetMethod(null);
- assertNull(entityMappings.getDefaultGetMethod());
- assertEquals("getBar", entityMappings.getGetMethod());
- }
-
- public void testGetDefaultSetMethod() throws Exception {
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- assertNull(entityMappings.getDefaultSetMethod());
- assertNull(entityMappings.getSetMethod());
-
- getPersistenceUnitDefaults().setSpecifiedSetMethod("setFoo");
- assertEquals("setFoo", entityMappings.getDefaultSetMethod());
- assertEquals("setFoo", entityMappings.getSetMethod());
-
- entityMappings.setSpecifiedSetMethod("setBar");
- assertEquals("setFoo", entityMappings.getDefaultSetMethod());
- assertEquals("setBar", entityMappings.getSetMethod());
-
- getPersistenceUnitDefaults().setSpecifiedSetMethod(null);
- assertNull(entityMappings.getDefaultSetMethod());
- assertEquals("setBar", entityMappings.getSetMethod());
- }
-
- public void testUpdateSpecifiedSetMethod() throws Exception {
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- assertNull(entityMappings.getSpecifiedSetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods());
-
- //set setMethod in the resource model, verify context model updated
- getXmlEntityMappings().setAccessMethods(EclipseLinkOrmFactory.eINSTANCE.createXmlAccessMethods());
-
- getXmlEntityMappings().getAccessMethods().setSetMethod("setFoo");
- assertEquals("setFoo", entityMappings.getSetMethod());
- assertEquals("setFoo", getXmlEntityMappings().getAccessMethods().getSetMethod());
-
- //set setMethod to null in the resource model
- getXmlEntityMappings().getAccessMethods().setSetMethod(null);
- assertNull(entityMappings.getSetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods().getSetMethod());
- }
-
- public void testModifySpecifiedSetMethod() throws Exception {
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- assertNull(entityMappings.getSpecifiedSetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods());
-
- //set setMethod in the context model, verify resource model modified
- entityMappings.setSpecifiedSetMethod("setMe");
- assertEquals("setMe", entityMappings.getSetMethod());
- assertEquals("setMe", getXmlEntityMappings().getAccessMethods().getSetMethod());
-
- //set setMethod to null in the context model
- entityMappings.setSpecifiedSetMethod(null);
- assertNull(entityMappings.getSetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifySpecifiedSetMethod2() throws Exception {
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- assertNull(entityMappings.getSpecifiedSetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods());
-
- //set setMethod in the context model, verify resource model modified
- entityMappings.setSpecifiedSetMethod("setMe");
- assertEquals("setMe", entityMappings.getSetMethod());
- assertEquals("setMe", getXmlEntityMappings().getAccessMethods().getSetMethod());
-
- //set another element on the access-methods element so it doesn't get removed
- getXmlEntityMappings().getAccessMethods().setGetMethod("getMe");
- //set getMethod to null in the context model
- entityMappings.setSpecifiedSetMethod(null);
- assertNull(entityMappings.getSetMethod());
- assertNull(getXmlEntityMappings().getAccessMethods().getSetMethod());
- }
-
- protected EclipseLinkPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return (EclipseLinkPersistenceUnitDefaults) getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmEmbeddableTests.java
deleted file mode 100644
index bc21b644af..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmEmbeddableTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_1OrmEmbeddableTests
- extends EclipseLink2_1ContextModelTestCase
-{
- public EclipseLink2_1OrmEmbeddableTests(String name) {
- super(name);
- }
-
- public void testUpdateSpecifiedParentClass() throws Exception {
- EclipseLinkOrmPersistentType persistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Employee");
- EclipseLinkOrmTypeMapping ormTypeMapping = persistentType.getMapping();
- XmlTypeMapping xmlTypeMapping = (XmlTypeMapping) ormTypeMapping.getXmlTypeMapping();
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
-
- //set parentClass in the resource model, verify context model updated
- xmlTypeMapping.setParentClass("model.Parent");
- assertEquals("model.Parent", ormTypeMapping.getSpecifiedParentClass());
- assertEquals("model.Parent", xmlTypeMapping.getParentClass());
-
- //set parentClass to null in the resource model
- xmlTypeMapping.setParentClass(null);
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
- }
-
- public void testModifySpecifiedParentClass() throws Exception {
- EclipseLinkOrmPersistentType persistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, "model.Employee");
- EclipseLinkOrmTypeMapping ormTypeMapping = persistentType.getMapping();
- XmlTypeMapping xmlTypeMapping = (XmlTypeMapping) ormTypeMapping.getXmlTypeMapping();
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
-
- //set parentClass in the context model, verify resource model modified
- ormTypeMapping.setSpecifiedParentClass("model.Parent");
- assertEquals("model.Parent", ormTypeMapping.getSpecifiedParentClass());
- assertEquals("model.Parent", xmlTypeMapping.getParentClass());
-
- //set parentClass to null in the context model
- ormTypeMapping.setSpecifiedParentClass(null);
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmEntityTests.java
deleted file mode 100644
index 08779f7c2a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmEntityTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_1OrmEntityTests
- extends EclipseLink2_1ContextModelTestCase
-{
- public EclipseLink2_1OrmEntityTests(String name) {
- super(name);
- }
-
- public void testUpdateSpecifiedParentClass() throws Exception {
- EclipseLinkOrmPersistentType persistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Employee");
- EclipseLinkOrmTypeMapping ormTypeMapping = persistentType.getMapping();
- XmlTypeMapping xmlTypeMapping = (XmlTypeMapping) ormTypeMapping.getXmlTypeMapping();
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
-
- //set parentClass in the resource model, verify context model updated
- xmlTypeMapping.setParentClass("model.Parent");
- assertEquals("model.Parent", ormTypeMapping.getSpecifiedParentClass());
- assertEquals("model.Parent", xmlTypeMapping.getParentClass());
-
- //set parentClass to null in the resource model
- xmlTypeMapping.setParentClass(null);
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
- }
-
- public void testModifySpecifiedParentClass() throws Exception {
- EclipseLinkOrmPersistentType persistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Employee");
- EclipseLinkOrmTypeMapping ormTypeMapping = persistentType.getMapping();
- XmlTypeMapping xmlTypeMapping = (XmlTypeMapping) ormTypeMapping.getXmlTypeMapping();
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
-
- //set parentClass in the context model, verify resource model modified
- ormTypeMapping.setSpecifiedParentClass("model.Parent");
- assertEquals("model.Parent", ormTypeMapping.getSpecifiedParentClass());
- assertEquals("model.Parent", xmlTypeMapping.getParentClass());
-
- //set parentClass to null in the context model
- ormTypeMapping.setSpecifiedParentClass(null);
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmMappedSuperclassTests.java
deleted file mode 100644
index 1b16d12965..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_1OrmMappedSuperclassTests
- extends EclipseLink2_1ContextModelTestCase
-{
- public EclipseLink2_1OrmMappedSuperclassTests(String name) {
- super(name);
- }
-
- public void testUpdateSpecifiedParentClass() throws Exception {
- EclipseLinkOrmPersistentType persistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Employee");
- EclipseLinkOrmTypeMapping ormTypeMapping = persistentType.getMapping();
- XmlTypeMapping xmlTypeMapping = (XmlTypeMapping) ormTypeMapping.getXmlTypeMapping();
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
-
- //set parentClass in the resource model, verify context model updated
- xmlTypeMapping.setParentClass("model.Parent");
- assertEquals("model.Parent", ormTypeMapping.getSpecifiedParentClass());
- assertEquals("model.Parent", xmlTypeMapping.getParentClass());
-
- //set parentClass to null in the resource model
- xmlTypeMapping.setParentClass(null);
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
- }
-
- public void testModifySpecifiedParentClass() throws Exception {
- EclipseLinkOrmPersistentType persistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, "model.Employee");
- EclipseLinkOrmTypeMapping ormTypeMapping = persistentType.getMapping();
- XmlTypeMapping xmlTypeMapping = (XmlTypeMapping) ormTypeMapping.getXmlTypeMapping();
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
-
- //set parentClass in the context model, verify resource model modified
- ormTypeMapping.setSpecifiedParentClass("model.Parent");
- assertEquals("model.Parent", ormTypeMapping.getSpecifiedParentClass());
- assertEquals("model.Parent", xmlTypeMapping.getParentClass());
-
- //set parentClass to null in the context model
- ormTypeMapping.setSpecifiedParentClass(null);
- assertNull(ormTypeMapping.getSpecifiedParentClass());
- assertNull(xmlTypeMapping.getParentClass());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmPersistentTypeTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmPersistentTypeTests.java
deleted file mode 100644
index 59a349a2db..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1OrmPersistentTypeTests.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkOrmPersistentType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlAccessMethodsHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_1OrmPersistentTypeTests
- extends EclipseLink2_1ContextModelTestCase
-{
- public EclipseLink2_1OrmPersistentTypeTests(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, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- }
- });
- }
-
- public void testUpdateSpecifiedGetMethod() throws Exception {
- createTestEntity();
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- XmlAccessMethodsHolder xmlAccessMethodsHolder = (XmlAccessMethodsHolder) ormPersistentType.getMapping().getXmlTypeMapping();
- assertNull(ormPersistentType.getSpecifiedGetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- //set getMethod in the resource model, verify context model updated
- xmlAccessMethodsHolder.setAccessMethods(EclipseLinkOrmFactory.eINSTANCE.createXmlAccessMethods());
- xmlAccessMethodsHolder.getAccessMethods().setGetMethod("getFoo");
- assertEquals("getFoo", ormPersistentType.getSpecifiedGetMethod());
- assertEquals("getFoo", xmlAccessMethodsHolder.getAccessMethods().getGetMethod());
-
- //set getMethod to null in the resource model
- xmlAccessMethodsHolder.getAccessMethods().setGetMethod(null);
- assertNull(ormPersistentType.getSpecifiedGetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods().getGetMethod());
- }
-
- public void testModifySpecifiedGetMethod() throws Exception {
- createTestEntity();
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- XmlAccessMethodsHolder xmlAccessMethodsHolder = (XmlAccessMethodsHolder) ormPersistentType.getMapping().getXmlTypeMapping();
- assertNull(ormPersistentType.getSpecifiedGetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- //set getMethod in the context model, verify resource model modified
- ormPersistentType.setSpecifiedGetMethod("getMe");
- assertEquals("getMe", ormPersistentType.getSpecifiedGetMethod());
- assertEquals("getMe", xmlAccessMethodsHolder.getAccessMethods().getGetMethod());
-
- //set getMethod to null in the context model
- ormPersistentType.setSpecifiedGetMethod(null);
- assertNull(ormPersistentType.getSpecifiedGetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
- }
-
- public void testModifySpecifiedGetMethod2() throws Exception {
- createTestEntity();
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- XmlAccessMethodsHolder xmlAccessMethodsHolder = (XmlAccessMethodsHolder) ormPersistentType.getMapping().getXmlTypeMapping();
- assertNull(ormPersistentType.getSpecifiedGetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- //set getMethod in the context model, verify resource model modified
- ormPersistentType.setSpecifiedGetMethod("getMe");
- assertEquals("getMe", ormPersistentType.getGetMethod());
- assertEquals("getMe", xmlAccessMethodsHolder.getAccessMethods().getGetMethod());
-
- //set another element on the access-methods element so it doesn't get removed
- xmlAccessMethodsHolder.getAccessMethods().setSetMethod("setMe");
- //set getMethod to null in the context model
- ormPersistentType.setSpecifiedGetMethod(null);
- assertNull(ormPersistentType.getSpecifiedGetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods().getGetMethod());
- }
-
- //TODO default from super class, default from mapped super class, what about a default on an embeddable?
- //default from persistence-unit-defaults, default from entity-mappings, default from java entity
- public void testGetDefaultGetMethod() throws Exception {
- createTestEntity();
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- XmlAccessMethodsHolder xmlAccessMethodsHolder = (XmlAccessMethodsHolder) ormPersistentType.getMapping().getXmlTypeMapping();
- assertNull(ormPersistentType.getSpecifiedGetMethod());
- assertNull(ormPersistentType.getGetMethod());
- assertNull(ormPersistentType.getDefaultGetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- ormPersistentType.setSpecifiedAccess(EclipseLinkAccessType.VIRTUAL);
- assertNull(ormPersistentType.getSpecifiedGetMethod());
- assertEquals("get", ormPersistentType.getGetMethod());
- assertEquals("get", ormPersistentType.getDefaultGetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- getPersistenceUnitDefaults().setSpecifiedGetMethod("getFoo");
- assertEquals("getFoo", ormPersistentType.getDefaultGetMethod());
- assertEquals("getFoo", ormPersistentType.getGetMethod());
-
- ormPersistentType.setSpecifiedGetMethod("getBar");
- assertEquals("getFoo", ormPersistentType.getDefaultGetMethod());
- assertEquals("getBar", ormPersistentType.getGetMethod());
-
- getPersistenceUnitDefaults().setSpecifiedGetMethod(null);
- assertEquals("get", ormPersistentType.getDefaultGetMethod());
- assertEquals("getBar", ormPersistentType.getGetMethod());
-
- ormPersistentType.setSpecifiedAccess(null);
- assertNull(ormPersistentType.getDefaultGetMethod());
- }
-
- public void testUpdateSpecifiedSetMethod() throws Exception {
- createTestEntity();
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- XmlAccessMethodsHolder xmlAccessMethodsHolder = (XmlAccessMethodsHolder) ormPersistentType.getMapping().getXmlTypeMapping();
- assertNull(ormPersistentType.getSpecifiedSetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- //set setMethod in the resource model, verify context model updated
- xmlAccessMethodsHolder.setAccessMethods(EclipseLinkOrmFactory.eINSTANCE.createXmlAccessMethods());
- xmlAccessMethodsHolder.getAccessMethods().setSetMethod("setFoo");
- assertEquals("setFoo", ormPersistentType.getSpecifiedSetMethod());
- assertEquals("setFoo", xmlAccessMethodsHolder.getAccessMethods().getSetMethod());
-
- //set setMethod to null in the resource model
- xmlAccessMethodsHolder.getAccessMethods().setSetMethod(null);
- assertNull(ormPersistentType.getSpecifiedSetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods().getSetMethod());
- }
-
- public void testModifySpecifiedSetMethod() throws Exception {
- createTestEntity();
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- XmlAccessMethodsHolder xmlAccessMethodsHolder = (XmlAccessMethodsHolder) ormPersistentType.getMapping().getXmlTypeMapping();
- assertNull(ormPersistentType.getSpecifiedSetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- //set setMethod in the context model, verify resource model modified
- ormPersistentType.setSpecifiedSetMethod("setMe");
- assertEquals("setMe", ormPersistentType.getSpecifiedSetMethod());
- assertEquals("setMe", xmlAccessMethodsHolder.getAccessMethods().getSetMethod());
-
- //set setMethod to null in the context model
- ormPersistentType.setSpecifiedSetMethod(null);
- assertNull(ormPersistentType.getSpecifiedSetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
- }
-
- public void testModifySpecifiedSetMethod2() throws Exception {
- createTestEntity();
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- XmlAccessMethodsHolder xmlAccessMethodsHolder = (XmlAccessMethodsHolder) ormPersistentType.getMapping().getXmlTypeMapping();
- assertNull(ormPersistentType.getSpecifiedSetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- //set setMethod in the context model, verify resource model modified
- ormPersistentType.setSpecifiedSetMethod("setMe");
- assertEquals("setMe", ormPersistentType.getSetMethod());
- assertEquals("setMe", xmlAccessMethodsHolder.getAccessMethods().getSetMethod());
-
- //set another element on the access-methods element so it doesn't get removed
- xmlAccessMethodsHolder.getAccessMethods().setGetMethod("getMe");
- //set setMethod to null in the context model
- ormPersistentType.setSpecifiedSetMethod(null);
- assertNull(ormPersistentType.getSpecifiedSetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods().getSetMethod());
- }
-
- //TODO default from super class, default from mapped super class, what about a default on an embeddable?
- //default from persistence-unit-defaults, default from entity-mappings, default from java entity
- public void testGetDefaultSetMethod() throws Exception {
- createTestEntity();
- EclipseLinkOrmPersistentType ormPersistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- XmlAccessMethodsHolder xmlAccessMethodsHolder = (XmlAccessMethodsHolder) ormPersistentType.getMapping().getXmlTypeMapping();
- assertNull(ormPersistentType.getSpecifiedSetMethod());
- assertNull(ormPersistentType.getSetMethod());
- assertNull(ormPersistentType.getDefaultSetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- ormPersistentType.setSpecifiedAccess(EclipseLinkAccessType.VIRTUAL);
- assertNull(ormPersistentType.getSpecifiedSetMethod());
- assertEquals("set", ormPersistentType.getSetMethod());
- assertEquals("set", ormPersistentType.getDefaultSetMethod());
- assertNull(xmlAccessMethodsHolder.getAccessMethods());
-
- getPersistenceUnitDefaults().setSpecifiedSetMethod("setFoo");
- assertEquals("setFoo", ormPersistentType.getDefaultSetMethod());
- assertEquals("setFoo", ormPersistentType.getSetMethod());
-
- ormPersistentType.setSpecifiedSetMethod("setBar");
- assertEquals("setFoo", ormPersistentType.getDefaultSetMethod());
- assertEquals("setBar", ormPersistentType.getSetMethod());
-
- getPersistenceUnitDefaults().setSpecifiedSetMethod(null);
- assertEquals("set", ormPersistentType.getDefaultSetMethod());
- assertEquals("setBar", ormPersistentType.getSetMethod());
-
- ormPersistentType.setSpecifiedAccess(null);
- assertNull(ormPersistentType.getDefaultSetMethod());
- }
-
- protected EclipseLinkPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return(EclipseLinkPersistenceUnitDefaults) getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- public void testAddVirtualAttribute() throws Exception {
- EclipseLinkOrmPersistentType persistentType = (EclipseLinkOrmPersistentType) getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Employee");
- OrmPersistentAttribute persistentAttribute = persistentType.addVirtualAttribute("id", MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, "int");
-
- assertEquals("id", persistentAttribute.getName());
- assertEquals(EclipseLinkAccessType.VIRTUAL, persistentAttribute.getSpecifiedAccess());
- OrmIdMapping idMapping = (OrmIdMapping) persistentAttribute.getMapping();
- assertEquals("int", idMapping.getAttributeType());
-
- XmlEntityMappings xmlEntityMappings = getXmlEntityMappings();
- XmlEntity xmlEntity = (XmlEntity) xmlEntityMappings.getEntities().get(0);
- XmlId xmlId = (XmlId) xmlEntity.getAttributes().getIds().get(0);
- assertEquals("id", xmlId.getName());
- assertEquals("int", xmlId.getAttributeType());
- assertEquals("VIRTUAL", xmlId.getAccess());
-
- //if the entity access is set to VIRTUAL, test that the added virtual attribute mapping has no specified access
- persistentType.setSpecifiedAccess(EclipseLinkAccessType.VIRTUAL);
- persistentAttribute = persistentType.addVirtualAttribute("name", MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, "String");
-
- assertEquals("name", persistentAttribute.getName());
- assertNull(persistentAttribute.getSpecifiedAccess());
- assertEquals(EclipseLinkAccessType.VIRTUAL, persistentAttribute.getDefaultAccess());
- OrmBasicMapping basicMapping = (OrmBasicMapping) persistentAttribute.getMapping();
- assertEquals("String", basicMapping.getAttributeType());
-
- XmlBasic xmlBasic = (XmlBasic) xmlEntity.getAttributes().getBasics().get(0);
- assertEquals("name", xmlBasic.getName());
- assertEquals("String", xmlBasic.getAttributeType());
- assertNull(xmlBasic.getAccess());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1PersistenceUnitDefaultsTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1PersistenceUnitDefaultsTests.java
deleted file mode 100644
index 39c93db3c2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_1PersistenceUnitDefaultsTests.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkAccessType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_1ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_1PersistenceUnitDefaultsTests
- extends EclipseLink2_1ContextModelTestCase
-{
- public EclipseLink2_1PersistenceUnitDefaultsTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected EclipseLinkPersistenceUnitDefaults getPersistenceUnitDefaults() {
- return(EclipseLinkPersistenceUnitDefaults) getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- protected XmlPersistenceUnitDefaults getXmlPersistenceUnitDefaults() {
- return (XmlPersistenceUnitDefaults) getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- XmlPersistenceUnitMetadata persistenceUnitMetadata = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- getXmlEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- XmlPersistenceUnitDefaults persistenceUnitDefaultsResource = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- persistenceUnitMetadata.setPersistenceUnitDefaults(persistenceUnitDefaultsResource);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(true);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(false);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
- }
-
-
- public void testUpdateAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL);
- assertEquals(EclipseLinkAccessType.VIRTUAL, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- persistenceUnitDefaults.setSpecifiedAccess(EclipseLinkAccessType.VIRTUAL);
- assertEquals(EclipseLinkAccessType.VIRTUAL, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setSpecifiedAccess(null);
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyAccess2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(EclipseLinkAccessType.VIRTUAL);
- assertEquals(EclipseLinkAccessType.VIRTUAL, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- //set access to null in the context model
- persistenceUnitDefaults.setSpecifiedAccess(null);
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(EclipseLinkAccessType.VIRTUAL);
- assertEquals(EclipseLinkAccessType.VIRTUAL, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_1.EclipseLinkAccessType.VIRTUAL, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setSpecifiedAccess(null);
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateGetMethod() throws Exception {
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getGetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set getMethod in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlPersistenceUnitDefaults().setAccessMethods(EclipseLinkOrmFactory.eINSTANCE.createXmlAccessMethods());
-
- getXmlPersistenceUnitDefaults().getAccessMethods().setGetMethod("getFoo");
- assertEquals("getFoo", persistenceUnitDefaults.getGetMethod());
- assertEquals("getFoo", getXmlPersistenceUnitDefaults().getAccessMethods().getGetMethod());
-
- //set getMethod to null in the resource model
- getXmlPersistenceUnitDefaults().getAccessMethods().setGetMethod(null);
- assertNull(persistenceUnitDefaults.getGetMethod());
- assertNull(getXmlPersistenceUnitDefaults().getAccessMethods().getGetMethod());
- }
-
- public void testModifyGetMethod() throws Exception {
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getGetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set getMethod in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedGetMethod("getMe");
- assertEquals("getMe", persistenceUnitDefaults.getGetMethod());
- assertEquals("getMe", getXmlPersistenceUnitDefaults().getAccessMethods().getGetMethod());
-
- //set getMethod to null in the context model
- persistenceUnitDefaults.setSpecifiedGetMethod(null);
- assertNull(persistenceUnitDefaults.getGetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyGetMethod2() throws Exception {
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getGetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set getMethod in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedGetMethod("getMe");
- assertEquals("getMe", persistenceUnitDefaults.getGetMethod());
- assertEquals("getMe", getXmlPersistenceUnitDefaults().getAccessMethods().getGetMethod());
-
- //set another element on the access-methods element so it doesn't get removed
- getXmlPersistenceUnitDefaults().getAccessMethods().setSetMethod("setMe");
- //set getMethod to null in the context model
- persistenceUnitDefaults.setSpecifiedGetMethod(null);
- assertNull(persistenceUnitDefaults.getGetMethod());
- assertNull(getXmlPersistenceUnitDefaults().getAccessMethods().getGetMethod());
- }
-
- public void testModifyGetMethod3() throws Exception {
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getGetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the ersistence-unit-defaults element so only access-methods element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
-
- //set getMethod in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedGetMethod("getMe");
- assertEquals("getMe", persistenceUnitDefaults.getGetMethod());
- assertEquals("getMe", getXmlPersistenceUnitDefaults().getAccessMethods().getGetMethod());
-
- //set getMethod to null in the context model
- persistenceUnitDefaults.setSpecifiedGetMethod(null);
- assertNull(persistenceUnitDefaults.getGetMethod());
- assertNull(getXmlPersistenceUnitDefaults().getAccessMethods());
- }
-
- public void testUpdateSetMethod() throws Exception {
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set getMethod in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlPersistenceUnitDefaults().setAccessMethods(EclipseLinkOrmFactory.eINSTANCE.createXmlAccessMethods());
-
- getXmlPersistenceUnitDefaults().getAccessMethods().setSetMethod("setFoo");
- assertEquals("setFoo", persistenceUnitDefaults.getSetMethod());
- assertEquals("setFoo", getXmlPersistenceUnitDefaults().getAccessMethods().getSetMethod());
-
- //set getMethod to null in the resource model
- getXmlPersistenceUnitDefaults().getAccessMethods().setSetMethod(null);
- assertNull(persistenceUnitDefaults.getSetMethod());
- assertNull(getXmlPersistenceUnitDefaults().getAccessMethods().getSetMethod());
- }
-
- public void testModifySetMethod() throws Exception {
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set getMethod in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSetMethod("setMe");
- assertEquals("setMe", persistenceUnitDefaults.getSetMethod());
- assertEquals("setMe", getXmlPersistenceUnitDefaults().getAccessMethods().getSetMethod());
-
- //set getMethod to null in the context model
- persistenceUnitDefaults.setSpecifiedSetMethod(null);
- assertNull(persistenceUnitDefaults.getSetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifySetMethod2() throws Exception {
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set getMethod in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSetMethod("setMe");
- assertEquals("setMe", persistenceUnitDefaults.getSetMethod());
- assertEquals("setMe", getXmlPersistenceUnitDefaults().getAccessMethods().getSetMethod());
-
- //set another element on the access-methods element so it doesn't get removed
- getXmlPersistenceUnitDefaults().getAccessMethods().setGetMethod("getMe");
- //set getMethod to null in the context model
- persistenceUnitDefaults.setSpecifiedSetMethod(null);
- assertNull(persistenceUnitDefaults.getSetMethod());
- assertNull(getXmlPersistenceUnitDefaults().getAccessMethods().getSetMethod());
- }
-
- public void testModifySetMethod3() throws Exception {
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = getPersistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSetMethod());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the ersistence-unit-defaults element so only access-methods element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
-
- //set getMethod in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSetMethod("setMe");
- assertEquals("setMe", persistenceUnitDefaults.getSetMethod());
- assertEquals("setMe", getXmlPersistenceUnitDefaults().getAccessMethods().getSetMethod());
-
- //set getMethod to null in the context model
- persistenceUnitDefaults.setSpecifiedSetMethod(null);
- assertNull(persistenceUnitDefaults.getSetMethod());
- assertNull(getXmlPersistenceUnitDefaults().getAccessMethods());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java
deleted file mode 100644
index 5d94efd33b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLink2_3OrmMultitenancyTests.java
+++ /dev/null
@@ -1,546 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.InheritanceType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkMultitenantType2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMultitenancy2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmTenantDiscriminatorColumn2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenant;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMultitenantHolder;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_3.MultitenantType;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_3ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_3OrmMultitenancyTests
- extends EclipseLink2_3ContextModelTestCase
-{
- protected static final String SUB_TYPE_NAME = "AnnotationTestTypeChild";
- protected static final String FULLY_QUALIFIED_SUB_TYPE_NAME = PACKAGE_NAME + "." + SUB_TYPE_NAME;
-
-
- public EclipseLink2_3OrmMultitenancyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantMappedSuperclass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.MAPPED_SUPERCLASS,
- EclipseLink.MULTITENANT,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@Multitenant").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"MS_TENANT_ID\")").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantRootEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(
- JPA.ENTITY,
- JPA.INHERITANCE,
- EclipseLink.MULTITENANT,
- EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Inheritenace").append(CR);
- sb.append("@Multitenant").append(CR);
- sb.append("@TenantDiscriminatorColumn(name=\"ROOT_ENTITY_TENANT_ID\")").append(CR);
- }
- });
- }
-
- private void createTestSubType() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("AnnotationTestTypeChild").append(" ");
- sb.append("extends " + TYPE_NAME + " ");
- sb.append("{}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "AnnotationTestTypeChild.java", sourceWriter);
- }
-
- public void testUpdateSpecifiedType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(multitenantResource.getType());
-
- //set type in the resource model, verify context model updated
- multitenantResource.setType(MultitenantType.SINGLE_TABLE);
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.SINGLE_TABLE, multitenantResource.getType());
-
- //set type to null in the resource model
- multitenantResource.setType(null);
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(multitenantResource.getType());
-
- multitenantResource.setType(MultitenantType.TABLE_PER_TENANT);
- assertEquals(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.TABLE_PER_TENANT, multitenantResource.getType());
-
- multitenantResource.setType(MultitenantType.VPD);
- assertEquals(EclipseLinkMultitenantType2_3.VPD, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.VPD, multitenantResource.getType());
-
- multitenantHolder.setMultitenant(null);
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(ormMultitenancy.getType());
- assertNull(multitenantHolder.getMultitenant());
- }
-
- public void testModifySpecifiedType() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(multitenantResource.getType());
-
- //set type in the context model, verify resource model modified
- ormMultitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(EclipseLinkMultitenantType2_3.SINGLE_TABLE, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.SINGLE_TABLE, multitenantResource.getType());
-
- ormMultitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.VPD);
- assertEquals(EclipseLinkMultitenantType2_3.VPD, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.VPD, multitenantResource.getType());
-
- ormMultitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT);
- assertEquals(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT, ormMultitenancy.getSpecifiedType());
- assertEquals(MultitenantType.TABLE_PER_TENANT, multitenantResource.getType());
-
- //set type to null in the context model
- ormMultitenancy.setSpecifiedType(null);
- assertNull(ormMultitenancy.getSpecifiedType());
- assertNull(multitenantResource.getType());
- }
-
- public void testUpdateSpecifiedIncludeCriteria() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- assertNull(ormMultitenancy.getSpecifiedIncludeCriteria());
- assertNull(multitenantResource.getIncludeCriteria());
-
- //set enumerated in the resource model, verify context model updated
- multitenantResource.setIncludeCriteria(Boolean.TRUE);
- assertEquals(Boolean.TRUE, ormMultitenancy.getSpecifiedIncludeCriteria());
- assertEquals(Boolean.TRUE, multitenantResource.getIncludeCriteria());
-
- multitenantResource.setIncludeCriteria(Boolean.FALSE);
- assertEquals(Boolean.FALSE, ormMultitenancy.getSpecifiedIncludeCriteria());
- assertEquals(Boolean.FALSE, multitenantResource.getIncludeCriteria());
-
- //set enumerated to null in the resource model
- multitenantResource.setIncludeCriteria(null);
- assertNull(ormMultitenancy.getSpecifiedIncludeCriteria());
- assertNull(multitenantResource.getIncludeCriteria());
- }
-
- public void testModifySpecifiedIncludeCriteria() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- assertNull(ormMultitenancy.getSpecifiedIncludeCriteria());
- assertNull(multitenantResource.getIncludeCriteria());
-
- //set enumerated in the context model, verify resource model updated
- ormMultitenancy.setSpecifiedIncludeCriteria(Boolean.TRUE);
- assertEquals(Boolean.TRUE, multitenantResource.getIncludeCriteria());
- assertEquals(Boolean.TRUE, ormMultitenancy.getSpecifiedIncludeCriteria());
-
- ormMultitenancy.setSpecifiedIncludeCriteria(Boolean.FALSE);
- assertEquals(Boolean.FALSE, multitenantResource.getIncludeCriteria());
- assertEquals(Boolean.FALSE, ormMultitenancy.getSpecifiedIncludeCriteria());
-
- //set enumerated to null in the context model
- ormMultitenancy.setSpecifiedIncludeCriteria(null);
- assertNull(multitenantResource.getIncludeCriteria());
- assertNull(ormMultitenancy.getSpecifiedIncludeCriteria());
- }
-
- public void testAddSpecifiedTenantDiscriminatorColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn = ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(0);
- tenantDiscriminatorColumn.setSpecifiedName("FOO");
-
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
-
- OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn2 = ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(0);
- tenantDiscriminatorColumn2.setSpecifiedName("BAR");
-
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
-
- OrmTenantDiscriminatorColumn2_3 tenantDiscriminatorColumn3 = ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(1);
- tenantDiscriminatorColumn3.setSpecifiedName("BAZ");
-
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(2).getName());
-
- ListIterator<OrmTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals(tenantDiscriminatorColumn2, tenantDiscriminatorColumns.next());
- assertEquals(tenantDiscriminatorColumn3, tenantDiscriminatorColumns.next());
- assertEquals(tenantDiscriminatorColumn, tenantDiscriminatorColumns.next());
-
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- }
-
- public void testRemoveSpecifiedTenantDiscriminatorColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, multitenantResource.getTenantDiscriminatorColumns().size());
-
- ormMultitenancy.removeSpecifiedTenantDiscriminatorColumn(0);
- assertEquals(2, multitenantResource.getTenantDiscriminatorColumns().size());
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
-
- ormMultitenancy.removeSpecifiedTenantDiscriminatorColumn(0);
- assertEquals(1, multitenantResource.getTenantDiscriminatorColumns().size());
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
-
- ormMultitenancy.removeSpecifiedTenantDiscriminatorColumn(0);
- assertEquals(0, multitenantResource.getTenantDiscriminatorColumns().size());
- }
-
- public void testMoveSpecifiedTenantDiscriminatorColumn() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(0).setSpecifiedName("FOO");
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(1).setSpecifiedName("BAR");
- ormMultitenancy.addSpecifiedTenantDiscriminatorColumn(2).setSpecifiedName("BAZ");
-
- assertEquals(3, multitenantResource.getTenantDiscriminatorColumns().size());
-
-
- ormMultitenancy.moveSpecifiedTenantDiscriminatorColumn(2, 0);
- ListIterator<OrmTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
-
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(2).getName());
-
-
- ormMultitenancy.moveSpecifiedTenantDiscriminatorColumn(0, 1);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
-
- assertEquals("BAZ", multitenantResource.getTenantDiscriminatorColumns().get(0).getName());
- assertEquals("BAR", multitenantResource.getTenantDiscriminatorColumns().get(1).getName());
- assertEquals("FOO", multitenantResource.getTenantDiscriminatorColumns().get(2).getName());
- }
-
- public void testUpdateTenantDiscriminatorColumns() throws Exception {
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.foo");
- XmlMultitenantHolder multitenantHolder = (XmlMultitenantHolder) getXmlEntityMappings().getEntities().get(0);
- multitenantHolder.setMultitenant(EclipseLinkOrmFactory.eINSTANCE.createXmlMultitenant());
-
- OrmEclipseLinkMultitenancy2_3 ormMultitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- XmlMultitenant multitenantResource = multitenantHolder.getMultitenant();
-
- multitenantResource.getTenantDiscriminatorColumns().add(EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn());
- multitenantResource.getTenantDiscriminatorColumns().add(EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn());
- multitenantResource.getTenantDiscriminatorColumns().add(EclipseLinkOrmFactory.eINSTANCE.createXmlTenantDiscriminatorColumn());
-
- multitenantResource.getTenantDiscriminatorColumns().get(0).setName("FOO");
- multitenantResource.getTenantDiscriminatorColumns().get(1).setName("BAR");
- multitenantResource.getTenantDiscriminatorColumns().get(2).setName("BAZ");
-
- ListIterator<OrmTenantDiscriminatorColumn2_3> tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().move(2, 0);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().move(0, 1);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("BAR", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().remove(1);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertEquals("FOO", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().remove(1);
- tenantDiscriminatorColumns = ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator();
- assertEquals("BAZ", tenantDiscriminatorColumns.next().getName());
- assertFalse(tenantDiscriminatorColumns.hasNext());
-
- multitenantResource.getTenantDiscriminatorColumns().remove(0);
- assertFalse(ormMultitenancy.getSpecifiedTenantDiscriminatorColumns().iterator().hasNext());
- }
-
- //MappedSuperclass specifies multitenancy, all subclass entities are multitenant by default.
- public void testTenantDiscriminatorColumnsWithMappedSuperclass() throws Exception {
- createTestMultitenantMappedSuperclass();
- createTestSubType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormPersistentType2 = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType2.getMapping()).getMultitenancy();
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("MS_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if the entity specifies multitenant, then it does not get the tenant discriminator columns from the mapped superclass
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
-
- multitenancy.setSpecifiedMultitenant(false);
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- OrmEclipseLinkMultitenancy2_3 mappedSuperclassMultitenancy = ((OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping()).getMultitenancy();
- mappedSuperclassMultitenancy.setSpecifiedMultitenant(true);
- mappedSuperclassMultitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("MS_TENANT_ID");
-
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("MS_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- //Root entity specifies multitenancy and SINGLE_TABLE inheritance, all subclass entities are multitenant by default.
- public void testTenantDiscriminatorColumnsWithInheritance() throws Exception {
- createTestMultitenantRootEntity();
- createTestSubType();
-
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".AnnotationTestTypeChild");
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- ormPersistentType.getMapping().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertTrue(multitenancy.isMultitenant()); //multitenant by default from root entity
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("ROOT_ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- ormPersistentType.getMapping().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.TABLE_PER_CLASS);
- assertFalse(multitenancy.isMultitenant()); //not multitenant since inheritance strategy is table per class
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
- assertFalse(multitenancy.isMultitenant()); //not multitenant since inheritance strategy is table per class
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //get the default tenant discriminator column from the persistence unit defaults instead of the root entity since inheritance strategy is table per class
- multitenancy.setSpecifiedMultitenant(true);
- assertTrue(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- multitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("CHILD_TENANT_ID");
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- ormPersistentType.getMapping().getRootEntity().setSpecifiedInheritanceStrategy(InheritanceType.JOINED);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("CHILD_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- public void testTenantDiscriminatorColumnsWithPersistenceUnitDefaults() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("PU_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if there are specified tenant discriminator columns then there should not be any default ones
- multitenancy.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("ENTITY_TENANT_ID");
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals(0, multitenancy.getDefaultTenantDiscriminatorColumnsSize());
- assertEquals("ENTITY_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedMultitenant(false);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
- }
-
- public void testTenantDiscriminatorColumnsWithEntityMappingsDefaults() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkEntityMappings entityMappings = (EclipseLinkEntityMappings) getMappingFile().getRoot();
- entityMappings.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("EM_TENANT_ID");
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- //if entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.TABLE_PER_TENANT);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
- //if entity is not SINGLE_TABLE multitenant than there are no default tenant discriminator columns
- multitenancy.setSpecifiedMultitenant(false);
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
-
-
- EclipseLinkPersistenceUnitDefaults persistenceUnitDefaults = (EclipseLinkPersistenceUnitDefaults) getMappingFile().getRoot().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- persistenceUnitDefaults.addTenantDiscriminatorColumn().setSpecifiedName("PU_TENANT_ID");
-
- multitenancy.setSpecifiedType(EclipseLinkMultitenantType2_3.SINGLE_TABLE);
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
- }
-
- public void testTenantDiscriminatorColumnsWithJavaMultitenant() throws Exception {
- createTestEntity();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- ((EclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getMultitenancy().setSpecifiedMultitenant(true);
-
- OrmEclipseLinkMultitenancy2_3 multitenancy = ((OrmEclipseLinkEntity) ormPersistentType.getMapping()).getMultitenancy();
- assertTrue(multitenancy.isMultitenant()); //isMultitenant is true because the java entity specifies @Multitenant
- assertFalse(multitenancy.isSpecifiedMultitenant());
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
- EclipseLinkEntityMappings entityMappings = (EclipseLinkEntityMappings) getMappingFile().getRoot();
- entityMappings.addSpecifiedTenantDiscriminatorColumn().setSpecifiedName("EM_TENANT_ID");
-
- assertEquals(1, multitenancy.getTenantDiscriminatorColumnsSize());
- assertEquals("EM_TENANT_ID", multitenancy.getTenantDiscriminatorColumns().iterator().next().getName());
-
-
- OrmPersistenceUnitMetadata persistenceUnitMetadata = (OrmPersistenceUnitMetadata) getMappingFile().getRoot().getPersistenceUnitMetadata();
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertFalse(multitenancy.isMultitenant());
- assertEquals(0, multitenancy.getTenantDiscriminatorColumnsSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java
deleted file mode 100644
index 4560c5a451..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkEntityMappingsTests.java
+++ /dev/null
@@ -1,677 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkEntityMappingsTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkEntityMappingsTests(String name) {
- super(name);
- }
-
-
- public void testUpdateCustomConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEntityMappings.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEntityMappings.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceEntityMappings.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceEntityMappings.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals("Foo", resourceEntityMappings.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEntityMappings.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceEntityMappings.getConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEntityMappings.getConverters().get(0).getName());
- assertEquals("Foo", resourceEntityMappings.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceEntityMappings.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceEntityMappings.getConverters().size());
- assertEquals("Foo", resourceEntityMappings.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEntityMappings.getConverters().get(0).getName());
- assertEquals("Foo2", resourceEntityMappings.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceEntityMappings.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceEntityMappings.getConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEntityMappings.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEntityMappings.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEntityMappings.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceEntityMappings.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceEntityMappings.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals("Foo", resourceEntityMappings.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEntityMappings.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceEntityMappings.getTypeConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEntityMappings.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEntityMappings.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceEntityMappings.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceEntityMappings.getTypeConverters().size());
- assertEquals("Foo", resourceEntityMappings.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEntityMappings.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEntityMappings.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceEntityMappings.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceEntityMappings.getTypeConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEntityMappings.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEntityMappings.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEntityMappings.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEntityMappings.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntityMappings.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntityMappings.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEntityMappings.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntityMappings.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEntityMappings.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntityMappings.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEntityMappings.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntityMappings.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntityMappings.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEntityMappings.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEntityMappings.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceEntityMappings.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntityMappings.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceEntityMappings.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntityMappings.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- XmlEntityMappings resourceEntityMappings = getXmlEntityMappings();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- EclipseLinkEntityMappings contextEntityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = contextEntityMappings.getConverterContainer();
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals("Foo", resourceEntityMappings.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEntityMappings.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceEntityMappings.getStructConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEntityMappings.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceEntityMappings.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceEntityMappings.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceEntityMappings.getStructConverters().size());
- assertEquals("Foo", resourceEntityMappings.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEntityMappings.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceEntityMappings.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceEntityMappings.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceEntityMappings.getStructConverters().size());
- assertEquals("Foo2", resourceEntityMappings.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEntityMappings.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEntityMappings.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java
deleted file mode 100644
index 02daf99833..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmBasicMappingTests.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.java.JavaBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmBasicMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmBasicMappingTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableBasicDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public EclipseLinkOrmBasicMappingTests(String name) {
- super(name);
- }
-
-
- public void testUpdateMutable() throws Exception {
- createTestEntityWithBasicMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping contextBasic =
- (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlBasic resourceBasic =
- (XmlBasic) resourceEntity.getAttributes().getBasics().get(0);
- EclipseLinkBasicMapping javaBasicMapping = (EclipseLinkBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- // check defaults
-
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceBasic.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceBasic.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceBasic.setMutable(null);
-
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // TODO - test defaults for java serializable and date/time types,
- // with and without persistence property
-
- // set mutable on java basic mapping
-
- javaBasicMapping.getMutable().setSpecifiedMutable(Boolean.FALSE);
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
- assertFalse(javaBasicMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkBasicMapping virtualContextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceBasic.getMutable());
- assertTrue(virtualContextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, virtualContextBasic.getMutable().getSpecifiedMutable());
- assertFalse(virtualContextBasic.getMutable().isMutable());
- assertFalse(javaBasicMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- virtualContextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceBasic.getMutable());
- assertTrue(virtualContextBasic.getMutable().isDefaultMutable());
- assertNull(virtualContextBasic.getMutable().getSpecifiedMutable());
- assertTrue(virtualContextBasic.getMutable().isMutable());
- assertFalse(javaBasicMapping.getMutable().isMutable());
- }
-
- public void testUpdateMutableDate() throws Exception {
- createTestEntityWithMutableBasicDate();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myDate"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping contextBasic =
- (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlBasic resourceBasic =
- (XmlBasic) resourceEntity.getAttributes().getBasics().get(0);
- EclipseLinkBasicMapping javaBasicMapping = (EclipseLinkBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("myDate").getMapping();
-
- // check defaults
-
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceBasic.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceBasic.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceBasic.setMutable(null);
-
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.TRUE);
- assertNull(resourceBasic.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(null);
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set mutable on java basic mapping
-
- javaBasicMapping.getMutable().setSpecifiedMutable(Boolean.TRUE);
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
- assertTrue(javaBasicMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkBasicMapping virtualContextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceBasic.getMutable());
- assertFalse(virtualContextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, virtualContextBasic.getMutable().getSpecifiedMutable());
- assertTrue(virtualContextBasic.getMutable().isMutable());
- assertTrue(javaBasicMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- virtualContextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceBasic.getMutable());
- assertFalse(virtualContextBasic.getMutable().isDefaultMutable());
- assertNull(virtualContextBasic.getMutable().getSpecifiedMutable());
- assertFalse(virtualContextBasic.getMutable().isMutable());
- assertTrue(javaBasicMapping.getMutable().isMutable());
- }
-
- public void testModifyMutable() throws Exception {
- createTestEntityWithMutableBasicDate();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myDate"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping contextBasic =
- (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlBasic resourceBasic =
- (XmlBasic) resourceEntity.getAttributes().getBasics().get(0);
-
- // check defaults
-
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set context mutable to true, check resource
-
- contextBasic.getMutable().setSpecifiedMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
-
- // set context mutable to false, check resource
-
- contextBasic.getMutable().setSpecifiedMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
-
- // set context mutable to null, check resource
-
- contextBasic.getMutable().setSpecifiedMutable(null);
-
- assertNull(resourceBasic.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
- }
-
- public void testUpdateConvert() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = (XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
- JavaBasicMapping javaBasicMapping = (JavaBasicMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- basicResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.class, ormBasicMapping.getConverter().getType());
- assertEquals("myConvert", basicResource.getConvert());
-
- //set lob to null in the resource model
- basicResource.setConvert(null);
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
-
- javaBasicMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) javaBasicMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaBasicMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkBasicMapping virtualBasicMapping = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
-
- assertEquals(EclipseLinkConvert.class, virtualBasicMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaBasicMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaBasicMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.class, virtualBasicMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) virtualBasicMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaBasicMapping.getConverter()).getSpecifiedConverterName());
-
- javaBasicMapping.setConverter(null);
- assertNull(virtualBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertNull(javaBasicMapping.getConverter().getType());
- }
-
- public void testModifyConvert() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmBasicMapping ormBasicMapping = (OrmBasicMapping) ormPersistentAttribute.getMapping();
- XmlBasic basicResource = (XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormBasicMapping.setConverter(EclipseLinkConvert.class);
- assertEquals("", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormBasicMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormBasicMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormBasicMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormBasicMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob to false in the context model
- ormBasicMapping.setConverter(null);
- assertNull(ormBasicMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmCachingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmCachingTests.java
deleted file mode 100644
index 868065b582..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmCachingTests.java
+++ /dev/null
@@ -1,497 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlCache;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.v2_2.CacheIsolationType;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmCachingTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- public EclipseLinkOrmCachingTests(String name) {
- super(name);
- }
-
- public void testSetSpecifiedShared() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(true, caching.isShared());
-
- caching.setSpecifiedShared(Boolean.FALSE);
-
-
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedShared());
- assertEquals(false, entity.getCaching().isShared());
-
-
- }
-
- public void testSetSpecifiedSharedFalseUnsetsOtherCacheSettings() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- caching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- caching.setSpecifiedSize(Integer.valueOf(500));
- caching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
- caching.setSpecifiedRefreshOnlyIfNewer(Boolean.FALSE);
- caching.setSpecifiedDisableHits(Boolean.FALSE);
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- caching.setSpecifiedExistenceType(EclipseLinkExistenceType.CHECK_CACHE);
- caching.setExpiry(Integer.valueOf(8000));
-
- caching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(null, caching.getSpecifiedType());
- assertEquals(null, caching.getSpecifiedSize());
- assertEquals(null, caching.getSpecifiedAlwaysRefresh());
- assertEquals(null, caching.getSpecifiedRefreshOnlyIfNewer());
- assertEquals(null, caching.getSpecifiedDisableHits());
- assertEquals(null, caching.getSpecifiedCoordinationType());
- assertEquals(null, caching.getExpiry());
-
-
- //existence checking is the only thing that isn't unset when shared is set to false
- assertEquals(EclipseLinkExistenceType.CHECK_CACHE, caching.getSpecifiedExistenceType());
-
- caching.setSpecifiedShared(null);
- EclipseLinkTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
- timeOfDayExpiry.setHour(Integer.valueOf(5));
-
- caching.setSpecifiedShared(Boolean.FALSE);
- assertNull(caching.getExpiryTimeOfDay());
-
- }
-
- public void testGetDefaultShared() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertTrue(caching.isDefaultShared());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT, "false");
-
- assertFalse(caching.isDefaultShared());
- }
-
- public void testGetSpecifiedShared() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(true, caching.isShared());
-
- }
-
- public void testSetSpecifiedType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
-
- caching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
-
-
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getSpecifiedType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, entity.getCaching().getType());
-
- caching.setSpecifiedType(EclipseLinkCacheType.SOFT_WEAK);
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getSpecifiedType());
-
- caching.setSpecifiedType(null);
- assertNull(caching.getSpecifiedType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
- }
-
- public void testGetDefaultType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getDefaultType());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT, EclipseLinkCacheType.FULL.toString());
-
- assertEquals(EclipseLinkCacheType.FULL, caching.getDefaultType());
- }
-
- public void testGetSpecifiedType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, caching.getType());
-
- }
-
- public void testSetSpecifiedAlwaysRefresh() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isAlwaysRefresh());
-
- caching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
-
-
- assertEquals(Boolean.FALSE, entity.getCaching().getSpecifiedAlwaysRefresh());
- assertEquals(false, entity.getCaching().isAlwaysRefresh());
-
- }
-
- public void testGetSpecifiedAlwaysRefresh() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isAlwaysRefresh());
-
- }
-
- public void testSetSpecifiedRefreshOnlyIfNewer() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isRefreshOnlyIfNewer());
-
- caching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
-
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedRefreshOnlyIfNewer());
- assertEquals(true, entity.getCaching().isRefreshOnlyIfNewer());
-
- }
-
- public void testGetSpecifiedRefreshOnlyIfNewer() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isRefreshOnlyIfNewer());
-
- }
-
- public void testSetSpecifiedDisableHits() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isDisableHits());
-
- caching.setSpecifiedDisableHits(Boolean.TRUE);
-
-
- assertEquals(Boolean.TRUE, entity.getCaching().getSpecifiedDisableHits());
- assertEquals(true, entity.getCaching().isDisableHits());
-
- }
-
- public void testGetSpecifiedDisableHits() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(false, caching.isDisableHits());
-
- }
-
- public void testSetSpecifiedCoordinationType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
-
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
-
-
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, entity.getCaching().getCoordinationType());
-
- //set specified coordination type to the same as the default, verify it is not set to default
- caching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES);
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getSpecifiedCoordinationType());
-
- caching.setSpecifiedCoordinationType(null);
- assertNull(caching.getSpecifiedCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
- }
-
- public void testGetSpecifiedCoordinationType() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, caching.getCoordinationType());
- }
-
- public void testGetExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
-
- assertNull(entity.getCaching().getExpiry());
-
- }
-
- public void testSetExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- caching.setExpiry(Integer.valueOf(58));
- assertEquals(Integer.valueOf(58), caching.getExpiry());
-
-
- caching.setExpiry(null);
- assertNull(caching.getExpiry());
- }
-
- public void testSetExpiryUnsetsExpiryTimeOfDay() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- caching.addExpiryTimeOfDay();
- caching.getExpiryTimeOfDay().setHour(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), caching.getExpiryTimeOfDay().getHour());
-
- caching.setExpiry(Integer.valueOf(900));
-
- assertNull(caching.getExpiryTimeOfDay());
- assertEquals(Integer.valueOf(900), caching.getExpiry());
- }
-
- public void testGetTimeOfDayExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
- }
-
- public void testAddTimeOfDayExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
-
- EclipseLinkTimeOfDay timeOfDayExpiry = caching.addExpiryTimeOfDay();
-
- assertNotNull(caching.getExpiryTimeOfDay());
- assertEquals(timeOfDayExpiry, caching.getExpiryTimeOfDay());
- }
-
- public void testRemoveTimeOfDayExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertNull(caching.getExpiryTimeOfDay());
- }
-
- public void testAddTimeOfDayExpiryUnsetsExpiry() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- caching.setExpiry(Integer.valueOf(800));
- assertEquals(Integer.valueOf(800), caching.getExpiry());
-
- caching.addExpiryTimeOfDay();
-
- assertNull(caching.getExpiry());
- assertNotNull(caching.getExpiryTimeOfDay());
- }
-
-
- public void testSetSpecifiedSize() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getSize());
-
- caching.setSpecifiedSize(new Integer(50));
-
-
- assertEquals(new Integer(50), entity.getCaching().getSpecifiedSize());
- assertEquals(50, entity.getCaching().getSize());
- }
-
- public void testGetDefaultSize() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getDefaultSize());
-
- getPersistenceUnit().setProperty(Caching.ECLIPSELINK_CACHE_SIZE_DEFAULT, "333");
-
- assertEquals(333, caching.getDefaultSize());
- }
-
- public void testGetSpecifiedSize() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
-
- assertEquals(100, caching.getSize());
-
- caching.setSpecifiedSize(new Integer(50));
- getJpaProject().synchronizeContextModel();
-
- assertEquals(new Integer(50), entity.getCaching().getSpecifiedSize());
- assertEquals(50, entity.getCaching().getSize());
- }
-
- public void testSetSpecifiedIsolation() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
- XmlCache xmlCache = entity.getXmlTypeMapping().getCache();
-
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(xmlCache);
-
- caching.setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2.PROTECTED);
- xmlCache = entity.getXmlTypeMapping().getCache();
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, entity.getCaching().getIsolation());
- assertEquals(CacheIsolationType.PROTECTED, xmlCache.getIsolation());
-
- //set specified isolation to the same as the default, verify it is not set to default
- caching.setSpecifiedIsolation(EclipseLinkCacheIsolationType2_2.SHARED);
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertEquals(CacheIsolationType.SHARED, xmlCache.getIsolation());
-
- caching.setSpecifiedIsolation(null);
- xmlCache = entity.getXmlTypeMapping().getCache();
- assertNull(caching.getSpecifiedIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(xmlCache);
- }
-
- public void testGetSpecifiedIsolation() throws Exception {
- createTestEntity();
-
- OrmPersistentType type = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity entity = (OrmEclipseLinkEntity)type.getMapping();
- OrmEclipseLinkCaching caching = entity.getCaching();
- XmlCache xmlCache = entity.getXmlTypeMapping().getCache();
-
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(xmlCache);
-
- entity.getXmlTypeMapping().setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- xmlCache = entity.getXmlTypeMapping().getCache();
- xmlCache.setIsolation(CacheIsolationType.ISOLATED);
- assertEquals(EclipseLinkCacheIsolationType2_2.ISOLATED, caching.getIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.ISOLATED, caching.getSpecifiedIsolation());
-
- xmlCache.setIsolation(CacheIsolationType.PROTECTED);
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, caching.getIsolation());
- assertEquals(EclipseLinkCacheIsolationType2_2.PROTECTED, caching.getSpecifiedIsolation());
-
- xmlCache.setIsolation(null);
- assertEquals(EclipseLinkCacheIsolationType2_2.SHARED, caching.getIsolation());
- assertNull(caching.getSpecifiedIsolation());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java
deleted file mode 100644
index 8debc934af..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmConverterTests.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmConverterTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERT, EclipseLink.CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Convert(name=\"foo\")").append(CR);
- sb.append(" @Converter");
- }
- });
- }
-
-
- public EclipseLinkOrmConverterTests(String name) {
- super(name);
- }
-
-
- public void testUpdateConverterClass() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- OrmEclipseLinkCustomConverter ormConverter = ormBasicMapping.getConverterContainer().addCustomConverter(0);
- XmlConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getConverters().get(0);
-
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getClassName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setClassName("myConvert");
- assertEquals("myConvert", ormConverter.getConverterClass());
- assertEquals("myConvert", converterResource.getClassName());
-
- //set converter class name to null in the resource model
- converterResource.setClassName(null);
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getClassName());
- }
-
- public void testModifyConverterClass() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- OrmEclipseLinkCustomConverter ormConverter = ormBasicMapping.getConverterContainer().addCustomConverter(0);
- XmlConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getConverters().get(0);
-
-
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getClassName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setConverterClass("foo");
- assertEquals("foo", ormConverter.getConverterClass());
- assertEquals("foo", converterResource.getClassName());
-
- ormConverter.setConverterClass(null);
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getClassName());
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- OrmEclipseLinkCustomConverter ormConverter = ormBasicMapping.getConverterContainer().addCustomConverter(0);
- XmlConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getConverters().get(0);
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setName("myConvert");
- assertEquals("myConvert", ormConverter.getName());
- assertEquals("myConvert", converterResource.getName());
-
- //set converter class name to null in the resource model
- converterResource.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- OrmEclipseLinkCustomConverter ormConverter = ormBasicMapping.getConverterContainer().addCustomConverter(0);
- XmlConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getConverters().get(0);
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setName("foo");
- assertEquals("foo", ormConverter.getName());
- assertEquals("foo", converterResource.getName());
-
- ormConverter.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java
deleted file mode 100644
index 1c1310d299..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEmbeddableTests.java
+++ /dev/null
@@ -1,1037 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmEmbeddableTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmEmbeddableTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEmbeddableForCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, EclipseLink.CUSTOMIZER);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, EclipseLink.CHANGE_TRACKING);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForCustomConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForObjectTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableForStructConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
- });
- }
-
- public void testUpdateCustomizerClass() throws Exception {
- createTestEmbeddableForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEmbeddable javaContextEmbeddable = (JavaEclipseLinkEmbeddable) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
-
- // check defaults
-
- assertNull(resourceEmbeddable.getCustomizer());
- assertNull(javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // set xml customizer, check defaults
- resourceEmbeddable.setCustomizer(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(resourceEmbeddable.getCustomizer().getClassName());
- assertNull(javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
-
- // set xml customizer class, check override
-
- resourceEmbeddable.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceEmbeddable.getCustomizer().getClassName());
- assertNull(javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // clear xml customizer class, set java customizer class, check defaults
-
- resourceEmbeddable.getCustomizer().setClassName(null);
- javaContextEmbeddable.getCustomizer().setSpecifiedCustomizerClass("bar");
-
- assertNull(resourceEmbeddable.getCustomizer().getClassName());
- assertEquals("bar", javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEmbeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEmbeddable.getCustomizer().getClassName());
- assertEquals("bar", javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- ormContextEmbeddable.setSpecifiedMetadataComplete(null);
-
- // set xml customizer class, check override
-
- resourceEmbeddable.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceEmbeddable.getCustomizer().getClassName());
- assertEquals("bar", javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- //set xml customizer null
- javaContextEmbeddable.getCustomizer().setSpecifiedCustomizerClass(null);
- resourceEmbeddable.setCustomizer(null);
- assertNull(resourceEmbeddable.getCustomizer());
- assertNull(javaContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- }
-
- public void testModifyCustomizerClass() throws Exception {
- createTestEmbeddableForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- // check defaults
-
- assertNull(resourceEmbeddable.getCustomizer());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer, check resource
-
- ormContextEmbeddable.getCustomizer().setSpecifiedCustomizerClass("foo");
-
- assertEquals("foo", resourceEmbeddable.getCustomizer().getClassName());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer to null, check resource
-
- ormContextEmbeddable.getCustomizer().setSpecifiedCustomizerClass(null);
-
- assertNull(resourceEmbeddable.getCustomizer());
- assertNull(ormContextEmbeddable.getCustomizer().getCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEmbeddable.getCustomizer().getSpecifiedCustomizerClass());
- }
-
- public void testUpdateChangeTracking() throws Exception {
- createTestEmbeddableForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEmbeddable javaContextEmbeddable = (JavaEclipseLinkEmbeddable) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- // check defaults
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set xml type to ATTRIBUTE, check context
-
- resourceEmbeddable.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set xml type to OBJECT, check context
-
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set xml type to DEFERRED, check context
-
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set xml type to AUTO, check context
-
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // clear xml change tracking, set java change tracking, check defaults
-
- resourceEmbeddable.setChangeTracking(null);
- javaContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEmbeddable.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // unset metadataComplete, set xml change tracking to OBJECT, check context
-
- ormContextEmbeddable.setSpecifiedMetadataComplete(null);
- resourceEmbeddable.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceEmbeddable.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
- }
-
- public void testModifyChangeTracking() throws Exception {
- createTestEmbeddableForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- // check defaults
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to ATTRIBUTE, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to OBJECT, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to DEFERRED, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to AUTO, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to null, check resource
-
- ormContextEmbeddable.getChangeTracking().setSpecifiedType(null);
-
- assertNull(resourceEmbeddable.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEmbeddable.getChangeTracking().getDefaultType());
- assertNull(ormContextEmbeddable.getChangeTracking().getSpecifiedType());
- }
-
- public void testUpdateCustomConverters() throws Exception {
- createTestEmbeddableForCustomConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEmbeddable.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEmbeddable.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEmbeddable.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceEmbeddable.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceEmbeddable.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- createTestEmbeddableForCustomConverters();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEmbeddable.getConverters().size());
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals("Foo", resourceEmbeddable.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEmbeddable.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceEmbeddable.getConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEmbeddable.getConverters().get(0).getName());
- assertEquals("Foo", resourceEmbeddable.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceEmbeddable.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceEmbeddable.getConverters().size());
- assertEquals("Foo", resourceEmbeddable.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEmbeddable.getConverters().get(0).getName());
- assertEquals("Foo2", resourceEmbeddable.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceEmbeddable.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceEmbeddable.getConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEmbeddable.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
-
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getConverters().size());
- }
-
- public void testUpdateTypeConverters() throws Exception {
- createTestEmbeddableForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEmbeddable.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEmbeddable.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceEmbeddable.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceEmbeddable.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- createTestEmbeddableForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals("Foo", resourceEmbeddable.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEmbeddable.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceEmbeddable.getTypeConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEmbeddable.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEmbeddable.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceEmbeddable.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceEmbeddable.getTypeConverters().size());
- assertEquals("Foo", resourceEmbeddable.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEmbeddable.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEmbeddable.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceEmbeddable.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceEmbeddable.getTypeConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEmbeddable.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- createTestEmbeddableForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEmbeddable.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEmbeddable.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- createTestEmbeddableForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEmbeddable.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEmbeddable.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEmbeddable.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEmbeddable.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceEmbeddable.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEmbeddable.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEmbeddable.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEmbeddable.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEmbeddable.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEmbeddable.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- createTestEmbeddableForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEmbeddable.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEmbeddable.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceEmbeddable.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEmbeddable.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceEmbeddable.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEmbeddable.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- createTestEmbeddableForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEmbeddable ormContextEmbeddable = (OrmEclipseLinkEmbeddable) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEmbeddable.getConverterContainer();
- XmlEmbeddable resourceEmbeddable = (XmlEmbeddable) getXmlEntityMappings().getEmbeddables().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals("Foo", resourceEmbeddable.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEmbeddable.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceEmbeddable.getStructConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEmbeddable.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceEmbeddable.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceEmbeddable.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceEmbeddable.getStructConverters().size());
- assertEquals("Foo", resourceEmbeddable.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEmbeddable.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceEmbeddable.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceEmbeddable.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceEmbeddable.getStructConverters().size());
- assertEquals("Foo2", resourceEmbeddable.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEmbeddable.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEmbeddable.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java
deleted file mode 100644
index 403a9d184b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmEntityTests.java
+++ /dev/null
@@ -1,2395 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTimeOfDay;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmEntityTests
- extends EclipseLinkContextModelTestCase
-{
-
- public EclipseLinkOrmEntityTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityForReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, EclipseLink.CHANGE_TRACKING);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForCaching() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForObjectTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityForStructConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- public void testUpdateReadOnly() throws Exception {
- createTestEntityForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEntity javaContextEntity = (JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceEntity.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceEntity.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to true, check defaults
-
- resourceEntity.setReadOnly(null);
- javaContextEntity.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertNull(resourceEntity.getReadOnly());
- assertTrue(javaContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEntity.getReadOnly());
- assertTrue(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- // set xml read only to false, check override
-
- resourceEntity.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getReadOnly());
- assertTrue(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceEntity.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getReadOnly());
- assertTrue(javaContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to false, check defaults
-
- resourceEntity.setReadOnly(null);
- javaContextEntity.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertNull(resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
-
-
- // set xml read only to false, check override
-
- resourceEntity.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceEntity.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getReadOnly());
- assertFalse(javaContextEntity.getReadOnly().isReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testModifyReadOnly() throws Exception {
- createTestEntityForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to true, check resource
-
- ormContextEntity.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getReadOnly());
- assertTrue(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to false, check resource
-
- ormContextEntity.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextEntity.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to null, check resource
-
- ormContextEntity.getReadOnly().setSpecifiedReadOnly(null);
-
- assertNull(resourceEntity.getReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isReadOnly());
- assertFalse(ormContextEntity.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextEntity.getReadOnly().getSpecifiedReadOnly());
- }
-
-
- public void testUpdateCustomizerClass() throws Exception {
- createTestEntityForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEntity javaContextEntity = (JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertNull(resourceEntity.getCustomizer());
- assertNull(javaContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // set xml customizer, check defaults
- resourceEntity.setCustomizer(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(resourceEntity.getCustomizer().getClassName());
- assertNull(javaContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
-
- // set xml customizer class, check override
-
- resourceEntity.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceEntity.getCustomizer().getClassName());
- assertNull(javaContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // clear xml customizer class, set java customizer class, check defaults
-
- resourceEntity.getCustomizer().setClassName(null);
- javaContextEntity.getCustomizer().setSpecifiedCustomizerClass("bar");
-
- assertNull(resourceEntity.getCustomizer().getClassName());
- assertEquals("bar", javaContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEntity.getCustomizer().getClassName());
- assertEquals("bar", javaContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- // set xml customizer class, check override
-
- resourceEntity.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceEntity.getCustomizer().getClassName());
- assertEquals("bar", javaContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- //set xml customizer null
- javaContextEntity.getCustomizer().setSpecifiedCustomizerClass(null);
- resourceEntity.setCustomizer(null);
- assertNull(resourceEntity.getCustomizer());
- assertNull(javaContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- }
-
- public void testModifyCustomizerClass() throws Exception {
- createTestEntityForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getCustomizer());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer, check resource
-
- ormContextEntity.getCustomizer().setSpecifiedCustomizerClass("foo");
-
- assertEquals("foo", resourceEntity.getCustomizer().getClassName());
- assertEquals("foo", ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer to null, check resource
-
- ormContextEntity.getCustomizer().setSpecifiedCustomizerClass(null);
-
- assertNull(resourceEntity.getCustomizer());
- assertNull(ormContextEntity.getCustomizer().getCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextEntity.getCustomizer().getSpecifiedCustomizerClass());
- }
-
- public void testUpdateChangeTracking() throws Exception {
- createTestEntityForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkEntity javaContextEntity = (JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set xml type to ATTRIBUTE, check context
-
- resourceEntity.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set xml type to OBJECT, check context
-
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set xml type to DEFERRED, check context
-
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set xml type to AUTO, check context
-
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // clear xml change tracking, set java change tracking, check defaults
-
- resourceEntity.setChangeTracking(null);
- javaContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // unset metadataComplete, set xml change tracking to OBJECT, check context
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- resourceEntity.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceEntity.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getSpecifiedType());
- }
-
- public void testModifyChangeTracking() throws Exception {
- createTestEntityForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to ATTRIBUTE, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to OBJECT, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to DEFERRED, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to AUTO, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to null, check resource
-
- ormContextEntity.getChangeTracking().setSpecifiedType(null);
-
- assertNull(resourceEntity.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextEntity.getChangeTracking().getDefaultType());
- assertNull(ormContextEntity.getChangeTracking().getSpecifiedType());
- }
-
- public void testUpdateCacheType() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set xml cache type, check settings
- resourceEntity.getCache().setType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedType(EclipseLinkCacheType.WEAK);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
- // clear xml cache type, check defaults
- resourceEntity.getCache().setType(null);
-
- assertEquals(null, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheType() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set context cache type, check resource
-
- ormContextEntity.getCaching().setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.HARD_WEAK, resourceEntity.getCache().getType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getSpecifiedType());
-
- // set context customizer to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedType(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
- }
-
- public void testUpdateCacheCoordinationType() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set xml cache type, check settings
- resourceEntity.getCache().setCoordinationType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
- // clear xml cache type, check defaults
- resourceEntity.getCache().setCoordinationType(null);
-
- assertEquals(null, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheCoordinationType() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context cache coordination type, check resource
-
- ormContextEntity.getCaching().setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, resourceEntity.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context coordination type to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedCoordinationType(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
- }
-
-
- public void testUpdateCacheSize() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity xmlEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, xmlEntity.getCache());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set xml cache, check defaults
- xmlEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, xmlEntity.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set xml cache size, check settings
- xmlEntity.getCache().setSize(new Integer(105));
- assertEquals(new Integer(105), xmlEntity.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedSize(new Integer(50));
-
- assertEquals(new Integer(105), xmlEntity.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
- // clear xml cache size, check defaults
- xmlEntity.getCache().setSize(null);
-
- assertEquals(null, xmlEntity.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // clear xml cache, check defaults
- xmlEntity.setCache(null);
-
- assertEquals(null, xmlEntity.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(50, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, xmlEntity.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheSize() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedSize(new Integer(50));
- assertEquals(new Integer(50), resourceEntity.getCache().getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(50), ormContextCaching.getSpecifiedSize());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedSize(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
- }
-
- public void testUpdateCacheAlwaysRefresh() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set xml cache always refresh, check settings
- resourceEntity.getCache().setAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set java cache always refresh, check defaults
-
- javaContextCaching.setSpecifiedAlwaysRefresh(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache always refresh to false
- resourceEntity.getCache().setAlwaysRefresh(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // clear xml cache always refresh, check defaults
- resourceEntity.getCache().setAlwaysRefresh(null);
-
- assertEquals(null, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testModifyCacheAlwaysRefresh() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedAlwaysRefresh(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testUpdateCacheRefreshOnlyIfNewer() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set xml cache size, check settings
- resourceEntity.getCache().setRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache always refresh to false
- resourceEntity.getCache().setRefreshOnlyIfNewer(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // clear xml cache always refresh, check defaults
- resourceEntity.getCache().setRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testModifyCacheRefreshOnlyIfNewer() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testUpdateCacheDisableHits() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set xml cache size, check settings
- resourceEntity.getCache().setDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedDisableHits(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache always refresh to false
- resourceEntity.getCache().setDisableHits(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedDisableHits());
-
- // clear xml cache always refresh, check defaults
- resourceEntity.getCache().setDisableHits(null);
-
- assertEquals(null, resourceEntity.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testModifyCacheDisableHits() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedDisableHits(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testUpdateCacheShared() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set xml cache size, check settings
- resourceEntity.getCache().setShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set xml cache always refresh to false
- resourceEntity.getCache().setShared(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceEntity.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedShared());
-
- // clear xml cache always refresh, check defaults
- resourceEntity.getCache().setShared(null);
-
- assertEquals(null, resourceEntity.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testModifyCacheShared() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set context cache size, check resource
-
- ormContextEntity.getCaching().setSpecifiedShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedShared(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
- public void testSetSpecifiedSharedFalseUnsetsOtherCacheSettings() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- ormContextCaching.setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- ormContextCaching.setSpecifiedSize(Integer.valueOf(500));
- ormContextCaching.setSpecifiedAlwaysRefresh(Boolean.FALSE);
- ormContextCaching.setSpecifiedRefreshOnlyIfNewer(Boolean.FALSE);
- ormContextCaching.setSpecifiedDisableHits(Boolean.FALSE);
- ormContextCaching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- ormContextCaching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
- ormContextCaching.setExpiry(Integer.valueOf(8000));
-
- ormContextCaching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(null, ormContextCaching.getSpecifiedType());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- //existence checking is the only thing that isn't unset when shared is set to false
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- ormContextCaching.setSpecifiedShared(null);
- EclipseLinkTimeOfDay timeOfDayExpiry = ormContextCaching.addExpiryTimeOfDay();
- timeOfDayExpiry.setHour(Integer.valueOf(5));
-
- ormContextCaching.setSpecifiedShared(Boolean.FALSE);
- assertNull(ormContextCaching.getExpiryTimeOfDay());
- assertEquals(Boolean.FALSE, resourceEntity.getCache().getShared());
- assertNull(resourceEntity.getCache().getExpiryTimeOfDay());
- }
-
- public void testUpdateExistenceChecking() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set xml existence checking, check settings
- resourceEntity.setExistenceChecking(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
-
- // set java cache existence checking, check defaults
-
- javaContextCaching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // clear xml existence checking, check defaults
- resourceEntity.setExistenceChecking(null);
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- ormContextEntity.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyExistenceChecking() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set context cache existence checking, check resource
-
- ormContextEntity.getCaching().setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // set context existence checking to null, check resource
-
- ormContextEntity.getCaching().setSpecifiedExistenceType(null);
-
- assertEquals(null, resourceEntity.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
- }
-
- public void testUpdateCacheExpiry() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getExpiry());
- assertEquals(null, javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- // set xml cache expiry, check settings
- resourceEntity.getCache().setExpiry(new Integer(45));
- assertEquals(new Integer(45), resourceEntity.getCache().getExpiry());
- assertEquals(null, javaContextCaching.getExpiry());
- assertEquals(new Integer(45), ormContextCaching.getExpiry());
-
-
- // set java cache expiry, check defaults
-
- javaContextCaching.setExpiry(new Integer(55));
-
- assertEquals(new Integer(45), resourceEntity.getCache().getExpiry());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(new Integer(45), ormContextCaching.getExpiry());
-
- // clear xml cache expiry to null, check defaults
- resourceEntity.getCache().setExpiry(null);
-
- assertEquals(null, resourceEntity.getCache().getExpiry());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(55), javaContextCaching.getExpiry());
- assertEquals(null, ormContextCaching.getExpiry());
- }
-
- public void testModifyCacheExpiry() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, ormContextCaching.getExpiry());
-
- // set context cache expiry, check resource
-
- ormContextEntity.getCaching().setExpiry(new Integer(60));
- assertEquals(new Integer(60), resourceEntity.getCache().getExpiry());
- assertEquals(new Integer(60), ormContextCaching.getExpiry());
-
- // set context cache size to null, check resource
-
- ormContextEntity.getCaching().setExpiry(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, ormContextCaching.getExpiry());
- }
-
- public void testUpdateCacheExpiryTimeOfDay() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkEntity) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, javaContextCaching.getExpiryTimeOfDay());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
- // set xml cache, check defaults
- resourceEntity.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceEntity.getCache().getExpiryTimeOfDay());
- assertEquals(null, javaContextCaching.getExpiryTimeOfDay());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
-
- // set xml cache expiry, check settings
- resourceEntity.getCache().setExpiryTimeOfDay(EclipseLinkOrmFactory.eINSTANCE.createXmlTimeOfDay());
- resourceEntity.getCache().getExpiryTimeOfDay().setHour(new Integer(10));
- assertEquals(new Integer(10), resourceEntity.getCache().getExpiryTimeOfDay().getHour());
- assertEquals(null, javaContextCaching.getExpiryTimeOfDay());
- assertEquals(new Integer(10), ormContextCaching.getExpiryTimeOfDay().getHour());
-
-
- // set java cache expiry, check defaults
-
- javaContextCaching.addExpiryTimeOfDay();
- javaContextCaching.getExpiryTimeOfDay().setHour(new Integer(12));
-
- assertEquals(new Integer(10), resourceEntity.getCache().getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(10), ormContextCaching.getExpiryTimeOfDay().getHour());
-
- // clear xml cache expiry to null, check defaults
- resourceEntity.getCache().setExpiryTimeOfDay(null);
-
- assertEquals(null, resourceEntity.getCache().getExpiryTimeOfDay());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
-
- // clear xml cache, check defaults
- resourceEntity.setCache(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextEntity.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextEntity.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(new Integer(12), javaContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
- }
-
- public void testModifyCacheExpiryTimeOfDay() throws Exception {
- createTestEntityForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextEntity.getCaching();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- // check defaults
-
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
-
- // set context cache expiry, check resource
-
- ormContextEntity.getCaching().addExpiryTimeOfDay().setHour(new Integer(12));
- assertEquals(new Integer(12), resourceEntity.getCache().getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(12), ormContextCaching.getExpiryTimeOfDay().getHour());
-
- // set context expiry time of day minute, check resource
-
- ormContextEntity.getCaching().getExpiryTimeOfDay().setMinute(new Integer(35));
-
- assertEquals(new Integer(12), resourceEntity.getCache().getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(12), ormContextCaching.getExpiryTimeOfDay().getHour());
- assertEquals(new Integer(35), resourceEntity.getCache().getExpiryTimeOfDay().getMinute());
- assertEquals(new Integer(35), ormContextCaching.getExpiryTimeOfDay().getMinute());
-
- // set context expiry time of day null, check resource
-
- ormContextEntity.getCaching().removeExpiryTimeOfDay();
- assertEquals(null, resourceEntity.getCache());
- assertEquals(null, ormContextCaching.getExpiryTimeOfDay());
- }
-
- public void testUpdateCustomConverters() throws Exception {
- createTestEntityForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEntity.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceEntity.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceEntity.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceEntity.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- createTestEntityForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals("Foo", resourceEntity.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEntity.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceEntity.getConverters().size());
- assertEquals("Foo2", resourceEntity.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEntity.getConverters().get(0).getName());
- assertEquals("Foo", resourceEntity.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceEntity.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceEntity.getConverters().size());
- assertEquals("Foo", resourceEntity.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceEntity.getConverters().get(0).getName());
- assertEquals("Foo2", resourceEntity.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceEntity.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceEntity.getConverters().size());
- assertEquals("Foo2", resourceEntity.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceEntity.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateTypeConverters() throws Exception {
- createTestEntityForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEntity.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceEntity.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceEntity.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceEntity.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- createTestEntityForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals("Foo", resourceEntity.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEntity.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceEntity.getTypeConverters().size());
- assertEquals("Foo2", resourceEntity.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEntity.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEntity.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceEntity.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceEntity.getTypeConverters().size());
- assertEquals("Foo", resourceEntity.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceEntity.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEntity.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceEntity.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceEntity.getTypeConverters().size());
- assertEquals("Foo2", resourceEntity.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceEntity.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- createTestEntityForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEntity.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceEntity.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEntity.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceEntity.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- createTestEntityForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEntity.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntity.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceEntity.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEntity.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntity.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceEntity.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntity.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceEntity.getObjectTypeConverters().size());
- assertEquals("Foo", resourceEntity.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceEntity.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceEntity.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntity.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceEntity.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceEntity.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceEntity.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- createTestEntityForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEntity.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceEntity.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceEntity.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceEntity.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceEntity.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceEntity.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- createTestEntityForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkEntity ormContextEntity = (OrmEclipseLinkEntity) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextEntity.getConverterContainer();
- XmlEntity resourceEntity = (XmlEntity) getXmlEntityMappings().getEntities().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals("Foo", resourceEntity.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEntity.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceEntity.getStructConverters().size());
- assertEquals("Foo2", resourceEntity.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEntity.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceEntity.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceEntity.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceEntity.getStructConverters().size());
- assertEquals("Foo", resourceEntity.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceEntity.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceEntity.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceEntity.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceEntity.getStructConverters().size());
- assertEquals("Foo2", resourceEntity.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceEntity.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceEntity.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java
deleted file mode 100644
index 26342a503c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmIdMappingTests.java
+++ /dev/null
@@ -1,391 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlId;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmIdMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmIdMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableIdDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public void testUpdateMutable() throws Exception {
- createTestEntityWithIdMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkIdMapping contextId =
- (OrmEclipseLinkIdMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlId resourceId =
- (XmlId) resourceEntity.getAttributes().getIds().get(0);
- EclipseLinkIdMapping javaIdMapping = (EclipseLinkIdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- // check defaults
-
- assertNull(resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceId.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceId.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceId.setMutable(null);
-
- assertNull(resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // TODO - test defaults for java serializable and date/time types,
- // with and without persistence property
-
- // set mutable on java basic mapping
-
- javaIdMapping.getMutable().setSpecifiedMutable(Boolean.FALSE);
- assertNull(resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
- assertFalse(javaIdMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkIdMapping virtualIdMapping = (EclipseLinkIdMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceId.getMutable());
- assertTrue(virtualIdMapping.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, virtualIdMapping.getMutable().getSpecifiedMutable());
- assertFalse(virtualIdMapping.getMutable().isMutable());
- assertFalse(javaIdMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkBasicMapping virtualBasicMapping = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceId.getMutable());
- assertTrue(virtualBasicMapping.getMutable().isDefaultMutable());
- assertNull(virtualBasicMapping.getMutable().getSpecifiedMutable());
- assertTrue(virtualBasicMapping.getMutable().isMutable());
- assertFalse(javaIdMapping.getMutable().isMutable());
- }
-
- public void testUpdateMutableDate() throws Exception {
- createTestEntityWithMutableIdDate();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myDate"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkIdMapping contextId =
- (OrmEclipseLinkIdMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlId resourceId =
- (XmlId) resourceEntity.getAttributes().getIds().get(0);
- EclipseLinkIdMapping javaIdMapping = (EclipseLinkIdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("myDate").getMapping();
-
- // check defaults
-
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceId.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceId.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceId.setMutable(null);
-
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.TRUE);
- assertNull(resourceId.getMutable());
- assertTrue(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(null);
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set mutable on java id mapping
-
- javaIdMapping.getMutable().setSpecifiedMutable(Boolean.TRUE);
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
- assertTrue(javaIdMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkIdMapping virtualIdMapping = (EclipseLinkIdMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceId.getMutable());
- assertFalse(virtualIdMapping.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, virtualIdMapping.getMutable().getSpecifiedMutable());
- assertTrue(virtualIdMapping.getMutable().isMutable());
- assertTrue(javaIdMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkBasicMapping virtualBasicMapping = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceId.getMutable());
- assertFalse(virtualBasicMapping.getMutable().isDefaultMutable());
- assertNull(virtualBasicMapping.getMutable().getSpecifiedMutable());
- assertFalse(virtualBasicMapping.getMutable().isMutable());
- assertTrue(javaIdMapping.getMutable().isMutable());
- }
-
- public void testModifyMutable() throws Exception {
- createTestEntityWithMutableIdDate();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myDate"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkIdMapping contextId =
- (OrmEclipseLinkIdMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlId resourceId =
- (XmlId) resourceEntity.getAttributes().getIds().get(0);
-
- // check defaults
-
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set context mutable to true, check resource
-
- contextId.getMutable().setSpecifiedMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextId.getMutable().getSpecifiedMutable());
- assertTrue(contextId.getMutable().isMutable());
-
- // set context mutable to false, check resource
-
- contextId.getMutable().setSpecifiedMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
-
- // set context read only to null, check resource
-
- contextId.getMutable().setSpecifiedMutable(null);
-
- assertNull(resourceId.getMutable());
- assertFalse(contextId.getMutable().isDefaultMutable());
- assertNull(contextId.getMutable().getSpecifiedMutable());
- assertFalse(contextId.getMutable().isMutable());
- }
-
- public void testUpdateConvert() throws Exception {
- createTestEntityWithIdMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId basicResource = (XmlId) getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
- JavaIdMapping javaIdMapping = (JavaIdMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- basicResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.class, ormIdMapping.getConverter().getType());
- assertEquals("myConvert", basicResource.getConvert());
-
- //set lob to null in the resource model
- basicResource.setConvert(null);
- assertNull(ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
-
- javaIdMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) javaIdMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertNull(ormIdMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaIdMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- IdMapping virtualIdMapping = (IdMapping) ormPersistentAttribute2.getMapping();
-
- assertEquals(EclipseLinkConvert.class, virtualIdMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) virtualIdMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaIdMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaIdMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.class, virtualIdMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) virtualIdMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaIdMapping.getConverter()).getSpecifiedConverterName());
-
- javaIdMapping.setConverter(null);
- assertNull(virtualIdMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
- assertNull(javaIdMapping.getConverter().getType());
- }
-
- public void testModifyConvert() throws Exception {
- createTestEntityWithIdMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- OrmIdMapping ormIdMapping = (OrmIdMapping) ormPersistentAttribute.getMapping();
- XmlId basicResource = (XmlId) getXmlEntityMappings().getEntities().get(0).getAttributes().getIds().get(0);
-
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormIdMapping.setConverter(EclipseLinkConvert.class);
- assertEquals("", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormIdMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormIdMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormIdMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormIdMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormIdMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
-
- //set lob to false in the context model
- ormIdMapping.setConverter(null);
- assertNull(ormIdMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java
deleted file mode 100644
index f18dc7116a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToManyMappingTests.java
+++ /dev/null
@@ -1,397 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.ManyToManyMapping;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkManyToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToMany;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmManyToManyMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmManyToManyMappingTests(String name) {
- super(name);
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Collection;");
- sb.append(CR);
- sb.append("import ").append(JPA.MANY_TO_MANY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.JOIN_TABLE).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.JOIN_COLUMN).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToMany").append(CR);
- sb.append(" @JoinTable(name=\"DEP_EMP\", joinColumns=@JoinColumn(name=\"DEPT_ID\"), inverseJoinColumns=@JoinColumn(name=\"EMP_ID\"))").append(CR);
- sb.append(" private Collection<Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestTypeWithCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("java.util.Collection");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" private Collection<Foo> manyToMany;").append(CR);
- }
- });
- }
-
- public void testUpdateJoinFetch() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToMany"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkRelationshipMapping contextManyToMany =
- (EclipseLinkRelationshipMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlManyToMany resourceManyToMany =
- (XmlManyToMany) resourceEntity.getAttributes().getManyToManys().get(0);
-
- // check defaults
-
- assertNull(resourceManyToMany.getJoinFetch());
- assertNull(contextManyToMany.getJoinFetch().getValue());
-
- // set xml join fetch to INNER, check context
-
- resourceManyToMany.setJoinFetch(XmlJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceManyToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextManyToMany.getJoinFetch().getValue());
-
- // set xml join fetch to OUTER, check context
-
- resourceManyToMany.setJoinFetch(XmlJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceManyToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextManyToMany.getJoinFetch().getValue());
-
- // set xml join fetch to null, check context
-
- resourceManyToMany.setJoinFetch(null);
-
- assertNull(resourceManyToMany.getJoinFetch());
- assertNull(contextManyToMany.getJoinFetch().getValue());
- }
-
- public void testModifyJoinFetch() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToMany"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkRelationshipMapping contextManyToMany =
- (EclipseLinkRelationshipMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlManyToMany resourceManyToMany =
- (XmlManyToMany) resourceEntity.getAttributes().getManyToManys().get(0);
-
- // check defaults
-
- assertNull(resourceManyToMany.getJoinFetch());
- assertNull(contextManyToMany.getJoinFetch().getValue());
-
- // set context join fetch to INNER, check resource
-
- contextManyToMany.getJoinFetch().setValue(EclipseLinkJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceManyToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextManyToMany.getJoinFetch().getValue());
-
- // set context join fetch to OUTER, check resource
-
- contextManyToMany.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceManyToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextManyToMany.getJoinFetch().getValue());
-
- // set context join fetch to null, check resource
-
- contextManyToMany.getJoinFetch().setValue(null);
-
- assertNull(resourceManyToMany.getJoinFetch());
- assertNull(contextManyToMany.getJoinFetch().getValue());
- }
-
- public void testJoinFetchDefault() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- EclipseLinkRelationshipMapping manyToMany = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertNull(manyToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- EclipseLinkOneToManyMapping oneToMany = (EclipseLinkOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertNull(oneToMany.getJoinFetch().getValue());
-
-
- EclipseLinkRelationshipMapping javaRelationshipMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getJavaPersistentType().getAttributeNamed("employees").getMapping();
- javaRelationshipMapping.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
- assertNull(oneToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- manyToMany = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(EclipseLinkJoinFetchType.OUTER, manyToMany.getJoinFetch().getValue());
- }
-
- public void testDefaultJoinTable() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- OrmReadOnlyPersistentAttribute attribute = departmentPersistentType.getAttributeNamed("employees");
- ManyToManyMapping manyToMany = (ManyToManyMapping) attribute.getMapping();
-
- assertEquals(true, attribute.isVirtual());
- JoinTable ormJoinTable = manyToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getName());
- assertEquals("id", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getName());
- assertEquals("empId", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getReferencedColumnName());
-
- //set metadata-complete and verify JoinTable info is not taken from the java
- departmentPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- departmentPersistentType.addAttributeToXml(departmentPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- attribute = departmentPersistentType.getAttributeNamed("employees");
- OneToManyMapping oneToMany = (OneToManyMapping) attribute.getMapping();
-
- assertEquals(true, attribute.isVirtual());
- ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals("employees_empId", ormJoinTable.getDefaultInverseJoinColumn().getName());
- assertEquals("empId", ormJoinTable.getDefaultInverseJoinColumn().getReferencedColumnName());
-
- //set metadata-complete to false, add mapping to orm.xml verify JoinTable info is not taken from the java
- departmentPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
- attribute = departmentPersistentType.getAttributeNamed("employees");
- manyToMany = (ManyToManyMapping) attribute.getMapping();
- assertEquals(true, attribute.isVirtual());
- ormJoinTable = manyToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getName());
- assertEquals("id", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getName());
- assertEquals("empId", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getReferencedColumnName());
-
-
- departmentPersistentType.addAttributeToXml(departmentPersistentType.getAttributeNamed("employees"), MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- attribute = departmentPersistentType.getAttributeNamed("employees");
- manyToMany = (ManyToManyMapping) attribute.getMapping();
- assertEquals(false, attribute.isVirtual());
- ormJoinTable = manyToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals(0, ormJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals(0, ormJoinTable.getSpecifiedInverseJoinColumnsSize());
- assertEquals("employees_empId", ormJoinTable.getDefaultInverseJoinColumn().getName());
- assertEquals("empId", ormJoinTable.getDefaultInverseJoinColumn().getReferencedColumnName());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ManyToManyMapping virtualManyToManyMapping = (ManyToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualManyToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualManyToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualManyToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualManyToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(virtualManyToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualManyToManyMapping).getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- OrmPersistentAttribute ormPersistentAttribute = virtualPersistentAttribute.addToXml(MappingKeys.MANY_TO_MANY_ATTRIBUTE_MAPPING_KEY);
-
- OrmEclipseLinkManyToManyMapping ormManyToManyMapping = (OrmEclipseLinkManyToManyMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToManyMapping.getName());
- assertEquals(FetchType.LAZY, ormManyToManyMapping.getFetch());
- assertEquals("test.Address", ormManyToManyMapping.getTargetEntity());
- assertNull(ormManyToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = ormManyToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertTrue(ormManyToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, ormManyToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(null, ormManyToManyMapping.getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java
deleted file mode 100644
index 5cb4f01864..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmManyToOneMappingTests.java
+++ /dev/null
@@ -1,331 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.ManyToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkManyToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlManyToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmManyToOneMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmManyToOneMappingTests(String name) {
- super(name);
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ").append(JPA.MANY_TO_ONE).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @ManyToOne").append(CR);
- sb.append(" private Employee employee;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityManyToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.MANY_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @ManyToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private String state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestTypeWithManyToOneAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" private Foo manyToOne;").append(CR);
- }
- });
- }
-
- public void testUpdateJoinFetch() throws Exception {
- createTestTypeWithManyToOneAttribute();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToOne"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkRelationshipMapping contextManyToOne =
- (EclipseLinkRelationshipMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlManyToOne resourceManyToOne =
- (XmlManyToOne) resourceEntity.getAttributes().getManyToOnes().get(0);
-
- // check defaults
-
- assertNull(resourceManyToOne.getJoinFetch());
- assertNull(contextManyToOne.getJoinFetch().getValue());
-
- // set xml join fetch to INNER, check context
-
- resourceManyToOne.setJoinFetch(XmlJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceManyToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextManyToOne.getJoinFetch().getValue());
-
- // set xml join fetch to OUTER, check context
-
- resourceManyToOne.setJoinFetch(XmlJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceManyToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextManyToOne.getJoinFetch().getValue());
-
- // set xml join fetch to null, check context
-
- resourceManyToOne.setJoinFetch(null);
-
- assertNull(resourceManyToOne.getJoinFetch());
- assertNull(contextManyToOne.getJoinFetch().getValue());
- }
-
- public void testModifyJoinFetch() throws Exception {
- createTestTypeWithManyToOneAttribute();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("manyToOne"), MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkRelationshipMapping contextManyToOne =
- (EclipseLinkRelationshipMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlManyToOne resourceManyToOne =
- (XmlManyToOne) resourceEntity.getAttributes().getManyToOnes().get(0);
-
- // check defaults
-
- assertNull(resourceManyToOne.getJoinFetch());
- assertNull(contextManyToOne.getJoinFetch().getValue());
-
- // set context join fetch to INNER, check resource
-
- contextManyToOne.getJoinFetch().setValue(EclipseLinkJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceManyToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextManyToOne.getJoinFetch().getValue());
-
- // set context join fetch to OUTER, check resource
-
- contextManyToOne.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceManyToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextManyToOne.getJoinFetch().getValue());
-
- // set context join fetch to null, check resource
-
- contextManyToOne.getJoinFetch().setValue(null);
-
- assertNull(resourceManyToOne.getJoinFetch());
- assertNull(contextManyToOne.getJoinFetch().getValue());
- }
-
- public void testJoinFetchDefaultFromJava() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- EclipseLinkRelationshipMapping manyToOneMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
-
- assertNull(manyToOneMapping.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- EclipseLinkOneToOneMapping oneToOne = (EclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertNull(oneToOne.getJoinFetch().getValue());
-
-
- EclipseLinkRelationshipMapping javaRelationshipMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getJavaPersistentType().getAttributeNamed("employee").getMapping();
- javaRelationshipMapping.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
- manyToOneMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertNull(manyToOneMapping.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- manyToOneMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertEquals(EclipseLinkJoinFetchType.OUTER, manyToOneMapping.getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- ManyToOneMapping virtualManyToOneMapping = (ManyToOneMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualManyToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualManyToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualManyToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualManyToOneMapping.getSpecifiedTargetEntity());
-
- JoinColumn virtualJoinColumn = virtualManyToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade cascade = virtualManyToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualManyToOneMapping).getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityManyToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = virtualPersistentAttribute.addToXml(MappingKeys.MANY_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- OrmEclipseLinkManyToOneMapping ormManyToOneMapping = (OrmEclipseLinkManyToOneMapping) ormPersistentAttribute.getMapping();
- assertEquals("address", ormManyToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormManyToOneMapping.getDefaultFetch());
- assertEquals(true, ormManyToOneMapping.isDefaultOptional());
- assertEquals("test.Address", ormManyToOneMapping.getDefaultTargetEntity());
-
- Cascade cascade = ormManyToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertEquals(null, ormManyToOneMapping.getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java
deleted file mode 100644
index dd364be549..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmMappedSuperclassTests.java
+++ /dev/null
@@ -1,2149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkExistenceType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkCaching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmMappedSuperclassTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmMappedSuperclassTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestMappedSuperclassForReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CHANGE_TRACKING);
- }
-
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForCaching() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForObjectTypeConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassForStructConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
- });
- }
-
- public void testUpdateReadOnly() throws Exception {
- createTestMappedSuperclassForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to true, check defaults
-
- resourceMappedSuperclass.setReadOnly(null);
- javaContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertTrue(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // clear xml read only, set java read only to false, check defaults
-
- resourceMappedSuperclass.setReadOnly(null);
- javaContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to false, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set xml read only to true, check override
-
- resourceMappedSuperclass.setReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertFalse(javaContextMappedSuperclass.getReadOnly().isReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testModifyReadOnly() throws Exception {
- createTestMappedSuperclassForReadOnly();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to true, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getReadOnly());
- assertTrue(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.TRUE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to false, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertEquals(Boolean.FALSE, ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
-
- // set context read only to null, check resource
-
- ormContextMappedSuperclass.getReadOnly().setSpecifiedReadOnly(null);
-
- assertNull(resourceMappedSuperclass.getReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isReadOnly());
- assertFalse(ormContextMappedSuperclass.getReadOnly().isDefaultReadOnly());
- assertNull(ormContextMappedSuperclass.getReadOnly().getSpecifiedReadOnly());
- }
-
- public void testUpdateCustomizerClass() throws Exception {
- createTestMappedSuperclassForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set xml customizer, check defaults
- resourceMappedSuperclass.setCustomizer(OrmFactory.eINSTANCE.createXmlClassReference());
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
-
- // set xml customizer class, check override
-
- resourceMappedSuperclass.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // clear xml customizer class, set java customizer class, check defaults
-
- resourceMappedSuperclass.getCustomizer().setClassName(null);
- javaContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass("bar");
-
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- // set xml customizer class, check override
-
- resourceMappedSuperclass.getCustomizer().setClassName("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("bar", javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertEquals("bar", ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- //set xml customizer null
- javaContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass(null);
- resourceMappedSuperclass.setCustomizer(null);
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(javaContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- }
-
- public void testModifyCustomizerClass() throws Exception {
- createTestMappedSuperclassForCustomizer();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer, check resource
-
- ormContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass("foo");
-
- assertEquals("foo", resourceMappedSuperclass.getCustomizer().getClassName());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertEquals("foo", ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
-
- // set context customizer to null, check resource
-
- ormContextMappedSuperclass.getCustomizer().setSpecifiedCustomizerClass(null);
-
- assertNull(resourceMappedSuperclass.getCustomizer());
- assertNull(ormContextMappedSuperclass.getCustomizer().getCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getDefaultCustomizerClass());
- assertNull(ormContextMappedSuperclass.getCustomizer().getSpecifiedCustomizerClass());
- }
-
- public void testUpdateChangeTracking() throws Exception {
- createTestMappedSuperclassForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkMappedSuperclass javaContextMappedSuperclass = (JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to ATTRIBUTE, check context
-
- resourceMappedSuperclass.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to OBJECT, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to DEFERRED, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set xml type to AUTO, check context
-
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // clear xml change tracking, set java change tracking, check defaults
-
- resourceMappedSuperclass.setChangeTracking(null);
- javaContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // unset metadataComplete, set xml change tracking to OBJECT, check context
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- resourceMappedSuperclass.setChangeTracking(EclipseLinkOrmFactory.eINSTANCE.createXmlChangeTracking());
- resourceMappedSuperclass.getChangeTracking().setType(XmlChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, javaContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
- }
-
- public void testModifyChangeTracking() throws Exception {
- createTestMappedSuperclassForChangeTracking();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to ATTRIBUTE, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.ATTRIBUTE);
-
- assertEquals(XmlChangeTrackingType.ATTRIBUTE, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.ATTRIBUTE, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to OBJECT, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.OBJECT);
-
- assertEquals(XmlChangeTrackingType.OBJECT, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.OBJECT, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to DEFERRED, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.DEFERRED);
-
- assertEquals(XmlChangeTrackingType.DEFERRED, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.DEFERRED, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to AUTO, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(EclipseLinkChangeTrackingType.AUTO);
-
- assertEquals(XmlChangeTrackingType.AUTO, resourceMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
-
- // set context change tracking to null, check resource
-
- ormContextMappedSuperclass.getChangeTracking().setSpecifiedType(null);
-
- assertNull(resourceMappedSuperclass.getChangeTracking());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getType());
- assertEquals(EclipseLinkChangeTrackingType.AUTO, ormContextMappedSuperclass.getChangeTracking().getDefaultType());
- assertNull(ormContextMappedSuperclass.getChangeTracking().getSpecifiedType());
- }
-
- public void testUpdateCacheType() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set xml cache type, check settings
- resourceMappedSuperclass.getCache().setType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedType(EclipseLinkCacheType.WEAK);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.FULL, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.FULL, ormContextCaching.getSpecifiedType());
-
- // clear xml cache type, check defaults
- resourceMappedSuperclass.getCache().setType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.WEAK, javaContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheType() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
-
- // set context cache type, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedType(EclipseLinkCacheType.HARD_WEAK);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheType.HARD_WEAK, resourceMappedSuperclass.getCache().getType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(EclipseLinkCacheType.HARD_WEAK, ormContextCaching.getSpecifiedType());
-
- // set context customizer to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getType());
- assertEquals(EclipseLinkCacheType.SOFT_WEAK, ormContextCaching.getDefaultType());
- assertEquals(null, ormContextCaching.getSpecifiedType());
- }
-
- public void testUpdateCacheCoordinationType() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set xml cache type, check settings
- resourceMappedSuperclass.getCache().setCoordinationType(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set java cache type, check defaults
-
- javaContextCaching.setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, ormContextCaching.getSpecifiedCoordinationType());
-
- // clear xml cache type, check defaults
- resourceMappedSuperclass.getCache().setCoordinationType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, javaContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheCoordinationType() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context cache coordination type, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedCoordinationType(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, resourceMappedSuperclass.getCache().getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, ormContextCaching.getSpecifiedCoordinationType());
-
- // set context coordination type to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedCoordinationType(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getCoordinationType());
- assertEquals(EclipseLinkCacheCoordinationType.SEND_OBJECT_CHANGES, ormContextCaching.getDefaultCoordinationType());
- assertEquals(null, ormContextCaching.getSpecifiedCoordinationType());
- }
-
-
- public void testUpdateCacheSize() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setSize(new Integer(105));
- assertEquals(new Integer(105), resourceMappedSuperclass.getCache().getSize());
- assertEquals(100, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedSize(new Integer(50));
-
- assertEquals(new Integer(105), resourceMappedSuperclass.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(105, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(105), ormContextCaching.getSpecifiedSize());
-
- // clear xml cache size, check defaults
- resourceMappedSuperclass.getCache().setSize(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getSize());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(50, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(50, javaContextCaching.getSize());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyCacheSize() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedSize(new Integer(50));
- assertEquals(new Integer(50), resourceMappedSuperclass.getCache().getSize());
- assertEquals(50, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(new Integer(50), ormContextCaching.getSpecifiedSize());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedSize(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(100, ormContextCaching.getSize());
- assertEquals(100, ormContextCaching.getDefaultSize());
- assertEquals(null, ormContextCaching.getSpecifiedSize());
- }
-
- public void testUpdateCacheAlwaysRefresh() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set xml cache always refresh, check settings
- resourceMappedSuperclass.getCache().setAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(false, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set java cache always refresh, check defaults
-
- javaContextCaching.setSpecifiedAlwaysRefresh(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setAlwaysRefresh(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setAlwaysRefresh(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(true, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testModifyCacheAlwaysRefresh() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedAlwaysRefresh(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getAlwaysRefresh());
- assertEquals(true, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedAlwaysRefresh());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedAlwaysRefresh(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isAlwaysRefresh());
- assertEquals(false, ormContextCaching.isDefaultAlwaysRefresh());
- assertEquals(null, ormContextCaching.getSpecifiedAlwaysRefresh());
- }
-
- public void testUpdateCacheRefreshOnlyIfNewer() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(false, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testModifyCacheRefreshOnlyIfNewer() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedRefreshOnlyIfNewer(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getRefreshOnlyIfNewer());
- assertEquals(true, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedRefreshOnlyIfNewer(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isRefreshOnlyIfNewer());
- assertEquals(false, ormContextCaching.isDefaultRefreshOnlyIfNewer());
- assertEquals(null, ormContextCaching.getSpecifiedRefreshOnlyIfNewer());
- }
-
- public void testUpdateCacheDisableHits() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(false, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedDisableHits(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setDisableHits(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedDisableHits());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setDisableHits(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(true, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testModifyCacheDisableHits() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedDisableHits(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getDisableHits());
- assertEquals(true, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedDisableHits());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedDisableHits(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, ormContextCaching.isDisableHits());
- assertEquals(false, ormContextCaching.isDefaultDisableHits());
- assertEquals(null, ormContextCaching.getSpecifiedDisableHits());
- }
-
- public void testUpdateCacheShared() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set xml cache, check defaults
- resourceMappedSuperclass.setCache(EclipseLinkOrmFactory.eINSTANCE.createXmlCache());
- assertEquals(null, resourceMappedSuperclass.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set xml cache size, check settings
- resourceMappedSuperclass.getCache().setShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(true, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
-
- // set java cache size, check defaults
-
- javaContextCaching.setSpecifiedShared(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set xml cache always refresh to false
- resourceMappedSuperclass.getCache().setShared(Boolean.TRUE);
- assertEquals(Boolean.TRUE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.TRUE, ormContextCaching.getSpecifiedShared());
-
- // clear xml cache always refresh, check defaults
- resourceMappedSuperclass.getCache().setShared(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // clear xml cache, check defaults
- resourceMappedSuperclass.setCache(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
-
- // set metadataComplete back to null, check defaults from java
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(false, javaContextCaching.isShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(false, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testModifyCacheShared() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
-
- // set context cache size, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, resourceMappedSuperclass.getCache().getShared());
- assertEquals(false, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(Boolean.FALSE, ormContextCaching.getSpecifiedShared());
-
- // set context cache size to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedShared(null);
-
- assertEquals(null, resourceMappedSuperclass.getCache());
- assertEquals(true, ormContextCaching.isShared());
- assertEquals(true, ormContextCaching.isDefaultShared());
- assertEquals(null, ormContextCaching.getSpecifiedShared());
- }
-
- public void testUpdateExistenceChecking() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaEclipseLinkCaching javaContextCaching = ((JavaEclipseLinkMappedSuperclass) ormPersistentType.getJavaPersistentType().getMapping()).getCaching();
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set xml existence checking, check settings
- resourceMappedSuperclass.setExistenceChecking(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
-
- // set java cache existence checking, check defaults
-
- javaContextCaching.setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE);
-
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // clear xml existence checking, check defaults
- resourceMappedSuperclass.setExistenceChecking(null);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set metadataComplete to True, check defaults not from java
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(Boolean.TRUE);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_NON_EXISTENCE, javaContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- ormContextMappedSuperclass.setSpecifiedMetadataComplete(null);
- }
-
- public void testModifyExistenceChecking() throws Exception {
- createTestMappedSuperclassForCaching();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- EclipseLinkCaching ormContextCaching = ormContextMappedSuperclass.getCaching();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- // check defaults
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
-
- // set context cache existence checking, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedExistenceType(EclipseLinkExistenceType.ASSUME_EXISTENCE);
- assertEquals(org.eclipse.jpt.jpa.eclipselink.core.resource.orm.ExistenceType.ASSUME_EXISTENCE, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(EclipseLinkExistenceType.ASSUME_EXISTENCE, ormContextCaching.getSpecifiedExistenceType());
-
- // set context existence checking to null, check resource
-
- ormContextMappedSuperclass.getCaching().setSpecifiedExistenceType(null);
-
- assertEquals(null, resourceMappedSuperclass.getExistenceChecking());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getExistenceType());
- assertEquals(EclipseLinkExistenceType.CHECK_DATABASE, ormContextCaching.getDefaultExistenceType());
- assertEquals(null, ormContextCaching.getSpecifiedExistenceType());
- }
- public void testUpdateCustomConverters() throws Exception {
- createTestMappedSuperclassForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlConverter resourceConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceMappedSuperclass.getConverters().add(resourceConverter);
- resourceConverter.setClassName("Foo");
- resourceConverter.setName("myConverter");
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlConverter resourceConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConverter();
- resourceMappedSuperclass.getConverters().add(0, resourceConverter2);
- resourceConverter2.setClassName("Foo2");
- resourceConverter2.setName("myConverter2");
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getConverters().remove(resourceConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyCustomConverters() throws Exception {
- createTestMappedSuperclassForConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter = ormContextConverterHolder.addCustomConverter(0);
- contextConverter.setConverterClass("Foo");
- contextConverter.setName("myConverter");
-
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ListIterator<? extends EclipseLinkCustomConverter> ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- EclipseLinkCustomConverter ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkCustomConverter contextConverter2 = ormContextConverterHolder.addCustomConverter(0);
- contextConverter2.setConverterClass("Foo2");
- contextConverter2.setName("myConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(1).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveCustomConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(1).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo", ormContextConverter.getConverterClass());
- assertEquals("myConverter", ormContextConverter.getName());
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getConverters().get(0).getClassName());
- assertEquals("myConverter2", resourceMappedSuperclass.getConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getCustomConvertersSize());
- ormContextConverters = ormContextConverterHolder.getCustomConverters().iterator();
- ormContextConverter = ormContextConverters.next();
- assertEquals("Foo2", ormContextConverter.getConverterClass());
- assertEquals("myConverter2", ormContextConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeCustomConverter(contextConverter2);
-
- assertEquals(0, ormContextConverterHolder.getCustomConvertersSize());
- assertFalse(ormContextConverterHolder.getCustomConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateTypeConverters() throws Exception {
- createTestMappedSuperclassForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceMappedSuperclass.getTypeConverters().add(resourceTypeConverter);
- resourceTypeConverter.setDataType("Foo");
- resourceTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlTypeConverter resourceTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlTypeConverter();
- resourceMappedSuperclass.getTypeConverters().add(0, resourceTypeConverter2);
- resourceTypeConverter2.setDataType("Foo2");
- resourceTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getTypeConverters().remove(resourceTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyTypeConverters() throws Exception {
- createTestMappedSuperclassForTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter.setDataType("Foo");
- contextTypeConverter.setName("myTypeConverter");
-
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ListIterator<? extends EclipseLinkTypeConverter> ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- EclipseLinkTypeConverter ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkTypeConverter contextTypeConverter2 = ormContextConverterHolder.addTypeConverter(0);
- contextTypeConverter2.setDataType("Foo2");
- contextTypeConverter2.setName("myTypeConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveTypeConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(1).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter", ormContextTypeConverter.getName());
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getTypeConverters().get(0).getDataType());
- assertEquals("myTypeConverter2", resourceMappedSuperclass.getTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getTypeConvertersSize());
- ormContextTypeConverters = ormContextConverterHolder.getTypeConverters().iterator();
- ormContextTypeConverter = ormContextTypeConverters.next();
- assertEquals("Foo2", ormContextTypeConverter.getDataType());
- assertEquals("myTypeConverter2", ormContextTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeTypeConverter(contextTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateObjectTypeConverters() throws Exception {
- createTestMappedSuperclassForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceMappedSuperclass.getObjectTypeConverters().add(resourceObjectTypeConverter);
- resourceObjectTypeConverter.setDataType("Foo");
- resourceObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlObjectTypeConverter resourceObjectTypeConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlObjectTypeConverter();
- resourceMappedSuperclass.getObjectTypeConverters().add(0, resourceObjectTypeConverter2);
- resourceObjectTypeConverter2.setDataType("Foo2");
- resourceObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getObjectTypeConverters().remove(resourceObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyObjectTypeConverters() throws Exception {
- createTestMappedSuperclassForObjectTypeConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter.setDataType("Foo");
- contextObjectTypeConverter.setName("myObjectTypeConverter");
-
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ListIterator<? extends EclipseLinkObjectTypeConverter> ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- EclipseLinkObjectTypeConverter ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkObjectTypeConverter contextObjectTypeConverter2 = ormContextConverterHolder.addObjectTypeConverter(0);
- contextObjectTypeConverter2.setDataType("Foo2");
- contextObjectTypeConverter2.setName("myObjectTypeConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveObjectTypeConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(1).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter", ormContextObjectTypeConverter.getName());
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getDataType());
- assertEquals("myObjectTypeConverter2", resourceMappedSuperclass.getObjectTypeConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getObjectTypeConvertersSize());
- ormContextObjectTypeConverters = ormContextConverterHolder.getObjectTypeConverters().iterator();
- ormContextObjectTypeConverter = ormContextObjectTypeConverters.next();
- assertEquals("Foo2", ormContextObjectTypeConverter.getDataType());
- assertEquals("myObjectTypeConverter2", ormContextObjectTypeConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeObjectTypeConverter(contextObjectTypeConverter2);
-
- assertEquals(0, ormContextConverterHolder.getObjectTypeConvertersSize());
- assertFalse(ormContextConverterHolder.getObjectTypeConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getObjectTypeConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testUpdateStructConverters() throws Exception {
- createTestMappedSuperclassForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the resource model, check context model
- XmlStructConverter resourceStructConverter = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceMappedSuperclass.getStructConverters().add(resourceStructConverter);
- resourceStructConverter.setConverter("Foo");
- resourceStructConverter.setName("myStructConverter");
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the resource model, check context model
- XmlStructConverter resourceStructConverter2 = EclipseLinkOrmFactory.eINSTANCE.createXmlStructConverter();
- resourceMappedSuperclass.getStructConverters().add(0, resourceStructConverter2);
- resourceStructConverter2.setConverter("Foo2");
- resourceStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the resource model, check context model
- resourceMappedSuperclass.getStructConverters().move(0, 1);
-
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(0);
-
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the resource model, check context model
- resourceMappedSuperclass.getStructConverters().remove(resourceStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-
- public void testModifyStructConverters() throws Exception {
- createTestMappedSuperclassForStructConverters();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.MAPPED_SUPERCLASS_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmEclipseLinkMappedSuperclass ormContextMappedSuperclass = (OrmEclipseLinkMappedSuperclass) ormPersistentType.getMapping();
- OrmEclipseLinkConverterContainer ormContextConverterHolder = ormContextMappedSuperclass.getConverterContainer();
- XmlMappedSuperclass resourceMappedSuperclass = (XmlMappedSuperclass) getXmlEntityMappings().getMappedSuperclasses().get(0);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add a converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter.setConverterClass("Foo");
- contextStructConverter.setName("myStructConverter");
-
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ListIterator<? extends EclipseLinkStructConverter> ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- EclipseLinkStructConverter ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //add another converter to the context model, check resource model
- EclipseLinkStructConverter contextStructConverter2 = ormContextConverterHolder.addStructConverter(0);
- contextStructConverter2.setConverterClass("Foo2");
- contextStructConverter2.setName("myStructConverter2");
-
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //move a converter in the context model, check resource model
- ormContextConverterHolder.moveStructConverter(0, 1);
-
- assertEquals(2, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(1).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(1).getName());
- assertEquals(2, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter", ormContextStructConverter.getName());
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(2, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(0);
-
- assertEquals(1, resourceMappedSuperclass.getStructConverters().size());
- assertEquals("Foo2", resourceMappedSuperclass.getStructConverters().get(0).getConverter());
- assertEquals("myStructConverter2", resourceMappedSuperclass.getStructConverters().get(0).getName());
- assertEquals(1, ormContextConverterHolder.getStructConvertersSize());
- ormContextStructConverters = ormContextConverterHolder.getStructConverters().iterator();
- ormContextStructConverter = ormContextStructConverters.next();
- assertEquals("Foo2", ormContextStructConverter.getConverterClass());
- assertEquals("myStructConverter2", ormContextStructConverter.getName());
- assertEquals(1, CollectionTools.size(persistenceUnit.getAllConverters()));
-
- //remove a converter from the context model, check resource model
- ormContextConverterHolder.removeStructConverter(contextStructConverter2);
-
- assertEquals(0, ormContextConverterHolder.getStructConvertersSize());
- assertFalse(ormContextConverterHolder.getStructConverters().iterator().hasNext());
- assertEquals(0, resourceMappedSuperclass.getStructConverters().size());
- assertEquals(0, CollectionTools.size(persistenceUnit.getAllConverters()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java
deleted file mode 100644
index c3b0c8ac95..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmObjectTypeConverterTests.java
+++ /dev/null
@@ -1,403 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmObjectTypeConverterTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERT, EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Convert(name=\"foo\")").append(CR);
- sb.append(" @ObjectTypeConverter");
- }
- });
- }
-
-
- public EclipseLinkOrmObjectTypeConverterTests(String name) {
- super(name);
- }
-
-
- public void testUpdateDataType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setDataType("myConvert");
- assertEquals("myConvert", ormConverter.getDataType());
- assertEquals("myConvert", converterResource.getDataType());
-
- //set converter class name to null in the resource model
- converterResource.setDataType(null);
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
- }
-
- public void testModifyDataType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setDataType("foo");
- assertEquals("foo", ormConverter.getDataType());
- assertEquals("foo", converterResource.getDataType());
-
- ormConverter.setDataType(null);
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
- }
-
- public void testUpdateObjectType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setObjectType("myConvert");
- assertEquals("myConvert", ormConverter.getObjectType());
- assertEquals("myConvert", converterResource.getObjectType());
-
- //set converter class name to null in the resource model
- converterResource.setObjectType(null);
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
- }
-
- public void testModifyObjectType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setObjectType("foo");
- assertEquals("foo", ormConverter.getObjectType());
- assertEquals("foo", converterResource.getObjectType());
-
- ormConverter.setObjectType(null);
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setName("myConvert");
- assertEquals("myConvert", ormConverter.getName());
- assertEquals("myConvert", converterResource.getName());
-
- //set converter class name to null in the resource model
- converterResource.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setName("foo");
- assertEquals("foo", ormConverter.getName());
- assertEquals("foo", converterResource.getName());
-
- ormConverter.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-
- public void testUpdateDefaultObjectValue() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getDefaultObjectValue());
- assertEquals(null, converterResource.getDefaultObjectValue());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setDefaultObjectValue("myConvert");
- assertEquals("myConvert", ormConverter.getDefaultObjectValue());
- assertEquals("myConvert", converterResource.getDefaultObjectValue());
-
- //set converter class name to null in the resource model
- converterResource.setDefaultObjectValue(null);
- assertEquals(null, ormConverter.getDefaultObjectValue());
- assertEquals(null, converterResource.getDefaultObjectValue());
- }
-
- public void testModifyDefaultObjectValue() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getDefaultObjectValue());
- assertEquals(null, converterResource.getDefaultObjectValue());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setDefaultObjectValue("foo");
- assertEquals("foo", ormConverter.getDefaultObjectValue());
- assertEquals("foo", converterResource.getDefaultObjectValue());
-
- ormConverter.setDefaultObjectValue(null);
- assertEquals(null, ormConverter.getDefaultObjectValue());
- assertEquals(null, converterResource.getDefaultObjectValue());
- }
-
-
- public void testUpdateConversionValues() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(0, ormConverter.getConversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
-
- //add conversion value to resource model, check context model
- XmlConversionValue resourceConversionValue = EclipseLinkOrmFactory.eINSTANCE.createXmlConversionValue();
- converterResource.getConversionValues().add(resourceConversionValue);
- resourceConversionValue.setDataValue("foo");
- resourceConversionValue.setObjectValue("bar");
-
- assertEquals(1, ormConverter.getConversionValuesSize());
- ListIterator<? extends EclipseLinkConversionValue> contextConversionValues = ormConverter.getConversionValues().iterator();
- EclipseLinkConversionValue contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- assertEquals(1, converterResource.getConversionValues().size());
- assertEquals("foo", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(0).getObjectValue());
-
- //add a conversion to the beginning of the resource model list
- XmlConversionValue xmlConversionValue2 = EclipseLinkOrmFactory.eINSTANCE.createXmlConversionValue();
- converterResource.getConversionValues().add(0, xmlConversionValue2);
- xmlConversionValue2.setDataValue("foo2");
- xmlConversionValue2.setObjectValue("bar2");
-
- assertEquals(2, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- assertEquals(2, converterResource.getConversionValues().size());
- assertEquals("foo2", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(0).getObjectValue());
- assertEquals("foo", converterResource.getConversionValues().get(1).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(1).getObjectValue());
-
- //move a conversion value in the resource model list
-
- converterResource.getConversionValues().move(0, 1);
- assertEquals(2, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- assertEquals(2, converterResource.getConversionValues().size());
- assertEquals("foo", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(0).getObjectValue());
- assertEquals("foo2", converterResource.getConversionValues().get(1).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(1).getObjectValue());
-
- //remove a conversion value from the resource model list
-
- converterResource.getConversionValues().remove(0);
- assertEquals(1, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- assertEquals(1, converterResource.getConversionValues().size());
- assertEquals("foo2", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(0).getObjectValue());
-
- //clear the conversion value resource model list
- converterResource.getConversionValues().clear();
- assertEquals(0, ormConverter.getConversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
- }
-
- public void testModifyConversionValues() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkObjectTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addObjectTypeConverter(0);
- XmlObjectTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getObjectTypeConverters().get(0);
-
- assertEquals(0, ormConverter.getConversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
-
- //add conversion value to context model, check resource model
- EclipseLinkConversionValue contextConversionValue = ormConverter.addConversionValue();
- contextConversionValue.setDataValue("foo");
- contextConversionValue.setObjectValue("bar");
-
- assertEquals(1, ormConverter.getConversionValuesSize());
- ListIterator<? extends EclipseLinkConversionValue> contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- assertEquals(1, converterResource.getConversionValues().size());
- assertEquals("foo", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(0).getObjectValue());
-
- //add a conversion to the beginning of the context model list
- EclipseLinkConversionValue contextConversionValue2 = ormConverter.addConversionValue(0);
- contextConversionValue2.setDataValue("foo2");
- contextConversionValue2.setObjectValue("bar2");
-
- assertEquals(2, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- assertEquals(2, converterResource.getConversionValues().size());
- assertEquals("foo2", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(0).getObjectValue());
- assertEquals("foo", converterResource.getConversionValues().get(1).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(1).getObjectValue());
-
- //move a conversion value in the context model list
-
- ormConverter.moveConversionValue(0, 1);
- assertEquals(2, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo", contextConversionValue.getDataValue());
- assertEquals("bar", contextConversionValue.getObjectValue());
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- assertEquals(2, converterResource.getConversionValues().size());
- assertEquals("foo", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar", converterResource.getConversionValues().get(0).getObjectValue());
- assertEquals("foo2", converterResource.getConversionValues().get(1).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(1).getObjectValue());
-
- //remove a conversion value from the context model list
-
- ormConverter.removeConversionValue(0);
- assertEquals(1, ormConverter.getConversionValuesSize());
- contextConversionValues = ormConverter.getConversionValues().iterator();
- contextConversionValue = contextConversionValues.next();
- assertEquals("foo2", contextConversionValue.getDataValue());
- assertEquals("bar2", contextConversionValue.getObjectValue());
- assertEquals(1, converterResource.getConversionValues().size());
- assertEquals("foo2", converterResource.getConversionValues().get(0).getDataValue());
- assertEquals("bar2", converterResource.getConversionValues().get(0).getObjectValue());
-
- //clear the conversion value resource model list
- ormConverter.removeConversionValue(0);
- assertEquals(0, ormConverter.getConversionValuesSize());
- assertEquals(0, converterResource.getConversionValues().size());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java
deleted file mode 100644
index 6ac83af73e..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToManyMappingTests.java
+++ /dev/null
@@ -1,760 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinTable;
-import org.eclipse.jpt.jpa.core.context.OneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaOneToManyMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.orm.OrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToManyRelationship2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToManyMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToMany;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmOneToManyMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmOneToManyMappingTests(String name) {
- super(name);
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("import java.util.Collection;");
- sb.append(CR);
- sb.append("import ").append(JPA.JOIN_TABLE).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.JOIN_COLUMN).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @JoinTable(name=\"DEP_EMP\", joinColumns=@JoinColumn(name=\"DEPT_ID\"), inverseJoinColumns=@JoinColumn(name=\"EMP_ID\"))").append(CR);
- sb.append(" private Collection<Employee> employees;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private void createTestEntityWithOneToManyMapping() throws Exception {
- createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToMany").append(CR);
- }
- });
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- for (OrmReadOnlyPersistentAttribute each : ormPersistentType.getAttributes()) {
- each.addToXml();
- }
- }
-
- private ICompilationUnit createTestEntityWithValidMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map<String, Address> addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithValidNonGenericMapOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.ID);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany").append(CR);
- sb.append(" private java.util.Map addresses;").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- }
- });
- }
-
- private void createTestEmbeddableState() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.EMBEDDABLE);
- sb.append(";");
- sb.append(CR);
- sb.append("@Embeddable");
- sb.append(CR);
- sb.append("public class ").append("State").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" private String foo;").append(CR);
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "State.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityOneToManyMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_MANY, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, JPA.ORDER_BY, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToMany(fetch=FetchType.EAGER, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @OrderBy(\"city\"");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(" private java.util.Collection<Address> address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private ICompilationUnit createTestTypeWithCollection() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>("java.util.Collection");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" private Collection<Foo> oneToMany;").append(CR);
- }
- });
- }
-
- public void testUpdatePrivateOwned() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkOneToManyMapping contextOneToMany =
- (EclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlOneToMany resourceOneToMany =
- (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- // check defaults
-
- assertFalse(resourceOneToMany.isPrivateOwned());
- assertFalse(contextOneToMany.getPrivateOwned().isPrivateOwned());
-
- // set xml private owned to true, check context
-
- resourceOneToMany.setPrivateOwned(true);
-
- assertTrue(resourceOneToMany.isPrivateOwned());
- assertTrue(contextOneToMany.getPrivateOwned().isPrivateOwned());
-
- // set xml private owned back to false, check context
-
- resourceOneToMany.setPrivateOwned(false);
-
- assertFalse(resourceOneToMany.isPrivateOwned());
- assertFalse(contextOneToMany.getPrivateOwned().isPrivateOwned());
- }
-
- public void testModifyPrivateOwned() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkOneToManyMapping contextOneToMany =
- (EclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToMany resourceOneToMany =
- (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- // check defaults
-
- assertFalse(resourceOneToMany.isPrivateOwned());
- assertFalse(contextOneToMany.getPrivateOwned().isPrivateOwned());
-
- // set context private owned to true, check resource
-
- contextOneToMany.getPrivateOwned().setPrivateOwned(true);
-
- assertTrue(resourceOneToMany.isPrivateOwned());
- assertTrue(contextOneToMany.getPrivateOwned().isPrivateOwned());
-
- // set context private owned back to false, check resource
-
- contextOneToMany.getPrivateOwned().setPrivateOwned(false);
-
- assertFalse(resourceOneToMany.isPrivateOwned());
- assertFalse(contextOneToMany.getPrivateOwned().isPrivateOwned());
- }
-
- public void testUpdateJoinFetch() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkOneToManyMapping contextOneToMany =
- (EclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlOneToMany resourceOneToMany =
- (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- // check defaults
-
- assertNull(resourceOneToMany.getJoinFetch());
- assertNull(contextOneToMany.getJoinFetch().getValue());
-
- // set xml join fetch to INNER, check context
-
- resourceOneToMany.setJoinFetch(XmlJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceOneToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextOneToMany.getJoinFetch().getValue());
-
- // set xml join fetch to OUTER, check context
-
- resourceOneToMany.setJoinFetch(XmlJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceOneToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextOneToMany.getJoinFetch().getValue());
-
- // set xml join fetch to null, check context
-
- resourceOneToMany.setJoinFetch(null);
-
- assertNull(resourceOneToMany.getJoinFetch());
- assertNull(contextOneToMany.getJoinFetch().getValue());
- }
-
- public void testModifyJoinFetch() throws Exception {
- createTestTypeWithCollection();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToMany"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkOneToManyMapping contextOneToMany =
- (EclipseLinkOneToManyMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToMany resourceOneToMany =
- (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- // check defaults
-
- assertNull(resourceOneToMany.getJoinFetch());
- assertNull(contextOneToMany.getJoinFetch().getValue());
-
- // set context join fetch to INNER, check resource
-
- contextOneToMany.getJoinFetch().setValue(EclipseLinkJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceOneToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextOneToMany.getJoinFetch().getValue());
-
- // set context join fetch to OUTER, check resource
-
- contextOneToMany.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceOneToMany.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextOneToMany.getJoinFetch().getValue());
-
- // set context join fetch to null, check resource
-
- contextOneToMany.getJoinFetch().setValue(null);
-
- assertNull(resourceOneToMany.getJoinFetch());
- assertNull(contextOneToMany.getJoinFetch().getValue());
- }
-
- public void testJoinFetchDefault() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- EclipseLinkOneToManyMapping oneToMany = (EclipseLinkOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
-
- assertNull(oneToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- oneToMany = (EclipseLinkOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertNull(oneToMany.getJoinFetch().getValue());
-
- EclipseLinkRelationshipMapping javaRelationshipMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getJavaPersistentType().getAttributeNamed("employees").getMapping();
- javaRelationshipMapping.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
- assertNull(oneToMany.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- oneToMany = (EclipseLinkOneToManyMapping) departmentPersistentType.getAttributeNamed("employees").getMapping();
- assertEquals(EclipseLinkJoinFetchType.OUTER, oneToMany.getJoinFetch().getValue());
- }
-
- public void testDefaultJoinTable() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- OrmReadOnlyPersistentAttribute attribute = departmentPersistentType.getAttributeNamed("employees");
- OneToManyMapping oneToMany = (OneToManyMapping) attribute.getMapping();
-
- assertEquals(true, attribute.isVirtual());
- JoinTable ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getName());
- assertEquals("id", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getName());
- assertEquals("empId", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getReferencedColumnName());
-
- //set metadata-complete and verify JoinTable info is not taken from the java
- departmentPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- departmentPersistentType.addAttributeToXml(departmentPersistentType.getAttributeNamed("id"), MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
- attribute = departmentPersistentType.getAttributeNamed("employees");
- oneToMany = (OneToManyMapping) attribute.getMapping();
-
- assertEquals(true, attribute.isVirtual());
- ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals("employees_empId", ormJoinTable.getDefaultInverseJoinColumn().getName());
- assertEquals("empId", ormJoinTable.getDefaultInverseJoinColumn().getReferencedColumnName());
-
- //set metadata-complete to false, add mapping to orm.xml verify JoinTable info is not taken from the java
- departmentPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.FALSE);
- attribute = departmentPersistentType.getAttributeNamed("employees");
- oneToMany = (OneToManyMapping) attribute.getMapping();
- assertEquals(true, attribute.isVirtual());
- ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("DEP_EMP", ormJoinTable.getName());
- assertEquals("DEPT_ID", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getName());
- assertEquals("id", ormJoinTable.getSpecifiedJoinColumns().iterator().next().getReferencedColumnName());
- assertEquals("EMP_ID", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getName());
- assertEquals("empId", ormJoinTable.getSpecifiedInverseJoinColumns().iterator().next().getReferencedColumnName());
-
-
- departmentPersistentType.addAttributeToXml(departmentPersistentType.getAttributeNamed("employees"), MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY);
- attribute = departmentPersistentType.getAttributeNamed("employees");
- oneToMany = (OneToManyMapping) attribute.getMapping();
- assertEquals(false, attribute.isVirtual());
- ormJoinTable = oneToMany.getRelationship().getJoinTableStrategy().getJoinTable();
- assertEquals("Department_Employee", ormJoinTable.getName());
- assertEquals(0, ormJoinTable.getSpecifiedJoinColumnsSize());
- assertEquals("Department_id", ormJoinTable.getDefaultJoinColumn().getName());
- assertEquals("id", ormJoinTable.getDefaultJoinColumn().getReferencedColumnName());
- assertEquals(0, ormJoinTable.getSpecifiedInverseJoinColumnsSize());
- assertEquals("employees_empId", ormJoinTable.getDefaultInverseJoinColumn().getName());
- assertEquals("empId", ormJoinTable.getDefaultInverseJoinColumn().getReferencedColumnName());
- }
-
- public void testUpdateVirtualMapKey() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping ormOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
- assertNull(ormOneToManyMapping.getSpecifiedMapKey());
- assertNull(ormOneToManyMapping.getMapKey());
- assertFalse(ormOneToManyMapping.isPkMapKey());
- assertFalse(ormOneToManyMapping.isCustomMapKey());
- assertTrue(ormOneToManyMapping.isNoMapKey());
-
- //set pk mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setPkMapKey(true);
- assertEquals("id", ormOneToManyMapping.getMapKey());
- assertTrue(ormOneToManyMapping.isPkMapKey());
- assertFalse(ormOneToManyMapping.isCustomMapKey());
- assertFalse(ormOneToManyMapping.isNoMapKey());
-
-
- //set custom specified mapKey in the java, verify virtual orm mapping updates
- javaOneToManyMapping.setCustomMapKey(true);
- javaOneToManyMapping.setSpecifiedMapKey("city");
- assertEquals("city", ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals("city", ormOneToManyMapping.getMapKey());
- assertFalse(ormOneToManyMapping.isPkMapKey());
- assertTrue(ormOneToManyMapping.isCustomMapKey());
- assertFalse(ormOneToManyMapping.isNoMapKey());
-
- //set metadata complete and verify that the orm model ignores the java annotations
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- assertEquals(null, ormOneToManyMapping.getSpecifiedMapKey());
- assertEquals(null, ormOneToManyMapping.getMapKey());
- assertFalse(ormOneToManyMapping.isPkMapKey());
- assertFalse(ormOneToManyMapping.isCustomMapKey());
- assertTrue(ormOneToManyMapping.isNoMapKey());
- }
-
- public void testCandidateMapKeyNames() throws Exception {
- createTestEntityWithValidMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping oneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames =
- oneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
- }
-
- public void testCandidateMapKeyNames2() throws Exception {
- createTestEntityWithValidNonGenericMapOneToManyMapping();
- createTestTargetEntityAddress();
- createTestEmbeddableState();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- getEntityMappings().addPersistentType(MappingKeys.EMBEDDABLE_TYPE_MAPPING_KEY, PACKAGE_NAME + ".State");
-
- OneToManyMapping ormOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- JavaOneToManyMapping javaOneToManyMapping = (JavaOneToManyMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("addresses").getMapping();
-
- Iterator<String> mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- javaOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormPersistentType.getAttributeNamed("addresses").addToXml();
- ormOneToManyMapping = (OneToManyMapping) ormPersistentType.getAttributeNamed("addresses").getMapping();
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("test.Address");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals("id", mapKeyNames.next());
- assertEquals("city", mapKeyNames.next());
- assertEquals("state", mapKeyNames.next());
- assertEquals("zip", mapKeyNames.next());
- assertFalse(mapKeyNames.hasNext());
-
- ormOneToManyMapping.setSpecifiedTargetEntity("String");
- mapKeyNames = ormOneToManyMapping.getCandidateMapKeyNames().iterator();
- assertEquals(false, mapKeyNames.hasNext());
- }
-
- public void testModifyPredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship2_0 rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinColumn();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- rel.setStrategyToMappedBy();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- rel.setStrategyToJoinTable();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testUpdatePredominantJoiningStrategy() throws Exception {
- createTestEntityWithOneToManyMapping();
- OrmPersistentType contextType = getEntityMappings().getPersistentType(FULLY_QUALIFIED_TYPE_NAME);
- OrmReadOnlyPersistentAttribute contextAttribute = contextType.getAttributeNamed("id");
- OrmEclipseLinkOneToManyMapping contextMapping = (OrmEclipseLinkOneToManyMapping) contextAttribute.getMapping();
- EclipseLinkOneToManyRelationship2_0 rel = contextMapping.getRelationship();
- XmlEntity resourceEntity = (XmlEntity) contextType.getMapping().getXmlTypeMapping();
- XmlOneToMany resourceMapping = (XmlOneToMany) resourceEntity.getAttributes().getOneToManys().get(0);
-
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy("foo");
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(OrmFactory.eINSTANCE.createXmlJoinTable());
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().add(OrmFactory.eINSTANCE.createXmlJoinColumn());
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNotNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertTrue(rel.strategyIsMappedBy());
-
- resourceMapping.setMappedBy(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNotNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.setJoinTable(null);
- getJpaProject().synchronizeContextModel();
- assertFalse(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertTrue(rel.strategyIsJoinColumn());
- assertFalse(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
-
- resourceMapping.getJoinColumns().clear();
- getJpaProject().synchronizeContextModel();
- assertTrue(resourceMapping.getJoinColumns().isEmpty());
- assertNull(resourceMapping.getJoinTable());
- assertNull(resourceMapping.getMappedBy());
- assertFalse(rel.strategyIsJoinColumn());
- assertTrue(rel.strategyIsJoinTable());
- assertFalse(rel.strategyIsMappedBy());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- EclipseLinkOneToManyMapping virtualOneToManyMapping = (EclipseLinkOneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.EAGER, virtualOneToManyMapping.getSpecifiedFetch());
- assertEquals("Address", virtualOneToManyMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualOneToManyMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isCustomOrdering());
- assertEquals("city", virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, virtualOneToManyMapping.getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToManyMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_MANY_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
-
- EclipseLinkOneToManyMapping virtualOneToManyMapping = (EclipseLinkOneToManyMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToManyMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToManyMapping.getFetch());
- assertEquals("test.Address", virtualOneToManyMapping.getTargetEntity());
- assertNull(virtualOneToManyMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- Cascade cascade = virtualOneToManyMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertTrue(virtualOneToManyMapping.getOrderable().isNoOrdering());
- assertEquals(null, virtualOneToManyMapping.getOrderable().getSpecifiedOrderBy());
-
- assertEquals(null, virtualOneToManyMapping.getJoinFetch().getValue());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java
deleted file mode 100644
index 47660bc278..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmOneToOneMappingTests.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.tests.internal.projects.TestJavaProject.SourceWriter;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.Cascade;
-import org.eclipse.jpt.jpa.core.context.FetchType;
-import org.eclipse.jpt.jpa.core.context.JoinColumn;
-import org.eclipse.jpt.jpa.core.context.OneToOneMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkRelationshipMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlJoinFetchType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlOneToOne;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmOneToOneMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmOneToOneMappingTests(String name) {
- super(name);
- }
-
- private void createTestDepartment() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("import ").append(JPA.ONE_TO_ONE).append(";");
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Department").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" @OneToOne").append(CR);
- sb.append(" private Employee employee;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Department.java", sourceWriter);
- }
-
- private void createTestEmployee() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ").append(JPA.ENTITY).append(";");
- sb.append(CR);
- sb.append("import ").append(JPA.ID).append(";");
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Employee").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int empId;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Employee.java", sourceWriter);
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE, JPA.JOIN_COLUMN, JPA.FETCH_TYPE, JPA.CASCADE_TYPE, EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE, EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" @OneToOne(fetch=FetchType.LAZY, optional=false, targetEntity=Address.class, cascade={CascadeType.ALL, CascadeType.PERSIST, CascadeType.MERGE, CascadeType.REMOVE, CascadeType.REFRESH})");
- sb.append(CR);
- sb.append(" @JoinColumn(name=\"MY_COLUMN\", referencedColumnName=\"MY_REFERENCED_COLUMN\", unique=true, nullable=false, insertable=false, updatable=false, columnDefinition=\"COLUMN_DEFINITION\", table=\"MY_TABLE\")");
- sb.append(CR);
- sb.append(" @JoinFetch(JoinFetchType.INNER)");
- sb.append(CR);
- sb.append(" @PrivateOwned)");
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- sb.append(" @Id");
- }
- });
- }
-
- private void createTestTargetEntityAddress() throws Exception {
- SourceWriter sourceWriter = new SourceWriter() {
- public void appendSourceTo(StringBuilder sb) {
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ENTITY);
- sb.append(";");
- sb.append(CR);
- sb.append("import ");
- sb.append(JPA.ID);
- sb.append(";");
- sb.append(CR);
- sb.append(CR);
- sb.append("@Entity");
- sb.append(CR);
- sb.append("public class ").append("Address").append(" ");
- sb.append("{").append(CR);
- sb.append(CR);
- sb.append(" @Id").append(CR);
- sb.append(" private int id;").append(CR);
- sb.append(CR);
- sb.append(" private String city;").append(CR);
- sb.append(CR);
- sb.append(" private State state;").append(CR);
- sb.append(CR);
- sb.append(" private int zip;").append(CR);
- sb.append(CR);
- sb.append("}").append(CR);
- }
- };
- this.javaProject.createCompilationUnit(PACKAGE_NAME, "Address.java", sourceWriter);
- }
-
- private ICompilationUnit createTestTypeWithOneToOneAttribute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(" private Foo oneToOne;").append(CR);
- }
- });
- }
-
- public void testUpdatePrivateOwned() throws Exception {
- createTestTypeWithOneToOneAttribute();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToOne"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkOneToOneMapping contextOneToOne =
- (EclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToOne resourceOneToOne =
- (XmlOneToOne) resourceEntity.getAttributes().getOneToOnes().get(0);
-
- // check defaults
-
- assertFalse(resourceOneToOne.isPrivateOwned());
- assertFalse(contextOneToOne.getPrivateOwned().isPrivateOwned());
-
- // set xml private owned to true, check context
-
- resourceOneToOne.setPrivateOwned(true);
-
- assertTrue(resourceOneToOne.isPrivateOwned());
- assertTrue(contextOneToOne.getPrivateOwned().isPrivateOwned());
-
- // set xml private owned back to false, check context
-
- resourceOneToOne.setPrivateOwned(false);
-
- assertFalse(resourceOneToOne.isPrivateOwned());
- assertFalse(contextOneToOne.getPrivateOwned().isPrivateOwned());
- }
-
- public void testModifyPrivateOwned() throws Exception {
- createTestTypeWithOneToOneAttribute();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToOne"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkOneToOneMapping contextOneToOne =
- (EclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToOne resourceOneToOne =
- (XmlOneToOne) resourceEntity.getAttributes().getOneToOnes().get(0);
-
- // check defaults
-
- assertFalse(resourceOneToOne.isPrivateOwned());
- assertFalse(contextOneToOne.getPrivateOwned().isPrivateOwned());
-
- // set context private owned to true, check resource
-
- contextOneToOne.getPrivateOwned().setPrivateOwned(true);
-
- assertTrue(resourceOneToOne.isPrivateOwned());
- assertTrue(contextOneToOne.getPrivateOwned().isPrivateOwned());
-
- // set context private owned back to false, check resource
-
- contextOneToOne.getPrivateOwned().setPrivateOwned(false);
- }
-
- public void testUpdateJoinFetch() throws Exception {
- createTestTypeWithOneToOneAttribute();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToOne"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkOneToOneMapping contextOneToOne =
- (EclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity) getXmlEntityMappings().getEntities().get(0);
- XmlOneToOne resourceOneToOne =
- (XmlOneToOne) resourceEntity.getAttributes().getOneToOnes().get(0);
-
- // check defaults
-
- assertNull(resourceOneToOne.getJoinFetch());
- assertNull(contextOneToOne.getJoinFetch().getValue());
-
- // set xml join fetch to INNER, check context
-
- resourceOneToOne.setJoinFetch(XmlJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceOneToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextOneToOne.getJoinFetch().getValue());
-
- // set xml join fetch to OUTER, check context
-
- resourceOneToOne.setJoinFetch(XmlJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceOneToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextOneToOne.getJoinFetch().getValue());
-
- // set xml join fetch to null, check context
-
- resourceOneToOne.setJoinFetch(null);
-
- assertNull(resourceOneToOne.getJoinFetch());
- assertNull(contextOneToOne.getJoinFetch().getValue());
- }
-
- public void testModifyJoinFetch() throws Exception {
- createTestTypeWithOneToOneAttribute();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("oneToOne"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- EclipseLinkOneToOneMapping contextOneToOne =
- (EclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlOneToOne resourceOneToOne =
- (XmlOneToOne) resourceEntity.getAttributes().getOneToOnes().get(0);
-
- // check defaults
-
- assertNull(resourceOneToOne.getJoinFetch());
- assertNull(contextOneToOne.getJoinFetch().getValue());
-
- // set context join fetch to INNER, check resource
-
- contextOneToOne.getJoinFetch().setValue(EclipseLinkJoinFetchType.INNER);
-
- assertEquals(XmlJoinFetchType.INNER, resourceOneToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.INNER, contextOneToOne.getJoinFetch().getValue());
-
- // set context join fetch to OUTER, check resource
-
- contextOneToOne.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
-
- assertEquals(XmlJoinFetchType.OUTER, resourceOneToOne.getJoinFetch());
- assertEquals(EclipseLinkJoinFetchType.OUTER, contextOneToOne.getJoinFetch().getValue());
-
- // set context join fetch to null, check resource
-
- contextOneToOne.getJoinFetch().setValue(null);
-
- assertNull(resourceOneToOne.getJoinFetch());
- assertNull(contextOneToOne.getJoinFetch().getValue());
- }
-
- public void testJoinFetchDefaultFromJava() throws Exception {
- createTestEmployee();
- createTestDepartment();
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Department");
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Employee");
-
- OrmPersistentType departmentPersistentType = getEntityMappings().getPersistentTypes().iterator().next();
- EclipseLinkOneToOneMapping oneToOne = (EclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
-
- assertNull(oneToOne.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- oneToOne = (EclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertNull(oneToOne.getJoinFetch().getValue());
-
- EclipseLinkRelationshipMapping javaRelationshipMapping = (EclipseLinkRelationshipMapping) departmentPersistentType.getJavaPersistentType().getAttributeNamed("employee").getMapping();
- javaRelationshipMapping.getJoinFetch().setValue(EclipseLinkJoinFetchType.OUTER);
- assertNull(oneToOne.getJoinFetch().getValue());
-
- getEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- oneToOne = (EclipseLinkOneToOneMapping) departmentPersistentType.getAttributeNamed("employee").getMapping();
- assertEquals(EclipseLinkJoinFetchType.OUTER, oneToOne.getJoinFetch().getValue());
- }
-
- public void testVirtualMappingMetadataCompleteFalse() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
-
- OneToOneMapping virtualOneToOneMapping = (OneToOneMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", virtualOneToOneMapping.getName());
- assertEquals(FetchType.LAZY, virtualOneToOneMapping.getSpecifiedFetch());
- assertEquals(Boolean.FALSE, virtualOneToOneMapping.getSpecifiedOptional());
- assertEquals("Address", virtualOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(virtualOneToOneMapping.getRelationship().
- getMappedByStrategy().getMappedByAttribute());
-
- JoinColumn virtualJoinColumn =
- virtualOneToOneMapping.getRelationship().getJoinColumnStrategy().getSpecifiedJoinColumns().iterator().next();
- assertEquals("MY_COLUMN", virtualJoinColumn.getSpecifiedName());
- assertEquals("MY_REFERENCED_COLUMN", virtualJoinColumn.getSpecifiedReferencedColumnName());
- assertEquals(Boolean.TRUE, virtualJoinColumn.getSpecifiedUnique());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedNullable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedInsertable());
- assertEquals(Boolean.FALSE, virtualJoinColumn.getSpecifiedUpdatable());
- assertEquals("COLUMN_DEFINITION", virtualJoinColumn.getColumnDefinition());
- assertEquals("MY_TABLE", virtualJoinColumn.getSpecifiedTable());
-
- Cascade cascade = virtualOneToOneMapping.getCascade();
- assertTrue(cascade.isAll());
- assertTrue(cascade.isMerge());
- assertTrue(cascade.isPersist());
- assertTrue(cascade.isRemove());
- assertTrue(cascade.isRefresh());
-
- assertEquals(EclipseLinkJoinFetchType.INNER, ((EclipseLinkJoinFetchMapping) virtualOneToOneMapping).getJoinFetch().getValue());
- assertTrue(((EclipseLinkOneToOneMapping) virtualOneToOneMapping).getPrivateOwned().isPrivateOwned());
- }
-
- public void testVirtualMappingMetadataCompleteTrue() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
- OrmReadOnlyPersistentAttribute virtualPersistentAttribute = ormPersistentType.getAttributeNamed("address");
-
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, virtualPersistentAttribute.getMappingKey());
- assertTrue(virtualPersistentAttribute.isVirtual());
-
- EclipseLinkOneToOneMapping ormOneToOneMapping = (EclipseLinkOneToOneMapping) virtualPersistentAttribute.getMapping();
- assertEquals("address", ormOneToOneMapping.getName());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- assertEquals("test.Address", ormOneToOneMapping.getTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
-
- //TODO default join columns in xml one-to-one
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.specifiedJoinColumns().next();
-// //TODO java default columns name in JavaSingleRelationshipMapping.JoinColumnOwner
-// //assertEquals("address", ormJoinColumn.getSpecifiedName());
-// //assertEquals("address", ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getSpecifiedUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getSpecifiedTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertEquals(null, ormOneToOneMapping.getJoinFetch().getValue());
- assertFalse(ormOneToOneMapping.getPrivateOwned().isPrivateOwned());
- }
-
- public void testSpecifiedMapping() throws Exception {
- createTestEntityOneToOneMapping();
- createTestTargetEntityAddress();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, PACKAGE_NAME + ".Address");
-
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("address"), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- OrmEclipseLinkOneToOneMapping ormOneToOneMapping = (OrmEclipseLinkOneToOneMapping) ormPersistentAttribute.getMapping();
-
- assertEquals("address", ormOneToOneMapping.getName());
- assertNull(ormOneToOneMapping.getSpecifiedFetch());
- assertNull(ormOneToOneMapping.getSpecifiedOptional());
- assertNull(ormOneToOneMapping.getSpecifiedTargetEntity());
- assertNull(ormOneToOneMapping.getRelationship().getMappedByStrategy().getMappedByAttribute());
- assertEquals(FetchType.EAGER, ormOneToOneMapping.getFetch());
- assertEquals(true, ormOneToOneMapping.isOptional());
- //TODO default target entity in xml
- //assertEquals("test.Address", ormOneToOneMapping.getDefaultTargetEntity());
-
- assertTrue(ormOneToOneMapping.getRelationship().getJoinColumnStrategy().getJoinColumnsSize() > 0);
-
- //TODO default join columns for specified xmlOneToOne mapping
-// XmlJoinColumn ormJoinColumn = ormOneToOneMapping.defaultJoinColumns().next();
-// assertNull(ormJoinColumn.getSpecifiedName());
-// assertNull(ormJoinColumn.getSpecifiedReferencedColumnName());
-// assertNull(ormJoinColumn.getSpecifiedUnique());
-// assertNull(ormJoinColumn.getSpecifiedNullable());
-// assertNull(ormJoinColumn.getSpecifiedInsertable());
-// assertNull(ormJoinColumn.getSpecifiedUpdatable());
-// assertNull(ormJoinColumn.getColumnDefinition());
-// assertNull(ormJoinColumn.getSpecifiedTable());
-//
-// assertEquals("address", ormJoinColumn.getDefaultName());
-// assertEquals("address", ormJoinColumn.getDefaultReferencedColumnName());
-// assertEquals(Boolean.FALSE, ormJoinColumn.getDefaultUnique());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultNullable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultInsertable());
-// assertEquals(Boolean.TRUE, ormJoinColumn.getDefaultUpdatable());
-// assertEquals(null, ormJoinColumn.getColumnDefinition());
-// assertEquals(TYPE_NAME, ormJoinColumn.getDefaultTable());
-
- Cascade cascade = ormOneToOneMapping.getCascade();
- assertFalse(cascade.isAll());
- assertFalse(cascade.isMerge());
- assertFalse(cascade.isPersist());
- assertFalse(cascade.isRemove());
- assertFalse(cascade.isRefresh());
-
- assertEquals(null, ormOneToOneMapping.getJoinFetch().getValue());
- assertFalse(ormOneToOneMapping.getPrivateOwned().isPrivateOwned());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java
deleted file mode 100644
index f19d5ddd58..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmPersistentAttributeTests.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAttribute;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceAnnotatedElement.Kind;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.BasicMapping;
-import org.eclipse.jpt.jpa.core.context.IdMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.java.JavaPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.internal.jpa1.context.java.GenericJavaNullAttributeMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkIdMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkOneToOneMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmPersistentAttributeTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmPersistentAttributeTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- private ICompilationUnit createTestTypeNullAttributeMapping() throws Exception {
-
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append(CR);
- sb.append(" private Address address;").append(CR);
- sb.append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityIdMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id");
- sb.append("@Column(name=\"FOO\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityOneToOneMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ONE_TO_ONE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@OneToOne");
- sb.append(" private Address address;");
- }
- });
- }
-
- public void testMakeSpecified() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- ormPersistentAttribute.addToXml();
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ormPersistentAttribute.addToXml();
-
- assertEquals(0, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("name", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeSpecifiedMappingKey() throws Exception {
- createTestTypeNullAttributeMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(3, ormPersistentType.getDefaultAttributesSize());
-
- //take a virtual mapping with a mapping type and make it specified
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertTrue(ormPersistentAttribute.isVirtual());
- assertTrue(ormPersistentAttribute.getMapping() instanceof GenericJavaNullAttributeMapping);
- ormPersistentAttribute.addToXml(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertEquals(specifiedOrmPersistentAttribute.getMappingKey(), MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY);
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmEclipseLinkOneToOneMapping);
-
- ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- ormPersistentAttribute.addToXml(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY);
-
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- Iterator<OrmPersistentAttribute> specifiedAttributes = ormPersistentType.getSpecifiedAttributes().iterator();
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- assertTrue(specifiedOrmPersistentAttribute.getMapping() instanceof OrmEclipseLinkIdMapping);
-
- specifiedOrmPersistentAttribute = specifiedAttributes.next();
- assertEquals("address", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
- }
-
- public void testMakeVirtual() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
-
- assertEquals(0, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- assertEquals("id", specifiedOrmPersistentAttribute.getName());
- assertFalse(specifiedOrmPersistentAttribute.isVirtual());
-
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
- assertEquals(0, ormPersistentType.getSpecifiedAttributesSize());
-
- Iterator<OrmReadOnlyPersistentAttribute> virtualAttributes = ormPersistentType.getDefaultAttributes().iterator();
- OrmReadOnlyPersistentAttribute virtualAttribute = virtualAttributes.next();
- assertEquals("id", virtualAttribute.getName());
- virtualAttribute = virtualAttributes.next();
- assertEquals("name", virtualAttribute.getName());
- }
-
- public void testMakeVirtualNoUnderlyingJavaAttribute() throws Exception {
- createTestType();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- assertEquals(2, ormPersistentType.getDefaultAttributesSize());
-
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
- ormPersistentType.getDefaultAttributes().iterator().next().addToXml();
-
-
- ormPersistentType.getSpecifiedAttributes().iterator().next().getMapping().setName("noJavaAttribute");
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(2, ormPersistentType.getSpecifiedAttributesSize());
-
-
- OrmPersistentAttribute specifiedOrmPersistentAttribute = ormPersistentType.getSpecifiedAttributes().iterator().next();
- specifiedOrmPersistentAttribute.removeFromXml();
- assertEquals(1, ormPersistentType.getDefaultAttributesSize());
- assertEquals(1, ormPersistentType.getSpecifiedAttributesSize());
-
- assertEquals("id", ormPersistentType.getDefaultAttributes().iterator().next().getName());
- assertEquals("name", ormPersistentType.getSpecifiedAttributes().iterator().next().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ID_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("FOO", ((IdMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertEquals("id", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- assertEquals("id", ((BasicMapping) ormPersistentAttribute.getMapping()).getColumn().getName());
- }
-
- public void testVirtualMappingTypeWhenMetadataComplete2() throws Exception {
- createTestEntityOneToOneMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getDefaultAttributes().iterator().next();
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.ONE_TO_ONE_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
-
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("address");
- assertEquals("address", ormPersistentAttribute.getName());
- assertEquals(MappingKeys.NULL_ATTRIBUTE_MAPPING_KEY, ormPersistentAttribute.getMappingKey());
- }
-
- public void testGetJavaPersistentAttribute() throws Exception {
- createTestEntityIdMapping();
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- JavaPersistentType javaPersistentType = ormPersistentType.getJavaPersistentType();
-
- OrmReadOnlyPersistentAttribute ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- JavaPersistentAttribute javaPersistentAttribute = javaPersistentType.getAttributeNamed("id");
-
- //virtual orm attribute, access type matches java : FIELD, name matches java
- assertTrue(ormPersistentAttribute.isVirtual());
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- JavaResourceAttribute javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertTrue(javaResourceAttribute.getKind() == Kind.FIELD);
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getFields().iterator().next(), javaResourceAttribute);
-
-
- //specified orm attribute, access type matches java : FIELD, name matches java
- //javaPersistentAttribute should be == to java context model object
- ormPersistentAttribute.addToXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertFalse(ormPersistentAttribute.isVirtual());
- assertEquals(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
-
-
- //virtual orm attribute, java access type FIELD, orm access type PROPERTY, name matches java
- //verify both the property java resource attribute and the field java resource attribute are used in orm
- //because the field is annotated and property is specified
- ((OrmPersistentAttribute) ormPersistentAttribute).removeFromXml();
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- ormPersistentType.setSpecifiedAccess(AccessType.PROPERTY);
- ListIterator<OrmReadOnlyPersistentAttribute> attributes = ormPersistentType.getAttributes().iterator();
- OrmReadOnlyPersistentAttribute idFieldAttribute = attributes.next();
- OrmReadOnlyPersistentAttribute idPropertyAttribute = attributes.next();
- assertEquals(ormPersistentAttribute, idFieldAttribute);
- assertNotSame(ormPersistentAttribute, idPropertyAttribute);
- ormPersistentAttribute = idPropertyAttribute;
- assertNotSame(javaPersistentAttribute, ormPersistentAttribute.getJavaPersistentAttribute());
- assertEquals(AccessType.FIELD, javaPersistentAttribute.getAccess());
- assertEquals(AccessType.PROPERTY, ormPersistentAttribute.getJavaPersistentAttribute().getAccess());
- assertEquals(AccessType.FIELD, idFieldAttribute.getJavaPersistentAttribute().getAccess());
- javaResourceAttribute = ormPersistentAttribute.getJavaPersistentAttribute().getResourceAttribute();
- assertEquals("id", javaResourceAttribute.getName());
- assertEquals(javaPersistentType.getJavaResourceType().getMethods().iterator().next(), javaResourceAttribute);
-
-
- ormPersistentType.setSpecifiedAccess(null);//default access will be field
- ormPersistentAttribute = ormPersistentType.getAttributeNamed("id");
- OrmPersistentAttribute ormPersistentAttribute2 = ormPersistentAttribute.addToXml();
- ormPersistentAttribute2.getMapping().setName("id2");
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName(null);
- assertEquals(null, ormPersistentAttribute2.getJavaPersistentAttribute());
-
- ormPersistentAttribute2.getMapping().setName("id");
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
-
-
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- assertEquals(javaPersistentAttribute, ormPersistentAttribute2.getJavaPersistentAttribute());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java
deleted file mode 100644
index cd8ce4dc44..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmStructConverterTests.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmStructConverterTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERT, EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Convert(name=\"foo\")").append(CR);
- sb.append(" @StructConverter");
- }
- });
- }
-
-
- public EclipseLinkOrmStructConverterTests(String name) {
- super(name);
- }
-
-
- public void testUpdateConverter() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkStructConverter ormConverter = ormBasicMapping.getConverterContainer().addStructConverter(0);
- XmlStructConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getStructConverters().get(0);
-
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getConverter());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setConverter("myConvert");
- assertEquals("myConvert", ormConverter.getConverterClass());
- assertEquals("myConvert", converterResource.getConverter());
-
- //set converter class name to null in the resource model
- converterResource.setConverter(null);
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getConverter());
- }
-
- public void testModifyConverter() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkStructConverter ormConverter = ormBasicMapping.getConverterContainer().addStructConverter(0);
- XmlStructConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getStructConverters().get(0);
-
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getConverter());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setConverterClass("foo");
- assertEquals("foo", ormConverter.getConverterClass());
- assertEquals("foo", converterResource.getConverter());
-
- ormConverter.setConverterClass(null);
- assertEquals(null, ormConverter.getConverterClass());
- assertEquals(null, converterResource.getConverter());
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkStructConverter ormConverter = ormBasicMapping.getConverterContainer().addStructConverter(0);
- XmlStructConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getStructConverters().get(0);
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setName("myConvert");
- assertEquals("myConvert", ormConverter.getName());
- assertEquals("myConvert", converterResource.getName());
-
- //set converter class name to null in the resource model
- converterResource.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkStructConverter ormConverter = ormBasicMapping.getConverterContainer().addStructConverter(0);
- XmlStructConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getStructConverters().get(0);
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setName("foo");
- assertEquals("foo", ormConverter.getName());
- assertEquals("foo", converterResource.getName());
-
- ormConverter.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java
deleted file mode 100644
index 308476ccf5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTransientMappingTests.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmTransientMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmTransientMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithTransientMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.TRANSIENT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transient").append(CR);
- }
- });
- }
-
- public void testCreateTransientMapping() throws Exception {
- createTestEntityWithTransientMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
-
- OrmReadOnlyPersistentAttribute persistentAttribute = ormPersistentType.getAttributeNamed("id");
- assertTrue(persistentAttribute.isVirtual());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute.getMappingKey());
-
- OrmPersistentAttribute persistentAttribute2 = persistentAttribute.addToXml(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY);
- assertFalse(persistentAttribute2.isVirtual());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute2.getMappingKey());
- assertEquals(MappingKeys.TRANSIENT_ATTRIBUTE_MAPPING_KEY, persistentAttribute2.getMapping().getKey());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java
deleted file mode 100644
index c4f725e58f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmTypeConverterTests.java
+++ /dev/null
@@ -1,191 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlBasic;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmTypeConverterTests
- extends EclipseLinkContextModelTestCase
-{
-
- private ICompilationUnit createTestEntityWithBasicMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERT, EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append(" @Convert(name=\"foo\")").append(CR);
- sb.append(" @TypeConverter");
- }
- });
- }
-
-
- public EclipseLinkOrmTypeConverterTests(String name) {
- super(name);
- }
-
-
- public void testUpdateDataType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addTypeConverter(0);
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setDataType("myConvert");
- assertEquals("myConvert", ormConverter.getDataType());
- assertEquals("myConvert", converterResource.getDataType());
-
- //set converter class name to null in the resource model
- converterResource.setDataType(null);
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
- }
-
- public void testModifyDataType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addTypeConverter(0);
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setDataType("foo");
- assertEquals("foo", ormConverter.getDataType());
- assertEquals("foo", converterResource.getDataType());
-
- ormConverter.setDataType(null);
- assertEquals(null, ormConverter.getDataType());
- assertEquals(null, converterResource.getDataType());
- }
-
- public void testUpdateObjectType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addTypeConverter(0);
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setObjectType("myConvert");
- assertEquals("myConvert", ormConverter.getObjectType());
- assertEquals("myConvert", converterResource.getObjectType());
-
- //set converter class name to null in the resource model
- converterResource.setObjectType(null);
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
- }
-
- public void testModifyObjectType() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addTypeConverter(0);
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setObjectType("foo");
- assertEquals("foo", ormConverter.getObjectType());
- assertEquals("foo", converterResource.getObjectType());
-
- ormConverter.setObjectType(null);
- assertEquals(null, ormConverter.getObjectType());
- assertEquals(null, converterResource.getObjectType());
- }
-
- public void testUpdateName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addTypeConverter(0);
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class name in the resource model, verify context model updated
- converterResource.setName("myConvert");
- assertEquals("myConvert", ormConverter.getName());
- assertEquals("myConvert", converterResource.getName());
-
- //set converter class name to null in the resource model
- converterResource.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-
- public void testModifyName() throws Exception {
- createTestEntityWithBasicMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.BASIC_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkBasicMapping ormBasicMapping = (OrmEclipseLinkBasicMapping) ormPersistentAttribute.getMapping();
- EclipseLinkTypeConverter ormConverter = ormBasicMapping.getConverterContainer().addTypeConverter(0);
- XmlTypeConverter converterResource = ((XmlBasic) getXmlEntityMappings().getEntities().get(0).getAttributes().getBasics().get(0)).getTypeConverters().get(0);
-
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
-
- //set converter class in the context model, verify resource model updated
- ormConverter.setName("foo");
- assertEquals("foo", ormConverter.getName());
- assertEquals("foo", converterResource.getName());
-
- ormConverter.setName(null);
- assertEquals(null, ormConverter.getName());
- assertEquals(null, converterResource.getName());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java
deleted file mode 100644
index b8d442838b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkOrmVersionMappingTests.java
+++ /dev/null
@@ -1,392 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.VersionMapping;
-import org.eclipse.jpt.jpa.core.context.java.JavaVersionMapping;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmReadOnlyPersistentAttribute;
-import org.eclipse.jpt.jpa.core.context.orm.OrmVersionMapping;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkBasicMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvert;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkVersionMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlVersion;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkOrmVersionMappingTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkOrmVersionMappingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestEntityWithVersionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithMutableVersionDate() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.VERSION, EclipseLink.MUTABLE, "java.util.Date");
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append(" @Mutable").append(CR);
- sb.append(" private Date myDate;").append(CR);
- sb.append(CR);
- sb.append(" ");
- }
- });
- }
-
- public void testUpdateMutable() throws Exception {
- createTestEntityWithVersionMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkVersionMapping contextVersion =
- (OrmEclipseLinkVersionMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlVersion resourceVersion =
- (XmlVersion) resourceEntity.getAttributes().getVersions().get(0);
- EclipseLinkVersionMapping javaVersionMapping = (EclipseLinkVersionMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- // check defaults
-
- assertNull(resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceVersion.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceVersion.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceVersion.setMutable(null);
-
- assertNull(resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // TODO - test defaults for java serializable and date/time types,
- // with and without persistence property
-
- // set mutable on java basic mapping
-
- javaVersionMapping.getMutable().setSpecifiedMutable(Boolean.FALSE);
- assertNull(resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
- assertFalse(javaVersionMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkVersionMapping virtualContextVersion = (EclipseLinkVersionMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceVersion.getMutable());
- assertTrue(virtualContextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, virtualContextVersion.getMutable().getSpecifiedMutable());
- assertFalse(virtualContextVersion.getMutable().isMutable());
- assertFalse(javaVersionMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- EclipseLinkBasicMapping contextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceVersion.getMutable());
- assertTrue(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertTrue(contextBasic.getMutable().isMutable());
- assertFalse(javaVersionMapping.getMutable().isMutable());
- }
-
- public void testUpdateMutableDate() throws Exception {
- createTestEntityWithMutableVersionDate();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myDate"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkVersionMapping contextVersion =
- (OrmEclipseLinkVersionMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlVersion resourceVersion =
- (XmlVersion) resourceEntity.getAttributes().getVersions().get(0);
- EclipseLinkVersionMapping javaVersionMapping = (EclipseLinkVersionMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("myDate").getMapping();
-
- // check defaults
-
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set xml mutable to false, check context
-
- resourceVersion.setMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set xml mutable to true, check context
-
- resourceVersion.setMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // clear xml mutable, check context
-
- resourceVersion.setMutable(null);
-
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.TRUE);
- assertNull(resourceVersion.getMutable());
- assertTrue(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(Boolean.FALSE);
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- getPersistenceUnit().getOptions().setTemporalMutable(null);
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set mutable on java version mapping
-
- javaVersionMapping.getMutable().setSpecifiedMutable(Boolean.TRUE);
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
- assertTrue(javaVersionMapping.getMutable().isMutable());
-
- // remove attribute from xml, test default mutable from java
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkVersionMapping virtualContextVersion = (EclipseLinkVersionMapping) ormPersistentAttribute2.getMapping();
-
- assertNull(resourceVersion.getMutable());
- assertFalse(virtualContextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, virtualContextVersion.getMutable().getSpecifiedMutable());
- assertTrue(virtualContextVersion.getMutable().isMutable());
- assertTrue(javaVersionMapping.getMutable().isMutable());
-
- // set metadata complete
- ormPersistentType.getMapping().setSpecifiedMetadataComplete(Boolean.TRUE);
- ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("myDate");
- EclipseLinkBasicMapping contextBasic = (EclipseLinkBasicMapping) ormPersistentAttribute2.getMapping();
- assertNull(resourceVersion.getMutable());
- assertFalse(contextBasic.getMutable().isDefaultMutable());
- assertNull(contextBasic.getMutable().getSpecifiedMutable());
- assertFalse(contextBasic.getMutable().isMutable());
- assertTrue(javaVersionMapping.getMutable().isMutable());
- }
-
- public void testModifyMutable() throws Exception {
- createTestEntityWithMutableVersionDate();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("myDate"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- OrmEclipseLinkVersionMapping contextVersion =
- (OrmEclipseLinkVersionMapping) ormPersistentAttribute.getMapping();
- XmlEntity resourceEntity =
- (XmlEntity)getXmlEntityMappings().getEntities().get(0);
- XmlVersion resourceVersion =
- (XmlVersion) resourceEntity.getAttributes().getVersions().get(0);
-
- // check defaults
-
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set context mutable to true, check resource
-
- contextVersion.getMutable().setSpecifiedMutable(Boolean.TRUE);
-
- assertEquals(Boolean.TRUE, resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.TRUE, contextVersion.getMutable().getSpecifiedMutable());
- assertTrue(contextVersion.getMutable().isMutable());
-
- // set context mutable to false, check resource
-
- contextVersion.getMutable().setSpecifiedMutable(Boolean.FALSE);
-
- assertEquals(Boolean.FALSE, resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertEquals(Boolean.FALSE, contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
-
- // set context read only to null, check resource
-
- contextVersion.getMutable().setSpecifiedMutable(null);
-
- assertNull(resourceVersion.getMutable());
- assertFalse(contextVersion.getMutable().isDefaultMutable());
- assertNull(contextVersion.getMutable().getSpecifiedMutable());
- assertFalse(contextVersion.getMutable().isMutable());
- }
-
- public void testUpdateConvert() throws Exception {
- createTestEntityWithVersionMapping();
-
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute = ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion basicResource = (XmlVersion) getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
- JavaVersionMapping javaVersionMapping = (JavaVersionMapping) ormPersistentType.getJavaPersistentType().getAttributeNamed("id").getMapping();
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob in the resource model, verify context model updated
- basicResource.setConvert("myConvert");
- assertEquals(EclipseLinkConvert.class, ormVersionMapping.getConverter().getType());
- assertEquals("myConvert", basicResource.getConvert());
-
- //set lob to null in the resource model
- basicResource.setConvert(null);
- assertNull(ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
-
- javaVersionMapping.setConverter(EclipseLinkConvert.class);
- ((EclipseLinkConvert) javaVersionMapping.getConverter()).setSpecifiedConverterName("foo");
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaVersionMapping.getConverter()).getSpecifiedConverterName());
-
-
- ormPersistentAttribute.removeFromXml();
- OrmReadOnlyPersistentAttribute ormPersistentAttribute2 = ormPersistentType.getAttributeNamed("id");
- VersionMapping virtualVersionMapping = (VersionMapping) ormPersistentAttribute2.getMapping();
-
- assertEquals(EclipseLinkConvert.class, virtualVersionMapping.getConverter().getType());
- assertEquals("foo", ((EclipseLinkConvert) virtualVersionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("foo", ((EclipseLinkConvert) javaVersionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) javaVersionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals(EclipseLinkConvert.class, virtualVersionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) virtualVersionMapping.getConverter()).getSpecifiedConverterName());
- assertEquals(null, basicResource.getConvert());
- assertEquals("bar", ((EclipseLinkConvert) javaVersionMapping.getConverter()).getSpecifiedConverterName());
-
- javaVersionMapping.setConverter(null);
- assertNull(virtualVersionMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
- assertNull(javaVersionMapping.getConverter().getType());
- }
-
- public void testModifyConvert() throws Exception {
- createTestEntityWithVersionMapping();
- OrmPersistentType ormPersistentType =
- getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, FULLY_QUALIFIED_TYPE_NAME);
- OrmPersistentAttribute ormPersistentAttribute =
- ormPersistentType.addAttributeToXml(ormPersistentType.getAttributeNamed("id"), MappingKeys.VERSION_ATTRIBUTE_MAPPING_KEY);
- OrmVersionMapping ormVersionMapping = (OrmVersionMapping) ormPersistentAttribute.getMapping();
- XmlVersion basicResource = (XmlVersion) getXmlEntityMappings().getEntities().get(0).getAttributes().getVersions().get(0);
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
-
- //set lob in the context model, verify resource model updated
- ormVersionMapping.setConverter(EclipseLinkConvert.class);
- assertEquals("", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormVersionMapping.getConverter().getType());
-
- ((EclipseLinkConvert) ormVersionMapping.getConverter()).setSpecifiedConverterName("bar");
- assertEquals("bar", basicResource.getConvert());
- assertEquals(EclipseLinkConvert.class, ormVersionMapping.getConverter().getType());
- assertEquals("bar", ((EclipseLinkConvert) ormVersionMapping.getConverter()).getSpecifiedConverterName());
-
- ((EclipseLinkConvert) ormVersionMapping.getConverter()).setSpecifiedConverterName(null);
-
- assertNull(ormVersionMapping.getConverter().getType());
- assertEquals(null, basicResource.getConvert());
-
- //set lob to false in the context model
- ormVersionMapping.setConverter(null);
- assertNull(ormVersionMapping.getConverter().getType());
- assertNull(basicResource.getConvert());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java
deleted file mode 100644
index 6691af01df..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitDefaultsTests.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.AccessType;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitDefaults;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLinkPersistenceUnitDefaultsTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkPersistenceUnitDefaultsTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmPersistenceUnitDefaults persistenceUnitDefaults() {
- return getEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- XmlPersistenceUnitMetadata persistenceUnitMetadata = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- getXmlEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- XmlPersistenceUnitDefaults persistenceUnitDefaultsResource = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults();
- persistenceUnitMetadata.setPersistenceUnitDefaults(persistenceUnitDefaultsResource);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(true);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCascadePersist(false);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setSchema(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog("asdf");
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setCatalog(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
-
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertFalse(persistenceUnitDefaultsResource.isUnset());
-
- persistenceUnitDefaultsResource.setAccess(null);
- assertTrue(persistenceUnitDefaultsResource.isUnset());
- }
-
- public void testUpdateSchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifySchema2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
- }
-
- public void testModifySchema3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set schema in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedSchema("MY_SCHEMA");
- assertEquals("MY_SCHEMA", persistenceUnitDefaults.getSchema());
- assertEquals("MY_SCHEMA", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getSchema());
-
- //set schema to null in the context model
- persistenceUnitDefaults.setSpecifiedSchema(null);
- assertNull(persistenceUnitDefaults.getSchema());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCatalog2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setSchema("MY_SCHEMA");
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
- }
-
- public void testModifyCatalog3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set catalog in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedCatalog("MY_CATALOG");
- assertEquals("MY_CATALOG", persistenceUnitDefaults.getCatalog());
- assertEquals("MY_CATALOG", getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getCatalog());
-
- //set catalog to null in the context model
- persistenceUnitDefaults.setSpecifiedCatalog(null);
- assertNull(persistenceUnitDefaults.getCatalog());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
- public void testUpdateCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the resource model, persistence-unit-defaults tag not removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyCascadePersist2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCatalog("MY_CATALOG");
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
- }
-
- public void testModifyCascadePersist3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set cascadePersist in the context model, verify resource model modified
- persistenceUnitDefaults.setCascadePersist(true);
- assertTrue(persistenceUnitDefaults.isCascadePersist());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().isCascadePersist());
-
- //set cascadePersist to null in the context model
- persistenceUnitDefaults.setCascadePersist(false);
- assertFalse(persistenceUnitDefaults.isCascadePersist());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-
- public void testUpdateAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setAccess(null);
- assertNull(persistenceUnitDefaults.getAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(AccessType.PROPERTY);
- assertEquals(AccessType.PROPERTY, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.PROPERTY, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setSpecifiedAccess(null);
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyAccess2() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set another element on the persistence-unit-defaults element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().setCascadePersist(true);
- //set access to null in the context model
- persistenceUnitDefaults.setSpecifiedAccess(null);
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
- }
-
- public void testModifyAccess3() throws Exception {
- OrmPersistenceUnitDefaults persistenceUnitDefaults = persistenceUnitDefaults();
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- //set another element on the persistence-unit-metadata element so only persistence-unit-defaults element gets removed
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
-
- //set access in the context model, verify resource model modified
- persistenceUnitDefaults.setSpecifiedAccess(AccessType.FIELD);
- assertEquals(AccessType.FIELD, persistenceUnitDefaults.getSpecifiedAccess());
- assertEquals(org.eclipse.jpt.jpa.core.resource.orm.AccessType.FIELD, getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults().getAccess());
-
- //set access to null in the context model
- persistenceUnitDefaults.setSpecifiedAccess(null);
- assertNull(persistenceUnitDefaults.getSpecifiedAccess());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata().getPersistenceUnitDefaults());
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java
deleted file mode 100644
index ae3984ff89..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/EclipseLinkPersistenceUnitMetadataTests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.EclipseLinkOrmFactory;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.orm.XmlPersistenceUnitMetadata;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-
-public class EclipseLinkPersistenceUnitMetadataTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkPersistenceUnitMetadataTests(String name) {
- super(name);
- }
-
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- XmlMappingFileRef mappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- mappingFileRef.setFileName(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- getXmlPersistenceUnit().getMappingFiles().add(mappingFileRef);
- getPersistenceXmlResource().save(null);
- }
-
- protected OrmPersistenceUnitMetadata persistenceUnitMetadata() {
- return getEntityMappings().getPersistenceUnitMetadata();
- }
-
- public void testIsAllFeaturesUnset() throws Exception {
- XmlPersistenceUnitMetadata persistenceUnitMetadata = EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata();
- getXmlEntityMappings().setPersistenceUnitMetadata(persistenceUnitMetadata);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertFalse(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertTrue(persistenceUnitMetadata.isUnset());
-
- persistenceUnitMetadata.setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- assertFalse(persistenceUnitMetadata.isUnset());
- }
-
- public void testUpdateXmlMappingMetadataComplete() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the resource model, verify context model updated
- getXmlEntityMappings().setPersistenceUnitMetadata(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitMetadata());
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the resource model
- getXmlEntityMappings().getPersistenceUnitMetadata().setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-
- public void testModifyXmlMappingMetadataComplete() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the context model
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
- }
-
- public void testModifyXmlMappingMetadataComplete2() throws Exception {
- OrmPersistenceUnitMetadata persistenceUnitMetadata = getEntityMappings().getPersistenceUnitMetadata();
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertNull(getXmlEntityMappings().getPersistenceUnitMetadata());
-
- //set xmlMappingMetadataComplete in the context model, verify resource model modified
- persistenceUnitMetadata.setXmlMappingMetadataComplete(true);
- assertTrue(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertTrue(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
-
- //set xmlMappingMetadataComplete to null in the context model
- //set another element on the persistence-unit-metadata element so it doesn't get removed
- getXmlEntityMappings().getPersistenceUnitMetadata().setPersistenceUnitDefaults(EclipseLinkOrmFactory.eINSTANCE.createXmlPersistenceUnitDefaults());
- persistenceUnitMetadata.setXmlMappingMetadataComplete(false);
- assertFalse(persistenceUnitMetadata.isXmlMappingMetadataComplete());
- assertFalse(getXmlEntityMappings().getPersistenceUnitMetadata().isXmlMappingMetadataComplete());
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java
deleted file mode 100644
index 4d70a79c65..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/orm/JptEclipseLinkCoreOrmContextModelTests.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2012 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.orm;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLinkCoreOrmContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCoreOrmContextModelTests.class.getName());
- suite.addTestSuite(EclipseLinkEntityMappingsTests.class);
- suite.addTestSuite(EclipseLinkPersistenceUnitMetadataTests.class);
- suite.addTestSuite(EclipseLinkPersistenceUnitDefaultsTests.class);
- suite.addTestSuite(EclipseLinkOrmEmbeddableTests.class);
- suite.addTestSuite(EclipseLinkOrmEntityTests.class);
- suite.addTestSuite(EclipseLinkOrmMappedSuperclassTests.class);
- suite.addTestSuite(EclipseLinkOrmBasicMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmIdMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmManyToManyMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmManyToOneMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmOneToManyMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmOneToOneMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmPersistentAttributeTests.class);
- suite.addTestSuite(EclipseLinkOrmVersionMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmTransientMappingTests.class);
- suite.addTestSuite(EclipseLinkOrmConverterTests.class);
- suite.addTestSuite(EclipseLinkOrmObjectTypeConverterTests.class);
- suite.addTestSuite(EclipseLinkOrmStructConverterTests.class);
- suite.addTestSuite(EclipseLinkOrmTypeConverterTests.class);
- suite.addTestSuite(EclipseLinkOrmCachingTests.class);
- suite.addTestSuite(EclipseLink1_1OrmPersistentAttributeTests.class);
- suite.addTestSuite(EclipseLink1_1OrmPersistentTypeTests.class);
- suite.addTestSuite(EclipseLink1_1OrmTransientMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmCollectionTableTests.class);
- suite.addTestSuite(EclipseLink2_0OrmElementCollectionMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmEntityTests.class);
- suite.addTestSuite(EclipseLink2_0OrmManyToManyMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmManyToOneMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmMappedSuperclassTests.class);
- suite.addTestSuite(EclipseLink2_0OrmOneToOneMappingTests.class);
- suite.addTestSuite(EclipseLink2_0OrmOneToManyMappingTests.class);
- suite.addTestSuite(EclipseLink2_1EntityMappingsTests.class);
- suite.addTestSuite(EclipseLink2_1PersistenceUnitDefaultsTests.class);
- suite.addTestSuite(EclipseLink2_1OrmPersistentTypeTests.class);
- suite.addTestSuite(EclipseLink2_1OrmEmbeddableTests.class);
- suite.addTestSuite(EclipseLink2_1OrmEntityTests.class);
- suite.addTestSuite(EclipseLink2_1OrmMappedSuperclassTests.class);
- suite.addTestSuite(EclipseLink2_3OrmMultitenancyTests.class);
- return suite;
- }
-
-
- private JptEclipseLinkCoreOrmContextModelTests() {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingAdapterTests.java
deleted file mode 100644
index 533f3ee33c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingAdapterTests.java
+++ /dev/null
@@ -1,448 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.FlushClearCache;
-
-/**
- * Tests the update of model objects by the Caching adapter when the
- * PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class CachingAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Caching caching;
- private ListEvent entitiesEvent;
-
- public static final String ENTITY_TEST = "Employee";
- public static final String ENTITY_TEST_2 = "Address";
-
- public static final String CACHE_TYPE_DEFAULT_KEY = Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT;
- public static final CacheType CACHE_TYPE_DEFAULT_TEST_VALUE = CacheType.soft_weak;
- public static final CacheType CACHE_TYPE_DEFAULT_TEST_VALUE_2 = CacheType.full;
-
- public static final String CACHE_SIZE_DEFAULT_KEY = Caching.ECLIPSELINK_CACHE_SIZE_DEFAULT;
- public static final Integer CACHE_SIZE_DEFAULT_TEST_VALUE = 12345;
- public static final Integer CACHE_SIZE_DEFAULT_TEST_VALUE_2 = 67890;
-
- public static final String SHARED_CACHE_DEFAULT_KEY = Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT;
- public static final Boolean SHARED_CACHE_DEFAULT_TEST_VALUE = false;
- public static final Boolean SHARED_CACHE_DEFAULT_TEST_VALUE_2 = true;
-
- public static final String CACHE_TYPE_KEY = Caching.ECLIPSELINK_CACHE_TYPE + ENTITY_TEST;
- public static final CacheType CACHE_TYPE_TEST_VALUE = CacheType.soft_weak;
- public static final CacheType CACHE_TYPE_TEST_VALUE_2 = CacheType.full;
-
- public static final String SHARED_CACHE_KEY = Caching.ECLIPSELINK_SHARED_CACHE + ENTITY_TEST;
- public static final Boolean SHARED_CACHE_TEST_VALUE = false;
- public static final Boolean SHARED_CACHE_TEST_VALUE_2 = true;
-
- public static final String CACHE_SIZE_KEY = Caching.ECLIPSELINK_CACHE_SIZE + ENTITY_TEST;
- public static final Integer CACHE_SIZE_TEST_VALUE = 12345;
- public static final Integer CACHE_SIZE_TEST_VALUE_2 = 67890;
-
- public static final String FLUSH_CLEAR_CACHE_KEY = Caching.ECLIPSELINK_FLUSH_CLEAR_CACHE;
- public static final FlushClearCache FLUSH_CLEAR_CACHE_TEST_VALUE = FlushClearCache.drop;
- public static final FlushClearCache FLUSH_CLEAR_CACHE_TEST_VALUE_2 = FlushClearCache.merge;
-
- public CachingAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.caching = this.getPersistenceUnit().getCaching();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.caching.addPropertyChangeListener(Caching.CACHE_TYPE_DEFAULT_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(Caching.CACHE_SIZE_DEFAULT_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(Caching.SHARED_CACHE_DEFAULT_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(CachingEntity.CACHE_TYPE_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(CachingEntity.CACHE_SIZE_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(CachingEntity.SHARED_CACHE_PROPERTY, propertyChangeListener);
- this.caching.addPropertyChangeListener(Caching.FLUSH_CLEAR_CACHE_PROPERTY, propertyChangeListener);
-
- ListChangeListener entitiesChangeListener = this.buildEntitiesChangeListener();
- this.caching.addListChangeListener(Caching.ENTITIES_LIST, entitiesChangeListener);
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 7;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(CACHE_TYPE_DEFAULT_KEY, CACHE_TYPE_DEFAULT_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty(CACHE_SIZE_DEFAULT_KEY, CACHE_SIZE_DEFAULT_TEST_VALUE);
- this.persistenceUnitSetProperty(SHARED_CACHE_DEFAULT_KEY, SHARED_CACHE_DEFAULT_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(CACHE_SIZE_KEY, CACHE_SIZE_TEST_VALUE);
- this.persistenceUnitSetProperty(CACHE_TYPE_KEY, CACHE_TYPE_TEST_VALUE);
- this.persistenceUnitSetProperty(SHARED_CACHE_KEY, SHARED_CACHE_TEST_VALUE);
- this.persistenceUnitSetProperty(FLUSH_CLEAR_CACHE_KEY, FLUSH_CLEAR_CACHE_TEST_VALUE);
- return;
- }
-
- // ********** Listeners **********
- private ListChangeListener buildEntitiesChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- CachingAdapterTests.this.entityAdded(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- CachingAdapterTests.this.entityRemoved(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- CachingAdapterTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- CachingAdapterTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- CachingAdapterTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listChanged(ListChangeEvent e) {
- CachingAdapterTests.this.throwUnsupportedOperationException(e);
- }
- };
- }
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.entitiesEvent = null;
- }
-
- void entityAdded(ListAddEvent e) {
- this.entitiesEvent = e;
- }
-
- void entityRemoved(ListRemoveEvent e) {
- this.entitiesEvent = e;
- }
-
- // ********** entities list **********
- public void testEntitiesList() throws Exception {
- // add
- this.clearEvent();
- int originalNumberOfEntities = this.caching.getEntitiesSize();
-
- this.caching.addEntity(ENTITY_TEST_2);
- assertEquals("Entity not added", this.caching.getEntitiesSize(), originalNumberOfEntities + 1);
-
- // verify event received
- assertNotNull("No Event Fired.", this.entitiesEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.entitiesEvent.getListName(), Caching.ENTITIES_LIST);
-
- // remove
- this.clearEvent();
- this.caching.removeEntity(ENTITY_TEST_2);
- assertEquals("Entity not removed", this.caching.getEntitiesSize(), originalNumberOfEntities);
-
- // verify event received
- assertNotNull("No Event Fired.", this.entitiesEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.entitiesEvent.getListName(), Caching.ENTITIES_LIST);
- }
-
- // ********** CacheTypeDefault **********
- /**
- * Tests the update of CacheTypeDefault property by the Caching adapter when
- * the PU or the model changes.
- */
- public void testSetCacheTypeDefault() throws Exception {
- this.verifyModelInitialized(
- CACHE_TYPE_DEFAULT_KEY,
- CACHE_TYPE_DEFAULT_TEST_VALUE);
- this.verifySetProperty(
- CACHE_TYPE_DEFAULT_KEY,
- CACHE_TYPE_DEFAULT_TEST_VALUE,
- CACHE_TYPE_DEFAULT_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheTypeDefault() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_TYPE_DEFAULT_KEY,
- CACHE_TYPE_DEFAULT_TEST_VALUE,
- CACHE_TYPE_DEFAULT_TEST_VALUE_2);
- }
-
- // ********** CacheSizeDefault **********
- /**
- * Tests the update of CacheSizeDefault property by the Caching adapter when
- * the PU or the model changes.
- */
- public void testSetCacheSizeDefault() throws Exception {
- this.verifyModelInitialized(
- CACHE_SIZE_DEFAULT_KEY,
- CACHE_SIZE_DEFAULT_TEST_VALUE);
- this.verifySetProperty(
- CACHE_SIZE_DEFAULT_KEY,
- CACHE_SIZE_DEFAULT_TEST_VALUE,
- CACHE_SIZE_DEFAULT_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheSizeDefault() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_SIZE_DEFAULT_KEY,
- CACHE_SIZE_DEFAULT_TEST_VALUE,
- CACHE_SIZE_DEFAULT_TEST_VALUE_2);
- }
-
- // ********** SharedCacheDefault **********
- public void testSetSharedCacheDefault() throws Exception {
- this.verifyModelInitialized(
- SHARED_CACHE_DEFAULT_KEY,
- SHARED_CACHE_DEFAULT_TEST_VALUE);
- this.verifySetProperty(
- SHARED_CACHE_DEFAULT_KEY,
- SHARED_CACHE_DEFAULT_TEST_VALUE,
- SHARED_CACHE_DEFAULT_TEST_VALUE_2);
- }
-
- public void testAddRemoveSharedCacheDefault() throws Exception {
- this.verifyAddRemoveProperty(
- SHARED_CACHE_DEFAULT_KEY,
- SHARED_CACHE_DEFAULT_TEST_VALUE,
- SHARED_CACHE_DEFAULT_TEST_VALUE_2);
- }
-
- // ********** CacheType **********
- /**
- * Tests the update of CacheType property by the Caching adapter when the PU
- * or the model changes.
- */
- public void testSetCacheType() throws Exception {
- this.verifyModelInitialized(
- CACHE_TYPE_KEY,
- CACHE_TYPE_TEST_VALUE);
- this.verifySetCachingProperty(
- CachingEntity.CACHE_TYPE_PROPERTY,
- CACHE_TYPE_KEY,
- CACHE_TYPE_TEST_VALUE,
- CACHE_TYPE_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheType() throws Exception {
- this.verifyAddRemoveCachingProperty(
- CachingEntity.CACHE_TYPE_PROPERTY,
- CACHE_TYPE_KEY,
- CACHE_TYPE_TEST_VALUE,
- CACHE_TYPE_TEST_VALUE_2);
- }
-
- // ********** CacheSize **********
- /**
- * Tests the update of CacheSize property by the Caching adapter when the PU
- * or the model changes.
- */
- public void testSetCacheSize() throws Exception {
- this.verifyModelInitialized(
- CACHE_SIZE_KEY,
- CACHE_SIZE_TEST_VALUE);
- this.verifySetCachingProperty(
- CachingEntity.CACHE_SIZE_PROPERTY,
- CACHE_SIZE_KEY,
- CACHE_SIZE_TEST_VALUE,
- CACHE_SIZE_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheSize() throws Exception {
- this.verifyAddRemoveCachingProperty(
- CachingEntity.CACHE_SIZE_PROPERTY,
- CACHE_SIZE_KEY,
- CACHE_SIZE_TEST_VALUE,
- CACHE_SIZE_TEST_VALUE_2);
- }
-
- // ********** SharedCache **********
- /**
- * Tests the update of SharedCache property by the Caching adapter when the
- * PU or the model changes.
- */
- public void testSetSharedCache() throws Exception {
- this.verifyModelInitialized(
- SHARED_CACHE_KEY,
- SHARED_CACHE_TEST_VALUE);
- this.verifySetCachingProperty(
- CachingEntity.SHARED_CACHE_PROPERTY,
- SHARED_CACHE_KEY,
- SHARED_CACHE_TEST_VALUE,
- SHARED_CACHE_TEST_VALUE_2);
- }
-
- public void testAddRemoveSharedCache() throws Exception {
- this.verifyAddRemoveCachingProperty(
- CachingEntity.SHARED_CACHE_PROPERTY,
- SHARED_CACHE_KEY,
- SHARED_CACHE_TEST_VALUE,
- SHARED_CACHE_TEST_VALUE_2);
- }
-
- // ********** FlushClearCache tests **********
- public void testSetFlushClearCache() throws Exception {
- this.verifyModelInitialized(
- FLUSH_CLEAR_CACHE_KEY,
- FLUSH_CLEAR_CACHE_TEST_VALUE);
- this.verifySetProperty(
- FLUSH_CLEAR_CACHE_KEY,
- FLUSH_CLEAR_CACHE_TEST_VALUE,
- FLUSH_CLEAR_CACHE_TEST_VALUE_2);
- }
-
- public void testAddRemoveFlushClearCache() throws Exception {
- this.verifyAddRemoveProperty(
- FLUSH_CLEAR_CACHE_KEY,
- FLUSH_CLEAR_CACHE_TEST_VALUE,
- FLUSH_CLEAR_CACHE_TEST_VALUE_2);
- }
-
- // ****** convenience methods *******
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.caching;
- }
-
- protected void verifySetCachingProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, testValue2);
-
- // Replace by setting model object
- this.clearEvent();
- this.setCachingProperty(propertyName, ENTITY_TEST, testValue1);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, testValue1);
- }
-
- protected void verifyAddRemoveCachingProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key);
- assertNull(this.getPersistenceUnit().getProperty(key));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, null);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, testValue1);
-
- // Set to null
- this.persistenceUnitSetProperty(key, null);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, null);
-
- // Replace
- this.persistenceUnitSetProperty(key, testValue2);
- this.verifyPutCachingProperty(propertyName, ENTITY_TEST, testValue2);
- }
-
- protected void verifyPutCachingProperty(String propertyName, String entityName, Object expectedValue) throws Exception {
- this.verifyEvent(propertyName);
- this.verifyCachingEvent(propertyName, entityName, expectedValue);
- }
-
- protected void verifyCachingEvent(String propertyName, String entityName, Object expectedValue) throws Exception {
- // verify event value
- CachingEntity entity = (CachingEntity) this.propertyChangedEvent.getNewValue();
- if (propertyName.equals(CachingEntity.CACHE_TYPE_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getCacheTypeOf(entityName));
- assertEquals(expectedValue, this.caching.getCacheTypeOf(entityName));
- }
- else if (propertyName.equals(CachingEntity.CACHE_SIZE_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getCacheSizeOf(entityName));
- assertEquals(expectedValue, this.caching.getCacheSizeOf(entityName));
- }
- else if (propertyName.equals(CachingEntity.SHARED_CACHE_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getSharedCacheOf(entityName));
- assertEquals(expectedValue, this.caching.getSharedCacheOf(entityName));
- }
- else {
- this.throwMissingDefinition("verifyCachingEvent", propertyName);
- }
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Caching.CACHE_TYPE_DEFAULT_PROPERTY))
- this.caching.setCacheTypeDefault((CacheType) newValue);
- else if (propertyName.equals(Caching.CACHE_SIZE_DEFAULT_PROPERTY))
- this.caching.setCacheSizeDefault((Integer) newValue);
- else if (propertyName.equals(Caching.SHARED_CACHE_DEFAULT_PROPERTY))
- this.caching.setSharedCacheDefault((Boolean) newValue);
- else if (propertyName.equals(Caching.FLUSH_CLEAR_CACHE_PROPERTY))
- this.caching.setFlushClearCache((FlushClearCache) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- protected void setCachingProperty(String propertyName, String entityName, Object newValue) throws NoSuchFieldException {
- if (propertyName.equals(CachingEntity.CACHE_TYPE_PROPERTY))
- this.caching.setCacheTypeOf(entityName, (CacheType) newValue);
- else if (propertyName.equals(CachingEntity.CACHE_SIZE_PROPERTY))
- this.caching.setCacheSizeOf(entityName, (Integer) newValue);
- else if (propertyName.equals(CachingEntity.SHARED_CACHE_PROPERTY))
- this.caching.setSharedCacheOf(entityName, (Boolean) newValue);
- else
- this.throwMissingDefinition("setCachingProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Caching.CACHE_TYPE_DEFAULT_PROPERTY))
- modelValue = this.caching.getCacheTypeDefault();
- else if (propertyName.equals(Caching.CACHE_SIZE_DEFAULT_PROPERTY))
- modelValue = this.caching.getCacheSizeDefault();
- else if (propertyName.equals(Caching.SHARED_CACHE_DEFAULT_PROPERTY))
- modelValue = this.caching.getSharedCacheDefault();
- else if (propertyName.equals(CachingEntity.CACHE_SIZE_PROPERTY))
- modelValue = this.caching.getCacheSizeOf(ENTITY_TEST);
- else if (propertyName.equals(CachingEntity.CACHE_TYPE_PROPERTY))
- modelValue = this.caching.getCacheTypeOf(ENTITY_TEST);
- else if (propertyName.equals(CachingEntity.SHARED_CACHE_PROPERTY))
- modelValue = this.caching.getSharedCacheOf(ENTITY_TEST);
- else if (propertyName.equals(Caching.FLUSH_CLEAR_CACHE_PROPERTY))
- modelValue = this.caching.getFlushClearCache();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingValueModelTests.java
deleted file mode 100644
index 103418674f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CachingValueModelTests.java
+++ /dev/null
@@ -1,443 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Caching;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CachingEntity;
-
-/**
- * CachingValueModelTests
- */
-@SuppressWarnings("nls")
-public class CachingValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Caching caching;
- private PropertyValueModel<Caching> cachingHolder;
-
- private ModifiablePropertyValueModel<CacheType> cacheTypeHolder;
- private PropertyChangeListener cacheTypeListener;
- private PropertyChangeEvent cacheTypeEvent;
-
- private ModifiablePropertyValueModel<Boolean> sharedCacheHolder;
- private PropertyChangeListener sharedCacheListener;
- private PropertyChangeEvent sharedCacheEvent;
-
- private ModifiablePropertyValueModel<CacheType> cacheTypeDefaultHolder;
- private PropertyChangeListener cacheTypeDefaultListener;
- private PropertyChangeEvent cacheTypeDefaultEvent;
-
- private ModifiablePropertyValueModel<Boolean> sharedCacheDefaultHolder;
- private PropertyChangeListener sharedCacheDefaultListener;
- private PropertyChangeEvent sharedCacheDefaultEvent;
-
- public static final String ENTITY_NAME_TEST_VALUE = "Employee";
- public static final CacheType CACHE_TYPE_TEST_VALUE = CacheType.hard_weak;
- public static final Boolean SHARED_CACHE_TEST_VALUE = Boolean.FALSE;
- public static final CacheType CACHE_TYPE_DEFAULT_TEST_VALUE = CacheType.weak;
- public static final Boolean SHARED_CACHE_DEFAULT_TEST_VALUE = Boolean.FALSE;
-
- public CachingValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.caching = this.subject.getCaching(); // Subject
- this.cachingHolder = new SimplePropertyValueModel<Caching>(this.caching);
-
- this.cacheTypeHolder = this.buildCacheTypeAA(this.cachingHolder);
- this.cacheTypeListener = this.buildCacheTypeChangeListener();
- this.cacheTypeHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.cacheTypeListener);
- this.cacheTypeEvent = null;
-
- this.sharedCacheHolder = this.buildSharedCacheAA(this.cachingHolder);
- this.sharedCacheListener = this.buildSharedCacheChangeListener();
- this.sharedCacheHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.sharedCacheListener);
- this.sharedCacheEvent = null;
-
- this.cacheTypeDefaultHolder = this.buildCacheTypeDefaultAA(this.cachingHolder);
- this.cacheTypeDefaultListener = this.buildCacheTypeDefaultChangeListener();
- this.cacheTypeDefaultHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.cacheTypeDefaultListener);
- this.cacheTypeDefaultEvent = null;
-
- this.sharedCacheDefaultHolder = this.buildSharedCacheDefaultAA(this.cachingHolder);
- this.sharedCacheDefaultListener = this.buildSharedCacheDefaultChangeListener();
- this.sharedCacheDefaultHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.sharedCacheDefaultListener);
- this.sharedCacheDefaultEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectCaching = (AbstractModel) this.caching; // Subject
- PropertyAspectAdapter<Caching, CacheType> cacheTypeAA =
- (PropertyAspectAdapter<Caching, CacheType>) this.cacheTypeHolder;
- assertTrue(cacheTypeAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCaching.hasAnyPropertyChangeListeners(Caching.CACHE_TYPE_PROPERTY));
-
- cacheTypeAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.cacheTypeListener);
- assertFalse(subjectCaching.hasAnyPropertyChangeListeners(Caching.CACHE_TYPE_PROPERTY));
- assertFalse(cacheTypeAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyAspectAdapter<Caching, Boolean> sharedCacheAA =
- (PropertyAspectAdapter<Caching, Boolean>) this.sharedCacheHolder;
- assertTrue(sharedCacheAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCaching.hasAnyPropertyChangeListeners(Caching.SHARED_CACHE_PROPERTY));
-
- sharedCacheAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.sharedCacheListener);
- assertFalse(subjectCaching.hasAnyPropertyChangeListeners(Caching.SHARED_CACHE_PROPERTY));
- assertFalse(sharedCacheAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyAspectAdapter<Caching, CacheType> cacheTypeDefaultAA =
- (PropertyAspectAdapter<Caching, CacheType>) this.cacheTypeDefaultHolder;
- assertTrue(cacheTypeDefaultAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCaching.hasAnyPropertyChangeListeners(Caching.CACHE_TYPE_DEFAULT_PROPERTY));
-
- cacheTypeDefaultAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.cacheTypeDefaultListener);
- assertFalse(subjectCaching.hasAnyPropertyChangeListeners(Caching.CACHE_TYPE_DEFAULT_PROPERTY));
- assertFalse(cacheTypeDefaultAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
-
- PropertyAspectAdapter<Caching, Boolean> sharedCacheDefaultAA =
- (PropertyAspectAdapter<Caching, Boolean>) this.sharedCacheDefaultHolder;
- assertTrue(sharedCacheDefaultAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCaching.hasAnyPropertyChangeListeners(Caching.SHARED_CACHE_DEFAULT_PROPERTY));
-
- sharedCacheDefaultAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.sharedCacheDefaultListener);
- assertFalse(subjectCaching.hasAnyPropertyChangeListeners(Caching.SHARED_CACHE_DEFAULT_PROPERTY));
- assertFalse(sharedCacheDefaultAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- Caching.ECLIPSELINK_CACHE_TYPE + ENTITY_NAME_TEST_VALUE,
- CACHE_TYPE_TEST_VALUE);
- this.persistenceUnitSetProperty(
- Caching.ECLIPSELINK_SHARED_CACHE + ENTITY_NAME_TEST_VALUE,
- SHARED_CACHE_TEST_VALUE);
- this.persistenceUnitSetProperty(
- Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT,
- CACHE_TYPE_DEFAULT_TEST_VALUE);
- this.persistenceUnitSetProperty(
- Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT,
- SHARED_CACHE_DEFAULT_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.caching;
- }
-
- /** ****** CacheType ******* */
- private ModifiablePropertyValueModel<CacheType> buildCacheTypeAA(PropertyValueModel<Caching> subjectHolder) {
- return new PropertyAspectAdapter<Caching, CacheType>(subjectHolder, Caching.CACHE_TYPE_PROPERTY) {
- @Override
- protected CacheType buildValue_() {
- return this.subject.getCacheTypeOf(ENTITY_NAME_TEST_VALUE);
- }
-
- @Override
- protected void setValue_(CacheType enumValue) {
- this.subject.setCacheTypeOf(ENTITY_NAME_TEST_VALUE, enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildCacheTypeChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingValueModelTests.this.cacheTypeEvent = e;
- }
- };
- }
-
- /** ****** SharedCache ******* */
- private ModifiablePropertyValueModel<Boolean> buildSharedCacheAA(PropertyValueModel<Caching> subjectHolder) {
- return new PropertyAspectAdapter<Caching, Boolean>(subjectHolder, Caching.SHARED_CACHE_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSharedCacheOf(ENTITY_NAME_TEST_VALUE);
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setSharedCacheOf(ENTITY_NAME_TEST_VALUE, enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildSharedCacheChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingValueModelTests.this.sharedCacheEvent = e;
- }
- };
- }
-
- /** ****** CacheTypeDefault ******* */
- private ModifiablePropertyValueModel<CacheType> buildCacheTypeDefaultAA(PropertyValueModel<Caching> subjectHolder) {
- return new PropertyAspectAdapter<Caching, CacheType>(subjectHolder, Caching.CACHE_TYPE_DEFAULT_PROPERTY) {
- @Override
- protected CacheType buildValue_() {
- return this.subject.getCacheTypeDefault();
- }
-
- @Override
- protected void setValue_(CacheType enumValue) {
- this.subject.setCacheTypeDefault(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildCacheTypeDefaultChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingValueModelTests.this.cacheTypeDefaultEvent = e;
- }
- };
- }
-
- /** ****** SharedCacheDefault ******* */
- private ModifiablePropertyValueModel<Boolean> buildSharedCacheDefaultAA(PropertyValueModel<Caching> subjectHolder) {
- return new PropertyAspectAdapter<Caching, Boolean>(subjectHolder, Caching.SHARED_CACHE_DEFAULT_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getSharedCacheDefault();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setSharedCacheDefault(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildSharedCacheDefaultChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CachingValueModelTests.this.sharedCacheDefaultEvent = e;
- }
- };
- }
-
- /** ****** Basic Entity's Properties Tests ******* */
-
- public void testClone() {
- CachingEntity entity = this.buildEntity("TestEntity", CacheType.full, 100, true);
-
- this.verifyClone(entity, entity.clone());
- }
-
- public void testEquals() {
- CachingEntity entity1 = this.buildEntity("TestEntityA", CacheType.full, 100, true);
- CachingEntity entity2 = this.buildEntity("TestEntityB", CacheType.full, 100, true);
- assertEquals(entity1, entity2);
- CachingEntity entity3 = this.buildEntity("TestEntityC", CacheType.full, 100, true);
- assertEquals(entity1, entity3);
- assertEquals(entity2, entity3);
- }
-
- public void testIsEmpty() {
- CachingEntity entity = this.buildEntity("TestEntity");
- assertTrue(entity.isEmpty());
- this.caching.setCacheSizeOf(entity.getName(), 100);
- assertFalse(entity.isEmpty());
- }
-
- private void verifyClone(CachingEntity original, CachingEntity clone) {
- assertNotSame(original, clone);
- assertEquals(original, original);
- assertEquals(original, clone);
- }
-
- private CachingEntity buildEntity(String name) {
- return this.caching.addEntity(name);
- }
-
- private CachingEntity buildEntity(String name, CacheType cacheType, Integer size, Boolean isShared) {
- CachingEntity entity = this.caching.addEntity(name);
- this.caching.setCacheTypeOf(entity.getName(), cacheType);
- this.caching.setCacheSizeOf(entity.getName(), size);
- this.caching.setSharedCacheOf(entity.getName(), isShared);
- return entity;
- }
-
- /** ****** Caching Tests ******* */
- public void testValue() {
- /** ****** CacheType - defaults for entity level caching are equal to the persistence unit settings ******* */
- this.verifyCacheTypeAAValue(CACHE_TYPE_TEST_VALUE);
- assertEquals(this.caching.getCacheTypeDefault(), this.caching.getDefaultCacheType());
- /** ****** SharedCache - defaults for entity level caching are equal to the persistence unit settings ******* */
- this.verifySharedCacheAAValue(SHARED_CACHE_TEST_VALUE);
- assertEquals(this.caching.getSharedCacheDefault(), this.caching.getDefaultSharedCache());
- /** ****** CacheTypeDefault ******* */
- this.verifyCacheTypeDefaultAAValue(CACHE_TYPE_DEFAULT_TEST_VALUE);
- assertEquals(Caching.DEFAULT_CACHE_TYPE_DEFAULT, this.caching.getDefaultCacheTypeDefault());
- /** ****** SharedCacheDefault ******* */
- this.verifySharedCacheDefaultAAValue(SHARED_CACHE_DEFAULT_TEST_VALUE);
- assertEquals(Caching.DEFAULT_SHARED_CACHE_DEFAULT, this.caching.getDefaultSharedCacheDefault());
- }
-
- public void testSetValue() throws Exception {
- /** ****** CacheType ******* */
- this.cacheTypeEvent = null;
- this.verifyHasListeners(this.cacheTypeHolder, PropertyValueModel.VALUE);
- CacheType newCacheType = CacheType.full;
- // Modify the property holder
- this.cacheTypeHolder.setValue(newCacheType);
- this.verifyCacheTypeAAValue(newCacheType);
- assertNotNull(this.cacheTypeEvent);
- /** ****** SharedCache ******* */
- this.sharedCacheEvent = null;
- this.verifyHasListeners(this.sharedCacheHolder, PropertyValueModel.VALUE);
- Boolean newSharedCache = !SHARED_CACHE_TEST_VALUE;
- // Modify the property holder
- this.sharedCacheHolder.setValue(newSharedCache);
- this.verifySharedCacheAAValue(newSharedCache);
- assertNotNull(this.sharedCacheEvent);
- /** ****** CacheTypeDefault ******* */
- this.cacheTypeDefaultEvent = null;
- this.verifyHasListeners(this.cacheTypeDefaultHolder, PropertyValueModel.VALUE);
- CacheType newCacheTypeDefault = CacheType.none;
- // Modify the property holder
- this.cacheTypeDefaultHolder.setValue(newCacheTypeDefault);
- this.verifyCacheTypeDefaultAAValue(newCacheTypeDefault);
- assertNotNull(this.cacheTypeDefaultEvent);
- /** ****** SharedCacheDefault ******* */
- this.sharedCacheDefaultEvent = null;
- this.verifyHasListeners(this.sharedCacheDefaultHolder, PropertyValueModel.VALUE);
- Boolean newSharedCacheDefault = !SHARED_CACHE_DEFAULT_TEST_VALUE;
- // Modify the property holder
- this.sharedCacheDefaultHolder.setValue(newSharedCacheDefault);
- this.verifySharedCacheDefaultAAValue(newSharedCacheDefault);
- assertNotNull(this.sharedCacheDefaultEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- /** ****** CacheType ******* */
- this.cacheTypeEvent = null;
- // Setting the property holder
- this.cacheTypeHolder.setValue(null);
- // testing Holder
- this.verifyCacheTypeAAValue(null);
- assertNotNull(this.cacheTypeEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Caching.ECLIPSELINK_CACHE_TYPE + ENTITY_NAME_TEST_VALUE, notDeleted);
- /** ****** SharedCache ******* */
- this.sharedCacheEvent = null;
- // Setting the property holder
- this.sharedCacheHolder.setValue(null);
- // testing Holder
- this.verifySharedCacheAAValue(null);
- assertNotNull(this.sharedCacheEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Caching.ECLIPSELINK_SHARED_CACHE + ENTITY_NAME_TEST_VALUE, notDeleted);
- /** ****** CacheTypeDefault ******* */
- this.cacheTypeDefaultEvent = null;
- // Setting the property holder
- this.cacheTypeDefaultHolder.setValue(null);
- // testing Holder
- this.verifyCacheTypeDefaultAAValue(null);
- assertNotNull(this.cacheTypeDefaultEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT, notDeleted);
- /** ****** SharedCacheDefault ******* */
- this.sharedCacheDefaultEvent = null;
- // Setting the property holder
- this.sharedCacheDefaultHolder.setValue(null);
- // testing Holder
- this.verifySharedCacheDefaultAAValue(null);
- assertNotNull(this.sharedCacheDefaultEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT, notDeleted);
- }
-
- /** ****** convenience methods ******* */
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyCacheTypeAAValue(CacheType testValue) {
- this.verifyAAValue(
- testValue,
- this.caching.getCacheTypeOf(ENTITY_NAME_TEST_VALUE),
- this.cacheTypeHolder,
- Caching.ECLIPSELINK_CACHE_TYPE + ENTITY_NAME_TEST_VALUE);
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifySharedCacheAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.caching.getSharedCacheOf(ENTITY_NAME_TEST_VALUE),
- this.sharedCacheHolder,
- Caching.ECLIPSELINK_SHARED_CACHE + ENTITY_NAME_TEST_VALUE);
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyCacheTypeDefaultAAValue(CacheType testValue) {
- this.verifyAAValue(
- testValue,
- this.caching.getCacheTypeDefault(),
- this.cacheTypeDefaultHolder,
- Caching.ECLIPSELINK_CACHE_TYPE_DEFAULT);
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifySharedCacheDefaultAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.caching.getSharedCacheDefault(),
- this.sharedCacheDefaultHolder,
- Caching.ECLIPSELINK_CACHE_SHARED_DEFAULT);
- }
-
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CustomizationValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CustomizationValueModelTests.java
deleted file mode 100644
index b8186eedc4..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/CustomizationValueModelTests.java
+++ /dev/null
@@ -1,204 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CustomizationEntity;
-
-/**
- * CustomizationValueModelTests
- */
-@SuppressWarnings("nls")
-public class CustomizationValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Customization customization;
-
- private ModifiablePropertyValueModel<Boolean> throwExceptionsHolder;
- private PropertyChangeListener throwExceptionsListener;
- private PropertyChangeEvent throwExceptionsEvent;
-
- public static final String ENTITY_NAME_TEST_VALUE = "Employee";
- public static final Boolean THROW_EXCEPTIONS_TEST_VALUE = Boolean.FALSE;
- public static final String CUSTOMIZER_TEST_VALUE = "acme.sessions.Customizer";
-
- public CustomizationValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.customization = this.subject.getCustomization(); // Subject
- PropertyValueModel<Customization> customizationHolder = new SimplePropertyValueModel<Customization>(this.customization);
-
- this.throwExceptionsHolder = this.buildThrowExceptionsAA(customizationHolder);
- this.throwExceptionsListener = this.buildThrowExceptionsChangeListener();
- this.throwExceptionsHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.throwExceptionsListener);
- this.throwExceptionsEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectCustomization = (AbstractModel) this.customization; // Subject
-
- PropertyAspectAdapter<Customization, Boolean> throwExceptionsAA =
- (PropertyAspectAdapter<Customization, Boolean>) this.throwExceptionsHolder;
- assertTrue(throwExceptionsAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectCustomization.hasAnyPropertyChangeListeners(Customization.THROW_EXCEPTIONS_PROPERTY));
-
- throwExceptionsAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.throwExceptionsListener);
- assertFalse(subjectCustomization.hasAnyPropertyChangeListeners(Customization.THROW_EXCEPTIONS_PROPERTY));
- assertFalse(throwExceptionsAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- Customization.ECLIPSELINK_THROW_EXCEPTIONS,
- THROW_EXCEPTIONS_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.customization;
- }
-
- // ****** ThrowExceptions *******
- private ModifiablePropertyValueModel<Boolean> buildThrowExceptionsAA(PropertyValueModel<Customization> subjectHolder) {
- return new PropertyAspectAdapter<Customization, Boolean>(subjectHolder, Customization.THROW_EXCEPTIONS_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getThrowExceptions();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setThrowExceptions(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildThrowExceptionsChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- CustomizationValueModelTests.this.throwExceptionsEvent = e;
- }
- };
- }
-
- /** ****** Basic Entity's Properties Tests ******* */
-
- public void testClone() {
- CustomizationEntity entity = this.buildEntity("TestEntity", CUSTOMIZER_TEST_VALUE);
-
- this.verifyClone(entity, entity.clone());
- }
-
- public void testEquals() {
- CustomizationEntity entity1 = this.buildEntity("TestEntityA", CUSTOMIZER_TEST_VALUE);
- CustomizationEntity entity2 = this.buildEntity("TestEntityB", CUSTOMIZER_TEST_VALUE);
- assertEquals(entity1, entity2);
- CustomizationEntity entity3 = this.buildEntity("TestEntityC", CUSTOMIZER_TEST_VALUE);
- assertEquals(entity1, entity3);
- assertEquals(entity2, entity3);
- }
-
- public void testIsEmpty() {
- CustomizationEntity entity = this.buildEntity("TestEntity");
- assertTrue(entity.isEmpty());
- this.customization.setDescriptorCustomizerOf(entity.getName(), CUSTOMIZER_TEST_VALUE);
- assertFalse(entity.isEmpty());
- }
-
- private void verifyClone(CustomizationEntity original, CustomizationEntity clone) {
- assertNotSame(original, clone);
- assertEquals(original, original);
- assertEquals(original, clone);
- }
-
- private CustomizationEntity buildEntity(String name) {
- return this.customization.addEntity(name);
- }
-
- private CustomizationEntity buildEntity(String name, String aClassName) {
- CustomizationEntity entity = this.customization.addEntity(name);
- this.customization.setDescriptorCustomizerOf(entity.getName(), aClassName);
- return entity;
- }
-
- // ****** Tests *******
- public void testValue() {
- // ****** ThrowExceptions *******
- this.verifyThrowExceptionsAAValue(THROW_EXCEPTIONS_TEST_VALUE);
- assertEquals(Customization.DEFAULT_THROW_EXCEPTIONS, this.customization.getDefaultThrowExceptions());
- }
-
- public void testSetValue() throws Exception {
- // ****** ThrowExceptions *******
- this.throwExceptionsEvent = null;
- this.verifyHasListeners(this.throwExceptionsHolder, PropertyValueModel.VALUE);
- Boolean newThrowExceptions = !THROW_EXCEPTIONS_TEST_VALUE;
- // Modify the property holder
- this.throwExceptionsHolder.setValue(newThrowExceptions);
- this.verifyThrowExceptionsAAValue(newThrowExceptions);
- assertNotNull(this.throwExceptionsEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- // ****** ThrowExceptions *******
- this.throwExceptionsEvent = null;
- // Setting the property holder
- this.throwExceptionsHolder.setValue(null);
- // testing Holder
- this.verifyThrowExceptionsAAValue(null);
- assertNotNull(this.throwExceptionsEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Customization.ECLIPSELINK_THROW_EXCEPTIONS, notDeleted);
- }
-
- // ****** convenience methods *******
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyThrowExceptionsAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.customization.getThrowExceptions(),
- this.throwExceptionsHolder,
- Customization.ECLIPSELINK_THROW_EXCEPTIONS);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java
deleted file mode 100644
index 1b9dea60c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0ConnectionTests.java
+++ /dev/null
@@ -1,173 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.jpa2.context.persistence.connection.JpaConnection2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection2_0;
-
-/**
- * EclipseLink2_0ConnectionTests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0ConnectionTests extends EclipseLink2_0PersistenceUnitTestCase
-{
- private Connection2_0 connection;
-
- public static final String NATIVE_SQL_KEY = Connection.ECLIPSELINK_NATIVE_SQL;
- public static final Boolean NATIVE_SQL_TEST_VALUE = false;
- public static final Boolean NATIVE_SQL_TEST_VALUE_2 = ! NATIVE_SQL_TEST_VALUE;
-
- public static final String DRIVER_KEY = JpaConnection2_0.PERSISTENCE_JDBC_DRIVER;
- public static final String DRIVER_TEST_VALUE = "connection.driver";
- public static final String DRIVER_TEST_VALUE_2 = "connection.driver.2";
- public static final String LEGACY_DRIVER_KEY = Connection.ECLIPSELINK_DRIVER;
- public static final String LEGACY_DRIVER_TEST_VALUE = "legacy.connection.driver";
-
- public static final String URL_KEY = JpaConnection2_0.PERSISTENCE_JDBC_URL;
- public static final String URL_TEST_VALUE = "test";
- public static final String URL_TEST_VALUE_2 = "test_2";
- public static final String LEGACY_URL_KEY = Connection.ECLIPSELINK_URL;
- public static final String LEGACY_URL_TEST_VALUE = "legacy.connection.url";
-
- public static final String USER_KEY = JpaConnection2_0.PERSISTENCE_JDBC_USER;
- public static final String USER_TEST_VALUE = "test";
- public static final String USER_TEST_VALUE_2 = "test_2";
- public static final String LEGACY_USER_KEY = Connection.ECLIPSELINK_USER;
- public static final String LEGACY_USER_TEST_VALUE = "legacy.connection.user";
-
- public static final String PASSWORD_KEY = JpaConnection2_0.PERSISTENCE_JDBC_PASSWORD;
- public static final String PASSWORD_TEST_VALUE = "test";
- public static final String PASSWORD_TEST_VALUE_2 = "test_2";
- public static final String LEGACY_PASSWORD_KEY = Connection.ECLIPSELINK_PASSWORD;
- public static final String LEGACY_PASSWORD_TEST_VALUE = "legacy.connection.password";
-
- public EclipseLink2_0ConnectionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.connection = (Connection2_0) this.subject.getConnection();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.connection.addPropertyChangeListener(Connection.DRIVER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.URL_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.USER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.PASSWORD_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 8; // EclipseLink properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes EclipseLink properties
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(LEGACY_DRIVER_KEY, LEGACY_DRIVER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(DRIVER_KEY, DRIVER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(LEGACY_URL_KEY, LEGACY_URL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(URL_KEY, URL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(LEGACY_USER_KEY, LEGACY_USER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(USER_KEY, USER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(LEGACY_PASSWORD_KEY, LEGACY_PASSWORD_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(PASSWORD_KEY, PASSWORD_TEST_VALUE.toString());
-
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.connection;
- }
-
- // ********** get/set property **********
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
-
- if (propertyName.equals(Connection.DRIVER_PROPERTY))
- modelValue = this.connection.getDriver();
- else if (propertyName.equals(Connection.URL_PROPERTY))
- modelValue = this.connection.getUrl();
- else if (propertyName.equals(Connection.USER_PROPERTY))
- modelValue = this.connection.getUser();
- else if (propertyName.equals(Connection.PASSWORD_PROPERTY))
- modelValue = this.connection.getPassword();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Connection.DRIVER_PROPERTY))
- this.connection.setDriver((String) newValue);
- else if (propertyName.equals(Connection.URL_PROPERTY))
- this.connection.setUrl((String) newValue);
- else if (propertyName.equals(Connection.USER_PROPERTY))
- this.connection.setUser((String) newValue);
- else if (propertyName.equals(Connection.PASSWORD_PROPERTY))
- this.connection.setPassword((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
-
- // ********** Properties Name Migration tests **********
- public void testDriverPropertyNameMigration() throws Exception {
-
- // Verify legacy driver exists
- assertTrue("Legacy driver not exists", this.propertyValueEquals(LEGACY_DRIVER_KEY, LEGACY_DRIVER_TEST_VALUE));
-
- // Verify driver read in
- assertEquals("Incorrect driver read", this.connection.getDriver(), DRIVER_TEST_VALUE);
-
- // Change driver value
- this.connection.setDriver(DRIVER_TEST_VALUE_2);
- // Verify driver value changed
- assertEquals("Driver not set", this.connection.getDriver(), DRIVER_TEST_VALUE_2);
- assertTrue("PersistenceUnit property not set", this.propertyValueEquals(DRIVER_KEY, DRIVER_TEST_VALUE_2));
-
- // Verify legacy entry has been deleted
- this.verifyPuHasNotProperty(LEGACY_DRIVER_KEY, "Legacy property has not been deleted");
- }
-
- public void testPropertiesNamesMigration() throws Exception {
- // connection.initializeProperties() occurred before test.puPopulate() therefore
- // we cannot test the case where there are legacy properties only exist in the xml
- // Verify that User & Password exist in both forms
- this.verifyPuHasProperty(USER_KEY, "Property not exists");
- this.verifyPuHasProperty(PASSWORD_KEY, "Property not exists");
- this.verifyPuHasProperty(LEGACY_USER_KEY, "Legacy property not exists");
- this.verifyPuHasProperty(LEGACY_PASSWORD_KEY, "Legacy property not exists");
-
- // Change a property value to trigger migration routine
- this.connection.setNativeSql(NATIVE_SQL_TEST_VALUE);
-
- // Verify that all legacy entry has been deleted
- this.verifyPuHasNotProperty(LEGACY_DRIVER_KEY, "Legacy property has not been deleted");
- this.verifyPuHasNotProperty(LEGACY_URL_KEY, "Legacy property has not been deleted");
- this.verifyPuHasNotProperty(LEGACY_USER_KEY, "Legacy property has not been deleted");
- this.verifyPuHasNotProperty(LEGACY_PASSWORD_KEY, "Legacy property has not been deleted");
- }
-
-
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java
deleted file mode 100644
index 48a59dde32..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0LoggingTests.java
+++ /dev/null
@@ -1,431 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging2_0;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-
-/**
- * EclipseLink2_0LoggingTests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0LoggingTests extends EclipseLink2_0PersistenceUnitTestCase
-{
- private Logging2_0 logging;
-
- public static final String SQL_LOGGING_KEY = Logging2_0.ECLIPSELINK_SQL_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel SQL_LOGGING_TEST_VALUE = LoggingLevel.off;
- public static final LoggingLevel SQL_LOGGING_TEST_VALUE_2 = LoggingLevel.severe;
-
- public static final String TRANSACTION_LOGGING_KEY = Logging2_0.ECLIPSELINK_TRANSACTION_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel TRANSACTION_LOGGING_TEST_VALUE = LoggingLevel.warning;
- public static final LoggingLevel TRANSACTION_LOGGING_TEST_VALUE_2 = LoggingLevel.info;
-
- public static final String EVENT_LOGGING_KEY = Logging2_0.ECLIPSELINK_EVENT_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel EVENT_LOGGING_TEST_VALUE = LoggingLevel.config;
- public static final LoggingLevel EVENT_LOGGING_TEST_VALUE_2 = LoggingLevel.fine;
-
- public static final String CONNECTION_LOGGING_KEY = Logging2_0.ECLIPSELINK_CONNECTION_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel CONNECTION_LOGGING_TEST_VALUE = LoggingLevel.finer;
- public static final LoggingLevel CONNECTION_LOGGING_TEST_VALUE_2 = LoggingLevel.finest;
-
- public static final String QUERY_LOGGING_KEY = Logging2_0.ECLIPSELINK_QUERY_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel QUERY_LOGGING_TEST_VALUE = LoggingLevel.all;
- public static final LoggingLevel QUERY_LOGGING_TEST_VALUE_2 = LoggingLevel.off;
-
- public static final String CACHE_LOGGING_KEY = Logging2_0.ECLIPSELINK_CACHE_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel CACHE_LOGGING_TEST_VALUE = LoggingLevel.severe;
- public static final LoggingLevel CACHE_LOGGING_TEST_VALUE_2 = LoggingLevel.warning;
-
- public static final String PROPAGATION_LOGGING_KEY = Logging2_0.ECLIPSELINK_PROPAGATION_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel PROPAGATION_LOGGING_TEST_VALUE = LoggingLevel.info;
- public static final LoggingLevel PROPAGATION_LOGGING_TEST_VALUE_2 = LoggingLevel.config;
-
- public static final String SEQUENCING_LOGGING_KEY = Logging2_0.ECLIPSELINK_SEQUENCING_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel SEQUENCING_LOGGING_TEST_VALUE = LoggingLevel.fine;
- public static final LoggingLevel SEQUENCING_LOGGING_TEST_VALUE_2 = LoggingLevel.finer;
-
- public static final String EJB_LOGGING_KEY = Logging2_0.ECLIPSELINK_EJB_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel EJB_LOGGING_TEST_VALUE = LoggingLevel.finest;
- public static final LoggingLevel EJB_LOGGING_TEST_VALUE_2 = LoggingLevel.all;
-
- public static final String DMS_LOGGING_KEY = Logging2_0.ECLIPSELINK_DMS_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel DMS_LOGGING_TEST_VALUE = LoggingLevel.off;
- public static final LoggingLevel DMS_LOGGING_TEST_VALUE_2 = LoggingLevel.severe;
-
- public static final String EJB_OR_METADATA_LOGGING_KEY = Logging2_0.ECLIPSELINK_EJB_OR_METADATA_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel EJB_OR_METADATA_LOGGING_TEST_VALUE = LoggingLevel.warning;
- public static final LoggingLevel EJB_OR_METADATA_LOGGING_TEST_VALUE_2 = LoggingLevel.info;
-
- public static final String METAMODEL_LOGGING_KEY = Logging2_0.ECLIPSELINK_METAMODEL_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel METAMODEL_LOGGING_TEST_VALUE = LoggingLevel.config;
- public static final LoggingLevel METAMODEL_LOGGING_TEST_VALUE_2 = LoggingLevel.fine;
-
- public static final String WEAVER_LOGGING_KEY = Logging2_0.ECLIPSELINK_WEAVER_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel WEAVER_LOGGING_TEST_VALUE = LoggingLevel.finer;
- public static final LoggingLevel WEAVER_LOGGING_TEST_VALUE_2 = LoggingLevel.finest;
-
- public static final String PROPERTIES_LOGGING_KEY = Logging2_0.ECLIPSELINK_PROPERTIES_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel PROPERTIES_LOGGING_TEST_VALUE = LoggingLevel.all;
- public static final LoggingLevel PROPERTIES_LOGGING_TEST_VALUE_2 = LoggingLevel.off;
-
- public static final String SERVER_LOGGING_KEY = Logging2_0.ECLIPSELINK_SERVER_CATEGORY_LOGGING_LEVEL;
- public static final LoggingLevel SERVER_LOGGING_TEST_VALUE = LoggingLevel.severe;
- public static final LoggingLevel SERVER_LOGGING_TEST_VALUE_2 = LoggingLevel.warning;
-
- // ********** constructors **********
- public EclipseLink2_0LoggingTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.logging = (Logging2_0) this.subject.getLogging();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.logging.addPropertyChangeListener(Logging2_0.SQL_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.TRANSACTION_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.EVENT_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.CONNECTION_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.QUERY_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.CACHE_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.PROPAGATION_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.SEQUENCING_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.EJB_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.DMS_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.EJB_OR_METADATA_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.METAMODEL_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.WEAVER_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.PROPERTIES_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging2_0.SERVER_CATEGORY_LOGGING_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PersistenceUnit properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 15; // PersistenceUnit properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 1 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes PersistenceUnit properties
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(SQL_LOGGING_KEY, SQL_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(TRANSACTION_LOGGING_KEY, TRANSACTION_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(EVENT_LOGGING_KEY, EVENT_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(CONNECTION_LOGGING_KEY, CONNECTION_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(QUERY_LOGGING_KEY, QUERY_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(CACHE_LOGGING_KEY, CACHE_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(PROPAGATION_LOGGING_KEY, PROPAGATION_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(SEQUENCING_LOGGING_KEY, SEQUENCING_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(EJB_LOGGING_KEY, EJB_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(DMS_LOGGING_KEY, DMS_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(EJB_OR_METADATA_LOGGING_KEY, EJB_OR_METADATA_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(METAMODEL_LOGGING_KEY, METAMODEL_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(WEAVER_LOGGING_KEY, WEAVER_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(PROPERTIES_LOGGING_KEY, PROPERTIES_LOGGING_TEST_VALUE);
- this.persistenceUnitSetProperty(SERVER_LOGGING_KEY, SERVER_LOGGING_TEST_VALUE);
-
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.logging;
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
-
- return this.logging.getLevel(propertyName);
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
-
- this.logging.setLevel(propertyName, (LoggingLevel) newValue);
- }
-
- // ********** Sql Level tests **********
- public void testSetSqlLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- SQL_LOGGING_KEY,
- SQL_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- SQL_LOGGING_KEY,
- SQL_LOGGING_TEST_VALUE,
- SQL_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveSqlLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- SQL_LOGGING_KEY,
- SQL_LOGGING_TEST_VALUE,
- SQL_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Transaction Level tests **********
- public void testSetTransactionLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- TRANSACTION_LOGGING_KEY,
- TRANSACTION_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- TRANSACTION_LOGGING_KEY,
- TRANSACTION_LOGGING_TEST_VALUE,
- TRANSACTION_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveTransactionLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- TRANSACTION_LOGGING_KEY,
- TRANSACTION_LOGGING_TEST_VALUE,
- TRANSACTION_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Event Level tests **********
- public void testSetEventLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- EVENT_LOGGING_KEY,
- EVENT_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- EVENT_LOGGING_KEY,
- EVENT_LOGGING_TEST_VALUE,
- EVENT_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveEventLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- EVENT_LOGGING_KEY,
- EVENT_LOGGING_TEST_VALUE,
- EVENT_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Connection Level tests **********
- public void testSetConnectionLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- CONNECTION_LOGGING_KEY,
- CONNECTION_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- CONNECTION_LOGGING_KEY,
- CONNECTION_LOGGING_TEST_VALUE,
- CONNECTION_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveConnectionLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- CONNECTION_LOGGING_KEY,
- CONNECTION_LOGGING_TEST_VALUE,
- CONNECTION_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Query Level tests **********
- public void testSetQueryLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- QUERY_LOGGING_KEY,
- QUERY_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- QUERY_LOGGING_KEY,
- QUERY_LOGGING_TEST_VALUE,
- QUERY_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveQueryLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- QUERY_LOGGING_KEY,
- QUERY_LOGGING_TEST_VALUE,
- QUERY_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Cache Level tests **********
- public void testSetCacheLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- CACHE_LOGGING_KEY,
- CACHE_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- CACHE_LOGGING_KEY,
- CACHE_LOGGING_TEST_VALUE,
- CACHE_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_LOGGING_KEY,
- CACHE_LOGGING_TEST_VALUE,
- CACHE_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Propagation Level tests **********
- public void testSetPropagationLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- PROPAGATION_LOGGING_KEY,
- PROPAGATION_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- PROPAGATION_LOGGING_KEY,
- PROPAGATION_LOGGING_TEST_VALUE,
- PROPAGATION_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemovePropagationLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- PROPAGATION_LOGGING_KEY,
- PROPAGATION_LOGGING_TEST_VALUE,
- PROPAGATION_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Sequencing Level tests **********
- public void testSetSequencingLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- SEQUENCING_LOGGING_KEY,
- SEQUENCING_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- SEQUENCING_LOGGING_KEY,
- SEQUENCING_LOGGING_TEST_VALUE,
- SEQUENCING_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveSequencingLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- SEQUENCING_LOGGING_KEY,
- SEQUENCING_LOGGING_TEST_VALUE,
- SEQUENCING_LOGGING_TEST_VALUE_2);
- }
-
- // ********** EJB Level tests **********
- public void testSetEJBLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- EJB_LOGGING_KEY,
- EJB_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- EJB_LOGGING_KEY,
- EJB_LOGGING_TEST_VALUE,
- EJB_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveEJBLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- EJB_LOGGING_KEY,
- EJB_LOGGING_TEST_VALUE,
- EJB_LOGGING_TEST_VALUE_2);
- }
-
- // ********** DMS Level tests **********
- public void testSetDMSLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- DMS_LOGGING_KEY,
- DMS_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- DMS_LOGGING_KEY,
- DMS_LOGGING_TEST_VALUE,
- DMS_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveDMSLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- DMS_LOGGING_KEY,
- DMS_LOGGING_TEST_VALUE,
- DMS_LOGGING_TEST_VALUE_2);
- }
-
- // ********** EJB or Metadata Level tests **********
- public void testSetEJBOrMetadataLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- EJB_OR_METADATA_LOGGING_KEY,
- EJB_OR_METADATA_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- EJB_OR_METADATA_LOGGING_KEY,
- EJB_OR_METADATA_LOGGING_TEST_VALUE,
- EJB_OR_METADATA_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveEJBOrMetadataLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- EJB_OR_METADATA_LOGGING_KEY,
- EJB_OR_METADATA_LOGGING_TEST_VALUE,
- EJB_OR_METADATA_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Metamodel Level tests **********
- public void testSetMetamodelLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- METAMODEL_LOGGING_KEY,
- METAMODEL_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- METAMODEL_LOGGING_KEY,
- METAMODEL_LOGGING_TEST_VALUE,
- METAMODEL_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveMetamodelLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- METAMODEL_LOGGING_KEY,
- METAMODEL_LOGGING_TEST_VALUE,
- METAMODEL_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Weaver Level tests **********
- public void testSetWeaverLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- WEAVER_LOGGING_KEY,
- WEAVER_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- WEAVER_LOGGING_KEY,
- WEAVER_LOGGING_TEST_VALUE,
- WEAVER_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeaverLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVER_LOGGING_KEY,
- WEAVER_LOGGING_TEST_VALUE,
- WEAVER_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Properties Level tests **********
- public void testSetPropertiesLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- PROPERTIES_LOGGING_KEY,
- PROPERTIES_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- PROPERTIES_LOGGING_KEY,
- PROPERTIES_LOGGING_TEST_VALUE,
- PROPERTIES_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemovePropertiesLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- PROPERTIES_LOGGING_KEY,
- PROPERTIES_LOGGING_TEST_VALUE,
- PROPERTIES_LOGGING_TEST_VALUE_2);
- }
-
- // ********** Server Level tests **********
- public void testSetServerLoggingLevel() throws Exception {
- this.verifyModelInitialized(
- SERVER_LOGGING_KEY,
- SERVER_LOGGING_TEST_VALUE);
- this.verifySetProperty(
- SERVER_LOGGING_KEY,
- SERVER_LOGGING_TEST_VALUE,
- SERVER_LOGGING_TEST_VALUE_2);
- }
-
- public void testAddRemoveServerLoggingLevel() throws Exception {
- this.verifyAddRemoveProperty(
- SERVER_LOGGING_KEY,
- SERVER_LOGGING_TEST_VALUE,
- SERVER_LOGGING_TEST_VALUE_2);
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java
deleted file mode 100644
index 3c724aee0b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0OptionsTests.java
+++ /dev/null
@@ -1,519 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2009, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options2_0;
-
-/**
- * EclipseLinkOptions2_0Tests
- */
-@SuppressWarnings("nls")
-public class EclipseLink2_0OptionsTests extends EclipseLink2_0PersistenceUnitTestCase
-{
- private Options2_0 options;
- private ListChangeEvent prePersistEvent;
- private ListChangeEvent preUpdateEvent;
- private ListChangeEvent preRemoveEvent;
-
- public static final String LOCK_TIMEOUT_KEY = Options2_0.PERSISTENCE_LOCK_TIMEOUT;
- public static final Integer LOCK_TIMEOUT_TEST_VALUE = 100;
- public static final Integer LOCK_TIMEOUT_TEST_VALUE_2 = 200;
-
- public static final String QUERY_TIMEOUT_KEY = Options2_0.PERSISTENCE_QUERY_TIMEOUT;
- public static final Integer QUERY_TIMEOUT_TEST_VALUE = 100;
- public static final Integer QUERY_TIMEOUT_TEST_VALUE_2 = 200;
-
- public static final String VALIDATION_GROUP_PRE_PERSIST_KEY = Options2_0.PERSISTENCE_VALIDATION_GROUP_PRE_PERSIST;
- public static final String VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE = "test_pre-persist_group";
- public static final String VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2 = "test_2_pre-persist_group";
-
- public static final String VALIDATION_GROUP_PRE_UPDATE_KEY = Options2_0.PERSISTENCE_VALIDATION_GROUP_PRE_UPDATE;
- public static final String VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE = "test_pre-update_group";
- public static final String VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2 = "test_2_pre-update_group";
-
- public static final String VALIDATION_GROUP_PRE_REMOVE_KEY = Options2_0.PERSISTENCE_VALIDATION_GROUP_PRE_REMOVE;
- public static final String VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE = "test_pre-remove_group";
- public static final String VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2 = "test_2_pre-remove_group";
-
- // ********** constructors **********
- public EclipseLink2_0OptionsTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.options = (Options2_0) this.subject.getOptions();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.options.addPropertyChangeListener(Options2_0.LOCK_TIMEOUT_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options2_0.QUERY_TIMEOUT_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY, propertyChangeListener);
-
- ListChangeListener validationGroupListChangeListener = this.buildValidationGroupListChangeListener();
- this.options.addListChangeListener(Options2_0.VALIDATION_GROUP_PRE_PERSIST_LIST, validationGroupListChangeListener);
- this.options.addListChangeListener(Options2_0.VALIDATION_GROUP_PRE_UPDATE_LIST, validationGroupListChangeListener);
- this.options.addListChangeListener(Options2_0.VALIDATION_GROUP_PRE_REMOVE_LIST, validationGroupListChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PersistenceUnit properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 5; // PersistenceUnit properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 1; // 1 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes PersistenceUnit properties
- this.persistenceUnitSetProperty(LOCK_TIMEOUT_KEY, LOCK_TIMEOUT_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(QUERY_TIMEOUT_KEY, QUERY_TIMEOUT_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
-
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_PERSIST_KEY, VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE);
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_UPDATE_KEY, VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE);
- this.persistenceUnitSetProperty(VALIDATION_GROUP_PRE_REMOVE_KEY, VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.options;
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Options2_0.LOCK_TIMEOUT_PROPERTY))
- modelValue = this.options.getLockTimeout();
- else if (propertyName.equals(Options2_0.QUERY_TIMEOUT_PROPERTY))
- modelValue = this.options.getQueryTimeout();
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPrePersists().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPreUpdates().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY)) {
- ListIterator<String> iterator = this.options.getValidationGroupPreRemoves().iterator();
- modelValue = this.getFirstElement(iterator);
- }
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Options2_0.LOCK_TIMEOUT_PROPERTY))
- this.options.setLockTimeout((Integer) newValue);
- else if (propertyName.equals(Options2_0.QUERY_TIMEOUT_PROPERTY))
- this.options.setQueryTimeout((Integer) newValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.addValidationGroupPrePersist((String) newValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.addValidationGroupPreUpdate((String) newValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.addValidationGroupPreRemove((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- // ********** LockTimeout tests **********
- public void testSetLockTimeout() throws Exception {
- this.verifyModelInitialized(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE);
- this.verifySetProperty(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE,
- LOCK_TIMEOUT_TEST_VALUE_2);
- }
-
- public void testAddRemoveLockTimeout() throws Exception {
- this.verifyAddRemoveProperty(
- LOCK_TIMEOUT_KEY,
- LOCK_TIMEOUT_TEST_VALUE,
- LOCK_TIMEOUT_TEST_VALUE_2);
- }
-
- // ********** QueryTimeout tests **********
- public void testSetQueryTimeout() throws Exception {
- this.verifyModelInitialized(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE);
- this.verifySetProperty(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE,
- QUERY_TIMEOUT_TEST_VALUE_2);
- }
-
- public void testAddRemoveQueryTimeout() throws Exception {
- this.verifyAddRemoveProperty(
- QUERY_TIMEOUT_KEY,
- QUERY_TIMEOUT_TEST_VALUE,
- QUERY_TIMEOUT_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPrePersist tests **********
- public void testSetValidationGroupPrePersist() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPrePersist() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPrePersistCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPrePersistCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_KEY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPreUpdate tests **********
- public void testSetValidationGroupPreUpdate() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreUpdate() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPreUpdateCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPreUpdateCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_KEY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2);
- }
-
- // ********** ValidationGroupPreRemove tests **********
- public void testSetValidationGroupPreRemove() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE);
- this.verifySetValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationGroupPreRemove() throws Exception {
- this.verifyAddRemoveValidationGroupProperty(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testAddValidationGroupPreRemoveCompositeValue() throws Exception {
- this.verifyAddCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- public void testRemoveValidationGroupPreRemoveCompositeValue() throws Exception {
- this.verifyRemoveCompositeValue(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_KEY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2);
- }
-
- // ********** ValidationGroups list **********
- public void testValidationGroupsList() throws Exception {
- this.verifyListEvents(
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY,
- VALIDATION_GROUP_PRE_PERSIST_TEST_VALUE_2,
- Options2_0.VALIDATION_GROUP_PRE_PERSIST_LIST);
-
- this.verifyListEvents(
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY,
- VALIDATION_GROUP_PRE_UPDATE_TEST_VALUE_2,
- Options2_0.VALIDATION_GROUP_PRE_UPDATE_LIST);
-
- this.verifyListEvents(
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY,
- VALIDATION_GROUP_PRE_REMOVE_TEST_VALUE_2,
- Options2_0.VALIDATION_GROUP_PRE_REMOVE_LIST);
- }
-
- // ********** override **********
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.prePersistEvent = null;
- this.preUpdateEvent = null;
- this.preRemoveEvent = null;
- }
-
- // ****** convenience methods *******
-
- // ********** verify ValidationGroup property **********
- protected void verifySetValidationGroupProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2, true);
- this.propertiesTotal++;
- this.verifyPutValidationGroupProperty(propertyName, testValue1);
- }
-
- @SuppressWarnings("unused")
- protected void verifyAddRemoveValidationGroupProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- assertTrue(this.validationGroupValueExists(propertyName, (String)testValue1));
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key, (String)testValue1);
- assertFalse(this.validationGroupValueExists(propertyName, (String)testValue1));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1, true);
- this.verifyPutValidationGroupProperty(propertyName, testValue1);
- }
-
- protected void verifyAddCompositeValue(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- String stringTestValue1 = (String)testValue1;
- String stringTestValue2 = (String)testValue2;
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- this.addValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 2);
-
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue2));
-
- String propertyValue = this.getPersistenceUnit().getProperty(key).getValue();
- assertTrue(propertyValue.indexOf(stringTestValue1) != -1);
- assertTrue(propertyValue.indexOf(stringTestValue2) != -1);
- }
-
- protected void verifyRemoveCompositeValue(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- String stringTestValue1 = (String)testValue1;
- String stringTestValue2 = (String)testValue2;
- assertTrue(this.validationGroupValueExists(propertyName, stringTestValue1));
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- this.addValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 2);
-
- this.removeValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 1);
- assertFalse(this.validationGroupValueExists(propertyName, stringTestValue2));
- String propertyValue = this.getPersistenceUnit().getProperty(key).getValue();
- assertTrue(propertyValue.indexOf(stringTestValue1) != -1);
- assertTrue(propertyValue.indexOf(stringTestValue2) == -1);
-
- this.removeValidationGroupValue(propertyName, stringTestValue2);
- assertEquals(this.getValidationGroupSize(propertyName), 1);
-
- this.removeValidationGroupValue(propertyName, stringTestValue1);
- assertEquals(this.getValidationGroupSize(propertyName), 0);
- assertFalse(this.validationGroupValueExists(propertyName, stringTestValue1));
-
- assertNull(this.getPersistenceUnit().getProperty(key));
- }
-
- protected void verifyListEvents(String propertyName, String testValue, String listName) throws Exception {
- // add
- this.clearEvent();
- this.addValidationGroupValue(propertyName, testValue);
-
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event for the expected property
- assertEquals("Wrong Event.", this.getEventFor(propertyName).getListName(), listName);
-
- // remove
- this.clearEvent();
-
- this.removeValidationGroupValue(propertyName, testValue);
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event for the expected property
- assertEquals("Wrong Event.", this.getEventFor(propertyName).getListName(), listName);
- }
-
- protected void verifyPutValidationGroupProperty(String propertyName, Object expectedValue) throws Exception {
- // verify event received
- assertNotNull("No Event Fired.", this.getEventFor(propertyName));
- // verify event value
- assertTrue(this.validationGroupValueExists(propertyName, (String) expectedValue));
- return;
- }
-
- // ********** internal method **********
-
- private ListChangeListener buildValidationGroupListChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- EclipseLink2_0OptionsTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listChanged(ListChangeEvent e) {
-
- EclipseLink2_0OptionsTests.this.validationGroupChanged(e);
- }
- };
- }
-
- private void validationGroupChanged(ListChangeEvent e) {
- String listName = e.getListName();
-
- if (listName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_LIST))
- this.prePersistEvent = e;
- else if (listName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_LIST))
- this.preUpdateEvent = e;
- else if (listName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_LIST))
- this.preRemoveEvent = e;
- else
- this.throwUnsupportedOperationException(e);
- }
-
- private void addValidationGroupValue(String propertyName, String propertyValue) throws NoSuchFieldException {
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.addValidationGroupPrePersist(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.addValidationGroupPreUpdate(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.addValidationGroupPreRemove(propertyValue);
- else
- this.throwMissingDefinition("addValidationGroupValue", propertyName);
- }
-
- private void removeValidationGroupValue(String propertyName, String propertyValue) throws NoSuchFieldException {
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- this.options.removeValidationGroupPrePersist(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- this.options.removeValidationGroupPreUpdate(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- this.options.removeValidationGroupPreRemove(propertyValue);
- else
- this.throwMissingDefinition("removeValidationGroupValue", propertyName);
- }
-
- private boolean validationGroupValueExists(String propertyName, String propertyValue) throws NoSuchFieldException {
- boolean result = false;
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- result = this.options.validationGroupPrePersistExists(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- result = this.options.validationGroupPreUpdateExists(propertyValue);
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- result = this.options.validationGroupPreRemoveExists(propertyValue);
- else
- this.throwMissingDefinition("verifyValidationGroupValueExists", propertyName);
- return result;
- }
-
- private int getValidationGroupSize(String propertyName) throws NoSuchFieldException {
- int result = 0;
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- result = this.options.getValidationGroupPrePersistsSize();
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- result = this.options.getValidationGroupPreUpdatesSize();
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- result = this.options.getValidationGroupPreRemovesSize();
- else
- this.throwMissingDefinition("verifyValidationGroupSize", propertyName);
- return result;
- }
-
- private ListChangeEvent getEventFor(String propertyName) throws NoSuchFieldException {
- ListChangeEvent event = null;
- if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_PERSIST_PROPERTY))
- event = this.prePersistEvent;
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_UPDATE_PROPERTY))
- event = this.preUpdateEvent;
- else if (propertyName.equals(Options2_0.VALIDATION_GROUP_PRE_REMOVE_PROPERTY))
- event = this.preRemoveEvent;
- else
- this.throwMissingDefinition("getEventFor", propertyName);
- return event;
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java
deleted file mode 100644
index 55a6479832..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_0PersistenceUnitTestCase.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.JpaFacet;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.tests.internal.context.persistence.PersistenceUnitTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.wst.common.componentcore.datamodel.properties.IFacetDataModelProperties;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * EclipseLink2_0PersistenceUnitTestCase
- */
-public abstract class EclipseLink2_0PersistenceUnitTestCase extends PersistenceUnitTestCase
-{
- protected EclipseLinkPersistenceUnit subject;
-
- protected PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder;
-
- // ********** constructors **********
- protected EclipseLink2_0PersistenceUnitTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject = this.getPersistenceUnit();
- this.subjectHolder = new SimplePropertyValueModel<EclipseLinkPersistenceUnit>(this.subject);
- this.populatePu();
- }
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(IFacetDataModelProperties.FACET_VERSION_STR, JpaFacet.VERSION_2_0.getVersionString());
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, EclipseLinkPlatform.VERSION_2_0);
- return dataModel;
- }
-
- @Override
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_2JpaMetadataConversionTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_2JpaMetadataConversionTests.java
deleted file mode 100644
index 0eecf5c287..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLink2_2JpaMetadataConversionTests.java
+++ /dev/null
@@ -1,823 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.JptJpaCorePlugin;
-import org.eclipse.jpt.jpa.core.context.java.JavaEntity;
-import org.eclipse.jpt.jpa.core.context.java.JavaIdMapping;
-import org.eclipse.jpt.jpa.core.context.orm.EntityMappings;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.jpa2.resource.java.JPA2_0;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.tests.internal.jpa2.context.persistence.Generic2_0JpaMetadataConversionTests;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConversionValue;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkConvertibleMapping;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkObjectTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkStructConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.EclipseLinkTypeConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEmbeddable;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.java.JavaEclipseLinkMappedSuperclass;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.EclipseLinkEntityMappings;
-import org.eclipse.jpt.jpa.eclipselink.core.context.orm.OrmEclipseLinkConverterContainer;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.orm.OrmEclipseLinkCustomConverter;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLink2_2ContextModelTestCase;
-
-@SuppressWarnings("nls")
-public class EclipseLink2_2JpaMetadataConversionTests extends EclipseLink2_2ContextModelTestCase {
-
- private IProgressMonitor progressMonitor;
-
- public EclipseLink2_2JpaMetadataConversionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.progressMonitor = new IProgressMonitor() {
- public void worked(int work) {}
- public void subTask(String name) {}
- public void setTaskName(String name) {}
- public void setCanceled(boolean value) {}
- public boolean isCanceled() {return false;}
- public void internalWorked(double work) {}
- public void done() {}
- public void beginTask(String name, int totalWork) {}
- } ;
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.progressMonitor = null;
- super.tearDown();
- }
-
- // ************ metadata conversion of equivalent queries on EclipseLink platform*************
-
- private ICompilationUnit createTestEntityWithDuplicateQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.NAMED_QUERY, JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedQuery(name=\"nquery\")").append(CR);
- sb.append("@NamedNativeQueries({" +
- "@NamedNativeQuery(name=\"nnq1\", query=\"abcd\"), " +
- "@NamedNativeQuery(name=\"nnq1\", query=\"abcde\")})");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEquivalentQueries() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.NAMED_NATIVE_QUERIES, JPA.NAMED_NATIVE_QUERY, JPA.QUERY_HINT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@NamedNativeQueries({" +
- "@NamedNativeQuery(name=\"nnq1\", query=\"abcd\", resultClass=foo1.class, resultSetMapping=\"bar1\", " +
- "hints={@QueryHint(name=\"nnq1hint1\", value = \"aaa\"), " +
- "@QueryHint(name=\"nnq1hint2\", value=\"bbb\")}), " +
- "@NamedNativeQuery(name=\"nnq1\", query=\"abcd\", resultClass=foo1.class, resultSetMapping=\"bar1\", " +
- "hints={@QueryHint(name=\"nnq1hint1\", value = \"aaa\"), " +
- "@QueryHint(name=\"nnq1hint2\", value=\"bbb\")})})");
- }
- });
- }
-
- public void testConvertDuplicateQueries() throws Exception {
- createTestEntityWithDuplicateQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
- persistenceUnit.convertJavaQueries(entityMappings, progressMonitor);
-
- JavaEntity entity = getJavaEntity();
- // test duplicate Java queries are not converted to eclipselink-orm.xml and
- // not removed from the Java entity, but unique query is
- assertEquals(0, entity.getQueryContainer().getNamedQueriesSize());
- assertEquals(2, entity.getQueryContainer().getNamedNativeQueriesSize());
- assertEquals(1, entityMappings.getQueryContainer().getNamedQueriesSize());
- assertEquals(0, entityMappings.getQueryContainer().getNamedNativeQueriesSize());
- }
-
- public void testConvertEquivalentQueries() throws Exception {
- createTestEntityWithEquivalentQueries();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- JavaEntity entity = getJavaEntity();
-
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
- persistenceUnit.convertJavaQueries(entityMappings, progressMonitor);
-
- // test only one of the equivalent Java queries are converted
- // to eclipselink-orm.xml and the rest are removed
- assertEquals(0, entity.getQueryContainer().getNamedNativeQueriesSize());
- assertEquals(1, entityMappings.getQueryContainer().getNamedNativeQueriesSize());
- }
-
- // ************ metadata conversion of equivalent generators on EclipseLink platform*************
-
- private ICompilationUnit createTestEntityWithDuplicateGenerators() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.TABLE_GENERATOR, JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@TableGenerator(name=\"tgen\", initialValue=100)").append(CR);
- sb.append("@SequenceGenerator(name=\"sgen\", initialValue=10)");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@TableGenerator(name=\"tgen\", initialValue=10)").append(CR);
- sb.append("@SequenceGenerator(name=\"sgen\", initialValue=1)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEquivalentGenerators() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, JPA.TABLE_GENERATOR, JPA.SEQUENCE_GENERATOR);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@TableGenerator(name=\"tgen\", table=\"ID_GEN\", schema=\"APP\", catalog=\"FOO\"," +
- "pkColumnName=\"GEN_NAME\", valueColumnName=\"GEN_VALUE\", pkColumnValue=\"TGEN\"," +
- "allocationSize=50, initialValue=100)").append(CR);
- sb.append("@SequenceGenerator(name=\"sgen\", sequenceName=\"Foo_Seq\", schema=\"SYS\", catalog=\"BAR\"," +
- "allocationSize=5, initialValue=10)");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@TableGenerator(name=\"tgen\", table=\"ID_GEN\", schema=\"APP\", catalog=\"FOO\"," +
- "pkColumnName=\"GEN_NAME\", valueColumnName=\"GEN_VALUE\", pkColumnValue=\"TGEN\"," +
- "allocationSize=50, initialValue=100)").append(CR);
- sb.append("@SequenceGenerator(name=\"sgen\", sequenceName=\"Foo_Seq\", schema=\"SYS\", catalog=\"BAR\"," +
- "allocationSize=5, initialValue=10)");
- }
- });
- }
-
- public void testConvertDuplicateGenerators() throws Exception {
- createTestEntityWithDuplicateGenerators();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- PersistenceUnit persistenceUnit = getPersistenceUnit();
-
- JavaEntity entity = getJavaEntity();
- JavaIdMapping mapping = (JavaIdMapping)entity.getIdAttribute().getMapping();
-
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
- persistenceUnit.convertJavaGenerators(entityMappings, progressMonitor);
-
- // test duplicate Java generators are not converted to eclipselink-orm.xml and
- // not removed from the Java entity, but unique generator is
- assertNotNull(entity.getGeneratorContainer().getSequenceGenerator());
- assertNotNull(entity.getGeneratorContainer().getTableGenerator());
- assertEquals(0, entityMappings.getSequenceGeneratorsSize());
- assertEquals(0, entityMappings.getTableGeneratorsSize());
- assertNotNull(mapping.getGeneratorContainer().getSequenceGenerator());
- assertNotNull(mapping.getGeneratorContainer().getTableGenerator());
- }
-
- public void testConvertEquivalentGenerators() throws Exception {
- createTestEntityWithEquivalentGenerators();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- JavaEntity entity = getJavaEntity();
- JavaIdMapping mapping = (JavaIdMapping)entity.getIdAttribute().getMapping();
-
- addXmlMappingFileRef(JptJpaCorePlugin.DEFAULT_ORM_XML_RUNTIME_PATH.toString());
- EntityMappings entityMappings = getEntityMappings();
- persistenceUnit.convertJavaGenerators(entityMappings, progressMonitor);
-
- // test only one of the equivalent generators are converted to
- // eclipselink-orm.xml and the rest are removed
- assertNull(entity.getGeneratorContainer().getSequenceGenerator());
- assertNull(entity.getGeneratorContainer().getTableGenerator());
- assertNull(mapping.getGeneratorContainer().getSequenceGenerator());
- assertNull(mapping.getGeneratorContainer().getTableGenerator());
- assertEquals(1, entityMappings.getSequenceGeneratorsSize());
- assertEquals(1, entityMappings.getTableGeneratorsSize());
- }
-
- // ************ entity with converters*************
-
- private ICompilationUnit createTestEntityWithConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.CONVERTER, EclipseLink.TYPE_CONVERTER,
- EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.STRUCT_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=foo.class)").append(CR);
- sb.append("@TypeConverter(name=\"type\", dataType=Number.class, objectType=Integer.class)").append(CR);
- sb.append("@ObjectTypeConverter(name=\"otype\", dataType=Character.class, objectType=String.class, " +
- "conversionValues={@ConversionValue(dataValue=\"m\", objectValue=\"male\"), " +
- "@ConversionValue(dataValue=\"f\", objectValue=\"female\")}," +
- "defaultObjectValue=\"female\")").append(CR);
- sb.append("@StructConverter(name=\"struct\", converter=\"bar\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConverterOnConvertibleMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.ID, EclipseLink.CONVERTERS, EclipseLink.CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@Converters({" +
- "@Converter(name = \"custom1\", converterClass=foo1.class)," +
- "@Converter(name = \"custom2\", converterClass=foo2.class)})");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithConverterOnCollectionMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA2_0.ELEMENT_COLLECTION,
- "java.util.Map", EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity");
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ElementCollection").append(CR);
- sb.append("@StructConverter(name=\"struct\", converter=\"bar\")").append(CR);
- sb.append(" private Map<String, String> projects;");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithDuplicateConvertersOfDiffTypes() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERTER, EclipseLink.TYPE_CONVERTER,
- EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.STRUCT_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=foo.class)").append(CR);
- sb.append("@TypeConverter(name=\"type\")").append(CR);
- sb.append("@ObjectTypeConverter(name=\"type\")").append(CR);
- sb.append("@StructConverter(name=\"struct\", converter=\"bar\")");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append("@ObjectTypeConverter(name=\"otype\")");
- }
- });
- }
-
- private ICompilationUnit createTestEntity2WithDuplicateConvertersOfSameType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERTER, EclipseLink.TYPE_CONVERTER,
- EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.STRUCT_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=foo.class)").append(CR);
- sb.append("@TypeConverter(name=\"type\")").append(CR);
- sb.append("@ObjectTypeConverter(name=\"otype\")").append(CR);
- sb.append("@StructConverter(name=\"struct\", converter=\"bar\")");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=bar.class)");
- }
- });
- }
-
- private ICompilationUnit createTestEntityWithEquivalentConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY, JPA.BASIC, EclipseLink.CONVERTER, EclipseLink.TYPE_CONVERTER,
- EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.STRUCT_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=foo.class)").append(CR);
- sb.append("@TypeConverter(name=\"type\")").append(CR);
- sb.append("@ObjectTypeConverter(name=\"otype\")").append(CR);
- sb.append("@StructConverter(name=\"struct\", converter=\"bar\")");
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Basic").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=foo.class)");
- }
- });
- }
-
- public void testConvertConvertersonEntity() throws Exception {
- createTestEntityWithConverters();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = getJavaEntity();
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test Java converter are converted to eclipselink-orm.xml and removed from the Java entity
- assertEquals(1, entityMappings.getConverterContainer().getCustomConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getTypeConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getObjectTypeConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getStructConvertersSize());
- assertEquals(entity.getConverterContainer().getCustomConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getTypeConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getObjectTypeConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getStructConvertersSize(), 0);
-
- // test the mapping file converters have correct values
- EclipseLinkCustomConverter custom = entityMappings.getConverterContainer().getCustomConverters().iterator().next();
- assertEquals("custom", custom.getName());
- assertEquals("foo", custom.getConverterClass());
-
- EclipseLinkTypeConverter type = entityMappings.getConverterContainer().getTypeConverters().iterator().next();
- assertEquals("type", type.getName());
- assertEquals("java.lang.Number", type.getDataType());
- assertEquals("java.lang.Integer", type.getObjectType());
-
- EclipseLinkObjectTypeConverter otype = entityMappings.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertEquals("otype", otype.getName());
- assertEquals("java.lang.Character", otype.getDataType());
- assertEquals("java.lang.String", otype.getObjectType());
- ListIterator<? extends EclipseLinkConversionValue> values = otype.getConversionValues().iterator();
- EclipseLinkConversionValue value1 = values.next();
- assertEquals("m", value1.getDataValue());
- assertEquals("male", value1.getObjectValue());
- EclipseLinkConversionValue value2 = values.next();
- assertEquals("f", value2.getDataValue());
- assertEquals("female", value2.getObjectValue());
- assertEquals("female", otype.getDefaultObjectValue());
-
- EclipseLinkStructConverter struct = entityMappings.getConverterContainer().getStructConverters().iterator().next();
- assertEquals("struct", struct.getName());
- assertEquals("bar", struct.getConverterClass());
- }
-
- public void testConvertConvertersOnEntityConvertibleMapping() throws Exception {
- createTestEntityWithConverterOnConvertibleMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = getJavaEntity();
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test Java converter on attribute mapping is converted to eclipselink-orm.xml and removed from the Java entity
- assertEquals(2, entityMappings.getConverterContainer().getCustomConvertersSize());
-
- EclipseLinkConvertibleMapping mapping = (EclipseLinkConvertibleMapping)entity.getIdAttribute().getMapping();
-
- assertEquals(mapping.getConverterContainer().getConvertersSize(), 0);
-
- // test the mapping file converter have correct values
- Collection<OrmEclipseLinkCustomConverter> customConverters = CollectionTools.collection(entityMappings.getConverterContainer().getCustomConverters());
- EclipseLinkCustomConverter custom1 = Generic2_0JpaMetadataConversionTests.selectNodeNamed(customConverters, "custom1");
- assertEquals("custom1", custom1.getName());
- assertEquals("foo1", custom1.getConverterClass());
- EclipseLinkCustomConverter custom2 = Generic2_0JpaMetadataConversionTests.selectNodeNamed(customConverters, "custom2");
- assertEquals("custom2", custom2.getName());
- assertEquals("foo2", custom2.getConverterClass());
- }
-
- public void testConvertConvertersOnCollectionMapping() throws Exception {
- createTestEntityWithConverterOnCollectionMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEntity entity = getJavaEntity();
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test Java converter on attribute mapping is converted to eclipselink-orm.xml and removed from the Java entity
- assertEquals(1, entityMappings.getConverterContainer().getStructConvertersSize());
-
- if (entity.getAttributeMappings().iterator().hasNext()) {
- EclipseLinkConvertibleMapping mapping = (EclipseLinkConvertibleMapping)entity.getAttributeMappings().iterator().next();
- assertEquals(mapping.getConverterContainer().getConvertersSize(), 0);
- }
-
- // test the mapping file converter have correct values
- EclipseLinkStructConverter custom = entityMappings.getConverterContainer().getStructConverters().iterator().next();
- assertEquals("struct", custom.getName());
- assertEquals("bar", custom.getConverterClass());
-
- // TODO test converting converter on map key - not supported yet
- }
-
- public void testConvertOverriddenConverters() throws Exception {
- createTestEntityWithDuplicateConvertersOfDiffTypes();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- OrmEclipseLinkConverterContainer ormConvertercontainer = entityMappings.getConverterContainer();
- EclipseLinkCustomConverter converter = ormConvertercontainer.addCustomConverter(ormConvertercontainer.getCustomConvertersSize());
- converter.setName("type");
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- JavaEclipseLinkEntity entity = getJavaEntity();
- EclipseLinkConvertibleMapping mapping = (EclipseLinkConvertibleMapping)entity.getAttributeMappings().iterator().next();
- assertTrue(CollectionTools.contains(persistenceUnit.getConverters(), mapping.getConverterContainer().getConverters().iterator().next()));
-
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test overriden Java converters are not converted to eclipselink-orm.xml and
- // not removed from the Java entity, but unique converters are
- assertEquals(entity.getConverterContainer().getTypeConvertersSize(), 1);
- assertEquals(entity.getConverterContainer().getObjectTypeConvertersSize(), 1);
- assertEquals(entity.getConverterContainer().getCustomConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getStructConvertersSize(), 0);
- assertEquals(mapping.getConverterContainer().getObjectTypeConvertersSize(), 0);
- assertEquals(2, ormConvertercontainer.getCustomConvertersSize());
- assertEquals(1, ormConvertercontainer.getStructConvertersSize());
- assertEquals(0, ormConvertercontainer.getTypeConvertersSize());
- assertEquals(1, ormConvertercontainer.getObjectTypeConvertersSize());
- }
-
- public void testConvertDuplicateConvertersWithDiffTypes() throws Exception {
- createTestEntityWithDuplicateConvertersOfDiffTypes();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- JavaEclipseLinkEntity entity = getJavaEntity();
- EclipseLinkConvertibleMapping mapping = (EclipseLinkConvertibleMapping)entity.getAttributeMappings().iterator().next();
-
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test duplicate Java converters are not converted to eclipselink-orm.xml and
- // not removed from the Java entity, but unique converters are
- assertEquals(entity.getConverterContainer().getTypeConvertersSize(), 1);
- assertEquals(entity.getConverterContainer().getObjectTypeConvertersSize(), 1);
- assertEquals(entity.getConverterContainer().getCustomConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getStructConvertersSize(), 0);
- assertEquals(mapping.getConverterContainer().getObjectTypeConvertersSize(), 0);
- assertEquals(1, entityMappings.getConverterContainer().getCustomConvertersSize());
- assertEquals(0, entityMappings.getConverterContainer().getTypeConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getStructConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getObjectTypeConvertersSize());
- }
-
- public void testConvertDuplicateConvertersWithSameType() throws Exception {
- createTestEntity2WithDuplicateConvertersOfSameType();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- JavaEclipseLinkEntity entity = getJavaEntity();
- EclipseLinkConvertibleMapping mapping = (EclipseLinkConvertibleMapping)entity.getAttributeMappings().iterator().next();
-
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test duplicate Java converters are not converted to eclipselink-orm.xml and
- // not removed from the Java entity, but unique converters are
- assertEquals(entity.getConverterContainer().getCustomConvertersSize(), 1);
- assertEquals(entity.getConverterContainer().getTypeConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getObjectTypeConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getStructConvertersSize(), 0);
- assertEquals(mapping.getConverterContainer().getCustomConvertersSize(), 1);
- assertEquals(0, entityMappings.getConverterContainer().getCustomConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getTypeConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getStructConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getObjectTypeConvertersSize());
- }
-
- public void testConvertEquivalentConverters() throws Exception {
- createTestEntityWithEquivalentConverters();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- JavaEclipseLinkEntity entity = getJavaEntity();
- EclipseLinkConvertibleMapping mapping = (EclipseLinkConvertibleMapping)entity.getAttributeMappings().iterator().next();
-
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test only one of the equivalent converters is converted to
- // eclipselink-orm.xml and the rest are removed
- assertEquals(entity.getConverterContainer().getCustomConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getTypeConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getObjectTypeConvertersSize(), 0);
- assertEquals(entity.getConverterContainer().getStructConvertersSize(), 0);
- assertEquals(mapping.getConverterContainer().getCustomConvertersSize(), 0);
- assertEquals(1, entityMappings.getConverterContainer().getCustomConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getTypeConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getStructConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getObjectTypeConvertersSize());
- }
-
- // ************ embeddable with converters*************
-
- private ICompilationUnit createTestEmbeddableWithConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, EclipseLink.CONVERTER, EclipseLink.TYPE_CONVERTER,
- EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.STRUCT_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=foo.class)").append(CR);
- sb.append("@TypeConverter(name=\"type\", dataType=Number.class, objectType=Integer.class)").append(CR);
- sb.append("@ObjectTypeConverter(name=\"otype\", dataType=Character.class, objectType=String.class, " +
- "conversionValues={@ConversionValue(dataValue=\"m\", objectValue=\"male\"), " +
- "@ConversionValue(dataValue=\"f\", objectValue=\"female\")}," +
- "defaultObjectValue=\"female\")").append(CR);
- sb.append("@StructConverter(name=\"struct\", converter=\"bar\")");
- }
- });
- }
-
- private ICompilationUnit createTestEmbeddableWithConverterOnConvertibleMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.EMBEDDABLE, JPA.VERSION, EclipseLink.CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Embeddable").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Version").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=foo.class)");
- }
- });
- }
-
- public void testConvertConvertersOnEmbeddable() throws Exception {
- createTestEmbeddableWithConverters();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEmbeddable embeddable = getJavaEmbeddable();
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test Java converter are converted to eclipselink-orm.xml and removed from the Java entity
- assertEquals(1, entityMappings.getConverterContainer().getCustomConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getTypeConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getObjectTypeConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getStructConvertersSize());
- assertEquals(embeddable.getConverterContainer().getCustomConvertersSize(), 0);
- assertEquals(embeddable.getConverterContainer().getTypeConvertersSize(), 0);
- assertEquals(embeddable.getConverterContainer().getObjectTypeConvertersSize(), 0);
- assertEquals(embeddable.getConverterContainer().getStructConvertersSize(), 0);
-
- // test the mapping file converters have correct values
- EclipseLinkCustomConverter custom = entityMappings.getConverterContainer().getCustomConverters().iterator().next();
- assertEquals("custom", custom.getName());
- assertEquals("foo", custom.getConverterClass());
-
- EclipseLinkTypeConverter type = entityMappings.getConverterContainer().getTypeConverters().iterator().next();
- assertEquals("type", type.getName());
- assertEquals("java.lang.Number", type.getDataType());
- assertEquals("java.lang.Integer", type.getObjectType());
-
- EclipseLinkObjectTypeConverter otype = entityMappings.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertEquals("otype", otype.getName());
- assertEquals("java.lang.Character", otype.getDataType());
- assertEquals("java.lang.String", otype.getObjectType());
- ListIterator<? extends EclipseLinkConversionValue> values = otype.getConversionValues().iterator();
- EclipseLinkConversionValue value1 = values.next();
- assertEquals("m", value1.getDataValue());
- assertEquals("male", value1.getObjectValue());
- EclipseLinkConversionValue value2 = values.next();
- assertEquals("f", value2.getDataValue());
- assertEquals("female", value2.getObjectValue());
- assertEquals("female", otype.getDefaultObjectValue());
-
- EclipseLinkStructConverter struct = entityMappings.getConverterContainer().getStructConverters().iterator().next();
- assertEquals("struct", struct.getName());
- assertEquals("bar", struct.getConverterClass());
- }
-
- public void testConvertConvertersOnEmbeddableConvertibleMapping() throws Exception {
- createTestEmbeddableWithConverterOnConvertibleMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkEmbeddable embeddable = getJavaEmbeddable();
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test Java converter on attribute mapping is converted to eclipselink-orm.xml and removed from the Java entity
- assertEquals(1, entityMappings.getConverterContainer().getCustomConvertersSize());
-
- EclipseLinkConvertibleMapping mapping = (EclipseLinkConvertibleMapping)embeddable.getAttributeMappings().iterator().next();
- assertEquals(mapping.getConverterContainer().getConvertersSize(), 0);
-
- // test the mapping file converter have correct values
- EclipseLinkCustomConverter custom = entityMappings.getConverterContainer().getCustomConverters().iterator().next();
- assertEquals("custom", custom.getName());
- assertEquals("foo", custom.getConverterClass());
- }
-
- // ************ mapped superclass with converters*************
- private ICompilationUnit createTestMappedSuperclassWithConverters() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, EclipseLink.CONVERTER, EclipseLink.TYPE_CONVERTER,
- EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.STRUCT_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=foo.class)").append(CR);
- sb.append("@TypeConverter(name=\"type\", dataType=Number.class, objectType=Integer.class)").append(CR);
- sb.append("@ObjectTypeConverter(name=\"otype\", dataType=Character.class, objectType=String.class, " +
- "conversionValues={@ConversionValue(dataValue=\"m\", objectValue=\"male\"), " +
- "@ConversionValue(dataValue=\"f\", objectValue=\"female\")}," +
- "defaultObjectValue=\"female\")").append(CR);
- sb.append("@StructConverter(name=\"struct\", converter=\"bar\")");
- }
- });
- }
-
- private ICompilationUnit createTestMappedSuperclassWithConverterOnConvertibleMapping() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.MAPPED_SUPERCLASS, JPA.ID, EclipseLink.CONVERTER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@MappedSuperclass").append(CR);
- }
-
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Id").append(CR);
- sb.append("@Converter(name=\"custom\", converterClass=foo.class)");
- }
- });
- }
-
- public void testConvertConvertersOnMappedSuperclass() throws Exception {
- createTestMappedSuperclassWithConverters();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMappedSuperclass mappedSuperclass = getJavaMappedSuperclass();
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test Java converter are converted to eclipselink-orm.xml and removed from the Java entity
- assertEquals(1, entityMappings.getConverterContainer().getCustomConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getTypeConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getObjectTypeConvertersSize());
- assertEquals(1, entityMappings.getConverterContainer().getStructConvertersSize());
- assertEquals(mappedSuperclass.getConverterContainer().getCustomConvertersSize(), 0);
- assertEquals(mappedSuperclass.getConverterContainer().getTypeConvertersSize(), 0);
- assertEquals(mappedSuperclass.getConverterContainer().getObjectTypeConvertersSize(), 0);
- assertEquals(mappedSuperclass.getConverterContainer().getStructConvertersSize(), 0);
-
- // test the mapping file converters have correct values
- EclipseLinkCustomConverter custom = entityMappings.getConverterContainer().getCustomConverters().iterator().next();
- assertEquals("custom", custom.getName());
- assertEquals("foo", custom.getConverterClass());
-
- EclipseLinkTypeConverter type = entityMappings.getConverterContainer().getTypeConverters().iterator().next();
- assertEquals("type", type.getName());
- assertEquals("java.lang.Number", type.getDataType());
- assertEquals("java.lang.Integer", type.getObjectType());
-
- EclipseLinkObjectTypeConverter otype = entityMappings.getConverterContainer().getObjectTypeConverters().iterator().next();
- assertEquals("otype", otype.getName());
- assertEquals("java.lang.Character", otype.getDataType());
- assertEquals("java.lang.String", otype.getObjectType());
- ListIterator<? extends EclipseLinkConversionValue> values = otype.getConversionValues().iterator();
- EclipseLinkConversionValue value1 = values.next();
- assertEquals("m", value1.getDataValue());
- assertEquals("male", value1.getObjectValue());
- EclipseLinkConversionValue value2 = values.next();
- assertEquals("f", value2.getDataValue());
- assertEquals("female", value2.getObjectValue());
- assertEquals("female", otype.getDefaultObjectValue());
-
- EclipseLinkStructConverter struct = entityMappings.getConverterContainer().getStructConverters().iterator().next();
- assertEquals("struct", struct.getName());
- assertEquals("bar", struct.getConverterClass());
- }
-
- public void testConvertConvertersOnMappedSuperclassConvertibleMapping() throws Exception {
- createTestMappedSuperclassWithConverterOnConvertibleMapping();
- addXmlClassRef(FULLY_QUALIFIED_TYPE_NAME);
-
- JavaEclipseLinkMappedSuperclass mappedSuperclass = getJavaMappedSuperclass();
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- EclipseLinkEntityMappings entityMappings = getEntityMappings();
-
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- persistenceUnit.convertJavaConverters(entityMappings, progressMonitor);
-
- // test Java converter on attribute mapping is converted to eclipselink-orm.xml and removed from the Java entity
- assertEquals(1, entityMappings.getConverterContainer().getCustomConvertersSize());
-
- EclipseLinkConvertibleMapping mapping = (EclipseLinkConvertibleMapping)mappedSuperclass.getAttributeMappings().iterator().next();
- assertEquals(mapping.getConverterContainer().getConvertersSize(), 0);
-
- // test the mapping file converter have correct values
- EclipseLinkCustomConverter custom = entityMappings.getConverterContainer().getCustomConverters().iterator().next();
- assertEquals("custom", custom.getName());
- assertEquals("foo", custom.getConverterClass());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkConnectionTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkConnectionTests.java
deleted file mode 100644
index e5a43a7d4c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkConnectionTests.java
+++ /dev/null
@@ -1,541 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitTransactionType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.BatchWriting;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Connection;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.ExclusiveConnectionMode;
-
-/**
- * ConnectionAdapterTests
- */
-@SuppressWarnings("nls")
-public class EclipseLinkConnectionTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Connection connection;
-
- public static final PersistenceUnitTransactionType TRANSACTION_TYPE_TEST_VALUE = PersistenceUnitTransactionType.RESOURCE_LOCAL;
- public static final PersistenceUnitTransactionType TRANSACTION_TYPE_TEST_VALUE_2 = PersistenceUnitTransactionType.JTA;
-
- public static final String JTA_DATA_SOURCE_TEST_VALUE = "Test_JTA";
- public static final String JTA_DATA_SOURCE_TEST_VALUE_2 = "Test_JTA_2";
-
- public static final String NON_JTA_DATA_SOURCE_TEST_VALUE = "Test_Non_JTA";
- public static final String NON_JTA_DATA_SOURCE_TEST_VALUE_2 = "Test_Non_JTA_2";
-
- public static final String NATIVE_SQL_KEY = Connection.ECLIPSELINK_NATIVE_SQL;
- public static final Boolean NATIVE_SQL_TEST_VALUE = false;
- public static final Boolean NATIVE_SQL_TEST_VALUE_2 = ! NATIVE_SQL_TEST_VALUE;
-
- public static final String BATCH_WRITING_KEY = Connection.ECLIPSELINK_BATCH_WRITING;
- public static final BatchWriting BATCH_WRITING_TEST_VALUE = BatchWriting.oracle_jdbc;
- public static final BatchWriting BATCH_WRITING_TEST_VALUE_2 = BatchWriting.buffered;
-
- public static final String CACHE_STATEMENTS_KEY = Connection.ECLIPSELINK_CACHE_STATEMENTS;
- public static final Boolean CACHE_STATEMENTS_TEST_VALUE = false;
- public static final Boolean CACHE_STATEMENTS_TEST_VALUE_2 = ! CACHE_STATEMENTS_TEST_VALUE;
-
- public static final String CACHE_STATEMENTS_SIZE_KEY = Connection.ECLIPSELINK_CACHE_STATEMENTS_SIZE;
- public static final Integer CACHE_STATEMENTS_SIZE_TEST_VALUE = 100;
- public static final Integer CACHE_STATEMENTS_SIZE_TEST_VALUE_2 = 200;
-
- public static final String DRIVER_KEY = Connection.ECLIPSELINK_DRIVER;
- public static final String DRIVER_TEST_VALUE = "connection.driver";
- public static final String DRIVER_TEST_VALUE_2 = "connection.driver.2";
-
- public static final String URL_KEY = Connection.ECLIPSELINK_URL;
- public static final String URL_TEST_VALUE = "test";
- public static final String URL_TEST_VALUE_2 = "test_2";
-
- public static final String USER_KEY = Connection.ECLIPSELINK_USER;
- public static final String USER_TEST_VALUE = "test";
- public static final String USER_TEST_VALUE_2 = "test_2";
-
- public static final String PASSWORD_KEY = Connection.ECLIPSELINK_PASSWORD;
- public static final String PASSWORD_TEST_VALUE = "test";
- public static final String PASSWORD_TEST_VALUE_2 = "test_2";
-
- public static final String BIND_PARAMETERS_KEY = Connection.ECLIPSELINK_BIND_PARAMETERS;
- public static final Boolean BIND_PARAMETERS_TEST_VALUE = false;
- public static final Boolean BIND_PARAMETERS_TEST_VALUE_2 = ! BIND_PARAMETERS_TEST_VALUE;
-
- public static final String READ_CONNECTIONS_SHARED_KEY = Connection.ECLIPSELINK_READ_CONNECTIONS_SHARED;
- public static final Boolean READ_CONNECTIONS_SHARED_TEST_VALUE = false;
- public static final Boolean READ_CONNECTIONS_SHARED_TEST_VALUE_2 = ! READ_CONNECTIONS_SHARED_TEST_VALUE;
-
- public static final String READ_CONNECTIONS_MIN_KEY = Connection.ECLIPSELINK_READ_CONNECTIONS_MIN;
- public static final Integer READ_CONNECTIONS_MIN_TEST_VALUE = 100;
- public static final Integer READ_CONNECTIONS_MIN_TEST_VALUE_2 = 200;
-
- public static final String READ_CONNECTIONS_MAX_KEY = Connection.ECLIPSELINK_READ_CONNECTIONS_MAX;
- public static final Integer READ_CONNECTIONS_MAX_TEST_VALUE = 100;
- public static final Integer READ_CONNECTIONS_MAX_TEST_VALUE_2 = 200;
-
- public static final String WRITE_CONNECTIONS_MIN_KEY = Connection.ECLIPSELINK_WRITE_CONNECTIONS_MIN;
- public static final Integer WRITE_CONNECTIONS_MIN_TEST_VALUE = 100;
- public static final Integer WRITE_CONNECTIONS_MIN_TEST_VALUE_2 = 200;
-
- public static final String WRITE_CONNECTIONS_MAX_KEY = Connection.ECLIPSELINK_WRITE_CONNECTIONS_MAX;
- public static final Integer WRITE_CONNECTIONS_MAX_TEST_VALUE = 100;
- public static final Integer WRITE_CONNECTIONS_MAX_TEST_VALUE_2 = 200;
-
- public static final String EXCLUSIVE_CONNECTION_MODE_KEY = Connection.ECLIPSELINK_EXCLUSIVE_CONNECTION_MODE;
- public static final ExclusiveConnectionMode EXCLUSIVE_CONNECTION_MODE_TEST_VALUE = ExclusiveConnectionMode.always;
- public static final ExclusiveConnectionMode EXCLUSIVE_CONNECTION_MODE_TEST_VALUE_2 = ExclusiveConnectionMode.isolated;
-
- public static final String LAZY_CONNECTION_KEY = Connection.ECLIPSELINK_LAZY_CONNECTION;
- public static final Boolean LAZY_CONNECTION_TEST_VALUE = false;
- public static final Boolean LAZY_CONNECTION_TEST_VALUE_2 = ! LAZY_CONNECTION_TEST_VALUE;
-
- // ********** constructors **********
- public EclipseLinkConnectionTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.connection = this.subject.getConnection();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.connection.addPropertyChangeListener(Connection.NATIVE_SQL_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.BATCH_WRITING_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.CACHE_STATEMENTS_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.CACHE_STATEMENTS_SIZE_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.DRIVER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.URL_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.USER_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.PASSWORD_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.BIND_PARAMETERS_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.READ_CONNECTIONS_SHARED_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.READ_CONNECTIONS_MIN_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.READ_CONNECTIONS_MAX_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.WRITE_CONNECTIONS_MIN_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.WRITE_CONNECTIONS_MAX_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.EXCLUSIVE_CONNECTION_MODE_PROPERTY, propertyChangeListener);
- this.connection.addPropertyChangeListener(Connection.LAZY_CONNECTION_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 16; // EclipseLink properties
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- // Initializes EclipseLink properties
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(NATIVE_SQL_KEY, NATIVE_SQL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(BATCH_WRITING_KEY, BATCH_WRITING_TEST_VALUE);
- this.persistenceUnitSetProperty(CACHE_STATEMENTS_KEY, CACHE_STATEMENTS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(CACHE_STATEMENTS_SIZE_KEY, CACHE_STATEMENTS_SIZE_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(DRIVER_KEY, DRIVER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(URL_KEY, URL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(USER_KEY, USER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(PASSWORD_KEY, PASSWORD_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(BIND_PARAMETERS_KEY, BIND_PARAMETERS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty(READ_CONNECTIONS_SHARED_KEY, READ_CONNECTIONS_SHARED_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(READ_CONNECTIONS_MIN_KEY, READ_CONNECTIONS_MIN_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(READ_CONNECTIONS_MAX_KEY, READ_CONNECTIONS_MAX_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WRITE_CONNECTIONS_MIN_KEY, WRITE_CONNECTIONS_MIN_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WRITE_CONNECTIONS_MAX_KEY, WRITE_CONNECTIONS_MAX_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(EXCLUSIVE_CONNECTION_MODE_KEY, EXCLUSIVE_CONNECTION_MODE_TEST_VALUE);
- this.persistenceUnitSetProperty(LAZY_CONNECTION_KEY, LAZY_CONNECTION_TEST_VALUE.toString());
-
- // Initializes PU elements
- this.getPersistenceUnit().setSpecifiedTransactionType(TRANSACTION_TYPE_TEST_VALUE);
- this.getPersistenceUnit().setJtaDataSource(JTA_DATA_SOURCE_TEST_VALUE);
- this.getPersistenceUnit().setNonJtaDataSource(NON_JTA_DATA_SOURCE_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.connection;
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Connection.NATIVE_SQL_PROPERTY))
- this.connection.setNativeSql((Boolean) newValue);
- else if (propertyName.equals(Connection.BATCH_WRITING_PROPERTY))
- this.connection.setBatchWriting((BatchWriting) newValue);
- else if (propertyName.equals(Connection.CACHE_STATEMENTS_PROPERTY))
- this.connection.setCacheStatements((Boolean) newValue);
- else if (propertyName.equals(Connection.CACHE_STATEMENTS_SIZE_PROPERTY))
- this.connection.setCacheStatementsSize((Integer) newValue);
- else if (propertyName.equals(Connection.DRIVER_PROPERTY))
- this.connection.setDriver((String) newValue);
- else if (propertyName.equals(Connection.URL_PROPERTY))
- this.connection.setUrl((String) newValue);
- else if (propertyName.equals(Connection.USER_PROPERTY))
- this.connection.setUser((String) newValue);
- else if (propertyName.equals(Connection.PASSWORD_PROPERTY))
- this.connection.setPassword((String) newValue);
- else if (propertyName.equals(Connection.BIND_PARAMETERS_PROPERTY))
- this.connection.setBindParameters((Boolean) newValue);
- else if (propertyName.equals(Connection.READ_CONNECTIONS_SHARED_PROPERTY))
- this.connection.setReadConnectionsShared((Boolean) newValue);
- else if (propertyName.equals(Connection.READ_CONNECTIONS_MIN_PROPERTY))
- this.connection.setReadConnectionsMin((Integer) newValue);
- else if (propertyName.equals(Connection.READ_CONNECTIONS_MAX_PROPERTY))
- this.connection.setReadConnectionsMax((Integer) newValue);
- else if (propertyName.equals(Connection.WRITE_CONNECTIONS_MIN_PROPERTY))
- this.connection.setWriteConnectionsMin((Integer) newValue);
- else if (propertyName.equals(Connection.WRITE_CONNECTIONS_MAX_PROPERTY))
- this.connection.setWriteConnectionsMax((Integer) newValue);
- else if (propertyName.equals(Connection.EXCLUSIVE_CONNECTION_MODE_PROPERTY))
- this.connection.setExclusiveConnectionMode((ExclusiveConnectionMode) newValue);
- else if (propertyName.equals(Connection.LAZY_CONNECTION_PROPERTY))
- this.connection.setLazyConnection((Boolean) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Connection.NATIVE_SQL_PROPERTY))
- modelValue = this.connection.getNativeSql();
- else if (propertyName.equals(Connection.BATCH_WRITING_PROPERTY))
- modelValue = this.connection.getBatchWriting();
- else if (propertyName.equals(Connection.CACHE_STATEMENTS_PROPERTY))
- modelValue = this.connection.getCacheStatements();
- else if (propertyName.equals(Connection.CACHE_STATEMENTS_SIZE_PROPERTY))
- modelValue = this.connection.getCacheStatementsSize();
- else if (propertyName.equals(Connection.DRIVER_PROPERTY))
- modelValue = this.connection.getDriver();
- else if (propertyName.equals(Connection.URL_PROPERTY))
- modelValue = this.connection.getUrl();
- else if (propertyName.equals(Connection.USER_PROPERTY))
- modelValue = this.connection.getUser();
- else if (propertyName.equals(Connection.PASSWORD_PROPERTY))
- modelValue = this.connection.getPassword();
- else if (propertyName.equals(Connection.BIND_PARAMETERS_PROPERTY))
- modelValue = this.connection.getBindParameters();
- else if (propertyName.equals(Connection.READ_CONNECTIONS_SHARED_PROPERTY))
- modelValue = this.connection.getReadConnectionsShared();
- else if (propertyName.equals(Connection.READ_CONNECTIONS_MIN_PROPERTY))
- modelValue = this.connection.getReadConnectionsMin();
- else if (propertyName.equals(Connection.READ_CONNECTIONS_MAX_PROPERTY))
- modelValue = this.connection.getReadConnectionsMax();
- else if (propertyName.equals(Connection.WRITE_CONNECTIONS_MIN_PROPERTY))
- modelValue = this.connection.getWriteConnectionsMin();
- else if (propertyName.equals(Connection.WRITE_CONNECTIONS_MAX_PROPERTY))
- modelValue = this.connection.getWriteConnectionsMax();
- else if (propertyName.equals(Connection.EXCLUSIVE_CONNECTION_MODE_PROPERTY))
- modelValue = this.connection.getExclusiveConnectionMode();
- else if (propertyName.equals(Connection.LAZY_CONNECTION_PROPERTY))
- modelValue = this.connection.getLazyConnection();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- // ********** NativeSql tests **********
- public void testSetNativeSql() throws Exception {
- this.verifyModelInitialized(
- NATIVE_SQL_KEY,
- NATIVE_SQL_TEST_VALUE);
- this.verifySetProperty(
- NATIVE_SQL_KEY,
- NATIVE_SQL_TEST_VALUE,
- NATIVE_SQL_TEST_VALUE_2);
- }
-
- public void testAddRemoveNativeSql() throws Exception {
- this.verifyAddRemoveProperty(
- NATIVE_SQL_KEY,
- NATIVE_SQL_TEST_VALUE,
- NATIVE_SQL_TEST_VALUE_2);
- }
-
- // ********** BatchWriting tests **********
- public void testSetBatchWriting() throws Exception {
- this.verifyModelInitialized(
- BATCH_WRITING_KEY,
- BATCH_WRITING_TEST_VALUE);
- this.verifySetProperty(
- BATCH_WRITING_KEY,
- BATCH_WRITING_TEST_VALUE,
- BATCH_WRITING_TEST_VALUE_2);
- }
-
- public void testAddRemoveBatchWriting() throws Exception {
- this.verifyAddRemoveProperty(
- BATCH_WRITING_KEY,
- BATCH_WRITING_TEST_VALUE,
- BATCH_WRITING_TEST_VALUE_2);
- }
-
- // ********** CacheStatements tests **********
- public void testSetCacheStatements() throws Exception {
- this.verifyModelInitialized(
- CACHE_STATEMENTS_KEY,
- CACHE_STATEMENTS_TEST_VALUE);
- this.verifySetProperty(
- CACHE_STATEMENTS_KEY,
- CACHE_STATEMENTS_TEST_VALUE,
- CACHE_STATEMENTS_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheStatements() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_STATEMENTS_KEY,
- CACHE_STATEMENTS_TEST_VALUE,
- CACHE_STATEMENTS_TEST_VALUE_2);
- }
-
- // ********** CacheStatementsSize tests **********
- public void testSetCacheStatementsSize() throws Exception {
- this.verifyModelInitialized(
- CACHE_STATEMENTS_SIZE_KEY,
- CACHE_STATEMENTS_SIZE_TEST_VALUE);
- this.verifySetProperty(
- CACHE_STATEMENTS_SIZE_KEY,
- CACHE_STATEMENTS_SIZE_TEST_VALUE,
- CACHE_STATEMENTS_SIZE_TEST_VALUE_2);
- }
-
- public void testAddRemoveCacheStatementsSize() throws Exception {
- this.verifyAddRemoveProperty(
- CACHE_STATEMENTS_SIZE_KEY,
- CACHE_STATEMENTS_SIZE_TEST_VALUE,
- CACHE_STATEMENTS_SIZE_TEST_VALUE_2);
- }
-
- // ********** Driver tests **********
- public void testSetDriver() throws Exception {
- this.verifyModelInitialized(
- DRIVER_KEY,
- DRIVER_TEST_VALUE);
- this.verifySetProperty(
- DRIVER_KEY,
- DRIVER_TEST_VALUE,
- DRIVER_TEST_VALUE_2);
- }
-
- public void testAddRemoveDriver() throws Exception {
- this.verifyAddRemoveProperty(
- DRIVER_KEY,
- DRIVER_TEST_VALUE,
- DRIVER_TEST_VALUE_2);
- }
-
- // ********** Url tests **********
- public void testSetUrl() throws Exception {
- this.verifyModelInitialized(
- URL_KEY,
- URL_TEST_VALUE);
- this.verifySetProperty(
- URL_KEY,
- URL_TEST_VALUE,
- URL_TEST_VALUE_2);
- }
-
- public void testAddRemoveUrl() throws Exception {
- this.verifyAddRemoveProperty(
- URL_KEY,
- URL_TEST_VALUE,
- URL_TEST_VALUE_2);
- }
-
- // ********** User tests **********
- public void testSetUser() throws Exception {
- this.verifyModelInitialized(
- USER_KEY,
- USER_TEST_VALUE);
- this.verifySetProperty(
- USER_KEY,
- USER_TEST_VALUE,
- USER_TEST_VALUE_2);
- }
-
- public void testAddRemoveUser() throws Exception {
- this.verifyAddRemoveProperty(
- USER_KEY,
- USER_TEST_VALUE,
- USER_TEST_VALUE_2);
- }
-
- // ********** Password tests **********
- public void testSetPassword() throws Exception {
- this.verifyModelInitialized(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE);
- this.verifySetProperty(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE,
- PASSWORD_TEST_VALUE_2);
- }
-
- public void testAddRemovePassword() throws Exception {
- this.verifyAddRemoveProperty(
- PASSWORD_KEY,
- PASSWORD_TEST_VALUE,
- PASSWORD_TEST_VALUE_2);
- }
-
- // ********** BindParameters tests **********
- public void testSetBindParameters() throws Exception {
- this.verifyModelInitialized(
- BIND_PARAMETERS_KEY,
- BIND_PARAMETERS_TEST_VALUE);
- this.verifySetProperty(
- BIND_PARAMETERS_KEY,
- BIND_PARAMETERS_TEST_VALUE,
- BIND_PARAMETERS_TEST_VALUE_2);
- }
-
- public void testAddRemoveBindParameters() throws Exception {
- this.verifyAddRemoveProperty(
- BIND_PARAMETERS_KEY,
- BIND_PARAMETERS_TEST_VALUE,
- BIND_PARAMETERS_TEST_VALUE_2);
- }
-
- // ********** ReadConnectionsShared tests **********
- public void testSetReadConnectionsShared() throws Exception {
- this.verifyModelInitialized(
- READ_CONNECTIONS_SHARED_KEY,
- READ_CONNECTIONS_SHARED_TEST_VALUE);
- this.verifySetProperty(
- READ_CONNECTIONS_SHARED_KEY,
- READ_CONNECTIONS_SHARED_TEST_VALUE,
- READ_CONNECTIONS_SHARED_TEST_VALUE_2);
- }
-
- public void testAddRemoveReadConnectionsShared() throws Exception {
- this.verifyAddRemoveProperty(
- READ_CONNECTIONS_SHARED_KEY,
- READ_CONNECTIONS_SHARED_TEST_VALUE,
- READ_CONNECTIONS_SHARED_TEST_VALUE_2);
- }
-
- // ********** ReadConnectionsMin tests **********
- public void testSetReadConnectionsMin() throws Exception {
- this.verifyModelInitialized(
- READ_CONNECTIONS_MIN_KEY,
- READ_CONNECTIONS_MIN_TEST_VALUE);
- this.verifySetProperty(
- READ_CONNECTIONS_MIN_KEY,
- READ_CONNECTIONS_MIN_TEST_VALUE,
- READ_CONNECTIONS_MIN_TEST_VALUE_2);
- }
-
- public void testAddRemoveReadConnectionsMin() throws Exception {
- this.verifyAddRemoveProperty(
- READ_CONNECTIONS_MIN_KEY,
- READ_CONNECTIONS_MIN_TEST_VALUE,
- READ_CONNECTIONS_MIN_TEST_VALUE_2);
- }
-
- // ********** ReadConnectionsMax tests **********
- public void testSetReadConnectionsMax() throws Exception {
- this.verifyModelInitialized(
- READ_CONNECTIONS_MAX_KEY,
- READ_CONNECTIONS_MAX_TEST_VALUE);
- this.verifySetProperty(
- READ_CONNECTIONS_MAX_KEY,
- READ_CONNECTIONS_MAX_TEST_VALUE,
- READ_CONNECTIONS_MAX_TEST_VALUE_2);
- }
-
- public void testAddRemoveReadConnectionsMax() throws Exception {
- this.verifyAddRemoveProperty(
- READ_CONNECTIONS_MAX_KEY,
- READ_CONNECTIONS_MAX_TEST_VALUE,
- READ_CONNECTIONS_MAX_TEST_VALUE_2);
- }
-
- // ********** WriteConnectionsMin tests **********
- public void testSetWriteConnectionsMin() throws Exception {
- this.verifyModelInitialized(
- WRITE_CONNECTIONS_MIN_KEY,
- WRITE_CONNECTIONS_MIN_TEST_VALUE);
- this.verifySetProperty(
- WRITE_CONNECTIONS_MIN_KEY,
- WRITE_CONNECTIONS_MIN_TEST_VALUE,
- WRITE_CONNECTIONS_MIN_TEST_VALUE_2);
- }
-
- public void testAddRemoveWriteConnectionsMin() throws Exception {
- this.verifyAddRemoveProperty(
- WRITE_CONNECTIONS_MIN_KEY,
- WRITE_CONNECTIONS_MIN_TEST_VALUE,
- WRITE_CONNECTIONS_MIN_TEST_VALUE_2);
- }
-
- // ********** WriteConnectionsMax tests **********
- public void testSetWriteConnectionsMax() throws Exception {
- this.verifyModelInitialized(
- WRITE_CONNECTIONS_MAX_KEY,
- WRITE_CONNECTIONS_MAX_TEST_VALUE);
- this.verifySetProperty(
- WRITE_CONNECTIONS_MAX_KEY,
- WRITE_CONNECTIONS_MAX_TEST_VALUE,
- WRITE_CONNECTIONS_MAX_TEST_VALUE_2);
- }
-
- public void testAddRemoveWriteConnectionsMax() throws Exception {
- this.verifyAddRemoveProperty(
- WRITE_CONNECTIONS_MAX_KEY,
- WRITE_CONNECTIONS_MAX_TEST_VALUE,
- WRITE_CONNECTIONS_MAX_TEST_VALUE_2);
- }
-
- // ********** ExclusiveConnectionMode tests **********
- public void testSetExclusiveConnectionMode() throws Exception {
- this.verifyModelInitialized(
- EXCLUSIVE_CONNECTION_MODE_KEY,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE);
- this.verifySetProperty(
- EXCLUSIVE_CONNECTION_MODE_KEY,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE_2);
- }
-
- public void testAddRemoveExclusiveConnectionMode() throws Exception {
- this.verifyAddRemoveProperty(
- EXCLUSIVE_CONNECTION_MODE_KEY,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE,
- EXCLUSIVE_CONNECTION_MODE_TEST_VALUE_2);
- }
-
- // ********** LazyConnection tests **********
- public void testSetLazyConnection() throws Exception {
- this.verifyModelInitialized(
- LAZY_CONNECTION_KEY,
- LAZY_CONNECTION_TEST_VALUE);
- this.verifySetProperty(
- LAZY_CONNECTION_KEY,
- LAZY_CONNECTION_TEST_VALUE,
- LAZY_CONNECTION_TEST_VALUE_2);
- }
-
- public void testAddRemoveLazyConnection() throws Exception {
- this.verifyAddRemoveProperty(
- LAZY_CONNECTION_KEY,
- LAZY_CONNECTION_TEST_VALUE,
- LAZY_CONNECTION_TEST_VALUE_2);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkCustomizationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkCustomizationTests.java
deleted file mode 100644
index 0640c90007..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkCustomizationTests.java
+++ /dev/null
@@ -1,760 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import java.util.ListIterator;
-import org.eclipse.jpt.common.utility.model.event.ListAddEvent;
-import org.eclipse.jpt.common.utility.model.event.ListChangeEvent;
-import org.eclipse.jpt.common.utility.model.event.ListClearEvent;
-import org.eclipse.jpt.common.utility.model.event.ListEvent;
-import org.eclipse.jpt.common.utility.model.event.ListMoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListRemoveEvent;
-import org.eclipse.jpt.common.utility.model.event.ListReplaceEvent;
-import org.eclipse.jpt.common.utility.model.listener.ListChangeListener;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Customization;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.CustomizationEntity;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Profiler;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Weaving;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.context.persistence.EclipseLinkCustomization;
-
-/**
- * Tests the update of model objects by the Customization adapter when the
- * PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class EclipseLinkCustomizationTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Customization customization;
- private ListEvent entitiesEvent;
- private ListEvent sessionCustomizersEvent;
-
- public static final String ENTITY_TEST = "Employee";
- public static final String ENTITY_TEST_2 = "Address";
-
- public static final String THROW_EXCEPTIONS_KEY = Customization.ECLIPSELINK_THROW_EXCEPTIONS;
- public static final Boolean THROW_EXCEPTIONS_TEST_VALUE = false;
- public static final Boolean THROW_EXCEPTIONS_TEST_VALUE_2 = ! THROW_EXCEPTIONS_TEST_VALUE;
-
- public static final String WEAVING_LAZY_KEY = Customization.ECLIPSELINK_WEAVING_LAZY;
- public static final Boolean WEAVING_LAZY_TEST_VALUE = false;
- public static final Boolean WEAVING_LAZY_TEST_VALUE_2 = ! WEAVING_LAZY_TEST_VALUE;
-
- public static final String WEAVING_CHANGE_TRACKING_KEY = Customization.ECLIPSELINK_WEAVING_CHANGE_TRACKING;
- public static final Boolean WEAVING_CHANGE_TRACKING_TEST_VALUE = false;
- public static final Boolean WEAVING_CHANGE_TRACKING_TEST_VALUE_2 = ! WEAVING_CHANGE_TRACKING_TEST_VALUE;
-
- public static final String WEAVING_FETCH_GROUPS_KEY = Customization.ECLIPSELINK_WEAVING_FETCH_GROUPS;
- public static final Boolean WEAVING_FETCH_GROUPS_TEST_VALUE = false;
- public static final Boolean WEAVING_FETCH_GROUPS_TEST_VALUE_2 = ! WEAVING_FETCH_GROUPS_TEST_VALUE;
-
- public static final String WEAVING_INTERNAL_KEY = Customization.ECLIPSELINK_WEAVING_INTERNAL;
- public static final Boolean WEAVING_INTERNAL_TEST_VALUE = false;
- public static final Boolean WEAVING_INTERNAL_TEST_VALUE_2 = ! WEAVING_INTERNAL_TEST_VALUE;
-
- public static final String WEAVING_EAGER_KEY = Customization.ECLIPSELINK_WEAVING_EAGER;
- public static final Boolean WEAVING_EAGER_TEST_VALUE = true;
- public static final Boolean WEAVING_EAGER_TEST_VALUE_2 = ! WEAVING_EAGER_TEST_VALUE;
-
- public static final String VALIDATION_ONLY_KEY = Customization.ECLIPSELINK_VALIDATION_ONLY;
- public static final Boolean VALIDATION_ONLY_TEST_VALUE = false;
- public static final Boolean VALIDATION_ONLY_TEST_VALUE_2 = ! VALIDATION_ONLY_TEST_VALUE;
-
- public static final String VALIDATE_SCHEMA_KEY = Customization.ECLIPSELINK_VALIDATE_SCHEMA;
- public static final Boolean VALIDATE_SCHEMA_TEST_VALUE = true;
- public static final Boolean VALIDATE_SCHEMA_TEST_VALUE_2 = ! VALIDATE_SCHEMA_TEST_VALUE;
-
- private static final String SESSION_CUSTOMIZER_KEY = Customization.ECLIPSELINK_SESSION_CUSTOMIZER;
- private static final String SESSION_CUSTOMIZER_TEST_VALUE = "java.lang.String";
- private static final String SESSION_CUSTOMIZER_TEST_VALUE_2 = "java.lang.Boolean";
-
- public static final String WEAVING_KEY = Customization.ECLIPSELINK_WEAVING;
- public static final Weaving WEAVING_TEST_VALUE = Weaving.false_;
- public static final Weaving WEAVING_TEST_VALUE_2 = Weaving.static_;
-
- public static final String CUSTOMIZER_KEY = Customization.ECLIPSELINK_DESCRIPTOR_CUSTOMIZER + ENTITY_TEST;
- public static final String CUSTOMIZER_TEST_VALUE = "acme.sessions.DescriptorCustomizer";
- public static final String CUSTOMIZER_TEST_VALUE_2 = "acme.sessions.Customizer";
-
- private static final String PROFILER_KEY = Customization.ECLIPSELINK_PROFILER;
- private static final Profiler PROFILER_TEST_VALUE = Profiler.query_monitor;
- private static final String PROFILER_TEST_VALUE_2 = "custom.profiler.test";
-
- public static final String EXCEPTION_HANDLER_KEY = Customization.ECLIPSELINK_EXCEPTION_HANDLER;
- public static final String EXCEPTION_HANDLER_TEST_VALUE = "acme.CustomSessionEventListener";
- public static final String EXCEPTION_HANDLER_TEST_VALUE_2 = "oracle.sessions.CustomSessionEventListener";
-
- // ********** constructors **********
- public EclipseLinkCustomizationTests(String name) {
- super(name);
- }
-
- // ********** behavior **********
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.customization = this.subject.getCustomization();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.customization.addPropertyChangeListener(Customization.THROW_EXCEPTIONS_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_LAZY_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_CHANGE_TRACKING_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_FETCH_GROUPS_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_INTERNAL_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_EAGER_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.WEAVING_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.VALIDATION_ONLY_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.VALIDATE_SCHEMA_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.SESSION_CUSTOMIZER_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.PROFILER_PROPERTY, propertyChangeListener);
- this.customization.addPropertyChangeListener(Customization.EXCEPTION_HANDLER_PROPERTY, propertyChangeListener);
-
- ListChangeListener sessionCustomizersChangeListener = this.buildSessionCustomizersChangeListener();
- this.customization.addListChangeListener(Customization.SESSION_CUSTOMIZER_LIST, sessionCustomizersChangeListener);
-
- ListChangeListener entitiesChangeListener = this.buildEntitiesChangeListener();
- this.customization.addListChangeListener(Customization.ENTITIES_LIST, entitiesChangeListener);
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 13;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(THROW_EXCEPTIONS_KEY, THROW_EXCEPTIONS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_LAZY_KEY, WEAVING_LAZY_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_CHANGE_TRACKING_KEY, WEAVING_CHANGE_TRACKING_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_FETCH_GROUPS_KEY, WEAVING_FETCH_GROUPS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_INTERNAL_KEY, WEAVING_INTERNAL_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_EAGER_KEY, WEAVING_EAGER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(VALIDATION_ONLY_KEY, VALIDATION_ONLY_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(VALIDATE_SCHEMA_KEY, VALIDATE_SCHEMA_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty(SESSION_CUSTOMIZER_KEY, SESSION_CUSTOMIZER_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(WEAVING_KEY, WEAVING_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(CUSTOMIZER_KEY, CUSTOMIZER_TEST_VALUE);
- this.persistenceUnitSetProperty(PROFILER_KEY, PROFILER_TEST_VALUE);
- this.persistenceUnitSetProperty(EXCEPTION_HANDLER_KEY, EXCEPTION_HANDLER_TEST_VALUE);
- return;
- }
-
- // ********** Listeners **********
- private ListChangeListener buildEntitiesChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- EclipseLinkCustomizationTests.this.entityAdded(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- EclipseLinkCustomizationTests.this.entityRemoved(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listChanged(ListChangeEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
- };
- }
-
- private ListChangeListener buildSessionCustomizersChangeListener() {
- return new ListChangeListener() {
- public void itemsAdded(ListAddEvent e) {
- EclipseLinkCustomizationTests.this.sessionCustomizerAdded(e);
- }
-
- public void itemsRemoved(ListRemoveEvent e) {
- EclipseLinkCustomizationTests.this.sessionCustomizerRemoved(e);
- }
-
- public void itemsReplaced(ListReplaceEvent e) {
- EclipseLinkCustomizationTests.this.sessionCustomizerReplaced(e);
- }
-
- public void itemsMoved(ListMoveEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
-
- public void listCleared(ListClearEvent e) {
- EclipseLinkCustomizationTests.this.sessionCustomizerListCleared(e);
- }
-
- public void listChanged(ListChangeEvent e) {
- EclipseLinkCustomizationTests.this.throwUnsupportedOperationException(e);
- }
- };
- }
-
- @Override
- protected void clearEvent() {
- super.clearEvent();
- this.entitiesEvent = null;
- this.sessionCustomizersEvent = null;
- }
-
- void entityAdded(ListAddEvent e) {
- this.entitiesEvent = e;
- }
-
- void entityRemoved(ListRemoveEvent e) {
- this.entitiesEvent = e;
- }
-
- void sessionCustomizerAdded(ListAddEvent e) {
- this.sessionCustomizersEvent = e;
- }
-
- void sessionCustomizerRemoved(ListRemoveEvent e) {
- this.sessionCustomizersEvent = e;
- }
-
- void sessionCustomizerReplaced(ListReplaceEvent e) {
- this.sessionCustomizersEvent = e;
- }
-
- void sessionCustomizerListCleared(ListClearEvent e) {
- this.sessionCustomizersEvent = e;
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Customization.THROW_EXCEPTIONS_PROPERTY))
- this.customization.setThrowExceptions((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_LAZY_PROPERTY))
- this.customization.setWeavingLazy((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_CHANGE_TRACKING_PROPERTY))
- this.customization.setWeavingChangeTracking((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_FETCH_GROUPS_PROPERTY))
- this.customization.setWeavingFetchGroups((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_INTERNAL_PROPERTY))
- this.customization.setWeavingInternal((Boolean) newValue);
- else if (propertyName.equals(Customization.WEAVING_EAGER_PROPERTY))
- this.customization.setWeavingEager((Boolean) newValue);
- else if (propertyName.equals(Customization.VALIDATION_ONLY_PROPERTY))
- this.customization.setValidationOnly((Boolean) newValue);
- else if (propertyName.equals(Customization.VALIDATE_SCHEMA_PROPERTY))
- this.customization.setValidateSchema((Boolean) newValue);
- else if (propertyName.equals(Customization.EXCEPTION_HANDLER_PROPERTY))
- this.customization.setExceptionHandler((String) newValue);
- else if (propertyName.equals(Customization.SESSION_CUSTOMIZER_PROPERTY))
- this.customization.addSessionCustomizer((String) newValue);
- else if (propertyName.equals(Customization.WEAVING_PROPERTY))
- this.customization.setWeaving((Weaving) newValue);
- else if (propertyName.equals(Customization.PROFILER_PROPERTY)) {
- if (newValue.getClass().isEnum())
- this.customization.setProfiler((Profiler) newValue);
- else
- this.customization.setProfiler((String) newValue);
- }
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Customization.THROW_EXCEPTIONS_PROPERTY))
- modelValue = this.customization.getThrowExceptions();
- else if (propertyName.equals(Customization.WEAVING_PROPERTY))
- modelValue = this.customization.getWeaving();
- else if (propertyName.equals(Customization.WEAVING_LAZY_PROPERTY))
- modelValue = this.customization.getWeavingLazy();
- else if (propertyName.equals(Customization.WEAVING_CHANGE_TRACKING_PROPERTY))
- modelValue = this.customization.getWeavingChangeTracking();
- else if (propertyName.equals(Customization.WEAVING_FETCH_GROUPS_PROPERTY))
- modelValue = this.customization.getWeavingFetchGroups();
- else if (propertyName.equals(Customization.WEAVING_INTERNAL_PROPERTY))
- modelValue = this.customization.getWeavingInternal();
- else if (propertyName.equals(Customization.WEAVING_EAGER_PROPERTY))
- modelValue = this.customization.getWeavingEager();
- else if (propertyName.equals(Customization.VALIDATION_ONLY_PROPERTY))
- modelValue = this.customization.getValidationOnly();
- else if (propertyName.equals(Customization.VALIDATE_SCHEMA_PROPERTY))
- modelValue = this.customization.getValidateSchema();
- else if (propertyName.equals(Customization.EXCEPTION_HANDLER_PROPERTY))
- modelValue = this.customization.getExceptionHandler();
- else if (propertyName.equals(Customization.PROFILER_PROPERTY))
- modelValue = this.customization.getProfiler();
- else if (propertyName.equals(Customization.SESSION_CUSTOMIZER_PROPERTY)) {
- ListIterator<String> iterator = this.customization.getSessionCustomizers().iterator();
- if(iterator.hasNext()) {
- modelValue = iterator.next();
- }
- }
- else if (propertyName.equals(CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY))
- modelValue = this.customization.getDescriptorCustomizerOf(ENTITY_TEST);
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void verifyPutProperty(String propertyName, Object expectedValue) throws Exception {
- Object expectedValue_ = expectedValue;
- if (propertyName.equals(Customization.PROFILER_PROPERTY)) {
-
- expectedValue_ = (expectedValue != null && expectedValue.getClass().isEnum()) ?
- this.getPropertyStringValueOf(PROFILER_TEST_VALUE) : // model is storing EclipseLinkStringValue
- expectedValue;
- }
- super.verifyPutProperty(propertyName, expectedValue_);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.customization;
- }
-
- // ********** entities list **********
- public void testEntitiesList() throws Exception {
- // add
- this.clearEvent();
- this.customization.addEntity(ENTITY_TEST_2);
-
- // verify event received
- assertNotNull("No Event Fired.", this.entitiesEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.entitiesEvent.getListName(), Customization.ENTITIES_LIST);
-
- // remove
- this.clearEvent();
- this.customization.removeEntity(ENTITY_TEST_2);
-
- // verify event received
- assertNotNull("No Event Fired.", this.entitiesEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.entitiesEvent.getListName(), Customization.ENTITIES_LIST);
- }
-
- // ********** sessionCustomizers list **********
- public void testSessionCustomizersList() throws Exception {
- // add
- this.clearEvent();
- String className = this.customization.addSessionCustomizer(SESSION_CUSTOMIZER_TEST_VALUE_2);
-
- // verify event received
- assertNotNull("No Event Fired.", this.sessionCustomizersEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.sessionCustomizersEvent.getListName(), Customization.SESSION_CUSTOMIZER_LIST);
-
- // remove
- this.clearEvent();
-
- this.customization.removeSessionCustomizer(className);
- // verify event received
- assertNotNull("No Event Fired.", this.sessionCustomizersEvent);
- // verify event for the expected property
- assertEquals("Wrong Event.", this.sessionCustomizersEvent.getListName(), Customization.SESSION_CUSTOMIZER_LIST);
- }
-
- // ********** ThrowExceptions tests **********
- public void testSetThrowExceptions() throws Exception {
- this.verifyModelInitialized(
- THROW_EXCEPTIONS_KEY,
- THROW_EXCEPTIONS_TEST_VALUE);
- this.verifySetProperty(
- THROW_EXCEPTIONS_KEY,
- THROW_EXCEPTIONS_TEST_VALUE,
- THROW_EXCEPTIONS_TEST_VALUE_2);
- }
-
- public void testAddRemoveThrowExceptions() throws Exception {
- this.verifyAddRemoveProperty(
- THROW_EXCEPTIONS_KEY,
- THROW_EXCEPTIONS_TEST_VALUE,
- THROW_EXCEPTIONS_TEST_VALUE_2);
- }
-
- // ********** WeavingLazy tests **********
- public void testSetWeavingLazy() throws Exception {
- this.verifyModelInitialized(
- WEAVING_LAZY_KEY,
- WEAVING_LAZY_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_LAZY_KEY,
- WEAVING_LAZY_TEST_VALUE,
- WEAVING_LAZY_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingLazy() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_LAZY_KEY,
- WEAVING_LAZY_TEST_VALUE,
- WEAVING_LAZY_TEST_VALUE_2);
- }
-
- // ********** WeavingChangeTracking tests **********
- public void testSetWeavingChangeTracking() throws Exception {
- this.verifyModelInitialized(
- WEAVING_CHANGE_TRACKING_KEY,
- WEAVING_CHANGE_TRACKING_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_CHANGE_TRACKING_KEY,
- WEAVING_CHANGE_TRACKING_TEST_VALUE,
- WEAVING_CHANGE_TRACKING_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingChangeTracking() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_CHANGE_TRACKING_KEY,
- WEAVING_CHANGE_TRACKING_TEST_VALUE,
- WEAVING_CHANGE_TRACKING_TEST_VALUE_2);
- }
-
- // ********** WeavingFetchGroups tests **********
- public void testSetWeavingFetchGroups() throws Exception {
- this.verifyModelInitialized(
- WEAVING_FETCH_GROUPS_KEY,
- WEAVING_FETCH_GROUPS_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_FETCH_GROUPS_KEY,
- WEAVING_FETCH_GROUPS_TEST_VALUE,
- WEAVING_FETCH_GROUPS_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingFetchGroups() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_FETCH_GROUPS_KEY,
- WEAVING_FETCH_GROUPS_TEST_VALUE,
- WEAVING_FETCH_GROUPS_TEST_VALUE_2);
- }
-
- // ********** WeavingInternal tests **********
- public void testSetWeavingInternal() throws Exception {
- this.verifyModelInitialized(
- WEAVING_INTERNAL_KEY,
- WEAVING_INTERNAL_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_INTERNAL_KEY,
- WEAVING_INTERNAL_TEST_VALUE,
- WEAVING_INTERNAL_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingInternal() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_INTERNAL_KEY,
- WEAVING_INTERNAL_TEST_VALUE,
- WEAVING_INTERNAL_TEST_VALUE_2);
- }
-
- // ********** WeavingEager tests **********
- public void testSetWeavingEager() throws Exception {
- this.verifyModelInitialized(
- WEAVING_EAGER_KEY,
- WEAVING_EAGER_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_EAGER_KEY,
- WEAVING_EAGER_TEST_VALUE,
- WEAVING_EAGER_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeavingEager() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_EAGER_KEY,
- WEAVING_EAGER_TEST_VALUE,
- WEAVING_EAGER_TEST_VALUE_2);
- }
-
- // ********** SessionCustomizer tests **********
- public void testSetSessionCustomizer() throws Exception {
- this.verifyModelInitialized(
- SESSION_CUSTOMIZER_KEY,
- SESSION_CUSTOMIZER_TEST_VALUE);
- this.verifySetSessionCustomizationProperty(
- Customization.SESSION_CUSTOMIZER_PROPERTY,
- SESSION_CUSTOMIZER_KEY,
- SESSION_CUSTOMIZER_TEST_VALUE,
- SESSION_CUSTOMIZER_TEST_VALUE_2);
- }
-
- public void testAddRemoveSessionCustomizer() throws Exception {
- this.verifyAddRemoveSessionCustomizationProperty(
- Customization.SESSION_CUSTOMIZER_PROPERTY,
- SESSION_CUSTOMIZER_KEY,
- SESSION_CUSTOMIZER_TEST_VALUE,
- SESSION_CUSTOMIZER_TEST_VALUE_2);
- }
-
- // ********** Weaving tests **********
- /**
- * Tests the update of Weaving property by the Customization adapter when
- * the PU or the model changes.
- */
- public void testSetWeaving() throws Exception {
- this.verifyModelInitialized(
- WEAVING_KEY,
- WEAVING_TEST_VALUE);
- this.verifySetProperty(
- WEAVING_KEY,
- WEAVING_TEST_VALUE,
- WEAVING_TEST_VALUE_2);
- }
-
- public void testAddRemoveWeaving() throws Exception {
- this.verifyAddRemoveProperty(
- WEAVING_KEY,
- WEAVING_TEST_VALUE,
- WEAVING_TEST_VALUE_2);
- }
-
- // ********** ValidationOnly tests **********
- public void testSetValidationOnly() throws Exception {
- this.verifyModelInitialized(
- VALIDATION_ONLY_KEY,
- VALIDATION_ONLY_TEST_VALUE);
- this.verifySetProperty(
- VALIDATION_ONLY_KEY,
- VALIDATION_ONLY_TEST_VALUE,
- VALIDATION_ONLY_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidationOnly() throws Exception {
- this.verifyAddRemoveProperty(
- VALIDATION_ONLY_KEY,
- VALIDATION_ONLY_TEST_VALUE,
- VALIDATION_ONLY_TEST_VALUE_2);
- }
-
- // ********** ValidateSchema tests **********
- public void testSetValidateSchema() throws Exception {
- this.verifyModelInitialized(
- VALIDATE_SCHEMA_KEY,
- VALIDATE_SCHEMA_TEST_VALUE);
- this.verifySetProperty(
- VALIDATE_SCHEMA_KEY,
- VALIDATE_SCHEMA_TEST_VALUE,
- VALIDATE_SCHEMA_TEST_VALUE_2);
- }
-
- public void testAddRemoveValidateSchema() throws Exception {
- this.verifyAddRemoveProperty(
- VALIDATE_SCHEMA_KEY,
- VALIDATE_SCHEMA_TEST_VALUE,
- VALIDATE_SCHEMA_TEST_VALUE_2);
- }
-
- // ********** ExceptionHandler tests **********
- public void testSetExceptionHandler() throws Exception {
- this.verifyModelInitialized(
- EXCEPTION_HANDLER_KEY,
- EXCEPTION_HANDLER_TEST_VALUE);
- this.verifySetProperty(
- EXCEPTION_HANDLER_KEY,
- EXCEPTION_HANDLER_TEST_VALUE,
- EXCEPTION_HANDLER_TEST_VALUE_2);
- }
-
- public void testAddRemoveExceptionHandler() throws Exception {
- this.verifyAddRemoveProperty(
- EXCEPTION_HANDLER_KEY,
- EXCEPTION_HANDLER_TEST_VALUE,
- EXCEPTION_HANDLER_TEST_VALUE_2);
- }
-
- // ********** Customization class **********
- /**
- * Tests the update of Customization property by the Customization adapter when the
- * PU or the model changes.
- */
- public void testSetCustomization() throws Exception {
- this.verifyModelInitialized(
- CUSTOMIZER_KEY,
- CUSTOMIZER_TEST_VALUE);
- this.verifySetCustomizationProperty(
- CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY,
- CUSTOMIZER_KEY,
- CUSTOMIZER_TEST_VALUE,
- CUSTOMIZER_TEST_VALUE_2);
- }
-
- public void testAddRemoveCustomization() throws Exception {
- this.verifyAddRemoveCustomizationProperty(
- CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY,
- CUSTOMIZER_KEY,
- CUSTOMIZER_TEST_VALUE,
- CUSTOMIZER_TEST_VALUE_2);
- }
-
- // ********** Profiler tests **********
- public void testSetProfiler() throws Exception {
- this.verifyModelInitialized(
- PROFILER_KEY,
- this.getPropertyStringValueOf(PROFILER_TEST_VALUE)); // model is storing EclipseLinkStringValue
- // verify set enum value
- this.verifySetProperty(
- PROFILER_KEY,
- PROFILER_TEST_VALUE,
- PROFILER_TEST_VALUE_2);
- // verify set custom and literal value
- this.verifySetProfiler(
- PROFILER_KEY,
- PROFILER_TEST_VALUE,
- PROFILER_TEST_VALUE_2);
- }
-
- public void testAddRemoveProfiler() throws Exception {
- this.verifyAddRemoveProperty(
- PROFILER_KEY,
- PROFILER_TEST_VALUE,
- PROFILER_TEST_VALUE_2);
- }
-
- /**
- * Verifies setting custom profiler and literals.
- */
- protected void verifySetProfiler(String elKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(elKey);
- String propertyName = this.getModel().propertyIdOf(property);
- // test set custom profiler.
- this.clearEvent();
- this.setProperty(propertyName, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // test set (Profiler) null
- this.clearEvent();
- this.customization.setProfiler((Profiler) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
-
- // test set enum literal
- this.clearEvent();
- this.setProperty(propertyName, testValue1.toString());
- assertNotNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, this.getPropertyStringValueOf(testValue1));
-
- // test set (String) null
- this.clearEvent();
- this.customization.setProfiler((String) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
- }
-
-
-
- // ****** convenience methods *******
-
- // ********** verify SessionCustomizer property **********
- protected void verifySetSessionCustomizationProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2, true);
- this.propertiesTotal++;
- this.verifyPutSessionCustomizerProperty(propertyName, testValue1);
- }
-
- @SuppressWarnings("unused")
- protected void verifyAddRemoveSessionCustomizationProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key, (String) testValue1);
- assertFalse(this.customization.sessionCustomizerExists(key));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1, true);
- this.verifyPutSessionCustomizerProperty(propertyName, testValue1);
- }
-
- protected void verifyPutSessionCustomizerProperty(String propertyName, Object expectedValue) throws Exception {
- // verify event received
- assertNotNull("No Event Fired.", this.sessionCustomizersEvent);
- this.verifySessionCustomizerEvent(propertyName, expectedValue);
- }
-
- @SuppressWarnings("unused")
- protected void verifySessionCustomizerEvent(String propertyName, Object expectedValue) throws Exception {
- // verify event value
- EclipseLinkCustomization customization = (EclipseLinkCustomization) this.sessionCustomizersEvent.getSource();
- assertTrue(customization.sessionCustomizerExists((String) expectedValue));
- return;
- }
-
- // ********** verify entity property **********
- protected void verifySetCustomizationProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Replace
- this.persistenceUnitSetProperty(key, testValue2);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, testValue2);
-
- // Replace by setting model object
- this.clearEvent();
- this.setCustomizationProperty(propertyName, ENTITY_TEST, testValue1);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, testValue1);
- }
-
- protected void verifyAddRemoveCustomizationProperty(String propertyName, String key, Object testValue1, Object testValue2) throws Exception {
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(key);
- assertNull(this.getPersistenceUnit().getProperty(key));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, null);
-
- // Add original Property
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(key, testValue1);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, testValue1);
-
- // Replace
- this.persistenceUnitSetProperty(key, testValue2);
- this.verifyPutCustomizationProperty(propertyName, ENTITY_TEST, testValue2);
- }
-
- protected void verifyPutCustomizationProperty(String propertyName, String entityName, Object expectedValue) throws Exception {
- this.verifyEvent(propertyName);
- this.verifyCustomizationEvent(propertyName, entityName, expectedValue);
- }
-
- protected void verifyCustomizationEvent(String propertyName, String entityName, Object expectedValue) throws Exception {
- // verify event value
- CustomizationEntity entity = (CustomizationEntity) this.propertyChangedEvent.getNewValue();
- if (propertyName.equals(CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY)) {
- assertEquals(expectedValue, entity.getParent().getDescriptorCustomizerOf(entityName));
- assertEquals(expectedValue, this.customization.getDescriptorCustomizerOf(entityName));
- }
- else {
- this.throwMissingDefinition("verifyCustomizationEvent", propertyName);
- }
- }
-
- protected void setCustomizationProperty(String propertyName, String entityName, Object newValue) throws NoSuchFieldException {
- if (propertyName.equals(CustomizationEntity.DESCRIPTOR_CUSTOMIZER_PROPERTY))
- this.customization.setDescriptorCustomizerOf(entityName, (String) newValue);
- else
- this.throwMissingDefinition("setCustomizationProperty", propertyName);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java
deleted file mode 100644
index d6ca4d10f5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTestCase.java
+++ /dev/null
@@ -1,53 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.internal.facet.JpaFacetDataModelProperties;
-import org.eclipse.jpt.jpa.core.tests.internal.context.persistence.PersistenceUnitTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.platform.EclipseLinkPlatform;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-/**
- * PersistenceUnitTestCase
- */
-public abstract class EclipseLinkPersistenceUnitTestCase extends PersistenceUnitTestCase
-{
- protected EclipseLinkPersistenceUnit subject;
-
- protected PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder;
-
- // ********** constructors **********
- protected EclipseLinkPersistenceUnitTestCase(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.subject = this.getPersistenceUnit();
- this.subjectHolder = new SimplePropertyValueModel<EclipseLinkPersistenceUnit>(this.subject);
- this.populatePu();
- }
-
- @Override
- protected IDataModel buildJpaConfigDataModel() {
- IDataModel dataModel = super.buildJpaConfigDataModel();
- dataModel.setProperty(JpaFacetDataModelProperties.PLATFORM, EclipseLinkPlatform.VERSION_1_0);
- return dataModel;
- }
-
- @Override
- protected EclipseLinkPersistenceUnit getPersistenceUnit() {
- return (EclipseLinkPersistenceUnit) super.getPersistenceUnit();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java
deleted file mode 100644
index f39bd0a27a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/EclipseLinkPersistenceUnitTests.java
+++ /dev/null
@@ -1,174 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.internal.operations.JptFileCreationDataModelProperties;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.MappingKeys;
-import org.eclipse.jpt.jpa.core.context.orm.OrmPersistentType;
-import org.eclipse.jpt.jpa.core.context.persistence.MappingFileRef;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.internal.operations.OrmFileCreationDataModelProperties;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.core.resource.persistence.PersistenceFactory;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlJavaClassRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlMappingFileRef;
-import org.eclipse.jpt.jpa.core.resource.persistence.XmlPersistenceUnit;
-import org.eclipse.jpt.jpa.core.resource.xml.JpaXmlResource;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-import org.eclipse.jpt.jpa.eclipselink.core.JptJpaEclipseLinkCorePlugin;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.operations.EclipseLinkOrmFileCreationDataModelProvider;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.EclipseLinkContextModelTestCase;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-@SuppressWarnings("nls")
-public class EclipseLinkPersistenceUnitTests
- extends EclipseLinkContextModelTestCase
-{
- public EclipseLinkPersistenceUnitTests(String name) {
- super(name);
- }
-
- @Override
- protected boolean createOrmXml() {
- return true;
- }
-
- @Override
- protected IDataModel buildEclipseLinkOrmConfig(TestJpaProject testJpaProject) {
- IDataModel dataModel =
- DataModelFactory.createDataModel(new EclipseLinkOrmFileCreationDataModelProvider());
- dataModel.setProperty(JptFileCreationDataModelProperties.CONTAINER_PATH,
- testJpaProject.getProject().getFolder("src/META-INF").getFullPath());
- dataModel.setProperty(OrmFileCreationDataModelProperties.ADD_TO_PERSISTENCE_UNIT, Boolean.FALSE);
- return dataModel;
- }
-
- private ICompilationUnit createTestEntity() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(JPA.ENTITY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Entity").append(CR);
- }
- });
- }
-
- public void testUpdateEclipseLinkImpliedMappingFileRef1() throws Exception {
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource eclipseLinkOrmResource = getOrmXmlResource();
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNotNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
-
- // remove eclipselink-orm.xml
- deleteResource(eclipseLinkOrmResource);
-
- assertFalse(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
- }
-
- public void testUpdateEclipseLinkImpliedMappingFileRef2() {
- XmlPersistenceUnit xmlPersistenceUnit = getXmlPersistenceUnit();
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource eclipseLinkOrmResource = getOrmXmlResource();
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNotNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
-
- // add specified eclipselink-orm.xml
- XmlMappingFileRef xmlMappingFileRef = PersistenceFactory.eINSTANCE.createXmlMappingFileRef();
- xmlMappingFileRef.setFileName("META-INF/eclipselink-orm.xml");
- xmlPersistenceUnit.getMappingFiles().add(xmlMappingFileRef);
-
- assertEquals(1, CollectionTools.size(persistenceUnit.getSpecifiedMappingFileRefs()));
-
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
- }
-
- public void testUpdateEclipseLinkImpliedMappingFileRef3() {
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
-
- // test that there is one initially
- JpaXmlResource eclipseLinkOrmResource = getOrmXmlResource();
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNotNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
-
- // ignore in persistence unit
- persistenceUnit.getGeneralProperties().setExcludeEclipselinkOrm(Boolean.TRUE);
-
- assertTrue(eclipseLinkOrmResource.fileExists());
- assertNotNull(persistenceUnit.getImpliedMappingFileRef());
- assertNull(persistenceUnit.getImpliedEclipseLinkMappingFileRef());
- }
-
- public void testMappingFileRefs() {
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- ListIterator<MappingFileRef> mappingFileRefs = persistenceUnit.getMappingFileRefs().iterator();
-
- assertEquals(persistenceUnit.getImpliedMappingFileRef(), mappingFileRefs.next().getMappingFile().getParent());
- assertEquals(persistenceUnit.getImpliedEclipseLinkMappingFileRef(), mappingFileRefs.next().getMappingFile().getParent());
- }
-
- public void testMappingFileRefsSize() {
- EclipseLinkPersistenceUnit persistenceUnit = getPersistenceUnit();
- assertEquals(2, persistenceUnit.getMappingFileRefsSize());
- }
-
- public void testPersistentType() throws Exception {
- getJpaProject().setDiscoversAnnotatedClasses(false);
- PersistenceUnit persistenceUnit = getPersistenceUnit();
- createTestEntity();
-
- //persistentType not listed in persistence.xml and discoverAnnotatedClasses is false
- //still find the persistentType because of changes for bug 190317
- assertFalse(getJpaProject().discoversAnnotatedClasses());
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType not listed in persistence.xml, discover annotated classes set to true
- getJpaProject().setDiscoversAnnotatedClasses(true);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
- //test persistentType list as class in persistence.xml
- getJpaProject().setDiscoversAnnotatedClasses(false);
- XmlJavaClassRef classRef = PersistenceFactory.eINSTANCE.createXmlJavaClassRef();
- classRef.setJavaClass(FULLY_QUALIFIED_TYPE_NAME);
- getXmlPersistenceUnit().getClasses().add(classRef);
- assertNotNull(persistenceUnit.getPersistentType(FULLY_QUALIFIED_TYPE_NAME));
-
-
- //test persistentType from orm.xml file that is specified in the persistence.xml
- addXmlMappingFileRef(JptJpaEclipseLinkCorePlugin.DEFAULT_ECLIPSELINK_ORM_XML_RUNTIME_PATH.toString());
- OrmPersistentType ormPersistentType = getEntityMappings().addPersistentType(MappingKeys.ENTITY_TYPE_MAPPING_KEY, "model.Foo");
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- assertEquals(ormPersistentType, persistenceUnit.getPersistentType("model.Foo"));
-
- //test persistentType from eclipselink-orm.xml file that is implied(not specified) in the persistence.xml
- getXmlPersistenceUnit().getMappingFiles().remove(0);
- assertNotNull(persistenceUnit.getPersistentType("model.Foo"));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesAdapterTests.java
deleted file mode 100644
index 40d0e2f66f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesAdapterTests.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.GeneralProperties;
-
-/**
- * GeneralAdapterTests
- */
-@SuppressWarnings("nls")
-public class GeneralPropertiesAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private GeneralProperties generalProperties;
-
- public static final String EXCLUDE_ECLIPSELINK_ORM_KEY = GeneralProperties.ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM;
- public static final Boolean EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE = false;
- public static final Boolean EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE_2 = ! EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE;
-
-
- public GeneralPropertiesAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.generalProperties = this.subject.getGeneralProperties();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.generalProperties.addPropertyChangeListener(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 1;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 2; // misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(EXCLUDE_ECLIPSELINK_ORM_KEY, EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
-
- return;
- }
-
-
- // ********** ExcludeEclipselinkOrm tests **********
- public void testSetExcludeEclipselinkOrm() throws Exception {
- this.verifyModelInitialized(
- EXCLUDE_ECLIPSELINK_ORM_KEY,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE);
- this.verifySetProperty(
- EXCLUDE_ECLIPSELINK_ORM_KEY,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE_2);
- }
-
- public void testAddRemoveExcludeEclipselinkOrm() throws Exception {
- this.verifyAddRemoveProperty(
- EXCLUDE_ECLIPSELINK_ORM_KEY,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE_2);
- }
-
-
-
- // ********** get/set property **********
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY))
- modelValue = this.generalProperties.getExcludeEclipselinkOrm();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY))
- this.generalProperties.setExcludeEclipselinkOrm((Boolean) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.generalProperties;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesValueModelTests.java
deleted file mode 100644
index d27a2a11ef..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/GeneralPropertiesValueModelTests.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.GeneralProperties;
-
-/**
- * GeneralPropertyValueModelTests
- */
-@SuppressWarnings("nls")
-public class GeneralPropertiesValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private GeneralProperties generalProperty;
-
- private ModifiablePropertyValueModel<Boolean> excludeEclipselinkOrmHolder;
- private PropertyChangeListener excludeEclipselinkOrmListener;
- private PropertyChangeEvent excludeEclipselinkOrmEvent;
-
- public static final Boolean EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE = Boolean.FALSE;
-
- public GeneralPropertiesValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.generalProperty = this.subject.getGeneralProperties(); // Subject
- PropertyValueModel<GeneralProperties> generalPropertyHolder = new SimplePropertyValueModel<GeneralProperties>(this.generalProperty);
-
- this.excludeEclipselinkOrmHolder = this.buildExcludeEclipselinkOrmAA(generalPropertyHolder);
- this.excludeEclipselinkOrmListener = this.buildExcludeEclipselinkOrmChangeListener();
- this.excludeEclipselinkOrmHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.excludeEclipselinkOrmListener);
- this.excludeEclipselinkOrmEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectGeneralProperty = (AbstractModel) this.generalProperty; // Subject
-
- PropertyAspectAdapter<GeneralProperties, Boolean> excludeEclipselinkOrmAA =
- (PropertyAspectAdapter<GeneralProperties, Boolean>) this.excludeEclipselinkOrmHolder;
- assertTrue(excludeEclipselinkOrmAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectGeneralProperty.hasAnyPropertyChangeListeners(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY));
-
- excludeEclipselinkOrmAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.excludeEclipselinkOrmListener);
- assertFalse(subjectGeneralProperty.hasAnyPropertyChangeListeners(GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY));
- assertFalse(excludeEclipselinkOrmAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- GeneralProperties.ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM,
- EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.generalProperty;
- }
-
- // ****** ExcludeEclipselinkOrm *******
- private ModifiablePropertyValueModel<Boolean> buildExcludeEclipselinkOrmAA(PropertyValueModel<GeneralProperties> subjectHolder) {
- return new PropertyAspectAdapter<GeneralProperties, Boolean>(subjectHolder, GeneralProperties.EXCLUDE_ECLIPSELINK_ORM_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getExcludeEclipselinkOrm();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setExcludeEclipselinkOrm(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildExcludeEclipselinkOrmChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- GeneralPropertiesValueModelTests.this.excludeEclipselinkOrmEvent = e;
- }
- };
- }
-
- // ****** Tests *******
- public void testValue() {
- // ****** ExcludeEclipselinkOrm *******
- this.verifyExcludeEclipselinkOrmAAValue(EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE);
- assertEquals(GeneralProperties.DEFAULT_EXCLUDE_ECLIPSELINK_ORM, this.generalProperty.getDefaultExcludeEclipselinkOrm());
- }
-
- public void testSetValue() throws Exception {
- // ****** ExcludeEclipselinkOrm *******
- this.excludeEclipselinkOrmEvent = null;
- this.verifyHasListeners(this.excludeEclipselinkOrmHolder, PropertyValueModel.VALUE);
- Boolean newExcludeEclipselinkOrm = !EXCLUDE_ECLIPSELINK_ORM_TEST_VALUE;
- // Modify the property holder
- this.excludeEclipselinkOrmHolder.setValue(newExcludeEclipselinkOrm);
- this.verifyExcludeEclipselinkOrmAAValue(newExcludeEclipselinkOrm);
- assertNotNull(this.excludeEclipselinkOrmEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- // ****** ExcludeEclipselinkOrm *******
- this.excludeEclipselinkOrmEvent = null;
- // Setting the property holder
- this.excludeEclipselinkOrmHolder.setValue(null);
- // testing Holder
- this.verifyExcludeEclipselinkOrmAAValue(null);
- assertNotNull(this.excludeEclipselinkOrmEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(GeneralProperties.ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM, notDeleted);
- }
-
- // ****** convenience methods *******
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyExcludeEclipselinkOrmAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.generalProperty.getExcludeEclipselinkOrm(),
- this.excludeEclipselinkOrmHolder,
- GeneralProperties.ECLIPSELINK_EXCLUDE_ECLIPSELINK_ORM);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java
deleted file mode 100644
index 3525425419..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/JptEclipseLinkCorePersistenceContextModelTests.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class JptEclipseLinkCorePersistenceContextModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCorePersistenceContextModelTests.class.getName());
- suite.addTestSuite(EclipseLinkPersistenceUnitTests.class);
- suite.addTestSuite(GeneralPropertiesValueModelTests.class);
- suite.addTestSuite(GeneralPropertiesAdapterTests.class);
-// suite.addTestSuite(ConnectionValueModelTests.class);
- suite.addTestSuite(EclipseLinkConnectionTests.class);
- suite.addTestSuite(CustomizationValueModelTests.class);
- suite.addTestSuite(EclipseLinkCustomizationTests.class);
- suite.addTestSuite(CachingValueModelTests.class);
- suite.addTestSuite(CachingAdapterTests.class);
- suite.addTestSuite(LoggingValueModelTests.class);
- suite.addTestSuite(LoggingAdapterTests.class);
- suite.addTestSuite(OptionsValueModelTests.class);
- suite.addTestSuite(OptionsAdapterTests.class);
- suite.addTestSuite(SchemaGenerationValueModelTests.class);
- suite.addTestSuite(SchemaGenerationBasicAdapterTests.class);
- suite.addTestSuite(SchemaGenerationAdapterTests.class);
- suite.addTestSuite(EclipseLink2_0ConnectionTests.class);
- suite.addTestSuite(EclipseLink2_0LoggingTests.class);
- suite.addTestSuite(EclipseLink2_0OptionsTests.class);
- suite.addTestSuite(EclipseLink2_2JpaMetadataConversionTests.class);
- return suite;
- }
-
- private JptEclipseLinkCorePersistenceContextModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingAdapterTests.java
deleted file mode 100644
index 2b73639acd..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingAdapterTests.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logger;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.LoggingLevel;
-
-/**
- * Tests the update of model objects by the Logging adapter when the
- * PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class LoggingAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Logging logging;
-
- public static final String LEVEL_KEY = Logging.ECLIPSELINK_LEVEL;
- public static final LoggingLevel LEVEL_TEST_VALUE = LoggingLevel.fine;
- public static final LoggingLevel LEVEL_TEST_VALUE_2 = LoggingLevel.finest;
-
- public static final String TIMESTAMP_KEY = Logging.ECLIPSELINK_TIMESTAMP;
- public static final Boolean TIMESTAMP_TEST_VALUE = false;
- public static final Boolean TIMESTAMP_TEST_VALUE_2 = ! TIMESTAMP_TEST_VALUE;
-
- public static final String THREAD_KEY = Logging.ECLIPSELINK_THREAD;
- public static final Boolean THREAD_TEST_VALUE = false;
- public static final Boolean THREAD_TEST_VALUE_2 = ! THREAD_TEST_VALUE;
-
- public static final String SESSION_KEY = Logging.ECLIPSELINK_SESSION;
- public static final Boolean SESSION_TEST_VALUE = false;
- public static final Boolean SESSION_TEST_VALUE_2 = ! SESSION_TEST_VALUE;
-
- public static final String EXCEPTIONS_KEY = Logging.ECLIPSELINK_EXCEPTIONS;
- public static final Boolean EXCEPTIONS_TEST_VALUE = false;
- public static final Boolean EXCEPTIONS_TEST_VALUE_2 = ! EXCEPTIONS_TEST_VALUE;
-
- private static final String LOG_FILE_LOCATION_KEY = Logging.ECLIPSELINK_LOG_FILE_LOCATION;
- private static final String LOG_FILE_LOCATION_TEST_VALUE = "C:/temp";
- private static final String LOG_FILE_LOCATION_TEST_VALUE_2 = "C:/tmp";
-
- private static final String LOGGER_KEY = Logging.ECLIPSELINK_LOGGER;
- private static final Logger LOGGER_TEST_VALUE = Logger.java_logger;
- private static final String LOGGER_TEST_VALUE_2 = "custom.logger.test";
-
- public LoggingAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.logging = this.subject.getLogging();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.logging.addPropertyChangeListener(Logging.LEVEL_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.TIMESTAMP_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.THREAD_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.SESSION_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.EXCEPTIONS_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.LOG_FILE_LOCATION_PROPERTY, propertyChangeListener);
- this.logging.addPropertyChangeListener(Logging.LOGGER_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 7;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(TIMESTAMP_KEY, TIMESTAMP_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty(LEVEL_KEY, LEVEL_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty(THREAD_KEY, THREAD_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(SESSION_KEY, SESSION_TEST_VALUE.toString());
- this.persistenceUnitSetProperty(EXCEPTIONS_KEY, EXCEPTIONS_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(LOG_FILE_LOCATION_KEY, LOG_FILE_LOCATION_TEST_VALUE);
- this.persistenceUnitSetProperty(LOGGER_KEY, LOGGER_TEST_VALUE);
- return;
- }
-
- // ********** Level tests **********
- public void testSetLevel() throws Exception {
- this.verifyModelInitialized(
- LEVEL_KEY,
- LEVEL_TEST_VALUE);
- this.verifySetProperty(
- LEVEL_KEY,
- LEVEL_TEST_VALUE,
- LEVEL_TEST_VALUE_2);
- }
-
- public void testAddRemoveLevel() throws Exception {
- this.verifyAddRemoveProperty(
- LEVEL_KEY,
- LEVEL_TEST_VALUE,
- LEVEL_TEST_VALUE_2);
- }
-
- // ********** Timestamp tests **********
- public void testSetTimestamp() throws Exception {
- this.verifyModelInitialized(
- TIMESTAMP_KEY,
- TIMESTAMP_TEST_VALUE);
- this.verifySetProperty(
- TIMESTAMP_KEY,
- TIMESTAMP_TEST_VALUE,
- TIMESTAMP_TEST_VALUE_2);
- }
-
- public void testAddRemoveTimestamp() throws Exception {
- this.verifyAddRemoveProperty(
- TIMESTAMP_KEY,
- TIMESTAMP_TEST_VALUE,
- TIMESTAMP_TEST_VALUE_2);
- }
-
- // ********** Thread tests **********
- public void testSetThread() throws Exception {
- this.verifyModelInitialized(
- THREAD_KEY,
- THREAD_TEST_VALUE);
- this.verifySetProperty(
- THREAD_KEY,
- THREAD_TEST_VALUE,
- THREAD_TEST_VALUE_2);
- }
-
- public void testAddRemoveThread() throws Exception {
- this.verifyAddRemoveProperty(
- THREAD_KEY,
- THREAD_TEST_VALUE,
- THREAD_TEST_VALUE_2);
- }
-
- // ********** Session tests **********
- public void testSetSession() throws Exception {
- this.verifyModelInitialized(
- SESSION_KEY,
- SESSION_TEST_VALUE);
- this.verifySetProperty(
- SESSION_KEY,
- SESSION_TEST_VALUE,
- SESSION_TEST_VALUE_2);
- }
-
- public void testAddRemoveSession() throws Exception {
- this.verifyAddRemoveProperty(
- SESSION_KEY,
- SESSION_TEST_VALUE,
- SESSION_TEST_VALUE_2);
- }
-
- // ********** Exceptions tests **********
- public void testSetExceptions() throws Exception {
- this.verifyModelInitialized(
- EXCEPTIONS_KEY,
- EXCEPTIONS_TEST_VALUE);
- this.verifySetProperty(
- EXCEPTIONS_KEY,
- EXCEPTIONS_TEST_VALUE,
- EXCEPTIONS_TEST_VALUE_2);
- }
-
- public void testAddRemoveExceptions() throws Exception {
- this.verifyAddRemoveProperty(
- EXCEPTIONS_KEY,
- EXCEPTIONS_TEST_VALUE,
- EXCEPTIONS_TEST_VALUE_2);
- }
-
- // ********** LogFileLocation **********
- public void testSetLogFileLocation() throws Exception {
- this.verifyModelInitialized(
- LOG_FILE_LOCATION_KEY,
- LOG_FILE_LOCATION_TEST_VALUE);
- this.verifySetProperty(
- LOG_FILE_LOCATION_KEY,
- LOG_FILE_LOCATION_TEST_VALUE,
- LOG_FILE_LOCATION_TEST_VALUE_2);
- }
-
- public void testAddRemoveLogFileLocation() throws Exception {
- this.verifyAddRemoveProperty(
- LOG_FILE_LOCATION_KEY,
- LOG_FILE_LOCATION_TEST_VALUE,
- LOG_FILE_LOCATION_TEST_VALUE_2);
- }
-
- public void testSetEmptyFileLocation() throws Exception {
- String puKey = LOG_FILE_LOCATION_KEY;
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- String propertyName = this.getModel().propertyIdOf(property);
-
- // Set FileLocation to "" & verify that the property is deleted
- this.verifyPuHasProperty(puKey, "persistenceUnit.properties doesn't contains: ");
- this.setProperty(propertyName, "");
-
- this.verifyPuHasNotProperty(puKey, "Property was not deleted");
- this.verifyPutProperty(propertyName, null);
- assertNull(this.getPersistenceUnit().getProperty(puKey));
- }
-
- // ********** Logger tests **********
- public void testSetLogger() throws Exception {
- this.verifyModelInitialized(
- LOGGER_KEY,
- this.getPropertyStringValueOf(LOGGER_TEST_VALUE)); // model is storing EclipseLinkStringValue
- // verify set enum value
- this.verifySetProperty(
- LOGGER_KEY,
- LOGGER_TEST_VALUE,
- LOGGER_TEST_VALUE_2);
- // verify set custom and literal value
- this.verifySetLogger(
- LOGGER_KEY,
- LOGGER_TEST_VALUE,
- LOGGER_TEST_VALUE_2);
- }
-
- public void testAddRemoveLogger() throws Exception {
- this.verifyAddRemoveProperty(
- LOGGER_KEY,
- LOGGER_TEST_VALUE,
- LOGGER_TEST_VALUE_2);
- }
-
- /**
- * Verifies setting custom logger and literals.
- */
- protected void verifySetLogger(String elKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(elKey);
- String propertyName = this.getModel().propertyIdOf(property);
- // test set custom logger.
- this.clearEvent();
- this.setProperty(propertyName, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // test set (Logger) null
- this.clearEvent();
- this.logging.setLogger((Logger) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
-
- // test set enum literal
- this.clearEvent();
- this.setProperty(propertyName, testValue1.toString());
- assertNotNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, this.getPropertyStringValueOf(testValue1));
-
- // test set (String) null
- this.clearEvent();
- this.logging.setLogger((String) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Logging.LEVEL_PROPERTY))
- this.logging.setLevel((LoggingLevel) newValue);
- else if (propertyName.equals(Logging.TIMESTAMP_PROPERTY))
- this.logging.setTimestamp((Boolean) newValue);
- else if (propertyName.equals(Logging.THREAD_PROPERTY))
- this.logging.setThread((Boolean) newValue);
- else if (propertyName.equals(Logging.SESSION_PROPERTY))
- this.logging.setSession((Boolean) newValue);
- else if (propertyName.equals(Logging.EXCEPTIONS_PROPERTY))
- this.logging.setExceptions((Boolean) newValue);
- else if (propertyName.equals(Logging.LOG_FILE_LOCATION_PROPERTY))
- this.logging.setLogFileLocation((String) newValue);
- else if (propertyName.equals(Logging.LOGGER_PROPERTY)) {
- if (newValue.getClass().isEnum())
- this.logging.setLogger((Logger) newValue);
- else
- this.logging.setLogger((String) newValue);
- }
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Logging.LEVEL_PROPERTY))
- modelValue = this.logging.getLevel();
- else if (propertyName.equals(Logging.TIMESTAMP_PROPERTY))
- modelValue = this.logging.getTimestamp();
- else if (propertyName.equals(Logging.THREAD_PROPERTY))
- modelValue = this.logging.getThread();
- else if (propertyName.equals(Logging.SESSION_PROPERTY))
- modelValue = this.logging.getSession();
- else if (propertyName.equals(Logging.EXCEPTIONS_PROPERTY))
- modelValue = this.logging.getExceptions();
- else if (propertyName.equals(Logging.LOG_FILE_LOCATION_PROPERTY))
- modelValue = this.logging.getLogFileLocation();
- else if (propertyName.equals(Logging.LOGGER_PROPERTY))
- modelValue = this.logging.getLogger();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void verifyPutProperty(String propertyName, Object expectedValue) throws Exception {
- Object expectedValue_ = expectedValue;
- if (propertyName.equals(Logging.LOGGER_PROPERTY)) {
-
- expectedValue_ = (expectedValue != null && expectedValue.getClass().isEnum()) ?
- this.getPropertyStringValueOf(LOGGER_TEST_VALUE) : // model is storing EclipseLinkStringValue
- expectedValue;
- }
- super.verifyPutProperty(propertyName, expectedValue_);
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.logging;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingValueModelTests.java
deleted file mode 100644
index 17f80fc62b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/LoggingValueModelTests.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Logging;
-
-/**
- * LoggingValueModelTests
- */
-@SuppressWarnings("nls")
-public class LoggingValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Logging logging;
-
- private ModifiablePropertyValueModel<Boolean> timestampHolder;
- private PropertyChangeListener timestampListener;
- private PropertyChangeEvent timestampEvent;
-
- public static final Boolean TIMESTAMP_TEST_VALUE = Boolean.FALSE;
-
- public LoggingValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.logging = this.subject.getLogging(); // Subject
- PropertyValueModel<Logging> loggingHolder = new SimplePropertyValueModel<Logging>(this.logging);
-
- this.timestampHolder = this.buildTimestampAA(loggingHolder);
- this.timestampListener = this.buildTimestampChangeListener();
- this.timestampHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.timestampListener);
- this.timestampEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectLogging = (AbstractModel) this.logging; // Subject
-
- PropertyAspectAdapter<Logging, Boolean> timestampAA =
- (PropertyAspectAdapter<Logging, Boolean>) this.timestampHolder;
- assertTrue(timestampAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectLogging.hasAnyPropertyChangeListeners(Logging.TIMESTAMP_PROPERTY));
-
- timestampAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.timestampListener);
- assertFalse(subjectLogging.hasAnyPropertyChangeListeners(Logging.TIMESTAMP_PROPERTY));
- assertFalse(timestampAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- Logging.ECLIPSELINK_TIMESTAMP,
- TIMESTAMP_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.logging;
- }
-
- // ****** Timestamp *******
- private ModifiablePropertyValueModel<Boolean> buildTimestampAA(PropertyValueModel<Logging> subjectHolder) {
- return new PropertyAspectAdapter<Logging, Boolean>(subjectHolder, Logging.TIMESTAMP_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getTimestamp();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setTimestamp(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildTimestampChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- LoggingValueModelTests.this.timestampEvent = e;
- }
- };
- }
-
- // ****** Tests *******
- public void testValue() {
- // ****** Timestamp *******
- this.verifyTimestampAAValue(TIMESTAMP_TEST_VALUE);
- assertEquals(Logging.DEFAULT_TIMESTAMP, this.logging.getDefaultTimestamp());
- }
-
- public void testSetValue() throws Exception {
- // ****** Timestamp *******
- this.timestampEvent = null;
- this.verifyHasListeners(this.timestampHolder, PropertyValueModel.VALUE);
- Boolean newTimestamp = !TIMESTAMP_TEST_VALUE;
- // Modify the property holder
- this.timestampHolder.setValue(newTimestamp);
- this.verifyTimestampAAValue(newTimestamp);
- assertNotNull(this.timestampEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- // ****** Timestamp *******
- this.timestampEvent = null;
- // Setting the property holder
- this.timestampHolder.setValue(null);
- // testing Holder
- this.verifyTimestampAAValue(null);
- assertNotNull(this.timestampEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Logging.ECLIPSELINK_TIMESTAMP, notDeleted);
- }
-
- // ****** convenience methods *******
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyTimestampAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.logging.getTimestamp(),
- this.timestampHolder,
- Logging.ECLIPSELINK_TIMESTAMP);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsAdapterTests.java
deleted file mode 100644
index 6f4f33c3f3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsAdapterTests.java
+++ /dev/null
@@ -1,379 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2008, 2011 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetDatabase;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.TargetServer;
-
-/**
- * Tests the update of model objects by the Option adapter when the
- * PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class OptionsAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Options options;
-
- private static final String SESSION_NAME_KEY = Options.ECLIPSELINK_SESSION_NAME;
- private static final String SESSION_NAME_TEST_VALUE = "session-name.test";
- private static final String SESSION_NAME_TEST_VALUE_2 = "session-name-2.test";
-
- private static final String SESSIONS_XML_KEY = Options.ECLIPSELINK_SESSIONS_XML;
- private static final String SESSIONS_XML_TEST_VALUE = "sessions-xml.test";
- private static final String SESSIONS_XML_TEST_VALUE_2 = "sessions-xml-2.test";
-
- public static final String TARGET_DATABASE_KEY = Options.ECLIPSELINK_TARGET_DATABASE;
- public static final TargetDatabase TARGET_DATABASE_TEST_VALUE = TargetDatabase.cloudscape;
- public static final String TARGET_DATABASE_TEST_VALUE_2 = "custom.targetDatabase.test";
-
- private static final String TARGET_SERVER_KEY = Options.ECLIPSELINK_TARGET_SERVER;
- private static final TargetServer TARGET_SERVER_TEST_VALUE = TargetServer.weblogic_9;
- private static final String TARGET_SERVER_TEST_VALUE_2 = "custom.targetServer.test";
-
- public static final String INCLUDE_DESCRIPTOR_QUERIES_KEY = Options.ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES;
- public static final Boolean INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE = false;
- public static final Boolean INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE_2 = ! INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE;
-
- public static final String SESSION_EVENT_LISTENER_KEY = Options.ECLIPSELINK_SESSION_EVENT_LISTENER;
- public static final String SESSION_EVENT_LISTENER_TEST_VALUE = "acme.CustomSessionEventListener";
- public static final String SESSION_EVENT_LISTENER_TEST_VALUE_2 = "oracle.sessions.CustomSessionEventListener";
-
- public static final String TEMPORAL_MUTABLE_KEY = Options.ECLIPSELINK_TEMPORAL_MUTABLE;
- public static final Boolean TEMPORAL_MUTABLE_TEST_VALUE = true;
- public static final Boolean TEMPORAL_MUTABLE_TEST_VALUE_2 = ! TEMPORAL_MUTABLE_TEST_VALUE;
-
- public OptionsAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.options = this.subject.getOptions();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
-
- this.options.addPropertyChangeListener(Options.SESSION_NAME_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.SESSIONS_XML_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.TARGET_DATABASE_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.TARGET_SERVER_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.SESSION_EVENT_LISTENER_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(
- Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY, propertyChangeListener);
- this.options.addPropertyChangeListener(Options.TEMPORAL_MUTABLE_PROPERTY, propertyChangeListener);
-
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.modelPropertiesSizeOriginal = 7;
- this.propertiesTotal = this.modelPropertiesSizeOriginal + 4; // 4 misc properties
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty(SESSION_NAME_KEY, SESSION_NAME_TEST_VALUE);
- this.persistenceUnitSetProperty(SESSIONS_XML_KEY, SESSIONS_XML_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.1", "value.1");
- this.persistenceUnitSetProperty(INCLUDE_DESCRIPTOR_QUERIES_KEY, INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE.toString());
- this.persistenceUnitSetProperty("misc.property.2", "value.2");
- this.persistenceUnitSetProperty("misc.property.3", "value.3");
- this.persistenceUnitSetProperty(TARGET_DATABASE_KEY, TARGET_DATABASE_TEST_VALUE);
- this.persistenceUnitSetProperty(TARGET_SERVER_KEY, TARGET_SERVER_TEST_VALUE);
- this.persistenceUnitSetProperty(SESSION_EVENT_LISTENER_KEY, SESSION_EVENT_LISTENER_TEST_VALUE);
- this.persistenceUnitSetProperty("misc.property.4", "value.4");
- this.persistenceUnitSetProperty(TEMPORAL_MUTABLE_KEY, TEMPORAL_MUTABLE_TEST_VALUE.toString());
- return;
- }
-
- // ********** Listeners **********
-
- // ********** SessionName tests **********
- public void testSetSessionName() throws Exception {
- this.verifyModelInitialized(
- SESSION_NAME_KEY,
- SESSION_NAME_TEST_VALUE);
- this.verifySetProperty(
- SESSION_NAME_KEY,
- SESSION_NAME_TEST_VALUE,
- SESSION_NAME_TEST_VALUE_2);
- }
-
- public void testAddRemoveSessionName() throws Exception {
- this.verifyAddRemoveProperty(
- SESSION_NAME_KEY,
- SESSION_NAME_TEST_VALUE,
- SESSION_NAME_TEST_VALUE_2);
- }
-
- // ********** SessionsXml tests **********
- public void testSetSessionsXml() throws Exception {
- this.verifyModelInitialized(
- SESSIONS_XML_KEY,
- SESSIONS_XML_TEST_VALUE);
- this.verifySetProperty(
- SESSIONS_XML_KEY,
- SESSIONS_XML_TEST_VALUE,
- SESSIONS_XML_TEST_VALUE_2);
- }
-
- public void testAddRemoveSessionsXml() throws Exception {
- this.verifyAddRemoveProperty(
- SESSIONS_XML_KEY,
- SESSIONS_XML_TEST_VALUE,
- SESSIONS_XML_TEST_VALUE_2);
- }
-
- // ********** IncludeDescriptorQueries tests **********
- public void testSetIncludeDescriptorQueries() throws Exception {
- this.verifyModelInitialized(
- INCLUDE_DESCRIPTOR_QUERIES_KEY,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE);
- this.verifySetProperty(
- INCLUDE_DESCRIPTOR_QUERIES_KEY,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE_2);
- }
-
- public void testAddRemoveIncludeDescriptorQueries() throws Exception {
- this.verifyAddRemoveProperty(
- INCLUDE_DESCRIPTOR_QUERIES_KEY,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE_2);
- }
-
- // ********** TargetDatabase tests **********
- public void testSetTargetDatabase() throws Exception {
- this.verifyModelInitialized(
- TARGET_DATABASE_KEY,
- this.getPropertyStringValueOf(TARGET_DATABASE_TEST_VALUE)); // model is storing EclipseLinkStringValue
- this.verifySetProperty(
- TARGET_DATABASE_KEY,
- TARGET_DATABASE_TEST_VALUE,
- TARGET_DATABASE_TEST_VALUE_2);
- // verify set custom and literal value
- this.verifySetTargetDatabase(
- TARGET_DATABASE_KEY,
- TARGET_DATABASE_TEST_VALUE,
- TARGET_DATABASE_TEST_VALUE_2);
- }
-
- public void testAddRemoveTargetDatabase() throws Exception {
- this.verifyAddRemoveProperty(
- TARGET_DATABASE_KEY,
- TARGET_DATABASE_TEST_VALUE,
- TARGET_DATABASE_TEST_VALUE_2);
- }
-
- /**
- * Verifies setting custom targetDatabase and literals.
- */
- protected void verifySetTargetDatabase(String elKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(elKey);
- String propertyName = this.getModel().propertyIdOf(property);
- // test set custom targetDatabase.
- this.clearEvent();
- this.setProperty(propertyName, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // test set (TargetDatabase) null
- this.clearEvent();
- this.options.setTargetDatabase((TargetDatabase) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
-
- // test set enum literal
- this.clearEvent();
- this.setProperty(propertyName, testValue1.toString());
- assertNotNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, this.getPropertyStringValueOf(testValue1));
-
- // test set (String) null
- this.clearEvent();
- this.options.setTargetDatabase((String) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
- }
-
- // ********** TargetServer tests **********
- public void testSetTargetServer() throws Exception {
- this.verifyModelInitialized(
- TARGET_SERVER_KEY,
- this.getPropertyStringValueOf(TARGET_SERVER_TEST_VALUE)); // model is storing EclipseLinkStringValue
- // verify set enum value
- this.verifySetProperty(
- TARGET_SERVER_KEY,
- TARGET_SERVER_TEST_VALUE,
- TARGET_SERVER_TEST_VALUE_2);
- // verify set custom and literal value
- this.verifySetTargetServer(
- TARGET_SERVER_KEY,
- TARGET_SERVER_TEST_VALUE,
- TARGET_SERVER_TEST_VALUE_2);
- }
-
- public void testAddRemoveTargetServer() throws Exception {
- this.verifyAddRemoveProperty(
- TARGET_SERVER_KEY,
- TARGET_SERVER_TEST_VALUE,
- TARGET_SERVER_TEST_VALUE_2);
- }
-
- /**
- * Verifies setting custom targetServer and literals.
- */
- protected void verifySetTargetServer(String elKey, Object testValue1, Object testValue2) throws Exception {
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(elKey);
- String propertyName = this.getModel().propertyIdOf(property);
- // test set custom targetServer.
- this.clearEvent();
- this.setProperty(propertyName, testValue2);
- this.verifyPutProperty(propertyName, testValue2);
-
- // test set (TargetServer) null
- this.clearEvent();
- this.options.setTargetServer((TargetServer) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
-
- // test set enum literal
- this.clearEvent();
- this.setProperty(propertyName, testValue1.toString());
- assertNotNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, this.getPropertyStringValueOf(testValue1));
-
- // test set (String) null
- this.clearEvent();
- this.options.setTargetServer((String) null);
- assertNull(this.getPersistenceUnit().getProperty(elKey));
- this.verifyPutProperty(propertyName, null);
- }
-
- // ********** EventListener tests **********
- public void testSetEventListener() throws Exception {
- this.verifyModelInitialized(
- SESSION_EVENT_LISTENER_KEY,
- SESSION_EVENT_LISTENER_TEST_VALUE);
- this.verifySetProperty(
- SESSION_EVENT_LISTENER_KEY,
- SESSION_EVENT_LISTENER_TEST_VALUE,
- SESSION_EVENT_LISTENER_TEST_VALUE_2);
- }
-
- public void testAddRemoveEventListener() throws Exception {
- this.verifyAddRemoveProperty(
- SESSION_EVENT_LISTENER_KEY,
- SESSION_EVENT_LISTENER_TEST_VALUE,
- SESSION_EVENT_LISTENER_TEST_VALUE_2);
- }
-
- // ********** TemporalMutable tests **********
- public void testSetTemporalMutable() throws Exception {
- this.verifyModelInitialized(
- TEMPORAL_MUTABLE_KEY,
- TEMPORAL_MUTABLE_TEST_VALUE);
- this.verifySetProperty(
- TEMPORAL_MUTABLE_KEY,
- TEMPORAL_MUTABLE_TEST_VALUE,
- TEMPORAL_MUTABLE_TEST_VALUE_2);
- }
-
- public void testAddRemoveTemporalMutable() throws Exception {
- this.verifyAddRemoveProperty(
- TEMPORAL_MUTABLE_KEY,
- TEMPORAL_MUTABLE_TEST_VALUE,
- TEMPORAL_MUTABLE_TEST_VALUE_2);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- if (propertyName.equals(Options.SESSION_NAME_PROPERTY))
- this.options.setSessionName((String) newValue);
- else if (propertyName.equals(Options.SESSIONS_XML_PROPERTY))
- this.options.setSessionsXml((String) newValue);
- else if (propertyName.equals(Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY))
- this.options.setIncludeDescriptorQueries((Boolean) newValue);
- else if (propertyName.equals(Options.TARGET_DATABASE_PROPERTY))
- this.setTargetDatabaseProperty(newValue);
- else if (propertyName.equals(Options.TARGET_SERVER_PROPERTY))
- this.setTargetServerProperty(newValue);
- else if (propertyName.equals(Options.SESSION_EVENT_LISTENER_PROPERTY))
- this.options.setEventListener((String) newValue);
- else if (propertyName.equals(Options.TEMPORAL_MUTABLE_PROPERTY))
- this.options.setTemporalMutable((Boolean) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- private void setTargetDatabaseProperty(Object newValue) {
- if (newValue.getClass().isEnum())
- this.options.setTargetDatabase((TargetDatabase) newValue);
- else
- this.options.setTargetDatabase((String) newValue);
- }
-
- private void setTargetServerProperty(Object newValue) {
- if (newValue.getClass().isEnum())
- this.options.setTargetServer((TargetServer) newValue);
- else
- this.options.setTargetServer((String) newValue);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(Options.SESSION_NAME_PROPERTY))
- modelValue = this.options.getSessionName();
- else if (propertyName.equals(Options.SESSIONS_XML_PROPERTY))
- modelValue = this.options.getSessionsXml();
- else if (propertyName.equals(Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY))
- modelValue = this.options.getIncludeDescriptorQueries();
- else if (propertyName.equals(Options.TARGET_DATABASE_PROPERTY))
- modelValue = this.options.getTargetDatabase();
- else if (propertyName.equals(Options.TARGET_SERVER_PROPERTY))
- modelValue = this.options.getTargetServer();
- else if (propertyName.equals(Options.SESSION_EVENT_LISTENER_PROPERTY))
- modelValue = this.options.getEventListener();
- else if (propertyName.equals(Options.TEMPORAL_MUTABLE_PROPERTY))
- modelValue = this.options.getTemporalMutable();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected void verifyPutProperty(String propertyName, Object expectedValue) throws Exception {
- Object expectedValue_ = expectedValue;
- if (propertyName.equals(Options.TARGET_DATABASE_PROPERTY) ||
- propertyName.equals(Options.TARGET_SERVER_PROPERTY)) {
-
- expectedValue_ = this.convertToEclipseLinkStringValue(expectedValue);
- }
-
- super.verifyPutProperty(propertyName, expectedValue_);
- }
-
- private String convertToEclipseLinkStringValue(Object expectedValue) {
- return (String) ((expectedValue != null && expectedValue.getClass().isEnum()) ?
- this.getPropertyStringValueOf(expectedValue) : // model is storing EclipseLinkStringValue
- expectedValue); // already a EclipseLinkStringValue
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.options;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsValueModelTests.java
deleted file mode 100644
index 2ad99b8046..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/OptionsValueModelTests.java
+++ /dev/null
@@ -1,160 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.AbstractModel;
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.Options;
-
-/**
- * OptionsValueModelTests
- */
-public class OptionsValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private Options options;
-
- private ModifiablePropertyValueModel<Boolean> includeDescriptorQueriesHolder;
- private PropertyChangeListener includeDescriptorQueriesListener;
- private PropertyChangeEvent includeDescriptorQueriesEvent;
-
- public static final Boolean INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE = Boolean.FALSE;
-
- public OptionsValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.options = this.subject.getOptions(); // Subject
- PropertyValueModel<Options> optionsHolder = new SimplePropertyValueModel<Options>(this.options);
-
- this.includeDescriptorQueriesHolder = this.buildIncludeDescriptorQueriesAA(optionsHolder);
- this.includeDescriptorQueriesListener = this.buildIncludeDescriptorQueriesChangeListener();
- this.includeDescriptorQueriesHolder.addPropertyChangeListener(PropertyValueModel.VALUE, this.includeDescriptorQueriesListener);
- this.includeDescriptorQueriesEvent = null;
- }
-
- public void testHasListeners() {
- AbstractModel subjectOptions = (AbstractModel) this.options; // Subject
-
- PropertyAspectAdapter<Options, Boolean> includeDescriptorQueriesAA =
- (PropertyAspectAdapter<Options, Boolean>) this.includeDescriptorQueriesHolder;
- assertTrue(includeDescriptorQueriesAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- assertTrue(subjectOptions.hasAnyPropertyChangeListeners(Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY));
-
- includeDescriptorQueriesAA.removePropertyChangeListener(PropertyValueModel.VALUE, this.includeDescriptorQueriesListener);
- assertFalse(subjectOptions.hasAnyPropertyChangeListeners(Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY));
- assertFalse(includeDescriptorQueriesAA.hasAnyPropertyChangeListeners(PropertyValueModel.VALUE));
- }
-
- /**
- * Initializes directly the PU properties before testing.
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- Options.ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES,
- INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.options;
- }
-
- // ****** IncludeDescriptorQueries *******
- private ModifiablePropertyValueModel<Boolean> buildIncludeDescriptorQueriesAA(PropertyValueModel<Options> subjectHolder) {
- return new PropertyAspectAdapter<Options, Boolean>(subjectHolder, Options.SESSION_INCLUDE_DESCRIPTOR_QUERIES_PROPERTY) {
- @Override
- protected Boolean buildValue_() {
- return this.subject.getIncludeDescriptorQueries();
- }
-
- @Override
- protected void setValue_(Boolean enumValue) {
- this.subject.setIncludeDescriptorQueries(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildIncludeDescriptorQueriesChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- OptionsValueModelTests.this.includeDescriptorQueriesEvent = e;
- }
- };
- }
-
- // ****** Tests *******
- public void testValue() {
- // ****** IncludeDescriptorQueries *******
- this.verifyIncludeDescriptorQueriesAAValue(INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE);
- assertEquals(Options.DEFAULT_SESSION_INCLUDE_DESCRIPTOR_QUERIES, this.options.getDefaultIncludeDescriptorQueries());
- }
-
- public void testSetValue() throws Exception {
- // ****** IncludeDescriptorQueries *******
- this.includeDescriptorQueriesEvent = null;
- this.verifyHasListeners(this.includeDescriptorQueriesHolder, PropertyValueModel.VALUE);
- Boolean newIncludeDescriptorQueries = !INCLUDE_DESCRIPTOR_QUERIES_TEST_VALUE;
- // Modify the property holder
- this.includeDescriptorQueriesHolder.setValue(newIncludeDescriptorQueries);
- this.verifyIncludeDescriptorQueriesAAValue(newIncludeDescriptorQueries);
- assertNotNull(this.includeDescriptorQueriesEvent);
- }
-
- public void testSetNullValue() {
- String notDeleted = "Property not deleted";
- // ****** IncludeDescriptorQueries *******
- this.includeDescriptorQueriesEvent = null;
- // Setting the property holder
- this.includeDescriptorQueriesHolder.setValue(null);
- // testing Holder
- this.verifyIncludeDescriptorQueriesAAValue(null);
- assertNotNull(this.includeDescriptorQueriesEvent);
- // testing PU properties
- this.verifyPuHasNotProperty(Options.ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES, notDeleted);
- }
-
- // ****** convenience methods *******
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyIncludeDescriptorQueriesAAValue(Boolean testValue) {
- this.verifyAAValue(
- testValue,
- this.options.getIncludeDescriptorQueries(),
- this.includeDescriptorQueriesHolder,
- Options.ECLIPSELINK_SESSION_INCLUDE_DESCRIPTOR_QUERIES);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationAdapterTests.java
deleted file mode 100644
index 6a666ce545..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationAdapterTests.java
+++ /dev/null
@@ -1,253 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-
-/**
- * Tests the update of OutputMode model object by the SchemaGeneration adapter
- * when the PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class SchemaGenerationAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private SchemaGeneration schemaGeneration;
-
- public static final String DDL_GENERATION_TYPE_KEY = SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE;
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE = DdlGenerationType.drop_and_create_tables;
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE_2 = DdlGenerationType.none;
-
- public static final String OUTPUT_MODE_KEY = SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE;
- public static final OutputMode OUTPUT_MODE_TEST_VALUE = OutputMode.sql_script;
- public static final OutputMode OUTPUT_MODE_TEST_VALUE_2 = OutputMode.database;
-
- private static final String CREATE_FILE_NAME_KEY = SchemaGeneration.ECLIPSELINK_CREATE_FILE_NAME;
- private static final String CREATE_FILE_NAME_TEST_VALUE = "create-file-name.test";
- private static final String CREATE_FILE_NAME_TEST_VALUE_2 = "create-file-name-2.test";
-
- private static final String DROP_FILE_NAME_KEY = SchemaGeneration.ECLIPSELINK_DROP_FILE_NAME;
- private static final String DROP_FILE_NAME_TEST_VALUE = "drop-file-name.test";
- private static final String DROP_FILE_NAME_TEST_VALUE_2 = "drop-file-name-2.test";
-
- private static final String APPLICATION_LOCATION_KEY = SchemaGeneration.ECLIPSELINK_APPLICATION_LOCATION;
- private static final String APPLICATION_LOCATION_TEST_VALUE = "C:/temp";
- private static final String APPLICATION_LOCATION_TEST_VALUE_2 = "C:/tmp";
-
- public SchemaGenerationAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.schemaGeneration = this.subject.getSchemaGeneration();
-
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.OUTPUT_MODE_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.CREATE_FILE_NAME_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.DROP_FILE_NAME_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.APPLICATION_LOCATION_PROPERTY, propertyChangeListener);
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing. Cannot use
- * Property Holder to initialize because it is not created yet
- */
- @Override
- protected void populatePu() {
- this.propertiesTotal = 9;
- this.modelPropertiesSizeOriginal = 5;
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("property.0", "value.0");
- this.persistenceUnitSetProperty(OUTPUT_MODE_KEY, this.getPropertyStringValueOf(OUTPUT_MODE_TEST_VALUE));
- this.persistenceUnitSetProperty("property.2", "value.2");
- this.persistenceUnitSetProperty("property.3", "value.3");
- this.persistenceUnitSetProperty("property.4", "value.4");
- this.persistenceUnitSetProperty(DDL_GENERATION_TYPE_KEY, this.getPropertyStringValueOf(DDL_GENERATION_TYPE_TEST_VALUE));
- this.persistenceUnitSetProperty(CREATE_FILE_NAME_KEY, CREATE_FILE_NAME_TEST_VALUE);
- this.persistenceUnitSetProperty(DROP_FILE_NAME_KEY, DROP_FILE_NAME_TEST_VALUE);
- this.persistenceUnitSetProperty(APPLICATION_LOCATION_KEY, APPLICATION_LOCATION_TEST_VALUE);
- return;
- }
-
- // ********** CreateFileName **********
- /**
- * Tests the update of CreateFileName property by the SchemaGeneration
- * adapter when the PU or the model changes.
- */
- public void testSetCreateFileName() throws Exception {
- this.verifyModelInitialized(
- CREATE_FILE_NAME_KEY,
- CREATE_FILE_NAME_TEST_VALUE);
- this.verifySetProperty(
- CREATE_FILE_NAME_KEY,
- CREATE_FILE_NAME_TEST_VALUE,
- CREATE_FILE_NAME_TEST_VALUE_2);
- }
-
- public void testAddRemoveCreateFileName() throws Exception {
- this.verifyAddRemoveProperty(
- CREATE_FILE_NAME_KEY,
- CREATE_FILE_NAME_TEST_VALUE,
- CREATE_FILE_NAME_TEST_VALUE_2);
- }
-
- // ********** DropFileName **********
- /**
- * Tests the update of DropFileName property by the SchemaGeneration adapter
- * when the PU or the model changes.
- */
- public void testSetDropFileName() throws Exception {
- this.verifyModelInitialized(
- DROP_FILE_NAME_KEY,
- DROP_FILE_NAME_TEST_VALUE);
- this.verifySetProperty(
- DROP_FILE_NAME_KEY,
- DROP_FILE_NAME_TEST_VALUE,
- DROP_FILE_NAME_TEST_VALUE_2);
- }
-
- public void testAddRemoveDropFileName() throws Exception {
- this.verifyAddRemoveProperty(
- DROP_FILE_NAME_KEY,
- DROP_FILE_NAME_TEST_VALUE,
- DROP_FILE_NAME_TEST_VALUE_2);
- }
-
- // ********** ApplicationLocation **********
- /**
- * Tests the update of ApplicationLocation property by the SchemaGeneration
- * adapter when the PU or the model changes.
- */
- public void testSetApplicationLocation() throws Exception {
- this.verifyModelInitialized(
- APPLICATION_LOCATION_KEY,
- APPLICATION_LOCATION_TEST_VALUE);
- this.verifySetProperty(
- APPLICATION_LOCATION_KEY,
- APPLICATION_LOCATION_TEST_VALUE,
- APPLICATION_LOCATION_TEST_VALUE_2);
- }
-
- public void testAddRemoveApplicationLocation() throws Exception {
- this.verifyAddRemoveProperty(
- APPLICATION_LOCATION_KEY,
- APPLICATION_LOCATION_TEST_VALUE,
- APPLICATION_LOCATION_TEST_VALUE_2);
- }
-
- public void testSetEmptyApplicationLocation() throws Exception {
- String puKey = APPLICATION_LOCATION_KEY;
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(puKey);
- String propertyName = this.getModel().propertyIdOf(property);
-
- // Set ApplicationLocation to "" & verify that the property is deleted
- this.verifyPuHasProperty(puKey, "persistenceUnit.properties doesn't contains: ");
- this.setProperty(propertyName, "");
-
- this.verifyPuHasNotProperty(puKey, "Property was not deleted");
- this.verifyPutProperty(propertyName, null);
- assertNull(this.getPersistenceUnit().getProperty(puKey));
- }
-
- // ********** OutputMode **********
- /**
- * Tests the update of OutputMode property by the SchemaGeneration adapter
- * when the PU or the model changes.
- */
- public void testSetOutputMode() throws Exception {
- this.verifyModelInitialized(
- OUTPUT_MODE_KEY,
- OUTPUT_MODE_TEST_VALUE);
- this.verifySetProperty(
- OUTPUT_MODE_KEY,
- OUTPUT_MODE_TEST_VALUE,
- OUTPUT_MODE_TEST_VALUE_2);
- }
-
- public void testAddRemoveOutputMode() throws Exception {
- this.verifyAddRemoveProperty(
- OUTPUT_MODE_KEY,
- OUTPUT_MODE_TEST_VALUE,
- OUTPUT_MODE_TEST_VALUE_2);
- }
-
- // ********** DdlGenerationType **********
- /**
- * Tests the update of DdlGenerationType property by the SchemaGeneration
- * adapter when the PU or the model changes.
- */
- public void testSetDdlGenerationType() throws Exception {
- this.verifyModelInitialized(
- DDL_GENERATION_TYPE_KEY,
- DDL_GENERATION_TYPE_TEST_VALUE);
- this.verifySetProperty(
- DDL_GENERATION_TYPE_KEY,
- DDL_GENERATION_TYPE_TEST_VALUE,
- DDL_GENERATION_TYPE_TEST_VALUE_2);
- }
-
- public void testAddRemoveDdlGenerationType() throws Exception {
- this.verifyAddRemoveProperty(
- DDL_GENERATION_TYPE_KEY,
- DDL_GENERATION_TYPE_TEST_VALUE,
- DDL_GENERATION_TYPE_TEST_VALUE_2);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws NoSuchFieldException {
- if (propertyName.equals(SchemaGeneration.OUTPUT_MODE_PROPERTY))
- this.schemaGeneration.setOutputMode((OutputMode) newValue);
- // else if( propertyName.equals( Caching.CACHE_SIZE_PROPERTY))
- // TODO
- else if (propertyName.equals(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY))
- this.schemaGeneration.setDdlGenerationType((DdlGenerationType) newValue);
- else if (propertyName.equals(SchemaGeneration.APPLICATION_LOCATION_PROPERTY))
- this.schemaGeneration.setApplicationLocation((String) newValue);
- else if (propertyName.equals(SchemaGeneration.CREATE_FILE_NAME_PROPERTY))
- this.schemaGeneration.setCreateFileName((String) newValue);
- else if (propertyName.equals(SchemaGeneration.DROP_FILE_NAME_PROPERTY))
- this.schemaGeneration.setDropFileName((String) newValue);
- else
- this.throwMissingDefinition("setProperty", propertyName);
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- Object modelValue = null;
- if (propertyName.equals(SchemaGeneration.OUTPUT_MODE_PROPERTY))
- modelValue = this.schemaGeneration.getOutputMode();
- else if (propertyName.equals(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY))
- modelValue = this.schemaGeneration.getDdlGenerationType();
- else if (propertyName.equals(SchemaGeneration.APPLICATION_LOCATION_PROPERTY))
- modelValue = this.schemaGeneration.getApplicationLocation();
- else if (propertyName.equals(SchemaGeneration.CREATE_FILE_NAME_PROPERTY))
- modelValue = this.schemaGeneration.getCreateFileName();
- else if (propertyName.equals(SchemaGeneration.DROP_FILE_NAME_PROPERTY))
- modelValue = this.schemaGeneration.getDropFileName();
- else
- this.throwMissingDefinition("getProperty", propertyName);
- return modelValue;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.schemaGeneration;
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationBasicAdapterTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationBasicAdapterTests.java
deleted file mode 100644
index 9638330836..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationBasicAdapterTests.java
+++ /dev/null
@@ -1,153 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.iterables.ListIterable;
-import org.eclipse.jpt.common.utility.internal.model.value.ItemPropertyListValueModelAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.ListAspectAdapter;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.ListValueModel;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.EclipseLinkPersistenceUnit;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-
-/**
- * Tests the update of OutputMode model object by the SchemaGeneration adapter
- * when the PersistenceUnit changes.
- */
-@SuppressWarnings("nls")
-public class SchemaGenerationBasicAdapterTests extends EclipseLinkPersistenceUnitTestCase
-{
- private SchemaGeneration schemaGeneration;
-
- public static final String outputModeKey = SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE;
- public static final String ddlGenTypeKey = SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE;
-
- public static final OutputMode OUTPUT_MODE_TEST_VALUE = OutputMode.sql_script;
- public static final OutputMode OUTPUT_MODE_TEST_VALUE_2 = OutputMode.database;
-
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE = DdlGenerationType.drop_and_create_tables;
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE_2 = DdlGenerationType.none;
-
- public SchemaGenerationBasicAdapterTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.schemaGeneration = this.subject.getSchemaGeneration();
- PropertyChangeListener propertyChangeListener = this.buildPropertyChangeListener();
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.OUTPUT_MODE_PROPERTY, propertyChangeListener);
- this.schemaGeneration.addPropertyChangeListener(SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY, propertyChangeListener);
- this.clearEvent();
- }
-
- /**
- * Initializes directly the PU properties before testing. Cannot use
- * Property Holder to initialize because it is not created yet
- */
- @Override
- protected void populatePu() {
- this.propertiesTotal = 6;
- this.modelPropertiesSizeOriginal = 2;
- this.modelPropertiesSize = this.modelPropertiesSizeOriginal;
-
- this.persistenceUnitSetProperty("property.0", "value.0");
- this.persistenceUnitSetProperty(outputModeKey, this.getPropertyStringValueOf(OUTPUT_MODE_TEST_VALUE));
- this.persistenceUnitSetProperty("property.2", "value.2");
- this.persistenceUnitSetProperty("property.3", "value.3");
- this.persistenceUnitSetProperty("property.4", "value.4");
- this.persistenceUnitSetProperty(ddlGenTypeKey, this.getPropertyStringValueOf(DDL_GENERATION_TYPE_TEST_VALUE));
- return;
- }
-
- /** ****** test methods ******* */
-
- /**
- * Tests the update of OutputMode property by the SchemaGeneration adapter
- * when the PU changes.
- */
- public void testOutputModeUpdate() throws Exception {
- ListValueModel<PersistenceUnit.Property> propertiesAdapter = this.buildPropertiesAdapter(this.subjectHolder);
- ListValueModel<PersistenceUnit.Property> propertyListAdapter = new ItemPropertyListValueModelAdapter<PersistenceUnit.Property>(propertiesAdapter, PersistenceUnit.Property.VALUE_PROPERTY);
-
- this.verifyHasListeners(this.schemaGeneration, SchemaGeneration.OUTPUT_MODE_PROPERTY);
-
- // Basic
- assertTrue(schemaGeneration.itemIsProperty(this.getPersistenceUnit().getProperty(outputModeKey)));
- assertEquals(OUTPUT_MODE_TEST_VALUE, this.schemaGeneration.getOutputMode());
-
- // Replace
- this.persistenceUnitSetProperty(outputModeKey, OUTPUT_MODE_TEST_VALUE_2);
- this.verifyPutEvent(SchemaGeneration.OUTPUT_MODE_PROPERTY, OUTPUT_MODE_TEST_VALUE_2, this.schemaGeneration.getOutputMode());
-
- // Remove
- this.clearEvent();
- --this.propertiesTotal;
- --this.modelPropertiesSize;
- this.getPersistenceUnit().removeProperty(outputModeKey);
- assertNull(this.getPersistenceUnit().getProperty(outputModeKey));
- assertEquals(this.modelPropertiesSize, this.modelPropertiesSizeOriginal - 1);
- assertNotNull(this.propertyChangedEvent);
- assertNull(this.propertyChangedEvent.getNewValue());
-
- // Add original OutputMode
- ++this.propertiesTotal;
- ++this.modelPropertiesSize;
- this.persistenceUnitSetProperty(outputModeKey, OUTPUT_MODE_TEST_VALUE);
- this.verifyPutEvent(SchemaGeneration.OUTPUT_MODE_PROPERTY, OUTPUT_MODE_TEST_VALUE, this.schemaGeneration.getOutputMode());
-
- // Replace again
- this.persistenceUnitSetProperty(outputModeKey, OUTPUT_MODE_TEST_VALUE_2);
- this.verifyPutEvent(SchemaGeneration.OUTPUT_MODE_PROPERTY, OUTPUT_MODE_TEST_VALUE_2, this.schemaGeneration.getOutputMode());
-
- // Replace by setting model object
- this.clearEvent();
- this.schemaGeneration.setOutputMode(OUTPUT_MODE_TEST_VALUE);
- this.verifyPutEvent(SchemaGeneration.OUTPUT_MODE_PROPERTY, OUTPUT_MODE_TEST_VALUE, this.schemaGeneration.getOutputMode());
- }
-
- // ****** convenience methods *******
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.schemaGeneration;
- }
-
- private ListValueModel<PersistenceUnit.Property> buildPropertiesAdapter(PropertyValueModel<EclipseLinkPersistenceUnit> subjectHolder) {
- return new ListAspectAdapter<EclipseLinkPersistenceUnit, PersistenceUnit.Property>(subjectHolder, PersistenceUnit.PROPERTIES_LIST) {
- @Override
- protected ListIterable<PersistenceUnit.Property> getListIterable() {
- return this.subject.getProperties();
- }
-
- @Override
- protected int size_() {
- return this.subject.getPropertiesSize();
- }
- };
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationValueModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationValueModelTests.java
deleted file mode 100644
index 2673eaf563..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/context/persistence/SchemaGenerationValueModelTests.java
+++ /dev/null
@@ -1,231 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2012 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.persistence;
-
-import org.eclipse.jpt.common.utility.internal.model.value.PropertyAspectAdapter;
-import org.eclipse.jpt.common.utility.internal.model.value.SimplePropertyValueModel;
-import org.eclipse.jpt.common.utility.model.event.PropertyChangeEvent;
-import org.eclipse.jpt.common.utility.model.listener.PropertyChangeListener;
-import org.eclipse.jpt.common.utility.model.value.PropertyValueModel;
-import org.eclipse.jpt.common.utility.model.value.ModifiablePropertyValueModel;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnit;
-import org.eclipse.jpt.jpa.core.context.persistence.PersistenceUnitProperties;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.DdlGenerationType;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.OutputMode;
-import org.eclipse.jpt.jpa.eclipselink.core.context.persistence.SchemaGeneration;
-
-/**
- * SchemaGenerationValueModelTests
- *
- * Tests the PropertyValueModel of SchemaGeneration model and the update of the
- * PersistenceUnit.
- */
-public class SchemaGenerationValueModelTests extends EclipseLinkPersistenceUnitTestCase
-{
- private SchemaGeneration schemaGen;
- private PropertyValueModel<SchemaGeneration> schemaGenHolder;
-
- private ModifiablePropertyValueModel<DdlGenerationType> ddlGenerationTypeHolder;
- private PropertyChangeEvent ddlGenerationTypeEvent;
-
- private ModifiablePropertyValueModel<OutputMode> outputModeHolder;
- private PropertyChangeEvent outputModeEvent;
-
- public static final DdlGenerationType DDL_GENERATION_TYPE_TEST_VALUE = DdlGenerationType.drop_and_create_tables;
- public static final OutputMode OUTPUT_MODE_TEST_VALUE = OutputMode.sql_script;
-
- public SchemaGenerationValueModelTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.schemaGen = this.subject.getSchemaGeneration(); // Subject
- this.schemaGenHolder = new SimplePropertyValueModel<SchemaGeneration>(this.schemaGen);
-
- this.ddlGenerationTypeHolder = this.buildDdlGenerationTypeAA(this.schemaGenHolder);
- PropertyChangeListener ddlGenerationTypeListener = this.buildDdlGenerationTypeChangeListener();
- this.ddlGenerationTypeHolder.addPropertyChangeListener(PropertyValueModel.VALUE, ddlGenerationTypeListener);
- this.ddlGenerationTypeEvent = null;
-
- this.outputModeHolder = this.buildOutputModeAA(this.schemaGenHolder);
- PropertyChangeListener outputModeListener = this.buildOutputModeChangeListener();
- this.outputModeHolder.addPropertyChangeListener(PropertyValueModel.VALUE, outputModeListener);
- this.outputModeEvent = null;
- }
-
- /**
- * Initializes directly the PU properties before testing. Cannot use
- * Property Holder to initialize because it is not created yet
- */
- @Override
- protected void populatePu() {
- this.persistenceUnitSetProperty(
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE,
- DDL_GENERATION_TYPE_TEST_VALUE);
- this.persistenceUnitSetProperty(
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE,
- OUTPUT_MODE_TEST_VALUE);
- return;
- }
-
- @Override
- protected PersistenceUnitProperties getModel() {
- return this.schemaGen;
- }
-
- /** ****** DdlGenerationType ******* */
- private ModifiablePropertyValueModel<DdlGenerationType> buildDdlGenerationTypeAA(PropertyValueModel<SchemaGeneration> subjectHolder) {
- return new PropertyAspectAdapter<SchemaGeneration, DdlGenerationType>(subjectHolder, SchemaGeneration.DDL_GENERATION_TYPE_PROPERTY) {
- @Override
- protected DdlGenerationType buildValue_() {
- return this.subject.getDdlGenerationType();
- }
-
- @Override
- protected void setValue_(DdlGenerationType enumValue) {
- this.subject.setDdlGenerationType(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildDdlGenerationTypeChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- SchemaGenerationValueModelTests.this.ddlGenerationTypeEvent = e;
- }
- };
- }
-
- /** ****** OutputMode ******* */
- private ModifiablePropertyValueModel<OutputMode> buildOutputModeAA(PropertyValueModel<SchemaGeneration> subjectHolder) {
- return new PropertyAspectAdapter<SchemaGeneration, OutputMode>(subjectHolder, SchemaGeneration.OUTPUT_MODE_PROPERTY) {
- @Override
- protected OutputMode buildValue_() {
- return this.subject.getOutputMode();
- }
-
- @Override
- protected void setValue_(OutputMode enumValue) {
- this.subject.setOutputMode(enumValue);
- }
- };
- }
-
- private PropertyChangeListener buildOutputModeChangeListener() {
- return new PropertyChangeListener() {
- public void propertyChanged(PropertyChangeEvent e) {
- SchemaGenerationValueModelTests.this.outputModeEvent = e;
- }
- };
- }
-
- public void testValue() {
- /** ****** DdlGenerationType ******* */
- this.verifyDdlGenerationTypeAAValue(DDL_GENERATION_TYPE_TEST_VALUE);
- assertEquals(
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_DDL_GENERATION_TYPE,
- this.schemaGen.getDefaultDdlGenerationType());
- /** ****** OutputMode ******* */
- this.verifyOutputModeAAValue(OUTPUT_MODE_TEST_VALUE);
- assertEquals(
- SchemaGeneration.DEFAULT_SCHEMA_GENERATION_OUTPUT_MODE,
- this.schemaGen.getDefaultOutputMode());
- }
-
- public void testSetValue() throws Exception {
- /** ****** DdlGenerationType ******* */
- this.ddlGenerationTypeEvent = null;
- this.verifyHasListeners(this.ddlGenerationTypeHolder, PropertyValueModel.VALUE);
- DdlGenerationType newDdlGenerationType = DdlGenerationType.create_tables;
- // Modify the persistenceUnit directly
- this.subject.setProperty(
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE,
- this.getPropertyStringValueOf(newDdlGenerationType),
- false);
- this.verifyDdlGenerationTypeAAValue(newDdlGenerationType);
- assertNotNull(this.ddlGenerationTypeEvent);
-
- /** ****** OutputMode ******* */
- this.outputModeEvent = null;
- this.verifyHasListeners(this.outputModeHolder, PropertyValueModel.VALUE);
- OutputMode newOutputMode = OutputMode.database;
- // Modify the property holder
- this.outputModeHolder.setValue(newOutputMode);
- this.verifyOutputModeAAValue(newOutputMode);
- assertNotNull(this.outputModeEvent);
- }
-
- public void testSetNullValue() {
- /** ****** DdlGenerationType ******* */
- this.ddlGenerationTypeEvent = null;
- // Setting the persistenceUnit directly
- this.subject.setProperty(SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE, null, false);
- this.ddlGenerationTypeHolder.setValue(null);
- // testing Holder
- this.verifyDdlGenerationTypeAAValue(null);
- assertNotNull(this.ddlGenerationTypeEvent);
- // testing PU properties
- PersistenceUnit.Property property = this.getPersistenceUnit().getProperty(SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE);
- assertNull(property);
-
- /** ****** OutputMode ******* */
- this.outputModeEvent = null;
- // Setting the property holder
- this.outputModeHolder.setValue(null);
- // testing Holder
- this.verifyOutputModeAAValue(null);
- assertNotNull(this.outputModeEvent);
- // testing PU properties
- property = this.getPersistenceUnit().getProperty(SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE);
- assertNull(property);
- }
-
- /** ****** convenience methods ******* */
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyDdlGenerationTypeAAValue(DdlGenerationType testValue) {
- this.verifyAAValue(
- testValue,
- this.schemaGen.getDdlGenerationType(),
- this.ddlGenerationTypeHolder,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_TYPE);
- }
-
- /**
- * Performs three value tests:<br>
- * 1. subject value<br>
- * 2. aspect adapter value<br>
- * 3. persistenceUnit property value<br>
- */
- protected void verifyOutputModeAAValue(OutputMode testValue) {
- this.verifyAAValue(
- testValue,
- this.schemaGen.getOutputMode(),
- this.outputModeHolder,
- SchemaGeneration.ECLIPSELINK_DDL_GENERATION_OUTPUT_MODE);
- }
-
- // ********** get/set property **********
- @Override
- protected void setProperty(String propertyName, Object newValue) throws Exception {
- throw new UnsupportedOperationException();
- }
-
- @Override
- protected Object getProperty(String propertyName) throws NoSuchFieldException {
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/EclipseLinkStaticWeavingBuilderMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/EclipseLinkStaticWeavingBuilderMetadataTests.java
deleted file mode 100644
index 764927f336..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/EclipseLinkStaticWeavingBuilderMetadataTests.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.metadata;
-
-import junit.framework.Assert;
-
-import org.eclipse.jpt.jpa.core.tests.internal.metadata.JpaMetadataTests;
-import org.eclipse.jpt.jpa.eclipselink.core.builder.StaticWeavingBuilderConfigurator;
-
-/**
- * JpaStaticWeavingBuilderMetadataTests
- */
-public class EclipseLinkStaticWeavingBuilderMetadataTests extends JpaMetadataTests {
-
- public static final String SOURCE_PREF_KEY = "staticweave.SOURCE"; //$NON-NLS-1$
- public static final String LOG_LEVEL_PREF_KEY = "staticweave.LOG_LEVEL"; //$NON-NLS-1$
-
- public static final String SOURCE_TEST_VALUE = "bin"; //$NON-NLS-1$
- public static final String LOG_LEVEL_TEST_VALUE = "ALL"; //$NON-NLS-1$
-
- protected StaticWeavingBuilderConfigurator projectPrefsManager;
-
- // ********** constructor **********
-
- public EclipseLinkStaticWeavingBuilderMetadataTests(String name) {
- super(name);
- }
-
- // ********** overrides **********
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
-
- this.projectPrefsManager = new StaticWeavingBuilderConfigurator(this.getJavaProject().getProject());
- Assert.assertNotNull(this.projectPrefsManager);
- }
-
- // ********** tests **********
-
- public void testSourceLocationProjectMetadata() throws Exception {
-
- this.projectPrefsManager.setSourceLocationPreference(SOURCE_TEST_VALUE);
- this.projectPrefsManager.getLegacyProjectPreferences().flush();
-
- String value = this.getProjectPrefs().get(SOURCE_PREF_KEY);
- Assert.assertNotNull(value);
- Assert.assertTrue(SOURCE_TEST_VALUE.equals(value));
- }
-
- public void testLogLevelProjectMetadata() throws Exception {
-
- this.projectPrefsManager.setLogLevelPreference(LOG_LEVEL_TEST_VALUE);
- this.projectPrefsManager.getLegacyProjectPreferences().flush();
-
- String value = this.getProjectPrefs().get(LOG_LEVEL_PREF_KEY);
- Assert.assertNotNull(value);
- Assert.assertTrue(LOG_LEVEL_TEST_VALUE.equals(value));
- }
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/JptJpaEclipseLinkCoreMetadataTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/JptJpaEclipseLinkCoreMetadataTests.java
deleted file mode 100644
index ce8adf5e40..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/metadata/JptJpaEclipseLinkCoreMetadataTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
-* Copyright (c) 2012 Oracle. All rights reserved.
-* This program and the accompanying materials are made available under the
-* terms of the Eclipse Public License v1.0, which accompanies this distribution
-* and is available at http://www.eclipse.org/legal/epl-v10.html.
-*
-* Contributors:
-* Oracle - initial API and implementation
-*******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.metadata;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-
-/**
- * JptJpaEclipseLinkCoreMetadataTests
- */
-public class JptJpaEclipseLinkCoreMetadataTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaEclipseLinkCoreMetadataTests.class.getPackage().getName());
- suite.addTestSuite(EclipseLinkStaticWeavingBuilderMetadataTests.class);
- return suite;
- }
-
- private JptJpaEclipseLinkCoreMetadataTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-} \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java
deleted file mode 100644
index 8f5954ced6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/JptJpaEclipselinkCoreResourceModelTests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.JptJpaEclipseLinkCoreTests;
-import org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java.JptEclipseLinkCoreJavaResourceModelTests;
-
-/**
- * Required Java system property:
- * -Dorg.eclipse.jpt.jpa.jar=<jpa.jar path>
- * -Dorg.eclipse.jpt.eclipselink.jar=<eclipselink.jar path>
- */
-public class JptJpaEclipselinkCoreResourceModelTests extends TestCase
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptJpaEclipselinkCoreResourceModelTests.class.getName());
- if(JptJpaEclipseLinkCoreTests.requiredJarsExists()) {
- suite.addTest(JptEclipseLinkCoreJavaResourceModelTests.suite());
- }
- else {
- suite.addTest(TestSuite.warning(JptJpaEclipseLinkCoreTests.buildMissingJarErrorMessage()));
- }
- return suite;
- }
-
- private JptJpaEclipselinkCoreResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CacheTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CacheTests.java
deleted file mode 100644
index 6124345bd1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CacheTests.java
+++ /dev/null
@@ -1,494 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheCoordinationType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheIsolationType2_2;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.CacheType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-@SuppressWarnings("nls")
-public class CacheTests extends EclipseLinkJavaResourceModelTestCase {
-
- public CacheTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestCache() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.CACHE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithCacheType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.CACHE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(type = CacheType.SOFT)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithSize() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(size = 50)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithExpiry() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiry = 50)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithExpiryTimeOfDay() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithShared() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(shared=true)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithAlwaysRefresh() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(alwaysRefresh=true)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithRefreshOnlyIfNewer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(refreshOnlyIfNewer=true)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithDisableHits() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(disableHits=true)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithCoordinationType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.CACHE_COORDINATION_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(coordinationType = CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithIsolation() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.CACHE_ISOLATION_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(isolation = CacheIsolationType.ISOLATED)");
- }
- });
- }
-
- public void testCache() throws Exception {
- ICompilationUnit cu = this.createTestCache();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNotNull(cache);
- }
-
- public void testGetType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCacheType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheType.SOFT, cache.getType());
- }
-
- public void testSetType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCacheType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheType.SOFT, cache.getType());
-
- cache.setType(CacheType.WEAK);
- assertEquals(CacheType.WEAK, cache.getType());
-
- assertSourceContains("@Cache(type = WEAK)", cu);
-
- cache.setType(null);
- assertNull(cache.getType());
-
- assertSourceDoesNotContain("(type = WEAK)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetSize() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getSize());
- }
-
- public void testSetSize() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithSize();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getSize());
-
- cache.setSize(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), cache.getSize());
-
- assertSourceContains("@Cache(size = 80)", cu);
-
- cache.setSize(null);
- assertNull(cache.getSize());
-
- assertSourceDoesNotContain("(size = 80)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetShared() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithShared();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getShared());
- }
-
- public void testSetShared() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithShared();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getShared());
-
- cache.setShared(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cache.getShared());
-
- assertSourceContains("@Cache(shared=false)", cu);
- }
-
- public void testSetSharedNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithShared();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getShared());
-
- cache.setShared(null);
-
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetExpiry() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiry();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getExpiry());
- }
-
- public void testSetExpiry() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiry();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Integer.valueOf(50), cache.getExpiry());
-
- cache.setExpiry(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), cache.getExpiry());
-
- assertSourceContains("@Cache(expiry = 80)", cu);
-
- cache.setExpiry(null);
- assertNull(cache.getExpiry());
-
- assertSourceDoesNotContain("(expiry = 80)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiryTimeOfDay();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertNotNull(timeOfDay);
- }
-
- public void testAddExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestCache();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- cache.addExpiryTimeOfDay();
-
- assertNotNull(cache.getExpiryTimeOfDay());
-
- assertSourceContains("@Cache(expiryTimeOfDay = @TimeOfDay)", cu);
- }
-
- public void testRemoveExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithExpiryTimeOfDay();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- assertNotNull(cache.getExpiryTimeOfDay());
-
- cache.removeExpiryTimeOfDay();
- assertNull(cache.getExpiryTimeOfDay());
- assertSourceDoesNotContain("@Cache(expiryTimeOfDay = @TimeOfDay)", cu);
- }
-
- public void testGetAlwaysRefresh() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithAlwaysRefresh();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getAlwaysRefresh());
- }
-
- public void testSetAlwaysRefresh() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithAlwaysRefresh();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getAlwaysRefresh());
-
- cache.setAlwaysRefresh(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cache.getAlwaysRefresh());
-
- assertSourceContains("@Cache(alwaysRefresh=false)", cu);
- }
-
- public void testSetAlwaysRefreshNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithAlwaysRefresh();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getAlwaysRefresh());
-
- cache.setAlwaysRefresh(null);
- cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNull(cache.getAlwaysRefresh());
-
- assertSourceContains("@Cache", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetRefreshOnlyIfNewer() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithRefreshOnlyIfNewer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getRefreshOnlyIfNewer());
- }
-
- public void testSetRefreshOnlyIfNewer() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithRefreshOnlyIfNewer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getRefreshOnlyIfNewer());
-
- cache.setRefreshOnlyIfNewer(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cache.getRefreshOnlyIfNewer());
-
- assertSourceContains("@Cache(refreshOnlyIfNewer=false)", cu);
- }
-
- public void testSetRefreshOnlyIfNewerNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithRefreshOnlyIfNewer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getRefreshOnlyIfNewer());
-
- cache.setRefreshOnlyIfNewer(null);
- cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNull(cache.getRefreshOnlyIfNewer());
- assertSourceContains("@Cache", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetDisableHits() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithDisableHits();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getDisableHits());
- }
-
- public void testSetDisableHits() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithDisableHits();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getDisableHits());
-
- cache.setDisableHits(Boolean.FALSE);
- assertEquals(Boolean.FALSE, cache.getDisableHits());
-
- assertSourceContains("@Cache(disableHits=false)", cu);
- }
-
- public void testSetDisableHitsNull() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithDisableHits();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(Boolean.TRUE, cache.getDisableHits());
-
- cache.setDisableHits(null);
- cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertNull(cache.getDisableHits());
- assertSourceContains("@Cache", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
-
- public void testGetCoordinationType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCoordinationType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, cache.getCoordinationType());
- }
-
- public void testSetCoordinationType() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithCoordinationType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheCoordinationType.INVALIDATE_CHANGED_OBJECTS, cache.getCoordinationType());
-
- cache.setCoordinationType(CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES);
- assertEquals(CacheCoordinationType.SEND_NEW_OBJECTS_WITH_CHANGES, cache.getCoordinationType());
-
- assertSourceContains("@Cache(coordinationType = SEND_NEW_OBJECTS_WITH_CHANGES)", cu);
-
- cache.setCoordinationType(null);
- assertNull(cache.getCoordinationType());
-
- assertSourceDoesNotContain("(coordinationType = SEND_NEW_OBJECTS_WITH_CHANGES)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-
- public void testGetIsolation() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithIsolation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheIsolationType2_2.ISOLATED, cache.getIsolation());
- }
-
- public void testSetIsolation() throws Exception {
- ICompilationUnit cu = this.createTestCacheWithIsolation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- assertEquals(CacheIsolationType2_2.ISOLATED, cache.getIsolation());
-
- cache.setIsolation(CacheIsolationType2_2.SHARED);
- assertEquals(CacheIsolationType2_2.SHARED, cache.getIsolation());
-
- assertSourceContains("@Cache(isolation = SHARED)", cu);
-
- cache.setIsolation(CacheIsolationType2_2.PROTECTED);
- assertEquals(CacheIsolationType2_2.PROTECTED, cache.getIsolation());
-
- assertSourceContains("@Cache(isolation = PROTECTED)", cu);
-
- cache.setIsolation(null);
- assertNull(cache.getIsolation());
-
- assertSourceDoesNotContain("(isolation = SHARED)", cu);
- assertSourceDoesNotContain("@Cache(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java
deleted file mode 100644
index 9f4c306b62..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ChangeTrackingTests.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ChangeTrackingType;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkChangeTrackingAnnotation;
-
-@SuppressWarnings("nls")
-public class ChangeTrackingTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ChangeTrackingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestChangeTracking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CHANGE_TRACKING, EclipseLink.CHANGE_TRACKING_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ChangeTracking");
- }
- });
- }
-
- private ICompilationUnit createTestChangeTrackingWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CHANGE_TRACKING, EclipseLink.CHANGE_TRACKING_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ChangeTracking(ChangeTrackingType.DEFERRED)");
- }
- });
- }
-
- public void testChangeTracking() throws Exception {
- ICompilationUnit cu = this.createTestChangeTracking();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkChangeTrackingAnnotation existenceChecking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLink.CHANGE_TRACKING);
- assertNotNull(existenceChecking);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestChangeTrackingWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkChangeTrackingAnnotation existenceChecking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLink.CHANGE_TRACKING);
- assertEquals(ChangeTrackingType.DEFERRED, existenceChecking.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestChangeTrackingWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkChangeTrackingAnnotation existenceChecking = (EclipseLinkChangeTrackingAnnotation) resourceType.getAnnotation(EclipseLink.CHANGE_TRACKING);
- assertEquals(ChangeTrackingType.DEFERRED, existenceChecking.getValue());
-
- existenceChecking.setValue(ChangeTrackingType.ATTRIBUTE);
- assertEquals(ChangeTrackingType.ATTRIBUTE, existenceChecking.getValue());
-
- assertSourceContains("@ChangeTracking(ATTRIBUTE)", cu);
-
- existenceChecking.setValue(null);
- assertNull(existenceChecking.getValue());
-
- assertSourceDoesNotContain("(ATTRIBUTE)", cu);
- assertSourceContains("@ChangeTracking", cu);
- assertSourceDoesNotContain("@ChangeTracking(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java
deleted file mode 100644
index 78ee82137d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConversionValueAnnotationTests.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class ConversionValueAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ConversionValueAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestObjectTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithConversionValues() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})");
- }
- });
- }
-
-
- public void testGetDataValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("F", converter.conversionValueAt(0).getDataValue());
- }
-
- public void testSetDataValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("F", converter.conversionValueAt(0).getDataValue());
-
- converter.conversionValueAt(0).setDataValue("FOO");
- assertEquals("FOO", converter.conversionValueAt(0).getDataValue());
-
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"FOO\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
- }
-
- public void testSetDataValueNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals(0, converter.getConversionValuesSize());
-
- converter.addConversionValue(0).setDataValue("FOO");
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue(dataValue = \"FOO\"))", cu);
-
- converter.conversionValueAt(0).setDataValue(null);
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue)", cu);
- assertEquals(1, converter.getConversionValuesSize());
- }
-
- public void testGetObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Female", converter.conversionValueAt(0).getObjectValue());
- }
-
- public void testSetObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Female", converter.conversionValueAt(0).getObjectValue());
-
- converter.conversionValueAt(0).setObjectValue("FOO");
- assertEquals("FOO", converter.conversionValueAt(0).getObjectValue());
-
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"F\", objectValue = \"FOO\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
- }
-
- public void testSetObjectValueNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals(0, converter.getConversionValuesSize());
-
- converter.addConversionValue(0).setObjectValue("FOO");
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue(objectValue = \"FOO\"))", cu);
-
- converter.conversionValueAt(0).setObjectValue(null);
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue)", cu);
- assertEquals(1, converter.getConversionValuesSize());
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java
deleted file mode 100644
index 42c050d3c0..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConvertAnnotationTests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConvertAnnotation;
-
-@SuppressWarnings("nls")
-public class ConvertAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ConvertAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert");
- }
- });
- }
-
- private ICompilationUnit createTestConverterWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Convert(value=\"myConverter\")");
- }
- });
- }
-
- public void testConvertAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestConvert();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.CONVERT));
-
- resourceField.removeAnnotation(EclipseLink.CONVERT);
- assertNull(resourceField.getAnnotation(EclipseLink.CONVERT));
-
- resourceField.addAnnotation(EclipseLink.CONVERT);
- assertNotNull(resourceField.getAnnotation(EclipseLink.CONVERT));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLink.CONVERT);
- assertEquals("myConverter", convert.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLink.CONVERT);
- assertEquals("myConverter", convert.getValue());
-
- convert.setValue("Bar");
- assertEquals("Bar", convert.getValue());
-
- assertSourceContains("@Convert(value=\"Bar\")", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConvertAnnotation convert = (EclipseLinkConvertAnnotation) resourceField.getAnnotation(EclipseLink.CONVERT);
- assertEquals("myConverter", convert.getValue());
-
- convert.setValue(null);
- assertNull(convert.getValue());
-
- assertSourceContains("@Convert", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java
deleted file mode 100644
index 62774747a6..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ConverterAnnotationTests.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class ConverterAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ConverterAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Converter");
- }
- });
- }
-
- private ICompilationUnit createTestConverterWithConverterClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Converter(converterClass=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestConverterWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Converter(name=\"bar\")");
- }
- });
- }
-
- public void testConverterAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(0, EclipseLink.CONVERTER));
-
- resourceField.removeAnnotation(0, EclipseLink.CONVERTER);
- assertNull(resourceField.getAnnotation(0, EclipseLink.CONVERTER));
-
- resourceField.addAnnotation(0, EclipseLink.CONVERTER);
- assertNotNull(resourceField.getAnnotation(0, EclipseLink.CONVERTER));
- }
-
- public void testGetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithConverterClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.CONVERTER);
- assertEquals("Foo", converter.getConverterClass());
- }
-
- public void testSetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithConverterClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.CONVERTER);
- assertEquals("Foo", converter.getConverterClass());
-
- converter.setConverterClass("Bar");
- assertEquals("Bar", converter.getConverterClass());
-
- assertSourceContains("@Converter(converterClass=Bar.class)", cu);
- }
-
- public void testSetConverterClassNull() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithConverterClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.CONVERTER);
- assertEquals("Foo", converter.getConverterClass());
-
- converter.setConverterClass(null);
- assertNull(converter.getConverterClass());
-
- assertSourceContains("@Converter", cu);
- assertSourceDoesNotContain("converterClass", cu);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName("foo");
- assertEquals("foo", converter.getName());
-
- assertSourceContains("@Converter(name=\"foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkConverterAnnotation converter = (EclipseLinkConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName(null);
- assertNull(converter.getName());
-
- assertSourceContains("@Converter", cu);
- assertSourceDoesNotContain("name=", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java
deleted file mode 100644
index d28a256c02..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/CustomizerAnnotationTests.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCustomizerAnnotation;
-
-@SuppressWarnings("nls")
-public class CustomizerAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public CustomizerAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestCustomizer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Customizer");
- }
- });
- }
-
- private ICompilationUnit createTestCustomizerWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CUSTOMIZER);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Customizer(Foo.class)");
- }
- });
- }
-
- public void testCustomizerAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestCustomizer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertNotNull(resourceType.getAnnotation(EclipseLink.CUSTOMIZER));
-
- resourceType.removeAnnotation(EclipseLink.CUSTOMIZER);
- assertNull(resourceType.getAnnotation(EclipseLink.CUSTOMIZER));
-
- resourceType.addAnnotation(EclipseLink.CUSTOMIZER);
- assertNotNull(resourceType.getAnnotation(EclipseLink.CUSTOMIZER));
- }
-
- public void testGetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLink.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
- }
-
- public void testSetConverterClass() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLink.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
-
- converter.setValue("Bar");
- assertEquals("Bar", converter.getValue());
-
- assertSourceContains("@Customizer(Bar.class)", cu);
- }
-
- public void testSetConverterClassNull() throws Exception {
- ICompilationUnit cu = this.createTestCustomizerWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCustomizerAnnotation converter = (EclipseLinkCustomizerAnnotation) resourceType.getAnnotation(EclipseLink.CUSTOMIZER);
- assertEquals("Foo", converter.getValue());
-
- converter.setValue(null);
- assertNull(converter.getValue());
-
- assertSourceContains("@Customizer", cu);
- assertSourceDoesNotContain("Foo.class", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_0JavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_0JavaResourceModelTestCase.java
deleted file mode 100644
index e521e0b6f8..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_0JavaResourceModelTestCase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_0JpaAnnotationDefinitionProvider;
-
-public class EclipseLink2_0JavaResourceModelTestCase extends JpaJavaResourceModelTestCase
-{
-
- public static final String ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
-
- public EclipseLink2_0JavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_0JpaAnnotationDefinitionProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_3JavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_3JavaResourceModelTestCase.java
deleted file mode 100644
index 299511293c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLink2_3JavaResourceModelTestCase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLink2_3JpaAnnotationDefinitionProvider;
-
-public class EclipseLink2_3JavaResourceModelTestCase extends JpaJavaResourceModelTestCase
-{
-
- public static final String ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
-
- public EclipseLink2_3JavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLink2_3JpaAnnotationDefinitionProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java
deleted file mode 100644
index bd5fc19678..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkJavaResourceModelTestCase.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import org.eclipse.jpt.common.core.AnnotationProvider;
-import org.eclipse.jpt.jpa.core.internal.GenericJpaAnnotationDefinitionProvider;
-import org.eclipse.jpt.jpa.core.internal.JpaAnnotationProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.resource.java.JpaJavaResourceModelTestCase;
-import org.eclipse.jpt.jpa.eclipselink.core.internal.EclipseLinkJpaAnnotationDefinitionProvider;
-
-public class EclipseLinkJavaResourceModelTestCase extends JpaJavaResourceModelTestCase
-{
-
- public static final String ECLIPSELINK_ANNOTATIONS_PACKAGE_NAME = "org.eclipse.persistence.annotations"; //$NON-NLS-1$
-
- public EclipseLinkJavaResourceModelTestCase(String name) {
- super(name);
- }
-
- @Override
- protected AnnotationProvider buildAnnotationProvider() {
- return new JpaAnnotationProvider(
- GenericJpaAnnotationDefinitionProvider.instance(),
- EclipseLinkJpaAnnotationDefinitionProvider.instance());
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java
deleted file mode 100644
index f7781fb560..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkPrimaryKeyAnnotationTests.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-
-@SuppressWarnings("nls")
-public class EclipseLinkPrimaryKeyAnnotationTests
- extends EclipseLinkJavaResourceModelTestCase
-{
- public EclipseLinkPrimaryKeyAnnotationTests(String name) {
- super(name);
- }
-
-
- private ICompilationUnit createTestTypeWithPrimaryKeyAnnotation() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.PRIMARY_KEY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@PrimaryKey");
- }
- });
- }
-
-
- public void testAddRemoveAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestTypeWithPrimaryKeyAnnotation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- assertNotNull(resourceType.getAnnotation(EclipseLink.PRIMARY_KEY));
-
- resourceType.removeAnnotation(EclipseLink.PRIMARY_KEY);
- assertNull(resourceType.getAnnotation(EclipseLink.PRIMARY_KEY));
-
- resourceType.addAnnotation(EclipseLink.PRIMARY_KEY);
- assertNotNull(resourceType.getAnnotation(EclipseLink.PRIMARY_KEY));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.java
deleted file mode 100644
index d7c44fbc50..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.java
+++ /dev/null
@@ -1,330 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.DiscriminatorType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTenantDiscriminatorColumnAnnotation2_3;
-
-@SuppressWarnings("nls")
-public class EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests extends EclipseLink2_3JavaResourceModelTestCase {
-
- private static final String COLUMN_NAME = "MY_COLUMN";
- private static final String COLUMN_COLUMN_DEFINITION = "COLUMN_DEFINITION";
- private static final String COLUMN_CONTEXT_PROPERTY = "eclipselink.foo-id";
- private static final String COLUMN_TABLE = "MY_TABLE";
-
- public EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn");
- }
- });
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumnWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(name = \"" + COLUMN_NAME + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumnWithColumnDefinition() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(columnDefinition = \"" + COLUMN_COLUMN_DEFINITION + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumnWithContextProperty() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(contextProperty = \"" + COLUMN_CONTEXT_PROPERTY + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTenantDiscriminatorColumnWithTable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(table = \"" + COLUMN_TABLE + "\")");
- }
- });
- }
-
- private ICompilationUnit createTestTenenatDiscriminatorColumnWithDiscriminatorType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN, JPA.DISCRIMINATOR_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(discriminatorType = DiscriminatorType.CHAR)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithIntElement(final String intElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(" + intElement + " = 5)");
- }
- });
- }
-
- private ICompilationUnit createTestColumnWithBooleanElement(final String booleanElement) throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@TenantDiscriminatorColumn(" + booleanElement + " = true)");
- }
- });
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertEquals(COLUMN_NAME, column.getName());
- }
-
- public void testGetNull() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertNotNull(column);
- assertNull(column.getName());
- assertNull(column.getDiscriminatorType());
- assertNull(column.getColumnDefinition());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getName());
-
- column.setName("Foo");
- assertEquals("Foo", column.getName());
-
- assertSourceContains("@TenantDiscriminatorColumn(name = \"Foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertEquals(COLUMN_NAME, column.getName());
-
- column.setName(null);
- assertNull(column.getName());
-
- assertSourceDoesNotContain("(name", cu);
- }
-
- public void testGetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithColumnDefinition();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertEquals(COLUMN_COLUMN_DEFINITION, column.getColumnDefinition());
- }
-
- public void testSetColumnDefinition() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getColumnDefinition());
-
- column.setColumnDefinition("Foo");
- assertEquals("Foo", column.getColumnDefinition());
-
- assertSourceContains("@TenantDiscriminatorColumn(columnDefinition = \"Foo\")", cu);
-
-
- column.setColumnDefinition(null);
- assertSourceDoesNotContain("(columnDefinition", cu);
- }
-
- public void testGetLength() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithIntElement("length");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertEquals(Integer.valueOf(5), column.getLength());
- }
-
- public void testSetLength() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getLength());
-
- column.setLength(Integer.valueOf(5));
- assertEquals(Integer.valueOf(5), column.getLength());
-
- assertSourceContains("@TenantDiscriminatorColumn(length = 5)", cu);
-
- column.setLength(null);
- assertSourceDoesNotContain("(length", cu);
- }
-
- public void testGetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestTenenatDiscriminatorColumnWithDiscriminatorType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertEquals(DiscriminatorType.CHAR, column.getDiscriminatorType());
- }
-
- public void testSetDiscriminatorType() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNull(column.getDiscriminatorType());
-
- column.setDiscriminatorType(DiscriminatorType.INTEGER);
- assertEquals(DiscriminatorType.INTEGER, column.getDiscriminatorType());
-
- assertSourceContains("@TenantDiscriminatorColumn(discriminatorType = INTEGER)", cu);
-
- column.setDiscriminatorType(null);
- assertSourceDoesNotContain("(discriminatorType", cu);
- }
-
- public void testGetContextProperty() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithContextProperty();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertEquals(COLUMN_CONTEXT_PROPERTY, column.getContextProperty());
- }
-
- public void testSetContextProperty() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getContextProperty());
-
- column.setContextProperty("Foo");
- assertEquals("Foo", column.getContextProperty());
-
- assertSourceContains("@TenantDiscriminatorColumn(contextProperty = \"Foo\")", cu);
-
-
- column.setContextProperty(null);
- assertSourceDoesNotContain("(contextProperty", cu);
- }
-
- public void testGetTable() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumnWithTable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
- assertEquals(COLUMN_TABLE, column.getTable());
- }
-
- public void testSetTable() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getTable());
-
- column.setTable("Foo");
- assertEquals("Foo", column.getTable());
-
- assertSourceContains("@TenantDiscriminatorColumn(table = \"Foo\")", cu);
-
-
- column.setTable(null);
- assertSourceDoesNotContain("(table", cu);
- }
-
- public void testGetPrimaryKey() throws Exception {
- ICompilationUnit cu = this.createTestColumnWithBooleanElement("primaryKey");
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertEquals(Boolean.TRUE, column.getPrimaryKey());
- }
-
- public void testSetPrimaryKey() throws Exception {
- ICompilationUnit cu = this.createTestTenantDiscriminatorColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- EclipseLinkTenantDiscriminatorColumnAnnotation2_3 column = (EclipseLinkTenantDiscriminatorColumnAnnotation2_3) resourceType.getAnnotation(0, EclipseLink.TENANT_DISCRIMINATOR_COLUMN);
-
- assertNotNull(column);
- assertNull(column.getPrimaryKey());
-
- column.setPrimaryKey(Boolean.FALSE);
- assertEquals(Boolean.FALSE, column.getPrimaryKey());
-
- assertSourceContains("@TenantDiscriminatorColumn(primaryKey = false)", cu);
-
- column.setPrimaryKey(null);
- assertSourceDoesNotContain("primaryKey", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipselinkMultitenantAnnotation2_3Tests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipselinkMultitenantAnnotation2_3Tests.java
deleted file mode 100644
index 390048d533..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/EclipselinkMultitenantAnnotation2_3Tests.java
+++ /dev/null
@@ -1,138 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMultitenantAnnotation2_3;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.MultitenantType2_3;
-
-@SuppressWarnings("nls")
-public class EclipselinkMultitenantAnnotation2_3Tests extends EclipseLink2_3JavaResourceModelTestCase {
-
- public EclipselinkMultitenantAnnotation2_3Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMultitenant() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MULTITENANT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Multitenant");
- }
- });
- }
-
- private ICompilationUnit createTestMultitenantWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MULTITENANT, EclipseLink.MULTITENANT_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Multitenant(MultitenantType.SINGLE_TABLE)");
- }
- });
- }
-
- private ICompilationUnit createTestCacheWithIncludeCriteria() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MULTITENANT);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Multitenant(includeCriteria=true)");
- }
- });
- }
-
- public void testMultitenant() throws Exception {
- ICompilationUnit cu = this.createTestMultitenant();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
- assertNotNull(multitenant);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMultitenantWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
- assertEquals(MultitenantType2_3.SINGLE_TABLE, multitenant.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMultitenantWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
- assertEquals(MultitenantType2_3.SINGLE_TABLE, multitenant.getValue());
-
- multitenant.setValue(MultitenantType2_3.TABLE_PER_TENANT);
- assertEquals(MultitenantType2_3.TABLE_PER_TENANT, multitenant.getValue());
-
- assertSourceContains("@Multitenant(TABLE_PER_TENANT)", cu);
-
- multitenant.setValue(null);
- assertNull(multitenant.getValue());
-
- assertSourceDoesNotContain("(TABLE_PER_TENANT)", cu);
- assertSourceContains("@Multitenant", cu);
- assertSourceDoesNotContain("@Multitenant(", cu);
- }
-
-//
-// public void testGetIncludeCriteria() throws Exception {
-// ICompilationUnit cu = this.createTestCacheWithIncludeCriteria();
-// JavaResourceType resourceType = buildJavaResourceType(cu);
-//
-// EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
-// assertEquals(Boolean.TRUE, multitenant.getIncludeCriteria());
-// }
-//
-// public void testSetIncludeCriteria() throws Exception {
-// ICompilationUnit cu = this.createTestCacheWithIncludeCriteria();
-// JavaResourceType resourceType = buildJavaResourceType(cu);
-//
-// EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
-// assertEquals(Boolean.TRUE, multitenant.getIncludeCriteria());
-//
-// multitenant.setIncludeCriteria(Boolean.FALSE);
-// assertEquals(Boolean.FALSE, multitenant.getIncludeCriteria());
-//
-// assertSourceContains("@Multitenant(includeCriteria=false)", cu);
-// }
-//
-// public void testSetIncludeCriteriaNull() throws Exception {
-// ICompilationUnit cu = this.createTestCacheWithIncludeCriteria();
-// JavaResourceType resourceType = buildJavaResourceType(cu);
-//
-// EclipseLinkMultitenantAnnotation2_3 multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
-// assertEquals(Boolean.TRUE, multitenant.getIncludeCriteria());
-//
-// multitenant.setIncludeCriteria(null);
-// multitenant = (EclipseLinkMultitenantAnnotation2_3) resourceType.getAnnotation(EclipseLink.MULTITENANT);
-// assertNull(multitenant.getIncludeCriteria());
-//
-// assertSourceContains("@Multitenant", cu);
-// assertSourceDoesNotContain("@Multitenant(", cu);
-// }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java
deleted file mode 100644
index 13fd742caa..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ExistenceCheckingTests.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkExistenceCheckingAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.ExistenceType;
-
-@SuppressWarnings("nls")
-public class ExistenceCheckingTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ExistenceCheckingTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestExistenceChecking() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.EXISTENCE_CHECKING, EclipseLink.EXISTENCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ExistenceChecking");
- }
- });
- }
-
- private ICompilationUnit createTestExistenceCheckingWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.EXISTENCE_CHECKING, EclipseLink.EXISTENCE_TYPE);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ExistenceChecking(ExistenceType.ASSUME_EXISTENCE)");
- }
- });
- }
-
- public void testExistenceChecking() throws Exception {
- ICompilationUnit cu = this.createTestExistenceChecking();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkExistenceCheckingAnnotation existenceChecking = (EclipseLinkExistenceCheckingAnnotation) resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
- assertNotNull(existenceChecking);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestExistenceCheckingWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkExistenceCheckingAnnotation existenceChecking = (EclipseLinkExistenceCheckingAnnotation) resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
- assertEquals(ExistenceType.ASSUME_EXISTENCE, existenceChecking.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestExistenceCheckingWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkExistenceCheckingAnnotation existenceChecking = (EclipseLinkExistenceCheckingAnnotation) resourceType.getAnnotation(EclipseLink.EXISTENCE_CHECKING);
- assertEquals(ExistenceType.ASSUME_EXISTENCE, existenceChecking.getValue());
-
- existenceChecking.setValue(ExistenceType.ASSUME_NON_EXISTENCE);
- assertEquals(ExistenceType.ASSUME_NON_EXISTENCE, existenceChecking.getValue());
-
- assertSourceContains("@ExistenceChecking(ASSUME_NON_EXISTENCE)", cu);
-
- existenceChecking.setValue(null);
- assertNull(existenceChecking.getValue());
-
- assertSourceDoesNotContain("(ASSUME_NON_EXISTENCE)", cu);
- assertSourceContains("@ExistenceChecking", cu);
- assertSourceDoesNotContain("@ExistenceChecking(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java
deleted file mode 100644
index e4609cc581..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JoinFetchTests.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkJoinFetchAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.JoinFetchType;
-
-@SuppressWarnings("nls")
-public class JoinFetchTests extends EclipseLinkJavaResourceModelTestCase {
-
- public JoinFetchTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestJoinFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinFetch");
- }
- });
- }
-
- private ICompilationUnit createTestJoinFetchWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.JOIN_FETCH, EclipseLink.JOIN_FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@JoinFetch(JoinFetchType.OUTER)");
- }
- });
- }
-
- public void testJoinFetch() throws Exception {
- ICompilationUnit cu = this.createTestJoinFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkJoinFetchAnnotation joinFetch = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLink.JOIN_FETCH);
- assertNotNull(joinFetch);
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestJoinFetchWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkJoinFetchAnnotation joinFetch = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLink.JOIN_FETCH);
- assertEquals(JoinFetchType.OUTER, joinFetch.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestJoinFetchWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkJoinFetchAnnotation joinFetch = (EclipseLinkJoinFetchAnnotation) resourceField.getAnnotation(EclipseLink.JOIN_FETCH);
- assertEquals(JoinFetchType.OUTER, joinFetch.getValue());
-
- joinFetch.setValue(JoinFetchType.INNER);
- assertEquals(JoinFetchType.INNER, joinFetch.getValue());
-
- assertSourceContains("@JoinFetch(INNER)", cu);
-
- joinFetch.setValue(null);
- assertNull(joinFetch.getValue());
-
- assertSourceDoesNotContain("(INNER)", cu);
- assertSourceContains("@JoinFetch", cu);
- assertSourceDoesNotContain("@JoinFetch(", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java
deleted file mode 100644
index 17d5d04489..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/JptEclipseLinkCoreJavaResourceModelTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptEclipseLinkCoreJavaResourceModelTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptEclipseLinkCoreJavaResourceModelTests.class.getName());
- suite.addTestSuite(CacheTests.class);
- suite.addTestSuite(ChangeTrackingTests.class);
- suite.addTestSuite(ConversionValueAnnotationTests.class);
- suite.addTestSuite(ConvertAnnotationTests.class);
- suite.addTestSuite(ConverterAnnotationTests.class);
- suite.addTestSuite(CustomizerAnnotationTests.class);
- suite.addTestSuite(ExistenceCheckingTests.class);
- suite.addTestSuite(JoinFetchTests.class);
- suite.addTestSuite(MutableAnnotationTests.class);
- suite.addTestSuite(ObjectTypeConverterAnnotationTests.class);
- suite.addTestSuite(EclipseLinkPrimaryKeyAnnotationTests.class);
- suite.addTestSuite(PrivateOwnedTests.class);
- suite.addTestSuite(ReadOnlyTests.class);
- suite.addTestSuite(ReadTransformerAnnotationTests.class);
- suite.addTestSuite(StructConverterAnnotationTests.class);
- suite.addTestSuite(TimeOfDayTests.class);
- suite.addTestSuite(TransformationAnnotationTests.class);
- suite.addTestSuite(TypeConverterAnnotationTests.class);
- suite.addTestSuite(WriteTransformerAnnotationTests.class);
- suite.addTestSuite(MapKeyConvertAnnotation2_0Tests.class);
- suite.addTestSuite(EclipselinkMultitenantAnnotation2_3Tests.class);
- suite.addTestSuite(EclipseLinkTenantDiscriminatorColumnAnnotation2_3Tests.class);
-
- return suite;
- }
-
- private JptEclipseLinkCoreJavaResourceModelTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MapKeyConvertAnnotation2_0Tests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MapKeyConvertAnnotation2_0Tests.java
deleted file mode 100644
index cca6380195..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MapKeyConvertAnnotation2_0Tests.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMapKeyConvertAnnotation2_0;
-
-@SuppressWarnings("nls")
-public class MapKeyConvertAnnotation2_0Tests extends EclipseLink2_0JavaResourceModelTestCase {
-
- public MapKeyConvertAnnotation2_0Tests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMapKeyConvert() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MAP_KEY_CONVERT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyConvert");
- }
- });
- }
-
- private ICompilationUnit createTestConverterWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MAP_KEY_CONVERT);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@MapKeyConvert(value=\"myConverter\")");
- }
- });
- }
-
- public void testMapKeyConvertAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestMapKeyConvert();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT));
-
- resourceField.removeAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertNull(resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT));
-
- resourceField.addAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertNotNull(resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMapKeyConvertAnnotation2_0 convert = (EclipseLinkMapKeyConvertAnnotation2_0) resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertEquals("myConverter", convert.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMapKeyConvertAnnotation2_0 convert = (EclipseLinkMapKeyConvertAnnotation2_0) resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertEquals("myConverter", convert.getValue());
-
- convert.setValue("Bar");
- assertEquals("Bar", convert.getValue());
-
- assertSourceContains("@MapKeyConvert(value=\"Bar\")", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestConverterWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMapKeyConvertAnnotation2_0 convert = (EclipseLinkMapKeyConvertAnnotation2_0) resourceField.getAnnotation(EclipseLink.MAP_KEY_CONVERT);
- assertEquals("myConverter", convert.getValue());
-
- convert.setValue(null);
- assertNull(convert.getValue());
-
- assertSourceContains("@MapKeyConvert", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java
deleted file mode 100644
index 71d4f0ad7d..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/MutableAnnotationTests.java
+++ /dev/null
@@ -1,112 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkMutableAnnotation;
-
-@SuppressWarnings("nls")
-public class MutableAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public MutableAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestMutable() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MUTABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Mutable");
- }
- });
- }
-
- private ICompilationUnit createTestMutableWithValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.MUTABLE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Mutable(value=true)");
- }
- });
- }
-
-
-
- public void testMutableAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestMutable();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.MUTABLE));
-
- resourceField.removeAnnotation(EclipseLink.MUTABLE);
- assertNull(resourceField.getAnnotation(EclipseLink.MUTABLE));
-
- resourceField.addAnnotation(EclipseLink.MUTABLE);
- assertNotNull(resourceField.getAnnotation(EclipseLink.MUTABLE));
- }
-
- public void testGetValue() throws Exception {
- ICompilationUnit cu = this.createTestMutableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLink.MUTABLE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
- }
-
- public void testSetValue() throws Exception {
- ICompilationUnit cu = this.createTestMutableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLink.MUTABLE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
-
- mutableAnnotation.setValue(Boolean.FALSE);
- assertEquals(Boolean.FALSE, mutableAnnotation.getValue());
-
- assertSourceContains("@Mutable(value=false)", cu);
-
- mutableAnnotation.setValue(null);
- mutableAnnotation.setValue(Boolean.FALSE);
- assertSourceContains("@Mutable(false)", cu);
- }
-
- public void testSetValueNull() throws Exception {
- ICompilationUnit cu = this.createTestMutableWithValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkMutableAnnotation mutableAnnotation = (EclipseLinkMutableAnnotation) resourceField.getAnnotation(EclipseLink.MUTABLE);
- assertEquals(Boolean.TRUE, mutableAnnotation.getValue());
-
- mutableAnnotation.setValue(null);
- assertNull(mutableAnnotation.getValue());
-
- assertSourceContains("@Mutable", cu);
- assertSourceDoesNotContain("value", cu);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java
deleted file mode 100644
index bc2f149272..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ObjectTypeConverterAnnotationTests.java
+++ /dev/null
@@ -1,427 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import java.util.ListIterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkConversionValueAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkObjectTypeConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class ObjectTypeConverterAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ObjectTypeConverterAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestObjectTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithDataType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(dataType=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithObjectType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(objectType=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(name = \"bar\")");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithDefaultObjectValue() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(defaultObjectValue = \"f\")");
- }
- });
- }
-
- private ICompilationUnit createTestObjectTypeConverterWithConversionValues() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.OBJECT_TYPE_CONVERTER, EclipseLink.CONVERSION_VALUE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})");
- }
- });
- }
-
- public void testObjectTypeConverterAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER));
-
- resourceField.removeAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertNull(resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER));
-
- resourceField.addAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertNotNull(resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER));
- }
-
- public void testGetDataType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
-
- assertSourceContains("@ObjectTypeConverter(dataType=Bar.class)", cu);
-
- converter.setDataType("int");
- assertEquals("int", converter.getDataType());
- assertSourceContains("@ObjectTypeConverter(dataType=int.class)", cu);
- }
-
- public void testSetDataTypeNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType(null);
- assertNull(converter.getDataType());
-
- assertSourceContains("@ObjectTypeConverter", cu);
- assertSourceDoesNotContain("dataType", cu);
- }
-
- public void testGetObjectType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
-
- assertSourceContains("@ObjectTypeConverter(objectType=Bar.class)", cu);
-
- converter.setObjectType("int");
- assertEquals("int", converter.getObjectType());
- assertSourceContains("@ObjectTypeConverter(objectType=int.class)", cu);
- }
-
- public void testSetObjectTypeNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType(null);
- assertNull(converter.getObjectType());
-
- assertSourceContains("@ObjectTypeConverter", cu);
- assertSourceDoesNotContain("objectType", cu);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName("foo");
- assertEquals("foo", converter.getName());
-
- assertSourceContains("@ObjectTypeConverter(name = \"foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName(null);
- assertNull(converter.getName());
-
- assertSourceContains("@ObjectTypeConverter", cu);
- assertSourceDoesNotContain("name=", cu);
- }
-
-
- public void testGetDefaultObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDefaultObjectValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("f", converter.getDefaultObjectValue());
- }
-
- public void testSetDefaultObjectValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDefaultObjectValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("f", converter.getDefaultObjectValue());
-
- converter.setDefaultObjectValue("foo");
- assertEquals("foo", converter.getDefaultObjectValue());
-
- assertSourceContains("@ObjectTypeConverter(defaultObjectValue = \"foo\")", cu);
- }
-
- public void testSetDefaultObjectValueNull() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithDefaultObjectValue();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- assertEquals("f", converter.getDefaultObjectValue());
-
- converter.setDefaultObjectValue(null);
- assertNull(converter.getDefaultObjectValue());
-
- assertSourceContains("@ObjectTypeConverter", cu);
- assertSourceDoesNotContain("defaultObjectValue", cu);
- }
-
- public void testConversionValues() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
-
- assertEquals(0, converter.getConversionValuesSize());
- assertFalse(converter.getConversionValues().iterator().hasNext());
- }
-
- public void testConversionValues2() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
-
-
- converter.addConversionValue(0);
- converter.addConversionValue(1);
-
- assertEquals(2, converter.getConversionValuesSize());
- ListIterator<EclipseLinkConversionValueAnnotation> conversionValues = converter.getConversionValues().iterator();
- assertTrue(conversionValues.hasNext());
- assertNotNull(conversionValues.next());
- assertNotNull(conversionValues.next());
- assertFalse(conversionValues.hasNext());
- }
-
- public void testConversionValues3() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
-
- assertEquals(2, converter.getConversionValuesSize());
- ListIterator<EclipseLinkConversionValueAnnotation> conversionValues = converter.getConversionValues().iterator();
- EclipseLinkConversionValueAnnotation conversionValue = conversionValues.next();
- assertEquals("F", conversionValue.getDataValue());
- assertEquals("Female", conversionValue.getObjectValue());
- conversionValue = conversionValues.next();
- assertEquals("M", conversionValue.getDataValue());
- assertEquals("Male", conversionValue.getObjectValue());
- assertFalse(conversionValues.hasNext());
- }
-
- public void testAddConversionValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
-
- converter.addConversionValue(0).setObjectValue("FOO");
- converter.addConversionValue(1);
- converter.addConversionValue(0).setDataValue("BAR");
-
- assertEquals("BAR", converter.conversionValueAt(0).getDataValue());
- assertNull(converter.conversionValueAt(0).getObjectValue());
- assertEquals("FOO", converter.conversionValueAt(1).getObjectValue());
- assertNull(converter.conversionValueAt(1).getDataValue());
- assertNull(converter.conversionValueAt(2).getDataValue());
- assertNull(converter.conversionValueAt(2).getObjectValue());
-
- assertSourceContains("@ObjectTypeConverter(name = \"bar\", conversionValues = {@ConversionValue(dataValue = \"BAR\"),@ConversionValue(objectValue = \"FOO\"), @ConversionValue})", cu);
- }
-
- public void testRemoveConversionValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- converter.addConversionValue(0).setObjectValue("FOO");
-
- Iterator<EclipseLinkConversionValueAnnotation> conversionValues = converter.getConversionValues().iterator();
- assertEquals("FOO", conversionValues.next().getObjectValue());
- assertEquals("Female", conversionValues.next().getObjectValue());
- assertEquals("Male", conversionValues.next().getObjectValue());
- assertFalse(conversionValues.hasNext());
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
-
- converter.removeConversionValue(1);
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("FOO", conversionValues.next().getObjectValue());
- assertEquals("Male", conversionValues.next().getObjectValue());
- assertFalse(conversionValues.hasNext());
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
-
- converter.removeConversionValue(0);
- conversionValues = converter.getConversionValues().iterator();
- assertEquals("Male", conversionValues.next().getObjectValue());
- assertFalse(conversionValues.hasNext());
- assertSourceContains("@ObjectTypeConverter(conversionValues = @ConversionValue(dataValue = \"M\", objectValue = \"Male\"))", cu);
-
-
- converter.removeConversionValue(0);
- assertSourceDoesNotContain("@conversionValues", cu);
- assertSourceContains("@ObjectTypeConverter", cu);
- }
-
- public void testMoveConversionValue() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- converter.addConversionValue(0).setObjectValue("FOO");
-
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
-
- converter.moveConversionValue(2, 0);
- assertEquals("Female", converter.conversionValueAt(0).getObjectValue());
- assertEquals("F", converter.conversionValueAt(0).getDataValue());
- assertEquals("Male", converter.conversionValueAt(1).getObjectValue());
- assertEquals("M", converter.conversionValueAt(1).getDataValue());
- assertEquals("FOO", converter.conversionValueAt(2).getObjectValue());
- assertEquals(null, converter.conversionValueAt(2).getDataValue());
- assertEquals(3, converter.getConversionValuesSize());
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\"), @ConversionValue(objectValue = \"FOO\")})", cu);
- }
-
- public void testMoveConversionValue2() throws Exception {
- ICompilationUnit cu = this.createTestObjectTypeConverterWithConversionValues();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkObjectTypeConverterAnnotation converter = (EclipseLinkObjectTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.OBJECT_TYPE_CONVERTER);
- converter.addConversionValue(0).setObjectValue("FOO");
-
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"F\", objectValue = \"Female\"), @ConversionValue(dataValue = \"M\", objectValue = \"Male\")})", cu);
-
- converter.moveConversionValue(0, 2);
- assertEquals("Male", converter.conversionValueAt(0).getObjectValue());
- assertEquals("M", converter.conversionValueAt(0).getDataValue());
- assertEquals("FOO", converter.conversionValueAt(1).getObjectValue());
- assertEquals(null, converter.conversionValueAt(1).getDataValue());
- assertEquals("Female", converter.conversionValueAt(2).getObjectValue());
- assertEquals("F", converter.conversionValueAt(2).getDataValue());
- assertEquals(3, converter.getConversionValuesSize());
- assertSourceContains("@ObjectTypeConverter(conversionValues = {@ConversionValue(dataValue = \"M\", objectValue = \"Male\"), @ConversionValue(objectValue = \"FOO\"), @ConversionValue(dataValue = \"F\", objectValue = \"Female\")})", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java
deleted file mode 100644
index 7d8c6e83de..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/PrivateOwnedTests.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkPrivateOwnedAnnotation;
-
-@SuppressWarnings("nls")
-public class PrivateOwnedTests extends EclipseLinkJavaResourceModelTestCase {
-
- public PrivateOwnedTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestPrivateOwned() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.PRIVATE_OWNED);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@PrivateOwned");
- }
- });
- }
-
- public void testPrivateOwned() throws Exception {
- ICompilationUnit cu = this.createTestPrivateOwned();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkPrivateOwnedAnnotation privateOwned = (EclipseLinkPrivateOwnedAnnotation) resourceField.getAnnotation(EclipseLink.PRIVATE_OWNED);
- assertNotNull(privateOwned);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java
deleted file mode 100644
index 891f59cad2..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadOnlyTests.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadOnlyAnnotation;
-
-@SuppressWarnings("nls")
-public class ReadOnlyTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ReadOnlyTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestReadOnly() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.READ_ONLY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@ReadOnly");
- }
- });
- }
-
- public void testReadOnly() throws Exception {
- ICompilationUnit cu = this.createTestReadOnly();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkReadOnlyAnnotation readOnly = (EclipseLinkReadOnlyAnnotation) resourceType.getAnnotation(EclipseLink.READ_ONLY);
- assertNotNull(readOnly);
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java
deleted file mode 100644
index eab652b39a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/ReadTransformerAnnotationTests.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkReadTransformerAnnotation;
-
-@SuppressWarnings("nls")
-public class ReadTransformerAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public ReadTransformerAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestReadTransformer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.READ_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ReadTransformer");
- }
- });
- }
-
- private ICompilationUnit createTestReadTransformerWithTransformerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.READ_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ReadTransformer(transformerClass=Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestReadTransformerWithMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.READ_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@ReadTransformer(method=\"transformerMethod\")");
- }
- });
- }
-
- public void testReadTransformerAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER));
-
- resourceField.removeAnnotation(EclipseLink.READ_TRANSFORMER) ;
- assertNull(resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER));
-
- resourceField.addAnnotation(EclipseLink.READ_TRANSFORMER);
- assertNotNull(resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER));
- }
-
- public void testGetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("Foo", readTransformer.getTransformerClass());
- }
-
- public void testSetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("Foo", readTransformer.getTransformerClass());
-
- readTransformer.setTransformerClass("Bar");
- assertEquals("Bar", readTransformer.getTransformerClass());
-
- assertSourceContains("@ReadTransformer(transformerClass=Bar.class)", cu);
- }
-
- public void testSetTransformerClassNull() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("Foo", readTransformer.getTransformerClass());
-
- readTransformer.setTransformerClass(null);
- assertNull(readTransformer.getTransformerClass());
-
- assertSourceContains("@ReadTransformer", cu);
- assertSourceDoesNotContain("transformerClass", cu);
- }
-
- public void testGetMethod() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("transformerMethod", readTransformer.getMethod());
- }
-
- public void testSetMethod() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("transformerMethod", readTransformer.getMethod());
-
- readTransformer.setMethod("foo");
- assertEquals("foo", readTransformer.getMethod());
-
- assertSourceContains("@ReadTransformer(method=\"foo\")", cu);
- }
-
- public void testSetMethodNull() throws Exception {
- ICompilationUnit cu = this.createTestReadTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkReadTransformerAnnotation readTransformer = (EclipseLinkReadTransformerAnnotation) resourceField.getAnnotation(EclipseLink.READ_TRANSFORMER);
- assertEquals("transformerMethod", readTransformer.getMethod());
-
- readTransformer.setMethod(null);
- assertNull(readTransformer.getMethod());
-
- assertSourceContains("@ReadTransformer", cu);
- assertSourceDoesNotContain("method", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java
deleted file mode 100644
index e27aa9a0ec..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/StructConverterAnnotationTests.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkStructConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class StructConverterAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public StructConverterAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestStructConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@StructConverter");
- }
- });
- }
-
- private ICompilationUnit createTestStructConverterWithConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@StructConverter(converter=\"Foo\")");
- }
- });
- }
-
- private ICompilationUnit createTestStructConverterWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.STRUCT_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@StructConverter(name=\"bar\")");
- }
- });
- }
-
- public void testStructConverterAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestStructConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(0, EclipseLink.STRUCT_CONVERTER));
-
- resourceField.removeAnnotation(0, EclipseLink.STRUCT_CONVERTER);
- assertNull(resourceField.getAnnotation(0, EclipseLink.STRUCT_CONVERTER));
-
- resourceField.addAnnotation(0, EclipseLink.STRUCT_CONVERTER);
- assertNotNull(resourceField.getAnnotation(0, EclipseLink.STRUCT_CONVERTER));
- }
-
- public void testGetConverter() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.STRUCT_CONVERTER);
- assertEquals("Foo", converter.getConverter());
- }
-
- public void testSetConverter() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.STRUCT_CONVERTER);
- assertEquals("Foo", converter.getConverter());
-
- converter.setConverter("Bar");
- assertEquals("Bar", converter.getConverter());
-
- assertSourceContains("@StructConverter(converter=\"Bar\")", cu);
- }
-
- public void testSetConverterNull() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.STRUCT_CONVERTER);
- assertEquals("Foo", converter.getConverter());
-
- converter.setConverter(null);
- assertNull(converter.getConverter());
-
- assertSourceContains("@StructConverter", cu);
- assertSourceDoesNotContain("converter", cu);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.STRUCT_CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.STRUCT_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName("foo");
- assertEquals("foo", converter.getName());
-
- assertSourceContains("@StructConverter(name=\"foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestStructConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkStructConverterAnnotation converter = (EclipseLinkStructConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.STRUCT_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName(null);
- assertNull(converter.getName());
-
- assertSourceContains("@StructConverter", cu);
- assertSourceDoesNotContain("name=", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java
deleted file mode 100644
index 6df2ccd4c1..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TimeOfDayTests.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkCacheAnnotation;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTimeOfDayAnnotation;
-
-@SuppressWarnings("nls")
-public class TimeOfDayTests extends EclipseLinkJavaResourceModelTestCase {
-
- public TimeOfDayTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTimeOfDay() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay)");
- }
- });
- }
-
- private ICompilationUnit createTestTimeOfDayWithHour() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay(hour=5))");
- }
- });
- }
-
- private ICompilationUnit createTestTimeOfDayWithMinute() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay(minute=5))");
- }
- });
- }
-
- private ICompilationUnit createTestTimeOfDayWithSecond() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay(second=5))");
- }
- });
- }
-
- private ICompilationUnit createTestTimeOfDayWithMillisecond() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.CACHE, EclipseLink.TIME_OF_DAY);
- }
- @Override
- public void appendTypeAnnotationTo(StringBuilder sb) {
- sb.append("@Cache(expiryTimeOfDay = @TimeOfDay(millisecond=5))");
- }
- });
- }
-
- public void testExpiryTimeOfDay() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDay();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
-
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
-
- assertNotNull(timeOfDay);
- }
-
- public void testGetHour() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithHour();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getHour());
- }
-
- public void testSetHour() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithHour();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getHour());
-
- timeOfDay.setHour(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), timeOfDay.getHour());
-
- assertSourceContains("@TimeOfDay(hour=80)", cu);
-
- timeOfDay.setHour(null);
- assertNull(timeOfDay.getHour());
-
- assertSourceDoesNotContain("(hour=80)", cu);
- assertSourceContains("@TimeOfDay", cu);
- }
-
- public void testGetMinute() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMinute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMinute());
- }
-
- public void testSetMinute() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMinute();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMinute());
-
- timeOfDay.setMinute(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), timeOfDay.getMinute());
-
- assertSourceContains("@TimeOfDay(minute=80)", cu);
-
- timeOfDay.setMinute(null);
- assertNull(timeOfDay.getMinute());
-
- assertSourceDoesNotContain("(minute=80)", cu);
- assertSourceContains("@TimeOfDay", cu);
- }
-
- public void testGetSecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithSecond();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getSecond());
- }
-
- public void testSetSecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithSecond();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getSecond());
-
- timeOfDay.setSecond(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), timeOfDay.getSecond());
-
- assertSourceContains("@TimeOfDay(second=80)", cu);
-
- timeOfDay.setSecond(null);
- assertNull(timeOfDay.getSecond());
-
- assertSourceDoesNotContain("(second=80)", cu);
- assertSourceContains("@TimeOfDay", cu);
- }
-
- public void testGetMillisecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMillisecond();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMillisecond());
- }
-
- public void testSetMillisecond() throws Exception {
- ICompilationUnit cu = this.createTestTimeOfDayWithMillisecond();
- JavaResourceType resourceType = buildJavaResourceType(cu);
-
- EclipseLinkCacheAnnotation cache = (EclipseLinkCacheAnnotation) resourceType.getAnnotation(EclipseLink.CACHE);
- EclipseLinkTimeOfDayAnnotation timeOfDay = cache.getExpiryTimeOfDay();
- assertEquals(Integer.valueOf(5), timeOfDay.getMillisecond());
-
- timeOfDay.setMillisecond(Integer.valueOf(80));
- assertEquals(Integer.valueOf(80), timeOfDay.getMillisecond());
-
- assertSourceContains("@TimeOfDay(millisecond=80)", cu);
-
- timeOfDay.setMillisecond(null);
- assertNull(timeOfDay.getMillisecond());
-
- assertSourceDoesNotContain("(millisecond=80)", cu);
- assertSourceContains("@TimeOfDay", cu);
- }
-
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java
deleted file mode 100644
index 9d34d0fd95..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TransformationAnnotationTests.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterables.EmptyIterable;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.FetchType;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTransformationAnnotation;
-
-@SuppressWarnings("nls")
-public class TransformationAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public TransformationAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTransformation() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TRANSFORMATION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transformation");
- }
- });
- }
-
- private ICompilationUnit createTestTransformationWithOptional() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TRANSFORMATION);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transformation(optional = true)");
- }
- });
- }
-
- private ICompilationUnit createTestTransformationWithFetch() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TRANSFORMATION, JPA.FETCH_TYPE);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@Transformation(fetch = FetchType.EAGER)");
- }
- });
- }
-
- public void testTransformationAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestTransformation();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.TRANSFORMATION));
-
- resourceField.setPrimaryAnnotation(null, EmptyIterable.<String>instance());
- assertNull(resourceField.getAnnotation(EclipseLink.TRANSFORMATION));
-
- resourceField.setPrimaryAnnotation(EclipseLink.TRANSFORMATION, EmptyIterable.<String>instance());
- assertNotNull(resourceField.getAnnotation(EclipseLink.TRANSFORMATION));
- }
-
- public void testGetOptional() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(Boolean.TRUE, transformation.getOptional());
- }
-
- public void testSetOptional() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(Boolean.TRUE, transformation.getOptional());
-
- transformation.setOptional(Boolean.FALSE);
- assertEquals(Boolean.FALSE, transformation.getOptional());
-
- assertSourceContains("@Transformation(optional = false)", cu);
- }
-
- public void testSetOptionalNull() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithOptional();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(Boolean.TRUE, transformation.getOptional());
-
- transformation.setOptional(null);
- assertNull(transformation.getOptional());
-
- assertSourceContains("@Transformation", cu);
- assertSourceDoesNotContain("optional", cu);
- }
-
- public void testGetFetch() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(FetchType.EAGER, transformation.getFetch());
- }
-
- public void testSetFetch() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(FetchType.EAGER, transformation.getFetch());
-
- transformation.setFetch(FetchType.LAZY);
- assertEquals(FetchType.LAZY, transformation.getFetch());
-
- assertSourceContains("@Transformation(fetch = LAZY)", cu);
- }
-
- public void testSetFetchNull() throws Exception {
- ICompilationUnit cu = this.createTestTransformationWithFetch();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTransformationAnnotation transformation = (EclipseLinkTransformationAnnotation) resourceField.getAnnotation(EclipseLink.TRANSFORMATION);
- assertEquals(FetchType.EAGER, transformation.getFetch());
-
- transformation.setFetch(null);
- assertNull(transformation.getFetch());
-
- assertSourceContains("@Transformation", cu);
- assertSourceDoesNotContain("fetch", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java
deleted file mode 100644
index efa87ff5b3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/TypeConverterAnnotationTests.java
+++ /dev/null
@@ -1,215 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkTypeConverterAnnotation;
-
-@SuppressWarnings("nls")
-public class TypeConverterAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public TypeConverterAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestTypeConverter() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TypeConverter");
- }
- });
- }
-
- private ICompilationUnit createTestTypeConverterWithDataType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TypeConverter(dataType = Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestTypeConverterWithObjectType() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TypeConverter(objectType = Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestTypeConverterWithName() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.TYPE_CONVERTER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@TypeConverter(name = \"bar\")");
- }
- });
- }
-
- public void testTypeConverterAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverter();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER));
-
- resourceField.removeAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertNull(resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER));
-
- resourceField.addAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertNotNull(resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER));
- }
-
- public void testGetTypeDataType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
- }
-
- public void testSetDataType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType("Bar");
- assertEquals("Bar", converter.getDataType());
-
- assertSourceContains("@TypeConverter(dataType = Bar.class)", cu);
-
- converter.setDataType("int");
- assertEquals("int", converter.getDataType());
- assertSourceContains("@TypeConverter(dataType = int.class)", cu);
- }
-
- public void testSetDataTypeNull() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithDataType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getDataType());
-
- converter.setDataType(null);
- assertNull(converter.getDataType());
-
- assertSourceContains("@TypeConverter", cu);
- assertSourceDoesNotContain("dataType", cu);
- }
-
- public void testGetTypeObjectType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
- }
-
- public void testSetObjectType() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType("Bar");
- assertEquals("Bar", converter.getObjectType());
-
- assertSourceContains("@TypeConverter(objectType = Bar.class)", cu);
-
- converter.setObjectType("int");
- assertEquals("int", converter.getObjectType());
- assertSourceContains("@TypeConverter(objectType = int.class)", cu);
- }
-
- public void testSetObjectTypeNull() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithObjectType();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertEquals("Foo", converter.getObjectType());
-
- converter.setObjectType(null);
- assertNull(converter.getObjectType());
-
- assertSourceContains("@TypeConverter", cu);
- assertSourceDoesNotContain("objectType", cu);
- }
-
- public void testGetName() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
- }
-
- public void testSetName() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName("foo");
- assertEquals("foo", converter.getName());
-
- assertSourceContains("@TypeConverter(name = \"foo\")", cu);
- }
-
- public void testSetNameNull() throws Exception {
- ICompilationUnit cu = this.createTestTypeConverterWithName();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkTypeConverterAnnotation converter = (EclipseLinkTypeConverterAnnotation) resourceField.getAnnotation(0, EclipseLink.TYPE_CONVERTER);
- assertEquals("bar", converter.getName());
-
- converter.setName(null);
- assertNull(converter.getName());
-
- assertSourceContains("@TypeConverter", cu);
- assertSourceDoesNotContain("name=", cu);
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java
deleted file mode 100644
index e82c8f54f5..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/src/org/eclipse/jpt/jpa/eclipselink/core/tests/internal/resource/java/WriteTransformerAnnotationTests.java
+++ /dev/null
@@ -1,220 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2011 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.java;
-
-import java.util.Iterator;
-import org.eclipse.jdt.core.ICompilationUnit;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceField;
-import org.eclipse.jpt.common.core.resource.java.JavaResourceType;
-import org.eclipse.jpt.common.utility.internal.CollectionTools;
-import org.eclipse.jpt.common.utility.internal.iterators.ArrayIterator;
-import org.eclipse.jpt.jpa.core.resource.java.JPA;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLink;
-import org.eclipse.jpt.jpa.eclipselink.core.resource.java.EclipseLinkWriteTransformerAnnotation;
-
-@SuppressWarnings("nls")
-public class WriteTransformerAnnotationTests extends EclipseLinkJavaResourceModelTestCase {
-
- public WriteTransformerAnnotationTests(String name) {
- super(name);
- }
-
- private ICompilationUnit createTestWriteTransformer() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.WRITE_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@WriteTransformer");
- }
- });
- }
-
- private ICompilationUnit createTestWriteTransformerWithTransformerClass() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.WRITE_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@WriteTransformer(transformerClass = Foo.class)");
- }
- });
- }
-
- private ICompilationUnit createTestWriteTransformerWithMethod() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.WRITE_TRANSFORMER);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@WriteTransformer(method = \"transformerMethod\")");
- }
- });
- }
-
- private ICompilationUnit createTestWriteTransformerWithColumn() throws Exception {
- return this.createTestType(new DefaultAnnotationWriter() {
- @Override
- public Iterator<String> imports() {
- return new ArrayIterator<String>(EclipseLink.WRITE_TRANSFORMER, JPA.COLUMN);
- }
- @Override
- public void appendIdFieldAnnotationTo(StringBuilder sb) {
- sb.append("@WriteTransformer(column = @Column(name = \"FOO\"))");
- }
- });
- }
-
-
- public void testWriteTransformerAnnotation() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformer();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- assertNotNull(resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER));
-
- resourceField.removeAnnotation(EclipseLink.WRITE_TRANSFORMER) ;
- assertNull(resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER));
-
- resourceField.addAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNotNull(resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER));
- }
-
- public void testGetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("Foo", writeTransformer.getTransformerClass());
- }
-
- public void testSetTransformerClass() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("Foo", writeTransformer.getTransformerClass());
-
- writeTransformer.setTransformerClass("Bar");
- assertEquals("Bar", writeTransformer.getTransformerClass());
-
- assertSourceContains("@WriteTransformer(transformerClass = Bar.class)", cu);
- }
-
- public void testSetTransformerClassNull() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithTransformerClass();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("Foo", writeTransformer.getTransformerClass());
-
- writeTransformer.setTransformerClass(null);
- assertNull(writeTransformer.getTransformerClass());
-
- assertSourceContains("@WriteTransformer", cu);
- assertSourceDoesNotContain("transformerClass", cu);
- }
-
- public void testGetMethod() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("transformerMethod", writeTransformer.getMethod());
- }
-
- public void testSetMethod() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("transformerMethod", writeTransformer.getMethod());
-
- writeTransformer.setMethod("foo");
- assertEquals("foo", writeTransformer.getMethod());
-
- assertSourceContains("@WriteTransformer(method = \"foo\")", cu);
- }
-
- public void testSetMethodNull() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertEquals("transformerMethod", writeTransformer.getMethod());
-
- writeTransformer.setMethod(null);
- assertNull(writeTransformer.getMethod());
-
- assertSourceContains("@WriteTransformer", cu);
- assertSourceDoesNotContain("method", cu);
- }
-
-
- public void testGetColumn() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNotNull(writeTransformer.getColumn());
- assertEquals("FOO", writeTransformer.getColumn().getName());
- }
-
- public void testAddColumn() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithMethod();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNull(writeTransformer.getColumn());
-
- writeTransformer.addColumn();
-
- assertNotNull(writeTransformer.getColumn());
- assertSourceContains("@WriteTransformer(method = \"transformerMethod\", column = @Column)", cu);
-
- writeTransformer.getColumn().setName("BAR");
- assertSourceContains("@WriteTransformer(method = \"transformerMethod\", column = @Column(name = \"BAR\"))", cu);
-
- }
-
- public void testRemoveColumn() throws Exception {
- ICompilationUnit cu = this.createTestWriteTransformerWithColumn();
- JavaResourceType resourceType = buildJavaResourceType(cu);
- JavaResourceField resourceField = CollectionTools.get(resourceType.getFields(), 0);
-
- EclipseLinkWriteTransformerAnnotation writeTransformer = (EclipseLinkWriteTransformerAnnotation) resourceField.getAnnotation(EclipseLink.WRITE_TRANSFORMER);
- assertNotNull(writeTransformer.getColumn());
- assertEquals("FOO", writeTransformer.getColumn().getName());
-
- writeTransformer.removeColumn();
- assertNull(writeTransformer.getColumn());
-
- assertSourceContains("@WriteTransformer", cu);
- assertSourceDoesNotContain("column", cu);
- }
-
- public void getNonNullColumn() throws Exception {
-
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml b/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml
deleted file mode 100644
index b76008604b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.eclipselink.core.tests/test.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?> <!--
- Copyright (c) 2008, 2010 Oracle. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0, which accompanies this distribution and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: Oracle - initial API and implementation -->
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jpa.eclipselink.core.tests"/>
- <echo level="debug" message="testRoot: ${testRoot}" />
- <fail message="testRoot must be set" unless="testRoot" />
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite1">
- <property file="${testRoot}/testServer.properties"/>
- <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/>
- <delete dir="${jpt-folder}" quiet="true"/>
-
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${jpt-folder}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.jpa.eclipselink.core.tests.internal.resource.JptJpaEclipselinkCoreResourceModelTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/>
- </ant>
- </target>
- <target name="suite2"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.eclipselink.core.tests.internal.context.JptJpaEclipseLinkCoreContextModelTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/> </ant> </target> <target name="suite3"> <property file="${testRoot}/testServer.properties"/> <property name="jpt-folder" value="${eclipse-home}/jpt_folder"/> <delete dir="${jpt-folder}" quiet="true"/> <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}"> <property name="data-dir" value="${jpt-folder}"/> <property name="plugin-name" value="${plugin-name}"/> <property name="classname" value="org.eclipse.jpt.jpa.eclipselink.core.tests.internal.metadata.JptJpaEclipseLinkCoreMetadataTests" /> <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/> <property name="extraVMargs" value="-Dorg.eclipse.jpt.jpa.jar=${testDir}/${jpt-persistence-jar} -Dorg.eclipse.jpt.eclipselink.jar=${testDir}/${jpt-eclipselink-jar}"/> </ant> </target>
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite1, suite2, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.classpath
deleted file mode 100644
index a6a514e2d3..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.classpath
+++ /dev/null
@@ -1,11 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/gen/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.project
deleted file mode 100644
index b68577b671..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.gen.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index 58eaebea70..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:38 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index d666f3ae1a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,14 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.gen.tests
-Bundle-Version: 3.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle: org.eclipse.core.runtime;bundle-version="3.4.0",
- org.eclipse.jdt.core;bundle-version="3.4.0",
- org.eclipse.jpt.common.utility;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.db;bundle-version="[2.0.0,3.0.0)",
- org.eclipse.jpt.jpa.gen;bundle-version="[2.0.0,3.0.0)",
- org.junit;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jpt.jpa.gen.tests.internal;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/about.html b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/about.html
deleted file mode 100644
index be534ba44f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/about.html
+++ /dev/null
@@ -1,34 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
-<HTML>
-
-<head>
-<title>About</title>
-<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
-</head>
-
-<BODY lang="EN-US">
-
-<H3>About This Content</H3>
-
-<P>May 02, 2008</P>
-
-<H3>License</H3>
-
-<P>The Eclipse Foundation makes available all content in this plug-in
-("Content"). Unless otherwise indicated below, the Content is provided to you
-under the terms and conditions of the Eclipse Public License Version 1.0
-("EPL"). A copy of the EPL is available at
-<A href="http://www.eclipse.org/org/documents/epl-v10.php">http://www.eclipse.org/org/documents/epl-v10.php</A>.
-For purposes of the EPL, "Program" will mean the Content.</P>
-
-<P>If you did not receive this Content directly from the Eclipse Foundation, the
-Content is being redistributed by another party ("Redistributor") and different
-terms and conditions may apply to your use of any object code in the Content.
-Check the Redistributor's license that was provided with the Content. If no such
-license exists, contact the Redistributor. Unless otherwise indicated below, the
-terms and conditions of the EPL still apply to any source code in the Content
-and such source code may be obtained at
-<A href="http://www.eclipse.org/">http://www.eclipse.org/</A>.</P>
-
-</BODY>
-</HTML>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/build.properties
deleted file mode 100644
index 0473587c2b..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/build.properties
+++ /dev/null
@@ -1,16 +0,0 @@
-################################################################################
-# Copyright (c) 2008, 2011 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-bin.includes = .,\
- META-INF/,\
- about.html,\
- test.xml,\
- plugin.properties
-source.. = src/
-output.. = bin/
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/plugin.properties
deleted file mode 100644
index f81a674adc..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Java Persistence Tools Entity Generation Tests
-providerName=Eclipse.org
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/EntityGenToolsTests.java b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/EntityGenToolsTests.java
deleted file mode 100644
index 25e870f97a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/EntityGenToolsTests.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008, 2010 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.tests.internal;
-
-import java.util.HashSet;
-import org.eclipse.jpt.jpa.gen.internal.util.EntityGenTools;
-
-import junit.framework.TestCase;
-
-/**
- *
- */
-@SuppressWarnings("nls")
-public class EntityGenToolsTests extends TestCase {
-
- public EntityGenToolsTests(String name) {
- super(name);
- }
-
- public void testConvertToUniqueJavaStyleClassName1() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("Foo", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("foo", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("FOO", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_", names));
- assertEquals("Foo", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO", names));
- assertEquals("Foo_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleClassName("5oo", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName2() {
- HashSet<String> names = new HashSet<String>();
- names.add("Foo");
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("Foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO", names));
- assertEquals("Foo_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleClassName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName3() {
- HashSet<String> names = new HashSet<String>();
- names.add("foo");
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("Foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("foo", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_", names));
- assertEquals("Foo2", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO", names));
- assertEquals("Foo_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleClassName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName4() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("FooBar", names));
- assertEquals("Foo_bar", EntityGenTools.convertToUniqueJavaStyleClassName("foo_bar", names));
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR", names));
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO_BAR", names));
- assertEquals("FooBar", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_", names));
- assertEquals("FooBar_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleClassName("4FOO_BAR", names));
- }
-
- public void testConvertToUniqueJavaStyleClassName5() {
- HashSet<String> names = new HashSet<String>();
- names.add("FooBar");
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("FooBar", names));
- assertEquals("Foo_bar", EntityGenTools.convertToUniqueJavaStyleClassName("foo_bar", names));
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR", names));
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("_FOO_BAR", names));
- assertEquals("FooBar2", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_", names));
- assertEquals("FooBar_", EntityGenTools.convertToUniqueJavaStyleClassName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleClassName("4FOO_BAR", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName1() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("Foo", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_", names));
- assertEquals("foo", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO", names));
- assertEquals("foo_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleAttributeName("5oo", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName2() {
- HashSet<String> names = new HashSet<String>();
- names.add("Foo");
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("Foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO", names));
- assertEquals("foo_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleAttributeName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName3() {
- HashSet<String> names = new HashSet<String>();
- names.add("foo");
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("Foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_", names));
- assertEquals("foo2", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO", names));
- assertEquals("foo_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO*", names));
- assertEquals("_oo", EntityGenTools.convertToUniqueJavaStyleAttributeName("5OO", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName4() {
- HashSet<String> names = new HashSet<String>();
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("FooBar", names));
- assertEquals("foo_bar", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo_bar", names));
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR", names));
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO_BAR", names));
- assertEquals("fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_", names));
- assertEquals("fooBar_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("4FOO_BAR", names));
- }
-
- public void testConvertToUniqueJavaStyleAttributeName5() {
- HashSet<String> names = new HashSet<String>();
- names.add("FooBar");
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FooBar", names));
- assertEquals("foo_bar", EntityGenTools.convertToUniqueJavaStyleAttributeName("foo_bar", names));
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR", names));
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("_FOO_BAR", names));
- assertEquals("fooBar2", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_", names));
- assertEquals("fooBar_", EntityGenTools.convertToUniqueJavaStyleAttributeName("FOO_BAR_*", names));
- assertEquals("_fooBar", EntityGenTools.convertToUniqueJavaStyleAttributeName("4FOO_BAR", names));
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/JptJpaGenTests.java b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/JptJpaGenTests.java
deleted file mode 100644
index 530dd84d72..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/src/org/eclipse/jpt/jpa/gen/tests/internal/JptJpaGenTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.gen.tests.internal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.gen.tests.internal.EntityGenToolsTests;
-
-/**
- *
- */
-public class JptJpaGenTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite("JPT Entity Generation Tests"); //$NON-NLS-1$
- suite.addTestSuite(EntityGenToolsTests.class);
- return suite;
- }
-
- private JptJpaGenTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/test.xml b/jpa/tests/org.eclipse.jpt.jpa.gen.tests/test.xml
deleted file mode 100644
index 40a027f14a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.gen.tests/test.xml
+++ /dev/null
@@ -1,49 +0,0 @@
-<?xml version="1.0"?>
-<!--
- Copyright (c) 2008, 2010 Oracle. All rights reserved.
- This program and the accompanying materials are made available under the
- terms of the Eclipse Public License v1.0, which accompanies this distribution
- and is available at http://www.eclipse.org/legal/epl-v10.html.
-
- Contributors:
- Oracle - initial API and implementation
- -->
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <echo message="basedir ${basedir}" />
- <echo message="eclipse place ${eclipse-home}" />
- <!-- sets the properties plugin-name -->
- <property name="plugin-name" value="org.eclipse.jpt.jpa.gen.tests"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <ant target="gen-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.jpt.jpa.gen.tests.internal.JptJpaGenTests" />
- <property name="plugin-path" value="${eclipse-home}/plugins/${plugin-name}"/>
- <property name="extraVMargs" value=""/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init, suite, cleanup">
- </target>
-</project> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.classpath b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.classpath
deleted file mode 100644
index 516ebfb5b7..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.classpath
+++ /dev/null
@@ -1,14 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins">
- <accessrules>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/ui/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/jpa/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/core/**"/>
- <accessrule kind="accessible" pattern="org/eclipse/jpt/common/utility/**"/>
- </accessrules>
- </classpathentry>
- <classpathentry kind="output" path="bin"/>
-</classpath>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.cvsignore b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.cvsignore
deleted file mode 100644
index ba077a4031..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.project b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.project
deleted file mode 100644
index 9b0ee1fe12..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.jpa.ui.tests</name>
- <comment></comment>
- <projects>
- </projects>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.ManifestBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- <buildCommand>
- <name>org.eclipse.pde.SchemaBuilder</name>
- <arguments>
- </arguments>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.settings/org.eclipse.jdt.core.prefs b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.settings/org.eclipse.jdt.core.prefs
deleted file mode 100644
index bde70d36e8..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/.settings/org.eclipse.jdt.core.prefs
+++ /dev/null
@@ -1,12 +0,0 @@
-#Tue Mar 08 12:09:52 EST 2011
-eclipse.preferences.version=1
-org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
-org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
-org.eclipse.jdt.core.compiler.debug.lineNumber=generate
-org.eclipse.jdt.core.compiler.debug.localVariable=generate
-org.eclipse.jdt.core.compiler.debug.sourceFile=generate
-org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
-org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/META-INF/MANIFEST.MF b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/META-INF/MANIFEST.MF
deleted file mode 100644
index f0f41e0cdb..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,23 +0,0 @@
-Manifest-Version: 1.0
-Bundle-ManifestVersion: 2
-Bundle-Name: %pluginName
-Bundle-Vendor: %providerName
-Bundle-SymbolicName: org.eclipse.jpt.jpa.ui.tests
-Bundle-Version: 2.0.0.qualifier
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
-Require-Bundle:
- org.eclipse.core.resources,
- org.eclipse.core.runtime,
- org.eclipse.jface,
- org.eclipse.jpt.common.core.tests,
- org.eclipse.jpt.jpa.core.tests,
- org.eclipse.jpt.jpa.core.tests.extension.resource,
- org.eclipse.jpt.common.utility,
- org.eclipse.jpt.jpa.core,
- org.eclipse.jpt.jpa.ui,
- org.eclipse.ui.navigator;bundle-version="3.4.0",
- org.eclipse.ui.forms;bundle-version="3.3.100",
- org.eclipse.ui.workbench;bundle-version="3.4.0",
- org.junit;bundle-version="[4.0.0,5.0.0)"
-Export-Package: org.eclipse.jpt.jpa.ui.tests;x-internal:=true,
- org.eclipse.jpt.jpa.ui.tests.internal.platform;x-internal:=true
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/build.properties b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/build.properties
deleted file mode 100644
index 50f0aa3fd9..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/build.properties
+++ /dev/null
@@ -1,13 +0,0 @@
-################################################################################
-# Copyright (c) 2007, 2010 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-source.. = src/
-output.. = bin/
-bin.includes = META-INF/,\
- .
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/plugin.properties b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/plugin.properties
deleted file mode 100644
index ac887adeab..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/plugin.properties
+++ /dev/null
@@ -1,23 +0,0 @@
-################################################################################
-# Copyright (c) 2006, 2007 Oracle. All rights reserved.
-# This program and the accompanying materials are made available under the
-# terms of the Eclipse Public License v1.0, which accompanies this distribution
-# and is available at http://www.eclipse.org/legal/epl-v10.html.
-#
-# Contributors:
-# Oracle - initial API and implementation
-################################################################################
-# ====================================================================
-# To code developer:
-# Do NOT change the properties between this line and the
-# "%%% END OF TRANSLATED PROPERTIES %%%" line.
-# Make a new property name, append to the end of the file and change
-# the code to use the new property.
-# ====================================================================
-
-# ====================================================================
-# %%% END OF TRANSLATED PROPERTIES %%%
-# ====================================================================
-
-pluginName=Dali Java Persistence Tools - UI Tests
-providerName=Eclipse Web Tools Platform
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/JptUiTests.java b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/JptUiTests.java
deleted file mode 100644
index d52779117a..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/JptUiTests.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2006, 2008 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import org.eclipse.jpt.jpa.ui.tests.internal.platform.JptUiPlatformTests;
-
-/**
- * Runs all JPT UI Tests
- */
-public class JptUiTests {
-
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUiTests.class.getPackage().getName());
- suite.addTest(JptUiPlatformTests.suite());
- return suite;
- }
-
- private JptUiTests() {
- super();
- throw new UnsupportedOperationException();
- }
-
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
deleted file mode 100644
index ea60afa47f..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JpaPlatformUiExtensionTests.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2010 Oracle.
- * All rights reserved. This program and the accompanying materials are
- * made available under the terms of the Eclipse Public License v1.0 which
- * accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * Oracle - initial API and implementation
- *******************************************************************************/
-package org.eclipse.jpt.jpa.ui.tests.internal.platform;
-
-import junit.framework.TestCase;
-import org.eclipse.jpt.jpa.core.JpaProject;
-import org.eclipse.jpt.jpa.core.internal.platform.JpaPlatformManagerImpl;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.ExtensionTestPlugin;
-import org.eclipse.jpt.jpa.core.tests.extension.resource.TestJpaPlatformProvider;
-import org.eclipse.jpt.jpa.core.tests.internal.projects.TestJpaProject;
-
-@SuppressWarnings("nls")
-public class JpaPlatformUiExtensionTests extends TestCase
-{
- protected TestJpaProject testProject;
-
- protected static final String PROJECT_NAME = "ExtensionTestProject";
- protected static final String PACKAGE_NAME = "extension.test";
-
- public static final String TEST_PLUGIN_CLASS = ExtensionTestPlugin.class.getName();
- public static final String TEST_PLUGIN_ID = ExtensionTestPlugin.PLUGIN_ID;
-
- public static final String TEST_PLATFORM_ID = TestJpaPlatformProvider.ID;
- public static final String TEST_PLATFORM_CLASS = TestJpaPlatformProvider.class.getName();
- public static final String TEST_PLATFORM_LABEL = "Test Jpa Platform";
-
- public static final String TEST_UI_PLATFORM_ID = TEST_PLATFORM_ID;
-
- public JpaPlatformUiExtensionTests(String name) {
- super(name);
- }
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- this.testProject = this.buildJpaProject(PROJECT_NAME, false); // false = no auto-build
- }
-
- protected TestJpaProject buildJpaProject(String projectName, boolean autoBuild) throws Exception {
- return new TestJpaProject(projectName, autoBuild); // false = no auto-build
- }
-
- @Override
- protected void tearDown() throws Exception {
- this.testProject.getProject().delete(true, true, null);
- this.testProject = null;
- super.tearDown();
- }
-
- protected JpaProject jpaProject() {
- return this.testProject.getJpaProject();
- }
-
- public void testJpaPlatform() {
- assertNotNull(JpaPlatformManagerImpl.instance().buildJpaPlatformImplementation(this.testProject.getProject()));
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JptUiPlatformTests.java b/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JptUiPlatformTests.java
deleted file mode 100644
index abd6960a2c..0000000000
--- a/jpa/tests/org.eclipse.jpt.jpa.ui.tests/src/org/eclipse/jpt/jpa/ui/tests/internal/platform/JptUiPlatformTests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2007 Oracle. All rights reserved.
- * This program and the accompanying materials are made available under the
- * terms of the Eclipse Public License v1.0, which accompanies this distribution
- * and is available at http://www.eclipse.org/legal/epl-v10.html.
- *
- * Contributors:
- * Oracle - initial API and implementation
- ******************************************************************************/
-package org.eclipse.jpt.jpa.ui.tests.internal.platform;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class JptUiPlatformTests
-{
- public static Test suite() {
- TestSuite suite = new TestSuite(JptUiPlatformTests.class.getPackage().getName());
- suite.addTestSuite(JpaPlatformUiExtensionTests.class);
- return suite;
- }
-
- private JptUiPlatformTests() {
- super();
- throw new UnsupportedOperationException();
- }
-}
diff --git a/jpa/tests/org.eclipse.jpt.ui.tests/.project b/jpa/tests/org.eclipse.jpt.ui.tests/.project
deleted file mode 100644
index ab9bd7f596..0000000000
--- a/jpa/tests/org.eclipse.jpt.ui.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.ui.tests</name>
- <comment>renamed to org.eclipse.jpt.jpa.ui.tests</comment>
-</projectDescription> \ No newline at end of file
diff --git a/jpa/tests/org.eclipse.jpt.utility.tests/.project b/jpa/tests/org.eclipse.jpt.utility.tests/.project
deleted file mode 100644
index c371e9a48f..0000000000
--- a/jpa/tests/org.eclipse.jpt.utility.tests/.project
+++ /dev/null
@@ -1,5 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.jpt.utility.tests</name>
- <comment>renamed to org.eclipse.jpt.common.utility.tests and moved to common component</comment>
-</projectDescription>

Back to the top